Decomp some Evt, fio, ItemEntity & other functions (#433)

* Decomp some evt, fio and item entity functions

* run coverage.py

* Remove redundant comment

* Make ItemEntity.type s8, MAX_ITEM_ENTITIES, style changes
This commit is contained in:
JaThePlayer 2021-09-26 00:13:36 +02:00 committed by GitHub
parent 04bf35bf39
commit bb6e9303dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 225 additions and 487 deletions

View File

@ -982,7 +982,7 @@ typedef struct ItemEntity {
/* 0x14 */ struct ItemEntityPhysicsData* physicsData;
/* 0x18 */ s16 itemID; /* into item table, also worldIconID */
/* 0x1A */ u8 state;
/* 0x1B */ u8 type;
/* 0x1B */ s8 type;
/* 0x1C */ u8 pickupDelay; /* num frames before item can be picked up */
/* 0x1D */ char unk_1D;
/* 0x1E */ s16 wsFaceAngle; /* < 0 means none */

View File

@ -494,7 +494,7 @@ s32 entity_can_collide_with_jumping_player(Entity* entity);
s32 set_global_flag(s32 index);
void entity_base_block_init(Entity* entity);
s32 entity_start_script(Entity* entity);
s32 remove_item_entity_by_index(s32 index); // might not actually return anything
void remove_item_entity_by_index(s32 index);
void set_entity_commandlist(Entity* entity, s32* entityScript);
void func_800EF3E4(void);
void func_80268858(void);

View File

@ -1,13 +1,22 @@
#include "common.h"
#define MAX_ITEM_ENTITIES 256
extern s32 D_801512F8;
extern s32 D_80155D84;
extern s32 D_80155D88;
extern ItemEntity* D_80155DA0;
extern ItemEntity* D_801561A0;
extern ItemEntity* D_80155DA0[MAX_ITEM_ENTITIES];
extern ItemEntity* D_801561A0[MAX_ITEM_ENTITIES];
extern ItemEntity** D_801565A0; // item entity list
extern s16 D_801565A4;
extern s16 D_801565A8;
extern s16 D_80155D8C;
extern s16 D_80155D8E;
extern s16 D_80155D90;
void delete_shadow(s16);
void draw_item_entities(void);
void func_80132D94(void);
INCLUDE_ASM(s32, "C50A0", draw_ci_image_with_clipping);
@ -116,13 +125,40 @@ void item_entity_enable_shadow(ItemEntity* itemEntity) {
}
}
INCLUDE_ASM(s32, "C50A0", clear_item_entity_data);
void clear_item_entity_data(void) {
s32 i;
if (!gGameStatusPtr->isBattle) {
D_801565A0 = D_80155DA0;
} else {
D_801565A0 = D_801561A0;
}
for (i = 0; i < MAX_ITEM_ENTITIES; i++) {
D_801565A0[i] = NULL;
}
D_801512F8 = 0;
D_80155D8C = 0;
D_80155D8E = 0;
D_80155D90 = 0;
D_80155D84 = 0;
if (!gGameStatusPtr->isBattle) {
D_80155D88 = 0;
}
create_generic_entity_world(NULL, draw_item_entities);
create_generic_entity_frontUI(NULL, func_80132D94);
D_801565A4 = 0;
D_801565A8 = 0;
}
void init_item_entity_list(void) {
if (!gGameStatusPtr->isBattle) {
D_801565A0 = &D_80155DA0;
D_801565A0 = D_80155DA0;
} else {
D_801565A0 = &D_801561A0;
D_801565A0 = D_801561A0;
}
D_801565A4 = 0;
@ -158,9 +194,55 @@ INCLUDE_ASM(s32, "C50A0", func_80132D94);
INCLUDE_ASM(s32, "C50A0", render_item_entities);
INCLUDE_ASM(s32, "C50A0", remove_item_entity_by_reference);
void remove_item_entity_by_reference(ItemEntity* entity) {
s32 index;
INCLUDE_ASM(s32, "C50A0", remove_item_entity_by_index);
for (index = 0; index < MAX_ITEM_ENTITIES; index++) {
if (D_801565A0[index] == entity) {
break;
}
}
if (index < MAX_ITEM_ENTITIES) {
if (entity->physicsData != NULL) {
heap_free(entity->physicsData);
}
switch (entity->type) {
case 0:
case 3:
case 12:
case 16:
case 20:
case 28:
delete_shadow(entity->shadowIndex);
break;
}
heap_free(D_801565A0[index]);
D_801565A4 = 0;
D_801565A0[index] = NULL;
}
}
void remove_item_entity_by_index(s32 index) {
ItemEntity* itemEntity = D_801565A0[index];
switch (itemEntity->type) {
case 0:
case 3:
case 12:
case 16:
case 20:
case 28:
delete_shadow(itemEntity->shadowIndex);
break;
}
heap_free(D_801565A0[index]);
D_801565A0[index] = NULL;
D_801565A4 = 0;
}
INCLUDE_ASM(s32, "C50A0", func_80133A94);

View File

@ -1144,16 +1144,68 @@ ApiStatus evt_handle_bind_lock(Evt* script) {
return ApiStatus_DONE2;
}
ApiStatus evt_handle_thread(Evt* script);
INCLUDE_ASM(s32, "evt/si", evt_handle_thread, Evt* script);
ApiStatus evt_handle_thread(Evt* script) {
Evt* newScript;
s32 nargs;
s32 opcode;
s32 i;
// seek end thread opcode
Bytecode* startLine = script->ptrNextLine;
Bytecode* endLine = startLine;
do {
opcode = *endLine++;
nargs = *endLine++;
endLine += nargs;
} while (opcode != EVT_OP_END_SPAWN_THREAD);
script->ptrNextLine = endLine;
newScript = start_script_in_group((EvtSource*)startLine, script->priority, 0x60, script->groupFlags);
newScript->owner1.enemyID = script->owner1.enemyID;
newScript->owner2.npcID = script->owner2.npcID;
newScript->array = script->array;
newScript->flagArray = script->flagArray;
for (i = 0; i < ARRAY_COUNT(script->varTable); i++) {
newScript->varTable[i] = script->varTable[i];
}
for (i = 0; i < ARRAY_COUNT(script->varFlags); i++) {
newScript->varFlags[i] = script->varFlags[i];
}
return ApiStatus_DONE2;
}
ApiStatus evt_handle_end_thread(Evt* script) {
kill_script(script);
return ApiStatus_FINISH;
}
ApiStatus evt_handle_child_thread(Evt* script);
INCLUDE_ASM(ApiStatus, "evt/si", evt_handle_child_thread, Evt* script);
ApiStatus evt_handle_child_thread(Evt* script) {
Evt* newScript;
s32 nargs;
s32 opcode;
s32 i;
Bytecode* startLine = script->ptrNextLine;
Bytecode* endLine = startLine;
do {
opcode = *endLine++;
nargs = *endLine++;
endLine += nargs;
} while (opcode != EVT_OP_END_PARALLEL_THREAD);
script->ptrNextLine = endLine;
newScript = func_802C39F8(script, startLine, 0x60);
newScript->owner1.enemyID = script->owner1.enemyID;
newScript->owner2.npcID = script->owner2.npcID;
newScript->groupFlags = script->groupFlags;
newScript->array = script->array;
newScript->flagArray = script->flagArray;
return ApiStatus_DONE2;
}
ApiStatus evt_handle_end_child_thread(Evt* script) {
kill_script(script);

View File

@ -1,5 +1,9 @@
#include "common.h"
extern Bytecode D_802D9D34[0];
extern s32 D_802DB7D0;
extern s32 D_802DB7D8[10];
extern s32 D_802DB800[10];
s32 func_802D5B10();
s32 D_802D9D30 = 0;
@ -10,7 +14,19 @@ EvtSource D_802D9D34 = SCRIPT({
INCLUDE_ASM(s32, "evt/fa4c0_len_3bf0", func_802D5B10);
INCLUDE_ASM(s32, "evt/fa4c0_len_3bf0", func_802D5C70);
ApiStatus func_802D5C70(Evt* script) {
s32 i;
D_802DB7D0 = evt_get_variable(script, *script->ptrReadPos);
for (i = 0; i < ARRAY_COUNT(D_802DB7D8); i++) {
D_802DB7D8[i] = 0;
D_802DB800[i] = 0;
}
start_script(&D_802D9D34, 1, 0);
return ApiStatus_DONE2;
}
ApiStatus FadeOutMusic(Evt* script, s32 isInitialCall) {
Bytecode* args = script->ptrReadPos;

View File

@ -6,8 +6,11 @@ extern s32 logicalSaveInfo[4][2]; // 0x8009BA30
extern s32 physicalSaveInfo[6][2]; // 0x8009BA50
extern s32 nextAvailableSavePage; // 0x8009BA80
extern s32 D_800D95E8[];
extern s32 D_8009A6B0[];
void fio_serialize_state(void);
void fio_erase_flash(s32 pageNum);
void fio_write_flash(s32 pageNum, s32* readBuffer, s32 numBytes);
s32 get_spirits_rescued(void) {
s32 storyProgress = evt_get_variable(NULL, EVT_STORY_PROGRESS);
@ -70,7 +73,21 @@ s32 fio_has_valid_backup(void) {
return TRUE;
}
INCLUDE_ASM(s32, "fio", fio_flush_backups);
s32 fio_flush_backups(void) {
s32 checksum;
strcpy(D_800D95E8, &magicSaveString);
D_800D95E8[12] = 0;
D_800D95E8[13] = -1;
checksum = fio_calc_header_checksum();
D_800D95E8[12] = checksum;
D_800D95E8[13] = ~checksum;
fio_erase_flash(6);
fio_write_flash(6, D_800D95E8, 128);
fio_erase_flash(7);
fio_write_flash(7, D_800D95E8, 128);
return 1;
}
s32 fio_calc_file_checksum(SaveData* saveData) {
u32 sum = 0;
@ -90,7 +107,46 @@ s32 fio_validate_file_checksum(SaveData* saveData) {
return FALSE;
}
INCLUDE_ASM(s32, "fio", fio_fetch_saved_file_info);
s32 fio_fetch_saved_file_info(void) {
s32* buffer = D_8009A6B0;
void* bufferPtr = (void*)buffer;
s32 i, j, savePage;
for (i = 0; i < ARRAY_COUNT(logicalSaveInfo); i++) {
logicalSaveInfo[i][0] = -1;
logicalSaveInfo[i][1] = -1;
}
for (i = 0; i < ARRAY_COUNT(physicalSaveInfo); i++) {
fio_read_flash(i, bufferPtr, sizeof(SaveData));
if (fio_validate_file_checksum(bufferPtr) != 0) {
physicalSaveInfo[i][0] = buffer[14];
physicalSaveInfo[i][1] = buffer[15];
if (logicalSaveInfo[buffer[14]][1] < buffer[15]) {
logicalSaveInfo[buffer[14]][0] = i;
logicalSaveInfo[buffer[14]][1] = buffer[15];
}
}
}
savePage = 0x7FFFFFFF;
for (j = 0; j < ARRAY_COUNT(physicalSaveInfo); j++) {
for (i = 0; i < ARRAY_COUNT(logicalSaveInfo); i++) {
if (j == logicalSaveInfo[i][0]) {
break;
}
}
if (i == ARRAY_COUNT(logicalSaveInfo)) {
if (physicalSaveInfo[j][1] < savePage) {
savePage = physicalSaveInfo[j][1];
nextAvailableSavePage = j;
}
}
}
return 1;
}
s32 fio_load_game(s32 saveSlot) {
gGameStatusPtr->saveSlot = saveSlot;

View File

@ -243,7 +243,9 @@ void get_hud_element_render_pos(s32 id, s32* x, s32* y) {
*y = hudElement->renderPosY;
}
INCLUDE_ASM(void, "hud_element", set_hud_element_render_depth, s32 id, s32 z);
void set_hud_element_render_depth(s32 id, s32 z) {
hudElements[id & ~0x800]->worldPosOffset.z = z;
}
void set_hud_element_flags(s32 id, s32 flags) {
hudElements[id & ~0x800]->flags.as_word |= flags;

View File

@ -1,63 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel clear_item_entity_data
/* C76F0 80130FF0 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* C76F4 80130FF4 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* C76F8 80130FF8 27BDFFE8 */ addiu $sp, $sp, -0x18
/* C76FC 80130FFC AFBF0010 */ sw $ra, 0x10($sp)
/* C7700 80131000 80420070 */ lb $v0, 0x70($v0)
/* C7704 80131004 14400005 */ bnez $v0, .L8013101C
/* C7708 80131008 00000000 */ nop
/* C770C 8013100C 3C028015 */ lui $v0, %hi(D_80155DA0)
/* C7710 80131010 24425DA0 */ addiu $v0, $v0, %lo(D_80155DA0)
/* C7714 80131014 0804C409 */ j .L80131024
/* C7718 80131018 00000000 */ nop
.L8013101C:
/* C771C 8013101C 3C028015 */ lui $v0, %hi(D_801561A0)
/* C7720 80131020 244261A0 */ addiu $v0, $v0, %lo(D_801561A0)
.L80131024:
/* C7724 80131024 3C018015 */ lui $at, %hi(D_801565A0)
/* C7728 80131028 AC2265A0 */ sw $v0, %lo(D_801565A0)($at)
/* C772C 8013102C 3C028015 */ lui $v0, %hi(D_801565A0)
/* C7730 80131030 8C4265A0 */ lw $v0, %lo(D_801565A0)($v0)
/* C7734 80131034 240300FF */ addiu $v1, $zero, 0xff
/* C7738 80131038 244203FC */ addiu $v0, $v0, 0x3fc
.L8013103C:
/* C773C 8013103C AC400000 */ sw $zero, ($v0)
/* C7740 80131040 2463FFFF */ addiu $v1, $v1, -1
/* C7744 80131044 0461FFFD */ bgez $v1, .L8013103C
/* C7748 80131048 2442FFFC */ addiu $v0, $v0, -4
/* C774C 8013104C 3C028007 */ lui $v0, %hi(gGameStatusPtr)
/* C7750 80131050 8C42419C */ lw $v0, %lo(gGameStatusPtr)($v0)
/* C7754 80131054 3C018015 */ lui $at, %hi(D_801512F8)
/* C7758 80131058 AC2012F8 */ sw $zero, %lo(D_801512F8)($at)
/* C775C 8013105C 3C018015 */ lui $at, %hi(D_80155D8C)
/* C7760 80131060 A4205D8C */ sh $zero, %lo(D_80155D8C)($at)
/* C7764 80131064 3C018015 */ lui $at, %hi(D_80155D8E)
/* C7768 80131068 A4205D8E */ sh $zero, %lo(D_80155D8E)($at)
/* C776C 8013106C 3C018015 */ lui $at, %hi(D_80155D90)
/* C7770 80131070 A4205D90 */ sh $zero, %lo(D_80155D90)($at)
/* C7774 80131074 3C018015 */ lui $at, %hi(D_80155D84)
/* C7778 80131078 AC205D84 */ sw $zero, %lo(D_80155D84)($at)
/* C777C 8013107C 80420070 */ lb $v0, 0x70($v0)
/* C7780 80131080 14400003 */ bnez $v0, .L80131090
/* C7784 80131084 00000000 */ nop
/* C7788 80131088 3C018015 */ lui $at, %hi(D_80155D88)
/* C778C 8013108C AC205D88 */ sw $zero, %lo(D_80155D88)($at)
.L80131090:
/* C7790 80131090 3C058013 */ lui $a1, %hi(draw_item_entities)
/* C7794 80131094 24A52C80 */ addiu $a1, $a1, %lo(draw_item_entities)
/* C7798 80131098 0C048C56 */ jal create_generic_entity_world
/* C779C 8013109C 0000202D */ daddu $a0, $zero, $zero
/* C77A0 801310A0 3C058013 */ lui $a1, %hi(func_80132D94)
/* C77A4 801310A4 24A52D94 */ addiu $a1, $a1, %lo(func_80132D94)
/* C77A8 801310A8 0C048C8F */ jal create_generic_entity_frontUI
/* C77AC 801310AC 0000202D */ daddu $a0, $zero, $zero
/* C77B0 801310B0 8FBF0010 */ lw $ra, 0x10($sp)
/* C77B4 801310B4 3C018015 */ lui $at, %hi(D_801565A4)
/* C77B8 801310B8 A42065A4 */ sh $zero, %lo(D_801565A4)($at)
/* C77BC 801310BC 3C018015 */ lui $at, %hi(D_801565A8)
/* C77C0 801310C0 A42065A8 */ sh $zero, %lo(D_801565A8)($at)
/* C77C4 801310C4 03E00008 */ jr $ra
/* C77C8 801310C8 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,51 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.section .rodata
glabel jtbl_80150DA0
.word L80133A48_CA148, L80133A50_CA150, L80133A50_CA150, L80133A48_CA148, L80133A50_CA150, L80133A50_CA150, L80133A50_CA150, L80133A50_CA150, L80133A50_CA150, L80133A50_CA150, L80133A50_CA150, L80133A50_CA150, L80133A48_CA148, L80133A50_CA150, L80133A50_CA150, L80133A50_CA150, L80133A48_CA148, L80133A50_CA150, L80133A50_CA150, L80133A50_CA150, L80133A48_CA148, L80133A50_CA150, L80133A50_CA150, L80133A50_CA150, L80133A50_CA150, L80133A50_CA150, L80133A50_CA150, L80133A50_CA150, L80133A48_CA148, 0
.section .text
glabel remove_item_entity_by_index
/* CA0FC 801339FC 27BDFFE0 */ addiu $sp, $sp, -0x20
/* CA100 80133A00 AFB00010 */ sw $s0, 0x10($sp)
/* CA104 80133A04 0080802D */ daddu $s0, $a0, $zero
/* CA108 80133A08 3C028015 */ lui $v0, %hi(D_801565A0)
/* CA10C 80133A0C 8C4265A0 */ lw $v0, %lo(D_801565A0)($v0)
/* CA110 80133A10 00101880 */ sll $v1, $s0, 2
/* CA114 80133A14 AFBF0018 */ sw $ra, 0x18($sp)
/* CA118 80133A18 AFB10014 */ sw $s1, 0x14($sp)
/* CA11C 80133A1C 00621821 */ addu $v1, $v1, $v0
/* CA120 80133A20 8C630000 */ lw $v1, ($v1)
/* CA124 80133A24 8064001B */ lb $a0, 0x1b($v1)
/* CA128 80133A28 2C82001D */ sltiu $v0, $a0, 0x1d
/* CA12C 80133A2C 10400008 */ beqz $v0, L80133A50_CA150
/* CA130 80133A30 00041080 */ sll $v0, $a0, 2
/* CA134 80133A34 3C018015 */ lui $at, %hi(jtbl_80150DA0)
/* CA138 80133A38 00220821 */ addu $at, $at, $v0
/* CA13C 80133A3C 8C220DA0 */ lw $v0, %lo(jtbl_80150DA0)($at)
/* CA140 80133A40 00400008 */ jr $v0
/* CA144 80133A44 00000000 */ nop
glabel L80133A48_CA148
/* CA148 80133A48 0C0448CA */ jal delete_shadow
/* CA14C 80133A4C 84640020 */ lh $a0, 0x20($v1)
glabel L80133A50_CA150
/* CA150 80133A50 3C118015 */ lui $s1, %hi(D_801565A0)
/* CA154 80133A54 263165A0 */ addiu $s1, $s1, %lo(D_801565A0)
/* CA158 80133A58 8E220000 */ lw $v0, ($s1)
/* CA15C 80133A5C 00108080 */ sll $s0, $s0, 2
/* CA160 80133A60 02021021 */ addu $v0, $s0, $v0
/* CA164 80133A64 0C00AB4B */ jal heap_free
/* CA168 80133A68 8C440000 */ lw $a0, ($v0)
/* CA16C 80133A6C 8E220000 */ lw $v0, ($s1)
/* CA170 80133A70 02028021 */ addu $s0, $s0, $v0
/* CA174 80133A74 AE000000 */ sw $zero, ($s0)
/* CA178 80133A78 8FBF0018 */ lw $ra, 0x18($sp)
/* CA17C 80133A7C 8FB10014 */ lw $s1, 0x14($sp)
/* CA180 80133A80 8FB00010 */ lw $s0, 0x10($sp)
/* CA184 80133A84 3C018015 */ lui $at, %hi(D_801565A4)
/* CA188 80133A88 A42065A4 */ sh $zero, %lo(D_801565A4)($at)
/* CA18C 80133A8C 03E00008 */ jr $ra
/* CA190 80133A90 27BD0020 */ addiu $sp, $sp, 0x20

View File

@ -1,68 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.section .rodata
glabel jtbl_80150D28
.word L801339B0_CA0B0, L801339B8_CA0B8, L801339B8_CA0B8, L801339B0_CA0B0, L801339B8_CA0B8, L801339B8_CA0B8, L801339B8_CA0B8, L801339B8_CA0B8, L801339B8_CA0B8, L801339B8_CA0B8, L801339B8_CA0B8, L801339B8_CA0B8, L801339B0_CA0B0, L801339B8_CA0B8, L801339B8_CA0B8, L801339B8_CA0B8, L801339B0_CA0B0, L801339B8_CA0B8, L801339B8_CA0B8, L801339B8_CA0B8, L801339B0_CA0B0, L801339B8_CA0B8, L801339B8_CA0B8, L801339B8_CA0B8, L801339B8_CA0B8, L801339B8_CA0B8, L801339B8_CA0B8, L801339B8_CA0B8, L801339B0_CA0B0, 0
.section .text
glabel remove_item_entity_by_reference
/* CA030 80133930 3C038015 */ lui $v1, %hi(D_801565A0)
/* CA034 80133934 8C6365A0 */ lw $v1, %lo(D_801565A0)($v1)
/* CA038 80133938 27BDFFE0 */ addiu $sp, $sp, -0x20
/* CA03C 8013393C AFB10014 */ sw $s1, 0x14($sp)
/* CA040 80133940 0080882D */ daddu $s1, $a0, $zero
/* CA044 80133944 AFB00010 */ sw $s0, 0x10($sp)
/* CA048 80133948 0000802D */ daddu $s0, $zero, $zero
/* CA04C 8013394C AFBF0018 */ sw $ra, 0x18($sp)
.L80133950:
/* CA050 80133950 8C620000 */ lw $v0, ($v1)
/* CA054 80133954 10510006 */ beq $v0, $s1, .L80133970
/* CA058 80133958 2A020100 */ slti $v0, $s0, 0x100
/* CA05C 8013395C 26100001 */ addiu $s0, $s0, 1
/* CA060 80133960 2A020100 */ slti $v0, $s0, 0x100
/* CA064 80133964 1440FFFA */ bnez $v0, .L80133950
/* CA068 80133968 24630004 */ addiu $v1, $v1, 4
/* CA06C 8013396C 2A020100 */ slti $v0, $s0, 0x100
.L80133970:
/* CA070 80133970 1040001D */ beqz $v0, .L801339E8
/* CA074 80133974 00000000 */ nop
/* CA078 80133978 8E240014 */ lw $a0, 0x14($s1)
/* CA07C 8013397C 10800003 */ beqz $a0, .L8013398C
/* CA080 80133980 00000000 */ nop
/* CA084 80133984 0C00AB4B */ jal heap_free
/* CA088 80133988 00000000 */ nop
.L8013398C:
/* CA08C 8013398C 8223001B */ lb $v1, 0x1b($s1)
/* CA090 80133990 2C62001D */ sltiu $v0, $v1, 0x1d
/* CA094 80133994 10400008 */ beqz $v0, L801339B8_CA0B8
/* CA098 80133998 00031080 */ sll $v0, $v1, 2
/* CA09C 8013399C 3C018015 */ lui $at, %hi(jtbl_80150D28)
/* CA0A0 801339A0 00220821 */ addu $at, $at, $v0
/* CA0A4 801339A4 8C220D28 */ lw $v0, %lo(jtbl_80150D28)($at)
/* CA0A8 801339A8 00400008 */ jr $v0
/* CA0AC 801339AC 00000000 */ nop
glabel L801339B0_CA0B0
/* CA0B0 801339B0 0C0448CA */ jal delete_shadow
/* CA0B4 801339B4 86240020 */ lh $a0, 0x20($s1)
glabel L801339B8_CA0B8
/* CA0B8 801339B8 3C118015 */ lui $s1, %hi(D_801565A0)
/* CA0BC 801339BC 263165A0 */ addiu $s1, $s1, %lo(D_801565A0)
/* CA0C0 801339C0 8E220000 */ lw $v0, ($s1)
/* CA0C4 801339C4 00108080 */ sll $s0, $s0, 2
/* CA0C8 801339C8 02021021 */ addu $v0, $s0, $v0
/* CA0CC 801339CC 0C00AB4B */ jal heap_free
/* CA0D0 801339D0 8C440000 */ lw $a0, ($v0)
/* CA0D4 801339D4 8E220000 */ lw $v0, ($s1)
/* CA0D8 801339D8 3C018015 */ lui $at, %hi(D_801565A4)
/* CA0DC 801339DC A42065A4 */ sh $zero, %lo(D_801565A4)($at)
/* CA0E0 801339E0 02028021 */ addu $s0, $s0, $v0
/* CA0E4 801339E4 AE000000 */ sw $zero, ($s0)
.L801339E8:
/* CA0E8 801339E8 8FBF0018 */ lw $ra, 0x18($sp)
/* CA0EC 801339EC 8FB10014 */ lw $s1, 0x14($sp)
/* CA0F0 801339F0 8FB00010 */ lw $s0, 0x10($sp)
/* CA0F4 801339F4 03E00008 */ jr $ra
/* CA0F8 801339F8 27BD0020 */ addiu $sp, $sp, 0x20

View File

@ -1,33 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802D5C70
/* FA620 802D5C70 27BDFFE8 */ addiu $sp, $sp, -0x18
/* FA624 802D5C74 AFBF0010 */ sw $ra, 0x10($sp)
/* FA628 802D5C78 8C82000C */ lw $v0, 0xc($a0)
/* FA62C 802D5C7C 0C0B1EAF */ jal evt_get_variable
/* FA630 802D5C80 8C450000 */ lw $a1, ($v0)
/* FA634 802D5C84 0000282D */ daddu $a1, $zero, $zero
/* FA638 802D5C88 3C04802E */ lui $a0, %hi(D_802DB800)
/* FA63C 802D5C8C 2484B800 */ addiu $a0, $a0, %lo(D_802DB800)
/* FA640 802D5C90 3C03802E */ lui $v1, %hi(D_802DB7D8)
/* FA644 802D5C94 2463B7D8 */ addiu $v1, $v1, %lo(D_802DB7D8)
/* FA648 802D5C98 3C01802E */ lui $at, %hi(D_802DB7D0)
/* FA64C 802D5C9C AC22B7D0 */ sw $v0, %lo(D_802DB7D0)($at)
.L802D5CA0:
/* FA650 802D5CA0 AC600000 */ sw $zero, ($v1)
/* FA654 802D5CA4 AC800000 */ sw $zero, ($a0)
/* FA658 802D5CA8 24840004 */ addiu $a0, $a0, 4
/* FA65C 802D5CAC 24A50001 */ addiu $a1, $a1, 1
/* FA660 802D5CB0 28A2000A */ slti $v0, $a1, 0xa
/* FA664 802D5CB4 1440FFFA */ bnez $v0, .L802D5CA0
/* FA668 802D5CB8 24630004 */ addiu $v1, $v1, 4
/* FA66C 802D5CBC 3C04802E */ lui $a0, %hi(D_802D9D34)
/* FA670 802D5CC0 24849D34 */ addiu $a0, $a0, %lo(D_802D9D34)
/* FA674 802D5CC4 24050001 */ addiu $a1, $zero, 1
/* FA678 802D5CC8 0C0B0CF8 */ jal start_script
/* FA67C 802D5CCC 0000302D */ daddu $a2, $zero, $zero
/* FA680 802D5CD0 8FBF0010 */ lw $ra, 0x10($sp)
/* FA684 802D5CD4 24020002 */ addiu $v0, $zero, 2
/* FA688 802D5CD8 03E00008 */ jr $ra
/* FA68C 802D5CDC 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,39 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel evt_handle_child_thread
/* EB71C 802C6D6C 27BDFFE8 */ addiu $sp, $sp, -0x18
/* EB720 802C6D70 AFB00010 */ sw $s0, 0x10($sp)
/* EB724 802C6D74 0080802D */ daddu $s0, $a0, $zero
/* EB728 802C6D78 AFBF0014 */ sw $ra, 0x14($sp)
/* EB72C 802C6D7C 8E050008 */ lw $a1, 8($s0)
/* EB730 802C6D80 24060059 */ addiu $a2, $zero, 0x59
/* EB734 802C6D84 00A0202D */ daddu $a0, $a1, $zero
.L802C6D88:
/* EB738 802C6D88 8C830000 */ lw $v1, ($a0)
/* EB73C 802C6D8C 24840004 */ addiu $a0, $a0, 4
/* EB740 802C6D90 8C820000 */ lw $v0, ($a0)
/* EB744 802C6D94 24840004 */ addiu $a0, $a0, 4
/* EB748 802C6D98 00021080 */ sll $v0, $v0, 2
/* EB74C 802C6D9C 1466FFFA */ bne $v1, $a2, .L802C6D88
/* EB750 802C6DA0 00822021 */ addu $a0, $a0, $v0
/* EB754 802C6DA4 AE040008 */ sw $a0, 8($s0)
/* EB758 802C6DA8 0200202D */ daddu $a0, $s0, $zero
/* EB75C 802C6DAC 0C0B0E7E */ jal func_802C39F8
/* EB760 802C6DB0 24060060 */ addiu $a2, $zero, 0x60
/* EB764 802C6DB4 8E040148 */ lw $a0, 0x148($s0)
/* EB768 802C6DB8 0040182D */ daddu $v1, $v0, $zero
/* EB76C 802C6DBC AC640148 */ sw $a0, 0x148($v1)
/* EB770 802C6DC0 8E02014C */ lw $v0, 0x14c($s0)
/* EB774 802C6DC4 AC62014C */ sw $v0, 0x14c($v1)
/* EB778 802C6DC8 92020004 */ lbu $v0, 4($s0)
/* EB77C 802C6DCC A0620004 */ sb $v0, 4($v1)
/* EB780 802C6DD0 8E02013C */ lw $v0, 0x13c($s0)
/* EB784 802C6DD4 AC62013C */ sw $v0, 0x13c($v1)
/* EB788 802C6DD8 8E040140 */ lw $a0, 0x140($s0)
/* EB78C 802C6DDC AC640140 */ sw $a0, 0x140($v1)
/* EB790 802C6DE0 8FBF0014 */ lw $ra, 0x14($sp)
/* EB794 802C6DE4 8FB00010 */ lw $s0, 0x10($sp)
/* EB798 802C6DE8 24020002 */ addiu $v0, $zero, 2
/* EB79C 802C6DEC 03E00008 */ jr $ra
/* EB7A0 802C6DF0 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,60 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel evt_handle_thread
/* EB628 802C6C78 27BDFFE8 */ addiu $sp, $sp, -0x18
/* EB62C 802C6C7C AFB00010 */ sw $s0, 0x10($sp)
/* EB630 802C6C80 0080802D */ daddu $s0, $a0, $zero
/* EB634 802C6C84 AFBF0014 */ sw $ra, 0x14($sp)
/* EB638 802C6C88 8E040008 */ lw $a0, 8($s0)
/* EB63C 802C6C8C 24060057 */ addiu $a2, $zero, 0x57
/* EB640 802C6C90 0080282D */ daddu $a1, $a0, $zero
.L802C6C94:
/* EB644 802C6C94 8CA30000 */ lw $v1, ($a1)
/* EB648 802C6C98 24A50004 */ addiu $a1, $a1, 4
/* EB64C 802C6C9C 8CA20000 */ lw $v0, ($a1)
/* EB650 802C6CA0 24A50004 */ addiu $a1, $a1, 4
/* EB654 802C6CA4 00021080 */ sll $v0, $v0, 2
/* EB658 802C6CA8 1466FFFA */ bne $v1, $a2, .L802C6C94
/* EB65C 802C6CAC 00A22821 */ addu $a1, $a1, $v0
/* EB660 802C6CB0 AE050008 */ sw $a1, 8($s0)
/* EB664 802C6CB4 92050003 */ lbu $a1, 3($s0)
/* EB668 802C6CB8 92070004 */ lbu $a3, 4($s0)
/* EB66C 802C6CBC 0C0B0D74 */ jal start_script_in_group
/* EB670 802C6CC0 24060060 */ addiu $a2, $zero, 0x60
/* EB674 802C6CC4 8E030148 */ lw $v1, 0x148($s0)
/* EB678 802C6CC8 0040302D */ daddu $a2, $v0, $zero
/* EB67C 802C6CCC ACC30148 */ sw $v1, 0x148($a2)
/* EB680 802C6CD0 8E02014C */ lw $v0, 0x14c($s0)
/* EB684 802C6CD4 0000282D */ daddu $a1, $zero, $zero
/* EB688 802C6CD8 ACC2014C */ sw $v0, 0x14c($a2)
/* EB68C 802C6CDC 8E02013C */ lw $v0, 0x13c($s0)
/* EB690 802C6CE0 0200202D */ daddu $a0, $s0, $zero
/* EB694 802C6CE4 ACC2013C */ sw $v0, 0x13c($a2)
/* EB698 802C6CE8 8E020140 */ lw $v0, 0x140($s0)
/* EB69C 802C6CEC 00C0182D */ daddu $v1, $a2, $zero
/* EB6A0 802C6CF0 ACC20140 */ sw $v0, 0x140($a2)
.L802C6CF4:
/* EB6A4 802C6CF4 8C820084 */ lw $v0, 0x84($a0)
/* EB6A8 802C6CF8 24840004 */ addiu $a0, $a0, 4
/* EB6AC 802C6CFC 24A50001 */ addiu $a1, $a1, 1
/* EB6B0 802C6D00 AC620084 */ sw $v0, 0x84($v1)
/* EB6B4 802C6D04 28A20010 */ slti $v0, $a1, 0x10
/* EB6B8 802C6D08 1440FFFA */ bnez $v0, .L802C6CF4
/* EB6BC 802C6D0C 24630004 */ addiu $v1, $v1, 4
/* EB6C0 802C6D10 0000282D */ daddu $a1, $zero, $zero
/* EB6C4 802C6D14 0200202D */ daddu $a0, $s0, $zero
/* EB6C8 802C6D18 00C0182D */ daddu $v1, $a2, $zero
.L802C6D1C:
/* EB6CC 802C6D1C 8C8200C4 */ lw $v0, 0xc4($a0)
/* EB6D0 802C6D20 24840004 */ addiu $a0, $a0, 4
/* EB6D4 802C6D24 24A50001 */ addiu $a1, $a1, 1
/* EB6D8 802C6D28 AC6200C4 */ sw $v0, 0xc4($v1)
/* EB6DC 802C6D2C 28A20003 */ slti $v0, $a1, 3
/* EB6E0 802C6D30 1440FFFA */ bnez $v0, .L802C6D1C
/* EB6E4 802C6D34 24630004 */ addiu $v1, $v1, 4
/* EB6E8 802C6D38 8FBF0014 */ lw $ra, 0x14($sp)
/* EB6EC 802C6D3C 8FB00010 */ lw $s0, 0x10($sp)
/* EB6F0 802C6D40 24020002 */ addiu $v0, $zero, 2
/* EB6F4 802C6D44 03E00008 */ jr $ra
/* EB6F8 802C6D48 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,106 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel fio_fetch_saved_file_info
/* 6554 8002B154 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 6558 8002B158 AFB20018 */ sw $s2, 0x18($sp)
/* 655C 8002B15C 3C12800A */ lui $s2, %hi(D_8009A6B0)
/* 6560 8002B160 2652A6B0 */ addiu $s2, $s2, %lo(D_8009A6B0)
/* 6564 8002B164 AFB40020 */ sw $s4, 0x20($sp)
/* 6568 8002B168 0240A02D */ daddu $s4, $s2, $zero
/* 656C 8002B16C AFB00010 */ sw $s0, 0x10($sp)
/* 6570 8002B170 0000802D */ daddu $s0, $zero, $zero
/* 6574 8002B174 2404FFFF */ addiu $a0, $zero, -1
/* 6578 8002B178 3C03800A */ lui $v1, %hi(logicalSaveInfo)
/* 657C 8002B17C 2463BA30 */ addiu $v1, $v1, %lo(logicalSaveInfo)
/* 6580 8002B180 AFBF0024 */ sw $ra, 0x24($sp)
/* 6584 8002B184 AFB3001C */ sw $s3, 0x1c($sp)
/* 6588 8002B188 AFB10014 */ sw $s1, 0x14($sp)
.L8002B18C:
/* 658C 8002B18C AC640000 */ sw $a0, ($v1)
/* 6590 8002B190 AC640004 */ sw $a0, 4($v1)
/* 6594 8002B194 26100001 */ addiu $s0, $s0, 1
/* 6598 8002B198 2A020004 */ slti $v0, $s0, 4
/* 659C 8002B19C 1440FFFB */ bnez $v0, .L8002B18C
/* 65A0 8002B1A0 24630008 */ addiu $v1, $v1, 8
/* 65A4 8002B1A4 0000802D */ daddu $s0, $zero, $zero
/* 65A8 8002B1A8 3C13800A */ lui $s3, %hi(logicalSaveInfo)
/* 65AC 8002B1AC 2673BA30 */ addiu $s3, $s3, %lo(logicalSaveInfo)
/* 65B0 8002B1B0 3C11800A */ lui $s1, %hi(physicalSaveInfo)
/* 65B4 8002B1B4 2631BA50 */ addiu $s1, $s1, %lo(physicalSaveInfo)
.L8002B1B8:
/* 65B8 8002B1B8 0200202D */ daddu $a0, $s0, $zero
/* 65BC 8002B1BC 0280282D */ daddu $a1, $s4, $zero
/* 65C0 8002B1C0 0C00AE1A */ jal fio_read_flash
/* 65C4 8002B1C4 24061380 */ addiu $a2, $zero, 0x1380
/* 65C8 8002B1C8 0C00AC3E */ jal fio_validate_file_checksum
/* 65CC 8002B1CC 0280202D */ daddu $a0, $s4, $zero
/* 65D0 8002B1D0 50400014 */ beql $v0, $zero, .L8002B224
/* 65D4 8002B1D4 26100001 */ addiu $s0, $s0, 1
/* 65D8 8002B1D8 8E420038 */ lw $v0, 0x38($s2)
/* 65DC 8002B1DC AE220000 */ sw $v0, ($s1)
/* 65E0 8002B1E0 8E42003C */ lw $v0, 0x3c($s2)
/* 65E4 8002B1E4 AE220004 */ sw $v0, 4($s1)
/* 65E8 8002B1E8 8E420038 */ lw $v0, 0x38($s2)
/* 65EC 8002B1EC 8E43003C */ lw $v1, 0x3c($s2)
/* 65F0 8002B1F0 000210C0 */ sll $v0, $v0, 3
/* 65F4 8002B1F4 00532021 */ addu $a0, $v0, $s3
/* 65F8 8002B1F8 8C820004 */ lw $v0, 4($a0)
/* 65FC 8002B1FC 0043102A */ slt $v0, $v0, $v1
/* 6600 8002B200 50400008 */ beql $v0, $zero, .L8002B224
/* 6604 8002B204 26100001 */ addiu $s0, $s0, 1
/* 6608 8002B208 AC900000 */ sw $s0, ($a0)
/* 660C 8002B20C 8E420038 */ lw $v0, 0x38($s2)
/* 6610 8002B210 8E43003C */ lw $v1, 0x3c($s2)
/* 6614 8002B214 000210C0 */ sll $v0, $v0, 3
/* 6618 8002B218 00531021 */ addu $v0, $v0, $s3
/* 661C 8002B21C AC430004 */ sw $v1, 4($v0)
/* 6620 8002B220 26100001 */ addiu $s0, $s0, 1
.L8002B224:
/* 6624 8002B224 2A020006 */ slti $v0, $s0, 6
/* 6628 8002B228 1440FFE3 */ bnez $v0, .L8002B1B8
/* 662C 8002B22C 26310008 */ addiu $s1, $s1, 8
/* 6630 8002B230 3C067FFF */ lui $a2, 0x7fff
/* 6634 8002B234 34C6FFFF */ ori $a2, $a2, 0xffff
/* 6638 8002B238 0000202D */ daddu $a0, $zero, $zero
/* 663C 8002B23C 3C09800A */ lui $t1, %hi(logicalSaveInfo)
/* 6640 8002B240 2529BA30 */ addiu $t1, $t1, %lo(logicalSaveInfo)
/* 6644 8002B244 24080004 */ addiu $t0, $zero, 4
/* 6648 8002B248 3C07800A */ lui $a3, %hi(nextAvailableSavePage)
/* 664C 8002B24C 24E7BA80 */ addiu $a3, $a3, %lo(nextAvailableSavePage)
/* 6650 8002B250 3C05800A */ lui $a1, %hi(physicalSaveInfo)
/* 6654 8002B254 24A5BA50 */ addiu $a1, $a1, %lo(physicalSaveInfo)
.L8002B258:
/* 6658 8002B258 0000802D */ daddu $s0, $zero, $zero
/* 665C 8002B25C 0120182D */ daddu $v1, $t1, $zero
.L8002B260:
/* 6660 8002B260 8C620000 */ lw $v0, ($v1)
/* 6664 8002B264 10820005 */ beq $a0, $v0, .L8002B27C
/* 6668 8002B268 00000000 */ nop
/* 666C 8002B26C 26100001 */ addiu $s0, $s0, 1
/* 6670 8002B270 2A020004 */ slti $v0, $s0, 4
/* 6674 8002B274 1440FFFA */ bnez $v0, .L8002B260
/* 6678 8002B278 24630008 */ addiu $v1, $v1, 8
.L8002B27C:
/* 667C 8002B27C 56080008 */ bnel $s0, $t0, .L8002B2A0
/* 6680 8002B280 24840001 */ addiu $a0, $a0, 1
/* 6684 8002B284 8CA30004 */ lw $v1, 4($a1)
/* 6688 8002B288 0066102A */ slt $v0, $v1, $a2
/* 668C 8002B28C 50400004 */ beql $v0, $zero, .L8002B2A0
/* 6690 8002B290 24840001 */ addiu $a0, $a0, 1
/* 6694 8002B294 0060302D */ daddu $a2, $v1, $zero
/* 6698 8002B298 ACE40000 */ sw $a0, ($a3)
/* 669C 8002B29C 24840001 */ addiu $a0, $a0, 1
.L8002B2A0:
/* 66A0 8002B2A0 28820006 */ slti $v0, $a0, 6
/* 66A4 8002B2A4 1440FFEC */ bnez $v0, .L8002B258
/* 66A8 8002B2A8 24A50008 */ addiu $a1, $a1, 8
/* 66AC 8002B2AC 8FBF0024 */ lw $ra, 0x24($sp)
/* 66B0 8002B2B0 8FB40020 */ lw $s4, 0x20($sp)
/* 66B4 8002B2B4 8FB3001C */ lw $s3, 0x1c($sp)
/* 66B8 8002B2B8 8FB20018 */ lw $s2, 0x18($sp)
/* 66BC 8002B2BC 8FB10014 */ lw $s1, 0x14($sp)
/* 66C0 8002B2C0 8FB00010 */ lw $s0, 0x10($sp)
/* 66C4 8002B2C4 24020001 */ addiu $v0, $zero, 1
/* 66C8 8002B2C8 03E00008 */ jr $ra
/* 66CC 8002B2CC 27BD0028 */ addiu $sp, $sp, 0x28

View File

@ -1,37 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel fio_flush_backups
/* 644C 8002B04C 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 6450 8002B050 AFB00010 */ sw $s0, 0x10($sp)
/* 6454 8002B054 3C10800E */ lui $s0, %hi(D_800D95E8)
/* 6458 8002B058 261095E8 */ addiu $s0, $s0, %lo(D_800D95E8)
/* 645C 8002B05C 3C058007 */ lui $a1, %hi(magicSaveString)
/* 6460 8002B060 24A545D0 */ addiu $a1, $a1, %lo(magicSaveString)
/* 6464 8002B064 AFBF0014 */ sw $ra, 0x14($sp)
/* 6468 8002B068 0C01BB50 */ jal strcpy
/* 646C 8002B06C 0200202D */ daddu $a0, $s0, $zero
/* 6470 8002B070 2402FFFF */ addiu $v0, $zero, -1
/* 6474 8002B074 AE000030 */ sw $zero, 0x30($s0)
/* 6478 8002B078 0C00ABD0 */ jal fio_calc_header_checksum
/* 647C 8002B07C AE020034 */ sw $v0, 0x34($s0)
/* 6480 8002B080 24040006 */ addiu $a0, $zero, 6
/* 6484 8002B084 AE020030 */ sw $v0, 0x30($s0)
/* 6488 8002B088 00021027 */ nor $v0, $zero, $v0
/* 648C 8002B08C 0C00AE87 */ jal fio_erase_flash
/* 6490 8002B090 AE020034 */ sw $v0, 0x34($s0)
/* 6494 8002B094 24040006 */ addiu $a0, $zero, 6
/* 6498 8002B098 0200282D */ daddu $a1, $s0, $zero
/* 649C 8002B09C 0C00AE52 */ jal fio_write_flash
/* 64A0 8002B0A0 24060080 */ addiu $a2, $zero, 0x80
/* 64A4 8002B0A4 0C00AE87 */ jal fio_erase_flash
/* 64A8 8002B0A8 24040007 */ addiu $a0, $zero, 7
/* 64AC 8002B0AC 24040007 */ addiu $a0, $zero, 7
/* 64B0 8002B0B0 0200282D */ daddu $a1, $s0, $zero
/* 64B4 8002B0B4 0C00AE52 */ jal fio_write_flash
/* 64B8 8002B0B8 24060080 */ addiu $a2, $zero, 0x80
/* 64BC 8002B0BC 8FBF0014 */ lw $ra, 0x14($sp)
/* 64C0 8002B0C0 8FB00010 */ lw $s0, 0x10($sp)
/* 64C4 8002B0C4 24020001 */ addiu $v0, $zero, 1
/* 64C8 8002B0C8 03E00008 */ jr $ra
/* 64CC 8002B0CC 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,13 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel set_hud_element_render_depth
/* DB0DC 801449DC 2402F7FF */ addiu $v0, $zero, -0x801
/* DB0E0 801449E0 00822024 */ and $a0, $a0, $v0
/* DB0E4 801449E4 3C028015 */ lui $v0, %hi(hudElements)
/* DB0E8 801449E8 8C427960 */ lw $v0, %lo(hudElements)($v0)
/* DB0EC 801449EC 00042080 */ sll $a0, $a0, 2
/* DB0F0 801449F0 00822021 */ addu $a0, $a0, $v0
/* DB0F4 801449F4 8C820000 */ lw $v0, ($a0)
/* DB0F8 801449F8 03E00008 */ jr $ra
/* DB0FC 801449FC A0450044 */ sb $a1, 0x44($v0)