summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonarthCG <angel.cantos.giron@gmail.com>2021-06-21 11:01:34 +0200
committerLeonarthCG <angel.cantos.giron@gmail.com>2021-06-21 11:01:34 +0200
commit59ca3b7be50dfd2c44b8dcc95fef583788fcc3ce (patch)
treef4d85e31d0ca1a188762a3fee6366bf36e79d170
parent7abb984cc64c618c5efa8a3fad88206c3ebac7d3 (diff)
decompile object31 (frozenFlower)
-rw-r--r--asm/object31.s43
-rw-r--r--include/object.h4
-rw-r--r--linker.ld2
-rw-r--r--src/object.c2
-rw-r--r--src/object/frozenFlower.c21
5 files changed, 25 insertions, 47 deletions
diff --git a/asm/object31.s b/asm/object31.s
deleted file mode 100644
index 0ad6fc74..00000000
--- a/asm/object31.s
+++ /dev/null
@@ -1,43 +0,0 @@
- .include "asm/macros.inc"
-
- .include "constants/constants.inc"
-
- .syntax unified
-
- .text
-
-
- thumb_func_start Object31
-Object31: @ 0x0808A9C4
- push {lr}
- ldr r2, _0808A9D8 @ =gUnk_0812119C
- ldrb r1, [r0, #0xc]
- lsls r1, r1, #2
- adds r1, r1, r2
- ldr r1, [r1]
- bl _call_via_r1
- pop {pc}
- .align 2, 0
-_0808A9D8: .4byte gUnk_0812119C
-
- thumb_func_start sub_0808A9DC
-sub_0808A9DC: @ 0x0808A9DC
- movs r1, #1
- strb r1, [r0, #0xc]
- ldrb r1, [r0, #0xa]
- strb r1, [r0, #0x1e]
- ldrb r1, [r0, #0x19]
- movs r2, #0xc0
- orrs r1, r2
- strb r1, [r0, #0x19]
- adds r0, #0x29
- ldrb r1, [r0]
- movs r2, #7
- orrs r1, r2
- strb r1, [r0]
- bx lr
-
- thumb_func_start nullsub_519
-nullsub_519: @ 0x0808A9F8
- bx lr
- .align 2, 0
diff --git a/include/object.h b/include/object.h
index 145ae462..dc2b6b43 100644
--- a/include/object.h
+++ b/include/object.h
@@ -54,7 +54,7 @@ typedef enum {
PUSHABLE_ROCK,
HITTABLE_LEVER,
OBJECT_30,
- OBJECT_31,
+ FROZEN_FLOWER,
PULLABLE_MUSHROOM,
BOLLARD,
WARP_POINT,
@@ -250,7 +250,7 @@ extern void Smoke(Entity*);
extern void PushableRock(Entity*);
extern void HittableLever(Entity*);
extern void Object30(Entity*);
-extern void Object31(Entity*);
+extern void FrozenFlower(Entity*);
extern void PullableMushroom(Entity*);
extern void Bollard(Entity*);
extern void WarpPoint(Entity*);
diff --git a/linker.ld b/linker.ld
index 3ecd5a65..f093f9f7 100644
--- a/linker.ld
+++ b/linker.ld
@@ -738,7 +738,7 @@ SECTIONS {
asm/pushableRock.o(.text);
asm/hittableLever.o(.text);
asm/object30.o(.text);
- asm/object31.o(.text);
+ src/object/frozenFlower.o(.text);
asm/pullableMushroom.o(.text);
asm/bollard.o(.text);
asm/warpPoint.o(.text);
diff --git a/src/object.c b/src/object.c
index b5eff460..768c8d12 100644
--- a/src/object.c
+++ b/src/object.c
@@ -52,7 +52,7 @@ void (*const gObjectFunctions[])(Entity*) = {
[PUSHABLE_ROCK] = PushableRock,
[HITTABLE_LEVER] = HittableLever,
[OBJECT_30] = Object30,
- [OBJECT_31] = Object31,
+ [FROZEN_FLOWER] = FrozenFlower,
[PULLABLE_MUSHROOM] = PullableMushroom,
[BOLLARD] = Bollard,
[WARP_POINT] = WarpPoint,
diff --git a/src/object/frozenFlower.c b/src/object/frozenFlower.c
new file mode 100644
index 00000000..a668506b
--- /dev/null
+++ b/src/object/frozenFlower.c
@@ -0,0 +1,21 @@
+#include "global.h"
+#include "entity.h"
+
+extern void (*const gUnk_0812119C[])(Entity*);
+
+void FrozenFlower(Entity* this)
+{
+ gUnk_0812119C[this->action](this);
+}
+
+void sub_0808A9DC(Entity* this)
+{
+ this->action = 1;
+ this->frameIndex = this->type;
+ this->spriteRendering.b3 = 3;
+ this->spritePriority.b0 = 7;
+}
+
+void nullsub_519(Entity* this)
+{
+}