summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornotyouraveragehooman <65437533+notyouraveragehooman@users.noreply.github.com>2020-06-14 00:35:22 -0700
committerGitHub <noreply@github.com>2020-06-14 00:35:22 -0700
commit7f24d3da70cdfdac3e5543d7fe2eb27fc7852d8e (patch)
treeaf3fd36e245702ae50439821e744885b4d14d0fe
parentf0f3de254ff552429b84938ea90a88d7dd2e27fe (diff)
parentffc92f8f4f3e6de7bdb30abd2e4d58075d350c56 (diff)
Merge pull request #10 from gamestabled/malon
epona and malon should be resolved now
-rw-r--r--include/functions.h8
-rw-r--r--src/epona.c26
-rw-r--r--src/malon.c80
3 files changed, 93 insertions, 21 deletions
diff --git a/include/functions.h b/include/functions.h
index 02673254..bea58e53 100644
--- a/include/functions.h
+++ b/include/functions.h
@@ -10,7 +10,7 @@ extern u32 Random(void);
extern void PlaySFX(u32);
extern void UpdateSpriteOrderAndFlip(Entity*);
extern void LoadAnimation(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*);
diff --git a/src/epona.c b/src/epona.c
index be050c87..3e3bf464 100644
--- a/src/epona.c
+++ b/src/epona.c
@@ -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 LoadAnimation(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,8 @@ void sub_08065AA4(Entity* this) {
sub_0805E3A0(this, 2);
sub_08065A50(this);
}
- sub_080045C4(this, &gLinkEntity);
- LoadAnimation(this, sub_0806F5A4());
+
+ LoadAnimation(this, sub_0806F5A4(sub_080045C4(this, &gLinkEntity)));
} else {
sub_08065A50(this);
sub_080791D0();
diff --git a/src/malon.c b/src/malon.c
new file mode 100644
index 00000000..64ae31f2
--- /dev/null
+++ b/src/malon.c
@@ -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;
+ LoadAnimation(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;
+ LoadAnimation(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;
+ LoadAnimation(this, 0xC);
+ } else {
+ sub_080042B8(this);
+ }
+}