a few more

This commit is contained in:
Ethan Roseman 2020-11-02 15:19:04 -05:00
parent 5a0dea8665
commit 743619e28f
12 changed files with 56 additions and 183 deletions

View File

@ -1,8 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_80240434_8CAD34
/* 8CAD34 80240434 3C018011 */ lui $at, %hi(gPlayerData+0x1)
/* 8CAD38 80240438 A020F291 */ sb $zero, %lo(gPlayerData+0x1)($at)
/* 8CAD3C 8024043C 03E00008 */ jr $ra
/* 8CAD40 80240440 24020002 */ addiu $v0, $zero, 2

View File

@ -1,15 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_80240444_8CAD44
/* 8CAD44 80240444 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 8CAD48 80240448 AFBF0010 */ sw $ra, 0x10($sp)
/* 8CAD4C 8024044C 0C04417A */ jal get_entity_by_index
/* 8CAD50 80240450 8C840084 */ lw $a0, 0x84($a0)
/* 8CAD54 80240454 0C043F5A */ jal func_8010FD68
/* 8CAD58 80240458 0040202D */ daddu $a0, $v0, $zero
/* 8CAD5C 8024045C 8FBF0010 */ lw $ra, 0x10($sp)
/* 8CAD60 80240460 24020002 */ addiu $v0, $zero, 2
/* 8CAD64 80240464 03E00008 */ jr $ra
/* 8CAD68 80240468 27BD0018 */ addiu $sp, $sp, 0x18
/* 8CAD6C 8024046C 00000000 */ nop

View File

@ -1,23 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_8024173C_8CF7AC
/* 8CF7AC 8024173C 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 8CF7B0 80241740 AFB00010 */ sw $s0, 0x10($sp)
/* 8CF7B4 80241744 0080802D */ daddu $s0, $a0, $zero
/* 8CF7B8 80241748 AFBF0014 */ sw $ra, 0x14($sp)
/* 8CF7BC 8024174C 0C00FB5A */ jal get_enemy_safe
/* 8CF7C0 80241750 24040006 */ addiu $a0, $zero, 6
/* 8CF7C4 80241754 14400003 */ bnez $v0, .L80241764
/* 8CF7C8 80241758 24020001 */ addiu $v0, $zero, 1
/* 8CF7CC 8024175C 080905DA */ j .L80241768
/* 8CF7D0 80241760 AE000084 */ sw $zero, 0x84($s0)
.L80241764:
/* 8CF7D4 80241764 AE020084 */ sw $v0, 0x84($s0)
.L80241768:
/* 8CF7D8 80241768 8FBF0014 */ lw $ra, 0x14($sp)
/* 8CF7DC 8024176C 8FB00010 */ lw $s0, 0x10($sp)
/* 8CF7E0 80241770 24020002 */ addiu $v0, $zero, 2
/* 8CF7E4 80241774 03E00008 */ jr $ra
/* 8CF7E8 80241778 27BD0018 */ addiu $sp, $sp, 0x18
/* 8CF7EC 8024177C 00000000 */ nop

View File

