summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenny022p <info@henny022.de>2022-10-14 06:14:38 +0200
committerHenny022p <info@henny022.de>2022-10-14 06:14:38 +0200
commit05b46ee3fe418d5833ecc77b1b2dc74a47fdd4bf (patch)
treeb2c400ed938180680d5be43306db66d9b15b6954
parent9ef3442fe3699228176111843ddb08271f21b8f5 (diff)
match sub_08090094
uses forced register
-rw-r--r--include/global.h6
-rw-r--r--src/object/pushableFurniture.c89
2 files changed, 93 insertions, 2 deletions
diff --git a/include/global.h b/include/global.h
index 6126b24a..94d19c8f 100644
--- a/include/global.h
+++ b/include/global.h
@@ -95,6 +95,12 @@
#define END_NONMATCH }
#endif
+#if NON_MATCHING
+#define FORCE_REGISTER(var, reg) var
+#else
+#define FORCE_REGISTER(var, reg) register var asm(#reg)
+#endif
+
typedef union {
s32 WORD;
struct {
diff --git a/src/object/pushableFurniture.c b/src/object/pushableFurniture.c
index 37aff557..4f185253 100644
--- a/src/object/pushableFurniture.c
+++ b/src/object/pushableFurniture.c
@@ -405,8 +405,93 @@ void sub_0808FF50(PushableFurnitureEntity* this) {
}
}
-ASM_FUNC("asm/non_matching/pushableFurniture/sub_08090094.inc",
- void sub_08090094(PushableFurnitureEntity* this, u32 param_2, u32 param_3))
+void sub_08090094(PushableFurnitureEntity* this, u32 param_2, u32 tilePos) {
+ FORCE_REGISTER(u32 tmp1, r4);
+
+ u32 index;
+ u32 tmp2;
+
+ tmp1 = sub_080B1B44(tilePos, 1);
+ index = GetTileIndex(tilePos, 1);
+ if ((index & 0x4000) == 0) {
+ index = param_2;
+ switch (index) {
+ case 0x4025:
+ if (tmp1 == 5) {
+ index = 0x4022;
+ }
+ SetTile(index, tilePos, 1);
+ return;
+ case 0x402d:
+ case 0x402f:
+ if (tmp1 == 5) {
+ index = 0x4022;
+ }
+ SetTile(index, tilePos, 1);
+ return;
+ case 0x4024:
+ case 0x402c:
+ case 0x402e:
+ if (tmp1 == 10) {
+ index = 0x4022;
+ }
+ SetTile(index, tilePos, 1);
+ return;
+ default:
+ SetTile(index, tilePos, 1);
+ return;
+ }
+ }
+ switch (index) {
+ case 0x4022:
+ default:
+ return;
+ case 0x4025:
+ if (param_2 == 0x4024) {
+ index = 0x4022;
+ this->unk_83 |= 0x10;
+ }
+ if (param_2 == 0x402c) {
+ index = 0x4022;
+ this->unk_83 |= 0x10;
+ }
+ break;
+ case 0x402d:
+ case 0x402f:
+ if (param_2 == 0x402c) {
+ index = 0x402b;
+ this->unk_83 |= 0x10;
+ }
+ if (param_2 == 0x4024) {
+ index = 0x4022;
+ this->unk_83 |= 0x10;
+ }
+ break;
+ case 0x4024:
+ if (param_2 == 0x4025) {
+ index = 0x4022;
+ this->unk_83 |= 0x20;
+ }
+ if (param_2 == 0x402d) {
+ index = 0x4022;
+ this->unk_83 |= 0x20;
+ }
+ break;
+ case 0x402c:
+ case 0x402e:
+ if (param_2 == 0x402d) {
+ index = 0x402b;
+ this->unk_83 |= 0x20;
+ }
+ if (param_2 == 0x4025) {
+ index = 0x4022;
+ this->unk_83 |= 0x20;
+ }
+ break;
+ }
+
+ SetTile(index, tilePos, 1);
+}
void sub_08090254(PushableFurnitureEntity* this) {
sub_0807B9B8(this->unk_74, this->unk_70, super->collisionLayer);