diff --git a/asm/enemy/ballChainSoldier.s b/asm/enemy/ballChainSoldier.s deleted file mode 100644 index 907efd54..00000000 --- a/asm/enemy/ballChainSoldier.s +++ /dev/null @@ -1,797 +0,0 @@ - .include "asm/macros.inc" - - .include "constants/constants.inc" - - .syntax unified - - .text - - - thumb_func_start BallChainSoldier -BallChainSoldier: @ 0x0803E528 - push {lr} - ldr r1, _0803E534 @ =gUnk_080D06E0 - bl EnemyFunctionHandler - pop {pc} - .align 2, 0 -_0803E534: .4byte gUnk_080D06E0 - - thumb_func_start sub_0803E538 -sub_0803E538: @ 0x0803E538 - push {lr} - ldr r2, _0803E54C @ =gUnk_080D06F8 - ldrb r1, [r0, #0xc] - lsls r1, r1, #2 - adds r1, r1, r2 - ldr r1, [r1] - bl _call_via_r1 - pop {pc} - .align 2, 0 -_0803E54C: .4byte gUnk_080D06F8 - - thumb_func_start sub_0803E550 -sub_0803E550: @ 0x0803E550 - push {lr} - ldr r1, _0803E55C @ =gUnk_080D06E0 - bl sub_0804AA30 - pop {pc} - .align 2, 0 -_0803E55C: .4byte gUnk_080D06E0 - - thumb_func_start sub_0803E560 -sub_0803E560: @ 0x0803E560 - push {r4, lr} - adds r4, r0, #0 - bl sub_08001324 - - thumb_func_start sub_0803E568 -sub_0803E568: @ 0x0803E568 - adds r0, r4, #0 - bl sub_0803E538 - pop {r4, pc} - - thumb_func_start sub_0803E570 -sub_0803E570: @ 0x0803E570 - push {lr} - movs r1, #0xff - movs r2, #0x57 - bl CreateDeathFx - pop {pc} - - thumb_func_start nullsub_20 -nullsub_20: @ 0x0803E57C - bx lr - .align 2, 0 - - thumb_func_start sub_0803E580 -sub_0803E580: @ 0x0803E580 - push {r4, r5, lr} - adds r5, r0, #0 - bl sub_0804A720 - adds r0, r5, #0 - movs r1, #0x19 - movs r2, #0 - bl CreateProjectileWithParent - cmp r0, #0 - beq _0803E5E4 - str r5, [r0, #0x50] - str r0, [r5, #0x54] - ldrb r1, [r5, #0x10] - movs r0, #0x80 - movs r4, #0 - orrs r0, r1 - strb r0, [r5, #0x10] - ldrb r1, [r5, #0x18] - movs r0, #4 - rsbs r0, r0, #0 - ands r0, r1 - movs r1, #1 - orrs r0, r1 - strb r0, [r5, #0x18] - bl Random - movs r1, #3 - ands r0, r1 - strb r0, [r5, #0x14] - adds r0, r5, #0 - adds r0, #0x7b - strb r4, [r0] - adds r0, #1 - strb r4, [r0] - adds r1, r5, #0 - adds r1, #0x7e - movs r0, #0x20 - strb r0, [r1] - adds r1, #1 - movs r0, #0xfe - strb r0, [r1] - ldrb r1, [r5, #0x14] - lsls r1, r1, #2 - adds r0, r5, #0 - bl InitAnimationForceUpdate - adds r0, r5, #0 - bl sub_0803E86C -_0803E5E4: - pop {r4, r5, pc} - .align 2, 0 - - thumb_func_start sub_0803E5E8 -sub_0803E5E8: @ 0x0803E5E8 - push {r4, lr} - adds r4, r0, #0 - adds r0, #0x7c - ldrb r1, [r0] - subs r1, #0xa - strb r1, [r0] - adds r0, r4, #0 - bl sub_0803E9A4 - adds r0, r4, #0 - bl sub_0803E9D4 - cmp r0, #0 - bne _0803E61A - adds r1, r4, #0 - adds r1, #0x78 - ldrh r0, [r1] - subs r0, #1 - strh r0, [r1] - lsls r0, r0, #0x10 - cmp r0, #0 - bne _0803E61A - adds r0, r4, #0 - bl sub_0803E8CC -_0803E61A: - pop {r4, pc} - - thumb_func_start sub_0803E61C -sub_0803E61C: @ 0x0803E61C - push {r4, lr} - adds r4, r0, #0 - adds r0, #0x7c - ldrb r1, [r0] - subs r1, #0xa - strb r1, [r0] - adds r0, r4, #0 - bl sub_0803E9A4 - adds r0, r4, #0 - bl sub_0803E9D4 - cmp r0, #0 - bne _0803E66A - adds r0, r4, #0 - adds r0, #0x42 - ldrb r0, [r0] - cmp r0, #0 - bne _0803E654 - adds r0, r4, #0 - bl ProcessMovement - cmp r0, #0 - bne _0803E654 - adds r0, r4, #0 - bl sub_0803E86C - b _0803E66A -_0803E654: - adds r1, r4, #0 - adds r1, #0x78 - ldrh r0, [r1] - subs r0, #1 - strh r0, [r1] - lsls r0, r0, #0x10 - cmp r0, #0 - bne _0803E66A - adds r0, r4, #0 - bl sub_0803E92C -_0803E66A: - pop {r4, pc} - - thumb_func_start sub_0803E66C -sub_0803E66C: @ 0x0803E66C - push {r4, lr} - adds r4, r0, #0 - adds r1, r4, #0 - adds r1, #0x7c - ldrb r0, [r1] - subs r0, #0x10 - strb r0, [r1] - adds r0, r4, #0 - bl sub_0803E9A4 - adds r1, r4, #0 - adds r1, #0x7e - ldrb r0, [r1] - cmp r0, #0x21 - bhi _0803E68E - adds r0, #1 - strb r0, [r1] -_0803E68E: - adds r0, r4, #0 - movs r1, #1 - bl sub_08049FDC - cmp r0, #0 - beq _0803E6A4 - adds r0, r4, #0 - bl sub_0803EA64 - cmp r0, #0 - bne _0803E6B0 -_0803E6A4: - movs r0, #4 - strb r0, [r4, #0xc] - adds r1, r4, #0 - adds r1, #0x7b - movs r0, #0 - strb r0, [r1] -_0803E6B0: - pop {r4, pc} - .align 2, 0 - - thumb_func_start sub_0803E6B4 -sub_0803E6B4: @ 0x0803E6B4 - push {r4, lr} - adds r4, r0, #0 - adds r1, r4, #0 - adds r1, #0x7c - ldrb r0, [r1] - subs r0, #0xa - strb r0, [r1] - adds r0, r4, #0 - bl sub_0803E9A4 - adds r1, r4, #0 - adds r1, #0x7e - ldrb r0, [r1] - cmp r0, #0x20 - bls _0803E6D8 - subs r0, #1 - strb r0, [r1] - b _0803E6DE -_0803E6D8: - adds r0, r4, #0 - bl sub_0803E86C -_0803E6DE: - pop {r4, pc} - - thumb_func_start sub_0803E6E0 -sub_0803E6E0: @ 0x0803E6E0 - push {r4, lr} - adds r4, r0, #0 - adds r0, #0x7c - ldrb r1, [r0] - subs r1, #0xc - strb r1, [r0] - adds r0, r4, #0 - bl sub_0803E9A4 - adds r1, r4, #0 - adds r1, #0x7e - ldrb r0, [r1] - subs r0, #4 - strb r0, [r1] - lsls r0, r0, #0x18 - cmp r0, #0 - bgt _0803E718 - movs r0, #0 - strb r0, [r1] - movs r0, #6 - strb r0, [r4, #0xc] - movs r0, #0x1e - strb r0, [r4, #0xe] - ldrb r1, [r4, #0x14] - adds r1, #0x20 - adds r0, r4, #0 - bl InitAnimationForceUpdate -_0803E718: - pop {r4, pc} - .align 2, 0 - - thumb_func_start sub_0803E71C -sub_0803E71C: @ 0x0803E71C - push {lr} - adds r2, r0, #0 - ldrb r0, [r2, #0xe] - subs r0, #1 - strb r0, [r2, #0xe] - lsls r0, r0, #0x18 - lsrs r3, r0, #0x18 - cmp r3, #0 - bne _0803E756 - movs r0, #7 - strb r0, [r2, #0xc] - movs r0, #1 - strb r0, [r2, #0xe] - ldr r1, _0803E758 @ =gUnk_080D0724 - ldrb r0, [r2, #0x14] - adds r0, r0, r1 - ldrb r1, [r0] - adds r0, r2, #0 - adds r0, #0x7c - strb r1, [r0] - subs r0, #1 - strb r3, [r0] - adds r1, r2, #0 - adds r1, #0x7f - movs r0, #0xf6 - strb r0, [r1] - adds r0, #0x65 - bl EnqueueSFX -_0803E756: - pop {pc} - .align 2, 0 -_0803E758: .4byte gUnk_080D0724 - - thumb_func_start sub_0803E75C -sub_0803E75C: @ 0x0803E75C - push {lr} - adds r2, r0, #0 - adds r0, #0x5a - ldrb r1, [r0] - movs r0, #0x80 - ands r0, r1 - cmp r0, #0 - bne _0803E774 - adds r0, r2, #0 - bl UpdateAnimationSingleFrame - b _0803E7B0 -_0803E774: - ldrb r0, [r2, #0xe] - subs r0, #1 - strb r0, [r2, #0xe] - lsls r0, r0, #0x18 - adds r1, r2, #0 - adds r1, #0x7f - cmp r0, #0 - bne _0803E78E - movs r0, #2 - strb r0, [r2, #0xe] - ldrb r0, [r1] - adds r0, #1 - strb r0, [r1] -_0803E78E: - ldrb r0, [r1] - cmp r0, #0 - beq _0803E7A0 - adds r1, r2, #0 - adds r1, #0x7e - ldrb r0, [r1] - adds r0, #5 - strb r0, [r1] - b _0803E7B0 -_0803E7A0: - movs r0, #8 - strb r0, [r2, #0xc] - movs r0, #0x1e - strb r0, [r2, #0xe] - movs r0, #8 - movs r1, #0 - bl InitScreenShake -_0803E7B0: - pop {pc} - .align 2, 0 - - thumb_func_start sub_0803E7B4 -sub_0803E7B4: @ 0x0803E7B4 - 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 _0803E7C8 - movs r0, #9 - strb r0, [r1, #0xc] -_0803E7C8: - pop {pc} - .align 2, 0 - - thumb_func_start sub_0803E7CC -sub_0803E7CC: @ 0x0803E7CC - push {lr} - adds r2, r0, #0 - adds r1, r2, #0 - adds r1, #0x7e - ldrb r0, [r1] - subs r0, #2 - strb r0, [r1] - lsls r0, r0, #0x18 - lsrs r0, r0, #0x18 - cmp r0, #0xa - bhi _0803E806 - movs r0, #0xa - strb r0, [r2, #0xc] - movs r0, #0x5a - strb r0, [r2, #0xe] - ldrb r0, [r2, #0x14] - lsls r0, r0, #3 - strb r0, [r2, #0x15] - subs r1, #2 - movs r0, #0 - strb r0, [r1] - adds r1, #3 - movs r0, #0xfe - strb r0, [r1] - adds r0, r2, #0 - movs r1, #0x10 - bl sub_0803E94C - b _0803E814 -_0803E806: - cmp r0, #0x12 - bhi _0803E814 - ldr r2, [r2, #0x54] - ldrb r1, [r2, #0x10] - movs r0, #0x7f - ands r0, r1 - strb r0, [r2, #0x10] -_0803E814: - pop {pc} - .align 2, 0 - - thumb_func_start sub_0803E818 -sub_0803E818: @ 0x0803E818 - push {r4, lr} - adds r4, r0, #0 - ldrb r0, [r4, #0xe] - cmp r0, #0 - beq _0803E840 - subs r0, #1 - strb r0, [r4, #0xe] - lsls r0, r0, #0x18 - cmp r0, #0 - bne _0803E868 - ldr r0, [r4, #0x54] - ldrb r1, [r0, #0x10] - movs r2, #0x80 - orrs r1, r2 - strb r1, [r0, #0x10] - adds r0, r4, #0 - movs r1, #0 - bl sub_0803E94C - b _0803E868 -_0803E840: - adds r1, r4, #0 - adds r1, #0x7c - ldrb r0, [r1] - subs r0, #0xa - strb r0, [r1] - adds r0, r4, #0 - bl sub_0803E9A4 - adds r1, r4, #0 - adds r1, #0x7e - ldrb r0, [r1] - adds r0, #1 - strb r0, [r1] - lsls r0, r0, #0x18 - lsrs r0, r0, #0x18 - cmp r0, #0x1f - bls _0803E868 - adds r0, r4, #0 - bl sub_0803E86C -_0803E868: - pop {r4, pc} - .align 2, 0 - - thumb_func_start sub_0803E86C -sub_0803E86C: @ 0x0803E86C - push {r4, lr} - adds r4, r0, #0 - movs r1, #1 - bl sub_08049FDC - cmp r0, #0 - beq _0803E898 - adds r0, r4, #0 - movs r1, #0x50 - bl sub_0803EAD0 - cmp r0, #0 - beq _0803E898 - ldr r0, _0803E8C4 @ =gUnk_020000B0 - ldr r1, [r0] - adds r0, r4, #0 - bl GetFacingDirection - adds r0, #4 - movs r1, #0x18 - ands r0, r1 - strb r0, [r4, #0x15] -_0803E898: - movs r0, #1 - strb r0, [r4, #0xc] - bl Random - ldr r2, _0803E8C8 @ =gUnk_080D0728 - movs r1, #3 - ands r1, r0 - lsls r1, r1, #1 - adds r1, r1, r2 - ldrh r1, [r1] - adds r0, r4, #0 - adds r0, #0x78 - strh r1, [r0] - adds r1, r4, #0 - adds r1, #0x7a - movs r0, #4 - strb r0, [r1] - adds r0, r4, #0 - movs r1, #0 - bl sub_0803E94C - pop {r4, pc} - .align 2, 0 -_0803E8C4: .4byte gUnk_020000B0 -_0803E8C8: .4byte gUnk_080D0728 - - thumb_func_start sub_0803E8CC -sub_0803E8CC: @ 0x0803E8CC - push {r4, r5, lr} - adds r4, r0, #0 - bl Random - adds r5, r0, #0 - adds r0, r4, #0 - bl sub_08049FA0 - cmp r0, #0 - bne _0803E8F4 - movs r0, #3 - ands r0, r5 - cmp r0, #0 - beq _0803E8F4 - adds r0, r4, #0 - bl sub_08049EE4 - adds r0, #4 - movs r1, #0x18 - b _0803E8F8 -_0803E8F4: - movs r1, #0x18 - adds r0, r5, #0 -_0803E8F8: - ands r0, r1 - strb r0, [r4, #0x15] - movs r0, #2 - strb r0, [r4, #0xc] - ldr r2, _0803E928 @ =gUnk_080D0730 - lsrs r0, r5, #0x10 - movs r1, #3 - ands r0, r1 - lsls r0, r0, #1 - adds r0, r0, r2 - ldrh r1, [r0] - adds r0, r4, #0 - adds r0, #0x78 - strh r1, [r0] - adds r1, r4, #0 - adds r1, #0x7a - movs r0, #4 - strb r0, [r1] - adds r0, r4, #0 - movs r1, #0x10 - bl sub_0803E94C - pop {r4, r5, pc} - .align 2, 0 -_0803E928: .4byte gUnk_080D0730 - - thumb_func_start sub_0803E92C -sub_0803E92C: @ 0x0803E92C - push {r4, lr} - adds r4, r0, #0 - bl Random - movs r1, #1 - ands r1, r0 - cmp r1, #0 - beq _0803E944 - adds r0, r4, #0 - bl sub_0803E86C - b _0803E94A -_0803E944: - adds r0, r4, #0 - bl sub_0803E8CC -_0803E94A: - pop {r4, pc} - - thumb_func_start sub_0803E94C -sub_0803E94C: @ 0x0803E94C - push {r4, r5, r6, lr} - adds r3, r0, #0 - adds r6, r1, #0 - ldrb r2, [r3, #0x15] - adds r0, r2, #4 - movs r1, #0x18 - ands r0, r1 - asrs r4, r0, #3 - adds r0, r3, #0 - adds r0, #0x58 - ldrb r1, [r0] - movs r0, #0x10 - ands r0, r1 - lsls r0, r0, #0x18 - lsrs r0, r0, #0x18 - cmp r0, r6 - bne _0803E988 - movs r0, #7 - ands r0, r2 - ldrb r5, [r3, #0x14] - cmp r0, #4 - bne _0803E984 - lsrs r0, r2, #3 - subs r0, r5, r0 - movs r1, #3 - ands r0, r1 - cmp r0, #1 - ble _0803E9A2 -_0803E984: - cmp r4, r5 - beq _0803E9A2 -_0803E988: - strb r4, [r3, #0x14] - adds r0, r3, #0 - adds r0, #0x58 - ldrb r1, [r0] - movs r0, #3 - ands r0, r1 - adds r0, r6, r0 - lsls r1, r4, #2 - adds r4, r0, r1 - adds r0, r3, #0 - adds r1, r4, #0 - bl InitAnimationForceUpdate -_0803E9A2: - pop {r4, r5, r6, pc} - - thumb_func_start sub_0803E9A4 -sub_0803E9A4: @ 0x0803E9A4 - push {r4, lr} - adds r2, r0, #0 - adds r0, #0x7c - ldrb r0, [r0] - adds r0, #0x20 - movs r1, #0xff - ands r0, r1 - asrs r4, r0, #6 - adds r3, r2, #0 - adds r3, #0x58 - ldrb r1, [r3] - movs r0, #3 - ands r0, r1 - cmp r0, r4 - beq _0803E9D2 - ldrb r1, [r3] - movs r0, #4 - rsbs r0, r0, #0 - ands r1, r0 - adds r1, r4, r1 - adds r0, r2, #0 - bl InitAnimationForceUpdate -_0803E9D2: - pop {r4, pc} - - thumb_func_start sub_0803E9D4 -sub_0803E9D4: @ 0x0803E9D4 - push {r4, lr} - adds r4, r0, #0 - movs r1, #1 - bl sub_08049FDC - cmp r0, #0 - beq _0803EA58 - adds r0, r4, #0 - movs r1, #0x38 - bl sub_0803EAD0 - cmp r0, #0 - beq _0803EA10 - movs r0, #3 - strb r0, [r4, #0xc] - ldr r0, _0803EA0C @ =gUnk_020000B0 - ldr r1, [r0] - adds r0, r4, #0 - bl GetFacingDirection - adds r0, #4 - movs r1, #0x18 - ands r0, r1 - strb r0, [r4, #0x15] - adds r1, r4, #0 - adds r1, #0x7b - movs r0, #1 - b _0803EA46 - .align 2, 0 -_0803EA0C: .4byte gUnk_020000B0 -_0803EA10: - adds r0, r4, #0 - movs r1, #0x4e - bl sub_0803EAD0 - cmp r0, #0 - beq _0803EA58 - ldr r0, _0803EA54 @ =gUnk_020000B0 - ldr r1, [r0] - adds r0, r4, #0 - movs r2, #0x12 - bl sub_0804A044 - adds r2, r0, #0 - cmp r2, #0xff - beq _0803EA58 - adds r1, r4, #0 - adds r1, #0x7a - ldrb r0, [r1] - subs r0, #1 - strb r0, [r1] - lsls r0, r0, #0x18 - cmp r0, #0 - bne _0803EA60 - movs r0, #5 - strb r0, [r4, #0xc] - strb r2, [r4, #0x15] - movs r0, #4 -_0803EA46: - strb r0, [r1] - adds r0, r4, #0 - movs r1, #0 - bl sub_0803E94C - movs r0, #1 - b _0803EA62 - .align 2, 0 -_0803EA54: .4byte gUnk_020000B0 -_0803EA58: - adds r1, r4, #0 - adds r1, #0x7a - movs r0, #4 - strb r0, [r1] -_0803EA60: - movs r0, #0 -_0803EA62: - pop {r4, pc} - - thumb_func_start sub_0803EA64 -sub_0803EA64: @ 0x0803EA64 - push {r4, lr} - adds r4, r0, #0 - movs r1, #1 - bl sub_08049FDC - cmp r0, #0 - beq _0803EAC4 - adds r0, r4, #0 - movs r1, #0x4e - bl sub_0803EAD0 - cmp r0, #0 - beq _0803EAB8 - ldr r0, _0803EAB4 @ =gUnk_020000B0 - ldr r1, [r0] - adds r0, r4, #0 - movs r2, #0x12 - bl sub_0804A044 - adds r2, r0, #0 - cmp r2, #0xff - beq _0803EAB8 - adds r1, r4, #0 - adds r1, #0x7a - ldrb r0, [r1] - subs r0, #1 - strb r0, [r1] - lsls r0, r0, #0x18 - cmp r0, #0 - bne _0803EAAE - movs r0, #5 - strb r0, [r4, #0xc] - strb r2, [r4, #0x15] - adds r0, r4, #0 - movs r1, #0 - bl sub_0803E94C -_0803EAAE: - movs r0, #1 - b _0803EACE - .align 2, 0 -_0803EAB4: .4byte gUnk_020000B0 -_0803EAB8: - adds r0, r4, #0 - movs r1, #0x38 - bl sub_0803EAD0 - cmp r0, #0 - bne _0803EAAE -_0803EAC4: - adds r1, r4, #0 - adds r1, #0x7a - movs r0, #4 - strb r0, [r1] - movs r0, #0 -_0803EACE: - pop {r4, pc} - - thumb_func_start sub_0803EAD0 -sub_0803EAD0: @ 0x0803EAD0 - push {r4, lr} - adds r3, r1, #0 - ldr r1, _0803EAE8 @ =gUnk_020000B0 - ldr r2, [r1] - movs r4, #0x2e - ldrsh r1, [r2, r4] - movs r4, #0x32 - ldrsh r2, [r2, r4] - subs r2, #4 - bl EntityWithinDistance - pop {r4, pc} - .align 2, 0 -_0803EAE8: .4byte gUnk_020000B0 diff --git a/asm/non_matching/playerItem3/sub_0801B4C8.inc b/asm/non_matching/playerItem3/sub_0801B4C8.inc index 3752815f..3e0c5ca0 100644 --- a/asm/non_matching/playerItem3/sub_0801B4C8.inc +++ b/asm/non_matching/playerItem3/sub_0801B4C8.inc @@ -200,4 +200,4 @@ _0801B56C: bl sub_0801B584 pop {r4, r5, pc} .syntax divided -.endif \ No newline at end of file +.endif diff --git a/asm/object/object2A.s b/asm/object/object2A.s deleted file mode 100644 index d43ecb9c..00000000 --- a/asm/object/object2A.s +++ /dev/null @@ -1,145 +0,0 @@ - .include "asm/macros.inc" - - .include "constants/constants.inc" - - .syntax unified - - .text - - - thumb_func_start sub_08089BA0 -sub_08089BA0: @ 0x08089BA0 - push {r4, r5, r6, lr} - adds r5, r0, #0 - bl GetNextFrame - ldrb r0, [r5, #0xa] - cmp r0, #4 - bhi _08089BD0 - lsls r0, r0, #2 - ldr r1, _08089BB8 @ =_08089BBC - adds r0, r0, r1 - ldr r0, [r0] - mov pc, r0 - .align 2, 0 -_08089BB8: .4byte _08089BBC -_08089BBC: @ jump table - .4byte _08089BD0 @ case 0 - .4byte _08089BD6 @ case 1 - .4byte _08089BD6 @ case 2 - .4byte _08089C4C @ case 3 - .4byte _08089C72 @ case 4 -_08089BD0: - ldrb r0, [r5, #0xb] - cmp r0, #0 - beq _08089CBA -_08089BD6: - ldrb r0, [r5, #0xe] - subs r0, #1 - strb r0, [r5, #0xe] - lsls r0, r0, #0x18 - lsrs r0, r0, #0x18 - cmp r0, #0xff - bne _08089CBA - ldrb r0, [r5, #0xa] - cmp r0, #2 - bne _08089C42 - ldr r0, [r5, #0x54] - ldrh r0, [r0, #6] - movs r2, #0x2e - ldrsh r1, [r5, r2] - ldr r3, _08089C48 @ =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 sub_0807B7D8 - adds r0, r5, #0 - movs r1, #0 - movs r2, #0x10 - bl sub_0807AB44 - subs r4, #0x4f - adds r0, r5, #0 - movs r1, #0 - adds r2, r4, #0 - bl sub_0807AB44 - adds r0, r5, #0 - movs r1, #0x10 - movs r2, #0 - bl sub_0807AB44 - adds r0, r5, #0 - adds r1, r4, #0 - movs r2, #0 - bl sub_0807AB44 -_08089C42: - bl DeleteThisEntity - b _08089CBA - .align 2, 0 -_08089C48: .4byte gRoomControls -_08089C4C: - ldr r0, [r5, #0x50] - ldr r0, [r0, #4] - cmp r0, #0 - bne _08089C58 - bl DeleteThisEntity -_08089C58: - ldrb r0, [r5, #0xe] - subs r0, #1 - strb r0, [r5, #0xe] - lsls r0, r0, #0x18 - cmp r0, #0 - bne _08089C68 - bl DeleteThisEntity -_08089C68: - ldr r0, [r5, #0x50] - adds r1, r5, #0 - bl CopyPosition - b _08089CBA -_08089C72: - adds r0, r5, #0 - adds r0, #0x86 - ldrh r0, [r0] - bl CheckFlags - adds r1, r0, #0 - ldrb r0, [r5, #0xd] - cmp r0, #0 - bne _08089C96 - cmp r1, #0 - bne _08089CBA - movs r0, #1 - strb r0, [r5, #0xd] - ldrb r1, [r5, #0x18] - subs r0, #5 - ands r0, r1 - strb r0, [r5, #0x18] - b _08089CBA -_08089C96: - cmp r1, #0 - beq _08089CBA - movs r0, #0 - strb r0, [r5, #0xd] - ldrb r1, [r5, #0x18] - subs r0, #4 - ands r0, r1 - movs r1, #1 - orrs r0, r1 - strb r0, [r5, #0x18] - adds r0, r5, #0 - movs r1, #0 - bl InitializeAnimation - movs r0, #0x92 - lsls r0, r0, #1 - bl EnqueueSFX -_08089CBA: - pop {r4, r5, r6, pc} diff --git a/assets/assets.json b/assets/assets.json index f373e164..76ffe1f1 100644 --- a/assets/assets.json +++ b/assets/assets.json @@ -27771,11 +27771,6 @@ "size": 13, "type": "animation" }, - { - "path": "ballChainSoldier/gUnk_080D0724.bin", - "start": 853796, - "size": 4 - }, { "path": "ballChainSoldier/gUnk_080D0728.bin", "start": 853800, diff --git a/data/const/enemy/ballChainSoldier.s b/data/const/enemy/ballChainSoldier.s index 69e8693f..e5f1597a 100644 --- a/data/const/enemy/ballChainSoldier.s +++ b/data/const/enemy/ballChainSoldier.s @@ -4,36 +4,6 @@ .section .rodata .align 2 -gUnk_080D06E0:: @ 080D06E0 - .4byte sub_0803E538 - .4byte sub_0803E550 - .4byte sub_0803E560 - .4byte sub_0803E570 - .4byte sub_08001242 - .4byte nullsub_20 - -gUnk_080D06F8:: @ 080D06F8 - .4byte sub_0803E580 - .4byte sub_0803E5E8 - .4byte sub_0803E61C - .4byte sub_0803E66C - .4byte sub_0803E6B4 - .4byte sub_0803E6E0 - .4byte sub_0803E71C - .4byte sub_0803E75C - .4byte sub_0803E7B4 - .4byte sub_0803E7CC - .4byte sub_0803E818 - -gUnk_080D0724:: @ 080D0724 - .incbin "ballChainSoldier/gUnk_080D0724.bin" - -gUnk_080D0728:: @ 080D0728 - .incbin "ballChainSoldier/gUnk_080D0728.bin" - -gUnk_080D0730:: @ 080D0730 - .incbin "ballChainSoldier/gUnk_080D0730.bin" - gSpriteAnimations_BallChainSoldier_3:: @ 080D0738 .include "animations/gSpriteAnimations_BallChainSoldier_3.s" diff --git a/data/const/object/object2A.s b/data/const/object/object2A.s deleted file mode 100644 index d94ddbf4..00000000 --- a/data/const/object/object2A.s +++ /dev/null @@ -1,9 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - .align 2 - -gUnk_08120DD0:: @ 08120DD0 - .4byte sub_08089B18 - .4byte sub_08089BA0 diff --git a/linker.ld b/linker.ld index 90d04c6d..096c61df 100644 --- a/linker.ld +++ b/linker.ld @@ -399,7 +399,7 @@ SECTIONS { src/enemy/torchTrap.o(.text); src/enemy/vaatiRebornEnemy.o(.text); src/enemy/vaatiProjectile.o(.text); - asm/enemy/ballChainSoldier.o(.text); + src/enemy/ballChainSoldier.o(.text); src/enemy/enemy4D.o(.text); asm/enemy/enemy4D.o(.text); asm/enemy/ghini.o(.text); @@ -687,7 +687,6 @@ SECTIONS { asm/object/object28.o(.text); asm/object/ambientClouds.o(.text); src/object/object2A.o(.text); - asm/object/object2A.o(.text); asm/object/object2B.o(.text); asm/object/beanstalk.o(.text); src/object/smoke.o(.text); @@ -1076,6 +1075,7 @@ SECTIONS { data/animations/enemy/vaatiRebornEnemy.o(.rodata); src/enemy/vaatiProjectile.o(.rodata); data/animations/enemy/vaatiProjectile.o(.rodata); + src/enemy/ballChainSoldier.o(.rodata); data/const/enemy/ballChainSoldier.o(.rodata); data/animations/enemy/ballChainSoldier.o(.rodata); data/const/enemy/enemy4D.o(.rodata); @@ -1411,7 +1411,7 @@ SECTIONS { data/animations/object/pushableStatue.o(.rodata); data/const/object/ambientClouds.o(.rodata); data/animations/object/ambientClouds.o(.rodata); - data/const/object/object2A.o(.rodata); + src/object/object2A.o(.rodata); data/animations/object/object2A.o(.rodata); data/const/object/beanstalk.o(.rodata); data/animations/object/beanstalk.o(.rodata); diff --git a/src/code_08077B98.c b/src/code_08077B98.c index 2bf372a2..7ef7687e 100644 --- a/src/code_08077B98.c +++ b/src/code_08077B98.c @@ -26,7 +26,7 @@ void sub_08077BB8(ItemBehavior* beh) { UnkItemStruct* unk = (UnkItemStruct*)beh; // @nocheckin Entity* temp = sub_08077C54(unk); if (temp != NULL) { - temp->flags = 0x20; + temp->flags = ENT_PERSIST; } gPlayerState.item = temp; } @@ -92,7 +92,7 @@ Entity* CreatePlayerItem(u32 subtype, u32 form, u32 parameter, u32 unk) { ent = GetEmptyEntity(); if (ent != NULL) { - ent->flags = 0x80; + ent->flags = ENT_COLLIDE; ent->kind = PLAYER_ITEM; ent->id = subtype; ent->type = form; @@ -108,7 +108,7 @@ Entity* sub_08077CF8(u32 subtype, u32 form, u32 parameter, u32 unk) { ent = sub_0805E744(); if (ent != NULL) { - ent->flags = 0x80; + ent->flags = ENT_COLLIDE; ent->kind = PLAYER_ITEM; ent->id = subtype; ent->type = form; diff --git a/src/collision.c b/src/collision.c index 80f83af6..4af9296e 100644 --- a/src/collision.c +++ b/src/collision.c @@ -231,7 +231,7 @@ s32 sub_08017874(Entity* a, Entity* b) { if (newDmg <= 0) newDmg = 1; v5 = ModHealth(-newDmg); - SoundReqClipped(a, 122); + SoundReqClipped(a, SFX_PLY_VO6); } else { v6 = b->damage; if (b->kind == PLAYER_ITEM) { @@ -247,9 +247,9 @@ s32 sub_08017874(Entity* a, Entity* b) { v5 = a->health - v6; if (a->kind == ENEMY) { if ((a->field_0x6c.HALF.HI & 1) != 0) - SoundReqClipped(a, 295); + SoundReqClipped(a, SFX_BOSS_HIT); else - SoundReqClipped(a, 254); + SoundReqClipped(a, SFX_HIT); } } if (v5 <= 0) { @@ -750,7 +750,7 @@ s32 sub_08018308(Entity* org, Entity* tgt, u32 direction, ColSettings* settings) } } else if (org->id == 3) { if (settings->_9) { - SoundReqClipped(tgt, 254); + SoundReqClipped(tgt, SFX_HIT); } } else if (org->id == 5) { gPlayerEntity.iframes = 0x80; diff --git a/src/enemy/acroBandits.c b/src/enemy/acroBandits.c index 40338ad7..1df406b1 100644 --- a/src/enemy/acroBandits.c +++ b/src/enemy/acroBandits.c @@ -330,7 +330,7 @@ void sub_08031EE8(Entity* this) { if (this->z.HALF.HI < 1) { draw = this->spriteSettings.draw; if (!draw) - EnqueueSFX(299); + EnqueueSFX(SFX_12B); this->spriteSettings.draw = 1; } diff --git a/src/enemy/ballChainSoldier.c b/src/enemy/ballChainSoldier.c new file mode 100644 index 00000000..dad421f3 --- /dev/null +++ b/src/enemy/ballChainSoldier.c @@ -0,0 +1,342 @@ +#define NENT_DEPRECATED +#include "entity.h" +#include "enemy.h" +#include "functions.h" + +typedef struct { + Entity base; + u8 filler[0x10]; + u16 unk_78; + u8 unk_7a; + u8 unk_7b; + u8 unk_7c; + u8 unk_7d; + u8 unk_7e; + u8 unk_7f; +} BallChainSoldierEntity; + +extern Entity* gUnk_020000B0; + +void (*const gUnk_080D06E0[])(BallChainSoldierEntity*); +void (*const gUnk_080D06F8[])(BallChainSoldierEntity*); +const u8 gUnk_080D0724[]; +const u16 gUnk_080D0728[]; +const u16 gUnk_080D0730[]; + +extern u32 sub_0804A044(Entity*, Entity*, u32); +extern void sub_0803E86C(BallChainSoldierEntity*); +extern void sub_0803E9A4(BallChainSoldierEntity*); +extern bool32 sub_0803E9D4(BallChainSoldierEntity*); +extern void sub_0803E8CC(BallChainSoldierEntity*); +extern void sub_0803E92C(BallChainSoldierEntity*); +extern bool32 sub_0803EA64(BallChainSoldierEntity*); +extern void sub_0803E94C(BallChainSoldierEntity*, u32); +extern bool32 sub_0803EAD0(BallChainSoldierEntity*, u32); + +void BallChainSoldier(Entity* this) { + EnemyFunctionHandler(this, (EntityActionArray)gUnk_080D06E0); +} + +void sub_0803E538(BallChainSoldierEntity* this) { + gUnk_080D06F8[super->action](this); +} + +void sub_0803E550(BallChainSoldierEntity* this) { + sub_0804AA30(super, gUnk_080D06E0); +} + +void sub_0803E560(BallChainSoldierEntity* this) { + sub_08001324(super); + sub_0803E538(this); +} + +void BallChainSoldier_CreateDeathFx(BallChainSoldierEntity* this) { + CreateDeathFx(super, 0xff, 0x57); +} + +void nullsub_20(BallChainSoldierEntity* this) { +} + +void BallChainSoldier_Init(BallChainSoldierEntity* this) { + Entity* ent; + sub_0804A720(super); + ent = CreateProjectileWithParent(super, BALL_AND_CHAIN, 0); + if (ent == NULL) + return; + + ent->parent = super; + super->child = ent; + COLLISION_ON(super); + super->spriteSettings.draw = 1; + super->animationState = Random() & 3; + this->unk_7b = 0; + this->unk_7c = 0; + this->unk_7e = 0x20; + this->unk_7f = 0xfe; + InitAnimationForceUpdate(super, super->animationState << 2); + sub_0803E86C(this); +} + +void sub_0803E5E8(BallChainSoldierEntity* this) { + this->unk_7c -= 0xa; + sub_0803E9A4(this); + if (sub_0803E9D4(this) == 0) { + if (--this->unk_78 == 0) { + sub_0803E8CC(this); + } + } +} + +void sub_0803E61C(BallChainSoldierEntity* this) { + this->unk_7c -= 0xa; + sub_0803E9A4(this); + if (sub_0803E9D4(this) == 0) { + if (super->knockbackDuration == 0) { + if (ProcessMovement(super) == 0) { + sub_0803E86C(this); + return; + } + } + + if (--this->unk_78 == 0) { + sub_0803E92C(this); + } + } +} + +void sub_0803E66C(BallChainSoldierEntity* this) { + this->unk_7c -= 0x10; + sub_0803E9A4(this); + if (this->unk_7e <= 0x21) { + this->unk_7e++; + } + + if (!sub_08049FDC(super, 1) || sub_0803EA64(this) == 0) { + super->action = 4; + this->unk_7b = 0; + } +} + +void sub_0803E6B4(BallChainSoldierEntity* this) { + this->unk_7c -= 0xa; + sub_0803E9A4(this); + if (this->unk_7e > 0x20) { + this->unk_7e--; + } else { + sub_0803E86C(this); + } +} + +void sub_0803E6E0(BallChainSoldierEntity* this) { + this->unk_7c -= 0xc; + sub_0803E9A4(this); + this->unk_7e -= 4; + if ((s8)this->unk_7e <= 0) { + this->unk_7e = 0; + super->action = 6; + super->actionDelay = 0x1e; + InitAnimationForceUpdate(super, super->animationState + 0x20); + } +} + +void sub_0803E71C(BallChainSoldierEntity* this) { + if (--super->actionDelay == 0) { + super->action = 7; + super->actionDelay = 1; + this->unk_7c = gUnk_080D0724[super->animationState]; + this->unk_7b = 0; + this->unk_7f = 0xf6; + EnqueueSFX(SFX_15B); + } +} + +void sub_0803E75C(BallChainSoldierEntity* this) { + if ((super->frame & 0x80) == 0) { + UpdateAnimationSingleFrame(super); + } else { + if (--super->actionDelay == 0) { + super->actionDelay = 2; + this->unk_7f++; + } + + if (this->unk_7f) { + this->unk_7e += 5; + } else { + super->action = 8; + super->actionDelay = 0x1e; + InitScreenShake(8, 0); + } + } +} + +void sub_0803E7B4(BallChainSoldierEntity* this) { + if (--super->actionDelay == 0) { + super->action = 9; + } +} + +void sub_0803E7CC(BallChainSoldierEntity* this) { + this->unk_7e -= 2; + if (this->unk_7e <= 0xa) { + super->action = 0xa; + super->actionDelay = 0x5a; + super->direction = DirectionFromAnimationState(super->animationState); + this->unk_7c = 0; + this->unk_7f = 0xfe; + sub_0803E94C(this, 0x10); + } else if (this->unk_7e <= 0x12) { + COLLISION_OFF(super->child); + } +} + +void sub_0803E818(BallChainSoldierEntity* this) { + if (super->actionDelay) { + if (--super->actionDelay == 0) { + COLLISION_ON(super->child); + sub_0803E94C(this, 0); + } + } else { + this->unk_7c -= 0xa; + sub_0803E9A4(this); + if (++this->unk_7e > 0x1f) { + sub_0803E86C(this); + } + } +} + +void sub_0803E86C(BallChainSoldierEntity* this) { + if (sub_08049FDC(super, 1) && sub_0803EAD0(this, 0x50)) { + super->direction = DirectionRoundUp(GetFacingDirection(super, gUnk_020000B0)); + } + + super->action = 1; + this->unk_78 = gUnk_080D0728[Random() & 3]; + this->unk_7a = 4; + sub_0803E94C(this, 0); +} + +void sub_0803E8CC(BallChainSoldierEntity* this) { + u32 rand = Random(); + u32 temp; + u32 dir; + if (sub_08049FA0(super) == 0 && (rand & 3)) { + dir = sub_08049EE4(super) + 4; + temp = 0x18; + } else { + temp = 0x18; + dir = rand; + } + + super->direction = dir & temp; + super->action = 2; + this->unk_78 = gUnk_080D0730[(rand >> 0x10) & 3]; + this->unk_7a = 4; + sub_0803E94C(this, 0x10); +} + +void sub_0803E92C(BallChainSoldierEntity* this) { + if (Random() & 1) { + sub_0803E86C(this); + } else { + sub_0803E8CC(this); + } +} + +void sub_0803E94C(BallChainSoldierEntity* this, u32 arg2) { + s32 animationState = DirectionToAnimationState(super->direction); + if ((super->animIndex & 0x10) == arg2) { + u32 dir = super->direction & 7; + s32 currentAnimationState = super->animationState; + if (dir == 4) { + if (((currentAnimationState - (super->direction >> 3)) & 3) <= 1) + return; + } + if (animationState == currentAnimationState) + return; + } + + super->animationState = animationState; + animationState = arg2 + (super->animIndex & 3) + animationState * 4; + InitAnimationForceUpdate(super, animationState); +} + +void sub_0803E9A4(BallChainSoldierEntity* this) { + s32 val = ((this->unk_7c + 0x20) & 0xff) >> 6; + if ((super->animIndex & 3) == val) + return; + InitAnimationForceUpdate(super, val + (super->animIndex & -4)); +} + +bool32 sub_0803E9D4(BallChainSoldierEntity* this) { + u32 dir; + if (sub_08049FDC(super, 1)) { + if (sub_0803EAD0(this, 0x38)) { + super->action = 3; + super->direction = DirectionRoundUp(GetFacingDirection(super, gUnk_020000B0)); + this->unk_7b = 1; + sub_0803E94C(this, 0); + return 1; + } else if (sub_0803EAD0(this, 0x4e)) { + dir = sub_0804A044(super, gUnk_020000B0, 0x12); + if (dir != 0xff) { + if (--this->unk_7a != 0) + return 0; + super->action = 5; + super->direction = dir; + this->unk_7a = 4; + sub_0803E94C(this, 0); + return 1; + } + } + } + + this->unk_7a = 4; + return 0; +} + +bool32 sub_0803EA64(BallChainSoldierEntity* this) { + u32 dir; + if (sub_08049FDC(super, 1)) { + if (sub_0803EAD0(this, 0x4e)) { + dir = sub_0804A044(super, gUnk_020000B0, 0x12); + if (dir != 0xff) { + if (--this->unk_7a != 0) + return 1; + super->action = 5; + super->direction = dir; + sub_0803E94C(this, 0); + return 1; + } + } + + if (sub_0803EAD0(this, 0x38)) + return 1; + } + + this->unk_7a = 4; + return 0; +} + +bool32 sub_0803EAD0(BallChainSoldierEntity* this, u32 distance) { + return EntityWithinDistance(super, gUnk_020000B0->x.HALF.HI, gUnk_020000B0->y.HALF.HI - 4, distance); +} + +void (*const gUnk_080D06E0[])(BallChainSoldierEntity*) = { + sub_0803E538, + sub_0803E550, + sub_0803E560, + BallChainSoldier_CreateDeathFx, + (void (*const)(BallChainSoldierEntity*))sub_08001242, + nullsub_20, +}; + +void (*const gUnk_080D06F8[])(BallChainSoldierEntity*) = { + BallChainSoldier_Init, sub_0803E5E8, sub_0803E61C, sub_0803E66C, sub_0803E6B4, sub_0803E6E0, + sub_0803E71C, sub_0803E75C, sub_0803E7B4, sub_0803E7CC, sub_0803E818, +}; + +const u8 gUnk_080D0724[] = { 0, 0x44, 0x80, 0xBC }; + +const u16 gUnk_080D0728[] = { 0x1E, 0x32, 0x46, 0x5A }; + +const u16 gUnk_080D0730[] = { 0x3C, 0x5A, 0x78, 0x96 }; diff --git a/src/enemy/beetle.c b/src/enemy/beetle.c index e01f69d1..6b5ddbb6 100644 --- a/src/enemy/beetle.c +++ b/src/enemy/beetle.c @@ -137,7 +137,7 @@ void sub_08021984(Entity* this) { this->z.HALF.HI = -0x80; this->spriteRendering.b3 = 1; this->spriteOrientation.flipY = 1; - EnqueueSFX(0x12d); + EnqueueSFX(SFX_12D); } if (GravityUpdate(this, 0x1800) == 0) { @@ -204,7 +204,7 @@ void sub_08021AD8(Entity* this) { return; } this->direction = (u8)tmp; - EnqueueSFX(0x7c); + EnqueueSFX(SFX_PLY_JUMP); } sub_080AEFE0(this); if (!GravityUpdate(this, 0x1800)) diff --git a/src/enemy/bladeTrap.c b/src/enemy/bladeTrap.c index 815b0dcd..3af99a33 100644 --- a/src/enemy/bladeTrap.c +++ b/src/enemy/bladeTrap.c @@ -24,7 +24,7 @@ void BladeTrap(Entity* this) { if (!(--this->field_0x74.HWORD)) { if (!(this->direction & 0x80)) { - EnqueueSFX(0x74); + EnqueueSFX(SFX_METAL_CLINK); } sub_080A2CC0(this, &this->child, &this->field_0x74.HWORD); } diff --git a/src/enemy/bobomb.c b/src/enemy/bobomb.c index ef6c9dcf..116febb2 100644 --- a/src/enemy/bobomb.c +++ b/src/enemy/bobomb.c @@ -55,7 +55,7 @@ void sub_0802C688(Entity* this) { switch (this->field_0x82.HALF.LO) { case 1: sub_0802CB68(this); - EnqueueSFX(0x14d); + EnqueueSFX(SFX_14D); break; case 2: this->action = 3; @@ -245,7 +245,7 @@ void sub_0802CAF8(Entity* this) { sub_0802CBC4(this); } else { if (this->field_0x80.HALF.HI && sub_080044EC(this, 0x2800) == 1) { - EnqueueSFX(0x104); + EnqueueSFX(SFX_104); } sub_0802CC18(this); sub_08078930(this); @@ -300,7 +300,7 @@ void sub_0802CBC4(Entity* this) { void sub_0802CC18(Entity* this) { if (--this->field_0x80.HALF.LO == 0) { this->field_0x80.HALF.LO = 28; - EnqueueSFX(0x14d); + EnqueueSFX(SFX_14D); } } diff --git a/src/enemy/businessScrub.c b/src/enemy/businessScrub.c index 5a4bb18a..59868dd7 100644 --- a/src/enemy/businessScrub.c +++ b/src/enemy/businessScrub.c @@ -65,7 +65,7 @@ void sub_08028934(Entity* this) { if (pEVar1 != NULL) { pEVar1->z.HALF.HI -= 8; } - EnqueueSFX(0x1bb); + EnqueueSFX(SFX_EM_DEKUSCRUB_HIT); } } diff --git a/src/enemy/chuchu.c b/src/enemy/chuchu.c index c8e7640e..8a5f90fb 100644 --- a/src/enemy/chuchu.c +++ b/src/enemy/chuchu.c @@ -220,7 +220,7 @@ void sub_0801F1B0(Entity* this) { if (this->frame & 1) { this->frame ^= 1; this->hitType = 90; - EnqueueSFX(299); + EnqueueSFX(SFX_12B); } sub_080AEFE0(this); if (GravityUpdate(this, 0x4000) == 0) @@ -416,7 +416,7 @@ void sub_0801F584(Entity* this) { if (this->frame & 0x1) { this->frame ^= 1; this->hitType = 91; - EnqueueSFX(299); + EnqueueSFX(SFX_12B); } sub_080AEFE0(this); if (GravityUpdate(this, 0x4000) == 0) @@ -564,7 +564,7 @@ void sub_0801F884(Entity* this) { ent->type2 = 64; this->action = 4; this->hitType = 165; - EnqueueSFX(0x193); + EnqueueSFX(SFX_193); } } } @@ -593,7 +593,7 @@ void sub_0801F940(Entity* this) { if (this->frame & 0x10) { if (this->frame & 1) { this->frame ^= 1; - EnqueueSFX(299); + EnqueueSFX(SFX_12B); } sub_080AEFE0(this); if (GravityUpdate(this, 0x4000) == 0) diff --git a/src/enemy/cuccoChickAggr.c b/src/enemy/cuccoChickAggr.c index 94326739..5acaf9d3 100644 --- a/src/enemy/cuccoChickAggr.c +++ b/src/enemy/cuccoChickAggr.c @@ -53,7 +53,7 @@ void sub_08022988(Entity* this) { this->frameIndex = 1; this->zVelocity = Q_16_16(1.0); - EnqueueSFX(0xd6); + EnqueueSFX(SFX_VO_CHEEP); } ProcessMovement(this); @@ -79,7 +79,7 @@ void sub_080229F8(Entity* this) { sub_08022B44(this); } else { this->zVelocity = Q_16_16(1.0); - EnqueueSFX(0xd6); + EnqueueSFX(SFX_VO_CHEEP); } } } @@ -147,7 +147,7 @@ void sub_08022B44(Entity* this) { if (this->direction & 0xf) this->spriteSettings.flipX = (this->direction >> 4) ^ 1; - EnqueueSFX(0xd6); + EnqueueSFX(SFX_VO_CHEEP); } // clang-format off diff --git a/src/enemy/curtain.c b/src/enemy/curtain.c index 895a578c..d52c80b3 100644 --- a/src/enemy/curtain.c +++ b/src/enemy/curtain.c @@ -15,7 +15,7 @@ void sub_080481D0(Entity* this) { void sub_080481E8(Entity* this) { if (this->field_0x46) { this->action = 2; - this->flags &= 0x7f; + this->flags &= ~ENT_COLLIDE; this->spritePriority.b0 = 7; this->actionDelay = 3; } else { @@ -36,7 +36,7 @@ void sub_08048224(Entity* this) { this->actionDelay = 0; } else { this->action = 3; - this->flags &= 0x7f; + this->flags &= ~ENT_COLLIDE; this->actionDelay = 1; } diff --git a/src/enemy/darkNut.c b/src/enemy/darkNut.c index 7084ae0c..ad692d3b 100644 --- a/src/enemy/darkNut.c +++ b/src/enemy/darkNut.c @@ -97,7 +97,7 @@ void sub_08020BB8(Entity* this) { } this->action = 10; sub_08021218(this, 0xb, this->animationState); - EnqueueSFX(0x15d); + EnqueueSFX(SFX_15D); sub_08021588(this); break; case 0x4c: @@ -280,7 +280,7 @@ void sub_08021038(Entity* this) { pEVar2->parent = this; this->child = pEVar2; } - EnqueueSFX(270); + EnqueueSFX(SFX_10E); } if (this->frame & 0x80) { @@ -302,7 +302,7 @@ void sub_080210A8(Entity* this) { if (this->frame & 1) { this->frame = 0; sub_08021588(this); - EnqueueSFX(349); + EnqueueSFX(SFX_15D); } else if (this->frame & 0x80) { sub_08021390(this); } @@ -320,7 +320,7 @@ void sub_080210E4(Entity* this) { this->child = ent; } - EnqueueSFX(270); + EnqueueSFX(SFX_10E); } sub_08021644(this); @@ -578,13 +578,13 @@ void sub_0802159C(Entity* this) { ent->parent = this; this->child = ent; } - EnqueueSFX(0x116); + EnqueueSFX(SFX_116); } else if (this->frame == 2) { this->frame = 0; sub_08021588(this); } else if (this->frame & 0x20) { this->frame &= ~0x20; - EnqueueSFX(0x115); + EnqueueSFX(SFX_115); } } @@ -599,7 +599,7 @@ void sub_08021600(Entity* this) { ent->parent = this; this->child = ent; } - EnqueueSFX(0x10e); + EnqueueSFX(SFX_10E); } else if (this->frame == 2) { this->frame = 0; sub_08021588(this); @@ -609,7 +609,7 @@ void sub_08021600(Entity* this) { void sub_08021644(Entity* this) { if (this->frame & 0x20) { this->frame &= ~0x20; - EnqueueSFX(0x7d); + EnqueueSFX(SFX_PLY_LAND); } } diff --git a/src/enemy/doorMimic.c b/src/enemy/doorMimic.c index f1187330..a5b63e9d 100644 --- a/src/enemy/doorMimic.c +++ b/src/enemy/doorMimic.c @@ -91,7 +91,7 @@ void sub_080220F0(Entity* this) { fx->y.HALF.HI += off->v; } } - EnqueueSFX(260); + EnqueueSFX(SFX_104); } else if (this->frame & 1) { this->damage = 4; } diff --git a/src/enemy/fallingBoulder.c b/src/enemy/fallingBoulder.c index aa54cb6e..1bb932af 100644 --- a/src/enemy/fallingBoulder.c +++ b/src/enemy/fallingBoulder.c @@ -80,7 +80,7 @@ NONMATCH("asm/non_matching/fallingBoulder/sub_0802C334.inc", void sub_0802C334(E GetNextFrame(this); this->field_0x7c.HALF.HI = COORD_TO_TILE(this); if (sub_080044EC(this, *(u32*)&this->cutsceneBeh) == 1) { - EnqueueSFX(0x14c); + EnqueueSFX(SFX_14C); COLLISION_ON(this); this->field_0x7a.HWORD = 0xc; sub_0802C4B0(this); diff --git a/src/enemy/gyorgChild.c b/src/enemy/gyorgChild.c index c57e7dce..e260fb25 100644 --- a/src/enemy/gyorgChild.c +++ b/src/enemy/gyorgChild.c @@ -20,7 +20,7 @@ void (*const gUnk_080D1E6C[])(GyorgChildEntity*) = { void GyorgChild(Entity* this) { if (gRoomTransition.field_0x39 == 0) { - this->flags &= ~0x80; + this->flags &= ~ENT_COLLIDE; this->health = 0; this->collisionLayer = 2; } @@ -89,7 +89,7 @@ void sub_080486F4(GyorgChildEntity* this) { s32 r; InitializeAnimation(super, super->animationState); super->action = 1; - super->flags |= 0x80; + super->flags |= ENT_COLLIDE; r = (signed)Random() % 0xB; super->direction += r; super->direction -= 5; @@ -143,7 +143,7 @@ void sub_0804877C(GyorgChildEntity* this) { void sub_0804882C(GyorgChildEntity* this) { if (--super->actionDelay == 0) { super->action = 3; - super->flags |= 0x80; + super->flags |= ENT_COLLIDE; Random(); super->spriteSettings.draw = 1; super->spritePriority.b0 = 4; diff --git a/src/enemy/gyorgFemaleEye.c b/src/enemy/gyorgFemaleEye.c index af10a307..7137532e 100644 --- a/src/enemy/gyorgFemaleEye.c +++ b/src/enemy/gyorgFemaleEye.c @@ -125,7 +125,7 @@ void sub_08048B84(GyorgFemaleEyeEntity* this) { GetNextFrame(super); if (super->frame & 0x80) { super->action = 3; - super->flags |= 0x80; + super->flags |= ENT_COLLIDE; super->hitType = 0x1E; } } @@ -135,11 +135,11 @@ void sub_08048BB0(GyorgFemaleEyeEntity* this) { if (!((parent->unk_78 >> super->type) & 1)) { if (parent->base.health != 0) { super->action = 4; - super->flags &= ~0x80; + super->flags &= ~ENT_COLLIDE; InitializeAnimation(super, gUnk_080D2030[(super->animationState << 3) + super->type]); } else { super->action = 1; - super->flags &= ~0x80; + super->flags &= ~ENT_COLLIDE; super->spriteSettings.draw = 0; InitializeAnimation(super, gUnk_080D2010[(super->animationState << 3) + super->type]); CreateFx(super, 2, 0x40); @@ -150,7 +150,7 @@ void sub_08048BB0(GyorgFemaleEyeEntity* this) { super->iframes = 0xF4; super->hitType = 0x89; InitializeAnimation(super, (parent->base.animationState >> 6) + 0x14); - SoundReq(0x119); + SoundReq(SFX_ITEM_GLOVES_KNOCKBACK); } GetNextFrame(super); if (super->frame & 0x80) { diff --git a/src/enemy/lakitu.c b/src/enemy/lakitu.c index b7861656..d201bf87 100644 --- a/src/enemy/lakitu.c +++ b/src/enemy/lakitu.c @@ -318,7 +318,7 @@ void Lakitu_SpawnLightning(Entity* this) { PositionRelative(this, lightning, Q_16_16(offset->x), Q_16_16(offset->y)); - EnqueueSFX(0x193); + EnqueueSFX(SFX_193); } void sub_0803CBAC(Entity* this) { @@ -326,7 +326,7 @@ void sub_0803CBAC(Entity* this) { cloud = this->child; if (cloud != NULL) { - cloud->flags |= 0x80; + cloud->flags |= ENT_COLLIDE; cloud->hitType = 0x43; } diff --git a/src/enemy/lakituCloud.c b/src/enemy/lakituCloud.c index 3caf7608..3cf330c2 100644 --- a/src/enemy/lakituCloud.c +++ b/src/enemy/lakituCloud.c @@ -64,7 +64,7 @@ void sub_0803CD40(Entity* this) { ModHealth(-2); - SoundReqClipped(&gPlayerEntity, 122); + SoundReqClipped(&gPlayerEntity, SFX_PLY_VO6); sub_08079D84(); sub_0803CE3C(this); diff --git a/src/enemy/likeLike.c b/src/enemy/likeLike.c index d65a4c8a..20c5f188 100644 --- a/src/enemy/likeLike.c +++ b/src/enemy/likeLike.c @@ -205,7 +205,7 @@ void sub_0802805C(Entity* this) { } if ((this->actionDelay & 3) == 0) { - EnqueueSFX(0x104); + EnqueueSFX(SFX_104); } } } @@ -214,7 +214,7 @@ NONMATCH("asm/non_matching/likeLike/sub_0802810C.inc", void sub_0802810C(Entity* gPlayerState.jump_status = 0x41; gPlayerState.field_0xa = 0; gPlayerState.flags &= 0xffffffef; - gPlayerEntity.flags |= 0x80; + gPlayerEntity.flags |= ENT_COLLIDE; gPlayerEntity.zVelocity = Q_16_16(1.5); gPlayerEntity.iframes = -60; gPlayerEntity.direction = gPlayerEntity.animationState << 2; diff --git a/src/enemy/madderpillar.c b/src/enemy/madderpillar.c index a804035b..e68df9fd 100644 --- a/src/enemy/madderpillar.c +++ b/src/enemy/madderpillar.c @@ -61,7 +61,7 @@ void sub_080298A4(Entity* this) { this->hitType = 0x6b; this->field_0x76.HALF.HI = 0; ChangeObjPalette(this, 0x7f); - EnqueueSFX(0xfe); + EnqueueSFX(SFX_HIT); this->child->action = 2; break; } @@ -145,7 +145,7 @@ void sub_08029AA4(Entity* this) { this->field_0x7a.HWORD = 0x168; this->field_0x74.HALF.HI = 4; sub_08029EEC(this); - EnqueueSFX(0x19d); + EnqueueSFX(SFX_19D); } } @@ -159,7 +159,7 @@ void sub_08029AE0(Entity* this) { this->field_0x74.HALF.HI = 0; sub_08029EEC(this); ChangeObjPalette(this, 0x77); - EnqueueSFX(0x182); + EnqueueSFX(SFX_182); } } @@ -221,7 +221,7 @@ void sub_08029C2C(Entity* this) { if (--this->actionDelay == 0) { this->action = 4; ChangeObjPalette(this, 0x7f); - EnqueueSFX(0x6c); + EnqueueSFX(SFX_MENU_CANCEL); } } @@ -275,7 +275,7 @@ void sub_08029D14(Entity* this) { if (--this->actionDelay == 0) { InitializeAnimation(this, this->animationState + 0xc); ChangeObjPalette(this, 0x7f); - EnqueueSFX(0x6c); + EnqueueSFX(SFX_MENU_CANCEL); } } else { GetNextFrame(this); @@ -284,7 +284,7 @@ void sub_08029D14(Entity* this) { this->actionDelay = 0x78; this->hitType = 0x6c; this->hitbox = &gUnk_080FD298; - EnqueueSFX(0x6b); + EnqueueSFX(SFX_6B); } } } @@ -454,7 +454,7 @@ void sub_0802A098(Entity* this) { if (sub_08029F48(this)) { sub_08029E0C(this); sub_08029EEC(this); - EnqueueSFX(0x104); + EnqueueSFX(SFX_104); } sub_08029FB4(this, this->x.HALF.HI - uVar1, this->y.HALF.HI - uVar2); @@ -471,7 +471,7 @@ void sub_0802A0F8(Entity* this) { } } } else { - this->parent->flags &= ~0x80; + this->parent->flags &= ~ENT_COLLIDE; this->parent->health = 0; this->parent->field_0xf = 0x69; } @@ -505,7 +505,7 @@ void sub_0802A18C(Entity* this) { case 0x1e: break; default: - EnqueueSFX(0x12e); + EnqueueSFX(SFX_12E); break; } } diff --git a/src/enemy/mazaalBracelet.c b/src/enemy/mazaalBracelet.c index 55d40deb..eea86ae3 100644 --- a/src/enemy/mazaalBracelet.c +++ b/src/enemy/mazaalBracelet.c @@ -605,7 +605,7 @@ void sub_0803AA98(Entity* this) { this->speed = 0x40; InitializeAnimation(this, 10); temp = (*(Entity**)&this->field_0x74); - temp->flags |= 0x80; + temp->flags |= ENT_COLLIDE; temp = this->child; temp->hitType = 0x13; InitAnimationForceUpdate(temp, 5); @@ -754,7 +754,7 @@ void sub_0803ADAC(Entity* this) { if (--this->actionDelay == 0) { this->action = 0x16; this->spriteSettings.draw = 1; - (*(Entity**)&this->field_0x74)->flags |= 0x80; + (*(Entity**)&this->field_0x74)->flags |= ENT_COLLIDE; InitializeAnimation(this, 0xb); InitAnimationForceUpdate(this->child, 6); sub_0803B798(); @@ -1230,7 +1230,7 @@ void sub_0803B798(void) { gPlayerState.jump_status = 0x41; gPlayerState.field_0xa = 0; gPlayerState.flags &= ~(0xffff0000 | PL_CAPTURED); - gPlayerEntity.flags |= 0x80; + gPlayerEntity.flags |= ENT_COLLIDE; gPlayerEntity.zVelocity = Q_16_16(1.5); gPlayerEntity.z.HALF.HI = -10; gPlayerEntity.direction = 0x10; @@ -1244,7 +1244,7 @@ void sub_0803B798(void) { void sub_0803B804(Entity* this) { gPlayerEntity.iframes = 30; ModHealth(-4); - SoundReqClipped(&gPlayerEntity, 0x7a); + SoundReqClipped(&gPlayerEntity, SFX_PLY_VO6); } void sub_0803B824(Entity* this) { @@ -1263,7 +1263,7 @@ u32 sub_0803B870(Entity* this) { this->action = 0x18; this->actionDelay = 0x44; this->spriteSettings.draw = 0; - gPlayerEntity.flags = gPlayerEntity.flags & 0x7f; + gPlayerEntity.flags &= ~ENT_COLLIDE; gPlayerEntity.iframes = -0x10; sub_0803B824(this); entity->hitType = 0x13; diff --git a/src/enemy/mazaalHead.c b/src/enemy/mazaalHead.c index fa44a8d4..55e4923b 100644 --- a/src/enemy/mazaalHead.c +++ b/src/enemy/mazaalHead.c @@ -221,7 +221,7 @@ void sub_08033FFC(Entity* this) { } break; default: - if (((*(Entity**)&this->field_0x74)->flags & 0x80) != 0) { + if (((*(Entity**)&this->field_0x74)->flags & ENT_COLLIDE) != 0) { gRoomControls.camera_target = &gPlayerEntity; sub_08034420(this); gPlayerState.controlMode = 1; @@ -659,7 +659,7 @@ u32 sub_080348A4(Entity* this, Entity* hand_, u32 unk) { break; case 7: hand_->action = 0x1b; - hand_->flags = hand_->flags & 0x7f; + hand_->flags = hand_->flags & ~ENT_COLLIDE; InitializeAnimation(hand_, 5); break; case 8: diff --git a/src/enemy/moldworm.c b/src/enemy/moldworm.c index 80d1a055..695271ae 100644 --- a/src/enemy/moldworm.c +++ b/src/enemy/moldworm.c @@ -85,7 +85,7 @@ void sub_080230E4(Entity* this) { if (this->health == 0 && this->field_0x7c.BYTES.byte3 == 0 && this->action == 7) { CopyPosition(this, &gPlayerEntity); - gPlayerEntity.flags = gPlayerEntity.flags | 0x80; + gPlayerEntity.flags |= ENT_COLLIDE; gPlayerEntity.spriteSettings.draw = 1; gPlayerEntity.zVelocity = Q_16_16(1.5); gPlayerEntity.direction = 0xff; @@ -411,7 +411,7 @@ void sub_08023894(Entity* this) { gPlayerEntity.animationState = gPlayerEntity.direction >> 2; gPlayerEntity.iframes = 12; ModHealth(-0x10); - SoundReqClipped(&gPlayerEntity, 0x7a); + SoundReqClipped(&gPlayerEntity, SFX_PLY_VO6); } } } diff --git a/src/enemy/octorok.c b/src/enemy/octorok.c index 658d94a0..f94b4743 100644 --- a/src/enemy/octorok.c +++ b/src/enemy/octorok.c @@ -137,7 +137,7 @@ void Octorok_ShootNut(Entity* this) { ent->y.HALF.HI += off[1]; ent->z.HALF.HI = -3; this->frame &= 0xfe; - EnqueueSFX(0x18d); + EnqueueSFX(SFX_18D); } } diff --git a/src/enemy/octorokBoss.c b/src/enemy/octorokBoss.c index f603afd8..57c55849 100644 --- a/src/enemy/octorokBoss.c +++ b/src/enemy/octorokBoss.c @@ -832,7 +832,7 @@ void OctorokBoss_Action1_Attack(Entity* this) { if (this->field_0x80.HALF.LO != 0) { gPlayerEntity.spriteSettings.draw = 0; - gPlayerEntity.flags &= 0x7f; + gPlayerEntity.flags &= ~ENT_COLLIDE; gPlayerEntity.collisionLayer = 2; sub_08078B48(); sub_08077B20(); @@ -972,7 +972,7 @@ void OctorokBoss_ExecuteAttackVacuum(Entity* this) { GET_ANGULAR_VEL(this) = 0x100; GET_HELPER(this)->mouthObject->field_0x78.HALF.HI++; gPlayerEntity.spriteSettings.draw = 1; - gPlayerEntity.flags &= 0x7f; + gPlayerEntity.flags &= ~ENT_COLLIDE; gPlayerEntity.collisionLayer = 1; sub_080792BC(0x400, (u32)(-(GET_ANGLE_HI(this) + 0x80) * 0x1000000) >> 0x1b, 0x30); OctorokBoss_SetAttackTimer(this); @@ -1112,7 +1112,7 @@ void OctorokBoss_Burning_SubAction2(Entity* this) { void sub_080368D8(Entity* this) { if (this->field_0x80.HALF.LO != 0) { gPlayerEntity.spriteSettings.draw = 1; - gPlayerEntity.flags |= 0x80; + gPlayerEntity.flags |= ENT_COLLIDE; gPlayerEntity.collisionLayer = 1; } this->field_0x76.HWORD = 0xa0; diff --git a/src/enemy/pesto.c b/src/enemy/pesto.c index b52a69fc..9533a963 100644 --- a/src/enemy/pesto.c +++ b/src/enemy/pesto.c @@ -392,7 +392,7 @@ void sub_080244E8(Entity* this) { this->flags2 &= 0xfc; sub_080249DC(this); this->cutsceneBeh.HALF.HI = gPlayerEntity.spritePriority.b1; - gPlayerEntity.flags &= 0x7f; + gPlayerEntity.flags &= ~ENT_COLLIDE; gPlayerState.flags |= PL_DISABLE_ITEMS; gPlayerState.field_0xa |= 0x80; if (gPlayerState.swim_state != 0) { @@ -819,7 +819,7 @@ void sub_08024E4C(Entity* this) { this->field_0x86.HALF.HI++; player->iframes = 8; ModHealth(-2); - SoundReqClipped(player, 0x7a); + SoundReqClipped(player, SFX_PLY_VO6); } } } diff --git a/src/enemy/puffstool.c b/src/enemy/puffstool.c index e4763610..f444b65a 100644 --- a/src/enemy/puffstool.c +++ b/src/enemy/puffstool.c @@ -89,7 +89,7 @@ void sub_08025020(Entity* this) { ent->spritePriority.b0 = 3; CopyPosition(this, ent); } - EnqueueSFX(0x186); + EnqueueSFX(SFX_186); } break; } diff --git a/src/enemy/rollobite.c b/src/enemy/rollobite.c index c80786d3..4b8e07b0 100644 --- a/src/enemy/rollobite.c +++ b/src/enemy/rollobite.c @@ -190,7 +190,7 @@ void Rollobite_RolledUp(Entity* this) { sub_08078930(this); } else { if (unk == 1) - EnqueueSFX(260); + EnqueueSFX(SFX_104); if ((this->direction & 0x80) == 0) sub_080AEFE0(this); diff --git a/src/enemy/rope.c b/src/enemy/rope.c index d2ca5b18..05e1c85e 100644 --- a/src/enemy/rope.c +++ b/src/enemy/rope.c @@ -95,7 +95,7 @@ void sub_08031480(Entity* this) { this->field_0xf = 0xf; this->spriteSettings.draw = 1; UpdateSpriteForCollisionLayer(this); - EnqueueSFX(0x84); + EnqueueSFX(SFX_WATER_SPLASH); } } } diff --git a/src/enemy/rupeeLike.c b/src/enemy/rupeeLike.c index bb8e176f..40964971 100644 --- a/src/enemy/rupeeLike.c +++ b/src/enemy/rupeeLike.c @@ -71,7 +71,7 @@ void sub_08029318(Entity* this) { this->field_0x82.HALF.HI = 0x41; this->flags2 &= 0xfc; this->field_0x80.HALF.LO = gPlayerEntity.spritePriority.b1; - EnqueueSFX(0x104); + EnqueueSFX(SFX_104); } else { if (this->field_0x43 != 0) { sub_0804A9FC(this, 0x1c); @@ -239,7 +239,7 @@ void sub_080296C8(Entity* this) { void sub_080296D8(Entity* this) { gPlayerState.jump_status = 0x41; gPlayerState.flags &= ~PL_CAPTURED; - gPlayerEntity.flags |= 0x80; + gPlayerEntity.flags |= ENT_COLLIDE; gPlayerEntity.zVelocity = Q_16_16(1.5); gPlayerEntity.iframes = 0xa6; gPlayerEntity.z.HALF.HI = -2; diff --git a/src/enemy/sensorBladeTrap.c b/src/enemy/sensorBladeTrap.c index 0db62349..77af113a 100644 --- a/src/enemy/sensorBladeTrap.c +++ b/src/enemy/sensorBladeTrap.c @@ -95,7 +95,7 @@ void sub_0802BB10(Entity* this) { this->action = 3; this->speed = 0xc0; this->direction = this->direction ^ 0x10; - EnqueueSFX(0x74); + EnqueueSFX(SFX_METAL_CLINK); } bool32 sub_0802BB2C(Entity* this, u32 param_2) { diff --git a/src/enemy/sluggula.c b/src/enemy/sluggula.c index 720b3a50..7d6b68e9 100644 --- a/src/enemy/sluggula.c +++ b/src/enemy/sluggula.c @@ -121,13 +121,13 @@ void sub_08023CE0(Entity* this) { case 2: if (this->actionDelay != 0) { if (--this->actionDelay == 0) { - EnqueueSFX(0x12d); + EnqueueSFX(SFX_12D); InitializeAnimation(this, 4); } } else if (!GravityUpdate(this, Q_8_8(24))) { this->action = 3; this->spriteSettings.draw = 1; - EnqueueSFX(0x84); + EnqueueSFX(SFX_WATER_SPLASH); UpdateSpriteForCollisionLayer(this); } break; diff --git a/src/enemy/spearMoblin.c b/src/enemy/spearMoblin.c index 6cd8f4ca..8490f9d6 100644 --- a/src/enemy/spearMoblin.c +++ b/src/enemy/spearMoblin.c @@ -168,7 +168,7 @@ void sub_08028488(Entity* this) { this->action = 4; this->speed = 0x180; this->direction = sub_08049F84(this, 1); - EnqueueSFX(0x11e); + EnqueueSFX(SFX_EM_MOBLIN_SPEAR); break; case 2: this->action = 2; @@ -225,7 +225,7 @@ void sub_08028528(Entity* this) { } if ((this->actionDelay & 7) == 0) { - EnqueueSFX(0xf0); + EnqueueSFX(SFX_F0); CreateFx(this, FX_DEATH, 0x40); } diff --git a/src/enemy/spikedBeetle.c b/src/enemy/spikedBeetle.c index f4f6792e..fa3d70b4 100644 --- a/src/enemy/spikedBeetle.c +++ b/src/enemy/spikedBeetle.c @@ -159,7 +159,7 @@ void sub_0802B8B0(Entity* this) { this->actionDelay = 0x96; /* fallthrough */ case 1: - EnqueueSFX(299); + EnqueueSFX(SFX_12B); break; } } @@ -175,7 +175,7 @@ void sub_0802B8E0(Entity* this) { this->speed = 0x60; this->hitType = 99; InitializeAnimation(this, this->animationState); - EnqueueSFX(299); + EnqueueSFX(SFX_12B); } } diff --git a/src/enemy/spinyChuchu.c b/src/enemy/spinyChuchu.c index c6db356b..68df4b69 100644 --- a/src/enemy/spinyChuchu.c +++ b/src/enemy/spinyChuchu.c @@ -75,7 +75,7 @@ void sub_0802244C(Entity* this) { if (this->action == 3) { this->action = 4; InitializeAnimation(this, 3); - EnqueueSFX(0x194); + EnqueueSFX(SFX_194); } } } else { @@ -138,7 +138,7 @@ void sub_08022654(Entity* this) { this->subAction = 2; this->spriteSettings.draw = 1; InitializeAnimation(this, 5); - EnqueueSFX(0x7d); + EnqueueSFX(SFX_PLY_LAND); UpdateSpriteForCollisionLayer(this); /* fallthrough */ case 2: @@ -186,7 +186,7 @@ void sub_08022780(Entity* this) { if (this->frame & 0x80) { this->action = 4; InitializeAnimation(this, 3); - EnqueueSFX(0x194); + EnqueueSFX(SFX_194); } } @@ -229,7 +229,7 @@ void sub_08022854(Entity* this) { this->action = 7; this->hitType = 0x5c; InitializeAnimation(this, 5); - EnqueueSFX(0x7d); + EnqueueSFX(SFX_PLY_LAND); } } } diff --git a/src/enemy/sub_080451CC.c b/src/enemy/sub_080451CC.c index 14220d47..c7a82990 100644 --- a/src/enemy/sub_080451CC.c +++ b/src/enemy/sub_080451CC.c @@ -3,7 +3,7 @@ void sub_080451CC(Entity* this, Entity* other) { u8* pThis; u8* pOther; - other->flags = this->flags & 0xfe; + other->flags = this->flags & ~ENT_DID_INIT; other->x.WORD = this->x.WORD; other->y.WORD = this->y.WORD; other->z.WORD = this->z.WORD; diff --git a/src/enemy/takkuri.c b/src/enemy/takkuri.c index 7817f0d7..a9a29a9b 100644 --- a/src/enemy/takkuri.c +++ b/src/enemy/takkuri.c @@ -339,7 +339,7 @@ void sub_0803C0AC(Entity* this) { void sub_0803C120(TakkuriEntity* this) { super->action = 5; super->spriteSettings.draw = 0; - super->flags &= 0x7f; + super->flags &= ~ENT_COLLIDE; super->x.HALF.HI = this->x_0x78; super->y.HALF.HI = this->y_0x7a; super->z.HALF.HI += 8; diff --git a/src/enemy/vaatiArm.c b/src/enemy/vaatiArm.c index e0b1a76e..33dc556f 100644 --- a/src/enemy/vaatiArm.c +++ b/src/enemy/vaatiArm.c @@ -269,15 +269,15 @@ void sub_08042654(Entity* this) { break; this->subAction = 5; this->actionDelay = 0x5a; - ((VaatiArm_HeapStruct*)this->myHeap)->entities[0]->flags |= 0x80; + ((VaatiArm_HeapStruct*)this->myHeap)->entities[0]->flags |= ENT_COLLIDE; ((VaatiArm_HeapStruct*)this->myHeap)->entities[0]->spritePriority.b0 = 4; - ((VaatiArm_HeapStruct*)this->myHeap)->entities[1]->flags |= 0x80; + ((VaatiArm_HeapStruct*)this->myHeap)->entities[1]->flags |= ENT_COLLIDE; ((VaatiArm_HeapStruct*)this->myHeap)->entities[1]->spritePriority.b0 = 4; - ((VaatiArm_HeapStruct*)this->myHeap)->entities[2]->flags |= 0x80; + ((VaatiArm_HeapStruct*)this->myHeap)->entities[2]->flags |= ENT_COLLIDE; ((VaatiArm_HeapStruct*)this->myHeap)->entities[2]->spritePriority.b0 = 4; - ((VaatiArm_HeapStruct*)this->myHeap)->entities[3]->flags |= 0x80; + ((VaatiArm_HeapStruct*)this->myHeap)->entities[3]->flags |= ENT_COLLIDE; ((VaatiArm_HeapStruct*)this->myHeap)->entities[3]->spritePriority.b0 = 4; - ((VaatiArm_HeapStruct*)this->myHeap)->entities[4]->flags |= 0x80; + ((VaatiArm_HeapStruct*)this->myHeap)->entities[4]->flags |= ENT_COLLIDE; ((VaatiArm_HeapStruct*)this->myHeap)->entities[4]->spritePriority.b0 = 4; InitAnimationForceUpdate(this, 7); SoundReq(SFX_15E); @@ -495,7 +495,7 @@ void sub_08042B20(Entity* this) { CopyPosition(((VaatiArm_HeapStruct*)this->myHeap)->entities[4], object); } } - entity->flags &= 0x7f; + entity->flags &= ~ENT_COLLIDE; entity->spriteSettings.draw = 0; SoundReq(SFX_161); } @@ -599,7 +599,7 @@ void sub_08042D6C(Entity* this) { entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[i]; if (entity->z.HALF.HI < 4) { if (i != 2) { - entity->flags = entity->flags | 0x80; + entity->flags = entity->flags | ENT_COLLIDE; } if ((entity->spriteSettings.draw == 0u) && (object = CreateObject(OBJECT_AF, 2, 0), object != NULL)) { CopyPosition(entity, object); @@ -803,7 +803,7 @@ void sub_08043130(Entity* this) { for (i = 0; i < 4; i++) { entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[i]; if (entity->z.HALF.HI > -4) { - entity->flags = entity->flags & 0x7f; + entity->flags = entity->flags & ~ENT_COLLIDE; if (entity->spriteSettings.draw == 1) { SoundReq(SFX_161); } @@ -872,7 +872,7 @@ NONMATCH("asm/non_matching/vaati/sub_0804334C.inc", void sub_0804334C(Entity* th } for (i = 0; i < 5; i++) { entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[i]; - entity->flags = entity->flags | 0x80; + entity->flags = entity->flags | ENT_COLLIDE; entity->spriteSettings.draw = 1; } } @@ -958,15 +958,15 @@ void sub_08043490(Entity* this) { } else { entity->z.HALF.HI -= 2; if (entity->z.HALF.HI < 0) { - entity->flags = entity->flags | 0x80; + entity->flags = entity->flags | ENT_COLLIDE; entity->spriteSettings.draw = 1; entity->field_0x3c = entity->field_0x3c & 0xef; entity->hitType = 0x3a; entity->hitbox = (Hitbox*)&gUnk_080FD450; entity2 = ((VaatiArm_HeapStruct*)this->myHeap)->entities[2]; - entity2->flags = entity2->flags | 0x80; + entity2->flags = entity2->flags | ENT_COLLIDE; entity3 = ((VaatiArm_HeapStruct*)this->myHeap)->entities[3]; - entity3->flags = entity3->flags & 0x7f; + entity3->flags = entity3->flags & ~ENT_COLLIDE; } } UpdateAnimationSingleFrame(this); @@ -1000,7 +1000,7 @@ void sub_08043580(Entity* this) { for (i = 0; i < 5; i++) { entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[i]; if (-4 < entity->z.HALF.HI) { - entity->flags = entity->flags & 0x7f; + entity->flags = entity->flags & ~ENT_COLLIDE; entity->spriteSettings.draw = 0; } } @@ -1052,7 +1052,7 @@ void sub_08043698(Entity* this) { this->actionDelay = 0x3c; for (i = 0; i < 5; i++) { entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[i]; - entity->flags = entity->flags & 0x7f; + entity->flags = entity->flags & ~ENT_COLLIDE; } } @@ -1325,7 +1325,7 @@ void sub_08043D08(Entity* this) { this->subAction = 0; InitAnimationForceUpdate(this, 0xd); entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[4]; - entity->flags &= 0x7f; + entity->flags &= ~ENT_COLLIDE; entity->spriteSettings.draw = 0; InitializeAnimation(entity, 0x13); sub_0804AA1C(entity); @@ -1392,17 +1392,17 @@ void sub_08043EB8(Entity* this) { this->spritePriority.b0 = 4; InitAnimationForceUpdate(this, 0xd); pEVar4 = ((VaatiArm_HeapStruct*)this->myHeap)->entities[1]; - pEVar4->flags = pEVar4->flags | 0x80; + pEVar4->flags = pEVar4->flags | ENT_COLLIDE; pEVar4->spritePriority.b0 = 4; pEVar4 = ((VaatiArm_HeapStruct*)this->myHeap)->entities[2]; - pEVar4->flags = pEVar4->flags | 0x80; + pEVar4->flags = pEVar4->flags | ENT_COLLIDE; pEVar4->spritePriority.b0 = 4; pEVar4 = ((VaatiArm_HeapStruct*)this->myHeap)->entities[3]; - pEVar4->flags = pEVar4->flags & 0x7f; + pEVar4->flags = pEVar4->flags & ~ENT_COLLIDE; pEVar4->spriteSettings.draw = 1; pEVar4->spritePriority.b0 = 4; pEVar4 = ((VaatiArm_HeapStruct*)this->myHeap)->entities[4]; - pEVar4->flags = pEVar4->flags | 0x80; + pEVar4->flags = pEVar4->flags | ENT_COLLIDE; pEVar4->spriteSettings.draw = 1; pEVar4->spritePriority.b0 = 4; pEVar4->x.HALF.HI = (this->type2 == 0) ? gRoomTransition.field_0x44 : gRoomTransition.field_0x48; @@ -1432,7 +1432,7 @@ NONMATCH("asm/non_matching/vaati/sub_08044000.inc", void sub_08044000(Entity* th ptr2 = &gUnk_080D1400[this->type2 * 5]; for (i = 0; i < 5; ptr2++, i++) { entity = ((VaatiArm_HeapStruct*)this->myHeap)->entities[i]; - entity->flags = entity->flags | 0x80; + entity->flags = entity->flags | ENT_COLLIDE; entity->spritePriority.b0 = 4; ptr = &((VaatiArm_HeapStruct*)this->myHeap)->s1[i]; ptr->unk00.HWORD = *ptr2; diff --git a/src/enemy/vaatiProjectile.c b/src/enemy/vaatiProjectile.c index 39e68307..440a4287 100644 --- a/src/enemy/vaatiProjectile.c +++ b/src/enemy/vaatiProjectile.c @@ -65,7 +65,7 @@ void VaatiProjectileFunction1(Entity* this) { this->action = 5; COLLISION_OFF(this); this->spritePriority.b1 = 0; - gPlayerEntity.flags &= 0x7f; + gPlayerEntity.flags &= ~ENT_COLLIDE; gPlayerEntity.spriteOrientation.flipY = this->spriteOrientation.flipY; gPlayerEntity.spriteRendering.b3 = this->spriteRendering.b3; sub_0803E444(this); @@ -73,12 +73,12 @@ void VaatiProjectileFunction1(Entity* this) { SetPlayerControl(2); entity = this->parent; if (entity != NULL) { - entity->flags = entity->flags & 0x7f; + entity->flags = entity->flags & ~ENT_COLLIDE; } } else { gPlayerState.flags &= ~PL_DISABLE_ITEMS; entity = &gPlayerEntity; - entity->flags = gPlayerEntity.flags | 0x80; + entity->flags = gPlayerEntity.flags | ENT_COLLIDE; } #endif } diff --git a/src/enemy/vaatiRebornEnemy.c b/src/enemy/vaatiRebornEnemy.c index 99f1777b..0d625249 100644 --- a/src/enemy/vaatiRebornEnemy.c +++ b/src/enemy/vaatiRebornEnemy.c @@ -654,7 +654,7 @@ void VaatiRebornEnemyType1PreAction(Entity* this) { if (2 < ++parent->field_0x86.HALF.LO) { COLLISION_OFF(this); parent->action = 7; - parent->flags &= 0x7f; + parent->flags &= ~ENT_COLLIDE; parent->actionDelay = 0x80; parent->spriteOffsetX = 0; parent->direction = -1; diff --git a/src/enemy/wallMaster.c b/src/enemy/wallMaster.c index a9648193..9c91c691 100644 --- a/src/enemy/wallMaster.c +++ b/src/enemy/wallMaster.c @@ -92,7 +92,7 @@ void sub_0802A5B8(Entity* this) { sub_0802A7D0(this); if (this->actionDelay) { if (--this->actionDelay == 0) { - EnqueueSFX(0x12d); + EnqueueSFX(SFX_12D); InitializeAnimation(this, 0); } } else { diff --git a/src/enemy/wallMaster2.c b/src/enemy/wallMaster2.c index 2efd2c12..b2d5ba9f 100644 --- a/src/enemy/wallMaster2.c +++ b/src/enemy/wallMaster2.c @@ -41,7 +41,7 @@ void sub_0802CC80(Entity* this) { this->action = 3; COLLISION_OFF(this); InitializeAnimation(this, 1); - gPlayerEntity.flags &= ~0x80; + gPlayerEntity.flags &= ~ENT_COLLIDE; break; } if (this->field_0x43 != 0) { diff --git a/src/enemy/waterDrop.c b/src/enemy/waterDrop.c index d964ab45..39c329a2 100644 --- a/src/enemy/waterDrop.c +++ b/src/enemy/waterDrop.c @@ -43,7 +43,7 @@ void sub_0802A2B4(Entity* this) { if (!GravityUpdate(this, 0x2800)) { this->action = 2; this->spritePriority.b0 = 7; - EnqueueSFX(0x84); + EnqueueSFX(SFX_WATER_SPLASH); } else { LinearMoveUpdate(this); } diff --git a/src/enemyUtils.c b/src/enemyUtils.c index 956ba639..0e0929e6 100644 --- a/src/enemyUtils.c +++ b/src/enemyUtils.c @@ -54,7 +54,7 @@ bool32 EnemyInit(Entity* this) { object->spritePriority.b0 = 3; object->parent = this; CopyPosition(this, object); - this->flags &= 0x7f; + this->flags &= ~ENT_COLLIDE; this->spriteSettings.draw = 0; this->field_0x6c.HALF.HI |= 0x10; } diff --git a/src/item/itemJarEmpty.c b/src/item/itemJarEmpty.c index 4fcf4668..11a27fcc 100644 --- a/src/item/itemJarEmpty.c +++ b/src/item/itemJarEmpty.c @@ -46,7 +46,7 @@ void sub_08077534(ItemBehavior* this, u32 arg1) { sub_08077DF4(this, 0x610); break; } - gPlayerEntity.flags &= 0x7f; + gPlayerEntity.flags &= ~ENT_COLLIDE; } void sub_08077618(ItemBehavior* this, u32 arg1) { @@ -61,7 +61,7 @@ void sub_08077618(ItemBehavior* this, u32 arg1) { void sub_08077640(ItemBehavior* this, u32 arg1) { UpdateItemAnim(this); if ((this->field_0x5[9] & 0x80) != 0) { - gPlayerEntity.flags |= 0x80; + gPlayerEntity.flags |= ENT_COLLIDE; sub_08077E78(this, arg1); } } @@ -69,7 +69,7 @@ void sub_08077640(ItemBehavior* this, u32 arg1) { void sub_0807766C(ItemBehavior* this, u32 arg1) { UpdateItemAnim(this); if ((this->field_0x5[9] & 0x80) != 0) { - gPlayerEntity.flags |= 0x80; + gPlayerEntity.flags |= ENT_COLLIDE; sub_08077E78(this, arg1); } } diff --git a/src/item/itemOcarina.c b/src/item/itemOcarina.c index 5913c477..af8812bb 100644 --- a/src/item/itemOcarina.c +++ b/src/item/itemOcarina.c @@ -20,7 +20,7 @@ void OcarinaUse(ItemBehavior* this, u32 arg1) { this->field_0x5[4] |= 0xf; gPlayerEntity.animationState = 0x04; gPlayerEntity.spriteSettings.flipX = 0; - gPlayerEntity.flags &= 0x7f; + gPlayerEntity.flags &= ~ENT_COLLIDE; gPlayerEntity.field_0x7a.HWORD = 2; gPlayerState.flags |= PL_USE_OCARINA; gPlayerState.field_0x27[0] = -1; @@ -38,7 +38,7 @@ NONMATCH("asm/non_matching/ocarina/OcarinaUpdate.inc", void OcarinaUpdate(ItemBe // TODO regalloc UpdateItemAnim(this); if ((this->field_0x5[9] & 0x80) != 0) { - gPlayerEntity.flags |= 0x80; + gPlayerEntity.flags |= ENT_COLLIDE; gPlayerState.flags &= ~PL_USE_OCARINA; gPlayerState.field_0x27[0] = 0; gUnk_02034490[0] = 0; diff --git a/src/item/itemTryPickupObject.c b/src/item/itemTryPickupObject.c index 3e161d89..1eb0c3e2 100644 --- a/src/item/itemTryPickupObject.c +++ b/src/item/itemTryPickupObject.c @@ -30,7 +30,7 @@ void sub_08076488(ItemBehavior* this, u32 arg1) { } UpdateItemAnim(this); if ((this->field_0x5[9] & 0x80) != 0) { - gPlayerEntity.flags |= 0x80; + gPlayerEntity.flags |= ENT_COLLIDE; gPlayerState.heldObject = 4; bVar1 = ~(8 >> arg1); gPlayerState.keepFacing = bVar1 & gPlayerState.keepFacing; diff --git a/src/manager/managerF.c b/src/manager/managerF.c index b4e7e442..dc29c4f2 100644 --- a/src/manager/managerF.c +++ b/src/manager/managerF.c @@ -379,7 +379,7 @@ void sub_08059424(ManagerF* this) { tmp->collisionLayer = 2; tmp->x.HALF.HI = this->unk_38 + gRoomControls.origin_x; tmp->y.HALF.HI = this->unk_3a + gRoomControls.origin_y; - EnqueueSFX(0x1B0); + EnqueueSFX(SFX_1B0); DeleteThisEntity(); } diff --git a/src/npc/beedle.c b/src/npc/beedle.c index 703773ff..9a9717ab 100644 --- a/src/npc/beedle.c +++ b/src/npc/beedle.c @@ -26,7 +26,7 @@ s32 sub_080633C8(Entity* this); void sub_0806346C(Entity* this); void Beedle(Entity* this) { - if (this->flags & 0x2) { + if (this->flags & ENT_SCRIPTED) { sub_08063410(this); } else { sub_080632C8(this); diff --git a/src/npc/bladeBrothers.c b/src/npc/bladeBrothers.c index 5d2ddca1..63bc4310 100644 --- a/src/npc/bladeBrothers.c +++ b/src/npc/bladeBrothers.c @@ -35,7 +35,7 @@ extern EntityData gUnk_080F3494; static void sub_08068BEC(Entity* this, u32 unused); void BladeBrothers(Entity* this) { - if ((this->flags & 2) != 0) { + if ((this->flags & ENT_SCRIPTED) != 0) { gUnk_081115D0[this->action](this); } else { gUnk_081115C0[this->action](this); diff --git a/src/npc/brocco.c b/src/npc/brocco.c index b960237c..0030dd0f 100644 --- a/src/npc/brocco.c +++ b/src/npc/brocco.c @@ -11,7 +11,7 @@ extern void (*gUnk_0810CAA0[])(Entity*); extern Dialog gUnk_0810CAAC[]; void Brocco(Entity* this) { - if ((this->flags & 2) != 0) { + if ((this->flags & ENT_SCRIPTED) != 0) { sub_0806362C(this); } else { sub_08063544(this); diff --git a/src/npc/carlov.c b/src/npc/carlov.c index 6fc9ad81..8f830b11 100644 --- a/src/npc/carlov.c +++ b/src/npc/carlov.c @@ -12,11 +12,11 @@ void Carlov(Entity* this) { } if ((this->frame & 0x10) != 0) { this->frame = this->frame & 0xef; - EnqueueSFX(0x104); + EnqueueSFX(SFX_104); InitScreenShake(0x10, 0); } if ((this->frame & 0x20) != 0) { this->frame = this->frame & 0xdf; - EnqueueSFX(0x7c); + EnqueueSFX(SFX_PLY_JUMP); } } diff --git a/src/npc/castleMaid.c b/src/npc/castleMaid.c index 3322656f..154d1b0c 100644 --- a/src/npc/castleMaid.c +++ b/src/npc/castleMaid.c @@ -17,7 +17,7 @@ extern SpriteLoadData gUnk_0810F874[]; extern u32 _call_via_r0(u32*); void Maid(Entity* this) { - if ((this->flags & 2) != 0) { + if ((this->flags & ENT_SCRIPTED) != 0) { sub_08064570(this); } else { DeleteThisEntity(); diff --git a/src/npc/castorWildsStatue.c b/src/npc/castorWildsStatue.c index 2c388a08..1d3d80c2 100644 --- a/src/npc/castorWildsStatue.c +++ b/src/npc/castorWildsStatue.c @@ -23,7 +23,7 @@ extern PosOffset gUnk_08110E78[]; extern PosOffset gUnk_08110E8A[]; void CastorWildsStatue(Entity* this) { - if ((this->flags & 2) != 0) { + if ((this->flags & ENT_SCRIPTED) != 0) { gUnk_08110E5C[this->action](this); } else { gUnk_08110E4C[this->action](this); @@ -103,7 +103,7 @@ void sub_08067534(Entity* this) { entity->y.HALF.HI += 0x1c; } } - EnqueueSFX(0x14c); + EnqueueSFX(SFX_14C); InitScreenShake(0x28, 4); } diff --git a/src/npc/cat.c b/src/npc/cat.c index 4d236eb6..a5cba705 100644 --- a/src/npc/cat.c +++ b/src/npc/cat.c @@ -48,7 +48,7 @@ void sub_08067790(Entity* this) { void Cat(Entity* ent) { gCat[ent->action](ent); sub_08067C44(ent); - if (((ent->flags & 128) == 0) && (ent->type != 5)) { + if (((ent->flags & ENT_COLLIDE) == 0) && (ent->type != 5)) { sub_0806ED78(ent); } } diff --git a/src/npc/dog.c b/src/npc/dog.c index 85ed9568..111b27e0 100644 --- a/src/npc/dog.c +++ b/src/npc/dog.c @@ -62,7 +62,7 @@ void sub_08069B44(Entity* this) { this->field_0x74.HALF.LO = sub_0801E99C(this); SetDefaultPriority(this, PRIO_MESSAGE); InitAnimationForceUpdate(this, 10); - if ((this->flags & 2) != 0) { + if ((this->flags & ENT_SCRIPTED) != 0) { sub_0807DD50(this); } if (((this->type == 0) && ((gPlayerState.flags & PL_MINISH) == 0)) && (GetInventoryValue(0x36) != 2)) { diff --git a/src/npc/ghostBrothers.c b/src/npc/ghostBrothers.c index 1093a14d..466b5285 100644 --- a/src/npc/ghostBrothers.c +++ b/src/npc/ghostBrothers.c @@ -23,7 +23,7 @@ void sub_08065C0C(Entity* this); static EntityAction* const gUnk_08110164[]; void GhostBrothers(Entity* this) { - if (this->flags & 0x2) { + if (this->flags & ENT_SCRIPTED) { sub_08065C0C(this); } else { gUnk_08110164[this->type](this); diff --git a/src/npc/gorman.c b/src/npc/gorman.c index 7dfaf6ca..af735017 100644 --- a/src/npc/gorman.c +++ b/src/npc/gorman.c @@ -21,7 +21,7 @@ void sub_08069888(Entity* this); extern u16 gUnk_08111C50[]; void Gorman(Entity* this) { - if ((this->flags & 2) != 0) { + if ((this->flags & ENT_SCRIPTED) != 0) { sub_08069838(this); } else { sub_080697A4(this); diff --git a/src/npc/goron.c b/src/npc/goron.c index baada241..ab17ce82 100644 --- a/src/npc/goron.c +++ b/src/npc/goron.c @@ -10,7 +10,7 @@ extern void (*gUnk_08111A8C[])(Entity*); extern Dialog gUnk_08111A94[]; void Goron(Entity* this) { - if (this->flags & 2) { + if (this->flags & ENT_SCRIPTED) { gUnk_08111A8C[this->action](this); } else { gUnk_08111A80[this->action](this); diff --git a/src/npc/goronMerchant.c b/src/npc/goronMerchant.c index df239bd4..8862610f 100644 --- a/src/npc/goronMerchant.c +++ b/src/npc/goronMerchant.c @@ -16,7 +16,7 @@ static const u16 sKinstonePrices[]; extern u32 sub_0801E7D0(u32); void GoronMerchant(Entity* this) { - if ((this->flags & 2) != 0) { + if ((this->flags & ENT_SCRIPTED) != 0) { gUnk_08111B98[this->action](this); } else { gUnk_08111B88[this->action](this); diff --git a/src/npc/guard.c b/src/npc/guard.c index d8afe8b2..9c36c7f9 100644 --- a/src/npc/guard.c +++ b/src/npc/guard.c @@ -32,7 +32,7 @@ extern SpriteLoadData gUnk_0810F524[]; extern void* gUnk_0810F6BC[]; void Guard(Entity* this) { - if ((this->flags & 2) != 0) { + if ((this->flags & ENT_SCRIPTED) != 0) { gUnk_0810F544[this->action](this); } else { sub_08063D24(this); diff --git a/src/npc/kid.c b/src/npc/kid.c index 02910850..011327db 100644 --- a/src/npc/kid.c +++ b/src/npc/kid.c @@ -27,7 +27,7 @@ extern Dialog gUnk_0810BE10[]; extern u8 gUnk_0810C0A0[]; void Kid(Entity* this) { - if ((this->flags & 2) != 0) { + if ((this->flags & ENT_SCRIPTED) != 0) { sub_080621AC(this); } else { gUnk_0810BE0C[this->action](this); diff --git a/src/npc/kingDaltus.c b/src/npc/kingDaltus.c index e159c531..5fa29df2 100644 --- a/src/npc/kingDaltus.c +++ b/src/npc/kingDaltus.c @@ -9,7 +9,7 @@ extern void (*const gUnk_081104E0[])(Entity*); extern void (*const gUnk_081104EC[])(Entity*); void KingDaltus(Entity* this) { - if ((this->flags & 2) != 0) { + if ((this->flags & ENT_SCRIPTED) != 0) { if (this->interactType == 2) { this->interactType = 0; this->action = 2; diff --git a/src/npc/malon.c b/src/npc/malon.c index cff3828f..77d6a20c 100644 --- a/src/npc/malon.c +++ b/src/npc/malon.c @@ -7,7 +7,7 @@ extern void (*gUnk_0810FF5C[])(Entity* this); extern void (*gUnk_0810FF64[])(Entity* this); void Malon(Entity* this) { - if (this->flags & 0x2) { + if (this->flags & ENT_SCRIPTED) { gUnk_0810FF64[this->action](this); } else { gUnk_0810FF5C[this->action](this); diff --git a/src/npc/melari.c b/src/npc/melari.c index 7b28d0e2..4bdae9d3 100644 --- a/src/npc/melari.c +++ b/src/npc/melari.c @@ -10,7 +10,7 @@ extern u16 gUnk_0811153E[]; extern u16 gUnk_08111538[]; void Melari(Entity* this) { - if ((this->flags & 2) == 0) { + if ((this->flags & ENT_SCRIPTED) == 0) { gUnk_08111530[this->action](this); sub_0806ED78(this); } else { diff --git a/src/npc/ministerPotho.c b/src/npc/ministerPotho.c index 70e012eb..e86bca42 100644 --- a/src/npc/ministerPotho.c +++ b/src/npc/ministerPotho.c @@ -9,7 +9,7 @@ void sub_08066864(Entity*); extern u16 gUnk_08110650[]; void MinisterPotho(Entity* this) { - if ((this->flags & 2) != 0) { + if ((this->flags & ENT_SCRIPTED) != 0) { sub_08066864(this); } else { gUnk_08110644[this->action](this); diff --git a/src/npc/mountainMinish.c b/src/npc/mountainMinish.c index ed76f1e1..90a370db 100644 --- a/src/npc/mountainMinish.c +++ b/src/npc/mountainMinish.c @@ -13,7 +13,7 @@ void sub_08067EF0(Entity*); extern u16 gUnk_0811130E[]; void MountainMinish(Entity* this) { - if ((this->flags & 2) == 0) { + if ((this->flags & ENT_SCRIPTED) == 0) { gUnk_08111368[this->action](this); sub_0806ED78(this); } else { diff --git a/src/npc/npc26.c b/src/npc/npc26.c index 3a4fbf75..3603d246 100644 --- a/src/npc/npc26.c +++ b/src/npc/npc26.c @@ -6,7 +6,7 @@ static void (*const gUnk_081106D4[])(Entity*); static void (*const gUnk_081106E0[])(Entity*); void NPC26(Entity* this) { - if ((this->flags & 2) != 0) { + if ((this->flags & ENT_SCRIPTED) != 0) { gUnk_081106E0[this->action](this); } else { gUnk_081106D4[this->action](this); diff --git a/src/npc/npc5.c b/src/npc/npc5.c index ad5b98f2..3305d1a3 100644 --- a/src/npc/npc5.c +++ b/src/npc/npc5.c @@ -85,7 +85,7 @@ void CreateZeldaFollower(void) { npc = CreateNPC(0x2e, 0, 0); if (npc != NULL) { CopyPosition(&gPlayerEntity, npc); - npc->flags |= 0x20; + npc->flags |= ENT_PERSIST; npc->animationState = GetAnimationState(npc); } } @@ -820,7 +820,7 @@ void sub_08061AA8(Entity* this) { } void sub_08061ACC(Entity* this) { - this->flags = this->flags | 0x20; + this->flags = this->flags | ENT_PERSIST; this->action = 1; this->subAction = 0xff; this->actionDelay = 0; diff --git a/src/npc/percy.c b/src/npc/percy.c index db53c99d..b8defea1 100644 --- a/src/npc/percy.c +++ b/src/npc/percy.c @@ -21,7 +21,7 @@ void Percy_Head(Entity* this) { } void Percy(Entity* this) { - if ((this->flags & 2) != 0) { + if ((this->flags & ENT_SCRIPTED) != 0) { sub_0806B41C(this); } else { sub_0806B3CC(this); diff --git a/src/npc/pina.c b/src/npc/pina.c index 1ca1e56e..703a8061 100644 --- a/src/npc/pina.c +++ b/src/npc/pina.c @@ -13,7 +13,7 @@ extern void (*gUnk_0810CDF8[])(Entity*); extern Dialog gUnk_0810CE04[]; void Pina(Entity* this) { - if ((this->flags & 2) != 0) { + if ((this->flags & ENT_SCRIPTED) != 0) { sub_08063B68(this); } else { sub_08063A80(this); diff --git a/src/npc/postman.c b/src/npc/postman.c index 3629950c..63c6fcf1 100644 --- a/src/npc/postman.c +++ b/src/npc/postman.c @@ -21,7 +21,7 @@ extern void (*const gUnk_0810AA24[])(Entity*); extern Dialog gUnk_0810AA30[]; void Postman(Entity* this) { - if ((this->flags & 2) != 0) { + if ((this->flags & ENT_SCRIPTED) != 0) { sub_08060528(this); } else { gUnk_0810AA24[this->action](this); diff --git a/src/npc/smith.c b/src/npc/smith.c index 764a2aa8..9667b16c 100644 --- a/src/npc/smith.c +++ b/src/npc/smith.c @@ -14,7 +14,7 @@ extern u32 gUnk_081103E0; void Smith(Entity* this) { u32 index; - if ((this->flags & 2) != 0) { + if ((this->flags & ENT_SCRIPTED) != 0) { if (this->interactType == 2) { this->action = 4; this->interactType = 0; diff --git a/src/npc/stamp.c b/src/npc/stamp.c index 4fd6944b..2390a2a9 100644 --- a/src/npc/stamp.c +++ b/src/npc/stamp.c @@ -13,7 +13,7 @@ extern void (*gStampBehaviors2[2])(Entity*); extern Dialog gUnk_0810C2E4[2]; void Stamp(Entity* ent) { - if ((ent->flags & 2) != 0) { + if ((ent->flags & ENT_SCRIPTED) != 0) { gStampBehaviors2[ent->action](ent); } else { gStampBehaviors1[ent->action](ent); diff --git a/src/npc/sturgeon.c b/src/npc/sturgeon.c index 5961a0e1..60f77c1c 100644 --- a/src/npc/sturgeon.c +++ b/src/npc/sturgeon.c @@ -14,7 +14,7 @@ extern void (*const gUnk_0810FA44[])(Entity*); void sub_08064C9C(Entity* this); void Sturgeon(Entity* this) { - if ((this->flags & 2) == 0) { + if ((this->flags & ENT_SCRIPTED) == 0) { gUnk_0810FA44[this->action](this); sub_0806ED78(this); } else { diff --git a/src/npc/talon.c b/src/npc/talon.c index d991ab1f..075e4df4 100644 --- a/src/npc/talon.c +++ b/src/npc/talon.c @@ -10,7 +10,7 @@ extern u8 gUnk_0810FED8[]; void sub_0806574C(Entity* this); void Talon(Entity* this) { - if (this->flags & 2) { + if (this->flags & ENT_SCRIPTED) { gUnk_0810FEC4[this->action](this); } else { gUnk_0810FEBC[this->action](this); diff --git a/src/npc/tingleSiblings.c b/src/npc/tingleSiblings.c index 490f15ee..48c46b6c 100644 --- a/src/npc/tingleSiblings.c +++ b/src/npc/tingleSiblings.c @@ -10,7 +10,7 @@ extern void sub_08064EE8(Entity*); extern void (*const gUnk_0810FBFC[])(Entity*); void TingleSiblings(Entity* this) { - if ((this->flags & 2) != 0) { + if ((this->flags & ENT_SCRIPTED) != 0) { sub_08064DE4(this); } else { sub_08064D78(this); diff --git a/src/npc/townMinish.c b/src/npc/townMinish.c index 04638c22..96bc355e 100644 --- a/src/npc/townMinish.c +++ b/src/npc/townMinish.c @@ -24,7 +24,7 @@ extern u16 gUnk_08112C5C[2]; extern u16 gUnk_08112C60[4]; void TownMinish(Entity* this) { - if ((this->flags & 2) == 0) { + if ((this->flags & ENT_SCRIPTED) == 0) { gUnk_081126E8[this->action](this); sub_0806ED78(this); } else { @@ -139,7 +139,7 @@ void sub_0806ADFC(Entity* this) { void TownMinish_Head(Entity* this) { u32 frames; - if ((this->flags & 2) == 0) { + if ((this->flags & ENT_SCRIPTED) == 0) { frames = this->field_0x68.HALF.HI / 2; if ((this->frameSpriteSettings & 1)) { SetExtraSpriteFrame(this, 0, frames + 0x1c); diff --git a/src/npc/townsperson.c b/src/npc/townsperson.c index edb1b694..8cfd33c1 100644 --- a/src/npc/townsperson.c +++ b/src/npc/townsperson.c @@ -26,7 +26,7 @@ extern u16 gUnk_0810B7BA[]; extern Dialog gUnk_0810B7C0[]; void Townsperson(Entity* this) { - if ((this->flags & 2) != 0) { + if ((this->flags & ENT_SCRIPTED) != 0) { gUnk_0810B77C[this->action](this); } else { gUnk_0810B774[this->action](this); diff --git a/src/npc/zelda.c b/src/npc/zelda.c index f0bc5b77..4842ec83 100644 --- a/src/npc/zelda.c +++ b/src/npc/zelda.c @@ -73,7 +73,7 @@ void sub_08066D94(Entity* this) { npc = CreateNPC(0x2E, 0, 0); if (npc != NULL) { npc->animationState = gPlayerEntity.animationState; - npc->flags |= 0x20; + npc->flags |= ENT_PERSIST; npc->animationState = GetAnimationState(this); room = gRoomControls.room; npc->field_0x74.HWORD = room; diff --git a/src/npcUtils.c b/src/npcUtils.c index a3986e5b..e89e1471 100644 --- a/src/npcUtils.c +++ b/src/npcUtils.c @@ -56,7 +56,7 @@ void NPCInit(Entity* this) { const NPCDefinition* definition = GetNPCDefinition(this); if (definition->bitfield.type == 0) { // No sprite for this NPC - this->flags |= 1; + this->flags |= ENT_DID_INIT; } else { tmp = definition->bitfield.gfx; switch (definition->bitfield.gfx_type) { @@ -290,13 +290,13 @@ void sub_0806F0A4(void) { for (currentEntity = entityList->first; currentEntity != (Entity*)entityList; currentEntity = currentEntity->next) { Entity* nextEnt; - if ((currentEntity->flags & 1) == 0) + if ((currentEntity->flags & ENT_DID_INIT) == 0) continue; if ((currentEntity->field_0x17 & 1) == 0) continue; for (nextEnt = currentEntity->next; nextEnt != (Entity*)entityList; nextEnt = nextEnt->next) { - if ((nextEnt->flags & 1) == 0) + if ((nextEnt->flags & ENT_DID_INIT) == 0) continue; if ((nextEnt->field_0x17 & 1) == 0) continue; diff --git a/src/object/bakerOven.c b/src/object/bakerOven.c index be636d81..cdc65c3a 100644 --- a/src/object/bakerOven.c +++ b/src/object/bakerOven.c @@ -61,7 +61,7 @@ void sub_0809CD0C(Entity* this) { sub_0806FC80(this, &gPlayerEntity, 4)) { this->field_0xf++; ModHealth(-2); - SoundReqClipped(&gPlayerEntity, 0x7a); + SoundReqClipped(&gPlayerEntity, SFX_PLY_VO6); gPlayerEntity.iframes = 16; gPlayerEntity.knockbackDirection = 16; gPlayerEntity.knockbackDuration = 12; diff --git a/src/object/book.c b/src/object/book.c index 790c5839..c0003115 100644 --- a/src/object/book.c +++ b/src/object/book.c @@ -98,7 +98,7 @@ void sub_0809B4A8(Entity* this) { gPlayerEntity.x.HALF.LO = 0; gPlayerEntity.y.HALF.LO = 0; gPlayerEntity.direction = gPlayerEntity.animationState << 2; - EnqueueSFX(0x10f); + EnqueueSFX(SFX_10F); } else { this->actionDelay = 0x16; } diff --git a/src/object/hittableLever.c b/src/object/hittableLever.c index 6dc52e8d..401e9671 100644 --- a/src/object/hittableLever.c +++ b/src/object/hittableLever.c @@ -32,7 +32,7 @@ void HittableLever(HittableLeverEntity* this) { void HittableLever_Init(HittableLeverEntity* this) { super->action = 1; - super->flags |= 0x80; + super->flags |= ENT_COLLIDE; super->field_0x3c = 7; super->hitType = 0x8f; super->flags2 = 0xa; diff --git a/src/object/houseDoorExterior.c b/src/object/houseDoorExterior.c index a1495848..92ba70b8 100644 --- a/src/object/houseDoorExterior.c +++ b/src/object/houseDoorExterior.c @@ -105,7 +105,7 @@ void sub_0808681C(Entity* this) { this->action = 2; this->frameIndex = 1; } - if (this->flags & 0x2) { + if (this->flags & ENT_SCRIPTED) { this->action = 2; } break; @@ -119,7 +119,7 @@ void sub_0808681C(Entity* this) { break; } - if (this->flags & 0x2) { + if (this->flags & ENT_SCRIPTED) { ExecuteScript(this, *(ScriptExecutionContext**)&this->cutsceneBeh); sub_080868EC(this, *(void**)&this->cutsceneBeh); } @@ -158,7 +158,7 @@ static void sub_080868EC(Entity* entity, unk_80868EC* arg1) { } void sub_0808692C(Entity* this) { - this->flags &= 0xFD; + this->flags &= ~ENT_SCRIPTED; this->type2 = 2; this->action = this->frameIndex == 0 ? 1 : 2; this->subAction = 0; diff --git a/src/object/lightableSwitch.c b/src/object/lightableSwitch.c index 639ffa17..a8d9dffd 100644 --- a/src/object/lightableSwitch.c +++ b/src/object/lightableSwitch.c @@ -48,7 +48,7 @@ void sub_0809EA80(Entity* this) { } else { SetFlag(this->field_0x86.HWORD); } - EnqueueSFX(0x110); + EnqueueSFX(SFX_110); } sub_0809EABC(this); } @@ -121,7 +121,7 @@ void sub_0809EBD8(Entity* this) { this->actionDelay = 0x10; this->frameIndex = 2; SetFlag(this->field_0x86.HWORD); - EnqueueSFX(0x110); + EnqueueSFX(SFX_110); } } @@ -135,7 +135,7 @@ void sub_0809EC08(Entity* this) { this->action = 1; this->frameIndex = 3; ClearFlag(this->field_0x86.HWORD); - EnqueueSFX(0x110); + EnqueueSFX(SFX_110); } } } diff --git a/src/object/lilypadLarge.c b/src/object/lilypadLarge.c index 96b4dff9..9a7fe9d4 100644 --- a/src/object/lilypadLarge.c +++ b/src/object/lilypadLarge.c @@ -80,7 +80,7 @@ void sub_08085504(LilypadLargeEntity* this) { super->speed = 0x100; super->spritePriority.b0 = 6; super->hitbox = &gUnk_08120640; - super->flags |= 0x80; + super->flags |= ENT_COLLIDE; super->field_0x3c = 7; super->hitType = 1; super->flags2 = 4; @@ -204,7 +204,7 @@ void sub_08085C5C(LilypadLargeEntity* this) { } } if (gRoomControls.reload_flags == 0) { - super->flags &= 0xdf; + super->flags &= ~ENT_PERSIST; super->action = 1; super->updatePriority = super->updatePriorityPrev; gRoomControls.camera_target = &gPlayerEntity; @@ -228,7 +228,7 @@ void sub_08085D10(LilypadLargeEntity* this) { } void sub_08085D28(LilypadLargeEntity* this) { - if (((gPlayerState.framestate != 0x13) && ((gPlayerState.flags & 2) != 0)) && + if (((gPlayerState.framestate != PL_STATE_TALKEZLO) && ((gPlayerState.flags & 2) != 0)) && (sub_080002B4(super, 0, 0x18) == 0x11)) { super->action = 2; super->subAction = 0; @@ -240,7 +240,7 @@ NONMATCH("asm/non_matching/lilypadLarge/sub_08085D60.inc", void sub_08085D60(Lil u32 r4; // horizontal direction? u32 r6; // vertical direction? if ((gPlayerState.flags & 2) != 0) { - if (gPlayerState.framestate != 0x12) { + if (gPlayerState.framestate != PL_STATE_DIE) { if (gPlayerState.jump_status == 0) { if ((super->direction & 7) == 0) { // North or South r4 = super->direction; @@ -291,12 +291,12 @@ NONMATCH("asm/non_matching/lilypadLarge/sub_08085D60.inc", void sub_08085D60(Lil } } } - super->flags &= 0xdf; + super->flags &= ~ENT_PERSIST; } END_NONMATCH void sub_08085E74(LilypadLargeEntity* this) { - super->flags |= 0x20; + super->flags |= ENT_PERSIST; super->updatePriority = 6; super->action = 3; switch (super->direction) { diff --git a/src/object/lockedDoor.c b/src/object/lockedDoor.c index ddd18056..74cb0e55 100644 --- a/src/object/lockedDoor.c +++ b/src/object/lockedDoor.c @@ -148,7 +148,7 @@ void sub_080834B4(Entity* this) { this->action = 2; this->actionDelay = 7; SetTile(this->field_0x74.HWORD, this->field_0x76.HWORD, this->collisionLayer); - EnqueueSFX(0x10b); + EnqueueSFX(SFX_10B); } } @@ -184,7 +184,7 @@ void sub_08083540(Entity* this) { } } sub_08083814(this, this->field_0x7c.BYTES.byte2); - EnqueueSFX(0x10b); + EnqueueSFX(SFX_10B); } } diff --git a/src/object/mask.c b/src/object/mask.c index 5d94288f..596cb3a7 100644 --- a/src/object/mask.c +++ b/src/object/mask.c @@ -97,7 +97,7 @@ void sub_08092B0C(Entity* this) { this->actionDelay = 0; switch (this->type2 & 0xC0) { case 0x80: - EnqueueSFX(0x72); + EnqueueSFX(SFX_SECRET); case 0x40: SetFlag(this->field_0x86.HWORD); break; diff --git a/src/object/metalDoor.c b/src/object/metalDoor.c index b3998104..2146a801 100644 --- a/src/object/metalDoor.c +++ b/src/object/metalDoor.c @@ -67,7 +67,7 @@ void sub_080A074C(Entity* this) { ent->x.HALF.HI -= 0xc; ent->y.HALF.HI -= 0xc; } - EnqueueSFX(0x10b); + EnqueueSFX(SFX_10B); } } diff --git a/src/object/object2A.c b/src/object/object2A.c index 5ef7ba3e..743eb305 100644 --- a/src/object/object2A.c +++ b/src/object/object2A.c @@ -4,13 +4,15 @@ #include "functions.h" #include "flags.h" -extern void (*const gUnk_08120DD0[])(Entity*); +extern void sub_0807AB44(Entity*, s32, s32); + +void (*const gUnk_08120DD0[])(Entity*); void Object2A(Entity* this) { gUnk_08120DD0[this->action](this); } -void sub_08089B18(Entity* this) { +void Object2A_Init(Entity* this) { this->action = 1; this->spriteSettings.draw = TRUE; if (this->type2 != 0) { @@ -36,5 +38,61 @@ void sub_08089B18(Entity* this) { return; } } - EnqueueSFX(0x124); + EnqueueSFX(SFX_124); } + +void sub_08089BA0(Entity* this) { + u32 val; + GetNextFrame(this); + + switch (this->type) { + case 0: + default: + if (this->type2 == 0) + return; + case 1: + case 2: + if (--this->actionDelay != 0xff) + return; + if (this->type == 2) { + sub_0807B7D8(((u16*)this->child)[3], COORD_TO_TILE(this), this->collisionLayer); + sub_0807AB44(this, 0, 0x10); + sub_0807AB44(this, 0, -0x10); + sub_0807AB44(this, 0x10, 0); + sub_0807AB44(this, -0x10, 0); + } + DeleteThisEntity(); + break; + case 3: + if (this->parent->next == NULL) { + DeleteThisEntity(); + } + if (--this->actionDelay == 0) { + DeleteThisEntity(); + } + + CopyPosition(this->parent, this); + break; + case 4: + val = CheckFlags(this->field_0x86.HWORD); + if (this->subAction == 0) { + if (val) + return; + this->subAction = 1; + this->spriteSettings.draw = 0; + } else { + if (!val) + return; + this->subAction = 0; + this->spriteSettings.draw = 1; + InitializeAnimation(this, 0); + EnqueueSFX(SFX_124); + } + break; + } +} + +void (*const gUnk_08120DD0[])(Entity*) = { + Object2A_Init, + sub_08089BA0, +}; diff --git a/src/object/object6A.c b/src/object/object6A.c index 29dcb2ef..91c7108a 100644 --- a/src/object/object6A.c +++ b/src/object/object6A.c @@ -212,7 +212,7 @@ void sub_08094C30(Object6AEntity* this) { DeleteThisEntity(); if (super->action == 0) { super->action++; - SetDefaultPriority(super, 2); + SetDefaultPriority(super, PRIO_MESSAGE); super->spriteRendering.b3 = gUnk_08114F30[p->spriteRendering.b3]; InitAnimationForceUpdate(super, 1); } @@ -231,7 +231,7 @@ void sub_08094C88(Object6AEntity* this) { } else { super->action++; super->spriteSettings.draw = 1; - SetDefaultPriority(super, 3); + SetDefaultPriority(super, PRIO_NO_BLOCK); switch (super->type2) { case 0x40: case 0x41: @@ -290,7 +290,7 @@ void sub_08094D94(Object6AEntity* this) { } else { super->action++; super->spriteSettings.draw = 1; - SetDefaultPriority(super, 3); + SetDefaultPriority(super, PRIO_NO_BLOCK); InitAnimationForceUpdate(super, 0); } UpdateAnimationSingleFrame(super); @@ -330,7 +330,7 @@ void sub_08094E30(Object6AEntity* this) { super->action++; super->z.WORD = -0xA00000; super->zVelocity = 0; - SetDefaultPriority(super, 6); + SetDefaultPriority(super, PRIO_PLAYER_EVENT); InitializeAnimation(super, 0); if (sub_080002B8(super) == 13) { super->action = 3; @@ -344,7 +344,7 @@ void sub_08094E30(Object6AEntity* this) { super->z.WORD = 0; super->zVelocity = 0; InitializeAnimation(super, 1); - EnqueueSFX(382); + EnqueueSFX(SFX_LAVA_TILE_FLIP); } break; case 2: @@ -472,7 +472,7 @@ void sub_08095088(Object6AEntity* this) { void sub_08095120(Object6AEntity* this) { if (super->action == 0) { super->action = 1; - SetDefaultPriority(super, 3); + SetDefaultPriority(super, PRIO_NO_BLOCK); SortEntityBelow(super, super); sub_0807DD64(super); InitAnimationForceUpdate(super, 2); @@ -492,7 +492,7 @@ void sub_08095164(Object6AEntity* this) { void sub_08095188(Object6AEntity* this) { if (super->action == 0) { super->action = 1; - SetDefaultPriority(super, 3); + SetDefaultPriority(super, PRIO_NO_BLOCK); SortEntityBelow(super, super); sub_0807DD64(super); InitAnimationForceUpdate(super, 0); @@ -547,7 +547,7 @@ void sub_08095288(Object6AEntity* this) { if (super->action == 0) { super->action++; super->subAction = 0; - SetDefaultPriority(super, 3); + SetDefaultPriority(super, PRIO_NO_BLOCK); InitAnimationForceUpdate(super, 0); } if (super->subAction != 0) { @@ -607,7 +607,7 @@ void sub_080953A4(Object6AEntity* this) { if (super->action == 0) { super->action++; super->z.HALF.HI = -16; - SetDefaultPriority(super, 2); + SetDefaultPriority(super, PRIO_MESSAGE); super->spriteRendering.b3 = gUnk_08114F30[super->spriteRendering.b3]; SortEntityAbove(super, super); sub_0807DD64(super); @@ -847,7 +847,7 @@ void sub_080958D8(Object6AEntity* this) { void sub_08095918(Object6AEntity* this) { if (super->action == 0) { super->action++; - SetDefaultPriority(super, 6); + SetDefaultPriority(super, PRIO_PLAYER_EVENT); sub_0807DD64(super); InitializeAnimation(super, 0); } @@ -871,7 +871,7 @@ void sub_08095954(Object6AEntity* this) { PositionRelative(super, e, x, y); e->z.HALF.HI = -3; ((Object6AEntity*)e)->ctx = StartCutscene(e, &script_08012C48); - EnqueueSFX(292); + EnqueueSFX(SFX_124); super->frame &= ~1; } else { gActiveScriptInfo.syncFlags |= 0x100; @@ -882,7 +882,7 @@ void sub_080959CC(Object6AEntity* this) { if (super->action == 0) { super->action++; super->spriteSettings.draw = 0; - SetDefaultPriority(super, 3); + SetDefaultPriority(super, PRIO_NO_BLOCK); sub_0807DD64(super); } ExecuteScriptForEntity(super, 0); @@ -1038,7 +1038,7 @@ void sub_08095CE0(Object6AEntity* this) { if (super->action == 0) { super->action++; super->spriteSettings.draw = 0; - SetDefaultPriority(super, 6); + SetDefaultPriority(super, PRIO_PLAYER_EVENT); sub_0807DD64(super); } ExecuteScriptForEntity(super, 0); diff --git a/src/object/pot.c b/src/object/pot.c index 67b77328..4e47144f 100644 --- a/src/object/pot.c +++ b/src/object/pot.c @@ -89,7 +89,7 @@ void sub_08082310(Entity* this) { this->actionDelay = 64; } SetTile((u16)this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer); - EnqueueSFX(0x10F); + EnqueueSFX(SFX_10F); break; case 0x4067: SetTile((u16)this->field_0x70.HALF.LO, COORD_TO_TILE(this), this->collisionLayer); diff --git a/src/object/pullableLever.c b/src/object/pullableLever.c index 28109862..56acc72d 100644 --- a/src/object/pullableLever.c +++ b/src/object/pullableLever.c @@ -124,7 +124,7 @@ void PullableLever_HandleSubAction0(PullableLeverEntity* this) { super->field_0xf = 2; } if (player->animationState >> 1 == super->type2) { - if (gPlayerState.framestate == 0x1a) { + if (gPlayerState.framestate == PL_STATE_PULL) { if (gPlayerState.heldObject & 2) { if (gPlayerEntity.frame & 2) { sub_0809153C(this); diff --git a/src/object/railtrack.c b/src/object/railtrack.c index d92a9546..303d279d 100644 --- a/src/object/railtrack.c +++ b/src/object/railtrack.c @@ -55,7 +55,7 @@ void sub_08085264(Entity* this) { this->animationState = (this->animationState + *(u8*)&this->field_0x7c) & 3; InitializeAnimation(this, this->animationState); sub_0808543C(this); - EnqueueSFX(0x151); + EnqueueSFX(SFX_151); } } @@ -67,7 +67,7 @@ void sub_080852B4(Entity* this) { this->animationState = (this->animationState + *(u8*)&this->field_0x7c) & 3; InitializeAnimation(this, this->animationState); sub_08085394(this); - EnqueueSFX(0x151); + EnqueueSFX(SFX_151); } } @@ -97,7 +97,7 @@ void sub_08085308(Entity* this) { this->animationState = (this->animationState + *(u8*)&this->field_0x7c) & 3; InitializeAnimation(this, this->animationState); sub_0808543C(this); - EnqueueSFX(0x151); + EnqueueSFX(SFX_151); } } } diff --git a/src/object/warpPoint.c b/src/object/warpPoint.c index 02b73a9a..09c78307 100644 --- a/src/object/warpPoint.c +++ b/src/object/warpPoint.c @@ -56,7 +56,7 @@ void sub_0808B474(Entity* this) { gPlayerEntity.x.HALF.HI = this->x.HALF.HI; gPlayerEntity.y.HALF.HI = this->y.HALF.HI; gPlayerEntity.animationState = 4; - EnqueueSFX(0x112); + EnqueueSFX(SFX_112); RequestPriorityDuration(this, this->field_0xf + 0x10); } @@ -68,7 +68,7 @@ void sub_0808B530(Entity* this) { } this->action = 2; this->field_0xf = 60; - EnqueueSFX(0x112); + EnqueueSFX(SFX_112); } } @@ -91,7 +91,7 @@ void sub_0808B590(Entity* this) { gPlayerEntity.x.HALF.HI = this->x.HALF.HI; gPlayerEntity.y.HALF.HI = this->y.HALF.HI; gPlayerEntity.animationState = 4; - gPlayerEntity.flags &= ~0x80; + gPlayerEntity.flags &= ~ENT_COLLIDE; RequestPriorityDuration(this, this->field_0xf + 0x10); SoundReq(SFX_113); } else { diff --git a/src/playerItem/playerItem3.c b/src/playerItem/playerItem3.c index e8b76de0..4e668d64 100644 --- a/src/playerItem/playerItem3.c +++ b/src/playerItem/playerItem3.c @@ -23,7 +23,7 @@ void PlayerItem3(Entity* this) { this->field_0xf--; if ((this->field_0xf & 0xf) == 0) { - EnqueueSFX(0xfb); + EnqueueSFX(SFX_FB); } } diff --git a/src/playerItem/playerItemC.c b/src/playerItem/playerItemC.c index cc494f79..aa08e1bc 100644 --- a/src/playerItem/playerItemC.c +++ b/src/playerItem/playerItemC.c @@ -19,7 +19,7 @@ void PlayerItemC(Entity* this) { void sub_0801B8B0(Entity* this) { if (gPlayerState.dash_state != 0) { gPlayerState.item = this; - this->flags |= 0x20; + this->flags |= ENT_PERSIST; this->action = 0x01; this->flags2 = 8; LoadSwapGFX(this, 1, 3); @@ -41,7 +41,7 @@ void sub_0801B8FC(Entity* this) { gPlayerState.item = NULL; DeleteThisEntity(); } else { - pbVar1->flags |= 0x80; + pbVar1->flags |= ENT_COLLIDE; pbVar1->field_0x3c = 0x21; sub_0801B938(pbVar1); } diff --git a/src/playerItem/playerItemLantern.c b/src/playerItem/playerItemLantern.c index 3b7071df..00b2f9c6 100644 --- a/src/playerItem/playerItemLantern.c +++ b/src/playerItem/playerItemLantern.c @@ -13,7 +13,7 @@ void PlayerItemLantern(Entity* this) { } void sub_08054A60(Entity* this) { - this->flags |= 0xa0; + this->flags |= (ENT_PERSIST | ENT_COLLIDE); this->action = 0x01; this->actionDelay = 0x04; this->frameIndex = -1; diff --git a/src/projectile/arrowProjectile.c b/src/projectile/arrowProjectile.c index bdb0a214..7f6079f7 100644 --- a/src/projectile/arrowProjectile.c +++ b/src/projectile/arrowProjectile.c @@ -73,7 +73,7 @@ void ArrowProjectile_Action2(Entity* this) { COLLISION_OFF(this); this->actionDelay = 0x20; InitializeAnimation(this, this->animIndex + 2); - EnqueueSFX(0x18a); + EnqueueSFX(SFX_18A); LinearMoveUpdate(this); } else if (--this->actionDelay == 0) { DeleteThisEntity(); diff --git a/src/projectile/ballAndChain.c b/src/projectile/ballAndChain.c index c01f9a42..2f242f85 100644 --- a/src/projectile/ballAndChain.c +++ b/src/projectile/ballAndChain.c @@ -86,9 +86,9 @@ void sub_080AB170(Entity* this) { ent = parent->parent; if (this->field_0x7c.BYTES.byte0 != ent->field_0x7c.BYTES.byte0) { - this->flags |= 0x80; + this->flags |= ENT_COLLIDE; } else { - this->flags &= 0x7f; + this->flags &= ~ENT_COLLIDE; } this->field_0x7c.BYTES.byte0 = ent->field_0x7c.BYTES.byte0; diff --git a/src/projectile/dirtBallProjectile.c b/src/projectile/dirtBallProjectile.c index df383b15..03769bb0 100644 --- a/src/projectile/dirtBallProjectile.c +++ b/src/projectile/dirtBallProjectile.c @@ -145,7 +145,7 @@ void DirtBallProjectile_Action2(Entity* this) { switch (this->type) { case 0: InitializeAnimation(this, 1); - EnqueueSFX(0x84); + EnqueueSFX(SFX_WATER_SPLASH); this->action = 3; return; case 2: diff --git a/src/projectile/gyorgMaleEnergyProjectile.c b/src/projectile/gyorgMaleEnergyProjectile.c index cfcfed29..f654133e 100644 --- a/src/projectile/gyorgMaleEnergyProjectile.c +++ b/src/projectile/gyorgMaleEnergyProjectile.c @@ -33,7 +33,7 @@ void sub_080AC8DC(Entity* this) { default: { if (this->action != 3) { this->action = 3; - this->flags &= 0x7f; + this->flags &= ~ENT_COLLIDE; this->speed >>= 1; InitializeAnimation(this, 1); } diff --git a/src/projectile/lakituCloudProjectile.c b/src/projectile/lakituCloudProjectile.c index 0175653f..f66dd20e 100644 --- a/src/projectile/lakituCloudProjectile.c +++ b/src/projectile/lakituCloudProjectile.c @@ -42,7 +42,7 @@ void LakituCloudProjectile_SubAction2(Entity* this) { if (sub_0806F3E4(this) != 0) { if (this->hitType == 0xa6) { ModHealth(-2); - SoundReqClipped(&gPlayerEntity, 0x7a); + SoundReqClipped(&gPlayerEntity, SFX_PLY_VO6); sub_08079D84(); } CreateFx(this, FX_DEATH, 0); diff --git a/src/projectile/mandiblesProjectile.c b/src/projectile/mandiblesProjectile.c index f7fe2924..26e2fe24 100644 --- a/src/projectile/mandiblesProjectile.c +++ b/src/projectile/mandiblesProjectile.c @@ -171,7 +171,7 @@ void MandiblesProjectile_Action4(Entity* this) { if (entity->health == 0) { DeleteThisEntity(); } - EnqueueSFX(0xf2); + EnqueueSFX(SFX_F2); this->action = 1; this->animationState = 0xff; this->field_0x82.HALF.LO = 0; diff --git a/src/projectile/spiderWeb.c b/src/projectile/spiderWeb.c index 3f683296..c6176fa7 100644 --- a/src/projectile/spiderWeb.c +++ b/src/projectile/spiderWeb.c @@ -149,7 +149,7 @@ void SpiderWeb_SubAction0(Entity* this) { if ((this->frame & 1) != 0) { entity->x.HALF.HI = gUnk_0812A06C[entity->animationState] + entity->x.HALF.HI; entity->y.HALF.HI = gUnk_0812A06C[entity->animationState + 1] + entity->y.HALF.HI; - EnqueueSFX(0x100); + EnqueueSFX(SFX_100); } } } diff --git a/src/projectile/v1DarkMagicProjectile.c b/src/projectile/v1DarkMagicProjectile.c index dbc770a1..c8320212 100644 --- a/src/projectile/v1DarkMagicProjectile.c +++ b/src/projectile/v1DarkMagicProjectile.c @@ -203,7 +203,7 @@ void sub_080AAF74(Entity* this) { this->actionDelay = 0x1e; gPlayerEntity.iframes = 8; ModHealth(-4); - SoundReqClipped(&gPlayerEntity, 0x7a); + SoundReqClipped(&gPlayerEntity, SFX_PLY_VO6); if (gPlayerEntity.health == 0) { this->health = 0; } diff --git a/src/projectile/v2Projectile.c b/src/projectile/v2Projectile.c index fc7f09d2..fc863d53 100644 --- a/src/projectile/v2Projectile.c +++ b/src/projectile/v2Projectile.c @@ -84,7 +84,7 @@ void nullsub_542(Entity* this) { void sub_080ABC90(Entity* this) { if (sub_0806F3E4(this) != 0) { ModHealth(-2); - SoundReqClipped(&gPlayerEntity, 0x7a); + SoundReqClipped(&gPlayerEntity, SFX_PLY_VO6); sub_08079D84(); CreateFx(this, FX_DEATH, 0); DeleteThisEntity(); diff --git a/src/projectile/v3ElectricProjectile.c b/src/projectile/v3ElectricProjectile.c index a3461f03..869d02aa 100644 --- a/src/projectile/v3ElectricProjectile.c +++ b/src/projectile/v3ElectricProjectile.c @@ -43,7 +43,7 @@ void sub_080ABFEC(Entity* this) { } case 1: { this->action = 1; - this->flags &= 0x7f; + this->flags &= ~ENT_COLLIDE; this->cutsceneBeh.HALF.HI = 0x18; CopyPositionAndSpriteOffset(this->parent, this); this->z.HALF.HI -= 0x14; diff --git a/src/projectile/v3TennisBallProjectile.c b/src/projectile/v3TennisBallProjectile.c index 00fc5da7..b25cbf48 100644 --- a/src/projectile/v3TennisBallProjectile.c +++ b/src/projectile/v3TennisBallProjectile.c @@ -26,7 +26,7 @@ void sub_080ACA68(Entity* this) { case 0xc: case 0x6: { this->action = 2; - this->flags &= 0x7f; + this->flags &= ~ENT_COLLIDE; this->speed += 0x80 * 2; this->child = this->field_0x4c; if (sub_080ACB40(this)) { diff --git a/src/respawnPlayer.c b/src/respawnPlayer.c index 24d23b65..4a201c4e 100644 --- a/src/respawnPlayer.c +++ b/src/respawnPlayer.c @@ -31,7 +31,7 @@ void ResetPlayer() { case 2: case 3: case 4: { - gPlayerState.framestate = 0; + gPlayerState.framestate = PL_STATE_IDLE; break; } }