@ -1,58 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_80241CC8_8D31D8
/* 8D31D8 80241CC8 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 8D31DC 80241CCC AFB00010 */ sw $s0, 0x10($sp)
/* 8D31E0 80241CD0 0080802D */ daddu $s0, $a0, $zero
/* 8D31E4 80241CD4 3C05FD05 */ lui $a1, 0xfd05
/* 8D31E8 80241CD8 34A50F8A */ ori $a1, $a1, 0xf8a
/* 8D31EC 80241CDC AFBF0020 */ sw $ra, 0x20($sp)
/* 8D31F0 80241CE0 AFB3001C */ sw $s3, 0x1c($sp)
/* 8D31F4 80241CE4 AFB20018 */ sw $s2, 0x18($sp)
/* 8D31F8 80241CE8 0C0B1EAF */ jal get_variable
/* 8D31FC 80241CEC AFB10014 */ sw $s1, 0x14($sp)
/* 8D3200 80241CF0 0200202D */ daddu $a0, $s0, $zero
/* 8D3204 80241CF4 3C05FD05 */ lui $a1, 0xfd05
/* 8D3208 80241CF8 34A50F8B */ ori $a1, $a1, 0xf8b
/* 8D320C 80241CFC 0C0B1EAF */ jal get_variable
/* 8D3210 80241D00 0040902D */ daddu $s2, $v0, $zero
/* 8D3214 80241D04 0200202D */ daddu $a0, $s0, $zero
/* 8D3218 80241D08 3C05FD05 */ lui $a1, 0xfd05
/* 8D321C 80241D0C 34A50F8C */ ori $a1, $a1, 0xf8c
/* 8D3220 80241D10 0C0B1EAF */ jal get_variable
/* 8D3224 80241D14 0040982D */ daddu $s3, $v0, $zero
/* 8D3228 80241D18 8E440004 */ lw $a0, 4($s2)
/* 8D322C 80241D1C 0C048D70 */ jal func_801235C0
/* 8D3230 80241D20 0040882D */ daddu $s1, $v0, $zero
/* 8D3234 80241D24 0C00AB4B */ jal heap_free
/* 8D3238 80241D28 0240202D */ daddu $a0, $s2, $zero
/* 8D323C 80241D2C 0C00AB4B */ jal heap_free
/* 8D3240 80241D30 0260202D */ daddu $a0, $s3, $zero
/* 8D3244 80241D34 0C00AB4B */ jal heap_free
/* 8D3248 80241D38 0220202D */ daddu $a0, $s1, $zero
/* 8D324C 80241D3C 0200202D */ daddu $a0, $s0, $zero
/* 8D3250 80241D40 3C05FD05 */ lui $a1, 0xfd05
/* 8D3254 80241D44 34A50F8A */ ori $a1, $a1, 0xf8a
/* 8D3258 80241D48 0C0B2026 */ jal set_variable
/* 8D325C 80241D4C 0000302D */ daddu $a2, $zero, $zero
/* 8D3260 80241D50 0200202D */ daddu $a0, $s0, $zero
/* 8D3264 80241D54 3C05FD05 */ lui $a1, 0xfd05
/* 8D3268 80241D58 34A50F8B */ ori $a1, $a1, 0xf8b
/* 8D326C 80241D5C 0C0B2026 */ jal set_variable
/* 8D3270 80241D60 0000302D */ daddu $a2, $zero, $zero
/* 8D3274 80241D64 0200202D */ daddu $a0, $s0, $zero
/* 8D3278 80241D68 3C05FD05 */ lui $a1, 0xfd05
/* 8D327C 80241D6C 34A50F8C */ ori $a1, $a1, 0xf8c
/* 8D3280 80241D70 0C0B2026 */ jal set_variable
/* 8D3284 80241D74 0000302D */ daddu $a2, $zero, $zero
/* 8D3288 80241D78 8FBF0020 */ lw $ra, 0x20($sp)
/* 8D328C 80241D7C 8FB3001C */ lw $s3, 0x1c($sp)
/* 8D3290 80241D80 8FB20018 */ lw $s2, 0x18($sp)
/* 8D3294 80241D84 8FB10014 */ lw $s1, 0x14($sp)
/* 8D3298 80241D88 8FB00010 */ lw $s0, 0x10($sp)
/* 8D329C 80241D8C 24020002 */ addiu $v0, $zero, 2
/* 8D32A0 80241D90 03E00008 */ jr $ra
/* 8D32A4 80241D94 27BD0028 */ addiu $sp, $sp, 0x28
/* 8D32A8 80241D98 00000000 */ nop
/* 8D32AC 80241D9C 00000000 */ nop

View File

@ -1,18 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802414F8_8D72F8
/* 8D72F8 802414F8 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 8D72FC 802414FC AFB00010 */ sw $s0, 0x10($sp)
/* 8D7300 80241500 0080802D */ daddu $s0, $a0, $zero
/* 8D7304 80241504 AFBF0014 */ sw $ra, 0x14($sp)
/* 8D7308 80241508 0C00FB5A */ jal get_enemy_safe
/* 8D730C 8024150C 24040002 */ addiu $a0, $zero, 2
/* 8D7310 80241510 AE020084 */ sw $v0, 0x84($s0)
/* 8D7314 80241514 8FBF0014 */ lw $ra, 0x14($sp)
/* 8D7318 80241518 8FB00010 */ lw $s0, 0x10($sp)
/* 8D731C 8024151C 24020002 */ addiu $v0, $zero, 2
/* 8D7320 80241520 03E00008 */ jr $ra
/* 8D7324 80241524 27BD0018 */ addiu $sp, $sp, 0x18
/* 8D7328 80241528 00000000 */ nop
/* 8D732C 8024152C 00000000 */ nop

