From c0ed079d03d0d17b69577cbbd15ec4c07d7ff07f Mon Sep 17 00:00:00 2001 From: Macrepeh <63179588+Macrepeh@users.noreply.github.com> Date: Tue, 14 Jul 2020 19:14:32 -0400 Subject: [PATCH 1/3] Update linker.ld --- linker.ld | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linker.ld b/linker.ld index 248f0b65..13f230d5 100644 --- a/linker.ld +++ b/linker.ld @@ -607,7 +607,7 @@ SECTIONS { asm/kingGustaf.o(.text); asm/gina.o(.text); src/npc/simon.o(.text); - asm/anju.o(.text); + src/npc/anju.o(.text); asm/mama.o(.text); src/npc/emma.o(.text); src/npc/teachers.o(.text); From 0ed6703315f20b4def5a03ebca127b005e996e67 Mon Sep 17 00:00:00 2001 From: Macrepeh <63179588+Macrepeh@users.noreply.github.com> Date: Tue, 14 Jul 2020 19:15:39 -0400 Subject: [PATCH 2/3] Add files via upload --- src/npc/anju.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 src/npc/anju.c diff --git a/src/npc/anju.c b/src/npc/anju.c new file mode 100644 index 00000000..e1b7e4e8 --- /dev/null +++ b/src/npc/anju.c @@ -0,0 +1,61 @@ +#include "global.h" +#include "entity.h" +#include "link.h" +#include "room.h" +#include "flags.h" +#include "sprite.h" +#include "textbox.h" +#include "npc.h" + +extern void sub_0805E3A0(Entity*, u32); +extern void sub_0807DD50(Entity*); +extern u32 sub_0806F5A4(u32); +extern void sub_0806F118(Entity*); +extern void sub_0807DD94(Entity*, u32); +extern u32 sub_0801E99C(void); +extern void sub_08078784(Entity*, u32); + +void Anju(Entity *this) +{ + switch (this->action) { + case 0: + this->action = 1; + this->spriteSettings.b.draw = 1; + this->animationState = this->actionDelay; + sub_0807DD50(this); + return; + case 1: + if (this->interactType == 2) { + this->action = 2; + this->interactType = 0; + InitializeAnimation(this,(this->animIndex & -4) + sub_0806F5A4(GetFacingDirection(this, &gLinkEntity))); + sub_0806F118(this); + } else { + sub_0807DD94(this, 0); + } + return; + case 2: + if (UpdateFuseInteraction(this)) { + this->action = 1; + } + default: + } +} + +void sub_0806C354(Entity *this) +{ + this->field_0x68 = sub_0801E99C(); + sub_08078784(this,this->field_0x68); +} + +void Anju_Fusion(Entity *this) +{ + if (this->action == 0) { + this->action++; + this->spriteSettings.b.draw = 1; + InitAnimationForceUpdate(this,6); + } + else { + UpdateAnimationSingleFrame(this); + } +} \ No newline at end of file From c6a6888b43462204d996e7761d62d56e641c753e Mon Sep 17 00:00:00 2001 From: Macrepeh <63179588+Macrepeh@users.noreply.github.com> Date: Tue, 14 Jul 2020 19:16:25 -0400 Subject: [PATCH 3/3] Delete anju.s --- asm/anju.s | 122 ----------------------------------------------------- 1 file changed, 122 deletions(-) delete mode 100644 asm/anju.s diff --git a/asm/anju.s b/asm/anju.s deleted file mode 100644 index e3412270..00000000 --- a/asm/anju.s +++ /dev/null @@ -1,122 +0,0 @@ - .include "asm/macros.inc" - - .include "constants/constants.inc" - - .syntax unified - - .text - - - thumb_func_start Anju -Anju: @ 0x0806C2C4 - push {r4, lr} - adds r4, r0, #0 - ldrb r0, [r4, #0xc] - cmp r0, #1 - beq _0806C2FA - cmp r0, #1 - bgt _0806C2D8 - cmp r0, #0 - beq _0806C2DE - b _0806C350 -_0806C2D8: - cmp r0, #2 - beq _0806C342 - b _0806C350 -_0806C2DE: - movs r2, #1 - movs r0, #1 - strb r0, [r4, #0xc] - ldrb r1, [r4, #0x18] - subs r0, #5 - ands r0, r1 - orrs r0, r2 - strb r0, [r4, #0x18] - ldrb r0, [r4, #0xe] - strb r0, [r4, #0x14] - adds r0, r4, #0 - bl sub_0807DD50 - b _0806C350 -_0806C2FA: - adds r2, r4, #0 - adds r2, #0x39 - movs r1, #0 - ldrsb r1, [r2, r1] - cmp r1, #2 - bne _0806C338 - movs r0, #0 - strb r1, [r4, #0xc] - strb r0, [r2] - ldr r1, _0806C334 @ =gLinkEntity - adds r0, r4, #0 - bl GetFacingDirection - bl sub_0806F5A4 - adds r1, r4, #0 - adds r1, #0x58 - ldrb r1, [r1] - movs r2, #4 - rsbs r2, r2, #0 - ands r1, r2 - adds r1, r1, r0 - adds r0, r4, #0 - bl InitializeAnimation - adds r0, r4, #0 - bl sub_0806F118 - b _0806C350 - .align 2, 0 -_0806C334: .4byte gLinkEntity -_0806C338: - adds r0, r4, #0 - movs r1, #0 - bl sub_0807DD94 - b _0806C350 -_0806C342: - adds r0, r4, #0 - bl UpdateFuseInteraction - cmp r0, #0 - beq _0806C350 - movs r0, #1 - strb r0, [r4, #0xc] -_0806C350: - pop {r4, pc} - .align 2, 0 - - thumb_func_start sub_0806C354 -sub_0806C354: @ 0x0806C354 - push {r4, lr} - adds r4, r0, #0 - bl sub_0801E99C - adds r1, r4, #0 - adds r1, #0x68 - strb r0, [r1] - ldrb r1, [r1] - adds r0, r4, #0 - bl sub_08078784 - pop {r4, pc} - - thumb_func_start Anju_Fusion -Anju_Fusion: @ 0x0806C36C - push {lr} - adds r2, r0, #0 - ldrb r0, [r2, #0xc] - cmp r0, #0 - bne _0806C392 - adds r0, #1 - strb r0, [r2, #0xc] - ldrb r1, [r2, #0x18] - movs r0, #4 - rsbs r0, r0, #0 - ands r0, r1 - movs r1, #1 - orrs r0, r1 - strb r0, [r2, #0x18] - adds r0, r2, #0 - movs r1, #6 - bl InitAnimationForceUpdate - b _0806C398 -_0806C392: - adds r0, r2, #0 - bl UpdateAnimationSingleFrame -_0806C398: - pop {pc} - .align 2, 0