a few more kmr funcs

This commit is contained in:
Ethan Roseman 2020-11-02 14:53:06 -05:00
parent 0df7ef28a3
commit 5a0dea8665
9 changed files with 53 additions and 194 deletions

View File

@ -1,62 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802403B8_8AC348
/* 8AC348 802403B8 27BDFFD0 */ addiu $sp, $sp, -0x30
/* 8AC34C 802403BC AFB1001C */ sw $s1, 0x1c($sp)
/* 8AC350 802403C0 0080882D */ daddu $s1, $a0, $zero
/* 8AC354 802403C4 AFBF002C */ sw $ra, 0x2c($sp)
/* 8AC358 802403C8 AFB40028 */ sw $s4, 0x28($sp)
/* 8AC35C 802403CC AFB30024 */ sw $s3, 0x24($sp)
/* 8AC360 802403D0 AFB20020 */ sw $s2, 0x20($sp)
/* 8AC364 802403D4 AFB00018 */ sw $s0, 0x18($sp)
/* 8AC368 802403D8 8E30000C */ lw $s0, 0xc($s1)
/* 8AC36C 802403DC 8E050000 */ lw $a1, ($s0)
/* 8AC370 802403E0 0C0B1EAF */ jal get_variable
/* 8AC374 802403E4 26100004 */ addiu $s0, $s0, 4
/* 8AC378 802403E8 8E050000 */ lw $a1, ($s0)
/* 8AC37C 802403EC 26100004 */ addiu $s0, $s0, 4
/* 8AC380 802403F0 0220202D */ daddu $a0, $s1, $zero
/* 8AC384 802403F4 0C0B1EAF */ jal get_variable
/* 8AC388 802403F8 0040A02D */ daddu $s4, $v0, $zero
/* 8AC38C 802403FC 8E050000 */ lw $a1, ($s0)
/* 8AC390 80240400 26100004 */ addiu $s0, $s0, 4
/* 8AC394 80240404 0220202D */ daddu $a0, $s1, $zero
/* 8AC398 80240408 0C0B1EAF */ jal get_variable
/* 8AC39C 8024040C 0040982D */ daddu $s3, $v0, $zero
/* 8AC3A0 80240410 8E050000 */ lw $a1, ($s0)
/* 8AC3A4 80240414 26100004 */ addiu $s0, $s0, 4
/* 8AC3A8 80240418 0220202D */ daddu $a0, $s1, $zero
/* 8AC3AC 8024041C 0C0B1EAF */ jal get_variable
/* 8AC3B0 80240420 0040902D */ daddu $s2, $v0, $zero
/* 8AC3B4 80240424 0220202D */ daddu $a0, $s1, $zero
/* 8AC3B8 80240428 8E050000 */ lw $a1, ($s0)
/* 8AC3BC 8024042C 0C0B1EAF */ jal get_variable
/* 8AC3C0 80240430 0040802D */ daddu $s0, $v0, $zero
/* 8AC3C4 80240434 0280202D */ daddu $a0, $s4, $zero
/* 8AC3C8 80240438 44931000 */ mtc1 $s3, $f2
/* 8AC3CC 8024043C 00000000 */ nop
/* 8AC3D0 80240440 468010A0 */ cvt.s.w $f2, $f2
/* 8AC3D4 80240444 44051000 */ mfc1 $a1, $f2
/* 8AC3D8 80240448 44921000 */ mtc1 $s2, $f2
/* 8AC3DC 8024044C 00000000 */ nop
/* 8AC3E0 80240450 468010A0 */ cvt.s.w $f2, $f2
/* 8AC3E4 80240454 44061000 */ mfc1 $a2, $f2
/* 8AC3E8 80240458 44901000 */ mtc1 $s0, $f2
/* 8AC3EC 8024045C 00000000 */ nop
/* 8AC3F0 80240460 468010A0 */ cvt.s.w $f2, $f2
/* 8AC3F4 80240464 44071000 */ mfc1 $a3, $f2
/* 8AC3F8 80240468 44820000 */ mtc1 $v0, $f0
/* 8AC3FC 8024046C 00000000 */ nop
/* 8AC400 80240470 46800020 */ cvt.s.w $f0, $f0
/* 8AC404 80240474 0C01BFBC */ jal func_8006FEF0
/* 8AC408 80240478 E7A00010 */ swc1 $f0, 0x10($sp)
/* 8AC40C 8024047C 8FBF002C */ lw $ra, 0x2c($sp)
/* 8AC410 80240480 8FB40028 */ lw $s4, 0x28($sp)
/* 8AC414 80240484 8FB30024 */ lw $s3, 0x24($sp)
/* 8AC418 80240488 8FB20020 */ lw $s2, 0x20($sp)
/* 8AC41C 8024048C 8FB1001C */ lw $s1, 0x1c($sp)
/* 8AC420 80240490 8FB00018 */ lw $s0, 0x18($sp)
/* 8AC424 80240494 24020002 */ addiu $v0, $zero, 2
/* 8AC428 80240498 03E00008 */ jr $ra
/* 8AC42C 8024049C 27BD0030 */ addiu $sp, $sp, 0x30