View File

@ -1,55 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_80240304_8D87D4
/* 8D87D4 80240304 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 8D87D8 80240308 AFB10014 */ sw $s1, 0x14($sp)
/* 8D87DC 8024030C 0080882D */ daddu $s1, $a0, $zero
/* 8D87E0 80240310 AFBF0020 */ sw $ra, 0x20($sp)
/* 8D87E4 80240314 AFB3001C */ sw $s3, 0x1c($sp)
/* 8D87E8 80240318 AFB20018 */ sw $s2, 0x18($sp)
/* 8D87EC 8024031C AFB00010 */ sw $s0, 0x10($sp)
/* 8D87F0 80240320 8E30000C */ lw $s0, 0xc($s1)
/* 8D87F4 80240324 8E050000 */ lw $a1, ($s0)
/* 8D87F8 80240328 0C0B1EAF */ jal get_variable
/* 8D87FC 8024032C 26100004 */ addiu $s0, $s0, 4
/* 8D8800 80240330 8E050000 */ lw $a1, ($s0)
/* 8D8804 80240334 26100004 */ addiu $s0, $s0, 4
/* 8D8808 80240338 0220202D */ daddu $a0, $s1, $zero
/* 8D880C 8024033C 0C0B1EAF */ jal get_variable
/* 8D8810 80240340 0040982D */ daddu $s3, $v0, $zero
/* 8D8814 80240344 8E050000 */ lw $a1, ($s0)
/* 8D8818 80240348 26100004 */ addiu $s0, $s0, 4
/* 8D881C 8024034C 0220202D */ daddu $a0, $s1, $zero
/* 8D8820 80240350 0C0B1EAF */ jal get_variable
/* 8D8824 80240354 0040902D */ daddu $s2, $v0, $zero
/* 8D8828 80240358 0220202D */ daddu $a0, $s1, $zero
/* 8D882C 8024035C 8E050000 */ lw $a1, ($s0)
/* 8D8830 80240360 0C0B1EAF */ jal get_variable
/* 8D8834 80240364 0040882D */ daddu $s1, $v0, $zero
/* 8D8838 80240368 0260202D */ daddu $a0, $s3, $zero
/* 8D883C 8024036C 0C04417A */ jal get_entity_by_index
/* 8D8840 80240370 0040802D */ daddu $s0, $v0, $zero
/* 8D8844 80240374 0040182D */ daddu $v1, $v0, $zero
/* 8D8848 80240378 44920000 */ mtc1 $s2, $f0
/* 8D884C 8024037C 00000000 */ nop
/* 8D8850 80240380 46800020 */ cvt.s.w $f0, $f0
/* 8D8854 80240384 E4600048 */ swc1 $f0, 0x48($v1)
/* 8D8858 80240388 44910000 */ mtc1 $s1, $f0
/* 8D885C 8024038C 00000000 */ nop
/* 8D8860 80240390 46800020 */ cvt.s.w $f0, $f0
/* 8D8864 80240394 E460004C */ swc1 $f0, 0x4c($v1)
/* 8D8868 80240398 44900000 */ mtc1 $s0, $f0
/* 8D886C 8024039C 00000000 */ nop
/* 8D8870 802403A0 46800020 */ cvt.s.w $f0, $f0
/* 8D8874 802403A4 E4600050 */ swc1 $f0, 0x50($v1)
/* 8D8878 802403A8 8FBF0020 */ lw $ra, 0x20($sp)
/* 8D887C 802403AC 8FB3001C */ lw $s3, 0x1c($sp)
/* 8D8880 802403B0 8FB20018 */ lw $s2, 0x18($sp)
/* 8D8884 802403B4 8FB10014 */ lw $s1, 0x14($sp)
/* 8D8888 802403B8 8FB00010 */ lw $s0, 0x10($sp)
/* 8D888C 802403BC 24020002 */ addiu $v0, $zero, 2
/* 8D8890 802403C0 03E00008 */ jr $ra
/* 8D8894 802403C4 27BD0028 */ addiu $sp, $sp, 0x28
/* 8D8898 802403C8 00000000 */ nop
/* 8D889C 802403CC 00000000 */ nop

View File

