mirror of https://github.com/zeldaret/tmc.git
Merge remote-tracking branch 'upstream/master' into docs
This commit is contained in:
commit
1a6dc8f838
|
@ -1,145 +0,0 @@
|
||||||
.include "asm/macros.inc"
|
|
||||||
|
|
||||||
.include "constants/constants.inc"
|
|
||||||
|
|
||||||
.syntax unified
|
|
||||||
|
|
||||||
.text
|
|
||||||
|
|
||||||
|
|
||||||
thumb_func_start LilypadSmall
|
|
||||||
LilypadSmall: @ 0x08097A5C
|
|
||||||
push {r4, r5, lr}
|
|
||||||
adds r5, r0, #0
|
|
||||||
ldrb r0, [r5, #0xc]
|
|
||||||
cmp r0, #0
|
|
||||||
bne _08097AAC
|
|
||||||
movs r4, #1
|
|
||||||
movs r0, #1
|
|
||||||
strb r0, [r5, #0xc]
|
|
||||||
movs r0, #0x5a
|
|
||||||
strb r0, [r5, #0xe]
|
|
||||||
bl Random
|
|
||||||
strb r0, [r5, #0xf]
|
|
||||||
lsrs r0, r0, #0x10
|
|
||||||
movs r1, #3
|
|
||||||
ands r0, r1
|
|
||||||
strb r0, [r5, #0x1e]
|
|
||||||
ldrb r1, [r5, #0x18]
|
|
||||||
movs r0, #4
|
|
||||||
rsbs r0, r0, #0
|
|
||||||
ands r0, r1
|
|
||||||
orrs r0, r4
|
|
||||||
strb r0, [r5, #0x18]
|
|
||||||
adds r2, r5, #0
|
|
||||||
adds r2, #0x29
|
|
||||||
ldrb r0, [r2]
|
|
||||||
movs r1, #7
|
|
||||||
orrs r0, r1
|
|
||||||
strb r0, [r2]
|
|
||||||
ldrb r0, [r5, #0xb]
|
|
||||||
bl GetCurrentRoomProperty
|
|
||||||
str r0, [r5, #0x54]
|
|
||||||
adds r1, r5, #0
|
|
||||||
adds r1, #0x54
|
|
||||||
adds r2, r5, #0
|
|
||||||
adds r2, #0x70
|
|
||||||
adds r0, r5, #0
|
|
||||||
bl sub_080A2CC0
|
|
||||||
_08097AAC:
|
|
||||||
adds r0, r5, #0
|
|
||||||
bl sub_08097ADC
|
|
||||||
adds r1, r0, #0
|
|
||||||
adds r0, r5, #0
|
|
||||||
bl sub_080A2BE4
|
|
||||||
adds r0, r5, #0
|
|
||||||
bl sub_08097B24
|
|
||||||
adds r2, r5, #0
|
|
||||||
adds r2, #0x70
|
|
||||||
ldrh r0, [r2]
|
|
||||||
subs r0, #1
|
|
||||||
strh r0, [r2]
|
|
||||||
lsls r0, r0, #0x10
|
|
||||||
cmp r0, #0
|
|
||||||
bne _08097ADA
|
|
||||||
adds r1, r5, #0
|
|
||||||
adds r1, #0x54
|
|
||||||
adds r0, r5, #0
|
|
||||||
bl sub_080A2CC0
|
|
||||||
_08097ADA:
|
|
||||||
pop {r4, r5, pc}
|
|
||||||
|
|
||||||
thumb_func_start sub_08097ADC
|
|
||||||
sub_08097ADC: @ 0x08097ADC
|
|
||||||
push {r4, r5, lr}
|
|
||||||
adds r2, r0, #0
|
|
||||||
ldr r5, _08097B18 @ =gPlayerState
|
|
||||||
ldr r0, [r5, #0x30]
|
|
||||||
movs r1, #0x80
|
|
||||||
ands r0, r1
|
|
||||||
cmp r0, #0
|
|
||||||
beq _08097B20
|
|
||||||
ldr r4, _08097B1C @ =gPlayerEntity
|
|
||||||
adds r0, r2, #0
|
|
||||||
adds r1, r4, #0
|
|
||||||
movs r2, #8
|
|
||||||
movs r3, #8
|
|
||||||
bl sub_080041A0
|
|
||||||
cmp r0, #0
|
|
||||||
beq _08097B20
|
|
||||||
bl sub_08079F8C
|
|
||||||
cmp r0, #0
|
|
||||||
beq _08097B20
|
|
||||||
movs r0, #1
|
|
||||||
strb r0, [r5, #0x14]
|
|
||||||
movs r1, #0x36
|
|
||||||
ldrsh r0, [r4, r1]
|
|
||||||
cmp r0, #0
|
|
||||||
bne _08097B20
|
|
||||||
movs r0, #1
|
|
||||||
b _08097B22
|
|
||||||
.align 2, 0
|
|
||||||
_08097B18: .4byte gPlayerState
|
|
||||||
_08097B1C: .4byte gPlayerEntity
|
|
||||||
_08097B20:
|
|
||||||
movs r0, #0
|
|
||||||
_08097B22:
|
|
||||||
pop {r4, r5, pc}
|
|
||||||
|
|
||||||
thumb_func_start sub_08097B24
|
|
||||||
sub_08097B24: @ 0x08097B24
|
|
||||||
push {r4, lr}
|
|
||||||
adds r3, r0, #0
|
|
||||||
ldrb r0, [r3, #0xe]
|
|
||||||
subs r0, #1
|
|
||||||
strb r0, [r3, #0xe]
|
|
||||||
movs r4, #0xff
|
|
||||||
lsls r0, r0, #0x18
|
|
||||||
cmp r0, #0
|
|
||||||
bne _08097B44
|
|
||||||
movs r0, #0x5a
|
|
||||||
strb r0, [r3, #0xe]
|
|
||||||
ldrb r0, [r3, #0x1e]
|
|
||||||
adds r0, #1
|
|
||||||
movs r1, #3
|
|
||||||
ands r0, r1
|
|
||||||
strb r0, [r3, #0x1e]
|
|
||||||
_08097B44:
|
|
||||||
ldr r2, _08097B68 @ =gUnk_08123318
|
|
||||||
ldrb r0, [r3, #0xf]
|
|
||||||
adds r0, #1
|
|
||||||
strb r0, [r3, #0xf]
|
|
||||||
ands r0, r4
|
|
||||||
lsrs r0, r0, #5
|
|
||||||
movs r1, #7
|
|
||||||
ands r0, r1
|
|
||||||
lsls r0, r0, #1
|
|
||||||
adds r0, r0, r2
|
|
||||||
ldrh r2, [r0]
|
|
||||||
adds r0, r3, #0
|
|
||||||
adds r1, r2, #0
|
|
||||||
movs r3, #0
|
|
||||||
bl sub_0805EC9C
|
|
||||||
pop {r4, pc}
|
|
||||||
.align 2, 0
|
|
||||||
_08097B68: .4byte gUnk_08123318
|
|
386
asm/pot.s
386
asm/pot.s
|
@ -1,386 +0,0 @@
|
||||||
.include "asm/macros.inc"
|
|
||||||
|
|
||||||
.include "constants/constants.inc"
|
|
||||||
|
|
||||||
.syntax unified
|
|
||||||
|
|
||||||
.text
|
|
||||||
|
|
||||||
thumb_func_start sub_08082614
|
|
||||||
sub_08082614: @ 0x08082614
|
|
||||||
push {r4, r5, r6, r7, lr}
|
|
||||||
adds r5, r0, #0
|
|
||||||
bl sub_0800445C
|
|
||||||
ldrb r0, [r5, #0xe]
|
|
||||||
subs r0, #1
|
|
||||||
strb r0, [r5, #0xe]
|
|
||||||
lsls r0, r0, #0x18
|
|
||||||
lsrs r0, r0, #0x18
|
|
||||||
cmp r0, #0xff
|
|
||||||
beq _08082638
|
|
||||||
adds r0, r5, #0
|
|
||||||
bl sub_0806F69C
|
|
||||||
adds r0, r5, #0
|
|
||||||
bl sub_08016A6C
|
|
||||||
b _080826DC
|
|
||||||
_08082638:
|
|
||||||
adds r0, r5, #0
|
|
||||||
bl sub_0800442E
|
|
||||||
cmp r0, #0
|
|
||||||
bne _080826DC
|
|
||||||
movs r0, #1
|
|
||||||
strb r0, [r5, #0xc]
|
|
||||||
ldr r0, _080826A4 @ =gPlayerState
|
|
||||||
ldr r0, [r0, #0x30]
|
|
||||||
movs r1, #0x80
|
|
||||||
ands r0, r1
|
|
||||||
cmp r0, #0
|
|
||||||
beq _08082658
|
|
||||||
ldrh r0, [r5, #0x24]
|
|
||||||
lsls r0, r0, #1
|
|
||||||
strh r0, [r5, #0x24]
|
|
||||||
_08082658:
|
|
||||||
movs r1, #0x2e
|
|
||||||
ldrsh r0, [r5, r1]
|
|
||||||
ldr r2, _080826A8 @ =gRoomControls
|
|
||||||
ldrh r1, [r2, #6]
|
|
||||||
subs r0, r0, r1
|
|
||||||
asrs r0, r0, #4
|
|
||||||
movs r3, #0x3f
|
|
||||||
ands r0, r3
|
|
||||||
movs r4, #0x32
|
|
||||||
ldrsh r1, [r5, r4]
|
|
||||||
ldrh r2, [r2, #8]
|
|
||||||
subs r1, r1, r2
|
|
||||||
asrs r1, r1, #4
|
|
||||||
ands r1, r3
|
|
||||||
lsls r1, r1, #6
|
|
||||||
orrs r0, r1
|
|
||||||
adds r4, r5, #0
|
|
||||||
adds r4, #0x38
|
|
||||||
ldrb r1, [r4]
|
|
||||||
bl sub_080001DA
|
|
||||||
adds r1, r5, #0
|
|
||||||
adds r1, #0x70
|
|
||||||
strh r0, [r1]
|
|
||||||
adds r0, r5, #0
|
|
||||||
bl GetTileTypeByEntity
|
|
||||||
adds r6, r4, #0
|
|
||||||
cmp r0, #0x72
|
|
||||||
bhi _080826AC
|
|
||||||
cmp r0, #0x71
|
|
||||||
blo _080826AC
|
|
||||||
adds r0, r5, #0
|
|
||||||
movs r1, #0
|
|
||||||
bl sub_08082850
|
|
||||||
b _080826DC
|
|
||||||
.align 2, 0
|
|
||||||
_080826A4: .4byte gPlayerState
|
|
||||||
_080826A8: .4byte gRoomControls
|
|
||||||
_080826AC:
|
|
||||||
movs r0, #0x80
|
|
||||||
lsls r0, r0, #7
|
|
||||||
movs r7, #0x2e
|
|
||||||
ldrsh r1, [r5, r7]
|
|
||||||
ldr r3, _080826E0 @ =gRoomControls
|
|
||||||
ldrh r2, [r3, #6]
|
|
||||||
subs r1, r1, r2
|
|
||||||
asrs r1, r1, #4
|
|
||||||
movs r4, #0x3f
|
|
||||||
ands r1, r4
|
|
||||||
movs r7, #0x32
|
|
||||||
ldrsh r2, [r5, r7]
|
|
||||||
ldrh r3, [r3, #8]
|
|
||||||
subs r2, r2, r3
|
|
||||||
asrs r2, r2, #4
|
|
||||||
ands r2, r4
|
|
||||||
lsls r2, r2, #6
|
|
||||||
orrs r1, r2
|
|
||||||
ldrb r2, [r6]
|
|
||||||
bl SetTile
|
|
||||||
adds r0, r5, #0
|
|
||||||
bl sub_08078930
|
|
||||||
_080826DC:
|
|
||||||
pop {r4, r5, r6, r7, pc}
|
|
||||||
.align 2, 0
|
|
||||||
_080826E0: .4byte gRoomControls
|
|
||||||
|
|
||||||
thumb_func_start sub_080826E4
|
|
||||||
sub_080826E4: @ 0x080826E4
|
|
||||||
push {lr}
|
|
||||||
ldr r2, _080826F8 @ =gUnk_0811F0C4
|
|
||||||
ldrb r1, [r0, #0xd]
|
|
||||||
lsls r1, r1, #2
|
|
||||||
adds r1, r1, r2
|
|
||||||
ldr r1, [r1]
|
|
||||||
bl _call_via_r1
|
|
||||||
pop {pc}
|
|
||||||
.align 2, 0
|
|
||||||
_080826F8: .4byte gUnk_0811F0C4
|
|
||||||
|
|
||||||
thumb_func_start sub_080826FC
|
|
||||||
sub_080826FC: @ 0x080826FC
|
|
||||||
movs r2, #0
|
|
||||||
movs r1, #1
|
|
||||||
strb r1, [r0, #0xd]
|
|
||||||
movs r1, #0x30
|
|
||||||
strb r1, [r0, #0x1d]
|
|
||||||
strb r2, [r0, #0xe]
|
|
||||||
bx lr
|
|
||||||
.align 2, 0
|
|
||||||
|
|
||||||
thumb_func_start sub_0808270C
|
|
||||||
sub_0808270C: @ 0x0808270C
|
|
||||||
push {r4, r5, r6, lr}
|
|
||||||
adds r5, r0, #0
|
|
||||||
ldr r0, _08082768 @ =gPlayerState
|
|
||||||
ldrb r1, [r0, #0x1c]
|
|
||||||
movs r0, #0xf
|
|
||||||
ands r0, r1
|
|
||||||
cmp r0, #1
|
|
||||||
bne _0808272A
|
|
||||||
adds r0, r5, #0
|
|
||||||
adds r0, #0x41
|
|
||||||
ldrb r1, [r0]
|
|
||||||
movs r0, #0x7f
|
|
||||||
ands r0, r1
|
|
||||||
cmp r0, #0x13
|
|
||||||
beq _08082770
|
|
||||||
_0808272A:
|
|
||||||
adds r1, r5, #0
|
|
||||||
adds r1, #0x62
|
|
||||||
movs r0, #0
|
|
||||||
strb r0, [r1]
|
|
||||||
movs r0, #1
|
|
||||||
strb r0, [r5, #0xc]
|
|
||||||
movs r0, #0x80
|
|
||||||
lsls r0, r0, #7
|
|
||||||
movs r2, #0x2e
|
|
||||||
ldrsh r1, [r5, r2]
|
|
||||||
ldr r3, _0808276C @ =gRoomControls
|
|
||||||
ldrh r2, [r3, #6]
|
|
||||||
subs r1, r1, r2
|
|
||||||
asrs r1, r1, #4
|
|
||||||
movs r4, #0x3f
|
|
||||||
ands r1, r4
|
|
||||||
movs r6, #0x32
|
|
||||||
ldrsh r2, [r5, r6]
|
|
||||||
ldrh r3, [r3, #8]
|
|
||||||
subs r2, r2, r3
|
|
||||||
asrs r2, r2, #4
|
|
||||||
ands r2, r4
|
|
||||||
lsls r2, r2, #6
|
|
||||||
orrs r1, r2
|
|
||||||
adds r2, r5, #0
|
|
||||||
adds r2, #0x38
|
|
||||||
ldrb r2, [r2]
|
|
||||||
bl SetTile
|
|
||||||
b _08082776
|
|
||||||
.align 2, 0
|
|
||||||
_08082768: .4byte gPlayerState
|
|
||||||
_0808276C: .4byte gRoomControls
|
|
||||||
_08082770:
|
|
||||||
adds r0, r5, #0
|
|
||||||
bl sub_0806F4E8
|
|
||||||
_08082776:
|
|
||||||
pop {r4, r5, r6, pc}
|
|
||||||
|
|
||||||
thumb_func_start sub_08082778
|
|
||||||
sub_08082778: @ 0x08082778
|
|
||||||
push {r4, r5, r6, lr}
|
|
||||||
adds r5, r0, #0
|
|
||||||
ldrb r1, [r5, #0xe]
|
|
||||||
cmp r1, #0
|
|
||||||
bne _080827C4
|
|
||||||
movs r0, #1
|
|
||||||
strb r0, [r5, #0xe]
|
|
||||||
adds r0, r5, #0
|
|
||||||
adds r0, #0x62
|
|
||||||
strb r1, [r0]
|
|
||||||
adds r1, r5, #0
|
|
||||||
adds r1, #0x63
|
|
||||||
movs r0, #0xfe
|
|
||||||
strb r0, [r1]
|
|
||||||
adds r0, r5, #0
|
|
||||||
adds r0, #0x70
|
|
||||||
ldrh r0, [r0]
|
|
||||||
movs r2, #0x2e
|
|
||||||
ldrsh r1, [r5, r2]
|
|
||||||
ldr r3, _080827E8 @ =gRoomControls
|
|
||||||
ldrh r2, [r3, #6]
|
|
||||||
subs r1, r1, r2
|
|
||||||
asrs r1, r1, #4
|
|
||||||
movs r4, #0x3f
|
|
||||||
ands r1, r4
|
|
||||||
movs r6, #0x32
|
|
||||||
ldrsh r2, [r5, r6]
|
|
||||||
ldrh r3, [r3, #8]
|
|
||||||
subs r2, r2, r3
|
|
||||||
asrs r2, r2, #4
|
|
||||||
ands r2, r4
|
|
||||||
lsls r2, r2, #6
|
|
||||||
orrs r1, r2
|
|
||||||
adds r2, r5, #0
|
|
||||||
adds r2, #0x38
|
|
||||||
ldrb r2, [r2]
|
|
||||||
bl SetTile
|
|
||||||
_080827C4:
|
|
||||||
ldr r0, _080827EC @ =gPlayerState
|
|
||||||
ldrb r1, [r0, #0x1c]
|
|
||||||
movs r0, #0xf
|
|
||||||
ands r0, r1
|
|
||||||
cmp r0, #1
|
|
||||||
bne _080827DE
|
|
||||||
adds r0, r5, #0
|
|
||||||
adds r0, #0x41
|
|
||||||
ldrb r1, [r0]
|
|
||||||
movs r0, #0x7f
|
|
||||||
ands r0, r1
|
|
||||||
cmp r0, #0x13
|
|
||||||
beq _080827F0
|
|
||||||
_080827DE:
|
|
||||||
adds r0, r5, #0
|
|
||||||
movs r1, #0
|
|
||||||
bl sub_08082850
|
|
||||||
b _080827F6
|
|
||||||
.align 2, 0
|
|
||||||
_080827E8: .4byte gRoomControls
|
|
||||||
_080827EC: .4byte gPlayerState
|
|
||||||
_080827F0:
|
|
||||||
adds r0, r5, #0
|
|
||||||
bl sub_0806F3E4
|
|
||||||
_080827F6:
|
|
||||||
pop {r4, r5, r6, pc}
|
|
||||||
|
|
||||||
thumb_func_start sub_080827F8
|
|
||||||
sub_080827F8: @ 0x080827F8
|
|
||||||
push {lr}
|
|
||||||
adds r1, r0, #0
|
|
||||||
ldr r0, _08082810 @ =gPlayerState
|
|
||||||
ldrb r0, [r0, #0x1c]
|
|
||||||
cmp r0, #0
|
|
||||||
bne _0808280C
|
|
||||||
adds r0, r1, #0
|
|
||||||
movs r1, #0
|
|
||||||
bl sub_08082850
|
|
||||||
_0808280C:
|
|
||||||
pop {pc}
|
|
||||||
.align 2, 0
|
|
||||||
_08082810: .4byte gPlayerState
|
|
||||||
|
|
||||||
thumb_func_start nullsub_512
|
|
||||||
nullsub_512: @ 0x08082814
|
|
||||||
bx lr
|
|
||||||
.align 2, 0
|
|
||||||
|
|
||||||
thumb_func_start sub_08082818
|
|
||||||
sub_08082818: @ 0x08082818
|
|
||||||
push {lr}
|
|
||||||
movs r1, #0
|
|
||||||
bl sub_08082850
|
|
||||||
pop {pc}
|
|
||||||
.align 2, 0
|
|
||||||
|
|
||||||
thumb_func_start sub_08082824
|
|
||||||
sub_08082824: @ 0x08082824
|
|
||||||
push {r4, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
ldr r0, [r4, #0x20]
|
|
||||||
cmp r0, #0
|
|
||||||
bge _08082836
|
|
||||||
ldrb r0, [r4, #0x18]
|
|
||||||
movs r1, #0x80
|
|
||||||
orrs r0, r1
|
|
||||||
strb r0, [r4, #0x18]
|
|
||||||
_08082836:
|
|
||||||
movs r1, #0x80
|
|
||||||
lsls r1, r1, #6
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_08003FC4
|
|
||||||
cmp r0, #0
|
|
||||||
bne _0808284C
|
|
||||||
adds r0, r4, #0
|
|
||||||
movs r1, #0
|
|
||||||
bl sub_08082850
|
|
||||||
_0808284C:
|
|
||||||
pop {r4, pc}
|
|
||||||
.align 2, 0
|
|
||||||
|
|
||||||
thumb_func_start sub_08082850
|
|
||||||
sub_08082850: @ 0x08082850
|
|
||||||
push {r4, r5, lr}
|
|
||||||
adds r4, r0, #0
|
|
||||||
adds r5, r1, #0
|
|
||||||
ldrb r1, [r4, #0xa]
|
|
||||||
adds r0, #0x7d
|
|
||||||
ldrb r2, [r0]
|
|
||||||
ldrb r3, [r4, #0xb]
|
|
||||||
adds r0, r4, #0
|
|
||||||
bl sub_0808288C
|
|
||||||
adds r2, r0, #0
|
|
||||||
adds r0, r4, #0
|
|
||||||
movs r1, #5
|
|
||||||
bl CreateFx
|
|
||||||
cmp r0, #0
|
|
||||||
beq _08082874
|
|
||||||
str r5, [r0, #0x50]
|
|
||||||
_08082874:
|
|
||||||
ldrb r0, [r4, #0xb]
|
|
||||||
cmp r0, #1
|
|
||||||
bne _08082884
|
|
||||||
adds r0, r4, #0
|
|
||||||
adds r0, #0x86
|
|
||||||
ldrh r0, [r0]
|
|
||||||
bl SetFlag
|
|
||||||
_08082884:
|
|
||||||
bl DeleteThisEntity
|
|
||||||
pop {r4, r5, pc}
|
|
||||||
.align 2, 0
|
|
||||||
|
|
||||||
thumb_func_start sub_0808288C
|
|
||||||
sub_0808288C: @ 0x0808288C
|
|
||||||
push {r4, r5, r6, r7, lr}
|
|
||||||
mov r7, r8
|
|
||||||
push {r7}
|
|
||||||
adds r7, r0, #0
|
|
||||||
adds r4, r1, #0
|
|
||||||
adds r5, r2, #0
|
|
||||||
mov r8, r3
|
|
||||||
movs r6, #0
|
|
||||||
cmp r4, #0
|
|
||||||
beq _080828A6
|
|
||||||
cmp r4, #0xff
|
|
||||||
bne _080828AA
|
|
||||||
b _080828D6
|
|
||||||
_080828A6:
|
|
||||||
movs r6, #0x80
|
|
||||||
b _080828D6
|
|
||||||
_080828AA:
|
|
||||||
adds r0, r7, #0
|
|
||||||
movs r1, #0
|
|
||||||
adds r2, r4, #0
|
|
||||||
adds r3, r5, #0
|
|
||||||
bl CreateObjectWithParent
|
|
||||||
adds r2, r0, #0
|
|
||||||
cmp r2, #0
|
|
||||||
beq _080828D6
|
|
||||||
mov r0, r8
|
|
||||||
cmp r0, #2
|
|
||||||
bne _080828D4
|
|
||||||
movs r0, #5
|
|
||||||
strb r0, [r2, #0xe]
|
|
||||||
adds r0, r7, #0
|
|
||||||
adds r0, #0x86
|
|
||||||
ldrh r1, [r0]
|
|
||||||
adds r0, r2, #0
|
|
||||||
adds r0, #0x86
|
|
||||||
strh r1, [r0]
|
|
||||||
b _080828D6
|
|
||||||
_080828D4:
|
|
||||||
strb r6, [r2, #0xe]
|
|
||||||
_080828D6:
|
|
||||||
adds r0, r6, #0
|
|
||||||
pop {r3}
|
|
||||||
mov r8, r3
|
|
||||||
pop {r4, r5, r6, r7, pc}
|
|
||||||
.align 2, 0
|
|
|
@ -7,6 +7,7 @@
|
||||||
#include "position.h"
|
#include "position.h"
|
||||||
#include "player.h"
|
#include "player.h"
|
||||||
#include "structures.h"
|
#include "structures.h"
|
||||||
|
#include "room.h"
|
||||||
|
|
||||||
// Identified - to be sorted into header files
|
// Identified - to be sorted into header files
|
||||||
extern u32 Random(void);
|
extern u32 Random(void);
|
||||||
|
@ -225,6 +226,7 @@ extern void sub_08033744(Entity*);
|
||||||
extern void sub_0800417E(Entity*, u32);
|
extern void sub_0800417E(Entity*, u32);
|
||||||
extern void sub_080784C8();
|
extern void sub_080784C8();
|
||||||
extern void sub_08017640();
|
extern void sub_08017640();
|
||||||
|
extern u32 sub_0808288C(Entity*, u32, u32, u32);
|
||||||
extern void sub_0806FDA0(Entity*);
|
extern void sub_0806FDA0(Entity*);
|
||||||
extern void sub_080AE008(Entity*, u32, u32);
|
extern void sub_080AE008(Entity*, u32, u32);
|
||||||
extern u32 sub_08016A30(Entity*);
|
extern u32 sub_08016A30(Entity*);
|
||||||
|
@ -242,4 +244,8 @@ extern void HandleGameplayScreen(void);
|
||||||
extern void HandleGameOverScreen(void);
|
extern void HandleGameOverScreen(void);
|
||||||
extern void HandleCreditsScreen(void);
|
extern void HandleCreditsScreen(void);
|
||||||
extern void HandleDebugTextScreen(void);
|
extern void HandleDebugTextScreen(void);
|
||||||
|
extern void sub_080A2BE4(Entity*, u32);
|
||||||
|
extern u32 sub_08097ADC(Entity*);
|
||||||
|
extern void sub_08097B24(Entity*);
|
||||||
|
extern u32 sub_08079F8C(void);
|
||||||
#endif
|
#endif
|
|
@ -20,7 +20,9 @@ typedef struct {
|
||||||
/*0x0d*/ u8 field_0xd[2];
|
/*0x0d*/ u8 field_0xd[2];
|
||||||
/*0x0f*/ u8 hurtBlinkSpeed;
|
/*0x0f*/ u8 hurtBlinkSpeed;
|
||||||
/*0x10*/ u8 field_0x10[4];
|
/*0x10*/ u8 field_0x10[4];
|
||||||
/*0x14*/ u16 field_0x14[3];
|
/*0x11*/ u8 field_0x14;
|
||||||
|
/*0x11*/ u8 field_0x15;
|
||||||
|
/*0x14*/ u16 field_0x16[2];
|
||||||
/*0x1a*/ u8 field_0x1a[2];
|
/*0x1a*/ u8 field_0x1a[2];
|
||||||
/*0x1c*/ u8 field_0x1c;
|
/*0x1c*/ u8 field_0x1c;
|
||||||
/*0x1d*/ u8 field_0x1d[5];
|
/*0x1d*/ u8 field_0x1d[5];
|
||||||
|
|
|
@ -675,7 +675,6 @@ SECTIONS {
|
||||||
asm/button.o(.text);
|
asm/button.o(.text);
|
||||||
asm/object4.o(.text);
|
asm/object4.o(.text);
|
||||||
src/object/pot.o(.text);
|
src/object/pot.o(.text);
|
||||||
asm/pot.o(.text);
|
|
||||||
asm/object6.o(.text);
|
asm/object6.o(.text);
|
||||||
asm/blockPushed.o(.text);
|
asm/blockPushed.o(.text);
|
||||||
asm/lockedDoor.o(.text);
|
asm/lockedDoor.o(.text);
|
||||||
|
@ -793,7 +792,7 @@ SECTIONS {
|
||||||
asm/object70.o(.text);
|
asm/object70.o(.text);
|
||||||
asm/pushableGrave.o(.text);
|
asm/pushableGrave.o(.text);
|
||||||
asm/object72.o(.text);
|
asm/object72.o(.text);
|
||||||
asm/lilypadSmall.o(.text);
|
src/object/lilypadSmall.o(.text);
|
||||||
asm/object74.o(.text);
|
asm/object74.o(.text);
|
||||||
src/object/bell.o(.text);
|
src/object/bell.o(.text);
|
||||||
asm/macroDecorations.o(.text);
|
asm/macroDecorations.o(.text);
|
||||||
|
|
|
@ -182,6 +182,92 @@ u32 sub_0805457C(u32 arg0, u32 arg1) {
|
||||||
asm(".include \"asm/non_matching/code_0805457C.inc\"");
|
asm(".include \"asm/non_matching/code_0805457C.inc\"");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
extern u8 gUnk_080FE1DD[];
|
||||||
|
|
||||||
|
u32 CreateItemDrop(Entity* arg0, u32 itemID, u32 itemParameter) {
|
||||||
|
u32 prereqID;
|
||||||
|
u32 adjustedParam;
|
||||||
|
u32 uVar1;
|
||||||
|
Entity* itemEntity;
|
||||||
|
|
||||||
|
adjustedParam = (u8)itemParameter;
|
||||||
|
switch (adjustedParam) {
|
||||||
|
case 0x3f:
|
||||||
|
if (!GetInventoryValue(0x40)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (itemParameter == 0) {
|
||||||
|
adjustedParam = 1;
|
||||||
|
}
|
||||||
|
case 0x5d:
|
||||||
|
if (!GetInventoryValue(0x65)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 0x5e:
|
||||||
|
if (!GetInventoryValue(0x9)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 0x5c:
|
||||||
|
case 0xfc ... 0xfe:
|
||||||
|
if (GetInventoryValue(0x67) == 0) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
if (3 < gRoomVars.filler[5]) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (itemID != 0x5c) {
|
||||||
|
adjustedParam = gUnk_080FE1DD[(Random() & 0x3f) + (itemID - 0xfc) * 0x40];
|
||||||
|
if (adjustedParam == 0) {
|
||||||
|
itemID = 0;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
itemID = 0x5c;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 0xff:
|
||||||
|
if (!GetInventoryValue(0x1)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (itemID != 0) {
|
||||||
|
if (itemID == 0xff) {
|
||||||
|
itemEntity = CreateEnemy(7, 0);
|
||||||
|
if (itemEntity != NULL) {
|
||||||
|
itemEntity->x.HALF.HI = arg0->x.HALF.HI;
|
||||||
|
itemEntity->y.HALF.HI = arg0->y.HALF.HI;
|
||||||
|
itemEntity->collisionLayer = arg0->collisionLayer;
|
||||||
|
UpdateSpriteOrderAndFlip(itemEntity);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
itemEntity = CreateObject(0, itemID, adjustedParam);
|
||||||
|
if (itemEntity != NULL) {
|
||||||
|
if (arg0 == &gPlayerEntity) {
|
||||||
|
itemEntity->actionDelay = 1;
|
||||||
|
} else {
|
||||||
|
itemEntity->actionDelay = 0;
|
||||||
|
}
|
||||||
|
if ((arg0->entityType).type == 6) {
|
||||||
|
if (arg0->entityType.subtype == 99) {
|
||||||
|
arg0->attachedEntity = itemEntity;
|
||||||
|
} else if (arg0->entityType.subtype == 0x1e) {
|
||||||
|
itemEntity->direction = arg0->animationState << 3 | 0x80;
|
||||||
|
itemEntity->nonPlanarMovement = 0xc0;
|
||||||
|
itemEntity->field_0x20 = 0x18000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CopyPosition(arg0, itemEntity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return itemID;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
void sub_08054870(void)
|
void sub_08054870(void)
|
||||||
{
|
{
|
||||||
gUnk_080FE2A0[gMenu.menuType]();
|
gUnk_080FE2A0[gMenu.menuType]();
|
||||||
|
|
|
@ -0,0 +1,68 @@
|
||||||
|
#include "global.h"
|
||||||
|
#include "entity.h"
|
||||||
|
#include "functions.h"
|
||||||
|
#include "player.h"
|
||||||
|
|
||||||
|
extern Entity* GetCurrentRoomProperty(u32);
|
||||||
|
extern void sub_080A2CC0(Entity*, Entity**, u16*);
|
||||||
|
|
||||||
|
extern u16 gUnk_08123318[];
|
||||||
|
|
||||||
|
void LilypadSmall(Entity *this)
|
||||||
|
{
|
||||||
|
u32 rand;
|
||||||
|
u16 *psVar4;
|
||||||
|
|
||||||
|
if (this->action == 0) {
|
||||||
|
this->action = 1;
|
||||||
|
this->actionDelay = 0x5a;
|
||||||
|
rand = Random();
|
||||||
|
this->field_0xf = rand;
|
||||||
|
this->frameIndex = (rand >> 0x10) & 3;
|
||||||
|
this->spriteSettings.b.draw = TRUE;
|
||||||
|
this->spritePriority.b0 = 7;
|
||||||
|
this->attachedEntity = GetCurrentRoomProperty(this->entityType.parameter);
|
||||||
|
sub_080A2CC0(this, &this->attachedEntity, &this->field_0x70.HALF.LO);
|
||||||
|
}
|
||||||
|
sub_080A2BE4(this, sub_08097ADC(this));
|
||||||
|
sub_08097B24(this);
|
||||||
|
psVar4 = (u16 *)&this->field_0x70;
|
||||||
|
if (--*psVar4 == 0) {
|
||||||
|
sub_080A2CC0(this, &this->attachedEntity, psVar4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
u32 sub_08097ADC(Entity *this)
|
||||||
|
{
|
||||||
|
if ((gPlayerState.flags.all & 0x80) == 0) {
|
||||||
|
return 0;
|
||||||
|
} else if (sub_080041A0(this,&gPlayerEntity,8,8) == 0) {
|
||||||
|
return 0;
|
||||||
|
} else if (sub_08079F8C() == 0) {
|
||||||
|
return 0;
|
||||||
|
} else {
|
||||||
|
gPlayerState.field_0x14 = 1;
|
||||||
|
if (gPlayerEntity.height.HALF.HI != 0) {
|
||||||
|
return 0;
|
||||||
|
} else {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08097B24(Entity *this)
|
||||||
|
{
|
||||||
|
u32 temp;
|
||||||
|
u32 temp2;
|
||||||
|
u16 *temp3;
|
||||||
|
|
||||||
|
if (--this->actionDelay == 0) {
|
||||||
|
this->actionDelay = 0x5a;
|
||||||
|
this->frameIndex = (this->frameIndex + 1) & 3;
|
||||||
|
}
|
||||||
|
temp3 = gUnk_08123318;
|
||||||
|
temp2 = ++this->field_0xf;
|
||||||
|
|
||||||
|
temp = temp3[(temp2 >> 5) & 7];
|
||||||
|
sub_0805EC9C(this, temp, temp, 0);
|
||||||
|
}
|
142
src/object/pot.c
142
src/object/pot.c
|
@ -5,8 +5,13 @@
|
||||||
#include "player.h"
|
#include "player.h"
|
||||||
#include "room.h"
|
#include "room.h"
|
||||||
|
|
||||||
|
static void sub_08082824(Entity*);
|
||||||
|
static void sub_08082850(Entity*, Entity*);
|
||||||
|
static void sub_08082608(Entity*);
|
||||||
|
|
||||||
extern void (*const gUnk_0811F090[])(Entity*);
|
extern void (*const gUnk_0811F090[])(Entity*);
|
||||||
extern void (*const gUnk_0811F0A8[])(Entity*);
|
extern void (*const gUnk_0811F0A8[])(Entity*);
|
||||||
|
extern void (*const gUnk_0811F0C4[])(Entity*);
|
||||||
|
|
||||||
extern BoundingBox gUnk_080FD338; // TODO: should be const
|
extern BoundingBox gUnk_080FD338; // TODO: should be const
|
||||||
extern BoundingBox gUnk_080FD340; // TODO: should be const
|
extern BoundingBox gUnk_080FD340; // TODO: should be const
|
||||||
|
@ -15,10 +20,9 @@ extern u32 sub_08016A30(Entity*);
|
||||||
extern u32 sub_080001DA(u32, u32);
|
extern u32 sub_080001DA(u32, u32);
|
||||||
extern u32 GetTileTypeByEntity(Entity*);
|
extern u32 GetTileTypeByEntity(Entity*);
|
||||||
extern void sub_08078930(Entity*);
|
extern void sub_08078930(Entity*);
|
||||||
extern void sub_08082824(Entity*);
|
|
||||||
extern u32 sub_080002B8(Entity*);
|
extern u32 sub_080002B8(Entity*);
|
||||||
extern void sub_08082850(Entity*, Entity*);
|
extern void sub_08016A6C(Entity*);
|
||||||
extern void sub_08082608(Entity*);
|
extern u32 sub_0800442E(Entity*);
|
||||||
|
|
||||||
void Pot(Entity* this) {
|
void Pot(Entity* this) {
|
||||||
gUnk_0811F090[this->action](this);
|
gUnk_0811F090[this->action](this);
|
||||||
|
@ -163,7 +167,137 @@ void sub_080825F0(Entity* this) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_08082608(Entity* this) {
|
static void sub_08082608(Entity* this) {
|
||||||
this->action = 1;
|
this->action = 1;
|
||||||
this->previousActionFlag = 0;
|
this->previousActionFlag = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void sub_08082614(Entity* this) {
|
||||||
|
u32 tileType;
|
||||||
|
|
||||||
|
sub_0800445C(this);
|
||||||
|
if (--this->actionDelay != 0xFF) {
|
||||||
|
sub_0806F69C(this);
|
||||||
|
sub_08016A6C(this);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sub_0800442E(this)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this->action = 1;
|
||||||
|
if (gPlayerState.flags.all & 0x80) {
|
||||||
|
this->nonPlanarMovement <<= 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
this->field_0x70.HALF.LO = sub_080001DA(COORD_TO_TILE(this), this->collisionLayer);
|
||||||
|
tileType = GetTileTypeByEntity(this);
|
||||||
|
switch (tileType) {
|
||||||
|
case 0x71:
|
||||||
|
case 0x72:
|
||||||
|
sub_08082850(this, NULL);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
SetTile(0x4000, COORD_TO_TILE(this), this->collisionLayer);
|
||||||
|
sub_08078930(this);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_080826E4(Entity* this) {
|
||||||
|
gUnk_0811F0C4[this->previousActionFlag](this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_080826FC(Entity* this) {
|
||||||
|
this->previousActionFlag = 1;
|
||||||
|
this->field_0x1d = 48;
|
||||||
|
this->actionDelay = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_0808270C(Entity* this) {
|
||||||
|
if ((gPlayerState.field_0x1c & 0xF) != 0x1 || (this->bitfield & 0x7F) != 0x13) {
|
||||||
|
this->spriteOffsetX = 0;
|
||||||
|
this->action = 1;
|
||||||
|
SetTile(0x4000, COORD_TO_TILE(this), this->collisionLayer);
|
||||||
|
} else {
|
||||||
|
sub_0806F4E8(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08082778(Entity* this) {
|
||||||
|
if (this->actionDelay == 0) {
|
||||||
|
this->actionDelay = 1;
|
||||||
|
this->spriteOffsetX = 0;
|
||||||
|
this->spriteOffsetY = -2;
|
||||||
|
SetTile((u16)this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((gPlayerState.field_0x1c & 0xF) != 0x1 || (this->bitfield & 0x7F) != 0x13) {
|
||||||
|
sub_08082850(this, NULL);
|
||||||
|
} else {
|
||||||
|
sub_0806F3E4(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_080827F8(Entity* this) {
|
||||||
|
if (gPlayerState.field_0x1c == 0) {
|
||||||
|
sub_08082850(this, NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void nullsub_512(Entity* this) {
|
||||||
|
}
|
||||||
|
|
||||||
|
void sub_08082818(Entity* this) {
|
||||||
|
sub_08082850(this, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void sub_08082824(Entity* this) {
|
||||||
|
if (this->field_0x20 < 0) {
|
||||||
|
this->spriteSettings.b.flipY = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sub_08003FC4(this, 0x2000) == 0) {
|
||||||
|
sub_08082850(this, NULL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void sub_08082850(Entity* this, Entity* parent) {
|
||||||
|
u32 parameter = sub_0808288C(this, this->entityType.form, this->field_0x7c.BYTES.byte1, this->entityType.parameter);
|
||||||
|
Entity* fxEntity = CreateFx(this, 5, parameter);
|
||||||
|
if (fxEntity) {
|
||||||
|
fxEntity->parent = parent;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this->entityType.parameter == 1) {
|
||||||
|
SetFlag(this->field_0x86);
|
||||||
|
}
|
||||||
|
|
||||||
|
DeleteThisEntity();
|
||||||
|
}
|
||||||
|
|
||||||
|
u32 sub_0808288C(Entity* this, u32 form, u32 arg2, u32 arg3) {
|
||||||
|
Entity* entity;
|
||||||
|
u32 result = 0;
|
||||||
|
switch (form) {
|
||||||
|
case 0xFF:
|
||||||
|
result = 0;
|
||||||
|
break;
|
||||||
|
case 0:
|
||||||
|
result = 0x80;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
entity = CreateObjectWithParent(this, 0, form, arg2);
|
||||||
|
if (entity) {
|
||||||
|
if (arg3 == 2) {
|
||||||
|
entity->actionDelay = 5;
|
||||||
|
entity->field_0x86 = this->field_0x86;
|
||||||
|
} else {
|
||||||
|
entity->actionDelay = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
|
@ -20,8 +20,8 @@ void sub_08070698(Entity *this)
|
||||||
Entity *ent;
|
Entity *ent;
|
||||||
|
|
||||||
gPlayerState.field_0x0[0] = 0xff;
|
gPlayerState.field_0x0[0] = 0xff;
|
||||||
gPlayerState.field_0x14[1] = gPlayerEntity.x.HALF.HI;
|
gPlayerState.field_0x16[0] = gPlayerEntity.x.HALF.HI;
|
||||||
gPlayerState.field_0x14[2] = gPlayerEntity.y.HALF.HI;
|
gPlayerState.field_0x16[1] = gPlayerEntity.y.HALF.HI;
|
||||||
this->flags = this->flags | 0x80;
|
this->flags = this->flags | 0x80;
|
||||||
this->spritePriority.b0 = 0xc;
|
this->spritePriority.b0 = 0xc;
|
||||||
this->spritePriority.b1 = 1;
|
this->spritePriority.b1 = 1;
|
||||||
|
|
Loading…
Reference in New Issue