From 05111993bc0ff1fa798c4344eb4f5ccc7283389b Mon Sep 17 00:00:00 2001 From: octorock <79596758+octorock@users.noreply.github.com> Date: Sun, 27 Feb 2022 21:35:21 +0100 Subject: [PATCH] Decompile Object69 --- asm/object/object69.s | 40 ---------------------------------------- linker.ld | 2 +- src/object/object69.c | 23 +++++++++++++++++++++++ 3 files changed, 24 insertions(+), 41 deletions(-) delete mode 100644 asm/object/object69.s create mode 100644 src/object/object69.c diff --git a/asm/object/object69.s b/asm/object/object69.s deleted file mode 100644 index 05a953ba..00000000 --- a/asm/object/object69.s +++ /dev/null @@ -1,40 +0,0 @@ - .include "asm/macros.inc" - - .include "constants/constants.inc" - - .syntax unified - - .text - - - thumb_func_start Object69 -Object69: @ 0x08094A0C - push {lr} - adds r2, r0, #0 - ldrb r1, [r2, #0x10] - movs r0, #2 - ands r0, r1 - cmp r0, #0 - beq _08094A3E - ldrb r0, [r2, #0xc] - cmp r0, #0 - bne _08094A34 - movs r0, #1 - strb r0, [r2, #0xc] - ldr r0, _08094A30 @ =gHitbox_2 - str r0, [r2, #0x48] - adds r0, r2, #0 - bl sub_0807DD50 - b _08094A42 - .align 2, 0 -_08094A30: .4byte gHitbox_2 -_08094A34: - adds r0, r2, #0 - movs r1, #0 - bl sub_0807DD94 - b _08094A42 -_08094A3E: - movs r0, #1 - strb r0, [r2, #0xc] -_08094A42: - pop {pc} diff --git a/linker.ld b/linker.ld index 1178ff7a..aecc877b 100644 --- a/linker.ld +++ b/linker.ld @@ -751,7 +751,7 @@ SECTIONS { asm/object/object66.o(.text); asm/object/object67.o(.text); asm/object/object68.o(.text); - asm/object/object69.o(.text); + src/object/object69.o(.text); src/object/object6A.o(.text); src/object/crenelBeanSprout.o(.text); src/object/minecartDoor.o(.text); diff --git a/src/object/object69.c b/src/object/object69.c new file mode 100644 index 00000000..b02c964c --- /dev/null +++ b/src/object/object69.c @@ -0,0 +1,23 @@ +/** + * @file object69.c + * @ingroup Objects + * + * @brief Object69 object + */ +#include "entity.h" +#include "hitbox.h" +#include "functions.h" + +void Object69(Entity* this) { + if ((this->flags & ENT_SCRIPTED) != 0) { + if (this->action == 0) { + this->action = 1; + this->hitbox = (Hitbox*)&gHitbox_2; + sub_0807DD50(this); + } else { + sub_0807DD94(this, NULL); + } + } else { + this->action = 1; + } +}