View File

@ -1,22 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802404A0_8AC430
/* 8AC430 802404A0 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 8AC434 802404A4 2402001E */ addiu $v0, $zero, 0x1e
/* 8AC438 802404A8 44801000 */ mtc1 $zero, $f2
/* 8AC43C 802404AC 3C013E99 */ lui $at, 0x3e99
/* 8AC440 802404B0 3421999A */ ori $at, $at, 0x999a
/* 8AC444 802404B4 44810000 */ mtc1 $at, $f0
/* 8AC448 802404B8 44051000 */ mfc1 $a1, $f2
/* 8AC44C 802404BC 24040004 */ addiu $a0, $zero, 4
/* 8AC450 802404C0 AFBF0018 */ sw $ra, 0x18($sp)
/* 8AC454 802404C4 AFA20014 */ sw $v0, 0x14($sp)
/* 8AC458 802404C8 E7A00010 */ swc1 $f0, 0x10($sp)
/* 8AC45C 802404CC 00A0302D */ daddu $a2, $a1, $zero
/* 8AC460 802404D0 0C01C5D4 */ jal func_80071750
/* 8AC464 802404D4 00A0382D */ daddu $a3, $a1, $zero
/* 8AC468 802404D8 8FBF0018 */ lw $ra, 0x18($sp)
/* 8AC46C 802404DC 24020002 */ addiu $v0, $zero, 2
/* 8AC470 802404E0 03E00008 */ jr $ra
/* 8AC474 802404E4 27BD0020 */ addiu $sp, $sp, 0x20

View File

@ -1,25 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_80240530_8AC4C0
/* 8AC4C0 80240530 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 8AC4C4 80240534 AFBF0018 */ sw $ra, 0x18($sp)
/* 8AC4C8 80240538 8C82000C */ lw $v0, 0xc($a0)
/* 8AC4CC 8024053C 0C0B1EAF */ jal get_variable
/* 8AC4D0 80240540 8C450000 */ lw $a1, ($v0)
/* 8AC4D4 80240544 0C00EABB */ jal get_npc_unsafe
/* 8AC4D8 80240548 0040202D */ daddu $a0, $v0, $zero
/* 8AC4DC 8024054C 3C014120 */ lui $at, 0x4120
/* 8AC4E0 80240550 44810000 */ mtc1 $at, $f0
/* 8AC4E4 80240554 C442003C */ lwc1 $f2, 0x3c($v0)
/* 8AC4E8 80240558 46001080 */ add.s $f2, $f2, $f0
/* 8AC4EC 8024055C E7A00010 */ swc1 $f0, 0x10($sp)
/* 8AC4F0 80240560 8C450038 */ lw $a1, 0x38($v0)
/* 8AC4F4 80240564 8C470040 */ lw $a3, 0x40($v0)
/* 8AC4F8 80240568 44061000 */ mfc1 $a2, $f2
/* 8AC4FC 8024056C 0C01BFBC */ jal func_8006FEF0
/* 8AC500 80240570 24040003 */ addiu $a0, $zero, 3
/* 8AC504 80240574 8FBF0018 */ lw $ra, 0x18($sp)
/* 8AC508 80240578 24020002 */ addiu $v0, $zero, 2
/* 8AC50C 8024057C 03E00008 */ jr $ra
/* 8AC510 80240580 27BD0020 */ addiu $sp, $sp, 0x20

