Skip to content

Commit

Permalink
Progress on Enemy Ape
Browse files Browse the repository at this point in the history
  • Loading branch information
JaceCear committed Dec 13, 2024
1 parent fea263b commit 3f24147
Show file tree
Hide file tree
Showing 3 changed files with 135 additions and 291 deletions.
285 changes: 2 additions & 283 deletions asm/enemy_ape.s
Original file line number Diff line number Diff line change
Expand Up @@ -8,287 +8,6 @@
.if 0
.endif

thumb_func_start sub_805A674
sub_805A674: @ 0x0805A674
push {r4, r5, r6, r7, lr}
mov r7, sl
mov r6, sb
mov r5, r8
push {r5, r6, r7}
sub sp, #4
adds r7, r0, #0
movs r0, #0x18
bl VramMalloc
adds r5, r0, #0
adds r3, r7, #0
adds r3, #0x24
str r5, [r7, #0x24]
ldr r4, _0805A75C @ =gUnknown_080D1ECC
ldr r0, [r4, #0x14]
lsls r0, r0, #5
adds r5, r5, r0
ldrh r0, [r4, #0x10]
movs r2, #0
strh r0, [r3, #0xc]
ldrb r0, [r4, #0x12]
strb r0, [r3, #0x1a]
movs r0, #0xff
strb r0, [r3, #0x1b]
ldr r1, [r7, #0x1c]
asrs r1, r1, #8
ldrh r0, [r7, #0xa]
lsls r0, r0, #8
adds r1, r1, r0
ldr r6, _0805A760 @ =gCamera
ldr r0, [r6]
subs r1, r1, r0
strh r1, [r3, #0x10]
ldr r1, [r7, #0x20]
asrs r1, r1, #8
ldrh r0, [r7, #0xc]
lsls r0, r0, #8
adds r1, r1, r0
ldr r0, [r6, #4]
subs r1, r1, r0
strh r1, [r3, #0x12]
movs r0, #0x90
lsls r0, r0, #3
strh r0, [r3, #0x14]
strh r2, [r3, #0xe]
strh r2, [r3, #0x16]
movs r0, #0x10
mov sl, r0
mov r0, sl
strb r0, [r3, #0x1c]
movs r0, #0
strb r0, [r3, #0x1f]
movs r0, #0x80
lsls r0, r0, #5
mov sb, r0
str r0, [r3, #8]
movs r0, #1
rsbs r0, r0, #0
mov r8, r0
str r0, [r3, #0x20]
adds r0, r3, #0
str r2, [sp]
bl UpdateSpriteAnimation
adds r3, r7, #0
adds r3, #0x4c
str r5, [r7, #0x4c]
ldrh r0, [r4]
strh r0, [r3, #0xc]
ldrb r0, [r4, #2]
strb r0, [r3, #0x1a]
movs r0, #1
rsbs r0, r0, #0
strb r0, [r3, #0x1b]
ldr r1, [r7, #0x1c]
asrs r1, r1, #8
ldrh r0, [r7, #0xa]
lsls r0, r0, #8
adds r1, r1, r0
ldr r0, [r6]
subs r1, r1, r0
strh r1, [r3, #0x10]
ldr r1, [r7, #0x20]
asrs r1, r1, #8
ldrh r0, [r7, #0xc]
lsls r0, r0, #8
adds r1, r1, r0
ldr r0, [r6, #4]
subs r1, r1, r0
strh r1, [r3, #0x12]
movs r0, #0x98
lsls r0, r0, #3
strh r0, [r3, #0x14]
ldr r2, [sp]
strh r2, [r3, #0xe]
strh r2, [r3, #0x16]
mov r0, sl
strb r0, [r3, #0x1c]
movs r0, #0
strb r0, [r3, #0x1f]
mov r0, sb
str r0, [r3, #8]
mov r0, r8
str r0, [r3, #0x20]
adds r0, r3, #0
bl UpdateSpriteAnimation
add sp, #4
pop {r3, r4, r5}
mov r8, r3
mov sb, r4
mov sl, r5
pop {r4, r5, r6, r7}
pop {r0}
bx r0
.align 2, 0
_0805A75C: .4byte gUnknown_080D1ECC
_0805A760: .4byte gCamera

thumb_func_start Task_ApeMain
Task_ApeMain: @ 0x0805A764
push {r4, lr}
ldr r0, _0805A7A0 @ =gCurTask
ldr r0, [r0]
ldrh r1, [r0, #6]
movs r0, #0xc0
lsls r0, r0, #0x12
adds r4, r1, r0
ldr r0, _0805A7A4 @ =gStageData
ldrb r1, [r0, #4]
subs r0, r1, #1
lsls r0, r0, #0x18
lsrs r0, r0, #0x18
cmp r0, #1
bls _0805A78A
cmp r1, #4
beq _0805A78A
adds r0, r4, #0
bl sub_805A8B0
_0805A78A:
adds r0, r4, #0
bl sub_805ACB4
cmp r0, #1
bne _0805A7A8
ldr r0, _0805A7A0 @ =gCurTask
ldr r0, [r0]
bl TaskDestroy
b _0805A7DA
.align 2, 0
_0805A7A0: .4byte gCurTask
_0805A7A4: .4byte gStageData
_0805A7A8:
adds r0, r4, #0
bl sub_805AA10
adds r0, r4, #0
bl sub_805A964
cmp r0, #1
bne _0805A7DA
ldr r0, _0805A7E0 @ =gStageData
ldr r0, [r0, #0x1c]
ldr r1, [r4, #0x10]
subs r0, r0, r1
cmp r0, #0x77
bls _0805A7DA
adds r2, r4, #0
adds r2, #0x4c
ldr r1, _0805A7E4 @ =gUnknown_080D1ECC
ldrh r0, [r1, #8]
strh r0, [r2, #0xc]
ldrb r0, [r1, #0xa]
strb r0, [r2, #0x1a]
ldr r0, _0805A7E8 @ =gCurTask
ldr r1, [r0]
ldr r0, _0805A7EC @ =sub_805A7F0
str r0, [r1, #8]
_0805A7DA:
pop {r4}
pop {r0}
bx r0
.align 2, 0
_0805A7E0: .4byte gStageData
_0805A7E4: .4byte gUnknown_080D1ECC
_0805A7E8: .4byte gCurTask
_0805A7EC: .4byte sub_805A7F0

thumb_func_start sub_805A7F0
sub_805A7F0: @ 0x0805A7F0
push {r4, r5, r6, lr}
sub sp, #4
ldr r4, _0805A81C @ =gCurTask
ldr r0, [r4]
ldrh r1, [r0, #6]
movs r0, #0xc0
lsls r0, r0, #0x12
adds r5, r1, r0
adds r0, r5, #0
bl sub_805AA10
adds r6, r0, #0
adds r0, r5, #0
bl sub_805ACB4
cmp r0, #1
bne _0805A820
ldr r0, [r4]
bl TaskDestroy
b _0805A898
.align 2, 0
_0805A81C: .4byte gCurTask
_0805A820:
ldr r0, _0805A868 @ =gStageData
ldrb r1, [r0, #4]
subs r0, r1, #1
lsls r0, r0, #0x18
lsrs r0, r0, #0x18
cmp r0, #1
bls _0805A898
cmp r1, #4
beq _0805A898
ldrh r0, [r5, #0xe]
adds r1, r0, #0
cmp r1, #0x16
bls _0805A86C
ldrb r0, [r5, #6]
cmp r0, #0
bne _0805A86C
ldr r0, [r5, #0x54]
movs r1, #0x80
lsls r1, r1, #3
ands r0, r1
movs r4, #0xff
cmp r0, #0
beq _0805A850
movs r4, #1
_0805A850:
ldr r0, [r5, #0x1c]
ldr r1, [r5, #0x20]
ldrh r2, [r5, #0xa]
ldrh r3, [r5, #0xc]
lsls r4, r4, #0x18
asrs r4, r4, #0x18
str r4, [sp]
bl sub_805AD04
movs r0, #1
strb r0, [r5, #6]
b _0805A870
.align 2, 0
_0805A868: .4byte gStageData
_0805A86C:
subs r0, r1, #1
strh r0, [r5, #0xe]
_0805A870:
cmp r6, #0
bne _0805A898
adds r2, r5, #0
adds r2, #0x4c
ldr r1, _0805A8A0 @ =gUnknown_080D1ECC
ldrh r0, [r1]
movs r3, #0
strh r0, [r2, #0xc]
ldrb r0, [r1, #2]
strb r0, [r2, #0x1a]
ldr r0, _0805A8A4 @ =gStageData
ldr r0, [r0, #0x1c]
str r0, [r5, #0x10]
movs r0, #0x16
strh r0, [r5, #0xe]
strb r3, [r5, #6]
ldr r0, _0805A8A8 @ =gCurTask
ldr r1, [r0]
ldr r0, _0805A8AC @ =Task_ApeMain
str r0, [r1, #8]
_0805A898:
add sp, #4
pop {r4, r5, r6}
pop {r0}
bx r0
.align 2, 0
_0805A8A0: .4byte gUnknown_080D1ECC
_0805A8A4: .4byte gStageData
_0805A8A8: .4byte gCurTask
_0805A8AC: .4byte Task_ApeMain

thumb_func_start sub_805A8B0
sub_805A8B0: @ 0x0805A8B0
push {r4, lr}
Expand Down Expand Up @@ -868,8 +587,8 @@ TaskDestructor_Ape: @ 0x0805ACF0
pop {r0}
bx r0

thumb_func_start sub_805AD04
sub_805AD04: @ 0x0805AD04
thumb_func_start CreateApeProjectile
CreateApeProjectile: @ 0x0805AD04
push {r4, r5, r6, lr}
mov r6, sl
mov r5, sb
Expand Down
20 changes: 15 additions & 5 deletions include/constants/anim_sizes.h
Original file line number Diff line number Diff line change
Expand Up @@ -545,14 +545,16 @@
#define ANIM_AKATENTO_WIDTH 32
#define ANIM_AKATENTO_HEIGHT 24

// 1176
#define ANIM_BUZZER_PROJ_WIDTH 16
#define ANIM_BUZZER_PROJ_HEIGHT 16

// 1178
// 1169
#define ANIM_AOTENTO_WIDTH 32
#define ANIM_AOTENTO_HEIGHT 32

// 1171
#define ANIM_APE_WIDTH 40
#define ANIM_APE_HEIGHT 32
#define ANIM_APE_VAR2_WIDTH 16
#define ANIM_APE_VAR2_HEIGHT 16

// 1173
#define ANIM_FROG_WIDTH 32
#define ANIM_FROG_HEIGHT 48
Expand All @@ -569,10 +571,18 @@
#define ANIM_BUZZER_WIDTH 48
#define ANIM_BUZZER_HEIGHT 32

// 1176
#define ANIM_BUZZER_PROJ_WIDTH 16
#define ANIM_BUZZER_PROJ_HEIGHT 16

// 1178
#define ANIM_TAKKON_WIDTH 32
#define ANIM_TAKKON_HEIGHT 48

// 1177
#define ANIM_JOUSUN_WIDTH 40
#define ANIM_JOUSUN_HEIGHT 32

// 1180
#define ANIM_TAKKON_PROJ_WIDTH 24
#define ANIM_TAKKON_PROJ_HEIGHT 24
Expand Down
Loading

0 comments on commit 3f24147

Please sign in to comment.