mirror of https://github.com/zeldaret/tmc.git
commit
399fc6b98f
1041
asm/gibdo.s
1041
asm/gibdo.s
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,95 @@
|
|||
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
push {r4, lr}
|
||||
adds r4, r0, #0
|
||||
adds r0, #0x41
|
||||
ldrb r2, [r0]
|
||||
cmp r2, #0x87
|
||||
bne _080374D4
|
||||
ldrb r0, [r4, #0xc]
|
||||
cmp r0, #6
|
||||
bne _080374BC
|
||||
adds r0, r4, #0
|
||||
bl sub_08037ACC
|
||||
_080374BC:
|
||||
movs r0, #8
|
||||
strb r0, [r4, #0xc]
|
||||
movs r0, #0x3c
|
||||
strb r0, [r4, #0xe]
|
||||
ldrb r1, [r4, #0x10]
|
||||
movs r0, #0x7f
|
||||
ands r0, r1
|
||||
strb r0, [r4, #0x10]
|
||||
adds r0, r4, #0
|
||||
bl sub_08037B48
|
||||
b _08037534
|
||||
_080374D4:
|
||||
ldrb r0, [r4, #0xc]
|
||||
adds r1, r0, #0
|
||||
cmp r1, #6
|
||||
beq _0803752E
|
||||
adds r0, r4, #0
|
||||
adds r0, #0x3f
|
||||
ldrb r0, [r0]
|
||||
cmp r0, #0x27
|
||||
bne _080374F2
|
||||
cmp r2, #0x80
|
||||
bne _080374F2
|
||||
adds r0, r4, #0
|
||||
bl sub_08037A14
|
||||
b _08037534
|
||||
_080374F2:
|
||||
subs r0, r1, #1
|
||||
lsls r0, r0, #0x18
|
||||
lsrs r0, r0, #0x18
|
||||
cmp r0, #1
|
||||
bhi _08037534
|
||||
movs r0, #1
|
||||
strb r0, [r4, #0xc]
|
||||
adds r0, r4, #0
|
||||
adds r0, #0x3e
|
||||
ldrb r0, [r0]
|
||||
movs r1, #0x10
|
||||
eors r0, r1
|
||||
adds r0, #4
|
||||
movs r1, #0x18
|
||||
ands r0, r1
|
||||
strb r0, [r4, #0x15]
|
||||
lsrs r0, r0, #3
|
||||
strb r0, [r4, #0x14]
|
||||
ldrb r1, [r4, #0x14]
|
||||
adds r0, r4, #0
|
||||
bl InitAnimationForceUpdate
|
||||
adds r0, r4, #0
|
||||
bl sub_08037810
|
||||
cmp r0, #0
|
||||
beq _08037534
|
||||
movs r0, #4
|
||||
strb r0, [r4, #0xe]
|
||||
b _08037534
|
||||
_0803752E:
|
||||
adds r0, r4, #0
|
||||
bl sub_08037A58
|
||||
_08037534:
|
||||
adds r0, r4, #0
|
||||
adds r0, #0x43
|
||||
ldrb r0, [r0]
|
||||
cmp r0, #0
|
||||
beq _08037546
|
||||
adds r0, r4, #0
|
||||
movs r1, #0x1c
|
||||
bl sub_0804A9FC
|
||||
_08037546:
|
||||
ldr r1, _08037550 @ =gGibdo
|
||||
adds r0, r4, #0
|
||||
bl sub_0804AA30
|
||||
pop {r4, pc}
|
||||
.align 2, 0
|
||||
_08037550: .4byte gGibdo
|
||||
|
||||
|
||||
.syntax divided
|
|
@ -0,0 +1,57 @@
|
|||
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
push {r4, lr}
|
||||
adds r4, r0, #0
|
||||
bl sub_080379EC
|
||||
cmp r0, #0
|
||||
bne _0803773A
|
||||
bl ResetPlayer
|
||||
ldr r2, _08037724 @ =gPlayerState
|
||||
ldrb r1, [r2, #0x1a]
|
||||
movs r0, #0x80
|
||||
orrs r1, r0
|
||||
strb r1, [r2, #0x1a]
|
||||
ldrb r1, [r2, #0xa]
|
||||
orrs r0, r1
|
||||
strb r0, [r2, #0xa]
|
||||
ldr r0, _08037728 @ =gPlayerEntity
|
||||
adds r1, r4, #0
|
||||
bl CopyPositionAndSpriteOffset
|
||||
adds r0, r4, #0
|
||||
bl UpdateAnimationSingleFrame
|
||||
adds r2, r4, #0
|
||||
adds r2, #0x5a
|
||||
ldrb r1, [r2]
|
||||
movs r0, #1
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
beq _0803773A
|
||||
adds r1, r4, #0
|
||||
adds r1, #0x7c
|
||||
ldrb r0, [r1]
|
||||
subs r0, #1
|
||||
strb r0, [r1]
|
||||
lsls r0, r0, #0x18
|
||||
cmp r0, #0
|
||||
bne _0803772C
|
||||
adds r0, r4, #0
|
||||
bl sub_08037A58
|
||||
b _0803773A
|
||||
.align 2, 0
|
||||
_08037724: .4byte gPlayerState
|
||||
_08037728: .4byte gPlayerEntity
|
||||
_0803772C:
|
||||
ldrb r0, [r2]
|
||||
movs r1, #1
|
||||
eors r0, r1
|
||||
strb r0, [r2]
|
||||
adds r0, r4, #0
|
||||
bl sub_08037B10
|
||||
_0803773A:
|
||||
pop {r4, pc}
|
||||
|
||||
.syntax divided
|
|
@ -0,0 +1,86 @@
|
|||
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
push {r4, r5, r6, lr}
|
||||
adds r5, r0, #0
|
||||
adds r1, r5, #0
|
||||
adds r1, #0x76
|
||||
ldrb r0, [r1]
|
||||
cmp r0, #0
|
||||
bne _080378A8
|
||||
adds r0, r5, #0
|
||||
movs r1, #1
|
||||
bl sub_08049FDC
|
||||
cmp r0, #0
|
||||
beq _080378AC
|
||||
ldr r6, _080378A4 @ =gUnk_020000B0
|
||||
ldr r0, [r6]
|
||||
movs r2, #0x2e
|
||||
ldrsh r1, [r0, r2]
|
||||
movs r3, #0x32
|
||||
ldrsh r2, [r0, r3]
|
||||
adds r0, r5, #0
|
||||
movs r3, #0x40
|
||||
bl sub_0806FCB8
|
||||
cmp r0, #0
|
||||
beq _080378AC
|
||||
ldr r1, [r6]
|
||||
adds r0, r5, #0
|
||||
bl GetFacingDirection
|
||||
ldrb r1, [r5, #0x15]
|
||||
subs r0, r0, r1
|
||||
adds r0, #6
|
||||
movs r1, #0x1f
|
||||
ands r0, r1
|
||||
cmp r0, #0xc
|
||||
bhi _080378AC
|
||||
movs r0, #3
|
||||
strb r0, [r5, #0xc]
|
||||
movs r4, #0x18
|
||||
movs r0, #0x18
|
||||
strb r0, [r5, #0xe]
|
||||
movs r0, #8
|
||||
strb r0, [r5, #0xf]
|
||||
movs r0, #0xc0
|
||||
strh r0, [r5, #0x24]
|
||||
ldr r1, [r6]
|
||||
adds r0, r5, #0
|
||||
bl GetFacingDirection
|
||||
adds r0, #4
|
||||
ands r0, r4
|
||||
strb r0, [r5, #0x15]
|
||||
lsrs r0, r0, #3
|
||||
strb r0, [r5, #0x14]
|
||||
adds r1, r5, #0
|
||||
adds r1, #0x74
|
||||
movs r0, #0x96
|
||||
lsls r0, r0, #1
|
||||
strh r0, [r1]
|
||||
ldr r2, [r6]
|
||||
ldrh r1, [r2, #0x2e]
|
||||
adds r0, r5, #0
|
||||
adds r0, #0x78
|
||||
strh r1, [r0]
|
||||
ldrh r0, [r2, #0x32]
|
||||
adds r3, r5, #0
|
||||
adds r3, #0x7a
|
||||
strh r0, [r3]
|
||||
ldrb r1, [r5, #0x14]
|
||||
adds r0, r5, #0
|
||||
bl InitAnimationForceUpdate
|
||||
movs r0, #1
|
||||
b _080378AE
|
||||
.align 2, 0
|
||||
_080378A4: .4byte gUnk_020000B0
|
||||
_080378A8:
|
||||
subs r0, #1
|
||||
strb r0, [r1]
|
||||
_080378AC:
|
||||
movs r0, #0
|
||||
_080378AE:
|
||||
pop {r4, r5, r6, pc}
|
||||
|
||||
.syntax divided
|
|
@ -0,0 +1,39 @@
|
|||
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
push {r4, r5, lr}
|
||||
adds r5, r0, #0
|
||||
movs r4, #0x18
|
||||
movs r0, #0x18
|
||||
strb r0, [r5, #0xe]
|
||||
movs r0, #8
|
||||
strb r0, [r5, #0xf]
|
||||
movs r1, #0x2e
|
||||
ldrsh r0, [r5, r1]
|
||||
movs r2, #0x32
|
||||
ldrsh r1, [r5, r2]
|
||||
adds r2, r5, #0
|
||||
adds r2, #0x78
|
||||
ldrh r2, [r2]
|
||||
adds r3, r5, #0
|
||||
adds r3, #0x7a
|
||||
ldrh r3, [r3]
|
||||
bl sub_080045D4
|
||||
adds r0, #4
|
||||
ands r0, r4
|
||||
strb r0, [r5, #0x15]
|
||||
lsrs r0, r0, #3
|
||||
ldrb r1, [r5, #0x14]
|
||||
cmp r0, r1
|
||||
beq _080379BA
|
||||
strb r0, [r5, #0x14]
|
||||
adds r1, r0, #4
|
||||
adds r0, r5, #0
|
||||
bl InitAnimationForceUpdate
|
||||
_080379BA:
|
||||
pop {r4, r5, pc}
|
||||
|
||||
.syntax divided
|
|
@ -0,0 +1,64 @@
|
|||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
push {r4, lr}
|
||||
adds r4, r0, #0
|
||||
bl sub_08037ACC
|
||||
movs r0, #7
|
||||
strb r0, [r4, #0xc]
|
||||
adds r2, r4, #0
|
||||
adds r2, #0x29
|
||||
ldrb r1, [r2]
|
||||
subs r0, #0xf
|
||||
ands r0, r1
|
||||
movs r1, #4
|
||||
orrs r0, r1
|
||||
strb r0, [r2]
|
||||
adds r3, r4, #0
|
||||
adds r3, #0x3d
|
||||
movs r0, #0
|
||||
ldrsb r0, [r3, r0]
|
||||
cmp r0, #0
|
||||
bne _08037A84
|
||||
movs r0, #0xec
|
||||
strb r0, [r3]
|
||||
_08037A84:
|
||||
adds r1, r4, #0
|
||||
adds r1, #0x3f
|
||||
movs r0, #0x26
|
||||
strb r0, [r1]
|
||||
adds r2, r4, #0
|
||||
adds r2, #0x3b
|
||||
ldrb r0, [r2]
|
||||
movs r1, #1
|
||||
orrs r0, r1
|
||||
strb r0, [r2]
|
||||
movs r0, #0xf4
|
||||
strb r0, [r3]
|
||||
ldrb r0, [r4, #0x14]
|
||||
lsls r0, r0, #3
|
||||
movs r1, #0x10
|
||||
eors r0, r1
|
||||
adds r1, r4, #0
|
||||
adds r1, #0x3e
|
||||
strb r0, [r1]
|
||||
adds r1, #4
|
||||
movs r0, #8
|
||||
strb r0, [r1]
|
||||
adds r1, #4
|
||||
movs r0, #0xc0
|
||||
lsls r0, r0, #1
|
||||
strh r0, [r1]
|
||||
adds r1, #0x30
|
||||
movs r0, #0x3c
|
||||
strb r0, [r1]
|
||||
ldrb r1, [r4, #0x14]
|
||||
adds r1, #0x10
|
||||
adds r0, r4, #0
|
||||
bl InitAnimationForceUpdate
|
||||
pop {r4, pc}
|
||||
.align 2, 0
|
||||
|
||||
.syntax divided
|
|
@ -0,0 +1,106 @@
|
|||
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
push {r4, lr}
|
||||
adds r4, r0, #0
|
||||
movs r0, #0x2a
|
||||
movs r1, #3
|
||||
movs r2, #0
|
||||
bl CreateObject
|
||||
adds r3, r0, #0
|
||||
cmp r3, #0
|
||||
beq _08037B88
|
||||
ldrb r0, [r4, #0xe]
|
||||
movs r2, #0
|
||||
strb r0, [r3, #0xb]
|
||||
movs r0, #0x29
|
||||
adds r0, r0, r3
|
||||
mov ip, r0
|
||||
ldrb r1, [r0]
|
||||
movs r0, #8
|
||||
rsbs r0, r0, #0
|
||||
ands r0, r1
|
||||
movs r1, #3
|
||||
orrs r0, r1
|
||||
mov r1, ip
|
||||
strb r0, [r1]
|
||||
adds r0, r3, #0
|
||||
adds r0, #0x62
|
||||
strb r2, [r0]
|
||||
adds r1, r3, #0
|
||||
adds r1, #0x63
|
||||
movs r0, #0xfc
|
||||
strb r0, [r1]
|
||||
str r4, [r3, #0x50]
|
||||
_08037B88:
|
||||
adds r0, r4, #0
|
||||
adds r0, #0x80
|
||||
str r3, [r0]
|
||||
movs r0, #0x2a
|
||||
movs r1, #3
|
||||
movs r2, #0
|
||||
bl CreateObject
|
||||
adds r3, r0, #0
|
||||
cmp r3, #0
|
||||
beq _08037BCA
|
||||
ldrb r0, [r4, #0xe]
|
||||
strb r0, [r3, #0xb]
|
||||
movs r0, #0x29
|
||||
adds r0, r0, r3
|
||||
mov ip, r0
|
||||
ldrb r1, [r0]
|
||||
movs r2, #8
|
||||
rsbs r2, r2, #0
|
||||
adds r0, r2, #0
|
||||
ands r0, r1
|
||||
movs r1, #3
|
||||
orrs r0, r1
|
||||
mov r1, ip
|
||||
strb r0, [r1]
|
||||
adds r1, r3, #0
|
||||
adds r1, #0x62
|
||||
movs r0, #0xfd
|
||||
strb r0, [r1]
|
||||
adds r0, r3, #0
|
||||
adds r0, #0x63
|
||||
strb r2, [r0]
|
||||
str r4, [r3, #0x50]
|
||||
_08037BCA:
|
||||
adds r0, r4, #0
|
||||
adds r0, #0x84
|
||||
str r3, [r0]
|
||||
movs r0, #0x2a
|
||||
movs r1, #3
|
||||
movs r2, #0
|
||||
bl CreateObject
|
||||
adds r3, r0, #0
|
||||
cmp r3, #0
|
||||
beq _08037C06
|
||||
ldrb r0, [r4, #0xe]
|
||||
strb r0, [r3, #0xb]
|
||||
adds r2, r3, #0
|
||||
adds r2, #0x29
|
||||
ldrb r1, [r2]
|
||||
movs r0, #8
|
||||
rsbs r0, r0, #0
|
||||
ands r0, r1
|
||||
movs r1, #3
|
||||
orrs r0, r1
|
||||
strb r0, [r2]
|
||||
adds r1, r3, #0
|
||||
adds r1, #0x62
|
||||
movs r0, #5
|
||||
strb r0, [r1]
|
||||
adds r1, #1
|
||||
movs r0, #0xf5
|
||||
strb r0, [r1]
|
||||
str r4, [r3, #0x50]
|
||||
_08037C06:
|
||||
str r3, [r4, #0x54]
|
||||
pop {r4, pc}
|
||||
.align 2, 0
|
||||
|
||||
.syntax divided
|
|
@ -0,0 +1,36 @@
|
|||
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
|
||||
push {lr}
|
||||
adds r3, r0, #0
|
||||
adds r0, #0x80
|
||||
ldr r2, [r0]
|
||||
cmp r2, #0
|
||||
beq _08037C1E
|
||||
movs r0, #0xf
|
||||
strb r0, [r2, #0xe]
|
||||
str r1, [r2, #0x50]
|
||||
_08037C1E:
|
||||
adds r0, r3, #0
|
||||
adds r0, #0x84
|
||||
ldr r2, [r0]
|
||||
cmp r2, #0
|
||||
beq _08037C2E
|
||||
movs r0, #0xf
|
||||
strb r0, [r2, #0xe]
|
||||
str r1, [r2, #0x50]
|
||||
_08037C2E:
|
||||
ldr r2, [r3, #0x54]
|
||||
cmp r2, #0
|
||||
beq _08037C3A
|
||||
movs r0, #0xf
|
||||
strb r0, [r2, #0xe]
|
||||
str r1, [r2, #0x50]
|
||||
_08037C3A:
|
||||
pop {pc}
|
||||
|
||||
.syntax divided
|
|
@ -1344,7 +1344,7 @@ gUnk_080CF278:: @ 080CF278
|
|||
gUnk_080CF290:: @ 080CF290
|
||||
.incbin "baserom.gba", 0x0CF290, 0x0000004
|
||||
|
||||
gUnk_080CF294:: @ 080CF294
|
||||
gGibdo:: @ 080CF294
|
||||
.incbin "baserom.gba", 0x0CF294, 0x0000018
|
||||
|
||||
gUnk_080CF2AC:: @ 080CF2AC
|
||||
|
|
|
@ -392,7 +392,7 @@ SECTIONS {
|
|||
asm/mazaalHand.o(.text);
|
||||
asm/octorokBoss.o(.text);
|
||||
asm/flyingPot.o(.text);
|
||||
asm/gibdo.o(.text);
|
||||
src/enemy/gibdo.o(.text);
|
||||
asm/octorokGolden.o(.text);
|
||||
src/enemy/tektiteGolden.o(.text);
|
||||
asm/ropeGolden.o(.text);
|
||||
|
|
|
@ -0,0 +1,419 @@
|
|||
#include "global.h"
|
||||
#include "entity.h"
|
||||
#include "sprite.h"
|
||||
#include "functions.h"
|
||||
#include "enemy.h"
|
||||
// Gibudo
|
||||
void sub_08037794();
|
||||
void sub_08037B10();
|
||||
void sub_0803797C();
|
||||
void sub_080379BC();
|
||||
void sub_08037C0C();
|
||||
u32 sub_08037810();
|
||||
void sub_080377B0();
|
||||
u32 sub_080378B0();
|
||||
u32 sub_08037914();
|
||||
u32 sub_080379EC();
|
||||
void sub_08037A58();
|
||||
void sub_08037ACC();
|
||||
void sub_08037B48();
|
||||
void sub_08037A14();
|
||||
|
||||
extern void sub_0804A4E4(Entity*, Entity*);
|
||||
extern Entity* sub_08049DF4(u32);
|
||||
u32 sub_0804A044(Entity*, Entity*, u32);
|
||||
extern void sub_0800449C(Entity*, u32);
|
||||
|
||||
extern void (*const gGibdo[6])(Entity*);
|
||||
extern void (*const gUnk_080CF2AC[9])(Entity*);
|
||||
extern Entity* gUnk_020000B0;
|
||||
|
||||
void Gibdo(Entity* this) {
|
||||
EnemyFunctionHandler(this, gGibdo);
|
||||
SetChildOffset(this, 0, 1, -0x15);
|
||||
}
|
||||
|
||||
void Gibdo_OnTick(Entity* this) {
|
||||
gUnk_080CF2AC[this->action](this);
|
||||
}
|
||||
// Non-matching
|
||||
NONMATCH("asm/non_matching/gibdo/sub_080374A4.inc", void sub_080374A4(Entity* this)) {
|
||||
u8 x;
|
||||
if (this->bitfield == 0x87) {
|
||||
if (this->action == 0x6) {
|
||||
sub_08037ACC(this);
|
||||
}
|
||||
this->action = 0x8;
|
||||
this->actionDelay = 0x3c;
|
||||
this->flags &= 0x7F;
|
||||
sub_08037B48(this);
|
||||
} else {
|
||||
if (this->action != 0x6) {
|
||||
if (this->damageType == 0x27) {
|
||||
if (this->bitfield == 0x80) {
|
||||
sub_08037A14(this);
|
||||
}
|
||||
} else {
|
||||
if ((u8)(this->action - 1) < 2) {
|
||||
this->action = 1;
|
||||
x = DirectionTurnAround(this->field_0x3e);
|
||||
this->direction = x;
|
||||
this->animationState = x >> 3;
|
||||
InitAnimationForceUpdate(this, this->animationState);
|
||||
if (sub_08037810(this) != 0) {
|
||||
this->actionDelay = 4;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
sub_08037A58(this);
|
||||
}
|
||||
}
|
||||
if (this->field_0x43 != 0) {
|
||||
sub_0804A9FC(this, 0x1c);
|
||||
}
|
||||
sub_0804AA30(this, gGibdo);
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
void nullsub_162() {
|
||||
}
|
||||
|
||||
void sub_08037558(Entity* this) {
|
||||
sub_0804A720(this);
|
||||
this->animationState = Random() & 0x3;
|
||||
this->field_0x76.HALF.LO = 0;
|
||||
this->field_0x76.HALF.HI = 0;
|
||||
sub_08037794(this);
|
||||
}
|
||||
|
||||
void sub_08037580(Entity* this) {
|
||||
if (sub_08037810(this) == 0) {
|
||||
if (!(--this->field_0x74.HWORD)) {
|
||||
sub_080377B0(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080375A4(Entity* this) {
|
||||
if (sub_080378B0(this) == 0) {
|
||||
if (sub_08037810(this) == 0) {
|
||||
if (!(--this->field_0x74.HWORD)) {
|
||||
sub_08037794(this);
|
||||
} else {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if (ProcessMovement(this) == 0) {
|
||||
if (!(--this->field_0xf)) {
|
||||
sub_080379BC(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_080375F8(Entity* this) {
|
||||
if (sub_080378B0(this) == 0) {
|
||||
if (!(--this->actionDelay)) {
|
||||
this->action = 4;
|
||||
this->actionDelay = 0x18;
|
||||
InitAnimationForceUpdate(this, this->animationState + 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08037624(Entity* this) {
|
||||
if (sub_080378B0(this) == 0) {
|
||||
if (sub_08037914(this) == 0) {
|
||||
if (!(--this->field_0x74.HWORD)) {
|
||||
sub_08037794(this);
|
||||
} else {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if (ProcessMovement(this) == 0) {
|
||||
if (!(--this->field_0xf)) {
|
||||
sub_080379BC(this);
|
||||
}
|
||||
} else {
|
||||
if (!(--this->actionDelay)) {
|
||||
sub_0803797C(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08037690(Entity* this) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
this->field_0x76.HALF.HI = 0x14;
|
||||
sub_08037794(this);
|
||||
} else {
|
||||
if ((this->frames.all & 1) != 0) {
|
||||
this->damageType = 0x27;
|
||||
ProcessMovement(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Non-matching
|
||||
NONMATCH("asm/non_matching/gibdo/sub_080376D0.inc", void sub_080376D0(Entity* this)) {
|
||||
u8* x;
|
||||
if (sub_080379EC(this) == 0) {
|
||||
ResetPlayer();
|
||||
gPlayerState.field_0x1a[0] = gPlayerState.field_0x1a[0] | 0x80;
|
||||
gPlayerState.field_0xa = gPlayerState.field_0xa | 0x80;
|
||||
CopyPositionAndSpriteOffset(&gPlayerEntity, this);
|
||||
UpdateAnimationSingleFrame(this);
|
||||
x = &this->frames.all;
|
||||
if ((*x & 0x1) != 0) {
|
||||
if (!(--this->field_0x7c.BYTES.byte0)) {
|
||||
sub_08037A58(this);
|
||||
}
|
||||
} else {
|
||||
*x = *x ^ 1;
|
||||
sub_08037B10(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
void sub_0803773C(Entity* this) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if ((this->frames.all & 0x80) != 0) {
|
||||
sub_08037794(this);
|
||||
}
|
||||
}
|
||||
// Turn into Stalfos
|
||||
void sub_0803775C(Entity* this) {
|
||||
Entity* x;
|
||||
if (!(--this->actionDelay)) {
|
||||
x = CreateEnemy(0x42, 0);
|
||||
if (x != 0) {
|
||||
sub_0804A4E4(this, x);
|
||||
sub_08037C0C(this, x);
|
||||
}
|
||||
DeleteEntity(this);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08037794(Entity* this) {
|
||||
this->action = 1;
|
||||
this->field_0x74.HWORD = 0x1e;
|
||||
this->damageType = 0x26;
|
||||
InitAnimationForceUpdate(this, this->animationState);
|
||||
}
|
||||
|
||||
void sub_080377B0(Entity* this) {
|
||||
u32 r1;
|
||||
u32 r2;
|
||||
this->action = 2;
|
||||
this->field_0xf = 8;
|
||||
r1 = Random();
|
||||
this->field_0x74.HWORD = (r1 & 0x38) + 0x78;
|
||||
this->nonPlanarMovement = 0x40;
|
||||
r2 = Random();
|
||||
if (!sub_08049FA0(this) && (r2 & 3)) {
|
||||
this->direction = DirectionRoundUp(sub_08049EE4(this));
|
||||
} else {
|
||||
this->direction = DirectionRound(r2);
|
||||
}
|
||||
this->animationState = this->direction / 8;
|
||||
InitAnimationForceUpdate(this, this->animationState + 4);
|
||||
}
|
||||
// Nonmatching
|
||||
NONMATCH("asm/non_matching/gibdo/sub_08037810.inc", u32 sub_08037810(Entity* this)) {
|
||||
u32 x;
|
||||
u32 y;
|
||||
if (this->field_0x76.HALF.LO == 0) {
|
||||
if (sub_08049FDC(this, 1) != 0) {
|
||||
if (sub_0806FCB8(this, gUnk_020000B0->x.HALF.HI, gUnk_020000B0->y.HALF.HI, 0x40) != 0) {
|
||||
x = GetFacingDirection(this, gUnk_020000B0);
|
||||
if (((x - this->direction + 6) & 0x1f) <= 0xc) {
|
||||
this->action = 3;
|
||||
this->actionDelay = 0x18;
|
||||
this->field_0xf = 0x8;
|
||||
this->nonPlanarMovement = 0xc0;
|
||||
y = DirectionRoundUp(GetFacingDirection(this, gUnk_020000B0));
|
||||
this->direction = y;
|
||||
this->animationState = y / 8;
|
||||
this->field_0x74.HWORD = 300;
|
||||
this->field_0x78.HWORD = gUnk_020000B0->x.HALF.HI;
|
||||
this->field_0x7a.HWORD = gUnk_020000B0->y.HALF.HI;
|
||||
InitAnimationForceUpdate(this, this->animationState);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this->field_0x76.HALF.LO--;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
u32 sub_080378B0(Entity* this) {
|
||||
if (this->field_0x76.HALF.HI == 0) {
|
||||
if (sub_08049DF4(1) != 0) {
|
||||
if (sub_0804A044(this, gUnk_020000B0, 0xa) == this->direction)
|
||||
if (sub_0806FCB8(this, gUnk_020000B0->x.HALF.HI, gUnk_020000B0->y.HALF.HI, 0x18) != 0) {
|
||||
this->action = 5;
|
||||
this->nonPlanarMovement = 0x100;
|
||||
InitAnimationForceUpdate(this, this->animationState + 8);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this->field_0x76.HALF.HI--;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
u32 sub_08037914(Entity* this) {
|
||||
if (sub_08049FDC(this, 1) != 0) {
|
||||
if (sub_0806FCB8(gUnk_020000B0, this->field_0x78.HWORD, this->field_0x7a.HWORD, 0x28) == 0) {
|
||||
this->field_0x78.HWORD = gUnk_020000B0->x.HALF_U.HI;
|
||||
this->field_0x7a.HWORD = gUnk_020000B0->y.HALF_U.HI;
|
||||
sub_0803797C(this);
|
||||
return 0;
|
||||
}
|
||||
if (sub_0806FCB8(this, this->field_0x78.HWORD, this->field_0x7a.HWORD, 0x8) == 0) {
|
||||
return 0;
|
||||
}
|
||||
this->field_0x76.HALF.LO = 0x3c;
|
||||
}
|
||||
sub_08037794(this);
|
||||
return 1;
|
||||
}
|
||||
NONMATCH("asm/non_matching/gibdo/sub_0803797C.inc", void sub_0803797C(Entity* this)) {
|
||||
u32 z;
|
||||
u32 m;
|
||||
this->actionDelay = 0x18;
|
||||
this->field_0xf = 0x8;
|
||||
z = sub_080045D4(this->x.HALF.HI, this->y.HALF.HI, this->field_0x78.HWORD, this->field_0x7a.HWORD);
|
||||
m = (z + 4) & 0x18;
|
||||
this->direction = m;
|
||||
m = m / 8;
|
||||
if (m != this->animationState) {
|
||||
this->animationState = m;
|
||||
InitAnimationForceUpdate(this, m + 4);
|
||||
}
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
void sub_080379BC(Entity* this) {
|
||||
u32 r;
|
||||
this->actionDelay = 0x18;
|
||||
this->field_0xf = 0x8;
|
||||
r = Random();
|
||||
this->animationState = ((this->animationState + (r & 2)) - 1) & 3;
|
||||
this->direction = DirectionFromAnimationState(this->animationState);
|
||||
InitAnimationForceUpdate(this, this->animationState + 4);
|
||||
}
|
||||
|
||||
u32 sub_080379EC(Entity* this) {
|
||||
if (sub_0807953C() != 0) {
|
||||
if (!(--this->actionDelay)) {
|
||||
sub_08037A58(this);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void sub_08037A14(Entity* this) {
|
||||
this->action = 6;
|
||||
this->actionDelay = 0x18;
|
||||
this->spritePriority.b0 = (this->spritePriority.b0 & (this->actionDelay - 0x20));
|
||||
this->spritePriority.b0 |= 3;
|
||||
this->flags2 &= 0xfe;
|
||||
this->field_0x7c.BYTES.byte0 = 5;
|
||||
CopyPosition(this, this->field_0x4c);
|
||||
InitAnimationForceUpdate(this, this->animationState + 0xc);
|
||||
}
|
||||
// Not match
|
||||
// Take Damage maybe?
|
||||
NONMATCH("asm/non_matching/gibdo/sub_08037A58.inc", void sub_08037A58(Entity* this)) {
|
||||
sub_08037ACC(this);
|
||||
this->action = 7;
|
||||
this->spritePriority.b0 = (this->spritePriority.b0 & 0xf8) | 4;
|
||||
if (this->hurtBlinkTime == 0) {
|
||||
this->hurtBlinkTime = 0xec;
|
||||
}
|
||||
this->damageType = 0x26;
|
||||
this->flags2 |= 1;
|
||||
this->hurtBlinkTime = 0xf4;
|
||||
this->field_0x3e = (this->animationState << 3) ^ 0x10;
|
||||
this->field_0x42 = 8;
|
||||
this->field_0x46 = 0x180;
|
||||
this->field_0x76.HALF.LO = 0x3c;
|
||||
InitAnimationForceUpdate(this, this->animationState + 0x10);
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
void sub_08037ACC(Entity* this) {
|
||||
gPlayerState.flags.all &= 0xFFFFFEFF;
|
||||
gPlayerEntity.flags |= 0x80;
|
||||
gPlayerEntity.hurtBlinkTime = 0x1e;
|
||||
gPlayerEntity.field_0x3e = DirectionFromAnimationState(this->animationState);
|
||||
gPlayerEntity.field_0x42 = 4;
|
||||
gPlayerEntity.field_0x46 = 0x180;
|
||||
}
|
||||
// Damage player maybe?
|
||||
void sub_08037B10(Entity* this) {
|
||||
u32 h;
|
||||
gPlayerEntity.hurtBlinkTime = 0xc;
|
||||
h = ModHealth(-8);
|
||||
sub_0800449C(&gPlayerEntity, 0x7a);
|
||||
if (h == 0) {
|
||||
sub_08037A58(this);
|
||||
this->field_0x76.HALF.LO = 0xf0;
|
||||
}
|
||||
}
|
||||
NONMATCH("asm/non_matching/gibdo/sub_08037B48.inc", void sub_08037B48(Entity* this)) {
|
||||
Entity* E;
|
||||
E = CreateObject(0x2a, 3, 0);
|
||||
if (E != 0) {
|
||||
E->entityType.parameter = this->actionDelay;
|
||||
E->spritePriority.b0 = (E->spritePriority.b0 & 0xf8) | 3;
|
||||
E->spriteOffsetX = 0;
|
||||
E->spriteOffsetY = 0xfc;
|
||||
E->parent = this;
|
||||
}
|
||||
*(Entity**)&this->field_0x80.HWORD = E;
|
||||
E = CreateObject(0x2a, 3, 0);
|
||||
if (E != 0) {
|
||||
E->entityType.parameter = this->actionDelay;
|
||||
E->spritePriority.b0 = (E->spritePriority.b0 & 0xf8) | 3;
|
||||
E->spriteOffsetX = 0xfd;
|
||||
E->spriteOffsetY = 0xf8;
|
||||
E->parent = this;
|
||||
}
|
||||
*(Entity**)&this->cutsceneBeh.HWORD = E;
|
||||
E = CreateObject(0x2a, 3, 0);
|
||||
if (E != 0) {
|
||||
E->entityType.parameter = this->actionDelay;
|
||||
E->spritePriority.b0 = (E->spritePriority.b0 & 0xf8) | 3;
|
||||
E->spriteOffsetX = 0x5;
|
||||
E->spriteOffsetY = 0xf5;
|
||||
E->parent = this;
|
||||
}
|
||||
this->attachedEntity = E;
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
NONMATCH("asm/non_matching/gibdo/sub_08037C0C.inc", void sub_08037C0C(Entity* this, Entity* that)) {
|
||||
if (this->field_0x80.HWORD != 0) {
|
||||
this->actionDelay = 0xf;
|
||||
this->parent = that;
|
||||
}
|
||||
if (this->cutsceneBeh.HWORD != 0) {
|
||||
this->actionDelay = 0xf;
|
||||
this->parent = that;
|
||||
}
|
||||
if (this->attachedEntity != 0) {
|
||||
this->actionDelay = 0xf;
|
||||
this->parent = that;
|
||||
}
|
||||
}
|
||||
END_NONMATCH
|
Loading…
Reference in New Issue