Decompile some functions

This commit is contained in:
octorock
2022-04-10 23:42:14 +02:00
parent 02cec8ca8d
commit 4fd8048c3c
47 changed files with 540 additions and 1512 deletions
+36 -2
View File
@@ -20,6 +20,12 @@ void sub_08069888(Entity* this);
extern u16 gUnk_08111C50[];
extern const s16 gUnk_08111C5C[];
extern const u8 gUnk_08111C74[];
extern const s16 gUnk_08111C84[];
extern const u8 gUnk_08111C8C[];
void Gorman(Entity* this) {
if ((this->flags & ENT_SCRIPTED) != 0) {
sub_08069838(this);
@@ -98,9 +104,37 @@ void sub_08069888(Entity* this) {
MessageNoOverlap(gUnk_08111C50[index], this);
}
ASM_FUNC("asm/non_matching/gorman/sub_0806991C.inc", void sub_0806991C(Entity* this, ScriptExecutionContext* context))
void sub_0806991C(Entity* this, ScriptExecutionContext* context) {
u32 tmp;
const s16* ptr;
this->field_0x68.HALF.LO = (Random() & 0x1f) + 0x3c;
ptr = &gUnk_08111C5C[*(s8*)&this->field_0x68.HALF.HI * 2];
context->x.HALF.HI = gRoomControls.origin_x + ptr[0];
context->y.HALF.HI = gRoomControls.origin_y + ptr[1];
context->unk_19 = 8;
context->postScriptActions |= 2;
context->condition = 0;
tmp = sub_080045DA(context->x.HALF.HI - this->x.HALF.HI, context->y.HALF.HI - this->y.HALF.HI);
this->direction = tmp;
this->animationState = (this->animationState & 0x80) | gUnk_08111C74[(tmp << 0x18) >> 0x1c];
gActiveScriptInfo.flags |= 1;
}
ASM_FUNC("asm/non_matching/gorman/sub_080699AC.inc", void sub_080699AC(Entity* this, ScriptExecutionContext* context))
void sub_080699AC(Entity* this, ScriptExecutionContext* context) {
u32 tmp;
const s16* ptr;
this->field_0x68.HALF.LO = (Random() & 0x1f) + 0x3c;
ptr = &gUnk_08111C84[*(s8*)&this->field_0x68.HALF.HI * 2];
context->x.HALF.HI = gRoomControls.origin_x + ptr[0];
context->y.HALF.HI = gRoomControls.origin_y + ptr[1];
context->unk_19 = 8;
context->postScriptActions |= 2;
context->condition = 0;
tmp = sub_080045DA(context->x.HALF.HI - this->x.HALF.HI, context->y.HALF.HI - this->y.HALF.HI);
this->direction = tmp;
this->animationState = (this->animationState & 0x80) | gUnk_08111C8C[(tmp << 0x18) >> 0x1c];
gActiveScriptInfo.flags |= 1;
}
void sub_08069A3C(Entity* this) {
this->field_0x68.HALF.HI = gUnk_08111C9C[(Random() & 1) + (s8)this->field_0x68.HALF.HI * 2];
+26 -1
View File
@@ -1,9 +1,12 @@
#include "entity.h"
#include "sound.h"
#include "script.h"
#include "npc.h"
extern SpriteLoadData gUnk_0810C48C;
extern void sub_0806FF10(Entity* this, u32 param_2, u32 param_3);
void MinishEzlo(Entity* this) {
if (this->action == 0) {
if (LoadExtraSpriteData(this, &gUnk_0810C48C) == 0) {
@@ -27,7 +30,29 @@ void MinishEzlo(Entity* this) {
}
}
ASM_FUNC("asm/non_matching/minishEzlo/MinishEzlo_Head.inc", void MinishEzlo_Head(Entity* this))
void MinishEzlo_Head(Entity* this) {
u32 uVar1;
u32 uVar2;
u32 uVar3;
if ((this->frameSpriteSettings & 4) != 0) {
uVar2 = 1;
uVar1 = 0;
} else {
uVar2 = 0;
uVar1 = 1;
}
if ((this->frameSpriteSettings & 8) != 0) {
uVar3 = 0x16;
} else {
uVar3 = 0x11c;
}
SetExtraSpriteFrame(this, uVar2, (this->frame & 0xffffff7f) - 1);
SetExtraSpriteFrame(this, uVar1, this->frameIndex);
sub_0806FF10(this, uVar1, uVar3);
SetSpriteSubEntryOffsetData1(this, uVar1, uVar2);
sub_0807000C(this);
}
void sub_0806305C(Entity* this) {
this->spritePriority.b1 = 0;