From 560f5a873e69ab7cfa4d75799f07c55004448ea2 Mon Sep 17 00:00:00 2001 From: eperdew Date: Sun, 26 Sep 2021 05:04:12 -0700 Subject: [PATCH] Decompile E225B0.c. (#434) * Decompile E225B0.c. * Decompile EB5130.c. * Fix an off-by-one error that did not affect codegen. The struct declared in EB5130.c was missing a byte in a char array for no good reason. * Address ethteck's feedback for PR#434. - Move struct8015A578 to common_structs.h. - Add new unknown sound SOUND_UNKNOWN_17B. - Address various nits. * Update PR based on @nanaian's feedback. - Change first argument of mem_clear to be a void* (matching bzero). --- include/common_structs.h | 9 + include/enums.h | 1 + include/functions.h | 2 +- src/43F0.c | 6 +- src/E225B0.c | 185 ++++++++++++++++- src/EB5130.c | 7 +- src/world/action/super_boots.c | 6 - src/world/action/ultra_boots.c | 6 - .../E225B0/func_802B7000_E225B0.s | 193 ------------------ .../E225B0/func_802B72C0_E22870.s | 43 ---- .../E225B0/func_802B735C_E2290C.s | 152 -------------- .../EB5130/func_8024030C_EB543C.s | 17 -- 12 files changed, 203 insertions(+), 424 deletions(-) delete mode 100644 ver/us/asm/nonmatchings/E225B0/func_802B7000_E225B0.s delete mode 100644 ver/us/asm/nonmatchings/E225B0/func_802B72C0_E22870.s delete mode 100644 ver/us/asm/nonmatchings/E225B0/func_802B735C_E2290C.s delete mode 100644 ver/us/asm/nonmatchings/EB5130/func_8024030C_EB543C.s diff --git a/include/common_structs.h b/include/common_structs.h index bcb45fc52e..697a93c047 100644 --- a/include/common_structs.h +++ b/include/common_structs.h @@ -2317,4 +2317,13 @@ typedef struct unkPartnerStruct { /* 0x014 */ f32 unk_14; /* 0x018 */ f32 unk_18; } unkPartnerStruct; // size = 0x1C + +typedef struct struct8015A578 { + /* 0x00 */ u8 unk_00; + /* 0x01 */ u8 unk_01; + /* 0x02 */ u8 unk_02; + /* 0x03 */ u8 unk_03[5]; + /* 0x08 */ f32 unk_08; +} struct8015A578; // size = 0x0C + #endif diff --git a/include/enums.h b/include/enums.h index 329a380e82..c6103ec5a1 100644 --- a/include/enums.h +++ b/include/enums.h @@ -531,6 +531,7 @@ enum SoundIDs { SOUND_SMASH_GOOMNUT_TREE = 357, SOUND_UNKNOWN_167 = 359, SOUND_UNKNOWN_172 = 370, + SOUND_UNKNOWN_17B = 379, SOUND_BASIC_DOOR_OPEN = 449, SOUND_BASIC_DOOR_CLOSE, SOUND_METAL_DOOR_OPEN, diff --git a/include/functions.h b/include/functions.h index bc873f32be..e755d82a18 100644 --- a/include/functions.h +++ b/include/functions.h @@ -203,7 +203,7 @@ s32 test_ray_colliders(s32 ignoreFlags, f32 startX, f32 startY, f32 startZ, f32 s32 test_ray_entities(f32 startX, f32 startY, f32 startZ, f32 dirX, f32 dirY, f32 dirZ, f32* hitX, f32* hitY, f32* hitZ, f32* hitDepth, f32* hitNx, f32* hitNy, f32* hitNz); -void mem_clear(s8* data, s32 numBytes); +void mem_clear(void* data, s32 numBytes); void intro_logos_set_fade_color(s16 color); void intro_logos_set_fade_alpha(s16 alpha); diff --git a/src/43F0.c b/src/43F0.c index ea0cad5368..87f3ebc7c3 100644 --- a/src/43F0.c +++ b/src/43F0.c @@ -161,9 +161,11 @@ INCLUDE_ASM(char*, "43F0", int_to_string, s32 arg01, char* arg1, s32 arg2); #endif // should maybe be called bzero -void mem_clear(s8* data, s32 numBytes) { +void mem_clear(void* data, s32 numBytes) { + u8* addressableData = data; + while (numBytes > 0) { - *data++ = 0; + *addressableData++ = 0; numBytes--; } } diff --git a/src/E225B0.c b/src/E225B0.c index 4c12b1c60d..73b28f041b 100644 --- a/src/E225B0.c +++ b/src/E225B0.c @@ -1,7 +1,186 @@ #include "common.h" -INCLUDE_ASM(s32, "E225B0", func_802B7000_E225B0); -INCLUDE_ASM(s32, "E225B0", func_802B72C0_E22870); +typedef struct struct802B7C78 { + /* 0x00 */ f32 x; + /* 0x04 */ f32 y; + /* 0x08 */ f32 z; + /* 0x0C */ f32 scale; + /* 0x10 */ s32 unk_10; + /* 0x14 */ s32 unk_14; + /* 0x18 */ s32 unk_18; + /* 0x1C */ s32 unk_1C; + /* 0x20 */ s32 unk_20; + /* 0x24 */ s32 unk_24; + /* 0x28 */ s32 unk_28; +} struct802B7C78; + +typedef struct UnknownCommand { + /* 0x00 */ Matrix4f* unk_00; + /* 0x04 */ Matrix4f* unk_04; + /* 0x08 */ s16 unk_08; + /* 0x0A */ s16 unk_0A; + /* 0x0C */ s16 unk_0C; + /* 0x0E */ s16 unk_0E; + /* 0x10 */ u8 unk_10; +} UnknownCommand; + +extern Matrix4f D_802B7580_E22B30; +extern Matrix4f D_802B7BA0_E23150; +extern Matrix4f D_802B7BC0_E23170; +extern Matrix4f D_802B7BE0_E23190; +extern Gfx D_802B7C00_E231B0[]; + +extern void (*D_8010C93C)(void); +extern struct802B7C78* D_802B7C78_E23228; +extern struct8015A578 D_8015A578; + +void func_8013AA9C(s32, s32, s32, s32, s32, s32, s32); +void func_8013AF70(s32, UnknownCommand*, s32, Matrix4f*); +void func_802B735C_E2290C(void); + +void func_802B7000_E225B0(void) { + Matrix4f matrix1; + Matrix4f matrix2; + UnknownCommand command; + + Gfx* oldMasterGfxPos; + f32 scale; + s32 temp; + s32 matrixIndex; + struct802B7C78* localD_802B7C78_E23228; + u16 oldMatrixListPos; + + if (gPlayerStatus.animFlags & 0x100) { + guScaleF(matrix1, D_802B7C78_E23228->scale, D_802B7C78_E23228->scale, + D_802B7C78_E23228->scale); + guRotateF(matrix2, -gCameras[gCurrentCameraID].currentYaw, 0.0f, 1.0f, 0.0f); + guMtxCatF(matrix1, matrix2, matrix1); + guTranslateF(matrix2, D_802B7C78_E23228->x, D_802B7C78_E23228->y, D_802B7C78_E23228->z); + guMtxCatF(matrix1, matrix2, matrix2); + guMtxF2L(matrix2, (Mtx*) &gDisplayContext->matrixStack[gMatrixListPos]); + + gSPMatrix(gMasterGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], 3); + gSPDisplayList(gMasterGfxPos++, D_802B7C00_E231B0); + + localD_802B7C78_E23228 = D_802B7C78_E23228; + if (localD_802B7C78_E23228->unk_18 < 47) { + localD_802B7C78_E23228->unk_20 += 1; + } + + temp = D_802B7C78_E23228->unk_20; + temp = temp - (temp / 12) * 12; + switch (temp) { + case 0: + case 1: + case 2: + case 3: + command.unk_04 = &D_802B7BA0_E23150; + break; + case 4: + case 5: + case 6: + case 7: + command.unk_04 = &D_802B7BC0_E23170; + break; + case 8: + case 9: + case 10: + case 11: + command.unk_04 = &D_802B7BE0_E23190; + break; + } + func_8013AA9C(0, 7, 0xFF, 0xFF, 0xFF, D_802B7C78_E23228->unk_28, 0); + + command.unk_00 = &D_802B7580_E22B30; + command.unk_08 = 0x38; + command.unk_0A = 0x38; + command.unk_0C = -0x1C; + command.unk_0E = 0x2E; + command.unk_10 = 0xFF; + + func_8013AF70(0, &command, 0, &matrix2); + gSPPopMatrix(gMasterGfxPos++, 0); + } +} + + +void func_802B72C0_E22870(void) { + mem_clear(D_802B7C78_E23228, sizeof(*D_802B7C78_E23228)); + + D_802B7C78_E23228->x = gPlayerStatus.position.x; + D_802B7C78_E23228->y = gPlayerStatus.position.y + gPlayerStatus.colliderHeight + 8.0f; + D_802B7C78_E23228->z = gPlayerStatus.position.z; + + D_802B7C78_E23228->unk_28 = 0xFF; + + gPlayerStatus.animFlags |= 0x100; + D_8010C93C = &func_802B735C_E2290C; +} + +void func_802B735C_E2290C(void) { + f32 temp_f2; + s32 temp_v0_3; + s32 temp_v1; + struct802B7C78* temp_a0; + struct802B7C78* temp_v1_3; + s32 phi_v0; + PlayerStatus* playerStatus = &gPlayerStatus; + PartnerActionStatus* partnerActionStatus = &gPartnerActionStatus; + + temp_a0 = D_802B7C78_E23228; + temp_f2 = temp_a0->y; + temp_v1 = temp_a0->unk_24; + temp_a0->y = temp_f2 + (((playerStatus->position.y + playerStatus->colliderHeight + 10.0f) - temp_f2) / 1.5f); + temp_a0->x = playerStatus->position.x; + temp_a0->z = playerStatus->position.z; + + switch (temp_v1) { + case 0: + if (partnerActionStatus->actionState.b[0] && partnerActionStatus->actionState.b[3] == 8) { + phi_v0 = gGameStatusPtr->unk_7D; + } else { + phi_v0 = playerStatus->flags & 0x3000; + } + if (phi_v0 == 0) { + temp_v1_3 = D_802B7C78_E23228; + temp_v1_3->unk_24 += 1; + return; + } + break; + case 1: + if (playerStatus->flags & 0x20) { + temp_a0->unk_24 = 3; + return; + } + + if (temp_a0->unk_18++ >= 0x10) { + temp_a0->scale = 0.36f; + temp_a0->unk_24 += 1; + } + break; + case 2: + temp_a0->scale = 0.57f; + temp_a0->unk_24 += 1; + sfx_play_sound_at_player(SOUND_UNKNOWN_17B, 0); + break; + case 3: + temp_a0->scale = 0.53f; + if (temp_a0->unk_18 >= 0x2F || playerStatus->flags & 0x20) { + temp_a0->unk_28 -= 0x40; + if (temp_a0->unk_28 < 0) { + temp_a0->unk_28 = 0; + temp_a0->unk_18 = 0x33; + } + } + + if (D_802B7C78_E23228->unk_18++ >= 0x33) { + D_8015A578.unk_02 = 0; + D_8010C93C = NULL; + playerStatus->animFlags &= ~0x100; + } + break; + } +} + -INCLUDE_ASM(s32, "E225B0", func_802B735C_E2290C); diff --git a/src/EB5130.c b/src/EB5130.c index b3cf8518d9..22f95a0380 100644 --- a/src/EB5130.c +++ b/src/EB5130.c @@ -7,4 +7,9 @@ #include "world/common/DeadUnkTexturePanFunc2.inc.c" -INCLUDE_ASM(s32, "EB5130", func_8024030C_EB543C); +extern s16 D_80169B12; + +ApiStatus func_8024030C_EB543C(Evt* script, s32 isInitialCall) { + evt_set_variable(script, *script->ptrReadPos, D_80169B12); + return ApiStatus_DONE2; +} diff --git a/src/world/action/super_boots.c b/src/world/action/super_boots.c index 0483c50784..6bd88a7659 100644 --- a/src/world/action/super_boots.c +++ b/src/world/action/super_boots.c @@ -5,12 +5,6 @@ extern struct struct8015A578 D_8015A578; s32 func_802B6648_E27428(void); -typedef struct struct8015A578 { - /* 0x00 */ u8 unk_00; - /* 0x01 */ char unk_01[7]; - /* 0x02 */ f32 unk_08; -} struct8015A578; - void func_802B6000_E26DE0(void) { PlayerStatus* playerStatus = &gPlayerStatus; CollisionStatus* collisionStatus = &gCollisionStatus; diff --git a/src/world/action/ultra_boots.c b/src/world/action/ultra_boots.c index 42b9491cd1..5ee069d0bc 100644 --- a/src/world/action/ultra_boots.c +++ b/src/world/action/ultra_boots.c @@ -5,12 +5,6 @@ extern s32 gSpinHistoryPosY[5]; extern s16 gSpinHistoryPosAngle[5]; extern struct struct8015A578 D_8015A578; -typedef struct struct8015A578 { - /* 0x00 */ u8 unk_00; - /* 0x01 */ char unk_01[7]; - /* 0x08 */ f32 unk_08; -} struct8015A578; - s32 func_802B65F8_E26D08(void); void func_802B6000_E26710(void) { diff --git a/ver/us/asm/nonmatchings/E225B0/func_802B7000_E225B0.s b/ver/us/asm/nonmatchings/E225B0/func_802B7000_E225B0.s deleted file mode 100644 index bf83ee1eed..0000000000 --- a/ver/us/asm/nonmatchings/E225B0/func_802B7000_E225B0.s +++ /dev/null @@ -1,193 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -.section .rodata - -glabel jtbl_802B7C80_E23230 -.word L802B71DC_E2278C, L802B71DC_E2278C, L802B71DC_E2278C, L802B71DC_E2278C, L802B71EC_E2279C, L802B71EC_E2279C, L802B71EC_E2279C, L802B71EC_E2279C, L802B71FC_E227AC, L802B71FC_E227AC, L802B71FC_E227AC, L802B71FC_E227AC - -.section .text - -glabel func_802B7000_E225B0 -/* E225B0 802B7000 3C028011 */ lui $v0, %hi(gPlayerStatus+0x4) -/* E225B4 802B7004 8C42EFCC */ lw $v0, %lo(gPlayerStatus+0x4)($v0) -/* E225B8 802B7008 27BDFF30 */ addiu $sp, $sp, -0xd0 -/* E225BC 802B700C AFBF00C8 */ sw $ra, 0xc8($sp) -/* E225C0 802B7010 AFB300C4 */ sw $s3, 0xc4($sp) -/* E225C4 802B7014 AFB200C0 */ sw $s2, 0xc0($sp) -/* E225C8 802B7018 AFB100BC */ sw $s1, 0xbc($sp) -/* E225CC 802B701C 30420100 */ andi $v0, $v0, 0x100 -/* E225D0 802B7020 104000A0 */ beqz $v0, .L802B72A4 -/* E225D4 802B7024 AFB000B8 */ sw $s0, 0xb8($sp) -/* E225D8 802B7028 3C13802B */ lui $s3, %hi(D_802B7C78_E23228) -/* E225DC 802B702C 26737C78 */ addiu $s3, $s3, %lo(D_802B7C78_E23228) -/* E225E0 802B7030 8E620000 */ lw $v0, ($s3) -/* E225E4 802B7034 27A40020 */ addiu $a0, $sp, 0x20 -/* E225E8 802B7038 8C45000C */ lw $a1, 0xc($v0) -/* E225EC 802B703C 3C120001 */ lui $s2, 1 -/* E225F0 802B7040 00A0302D */ daddu $a2, $a1, $zero -/* E225F4 802B7044 0C019DF0 */ jal guScaleF -/* E225F8 802B7048 00A0382D */ daddu $a3, $a1, $zero -/* E225FC 802B704C 27B00060 */ addiu $s0, $sp, 0x60 -/* E22600 802B7050 3C038007 */ lui $v1, %hi(gCurrentCameraID) -/* E22604 802B7054 8C637410 */ lw $v1, %lo(gCurrentCameraID)($v1) -/* E22608 802B7058 44800000 */ mtc1 $zero, $f0 -/* E2260C 802B705C 00031080 */ sll $v0, $v1, 2 -/* E22610 802B7060 00431021 */ addu $v0, $v0, $v1 -/* E22614 802B7064 00021080 */ sll $v0, $v0, 2 -/* E22618 802B7068 00431023 */ subu $v0, $v0, $v1 -/* E2261C 802B706C 000218C0 */ sll $v1, $v0, 3 -/* E22620 802B7070 00431021 */ addu $v0, $v0, $v1 -/* E22624 802B7074 000210C0 */ sll $v0, $v0, 3 -/* E22628 802B7078 44060000 */ mfc1 $a2, $f0 -/* E2262C 802B707C 3C01800B */ lui $at, %hi(gCameras+0x6C) -/* E22630 802B7080 00220821 */ addu $at, $at, $v0 -/* E22634 802B7084 C4201DEC */ lwc1 $f0, %lo(gCameras+0x6C)($at) -/* E22638 802B7088 3C073F80 */ lui $a3, 0x3f80 -/* E2263C 802B708C 46000007 */ neg.s $f0, $f0 -/* E22640 802B7090 44050000 */ mfc1 $a1, $f0 -/* E22644 802B7094 0200202D */ daddu $a0, $s0, $zero -/* E22648 802B7098 0C019EC8 */ jal guRotateF -/* E2264C 802B709C AFA60010 */ sw $a2, 0x10($sp) -/* E22650 802B70A0 27A40020 */ addiu $a0, $sp, 0x20 -/* E22654 802B70A4 0200282D */ daddu $a1, $s0, $zero -/* E22658 802B70A8 0C019D80 */ jal guMtxCatF -/* E2265C 802B70AC 0080302D */ daddu $a2, $a0, $zero -/* E22660 802B70B0 8E620000 */ lw $v0, ($s3) -/* E22664 802B70B4 36521630 */ ori $s2, $s2, 0x1630 -/* E22668 802B70B8 8C450000 */ lw $a1, ($v0) -/* E2266C 802B70BC 8C460004 */ lw $a2, 4($v0) -/* E22670 802B70C0 8C470008 */ lw $a3, 8($v0) -/* E22674 802B70C4 0C019E40 */ jal guTranslateF -/* E22678 802B70C8 0200202D */ daddu $a0, $s0, $zero -/* E2267C 802B70CC 27A40020 */ addiu $a0, $sp, 0x20 -/* E22680 802B70D0 0200282D */ daddu $a1, $s0, $zero -/* E22684 802B70D4 0C019D80 */ jal guMtxCatF -/* E22688 802B70D8 0200302D */ daddu $a2, $s0, $zero -/* E2268C 802B70DC 0200202D */ daddu $a0, $s0, $zero -/* E22690 802B70E0 3C108007 */ lui $s0, %hi(gMatrixListPos) -/* E22694 802B70E4 261041F0 */ addiu $s0, $s0, %lo(gMatrixListPos) -/* E22698 802B70E8 3C11800A */ lui $s1, %hi(gDisplayContext) -/* E2269C 802B70EC 2631A674 */ addiu $s1, $s1, %lo(gDisplayContext) -/* E226A0 802B70F0 96050000 */ lhu $a1, ($s0) -/* E226A4 802B70F4 8E220000 */ lw $v0, ($s1) -/* E226A8 802B70F8 00052980 */ sll $a1, $a1, 6 -/* E226AC 802B70FC 00B22821 */ addu $a1, $a1, $s2 -/* E226B0 802B7100 0C019D40 */ jal guMtxF2L -/* E226B4 802B7104 00452821 */ addu $a1, $v0, $a1 -/* E226B8 802B7108 3C03DA38 */ lui $v1, 0xda38 -/* E226BC 802B710C 3C05800A */ lui $a1, %hi(gMasterGfxPos) -/* E226C0 802B7110 24A5A66C */ addiu $a1, $a1, %lo(gMasterGfxPos) -/* E226C4 802B7114 34630002 */ ori $v1, $v1, 2 -/* E226C8 802B7118 8CA40000 */ lw $a0, ($a1) -/* E226CC 802B711C 96020000 */ lhu $v0, ($s0) -/* E226D0 802B7120 0080302D */ daddu $a2, $a0, $zero -/* E226D4 802B7124 24840008 */ addiu $a0, $a0, 8 -/* E226D8 802B7128 ACA40000 */ sw $a0, ($a1) -/* E226DC 802B712C ACC30000 */ sw $v1, ($a2) -/* E226E0 802B7130 24430001 */ addiu $v1, $v0, 1 -/* E226E4 802B7134 3042FFFF */ andi $v0, $v0, 0xffff -/* E226E8 802B7138 00021180 */ sll $v0, $v0, 6 -/* E226EC 802B713C A6030000 */ sh $v1, ($s0) -/* E226F0 802B7140 8E230000 */ lw $v1, ($s1) -/* E226F4 802B7144 00521021 */ addu $v0, $v0, $s2 -/* E226F8 802B7148 00621821 */ addu $v1, $v1, $v0 -/* E226FC 802B714C 3C02DE00 */ lui $v0, 0xde00 -/* E22700 802B7150 ACC30004 */ sw $v1, 4($a2) -/* E22704 802B7154 AC820000 */ sw $v0, ($a0) -/* E22708 802B7158 8E630000 */ lw $v1, ($s3) -/* E2270C 802B715C 3C02802B */ lui $v0, %hi(D_802B7C00_E231B0) -/* E22710 802B7160 24427C00 */ addiu $v0, $v0, %lo(D_802B7C00_E231B0) -/* E22714 802B7164 AC820004 */ sw $v0, 4($a0) -/* E22718 802B7168 8C620018 */ lw $v0, 0x18($v1) -/* E2271C 802B716C 24840008 */ addiu $a0, $a0, 8 -/* E22720 802B7170 2842002F */ slti $v0, $v0, 0x2f -/* E22724 802B7174 10400004 */ beqz $v0, .L802B7188 -/* E22728 802B7178 ACA40000 */ sw $a0, ($a1) -/* E2272C 802B717C 8C620020 */ lw $v0, 0x20($v1) -/* E22730 802B7180 24420001 */ addiu $v0, $v0, 1 -/* E22734 802B7184 AC620020 */ sw $v0, 0x20($v1) -.L802B7188: -/* E22738 802B7188 8E620000 */ lw $v0, ($s3) -/* E2273C 802B718C 3C032AAA */ lui $v1, 0x2aaa -/* E22740 802B7190 8C440020 */ lw $a0, 0x20($v0) -/* E22744 802B7194 3463AAAB */ ori $v1, $v1, 0xaaab -/* E22748 802B7198 00830018 */ mult $a0, $v1 -/* E2274C 802B719C 000417C3 */ sra $v0, $a0, 0x1f -/* E22750 802B71A0 00004010 */ mfhi $t0 -/* E22754 802B71A4 00081843 */ sra $v1, $t0, 1 -/* E22758 802B71A8 00621823 */ subu $v1, $v1, $v0 -/* E2275C 802B71AC 00031040 */ sll $v0, $v1, 1 -/* E22760 802B71B0 00431021 */ addu $v0, $v0, $v1 -/* E22764 802B71B4 00021080 */ sll $v0, $v0, 2 -/* E22768 802B71B8 00822023 */ subu $a0, $a0, $v0 -/* E2276C 802B71BC 2C82000C */ sltiu $v0, $a0, 0xc -/* E22770 802B71C0 10400011 */ beqz $v0, .L802B7208 -/* E22774 802B71C4 00041080 */ sll $v0, $a0, 2 -/* E22778 802B71C8 3C01802B */ lui $at, %hi(jtbl_802B7C80_E23230) -/* E2277C 802B71CC 00220821 */ addu $at, $at, $v0 -/* E22780 802B71D0 8C227C80 */ lw $v0, %lo(jtbl_802B7C80_E23230)($at) -/* E22784 802B71D4 00400008 */ jr $v0 -/* E22788 802B71D8 00000000 */ nop -glabel L802B71DC_E2278C -/* E2278C 802B71DC 3C02802B */ lui $v0, %hi(D_802B7BA0_E23150) -/* E22790 802B71E0 24427BA0 */ addiu $v0, $v0, %lo(D_802B7BA0_E23150) -/* E22794 802B71E4 080ADC82 */ j .L802B7208 -/* E22798 802B71E8 AFA200A4 */ sw $v0, 0xa4($sp) -glabel L802B71EC_E2279C -/* E2279C 802B71EC 3C02802B */ lui $v0, %hi(D_802B7BC0_E23170) -/* E227A0 802B71F0 24427BC0 */ addiu $v0, $v0, %lo(D_802B7BC0_E23170) -/* E227A4 802B71F4 080ADC82 */ j .L802B7208 -/* E227A8 802B71F8 AFA200A4 */ sw $v0, 0xa4($sp) -glabel L802B71FC_E227AC -/* E227AC 802B71FC 3C02802B */ lui $v0, %hi(D_802B7BE0_E23190) -/* E227B0 802B7200 24427BE0 */ addiu $v0, $v0, %lo(D_802B7BE0_E23190) -/* E227B4 802B7204 AFA200A4 */ sw $v0, 0xa4($sp) -.L802B7208: -/* E227B8 802B7208 0000202D */ daddu $a0, $zero, $zero -/* E227BC 802B720C 24050007 */ addiu $a1, $zero, 7 -/* E227C0 802B7210 240600FF */ addiu $a2, $zero, 0xff -/* E227C4 802B7214 3C02802B */ lui $v0, %hi(D_802B7C78_E23228) -/* E227C8 802B7218 8C427C78 */ lw $v0, %lo(D_802B7C78_E23228)($v0) -/* E227CC 802B721C 00C0802D */ daddu $s0, $a2, $zero -/* E227D0 802B7220 AFB00010 */ sw $s0, 0x10($sp) -/* E227D4 802B7224 8C420028 */ lw $v0, 0x28($v0) -/* E227D8 802B7228 00C0382D */ daddu $a3, $a2, $zero -/* E227DC 802B722C AFA00018 */ sw $zero, 0x18($sp) -/* E227E0 802B7230 0C04EAA7 */ jal func_8013AA9C -/* E227E4 802B7234 AFA20014 */ sw $v0, 0x14($sp) -/* E227E8 802B7238 0000202D */ daddu $a0, $zero, $zero -/* E227EC 802B723C 27A500A0 */ addiu $a1, $sp, 0xa0 -/* E227F0 802B7240 0080302D */ daddu $a2, $a0, $zero -/* E227F4 802B7244 27A70060 */ addiu $a3, $sp, 0x60 -/* E227F8 802B7248 3C02802B */ lui $v0, %hi(D_802B7580_E22B30) -/* E227FC 802B724C 24427580 */ addiu $v0, $v0, %lo(D_802B7580_E22B30) -/* E22800 802B7250 AFA200A0 */ sw $v0, 0xa0($sp) -/* E22804 802B7254 24020038 */ addiu $v0, $zero, 0x38 -/* E22808 802B7258 A7A200A8 */ sh $v0, 0xa8($sp) -/* E2280C 802B725C A7A200AA */ sh $v0, 0xaa($sp) -/* E22810 802B7260 2402FFE4 */ addiu $v0, $zero, -0x1c -/* E22814 802B7264 A7A200AC */ sh $v0, 0xac($sp) -/* E22818 802B7268 2402002E */ addiu $v0, $zero, 0x2e -/* E2281C 802B726C A7A200AE */ sh $v0, 0xae($sp) -/* E22820 802B7270 0C04EBDC */ jal func_8013AF70 -/* E22824 802B7274 A3B000B0 */ sb $s0, 0xb0($sp) -/* E22828 802B7278 3C05D838 */ lui $a1, 0xd838 -/* E2282C 802B727C 3C03800A */ lui $v1, %hi(gMasterGfxPos) -/* E22830 802B7280 2463A66C */ addiu $v1, $v1, %lo(gMasterGfxPos) -/* E22834 802B7284 8C620000 */ lw $v0, ($v1) -/* E22838 802B7288 34A50002 */ ori $a1, $a1, 2 -/* E2283C 802B728C 0040202D */ daddu $a0, $v0, $zero -/* E22840 802B7290 24420008 */ addiu $v0, $v0, 8 -/* E22844 802B7294 AC620000 */ sw $v0, ($v1) -/* E22848 802B7298 24020040 */ addiu $v0, $zero, 0x40 -/* E2284C 802B729C AC850000 */ sw $a1, ($a0) -/* E22850 802B72A0 AC820004 */ sw $v0, 4($a0) -.L802B72A4: -/* E22854 802B72A4 8FBF00C8 */ lw $ra, 0xc8($sp) -/* E22858 802B72A8 8FB300C4 */ lw $s3, 0xc4($sp) -/* E2285C 802B72AC 8FB200C0 */ lw $s2, 0xc0($sp) -/* E22860 802B72B0 8FB100BC */ lw $s1, 0xbc($sp) -/* E22864 802B72B4 8FB000B8 */ lw $s0, 0xb8($sp) -/* E22868 802B72B8 03E00008 */ jr $ra -/* E2286C 802B72BC 27BD00D0 */ addiu $sp, $sp, 0xd0 diff --git a/ver/us/asm/nonmatchings/E225B0/func_802B72C0_E22870.s b/ver/us/asm/nonmatchings/E225B0/func_802B72C0_E22870.s deleted file mode 100644 index 9a0f7a6709..0000000000 --- a/ver/us/asm/nonmatchings/E225B0/func_802B72C0_E22870.s +++ /dev/null @@ -1,43 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_802B72C0_E22870 -/* E22870 802B72C0 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* E22874 802B72C4 AFB00010 */ sw $s0, 0x10($sp) -/* E22878 802B72C8 3C10802B */ lui $s0, %hi(D_802B7C78_E23228) -/* E2287C 802B72CC 26107C78 */ addiu $s0, $s0, %lo(D_802B7C78_E23228) -/* E22880 802B72D0 AFBF0014 */ sw $ra, 0x14($sp) -/* E22884 802B72D4 8E040000 */ lw $a0, ($s0) -/* E22888 802B72D8 0C00A580 */ jal mem_clear -/* E2288C 802B72DC 2405002C */ addiu $a1, $zero, 0x2c -/* E22890 802B72E0 3C048011 */ lui $a0, %hi(gPlayerStatus) -/* E22894 802B72E4 2484EFC8 */ addiu $a0, $a0, %lo(gPlayerStatus) -/* E22898 802B72E8 8E030000 */ lw $v1, ($s0) -/* E2289C 802B72EC C4800028 */ lwc1 $f0, 0x28($a0) -/* E228A0 802B72F0 E4600000 */ swc1 $f0, ($v1) -/* E228A4 802B72F4 848200B0 */ lh $v0, 0xb0($a0) -/* E228A8 802B72F8 C480002C */ lwc1 $f0, 0x2c($a0) -/* E228AC 802B72FC 44821000 */ mtc1 $v0, $f2 -/* E228B0 802B7300 00000000 */ nop -/* E228B4 802B7304 468010A0 */ cvt.s.w $f2, $f2 -/* E228B8 802B7308 46020000 */ add.s $f0, $f0, $f2 -/* E228BC 802B730C 3C014100 */ lui $at, 0x4100 -/* E228C0 802B7310 44811000 */ mtc1 $at, $f2 -/* E228C4 802B7314 00000000 */ nop -/* E228C8 802B7318 46020000 */ add.s $f0, $f0, $f2 -/* E228CC 802B731C E4600004 */ swc1 $f0, 4($v1) -/* E228D0 802B7320 C4800030 */ lwc1 $f0, 0x30($a0) -/* E228D4 802B7324 240200FF */ addiu $v0, $zero, 0xff -/* E228D8 802B7328 AC620028 */ sw $v0, 0x28($v1) -/* E228DC 802B732C E4600008 */ swc1 $f0, 8($v1) -/* E228E0 802B7330 8C820004 */ lw $v0, 4($a0) -/* E228E4 802B7334 34420100 */ ori $v0, $v0, 0x100 -/* E228E8 802B7338 AC820004 */ sw $v0, 4($a0) -/* E228EC 802B733C 8FBF0014 */ lw $ra, 0x14($sp) -/* E228F0 802B7340 8FB00010 */ lw $s0, 0x10($sp) -/* E228F4 802B7344 3C03802B */ lui $v1, %hi(func_802B735C_E2290C) -/* E228F8 802B7348 2463735C */ addiu $v1, $v1, %lo(func_802B735C_E2290C) -/* E228FC 802B734C 3C018011 */ lui $at, %hi(D_8010C93C) -/* E22900 802B7350 AC23C93C */ sw $v1, %lo(D_8010C93C)($at) -/* E22904 802B7354 03E00008 */ jr $ra -/* E22908 802B7358 27BD0018 */ addiu $sp, $sp, 0x18 diff --git a/ver/us/asm/nonmatchings/E225B0/func_802B735C_E2290C.s b/ver/us/asm/nonmatchings/E225B0/func_802B735C_E2290C.s deleted file mode 100644 index fcf0151c9f..0000000000 --- a/ver/us/asm/nonmatchings/E225B0/func_802B735C_E2290C.s +++ /dev/null @@ -1,152 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_802B735C_E2290C -/* E2290C 802B735C 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* E22910 802B7360 3C058011 */ lui $a1, %hi(gPlayerStatus) -/* E22914 802B7364 24A5EFC8 */ addiu $a1, $a1, %lo(gPlayerStatus) -/* E22918 802B7368 AFBF0010 */ sw $ra, 0x10($sp) -/* E2291C 802B736C 84A200B0 */ lh $v0, 0xb0($a1) -/* E22920 802B7370 C4A0002C */ lwc1 $f0, 0x2c($a1) -/* E22924 802B7374 44821000 */ mtc1 $v0, $f2 -/* E22928 802B7378 00000000 */ nop -/* E2292C 802B737C 468010A0 */ cvt.s.w $f2, $f2 -/* E22930 802B7380 46020000 */ add.s $f0, $f0, $f2 -/* E22934 802B7384 3C014120 */ lui $at, 0x4120 -/* E22938 802B7388 44811000 */ mtc1 $at, $f2 -/* E2293C 802B738C 3C04802B */ lui $a0, %hi(D_802B7C78_E23228) -/* E22940 802B7390 8C847C78 */ lw $a0, %lo(D_802B7C78_E23228)($a0) -/* E22944 802B7394 46020000 */ add.s $f0, $f0, $f2 -/* E22948 802B7398 C4820004 */ lwc1 $f2, 4($a0) -/* E2294C 802B739C 46020001 */ sub.s $f0, $f0, $f2 -/* E22950 802B73A0 3C013FC0 */ lui $at, 0x3fc0 -/* E22954 802B73A4 44812000 */ mtc1 $at, $f4 -/* E22958 802B73A8 00000000 */ nop -/* E2295C 802B73AC 46040003 */ div.s $f0, $f0, $f4 -/* E22960 802B73B0 46001080 */ add.s $f2, $f2, $f0 -/* E22964 802B73B4 8C830024 */ lw $v1, 0x24($a0) -/* E22968 802B73B8 E4820004 */ swc1 $f2, 4($a0) -/* E2296C 802B73BC C4A00028 */ lwc1 $f0, 0x28($a1) -/* E22970 802B73C0 3C068011 */ lui $a2, %hi(gPartnerActionStatus) -/* E22974 802B73C4 24C6EBB0 */ addiu $a2, $a2, %lo(gPartnerActionStatus) -/* E22978 802B73C8 E4800000 */ swc1 $f0, ($a0) -/* E2297C 802B73CC C4A00030 */ lwc1 $f0, 0x30($a1) -/* E22980 802B73D0 24020001 */ addiu $v0, $zero, 1 -/* E22984 802B73D4 10620022 */ beq $v1, $v0, .L802B7460 -/* E22988 802B73D8 E4800008 */ swc1 $f0, 8($a0) -/* E2298C 802B73DC 28620002 */ slti $v0, $v1, 2 -/* E22990 802B73E0 50400005 */ beql $v0, $zero, .L802B73F8 -/* E22994 802B73E4 24020002 */ addiu $v0, $zero, 2 -/* E22998 802B73E8 10600009 */ beqz $v1, .L802B7410 -/* E2299C 802B73EC 00000000 */ nop -/* E229A0 802B73F0 080ADD5A */ j .L802B7568 -/* E229A4 802B73F4 00000000 */ nop -.L802B73F8: -/* E229A8 802B73F8 1062002D */ beq $v1, $v0, .L802B74B0 -/* E229AC 802B73FC 24020003 */ addiu $v0, $zero, 3 -/* E229B0 802B7400 10620037 */ beq $v1, $v0, .L802B74E0 -/* E229B4 802B7404 00000000 */ nop -/* E229B8 802B7408 080ADD5A */ j .L802B7568 -/* E229BC 802B740C 00000000 */ nop -.L802B7410: -/* E229C0 802B7410 80C20000 */ lb $v0, ($a2) -/* E229C4 802B7414 10400008 */ beqz $v0, .L802B7438 -/* E229C8 802B7418 24020008 */ addiu $v0, $zero, 8 -/* E229CC 802B741C 80C30003 */ lb $v1, 3($a2) -/* E229D0 802B7420 14620005 */ bne $v1, $v0, .L802B7438 -/* E229D4 802B7424 00000000 */ nop -/* E229D8 802B7428 3C028007 */ lui $v0, %hi(gGameStatusPtr) -/* E229DC 802B742C 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0) -/* E229E0 802B7430 080ADD10 */ j .L802B7440 -/* E229E4 802B7434 8042007D */ lb $v0, 0x7d($v0) -.L802B7438: -/* E229E8 802B7438 8CA20000 */ lw $v0, ($a1) -/* E229EC 802B743C 30423000 */ andi $v0, $v0, 0x3000 -.L802B7440: -/* E229F0 802B7440 14400049 */ bnez $v0, .L802B7568 -/* E229F4 802B7444 00000000 */ nop -/* E229F8 802B7448 3C03802B */ lui $v1, %hi(D_802B7C78_E23228) -/* E229FC 802B744C 8C637C78 */ lw $v1, %lo(D_802B7C78_E23228)($v1) -/* E22A00 802B7450 8C620024 */ lw $v0, 0x24($v1) -/* E22A04 802B7454 24420001 */ addiu $v0, $v0, 1 -/* E22A08 802B7458 080ADD5A */ j .L802B7568 -/* E22A0C 802B745C AC620024 */ sw $v0, 0x24($v1) -.L802B7460: -/* E22A10 802B7460 8CA20000 */ lw $v0, ($a1) -/* E22A14 802B7464 30420020 */ andi $v0, $v0, 0x20 -/* E22A18 802B7468 10400003 */ beqz $v0, .L802B7478 -/* E22A1C 802B746C 24020003 */ addiu $v0, $zero, 3 -/* E22A20 802B7470 080ADD5A */ j .L802B7568 -/* E22A24 802B7474 AC820024 */ sw $v0, 0x24($a0) -.L802B7478: -/* E22A28 802B7478 8C820018 */ lw $v0, 0x18($a0) -/* E22A2C 802B747C 0040182D */ daddu $v1, $v0, $zero -/* E22A30 802B7480 24420001 */ addiu $v0, $v0, 1 -/* E22A34 802B7484 28630010 */ slti $v1, $v1, 0x10 -/* E22A38 802B7488 14600037 */ bnez $v1, .L802B7568 -/* E22A3C 802B748C AC820018 */ sw $v0, 0x18($a0) -/* E22A40 802B7490 8C820024 */ lw $v0, 0x24($a0) -/* E22A44 802B7494 3C013EB8 */ lui $at, 0x3eb8 -/* E22A48 802B7498 342151EC */ ori $at, $at, 0x51ec -/* E22A4C 802B749C 44810000 */ mtc1 $at, $f0 -/* E22A50 802B74A0 24420001 */ addiu $v0, $v0, 1 -/* E22A54 802B74A4 E480000C */ swc1 $f0, 0xc($a0) -/* E22A58 802B74A8 080ADD5A */ j .L802B7568 -/* E22A5C 802B74AC AC820024 */ sw $v0, 0x24($a0) -.L802B74B0: -/* E22A60 802B74B0 0000282D */ daddu $a1, $zero, $zero -/* E22A64 802B74B4 8C820024 */ lw $v0, 0x24($a0) -/* E22A68 802B74B8 3C013F11 */ lui $at, 0x3f11 -/* E22A6C 802B74BC 3421EB85 */ ori $at, $at, 0xeb85 -/* E22A70 802B74C0 44810000 */ mtc1 $at, $f0 -/* E22A74 802B74C4 24420001 */ addiu $v0, $v0, 1 -/* E22A78 802B74C8 E480000C */ swc1 $f0, 0xc($a0) -/* E22A7C 802B74CC AC820024 */ sw $v0, 0x24($a0) -/* E22A80 802B74D0 0C052736 */ jal sfx_play_sound_at_player -/* E22A84 802B74D4 2404017B */ addiu $a0, $zero, 0x17b -/* E22A88 802B74D8 080ADD5A */ j .L802B7568 -/* E22A8C 802B74DC 00000000 */ nop -.L802B74E0: -/* E22A90 802B74E0 8C820018 */ lw $v0, 0x18($a0) -/* E22A94 802B74E4 3C013F07 */ lui $at, 0x3f07 -/* E22A98 802B74E8 3421AE14 */ ori $at, $at, 0xae14 -/* E22A9C 802B74EC 44810000 */ mtc1 $at, $f0 -/* E22AA0 802B74F0 2842002F */ slti $v0, $v0, 0x2f -/* E22AA4 802B74F4 10400005 */ beqz $v0, .L802B750C -/* E22AA8 802B74F8 E480000C */ swc1 $f0, 0xc($a0) -/* E22AAC 802B74FC 8CA20000 */ lw $v0, ($a1) -/* E22AB0 802B7500 30420020 */ andi $v0, $v0, 0x20 -/* E22AB4 802B7504 10400008 */ beqz $v0, .L802B7528 -/* E22AB8 802B7508 00000000 */ nop -.L802B750C: -/* E22ABC 802B750C 8C820028 */ lw $v0, 0x28($a0) -/* E22AC0 802B7510 2442FFC0 */ addiu $v0, $v0, -0x40 -/* E22AC4 802B7514 04410004 */ bgez $v0, .L802B7528 -/* E22AC8 802B7518 AC820028 */ sw $v0, 0x28($a0) -/* E22ACC 802B751C 24020033 */ addiu $v0, $zero, 0x33 -/* E22AD0 802B7520 AC800028 */ sw $zero, 0x28($a0) -/* E22AD4 802B7524 AC820018 */ sw $v0, 0x18($a0) -.L802B7528: -/* E22AD8 802B7528 3C02802B */ lui $v0, %hi(D_802B7C78_E23228) -/* E22ADC 802B752C 8C427C78 */ lw $v0, %lo(D_802B7C78_E23228)($v0) -/* E22AE0 802B7530 8C430018 */ lw $v1, 0x18($v0) -/* E22AE4 802B7534 0060202D */ daddu $a0, $v1, $zero -/* E22AE8 802B7538 24630001 */ addiu $v1, $v1, 1 -/* E22AEC 802B753C 28840033 */ slti $a0, $a0, 0x33 -/* E22AF0 802B7540 14800009 */ bnez $a0, .L802B7568 -/* E22AF4 802B7544 AC430018 */ sw $v1, 0x18($v0) -/* E22AF8 802B7548 3C018016 */ lui $at, %hi(D_8015A57A) -/* E22AFC 802B754C A020A57A */ sb $zero, %lo(D_8015A57A)($at) -/* E22B00 802B7550 8CA20004 */ lw $v0, 4($a1) -/* E22B04 802B7554 2403FEFF */ addiu $v1, $zero, -0x101 -/* E22B08 802B7558 3C018011 */ lui $at, %hi(D_8010C93C) -/* E22B0C 802B755C AC20C93C */ sw $zero, %lo(D_8010C93C)($at) -/* E22B10 802B7560 00431024 */ and $v0, $v0, $v1 -/* E22B14 802B7564 ACA20004 */ sw $v0, 4($a1) -.L802B7568: -/* E22B18 802B7568 8FBF0010 */ lw $ra, 0x10($sp) -/* E22B1C 802B756C 03E00008 */ jr $ra -/* E22B20 802B7570 27BD0018 */ addiu $sp, $sp, 0x18 -/* E22B24 802B7574 00000000 */ nop -/* E22B28 802B7578 00000000 */ nop -/* E22B2C 802B757C 00000000 */ nop diff --git a/ver/us/asm/nonmatchings/EB5130/func_8024030C_EB543C.s b/ver/us/asm/nonmatchings/EB5130/func_8024030C_EB543C.s deleted file mode 100644 index d4ad310852..0000000000 --- a/ver/us/asm/nonmatchings/EB5130/func_8024030C_EB543C.s +++ /dev/null @@ -1,17 +0,0 @@ -.set noat # allow manual use of $at -.set noreorder # don't insert nops after branches - -glabel func_8024030C_EB543C -/* EB543C 8024030C 27BDFFE8 */ addiu $sp, $sp, -0x18 -/* EB5440 80240310 AFBF0010 */ sw $ra, 0x10($sp) -/* EB5444 80240314 8C82000C */ lw $v0, 0xc($a0) -/* EB5448 80240318 3C068017 */ lui $a2, %hi(D_80169B12) -/* EB544C 8024031C 84C69B12 */ lh $a2, %lo(D_80169B12)($a2) -/* EB5450 80240320 0C0B551A */ jal dead_evt_set_variable -/* EB5454 80240324 8C450000 */ lw $a1, ($v0) -/* EB5458 80240328 8FBF0010 */ lw $ra, 0x10($sp) -/* EB545C 8024032C 24020002 */ addiu $v0, $zero, 2 -/* EB5460 80240330 03E00008 */ jr $ra -/* EB5464 80240334 27BD0018 */ addiu $sp, $sp, 0x18 -/* EB5468 80240338 00000000 */ nop -/* EB546C 8024033C 00000000 */ nop