From d21a0afec2170f4dfd1e787c50018c6c20591b6e Mon Sep 17 00:00:00 2001 From: 21aslade <21aslade@go.dsdmail.net> Date: Wed, 1 Jul 2020 12:13:36 -0600 Subject: [PATCH] wheaton.c OK --- asm/wheaton.s | 38 -------------------------------------- linker.ld | 2 +- src/wheaton.c | 26 ++++++++++++++++++++++++++ 3 files changed, 27 insertions(+), 39 deletions(-) delete mode 100644 asm/wheaton.s create mode 100644 src/wheaton.c diff --git a/asm/wheaton.s b/asm/wheaton.s deleted file mode 100644 index b19406ba..00000000 --- a/asm/wheaton.s +++ /dev/null @@ -1,38 +0,0 @@ - .include "asm/macros.inc" - - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start Wheaton -Wheaton: @ 0x08062E20 - push {r4, lr} - adds r4, r0, #0 - ldrb r0, [r4, #0xc] - cmp r0, #0 - bne _08062E50 - adds r0, #1 - strb r0, [r4, #0xc] - adds r0, r4, #0 - movs r1, #2 - bl sub_0805E3A0 - adds r0, r4, #0 - adds r1, r4, #0 - bl ResolveEntityOnTop - ldr r0, _08062E5C @ =gUnk_0810C3C0 - str r0, [r4, #0x48] - adds r1, r4, #0 - adds r1, #0x63 - movs r0, #0xfe - strb r0, [r1] - adds r0, r4, #0 - bl sub_0807DD64 -_08062E50: - adds r0, r4, #0 - movs r1, #0 - bl sub_0807DD94 - pop {r4, pc} - .align 2, 0 -_08062E5C: .4byte gUnk_0810C3C0 diff --git a/linker.ld b/linker.ld index c8ecad9c..6bf92f3e 100644 --- a/linker.ld +++ b/linker.ld @@ -535,7 +535,7 @@ SECTIONS { asm/npc9.o(.text); src/stamp.o(.text); asm/marcy.o(.text); - asm/wheaton.o(.text); + src/wheaton.o(.text); asm/pita.o(.text); asm/minishEzlo.o(.text); src/mailbox.o(.text); diff --git a/src/wheaton.c b/src/wheaton.c new file mode 100644 index 00000000..06285482 --- /dev/null +++ b/src/wheaton.c @@ -0,0 +1,26 @@ +#include "global.h" +#include "entity.h" + +extern void sub_0805E3A0(Entity *, u32); +extern void ResolveEntityOnTop(Entity *, Entity *); +extern BoundingBox gUnk_0810C3C0; +extern void sub_0807DD64(Entity *); +extern void sub_0807DD94(Entity *, u32); + +void Wheaton(Entity *this) { + if (this->action == 0) { + this->action++; + + sub_0805E3A0(this, 2); + + ResolveEntityOnTop(this, this); + + this->boundingBox = &gUnk_0810C3C0; + + this->spriteOffsetY = 0xfe; + + sub_0807DD64(this); + } + + sub_0807DD94(this, 0); +} \ No newline at end of file