summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornotyourav <65437533+notyourav@users.noreply.github.com>2021-03-15 16:30:28 -0700
committerGitHub <noreply@github.com>2021-03-15 16:30:28 -0700
commitc319dc53d3bc67909be7bbe75538d796bc99ddff (patch)
tree46a2bc4237231598b6343e57c0bc62041797e263
parente09678c6ab4d6c1070495cf8b49b8b3dffefc4af (diff)
parent366ffa30332e94b3d977d6be5b8fea78efc54c79 (diff)
Merge pull request #137 from gamestabled/minishSizedArchway
MinishSizedArchway OK
-rw-r--r--asm/minishSizedArchway.s40
-rw-r--r--include/functions.h2
-rw-r--r--linker.ld2
-rw-r--r--src/object/archway.c19
-rw-r--r--src/object/minishSizedArchway.c16
5 files changed, 23 insertions, 56 deletions
diff --git a/asm/minishSizedArchway.s b/asm/minishSizedArchway.s
deleted file mode 100644
index cc3b1074..00000000
--- a/asm/minishSizedArchway.s
+++ /dev/null
@@ -1,40 +0,0 @@
- .include "asm/macros.inc"
-
- .include "constants/constants.inc"
-
- .syntax unified
-
- .text
-
-
- thumb_func_start MinishSizedArchway
-MinishSizedArchway: @ 0x080973E4
- push {r4, lr}
- adds r4, r0, #0
- ldrb r0, [r4, #0xc]
- cmp r0, #0
- bne _0809741E
- movs r0, #1
- strb r0, [r4, #0xc]
- ldrb r0, [r4, #0xa]
- strb r0, [r4, #0x1e]
- adds r1, r4, #0
- adds r1, #0x38
- movs r0, #2
- strb r0, [r1]
- adds r0, r4, #0
- bl UpdateSpriteForCollisionLayer
- bl CheckIsDungeon
- cmp r0, #0
- beq _0809741E
- adds r2, r4, #0
- adds r2, #0x29
- ldrb r1, [r2]
- movs r0, #8
- rsbs r0, r0, #0
- ands r0, r1
- movs r1, #1
- orrs r0, r1
- strb r0, [r2]
-_0809741E:
- pop {r4, pc}
diff --git a/include/functions.h b/include/functions.h
index 097c9a73..d6ce6fb3 100644
--- a/include/functions.h
+++ b/include/functions.h
@@ -62,7 +62,7 @@ extern void CreateDust(Entity*);
extern u32 IsItemEquipped(u32);
extern void DeleteManager(Manager*);
extern bool32 CheckPlayerInRegion(u32 centerX, u32 centerY, u32 radiusX, u32 radiusY);
-extern u32 CheckIsDungeon();
+extern u32 CheckIsDungeon(void);
extern u32 GetTileTypeByEntity(Entity*);
// Unidentified
diff --git a/linker.ld b/linker.ld
index 507f1cc7..4a55674c 100644
--- a/linker.ld
+++ b/linker.ld
@@ -799,7 +799,7 @@ SECTIONS {
asm/minecartDoor.o(.text);
asm/objectOnPillar.o(.text);
src/object/mineralWaterSource.o(.text);
- asm/minishSizedArchway.o(.text);
+ src/object/minishSizedArchway.o(.text);
asm/object70.o(.text);
asm/pushableGrave.o(.text);
asm/object72.o(.text);
diff --git a/src/object/archway.c b/src/object/archway.c
index 39975ee7..aa26762f 100644
--- a/src/object/archway.c
+++ b/src/object/archway.c
@@ -1,26 +1,17 @@
#include "global.h"
#include "entity.h"
#include "sprite.h"
-
-extern u32 CheckIsDungeon();
+#include "functions.h"
void Archway(Entity* this) {
- u32 v1;
- u32 v2;
- u32 v3;
-
if (this->action == 0) {
- v1 = this->action = 1;
- v2 = this->spriteSettings.raw;
- v1 = v1 - 0x5;
- v1 = v1 & v2;
- this->spriteSettings.raw = v1 | 1;
+ this->action = 1;
+ this->spriteSettings.b.draw = 1;
this->frameIndex = this->type2;
this->collisionLayer = 2;
UpdateSpriteForCollisionLayer(this);
- v3 = CheckIsDungeon();
- if (v3 != 0) {
- this->spritePriority.b0 = (this->spritePriority.b0 & 0xf8) | 1;
+ if (CheckIsDungeon()) {
+ this->spritePriority.b0 = 1;
}
}
}
diff --git a/src/object/minishSizedArchway.c b/src/object/minishSizedArchway.c
new file mode 100644
index 00000000..cc1b63d3
--- /dev/null
+++ b/src/object/minishSizedArchway.c
@@ -0,0 +1,16 @@
+#include "global.h"
+#include "entity.h"
+#include "sprite.h"
+#include "functions.h"
+
+void MinishSizedArchway(Entity* this) {
+ if (this->action == 0) {
+ this->action = 1;
+ this->frameIndex = this->type;
+ this->collisionLayer = 2;
+ UpdateSpriteForCollisionLayer(this);
+ if (CheckIsDungeon()) {
+ this->spritePriority.b0 = 1;
+ }
+ }
+}