add keese rodata

This commit is contained in:
Behemoth 2020-08-29 04:40:43 +02:00
parent ff7a8ec404
commit c3a7199cd6
4 changed files with 127 additions and 118 deletions

View File

@ -3,33 +3,6 @@
.section .rodata
gUnk_080CB69C:: @ 080CB69C
.incbin "baserom.gba", 0x0CB69C, 0x0000018
gUnk_080CB6B4:: @ 080CB6B4
.incbin "baserom.gba", 0x0CB6B4, 0x0000010
gUnk_080CB6C4:: @ 080CB6C4
.incbin "baserom.gba", 0x0CB6C4, 0x000000C
gUnk_080CB6D0:: @ 080CB6D0
.incbin "baserom.gba", 0x0CB6D0, 0x0000006
gUnk_080CB6D6:: @ 080CB6D6
.incbin "baserom.gba", 0x0CB6D6, 0x0000020
gUnk_080CB6F6:: @ 080CB6F6
.incbin "baserom.gba", 0x0CB6F6, 0x0000010
gUnk_080CB706:: @ 080CB706
.incbin "baserom.gba", 0x0CB706, 0x0000018
gUnk_080CB71E:: @ 080CB71E
.incbin "baserom.gba", 0x0CB71E, 0x000000A
gUnk_080CB728:: @ 080CB728
.incbin "baserom.gba", 0x0CB728, 0x000000C
gUnk_080CB734:: @ 080CB734
.incbin "baserom.gba", 0x0CB734, 0x0000018

13
data/keeseAnimations.s Normal file
View File

@ -0,0 +1,13 @@
.include "asm/macros.inc"
.include "constants/constants.inc"
.section .rodata
gUnk_080CB706:: @ 080CB706
.incbin "baserom.gba", 0x0CB706, 0x0000018
gUnk_080CB71E:: @ 080CB71E
.incbin "baserom.gba", 0x0CB71E, 0x000000A
gUnk_080CB728:: @ 080CB728
.incbin "baserom.gba", 0x0CB728, 0x000000C

View File

@ -920,6 +920,8 @@ SECTIONS {
src/enemy/hangingSeed.o(.rodata);
src/enemy/beetle.o(.rodata);
data/beetleAnimations.o(.rodata);
src/enemy/keese.o(.rodata);
data/keeseAnimations.o(.rodata);
data/data_080CB69C.o(.rodata);
src/enemy.o(.rodata);
data/data_080D3D94.o(.rodata);

View File

@ -2,14 +2,14 @@
#include "entity.h"
#include "enemy.h"
#include "player.h"
#include "functions.h"
extern void sub_0804AA30(Entity*, void *);
extern void sub_08001328(Entity*);
extern u32 sub_0806F520(Entity*);
extern void sub_0806F4E8(Entity*);
extern u32 sub_0806F3E4(Entity*);
extern void sub_0804A7D4(Entity*);
extern void sub_0804A720(Entity*);
extern u32 Random();
extern void sub_08021EF0(Entity*);
extern void sub_080AEFB4(Entity*);
extern void sub_08021F24(Entity*);
@ -17,102 +17,89 @@ extern u32 sub_0806FCB8(Entity*, s32, s32, u32);
extern u32 sub_08049FA0(Entity*);
extern u32 sub_08049EE4(Entity*);
extern void (*gUnk_080CB69C[])(Entity*);
extern void (*gUnk_080CB6B4[])(Entity*);
extern void (*gUnk_080CB6C4[])(Entity*);
extern void (*const gUnk_080CB69C[])(Entity*);
extern void (*const gUnk_080CB6B4[])(Entity*);
extern void (*const gUnk_080CB6C4[])(Entity*);
extern u8 gUnk_080CB6D0[];
extern u16 gUnk_080CB6D6[];
extern u8 gUnk_080CB6F6[];
extern const s8 gUnk_080CB6D0[];
extern const u16 gUnk_080CB6D6[];
extern const u8 gUnk_080CB6F6[];
void Keese(Entity *this)
{
void Keese(Entity* this) {
gUnk_080CB69C[GetNextFunction(this)](this);
}
void sub_08021D80(Entity *this)
{
void sub_08021D80(Entity* this) {
gUnk_080CB6B4[this->action](this);
}
void sub_08021d98(Entity *this)
{
sub_0804AA30(this, &gUnk_080CB69C);
void sub_08021d98(Entity* this) {
sub_0804AA30(this, gUnk_080CB69C);
}
void sub_08021DA8(Entity *this)
{
if (sub_0806F520(this)) {
gUnk_080CB6C4[this->previousActionFlag](this);
}
void sub_08021DA8(Entity* this) {
if (sub_0806F520(this)) {
gUnk_080CB6C4[this->previousActionFlag](this);
}
}
void sub_08021DCC(Entity *this)
{
this->previousActionFlag = 2;
void sub_08021DCC(Entity* this) {
this->previousActionFlag = 2;
}
void sub_08021DD4(Entity *this)
{
sub_0806F4E8(this);
void sub_08021DD4(Entity* this) {
sub_0806F4E8(this);
}
void sub_08021DDC(Entity *this)
{
if (sub_0806F3E4(this)) {
sub_0804A7D4(this);
}
void sub_08021DDC(Entity* this) {
if (sub_0806F3E4(this)) {
sub_0804A7D4(this);
}
}
void sub_08021DF0(Entity *this)
{
sub_0804A720(this);
if ((this->entityType).form != 0) {
this->spritePriority.b1 = 1;
this->height.HALF.HI = -0x10;
}
this->direction = Random() & 0x1f;
this->field_0x1c = 1;
this->spritePriority.b0 = 3;
this->collisionLayer = 3;
UpdateSpriteForCollisionLayer(this);
sub_08021EF0(this);
}
void sub_08021DF0(Entity* this) {
void sub_08021E4C(Entity *this)
{
if (this->field_0x78.HWORD != 0) {
this->field_0x78.HWORD--;
}
if (this->field_0x7a.HWORD != 0) {
(this->field_0x7a.HWORD)--;
}
GetNextFrame(this);
if ((this->frames.b.f3) != 0) {
sub_08021F24(this);
}
else {
sub_080AEFB4(this);
}
this->spriteOffsetY = gUnk_080CB6D0[this->frames.all];
}
void sub_08021EA4(Entity *this)
{
if (--this->actionDelay == 0) {
sub_0804A720(this);
if ((this->entityType).form != 0) {
this->spritePriority.b1 = 1;
this->height.HALF.HI = -0x10;
}
this->direction = Random() & 0x1f;
this->field_0x1c = 1;
this->spritePriority.b0 = 3;
this->collisionLayer = 3;
UpdateSpriteForCollisionLayer(this);
sub_08021EF0(this);
}
}
void sub_08021EBC(Entity *this)
{
void sub_08021E4C(Entity* this) {
if (this->field_0x78.HWORD != 0) {
this->field_0x78.HWORD--;
}
if (this->field_0x7a.HWORD != 0) {
(this->field_0x7a.HWORD)--;
}
GetNextFrame(this);
if ((this->frames.b.f3) != 0) {
sub_08021F24(this);
} else {
sub_080AEFB4(this);
}
this->spriteOffsetY = gUnk_080CB6D0[this->frames.all];
}
void sub_08021EA4(Entity* this) {
if (--this->actionDelay == 0) {
sub_08021EF0(this);
}
}
void sub_08021EBC(Entity* this) {
s32 iVar1;
if (this->actionDelay != 0) {
this->actionDelay--;
}
else {
} else {
iVar1 = sub_0806FCB8(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x70);
if (iVar1 != 0) {
sub_08021EF0(this);
@ -120,37 +107,71 @@ void sub_08021EBC(Entity *this)
}
}
void sub_08021EF0(Entity *this)
{
u32 uVar1;
this->action = 1;
this->field_0x78.HWORD = gUnk_080CB6D6[Random() & 0xf];
this->field_0x7a.HWORD = 0x3c;
InitializeAnimation(this, 0);
void sub_08021EF0(Entity* this) {
u32 uVar1;
this->action = 1;
this->field_0x78.HWORD = gUnk_080CB6D6[Random() & 0xf];
this->field_0x7a.HWORD = 0x3c;
InitializeAnimation(this, 0);
}
void sub_08021F24(Entity *this)
{
void sub_08021F24(Entity* this) {
u32 bVar1;
if (this->field_0x78.HWORD == 0) {
this->action = 2;
this->actionDelay = gUnk_080CB6F6[Random() & 0xf];
InitializeAnimation(this, 1);
}
else if (!this->field_0x7a.HWORD && !(sub_0806FCB8(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x70))) {
} else if (!this->field_0x7a.HWORD &&
!(sub_0806FCB8(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x70))) {
this->action = 3;
this->actionDelay = 0x1e;
InitializeAnimation(this, 1);
}
else {
} else {
if (sub_08049FA0(this) != 0) {
this->direction = Random() & 0x1f;
}
else {
} else {
this->direction = sub_08049EE4(this);
}
InitializeAnimation(this, 0);
}
}
}
// clang-format off
void (*const gUnk_080CB69C[])(Entity*) = {
sub_08021D80,
sub_08021d98,
sub_08001328,
sub_0804A7D4,
sub_08001242,
sub_08021DA8,
};
void (*const gUnk_080CB6B4[])(Entity*) = {
sub_08021DF0,
sub_08021E4C,
sub_08021EA4,
sub_08021EBC,
};
void (*const gUnk_080CB6C4[])(Entity*) = {
sub_08021DCC,
sub_08021DD4,
sub_08021DDC,
};
const s8 gUnk_080CB6D0[] = {
1, -2, -5, -2, 1, 0,
};
const u16 gUnk_080CB6D6[] = {
180, 180, 300, 300, 300, 300, 300, 300,
480, 480, 480, 480, 480, 480, 720, 720,
};
const u8 gUnk_080CB6F6[] = {
30, 30, 45, 45, 45, 45, 45, 45,
60, 60, 60, 60, 60, 60, 75, 75,
};
// clang-format on