mirror of https://github.com/zeldaret/tmc.git
Decompile angryStatue
This commit is contained in:
parent
62b8e59af1
commit
060aa62e8f
|
@ -1,191 +0,0 @@
|
||||||
.include "asm/macros.inc"
|
|
||||||
|
|
||||||
.include "constants/constants.inc"
|
|
||||||
|
|
||||||
.syntax unified
|
|
||||||
|
|
||||||
.text
|
|
||||||
|
|
||||||
|
|
||||||
thumb_func_start AngryStatue
|
|
||||||
AngryStatue: @ 0x0809F12C
|
|
||||||
push {lr}
|
|
||||||
ldr r2, _0809F140 @ =gUnk_08124670
|
|
||||||
ldrb r1, [r0, #0xc]
|
|
||||||
lsls r1, r1, #2
|
|
||||||
adds r1, r1, r2
|
|
||||||
ldr r1, [r1]
|
|
||||||
bl _call_via_r1
|
|
||||||
pop {pc}
|
|
||||||
.align 2, 0
|
|
||||||
_0809F140: .4byte gUnk_08124670
|
|
||||||
|
|
||||||
thumb_func_start sub_0809F144
|
|
||||||
sub_0809F144: @ 0x0809F144
|
|
||||||
push {r4, r5, r6, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
movs r0, #1
|
|
||||||
strb r0, [r4, #0xc]
|
|
||||||
ldr r0, _0809F188 @ =gUnk_080FD178
|
|
||||||
str r0, [r4, #0x48]
|
|
||||||
ldr r0, _0809F18C @ =0x00004022
|
|
||||||
movs r2, #0x2e
|
|
||||||
ldrsh r1, [r4, r2]
|
|
||||||
ldr r3, _0809F190 @ =gRoomControls
|
|
||||||
ldrh r2, [r3, #6]
|
|
||||||
subs r1, r1, r2
|
|
||||||
asrs r1, r1, #4
|
|
||||||
movs r5, #0x3f
|
|
||||||
ands r1, r5
|
|
||||||
movs r6, #0x32
|
|
||||||
ldrsh r2, [r4, r6]
|
|
||||||
ldrh r3, [r3, #8]
|
|
||||||
subs r2, r2, r3
|
|
||||||
asrs r2, r2, #4
|
|
||||||
ands r2, r5
|
|
||||||
lsls r2, r2, #6
|
|
||||||
orrs r1, r2
|
|
||||||
adds r2, r4, #0
|
|
||||||
adds r2, #0x38
|
|
||||||
ldrb r2, [r2]
|
|
||||||
bl SetTile
|
|
||||||
ldrb r1, [r4, #0xa]
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl InitializeAnimation
|
|
||||||
pop {r4, r5, r6, pc}
|
|
||||||
.align 2, 0
|
|
||||||
_0809F188: .4byte gUnk_080FD178
|
|
||||||
_0809F18C: .4byte 0x00004022
|
|
||||||
_0809F190: .4byte gRoomControls
|
|
||||||
|
|
||||||
thumb_func_start sub_0809F194
|
|
||||||
sub_0809F194: @ 0x0809F194
|
|
||||||
push {lr}
|
|
||||||
adds r2, r0, #0
|
|
||||||
ldr r0, [r2, #0x50]
|
|
||||||
ldrb r0, [r0, #0xf]
|
|
||||||
cmp r0, #1
|
|
||||||
bne _0809F1AE
|
|
||||||
movs r0, #2
|
|
||||||
strb r0, [r2, #0xc]
|
|
||||||
ldrb r1, [r2, #0xa]
|
|
||||||
adds r1, #4
|
|
||||||
adds r0, r2, #0
|
|
||||||
bl InitializeAnimation
|
|
||||||
_0809F1AE:
|
|
||||||
pop {pc}
|
|
||||||
|
|
||||||
thumb_func_start sub_0809F1B0
|
|
||||||
sub_0809F1B0: @ 0x0809F1B0
|
|
||||||
push {r4, r5, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
bl GetNextFrame
|
|
||||||
adds r2, r4, #0
|
|
||||||
adds r2, #0x5a
|
|
||||||
ldrb r1, [r2]
|
|
||||||
movs r3, #1
|
|
||||||
adds r0, r3, #0
|
|
||||||
ands r0, r1
|
|
||||||
cmp r0, #0
|
|
||||||
beq _0809F20C
|
|
||||||
movs r0, #0xfe
|
|
||||||
ands r0, r1
|
|
||||||
strb r0, [r2]
|
|
||||||
movs r0, #0x1b
|
|
||||||
bl CreateProjectile
|
|
||||||
adds r5, r0, #0
|
|
||||||
cmp r5, #0
|
|
||||||
beq _0809F21E
|
|
||||||
ldrb r0, [r4, #0xa]
|
|
||||||
strb r0, [r5, #0xa]
|
|
||||||
ldr r0, [r4, #0x50]
|
|
||||||
str r0, [r5, #0x50]
|
|
||||||
ldrb r0, [r4, #0xa]
|
|
||||||
lsls r0, r0, #1
|
|
||||||
ldr r1, _0809F208 @ =gUnk_08124684
|
|
||||||
adds r0, r0, r1
|
|
||||||
movs r2, #0
|
|
||||||
ldrsb r2, [r0, r2]
|
|
||||||
lsls r2, r2, #0x10
|
|
||||||
movs r3, #1
|
|
||||||
ldrsb r3, [r0, r3]
|
|
||||||
lsls r3, r3, #0x10
|
|
||||||
adds r0, r4, #0
|
|
||||||
adds r1, r5, #0
|
|
||||||
bl PositionRelative
|
|
||||||
movs r0, #0xec
|
|
||||||
bl EnqueueSFX
|
|
||||||
b _0809F21E
|
|
||||||
.align 2, 0
|
|
||||||
_0809F208: .4byte gUnk_08124684
|
|
||||||
_0809F20C:
|
|
||||||
movs r0, #0x80
|
|
||||||
ands r0, r1
|
|
||||||
cmp r0, #0
|
|
||||||
beq _0809F21E
|
|
||||||
strb r3, [r4, #0xc]
|
|
||||||
ldrb r1, [r4, #0xa]
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl InitializeAnimation
|
|
||||||
_0809F21E:
|
|
||||||
pop {r4, r5, pc}
|
|
||||||
|
|
||||||
thumb_func_start sub_0809F220
|
|
||||||
sub_0809F220: @ 0x0809F220
|
|
||||||
push {lr}
|
|
||||||
adds r2, r0, #0
|
|
||||||
ldrb r0, [r2, #0xe]
|
|
||||||
subs r0, #1
|
|
||||||
strb r0, [r2, #0xe]
|
|
||||||
lsls r0, r0, #0x18
|
|
||||||
cmp r0, #0
|
|
||||||
bne _0809F242
|
|
||||||
movs r0, #4
|
|
||||||
strb r0, [r2, #0xc]
|
|
||||||
movs r0, #0xf
|
|
||||||
strb r0, [r2, #0xe]
|
|
||||||
ldrb r1, [r2, #0xa]
|
|
||||||
adds r0, r2, #0
|
|
||||||
bl InitializeAnimation
|
|
||||||
b _0809F252
|
|
||||||
_0809F242:
|
|
||||||
ldr r0, [r2, #0x50]
|
|
||||||
adds r0, #0x36
|
|
||||||
movs r1, #1
|
|
||||||
ldrb r2, [r2, #0xb]
|
|
||||||
lsls r1, r2
|
|
||||||
ldrb r2, [r0]
|
|
||||||
orrs r1, r2
|
|
||||||
strb r1, [r0]
|
|
||||||
_0809F252:
|
|
||||||
pop {pc}
|
|
||||||
|
|
||||||
thumb_func_start sub_0809F254
|
|
||||||
sub_0809F254: @ 0x0809F254
|
|
||||||
push {r4, r5, lr}
|
|
||||||
adds r3, r0, #0
|
|
||||||
ldrb r1, [r3, #0x18]
|
|
||||||
lsls r0, r1, #0x1e
|
|
||||||
lsrs r0, r0, #0x1e
|
|
||||||
movs r5, #1
|
|
||||||
eors r0, r5
|
|
||||||
movs r4, #4
|
|
||||||
rsbs r4, r4, #0
|
|
||||||
adds r2, r4, #0
|
|
||||||
ands r2, r1
|
|
||||||
orrs r2, r0
|
|
||||||
strb r2, [r3, #0x18]
|
|
||||||
ldrb r0, [r3, #0xe]
|
|
||||||
subs r0, #1
|
|
||||||
strb r0, [r3, #0xe]
|
|
||||||
lsls r0, r0, #0x18
|
|
||||||
cmp r0, #0
|
|
||||||
bne _0809F284
|
|
||||||
movs r0, #1
|
|
||||||
strb r5, [r3, #0xc]
|
|
||||||
ands r2, r4
|
|
||||||
orrs r2, r0
|
|
||||||
strb r2, [r3, #0x18]
|
|
||||||
_0809F284:
|
|
||||||
pop {r4, r5, pc}
|
|
||||||
.align 2, 0
|
|
|
@ -45352,11 +45352,6 @@
|
||||||
"size": 16,
|
"size": 16,
|
||||||
"type": "animation"
|
"type": "animation"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"path": "angryStatue/gUnk_08124684.bin",
|
|
||||||
"start": 1197700,
|
|
||||||
"size": 8
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"path": "animation/gSpriteAnimations_ObjectA2_0.bin",
|
"path": "animation/gSpriteAnimations_ObjectA2_0.bin",
|
||||||
"start": 1197842,
|
"start": 1197842,
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
.include "asm/macros.inc"
|
|
||||||
.include "constants/constants.inc"
|
|
||||||
|
|
||||||
.section .rodata
|
|
||||||
.align 2
|
|
||||||
|
|
||||||
gUnk_08124670:: @ 08124670
|
|
||||||
.4byte sub_0809F144
|
|
||||||
.4byte sub_0809F194
|
|
||||||
.4byte sub_0809F1B0
|
|
||||||
.4byte sub_0809F220
|
|
||||||
.4byte sub_0809F254
|
|
||||||
|
|
||||||
gUnk_08124684:: @ 08124684
|
|
||||||
.incbin "angryStatue/gUnk_08124684.bin"
|
|
|
@ -808,7 +808,7 @@ SECTIONS {
|
||||||
src/object/treeThorns.o(.text);
|
src/object/treeThorns.o(.text);
|
||||||
src/object/fan.o(.text);
|
src/object/fan.o(.text);
|
||||||
asm/object/fan.o(.text);
|
asm/object/fan.o(.text);
|
||||||
asm/object/angryStatue.o(.text);
|
src/object/angryStatue.o(.text);
|
||||||
src/object/palaceArchway.o(.text);
|
src/object/palaceArchway.o(.text);
|
||||||
src/object/objectA2.o(.text);
|
src/object/objectA2.o(.text);
|
||||||
src/object/cloud.o(.text);
|
src/object/cloud.o(.text);
|
||||||
|
@ -1561,7 +1561,7 @@ SECTIONS {
|
||||||
data/const/object/lightableSwitch.o(.rodata);
|
data/const/object/lightableSwitch.o(.rodata);
|
||||||
data/const/object/fan.o(.rodata);
|
data/const/object/fan.o(.rodata);
|
||||||
data/animations/object/fan.o(.rodata);
|
data/animations/object/fan.o(.rodata);
|
||||||
data/const/object/angryStatue.o(.rodata);
|
src/object/angryStatue.o(.rodata);
|
||||||
data/animations/object/angryStatue.o(.rodata);
|
data/animations/object/angryStatue.o(.rodata);
|
||||||
data/const/object/palaceArchway.o(.rodata);
|
data/const/object/palaceArchway.o(.rodata);
|
||||||
src/object/objectA2.o(.rodata);
|
src/object/objectA2.o(.rodata);
|
||||||
|
|
|
@ -0,0 +1,80 @@
|
||||||
|
#include "entity.h"
|
||||||
|
#include "asm.h"
|
||||||
|
#include "room.h"
|
||||||
|
#include "sound.h"
|
||||||
|
#include "projectile.h"
|
||||||
|
#include "coord.h"
|
||||||
|
|
||||||
|
extern Hitbox gUnk_080FD178;
|
||||||
|
|
||||||
|
void sub_0809F144(Entity*);
|
||||||
|
void sub_0809F194(Entity*);
|
||||||
|
void sub_0809F1B0(Entity*);
|
||||||
|
void sub_0809F220(Entity*);
|
||||||
|
void sub_0809F254(Entity*);
|
||||||
|
|
||||||
|
void AngryStatue(Entity* this) {
|
||||||
|
static void (*const AngryStatue_Actions[])(Entity*) = {
|
||||||
|
sub_0809F144, sub_0809F194, sub_0809F1B0, sub_0809F220, sub_0809F254,
|
||||||
|
};
|
||||||
|
|
||||||
|
AngryStatue_Actions[this->action](this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_0809F144(Entity* this) {
|
||||||
|
this->action = 1;
|
||||||
|
this->hitbox = &gUnk_080FD178;
|
||||||
|
SetTile(0x4022, COORD_TO_TILE(this), this->collisionLayer);
|
||||||
|
InitializeAnimation(this, this->type);
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_0809F194(Entity* this) {
|
||||||
|
if (this->parent->field_0xf == 1) {
|
||||||
|
this->action = 2;
|
||||||
|
InitializeAnimation(this, this->type + 4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_0809F1B0(Entity* this) {
|
||||||
|
static const s8 gUnk_08124684[] = {
|
||||||
|
0, 12, 12, 2, 0, 12, -12, 2,
|
||||||
|
};
|
||||||
|
|
||||||
|
Entity* pEVar2;
|
||||||
|
const s8* ptr;
|
||||||
|
|
||||||
|
GetNextFrame(this);
|
||||||
|
if (this->frame & 1) {
|
||||||
|
this->frame &= 0xfe;
|
||||||
|
pEVar2 = CreateProjectile(CANNONBALL_PROJECTILE);
|
||||||
|
if (pEVar2 != NULL) {
|
||||||
|
pEVar2->type = this->type;
|
||||||
|
pEVar2->parent = this->parent;
|
||||||
|
ptr = &gUnk_08124684[this->type * 2];
|
||||||
|
PositionRelative(this, pEVar2, ptr[0] << 0x10, ptr[1] << 0x10);
|
||||||
|
EnqueueSFX(SFX_EC);
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if ((this->frame & 0x80) != 0) {
|
||||||
|
this->action = 1;
|
||||||
|
InitializeAnimation(this, this->type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_0809F220(Entity* this) {
|
||||||
|
if (--this->actionDelay == 0) {
|
||||||
|
this->action = 4;
|
||||||
|
this->actionDelay = 15;
|
||||||
|
InitializeAnimation(this, this->type);
|
||||||
|
} else {
|
||||||
|
this->parent->z.BYTES.byte2 |= 1 << this->type2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_0809F254(Entity* this) {
|
||||||
|
this->spriteSettings.draw ^= 1;
|
||||||
|
if (--this->actionDelay == 0) {
|
||||||
|
this->action = 1;
|
||||||
|
this->spriteSettings.draw = 1;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue