mirror of https://github.com/zeldaret/tmc.git
decompile doorMimic
This commit is contained in:
parent
9ad81a51d3
commit
6b8692d14f
343
asm/doorMimic.s
343
asm/doorMimic.s
|
@ -1,343 +0,0 @@
|
||||||
.include "asm/macros.inc"
|
|
||||||
|
|
||||||
.include "constants/constants.inc"
|
|
||||||
|
|
||||||
.syntax unified
|
|
||||||
|
|
||||||
.text
|
|
||||||
|
|
||||||
|
|
||||||
thumb_func_start DoorMimic
|
|
||||||
DoorMimic: @ 0x08021FA8
|
|
||||||
push {r4, r5, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
ldr r5, _08021FD4 @ =gUnk_080CB734
|
|
||||||
bl GetNextFunction
|
|
||||||
lsls r0, r0, #2
|
|
||||||
adds r0, r0, r5
|
|
||||||
ldr r1, [r0]
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl _call_via_r1
|
|
||||||
ldr r1, _08021FD8 @ =gUnk_080CB8A4
|
|
||||||
ldrb r0, [r4, #0xb]
|
|
||||||
lsls r0, r0, #2
|
|
||||||
adds r0, r0, r1
|
|
||||||
ldrb r1, [r4, #0x1e]
|
|
||||||
ldr r0, [r0]
|
|
||||||
lsls r1, r1, #2
|
|
||||||
adds r1, r1, r0
|
|
||||||
ldr r0, [r1]
|
|
||||||
str r0, [r4, #0x48]
|
|
||||||
pop {r4, r5, pc}
|
|
||||||
.align 2, 0
|
|
||||||
_08021FD4: .4byte gUnk_080CB734
|
|
||||||
_08021FD8: .4byte gUnk_080CB8A4
|
|
||||||
|
|
||||||
thumb_func_start sub_08021FDC
|
|
||||||
sub_08021FDC: @ 0x08021FDC
|
|
||||||
push {lr}
|
|
||||||
ldr r2, _08021FF0 @ =gUnk_080CB74C
|
|
||||||
ldrb r1, [r0, #0xc]
|
|
||||||
lsls r1, r1, #2
|
|
||||||
adds r1, r1, r2
|
|
||||||
ldr r1, [r1]
|
|
||||||
bl _call_via_r1
|
|
||||||
pop {pc}
|
|
||||||
.align 2, 0
|
|
||||||
_08021FF0: .4byte gUnk_080CB74C
|
|
||||||
|
|
||||||
thumb_func_start sub_08021FF4
|
|
||||||
sub_08021FF4: @ 0x08021FF4
|
|
||||||
push {lr}
|
|
||||||
ldr r1, _08022000 @ =gUnk_080CB734
|
|
||||||
bl sub_0804AA30
|
|
||||||
pop {pc}
|
|
||||||
.align 2, 0
|
|
||||||
_08022000: .4byte gUnk_080CB734
|
|
||||||
|
|
||||||
thumb_func_start sub_08022004
|
|
||||||
sub_08022004: @ 0x08022004
|
|
||||||
push {r4, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
adds r0, #0x7c
|
|
||||||
ldrh r0, [r0]
|
|
||||||
adds r1, r4, #0
|
|
||||||
adds r1, #0x7e
|
|
||||||
ldrh r1, [r1]
|
|
||||||
adds r2, r4, #0
|
|
||||||
adds r2, #0x38
|
|
||||||
ldrb r2, [r2]
|
|
||||||
bl SetTile
|
|
||||||
adds r0, r4, #0
|
|
||||||
movs r1, #5
|
|
||||||
movs r2, #0
|
|
||||||
bl CreateFx
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_08049CF4
|
|
||||||
bl DeleteThisEntity
|
|
||||||
pop {r4, pc}
|
|
||||||
.align 2, 0
|
|
||||||
|
|
||||||
thumb_func_start sub_08022034
|
|
||||||
sub_08022034: @ 0x08022034
|
|
||||||
push {r4, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
movs r0, #1
|
|
||||||
strb r0, [r4, #0xc]
|
|
||||||
ldrb r1, [r4, #0xa]
|
|
||||||
movs r0, #3
|
|
||||||
ands r0, r1
|
|
||||||
strb r0, [r4, #0xb]
|
|
||||||
adds r2, r4, #0
|
|
||||||
adds r2, #0x29
|
|
||||||
ldrb r1, [r2]
|
|
||||||
movs r0, #8
|
|
||||||
rsbs r0, r0, #0
|
|
||||||
ands r0, r1
|
|
||||||
movs r1, #5
|
|
||||||
orrs r0, r1
|
|
||||||
strb r0, [r2]
|
|
||||||
ldr r2, _08022098 @ =gUnk_080CB764
|
|
||||||
ldrb r0, [r4, #0xb]
|
|
||||||
lsls r0, r0, #1
|
|
||||||
adds r0, r0, r2
|
|
||||||
ldrb r0, [r0]
|
|
||||||
lsls r0, r0, #0x18
|
|
||||||
asrs r0, r0, #0x18
|
|
||||||
ldrh r1, [r4, #0x2e]
|
|
||||||
adds r0, r0, r1
|
|
||||||
adds r1, r4, #0
|
|
||||||
adds r1, #0x78
|
|
||||||
strh r0, [r1]
|
|
||||||
ldrb r0, [r4, #0xb]
|
|
||||||
lsls r0, r0, #1
|
|
||||||
adds r0, #1
|
|
||||||
adds r0, r0, r2
|
|
||||||
ldrb r0, [r0]
|
|
||||||
lsls r0, r0, #0x18
|
|
||||||
asrs r0, r0, #0x18
|
|
||||||
ldrh r1, [r4, #0x32]
|
|
||||||
adds r0, r0, r1
|
|
||||||
adds r1, r4, #0
|
|
||||||
adds r1, #0x7a
|
|
||||||
strh r0, [r1]
|
|
||||||
ldrb r1, [r4, #0xb]
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl InitializeAnimation
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_080221C0
|
|
||||||
pop {r4, pc}
|
|
||||||
.align 2, 0
|
|
||||||
_08022098: .4byte gUnk_080CB764
|
|
||||||
|
|
||||||
thumb_func_start sub_0802209C
|
|
||||||
sub_0802209C: @ 0x0802209C
|
|
||||||
push {r4, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
ldrb r0, [r4, #0xe]
|
|
||||||
cmp r0, #0
|
|
||||||
bne _080220D2
|
|
||||||
adds r0, r4, #0
|
|
||||||
adds r0, #0x78
|
|
||||||
ldrh r0, [r0]
|
|
||||||
adds r1, r4, #0
|
|
||||||
adds r1, #0x7a
|
|
||||||
ldrh r1, [r1]
|
|
||||||
movs r2, #0x10
|
|
||||||
movs r3, #0x10
|
|
||||||
bl sub_0806FBFC
|
|
||||||
cmp r0, #0
|
|
||||||
beq _080220D6
|
|
||||||
movs r0, #2
|
|
||||||
strb r0, [r4, #0xc]
|
|
||||||
movs r0, #0x12
|
|
||||||
strb r0, [r4, #0xe]
|
|
||||||
ldrb r1, [r4, #0xb]
|
|
||||||
adds r1, #4
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl InitializeAnimation
|
|
||||||
b _080220D6
|
|
||||||
_080220D2:
|
|
||||||
subs r0, #1
|
|
||||||
strb r0, [r4, #0xe]
|
|
||||||
_080220D6:
|
|
||||||
pop {r4, pc}
|
|
||||||
|
|
||||||
thumb_func_start sub_080220D8
|
|
||||||
sub_080220D8: @ 0x080220D8
|
|
||||||
push {lr}
|
|
||||||
adds r1, r0, #0
|
|
||||||
ldrb r0, [r1, #0xe]
|
|
||||||
subs r0, #1
|
|
||||||
strb r0, [r1, #0xe]
|
|
||||||
lsls r0, r0, #0x18
|
|
||||||
cmp r0, #0
|
|
||||||
bne _080220EC
|
|
||||||
movs r0, #3
|
|
||||||
strb r0, [r1, #0xc]
|
|
||||||
_080220EC:
|
|
||||||
pop {pc}
|
|
||||||
.align 2, 0
|
|
||||||
|
|
||||||
thumb_func_start sub_080220F0
|
|
||||||
sub_080220F0: @ 0x080220F0
|
|
||||||
push {r4, r5, r6, lr}
|
|
||||||
adds r5, r0, #0
|
|
||||||
bl GetNextFrame
|
|
||||||
adds r0, r5, #0
|
|
||||||
adds r0, #0x5a
|
|
||||||
ldrb r1, [r0]
|
|
||||||
movs r0, #0x80
|
|
||||||
ands r0, r1
|
|
||||||
cmp r0, #0
|
|
||||||
beq _08022160
|
|
||||||
movs r1, #0
|
|
||||||
movs r0, #4
|
|
||||||
strb r0, [r5, #0xc]
|
|
||||||
movs r0, #0x78
|
|
||||||
strb r0, [r5, #0xe]
|
|
||||||
adds r0, r5, #0
|
|
||||||
adds r0, #0x44
|
|
||||||
strb r1, [r0]
|
|
||||||
ldrb r1, [r5, #0xb]
|
|
||||||
lsls r0, r1, #1
|
|
||||||
adds r0, r0, r1
|
|
||||||
lsls r0, r0, #2
|
|
||||||
ldr r1, _0802215C @ =gUnk_080CB76C
|
|
||||||
adds r4, r0, r1
|
|
||||||
movs r6, #0
|
|
||||||
_08022124:
|
|
||||||
adds r0, r5, #0
|
|
||||||
movs r1, #0x11
|
|
||||||
movs r2, #0
|
|
||||||
bl CreateFx
|
|
||||||
adds r1, r0, #0
|
|
||||||
cmp r1, #0
|
|
||||||
beq _08022148
|
|
||||||
movs r0, #0
|
|
||||||
ldrsb r0, [r4, r0]
|
|
||||||
ldrh r2, [r1, #0x2e]
|
|
||||||
adds r0, r0, r2
|
|
||||||
strh r0, [r1, #0x2e]
|
|
||||||
movs r0, #1
|
|
||||||
ldrsb r0, [r4, r0]
|
|
||||||
ldrh r2, [r1, #0x32]
|
|
||||||
adds r0, r0, r2
|
|
||||||
strh r0, [r1, #0x32]
|
|
||||||
_08022148:
|
|
||||||
adds r6, #1
|
|
||||||
adds r4, #2
|
|
||||||
cmp r6, #5
|
|
||||||
bls _08022124
|
|
||||||
movs r0, #0x82
|
|
||||||
lsls r0, r0, #1
|
|
||||||
bl sub_08004488
|
|
||||||
b _08022170
|
|
||||||
.align 2, 0
|
|
||||||
_0802215C: .4byte gUnk_080CB76C
|
|
||||||
_08022160:
|
|
||||||
movs r0, #1
|
|
||||||
ands r0, r1
|
|
||||||
cmp r0, #0
|
|
||||||
beq _08022170
|
|
||||||
adds r1, r5, #0
|
|
||||||
adds r1, #0x44
|
|
||||||
movs r0, #4
|
|
||||||
strb r0, [r1]
|
|
||||||
_08022170:
|
|
||||||
pop {r4, r5, r6, pc}
|
|
||||||
.align 2, 0
|
|
||||||
|
|
||||||
thumb_func_start sub_08022174
|
|
||||||
sub_08022174: @ 0x08022174
|
|
||||||
push {r4, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
bl sub_0800445C
|
|
||||||
ldrb r0, [r4, #0xe]
|
|
||||||
subs r0, #1
|
|
||||||
strb r0, [r4, #0xe]
|
|
||||||
lsls r0, r0, #0x18
|
|
||||||
cmp r0, #0
|
|
||||||
bne _08022196
|
|
||||||
movs r0, #5
|
|
||||||
strb r0, [r4, #0xc]
|
|
||||||
ldrb r1, [r4, #0xb]
|
|
||||||
adds r1, #8
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl InitializeAnimation
|
|
||||||
_08022196:
|
|
||||||
pop {r4, pc}
|
|
||||||
|
|
||||||
thumb_func_start sub_08022198
|
|
||||||
sub_08022198: @ 0x08022198
|
|
||||||
push {r4, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
bl sub_0800445C
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl GetNextFrame
|
|
||||||
adds r0, r4, #0
|
|
||||||
adds r0, #0x5a
|
|
||||||
ldrb r1, [r0]
|
|
||||||
movs r0, #0x80
|
|
||||||
ands r0, r1
|
|
||||||
cmp r0, #0
|
|
||||||
beq _080221BC
|
|
||||||
movs r0, #1
|
|
||||||
strb r0, [r4, #0xc]
|
|
||||||
movs r0, #0x5a
|
|
||||||
strb r0, [r4, #0xe]
|
|
||||||
_080221BC:
|
|
||||||
pop {r4, pc}
|
|
||||||
.align 2, 0
|
|
||||||
|
|
||||||
thumb_func_start sub_080221C0
|
|
||||||
sub_080221C0: @ 0x080221C0
|
|
||||||
push {r4, r5, r6, lr}
|
|
||||||
adds r6, r0, #0
|
|
||||||
movs r0, #0x2e
|
|
||||||
ldrsh r4, [r6, r0]
|
|
||||||
ldr r1, _08022220 @ =gRoomControls
|
|
||||||
ldrh r0, [r1, #6]
|
|
||||||
subs r4, r4, r0
|
|
||||||
asrs r4, r4, #4
|
|
||||||
movs r2, #0x3f
|
|
||||||
ands r4, r2
|
|
||||||
movs r3, #0x32
|
|
||||||
ldrsh r0, [r6, r3]
|
|
||||||
ldrh r1, [r1, #8]
|
|
||||||
subs r0, r0, r1
|
|
||||||
asrs r0, r0, #4
|
|
||||||
ands r0, r2
|
|
||||||
lsls r0, r0, #6
|
|
||||||
orrs r4, r0
|
|
||||||
ldr r1, _08022224 @ =gUnk_080B4488
|
|
||||||
ldrb r0, [r6, #0xb]
|
|
||||||
lsls r0, r0, #1
|
|
||||||
adds r0, r0, r1
|
|
||||||
movs r1, #0
|
|
||||||
ldrsh r0, [r0, r1]
|
|
||||||
adds r4, r4, r0
|
|
||||||
adds r0, r6, #0
|
|
||||||
adds r0, #0x7e
|
|
||||||
strh r4, [r0]
|
|
||||||
adds r5, r6, #0
|
|
||||||
adds r5, #0x38
|
|
||||||
ldrb r1, [r5]
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_080001DA
|
|
||||||
adds r1, r6, #0
|
|
||||||
adds r1, #0x7c
|
|
||||||
strh r0, [r1]
|
|
||||||
ldr r1, _08022228 @ =gUnk_080CB79C
|
|
||||||
ldrb r0, [r6, #0xb]
|
|
||||||
lsls r0, r0, #1
|
|
||||||
adds r0, r0, r1
|
|
||||||
ldrh r0, [r0]
|
|
||||||
ldrb r2, [r5]
|
|
||||||
adds r1, r4, #0
|
|
||||||
bl SetTile
|
|
||||||
pop {r4, r5, r6, pc}
|
|
||||||
.align 2, 0
|
|
||||||
_08022220: .4byte gRoomControls
|
|
||||||
_08022224: .4byte gUnk_080B4488
|
|
||||||
_08022228: .4byte gUnk_080CB79C
|
|
|
@ -3,111 +3,6 @@
|
||||||
|
|
||||||
.section .rodata
|
.section .rodata
|
||||||
|
|
||||||
gUnk_080CB734:: @ 080CB734
|
|
||||||
.incbin "baserom.gba", 0x0CB734, 0x0000018
|
|
||||||
|
|
||||||
gUnk_080CB74C:: @ 080CB74C
|
|
||||||
.incbin "baserom.gba", 0x0CB74C, 0x0000018
|
|
||||||
|
|
||||||
gUnk_080CB764:: @ 080CB764
|
|
||||||
.incbin "baserom.gba", 0x0CB764, 0x0000008
|
|
||||||
|
|
||||||
gUnk_080CB76C:: @ 080CB76C
|
|
||||||
.incbin "baserom.gba", 0x0CB76C, 0x0000030
|
|
||||||
|
|
||||||
gUnk_080CB79C:: @ 080CB79C
|
|
||||||
.incbin "baserom.gba", 0x0CB79C, 0x0000008
|
|
||||||
|
|
||||||
gUnk_080CB7A4:: @ 080CB7A4
|
|
||||||
.incbin "baserom.gba", 0x0CB7A4, 0x0000008
|
|
||||||
|
|
||||||
gUnk_080CB7AC:: @ 080CB7AC
|
|
||||||
.incbin "baserom.gba", 0x0CB7AC, 0x0000008
|
|
||||||
|
|
||||||
gUnk_080CB7B4:: @ 080CB7B4
|
|
||||||
.incbin "baserom.gba", 0x0CB7B4, 0x0000008
|
|
||||||
|
|
||||||
gUnk_080CB7BC:: @ 080CB7BC
|
|
||||||
.incbin "baserom.gba", 0x0CB7BC, 0x0000008
|
|
||||||
|
|
||||||
gUnk_080CB7C4:: @ 080CB7C4
|
|
||||||
.incbin "baserom.gba", 0x0CB7C4, 0x0000008
|
|
||||||
|
|
||||||
gUnk_080CB7CC:: @ 080CB7CC
|
|
||||||
.incbin "baserom.gba", 0x0CB7CC, 0x0000008
|
|
||||||
|
|
||||||
gUnk_080CB7D4:: @ 080CB7D4
|
|
||||||
.incbin "baserom.gba", 0x0CB7D4, 0x0000008
|
|
||||||
|
|
||||||
gUnk_080CB7DC:: @ 080CB7DC
|
|
||||||
.incbin "baserom.gba", 0x0CB7DC, 0x0000008
|
|
||||||
|
|
||||||
gUnk_080CB7E4:: @ 080CB7E4
|
|
||||||
.incbin "baserom.gba", 0x0CB7E4, 0x0000008
|
|
||||||
|
|
||||||
gUnk_080CB7EC:: @ 080CB7EC
|
|
||||||
.incbin "baserom.gba", 0x0CB7EC, 0x0000008
|
|
||||||
|
|
||||||
gUnk_080CB7F4:: @ 080CB7F4
|
|
||||||
.incbin "baserom.gba", 0x0CB7F4, 0x0000030
|
|
||||||
|
|
||||||
gUnk_080CB824:: @ 080CB824
|
|
||||||
.incbin "baserom.gba", 0x0CB824, 0x0000008
|
|
||||||
|
|
||||||
gUnk_080CB82C:: @ 080CB82C
|
|
||||||
.incbin "baserom.gba", 0x0CB82C, 0x0000008
|
|
||||||
|
|
||||||
gUnk_080CB834:: @ 080CB834
|
|
||||||
.incbin "baserom.gba", 0x0CB834, 0x0000008
|
|
||||||
|
|
||||||
gUnk_080CB83C:: @ 080CB83C
|
|
||||||
.incbin "baserom.gba", 0x0CB83C, 0x0000008
|
|
||||||
|
|
||||||
gUnk_080CB844:: @ 080CB844
|
|
||||||
.incbin "baserom.gba", 0x0CB844, 0x0000008
|
|
||||||
|
|
||||||
gUnk_080CB84C:: @ 080CB84C
|
|
||||||
.incbin "baserom.gba", 0x0CB84C, 0x0000008
|
|
||||||
|
|
||||||
gUnk_080CB854:: @ 080CB854
|
|
||||||
.incbin "baserom.gba", 0x0CB854, 0x0000008
|
|
||||||
|
|
||||||
gUnk_080CB85C:: @ 080CB85C
|
|
||||||
.incbin "baserom.gba", 0x0CB85C, 0x0000008
|
|
||||||
|
|
||||||
gUnk_080CB864:: @ 080CB864
|
|
||||||
.incbin "baserom.gba", 0x0CB864, 0x0000008
|
|
||||||
|
|
||||||
gUnk_080CB86C:: @ 080CB86C
|
|
||||||
.incbin "baserom.gba", 0x0CB86C, 0x0000008
|
|
||||||
|
|
||||||
gUnk_080CB874:: @ 080CB874
|
|
||||||
.incbin "baserom.gba", 0x0CB874, 0x0000030
|
|
||||||
|
|
||||||
gUnk_080CB8A4:: @ 080CB8A4
|
|
||||||
.incbin "baserom.gba", 0x0CB8A4, 0x0000010
|
|
||||||
|
|
||||||
gUnk_080CB8B4:: @ 080CB8B4
|
|
||||||
.incbin "baserom.gba", 0x0CB8B4, 0x0000005
|
|
||||||
|
|
||||||
gUnk_080CB8B9:: @ 080CB8B9
|
|
||||||
.incbin "baserom.gba", 0x0CB8B9, 0x0000005
|
|
||||||
|
|
||||||
gUnk_080CB8BE:: @ 080CB8BE
|
|
||||||
.incbin "baserom.gba", 0x0CB8BE, 0x0000019
|
|
||||||
|
|
||||||
gUnk_080CB8D7:: @ 080CB8D7
|
|
||||||
.incbin "baserom.gba", 0x0CB8D7, 0x0000019
|
|
||||||
|
|
||||||
gUnk_080CB8F0:: @ 080CB8F0
|
|
||||||
.incbin "baserom.gba", 0x0CB8F0, 0x0000011
|
|
||||||
|
|
||||||
gUnk_080CB901:: @ 080CB901
|
|
||||||
.incbin "baserom.gba", 0x0CB901, 0x0000013
|
|
||||||
|
|
||||||
gUnk_080CB914:: @ 080CB914
|
|
||||||
.incbin "baserom.gba", 0x0CB914, 0x0000034
|
|
||||||
|
|
||||||
gUnk_080CB948:: @ 080CB948
|
gUnk_080CB948:: @ 080CB948
|
||||||
.incbin "baserom.gba", 0x0CB948, 0x0000018
|
.incbin "baserom.gba", 0x0CB948, 0x0000018
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
.include "asm/macros.inc"
|
||||||
|
.include "constants/constants.inc"
|
||||||
|
|
||||||
|
.section .rodata
|
||||||
|
|
||||||
|
gUnk_080CB8B4:: @ 080CB8B4
|
||||||
|
.incbin "baserom.gba", 0x0CB8B4, 0x0000005
|
||||||
|
|
||||||
|
gUnk_080CB8B9:: @ 080CB8B9
|
||||||
|
.incbin "baserom.gba", 0x0CB8B9, 0x0000005
|
||||||
|
|
||||||
|
gUnk_080CB8BE:: @ 080CB8BE
|
||||||
|
.incbin "baserom.gba", 0x0CB8BE, 0x0000019
|
||||||
|
|
||||||
|
gUnk_080CB8D7:: @ 080CB8D7
|
||||||
|
.incbin "baserom.gba", 0x0CB8D7, 0x0000019
|
||||||
|
|
||||||
|
gUnk_080CB8F0:: @ 080CB8F0
|
||||||
|
.incbin "baserom.gba", 0x0CB8F0, 0x0000011
|
||||||
|
|
||||||
|
gUnk_080CB901:: @ 080CB901
|
||||||
|
.incbin "baserom.gba", 0x0CB901, 0x0000013
|
||||||
|
|
||||||
|
gUnk_080CB914:: @ 080CB914
|
||||||
|
.incbin "baserom.gba", 0x0CB914, 0x0000034
|
|
@ -19,10 +19,7 @@ typedef struct {
|
||||||
} EntityType;
|
} EntityType;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
u8 unknown[6];
|
u8 unknown[8];
|
||||||
u8 field_0x6;
|
|
||||||
u8 field_0x7;
|
|
||||||
u8 unknown2[4];
|
|
||||||
} BoundingBox;
|
} BoundingBox;
|
||||||
|
|
||||||
typedef struct Entity {
|
typedef struct Entity {
|
||||||
|
|
|
@ -334,7 +334,7 @@ SECTIONS {
|
||||||
src/enemy/hangingSeed.o(.text);
|
src/enemy/hangingSeed.o(.text);
|
||||||
src/enemy/beetle.o(.text);
|
src/enemy/beetle.o(.text);
|
||||||
src/enemy/keese.o(.text);
|
src/enemy/keese.o(.text);
|
||||||
asm/doorMimic.o(.text);
|
src/enemy/doorMimic.o(.text);
|
||||||
asm/rockChuchu.o(.text);
|
asm/rockChuchu.o(.text);
|
||||||
asm/spinyChuchu.o(.text);
|
asm/spinyChuchu.o(.text);
|
||||||
asm/cuccoChickAggr.o(.text);
|
asm/cuccoChickAggr.o(.text);
|
||||||
|
@ -922,6 +922,8 @@ SECTIONS {
|
||||||
data/beetleAnimations.o(.rodata);
|
data/beetleAnimations.o(.rodata);
|
||||||
src/enemy/keese.o(.rodata);
|
src/enemy/keese.o(.rodata);
|
||||||
data/keeseAnimations.o(.rodata);
|
data/keeseAnimations.o(.rodata);
|
||||||
|
src/enemy/doorMimic.o(.rodata);
|
||||||
|
data/doorMimicAnimations.o(.rodata);
|
||||||
data/data_080CB734.o(.rodata);
|
data/data_080CB734.o(.rodata);
|
||||||
src/enemy.o(.rodata);
|
src/enemy.o(.rodata);
|
||||||
data/data_080D3D94.o(.rodata);
|
data/data_080D3D94.o(.rodata);
|
||||||
|
|
|
@ -0,0 +1,271 @@
|
||||||
|
#include "enemy.h"
|
||||||
|
#include "entity.h"
|
||||||
|
#include "functions.h"
|
||||||
|
|
||||||
|
extern s16 sub_080001DA(u32, u32); // ?
|
||||||
|
extern void sub_08049CF4();
|
||||||
|
extern u32 sub_0806FBFC(u32, u32, u32, u32);
|
||||||
|
void sub_080221C0();
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
s8 h;
|
||||||
|
s8 v;
|
||||||
|
} PACKED PosOffset;
|
||||||
|
|
||||||
|
extern void (*const gUnk_080CB734[])(Entity*);
|
||||||
|
extern void (*const gUnk_080CB74C[])(Entity*);
|
||||||
|
|
||||||
|
#if NON_MATCHING
|
||||||
|
extern const PosOffset gUnk_080CB764[];
|
||||||
|
#else
|
||||||
|
extern const s8 gUnk_080CB764[];
|
||||||
|
#endif
|
||||||
|
extern const PosOffset gUnk_080CB76C[4][6];
|
||||||
|
extern const u16 gUnk_080CB79C[];
|
||||||
|
extern const BoundingBox* const* const gUnk_080CB8A4[];
|
||||||
|
|
||||||
|
extern s16 gUnk_080B4488[];
|
||||||
|
|
||||||
|
void DoorMimic(Entity* this) {
|
||||||
|
gUnk_080CB734[GetNextFunction(this)](this);
|
||||||
|
this->boundingBox = (BoundingBox*)gUnk_080CB8A4[this->entityType.parameter][this->frameIndex];
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08021FDC(Entity* this) {
|
||||||
|
gUnk_080CB74C[this->action](this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08021FF4(Entity* this) {
|
||||||
|
sub_0804AA30(this, gUnk_080CB734);
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08022004(Entity* this) {
|
||||||
|
SetTile((u16)this->field_0x7c.HALF.LO, (u16)this->field_0x7c.HALF.HI, this->collisionLayer);
|
||||||
|
CreateFx(this, 5, 0);
|
||||||
|
sub_08049CF4(this);
|
||||||
|
DeleteThisEntity();
|
||||||
|
}
|
||||||
|
|
||||||
|
#if NON_MATCHING
|
||||||
|
void sub_08022034(Entity* this) {
|
||||||
|
this->action = 1;
|
||||||
|
this->entityType.parameter = this->entityType.form & 3;
|
||||||
|
this->spritePriority.b0 = 5;
|
||||||
|
this->field_0x78.HWORD = gUnk_080CB764[this->entityType.parameter].h + this->x.HALF.HI;
|
||||||
|
this->field_0x7a.HWORD = gUnk_080CB764[this->entityType.parameter].v + this->y.HALF.HI;
|
||||||
|
InitializeAnimation(this, this->entityType.parameter);
|
||||||
|
sub_080221C0(this);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
void sub_08022034(Entity* this) {
|
||||||
|
this->action = 1;
|
||||||
|
this->entityType.parameter = this->entityType.form & 3;
|
||||||
|
this->spritePriority.b0 = 5;
|
||||||
|
this->field_0x78.HWORD = gUnk_080CB764[this->entityType.parameter * 2] + this->x.HALF.HI;
|
||||||
|
this->field_0x7a.HWORD = gUnk_080CB764[this->entityType.parameter * 2 + 1] + this->y.HALF.HI;
|
||||||
|
InitializeAnimation(this, this->entityType.parameter);
|
||||||
|
sub_080221C0(this);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void sub_0802209C(Entity* this) {
|
||||||
|
if (this->actionDelay == 0) {
|
||||||
|
if (sub_0806FBFC(this->field_0x78.HWORD, this->field_0x7a.HWORD, 0x10, 0x10)) {
|
||||||
|
this->action = 2;
|
||||||
|
this->actionDelay = 0x12;
|
||||||
|
InitializeAnimation(this, this->entityType.parameter + 4);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this->actionDelay = this->actionDelay - 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_080220D8(Entity* this) {
|
||||||
|
if (--this->actionDelay == 0)
|
||||||
|
this->action = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_080220F0(Entity* this) {
|
||||||
|
GetNextFrame(this);
|
||||||
|
if (this->frames.all & 0x80) {
|
||||||
|
const PosOffset* off;
|
||||||
|
u32 i;
|
||||||
|
|
||||||
|
this->action = 4;
|
||||||
|
this->actionDelay = 0x78;
|
||||||
|
this->field_0x44 = 0;
|
||||||
|
off = gUnk_080CB76C[this->entityType.parameter];
|
||||||
|
for (i = 0; i < 6; i++, off++) {
|
||||||
|
Entity* fx = CreateFx(this, 0x11, 0);
|
||||||
|
if (fx) {
|
||||||
|
fx->x.HALF.HI += off->h;
|
||||||
|
fx->y.HALF.HI += off->v;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sub_08004488(260);
|
||||||
|
} else if (this->frames.all & 1) {
|
||||||
|
this->field_0x44 = 4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08022174(Entity* this) {
|
||||||
|
sub_0800445C(this);
|
||||||
|
if (--this->actionDelay == 0) {
|
||||||
|
this->action = 5;
|
||||||
|
InitializeAnimation(this, this->entityType.parameter + 8);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08022198(Entity* this) {
|
||||||
|
sub_0800445C(this);
|
||||||
|
GetNextFrame(this);
|
||||||
|
if (this->frames.all & 0x80) {
|
||||||
|
this->action = 1;
|
||||||
|
this->actionDelay = 0x5a;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_080221C0(Entity* this) {
|
||||||
|
u32 tile = COORD_TO_TILE(this) + gUnk_080B4488[this->entityType.parameter];
|
||||||
|
this->field_0x7c.HALF.HI = tile;
|
||||||
|
this->field_0x7c.HALF.LO = sub_080001DA(tile, this->collisionLayer);
|
||||||
|
SetTile(gUnk_080CB79C[this->entityType.parameter], tile, this->collisionLayer);
|
||||||
|
}
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
|
void (*const gUnk_080CB734[])(Entity*) = {
|
||||||
|
sub_08021FDC,
|
||||||
|
sub_08021FF4,
|
||||||
|
sub_08001324,
|
||||||
|
sub_08022004,
|
||||||
|
sub_08001242,
|
||||||
|
sub_08021FDC,
|
||||||
|
};
|
||||||
|
|
||||||
|
void (*const gUnk_080CB74C[])(Entity*) = {
|
||||||
|
sub_08022034,
|
||||||
|
sub_0802209C,
|
||||||
|
sub_080220D8,
|
||||||
|
sub_080220F0,
|
||||||
|
sub_08022174,
|
||||||
|
sub_08022198,
|
||||||
|
};
|
||||||
|
|
||||||
|
#if NON_MATCHING
|
||||||
|
const PosOffset gUnk_080CB764[] = {
|
||||||
|
{-0x08, 0x00},
|
||||||
|
{-0x10, -0x08},
|
||||||
|
{-0x08, -0x10},
|
||||||
|
{ 0x00, -0x08},
|
||||||
|
};
|
||||||
|
#else
|
||||||
|
const s8 gUnk_080CB764[] = {
|
||||||
|
-0x08, 0x00,
|
||||||
|
-0x10, -0x08,
|
||||||
|
-0x08, -0x10,
|
||||||
|
0x00, -0x08,
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
const PosOffset gUnk_080CB76C[][6] = {
|
||||||
|
{
|
||||||
|
{-0x04, 0x1a},
|
||||||
|
{ 0x04, 0x1a},
|
||||||
|
{-0x0c, 0x10},
|
||||||
|
{ 0x0c, 0x10},
|
||||||
|
{-0x0c, 0x08},
|
||||||
|
{ 0x0c, 0x08},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
{-0x1a, -0x04},
|
||||||
|
{-0x1a, 0x04},
|
||||||
|
{-0x10, -0x0c},
|
||||||
|
{-0x10, 0x0c},
|
||||||
|
{-0x08, -0x0c},
|
||||||
|
{-0x08, 0x0c},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
{-0x04, -0x1a},
|
||||||
|
{ 0x04, -0x1a},
|
||||||
|
{-0x0c, -0x10},
|
||||||
|
{ 0x0c, -0x10},
|
||||||
|
{-0x0c, -0x08},
|
||||||
|
{ 0x0c, -0x08},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
{ 0x1a, -0x04},
|
||||||
|
{ 0x1a, 0x04},
|
||||||
|
{ 0x10, -0x0c},
|
||||||
|
{ 0x10, 0x0c},
|
||||||
|
{ 0x08, -0x0c},
|
||||||
|
{ 0x08, 0x0c},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
const u16 gUnk_080CB79C[] = {
|
||||||
|
0x4023,
|
||||||
|
0x4025,
|
||||||
|
0x4026,
|
||||||
|
0x4024,
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
const BoundingBox gUnk_080CB7A4 = { 0x00, 0xf7, 0x00, 0x00, 0x00, 0x00, 0x08, 0x06 };
|
||||||
|
const BoundingBox gUnk_080CB7AC = { 0x00, 0xfb, 0x00, 0x00, 0x00, 0x00, 0x06, 0x04 };
|
||||||
|
const BoundingBox gUnk_080CB7B4 = { 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x06, 0x04 };
|
||||||
|
const BoundingBox gUnk_080CB7BC = { 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x06, 0x08 };
|
||||||
|
const BoundingBox gUnk_080CB7C4 = { 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x08, 0x0c };
|
||||||
|
const BoundingBox gUnk_080CB7CC = { 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08 };
|
||||||
|
const BoundingBox gUnk_080CB7D4 = { 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x08, 0x04 };
|
||||||
|
const BoundingBox gUnk_080CB7DC = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x04 };
|
||||||
|
const BoundingBox gUnk_080CB7E4 = { 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08 };
|
||||||
|
const BoundingBox gUnk_080CB7EC = { 0x00, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x08, 0x0c };
|
||||||
|
|
||||||
|
const BoundingBox *const gUnk_080CB7F4[] = {
|
||||||
|
&gUnk_080CB7A4,
|
||||||
|
&gUnk_080CB7AC,
|
||||||
|
&gUnk_080CB7B4,
|
||||||
|
&gUnk_080CB7BC,
|
||||||
|
&gUnk_080CB7C4,
|
||||||
|
&gUnk_080CB7C4,
|
||||||
|
&gUnk_080CB7CC,
|
||||||
|
&gUnk_080CB7D4,
|
||||||
|
&gUnk_080CB7DC,
|
||||||
|
&gUnk_080CB7E4,
|
||||||
|
&gUnk_080CB7EC,
|
||||||
|
&gUnk_080CB7EC,
|
||||||
|
};
|
||||||
|
|
||||||
|
const BoundingBox gUnk_080CB824 = { 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08 };
|
||||||
|
const BoundingBox gUnk_080CB82C = { 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x08 };
|
||||||
|
const BoundingBox gUnk_080CB834 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x08 };
|
||||||
|
const BoundingBox gUnk_080CB83C = { 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08 };
|
||||||
|
const BoundingBox gUnk_080CB844 = { 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x08 };
|
||||||
|
const BoundingBox gUnk_080CB84C = { 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08 };
|
||||||
|
const BoundingBox gUnk_080CB854 = { 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x08 };
|
||||||
|
const BoundingBox gUnk_080CB85C = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x08 };
|
||||||
|
const BoundingBox gUnk_080CB864 = { 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08 };
|
||||||
|
const BoundingBox gUnk_080CB86C = { 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x08 };
|
||||||
|
|
||||||
|
const BoundingBox *const gUnk_080CB874[] = {
|
||||||
|
&gUnk_080CB84C,
|
||||||
|
&gUnk_080CB854,
|
||||||
|
&gUnk_080CB85C,
|
||||||
|
&gUnk_080CB864,
|
||||||
|
&gUnk_080CB86C,
|
||||||
|
&gUnk_080CB86C,
|
||||||
|
&gUnk_080CB824,
|
||||||
|
&gUnk_080CB82C,
|
||||||
|
&gUnk_080CB834,
|
||||||
|
&gUnk_080CB83C,
|
||||||
|
&gUnk_080CB844,
|
||||||
|
&gUnk_080CB844,
|
||||||
|
};
|
||||||
|
|
||||||
|
const BoundingBox *const *const gUnk_080CB8A4[] = {
|
||||||
|
gUnk_080CB7F4,
|
||||||
|
gUnk_080CB874,
|
||||||
|
gUnk_080CB7F4,
|
||||||
|
gUnk_080CB874,
|
||||||
|
};
|
||||||
|
// clang-format on
|
|
@ -30,8 +30,8 @@ void MineralWaterSource_Init(Entity *this) {
|
||||||
this->entityType.parameter = unknownParameters->field_0x00;
|
this->entityType.parameter = unknownParameters->field_0x00;
|
||||||
this->field_0x40 = unknownParameters->field_0x03;
|
this->field_0x40 = unknownParameters->field_0x03;
|
||||||
|
|
||||||
this->boundingBox->field_0x6 = unknownParameters->field_0x01;
|
this->boundingBox->unknown[6] = unknownParameters->field_0x01;
|
||||||
this->boundingBox->field_0x7 = unknownParameters->field_0x02;
|
this->boundingBox->unknown[7] = unknownParameters->field_0x02;
|
||||||
|
|
||||||
this->flags |= 0x80;
|
this->flags |= 0x80;
|
||||||
|
|
||||||
|
|
|
@ -243,10 +243,10 @@ void sub_0808F498(Entity* this) {
|
||||||
this->action = 1;
|
this->action = 1;
|
||||||
this->actionDelay = 64;
|
this->actionDelay = 64;
|
||||||
var0 = this->entityType.parameter != 0 ? 44 : 43;
|
var0 = this->entityType.parameter != 0 ? 44 : 43;
|
||||||
this->x.HALF.HI -= this->parent->boundingBox->field_0x6;
|
this->x.HALF.HI -= this->parent->boundingBox->unknown[6];
|
||||||
this->x.HALF.HI += (s32)Random() % (this->parent->boundingBox->field_0x6 * 2);
|
this->x.HALF.HI += (s32)Random() % (this->parent->boundingBox->unknown[6] * 2);
|
||||||
this->y.HALF.HI -= this->parent->boundingBox->field_0x7;
|
this->y.HALF.HI -= this->parent->boundingBox->unknown[7];
|
||||||
this->y.HALF.HI += (s32)Random() % (this->parent->boundingBox->field_0x7 * 2);
|
this->y.HALF.HI += (s32)Random() % (this->parent->boundingBox->unknown[7] * 2);
|
||||||
sub_0801D2B4(this, var0);
|
sub_0801D2B4(this, var0);
|
||||||
InitializeAnimation(this, 4);
|
InitializeAnimation(this, 4);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue