Match some spring, sprite, and pause code (#472)

* Start Spring Work

Progress.

* More WIP

* Still WIP

Spring isn't ready for this yet.

* Decompile some sprite functions

Making progress.

* Partner stuff

More progress.

* PR fixes

* PR fixes

For commenting.
This commit is contained in:
Gota7 2021-10-16 05:53:28 -04:00 committed by GitHub
parent 936261657f
commit 072a585908
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 266 additions and 262 deletions

View File

@ -941,7 +941,8 @@ typedef struct StaticAnimatorNode {
} StaticAnimatorNode; // size = 0x2C
typedef struct SpriteComponent {
/* 0x00 */ char unk_00[8];
/* 0x00 */ s32 initialized;
/* 0x04 */ s32 unk_04;
/* 0x08 */ s16** readPos;
/* 0x0C */ f32 waitTime;
/* 0x10 */ s32 loopCounter;

View File

@ -481,7 +481,7 @@ s32 func_8004A784(Npc* npc, f32 arg1, f32* arg2, f32* arg3, f32* arg4, f32* arg5
void base_UnkNpcAIFunc1(Evt* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory);
void DeadUnkNpcAIFunc1(Evt* script, NpcAISettings* aiSettings, EnemyTerritoryThing* territory);
s32* spr_get_npc_palettes(u16 arg0);
s32** spr_get_npc_palettes(s32 npcSpriteID);
void spr_draw_player_sprite(s32 arg0, s32 arg1, s32 arg2, s32 arg3, Matrix4f arg4);
void spr_draw_npc_sprite(s32 arg0, s32 arg1, s32 arg2, s32 arg3, Matrix4f* arg4);
s32 spr_update_sprite(s32 arg0, s32 arg1, f32 arg2);

View File

@ -1,28 +1,146 @@
#include "common.h"
extern void* D_8015A578;
INCLUDE_ASM(s32, "entity/SimpleSpring", entity_ScriptSpring_idle);
#ifdef NON_EQUIVALENT
void entity_SimpleSpring_idle(Entity* ent) {
int new_var;
s32 *new_var2;
s32 isRiding;
s32 isColliding;
new_var2 = ent->dataBuf;
new_var = gPlayerStatus.actionState != ACTION_STATE_RIDE && (ent->collisionFlags & 1) != 0;
if (new_var) {
if ((*new_var2) >= 0x46) {
gPlayerStatus.unk_C5 = 5;
}
play_model_animation(ent->virtualModelIndex, 0x1E4);
entity_start_script(ent);
exec_entity_commandlist(ent);
sfx_play_sound_at_position(0x2086, 0, ent->position.x, ent->position.y, ent->position.z);
disable_player_input();
gPlayerStatus.currentSpeed = 0;
}
}
#else
INCLUDE_ASM(s32, "entity/SimpleSpring", entity_SimpleSpring_idle);
INCLUDE_ASM(s32, "entity/SimpleSpring", entity_SimpleSpring_set_jump_params);
#endif
INCLUDE_ASM(s32, "entity/SimpleSpring", entity_SimpleSpring_enable_player_input);
void entity_SimpleSpring_set_jump_params(Entity* ent) {
s32* data = ent->dataBuf;
set_action_state(ACTION_STATE_LAUNCH);
gPlayerStatus.gravityIntegrator[1] = 0;
gPlayerStatus.gravityIntegrator[0] = 15.0f;
gPlayerStatus.gravityIntegrator[2] = (f32)*data;
gPlayerStatus.gravityIntegrator[3] = ent->position.y;
}
void entity_SimpleSpring_enable_player_input(Entity* ent) {
enable_player_input();
}
void entity_ScriptSpring_init(void) {
}
INCLUDE_ASM(s32, "entity/SimpleSpring", entity_SimpleSpring_init);
void entity_SimpleSpring_init(Entity* ent) {
ent->dataBuf[0] = *D_8015C7D0;
}
INCLUDE_ASM(s32, "entity/SimpleSpring", entity_HiddenPanel_setupGfx);
INCLUDE_ASM(s32, "entity/SimpleSpring", entity_HiddenPanel_set_ispy_notification);
INCLUDE_ASM(s32, "entity/SimpleSpring", entity_HiddenPanel_hide);
void entity_HiddenPanel_hide(Entity* ent) {
ent->flags = (ent->flags & ~0x20) | 1;
}
INCLUDE_ASM(s32, "entity/SimpleSpring", entity_HiddenPanel_idle);
INCLUDE_ASM(s32, "entity/SimpleSpring", entity_HiddenPanel_flip_over);
#ifdef NON_EQUIVALENT
s32 entity_HiddenPanel_is_item_on_top(Entity* entity) {
ItemEntity* temp_v0;
s32 entityIndex;
s32 *args;
s32 phi_v0;
args = entity->dataBuf;
entityIndex = args[5];
phi_v0 = 0;
if ((entityIndex >= 0) &&
((temp_v0 = get_item_entity(entityIndex), (temp_v0 == 0))
|| (((temp_v0->flags & 0x10) != 0) && (fabs((f64) (entity->position.x - (f32) args[6])) <= 34.0)
&& (phi_v0 = 1, !(fabs((f64) (entity->position.y - (f32)args[8])) <= 34.0))))) {
}
return phi_v0;
}
#else
INCLUDE_ASM(s32, "entity/SimpleSpring", entity_HiddenPanel_is_item_on_top);
#endif
#ifdef NON_EQUIVALENT
void entity_HiddenPanel_init(Entity* ent) {
float sp58[4];
float sp18[4];
s32* temp_s1;
s32 temp_a1;
s32 temp_v1;
s32* data;
s32 phi_v0;
data = ent->dataBuf;
mem_clear(&D_8015A578, 0x10);
ent->unk3C = &entity_HiddenPanel_setupGfx;
data->unk6 = 0xFFFF;
data->unk24 = (?32) ent->unk4C;
data->unk74 = (u16) D_8015C7D0.unk2;
temp_v1 = D_8015C7D0[1];
data->unk3 = 1;
data->unk14 = -1;
data->unk10 = temp_v1;
if (temp_v1 == 0) {
data->unk10 = 0x15C;
}
temp_s1 = data + 0x34;
guMtxIdentF(temp_s1);
guTranslateF(&sp18, ent->position.x, ent->position.y, ent->position.z);
guRotateF(&sp58, ent->rotation.y, 0.0f, 1.0f, 0.0f);
guMtxCatF(&sp58, &sp18, &sp18);
guRotateF(&sp58, ent->rotation.x, 1.0f, 0.0f, 0.0f);
guMtxCatF(&sp58, &sp18, &sp18);
guRotateF(&sp58, ent->rotation.z, 0.0f, 0.0f, 1.0f);
guMtxCatF(&sp58, &sp18, &sp18);
guScaleF(&sp58, ent->scale.x, ent->scale.y, ent->scale.z);
guMtxCatF(&sp58, &sp18, temp_s1);
if ((D_8015A578.unk1 & 1) != 0) {
entity_set_render_script(ent, &D_802EAAE0);
phi_v0 = 0xA0001B0 & 0xFFFF;
} else {
phi_v0 = 0xA000180 & 0xFFFF;
}
temp_a1 = ent->vertexData + phi_v0;
data->unk78 = temp_a1;
mdl_project_tex_coords(data->unk74, temp_a1, temp_s2 + 0x34, ent->unk44);
D_8015A578.unk1 = (u8) (D_8015A578.unk1 + 1);
}
#else
INCLUDE_ASM(s32, "entity/SimpleSpring", entity_HiddenPanel_init);
#endif

View File

@ -1,5 +1,7 @@
#include "common.h"
extern s32 D_80270640[];
INCLUDE_ASM(s32, "pause/13E120", pause_partners_load_portrait);
INCLUDE_ASM(s32, "pause/13E120", pause_partners_draw_contents);
@ -8,9 +10,14 @@ INCLUDE_ASM(s32, "pause/13E120", pause_partners_draw_title);
INCLUDE_ASM(s32, "pause/13E120", pause_partners_draw_movelist);
INCLUDE_ASM(s32, "pause/13E120", pause_partners_draw_movelist_title);
void pause_partners_draw_movelist_title(void* menuTab, s32 x, s32 y) {
draw_msg(pause_get_menu_msg(0x55), x + 12, y + 1, 0xFF, -1, 1);
}
INCLUDE_ASM(s32, "pause/13E120", pause_partners_draw_movelist_flower);
void pause_partners_draw_movelist_flower(void* menuTab, s32 x, s32 y) {
set_hud_element_render_pos(D_80270640[1], x + 17, y + 16);
draw_hud_element_3(D_80270640[1]);
}
INCLUDE_ASM(s32, "pause/13E120", pause_partners_init);

View File

@ -34,6 +34,8 @@ typedef struct SpriteAnimData {
/* 0x0C */ s32 colorVariations;
} SpriteAnimData; // size = 0x10
extern s32 D_802DF590[];
extern s32 D_802DFA58[];
extern s32 spr_allocateBtlComponentsOnWorldHeap;
extern SpriteAnimData* spr_playerSprites[13];
extern s32 spr_playerMaxComponents;
@ -199,19 +201,86 @@ s32 spr_sign_extend_16bit(u16 val) {
INCLUDE_ASM(s32, "sprite", spr_component_update_commands);
#ifdef NON_EQUIVALENT
void spr_component_update_finish(SpriteComponent* comp, SpriteComponent** compList, s32 arg2, s32 palette) {
s32 temp_t0;
s32 temp_v0_2;
s8 temp_v0_3;
SpriteComponent* temp_v0;
if (comp->initialized) {
temp_t0 = comp->unk_04;
comp->compPos.x = comp->posOffset.x;
comp->compPos.y = comp->posOffset.y;
comp->compPos.z = comp->posOffset.z;
if ((temp_t0 & 0xF00) == 0x100) {
temp_v0 = compList[temp_t0 & 0xFF];
comp->compPos.x = comp->posOffset.x + temp_v0->compPos.x;
comp->compPos.y = comp->posOffset.y + temp_v0->compPos.y;
comp->compPos.z = comp->posOffset.z + temp_v0->compPos.z;
}
temp_v0_2 = comp->currentRaster;
if ((temp_v0_2 != -1) && (comp->currentRaster == -1)) {
temp_v0_3 = (*((temp_v0_2 * 4) + arg2))->unk6;
comp->unk18 = (s32) temp_v0_3;
if ((palette != 0) && (temp_v0_3 == 0)) {
comp->unk18 = palette;
}
}
}
}
#else
INCLUDE_ASM(s32, "sprite", spr_component_update_finish);
#endif
INCLUDE_ASM(s32, "sprite", spr_component_update);
INCLUDE_ASM(s32, "sprite", spr_init_component_anim_state);
void spr_init_component_anim_state(SpriteComponent* comp, s16*** anim) {
if (anim == -1) {
comp->initialized = FALSE;
return;
}
comp->initialized = TRUE;
comp->unk_04 = 0;
comp->readPos = *anim;
comp->waitTime = 0;
comp->loopCounter = 0;
comp->currentRaster = -1;
comp->currentPalette = -1;
comp->posOffset.x = 0;
comp->posOffset.y = 0;
comp->posOffset.z = 0;
comp->compPos.x = 0;
comp->compPos.y = 0;
comp->compPos.z = 0;
comp->rotation.x = 0;
comp->rotation.y = 0;
comp->rotation.z = 0;
comp->scale.x = 1.0f;
comp->scale.y = 1.0f;
comp->scale.z = 1.0f;
}
INCLUDE_ASM(s32, "sprite", spr_init_anim_state);
void spr_set_anim_timescale(f32 arg0) {
spr_animUpdateTimeScale = arg0 * 2.0f;
void spr_set_anim_timescale(f32 timescale) {
spr_animUpdateTimeScale = timescale * 2.0f;
}
INCLUDE_ASM(s32, "sprite", spr_load_player_sprite);
void spr_load_player_sprite(s32 spriteIndex) {
s32 ind = spriteIndex - 1;
SpriteAnimData* playerSprite = spr_load_sprite(ind, 1, 0);
spr_playerSprites[ind] = playerSprite;
if (spr_playerMaxComponents < playerSprite->maxComponents) {
spr_playerMaxComponents = playerSprite->maxComponents;
}
}
void spr_init_sprites(s32 playerSpriteSet) {
s32 i;
@ -281,12 +350,25 @@ INCLUDE_ASM(void, "sprite", spr_update_player_sprite, s32 arg0, s32 arg1, f32 ar
INCLUDE_ASM(void, "sprite", spr_draw_player_sprite, s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4);
INCLUDE_ASM(s32, "sprite", func_802DDEC4);
s32 func_802DDEC4(s32 arg0) {
return D_802DF590[arg0 * 3]; // The struct of D_802DF590 is probably 0xC in size with this taking the first field.
}
INCLUDE_ASM(s32, "sprite", func_802DDEE4);
#ifdef NON_MATCHING
// There's a problem here: this matches if arg6 is an s32, but the uses of this function match if it is a u16...
s32 func_802DDFF8(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, u16 arg6) {
return func_802DDEE4(0, -1, arg1, arg2, arg3, arg4, arg5, arg6);
}
#else
INCLUDE_ASM(s32, "sprite", func_802DDFF8);
#endif
INCLUDE_ASM(s32, "sprite", spr_get_player_raster_info);
INCLUDE_ASM(s32, "sprite", spr_get_player_palettes);
@ -297,7 +379,9 @@ INCLUDE_ASM(s32, "sprite", spr_update_sprite, s32 arg0, s32 arg1, f32 arg2);
INCLUDE_ASM(void, "sprite", spr_draw_npc_sprite, s32 arg0, s32 arg1, s32 arg2, s32 arg3, Matrix4f* arg4);
INCLUDE_ASM(s32, "sprite", func_802DE5C8);
s32 func_802DE5C8(s32 arg0) {
return D_802DFA58[arg0 * 5]; // The struct of D_802DFA58 is probably 0x14 in size with this taking the first field.
}
INCLUDE_ASM(s32, "sprite", spr_free_sprite);
@ -305,12 +389,51 @@ INCLUDE_ASM(s32, "sprite", func_802DE748);
INCLUDE_ASM(s32, "sprite", func_802DE780);
INCLUDE_ASM(s32, "sprite", func_802DE894);
s32 func_802DE894(s32 arg0, s32 arg1, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s32 arg6) {
return func_802DE780(arg0, -1, arg1, arg2, arg3, arg4, arg5, arg6);
}
INCLUDE_ASM(s32, "sprite", func_802DE8DC);
#ifdef NON_EQUIVALENT
// Some WIP work on sprite raster stuff.
s32 spr_get_npc_raster_info(spr_raster_info* outInfo, int npcSpriteID, int rasterIndex) {
SpriteAnimData* sprite;
void *temp_v1;
sprite = spr_npcSprites[npcSpriteID];
if (sprite == 0) {
return FALSE;
}
temp_v1 = sprite->rastersOffset[rasterIndex];
outInfo->unk0 = (s32)temp_v1->unk0;
outInfo->unk8 = (s32)temp_v1->unk4;
outInfo->unkC = (s32)temp_v1->unk5;
outInfo->unk4 = sprite->unk4[temp_v1->unk6];
return TRUE;
}
#else
INCLUDE_ASM(s32, "sprite", spr_get_npc_raster_info);
INCLUDE_ASM(s32*, "sprite", spr_get_npc_palettes, u16 arg0);
#endif
INCLUDE_ASM(s32, "sprite", spr_get_npc_color_variations);
s32** spr_get_npc_palettes(s32 npcSpriteID) {
SpriteAnimData* sprite = spr_npcSprites[npcSpriteID];
if (sprite != NULL) {
return sprite->palettesOffset;
}
return NULL;
}
s32 spr_get_npc_color_variations(s32 npcSpriteID) {
SpriteAnimData* sprite = spr_npcSprites[npcSpriteID];
if (sprite != NULL) {
return sprite->colorVariations;
}
return -1;
}

View File

@ -1,10 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel entity_HiddenPanel_hide
/* 107C10 802E6390 8C820000 */ lw $v0, ($a0)
/* 107C14 802E6394 2403FFDF */ addiu $v1, $zero, -0x21
/* 107C18 802E6398 00431024 */ and $v0, $v0, $v1
/* 107C1C 802E639C 34420001 */ ori $v0, $v0, 1
/* 107C20 802E63A0 03E00008 */ jr $ra
/* 107C24 802E63A4 AC820000 */ sw $v0, ($a0)

View File

@ -1,11 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel entity_SimpleSpring_enable_player_input
/* 1079F8 802E6178 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 1079FC 802E617C AFBF0010 */ sw $ra, 0x10($sp)
/* 107A00 802E6180 0C038069 */ jal enable_player_input
/* 107A04 802E6184 00000000 */ nop
/* 107A08 802E6188 8FBF0010 */ lw $ra, 0x10($sp)
/* 107A0C 802E618C 03E00008 */ jr $ra
/* 107A10 802E6190 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,9 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel entity_SimpleSpring_init
/* 107A1C 802E619C 8C830040 */ lw $v1, 0x40($a0)
/* 107A20 802E61A0 3C028016 */ lui $v0, %hi(D_8015C7D0)
/* 107A24 802E61A4 8C42C7D0 */ lw $v0, %lo(D_8015C7D0)($v0)
/* 107A28 802E61A8 03E00008 */ jr $ra
/* 107A2C 802E61AC AC620000 */ sw $v0, ($v1)

View File

@ -1,28 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel entity_SimpleSpring_set_jump_params
/* 107998 802E6118 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 10799C 802E611C AFB10014 */ sw $s1, 0x14($sp)
/* 1079A0 802E6120 0080882D */ daddu $s1, $a0, $zero
/* 1079A4 802E6124 AFBF0018 */ sw $ra, 0x18($sp)
/* 1079A8 802E6128 AFB00010 */ sw $s0, 0x10($sp)
/* 1079AC 802E612C 8E300040 */ lw $s0, 0x40($s1)
/* 1079B0 802E6130 0C039769 */ jal set_action_state
/* 1079B4 802E6134 24040006 */ addiu $a0, $zero, 6
/* 1079B8 802E6138 3C014170 */ lui $at, 0x4170
/* 1079BC 802E613C 44810000 */ mtc1 $at, $f0
/* 1079C0 802E6140 3C028011 */ lui $v0, %hi(gPlayerStatus)
/* 1079C4 802E6144 2442EFC8 */ addiu $v0, $v0, %lo(gPlayerStatus)
/* 1079C8 802E6148 AC400074 */ sw $zero, 0x74($v0)
/* 1079CC 802E614C E4400070 */ swc1 $f0, 0x70($v0)
/* 1079D0 802E6150 C6000000 */ lwc1 $f0, ($s0)
/* 1079D4 802E6154 46800020 */ cvt.s.w $f0, $f0
/* 1079D8 802E6158 E4400078 */ swc1 $f0, 0x78($v0)
/* 1079DC 802E615C C620004C */ lwc1 $f0, 0x4c($s1)
/* 1079E0 802E6160 E440007C */ swc1 $f0, 0x7c($v0)
/* 1079E4 802E6164 8FBF0018 */ lw $ra, 0x18($sp)
/* 1079E8 802E6168 8FB10014 */ lw $s1, 0x14($sp)
/* 1079EC 802E616C 8FB00010 */ lw $s0, 0x10($sp)
/* 1079F0 802E6170 03E00008 */ jr $ra
/* 1079F4 802E6174 27BD0020 */ addiu $sp, $sp, 0x20

View File

@ -1,20 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel pause_partners_draw_movelist_flower
/* 13F3E0 8024C0A0 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 13F3E4 8024C0A4 AFB00010 */ sw $s0, 0x10($sp)
/* 13F3E8 8024C0A8 3C108027 */ lui $s0, %hi(D_80270640)
/* 13F3EC 8024C0AC 26100640 */ addiu $s0, $s0, %lo(D_80270640)
/* 13F3F0 8024C0B0 24A50011 */ addiu $a1, $a1, 0x11
/* 13F3F4 8024C0B4 AFBF0014 */ sw $ra, 0x14($sp)
/* 13F3F8 8024C0B8 8E040004 */ lw $a0, 4($s0)
/* 13F3FC 8024C0BC 0C051261 */ jal set_hud_element_render_pos
/* 13F400 8024C0C0 24C60010 */ addiu $a2, $a2, 0x10
/* 13F404 8024C0C4 8E040004 */ lw $a0, 4($s0)
/* 13F408 8024C0C8 0C0511F8 */ jal draw_hud_element_3
/* 13F40C 8024C0CC 00000000 */ nop
/* 13F410 8024C0D0 8FBF0014 */ lw $ra, 0x14($sp)
/* 13F414 8024C0D4 8FB00010 */ lw $s0, 0x10($sp)
/* 13F418 8024C0D8 03E00008 */ jr $ra
/* 13F41C 8024C0DC 27BD0018 */ addiu $sp, $sp, 0x18

View File

@ -1,26 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel pause_partners_draw_movelist_title
/* 13F388 8024C048 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 13F38C 8024C04C AFB00018 */ sw $s0, 0x18($sp)
/* 13F390 8024C050 00A0802D */ daddu $s0, $a1, $zero
/* 13F394 8024C054 AFB1001C */ sw $s1, 0x1c($sp)
/* 13F398 8024C058 00C0882D */ daddu $s1, $a2, $zero
/* 13F39C 8024C05C AFBF0020 */ sw $ra, 0x20($sp)
/* 13F3A0 8024C060 0C093BA0 */ jal pause_get_menu_msg
/* 13F3A4 8024C064 24040055 */ addiu $a0, $zero, 0x55
/* 13F3A8 8024C068 0040202D */ daddu $a0, $v0, $zero
/* 13F3AC 8024C06C 2402FFFF */ addiu $v0, $zero, -1
/* 13F3B0 8024C070 AFA20010 */ sw $v0, 0x10($sp)
/* 13F3B4 8024C074 24020001 */ addiu $v0, $zero, 1
/* 13F3B8 8024C078 2605000C */ addiu $a1, $s0, 0xc
/* 13F3BC 8024C07C 02223021 */ addu $a2, $s1, $v0
/* 13F3C0 8024C080 240700FF */ addiu $a3, $zero, 0xff
/* 13F3C4 8024C084 0C04993B */ jal draw_msg
/* 13F3C8 8024C088 AFA20014 */ sw $v0, 0x14($sp)
/* 13F3CC 8024C08C 8FBF0020 */ lw $ra, 0x20($sp)
/* 13F3D0 8024C090 8FB1001C */ lw $s1, 0x1c($sp)
/* 13F3D4 8024C094 8FB00018 */ lw $s0, 0x18($sp)
/* 13F3D8 8024C098 03E00008 */ jr $ra
/* 13F3DC 8024C09C 27BD0028 */ addiu $sp, $sp, 0x28

View File

@ -1,12 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802DDEC4
/* 100FB4 802DDEC4 00041040 */ sll $v0, $a0, 1
/* 100FB8 802DDEC8 00441021 */ addu $v0, $v0, $a0
/* 100FBC 802DDECC 00021080 */ sll $v0, $v0, 2
/* 100FC0 802DDED0 3C01802E */ lui $at, %hi(D_802DF590)
/* 100FC4 802DDED4 00220821 */ addu $at, $at, $v0
/* 100FC8 802DDED8 8C22F590 */ lw $v0, %lo(D_802DF590)($at)
/* 100FCC 802DDEDC 03E00008 */ jr $ra
/* 100FD0 802DDEE0 00000000 */ nop

View File

@ -1,12 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802DE5C8
/* 1016B8 802DE5C8 00041080 */ sll $v0, $a0, 2
/* 1016BC 802DE5CC 00441021 */ addu $v0, $v0, $a0
/* 1016C0 802DE5D0 00021080 */ sll $v0, $v0, 2
/* 1016C4 802DE5D4 3C01802E */ lui $at, %hi(D_802DFA58)
/* 1016C8 802DE5D8 00220821 */ addu $at, $at, $v0
/* 1016CC 802DE5DC 8C22FA58 */ lw $v0, %lo(D_802DFA58)($at)
/* 1016D0 802DE5E0 03E00008 */ jr $ra
/* 1016D4 802DE5E4 00000000 */ nop

View File

@ -1,22 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802DE894
/* 101984 802DE894 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 101988 802DE898 00A0402D */ daddu $t0, $a1, $zero
/* 10198C 802DE89C 00C0482D */ daddu $t1, $a2, $zero
/* 101990 802DE8A0 8FA20038 */ lw $v0, 0x38($sp)
/* 101994 802DE8A4 8FA3003C */ lw $v1, 0x3c($sp)
/* 101998 802DE8A8 8FA50040 */ lw $a1, 0x40($sp)
/* 10199C 802DE8AC 0100302D */ daddu $a2, $t0, $zero
/* 1019A0 802DE8B0 AFA70010 */ sw $a3, 0x10($sp)
/* 1019A4 802DE8B4 0120382D */ daddu $a3, $t1, $zero
/* 1019A8 802DE8B8 AFBF0020 */ sw $ra, 0x20($sp)
/* 1019AC 802DE8BC AFA5001C */ sw $a1, 0x1c($sp)
/* 1019B0 802DE8C0 2405FFFF */ addiu $a1, $zero, -1
/* 1019B4 802DE8C4 AFA20014 */ sw $v0, 0x14($sp)
/* 1019B8 802DE8C8 0C0B79E0 */ jal func_802DE780
/* 1019BC 802DE8CC AFA30018 */ sw $v1, 0x18($sp)
/* 1019C0 802DE8D0 8FBF0020 */ lw $ra, 0x20($sp)
/* 1019C4 802DE8D4 03E00008 */ jr $ra
/* 1019C8 802DE8D8 27BD0028 */ addiu $sp, $sp, 0x28

View File

@ -1,18 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel spr_get_npc_color_variations
/* 101B5C 802DEA6C 00042080 */ sll $a0, $a0, 2
/* 101B60 802DEA70 3C02802E */ lui $v0, %hi(spr_npcSprites)
/* 101B64 802DEA74 00441021 */ addu $v0, $v0, $a0
/* 101B68 802DEA78 8C42F5B0 */ lw $v0, %lo(spr_npcSprites)($v0)
/* 101B6C 802DEA7C 14400003 */ bnez $v0, .L802DEA8C
/* 101B70 802DEA80 00000000 */ nop
/* 101B74 802DEA84 03E00008 */ jr $ra
/* 101B78 802DEA88 2402FFFF */ addiu $v0, $zero, -1
.L802DEA8C:
/* 101B7C 802DEA8C 8C42000C */ lw $v0, 0xc($v0)
/* 101B80 802DEA90 03E00008 */ jr $ra
/* 101B84 802DEA94 00000000 */ nop
/* 101B88 802DEA98 00000000 */ nop
/* 101B8C 802DEA9C 00000000 */ nop

View File

@ -1,16 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel spr_get_npc_palettes
/* 101B30 802DEA40 00042080 */ sll $a0, $a0, 2
/* 101B34 802DEA44 3C02802E */ lui $v0, %hi(spr_npcSprites)
/* 101B38 802DEA48 00441021 */ addu $v0, $v0, $a0
/* 101B3C 802DEA4C 8C42F5B0 */ lw $v0, %lo(spr_npcSprites)($v0)
/* 101B40 802DEA50 14400003 */ bnez $v0, .L802DEA60
/* 101B44 802DEA54 00000000 */ nop
/* 101B48 802DEA58 03E00008 */ jr $ra
/* 101B4C 802DEA5C 0000102D */ daddu $v0, $zero, $zero
.L802DEA60:
/* 101B50 802DEA60 8C420004 */ lw $v0, 4($v0)
/* 101B54 802DEA64 03E00008 */ jr $ra
/* 101B58 802DEA68 00000000 */ nop

View File

@ -1,33 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel spr_init_component_anim_state
/* 1008A0 802DD7B0 2403FFFF */ addiu $v1, $zero, -1
/* 1008A4 802DD7B4 14A30003 */ bne $a1, $v1, .L802DD7C4
/* 1008A8 802DD7B8 24020001 */ addiu $v0, $zero, 1
/* 1008AC 802DD7BC 03E00008 */ jr $ra
/* 1008B0 802DD7C0 AC800000 */ sw $zero, ($a0)
.L802DD7C4:
/* 1008B4 802DD7C4 AC820000 */ sw $v0, ($a0)
/* 1008B8 802DD7C8 AC800004 */ sw $zero, 4($a0)
/* 1008BC 802DD7CC 8CA20000 */ lw $v0, ($a1)
/* 1008C0 802DD7D0 3C013F80 */ lui $at, 0x3f80
/* 1008C4 802DD7D4 44810000 */ mtc1 $at, $f0
/* 1008C8 802DD7D8 AC80000C */ sw $zero, 0xc($a0)
/* 1008CC 802DD7DC AC800010 */ sw $zero, 0x10($a0)
/* 1008D0 802DD7E0 AC830014 */ sw $v1, 0x14($a0)
/* 1008D4 802DD7E4 AC830018 */ sw $v1, 0x18($a0)
/* 1008D8 802DD7E8 AC80001C */ sw $zero, 0x1c($a0)
/* 1008DC 802DD7EC AC800020 */ sw $zero, 0x20($a0)
/* 1008E0 802DD7F0 AC800024 */ sw $zero, 0x24($a0)
/* 1008E4 802DD7F4 AC800028 */ sw $zero, 0x28($a0)
/* 1008E8 802DD7F8 AC80002C */ sw $zero, 0x2c($a0)
/* 1008EC 802DD7FC AC800030 */ sw $zero, 0x30($a0)
/* 1008F0 802DD800 AC800034 */ sw $zero, 0x34($a0)
/* 1008F4 802DD804 AC800038 */ sw $zero, 0x38($a0)
/* 1008F8 802DD808 AC80003C */ sw $zero, 0x3c($a0)
/* 1008FC 802DD80C AC820008 */ sw $v0, 8($a0)
/* 100900 802DD810 E4800040 */ swc1 $f0, 0x40($a0)
/* 100904 802DD814 E4800044 */ swc1 $f0, 0x44($a0)
/* 100908 802DD818 03E00008 */ jr $ra
/* 10090C 802DD81C E4800048 */ swc1 $f0, 0x48($a0)

View File

@ -1,28 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel spr_load_player_sprite
/* 10098C 802DD89C 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 100990 802DD8A0 AFB00010 */ sw $s0, 0x10($sp)
/* 100994 802DD8A4 2490FFFF */ addiu $s0, $a0, -1
/* 100998 802DD8A8 0200202D */ daddu $a0, $s0, $zero
/* 10099C 802DD8AC 24050001 */ addiu $a1, $zero, 1
/* 1009A0 802DD8B0 AFBF0014 */ sw $ra, 0x14($sp)
/* 1009A4 802DD8B4 0C0B7AC3 */ jal spr_load_sprite
/* 1009A8 802DD8B8 0000302D */ daddu $a2, $zero, $zero
/* 1009AC 802DD8BC 00108080 */ sll $s0, $s0, 2
/* 1009B0 802DD8C0 3C04802E */ lui $a0, %hi(spr_playerMaxComponents)
/* 1009B4 802DD8C4 2484F580 */ addiu $a0, $a0, %lo(spr_playerMaxComponents)
/* 1009B8 802DD8C8 3C01802E */ lui $at, %hi(spr_playerSprites)
/* 1009BC 802DD8CC 00300821 */ addu $at, $at, $s0
/* 1009C0 802DD8D0 AC22F548 */ sw $v0, %lo(spr_playerSprites)($at)
/* 1009C4 802DD8D4 8C830000 */ lw $v1, ($a0)
/* 1009C8 802DD8D8 8C420008 */ lw $v0, 8($v0)
/* 1009CC 802DD8DC 0062182A */ slt $v1, $v1, $v0
/* 1009D0 802DD8E0 54600001 */ bnel $v1, $zero, .L802DD8E8
/* 1009D4 802DD8E4 AC820000 */ sw $v0, ($a0)
.L802DD8E8:
/* 1009D8 802DD8E8 8FBF0014 */ lw $ra, 0x14($sp)
/* 1009DC 802DD8EC 8FB00010 */ lw $s0, 0x10($sp)
/* 1009E0 802DD8F0 03E00008 */ jr $ra
/* 1009E4 802DD8F4 27BD0018 */ addiu $sp, $sp, 0x18