This commit is contained in:
theo3 2020-06-14 04:50:26 -07:00
commit 9d18ac0dc1
4 changed files with 117 additions and 23 deletions

23
.clang-format Normal file
View File

@ -0,0 +1,23 @@
IndentWidth: 4
Language: Cpp
UseTab: Never
ColumnLimit: 120
PointerAlignment: Left
BreakBeforeBraces: Attach
SpaceAfterCStyleCast: false
Cpp11BracedListStyle: false
IndentCaseLabels: true
BinPackArguments: true
BinPackParameters: true
AlignAfterOpenBracket: Align
AlignOperands: true
BreakBeforeTernaryOperators: true
BreakBeforeBinaryOperators: None
AllowShortBlocksOnASingleLine: true
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: false
AlignEscapedNewlines: Left
AlignTrailingComments: true
SortIncludes: false

View File

@ -10,7 +10,7 @@ extern u32 Random(void);
extern void PlaySFX(u32);
extern void UpdateSpriteOrderAndFlip(Entity*);
extern void InitAnimationForceUpdate(Entity*, u32);
extern void ShowNPCDialogue();
extern void ShowNPCDialogue(Entity*, u32*);
extern u32 UpdateFuseInteraction();
extern void CopyPosition(Entity*, Entity*);
extern void PositionRelative(Entity*, Entity*, u32, u32);
@ -45,6 +45,12 @@ extern void sub_0807DD64(Entity*);
extern void sub_0807DDAC(Entity*, u32);
extern void sub_0807DDE4(Entity*);
extern void sub_0806D02C(Entity*);
extern u32 sub_0806F5A4(u32);
extern u32 sub_080045C4(Entity*, Entity*);
extern void sub_08078784(Entity*, u32);
extern void sub_0807DD50(Entity*);
extern void sub_0807DD94(Entity*, u32);
extern Entity* sub_0805EB00(u32, u32, u32);
extern Entity* sub_0805EB2C(u32, u32, u32, u32, u32);
extern u32 sub_080045C4(Entity*, Entity*);

View File

@ -2,31 +2,17 @@
#include "entity.h"
#include "textbox.h"
#include "link.h"
extern void sub_0806ED78(Entity*);
extern u32 sub_0801E99C(Entity*);
extern void InitAnimationForceUpdate(Entity*, u32);
extern void sub_080042B8(Entity*);
extern void sub_08065AA4(Entity*);
extern u32 UpdateFuseInteraction(void);
extern void ShowNPCDialogue(Entity*, u64*);
extern void sub_08078778(Entity*);
extern void sub_080787A8(Entity*, u32);
extern void sub_0806F118(Entity*);
extern void sub_0805E3A0(Entity*, u8);
extern u32 sub_080045C4(Entity*, Entity*);
extern u32 sub_0806F5A4(void);
extern void sub_080791D0(void);
extern void PlaySFX(u32);
#include "functions.h"
extern TextBox gTextBox;
extern LinkState gLinkState;
extern Entity gLinkEntity;
void sub_08065A64(Entity* this);
void sub_08065AA4(Entity*);
extern void (*gUnk_0811006C[])(Entity*);
extern u64 gUnk_08110080[];
extern u32 gUnk_08110080[];
void sub_08065990(Entity* this) {
gUnk_0811006C[this->action](this);
@ -68,7 +54,7 @@ void sub_08065A34(Entity* this) {
}
void sub_08065A50(Entity* this) {
ShowNPCDialogue(this, &gUnk_08110080[this->entityType.parameter1]);
ShowNPCDialogue(this, &gUnk_08110080[this->entityType.parameter1 * 2]);
}
void sub_08065A64(Entity* this) {
@ -96,8 +82,7 @@ void sub_08065AA4(Entity* this) {
sub_0805E3A0(this, 2);
sub_08065A50(this);
}
sub_080045C4(this, &gLinkEntity);
InitAnimationForceUpdate(this, sub_0806F5A4());
InitAnimationForceUpdate(this, sub_0806F5A4(sub_080045C4(this, &gLinkEntity)));
} else {
sub_08065A50(this);
sub_080791D0();

80
src/malon.c Normal file
View File

@ -0,0 +1,80 @@
#include "global.h"
#include "functions.h"
#include "entity.h"
extern Entity gLinkEntity;
extern void (*gUnk_0810FF5C[])(Entity* this);
extern void (*gUnk_0810FF64[])(Entity* this);
void sub_0806581C(Entity* this) {
if (this->flags & 0x2) {
gUnk_0810FF64[this->action](this);
} else {
gUnk_0810FF5C[this->action](this);
if (this->action != 0) {
sub_0806ED78(this);
}
}
}
void sub_08065864(Entity* this) {
this->action = 1;
this->spriteSettings.b.ss0 = 1;
InitAnimationForceUpdate(this, 0xC);
}
void sub_08065880(Entity* this) {
sub_080042B8(this);
}
void sub_08065888(Entity* this) {
this->action = 1;
this->spriteSettings.b.ss0 = 1;
this->animationState = 4;
this->field_0x68 = sub_0801E99C(this);
sub_08078784(this, this->field_0x68);
sub_0807DD50(this);
}
void sub_080658BC(Entity* this) {
if (this->interactType == 2) {
this->action = 2;
this->interactType = 0;
InitAnimationForceUpdate(this, sub_0806F5A4(sub_080045C4(this, &gLinkEntity)));
sub_0806F118(this);
} else {
sub_0807DD94(this, 0);
}
}
void sub_08065900(Entity* this) {
if (UpdateFuseInteraction(this) != 0) {
this->action = 1;
}
}
void sub_08065914(Entity* this) {
Entity* target;
target = sub_0805EB00(7, 0x1F, 7);
if (target != NULL) {
PositionRelative(this, target, 0x180000, -0x10000);
target->parent = this;
}
target = sub_0805EB00(7, 0x20, 7);
if (target != NULL) {
PositionRelative(this, target, 0x280000, 0);
target->parent = this;
}
}
void sub_08065960(Entity* this) {
if (this->action == 0) {
this->action++;
this->spriteSettings.b.ss0 = 1;
InitAnimationForceUpdate(this, 0xC);
} else {
sub_080042B8(this);
}
}