mirror of https://github.com/zeldaret/tmc.git
start enemy4D.c
This commit is contained in:
parent
8ab5503804
commit
1b68e97d33
113
asm/enemy4D.s
113
asm/enemy4D.s
|
@ -6,119 +6,6 @@
|
||||||
|
|
||||||
.text
|
.text
|
||||||
|
|
||||||
|
|
||||||
thumb_func_start Enemy4D
|
|
||||||
Enemy4D: @ 0x0803EAEC
|
|
||||||
push {lr}
|
|
||||||
ldr r1, _0803EAF8 @ =gUnk_080D0880
|
|
||||||
bl EnemyFunctionHandler
|
|
||||||
pop {pc}
|
|
||||||
.align 2, 0
|
|
||||||
_0803EAF8: .4byte gUnk_080D0880
|
|
||||||
|
|
||||||
thumb_func_start sub_0803EAFC
|
|
||||||
sub_0803EAFC: @ 0x0803EAFC
|
|
||||||
push {lr}
|
|
||||||
ldr r2, _0803EB10 @ =gUnk_080D0898
|
|
||||||
ldrb r1, [r0, #0xc]
|
|
||||||
lsls r1, r1, #2
|
|
||||||
adds r1, r1, r2
|
|
||||||
ldr r1, [r1]
|
|
||||||
bl _call_via_r1
|
|
||||||
pop {pc}
|
|
||||||
.align 2, 0
|
|
||||||
_0803EB10: .4byte gUnk_080D0898
|
|
||||||
|
|
||||||
thumb_func_start sub_0803EB14
|
|
||||||
sub_0803EB14: @ 0x0803EB14
|
|
||||||
push {lr}
|
|
||||||
ldr r1, _0803EB20 @ =gUnk_080D0880
|
|
||||||
bl sub_0804AA30
|
|
||||||
pop {pc}
|
|
||||||
.align 2, 0
|
|
||||||
_0803EB20: .4byte gUnk_080D0880
|
|
||||||
|
|
||||||
thumb_func_start sub_0803EB24
|
|
||||||
sub_0803EB24: @ 0x0803EB24
|
|
||||||
push {r4, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
bl sub_08001324
|
|
||||||
|
|
||||||
thumb_func_start sub_0803EB2C
|
|
||||||
sub_0803EB2C: @ 0x0803EB2C
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_0803EAFC
|
|
||||||
pop {r4, pc}
|
|
||||||
|
|
||||||
thumb_func_start sub_0803EB34
|
|
||||||
sub_0803EB34: @ 0x0803EB34
|
|
||||||
push {lr}
|
|
||||||
movs r1, #0xff
|
|
||||||
movs r2, #0x57
|
|
||||||
bl CreateDeathFx
|
|
||||||
pop {pc}
|
|
||||||
|
|
||||||
thumb_func_start nullsub_21
|
|
||||||
nullsub_21: @ 0x0803EB40
|
|
||||||
bx lr
|
|
||||||
.align 2, 0
|
|
||||||
|
|
||||||
thumb_func_start sub_0803EB44
|
|
||||||
sub_0803EB44: @ 0x0803EB44
|
|
||||||
push {r4, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
bl sub_0804A720
|
|
||||||
adds r0, r4, #0
|
|
||||||
movs r1, #0x19
|
|
||||||
movs r2, #0
|
|
||||||
bl sub_0804A98C
|
|
||||||
cmp r0, #0
|
|
||||||
beq _0803EBB2
|
|
||||||
str r4, [r0, #0x50]
|
|
||||||
str r0, [r4, #0x54]
|
|
||||||
ldrb r1, [r4, #0x10]
|
|
||||||
movs r0, #0x80
|
|
||||||
movs r2, #0
|
|
||||||
orrs r0, r1
|
|
||||||
strb r0, [r4, #0x10]
|
|
||||||
ldrb r1, [r4, #0x18]
|
|
||||||
movs r0, #4
|
|
||||||
rsbs r0, r0, #0
|
|
||||||
ands r0, r1
|
|
||||||
movs r1, #1
|
|
||||||
orrs r0, r1
|
|
||||||
strb r0, [r4, #0x18]
|
|
||||||
movs r0, #2
|
|
||||||
strb r0, [r4, #0x14]
|
|
||||||
adds r0, r4, #0
|
|
||||||
adds r0, #0x7b
|
|
||||||
strb r2, [r0]
|
|
||||||
adds r0, #1
|
|
||||||
strb r2, [r0]
|
|
||||||
adds r1, r4, #0
|
|
||||||
adds r1, #0x7e
|
|
||||||
movs r0, #0x28
|
|
||||||
strb r0, [r1]
|
|
||||||
adds r1, #1
|
|
||||||
movs r0, #0xfe
|
|
||||||
strb r0, [r1]
|
|
||||||
ldrh r1, [r4, #0x2e]
|
|
||||||
adds r0, r4, #0
|
|
||||||
adds r0, #0x80
|
|
||||||
strh r1, [r0]
|
|
||||||
ldrh r0, [r4, #0x32]
|
|
||||||
adds r1, r4, #0
|
|
||||||
adds r1, #0x82
|
|
||||||
strh r0, [r1]
|
|
||||||
ldrb r1, [r4, #0x14]
|
|
||||||
lsls r1, r1, #2
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl InitAnimationForceUpdate
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_0803EE8C
|
|
||||||
_0803EBB2:
|
|
||||||
pop {r4, pc}
|
|
||||||
|
|
||||||
thumb_func_start sub_0803EBB4
|
thumb_func_start sub_0803EBB4
|
||||||
sub_0803EBB4: @ 0x0803EBB4
|
sub_0803EBB4: @ 0x0803EBB4
|
||||||
push {r4, lr}
|
push {r4, lr}
|
||||||
|
|
|
@ -1,41 +0,0 @@
|
||||||
.include "asm/macros.inc"
|
|
||||||
.include "constants/constants.inc"
|
|
||||||
|
|
||||||
.syntax unified
|
|
||||||
|
|
||||||
.text
|
|
||||||
|
|
||||||
thumb_func_start sub_08055E24
|
|
||||||
sub_08055E24: @ 0x08055E24
|
|
||||||
push {r4, lr}
|
|
||||||
ldr r4, _08055E5C @ =gMenu
|
|
||||||
ldrb r0, [r4, #6]
|
|
||||||
adds r0, #1
|
|
||||||
strb r0, [r4, #6]
|
|
||||||
ldr r1, _08055E60 @ =gUnk_02000070
|
|
||||||
movs r0, #1
|
|
||||||
strb r0, [r1]
|
|
||||||
ldr r1, [r4, #0xc]
|
|
||||||
ldrb r0, [r1, #2]
|
|
||||||
ldrb r1, [r1, #3]
|
|
||||||
bl sub_0804B0B0
|
|
||||||
ldr r0, _08055E64 @ =gUnk_080FF400
|
|
||||||
bl LoadRoomEntityList
|
|
||||||
ldrb r0, [r4, #4]
|
|
||||||
movs r1, #0
|
|
||||||
movs r2, #0
|
|
||||||
movs r3, #0
|
|
||||||
bl sub_08055B70
|
|
||||||
movs r0, #4
|
|
||||||
movs r1, #0x10
|
|
||||||
bl DoFade
|
|
||||||
pop {r4, pc}
|
|
||||||
.align 2, 0
|
|
||||||
_08055E5C: .4byte gMenu
|
|
||||||
_08055E60: .4byte gUnk_02000070
|
|
||||||
_08055E64: .4byte gUnk_080FF400
|
|
||||||
|
|
||||||
thumb_func_start nullsub_493
|
|
||||||
nullsub_493: @ 0x08055E68
|
|
||||||
bx lr
|
|
||||||
.align 2, 0
|
|
|
@ -110,4 +110,6 @@ extern void Enemy66(Entity*);
|
||||||
|
|
||||||
extern u32 GetNextFunction(Entity*);
|
extern u32 GetNextFunction(Entity*);
|
||||||
extern void EnemyFunctionHandler(Entity*, void (*const func[])(Entity*));
|
extern void EnemyFunctionHandler(Entity*, void (*const func[])(Entity*));
|
||||||
|
extern void sub_0804AA30(Entity*, void (*const func[])(Entity*));
|
||||||
|
extern void sub_08001324(Entity*);
|
||||||
#endif
|
#endif
|
|
@ -28,7 +28,7 @@ typedef struct {
|
||||||
u8 storyPanelIndex;
|
u8 storyPanelIndex;
|
||||||
u16 transitionTimer;
|
u16 transitionTimer;
|
||||||
u16 field_0xa;
|
u16 field_0xa;
|
||||||
u8 field_0xc[0x4];
|
u8* field_0xc;
|
||||||
u8 unk10[2];
|
u8 unk10[2];
|
||||||
u8 field_0x12;
|
u8 field_0x12;
|
||||||
u8 unk13;
|
u8 unk13;
|
||||||
|
|
|
@ -409,6 +409,7 @@ SECTIONS {
|
||||||
asm/vaatiRebornEnemy.o(.text);
|
asm/vaatiRebornEnemy.o(.text);
|
||||||
asm/vaatiProjectile.o(.text);
|
asm/vaatiProjectile.o(.text);
|
||||||
asm/ballChainSoldier.o(.text);
|
asm/ballChainSoldier.o(.text);
|
||||||
|
src/enemy/enemy4D.o(.text);
|
||||||
asm/enemy4D.o(.text);
|
asm/enemy4D.o(.text);
|
||||||
asm/ghini.o(.text);
|
asm/ghini.o(.text);
|
||||||
asm/vaatiTransfigured.o(.text);
|
asm/vaatiTransfigured.o(.text);
|
||||||
|
@ -465,7 +466,6 @@ SECTIONS {
|
||||||
src/code_0805436C.o(.text);
|
src/code_0805436C.o(.text);
|
||||||
asm/code_0805436C.o(.text);
|
asm/code_0805436C.o(.text);
|
||||||
src/sub_08055E08.o(.text);
|
src/sub_08055E08.o(.text);
|
||||||
asm/sub_08055E24.o(.text);
|
|
||||||
src/mainLoop.o(.text);
|
src/mainLoop.o(.text);
|
||||||
asm/code_08055FF4.o(.text);
|
asm/code_08055FF4.o(.text);
|
||||||
src/textbox.o(.text);
|
src/textbox.o(.text);
|
||||||
|
|
|
@ -0,0 +1,55 @@
|
||||||
|
#include "global.h"
|
||||||
|
#include "entity.h"
|
||||||
|
#include "enemy.h"
|
||||||
|
#include "functions.h"
|
||||||
|
|
||||||
|
extern void sub_0803EE8C(Entity*);
|
||||||
|
|
||||||
|
extern void (*const gUnk_080D0880[])(Entity*);
|
||||||
|
extern void (*const gUnk_080D0898[])(Entity*);
|
||||||
|
|
||||||
|
void Enemy4D(Entity* this) {
|
||||||
|
EnemyFunctionHandler(this, gUnk_080D0880);
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_0803EAFC(Entity* this) {
|
||||||
|
gUnk_080D0898[this->action](this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_0803EB14(Entity* this) {
|
||||||
|
sub_0804AA30(this, gUnk_080D0880);
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_0803EB24(Entity* this) {
|
||||||
|
sub_08001324(this);
|
||||||
|
sub_0803EAFC(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_0803EB34(Entity* this) {
|
||||||
|
CreateDeathFx(this, 0xff, 0x57);
|
||||||
|
}
|
||||||
|
|
||||||
|
void nullsub_21() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_0803EB44(Entity* this) {
|
||||||
|
Entity* pEVar1;
|
||||||
|
|
||||||
|
sub_0804A720(this);
|
||||||
|
pEVar1 = sub_0804A98C(this, 0x19, 0);
|
||||||
|
if (pEVar1 != NULL) {
|
||||||
|
pEVar1->parent = this;
|
||||||
|
this->attachedEntity = pEVar1;
|
||||||
|
this->flags |= 0x80;
|
||||||
|
this->spriteSettings.b.draw = TRUE;
|
||||||
|
this->animationState = 2;
|
||||||
|
*((u8*)&this->field_0x7a + 1) = 0;
|
||||||
|
*(u8*)&this->field_0x7c = 0;
|
||||||
|
*((u8*)&this->field_0x7c + 2) = 0x28;
|
||||||
|
*((u8*)&this->field_0x7c + 3) = 0xfe;
|
||||||
|
this->field_0x80.HWORD = this->x.HALF.HI;
|
||||||
|
this->field_0x82.HWORD = this->y.HALF.HI;
|
||||||
|
InitAnimationForceUpdate(this, this->animationState << 2);
|
||||||
|
sub_0803EE8C(this);
|
||||||
|
}
|
||||||
|
}
|
|
@ -3,7 +3,6 @@
|
||||||
#include "enemy.h"
|
#include "enemy.h"
|
||||||
#include "player.h"
|
#include "player.h"
|
||||||
|
|
||||||
extern void sub_0804AA30(Entity*, void *);
|
|
||||||
extern u32 sub_0806F520(Entity*);
|
extern u32 sub_0806F520(Entity*);
|
||||||
extern void sub_0806F4E8(Entity*);
|
extern void sub_0806F4E8(Entity*);
|
||||||
extern u32 sub_0806F3E4(Entity*);
|
extern u32 sub_0806F3E4(Entity*);
|
||||||
|
@ -17,9 +16,9 @@ extern u32 sub_0806FCB8(Entity*, s32, s32, u32);
|
||||||
extern u32 sub_08049FA0(Entity*);
|
extern u32 sub_08049FA0(Entity*);
|
||||||
extern u32 sub_08049EE4(Entity*);
|
extern u32 sub_08049EE4(Entity*);
|
||||||
|
|
||||||
extern void (*gUnk_080CB69C[])(Entity*);
|
extern void (*const gUnk_080CB69C[])(Entity*);
|
||||||
extern void (*gUnk_080CB6B4[])(Entity*);
|
extern void (*const gUnk_080CB6B4[])(Entity*);
|
||||||
extern void (*gUnk_080CB6C4[])(Entity*);
|
extern void (*const gUnk_080CB6C4[])(Entity*);
|
||||||
|
|
||||||
extern u8 gUnk_080CB6D0[];
|
extern u8 gUnk_080CB6D0[];
|
||||||
extern u16 gUnk_080CB6D6[];
|
extern u16 gUnk_080CB6D6[];
|
||||||
|
@ -37,7 +36,7 @@ void sub_08021D80(Entity *this)
|
||||||
|
|
||||||
void sub_08021d98(Entity *this)
|
void sub_08021d98(Entity *this)
|
||||||
{
|
{
|
||||||
sub_0804AA30(this, &gUnk_080CB69C);
|
sub_0804AA30(this, gUnk_080CB69C);
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_08021DA8(Entity *this)
|
void sub_08021DA8(Entity *this)
|
||||||
|
|
|
@ -1,13 +1,35 @@
|
||||||
|
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
|
#include "menu.h"
|
||||||
|
#include "room.h"
|
||||||
|
#include "functions.h"
|
||||||
|
|
||||||
extern u32* _call_via_r0(u32* func);
|
extern u32* _call_via_r0(u32* func);
|
||||||
extern u8 gMenu;
|
extern void (*const gUnk_080FF420[])();
|
||||||
extern u32* gUnk_080FF420;
|
extern void sub_0804B0B0(u32, u32);
|
||||||
|
extern void sub_08055B70(u32, u32, u32, u32);
|
||||||
|
|
||||||
void sub_08055E08() {
|
struct {
|
||||||
u32** arr = &gUnk_080FF420;
|
/*0x00*/ u8 unk0;
|
||||||
u8 i = gMenu;
|
/*0x10*/ u8 filler1[0x1B];
|
||||||
i = *(&gMenu + 6);
|
/*0x1c*/ u8 unk1C;
|
||||||
_call_via_r0(arr[i]);
|
/*0x1d*/ u8 unk1D;
|
||||||
|
/*0x1e*/ u8 unk1E;
|
||||||
|
/*0x1f*/ u8 unk1F;
|
||||||
|
} gUnk_02000070 = {};
|
||||||
|
|
||||||
|
extern EntityData gUnk_080FF400;
|
||||||
|
|
||||||
|
void sub_08055E08(void) {
|
||||||
|
gUnk_080FF420[gMenu.overlayType]();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void sub_08055E24(void) {
|
||||||
|
gMenu.overlayType++;
|
||||||
|
gUnk_02000070.unk0 = 1;
|
||||||
|
sub_0804B0B0(gMenu.field_0xc[2], gMenu.field_0xc[3]);
|
||||||
|
LoadRoomEntityList(&gUnk_080FF400);
|
||||||
|
sub_08055B70(gMenu.field_0x4, 0, 0, 0);
|
||||||
|
DoFade(4, 0x10);
|
||||||
|
}
|
||||||
|
|
||||||
|
void nullsub_493(void) {}
|
Loading…
Reference in New Issue