summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoroctorock <79596758+octorock@users.noreply.github.com>2022-02-28 23:35:23 +0100
committeroctorock <79596758+octorock@users.noreply.github.com>2022-03-10 19:40:44 +0100
commitcffa1024ca98b517031dc6965717774e25e6482a (patch)
treeb63a0b91017c2207c96673c4808184fba6c6ba56 /src
parent241c0312d93cb6940c1d5675dea4433c5a735a78 (diff)
Decompile Object74
Diffstat (limited to 'src')
-rw-r--r--src/object/chestSpawner.c2
-rw-r--r--src/object/jailBars.c12
-rw-r--r--src/object/object74.c116
-rw-r--r--src/object/pushableGrave.c2
-rw-r--r--src/object/stoneTablet.c15
5 files changed, 129 insertions, 18 deletions
diff --git a/src/object/chestSpawner.c b/src/object/chestSpawner.c
index 20016663..a7890edb 100644
--- a/src/object/chestSpawner.c
+++ b/src/object/chestSpawner.c
@@ -310,7 +310,7 @@ void sub_080842D8(ChestSpawnerEntity* this) {
if ((super->y.HALF.HI & 8) != 0) {
index += 2;
}
- sub_0801AF18((u8*)gUnk_0811F898[index], COORD_TO_TILE(super), super->collisionLayer);
+ SetMultipleTiles((u16*)gUnk_0811F898[index], COORD_TO_TILE(super), super->collisionLayer);
}
const Hitbox gUnk_0811F8A8 = { 0, -3, { 0, 0, 0, 0 }, 6, 6 };
diff --git a/src/object/jailBars.c b/src/object/jailBars.c
index 7a36f0e2..9983eb1c 100644
--- a/src/object/jailBars.c
+++ b/src/object/jailBars.c
@@ -8,8 +8,8 @@
extern void sub_080A0960(Entity*, u32);
extern void (*const gUnk_08124950[])(Entity*);
-extern u8 gUnk_08124960;
-extern u8 gUnk_0812497A;
+extern u16 gUnk_08124960[];
+extern u16 gUnk_0812497A[];
void JailBars(Entity* this) {
gUnk_08124950[this->action](this);
@@ -49,11 +49,11 @@ void nullsub_127(Entity* this) {
}
void sub_080A0960(Entity* this, u32 arg1) {
- u8* puVar1;
+ u16* puVar1;
- puVar1 = &gUnk_08124960;
+ puVar1 = gUnk_08124960;
if (arg1 == 1) {
- puVar1 = &gUnk_0812497A;
+ puVar1 = gUnk_0812497A;
}
- sub_0801AF18(puVar1, COORD_TO_TILE(this), 1);
+ SetMultipleTiles(puVar1, COORD_TO_TILE(this), 1);
}
diff --git a/src/object/object74.c b/src/object/object74.c
new file mode 100644
index 00000000..e3c4111c
--- /dev/null
+++ b/src/object/object74.c
@@ -0,0 +1,116 @@
+/**
+ * @file object74.c
+ * @ingroup Objects
+ *
+ * @brief Object74 object
+ */
+
+#define NENT_DEPRECATED
+#include "global.h"
+#include "object.h"
+#include "functions.h"
+#include "screen.h"
+
+typedef struct {
+ /*0x00*/ Entity base;
+ /*0x68*/ u8 unk_68[0x1e];
+ /*0x86*/ u16 unk_86;
+} Object74Entity;
+
+void sub_08097B84(Object74Entity*);
+void sub_08097BDC(Object74Entity*);
+void sub_08097C18(Object74Entity*);
+void sub_08097C20(Object74Entity*);
+void sub_08097C1C(Object74Entity*);
+void sub_08097CFC(Object74Entity*);
+bool32 sub_08097CB0(Object74Entity*);
+void sub_08097CB4(Object74Entity*);
+
+const Hitbox gUnk_08123328 = { 0, 0, { 4, 0, 0, 4 }, 18, 18 };
+
+void Object74(Object74Entity* this) {
+ static void (*const gUnk_08123330[])(Object74Entity*) = {
+ sub_08097B84, sub_08097BDC, sub_08097C18, sub_08097C20, sub_08097C1C,
+ };
+ gUnk_08123330[super->action](this);
+}
+
+void sub_08097B84(Object74Entity* this) {
+ super->action = 1;
+ super->spritePriority.b0 = 7;
+ super->hitbox = (Hitbox*)&gUnk_08123328;
+ if ((this->unk_86 == 0xffff) || (CheckFlags(this->unk_86))) {
+ super->spriteSettings.draw = 1;
+ super->action = 4;
+ sub_08097CFC(this);
+ } else {
+ sub_0805BC4C();
+ }
+}
+
+void sub_08097BDC(Object74Entity* this) {
+ if (CheckFlags(this->unk_86)) {
+ SetPlayerControl(CONTROL_1);
+ gUnk_02034490.unk0 = 1;
+ RequestPriorityDuration(super, 0x1e);
+ if (sub_08097CB0(this) == FALSE) {
+ sub_08097CB4(this);
+ }
+ }
+}
+
+void sub_08097C18(Object74Entity* this) {
+}
+
+void sub_08097C1C(Object74Entity* this) {
+}
+
+void sub_08097C20(Object74Entity* this) {
+ u32 tmp;
+ SetPriorityTimer(0x1e);
+ sub_0800445C(super);
+ CreateMagicSparkles(super->x.HALF.HI, super->y.HALF.HI, super->collisionLayer);
+ if (--super->actionDelay == 0) {
+ super->actionDelay = 8;
+ tmp = ++super->field_0xf;
+ gScreen.controls.alphaBlend = (((0x10 - tmp) * 0x100)) | tmp;
+ if (gScreen.controls.alphaBlend == 0x10) {
+ SetPlayerControl(CONTROL_ENABLED);
+ gUnk_02034490.unk0 = 0;
+ gScreen.controls.layerFXControl = 0;
+ sub_08097CFC(this);
+ super->action = 4;
+ super->spriteRendering.alphaBlend = 0;
+ SoundReq(SFX_SECRET);
+ SetGlobalFlag(TINY_ENTRANCE);
+ }
+ }
+}
+
+bool32 sub_08097CB0(Object74Entity* this) {
+ return FALSE;
+}
+
+void sub_08097CB4(Object74Entity* this) {
+ super->action = 3;
+ super->spriteSettings.draw = 1;
+ super->spriteRendering.alphaBlend = 1;
+ super->actionDelay = 0x1e;
+ super->field_0xf = 0;
+ gScreen.controls.layerFXControl = 0xf40;
+ gScreen.controls.alphaBlend = 0x1000;
+ SoundReq(SFX_14A);
+}
+
+void sub_08097CFC(Object74Entity* this) {
+ static const u16 gUnk_08123344[] = { 16448, 65471, 16449, 65472, 16450, 65473, 16451, 65535, 16452, 0,
+ 16453, 1, 16454, 63, 16455, 64, 16456, 65, 65535 };
+ static const u16 gUnk_0812336A[] = {
+ 16449, 65471, 16449, 65472, 16452, 65535, 16452, 0, 16455, 63, 16455, 64, 65535
+ };
+ if ((super->x.HALF.HI & 0xf) == 0) {
+ SetMultipleTiles((u16*)gUnk_0812336A, COORD_TO_TILE(super), super->collisionLayer);
+ } else {
+ SetMultipleTiles((u16*)gUnk_08123344, COORD_TO_TILE(super), super->collisionLayer);
+ }
+}
diff --git a/src/object/pushableGrave.c b/src/object/pushableGrave.c
index 989f817e..a3421aa2 100644
--- a/src/object/pushableGrave.c
+++ b/src/object/pushableGrave.c
@@ -78,7 +78,7 @@ void PushableGrave_Init(PushableGraveEntity* this) {
super->hitbox = (Hitbox*)&gUnk_080FD570;
SetTile(tileIndex, tilePosition, super->collisionLayer);
if (super->type2 == 2) {
- sub_0801AF18((u8*)gUnk_081232C0, tilePosition, super->collisionLayer);
+ SetMultipleTiles((u16*)gUnk_081232C0, tilePosition, super->collisionLayer);
}
}
}
diff --git a/src/object/stoneTablet.c b/src/object/stoneTablet.c
index 9216e9b8..ce0df01e 100644
--- a/src/object/stoneTablet.c
+++ b/src/object/stoneTablet.c
@@ -15,22 +15,17 @@ void StoneTablet(Entity* this) {
}
void sub_080979CC(Entity* this) {
- static const u8 gUnk_081232EC[] = {
- 0x22, 0x40, 0xFE, 0xFF, 0x22, 0x40, 0xFF, 0xFF, 0x22, 0x40, 0x0, 0x0, 0x22, 0x40, 0x1, 0x0, 0xFF, 0xFF,
- };
-
- static const u8 gUnk_081232FE[] = {
- 0x65, 0x40, 0xBF, 0xFF, 0x22, 0x40, 0xC0, 0xFF, 0x66, 0x40, 0xC1, 0xFF, 0x29,
- 0x40, 0xFF, 0xFF, 0x26, 0x40, 0x0, 0x0, 0x2A, 0x40, 0x1, 0x0, 0xFF, 0xFF,
- };
+ static const u16 gUnk_081232EC[] = { 0x4022, 0xfffe, 0x4022, 0xffff, 0x4022, 0x0, 0x4022, 0x1, 0xffff };
+ static const u16 gUnk_081232FE[] = { 0x4065, 0xffbf, 0x4022, 0xffc0, 0x4066, 0xffc1, 0x4029,
+ 0xffff, 0x4026, 0x0, 0x402a, 0x1, 0xffff };
this->action = 1;
this->spriteSettings.draw = 1;
if (this->type == 3) {
this->frameIndex = 0;
- sub_0801AF18(gUnk_081232FE, COORD_TO_TILE(this), this->collisionLayer);
+ SetMultipleTiles((u16*)gUnk_081232FE, COORD_TO_TILE(this), this->collisionLayer);
} else {
this->frameIndex = this->type;
- sub_0801AF18(gUnk_081232EC, COORD_TO_TILE(this), this->collisionLayer);
+ SetMultipleTiles((u16*)gUnk_081232EC, COORD_TO_TILE(this), this->collisionLayer);
}
}