View File

@ -1,61 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_80240BD8_8ACB68
/* 8ACB68 80240BD8 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 8ACB6C 80240BDC AFB1001C */ sw $s1, 0x1c($sp)
/* 8ACB70 80240BE0 0080882D */ daddu $s1, $a0, $zero
/* 8ACB74 80240BE4 AFBF0020 */ sw $ra, 0x20($sp)
/* 8ACB78 80240BE8 AFB00018 */ sw $s0, 0x18($sp)
/* 8ACB7C 80240BEC 10A0001D */ beqz $a1, .L80240C64
/* 8ACB80 80240BF0 8E22000C */ lw $v0, 0xc($s1)
/* 8ACB84 80240BF4 0C0B1EAF */ jal get_variable
/* 8ACB88 80240BF8 8C450000 */ lw $a1, ($v0)
/* 8ACB8C 80240BFC 0040202D */ daddu $a0, $v0, $zero
/* 8ACB90 80240C00 0C00EABB */ jal get_npc_unsafe
/* 8ACB94 80240C04 AE240074 */ sw $a0, 0x74($s1)
/* 8ACB98 80240C08 0040802D */ daddu $s0, $v0, $zero
/* 8ACB9C 80240C0C 3C04B000 */ lui $a0, 0xb000
/* 8ACBA0 80240C10 C6000040 */ lwc1 $f0, 0x40($s0)
/* 8ACBA4 80240C14 3484001E */ ori $a0, $a0, 0x1e
/* 8ACBA8 80240C18 E7A00010 */ swc1 $f0, 0x10($sp)
/* 8ACBAC 80240C1C 8E060038 */ lw $a2, 0x38($s0)
/* 8ACBB0 80240C20 8E07003C */ lw $a3, 0x3c($s0)
/* 8ACBB4 80240C24 0C052757 */ jal play_sound_at_position
/* 8ACBB8 80240C28 0000282D */ daddu $a1, $zero, $zero
/* 8ACBBC 80240C2C C604003C */ lwc1 $f4, 0x3c($s0)
/* 8ACBC0 80240C30 3C0141A0 */ lui $at, 0x41a0
/* 8ACBC4 80240C34 44810000 */ mtc1 $at, $f0
/* 8ACBC8 80240C38 3C014120 */ lui $at, 0x4120
/* 8ACBCC 80240C3C 44811000 */ mtc1 $at, $f2
/* 8ACBD0 80240C40 46002100 */ add.s $f4, $f4, $f0
/* 8ACBD4 80240C44 E7A20010 */ swc1 $f2, 0x10($sp)
/* 8ACBD8 80240C48 8E050038 */ lw $a1, 0x38($s0)
/* 8ACBDC 80240C4C 8E070040 */ lw $a3, 0x40($s0)
/* 8ACBE0 80240C50 44062000 */ mfc1 $a2, $f4
/* 8ACBE4 80240C54 0C01BFBC */ jal func_8006FEF0
/* 8ACBE8 80240C58 0000202D */ daddu $a0, $zero, $zero
/* 8ACBEC 80240C5C 24020003 */ addiu $v0, $zero, 3
/* 8ACBF0 80240C60 AE220070 */ sw $v0, 0x70($s1)
.L80240C64:
/* 8ACBF4 80240C64 0C00EABB */ jal get_npc_unsafe
/* 8ACBF8 80240C68 8E240074 */ lw $a0, 0x74($s1)
/* 8ACBFC 80240C6C 0040802D */ daddu $s0, $v0, $zero
/* 8ACC00 80240C70 8E230070 */ lw $v1, 0x70($s1)
/* 8ACC04 80240C74 2402FFFF */ addiu $v0, $zero, -1
/* 8ACC08 80240C78 2463FFFF */ addiu $v1, $v1, -1
/* 8ACC0C 80240C7C 10620003 */ beq $v1, $v0, .L80240C8C
/* 8ACC10 80240C80 AE230070 */ sw $v1, 0x70($s1)
/* 8ACC14 80240C84 08090327 */ j .L80240C9C
/* 8ACC18 80240C88 0000102D */ daddu $v0, $zero, $zero
.L80240C8C:
/* 8ACC1C 80240C8C 3C01C47A */ lui $at, 0xc47a
/* 8ACC20 80240C90 44810000 */ mtc1 $at, $f0
/* 8ACC24 80240C94 24020002 */ addiu $v0, $zero, 2
/* 8ACC28 80240C98 E600003C */ swc1 $f0, 0x3c($s0)
.L80240C9C:
/* 8ACC2C 80240C9C 8FBF0020 */ lw $ra, 0x20($sp)
/* 8ACC30 80240CA0 8FB1001C */ lw $s1, 0x1c($sp)
/* 8ACC34 80240CA4 8FB00018 */ lw $s0, 0x18($sp)
/* 8ACC38 80240CA8 03E00008 */ jr $ra
/* 8ACC3C 80240CAC 27BD0028 */ addiu $sp, $sp, 0x28

