mirror of https://github.com/zeldaret/tmc.git
mazaal head
This commit is contained in:
parent
1ea5469a6b
commit
3b7a042138
1853
asm/mazaalHead.s
1853
asm/mazaalHead.s
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,66 @@
|
|||
|
||||
.syntax unified
|
||||
push {r4, r5, lr}
|
||||
adds r3, r0, #0
|
||||
adds r0, #0x7d
|
||||
ldrb r1, [r0]
|
||||
movs r0, #0x10
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
beq _08034764
|
||||
ldr r0, [r3, #0x74]
|
||||
ldrb r0, [r0, #0xc]
|
||||
cmp r0, #0x28
|
||||
bhi _080347B0
|
||||
ldr r0, _08034760 @ =gPlayerEntity
|
||||
movs r1, #0x2e
|
||||
ldrsh r0, [r0, r1]
|
||||
adds r2, r0, #0
|
||||
subs r2, #0x60
|
||||
b _08034776
|
||||
.align 2, 0
|
||||
_08034760: .4byte gPlayerEntity
|
||||
_08034764:
|
||||
ldr r0, [r3, #0x78]
|
||||
ldrb r0, [r0, #0xc]
|
||||
cmp r0, #0x28
|
||||
bhi _080347B0
|
||||
ldr r0, _08034790 @ =gPlayerEntity
|
||||
movs r5, #0x2e
|
||||
ldrsh r0, [r0, r5]
|
||||
adds r2, r0, #0
|
||||
adds r2, #0x60
|
||||
_08034776:
|
||||
ldr r0, _08034794 @ =gRoomControls
|
||||
ldrh r4, [r0, #6]
|
||||
subs r0, r2, #4
|
||||
movs r5, #0x2e
|
||||
ldrsh r1, [r3, r5]
|
||||
cmp r0, r1
|
||||
bls _08034798
|
||||
adds r0, r4, #0
|
||||
adds r0, #0xe0
|
||||
cmp r0, r1
|
||||
blo _080347B0
|
||||
movs r0, #8
|
||||
b _080347A8
|
||||
.align 2, 0
|
||||
_08034790: .4byte gPlayerEntity
|
||||
_08034794: .4byte gRoomControls
|
||||
_08034798:
|
||||
adds r0, r2, #4
|
||||
cmp r0, r1
|
||||
bhs _080347B0
|
||||
adds r0, r4, #0
|
||||
adds r0, #0x90
|
||||
cmp r0, r1
|
||||
bhi _080347B0
|
||||
movs r0, #0x18
|
||||
_080347A8:
|
||||
strb r0, [r3, #0x15]
|
||||
adds r0, r3, #0
|
||||
bl sub_0806F69C
|
||||
_080347B0:
|
||||
pop {r4, r5, pc}
|
||||
.align 2, 0
|
||||
.syntax divided
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
|
||||
.syntax unified
|
||||
push {r4, r5, lr}
|
||||
adds r2, r0, #0
|
||||
ldr r0, _080347D8 @ =gPlayerEntity
|
||||
movs r1, #0x2e
|
||||
ldrsh r3, [r0, r1]
|
||||
ldr r0, _080347DC @ =gRoomControls
|
||||
ldrh r4, [r0, #6]
|
||||
subs r0, r3, #4
|
||||
movs r5, #0x2e
|
||||
ldrsh r1, [r2, r5]
|
||||
cmp r0, r1
|
||||
bls _080347E0
|
||||
adds r0, r4, #0
|
||||
adds r0, #0xe0
|
||||
cmp r0, r1
|
||||
blo _080347F8
|
||||
movs r0, #8
|
||||
b _080347F0
|
||||
.align 2, 0
|
||||
_080347D8: .4byte gPlayerEntity
|
||||
_080347DC: .4byte gRoomControls
|
||||
_080347E0:
|
||||
adds r0, r3, #4
|
||||
cmp r0, r1
|
||||
bhs _080347F8
|
||||
adds r0, r4, #0
|
||||
adds r0, #0x90
|
||||
cmp r0, r1
|
||||
bhi _080347F8
|
||||
movs r0, #0x18
|
||||
_080347F0:
|
||||
strb r0, [r2, #0x15]
|
||||
adds r0, r2, #0
|
||||
bl sub_0806F69C
|
||||
_080347F8:
|
||||
pop {r4, r5, pc}
|
||||
.align 2, 0
|
||||
.syntax divided
|
||||
|
|
@ -0,0 +1,130 @@
|
|||
.syntax unified
|
||||
push {r4, r5, lr}
|
||||
adds r4, r0, #0
|
||||
adds r3, r1, #0
|
||||
adds r5, r2, #0
|
||||
ldrb r0, [r3, #0xa]
|
||||
cmp r0, #0
|
||||
bne _080348C6
|
||||
movs r2, #5
|
||||
movs r0, #0x7d
|
||||
adds r0, r0, r4
|
||||
mov ip, r0
|
||||
ldrb r1, [r0]
|
||||
movs r0, #0x10
|
||||
orrs r0, r1
|
||||
mov r1, ip
|
||||
strb r0, [r1]
|
||||
b _080348C8
|
||||
_080348C6:
|
||||
movs r2, #0xa
|
||||
_080348C8:
|
||||
adds r0, r4, #0
|
||||
adds r0, #0x80
|
||||
ldrb r0, [r0]
|
||||
ands r0, r2
|
||||
cmp r0, #0
|
||||
beq _080348F0
|
||||
adds r0, r4, #0
|
||||
adds r0, #0x7d
|
||||
ldrb r2, [r0]
|
||||
ldrb r1, [r3, #0xa]
|
||||
adds r3, r0, #0
|
||||
cmp r1, #0
|
||||
bne _080348E6
|
||||
movs r0, #1
|
||||
b _080348E8
|
||||
_080348E6:
|
||||
movs r0, #2
|
||||
_080348E8:
|
||||
orrs r0, r2
|
||||
strb r0, [r3]
|
||||
movs r0, #0
|
||||
b _08034998
|
||||
_080348F0:
|
||||
cmp r5, #8
|
||||
bhi _08034996
|
||||
lsls r0, r5, #2
|
||||
ldr r1, _08034900 @ =_08034904
|
||||
adds r0, r0, r1
|
||||
ldr r0, [r0]
|
||||
mov pc, r0
|
||||
.align 2, 0
|
||||
_08034900: .4byte _08034904
|
||||
_08034904: @ jump table
|
||||
.4byte _08034928 @ case 0
|
||||
.4byte _0803492E @ case 1
|
||||
.4byte _0803493C @ case 2
|
||||
.4byte _0803494A @ case 3
|
||||
.4byte _0803493C @ case 4
|
||||
.4byte _08034958 @ case 5
|
||||
.4byte _08034966 @ case 6
|
||||
.4byte _0803496C @ case 7
|
||||
.4byte _08034982 @ case 8
|
||||
_08034928:
|
||||
movs r0, #3
|
||||
strb r0, [r3, #0xc]
|
||||
b _08034996
|
||||
_0803492E:
|
||||
movs r0, #4
|
||||
strb r0, [r3, #0xc]
|
||||
adds r1, r3, #0
|
||||
adds r1, #0x7c
|
||||
movs r0, #3
|
||||
strb r0, [r1]
|
||||
b _08034996
|
||||
_0803493C:
|
||||
movs r0, #4
|
||||
strb r0, [r3, #0xc]
|
||||
adds r1, r3, #0
|
||||
adds r1, #0x7c
|
||||
movs r0, #1
|
||||
strb r0, [r1]
|
||||
b _08034996
|
||||
_0803494A:
|
||||
movs r0, #0xf
|
||||
strb r0, [r3, #0xc]
|
||||
adds r1, r3, #0
|
||||
adds r1, #0x7e
|
||||
movs r0, #0xb4
|
||||
strh r0, [r1]
|
||||
b _08034996
|
||||
_08034958:
|
||||
movs r0, #0xf
|
||||
strb r0, [r3, #0xc]
|
||||
adds r1, r3, #0
|
||||
adds r1, #0x7e
|
||||
movs r0, #1
|
||||
strh r0, [r1]
|
||||
b _08034996
|
||||
_08034966:
|
||||
movs r0, #0x1e
|
||||
strb r0, [r3, #0xc]
|
||||
b _08034996
|
||||
_0803496C:
|
||||
movs r0, #0x1b
|
||||
strb r0, [r3, #0xc]
|
||||
ldrb r1, [r3, #0x10]
|
||||
movs r0, #0x7f
|
||||
ands r0, r1
|
||||
strb r0, [r3, #0x10]
|
||||
adds r0, r3, #0
|
||||
movs r1, #5
|
||||
bl InitializeAnimation
|
||||
b _08034996
|
||||
_08034982:
|
||||
ldrb r0, [r3, #0xa]
|
||||
adds r2, r0, #2
|
||||
movs r0, #0x36
|
||||
adds r1, r2, #0
|
||||
bl CreateEnemy
|
||||
adds r3, r0, #0
|
||||
cmp r3, #0
|
||||
beq _08034996
|
||||
str r4, [r3, #0x50]
|
||||
_08034996:
|
||||
movs r0, #1
|
||||
_08034998:
|
||||
pop {r4, r5, pc}
|
||||
.align 2, 0
|
||||
.syntax divided
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
|
||||
.syntax unified
|
||||
push {r4, lr}
|
||||
adds r1, r0, #0
|
||||
adds r3, r1, #0
|
||||
adds r3, #0x7d
|
||||
ldrb r2, [r3]
|
||||
movs r0, #0x60
|
||||
ands r0, r2
|
||||
cmp r0, #0x40
|
||||
beq _08034A52
|
||||
movs r0, #0x10
|
||||
ands r0, r2
|
||||
cmp r0, #0
|
||||
beq _08034A56
|
||||
adds r4, r1, #0
|
||||
adds r4, #0x80
|
||||
ldrb r1, [r4]
|
||||
movs r0, #5
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
beq _08034A3E
|
||||
movs r0, #0x40
|
||||
orrs r0, r2
|
||||
strb r0, [r3]
|
||||
_08034A3E:
|
||||
ldrb r1, [r4]
|
||||
movs r0, #0xa
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
beq _08034A7E
|
||||
ldrb r1, [r3]
|
||||
movs r0, #3
|
||||
ands r0, r1
|
||||
cmp r0, #1
|
||||
bne _08034A7E
|
||||
_08034A52:
|
||||
movs r0, #1
|
||||
b _08034A80
|
||||
_08034A56:
|
||||
adds r4, r1, #0
|
||||
adds r4, #0x80
|
||||
ldrb r1, [r4]
|
||||
movs r0, #0xa
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
beq _08034A6A
|
||||
movs r0, #0x40
|
||||
orrs r0, r2
|
||||
strb r0, [r3]
|
||||
_08034A6A:
|
||||
ldrb r1, [r4]
|
||||
movs r0, #5
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
beq _08034A7E
|
||||
ldrb r1, [r3]
|
||||
movs r0, #3
|
||||
ands r0, r1
|
||||
cmp r0, #2
|
||||
beq _08034A52
|
||||
_08034A7E:
|
||||
movs r0, #0
|
||||
_08034A80:
|
||||
pop {r4, pc}
|
||||
.align 2, 0
|
||||
.syntax divided
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
|
||||
.syntax unified
|
||||
push {r4, r5, lr}
|
||||
adds r4, r0, #0
|
||||
ldrb r0, [r4, #0xe]
|
||||
subs r0, #1
|
||||
strb r0, [r4, #0xe]
|
||||
lsls r0, r0, #0x18
|
||||
cmp r0, #0
|
||||
bne _08034B58
|
||||
movs r0, #3
|
||||
strb r0, [r4, #0xc]
|
||||
ldrb r1, [r4, #0xa]
|
||||
adds r1, #3
|
||||
adds r0, r4, #0
|
||||
bl InitializeAnimation
|
||||
b _08034B9A
|
||||
_08034B58:
|
||||
movs r0, #0xe
|
||||
bl sub_080A7EE0
|
||||
adds r5, r0, #0
|
||||
cmp r5, #0
|
||||
beq _08034B9A
|
||||
ldrb r0, [r4, #0xa]
|
||||
subs r0, #2
|
||||
strb r0, [r5, #0xa]
|
||||
lsls r0, r0, #0x18
|
||||
cmp r0, #0
|
||||
bne _08034B78
|
||||
ldrb r1, [r4, #0xe]
|
||||
movs r0, #0xa8
|
||||
subs r0, r0, r1
|
||||
b _08034B7C
|
||||
_08034B78:
|
||||
ldrb r0, [r4, #0xe]
|
||||
adds r0, #0x58
|
||||
_08034B7C:
|
||||
strb r0, [r5, #0x15]
|
||||
ldrb r0, [r5, #0xa]
|
||||
lsls r0, r0, #1
|
||||
ldr r1, _08034B9C @ =gUnk_080CED84
|
||||
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
|
||||
_08034B9A:
|
||||
pop {r4, r5, pc}
|
||||
.align 2, 0
|
||||
_08034B9C: .4byte gUnk_080CED84
|
||||
.syntax divided
|
||||
|
|
@ -1,96 +0,0 @@
|
|||
.include "asm/macros.inc"
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.section .rodata
|
||||
.align 2
|
||||
|
||||
gUnk_080CEC88:: @ 080CEC88
|
||||
.4byte sub_08033EF0
|
||||
.4byte sub_08033F08
|
||||
.4byte sub_08001324
|
||||
.4byte sub_0804A7D4
|
||||
.4byte sub_08001242
|
||||
.4byte nullsub_160
|
||||
|
||||
gUnk_080CECA0:: @ 080CECA0
|
||||
.4byte sub_08033F1C
|
||||
.4byte sub_08034A84
|
||||
.4byte sub_08034AC4
|
||||
.4byte sub_08034AC4
|
||||
.4byte sub_08034BC8
|
||||
|
||||
gUnk_080CECB4:: @ 080CECB4
|
||||
.4byte sub_08033F3C
|
||||
.4byte sub_08033FFC
|
||||
.4byte sub_0803414C
|
||||
.4byte sub_080341B8
|
||||
.4byte sub_080341D0
|
||||
.4byte sub_080341F4
|
||||
.4byte sub_08034210
|
||||
.4byte sub_08034240
|
||||
.4byte sub_08034274
|
||||
.4byte sub_080342A0
|
||||
.4byte sub_080342B4
|
||||
.4byte sub_080342C8
|
||||
.4byte sub_08034348
|
||||
.4byte sub_0803438C
|
||||
|
||||
gUnk_080CECEC:: @ 080CECEC
|
||||
.incbin "baserom.gba", 0x0CECEC, 0x0000008
|
||||
|
||||
gUnk_080CECF4:: @ 080CECF4
|
||||
.incbin "baserom.gba", 0x0CECF4, 0x000000E
|
||||
|
||||
gUnk_080CED02:: @ 080CED02
|
||||
.incbin "baserom.gba", 0x0CED02, 0x0000004
|
||||
|
||||
gUnk_080CED06:: @ 080CED06
|
||||
.incbin "baserom.gba", 0x0CED06, 0x0000006
|
||||
|
||||
gUnk_080CED0C:: @ 080CED0C
|
||||
.4byte sub_08034578
|
||||
.4byte sub_080344E0
|
||||
.4byte sub_0803451C
|
||||
.4byte sub_080344E0
|
||||
.4byte sub_08034558
|
||||
.4byte sub_080344E0
|
||||
.4byte sub_0803451C
|
||||
.4byte sub_080346A0
|
||||
|
||||
gUnk_080CED2C:: @ 080CED2C
|
||||
.4byte sub_08034578
|
||||
.4byte sub_080345D0
|
||||
.4byte sub_0803451C
|
||||
.4byte sub_080346A0
|
||||
.4byte sub_08034558
|
||||
.4byte sub_080345D0
|
||||
.4byte sub_08034558
|
||||
.4byte sub_080346A0
|
||||
|
||||
gUnk_080CED4C:: @ 080CED4C
|
||||
.4byte sub_08034578
|
||||
.4byte sub_080345D0
|
||||
.4byte sub_080346C8
|
||||
.4byte sub_080346A0
|
||||
.4byte sub_08034558
|
||||
.4byte sub_080346C8
|
||||
.4byte sub_080346A0
|
||||
.4byte sub_080346C8
|
||||
|
||||
gUnk_080CED6C:: @ 080CED6C
|
||||
.incbin "baserom.gba", 0x0CED6C, 0x0000008
|
||||
|
||||
gUnk_080CED74:: @ 080CED74
|
||||
.4byte sub_08034AEC
|
||||
.4byte sub_08034B0C
|
||||
.4byte sub_08034B38
|
||||
.4byte sub_08034BA0
|
||||
|
||||
gUnk_080CED84:: @ 080CED84
|
||||
.incbin "baserom.gba", 0x0CED84, 0x0000004
|
||||
|
||||
gUnk_080CED88:: @ 080CED88
|
||||
.incbin "baserom.gba", 0x0CED88, 0x0000014
|
||||
|
||||
gUnk_080CED9C:: @ 080CED9C
|
||||
.incbin "baserom.gba", 0x0CED9C, 0x0000014
|
||||
|
|
@ -396,7 +396,7 @@ SECTIONS {
|
|||
asm/bombarossa.o(.text);
|
||||
src/enemy/wisp.o(.text);
|
||||
asm/spinyBeetle.o(.text);
|
||||
asm/mazaalHead.o(.text);
|
||||
src/enemy/mazaalHead.o(.text);
|
||||
asm/mazaalMacro.o(.text);
|
||||
src/enemy/mazaalHand.o(.text);
|
||||
asm/octorokBoss.o(.text);
|
||||
|
|
@ -1093,7 +1093,7 @@ SECTIONS {
|
|||
data/animations/enemy/wisp.o(.rodata);
|
||||
data/const/enemy/spinyBeetle.o(.rodata);
|
||||
data/animations/enemy/spinyBeetle.o(.rodata);
|
||||
data/const/enemy/mazaalHead.o(.rodata);
|
||||
src/enemy/mazaalHead.o(.rodata);
|
||||
data/animations/enemy/mazaalHead.o(.rodata);
|
||||
data/const/enemy/mazaalMacro.o(.rodata);
|
||||
data/animations/enemy/mazaalMacro.o(.rodata);
|
||||
|
|
|
|||
|
|
@ -118,10 +118,10 @@ const s8 gUnk_080CFD1D[] = { -0x11, 0x11 };
|
|||
|
||||
void (*const gUnk_080CFD20[])(Entity*) = { sub_0803B910, sub_0803B978, sub_0803BA6C, sub_0803BA80 };
|
||||
|
||||
const s16 gUnk_080CFD30[] = { 0xdb, 0xdd, 0xdf, 0xe1, 0xdf, 0xdd, 0xdb, 0xe3, 0xe5, 0xe3 };
|
||||
const s16 gUnk_080CFD44[] = { 0xdc, 0xde, 0xe0, 0xe2, 0xe0, 0xde, 0xdc, 0xe4, 0xe6, 0xe4 };
|
||||
const s16 gUnk_080CFD58[] = { 0xe5, 0xe6 };
|
||||
const s16 gUnk_080CFD5C[] = { 0xe7, 0xe8 };
|
||||
const u16 gUnk_080CFD30[] = { 0xdb, 0xdd, 0xdf, 0xe1, 0xdf, 0xdd, 0xdb, 0xe3, 0xe5, 0xe3 };
|
||||
const u16 gUnk_080CFD44[] = { 0xdc, 0xde, 0xe0, 0xe2, 0xe0, 0xde, 0xdc, 0xe4, 0xe6, 0xe4 };
|
||||
const u16 gUnk_080CFD58[] = { 0xe5, 0xe6 };
|
||||
const u16 gUnk_080CFD5C[] = { 0xe7, 0xe8 };
|
||||
|
||||
extern s8 gUnk_080CED6C[8];
|
||||
|
||||
|
|
@ -1361,10 +1361,12 @@ void sub_0803BA80(Entity* this) {
|
|||
sub_0803BA8C(this, 10);
|
||||
}
|
||||
|
||||
NONMATCH("asm/non_matching/mazaal/sub_0803BA8C.inc", void sub_0803BA8C(Entity* this, u32 unk)) {
|
||||
void sub_0803BA8C(Entity* this, u32 unk) {
|
||||
u32 sVar2;
|
||||
u32 tmp;
|
||||
|
||||
sVar2 = 0;
|
||||
tmp = this->field_0x74.HALF.LO & 0xe0;
|
||||
if ((this->field_0x74.HALF.LO & 0xe0) == 0) {
|
||||
if (this->field_0x74.HALF.LO == 0) {
|
||||
if (9 < ++this->field_0x74.HALF.HI) {
|
||||
|
|
@ -1381,9 +1383,9 @@ NONMATCH("asm/non_matching/mazaal/sub_0803BA8C.inc", void sub_0803BA8C(Entity* t
|
|||
this->field_0x74.HALF.LO = 0;
|
||||
}
|
||||
} else {
|
||||
if ((this->field_0x74.HALF.LO & 0x80) == 0) {
|
||||
if ((tmp & 0x80) == 0) {
|
||||
this->field_0x74.HALF.LO |= 0x80;
|
||||
if ((this->field_0x74.HALF.LO & 0x20) != 0) {
|
||||
if ((tmp & 0x20) != 0) {
|
||||
sVar2 = gUnk_080CFD58[this->type - 2];
|
||||
} else {
|
||||
sVar2 = gUnk_080CFD5C[this->type - 2];
|
||||
|
|
@ -1392,10 +1394,9 @@ NONMATCH("asm/non_matching/mazaal/sub_0803BA8C.inc", void sub_0803BA8C(Entity* t
|
|||
}
|
||||
if (sVar2 != 0) {
|
||||
sub_0801D2B4(this, sVar2);
|
||||
(*(Entity**)&this->parent->field_0x78)->palette.b.b0 = this->palette.b.b0;
|
||||
(*(Entity**)&this->parent->field_0x78)->palette.b.b0 = this->palette.raw << 0x1c >> 0x1c;
|
||||
(*(Entity**)&this->parent->field_0x78)->palette.b.b4 = this->palette.b.b0;
|
||||
this->parent->attachedEntity->palette.b.b0 = this->palette.b.b0;
|
||||
this->parent->attachedEntity->palette.b.b0 = this->palette.raw << 0x1c >> 0x1c;
|
||||
this->parent->attachedEntity->palette.b.b4 = this->palette.b.b0;
|
||||
}
|
||||
}
|
||||
END_NONMATCH
|
||||
|
|
|
|||
|
|
@ -1 +1,828 @@
|
|||
#include "global.h"
|
||||
#include "global.h"
|
||||
#include "entity.h"
|
||||
#include "enemy.h"
|
||||
#include "screen.h"
|
||||
#include "audio.h"
|
||||
#include "random.h"
|
||||
#include "functions.h"
|
||||
|
||||
extern void UnloadOBJPalette(Entity*);
|
||||
extern void DoExitTransition(ScreenTransitionData*);
|
||||
|
||||
extern u8 gEntCount;
|
||||
|
||||
extern void sub_0803499C(Entity*);
|
||||
extern void sub_08034420(Entity*);
|
||||
extern void sub_08034830(Entity*);
|
||||
extern u32 sub_080349D8(Entity*);
|
||||
extern void sub_0803442C(Entity*, u32);
|
||||
extern void sub_0803443C(Entity*);
|
||||
extern void sub_080347B4(Entity*);
|
||||
extern void sub_0803473C(Entity*);
|
||||
extern u32 sub_08034A10(Entity*);
|
||||
extern void sub_080347FC(Entity*);
|
||||
extern void sub_080344BC(Entity*);
|
||||
extern void sub_08034498(Entity*);
|
||||
extern void sub_08034474(Entity*);
|
||||
extern void sub_080345A0(Entity*);
|
||||
extern void sub_080345B8(Entity*);
|
||||
extern void sub_08034638(Entity*);
|
||||
extern void sub_08034618(Entity*);
|
||||
extern void sub_08034658(Entity*);
|
||||
extern void sub_0803467C(Entity*);
|
||||
extern u32 sub_080348A4(Entity*, Entity*, u32);
|
||||
extern void sub_08034C00(Entity*);
|
||||
|
||||
void sub_08033EF0(Entity* this);
|
||||
void sub_08033F08(Entity* this);
|
||||
void nullsub_160(Entity* this);
|
||||
void sub_08033F1C(Entity* this);
|
||||
void sub_08034A84(Entity* this);
|
||||
void sub_08034AC4(Entity* this);
|
||||
void sub_08034BC8(Entity* this);
|
||||
void sub_08033F3C(Entity* this);
|
||||
void sub_08033FFC(Entity* this);
|
||||
void sub_0803414C(Entity* this);
|
||||
void sub_080341B8(Entity* this);
|
||||
void sub_080341D0(Entity* this);
|
||||
void sub_080341F4(Entity* this);
|
||||
void sub_08034210(Entity* this);
|
||||
void sub_08034240(Entity* this);
|
||||
void sub_08034274(Entity* this);
|
||||
void sub_080342A0(Entity* this);
|
||||
void sub_080342B4(Entity* this);
|
||||
void sub_080342C8(Entity* this);
|
||||
void sub_08034348(Entity* this);
|
||||
void sub_0803438C(Entity* this);
|
||||
void sub_08034578(Entity* this);
|
||||
void sub_080344E0(Entity* this);
|
||||
void sub_0803451C(Entity* this);
|
||||
void sub_08034558(Entity* this);
|
||||
void sub_080346A0(Entity* this);
|
||||
void sub_080345D0(Entity* this);
|
||||
void sub_080346C8(Entity* this);
|
||||
void sub_08034AEC(Entity* this);
|
||||
void sub_08034B0C(Entity* this);
|
||||
void sub_08034B38(Entity* this);
|
||||
void sub_08034BA0(Entity* this);
|
||||
|
||||
void (*const gUnk_080CEC88[])(Entity*) = {
|
||||
sub_08033EF0, sub_08033F08, sub_08001324, sub_0804A7D4, sub_08001242, nullsub_160,
|
||||
};
|
||||
void (*const gUnk_080CECA0[])(Entity*) = {
|
||||
sub_08033F1C, sub_08034A84, sub_08034AC4, sub_08034AC4, sub_08034BC8,
|
||||
};
|
||||
void (*const gUnk_080CECB4[])(Entity*) = {
|
||||
sub_08033F3C, sub_08033FFC, sub_0803414C, sub_080341B8, sub_080341D0, sub_080341F4, sub_08034210,
|
||||
sub_08034240, sub_08034274, sub_080342A0, sub_080342B4, sub_080342C8, sub_08034348, sub_0803438C,
|
||||
};
|
||||
const u8 gUnk_080CECEC[] = { 0xff, 0xfe, 0xff, 0x00, 0x01, 0x02, 0x01, 0x00 };
|
||||
const s8 gUnk_080CECF4[] = { -2, 0x01, -8, -4, -0x14, 0x08, 0x0e, -0x10, -6, 0x0c, 0x12, -2, 0x00, 0x00 };
|
||||
const u8 gUnk_080CED02[] = { 0x46, 0x46, 0x47, 0x48 };
|
||||
const u8 gUnk_080CED06[] = { 0xff, 0x00, 0x01, 0x00, 0x00, 0x00 };
|
||||
void (*const gUnk_080CED0C[])(Entity*) = {
|
||||
sub_08034578, sub_080344E0, sub_0803451C, sub_080344E0, sub_08034558, sub_080344E0, sub_0803451C, sub_080346A0,
|
||||
};
|
||||
void (*const gUnk_080CED2C[])(Entity*) = {
|
||||
sub_08034578, sub_080345D0, sub_0803451C, sub_080346A0, sub_08034558, sub_080345D0, sub_08034558, sub_080346A0,
|
||||
};
|
||||
void (*const gUnk_080CED4C[])(Entity*) = {
|
||||
sub_08034578, sub_080345D0, sub_080346C8, sub_080346A0, sub_08034558, sub_080346C8, sub_080346A0, sub_080346C8,
|
||||
};
|
||||
const s8 gUnk_080CED6C[] = { -0xa, -0xb, -0xc, -0xb, -0xa, -0x9, -0x8, -0x9 };
|
||||
void (*const gUnk_080CED74[])(Entity*) = {
|
||||
sub_08034AEC,
|
||||
sub_08034B0C,
|
||||
sub_08034B38,
|
||||
sub_08034BA0,
|
||||
};
|
||||
const s8 gUnk_080CED84[] = { 0x0d, 0x10, -0xd, 0x10 };
|
||||
const ScreenTransitionData gUnk_080CED88 = { 1, { 0, 0, 0, 0 }, 0x88, 0xf8, 0, 0x5a, 1, 1, 0, 0, 0 };
|
||||
const ScreenTransitionData gUnk_080CED9C = { 1, { 0, 0, 0, 0 }, 0x88, 0xf8, 0, 0x5a, 0, 1, 0, 0, 0 };
|
||||
|
||||
void MazaalHead(Entity* this) {
|
||||
gUnk_080CEC88[GetNextFunction(this)](this);
|
||||
}
|
||||
|
||||
void sub_08033EF0(Entity* this) {
|
||||
gUnk_080CECA0[this->type](this);
|
||||
}
|
||||
|
||||
void sub_08033F08(Entity* this) {
|
||||
sub_0804AA30(this, gUnk_080CEC88);
|
||||
}
|
||||
|
||||
void nullsub_160(Entity* this) {
|
||||
}
|
||||
|
||||
void sub_08033F1C(Entity* this) {
|
||||
gUnk_080CECB4[this->action](this);
|
||||
sub_0803499C(this);
|
||||
}
|
||||
|
||||
void sub_08033F3C(Entity* this) {
|
||||
Entity* pEVar1;
|
||||
Entity* pEVar2;
|
||||
u8* pbVar3;
|
||||
|
||||
if (gEntCount < 0x43) {
|
||||
if (gScreenTransition.field_0x38 != 0) {
|
||||
sub_08034420(this);
|
||||
this->field_0x80.HALF.HI = 1;
|
||||
} else {
|
||||
this->action = 1;
|
||||
}
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->field_0x6c.HALF.HI |= 1;
|
||||
this->field_0x80.HALF.LO = 0;
|
||||
InitializeAnimation(this, 0);
|
||||
pEVar1 = CreateEnemy(0x36, 1);
|
||||
pEVar1->parent = this;
|
||||
pEVar2 = CreateObject(0x7e, 0, 0);
|
||||
pEVar2->parent = this;
|
||||
if (gScreenTransition.field_0x39 == 0) {
|
||||
this->action = 0xd;
|
||||
this->subAction = 0;
|
||||
this->actionDelay = 0xfc;
|
||||
this->flags = this->flags & 0x7f;
|
||||
} else {
|
||||
pEVar2 = CreateEnemy(0x44, 0);
|
||||
pEVar2->parent = this;
|
||||
*(Entity**)&pEVar2->field_0x78 = this;
|
||||
*(Entity**)&this->field_0x74 = pEVar2;
|
||||
pEVar2 = CreateEnemy(0x44, 1);
|
||||
pEVar2->parent = this;
|
||||
*(Entity**)&pEVar2->field_0x78 = pEVar1;
|
||||
*(Entity**)&this->field_0x78 = pEVar2;
|
||||
CreateEnemy(0x36, 4)->parent = this;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08033FFC(Entity* this) {
|
||||
u16 temp;
|
||||
Entity* entity;
|
||||
|
||||
switch (this->subAction) {
|
||||
case 0:
|
||||
case 2:
|
||||
case 5:
|
||||
break;
|
||||
case 1:
|
||||
this->subAction = 2;
|
||||
this->actionDelay = 0x1e;
|
||||
entity = *(Entity**)&(*(Entity**)&this->field_0x74)->field_0x74;
|
||||
entity->subAction = 1;
|
||||
entity = *(Entity**)&(*(Entity**)&this->field_0x78)->field_0x74;
|
||||
entity->subAction = 1;
|
||||
UnloadOBJPalette(this);
|
||||
break;
|
||||
case 3:
|
||||
if (--this->actionDelay == 0) {
|
||||
this->subAction = 4;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
this->height.WORD += -0x8000;
|
||||
if (this->height.HALF.HI == -10) {
|
||||
this->subAction = 5;
|
||||
this->field_0x80.HALF.HI = 1;
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
this->subAction = 7;
|
||||
this->actionDelay = 0;
|
||||
entity = *(Entity**)&this->field_0x74;
|
||||
entity->subAction = 1;
|
||||
entity = *(Entity**)&entity->field_0x74;
|
||||
entity->subAction = 4;
|
||||
entity = *(Entity**)&this->field_0x78;
|
||||
entity->subAction = 1;
|
||||
entity = *(Entity**)&entity->field_0x74;
|
||||
entity->subAction = 4;
|
||||
gScreen.controls.layerFXControl = 0xf40;
|
||||
gScreen.controls.alphaBlend = 0x1000;
|
||||
break;
|
||||
case 7:
|
||||
temp = ++this->actionDelay >> 1;
|
||||
gScreen.controls.alphaBlend = (temp) | (0x10 - (temp)) * 0x100;
|
||||
if (0x1f < (this->actionDelay & 0xff)) {
|
||||
this->subAction = 8;
|
||||
entity = *(Entity**)&this->field_0x74;
|
||||
entity->subAction = 3;
|
||||
entity = *(Entity**)&entity->field_0x74;
|
||||
entity->subAction = 6;
|
||||
entity = *(Entity**)&this->field_0x78;
|
||||
entity->subAction = 3;
|
||||
entity = *(Entity**)&entity->field_0x74;
|
||||
entity->subAction = 6;
|
||||
this->spriteRendering.alphaBlend = 0;
|
||||
gScreen.controls.layerFXControl = 0;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (((*(Entity**)&this->field_0x74)->flags & 0x80) != 0) {
|
||||
gRoomControls.cameraTarget = &gPlayerEntity;
|
||||
sub_08034420(this);
|
||||
gPlayerState.field_0x8b = 1;
|
||||
sub_080791D0();
|
||||
SoundReq(BGM_BOSS_THEME);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0803414C(Entity* this) {
|
||||
u32 x, y;
|
||||
|
||||
x = gRoomControls.roomOriginX + 0xb8;
|
||||
y = gRoomControls.roomOriginY + 0x48;
|
||||
|
||||
if (this->x.HALF.HI - x + 1 < 3 && this->y.HALF.HI - y + 1 < 3) {
|
||||
if (sub_080349D8(this)) {
|
||||
if (this->subAction != 0) {
|
||||
this->subAction = 0;
|
||||
sub_0803442C(this, 0x1e);
|
||||
} else {
|
||||
sub_0803442C(this, 0x5a);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this->direction = sub_080045D4(this->x.HALF.HI, this->y.HALF.HI, x, y);
|
||||
sub_0806F69C(this);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080341B8(Entity* this) {
|
||||
if (sub_080349D8(this) != 0) {
|
||||
sub_0803442C(this, 0x2d);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080341D0(Entity* this) {
|
||||
if (((this->field_0x80.HALF.LO & 3) != 3) && (--this->actionDelay == 0)) {
|
||||
sub_0803443C(this);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080341F4(Entity* this) {
|
||||
sub_080347B4(this);
|
||||
if (sub_080349D8(this) != 0) {
|
||||
sub_08034420(this);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08034210(Entity* this) {
|
||||
sub_080347B4(this);
|
||||
if ((this->field_0x7c.BYTES.byte1 & 0x80) != 0 && sub_080349D8(this) != 0) {
|
||||
sub_08034420(this);
|
||||
} else {
|
||||
sub_08034830(this);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08034240(Entity* this) {
|
||||
if ((this->field_0x7c.HALF_U.HI != 0) && (--this->field_0x7c.HALF_U.HI < 0x96)) {
|
||||
sub_0803473C(this);
|
||||
}
|
||||
if (sub_080349D8(this) != 0) {
|
||||
sub_08034420(this);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08034274(Entity* this) {
|
||||
if (sub_080349D8(this) != 0) {
|
||||
sub_08034420(this);
|
||||
} else {
|
||||
sub_0803473C(this);
|
||||
if (sub_08034A10(this) != 0) {
|
||||
sub_080347FC(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080342A0(Entity* this) {
|
||||
if (sub_080349D8(this) != 0) {
|
||||
sub_08034420(this);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080342B4(Entity* this) {
|
||||
if (this->field_0x7c.HALF_U.HI == 0xff) {
|
||||
sub_08034420(this);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080342C8(Entity* this) {
|
||||
if (this->actionDelay != 0) {
|
||||
if (--this->actionDelay == 0) {
|
||||
SoundReq(SFX_115);
|
||||
}
|
||||
this->spriteOffsetX = gUnk_080CECEC[this->actionDelay >> 1 & 7];
|
||||
} else {
|
||||
this->spriteOffsetX = 0;
|
||||
if (sub_08003FC4(this, 0x2000) == 0) {
|
||||
this->action = 0xc;
|
||||
this->field_0x7c.HALF.HI = 0x708;
|
||||
this->field_0x7c.BYTES.byte1 = 0;
|
||||
this->field_0x80.HALF.HI = 0;
|
||||
sub_08080964(0x1e, 0);
|
||||
SoundReq(SFX_1A1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08034348(Entity* this) {
|
||||
if (this->field_0x7c.HALF_U.HI != 0) {
|
||||
this->field_0x7c.HALF.HI--;
|
||||
} else {
|
||||
if (this->height.HALF.HI > -10) {
|
||||
this->height.HALF.HI--;
|
||||
} else {
|
||||
if (sub_080349D8(this) != 0) {
|
||||
this->field_0x80.HALF.HI = 1;
|
||||
sub_08034420(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0803438C(Entity* this) {
|
||||
Entity* pEVar3;
|
||||
const s8* pVar;
|
||||
|
||||
if (this->actionDelay == 0) {
|
||||
this->currentHealth = 0;
|
||||
} else {
|
||||
this->actionDelay--;
|
||||
if (this->actionDelay > 0xc0) {
|
||||
this->spriteOffsetX = gUnk_080CED06[this->actionDelay & 3];
|
||||
} else {
|
||||
if ((this->actionDelay & 0x1f) == 0) {
|
||||
pEVar3 = CreateFx(this, gUnk_080CED02[Random() & 3], 0);
|
||||
if (pEVar3 != NULL) {
|
||||
pVar = &gUnk_080CECF4[this->actionDelay >> 4];
|
||||
pEVar3->x.HALF.HI = *pVar + pEVar3->x.HALF.HI;
|
||||
pVar++;
|
||||
pEVar3->y.HALF.HI = *pVar + pEVar3->y.HALF.HI;
|
||||
pEVar3->spritePriority.b0 = 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08034420(Entity* this) {
|
||||
this->action = 2;
|
||||
this->field_0x7c.BYTES.byte1 = 3;
|
||||
}
|
||||
|
||||
void sub_0803442C(Entity* this, u32 unk) {
|
||||
this->action = 4;
|
||||
this->actionDelay = (u8)unk;
|
||||
this->field_0x7c.BYTES.byte1 = 3;
|
||||
}
|
||||
|
||||
void sub_0803443C(Entity* this) {
|
||||
this->field_0x7c.BYTES.byte1 = 0;
|
||||
if (gScreenTransition.field_0x39 < 0x1f) {
|
||||
sub_080344BC(this);
|
||||
} else {
|
||||
if (gScreenTransition.field_0x39 < 0x3d) {
|
||||
sub_08034498(this);
|
||||
} else {
|
||||
sub_08034474(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08034474(Entity* this) {
|
||||
gUnk_080CED0C[this->field_0x7c.BYTES.byte0](this);
|
||||
this->field_0x7c.BYTES.byte0 = (this->field_0x7c.BYTES.byte0 + 1) & 7;
|
||||
}
|
||||
|
||||
void sub_08034498(Entity* this) {
|
||||
gUnk_080CED2C[this->field_0x7c.BYTES.byte0](this);
|
||||
this->field_0x7c.BYTES.byte0 = (this->field_0x7c.BYTES.byte0 + 1) & 7;
|
||||
}
|
||||
|
||||
void sub_080344BC(Entity* this) {
|
||||
gUnk_080CED4C[this->field_0x7c.BYTES.byte0](this);
|
||||
this->field_0x7c.BYTES.byte0 = (this->field_0x7c.BYTES.byte0 + 1) & 7;
|
||||
}
|
||||
|
||||
void sub_080344E0(Entity* this) {
|
||||
if ((this->field_0x80.HALF.LO & 5) != 0) {
|
||||
sub_080345A0(this);
|
||||
} else {
|
||||
if ((this->field_0x80.HALF.LO & 10) != 0 || (Random() & 1) != 0) {
|
||||
sub_080345B8(this);
|
||||
} else {
|
||||
sub_080345A0(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0803451C(Entity* this) {
|
||||
if ((this->field_0x80.HALF.LO & 5) != 0) {
|
||||
sub_08034618(this);
|
||||
} else if ((this->field_0x80.HALF.LO & 10) != 0) {
|
||||
sub_08034638(this);
|
||||
} else if ((Random() & 1) != 0) {
|
||||
sub_08034618(this);
|
||||
} else {
|
||||
sub_08034638(this);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08034558(Entity* this) {
|
||||
if ((Random() & 1) != 0) {
|
||||
sub_08034658(this);
|
||||
} else {
|
||||
sub_0803467C(this);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08034578(Entity* this) {
|
||||
this->action = 3;
|
||||
this->field_0x7c.BYTES.byte1 = 0;
|
||||
sub_080348A4(this, *(Entity**)&this->field_0x74, 0);
|
||||
sub_080348A4(this, *(Entity**)&this->field_0x78, 0);
|
||||
}
|
||||
|
||||
void sub_080345A0(Entity* this) {
|
||||
this->action = 5;
|
||||
this->field_0x7c.BYTES.byte1 = 1;
|
||||
sub_080348A4(this, *(Entity**)&this->field_0x78, 1);
|
||||
}
|
||||
|
||||
void sub_080345B8(Entity* this) {
|
||||
this->action = 5;
|
||||
this->field_0x7c.BYTES.byte1 = 2;
|
||||
sub_080348A4(this, *(Entity**)&this->field_0x74, 1);
|
||||
}
|
||||
|
||||
void sub_080345D0(Entity* this) {
|
||||
this->action = 6;
|
||||
if ((Random() & 1) != 0) {
|
||||
if (sub_080348A4(this, *(Entity**)&this->field_0x74, 2) == 0) {
|
||||
sub_080348A4(this, *(Entity**)&this->field_0x78, 2);
|
||||
}
|
||||
} else {
|
||||
if (sub_080348A4(this, *(Entity**)&this->field_0x78, 2) == 0) {
|
||||
sub_080348A4(this, *(Entity**)&this->field_0x74, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08034618(Entity* this) {
|
||||
this->action = 7;
|
||||
this->field_0x7c.BYTES.byte1 = 1;
|
||||
this->field_0x7c.HALF.HI = 0xb4;
|
||||
sub_080348A4(this, *(Entity**)&this->field_0x78, 3);
|
||||
}
|
||||
|
||||
void sub_08034638(Entity* this) {
|
||||
this->action = 7;
|
||||
this->field_0x7c.BYTES.byte1 = 2;
|
||||
this->field_0x7c.HALF.HI = 0xb4;
|
||||
sub_080348A4(this, *(Entity**)&this->field_0x74, 3);
|
||||
}
|
||||
|
||||
void sub_08034658(Entity* this) {
|
||||
this->action = 8;
|
||||
this->field_0x7c.BYTES.byte1 = 0;
|
||||
if (sub_080348A4(this, *(Entity**)&this->field_0x78, 4) == 0) {
|
||||
this->field_0x7c.BYTES.byte1 |= 0x40;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0803467C(Entity* this) {
|
||||
this->action = 8;
|
||||
this->field_0x7c.BYTES.byte1 = 0;
|
||||
if (sub_080348A4(this, *(Entity**)&this->field_0x74, 4) == 0) {
|
||||
this->field_0x7c.BYTES.byte1 |= 0x40;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080346A0(Entity* this) {
|
||||
this->action = 9;
|
||||
this->field_0x7c.BYTES.byte1 = 0;
|
||||
sub_080348A4(this, *(Entity**)&this->field_0x74, 6);
|
||||
sub_080348A4(this, *(Entity**)&this->field_0x78, 6);
|
||||
}
|
||||
|
||||
void sub_080346C8(Entity* this) {
|
||||
Entity* hand;
|
||||
|
||||
this->action = 10;
|
||||
this->field_0x7c.HALF.HI = 0;
|
||||
if ((Random() & 1) != 0) {
|
||||
if (sub_080348A4(this, *(Entity**)&this->field_0x74, 8) != 0) {
|
||||
hand = *(Entity**)&this->field_0x78;
|
||||
sub_080348A4(this, hand, 7);
|
||||
} else {
|
||||
sub_080348A4(this, *(Entity**)&this->field_0x74, 7);
|
||||
sub_080348A4(this, *(Entity**)&this->field_0x78, 8);
|
||||
}
|
||||
} else {
|
||||
if (sub_080348A4(this, *(Entity**)&this->field_0x78, 8) != 0) {
|
||||
hand = *(Entity**)&this->field_0x74;
|
||||
sub_080348A4(this, hand, 7);
|
||||
} else {
|
||||
sub_080348A4(this, *(Entity**)&this->field_0x74, 8);
|
||||
sub_080348A4(this, *(Entity**)&this->field_0x78, 7);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NONMATCH("asm/non_matching/mazaal/sub_0803473C.inc", void sub_0803473C(Entity* this)) {
|
||||
u32 direction;
|
||||
u32 playerX;
|
||||
u32 roomX;
|
||||
|
||||
if ((this->field_0x7c.BYTES.byte1 & 0x10) != 0) {
|
||||
if (0x28 < (*(Entity**)&this->field_0x74)->action) {
|
||||
return;
|
||||
}
|
||||
playerX = gPlayerEntity.x.HALF.HI - 0x60;
|
||||
} else {
|
||||
if (0x28 < (*(Entity**)&this->field_0x78)->action) {
|
||||
return;
|
||||
}
|
||||
playerX = gPlayerEntity.x.HALF.HI + 0x60;
|
||||
}
|
||||
roomX = gRoomControls.roomOriginX;
|
||||
if (playerX - 4 > this->x.HALF.HI) {
|
||||
if (roomX + 0xe0 < this->x.HALF.HI) {
|
||||
return;
|
||||
}
|
||||
direction = 8;
|
||||
} else {
|
||||
if (playerX + 4 >= this->x.HALF.HI) {
|
||||
return;
|
||||
}
|
||||
if (roomX + 0x90 > this->x.HALF.HI) {
|
||||
return;
|
||||
}
|
||||
direction = 0x18;
|
||||
}
|
||||
this->direction = direction;
|
||||
sub_0806F69C(this);
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
NONMATCH("asm/non_matching/mazaal/sub_080347B4.inc", void sub_080347B4(Entity* this)) {
|
||||
u32 direction;
|
||||
u32 playerX = gPlayerEntity.x.HALF.HI;
|
||||
u32 roomX = gRoomControls.roomOriginX;
|
||||
if (playerX - 4 > this->x.HALF.HI) {
|
||||
if (roomX + 0xe0 < this->x.HALF.HI) {
|
||||
return;
|
||||
}
|
||||
direction = 8;
|
||||
} else {
|
||||
if (playerX + 4 >= this->x.HALF.HI) {
|
||||
return;
|
||||
}
|
||||
if (roomX + 0x90 > this->x.HALF.HI) {
|
||||
return;
|
||||
}
|
||||
direction = 0x18;
|
||||
}
|
||||
this->direction = direction;
|
||||
sub_0806F69C(this);
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
void sub_080347FC(Entity* this) {
|
||||
if ((this->field_0x7c.BYTES.byte1 & 0x10) != 0) {
|
||||
sub_080348A4(this, *(Entity**)&this->field_0x78, 5);
|
||||
} else {
|
||||
sub_080348A4(this, *(Entity**)&this->field_0x74, 5);
|
||||
}
|
||||
this->field_0x7c.BYTES.byte1 |= 0x20;
|
||||
}
|
||||
|
||||
void sub_08034830(Entity* this) {
|
||||
if (sub_080349D8(this) != 0) {
|
||||
this->field_0x7c.BYTES.byte1 = 0x80;
|
||||
sub_080345D0(this);
|
||||
} else {
|
||||
if (sub_08034A10(this) != 0) {
|
||||
if ((this->field_0x80.HALF.LO & 0xf) != 0) {
|
||||
if (sub_080349D8(this) != 0) {
|
||||
sub_08034420(this);
|
||||
}
|
||||
} else {
|
||||
this->field_0x7c.BYTES.byte1 |= 0x20;
|
||||
if ((this->field_0x7c.BYTES.byte1 & 0x10) != 0) {
|
||||
sub_080348A4(this, *(Entity**)&this->field_0x78, 2);
|
||||
} else {
|
||||
sub_080348A4(this, *(Entity**)&this->field_0x74, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NONMATCH("asm/non_matching/mazaal/sub_080348A4.inc", u32 sub_080348A4(Entity* this, Entity* hand_, u32 unk)) {
|
||||
u8 bVar1;
|
||||
Entity* pEVar4;
|
||||
u32 temp;
|
||||
|
||||
if (hand_->type == 0) {
|
||||
bVar1 = 5;
|
||||
this->field_0x7c.BYTES.byte1 |= 0x10;
|
||||
} else {
|
||||
bVar1 = 10;
|
||||
}
|
||||
|
||||
if (this->field_0x80.HALF.LO & bVar1) {
|
||||
this->field_0x7c.BYTES.byte1 |= (hand_->type == 0) ? 1 : 2;
|
||||
return 0;
|
||||
} else {
|
||||
switch (unk) {
|
||||
case 0:
|
||||
hand_->action = 3;
|
||||
break;
|
||||
case 1:
|
||||
hand_->action = 4;
|
||||
hand_->field_0x7c.BYTES.byte0 = 3;
|
||||
break;
|
||||
case 2:
|
||||
case 4:
|
||||
hand_->action = 4;
|
||||
hand_->field_0x7c.BYTES.byte0 = 1;
|
||||
break;
|
||||
case 3:
|
||||
hand_->action = 0xf;
|
||||
hand_->field_0x7c.HALF.HI = 0xb4;
|
||||
break;
|
||||
case 5:
|
||||
hand_->action = 0xf;
|
||||
hand_->field_0x7c.HALF.HI = 1;
|
||||
break;
|
||||
case 6:
|
||||
hand_->action = 0x1e;
|
||||
break;
|
||||
case 7:
|
||||
hand_->action = 0x1b;
|
||||
hand_->flags = hand_->flags & 0x7f;
|
||||
InitializeAnimation(hand_, 5);
|
||||
break;
|
||||
case 8:
|
||||
pEVar4 = CreateEnemy(0x36, hand_->type + 2);
|
||||
if (pEVar4 != NULL) {
|
||||
pEVar4->parent = this;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
void sub_0803499C(Entity* this) {
|
||||
if (((this->field_0x80.HALF.LO & 0xc) != 0xc) && (this->field_0x80.HALF.HI != 0)) {
|
||||
this->height.HALF.HI = gUnk_080CED6C[(++this->field_0xf >> 4) & 7];
|
||||
}
|
||||
}
|
||||
|
||||
u32 sub_080349D8(Entity* this) {
|
||||
// this feels like a switch, but I couldn't get it to match as one
|
||||
if ((this->field_0x7c.BYTES.byte1 & 3) == 3) {
|
||||
return 1;
|
||||
} else {
|
||||
if ((this->field_0x7c.BYTES.byte1 & 3) == 1) {
|
||||
if (this->field_0x80.HALF.LO & 10)
|
||||
return 1;
|
||||
} else {
|
||||
if ((this->field_0x7c.BYTES.byte1 & 3) == 2) {
|
||||
if (this->field_0x80.HALF.LO & 5)
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
NONMATCH("asm/non_matching/mazaal/sub_08034A10.inc", u32 sub_08034A10(Entity* this)) {
|
||||
if ((this->field_0x7c.BYTES.byte1 & 0x60) != 0x40) {
|
||||
if ((this->field_0x7c.BYTES.byte1 & 0x10) != 0) {
|
||||
if ((this->field_0x80.HALF.LO & 5) != 0) {
|
||||
this->field_0x7c.BYTES.byte1 |= 0x40;
|
||||
}
|
||||
if (((this->field_0x80.HALF.LO & 10) == 0) || ((this->field_0x7c.BYTES.byte1 & 3) != 1)) {
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
if ((this->field_0x80.HALF.LO & 10) != 0) {
|
||||
this->field_0x7c.BYTES.byte1 |= 0x40;
|
||||
}
|
||||
if ((this->field_0x80.HALF.LO & 5) == 0) {
|
||||
return 0;
|
||||
}
|
||||
if ((this->field_0x7c.BYTES.byte1 & 3) != 2) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
void sub_08034A84(Entity* this) {
|
||||
if (this->parent->next == NULL) {
|
||||
DeleteEntity(this);
|
||||
} else {
|
||||
if (this->action == 0) {
|
||||
this->action = 1;
|
||||
this->spriteSettings.b.draw = 1;
|
||||
this->spriteSettings.b.flipX = 1;
|
||||
InitializeAnimation(this, 0);
|
||||
}
|
||||
CopyPositionAndSpriteOffset(this->parent, this);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08034AC4(Entity* this) {
|
||||
PositionRelative(this->parent, this, 0, 0x10000);
|
||||
gUnk_080CED74[this->action](this);
|
||||
}
|
||||
|
||||
void sub_08034AEC(Entity* this) {
|
||||
this->action = 1;
|
||||
this->actionDelay = 0x1e;
|
||||
InitializeAnimation(this, this->type + 1);
|
||||
SoundReq(SFX_151);
|
||||
}
|
||||
|
||||
void sub_08034B0C(Entity* this) {
|
||||
if (this->actionDelay != 0) {
|
||||
this->actionDelay--;
|
||||
} else {
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) == 0) {
|
||||
return;
|
||||
}
|
||||
this->action = 2;
|
||||
this->actionDelay = 0x50;
|
||||
}
|
||||
}
|
||||
|
||||
NONMATCH("asm/non_matching/mazaal/sub_08034B38.inc", void sub_08034B38(Entity* this)) {
|
||||
Entity* target;
|
||||
const s8* ptr;
|
||||
|
||||
if (--this->actionDelay == 0) {
|
||||
this->action = 3;
|
||||
InitializeAnimation(this, this->type + 3);
|
||||
} else {
|
||||
target = sub_080A7EE0(0xe);
|
||||
if (target != NULL) {
|
||||
target->type -= 2;
|
||||
if (target->type == 0) {
|
||||
target->direction = 0xa8 - this->actionDelay;
|
||||
} else {
|
||||
target->direction = this->actionDelay + 0x58;
|
||||
}
|
||||
ptr = &gUnk_080CED84[target->type * 2];
|
||||
PositionRelative(this, target, *(ptr++) << 0x10, *ptr << 0x10);
|
||||
}
|
||||
}
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
void sub_08034BA0(Entity* this) {
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
this->parent->field_0x7c.HALF.HI = 0xff;
|
||||
DeleteEntity(this);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08034BC8(Entity* this) {
|
||||
if (this->action == 0) {
|
||||
this->action = 1;
|
||||
InitializeAnimation(this, 1);
|
||||
}
|
||||
sub_0806FA90(this->parent, this, 0, 1);
|
||||
sub_0800445C(this);
|
||||
if (this->height.HALF.HI == 0) {
|
||||
sub_08034C00(this);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08034C00(Entity* this) {
|
||||
if (((gPlayerState.flags.all & 0x80) != 0) &&
|
||||
CheckPlayerInRegion(this->x.HALF.HI - gRoomControls.roomOriginX,
|
||||
this->y.HALF.HI - gRoomControls.roomOriginY + 0xd, 3, 3) != 0) {
|
||||
if (gScreenTransition.field_0x39 >= 0x3d) {
|
||||
DoExitTransition((ScreenTransitionData*)&gUnk_080CED88);
|
||||
} else {
|
||||
DoExitTransition((ScreenTransitionData*)&gUnk_080CED9C);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue