mirror of https://github.com/zeldaret/tmc.git
decompiled asm/fireplace.s
This commit is contained in:
parent
d572b9b64c
commit
be22573911
176
asm/fireplace.s
176
asm/fireplace.s
|
@ -1,176 +0,0 @@
|
|||
.include "asm/macros.inc"
|
||||
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
|
||||
thumb_func_start Fireplace
|
||||
Fireplace: @ 0x0809B6F0
|
||||
push {lr}
|
||||
ldr r2, _0809B704 @ =gUnk_08123D98
|
||||
ldrb r1, [r0, #0xc]
|
||||
lsls r1, r1, #2
|
||||
adds r1, r1, r2
|
||||
ldr r1, [r1]
|
||||
bl _call_via_r1
|
||||
pop {pc}
|
||||
.align 2, 0
|
||||
_0809B704: .4byte gUnk_08123D98
|
||||
|
||||
thumb_func_start sub_0809B708
|
||||
sub_0809B708: @ 0x0809B708
|
||||
push {r4, r5, r6, lr}
|
||||
adds r6, r0, #0
|
||||
movs r2, #1
|
||||
movs r0, #1
|
||||
strb r0, [r6, #0xc]
|
||||
ldrb r1, [r6, #0x18]
|
||||
subs r0, #5
|
||||
ands r0, r1
|
||||
orrs r0, r2
|
||||
strb r0, [r6, #0x18]
|
||||
movs r0, #0x80
|
||||
strh r0, [r6, #0x24]
|
||||
adds r0, r6, #0
|
||||
adds r0, #0x86
|
||||
ldrh r0, [r0]
|
||||
bl CheckFlags
|
||||
cmp r0, #0
|
||||
beq _0809B73A
|
||||
adds r0, r6, #0
|
||||
bl sub_0809B7DC
|
||||
bl DeleteThisEntity
|
||||
b _0809B78A
|
||||
_0809B73A:
|
||||
ldr r0, _0809B794 @ =0x0000030B
|
||||
movs r2, #0x2e
|
||||
ldrsh r1, [r6, r2]
|
||||
ldr r5, _0809B798 @ =gRoomControls
|
||||
ldrh r2, [r5, #6]
|
||||
subs r1, r1, r2
|
||||
asrs r1, r1, #4
|
||||
movs r4, #0x3f
|
||||
ands r1, r4
|
||||
movs r3, #0x32
|
||||
ldrsh r2, [r6, r3]
|
||||
ldrh r3, [r5, #8]
|
||||
subs r2, r2, r3
|
||||
asrs r2, r2, #4
|
||||
ands r2, r4
|
||||
lsls r2, r2, #6
|
||||
orrs r1, r2
|
||||
movs r2, #2
|
||||
bl sub_0807B7D8
|
||||
ldr r0, _0809B79C @ =0x00004061
|
||||
movs r2, #0x2e
|
||||
ldrsh r1, [r6, r2]
|
||||
ldrh r2, [r5, #6]
|
||||
subs r1, r1, r2
|
||||
asrs r1, r1, #4
|
||||
ands r1, r4
|
||||
movs r3, #0x32
|
||||
ldrsh r2, [r6, r3]
|
||||
ldrh r3, [r5, #8]
|
||||
subs r2, r2, r3
|
||||
asrs r2, r2, #4
|
||||
ands r2, r4
|
||||
lsls r2, r2, #6
|
||||
orrs r1, r2
|
||||
adds r2, r6, #0
|
||||
adds r2, #0x38
|
||||
ldrb r2, [r2]
|
||||
bl SetTile
|
||||
_0809B78A:
|
||||
adds r0, r6, #0
|
||||
bl sub_0809B7A0
|
||||
pop {r4, r5, r6, pc}
|
||||
.align 2, 0
|
||||
_0809B794: .4byte 0x0000030B
|
||||
_0809B798: .4byte gRoomControls
|
||||
_0809B79C: .4byte 0x00004061
|
||||
|
||||
thumb_func_start sub_0809B7A0
|
||||
sub_0809B7A0: @ 0x0809B7A0
|
||||
push {r4, lr}
|
||||
adds r4, r0, #0
|
||||
bl sub_0809B7C0
|
||||
ldrb r0, [r4, #0xe]
|
||||
cmp r0, #0
|
||||
beq _0809B7BC
|
||||
adds r0, r4, #0
|
||||
adds r0, #0x86
|
||||
ldrh r0, [r0]
|
||||
bl SetFlag
|
||||
bl DeleteThisEntity
|
||||
_0809B7BC:
|
||||
pop {r4, pc}
|
||||
.align 2, 0
|
||||
|
||||
thumb_func_start sub_0809B7C0
|
||||
sub_0809B7C0: @ 0x0809B7C0
|
||||
push {r4, lr}
|
||||
adds r4, r0, #0
|
||||
bl GetTileTypeByEntity
|
||||
ldr r1, _0809B7D8 @ =0xFFFFBF9F
|
||||
adds r0, r0, r1
|
||||
cmp r0, #1
|
||||
bls _0809B7D6
|
||||
adds r0, r4, #0
|
||||
bl sub_0809B7DC
|
||||
_0809B7D6:
|
||||
pop {r4, pc}
|
||||
.align 2, 0
|
||||
_0809B7D8: .4byte 0xFFFFBF9F
|
||||
|
||||
thumb_func_start sub_0809B7DC
|
||||
sub_0809B7DC: @ 0x0809B7DC
|
||||
push {r4, r5, r6, lr}
|
||||
adds r6, r0, #0
|
||||
movs r0, #0xc3
|
||||
lsls r0, r0, #2
|
||||
movs r2, #0x2e
|
||||
ldrsh r1, [r6, r2]
|
||||
ldr r5, _0809B838 @ =gRoomControls
|
||||
ldrh r2, [r5, #6]
|
||||
subs r1, r1, r2
|
||||
asrs r1, r1, #4
|
||||
movs r4, #0x3f
|
||||
ands r1, r4
|
||||
movs r3, #0x32
|
||||
ldrsh r2, [r6, r3]
|
||||
ldrh r3, [r5, #8]
|
||||
subs r2, r2, r3
|
||||
asrs r2, r2, #4
|
||||
ands r2, r4
|
||||
lsls r2, r2, #6
|
||||
orrs r1, r2
|
||||
movs r2, #2
|
||||
bl sub_0807B7D8
|
||||
ldr r0, _0809B83C @ =0x00004062
|
||||
movs r2, #0x2e
|
||||
ldrsh r1, [r6, r2]
|
||||
ldrh r2, [r5, #6]
|
||||
subs r1, r1, r2
|
||||
asrs r1, r1, #4
|
||||
ands r1, r4
|
||||
movs r3, #0x32
|
||||
ldrsh r2, [r6, r3]
|
||||
ldrh r3, [r5, #8]
|
||||
subs r2, r2, r3
|
||||
asrs r2, r2, #4
|
||||
ands r2, r4
|
||||
lsls r2, r2, #6
|
||||
orrs r1, r2
|
||||
adds r2, r6, #0
|
||||
adds r2, #0x38
|
||||
ldrb r2, [r2]
|
||||
bl SetTile
|
||||
movs r0, #1
|
||||
strb r0, [r6, #0xe]
|
||||
pop {r4, r5, r6, pc}
|
||||
.align 2, 0
|
||||
_0809B838: .4byte gRoomControls
|
||||
_0809B83C: .4byte 0x00004062
|
|
@ -846,7 +846,7 @@ SECTIONS {
|
|||
asm/object8A.o(.text);
|
||||
asm/object8B.o(.text);
|
||||
src/object/book.o(.text);
|
||||
asm/fireplace.o(.text);
|
||||
src/fireplace.o(.text);
|
||||
asm/object8E.o(.text);
|
||||
asm/frozenWaterElement.o(.text);
|
||||
asm/object90.o(.text);
|
||||
|
|
|
@ -0,0 +1,50 @@
|
|||
#include "entity.h"
|
||||
#include "functions.h"
|
||||
#include "player.h"
|
||||
#include "script.h"
|
||||
#include "flags.h"
|
||||
#include "room.h"
|
||||
|
||||
extern void (*gUnk_08123D98[])(Entity *);
|
||||
|
||||
void sub_0809B7A0(Entity *e);
|
||||
void sub_0809B7DC(Entity *this);
|
||||
void sub_0809B7C0(Entity *this);
|
||||
|
||||
void Fireplace(Entity *e) {
|
||||
gUnk_08123D98[e->action](e);
|
||||
}
|
||||
|
||||
void sub_0809B708(Entity *this) {
|
||||
this->action = 1;
|
||||
this->spriteSettings.draw = 1;
|
||||
this->speed = 0x80;
|
||||
if (CheckFlags(this->field_0x86.HWORD)) {
|
||||
sub_0809B7DC(this);
|
||||
DeleteThisEntity();
|
||||
} else {
|
||||
sub_0807B7D8(0x30b, TILE(this->x.HALF.HI, this->y.HALF.HI), 2);
|
||||
SetTile(0x4061, TILE(this->x.HALF.HI, this->y.HALF.HI), this->collisionLayer);
|
||||
}
|
||||
sub_0809B7A0(this);
|
||||
}
|
||||
|
||||
void sub_0809B7A0(Entity *this) {
|
||||
sub_0809B7C0(this);
|
||||
if (this->actionDelay) {
|
||||
SetFlag(this->field_0x86.HWORD);
|
||||
DeleteThisEntity();
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0809B7C0(Entity *this) {
|
||||
if (GetTileTypeByEntity(this) - 0x4061 > 1) {
|
||||
sub_0809B7DC(this);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0809B7DC(Entity *this) {
|
||||
sub_0807B7D8(0xc3 << 2, TILE(this->x.HALF.HI, this->y.HALF.HI), 2);
|
||||
SetTile(0x4062, TILE(this->x.HALF.HI, this->y.HALF.HI), this->collisionLayer);
|
||||
this->actionDelay = 1;
|
||||
}
|
Loading…
Reference in New Issue