View File

@ -1,17 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_8024002C_8CA92C
/* 8CA92C 8024002C 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 8CA930 80240030 AFB00010 */ sw $s0, 0x10($sp)
/* 8CA934 80240034 AFBF0014 */ sw $ra, 0x14($sp)
/* 8CA938 80240038 0C039D59 */ jal get_player_data
/* 8CA93C 8024003C 0080802D */ daddu $s0, $a0, $zero
/* 8CA940 80240040 80430002 */ lb $v1, 2($v0)
/* 8CA944 80240044 AE030084 */ sw $v1, 0x84($s0)
/* 8CA948 80240048 8FBF0014 */ lw $ra, 0x14($sp)
/* 8CA94C 8024004C 8FB00010 */ lw $s0, 0x10($sp)
/* 8CA950 80240050 24020002 */ addiu $v0, $zero, 2
/* 8CA954 80240054 03E00008 */ jr $ra
/* 8CA958 80240058 27BD0018 */ addiu $sp, $sp, 0x18
/* 8CA95C 8024005C 00000000 */ nop

View File

@ -33,6 +33,8 @@ s32 get_model_list_index_from_tree_index(s32 treeIndex);
void get_model_center_and_size(s32 modelID, f32* centerX, f32* centerY, f32* centerZ, f32* sizeX, f32* sizeY,
f32* sizeZ);
void func_8006FEF0(s32, f32, f32, f32, f32);
void func_80071750(s32, f32, f32, f32, f32, s32);
void func_80072950(s32, f32, f32, f32, f32, s32 time);
void update_collider_transform(s16 colliderID);
@ -74,6 +76,8 @@ void fx_walk_normal(s32 arg0, f32 arg1, f32 arg2, f32 arg3, s32 arg4, s32 arg5);
f32 func_800E0088(f32, f32);
s32 func_800EB168(s32);
PlayerData* get_player_data(void);
// Partner
void func_800EBA3C(Npc* partner);
void func_800EBB40(Npc* partner);

View File

@ -34,7 +34,7 @@ INCLUDE_ASM(s32, "os/code_4ac90_len_3910", func_8006FE30);
INCLUDE_ASM(s32, "os/code_4ac90_len_3910", fx_emote);
INCLUDE_ASM(s32, "os/code_4ac90_len_3910", func_8006FEF0);
INCLUDE_ASM(void, "os/code_4ac90_len_3910", func_8006FEF0, s32 a0, f32 a1, f32 a2, f32 a3, f32 a4);
INCLUDE_ASM(s32, "os/code_4ac90_len_3910", func_8006FF50);
@ -164,7 +164,7 @@ INCLUDE_ASM(s32, "os/code_4ac90_len_3910", func_80071690);
INCLUDE_ASM(s32, "os/code_4ac90_len_3910", func_800716F0);
INCLUDE_ASM(s32, "os/code_4ac90_len_3910", func_80071750);
INCLUDE_ASM(void, "os/code_4ac90_len_3910", func_80071750, s32 a0, f32 a1, f32 a2, f32 a3, f32 a4, s32 a5);
INCLUDE_ASM(s32, "os/code_4ac90_len_3910", func_800717B0);