@ -10,6 +10,14 @@ INCLUDE_ASM(s32, "world/area_kmr/kmr_04/8CA960", func_802402C8_8CABC8);
INCLUDE_ASM(s32, "world/area_kmr/kmr_04/8CA960", func_802403E0_8CACE0);
INCLUDE_ASM(s32, "world/area_kmr/kmr_04/8CA960", func_80240434_8CAD34);
ApiStatus func_80240434_8CAD34(ScriptInstance* script, s32 isInitialCall) {
gPlayerData.hammerLevel = 0;
INCLUDE_ASM(s32, "world/area_kmr/kmr_04/8CA960", func_80240444_8CAD44);
return ApiStatus_DONE2;
}
ApiStatus func_80240444_8CAD44(ScriptInstance* script, s32 isInitialCall) {
func_8010FD68(get_entity_by_index(script->varTable[0]));
return ApiStatus_DONE2;
}

View File

@ -2,5 +2,12 @@
#include "world/common/SomeMatrixOperations.inc.c"
ApiStatus func_8024173C_8CF7AC(ScriptInstance* script, s32 isInitialCall) {
if (get_enemy_safe(6) == NULL) {
script->varTable[0] = FALSE;
} else {
script->varTable[0] = TRUE;
}
INCLUDE_ASM(s32, "world/area_kmr/kmr_05/8CF570", func_8024173C_8CF7AC);
return ApiStatus_DONE2;
}

View File

@ -14,4 +14,21 @@ INCLUDE_ASM(s32, "world/area_kmr/kmr_06/8D2A10", func_80241A68_8D2F78);
INCLUDE_ASM(s32, "world/area_kmr/kmr_06/8D2A10", func_80241C78_8D3188);
INCLUDE_ASM(s32, "world/area_kmr/kmr_06/8D2A10", func_80241CC8_8D31D8);
ApiStatus func_80241CC8_8D31D8(ScriptInstance* script, s32 isInitialCall) {
// todo use correct types
s32* mapVar10 = get_variable(script, SI_MAP_VAR(10));
s32 mapVar11 = get_variable(script, SI_MAP_VAR(11));
s32 mapVar12 = get_variable(script, SI_MAP_VAR(12));
func_801235C0(mapVar10[1]);
heap_free(mapVar10);
heap_free(mapVar11);
heap_free(mapVar12);
set_variable(script, SI_MAP_VAR(10), 0);
set_variable(script, SI_MAP_VAR(11), 0);
set_variable(script, SI_MAP_VAR(12), 0);
return ApiStatus_DONE2;
}

View File

@ -22,4 +22,8 @@ INCLUDE_ASM(s32, "world/area_kmr/kmr_09/8D5E00", func_802411E8_8D6FE8);
INCLUDE_ASM(s32, "world/area_kmr/kmr_09/8D5E00", func_8024130C_8D710C);
INCLUDE_ASM(s32, "world/area_kmr/kmr_09/8D5E00", func_802414F8_8D72F8);
ApiStatus func_802414F8_8D72F8(ScriptInstance* script, s32 isInitialCall) {
script->varTable[0] = get_enemy_safe(2);
return ApiStatus_DONE2;
}

View File

@ -10,4 +10,17 @@ INCLUDE_ASM(s32, "world/area_kmr/kmr_10/8D84D0", func_80240268_8D8738);
INCLUDE_ASM(s32, "world/area_kmr/kmr_10/8D84D0", func_802402BC_8D878C);
INCLUDE_ASM(s32, "world/area_kmr/kmr_10/8D84D0", func_80240304_8D87D4);
ApiStatus func_80240304_8D87D4(ScriptInstance* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;
s32 entityIndex = get_variable(script, *args++);
s32 x = get_variable(script, *args++);
s32 y = get_variable(script, *args++);
s32 z = get_variable(script, *args++);
Entity* entity = get_entity_by_index(entityIndex);
entity->position.x = x;
entity->position.y = y;
entity->position.z = z;
return ApiStatus_DONE2;
}

View File

@ -564,6 +564,7 @@ EnemyNpcDefeat = 0x8007809C;
D_80078DB0 = 0x80078DB0;
D_80078DB4 = 0x80078DB4;
gEffectTable = 0x8007F214;
gItemTable = 0x800878E0; // size: 0x2D80
gAreas = 0x800934F0;
gCurrentEncounter = 0x800B0F10; // size:0xB0
gBattleState = 0x800DC068;