mirror of
https://github.com/zeldaret/tmc
synced 2026-06-27 18:53:10 -04:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -1,69 +0,0 @@
|
||||
.include "asm/macros.inc"
|
||||
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
push {r4, lr}
|
||||
adds r4, r0, #0
|
||||
ldr r0, _08063DA0 @ =gUnk_03003DBC
|
||||
ldrb r0, [r0]
|
||||
cmp r0, #0x46
|
||||
bhi _08063DC6
|
||||
ldrb r0, [r4, #9]
|
||||
movs r1, #0x15
|
||||
eors r0, r1
|
||||
rsbs r1, r0, #0
|
||||
orrs r1, r0
|
||||
lsrs r1, r1, #0x1f
|
||||
lsls r1, r1, #4
|
||||
ldr r0, _08063DA4 @ =gUnk_0810F524
|
||||
adds r1, r1, r0
|
||||
adds r0, r4, #0
|
||||
bl LoadExtraSpriteData
|
||||
cmp r0, #0
|
||||
beq _08063DC6
|
||||
adds r0, r4, #0
|
||||
movs r1, #4
|
||||
bl InitializeAnimation
|
||||
ldr r0, _08063DA8 @ =gUnk_0810F6BC
|
||||
ldrb r1, [r4, #0xa]
|
||||
lsls r1, r1, #2
|
||||
adds r1, r1, r0
|
||||
ldr r1, [r1]
|
||||
adds r0, r4, #0
|
||||
movs r2, #0
|
||||
bl sub_0806EE04
|
||||
ldrb r0, [r4, #0xa]
|
||||
cmp r0, #0
|
||||
blt _08063DB6
|
||||
cmp r0, #3
|
||||
bgt _08063DAC
|
||||
movs r0, #0xc
|
||||
bl sub_080A7EE0
|
||||
str r4, [r0, #0x50]
|
||||
movs r1, #0x3c
|
||||
strb r1, [r0, #0xf]
|
||||
b _08063DB6
|
||||
.align 2, 0
|
||||
_08063DA0: .4byte gUnk_03003DBC
|
||||
_08063DA4: .4byte gUnk_0810F524
|
||||
_08063DA8: .4byte gUnk_0810F6BC
|
||||
_08063DAC:
|
||||
cmp r0, #5
|
||||
bgt _08063DB6
|
||||
adds r0, r4, #0
|
||||
bl sub_08078778
|
||||
_08063DB6:
|
||||
ldrb r0, [r4, #0xc]
|
||||
adds r0, #1
|
||||
movs r1, #0
|
||||
strb r0, [r4, #0xc]
|
||||
strb r1, [r4, #0xa]
|
||||
adds r0, r4, #0
|
||||
bl sub_08063DC8
|
||||
_08063DC6:
|
||||
pop {r4, pc}
|
||||
.syntax divided
|
||||
@@ -1,73 +0,0 @@
|
||||
.syntax unified
|
||||
push {r4, lr}
|
||||
adds r4, r0, #0
|
||||
ldrb r0, [r4, #9]
|
||||
movs r1, #0x15
|
||||
eors r0, r1
|
||||
rsbs r1, r0, #0
|
||||
orrs r1, r0
|
||||
lsrs r1, r1, #0x1f
|
||||
lsls r1, r1, #4
|
||||
ldr r0, _08063EC8 @ =gUnk_0810F524
|
||||
adds r1, r1, r0
|
||||
adds r0, r4, #0
|
||||
bl LoadExtraSpriteData
|
||||
cmp r0, #0
|
||||
beq _08063F1E
|
||||
ldrb r0, [r4, #0xc]
|
||||
adds r0, #1
|
||||
strb r0, [r4, #0xc]
|
||||
ldrb r1, [r4, #0xe]
|
||||
cmp r1, #0
|
||||
beq _08063ECC
|
||||
adds r1, r4, #0
|
||||
adds r1, #0x70
|
||||
movs r0, #8
|
||||
strb r0, [r1]
|
||||
b _08063ED2
|
||||
.align 2, 0
|
||||
_08063EC8: .4byte gUnk_0810F524
|
||||
_08063ECC:
|
||||
adds r0, r4, #0
|
||||
adds r0, #0x70
|
||||
strb r1, [r0]
|
||||
_08063ED2:
|
||||
movs r0, #0
|
||||
strb r0, [r4, #0xe]
|
||||
adds r0, r4, #0
|
||||
bl sub_0805ACC0
|
||||
adds r2, r0, #0
|
||||
cmp r2, #0
|
||||
bne _08063EF2
|
||||
ldrh r0, [r4, #0x2e]
|
||||
adds r1, r4, #0
|
||||
adds r1, #0x68
|
||||
strh r0, [r1]
|
||||
ldrh r0, [r4, #0x32]
|
||||
adds r1, #2
|
||||
strh r0, [r1]
|
||||
b _08063EFE
|
||||
_08063EF2:
|
||||
lsrs r1, r2, #0x10
|
||||
adds r0, r4, #0
|
||||
adds r0, #0x68
|
||||
strh r1, [r0]
|
||||
adds r0, #2
|
||||
strh r2, [r0]
|
||||
_08063EFE:
|
||||
adds r1, r4, #0
|
||||
adds r1, #0x71
|
||||
movs r0, #0
|
||||
strb r0, [r1]
|
||||
subs r1, #0x39
|
||||
movs r0, #1
|
||||
strb r0, [r1]
|
||||
adds r0, r4, #0
|
||||
bl UpdateSpriteForCollisionLayer
|
||||
adds r0, r4, #0
|
||||
bl sub_0807DD64
|
||||
adds r0, r4, #0
|
||||
bl sub_08063F20
|
||||
_08063F1E:
|
||||
pop {r4, pc}
|
||||
.syntax divided
|
||||
@@ -1,50 +0,0 @@
|
||||
.include "asm/macros.inc"
|
||||
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
push {r4, r5, lr}
|
||||
adds r4, r0, #0
|
||||
ldr r0, [r4, #0x54]
|
||||
cmp r0, #0
|
||||
beq _0803258A
|
||||
adds r0, #0x41
|
||||
ldrb r1, [r0]
|
||||
movs r0, #0x80
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
bne _080325A4
|
||||
_0803258A:
|
||||
adds r5, r4, #0
|
||||
adds r5, #0x76
|
||||
ldrh r0, [r5]
|
||||
subs r0, #1
|
||||
strh r0, [r5]
|
||||
lsls r0, r0, #0x10
|
||||
cmp r0, #0
|
||||
beq _080325A4
|
||||
adds r0, r4, #0
|
||||
bl sub_080AEFE0
|
||||
cmp r0, #0
|
||||
bne _080325AC
|
||||
_080325A4:
|
||||
adds r0, r4, #0
|
||||
bl sub_0803275C
|
||||
b _080325C2
|
||||
_080325AC:
|
||||
adds r0, r4, #0
|
||||
bl UpdateAnimationSingleFrame
|
||||
ldrh r1, [r5]
|
||||
movs r0, #7
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
bne _080325C2
|
||||
adds r0, r4, #0
|
||||
bl sub_08032794
|
||||
_080325C2:
|
||||
pop {r4, r5, pc}
|
||||
.align 2, 0
|
||||
.syntax divided
|
||||
@@ -1,72 +0,0 @@
|
||||
.include "asm/macros.inc"
|
||||
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
push {r4, lr}
|
||||
adds r4, r0, #0
|
||||
movs r1, #1
|
||||
bl sub_08049FDC
|
||||
cmp r0, #0
|
||||
bne _0801FEEA
|
||||
adds r1, r4, #0
|
||||
adds r1, #0x74
|
||||
movs r0, #1
|
||||
strh r0, [r1]
|
||||
_0801FEEA:
|
||||
adds r0, r4, #0
|
||||
adds r0, #0x5a
|
||||
ldrb r0, [r0]
|
||||
movs r2, #0xf
|
||||
adds r1, r2, #0
|
||||
ands r1, r0
|
||||
lsls r1, r1, #5
|
||||
strh r1, [r4, #0x24]
|
||||
ldrb r0, [r4, #0xa]
|
||||
cmp r0, #0
|
||||
bne _0801FF28
|
||||
ldrb r1, [r4, #0xf]
|
||||
adds r0, r1, #1
|
||||
strb r0, [r4, #0xf]
|
||||
adds r0, r2, #0
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
bne _0801FF4E
|
||||
ldr r0, _0801FF24 @ =gUnk_020000B0
|
||||
ldr r1, [r0]
|
||||
adds r0, r4, #0
|
||||
bl sub_0800132C
|
||||
adds r1, r0, #0
|
||||
adds r0, r4, #0
|
||||
bl sub_08004596
|
||||
b _0801FF4E
|
||||
.align 2, 0
|
||||
_0801FF24: .4byte gUnk_020000B0
|
||||
_0801FF28:
|
||||
adds r0, r1, #0
|
||||
adds r0, #0x40
|
||||
strh r0, [r4, #0x24]
|
||||
ldrb r1, [r4, #0xf]
|
||||
adds r0, r1, #1
|
||||
strb r0, [r4, #0xf]
|
||||
movs r0, #7
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
bne _0801FF4E
|
||||
ldr r0, _0801FF58 @ =gUnk_020000B0
|
||||
ldr r1, [r0]
|
||||
adds r0, r4, #0
|
||||
bl sub_0800132C
|
||||
adds r1, r0, #0
|
||||
adds r0, r4, #0
|
||||
bl sub_08004596
|
||||
_0801FF4E:
|
||||
adds r0, r4, #0
|
||||
bl sub_080AEF88
|
||||
pop {r4, pc}
|
||||
.align 2, 0
|
||||
_0801FF58: .4byte gUnk_020000B0
|
||||
.syntax divided
|
||||
@@ -1,287 +0,0 @@
|
||||
.include "asm/macros.inc"
|
||||
|
||||
.include "constants/constants.inc"
|
||||
|
||||
.syntax unified
|
||||
|
||||
.text
|
||||
|
||||
.syntax unified
|
||||
push {r4, r5, r6, r7, lr}
|
||||
mov r7, r8
|
||||
push {r7}
|
||||
adds r5, r0, #0
|
||||
ldr r1, _080919D4 @ =gRoomControls
|
||||
movs r0, #0
|
||||
mov r8, r0
|
||||
movs r0, #7
|
||||
strb r0, [r1, #0xe]
|
||||
ldr r0, _080919D8 @ =gLinkState
|
||||
ldr r0, [r0, #0x30]
|
||||
movs r1, #0x80
|
||||
lsls r1, r1, #5
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
bne _080919DC
|
||||
movs r0, #1
|
||||
strb r0, [r5, #0xc]
|
||||
b _08091C04
|
||||
.align 2, 0
|
||||
_080919D4: .4byte gRoomControls
|
||||
_080919D8: .4byte gLinkState
|
||||
_080919DC:
|
||||
ldr r4, _08091A14 @ =gLinkEntity
|
||||
adds r6, r4, #0
|
||||
adds r6, #0x5a
|
||||
ldrb r1, [r6]
|
||||
movs r7, #0xf
|
||||
adds r0, r7, #0
|
||||
ands r0, r1
|
||||
cmp r0, #0
|
||||
bne _08091A22
|
||||
ldrb r1, [r5, #0x10]
|
||||
movs r0, #0x7f
|
||||
ands r0, r1
|
||||
strb r0, [r5, #0x10]
|
||||
adds r0, r5, #0
|
||||
adds r1, r4, #0
|
||||
bl CopyPosition
|
||||
ldrb r1, [r6]
|
||||
movs r0, #0xf0
|
||||
ands r0, r1
|
||||
cmp r0, #0x10
|
||||
bne _08091A18
|
||||
adds r1, r5, #0
|
||||
adds r1, #0x63
|
||||
movs r0, #1
|
||||
strb r0, [r1]
|
||||
b _08091C04
|
||||
.align 2, 0
|
||||
_08091A14: .4byte gLinkEntity
|
||||
_08091A18:
|
||||
adds r0, r5, #0
|
||||
adds r0, #0x63
|
||||
mov r1, r8
|
||||
strb r1, [r0]
|
||||
b _08091C04
|
||||
_08091A22:
|
||||
ldrb r0, [r5, #0x10]
|
||||
movs r1, #0x80
|
||||
orrs r0, r1
|
||||
strb r0, [r5, #0x10]
|
||||
mov r0, r8
|
||||
strh r0, [r4, #0x24]
|
||||
adds r0, r5, #0
|
||||
bl sub_0806F69C
|
||||
adds r0, r5, #0
|
||||
adds r1, r4, #0
|
||||
bl CopyPosition
|
||||
adds r0, r5, #0
|
||||
adds r0, #0x29
|
||||
ldrb r1, [r0]
|
||||
lsls r1, r1, #0x1d
|
||||
lsrs r1, r1, #0x1d
|
||||
subs r1, #1
|
||||
adds r3, r4, #0
|
||||
adds r3, #0x29
|
||||
movs r0, #7
|
||||
ands r1, r0
|
||||
ldrb r2, [r3]
|
||||
movs r0, #8
|
||||
rsbs r0, r0, #0
|
||||
ands r0, r2
|
||||
orrs r0, r1
|
||||
strb r0, [r3]
|
||||
adds r0, r5, #0
|
||||
bl sub_08091DDC
|
||||
cmp r0, #0
|
||||
beq _08091A68
|
||||
b _08091C04
|
||||
_08091A68:
|
||||
ldr r0, _08091AD8 @ =gScreenTransition
|
||||
ldr r0, [r0]
|
||||
ands r0, r7
|
||||
cmp r0, #0
|
||||
bne _08091A7A
|
||||
movs r0, #0x9c
|
||||
lsls r0, r0, #1
|
||||
bl PlaySFX
|
||||
_08091A7A:
|
||||
ldrb r0, [r5, #0xf]
|
||||
subs r0, #1
|
||||
strb r0, [r5, #0xf]
|
||||
lsls r0, r0, #0x18
|
||||
lsrs r0, r0, #0x18
|
||||
cmp r0, #0xff
|
||||
bne _08091A92
|
||||
movs r0, #0x7b
|
||||
bl PlaySFX
|
||||
movs r0, #0x3c
|
||||
strb r0, [r5, #0xf]
|
||||
_08091A92:
|
||||
ldr r2, _08091ADC @ =gUnk_081223C8
|
||||
ldrb r0, [r5, #0x14]
|
||||
lsls r0, r0, #1
|
||||
adds r1, r0, r2
|
||||
ldrb r1, [r1]
|
||||
lsls r1, r1, #0x18
|
||||
asrs r1, r1, #0x18
|
||||
adds r0, #1
|
||||
adds r0, r0, r2
|
||||
movs r2, #0
|
||||
ldrsb r2, [r0, r2]
|
||||
adds r0, r5, #0
|
||||
bl sub_080002B4
|
||||
adds r4, r0, #0
|
||||
ldr r1, _08091AE0 @ =gUnk_081223D8
|
||||
ldrb r0, [r5, #0x14]
|
||||
lsls r0, r0, #2
|
||||
adds r0, r0, r1
|
||||
ldr r1, [r0]
|
||||
adds r0, r4, #0
|
||||
bl sub_08007DD6
|
||||
cmp r0, #0
|
||||
bne _08091AE4
|
||||
ldrb r0, [r5, #0x15]
|
||||
movs r1, #0x10
|
||||
eors r0, r1
|
||||
strb r0, [r5, #0x15]
|
||||
ldrb r0, [r5, #0x14]
|
||||
movs r1, #2
|
||||
eors r0, r1
|
||||
strb r0, [r5, #0x14]
|
||||
b _08091BD8
|
||||
.align 2, 0
|
||||
_08091AD8: .4byte gScreenTransition
|
||||
_08091ADC: .4byte gUnk_081223C8
|
||||
_08091AE0: .4byte gUnk_081223D8
|
||||
_08091AE4:
|
||||
adds r0, r4, #0
|
||||
subs r0, #0x64
|
||||
cmp r0, #0xb
|
||||
bhi _08091BD8
|
||||
lsls r0, r0, #2
|
||||
ldr r1, _08091AF8 @ =_08091AFC
|
||||
adds r0, r0, r1
|
||||
ldr r0, [r0]
|
||||
mov pc, r0
|
||||
.align 2, 0
|
||||
_08091AF8: .4byte _08091AFC
|
||||
_08091AFC: @ jump table
|
||||
.4byte _08091B2C @ case 0
|
||||
.4byte _08091BD8 @ case 1
|
||||
.4byte _08091BD8 @ case 2
|
||||
.4byte _08091BB8 @ case 3
|
||||
.4byte _08091BB8 @ case 4
|
||||
.4byte _08091BB8 @ case 5
|
||||
.4byte _08091BB8 @ case 6
|
||||
.4byte _08091BD8 @ case 7
|
||||
.4byte _08091BB8 @ case 8
|
||||
.4byte _08091BB8 @ case 9
|
||||
.4byte _08091BB8 @ case 10
|
||||
.4byte _08091BB8 @ case 11
|
||||
_08091B2C:
|
||||
ldrb r1, [r5, #0x10]
|
||||
movs r0, #0xdf
|
||||
ands r0, r1
|
||||
strb r0, [r5, #0x10]
|
||||
adds r1, r5, #0
|
||||
adds r1, #0x3f
|
||||
movs r0, #1
|
||||
strb r0, [r1]
|
||||
subs r1, #3
|
||||
movs r0, #0x47
|
||||
strb r0, [r1]
|
||||
adds r1, #4
|
||||
movs r0, #0x44
|
||||
strb r0, [r1]
|
||||
subs r1, #5
|
||||
movs r4, #0x80
|
||||
movs r0, #0x80
|
||||
strb r0, [r1]
|
||||
movs r0, #6
|
||||
strb r0, [r5, #0xc]
|
||||
adds r0, r5, #0
|
||||
bl sub_08017744
|
||||
ldr r2, _08091BAC @ =gLinkState
|
||||
movs r0, #0x41
|
||||
strb r0, [r2, #2]
|
||||
ldr r0, [r2, #0x30]
|
||||
movs r1, #0x80
|
||||
lsls r1, r1, #5
|
||||
eors r0, r1
|
||||
movs r1, #0x80
|
||||
lsls r1, r1, #0x13
|
||||
orrs r0, r1
|
||||
str r0, [r2, #0x30]
|
||||
ldr r1, _08091BB0 @ =gLinkEntity
|
||||
movs r0, #0x80
|
||||
lsls r0, r0, #0xa
|
||||
str r0, [r1, #0x20]
|
||||
movs r0, #0x80
|
||||
lsls r0, r0, #2
|
||||
strh r0, [r1, #0x24]
|
||||
ldrb r0, [r5, #0x14]
|
||||
lsls r0, r0, #1
|
||||
strb r0, [r1, #0x14]
|
||||
ldrb r0, [r5, #0x15]
|
||||
strb r0, [r1, #0x15]
|
||||
ldrb r0, [r1, #0x10]
|
||||
orrs r4, r0
|
||||
strb r4, [r1, #0x10]
|
||||
adds r0, r5, #0
|
||||
bl sub_08004168
|
||||
ldrb r1, [r5, #0x14]
|
||||
adds r1, #0xc
|
||||
adds r0, r5, #0
|
||||
bl InitAnimationForceUpdate
|
||||
movs r0, #0x78
|
||||
bl PlaySFX
|
||||
ldr r0, _08091BB4 @ =0x00000139
|
||||
bl PlaySFX
|
||||
b _08091C04
|
||||
.align 2, 0
|
||||
_08091BAC: .4byte gLinkState
|
||||
_08091BB0: .4byte gLinkEntity
|
||||
_08091BB4: .4byte 0x00000139
|
||||
_08091BB8:
|
||||
adds r0, r5, #0
|
||||
bl sub_080002B8
|
||||
cmp r4, r0
|
||||
bne _08091BD8
|
||||
adds r0, r5, #0
|
||||
bl sub_08091C0C
|
||||
ldr r1, _08091BD4 @ =gLinkEntity
|
||||
ldrb r0, [r5, #0x14]
|
||||
lsls r0, r0, #1
|
||||
strb r0, [r1, #0x14]
|
||||
b _08091C04
|
||||
.align 2, 0
|
||||
_08091BD4: .4byte gLinkEntity
|
||||
_08091BD8:
|
||||
ldr r2, _08091BF8 @ =gLinkEntity
|
||||
ldrb r0, [r5, #0x14]
|
||||
lsls r1, r0, #1
|
||||
strb r1, [r2, #0x14]
|
||||
adds r1, r5, #0
|
||||
adds r1, #0x58
|
||||
ldrb r1, [r1]
|
||||
lsls r0, r0, #0x18
|
||||
lsrs r0, r0, #0x18
|
||||
cmp r1, r0
|
||||
bne _08091BFC
|
||||
adds r0, r5, #0
|
||||
bl UpdateAnimationSingleFrame
|
||||
b _08091C04
|
||||
.align 2, 0
|
||||
_08091BF8: .4byte gLinkEntity
|
||||
_08091BFC:
|
||||
ldrb r1, [r5, #0x14]
|
||||
adds r0, r5, #0
|
||||
bl InitAnimationForceUpdate
|
||||
_08091C04:
|
||||
pop {r3}
|
||||
mov r8, r3
|
||||
pop {r4, r5, r6, r7, pc}
|
||||
.align 2, 0
|
||||
.syntax divided
|
||||
@@ -1,36 +0,0 @@
|
||||
.syntax unified
|
||||
push {r4, lr}
|
||||
ldr r2, _080854E0 @ =gUnk_081205E0
|
||||
ldrb r1, [r0, #0x14]
|
||||
lsrs r1, r1, #1
|
||||
lsls r1, r1, #1
|
||||
adds r2, r1, r2
|
||||
ldrh r3, [r2]
|
||||
adds r4, r3, #0
|
||||
ldr r2, _080854E4 @ =gUnk_080B4488
|
||||
adds r1, r1, r2
|
||||
ldr r2, [r0, #0x70]
|
||||
movs r0, #0
|
||||
ldrsb r0, [r1, r0]
|
||||
lsls r1, r0, #1
|
||||
subs r0, r2, r1
|
||||
ldrh r0, [r0]
|
||||
cmp r3, r0
|
||||
bne _080854E8
|
||||
ldrh r0, [r2]
|
||||
cmp r3, r0
|
||||
bne _080854E8
|
||||
adds r0, r1, r2
|
||||
ldrh r0, [r0]
|
||||
cmp r4, r0
|
||||
bne _080854E8
|
||||
movs r0, #0
|
||||
b _080854EA
|
||||
.align 2, 0
|
||||
_080854E0: .4byte gUnk_081205E0
|
||||
_080854E4: .4byte gUnk_080B4488
|
||||
_080854E8:
|
||||
movs r0, #1
|
||||
_080854EA:
|
||||
pop {r4, pc}
|
||||
.syntax divided
|
||||
+13
-17
@@ -115,26 +115,22 @@ void sub_080324FC(Entity* this) {
|
||||
}
|
||||
}
|
||||
|
||||
#if NON_MATCHING // r4-r5 register swap
|
||||
void sub_08032574(Entity* this) {
|
||||
if (this->attachedEntity == NULL || !(this->attachedEntity->bitfield & 0x80)) {
|
||||
(this->field_0x76)--;
|
||||
if ((this->field_0x76 == 0) || (sub_080AEFE0(this) == 0)) {
|
||||
sub_0803275C(this);
|
||||
} else {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if (!(this->field_0x76 & 0x7)) {
|
||||
sub_08032794(this);
|
||||
}
|
||||
}
|
||||
if (this->attachedEntity && (this->attachedEntity->bitfield & 0x80)) {
|
||||
sub_0803275C(this);
|
||||
return;
|
||||
}
|
||||
|
||||
if (--this->field_0x76 == 0 || !sub_080AEFE0(this)) {
|
||||
sub_0803275C(this);
|
||||
return;
|
||||
}
|
||||
|
||||
UpdateAnimationSingleFrame(this);
|
||||
if ((this->field_0x76 & 0x7) == 0) {
|
||||
sub_08032794(this);
|
||||
}
|
||||
}
|
||||
#else
|
||||
NAKED
|
||||
void sub_08032574(Entity* this) {
|
||||
asm(".include \"asm/non_matching/keaton/sub_08032574.inc\"");
|
||||
}
|
||||
#endif
|
||||
|
||||
void sub_080325C4(Entity* this) {
|
||||
this->actionDelay--;
|
||||
|
||||
+118
-145
@@ -22,115 +22,100 @@ extern Entity* gUnk_020000B0;
|
||||
extern u8 gUnk_080CA4C8[];
|
||||
extern u16 gUnk_080CA4CA[];
|
||||
extern s16 gSineTable[];
|
||||
void Leever(Entity *this)
|
||||
{
|
||||
EnemyFunctionHandler(this, gUnk_080CA49C);
|
||||
SetChildOffset(this, 0, 1, -0x10);
|
||||
void Leever(Entity* this) {
|
||||
EnemyFunctionHandler(this, gUnk_080CA49C);
|
||||
SetChildOffset(this, 0, 1, -0x10);
|
||||
}
|
||||
|
||||
void sub_0801FC28(Entity *this)
|
||||
{
|
||||
gUnk_080CA4B4[this->action](this);
|
||||
void sub_0801FC28(Entity* this) {
|
||||
gUnk_080CA4B4[this->action](this);
|
||||
}
|
||||
|
||||
void sub_0801FC40(Entity *this)
|
||||
{
|
||||
if (this->bitfield == 0x80) {
|
||||
if (this->action == 3) {
|
||||
this->field_0x74 = 1;
|
||||
void sub_0801FC40(Entity* this) {
|
||||
if (this->bitfield == 0x80) {
|
||||
if (this->action == 3) {
|
||||
this->field_0x74 = 1;
|
||||
}
|
||||
} else {
|
||||
if (this->field_0x43 != 0) {
|
||||
sub_0804A9FC(this, 0x1c);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (this->field_0x43 != 0) {
|
||||
sub_0804A9FC(this, 0x1c);
|
||||
}
|
||||
}
|
||||
sub_0804AA30(this, gUnk_080CA49C);
|
||||
sub_0804AA30(this, gUnk_080CA49C);
|
||||
}
|
||||
|
||||
void sub_0801FC7C(Entity *this)
|
||||
{
|
||||
if ((this->entityType).form == 0) {
|
||||
sub_0804A7D4(this);
|
||||
}
|
||||
else {
|
||||
CreateDeathFx(this, 0xf1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0801FC9C(Entity *this)
|
||||
{
|
||||
sub_0804A720(this);
|
||||
this->action = 1;
|
||||
this->actionDelay = Random();
|
||||
}
|
||||
|
||||
void sub_0801FCB0(Entity *this)
|
||||
{
|
||||
if (--this->actionDelay == 0) {
|
||||
if (sub_0801FE68(this, Random() & 0x1f) != 0) {
|
||||
this->action = 2;
|
||||
this->spriteSettings.b.draw = TRUE;
|
||||
this->direction = (GetFacingDirection(this, gUnk_020000B0) + gUnk_080CA4C8[Random() & 1]) & 0x1f;
|
||||
InitializeAnimation(this, 0);
|
||||
UpdateSpriteForCollisionLayer(this);
|
||||
}
|
||||
else {
|
||||
this->actionDelay = (Random() & 0x18) + 8;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0801FD2C(Entity *this)
|
||||
{
|
||||
|
||||
GetNextFrame(this);
|
||||
|
||||
if (this->frames.b.f3 != 0) {
|
||||
this->action = 3;
|
||||
if (this->entityType.form == 0) {
|
||||
this->field_0x74 = 0xb4;
|
||||
}
|
||||
else {
|
||||
this->field_0x74 = 0x6e;
|
||||
}
|
||||
InitializeAnimation(this,2);
|
||||
}
|
||||
else if (this->frames.b.f0 != 0) {
|
||||
this->frames.all &= 0xfe;
|
||||
this->flags |= 0x80;
|
||||
void sub_0801FC7C(Entity* this) {
|
||||
if ((this->entityType).form == 0) {
|
||||
sub_0804A7D4(this);
|
||||
} else {
|
||||
CreateDeathFx(this, 0xf1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0801FD80(Entity *this)
|
||||
{
|
||||
|
||||
sub_0801FED4(this);
|
||||
GetNextFrame(this);
|
||||
|
||||
if (--this->field_0x74 == 0) {
|
||||
this->action = 4;
|
||||
this->flags &= 0x7f;
|
||||
InitializeAnimation(this, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0801FDB4(Entity *this)
|
||||
{
|
||||
sub_0801FED4(this);
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.b.f3) != 0) {
|
||||
void sub_0801FC9C(Entity* this) {
|
||||
sub_0804A720(this);
|
||||
this->action = 1;
|
||||
this->actionDelay = 0xf0;
|
||||
this->spriteSettings.b.draw = FALSE;
|
||||
}
|
||||
this->actionDelay = Random();
|
||||
}
|
||||
|
||||
u32 sub_0801FDE4(Entity *ent, s32 x, s32 y)
|
||||
{
|
||||
void sub_0801FCB0(Entity* this) {
|
||||
if (--this->actionDelay == 0) {
|
||||
if (sub_0801FE68(this, Random() & 0x1f) != 0) {
|
||||
this->action = 2;
|
||||
this->spriteSettings.b.draw = TRUE;
|
||||
this->direction = (GetFacingDirection(this, gUnk_020000B0) + gUnk_080CA4C8[Random() & 1]) & 0x1f;
|
||||
InitializeAnimation(this, 0);
|
||||
UpdateSpriteForCollisionLayer(this);
|
||||
} else {
|
||||
this->actionDelay = (Random() & 0x18) + 8;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0801FD2C(Entity* this) {
|
||||
|
||||
GetNextFrame(this);
|
||||
|
||||
if (this->frames.b.f3 != 0) {
|
||||
this->action = 3;
|
||||
if (this->entityType.form == 0) {
|
||||
this->field_0x74 = 0xb4;
|
||||
} else {
|
||||
this->field_0x74 = 0x6e;
|
||||
}
|
||||
InitializeAnimation(this, 2);
|
||||
} else if (this->frames.b.f0 != 0) {
|
||||
this->frames.all &= 0xfe;
|
||||
this->flags |= 0x80;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0801FD80(Entity* this) {
|
||||
|
||||
sub_0801FED4(this);
|
||||
GetNextFrame(this);
|
||||
|
||||
if (--this->field_0x74 == 0) {
|
||||
this->action = 4;
|
||||
this->flags &= 0x7f;
|
||||
InitializeAnimation(this, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_0801FDB4(Entity* this) {
|
||||
sub_0801FED4(this);
|
||||
GetNextFrame(this);
|
||||
if ((this->frames.b.f3) != 0) {
|
||||
this->action = 1;
|
||||
this->actionDelay = 0xf0;
|
||||
this->spriteSettings.b.draw = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
u32 sub_0801FDE4(Entity* ent, s32 x, s32 y) {
|
||||
u32 uVar3;
|
||||
u16 *puVar4;
|
||||
|
||||
u16* puVar4;
|
||||
|
||||
if (sub_080002D4(x, y, gUnk_020000B0->collisionLayer) != 0) {
|
||||
return 0;
|
||||
} else {
|
||||
@@ -147,60 +132,48 @@ u32 sub_0801FDE4(Entity *ent, s32 x, s32 y)
|
||||
}
|
||||
}
|
||||
|
||||
bool32 sub_0801FE68(Entity *ent, s32 arg2)
|
||||
{
|
||||
s32 sin, cos;
|
||||
s32 x, y;
|
||||
u32 i;
|
||||
bool32 sub_0801FE68(Entity* ent, s32 arg2) {
|
||||
s32 sin, cos;
|
||||
s32 x, y;
|
||||
u32 i;
|
||||
|
||||
|
||||
if (sub_08049FDC(ent, 1) == 0) {
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
x = gUnk_020000B0->x.WORD;
|
||||
y = gUnk_020000B0->y.WORD;
|
||||
sin = gSineTable[arg2 * 8] << 11;
|
||||
cos = gSineTable[arg2 * 8 + 0x40] << 11;
|
||||
for (i = 0; i < 8; i++) {
|
||||
x += sin;
|
||||
y += -cos;
|
||||
if (sub_0801FDE4(ent, x >> 0x10, y >> 0x10) == 0) {
|
||||
return 0;
|
||||
}
|
||||
if (sub_08049FDC(ent, 1) == 0) {
|
||||
return 0;
|
||||
} else {
|
||||
x = gUnk_020000B0->x.WORD;
|
||||
y = gUnk_020000B0->y.WORD;
|
||||
sin = gSineTable[arg2 * 8] << 11;
|
||||
cos = gSineTable[arg2 * 8 + 0x40] << 11;
|
||||
for (i = 0; i < 8; i++) {
|
||||
x += sin;
|
||||
y += -cos;
|
||||
if (sub_0801FDE4(ent, x >> 0x10, y >> 0x10) == 0) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
#if NON_MATCHING
|
||||
void sub_0801FED4(Entity *this)
|
||||
{
|
||||
s16 sVar2;
|
||||
|
||||
if (sub_08049FDC(this, 1) == 0) {
|
||||
this->field_0x74 = 1;
|
||||
}
|
||||
sVar2 = (this->frames.all & 0xf) * 0x20;
|
||||
this->nonPlanarMovement = sVar2;
|
||||
if (this->entityType.form == 0) {
|
||||
this->field_0xf++;
|
||||
if ((this->field_0xf & 0xf) == 0) {
|
||||
sub_08004596(this, sub_0800132C(this, gUnk_020000B0));
|
||||
extern u32 sub_0800132C(Entity*, Entity*);
|
||||
|
||||
void sub_0801FED4(Entity* this) {
|
||||
s16 sVar2;
|
||||
|
||||
if (sub_08049FDC(this, 1) == 0) {
|
||||
this->field_0x74 = 1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
this->nonPlanarMovement = sVar2 + 0x40;
|
||||
this->field_0xf++;
|
||||
if ((this->field_0xf & 0x7) == 0) {
|
||||
sub_08004596(this, sub_0800132C(this, gUnk_020000B0));
|
||||
sVar2 = (this->frames.all & 0xf) * 0x20;
|
||||
this->nonPlanarMovement = sVar2;
|
||||
if (this->entityType.form == 0) {
|
||||
if ((this->field_0xf++ & 0xf) == 0) {
|
||||
sub_08004596(this, sub_0800132C(this, gUnk_020000B0));
|
||||
}
|
||||
} else {
|
||||
this->nonPlanarMovement = sVar2 + 0x40;
|
||||
if ((this->field_0xf++ & 0x7) == 0) {
|
||||
sub_08004596(this, sub_0800132C(this, gUnk_020000B0));
|
||||
}
|
||||
}
|
||||
}
|
||||
sub_080AEF88(this);
|
||||
sub_080AEF88(this);
|
||||
}
|
||||
#else
|
||||
NAKED
|
||||
void sub_0801FED4(Entity *this) {
|
||||
asm(".include \"asm/non_matching/leever/sub_0801FED4.inc\"");
|
||||
}
|
||||
#endif
|
||||
+178
-134
@@ -30,6 +30,12 @@ extern u32 sub_0805ACC0(Entity*);
|
||||
extern void sub_0807DDAC(Entity*, u32);
|
||||
extern void sub_0807DDE4(Entity*);
|
||||
extern void sub_0807000C(Entity*);
|
||||
extern void sub_0806EE04(Entity*, void*, u32);
|
||||
extern Entity* sub_080A7EE0(int);
|
||||
extern void sub_08078778(Entity*);
|
||||
extern void sub_0807DD64(Entity*);
|
||||
void sub_08063DC8(Entity*);
|
||||
void sub_08063F20(Entity*);
|
||||
|
||||
extern void (*const gUnk_0810F544[])(Entity*);
|
||||
extern void (*const gUnk_0810F550[])(Entity*);
|
||||
@@ -40,157 +46,195 @@ extern SpriteLoadData gUnk_0810F524[];
|
||||
extern void* gUnk_0810F6BC[];
|
||||
extern ScreenTransition gScreenTransition;
|
||||
|
||||
void Guard(Entity *this)
|
||||
{
|
||||
if ((this->flags & 2) != 0) {
|
||||
gUnk_0810F544[this->action](this);
|
||||
}
|
||||
else {
|
||||
sub_08063D24(this);
|
||||
}
|
||||
void Guard(Entity* this) {
|
||||
if ((this->flags & 2) != 0) {
|
||||
gUnk_0810F544[this->action](this);
|
||||
} else {
|
||||
sub_08063D24(this);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08063D24(Entity *this)
|
||||
{
|
||||
gUnk_0810F550[this->action](this);
|
||||
sub_0806ED78(this);
|
||||
void sub_08063D24(Entity* this) {
|
||||
gUnk_0810F550[this->action](this);
|
||||
sub_0806ED78(this);
|
||||
}
|
||||
|
||||
NAKED
|
||||
void sub_08063D44(Entity* this) {
|
||||
asm(".include \"asm/non_matching/guard/sub_08063D44.inc\"");
|
||||
}
|
||||
Entity* ent;
|
||||
u32 temp, idx;
|
||||
|
||||
void sub_08063DC8(Entity *this)
|
||||
{
|
||||
if ((this->entityType).form == 0xff) {
|
||||
this->action = 2;
|
||||
this->actionDelay = 0x1e;
|
||||
this->animationState = sub_0806F5A4(GetFacingDirection(this,&gLinkEntity));
|
||||
InitAnimationForceUpdate(this, this->animationState + 4);
|
||||
}
|
||||
else {
|
||||
sub_0806EE20(this);
|
||||
if (this->field_0x3e != this->animationState) {
|
||||
this->animationState = this->field_0x3e;
|
||||
InitializeAnimation(this, this->animationState + 4);
|
||||
if (gUnk_03003DBC > 0x46)
|
||||
return;
|
||||
|
||||
temp = this->entityType.subtype;
|
||||
temp ^= 0x15;
|
||||
idx = ((-temp | temp) >> 0x1f) * 4;
|
||||
if (!LoadExtraSpriteData(this, &gUnk_0810F524[idx]))
|
||||
return;
|
||||
|
||||
InitializeAnimation(this, 4);
|
||||
sub_0806EE04(this, gUnk_0810F6BC[this->entityType.form], 0);
|
||||
switch (this->entityType.form) {
|
||||
case 0 ... 3:
|
||||
ent = sub_080A7EE0(0xc);
|
||||
ent->parent = this;
|
||||
ent->field_0xf = 0x3c;
|
||||
break;
|
||||
case 4 ... 5:
|
||||
sub_08078778(this);
|
||||
break;
|
||||
}
|
||||
else {
|
||||
GetNextFrame(this);
|
||||
}
|
||||
if (this->interactType != 0) {
|
||||
this->action = 3;
|
||||
this->interactType = 0;
|
||||
InitializeAnimation(this, sub_0806F5A4(GetFacingDirection(this,&gLinkEntity)));
|
||||
sub_08064428(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08063E54(Entity *this)
|
||||
{
|
||||
if (--this->actionDelay == 0) {
|
||||
SetRoomFlag(0xf);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08063E6C(Entity *this)
|
||||
{
|
||||
if ((gTextBox.doTextBox & 0x7f) == 0) {
|
||||
this->action = 1;
|
||||
InitializeAnimation(this, this->animationState + 4);
|
||||
}
|
||||
}
|
||||
|
||||
NAKED
|
||||
void sub_08063E90(Entity* this) {
|
||||
asm(".include \"asm/non_matching/guard/sub_08063E90.inc\"");
|
||||
}
|
||||
|
||||
void sub_08063F20(Entity *this)
|
||||
{
|
||||
sub_0807DDAC(this, 0);
|
||||
sub_0807DDE4(this);
|
||||
GetNextFrame(this);
|
||||
if (this->interactType != 0) {
|
||||
this->action++;
|
||||
this->interactType = 0;
|
||||
InitializeAnimation(this, sub_0806F5A4(GetFacingDirection(this, &gLinkEntity)) + *(s8 *)&this->field_0x70);
|
||||
sub_08064428(this);
|
||||
}
|
||||
this->entityType.form = 0;
|
||||
sub_08063DC8(this);
|
||||
}
|
||||
|
||||
void sub_08063F78(Entity *this)
|
||||
{
|
||||
if ((gTextBox.doTextBox & 0x7f) == 0) {
|
||||
this->action = this->action - 1;
|
||||
InitializeAnimation(this,(this->animationState >> 1) + 4 + *(s8 *)&this->field_0x70);
|
||||
}
|
||||
}
|
||||
|
||||
void Guard_Head(Entity *this)
|
||||
{
|
||||
u8 bVar1;
|
||||
u32 uVar2;
|
||||
u32 pbVar3;
|
||||
u32 uVar4;
|
||||
u32 pbVar5;
|
||||
|
||||
uVar2 = this->frames.all & 0x3f;
|
||||
pbVar5 = (this->frameIndex & 0x3f);
|
||||
uVar4 = this->frameSpriteSettings & 0x3f;
|
||||
if ((this->entityType).subtype == 0x15) {
|
||||
if ((this->frameIndex & 0x40) != 0) {
|
||||
pbVar5 = pbVar5 + 0x21;
|
||||
pbVar3 = 0xffffffff;
|
||||
uVar4 = 0;
|
||||
void sub_08063DC8(Entity* this) {
|
||||
if ((this->entityType).form == 0xff) {
|
||||
this->action = 2;
|
||||
this->actionDelay = 0x1e;
|
||||
this->animationState = sub_0806F5A4(GetFacingDirection(this, &gLinkEntity));
|
||||
InitAnimationForceUpdate(this, this->animationState + 4);
|
||||
} else {
|
||||
sub_0806EE20(this);
|
||||
if (this->field_0x3e != this->animationState) {
|
||||
this->animationState = this->field_0x3e;
|
||||
InitializeAnimation(this, this->animationState + 4);
|
||||
} else {
|
||||
GetNextFrame(this);
|
||||
}
|
||||
if (this->interactType != 0) {
|
||||
this->action = 3;
|
||||
this->interactType = 0;
|
||||
InitializeAnimation(this, sub_0806F5A4(GetFacingDirection(this, &gLinkEntity)));
|
||||
sub_08064428(this);
|
||||
}
|
||||
}
|
||||
else {
|
||||
pbVar3 = (uVar2 + 0x19);
|
||||
if ((this->frameSpriteSettings & 0x3f) != 0) {
|
||||
uVar4 += 0x1f;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08063E54(Entity* this) {
|
||||
if (--this->actionDelay == 0) {
|
||||
SetRoomFlag(0xf);
|
||||
}
|
||||
}
|
||||
else {
|
||||
pbVar3 = (uVar2 + 0x46);
|
||||
pbVar5 = pbVar5 + 0x2d;
|
||||
if ((this->frameSpriteSettings & 0x3f) != 0) {
|
||||
uVar4 += 0x4c;
|
||||
}
|
||||
|
||||
void sub_08063E6C(Entity* this) {
|
||||
if ((gTextBox.doTextBox & 0x7f) == 0) {
|
||||
this->action = 1;
|
||||
InitializeAnimation(this, this->animationState + 4);
|
||||
}
|
||||
}
|
||||
uVar4--;
|
||||
SetExtraSpriteFrame(this, 0, pbVar3);
|
||||
SetExtraSpriteFrame(this, 1, pbVar5);
|
||||
SetExtraSpriteFrame(this, 2, uVar4);
|
||||
SetSpriteSubEntryOffsetData1(this, 1, 0);
|
||||
SetSpriteSubEntryOffsetData2(this, 1, 2);
|
||||
sub_0807000C(this);
|
||||
}
|
||||
|
||||
void sub_08064030(Entity *arg0,Entity *arg1)
|
||||
{
|
||||
*(u32*)&arg1->animationState = (-gRoomVars.greatFairyState | gRoomVars.greatFairyState) >> 0x1f;
|
||||
void sub_08063E90(Entity* this) {
|
||||
Entity* ent;
|
||||
u32 temp, idx;
|
||||
u32 unk;
|
||||
|
||||
temp = this->entityType.subtype;
|
||||
temp ^= 0x15;
|
||||
idx = ((-temp | temp) >> 0x1f) * 4;
|
||||
if (!LoadExtraSpriteData(this, &gUnk_0810F524[idx]))
|
||||
return;
|
||||
|
||||
this->action++;
|
||||
if (this->actionDelay) {
|
||||
this->field_0x70.BYTES.byte0 = 8;
|
||||
} else {
|
||||
this->field_0x70.BYTES.byte0 = 0;
|
||||
}
|
||||
this->actionDelay = 0;
|
||||
|
||||
unk = sub_0805ACC0(this);
|
||||
if (unk == 0) {
|
||||
this->field_0x68.HWORD = this->x.HALF.HI;
|
||||
this->field_0x6a.HWORD = this->y.HALF.HI;
|
||||
} else {
|
||||
this->field_0x68.HWORD = unk >> 0x10;
|
||||
this->field_0x6a.HWORD = unk;
|
||||
}
|
||||
this->field_0x70.BYTES.byte1 = 0;
|
||||
this->collisionLayer = 1;
|
||||
UpdateSpriteForCollisionLayer(this);
|
||||
sub_0807DD64(this);
|
||||
sub_08063F20(this);
|
||||
}
|
||||
|
||||
void sub_08064044(void)
|
||||
{
|
||||
gScreenTransition.unk = 1;
|
||||
void sub_08063F20(Entity* this) {
|
||||
sub_0807DDAC(this, 0);
|
||||
sub_0807DDE4(this);
|
||||
GetNextFrame(this);
|
||||
if (this->interactType != 0) {
|
||||
this->action++;
|
||||
this->interactType = 0;
|
||||
InitializeAnimation(this, sub_0806F5A4(GetFacingDirection(this, &gLinkEntity)) + *(s8*)&this->field_0x70);
|
||||
sub_08064428(this);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08064050(Entity *arg0, struct_08064050 *arg1)
|
||||
{
|
||||
u32 unk;
|
||||
|
||||
arg1->unk2 = 0;
|
||||
switch (arg0->entityType.parameter) {
|
||||
case 0x11:
|
||||
arg1->unk2 = 1;
|
||||
break;
|
||||
case 0x12:
|
||||
arg1->unk2 = 2;
|
||||
break;
|
||||
case 0x13:
|
||||
arg1->unk2 = 3;
|
||||
}
|
||||
void sub_08063F78(Entity* this) {
|
||||
if ((gTextBox.doTextBox & 0x7f) == 0) {
|
||||
this->action = this->action - 1;
|
||||
InitializeAnimation(this, (this->animationState >> 1) + 4 + *(s8*)&this->field_0x70);
|
||||
}
|
||||
}
|
||||
|
||||
void Guard_Head(Entity* this) {
|
||||
u8 bVar1;
|
||||
u32 uVar2;
|
||||
u32 pbVar3;
|
||||
u32 uVar4;
|
||||
u32 pbVar5;
|
||||
|
||||
uVar2 = this->frames.all & 0x3f;
|
||||
pbVar5 = (this->frameIndex & 0x3f);
|
||||
uVar4 = this->frameSpriteSettings & 0x3f;
|
||||
if ((this->entityType).subtype == 0x15) {
|
||||
if ((this->frameIndex & 0x40) != 0) {
|
||||
pbVar5 = pbVar5 + 0x21;
|
||||
pbVar3 = 0xffffffff;
|
||||
uVar4 = 0;
|
||||
} else {
|
||||
pbVar3 = (uVar2 + 0x19);
|
||||
if ((this->frameSpriteSettings & 0x3f) != 0) {
|
||||
uVar4 += 0x1f;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
pbVar3 = (uVar2 + 0x46);
|
||||
pbVar5 = pbVar5 + 0x2d;
|
||||
if ((this->frameSpriteSettings & 0x3f) != 0) {
|
||||
uVar4 += 0x4c;
|
||||
}
|
||||
}
|
||||
uVar4--;
|
||||
SetExtraSpriteFrame(this, 0, pbVar3);
|
||||
SetExtraSpriteFrame(this, 1, pbVar5);
|
||||
SetExtraSpriteFrame(this, 2, uVar4);
|
||||
SetSpriteSubEntryOffsetData1(this, 1, 0);
|
||||
SetSpriteSubEntryOffsetData2(this, 1, 2);
|
||||
sub_0807000C(this);
|
||||
}
|
||||
|
||||
void sub_08064030(Entity* arg0, Entity* arg1) {
|
||||
*(u32*)&arg1->animationState = (-gRoomVars.greatFairyState | gRoomVars.greatFairyState) >> 0x1f;
|
||||
}
|
||||
|
||||
void sub_08064044(void) {
|
||||
gScreenTransition.unk = 1;
|
||||
}
|
||||
|
||||
void sub_08064050(Entity* arg0, struct_08064050* arg1) {
|
||||
u32 unk;
|
||||
|
||||
arg1->unk2 = 0;
|
||||
switch (arg0->entityType.parameter) {
|
||||
case 0x11:
|
||||
arg1->unk2 = 1;
|
||||
break;
|
||||
case 0x12:
|
||||
arg1->unk2 = 2;
|
||||
break;
|
||||
case 0x13:
|
||||
arg1->unk2 = 3;
|
||||
}
|
||||
}
|
||||
+89
-98
@@ -3,6 +3,13 @@
|
||||
#include "functions.h"
|
||||
#include "room.h"
|
||||
|
||||
extern u32 sub_08091DDC(Entity*);
|
||||
extern u32 sub_080002B4(Entity*, u32, u32);
|
||||
extern u32 sub_08007DD6(u32, u32);
|
||||
extern void sub_08017744(Entity*);
|
||||
extern u32 sub_080002B8(Entity*);
|
||||
extern void sub_08091C0C(Entity*);
|
||||
|
||||
typedef struct {
|
||||
u16 field_0x0;
|
||||
u16 field_0x2;
|
||||
@@ -17,6 +24,9 @@ extern void (*const gUnk_081223A8[])(Entity*);
|
||||
extern struct_030010EC gUnk_030010EC[];
|
||||
extern BoundingBox gUnk_080FD310;
|
||||
|
||||
extern const s8 gUnk_081223C8[];
|
||||
extern const u32 gUnk_081223D8[];
|
||||
|
||||
void Minecart(Entity* this) {
|
||||
gUnk_081223A8[this->action](this);
|
||||
this->bitfield = 0;
|
||||
@@ -115,111 +125,92 @@ void sub_080918A4(Entity *this)
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
typedef struct {
|
||||
u8 field_0x0;
|
||||
u8 field_0x1;
|
||||
} struct_081223C8;
|
||||
|
||||
extern struct_081223C8 gUnk_081223C8[];
|
||||
|
||||
extern u32 gUnk_081223D8[];
|
||||
|
||||
void sub_080919AC(Entity *this)
|
||||
{
|
||||
u32 iVar2;
|
||||
u32 uVar3;
|
||||
u32 uVar4;
|
||||
struct_081223C8* temp;
|
||||
u32 iVar2;
|
||||
u32 uVar3;
|
||||
|
||||
gRoomControls.unk5 = 7;
|
||||
if ((gLinkState.flags.all & 0x1000) == 0) {
|
||||
this->action = 1;
|
||||
}
|
||||
else {
|
||||
if ((gLinkEntity.frames.all & 0xf) == 0) {
|
||||
this->flags = this->flags & 0x7f;
|
||||
CopyPosition(this,&gLinkEntity);
|
||||
if ((gLinkEntity.frames.all & 0xf0) == 0x10) {
|
||||
this->spriteOffsetY = 1;
|
||||
}
|
||||
else {
|
||||
this->spriteOffsetY = 0;
|
||||
}
|
||||
gRoomControls.unk5 = 7;
|
||||
if ((gLinkState.flags.all & 0x1000) == 0) {
|
||||
this->action = 1;
|
||||
return;
|
||||
}
|
||||
else {
|
||||
this->flags = this->flags | 0x80;
|
||||
gLinkEntity.nonPlanarMovement = 0;
|
||||
sub_0806F69C(this);
|
||||
CopyPosition(this,&gLinkEntity);
|
||||
gLinkEntity.spritePriority.b0 = this->spritePriority.b0 - 1;
|
||||
if (!sub_08091DDC(this)) {
|
||||
if ((gScreenTransition.field_0x0 & 0xf) == 0) {
|
||||
PlaySFX(0x138);
|
||||
}
|
||||
|
||||
if (--this->field_0xf == 0xff) {
|
||||
PlaySFX(0x7b);
|
||||
this->field_0xf = 0x3c;
|
||||
if ((gLinkEntity.frames.all & 0xf) == 0) {
|
||||
this->flags = this->flags & 0x7f;
|
||||
CopyPosition(this,&gLinkEntity);
|
||||
if ((gLinkEntity.frames.all & 0xf0) == 0x10) {
|
||||
this->spriteOffsetY = 1;
|
||||
} else {
|
||||
this->spriteOffsetY = 0;
|
||||
}
|
||||
uVar3 = sub_03005800(this, gUnk_081223C8[this->animationState].field_0x0, gUnk_081223C8[this->animationState].field_0x1);
|
||||
iVar2 = sub_08007DD6(uVar3, gUnk_081223D8[this->animationState]);
|
||||
if (iVar2 == 0) {
|
||||
this->direction = this->direction ^ 0x10;
|
||||
this->animationState = this->animationState ^ 2;
|
||||
}
|
||||
else {
|
||||
switch(uVar3) {
|
||||
case 100:
|
||||
this->flags = this->flags & 0xdf;
|
||||
this->damageType = 1;
|
||||
this->field_0x3c = 0x47;
|
||||
this->field_0x40 = 0x44;
|
||||
this->flags2 = 0x80;
|
||||
this->action = 6;
|
||||
sub_08017744(this);
|
||||
gLinkState.jumpStatus = 0x41;
|
||||
gLinkState.flags.all = (gLinkState.flags.all ^ 0x1000) | 0x4000000;
|
||||
gLinkEntity.field_0x20 = 0x20000;
|
||||
gLinkEntity.nonPlanarMovement = 0x200;
|
||||
gLinkEntity.animationState = this->animationState << 1;
|
||||
gLinkEntity.direction = this->direction;
|
||||
gLinkEntity.flags |= 0x80;
|
||||
sub_08004168(this);
|
||||
InitAnimationForceUpdate(this, this->animationState + 0xc);
|
||||
PlaySFX(0x78);
|
||||
PlaySFX(0x139);
|
||||
return;
|
||||
case 0x67:
|
||||
case 0x68:
|
||||
case 0x69:
|
||||
case 0x6a:
|
||||
case 0x6c:
|
||||
case 0x6d:
|
||||
case 0x6e:
|
||||
case 0x6f:
|
||||
if (uVar3 == sub_080002B8()) {
|
||||
sub_08091C0C(this);
|
||||
gLinkEntity.animationState *= 2;
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
this->flags = this->flags | 0x80;
|
||||
gLinkEntity.nonPlanarMovement = 0;
|
||||
sub_0806F69C(this);
|
||||
CopyPosition(this,&gLinkEntity);
|
||||
gLinkEntity.spritePriority.b0 = this->spritePriority.b0 - 1;
|
||||
if (!sub_08091DDC(this)) {
|
||||
if ((gScreenTransition.frameCount & 0xf) == 0) {
|
||||
PlaySFX(0x138);
|
||||
}
|
||||
|
||||
if (--this->field_0xf == 0xff) {
|
||||
PlaySFX(0x7b);
|
||||
this->field_0xf = 0x3c;
|
||||
}
|
||||
|
||||
uVar3 = sub_080002B4(this, gUnk_081223C8[this->animationState * 2], gUnk_081223C8[this->animationState * 2 + 1]);
|
||||
iVar2 = sub_08007DD6(uVar3, gUnk_081223D8[this->animationState]);
|
||||
if (iVar2 == 0) {
|
||||
this->direction = this->direction ^ 0x10;
|
||||
this->animationState = this->animationState ^ 2;
|
||||
} else {
|
||||
switch (uVar3) {
|
||||
case 0x64:
|
||||
this->flags = this->flags & 0xdf;
|
||||
this->damageType = 1;
|
||||
this->field_0x3c = 0x47;
|
||||
this->field_0x40 = 0x44;
|
||||
this->flags2 = 0x80;
|
||||
this->action = 6;
|
||||
sub_08017744(this);
|
||||
gLinkState.jumpStatus = 0x41;
|
||||
gLinkState.flags.all = (gLinkState.flags.all ^ 0x1000) | 0x4000000;
|
||||
gLinkEntity.field_0x20 = 0x20000;
|
||||
gLinkEntity.nonPlanarMovement = 0x200;
|
||||
gLinkEntity.animationState = this->animationState << 1;
|
||||
gLinkEntity.direction = this->direction;
|
||||
gLinkEntity.flags |= 0x80;
|
||||
sub_08004168(this);
|
||||
InitAnimationForceUpdate(this, this->animationState + 0xc);
|
||||
PlaySFX(0x78);
|
||||
PlaySFX(0x139);
|
||||
return;
|
||||
case 0x67:
|
||||
case 0x68:
|
||||
case 0x69:
|
||||
case 0x6a:
|
||||
case 0x6c:
|
||||
case 0x6d:
|
||||
case 0x6e:
|
||||
case 0x6f:
|
||||
if (uVar3 == sub_080002B8(this)) {
|
||||
sub_08091C0C(this);
|
||||
gLinkEntity.animationState = this->animationState << 1;
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
gLinkEntity.animationState = this->animationState << 1;
|
||||
if (this->animIndex == this->animationState) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
}
|
||||
else {
|
||||
InitAnimationForceUpdate(this, this->animationState);
|
||||
}
|
||||
}
|
||||
gLinkEntity.animationState *= 2;
|
||||
if (this->animIndex == this->animationState) {
|
||||
UpdateAnimationSingleFrame(this);
|
||||
}
|
||||
else {
|
||||
InitAnimationForceUpdate(this, this->animationState);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
NAKED
|
||||
void sub_080919AC(Entity *this) {
|
||||
asm(".include \"asm/non_matching/minecart/sub_080919AC.inc\"");
|
||||
}
|
||||
#endif
|
||||
+20
-4
@@ -12,8 +12,8 @@ extern void SetTile(u32, u32, u32);
|
||||
|
||||
extern void (*const gUnk_081205D0[])(Entity*);
|
||||
|
||||
extern s8 gUnk_080B4488[][2];
|
||||
extern u16 gUnk_081205E0[];
|
||||
extern s8 gUnk_080B4488[];
|
||||
|
||||
void Railtrack(Entity* this) {
|
||||
gUnk_081205D0[this->action](this);
|
||||
@@ -135,14 +135,30 @@ void sub_0808543C(Entity *this)
|
||||
u32 uVar2;
|
||||
s8 temp;
|
||||
|
||||
temp = gUnk_080B4488[(this->animationState >> 1) << 1];
|
||||
temp = gUnk_080B4488[this->animationState / 2][0];
|
||||
uVar2 = COORD_TO_TILE(this);
|
||||
SetTile(this->field_0x74, uVar2 - temp, this->collisionLayer);
|
||||
SetTile(this->field_0x76, uVar2, this->collisionLayer);
|
||||
SetTile(this->field_0x78.HWORD, uVar2 + temp, this->collisionLayer);
|
||||
}
|
||||
|
||||
NAKED
|
||||
u32 sub_080854A8(Entity *this) {
|
||||
asm(".include \"asm/non_matching/railtrack/sub_080854A8.inc\"");
|
||||
u16 var0;
|
||||
u16* var1;
|
||||
s8* var2;
|
||||
|
||||
var0 = gUnk_081205E0[this->animationState / 2];
|
||||
var2 = gUnk_080B4488[this->animationState / 2];
|
||||
var1 = (u16 *)this->field_0x70.WORD;
|
||||
if (var0 != *(var1 - var2[0])) {
|
||||
return TRUE;
|
||||
}
|
||||
if (var0 != *var1) {
|
||||
return TRUE;
|
||||
}
|
||||
if (var0 != *(var1 + var2[0])) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
Reference in New Issue
Block a user