View File

@ -4,13 +4,31 @@ INCLUDE_ASM(s32, "world/area_kmr/kmr_00/8ABF90", func_80240000_8ABF90);
INCLUDE_ASM(s32, "world/area_kmr/kmr_00/8ABF90", func_80240388_8AC318);
INCLUDE_ASM(s32, "world/area_kmr/kmr_00/8ABF90", func_802403B8_8AC348);
ApiStatus func_802403B8_8AC348(ScriptInstance* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 var0 = get_variable(script, *args++);
s32 var1 = get_variable(script, *args++);
s32 var2 = get_variable(script, *args++);
s32 var3 = get_variable(script, *args++);
s32 var4 = get_variable(script, *args++);
INCLUDE_ASM(s32, "world/area_kmr/kmr_00/8ABF90", func_802404A0_8AC430);
func_8006FEF0(var0, var1, var2, var3, var4);
return ApiStatus_DONE2;
}
ApiStatus func_802404A0_8AC430(ScriptInstance* script, s32 isInitialCall) {
func_80071750(4, 0.0f, 0.0f, 0.0f, 0.3f, 30);
return ApiStatus_DONE2;
}
INCLUDE_ASM(s32, "world/area_kmr/kmr_00/8ABF90", func_802404E8_8AC478);
INCLUDE_ASM(s32, "world/area_kmr/kmr_00/8ABF90", func_80240530_8AC4C0);
ApiStatus func_80240530_8AC4C0(ScriptInstance* script, s32 isInitialCall) {
Npc* npc = get_npc_unsafe(get_variable(script, *script->ptrReadPos));
func_8006FEF0(3, npc->pos.x, npc->pos.y + 10.0f, npc->pos.z, 10.0f);
return ApiStatus_DONE2;
}
ApiStatus func_80240584_8AC514(ScriptInstance* script, s32 isInitialCall) {
func_8005553C(0, 2000);
@ -29,6 +47,26 @@ ApiStatus func_802405CC_8AC55C(ScriptInstance* script, s32 isInitialCall) {
INCLUDE_ASM(s32, "world/area_kmr/kmr_00/8ABF90", func_802405F0_8AC580);
INCLUDE_ASM(s32, "world/area_kmr/kmr_00/8ABF90", func_80240BD8_8ACB68);
ApiStatus func_80240BD8_8ACB68(ScriptInstance* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
Npc* npc;
if (isInitialCall) {
script->functionTemp[1].s = get_variable(script, *args);
npc = get_npc_unsafe(script->functionTemp[1].s);
play_sound_at_position(0xB000001E, 0, npc->pos.x, npc->pos.y, npc->pos.z);
func_8006FEF0(0, npc->pos.x, npc->pos.y + 20.0f, npc->pos.z, 10.0f);
script->functionTemp[0].s = 3;
}
npc = get_npc_unsafe(script->functionTemp[1].s);
script->functionTemp[0].s--;
if (script->functionTemp[0].s == -1) {
npc->pos.y = -1000.0f;
return ApiStatus_DONE2;
}
return ApiStatus_BLOCK;
}
INCLUDE_ASM(s32, "world/area_kmr/kmr_00/8ABF90", func_80240CB0_8ACC40);

View File

@ -2,4 +2,8 @@
#include "world/common/CheckPartnerFlags1000.inc.c"
INCLUDE_ASM(s32, "world/area_kmr/kmr_04/8CA900", func_8024002C_8CA92C);
ApiStatus func_8024002C_8CA92C(ScriptInstance* script, s32 isInitialCall) {
script->varTable[0] = get_player_data()->curHP;
return ApiStatus_DONE2;
}