diff --git a/asm/enemy/gyorgChild.s b/asm/enemy/gyorgChild.s deleted file mode 100644 index 4eae2a9a..00000000 --- a/asm/enemy/gyorgChild.s +++ /dev/null @@ -1,455 +0,0 @@ - .include "asm/macros.inc" - - .include "constants/constants.inc" - - .syntax unified - - .text - - - thumb_func_start GyorgChild -GyorgChild: @ 0x08048640 - push {r4, r5, lr} - adds r5, r0, #0 - ldr r0, _0804867C @ =gRoomTransition - adds r0, #0x39 - ldrb r2, [r0] - cmp r2, #0 - bne _08048664 - ldrb r1, [r5, #0x10] - movs r0, #0x7f - ands r0, r1 - strb r0, [r5, #0x10] - adds r0, r5, #0 - adds r0, #0x45 - strb r2, [r0] - adds r1, r5, #0 - adds r1, #0x38 - movs r0, #2 - strb r0, [r1] -_08048664: - ldr r4, _08048680 @ =gUnk_080D1E6C - adds r0, r5, #0 - bl GetNextFunction - lsls r0, r0, #2 - adds r0, r0, r4 - ldr r1, [r0] - adds r0, r5, #0 - bl _call_via_r1 - pop {r4, r5, pc} - .align 2, 0 -_0804867C: .4byte gRoomTransition -_08048680: .4byte gUnk_080D1E6C - - thumb_func_start sub_08048684 -sub_08048684: @ 0x08048684 - push {lr} - ldr r2, _08048698 @ =gUnk_080D1E84 - ldrb r1, [r0, #0xc] - lsls r1, r1, #2 - adds r1, r1, r2 - ldr r1, [r1] - bl _call_via_r1 - pop {pc} - .align 2, 0 -_08048698: .4byte gUnk_080D1E84 - - thumb_func_start sub_0804869C -sub_0804869C: @ 0x0804869C - push {lr} - ldr r1, _080486A8 @ =gUnk_080D1E6C - bl sub_0804AA30 - pop {pc} - .align 2, 0 -_080486A8: .4byte gUnk_080D1E6C - - thumb_func_start sub_080486AC -sub_080486AC: @ 0x080486AC - push {r4, lr} - adds r4, r0, #0 - bl sub_0806F520 - cmp r0, #0 - beq _080486C8 - ldr r0, _080486CC @ =gUnk_080D1E94 - ldrb r1, [r4, #0xd] - lsls r1, r1, #2 - adds r1, r1, r0 - ldr r1, [r1] - adds r0, r4, #0 - bl _call_via_r1 -_080486C8: - pop {r4, pc} - .align 2, 0 -_080486CC: .4byte gUnk_080D1E94 - - thumb_func_start sub_080486D0 -sub_080486D0: @ 0x080486D0 - movs r1, #2 - strb r1, [r0, #0xd] - bx lr - .align 2, 0 - - thumb_func_start sub_080486D8 -sub_080486D8: @ 0x080486D8 - push {lr} - bl sub_0806F4E8 - pop {pc} - - thumb_func_start sub_080486E0 -sub_080486E0: @ 0x080486E0 - push {r4, lr} - adds r4, r0, #0 - bl sub_0806F3E4 - cmp r0, #0 - beq _080486F2 - adds r0, r4, #0 - bl sub_0804A7D4 -_080486F2: - pop {r4, pc} - - thumb_func_start sub_080486F4 -sub_080486F4: @ 0x080486F4 - push {r4, r5, lr} - adds r4, r0, #0 - movs r5, #1 - strb r5, [r4, #0x1c] - ldrb r0, [r4, #0x1b] - movs r1, #0xc0 - orrs r0, r1 - strb r0, [r4, #0x1b] - ldrb r0, [r4, #0x19] - orrs r0, r1 - strb r0, [r4, #0x19] - adds r2, r4, #0 - adds r2, #0x29 - ldrb r0, [r2] - movs r1, #7 - orrs r0, r1 - strb r0, [r2] - ldrb r0, [r4, #0x15] - lsrs r0, r0, #2 - strb r0, [r4, #0x14] - ldrb r0, [r4, #0xa] - cmp r0, #0 - bne _0804876C - ldrb r1, [r4, #0x14] - adds r0, r4, #0 - bl InitializeAnimation - strb r5, [r4, #0xc] - ldrb r0, [r4, #0x10] - movs r1, #0x80 - orrs r0, r1 - strb r0, [r4, #0x10] - bl Random - movs r1, #0xb - bl __modsi3 - ldrb r1, [r4, #0x15] - adds r1, r1, r0 - subs r1, #5 - movs r2, #0x1f - ands r1, r2 - strb r1, [r4, #0x15] - lsls r0, r0, #1 - ldr r2, _08048768 @ =gUnk_080D1EA0 - adds r1, r0, r2 - ldrb r1, [r1] - strb r1, [r4, #0xe] - adds r0, #1 - adds r0, r0, r2 - ldrb r0, [r0] - adds r1, r4, #0 - adds r1, #0x7b - strb r0, [r1] - movs r0, #0x80 - lsls r0, r0, #2 - strh r0, [r4, #0x24] - b _0804877A - .align 2, 0 -_08048768: .4byte gUnk_080D1EA0 -_0804876C: - movs r0, #2 - strb r0, [r4, #0xc] - strb r5, [r4, #0xe] - ldrb r1, [r4, #0x18] - subs r0, #6 - ands r0, r1 - strb r0, [r4, #0x18] -_0804877A: - pop {r4, r5, pc} - - thumb_func_start sub_0804877C -sub_0804877C: @ 0x0804877C - push {r4, lr} - adds r4, r0, #0 - bl LinearMoveUpdate - ldrb r0, [r4, #0xe] - cmp r0, #0 - beq _080487AA - subs r0, #1 - strb r0, [r4, #0xe] - movs r1, #0xff - ands r0, r1 - movs r1, #0xf - ands r0, r1 - cmp r0, #0 - bne _080487AA - adds r0, r4, #0 - adds r0, #0x7b - ldrb r0, [r0] - ldrb r1, [r4, #0x15] - adds r0, r0, r1 - movs r1, #0x1f - ands r0, r1 - strb r0, [r4, #0x15] -_080487AA: - ldrb r0, [r4, #0x14] - lsrs r0, r0, #1 - cmp r0, #1 - beq _080487D4 - cmp r0, #1 - bgt _080487BC - cmp r0, #0 - beq _080487C2 - b _08048804 -_080487BC: - cmp r0, #2 - beq _080487EC - b _08048804 -_080487C2: - movs r2, #0x32 - ldrsh r1, [r4, r2] - ldr r0, _080487D0 @ =gRoomControls - movs r2, #0xc - ldrsh r0, [r0, r2] - b _0804880E - .align 2, 0 -_080487D0: .4byte gRoomControls -_080487D4: - movs r0, #0x2e - ldrsh r1, [r4, r0] - ldr r0, _080487E8 @ =gRoomControls - movs r2, #0xa - ldrsh r0, [r0, r2] - movs r2, #0x84 - lsls r2, r2, #1 - adds r0, r0, r2 - b _080487F8 - .align 2, 0 -_080487E8: .4byte gRoomControls -_080487EC: - movs r0, #0x32 - ldrsh r1, [r4, r0] - ldr r0, _08048800 @ =gRoomControls - movs r2, #0xc - ldrsh r0, [r0, r2] - adds r0, #0xb8 -_080487F8: - cmp r1, r0 - blt _08048824 - b _08048814 - .align 2, 0 -_08048800: .4byte gRoomControls -_08048804: - movs r0, #0x2e - ldrsh r1, [r4, r0] - ldr r0, _08048828 @ =gRoomControls - movs r2, #0xa - ldrsh r0, [r0, r2] -_0804880E: - subs r0, #0x18 - cmp r1, r0 - bgt _08048824 -_08048814: - movs r0, #2 - strb r0, [r4, #0xc] - movs r0, #0x5a - strb r0, [r4, #0xe] - ldrb r1, [r4, #0x18] - subs r0, #0x5e - ands r0, r1 - strb r0, [r4, #0x18] -_08048824: - pop {r4, pc} - .align 2, 0 -_08048828: .4byte gRoomControls - - thumb_func_start sub_0804882C -sub_0804882C: @ 0x0804882C - push {r4, lr} - adds r4, r0, #0 - ldrb r0, [r4, #0xe] - subs r0, #1 - strb r0, [r4, #0xe] - lsls r0, r0, #0x18 - cmp r0, #0 - bne _080488FA - movs r0, #3 - strb r0, [r4, #0xc] - ldrb r0, [r4, #0x10] - movs r1, #0x80 - orrs r0, r1 - strb r0, [r4, #0x10] - bl Random - ldrb r1, [r4, #0x18] - movs r0, #4 - rsbs r0, r0, #0 - ands r0, r1 - movs r1, #1 - orrs r0, r1 - strb r0, [r4, #0x18] - adds r2, r4, #0 - adds r2, #0x29 - ldrb r1, [r2] - movs r0, #8 - rsbs r0, r0, #0 - ands r0, r1 - movs r1, #4 - orrs r0, r1 - strb r0, [r2] - adds r0, r4, #0 - adds r0, #0x78 - ldrh r0, [r0] - strh r0, [r4, #0x24] - adds r1, r4, #0 - adds r1, #0x38 - movs r0, #2 - strb r0, [r1] - adds r0, r4, #0 - bl UpdateSpriteForCollisionLayer - adds r0, r4, #0 - adds r0, #0x7a - ldrb r0, [r0] - strb r0, [r4, #0x15] - lsls r0, r0, #0x18 - lsrs r0, r0, #0x1a - strb r0, [r4, #0x14] - ldrb r1, [r4, #0x14] - adds r0, r4, #0 - bl InitializeAnimation - ldrb r0, [r4, #0x14] - lsrs r0, r0, #1 - cmp r0, #1 - beq _080488D0 - cmp r0, #1 - bgt _080488AA - cmp r0, #0 - beq _080488AE - b _080488D0 -_080488AA: - cmp r0, #2 - bne _080488D0 -_080488AE: - ldr r1, _080488C8 @ =gPlayerEntity - adds r0, r4, #0 - adds r0, #0x74 - ldrh r0, [r0] - ldrh r1, [r1, #0x2e] - adds r0, r0, r1 - strh r0, [r4, #0x2e] - ldr r1, _080488CC @ =gRoomControls - adds r0, r4, #0 - adds r0, #0x76 - ldrh r0, [r0] - ldrh r1, [r1, #0xc] - b _080488E8 - .align 2, 0 -_080488C8: .4byte gPlayerEntity -_080488CC: .4byte gRoomControls -_080488D0: - ldr r1, _080488FC @ =gRoomControls - adds r0, r4, #0 - adds r0, #0x74 - ldrh r0, [r0] - ldrh r1, [r1, #0xa] - adds r0, r0, r1 - strh r0, [r4, #0x2e] - ldr r1, _08048900 @ =gPlayerEntity - adds r0, r4, #0 - adds r0, #0x76 - ldrh r0, [r0] - ldrh r1, [r1, #0x32] -_080488E8: - adds r0, r0, r1 - strh r0, [r4, #0x32] - ldrb r0, [r4, #0xb] - cmp r0, #0 - bne _080488FA - movs r0, #0xcc - lsls r0, r0, #1 - bl SoundReq -_080488FA: - pop {r4, pc} - .align 2, 0 -_080488FC: .4byte gRoomControls -_08048900: .4byte gPlayerEntity - - thumb_func_start sub_08048904 -sub_08048904: @ 0x08048904 - push {r4, lr} - adds r4, r0, #0 - bl LinearMoveUpdate - adds r0, r4, #0 - bl GetNextFrame - ldrb r0, [r4, #0x14] - lsrs r0, r0, #1 - cmp r0, #1 - beq _0804893C - cmp r0, #1 - bgt _08048924 - cmp r0, #0 - beq _0804892A - b _0804896C -_08048924: - cmp r0, #2 - beq _08048954 - b _0804896C -_0804892A: - movs r0, #0x32 - ldrsh r1, [r4, r0] - ldr r0, _08048938 @ =gRoomControls - movs r2, #0xc - ldrsh r0, [r0, r2] - b _08048976 - .align 2, 0 -_08048938: .4byte gRoomControls -_0804893C: - movs r0, #0x2e - ldrsh r1, [r4, r0] - ldr r0, _08048950 @ =gRoomControls - movs r2, #0xa - ldrsh r0, [r0, r2] - movs r2, #0x8c - lsls r2, r2, #1 - adds r0, r0, r2 - b _08048960 - .align 2, 0 -_08048950: .4byte gRoomControls -_08048954: - movs r0, #0x32 - ldrsh r1, [r4, r0] - ldr r0, _08048968 @ =gRoomControls - movs r2, #0xc - ldrsh r0, [r0, r2] - adds r0, #0xc8 -_08048960: - cmp r1, r0 - blt _08048980 - b _0804897C - .align 2, 0 -_08048968: .4byte gRoomControls -_0804896C: - movs r0, #0x2e - ldrsh r1, [r4, r0] - ldr r0, _08048984 @ =gRoomControls - movs r2, #0xa - ldrsh r0, [r0, r2] -_08048976: - subs r0, #0x28 - cmp r1, r0 - bgt _08048980 -_0804897C: - bl DeleteThisEntity -_08048980: - pop {r4, pc} - .align 2, 0 -_08048984: .4byte gRoomControls diff --git a/asm/enemy/gyorgFemale.s b/asm/enemy/gyorgFemale.s deleted file mode 100644 index 2b113b5c..00000000 --- a/asm/enemy/gyorgFemale.s +++ /dev/null @@ -1,1093 +0,0 @@ - .include "asm/macros.inc" - - .include "constants/constants.inc" - - .syntax unified - - .text - - - thumb_func_start GyorgFemale -GyorgFemale: @ 0x08046134 - push {lr} - ldr r2, _08046148 @ =gUnk_080D1A64 - ldrb r1, [r0, #0xc] - lsls r1, r1, #2 - adds r1, r1, r2 - ldr r1, [r1] - bl _call_via_r1 - pop {pc} - .align 2, 0 -_08046148: .4byte gUnk_080D1A64 - - thumb_func_start sub_0804614C -sub_0804614C: @ 0x0804614C - push {r4, r5, r6, lr} - adds r6, r0, #0 - ldr r0, _08046248 @ =gEntCount - ldrb r0, [r0] - cmp r0, #0x3d - bhi _08046244 - movs r0, #0x22 - bl CreateProjectile - adds r1, r0, #0 - movs r4, #0 - strb r4, [r1, #0xa] - str r6, [r1, #0x50] - ldr r0, [r6, #0x64] - str r1, [r0, #0x14] - movs r0, #0x63 - movs r1, #0 - bl CreateEnemy - adds r1, r0, #0 - str r6, [r1, #0x50] - ldr r0, [r6, #0x64] - str r1, [r0, #0x10] - movs r0, #0x61 - movs r1, #0 - bl CreateEnemy - adds r1, r0, #0 - str r6, [r1, #0x50] - movs r0, #0x61 - movs r1, #1 - bl CreateEnemy - adds r1, r0, #0 - str r6, [r1, #0x50] - movs r0, #0x61 - movs r1, #2 - bl CreateEnemy - adds r1, r0, #0 - str r6, [r1, #0x50] - movs r0, #0x61 - movs r1, #3 - bl CreateEnemy - adds r1, r0, #0 - str r6, [r1, #0x50] - movs r0, #0x61 - movs r1, #4 - bl CreateEnemy - adds r1, r0, #0 - str r6, [r1, #0x50] - movs r0, #0x61 - movs r1, #5 - bl CreateEnemy - adds r1, r0, #0 - str r6, [r1, #0x50] - movs r0, #0x61 - movs r1, #6 - bl CreateEnemy - adds r1, r0, #0 - str r6, [r1, #0x50] - movs r0, #0x61 - movs r1, #7 - bl CreateEnemy - adds r1, r0, #0 - str r6, [r1, #0x50] - movs r0, #1 - strb r0, [r6, #0xc] - ldrb r2, [r6, #0x1b] - movs r1, #0x3f - adds r0, r1, #0 - ands r0, r2 - movs r2, #0x80 - orrs r0, r2 - strb r0, [r6, #0x1b] - ldrb r0, [r6, #0x19] - ands r1, r0 - orrs r1, r2 - strb r1, [r6, #0x19] - adds r0, r6, #0 - adds r0, #0x38 - movs r5, #2 - strb r5, [r0] - adds r0, #0x40 - strb r4, [r0] - adds r0, #1 - strb r4, [r0] - adds r1, r6, #0 - adds r1, #0x70 - movs r0, #0x3c - strh r0, [r1] - ldr r0, _0804624C @ =gUnk_02019EE0 - movs r4, #0x80 - lsls r4, r4, #8 - adds r1, r4, #0 - bl MemClear - ldr r0, _08046250 @ =gMapDataTopSpecial - adds r1, r4, #0 - bl MemClear - adds r0, r6, #0 - movs r1, #0 - bl sub_0804660C - adds r0, r6, #0 - bl sub_080464C0 - ldr r0, _08046254 @ =gPlayerEntity - adds r1, r0, #0 - adds r1, #0x38 - strb r5, [r1] - bl UpdateSpriteForCollisionLayer - ldr r1, _08046258 @ =sub_08046498 - adds r0, r6, #0 - movs r2, #0 - bl RegisterTransitionManager -_08046244: - pop {r4, r5, r6, pc} - .align 2, 0 -_08046248: .4byte gEntCount -_0804624C: .4byte gUnk_02019EE0 -_08046250: .4byte gMapDataTopSpecial -_08046254: .4byte gPlayerEntity -_08046258: .4byte sub_08046498 - - thumb_func_start sub_0804625C -sub_0804625C: @ 0x0804625C - push {r4, lr} - adds r4, r0, #0 - adds r3, r4, #0 - adds r3, #0x79 - ldrb r2, [r3] - movs r0, #0x80 - ands r0, r2 - cmp r0, #0 - beq _08046286 - movs r1, #0x7f - ands r1, r2 - movs r0, #0x40 - orrs r1, r0 - strb r1, [r3] - movs r0, #3 - ands r1, r0 - lsls r1, r1, #6 - adds r0, r4, #0 - bl sub_0804660C - b _0804629A -_08046286: - movs r0, #0x40 - ands r0, r2 - cmp r0, #0 - beq _0804629A - movs r0, #0xbf - ands r0, r2 - strb r0, [r3] - adds r0, r4, #0 - bl sub_080464C0 -_0804629A: - bl sub_080465C8 - ldr r0, [r4, #0x64] - ldr r0, [r0] - adds r0, #0x6c - ldrh r1, [r0] - movs r3, #0x38 - ands r3, r1 - cmp r3, #0 - beq _080462D6 - movs r1, #0 - movs r0, #2 - strb r0, [r4, #0xc] - strb r1, [r4, #0xe] - adds r0, r4, #0 - adds r0, #0x7a - movs r2, #0 - strh r1, [r0] - adds r0, #2 - strb r2, [r0] - adds r0, #1 - strb r2, [r0] - adds r1, r4, #0 - adds r1, #0x70 - movs r0, #0x3c - strh r0, [r1] - adds r0, r4, #0 - adds r0, #0x80 - strb r2, [r0] - b _0804632A -_080462D6: - movs r0, #0x40 - ands r0, r1 - cmp r0, #0 - beq _08046302 - movs r0, #3 - strb r0, [r4, #0xc] - adds r2, r4, #0 - adds r2, #0x70 - movs r1, #0 - movs r0, #0x3c - strh r0, [r2] - strb r1, [r4, #0xe] - adds r0, r4, #0 - adds r0, #0x7a - strh r3, [r0] - adds r0, #2 - strb r1, [r0] - adds r0, #1 - strb r1, [r0] - adds r0, #3 - strb r1, [r0] - b _0804632A -_08046302: - movs r0, #0x80 - lsls r0, r0, #1 - ands r0, r1 - cmp r0, #0 - beq _0804632A - adds r1, r4, #0 - adds r1, #0x70 - ldrh r0, [r1] - subs r0, #1 - strh r0, [r1] - lsls r0, r0, #0x10 - cmp r0, #0 - bne _0804632A - movs r0, #0xb4 - lsls r0, r0, #1 - strh r0, [r1] - adds r0, r4, #0 - movs r1, #1 - bl sub_08046634 -_0804632A: - pop {r4, pc} - - thumb_func_start sub_0804632C -sub_0804632C: @ 0x0804632C - push {r4, r5, lr} - adds r4, r0, #0 - bl sub_080465C8 - adds r0, r4, #0 - bl sub_080466A8 - adds r3, r4, #0 - adds r3, #0x7a - ldrh r0, [r3] - adds r2, r0, #1 - movs r5, #0 - strh r2, [r3] - lsls r1, r2, #0x10 - ldr r0, _08046360 @ =0x059F0000 - cmp r1, r0 - bls _08046364 - movs r0, #0 - strh r0, [r3] - adds r0, r4, #0 - adds r0, #0x7c - strb r5, [r0] - adds r0, #1 - strb r5, [r0] - adds r0, #3 - b _08046388 - .align 2, 0 -_08046360: .4byte 0x059F0000 -_08046364: - lsls r0, r2, #0x10 - lsrs r1, r0, #0x10 - cmp r1, #0x78 - bne _08046374 - adds r0, r4, #0 - bl sub_08046668 - b _0804638A -_08046374: - movs r0, #0xa5 - lsls r0, r0, #3 - cmp r1, r0 - bne _0804638A - adds r0, r4, #0 - adds r0, #0x78 -.ifdef EU -_08046388: @TODO fix jump -.endif - strb r5, [r0] -.ifndef EU - adds r0, #5 - strb r5, [r0] - adds r0, #2 -_08046388: - strb r5, [r0] -.endif -_0804638A: - ldr r0, [r4, #0x64] - ldr r0, [r0] - adds r0, #0x6c - ldrh r1, [r0] - movs r0, #0x80 - ands r0, r1 - cmp r0, #0 - beq _080463B8 - adds r1, r4, #0 - adds r1, #0x70 - ldrh r0, [r1] - subs r0, #1 - strh r0, [r1] - lsls r0, r0, #0x10 - cmp r0, #0 - bne _080463B8 - movs r0, #0xb4 - lsls r0, r0, #1 - strh r0, [r1] - adds r0, r4, #0 - movs r1, #0 - bl sub_08046634 -_080463B8: - ldr r0, [r4, #0x64] - ldr r0, [r0] - adds r0, #0x6c - ldrh r1, [r0] - movs r0, #0x38 - ands r0, r1 - cmp r0, #0 - bne _080463E0 - movs r0, #1 - strb r0, [r4, #0xc] - adds r1, r4, #0 - adds r1, #0x70 - movs r2, #0 - movs r0, #0x3c - strh r0, [r1] - adds r0, r4, #0 -.ifdef EU - adds r0, #0x80 -.else - adds r0, #0x78 -.endif - strb r2, [r0] -.ifndef EU - adds r0, #8 - strb r2, [r0] -.endif -_080463E0: - pop {r4, r5, pc} - .align 2, 0 - - thumb_func_start sub_080463E4 -sub_080463E4: @ 0x080463E4 - push {r4, r5, r6, lr} - adds r4, r0, #0 - bl sub_080465C8 - adds r1, r4, #0 - adds r1, #0x70 - ldrh r0, [r1] - subs r0, #1 - movs r5, #0 - strh r0, [r1] - ldr r2, _0804643C @ =0x0000FFFF - adds r6, r2, #0 - lsls r0, r0, #0x10 - cmp r0, #0 - bne _08046410 - movs r0, #0xb4 - lsls r0, r0, #1 - strh r0, [r1] - adds r0, r4, #0 - movs r1, #1 - bl sub_08046634 -_08046410: - adds r0, r4, #0 - bl sub_080466A8 - adds r3, r4, #0 - adds r3, #0x7a - ldrh r0, [r3] - adds r2, r0, #1 - strh r2, [r3] - adds r0, r2, #0 - ands r0, r6 - ldr r1, _08046440 @ =0x0000059F - cmp r0, r1 - bls _08046444 - movs r0, #0 - strh r0, [r3] - adds r0, r4, #0 - adds r0, #0x7c - strb r5, [r0] - adds r0, #1 - strb r5, [r0] - adds r0, #3 - b _08046468 - .align 2, 0 -_0804643C: .4byte 0x0000FFFF -_08046440: .4byte 0x0000059F -_08046444: - lsls r0, r2, #0x10 - lsrs r1, r0, #0x10 - cmp r1, #0x78 - bne _08046454 - adds r0, r4, #0 - bl sub_08046668 - b _0804646A -_08046454: - movs r0, #0xa5 - lsls r0, r0, #3 - cmp r1, r0 - bne _0804646A - adds r0, r4, #0 - adds r0, #0x78 -.ifdef EU -_08046468: -.endif - strb r5, [r0] -.ifndef EU - adds r0, #5 - strb r5, [r0] - adds r0, #2 -_08046468: - strb r5, [r0] -.endif -_0804646A: - adds r0, r4, #0 - adds r0, #0x45 -.ifdef EU - ldrb r1, [r0] - cmp r1, #0 - bne _08046494 -.else - ldrb r0, [r0] - cmp r0, #0 - bne _08046494 -.endif - movs r0, #1 - strb r0, [r4, #0xc] -.ifdef EU - adds r0, r4, #0 - adds r0, #0x78 - strb r1, [r0] - adds r1, r4, #0 - adds r1, #0x70 - movs r2, #0 - movs r0, #0x3c - strh r0, [r1] - adds r0, r4, #0x0 - adds r0, #0x80 -.else - adds r1, r4, #0 - adds r1, #0x70 - movs r2, #0 - movs r0, #0x3c - strh r0, [r1] - adds r0, r4, #0 - adds r0, #0x78 - strb r2, [r0] - adds r0, #8 -.endif - strb r2, [r0] - movs r0, #0x94 - lsls r0, r0, #1 - bl SoundReq -_08046494: - pop {r4, r5, r6, pc} - .align 2, 0 - - thumb_func_start sub_08046498 -sub_08046498: @ 0x08046498 -.ifndef EU - push {r4, r5, lr} - adds r5, r0, #0 - ldr r0, _080464B8 @ =gUnk_02019EE0 - movs r4, #0x80 - lsls r4, r4, #8 - adds r1, r4, #0 - bl MemClear - ldr r0, _080464BC @ =gMapDataTopSpecial - adds r1, r4, #0 - bl MemClear - adds r0, r5, #0 - bl sub_080464C0 - pop {r4, r5, pc} - .align 2, 0 -_080464B8: .4byte gUnk_02019EE0 -_080464BC: .4byte gMapDataTopSpecial -.endif - - thumb_func_start sub_080464C0 -sub_080464C0: @ 0x080464C0 - push {r4, r5, r6, lr} - ldr r1, _08046508 @ =gUnk_080D1A74 - ldrb r0, [r0, #0x14] - lsrs r0, r0, #6 - lsls r0, r0, #2 - adds r0, r0, r1 - ldr r0, [r0] - bl sub_080197D4 - bl sub_08046518 - movs r6, #0x20 - ldr r4, _0804650C @ =gUnk_02019EE0 - ldr r0, _08046510 @ =0x00003260 - adds r5, r4, r0 -_080464DE: - adds r0, r4, #0 - adds r1, r5, #0 - movs r2, #0x40 - bl MemCopy - movs r0, #0x80 - lsls r0, r0, #1 - adds r5, r5, r0 - adds r4, #0x40 - subs r6, #1 - cmp r6, #0 - bne _080464DE - ldr r0, _0804650C @ =gUnk_02019EE0 - movs r1, #0x80 - lsls r1, r1, #4 - bl MemClear - ldr r1, _08046514 @ =gUpdateVisibleTiles - movs r0, #1 - strb r0, [r1] - pop {r4, r5, r6, pc} - .align 2, 0 -_08046508: .4byte gUnk_080D1A74 -_0804650C: .4byte gUnk_02019EE0 -_08046510: .4byte 0x00003260 -_08046514: .4byte gUpdateVisibleTiles - - thumb_func_start sub_08046518 -sub_08046518: @ 0x08046518 - push {r4, r5, r6, r7, lr} - mov r7, sl - mov r6, sb - mov r5, r8 - push {r5, r6, r7} - sub sp, #8 - ldr r1, _080465AC @ =gMetatileTypesTop - ldr r2, _080465B0 @ =0xFFFFBCB0 - adds r0, r1, r2 - ldr r3, _080465B4 @ =0xFFFFECB0 - adds r2, r1, r3 - ldr r7, _080465B8 @ =0x00006658 - adds r7, r1, r7 - str r7, [sp, #4] - ldr r3, _080465BC @ =0xFFFFD658 - adds r6, r1, r3 - movs r1, #0x10 -_0804653A: - movs r5, #0x10 - movs r7, #0x80 - adds r7, r7, r0 - mov sl, r7 - adds r3, r2, #0 - adds r3, #0x80 - str r3, [sp] - ldr r7, [sp, #4] - adds r7, #0x40 - mov r8, r7 - movs r3, #0x40 - adds r3, r3, r6 - mov sb, r3 - subs r1, #1 - mov ip, r1 - adds r3, r0, #0 - adds r3, #0x20 - adds r4, r2, #0 - adds r4, #0x20 -_08046560: - ldrh r0, [r3] - strh r0, [r4] - ldrh r0, [r3] - lsls r0, r0, #1 - ldr r7, _080465AC @ =gMetatileTypesTop - adds r0, r0, r7 - ldrh r1, [r0] - ldr r0, [sp, #4] - adds r2, r0, r5 - ldr r7, _080465C0 @ =gUnk_080B37A0 - adds r0, r1, r7 - ldrb r0, [r0] - strb r0, [r2] - adds r2, r6, r5 - ldr r0, _080465C4 @ =gUnk_080B3E80 - adds r1, r1, r0 - ldrb r0, [r1] - strb r0, [r2] - subs r3, #2 - subs r4, #2 - subs r5, #1 - cmp r5, #0 - bne _08046560 - mov r0, sl - ldr r2, [sp] - mov r1, r8 - str r1, [sp, #4] - mov r6, sb - mov r1, ip - cmp r1, #0 - bne _0804653A - add sp, #8 - pop {r3, r4, r5} - mov r8, r3 - mov sb, r4 - mov sl, r5 - pop {r4, r5, r6, r7, pc} - .align 2, 0 -_080465AC: .4byte gMetatileTypesTop -_080465B0: .4byte 0xFFFFBCB0 -_080465B4: .4byte 0xFFFFECB0 -_080465B8: .4byte 0x00006658 -_080465BC: .4byte 0xFFFFD658 -_080465C0: .4byte gUnk_080B37A0 -_080465C4: .4byte gUnk_080B3E80 - - thumb_func_start sub_080465C8 -sub_080465C8: @ 0x080465C8 - push {r4, lr} - ldr r3, _080465FC @ =gPlayerEntity - movs r0, #0x2e - ldrsh r2, [r3, r0] - ldr r1, _08046600 @ =gRoomControls - ldrh r0, [r1, #6] - subs r2, r2, r0 - asrs r2, r2, #3 - movs r4, #0x32 - ldrsh r0, [r3, r4] - ldrh r1, [r1, #8] - subs r0, r0, r1 - asrs r0, r0, #3 - ldr r1, _08046604 @ =gUnk_02019EE0 - lsls r0, r0, #7 - adds r0, r0, r2 - lsls r0, r0, #1 - adds r0, r0, r1 - ldrh r0, [r0] - cmp r0, #0 - beq _080465F8 - ldr r1, _08046608 @ =gPlayerState - movs r0, #1 - strb r0, [r1, #0x14] -_080465F8: - pop {r4, pc} - .align 2, 0 -_080465FC: .4byte gPlayerEntity -_08046600: .4byte gRoomControls -_08046604: .4byte gUnk_02019EE0 -_08046608: .4byte gPlayerState - - thumb_func_start sub_0804660C -sub_0804660C: @ 0x0804660C - push {r4, lr} - strb r1, [r0, #0x14] - lsrs r1, r1, #5 - lsls r1, r1, #1 - ldr r2, _0804662C @ =gUnk_080D1A84 - adds r1, r1, r2 - ldr r3, _08046630 @ =gRoomControls - ldrh r2, [r3, #6] - ldrh r4, [r1] - adds r2, r2, r4 - strh r2, [r0, #0x2e] - ldrh r2, [r3, #8] - ldrh r1, [r1, #2] - adds r2, r2, r1 - strh r2, [r0, #0x32] - pop {r4, pc} - .align 2, 0 -_0804662C: .4byte gUnk_080D1A84 -_08046630: .4byte gRoomControls - - thumb_func_start sub_08046634 -sub_08046634: @ 0x08046634 - push {r4, r5, lr} - adds r5, r0, #0 - cmp r1, #0 - bne _08046650 - ldr r4, _0804664C @ =gUnk_080D1AF4 - bl Random - movs r1, #3 - ands r1, r0 - adds r1, r1, r4 - ldrb r1, [r1] - b _0804665A - .align 2, 0 -_0804664C: .4byte gUnk_080D1AF4 -_08046650: - bl Random - adds r1, r0, #0 - movs r0, #7 - ands r1, r0 -_0804665A: - ldrb r2, [r5, #0x14] - lsrs r2, r2, #3 - adds r0, r1, #0 - movs r1, #0 - bl sub_080A1ED0 - pop {r4, r5, pc} - - thumb_func_start sub_08046668 -sub_08046668: @ 0x08046668 -.ifdef EU - push {r4, lr} - adds r4, r0, #0 - adds r0, #0x45 - ldrb r0, [r0] - cmp r0, #0 - beq _08046468EU - bl Random - ldr r2, _0804646C @ =gUnk_080D1AF8 - movs r1, #3 - ands r1, r0 - adds r1, r1, r2 - ldrb r1, [r1] - adds r0, r4, #0 - adds r0, #0x78 - movs r2, #0 - strb r1, [r0] - adds r0, #7 - strb r2, [r0] - adds r0, #3 - strb r2, [r0] - adds r0, r4, #0 - bl sub_080467DC -_08046468EU: - pop {r4, pc} - .align 2, 0 -_0804646C: .4byte gUnk_080D1AF8 - -.else - push {r4, r5, lr} - adds r4, r0, #0 - adds r0, #0x45 - ldrb r0, [r0] - cmp r0, #0 - beq _080466A0 - adds r5, r4, #0 - adds r5, #0x78 - ldrb r0, [r5] - cmp r0, #0xff - beq _080466A0 - bl Random - ldr r2, _080466A4 @ =gUnk_080D1AF8 - movs r1, #3 - ands r1, r0 - adds r1, r1, r2 - ldrb r0, [r1] - movs r1, #0 - strb r0, [r5] - adds r0, r4, #0 - adds r0, #0x7f - strb r1, [r0] - adds r0, #3 - strb r1, [r0] - adds r0, r4, #0 - bl sub_080467DC -_080466A0: - pop {r4, r5, pc} - .align 2, 0 -_080466A4: .4byte gUnk_080D1AF8 -.endif - - thumb_func_start sub_080466A8 -sub_080466A8: @ 0x080466A8 -.ifdef EU - push {r4, r5, r6, r7, lr} - adds r4, r0, #0 - adds r0, #0x7c - ldrb r2, [r0] - cmp r2, #0 - beq _08046514EU - adds r0, #1 - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - ldrb r1, [r4, #0xe] - adds r5, r0, #0 - cmp r1, #0 - bne _08046498 - subs r0, #5 - ldrb r0, [r0] - cmp r0, #0xff - beq _08046498 - movs r0, #3 - strb r0, [r4, #0xe] -_08046498: - ldrb r0, [r5] - bl sub_08000E62 - cmp r0, #2 - bls _08046514EU - movs r0, #0 - strb r0, [r4, #0xe] - strb r0, [r5] - adds r7, r4, #0 - adds r7, #0x78 - subs r0, #1 - adds r6, r0, #0 - movs r0, #0xff - strb r0, [r7] - adds r0, #0x28 - bl SoundReq - adds r5, r4, #0 - adds r5, #0x45 - ldrb r0, [r5] - cmp r0, #0 - beq _0804650E - movs r0, #8 - movs r1, #0 - bl InitScreenShake - adds r1, r4, #0 - adds r1, #0x82 - ldrb r0, [r1] - adds r0, #1 - strb r0, [r1] - ands r0, r6 - lsls r0, r0, #0x18 - lsrs r0, r0, #0x18 - cmp r0, #0xc - bhi _080464E6 - ldrb r0, [r5] - subs r0, #1 - strb r0, [r5] -_080464E6: - ldrb r0, [r5] - cmp r0, #0 - bne _080464F8 - strb r0, [r7] - adds r1, r4, #0 - adds r1, #0x7a - movs r0, #0xa5 - lsls r0, r0, #3 - b _0804650CEU -_080464F8: - adds r1, r4, #0 - adds r1, #0x7f - ldrb r0, [r1] - cmp r0, #0 - bne _0804650E - movs r0, #1 - strb r0, [r1] - subs r1, #5 - movs r0, #0x87 - lsls r0, r0, #3 -_0804650CEU: - strh r0, [r1] -_0804650E: - adds r0, r4, #0 - bl sub_080467DC -_08046514EU: - ldrb r1, [r4, #0xe] - cmp r1, #0 - beq _0804658C - adds r0, r4, #0 - adds r0, #0x78 - ldrb r0, [r0] - cmp r0, #0xff - beq _0804658C - subs r0, r1, #1 - strb r0, [r4, #0xe] - lsls r0, r0, #0x18 - lsrs r5, r0, #0x18 - cmp r5, #0 - bne _0804658C - adds r2, r4, #0 - adds r2, #0x80 - adds r3, r4, #0 - adds r3, #0x7d - ldrb r0, [r2] - ldrb r1, [r3] - orrs r0, r1 - strb r0, [r2] - strb r5, [r3] - adds r0, r4, #0 - bl sub_080467DC - ldr r2, _08046598 @ =gPlayerEntity - ldr r0, [r4, #0x64] - adds r0, #0x3c - ldrb r0, [r0] - adds r1, r2, #0 - adds r1, #0x3e - strb r0, [r1] - subs r1, #1 - movs r0, #0xf4 - strb r0, [r1] - adds r1, #5 - movs r0, #0xa - strb r0, [r1] - adds r0, r4, #0 - movs r1, #0x2c - movs r2, #0 - bl CreateFx - adds r2, r0, #0 - cmp r2, #0 - beq _0804658C - ldr r0, [r4, #0x64] - ldrh r0, [r0, #0x38] - strh r0, [r2, #0x2e] - ldr r0, [r4, #0x64] - ldrh r0, [r0, #0x3a] - strh r0, [r2, #0x32] - adds r1, r2, #0 - adds r1, #0x38 - movs r0, #1 - strb r0, [r1] - adds r0, r2, #0 - bl UpdateSpriteForCollisionLayer -_0804658C: - adds r1, r4, #0 - adds r1, #0x7c - movs r0, #0 - strb r0, [r1] - pop {r4, r5, r6, r7, pc} - .align 2, 0 -_08046598: .4byte gPlayerEntity - - -.else - push {r4, r5, r6, r7, lr} - adds r4, r0, #0 - adds r0, #0x7c - ldrb r2, [r0] - cmp r2, #0 - beq _0804674C - adds r0, #1 - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - ldrb r1, [r4, #0xe] - adds r5, r0, #0 - cmp r1, #0 - bne _080466D0 - subs r0, #5 - ldrb r0, [r0] - cmp r0, #0xff - beq _080466D0 - movs r0, #4 - strb r0, [r4, #0xe] -_080466D0: - ldrb r0, [r5] - bl sub_08000E62 - cmp r0, #2 - bls _0804674C - movs r0, #0 - strb r0, [r4, #0xe] - strb r0, [r5] - adds r7, r4, #0 - adds r7, #0x78 - subs r0, #1 - adds r6, r0, #0 - movs r0, #0xff - strb r0, [r7] - adds r0, #0x28 - bl SoundReq - adds r5, r4, #0 - adds r5, #0x45 - ldrb r0, [r5] - cmp r0, #0 - beq _08046746 - movs r0, #8 - movs r1, #0 - bl InitScreenShake - adds r1, r4, #0 - adds r1, #0x82 - ldrb r0, [r1] - adds r0, #1 - strb r0, [r1] - ands r0, r6 - lsls r0, r0, #0x18 - lsrs r0, r0, #0x18 - cmp r0, #0xc - bhi _0804671E - ldrb r0, [r5] - subs r0, #1 - strb r0, [r5] -_0804671E: - ldrb r0, [r5] - cmp r0, #0 - bne _08046730 - strb r0, [r7] - adds r1, r4, #0 - adds r1, #0x7a - movs r0, #0xa5 - lsls r0, r0, #3 - b _08046744 -_08046730: - adds r1, r4, #0 - adds r1, #0x7f - ldrb r0, [r1] - cmp r0, #0 - bne _08046746 - movs r0, #1 - strb r0, [r1] - subs r1, #5 - movs r0, #0x87 - lsls r0, r0, #3 -_08046744: - strh r0, [r1] -_08046746: - adds r0, r4, #0 - bl sub_080467DC -_0804674C: - ldrb r1, [r4, #0xe] - cmp r1, #0 - beq _080467CC - adds r0, r4, #0 - adds r0, #0x78 - ldrb r0, [r0] - cmp r0, #0xff - beq _080467CC - subs r0, r1, #1 - strb r0, [r4, #0xe] - lsls r0, r0, #0x18 - lsrs r5, r0, #0x18 - cmp r5, #0 - bne _080467CC - adds r2, r4, #0 - adds r2, #0x80 - adds r3, r4, #0 - adds r3, #0x7d - ldrb r0, [r2] - ldrb r1, [r3] - orrs r0, r1 - strb r0, [r2] - strb r5, [r3] - adds r0, r4, #0 - bl sub_080467DC - ldr r0, [r4, #0x64] - adds r0, #0x3c - ldrb r1, [r0] - adds r0, r1, #0 - cmp r0, #0xff - beq _080467CC - ldr r2, _080467D8 @ =gPlayerEntity - adds r0, r2, #0 - adds r0, #0x3e - strb r1, [r0] - adds r1, r2, #0 - adds r1, #0x3d - movs r0, #0xf4 - strb r0, [r1] - adds r1, #5 - movs r0, #0xa - strb r0, [r1] - adds r0, r4, #0 - movs r1, #0x2c - movs r2, #0 - bl CreateFx - adds r2, r0, #0 - cmp r2, #0 - beq _080467CC - ldr r0, [r4, #0x64] - ldrh r0, [r0, #0x38] - strh r0, [r2, #0x2e] - ldr r0, [r4, #0x64] - ldrh r0, [r0, #0x3a] - strh r0, [r2, #0x32] - adds r1, r2, #0 - adds r1, #0x38 - movs r0, #1 - strb r0, [r1] - adds r0, r2, #0 - bl UpdateSpriteForCollisionLayer -_080467CC: - adds r1, r4, #0 - adds r1, #0x7c - movs r0, #0 - strb r0, [r1] - pop {r4, r5, r6, r7, pc} - .align 2, 0 -_080467D8: .4byte gPlayerEntity -.endif - - thumb_func_start sub_080467DC -sub_080467DC: @ 0x080467DC - push {lr} - movs r1, #0 - ldr r0, [r0, #0x64] - movs r2, #0 - adds r0, #0x18 -_080467E6: - stm r0!, {r2} - adds r1, #1 - cmp r1, #7 - bls _080467E6 - pop {pc} - diff --git a/asm/enemy/gyorgFemaleEye.s b/asm/enemy/gyorgFemaleEye.s deleted file mode 100644 index 0876c5fa..00000000 --- a/asm/enemy/gyorgFemaleEye.s +++ /dev/null @@ -1,590 +0,0 @@ - .include "asm/macros.inc" - - .include "constants/constants.inc" - - .syntax unified - - .text - - - thumb_func_start GyorgFemaleEye -GyorgFemaleEye: @ 0x08048988 - push {r4, r5, lr} - adds r5, r0, #0 - ldr r0, [r5, #0x50] - ldr r0, [r0, #4] - cmp r0, #0 - bne _08048998 - bl DeleteThisEntity -_08048998: - ldr r4, _080489B0 @ =gUnk_080D1F64 - adds r0, r5, #0 - bl GetNextFunction - lsls r0, r0, #2 - adds r0, r0, r4 - ldr r1, [r0] - adds r0, r5, #0 - bl _call_via_r1 - pop {r4, r5, pc} - .align 2, 0 -_080489B0: .4byte gUnk_080D1F64 - - thumb_func_start sub_080489B4 -sub_080489B4: @ 0x080489B4 - push {lr} - ldr r2, _080489C8 @ =gUnk_080D1F7C - ldrb r1, [r0, #0xc] - lsls r1, r1, #2 - adds r1, r1, r2 - ldr r1, [r1] - bl _call_via_r1 - pop {pc} - .align 2, 0 -_080489C8: .4byte gUnk_080D1F7C - - thumb_func_start sub_080489CC -sub_080489CC: @ 0x080489CC -.ifdef EU - push {r4, r5, r6, lr} - adds r5, r0, #0 - movs r0, #0x45 - adds r0, r0, r5 - mov ip, r0 - ldrb r0, [r0] - cmp r0, #0xff - beq _080487F4 - ldr r3, [r5, #0x50] - adds r2, r3, #0 - adds r2, #0x7c - movs r0, #1 - ldrb r1, [r5, #0xa] - lsls r0, r1 - ldrb r1, [r2] - orrs r0, r1 - strb r0, [r2] - ldr r4, [r3, #0x64] - ldrb r0, [r5, #0xa] - lsls r0, r0, #2 - adds r1, r4, #0 - adds r1, #0x18 - adds r1, r1, r0 - ldr r0, [r5, #0x4c] - str r0, [r1] - ldr r2, _08048804 @ =gPlayerEntity - movs r6, #0x2e - ldrsh r0, [r2, r6] - movs r6, #0x2e - ldrsh r1, [r5, r6] - adds r0, r0, r1 - lsrs r1, r0, #0x1f - adds r0, r0, r1 - asrs r0, r0, #1 - strh r0, [r4, #0x38] - ldr r4, [r3, #0x64] - movs r1, #0x32 - ldrsh r0, [r2, r1] - movs r2, #0x32 - ldrsh r1, [r5, r2] - adds r0, r0, r1 - lsrs r1, r0, #0x1f - adds r0, r0, r1 - asrs r0, r0, #1 - strh r0, [r4, #0x3a] - ldr r2, [r3, #0x64] - adds r3, r5, #0 - adds r3, #0x3e - ldrb r0, [r3] - movs r1, #0x10 - eors r0, r1 - strb r0, [r3] - adds r2, #0x3c - strb r0, [r2] -_080487F4: - movs r0, #0xff - mov r6, ip - strb r0, [r6] - ldr r1, _08048808 @ =gUnk_080D1F64 - adds r0, r5, #0 - bl sub_0804AA30 - pop {r4, r5, r6, pc} - .align 2, 0 -_08048804: .4byte gPlayerEntity -_08048808: .4byte gUnk_080D1F64 -.else - push {r4, r5, r6, lr} - mov ip, r0 - adds r0, #0x45 - ldrb r0, [r0] - cmp r0, #0xff - bne _080489DA - b _08048AD8 -_080489DA: - mov r0, ip - ldr r4, [r0, #0x50] - adds r0, r4, #0 - adds r0, #0x78 - ldrb r0, [r0] - mov r2, ip - ldrb r1, [r2, #0xa] - asrs r0, r1 - movs r3, #1 - ands r0, r3 - cmp r0, #0 - beq _08048AD8 - adds r2, r4, #0 - adds r2, #0x7c - adds r0, r3, #0 - lsls r0, r1 - ldrb r1, [r2] - orrs r0, r1 - strb r0, [r2] - mov r0, ip - adds r0, #0x41 - ldrb r1, [r0] - movs r0, #0x7f - ands r0, r1 - subs r0, #4 - cmp r0, #0x16 - bhi _08048AD0 - lsls r0, r0, #2 - ldr r1, _08048A1C @ =_08048A20 - adds r0, r0, r1 - ldr r0, [r0] - mov pc, r0 - .align 2, 0 -_08048A1C: .4byte _08048A20 -_08048A20: @ jump table - .4byte _08048A7C @ case 0 - .4byte _08048A7C @ case 1 - .4byte _08048A7C @ case 2 - .4byte _08048AD0 @ case 3 - .4byte _08048A7C @ case 4 - .4byte _08048A7C @ case 5 - .4byte _08048A7C @ case 6 - .4byte _08048A7C @ case 7 - .4byte _08048A7C @ case 8 - .4byte _08048A7C @ case 9 - .4byte _08048AD0 @ case 10 - .4byte _08048AD0 @ case 11 - .4byte _08048A7C @ case 12 - .4byte _08048A7C @ case 13 - .4byte _08048A7C @ case 14 - .4byte _08048AD0 @ case 15 - .4byte _08048AD0 @ case 16 - .4byte _08048AD0 @ case 17 - .4byte _08048AD0 @ case 18 - .4byte _08048AD0 @ case 19 - .4byte _08048A7C @ case 20 - .4byte _08048A7C @ case 21 - .4byte _08048A7C @ case 22 -_08048A7C: - ldr r3, [r4, #0x64] - mov r5, ip - ldrb r0, [r5, #0xa] - lsls r0, r0, #2 - adds r1, r3, #0 - adds r1, #0x18 - adds r1, r1, r0 - ldr r0, [r5, #0x4c] - str r0, [r1] - ldr r2, _08048ACC @ =gPlayerEntity - movs r6, #0x2e - ldrsh r0, [r2, r6] - movs r6, #0x2e - ldrsh r1, [r5, r6] - adds r0, r0, r1 - lsrs r1, r0, #0x1f - adds r0, r0, r1 - asrs r0, r0, #1 - strh r0, [r3, #0x38] - ldr r3, [r4, #0x64] - movs r1, #0x32 - ldrsh r0, [r2, r1] - movs r2, #0x32 - ldrsh r1, [r5, r2] - adds r0, r0, r1 - lsrs r1, r0, #0x1f - adds r0, r0, r1 - asrs r0, r0, #1 - strh r0, [r3, #0x3a] - ldr r2, [r4, #0x64] - mov r3, ip - adds r3, #0x3e - ldrb r0, [r3] - movs r1, #0x10 - eors r0, r1 - strb r0, [r3] - adds r2, #0x3c - strb r0, [r2] - b _08048AD8 - .align 2, 0 -_08048ACC: .4byte gPlayerEntity -_08048AD0: - ldr r0, [r4, #0x64] - adds r0, #0x3c - movs r1, #0xff - strb r1, [r0] -_08048AD8: - mov r1, ip - adds r1, #0x45 - movs r0, #0xff - strb r0, [r1] - ldr r1, _08048AEC @ =gUnk_080D1F64 - mov r0, ip - bl sub_0804AA30 - pop {r4, r5, r6, pc} - .align 2, 0 -_08048AEC: .4byte gUnk_080D1F64 -.endif - - thumb_func_start sub_08048AF0 -sub_08048AF0: @ 0x08048AF0 - push {lr} - movs r1, #1 - strb r1, [r0, #0xc] - movs r1, #0xff - strb r1, [r0, #0x14] - ldrb r3, [r0, #0x1b] - movs r2, #0x3f - adds r1, r2, #0 - ands r1, r3 - movs r3, #0x80 - orrs r1, r3 - strb r1, [r0, #0x1b] - ldrb r1, [r0, #0x19] - ands r2, r1 - orrs r2, r3 - strb r2, [r0, #0x19] - adds r3, r0, #0 - adds r3, #0x29 - ldrb r1, [r3] - movs r2, #7 - orrs r1, r2 - strb r1, [r3] - adds r2, r0, #0 - adds r2, #0x38 - movs r1, #2 - strb r1, [r2] - bl sub_08048D20 - pop {pc} - .align 2, 0 - - thumb_func_start sub_08048B2C -sub_08048B2C: @ 0x08048B2C - push {r4, r5, lr} - adds r4, r0, #0 - bl sub_08048D20 - ldr r5, [r4, #0x50] - adds r0, r5, #0 - bl sub_08048D70 - cmp r0, #0 - beq _08048B62 - ldrb r0, [r4, #0x18] - lsls r0, r0, #0x1e - cmp r0, #0 - bne _08048B52 - adds r0, r4, #0 - movs r1, #2 - movs r2, #0x40 - bl CreateFx -_08048B52: - ldrb r0, [r4, #0x18] - movs r1, #4 - rsbs r1, r1, #0 - ands r1, r0 - movs r0, #1 - orrs r1, r0 - strb r1, [r4, #0x18] - b _08048B6C -_08048B62: - ldrb r1, [r4, #0x18] - movs r0, #4 - rsbs r0, r0, #0 - ands r0, r1 - strb r0, [r4, #0x18] -_08048B6C: - adds r0, r5, #0 - adds r0, #0x78 - ldrb r0, [r0] - ldrb r1, [r4, #0xa] - asrs r0, r1 - movs r1, #1 - ands r0, r1 - cmp r0, #0 - beq _08048B82 - movs r0, #2 - strb r0, [r4, #0xc] -_08048B82: - pop {r4, r5, pc} - - thumb_func_start sub_08048B84 -sub_08048B84: @ 0x08048B84 - push {r4, lr} - adds r4, r0, #0 - bl GetNextFrame - adds r0, r4, #0 - adds r0, #0x5a - ldrb r1, [r0] - movs r0, #0x80 - ands r0, r1 - cmp r0, #0 - beq _08048BAE - movs r0, #3 - strb r0, [r4, #0xc] - ldrb r1, [r4, #0x10] - movs r0, #0x80 - orrs r0, r1 - strb r0, [r4, #0x10] - adds r1, r4, #0 - adds r1, #0x3f - movs r0, #0x1e - strb r0, [r1] -_08048BAE: - pop {r4, pc} - - thumb_func_start sub_08048BB0 -sub_08048BB0: @ 0x08048BB0 - push {r4, r5, r6, lr} - adds r4, r0, #0 - ldr r2, [r4, #0x50] - adds r0, r2, #0 - adds r0, #0x78 - ldrb r3, [r0] - ldrb r1, [r4, #0xa] - adds r0, r3, #0 - asrs r0, r1 - movs r6, #1 - ands r0, r6 - cmp r0, #0 - bne _08048C34 - adds r0, r2, #0 - adds r0, #0x45 - ldrb r0, [r0] - cmp r0, #0 - beq _08048BFC - movs r0, #4 - strb r0, [r4, #0xc] - ldrb r1, [r4, #0x10] - movs r0, #0x7f - ands r0, r1 - strb r0, [r4, #0x10] - ldr r1, _08048BF8 @ =gUnk_080D2030 - ldrb r0, [r4, #0x14] - lsls r0, r0, #3 - ldrb r2, [r4, #0xa] - adds r0, r0, r2 - adds r0, r0, r1 - ldrb r1, [r0] - adds r0, r4, #0 - bl InitializeAnimation - b _08048CEA - .align 2, 0 -_08048BF8: .4byte gUnk_080D2030 -_08048BFC: - strb r6, [r4, #0xc] - ldrb r1, [r4, #0x10] - movs r0, #0x7f - ands r0, r1 - strb r0, [r4, #0x10] - ldrb r1, [r4, #0x18] - movs r0, #4 - rsbs r0, r0, #0 - ands r0, r1 - strb r0, [r4, #0x18] - ldr r1, _08048C30 @ =gUnk_080D2010 - ldrb r0, [r4, #0x14] - lsls r0, r0, #3 - ldrb r2, [r4, #0xa] - adds r0, r0, r2 - adds r0, r0, r1 - ldrb r1, [r0] - adds r0, r4, #0 - bl InitializeAnimation - adds r0, r4, #0 - movs r1, #2 - movs r2, #0x40 - bl CreateFx - b _08048CEA - .align 2, 0 -_08048C30: .4byte gUnk_080D2010 -_08048C34: - adds r5, r2, #0 - adds r5, #0x80 - ldrb r0, [r5] - asrs r0, r1 - ands r0, r6 - cmp r0, #0 - beq _08048CBC - adds r0, r4, #0 - adds r0, #0x58 - ldrb r0, [r0] - cmp r0, #0x13 - bhi _08048C6C - adds r1, r4, #0 - adds r1, #0x3d - movs r0, #0xf4 - strb r0, [r1] - adds r1, #2 - movs r0, #0x89 - strb r0, [r1] - ldrb r1, [r2, #0x14] - lsrs r1, r1, #6 - adds r1, #0x14 - adds r0, r4, #0 - bl InitializeAnimation - ldr r0, _08048CB4 @ =0x00000119 - bl SoundReq -_08048C6C: - adds r0, r4, #0 - bl GetNextFrame - adds r0, r4, #0 - adds r0, #0x5a - ldrb r1, [r0] - movs r0, #0x80 - ands r0, r1 - cmp r0, #0 - beq _08048CEA - adds r1, r4, #0 - adds r1, #0x3f - movs r0, #0x1e - strb r0, [r1] - ldr r1, _08048CB8 @ =gUnk_080D2010 - ldrb r0, [r4, #0x14] - lsls r0, r0, #3 - ldrb r2, [r4, #0xa] - adds r0, r0, r2 - adds r0, r0, r1 - ldrb r1, [r0] - adds r0, r4, #0 - bl InitializeAnimation - adds r0, r4, #0 - movs r1, #7 - bl UpdateAnimationVariableFrames - adds r1, r6, #0 - ldrb r4, [r4, #0xa] - lsls r1, r4 - ldrb r0, [r5] - bics r0, r1 - strb r0, [r5] - b _08048CEA - .align 2, 0 -_08048CB4: .4byte 0x00000119 -_08048CB8: .4byte gUnk_080D2010 -_08048CBC: - cmp r3, #0xff - bne _08048CEA - adds r0, r4, #0 - adds r0, #0x58 - ldrb r0, [r0] - subs r0, #0x10 - cmp r0, #3 - bls _08048CE4 - ldrb r1, [r4, #0x14] - adds r1, #0x10 - adds r0, r4, #0 - bl InitializeAnimation - bl Random - movs r1, #0x1c - ands r1, r0 - adds r0, r4, #0 - bl UpdateAnimationVariableFrames -_08048CE4: - adds r0, r4, #0 - bl GetNextFrame -_08048CEA: - pop {r4, r5, r6, pc} - - thumb_func_start sub_08048CEC -sub_08048CEC: @ 0x08048CEC - push {r4, lr} - adds r4, r0, #0 - bl GetNextFrame - adds r0, r4, #0 - adds r0, #0x5a - ldrb r1, [r0] - movs r0, #0x80 - ands r0, r1 - cmp r0, #0 - beq _08048D1A - movs r0, #1 - strb r0, [r4, #0xc] - ldr r1, _08048D1C @ =gUnk_080D2010 - ldrb r0, [r4, #0x14] - lsls r0, r0, #3 - ldrb r2, [r4, #0xa] - adds r0, r0, r2 - adds r0, r0, r1 - ldrb r1, [r0] - adds r0, r4, #0 - bl InitializeAnimation -_08048D1A: - pop {r4, pc} - .align 2, 0 -_08048D1C: .4byte gUnk_080D2010 - - thumb_func_start sub_08048D20 -sub_08048D20: @ 0x08048D20 - push {r4, r5, lr} - adds r4, r0, #0 - ldr r0, [r4, #0x50] - ldrb r0, [r0, #0x14] - lsrs r0, r0, #6 - ldrb r1, [r4, #0x14] - cmp r0, r1 - beq _08048D60 - strb r0, [r4, #0x14] - ldrb r1, [r4, #0xa] - lsls r3, r0, #3 - adds r1, r1, r3 - lsls r1, r1, #2 - ldr r0, _08048D64 @ =gUnk_080D1F90 - adds r1, r1, r0 - ldr r2, _08048D68 @ =gRoomControls - ldrh r0, [r2, #6] - ldrh r5, [r1] - adds r0, r0, r5 - strh r0, [r4, #0x2e] - ldrh r0, [r2, #8] - ldrh r1, [r1, #2] - adds r0, r0, r1 - strh r0, [r4, #0x32] - ldr r1, _08048D6C @ =gUnk_080D2010 - ldrb r0, [r4, #0xa] - adds r0, r0, r3 - adds r0, r0, r1 - ldrb r1, [r0] - adds r0, r4, #0 - bl InitializeAnimation -_08048D60: - pop {r4, r5, pc} - .align 2, 0 -_08048D64: .4byte gUnk_080D1F90 -_08048D68: .4byte gRoomControls -_08048D6C: .4byte gUnk_080D2010 - - thumb_func_start sub_08048D70 -sub_08048D70: @ 0x08048D70 - push {lr} - adds r1, r0, #0 - adds r0, #0x45 - ldrb r0, [r0] - cmp r0, #0 - bne _08048D8E - ldr r1, [r1, #0x64] - ldr r0, [r1, #8] - cmp r0, #0 - bne _08048D86 - ldr r0, [r1, #0xc] -_08048D86: - adds r0, #0x45 - ldrb r0, [r0] - cmp r0, #0 - bne _08048D92 -_08048D8E: - movs r0, #1 - b _08048D94 -_08048D92: - movs r0, #0 -_08048D94: - pop {pc} - .align 2, 0 diff --git a/asm/enemy/gyorgFemaleMouth.s b/asm/enemy/gyorgFemaleMouth.s deleted file mode 100644 index 007356a9..00000000 --- a/asm/enemy/gyorgFemaleMouth.s +++ /dev/null @@ -1,115 +0,0 @@ - .include "asm/macros.inc" - - .include "constants/constants.inc" - - .syntax unified - - .text - - - thumb_func_start GyorgFemaleMouth -GyorgFemaleMouth: @ 0x08048F8C - push {r4, r5, r6, lr} - adds r4, r0, #0 - ldr r0, [r4, #0x50] - ldr r0, [r0, #4] - cmp r0, #0 - bne _08048F9C - bl DeleteThisEntity -_08048F9C: - ldrb r0, [r4, #0xc] - cmp r0, #0 - bne _08048FD4 - movs r0, #1 - strb r0, [r4, #0xc] - ldrb r2, [r4, #0x1b] - movs r1, #0x3f - adds r0, r1, #0 - ands r0, r2 - movs r2, #0x80 - orrs r0, r2 - strb r0, [r4, #0x1b] - ldrb r0, [r4, #0x19] - ands r1, r0 - orrs r1, r2 - strb r1, [r4, #0x19] - adds r2, r4, #0 - adds r2, #0x29 - ldrb r0, [r2] - movs r1, #7 - orrs r0, r1 - strb r0, [r2] - adds r1, r4, #0 - adds r1, #0x38 - movs r0, #2 - strb r0, [r1] - movs r0, #0xff - strb r0, [r4, #0x14] -_08048FD4: - ldr r0, [r4, #0x50] - ldrb r0, [r0, #0x14] - lsrs r0, r0, #5 - lsls r6, r0, #0x18 - lsrs r5, r6, #0x18 - ldrb r0, [r4, #0x14] - cmp r5, r0 - beq _08049018 - strb r5, [r4, #0x14] - ldr r3, _08049010 @ =gUnk_080D28CC - lsls r1, r5, #1 - adds r1, r1, r3 - ldr r2, _08049014 @ =gRoomControls - ldrh r0, [r2, #6] - ldrh r1, [r1] - adds r0, r0, r1 - strh r0, [r4, #0x2e] - adds r1, r5, #1 - lsls r1, r1, #1 - adds r1, r1, r3 - ldrh r0, [r2, #8] - ldrh r1, [r1] - adds r0, r0, r1 - strh r0, [r4, #0x32] - lsrs r1, r6, #0x19 - adds r0, r4, #0 - bl InitializeAnimation - b _0804901E - .align 2, 0 -_08049010: .4byte gUnk_080D28CC -_08049014: .4byte gRoomControls -_08049018: - adds r0, r4, #0 - bl GetNextFrame -_0804901E: - movs r0, #2 - ands r0, r5 - cmp r0, #0 - beq _08049038 - ldr r0, _08049034 @ =gPlayerEntity - movs r2, #0x32 - ldrsh r1, [r4, r2] - movs r2, #0x32 - ldrsh r0, [r0, r2] - b _08049042 - .align 2, 0 -_08049034: .4byte gPlayerEntity -_08049038: - ldr r0, _08049054 @ =gPlayerEntity - movs r2, #0x2e - ldrsh r1, [r4, r2] - movs r2, #0x2e - ldrsh r0, [r0, r2] -_08049042: - cmp r1, r0 - bge _08049048 - adds r5, #1 -_08049048: - ldr r0, _08049058 @ =gUnk_080D28AC - lsls r1, r5, #2 - adds r1, r1, r0 - ldr r0, [r1] - str r0, [r4, #0x48] - pop {r4, r5, r6, pc} - .align 2, 0 -_08049054: .4byte gPlayerEntity -_08049058: .4byte gUnk_080D28AC diff --git a/asm/non_matching/gyorg_female/sub_08046518.inc b/asm/non_matching/gyorg_female/sub_08046518.inc new file mode 100644 index 00000000..c3aa7649 --- /dev/null +++ b/asm/non_matching/gyorg_female/sub_08046518.inc @@ -0,0 +1,84 @@ + push {r4, r5, r6, r7, lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5, r6, r7} + sub sp, #0x8 + ldr r1, _data0_0 + ldr r2, _data0_0+0x4 + add r0, r1, r2 + ldr r3, _data0_0+0x8 + add r2, r1, r3 + ldr r7, _data0_0+0xc + add r7, r1, r7 + str r7, [sp, #0x4] + ldr r3, _data0_0+0x10 + add r6, r1, r3 + mov r1, #0x10 +_code0_0: + mov r5, #0x10 + mov r7, #0x80 + add r7, r0 + mov r10, r7 + mov r3, r2 + add r3, #0x80 + str r3, [sp] + ldr r7, [sp, #0x4] + add r7, #0x40 + mov r8, r7 + mov r3, #0x40 + add r3, r6 + mov r9, r3 + sub r1, #0x1 + mov r12, r1 + mov r3, r0 + add r3, #0x20 + mov r4, r2 + add r4, #0x20 +_code0_1: + ldrh r0, [r3] + strh r0, [r4] + ldrh r0, [r3] + lsl r0, #0x1 + ldr r7, _data0_0 + add r0, r7 + ldrh r1, [r0] + ldr r0, [sp, #0x4] + add r2, r0, r5 + ldr r7, _data0_0+0x14 + add r0, r1, r7 + ldrb r0, [r0] + strb r0, [r2] + add r2, r6, r5 + ldr r0, _data0_0+0x18 + add r1, r0 + ldrb r0, [r1] + strb r0, [r2] + sub r3, #0x2 + sub r4, #0x2 + sub r5, #0x1 + cmp r5, #0x0 + bne _code0_1 + mov r0, r10 + ldr r2, [sp] + mov r1, r8 + str r1, [sp, #0x4] + mov r6, r9 + mov r1, r12 + cmp r1, #0x0 + bne _code0_0 + add sp, #0x8 + pop {r3, r4, r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4, r5, r6, r7, pc} +.align 2, 0 +_data0_0: + .4byte gMetatileTypesTop + .4byte 0xffffbcb0 + .4byte 0xffffecb0 + .4byte 0x6658 + .4byte 0xffffd658 + .4byte gUnk_080B37A0 + .4byte gUnk_080B3E80 diff --git a/asm/object/gyorgBossObject.s b/asm/object/gyorgBossObject.s deleted file mode 100644 index 11eb2ff4..00000000 --- a/asm/object/gyorgBossObject.s +++ /dev/null @@ -1,1466 +0,0 @@ - .include "asm/macros.inc" - - .include "constants/constants.inc" - - .syntax unified - - .text - - - thumb_func_start GyorgBossObject -GyorgBossObject: @ 0x080A16DC - push {r4, lr} - adds r4, r0, #0 - ldr r1, _080A1700 @ =gUnk_08124ED0 - ldrb r0, [r4, #0xc] - lsls r0, r0, #2 - adds r0, r0, r1 - ldr r1, [r0] - adds r0, r4, #0 - bl _call_via_r1 - adds r0, r4, #0 - bl sub_080A1DCC - adds r0, r4, #0 - bl sub_080A1C9C - pop {r4, pc} - .align 2, 0 -_080A1700: .4byte gUnk_08124ED0 - - thumb_func_start sub_080A1704 -sub_080A1704: @ 0x080A1704 -.ifdef EU - push {r4, r5, r6, r7, lr} - mov r7, sl - mov r6, sb - mov r5, r8 - push {r5, r6, r7} - mov sl, r0 - movs r0, #0x7b - bl CheckFlags - cmp r0, #0 - beq _080A0F5A - bl DeleteThisEntity -_080A0F5A: - ldr r0, _080A1050 @ =gEntCount - ldrb r0, [r0] - cmp r0, #0x45 - bhi _080A1044 - movs r0, #0x40 - bl zMalloc - adds r7, r0, #0 - cmp r7, #0 - beq _080A1044 - movs r6, #0 - movs r0, #1 - mov sb, r0 - mov r2, sb - mov r1, sl - strb r2, [r1, #0xc] - str r7, [r1, #0x64] - adds r1, #0x6e - movs r3, #0 - mov r8, r3 - movs r0, #0x96 - lsls r0, r0, #2 - strh r0, [r1] - mov r0, sl - adds r0, #0x6c - strh r6, [r0] - mov r0, sl - str r0, [r7] - movs r0, #0x5c - movs r1, #0 - bl CreateEnemy - adds r1, r0, #0 - str r7, [r1, #0x64] - str r1, [r7, #4] - movs r0, #0x5d - movs r1, #0 - bl CreateEnemy - adds r1, r0, #0 - ldr r4, _080A1054 @ =gRoomControls - movs r2, #0x80 - lsls r2, r2, #2 - adds r5, r2, #0 - ldrh r3, [r4, #6] - adds r0, r5, r3 - strh r0, [r1, #0x2e] - movs r2, #0xe0 - lsls r2, r2, #2 - adds r0, r2, #0 - ldrh r3, [r4, #8] - adds r0, r0, r3 - strh r0, [r1, #0x32] - str r7, [r1, #0x64] - str r1, [r7, #8] - movs r0, #0x5d - movs r1, #1 - bl CreateEnemy - adds r1, r0, #0 - movs r2, #0x98 - lsls r2, r2, #2 - adds r0, r2, #0 - ldrh r3, [r4, #6] - adds r0, r0, r3 - strh r0, [r1, #0x2e] - movs r2, #0xd8 - lsls r2, r2, #2 - adds r0, r2, #0 - ldrh r3, [r4, #8] - adds r0, r0, r3 - strh r0, [r1, #0x32] - str r7, [r1, #0x64] - str r1, [r7, #0xc] - ldr r2, _080A1058 @ =gScreen - ldr r0, _080A105C @ =0x00001E07 - strh r0, [r2, #0x2c] - ldrh r0, [r2] - movs r3, #0x80 - lsls r3, r3, #4 - adds r1, r3, #0 - orrs r0, r1 - strh r0, [r2] - mov r0, sl - adds r0, #0x70 - strh r6, [r0] - adds r0, #2 - strh r6, [r0] - adds r0, #2 - mov r1, r8 - strb r1, [r0] - adds r0, #6 - strb r1, [r0] - subs r0, #4 - movs r1, #0xc0 - strh r1, [r0] - adds r0, #2 - strh r1, [r0] - ldr r0, _080A1060 @ =gRoomTransition - adds r0, #0x39 - mov r2, sb - strb r2, [r0] - ldr r2, _080A1064 @ =gPlayerState - ldr r0, [r2, #0x30] - movs r1, #0x80 - lsls r1, r1, #0xa - orrs r0, r1 - str r0, [r2, #0x30] - ldrh r3, [r4, #6] - adds r5, r5, r3 - strh r5, [r2, #0x16] - movs r1, #0x84 - lsls r1, r1, #2 - adds r0, r1, #0 - ldrh r4, [r4, #8] - adds r0, r0, r4 - strh r0, [r2, #0x18] -_080A1044: - pop {r3, r4, r5} - mov r8, r3 - mov sb, r4 - mov sl, r5 - pop {r4, r5, r6, r7, pc} - .align 2, 0 -_080A1050: .4byte gEntCount -_080A1054: .4byte gRoomControls -_080A1058: .4byte gScreen -_080A105C: .4byte 0x00001E07 -_080A1060: .4byte gRoomTransition -_080A1064: .4byte gPlayerState - -.else - push {r4, r5, r6, r7, lr} - mov r7, sl - mov r6, sb - mov r5, r8 - push {r5, r6, r7} - mov sl, r0 - movs r0, #0x7b - bl CheckFlags - cmp r0, #0 - beq _080A171E - bl DeleteThisEntity -_080A171E: - ldr r0, _080A1828 @ =gEntCount - ldrb r0, [r0] - cmp r0, #0x45 - bhi _080A181C - movs r0, #0x40 - bl zMalloc - adds r7, r0, #0 - cmp r7, #0 - beq _080A181C - movs r6, #0 - movs r0, #1 - mov sb, r0 - mov r2, sb - mov r1, sl - strb r2, [r1, #0xc] - str r7, [r1, #0x64] - adds r1, #0x6e - movs r3, #0 - mov r8, r3 - movs r0, #0x96 - lsls r0, r0, #2 - strh r0, [r1] - mov r0, sl - adds r0, #0x6c - strh r6, [r0] - mov r0, sl - str r0, [r7] - movs r0, #0x5c - movs r1, #0 - bl CreateEnemy - adds r1, r0, #0 - str r7, [r1, #0x64] - str r1, [r7, #4] - movs r0, #0x5d - movs r1, #0 - bl CreateEnemy - adds r1, r0, #0 - ldr r4, _080A182C @ =gRoomControls - movs r2, #0x80 - lsls r2, r2, #2 - adds r5, r2, #0 - ldrh r3, [r4, #6] - adds r0, r5, r3 - strh r0, [r1, #0x2e] - movs r2, #0xcc - lsls r2, r2, #2 - adds r0, r2, #0 - ldrh r3, [r4, #8] - adds r0, r0, r3 - strh r0, [r1, #0x32] - str r7, [r1, #0x64] - str r1, [r7, #8] - movs r0, #0x5d - movs r1, #1 - bl CreateEnemy - adds r1, r0, #0 - movs r2, #0x98 - lsls r2, r2, #2 - adds r0, r2, #0 - ldrh r3, [r4, #6] - adds r0, r0, r3 - strh r0, [r1, #0x2e] - adds r2, #0xb0 - adds r0, r2, #0 - ldrh r3, [r4, #8] - adds r0, r0, r3 - strh r0, [r1, #0x32] - str r7, [r1, #0x64] - str r1, [r7, #0xc] - ldr r2, _080A1830 @ =gScreen - ldr r0, _080A1834 @ =0x00001E07 - strh r0, [r2, #0x2c] - ldrh r0, [r2] - movs r3, #0x80 - lsls r3, r3, #4 - adds r1, r3, #0 - orrs r0, r1 - strh r0, [r2] - mov r0, sl - adds r0, #0x70 - strh r6, [r0] - adds r0, #2 - strh r6, [r0] - adds r0, #2 - mov r1, r8 - strb r1, [r0] - adds r0, #6 - strb r1, [r0] - subs r0, #4 - movs r1, #0xc0 - strh r1, [r0] - adds r0, #2 - strh r1, [r0] - ldr r0, _080A1838 @ =gRoomTransition - adds r0, #0x39 - mov r2, sb - strb r2, [r0] - ldr r2, _080A183C @ =gPlayerState - ldr r0, [r2, #0x30] - movs r1, #0x80 - lsls r1, r1, #0xa - orrs r0, r1 - str r0, [r2, #0x30] - ldrh r3, [r4, #6] - adds r5, r5, r3 - strh r5, [r2, #0x16] - movs r1, #0x84 - lsls r1, r1, #2 - adds r0, r1, #0 - ldrh r4, [r4, #8] - adds r0, r0, r4 - strh r0, [r2, #0x18] - ldr r0, _080A1840 @ =0x80100000 - bl SoundReq - ldr r0, _080A1844 @ =gArea - movs r2, #0x86 - lsls r2, r2, #4 - adds r1, r0, r2 - ldr r3, _080A1848 @ =0x00000864 - adds r0, r0, r3 - ldr r0, [r0] - str r0, [r1] -_080A181C: - pop {r3, r4, r5} - mov r8, r3 - mov sb, r4 - mov sl, r5 - pop {r4, r5, r6, r7, pc} - .align 2, 0 -_080A1828: .4byte gEntCount -_080A182C: .4byte gRoomControls -_080A1830: .4byte gScreen -_080A1834: .4byte 0x00001E07 -_080A1838: .4byte gRoomTransition -_080A183C: .4byte gPlayerState -_080A1840: .4byte 0x80100000 -_080A1844: .4byte gArea -_080A1848: .4byte 0x00000864 -.endif - - thumb_func_start sub_080A184C -sub_080A184C: @ 0x080A184C - push {lr} - adds r3, r0, #0 - adds r1, r3, #0 - adds r1, #0x6e - ldrh r0, [r1] - subs r0, #1 - strh r0, [r1] - lsls r0, r0, #0x10 - cmp r0, #0 - bne _080A1874 - movs r0, #2 - strb r0, [r3, #0xc] - subs r1, #2 - movs r2, #8 - movs r0, #8 - strh r0, [r1] - ldr r0, [r3, #0x64] - ldr r0, [r0, #4] - adds r0, #0x45 - strb r2, [r0] -_080A1874: - ldr r2, _080A1894 @ =gPlayerState - ldr r1, _080A1898 @ =gRoomControls - movs r3, #0x80 - lsls r3, r3, #2 - adds r0, r3, #0 - ldrh r3, [r1, #6] - adds r0, r0, r3 - strh r0, [r2, #0x16] - movs r3, #0x84 - lsls r3, r3, #2 - adds r0, r3, #0 - ldrh r1, [r1, #8] - adds r0, r0, r1 - strh r0, [r2, #0x18] - pop {pc} - .align 2, 0 -_080A1894: .4byte gPlayerState -_080A1898: .4byte gRoomControls - - thumb_func_start sub_080A189C -sub_080A189C: @ 0x080A189C - push {lr} - adds r3, r0, #0 - ldr r0, [r3, #0x64] - ldr r0, [r0, #4] - adds r0, #0x45 - ldrb r0, [r0] - cmp r0, #0 - bne _080A18E6 - movs r0, #3 - strb r0, [r3, #0xc] - movs r0, #0x23 - strb r0, [r3, #0xe] - adds r1, r3, #0 - adds r1, #0x6c - movs r2, #1 - movs r0, #1 - strh r0, [r1] - adds r1, #0xc - movs r0, #0x80 - lsls r0, r0, #3 - strh r0, [r1] - adds r0, r3, #0 - adds r0, #0x7b - strb r2, [r0] - ldr r0, [r3, #0x64] - ldr r0, [r0, #8] - adds r0, #0x45 - movs r1, #0xc - strb r1, [r0] - movs r0, #0x94 - lsls r0, r0, #1 - bl SoundReq - movs r0, #0x96 - movs r1, #1 - bl InitScreenShake -_080A18E6: - ldr r2, _080A1904 @ =gPlayerState - ldr r1, _080A1908 @ =gRoomControls - movs r3, #0x80 - lsls r3, r3, #2 - adds r0, r3, #0 - ldrh r3, [r1, #6] - adds r0, r0, r3 - strh r0, [r2, #0x16] - movs r3, #0x84 - lsls r3, r3, #2 - adds r0, r3, #0 - ldrh r1, [r1, #8] - adds r0, r0, r1 - strh r0, [r2, #0x18] - pop {pc} - .align 2, 0 -_080A1904: .4byte gPlayerState -_080A1908: .4byte gRoomControls - - thumb_func_start sub_080A190C -sub_080A190C: @ 0x080A190C - push {r4, lr} - adds r4, r0, #0 - bl sub_080A1FF0 - ldr r3, [r4, #0x64] - ldr r2, [r3, #8] - adds r0, r2, #0 - adds r0, #0x45 - ldrb r0, [r0] - cmp r0, #0 - bne _080A197C - adds r0, r4, #0 - adds r1, r2, #0 - bl sub_080A20B8 - cmp r0, #0 - beq _080A1956 - movs r0, #4 - strb r0, [r4, #0xc] - adds r1, r4, #0 - adds r1, #0x6c - movs r0, #0x10 - strh r0, [r1] - adds r1, #0xc - movs r0, #0xc0 - strh r0, [r1] - ldr r0, [r4, #0x64] - ldr r0, [r0, #4] - ldrb r1, [r0, #0x14] - adds r0, r4, #0 - bl sub_080A1D70 - ldr r0, [r4, #0x64] - ldr r0, [r0, #4] - adds r0, #0x45 - movs r1, #0x18 - strb r1, [r0] -_080A1956: - ldr r2, _080A1974 @ =gPlayerState - ldr r1, _080A1978 @ =gRoomControls - movs r3, #0x80 - lsls r3, r3, #2 - adds r0, r3, #0 - ldrh r3, [r1, #6] - adds r0, r0, r3 - strh r0, [r2, #0x16] - movs r3, #0x84 - lsls r3, r3, #2 - adds r0, r3, #0 - ldrh r1, [r1, #8] - adds r0, r0, r1 - strh r0, [r2, #0x18] - b _080A1988 - .align 2, 0 -_080A1974: .4byte gPlayerState -_080A1978: .4byte gRoomControls -_080A197C: - ldr r1, _080A198C @ =gPlayerState - ldrh r0, [r2, #0x2e] - strh r0, [r1, #0x16] - ldr r0, [r3, #8] - ldrh r0, [r0, #0x32] - strh r0, [r1, #0x18] -_080A1988: - pop {r4, pc} - .align 2, 0 -_080A198C: .4byte gPlayerState - - thumb_func_start sub_080A1990 -sub_080A1990: @ 0x080A1990 - push {lr} - adds r2, r0, #0 - ldr r1, [r2, #0x64] - ldr r0, [r1, #4] - adds r0, #0x45 - ldrb r0, [r0] - cmp r0, #0 - bne _080A19D6 - ldr r0, [r1, #8] - adds r0, #0x45 - movs r1, #0xc - strb r1, [r0] - movs r0, #5 - strb r0, [r2, #0xc] - movs r0, #0x23 - strb r0, [r2, #0xe] - adds r1, r2, #0 - adds r1, #0x6c - movs r0, #2 - strh r0, [r1] - adds r1, #0xc - movs r0, #0x80 - lsls r0, r0, #3 - strh r0, [r1] - adds r1, #3 - movs r0, #1 - strb r0, [r1] - movs r0, #0x94 - lsls r0, r0, #1 - bl SoundReq - movs r0, #0x96 - movs r1, #1 - bl InitScreenShake -_080A19D6: - ldr r2, _080A19F4 @ =gPlayerState - ldr r1, _080A19F8 @ =gRoomControls - movs r3, #0x80 - lsls r3, r3, #2 - adds r0, r3, #0 - ldrh r3, [r1, #6] - adds r0, r0, r3 - strh r0, [r2, #0x16] - movs r3, #0x84 - lsls r3, r3, #2 - adds r0, r3, #0 - ldrh r1, [r1, #8] - adds r0, r0, r1 - strh r0, [r2, #0x18] - pop {pc} - .align 2, 0 -_080A19F4: .4byte gPlayerState -_080A19F8: .4byte gRoomControls - - thumb_func_start sub_080A19FC -sub_080A19FC: @ 0x080A19FC - push {r4, lr} - adds r4, r0, #0 - bl sub_080A1FF0 - ldr r3, [r4, #0x64] - ldr r2, [r3, #0xc] - adds r0, r2, #0 - adds r0, #0x45 - ldrb r0, [r0] - cmp r0, #0 - bne _080A1A6C - adds r0, r4, #0 - adds r1, r2, #0 - bl sub_080A20B8 - cmp r0, #0 - beq _080A1A46 - movs r0, #6 - strb r0, [r4, #0xc] - adds r1, r4, #0 - adds r1, #0x6c - movs r0, #0x20 - strh r0, [r1] - adds r1, #0xc - movs r0, #0xc0 - strh r0, [r1] - ldr r0, [r4, #0x64] - ldr r0, [r0, #4] - ldrb r1, [r0, #0x14] - adds r0, r4, #0 - bl sub_080A1D70 - ldr r0, [r4, #0x64] - ldr r0, [r0, #4] - adds r0, #0x45 - movs r1, #0x18 - strb r1, [r0] -_080A1A46: - ldr r2, _080A1A64 @ =gPlayerState - ldr r1, _080A1A68 @ =gRoomControls - movs r3, #0x80 - lsls r3, r3, #2 - adds r0, r3, #0 - ldrh r3, [r1, #6] - adds r0, r0, r3 - strh r0, [r2, #0x16] - movs r3, #0x84 - lsls r3, r3, #2 - adds r0, r3, #0 - ldrh r1, [r1, #8] - adds r0, r0, r1 - strh r0, [r2, #0x18] - b _080A1A78 - .align 2, 0 -_080A1A64: .4byte gPlayerState -_080A1A68: .4byte gRoomControls -_080A1A6C: - ldr r1, _080A1A7C @ =gPlayerState - ldrh r0, [r2, #0x2e] - strh r0, [r1, #0x16] - ldr r0, [r3, #0xc] - ldrh r0, [r0, #0x32] - strh r0, [r1, #0x18] -_080A1A78: - pop {r4, pc} - .align 2, 0 -_080A1A7C: .4byte gPlayerState - - thumb_func_start sub_080A1A80 -sub_080A1A80: @ 0x080A1A80 - push {lr} - adds r2, r0, #0 - ldr r1, [r2, #0x64] - ldr r0, [r1, #4] - adds r0, #0x45 - ldrb r0, [r0] - cmp r0, #0 - bne _080A1AC0 - ldr r0, [r1, #0xc] - adds r0, #0x45 - movs r1, #0xc - strb r1, [r0] - movs r0, #7 - strb r0, [r2, #0xc] - movs r0, #0x23 - strb r0, [r2, #0xe] - adds r1, r2, #0 - adds r1, #0x6c - adds r0, #0xe1 - strh r0, [r1] - adds r1, #0xc - movs r0, #0x80 - lsls r0, r0, #3 - strh r0, [r1] - movs r0, #0x94 - lsls r0, r0, #1 - bl SoundReq - movs r0, #0x96 - movs r1, #1 - bl InitScreenShake -_080A1AC0: - ldr r2, _080A1AE0 @ =gPlayerState - ldr r1, _080A1AE4 @ =gRoomControls - movs r3, #0x80 - lsls r3, r3, #2 - adds r0, r3, #0 - ldrh r3, [r1, #6] - adds r0, r0, r3 - strh r0, [r2, #0x16] - movs r3, #0x84 - lsls r3, r3, #2 - adds r0, r3, #0 - ldrh r1, [r1, #8] - adds r0, r0, r1 - strh r0, [r2, #0x18] - pop {pc} - .align 2, 0 -_080A1AE0: .4byte gPlayerState -_080A1AE4: .4byte gRoomControls - - thumb_func_start sub_080A1AE8 -sub_080A1AE8: @ 0x080A1AE8 - push {r4, lr} - adds r4, r0, #0 - bl sub_080A1FF0 - ldr r0, [r4, #0x64] - ldr r1, [r0, #0xc] - adds r0, r1, #0 - adds r0, #0x45 - ldrb r0, [r0] - cmp r0, #0 - bne _080A1B24 - adds r0, r4, #0 - bl sub_080A20B8 - cmp r0, #0 - beq _080A1B24 - movs r0, #8 - strb r0, [r4, #0xc] - adds r1, r4, #0 - adds r1, #0x6c - movs r0, #0x40 - strh r0, [r1] - adds r1, #0xc - movs r0, #0xc0 - strh r0, [r1] - ldr r0, [r4, #0x64] - ldr r0, [r0, #4] - adds r0, #0x45 - movs r1, #0xc - strb r1, [r0] -_080A1B24: - ldr r2, _080A1B44 @ =gPlayerState - ldr r1, _080A1B48 @ =gRoomControls - movs r3, #0x80 - lsls r3, r3, #2 - adds r0, r3, #0 - ldrh r3, [r1, #6] - adds r0, r0, r3 - strh r0, [r2, #0x16] - movs r3, #0x84 - lsls r3, r3, #2 - adds r0, r3, #0 - ldrh r1, [r1, #8] - adds r0, r0, r1 - strh r0, [r2, #0x18] - pop {r4, pc} - .align 2, 0 -_080A1B44: .4byte gPlayerState -_080A1B48: .4byte gRoomControls - - thumb_func_start sub_080A1B4C -sub_080A1B4C: @ 0x080A1B4C - push {r4, r5, r6, r7, lr} - adds r4, r0, #0 - ldr r0, [r4, #0x64] - ldr r0, [r0, #4] - adds r0, #0x45 - ldrb r7, [r0] - cmp r7, #0 - bne _080A1BD0 - adds r5, r4, #0 - adds r5, #0x6c - ldrh r0, [r5] - cmp r0, #0 - beq _080A1B80 - movs r0, #0x2d - movs r1, #1 - bl InitScreenShake - movs r0, #0x94 - lsls r0, r0, #1 - bl SoundReq - adds r1, r4, #0 - adds r1, #0x78 - movs r0, #0xc0 - lsls r0, r0, #3 - strh r0, [r1] -_080A1B80: - movs r6, #0 - strh r7, [r5] - ldr r0, _080A1BF0 @ =gRoomTransition - adds r0, #0x39 - strb r6, [r0] - bl sub_08079F8C - cmp r0, #0 - beq _080A1BD0 - ldr r3, _080A1BF4 @ =gPlayerEntity - movs r1, #0x36 - ldrsh r0, [r3, r1] - cmp r0, #0 - bne _080A1BD0 - movs r0, #9 - strb r0, [r4, #0xc] - strb r6, [r4, #0xe] - movs r0, #0xf0 - strb r0, [r4, #0xf] - adds r1, r4, #0 - adds r1, #0x6e - adds r0, #0xb4 - strh r0, [r1] - strb r6, [r4, #0x15] - movs r0, #0x60 - strh r0, [r4, #0x24] - ldr r2, _080A1BF8 @ =gPlayerState - ldr r0, [r2, #0x30] - ldr r1, _080A1BFC @ =0xFFFDFFFF - ands r0, r1 - str r0, [r2, #0x30] - adds r0, r3, #0 - adds r1, r4, #0 - bl CopyPosition - ldr r0, _080A1C00 @ =gRoomControls - str r4, [r0, #0x30] - movs r0, #2 - bl SetPlayerControl -_080A1BD0: - ldr r2, _080A1BF8 @ =gPlayerState - ldr r1, _080A1C00 @ =gRoomControls - movs r3, #0x80 - lsls r3, r3, #2 - adds r0, r3, #0 - ldrh r3, [r1, #6] - adds r0, r0, r3 - strh r0, [r2, #0x16] - movs r3, #0x84 - lsls r3, r3, #2 - adds r0, r3, #0 - ldrh r1, [r1, #8] - adds r0, r0, r1 - strh r0, [r2, #0x18] - pop {r4, r5, r6, r7, pc} - .align 2, 0 -_080A1BF0: .4byte gRoomTransition -_080A1BF4: .4byte gPlayerEntity -_080A1BF8: .4byte gPlayerState -_080A1BFC: .4byte 0xFFFDFFFF -_080A1C00: .4byte gRoomControls - - thumb_func_start sub_080A1C04 -sub_080A1C04: @ 0x080A1C04 - push {r4, lr} - adds r4, r0, #0 - adds r1, r4, #0 - adds r1, #0x6e - ldrh r0, [r1] - cmp r0, #0 - bne _080A1C52 - adds r0, r4, #0 - bl LinearMoveUpdate - adds r0, r4, #0 - bl sub_080A1E54 - ldrb r0, [r4, #0xf] - subs r1, r0, #1 - strb r1, [r4, #0xf] - lsls r0, r1, #0x18 - cmp r0, #0 - bne _080A1C40 - movs r0, #0x7b - bl SetFlag - ldr r0, _080A1C3C @ =gUnk_0813ABD0 - movs r1, #8 - bl sub_0808091C - b _080A1C9A - .align 2, 0 -_080A1C3C: .4byte gUnk_0813ABD0 -_080A1C40: - lsls r0, r1, #0x18 - lsrs r0, r0, #0x18 - cmp r0, #0x3c - bne _080A1C9A - movs r0, #7 - movs r1, #4 - bl SetFade - b _080A1C9A -_080A1C52: - subs r0, #1 - strh r0, [r1] - lsls r0, r0, #0x10 - lsrs r0, r0, #0x10 - cmp r0, #0xb3 - bhi _080A1C66 - adds r0, r4, #0 - bl sub_080A1E54 - b _080A1C9A -_080A1C66: - ldrh r1, [r1] - cmp r1, #0xb4 - beq _080A1C76 - movs r0, #0x96 - lsls r0, r0, #1 - cmp r1, r0 - beq _080A1C8A - b _080A1C9A -_080A1C76: - movs r0, #0x94 - lsls r0, r0, #1 - bl SoundReq - movs r0, #0xb4 - lsls r0, r0, #2 - movs r1, #2 - bl InitScreenShake - b _080A1C9A -_080A1C8A: - movs r0, #0x94 - lsls r0, r0, #1 - bl SoundReq - movs r0, #0x4b - movs r1, #1 - bl InitScreenShake -_080A1C9A: - pop {r4, pc} - - thumb_func_start sub_080A1C9C -sub_080A1C9C: @ 0x080A1C9C - push {r4, r5, r6, r7, lr} - adds r4, r0, #0 - adds r5, r4, #0 - adds r5, #0x7a - ldrb r0, [r5] - cmp r0, #0 - beq _080A1D04 - adds r0, r4, #0 - adds r0, #0x74 - adds r7, r4, #0 - adds r7, #0x75 - ldrb r1, [r0] - adds r6, r0, #0 - ldrb r0, [r7] - cmp r1, r0 - beq _080A1CE4 - subs r5, #2 - movs r0, #0 - strh r0, [r5] - adds r0, r4, #0 - movs r1, #0xc - bl sub_080A1D8C - adds r0, r4, #0 - adds r0, #0x76 - ldrh r1, [r0] - adds r2, r0, #0 - cmp r1, #0 - bne _080A1D14 - ldrb r0, [r7] - strb r0, [r6] - adds r0, r4, #0 - adds r0, #0x7c - ldrh r0, [r0] - strh r0, [r5] - b _080A1D14 -_080A1CE4: - adds r0, r4, #0 - movs r1, #0xc - bl sub_080A1D8C - adds r0, r4, #0 - adds r0, #0x78 - adds r1, r4, #0 - adds r1, #0x76 - ldrh r0, [r0] - adds r2, r1, #0 - ldrh r1, [r2] - cmp r0, r1 - bne _080A1D14 - movs r0, #0 - strb r0, [r5] - b _080A1D14 -_080A1D04: - adds r0, r4, #0 - movs r1, #8 - bl sub_080A1D8C - adds r6, r4, #0 - adds r6, #0x74 - adds r2, r4, #0 - adds r2, #0x76 -_080A1D14: - adds r3, r4, #0 - adds r3, #0x70 - ldr r5, _080A1D68 @ =gSineTable - ldrb r0, [r6] - lsls r0, r0, #1 - adds r0, r0, r5 - movs r7, #0 - ldrsh r1, [r0, r7] - ldrh r0, [r2] - muls r0, r1, r0 - cmp r0, #0 - bge _080A1D2E - adds r0, #0xff -_080A1D2E: - asrs r0, r0, #8 - ldrh r1, [r3] - adds r0, r0, r1 - strh r0, [r3] - adds r4, #0x72 - ldrb r0, [r6] - adds r0, #0x40 - lsls r0, r0, #1 - adds r0, r0, r5 - movs r5, #0 - ldrsh r1, [r0, r5] - ldrh r0, [r2] - muls r0, r1, r0 - cmp r0, #0 - bge _080A1D4E - adds r0, #0xff -_080A1D4E: - asrs r0, r0, #8 - ldrh r1, [r4] - subs r1, r1, r0 - strh r1, [r4] - ldr r2, _080A1D6C @ =gScreen - ldrh r0, [r3] - lsrs r0, r0, #8 - strh r0, [r2, #0x2e] - lsls r1, r1, #0x10 - lsrs r1, r1, #0x18 - strh r1, [r2, #0x30] - pop {r4, r5, r6, r7, pc} - .align 2, 0 -_080A1D68: .4byte gSineTable -_080A1D6C: .4byte gScreen - - thumb_func_start sub_080A1D70 -sub_080A1D70: @ 0x080A1D70 - adds r2, r0, #0 - adds r0, #0x75 - strb r1, [r0] - adds r1, r2, #0 - adds r1, #0x7a - movs r0, #1 - strb r0, [r1] - adds r0, r2, #0 - adds r0, #0x78 - ldrh r1, [r0] - adds r0, #4 - strh r1, [r0] - bx lr - .align 2, 0 - - thumb_func_start sub_080A1D8C -sub_080A1D8C: @ 0x080A1D8C - push {r4, lr} - adds r4, r1, #0 - adds r3, r0, #0 - adds r3, #0x78 - adds r2, r0, #0 - adds r2, #0x76 - ldrh r1, [r3] - ldrh r0, [r2] - cmp r1, r0 - beq _080A1DC8 - cmp r1, r0 - bls _080A1DB6 - adds r3, r0, #0 - subs r0, r1, r3 - cmp r4, r0 - bge _080A1DB2 - adds r0, r3, r4 - strh r0, [r2] - b _080A1DC8 -_080A1DB2: - strh r1, [r2] - b _080A1DC8 -_080A1DB6: - ldrh r1, [r2] - ldrh r3, [r3] - subs r0, r1, r3 - cmp r4, r0 - bge _080A1DC6 - subs r0, r1, r4 - strh r0, [r2] - b _080A1DC8 -_080A1DC6: - strh r3, [r2] -_080A1DC8: - pop {r4, pc} - .align 2, 0 - - thumb_func_start sub_080A1DCC -sub_080A1DCC: @ 0x080A1DCC - push {r4, lr} - adds r4, r0, #0 - ldr r1, [r4, #0x64] - ldr r3, [r1, #8] - cmp r3, #0 - bne _080A1DDE - ldr r3, [r1, #0xc] - cmp r3, #0 - beq _080A1E24 -_080A1DDE: - adds r0, r3, #0 - adds r0, #0x7c - ldrb r0, [r0] - cmp r0, #0 - beq _080A1E24 - ldrb r0, [r3, #0x19] - lsrs r0, r0, #6 - cmp r0, #2 - bne _080A1E24 - ldr r3, [r1, #0x10] - ldrb r2, [r3, #0x10] - movs r1, #0x7f - adds r0, r1, #0 - ands r0, r2 - strb r0, [r3, #0x10] - ldr r0, [r4, #0x64] - ldr r3, [r0, #0x14] - ldrb r2, [r3, #0x10] - adds r0, r1, #0 - ands r0, r2 - strb r0, [r3, #0x10] - ldr r3, [r3, #0x54] - ldrb r2, [r3, #0x10] - adds r0, r1, #0 - ands r0, r2 - strb r0, [r3, #0x10] - ldr r3, [r3, #0x54] - ldrb r2, [r3, #0x10] - adds r0, r1, #0 - ands r0, r2 - strb r0, [r3, #0x10] - ldr r3, [r3, #0x54] - ldrb r0, [r3, #0x10] - ands r1, r0 - b _080A1E50 -_080A1E24: - ldr r0, [r4, #0x64] - ldr r2, [r0, #0x10] - ldrb r0, [r2, #0x10] - movs r1, #0x80 - orrs r0, r1 - strb r0, [r2, #0x10] - ldr r0, [r4, #0x64] - ldr r3, [r0, #0x14] - ldrb r0, [r3, #0x10] - orrs r0, r1 - strb r0, [r3, #0x10] - ldr r3, [r3, #0x54] - ldrb r0, [r3, #0x10] - orrs r0, r1 - strb r0, [r3, #0x10] - ldr r3, [r3, #0x54] - ldrb r0, [r3, #0x10] - orrs r0, r1 - strb r0, [r3, #0x10] - ldr r3, [r3, #0x54] - ldrb r0, [r3, #0x10] - orrs r1, r0 -_080A1E50: - strb r1, [r3, #0x10] - pop {r4, pc} - - thumb_func_start sub_080A1E54 -sub_080A1E54: @ 0x080A1E54 - push {r4, r5, lr} - adds r2, r0, #0 - ldrb r0, [r2, #0xe] - adds r0, #1 - strb r0, [r2, #0xe] - movs r1, #0xff - ands r0, r1 - movs r1, #0x1f - ands r0, r1 - cmp r0, #0 - bne _080A1ECA - adds r0, r2, #0 - movs r1, #0x51 - movs r2, #0 - bl CreateFx - adds r4, r0, #0 - cmp r4, #0 - beq _080A1ECA - bl Random - ldr r3, _080A1ECC @ =gRoomControls - movs r1, #0xf0 - adds r2, r0, #0 - ands r2, r1 - movs r5, #0x80 - lsls r5, r5, #2 - adds r1, r5, #0 - adds r2, r2, r1 - ldrh r1, [r3, #6] - adds r1, r1, r2 - subs r1, #0x78 - strh r1, [r4, #0x2e] - lsrs r0, r0, #8 - movs r1, #0x70 - ands r0, r1 - movs r1, #0x84 - lsls r1, r1, #2 - adds r0, r0, r1 - ldrh r3, [r3, #8] - adds r0, r0, r3 - subs r0, #0x38 - strh r0, [r4, #0x32] - adds r2, r4, #0 - adds r2, #0x29 - ldrb r1, [r2] - movs r0, #8 - rsbs r0, r0, #0 - ands r0, r1 - movs r1, #5 - orrs r0, r1 - strb r0, [r2] - adds r1, r4, #0 - adds r1, #0x38 - movs r0, #2 - strb r0, [r1] - adds r0, r4, #0 - bl UpdateSpriteForCollisionLayer -_080A1ECA: - pop {r4, r5, pc} - .align 2, 0 -_080A1ECC: .4byte gRoomControls - - thumb_func_start sub_080A1ED0 -sub_080A1ED0: @ 0x080A1ED0 - push {r4, r5, r6, r7, lr} - mov r7, sl - mov r6, sb - mov r5, r8 - push {r5, r6, r7} - sub sp, #4 - mov sb, r1 - adds r5, r2, #0 - movs r1, #0 - str r1, [sp] - ldr r4, _080A1F60 @ =gUnk_08124EF8 - lsls r1, r5, #2 - adds r1, r1, r4 - ldrh r2, [r1] - ldr r3, _080A1F64 @ =gRoomControls - ldrh r1, [r3, #6] - adds r2, r2, r1 - mov sl, r2 - lsls r1, r5, #1 - adds r1, #1 - lsls r1, r1, #1 - adds r1, r1, r4 - ldrh r2, [r1] - ldrh r1, [r3, #8] - adds r2, r2, r1 - mov r8, r2 - ldr r1, _080A1F68 @ =gUnk_08124FF0 - lsls r0, r0, #2 - adds r0, r0, r1 - ldr r4, [r0] - movs r1, #0 - ldrsh r0, [r4, r1] - cmp r0, #1 - beq _080A1FB0 - lsls r7, r5, #3 - movs r0, #0x10 - adds r6, r7, #0 - eors r6, r0 -_080A1F1C: - movs r0, #0x60 - mov r1, sb - bl CreateEnemy - adds r2, r0, #0 - cmp r2, #0 - beq _080A1FA6 - mov r0, sp - ldrb r0, [r0] - strb r0, [r2, #0xb] - ldr r1, [sp] - adds r1, #1 - str r1, [sp] - mov r0, sl - strh r0, [r2, #0x2e] - mov r1, r8 - strh r1, [r2, #0x32] - strb r7, [r2, #0x15] - adds r0, r2, #0 - adds r0, #0x7a - strb r6, [r0] - ldrh r1, [r4, #4] - subs r0, #2 - strh r1, [r0] - cmp r5, #1 - beq _080A1F7A - cmp r5, #1 - blo _080A1F6C - cmp r5, #2 - beq _080A1F80 - cmp r5, #3 - beq _080A1F94 - b _080A1FA6 - .align 2, 0 -_080A1F60: .4byte gUnk_08124EF8 -_080A1F64: .4byte gRoomControls -_080A1F68: .4byte gUnk_08124FF0 -_080A1F6C: - ldrh r1, [r4] - adds r0, r2, #0 - adds r0, #0x74 - strh r1, [r0] - ldrh r0, [r4, #2] - rsbs r0, r0, #0 - b _080A1F8C -_080A1F7A: - ldrh r0, [r4, #2] - adds r0, #0xf0 - b _080A1F98 -_080A1F80: - ldrh r1, [r4] - adds r0, r2, #0 - adds r0, #0x74 - strh r1, [r0] - ldrh r0, [r4, #2] - adds r0, #0xa0 -_080A1F8C: - adds r1, r2, #0 - adds r1, #0x76 - strh r0, [r1] - b _080A1FA6 -_080A1F94: - ldrh r0, [r4, #2] - rsbs r0, r0, #0 -_080A1F98: - adds r1, r2, #0 - adds r1, #0x74 - strh r0, [r1] - ldrh r1, [r4] - adds r0, r2, #0 - adds r0, #0x76 - strh r1, [r0] -_080A1FA6: - adds r4, #6 - movs r1, #0 - ldrsh r0, [r4, r1] - cmp r0, #1 - bne _080A1F1C -_080A1FB0: - mov r0, sb - cmp r0, #0 - bne _080A1FE4 - movs r0, #0xf - movs r1, #2 - movs r2, #0 - bl CreateObject - adds r2, r0, #0 - cmp r2, #0 - beq _080A1FE4 - mov r1, sl - strh r1, [r2, #0x2e] - mov r0, r8 - strh r0, [r2, #0x32] - ldrb r0, [r2, #0x1b] - movs r1, #0xc0 - orrs r0, r1 - strb r0, [r2, #0x1b] - ldrb r0, [r2, #0x19] - orrs r0, r1 - strb r0, [r2, #0x19] - adds r1, r2, #0 - adds r1, #0x38 - movs r0, #1 - strb r0, [r1] -_080A1FE4: - add sp, #4 - pop {r3, r4, r5} - mov r8, r3 - mov sb, r4 - mov sl, r5 - pop {r4, r5, r6, r7, pc} - - thumb_func_start sub_080A1FF0 -sub_080A1FF0: @ 0x080A1FF0 - push {r4, r5, lr} - adds r5, r0, #0 - ldrb r0, [r5, #0xe] - cmp r0, #0 - beq _080A2066 - subs r1, r0, #1 - strb r1, [r5, #0xe] - lsls r0, r1, #0x18 - lsrs r0, r0, #0x18 - cmp r0, #0x20 - bhi _080A2066 - movs r0, #0xf - ands r1, r0 - cmp r1, #0 - bne _080A2066 - adds r0, r5, #0 - movs r1, #0x51 - movs r2, #0 - bl CreateFx - adds r4, r0, #0 - cmp r4, #0 - beq _080A2066 - bl Random - ldr r3, _080A209C @ =gRoomControls - movs r1, #0x78 - ands r0, r1 - movs r1, #0x80 - lsls r1, r1, #2 - adds r2, r1, #0 - adds r2, r0, r2 - ldrh r1, [r3, #6] - adds r1, r1, r2 - subs r1, #0x3c - strh r1, [r4, #0x2e] - movs r1, #0x84 - lsls r1, r1, #2 - adds r0, r0, r1 - ldrh r3, [r3, #8] - adds r0, r0, r3 - subs r0, #0x3c - strh r0, [r4, #0x32] - adds r2, r4, #0 - adds r2, #0x29 - ldrb r1, [r2] - movs r0, #8 - rsbs r0, r0, #0 - ands r0, r1 - movs r1, #6 - orrs r0, r1 - strb r0, [r2] - adds r1, r4, #0 - adds r1, #0x38 - movs r0, #1 - strb r0, [r1] - adds r0, r4, #0 - bl UpdateSpriteForCollisionLayer -_080A2066: - adds r4, r5, #0 - adds r4, #0x7b - ldrb r0, [r4] - cmp r0, #0 - beq _080A20B4 - ldr r0, _080A20A0 @ =gPlayerEntity - ldr r2, _080A209C @ =gRoomControls - ldrh r1, [r2, #6] - movs r3, #0x80 - lsls r3, r3, #2 - adds r1, r1, r3 - ldrh r2, [r2, #8] - adds r3, #0x10 - adds r2, r2, r3 - movs r3, #0x80 - lsls r3, r3, #1 - bl sub_0806FCB8 - cmp r0, #0 - beq _080A20B2 - ldrb r0, [r5, #0xe] - cmp r0, #0 - bne _080A20A4 - movs r0, #0x78 - strb r0, [r5, #0xe] - b _080A20B4 - .align 2, 0 -_080A209C: .4byte gRoomControls -_080A20A0: .4byte gPlayerEntity -_080A20A4: - cmp r0, #0x23 - bne _080A20B4 - movs r0, #0x1e - movs r1, #0 - bl InitScreenShake - b _080A20B4 -_080A20B2: - strb r0, [r4] -_080A20B4: - pop {r4, r5, pc} - .align 2, 0 - - thumb_func_start sub_080A20B8 -sub_080A20B8: @ 0x080A20B8 - push {r4, lr} - adds r4, r1, #0 - cmp r4, #0 - bne _080A20C4 - movs r0, #1 - b _080A20FA -_080A20C4: - bl sub_08079F8C - cmp r0, #0 - beq _080A20F8 - ldr r0, _080A20F0 @ =gPlayerEntity - movs r1, #0x36 - ldrsh r0, [r0, r1] - cmp r0, #0 - bne _080A20F8 - movs r1, #0 - adds r0, r4, #0 - adds r0, #0x7c - ldrb r0, [r0] - cmp r0, #0 - bne _080A20EC - ldr r0, _080A20F4 @ =gPlayerState - ldrb r1, [r0, #0x14] - rsbs r0, r1, #0 - orrs r0, r1 - lsrs r1, r0, #0x1f -_080A20EC: - adds r0, r1, #0 - b _080A20FA - .align 2, 0 -_080A20F0: .4byte gPlayerEntity -_080A20F4: .4byte gPlayerState -_080A20F8: - movs r0, #0 -_080A20FA: - pop {r4, pc} diff --git a/assets/assets.json b/assets/assets.json index b670564e..a7eefd99 100644 --- a/assets/assets.json +++ b/assets/assets.json @@ -28602,177 +28602,6 @@ "start": 858702, "size": 22 }, - { - "path": "gyorgFemale/gUnk_080D1A84.bin", - "start": 858756, - "size": 16 - }, - { - "path": "gyorgFemale/gUnk_080D1A94_JP.bin", - "variants": [ - "JP" - ], - "starts": { - "JP": 858164 - }, - "size": 24 - }, - { - "path": "gyorgFemale/gUnk_080D1A94_1_DEMO_JP.bin", - "variants": [ - "DEMO_JP" - ], - "starts": { - "DEMO_JP": 856792 - }, - "size": 24 - }, - { - "path": "gyorgFemale/gUnk_080D1A94_2_EU.bin", - "variants": [ - "EU" - ], - "starts": { - "EU": 856512 - }, - "size": 24 - }, - { - "path": "gyorgFemale/gUnk_080D1A94_3_USA-DEMO_USA.bin", - "variants": [ - "USA", - "DEMO_USA" - ], - "start": 858772, - "size": 24 - }, - { - "path": "gyorgFemale/gUnk_080D1AAC_JP.bin", - "variants": [ - "JP" - ], - "starts": { - "JP": 858188 - }, - "size": 24 - }, - { - "path": "gyorgFemale/gUnk_080D1AAC_1_DEMO_JP.bin", - "variants": [ - "DEMO_JP" - ], - "starts": { - "DEMO_JP": 856816 - }, - "size": 24 - }, - { - "path": "gyorgFemale/gUnk_080D1AAC_2_EU.bin", - "variants": [ - "EU" - ], - "starts": { - "EU": 856536 - }, - "size": 24 - }, - { - "path": "gyorgFemale/gUnk_080D1AAC_3_USA-DEMO_USA.bin", - "variants": [ - "USA", - "DEMO_USA" - ], - "start": 858796, - "size": 24 - }, - { - "path": "gyorgFemale/gUnk_080D1AC4_JP.bin", - "variants": [ - "JP" - ], - "starts": { - "JP": 858212 - }, - "size": 24 - }, - { - "path": "gyorgFemale/gUnk_080D1AC4_1_DEMO_JP.bin", - "variants": [ - "DEMO_JP" - ], - "starts": { - "DEMO_JP": 856840 - }, - "size": 24 - }, - { - "path": "gyorgFemale/gUnk_080D1AC4_2_EU.bin", - "variants": [ - "EU" - ], - "starts": { - "EU": 856560 - }, - "size": 24 - }, - { - "path": "gyorgFemale/gUnk_080D1AC4_3_USA-DEMO_USA.bin", - "variants": [ - "USA", - "DEMO_USA" - ], - "start": 858820, - "size": 24 - }, - { - "path": "gyorgFemale/gUnk_080D1ADC_JP.bin", - "variants": [ - "JP" - ], - "starts": { - "JP": 858236 - }, - "size": 24 - }, - { - "path": "gyorgFemale/gUnk_080D1ADC_1_DEMO_JP.bin", - "variants": [ - "DEMO_JP" - ], - "starts": { - "DEMO_JP": 856864 - }, - "size": 24 - }, - { - "path": "gyorgFemale/gUnk_080D1ADC_2_EU.bin", - "variants": [ - "EU" - ], - "starts": { - "EU": 856584 - }, - "size": 24 - }, - { - "path": "gyorgFemale/gUnk_080D1ADC_3_USA-DEMO_USA.bin", - "variants": [ - "USA", - "DEMO_USA" - ], - "start": 858844, - "size": 24 - }, - { - "path": "gyorgFemale/gUnk_080D1AF4.bin", - "start": 858868, - "size": 4 - }, - { - "path": "gyorgFemale/gUnk_080D1AF8.bin", - "start": 858872, - "size": 4 - }, { "path": "animations/gSpriteAnimations_GyorgMale_0.bin", "start": 859248, @@ -28959,11 +28788,6 @@ "size": 6, "type": "animation" }, - { - "path": "gyorgChild/gUnk_080D1EA0.bin", - "start": 859808, - "size": 22 - }, { "path": "animations/gSpriteAnimations_GyorgFemaleEye_0.bin", "start": 860240, @@ -29108,21 +28932,6 @@ "size": 16, "type": "animation" }, - { - "path": "gyorgFemaleEye/gUnk_080D1F90.bin", - "start": 860048, - "size": 128 - }, - { - "path": "gyorgFemaleEye/gUnk_080D2010.bin", - "start": 860176, - "size": 32 - }, - { - "path": "gyorgFemaleEye/gUnk_080D2030.bin", - "start": 860208, - "size": 32 - }, { "path": "animations/gSpriteAnimations_Enemy62_0.bin", "start": 861032, @@ -29541,51 +29350,6 @@ "size": 17, "type": "animation" }, - { - "path": "gyorgFemaleMouth/gUnk_080D28CC.bin", - "start": 862412, - "size": 16 - }, - { - "path": "gyorgFemaleMouth/gUnk_080D28DC.bin", - "start": 862428, - "size": 8 - }, - { - "path": "gyorgFemaleMouth/gUnk_080D28E4.bin", - "start": 862436, - "size": 8 - }, - { - "path": "gyorgFemaleMouth/gUnk_080D28EC.bin", - "start": 862444, - "size": 8 - }, - { - "path": "gyorgFemaleMouth/gUnk_080D28F4.bin", - "start": 862452, - "size": 8 - }, - { - "path": "gyorgFemaleMouth/gUnk_080D28FC.bin", - "start": 862460, - "size": 8 - }, - { - "path": "gyorgFemaleMouth/gUnk_080D2904.bin", - "start": 862468, - "size": 8 - }, - { - "path": "gyorgFemaleMouth/gUnk_080D290C.bin", - "start": 862476, - "size": 8 - }, - { - "path": "gyorgFemaleMouth/gUnk_080D2914.bin", - "start": 862484, - "size": 8 - }, { "path": "enemy64/gUnk_080D29B8.bin", "start": 862648, @@ -47121,11 +46885,6 @@ "start": 1200092, "size": 20 }, - { - "path": "gyorgBossObject/gUnk_08124EF8.bin", - "start": 1199864, - "size": 16 - }, { "path": "windcrest/gUnk_08125010.bin", "start": 1200144, diff --git a/data/const/enemy/gyorgChild.s b/data/const/enemy/gyorgChild.s deleted file mode 100644 index aa870879..00000000 --- a/data/const/enemy/gyorgChild.s +++ /dev/null @@ -1,29 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - .align 2 - -gUnk_080D1E6C:: @ 080D1E6C - .4byte sub_08048684 - .4byte sub_0804869C - .4byte sub_08001324 - .4byte sub_0804A7D4 - .4byte sub_08001242 - .4byte sub_080486AC - -gUnk_080D1E84:: @ 080D1E84 - .4byte sub_080486F4 - .4byte sub_0804877C - .4byte sub_0804882C - .4byte sub_08048904 - -gUnk_080D1E94:: @ 080D1E94 - .4byte sub_080486D0 - .4byte sub_080486D8 - .4byte sub_080486E0 - -gUnk_080D1EA0:: @ 080D1EA0 - .incbin "gyorgChild/gUnk_080D1EA0.bin" - - diff --git a/data/const/enemy/gyorgFemale.s b/data/const/enemy/gyorgFemale.s deleted file mode 100644 index 478654f4..00000000 --- a/data/const/enemy/gyorgFemale.s +++ /dev/null @@ -1,95 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - .align 2 - -gUnk_080D1A64:: @ 080D1A64 - .4byte sub_0804614C - .4byte sub_0804625C - .4byte sub_0804632C - .4byte sub_080463E4 - -gUnk_080D1A74:: @ 080D1A74 - .4byte gUnk_080D1A94 - .4byte gUnk_080D1AAC - .4byte gUnk_080D1AC4 - .4byte gUnk_080D1ADC - -gUnk_080D1A84:: @ 080D1A84 - .incbin "gyorgFemale/gUnk_080D1A84.bin" - -gUnk_080D1A94:: @ 080D1A94 -.ifdef JP - @ TODO only small differences - .incbin "gyorgFemale/gUnk_080D1A94_JP.bin" -.else -.ifdef DEMO_JP - @ TODO only small differences - .incbin "gyorgFemale/gUnk_080D1A94_1_DEMO_JP.bin" -.else -.ifdef EU - .incbin "gyorgFemale/gUnk_080D1A94_2_EU.bin" -.else - .incbin "gyorgFemale/gUnk_080D1A94_3_USA-DEMO_USA.bin" -.endif -.endif -.endif - - -gUnk_080D1AAC:: @ 080D1AAC -.ifdef JP - @ TODO only small differences - .incbin "gyorgFemale/gUnk_080D1AAC_JP.bin" -.else -.ifdef DEMO_JP - @ TODO only small differences - .incbin "gyorgFemale/gUnk_080D1AAC_1_DEMO_JP.bin" -.else -.ifdef EU - .incbin "gyorgFemale/gUnk_080D1AAC_2_EU.bin" -.else - .incbin "gyorgFemale/gUnk_080D1AAC_3_USA-DEMO_USA.bin" -.endif -.endif -.endif - -gUnk_080D1AC4:: @ 080D1AC4 -.ifdef JP - @ TODO only small differences - .incbin "gyorgFemale/gUnk_080D1AC4_JP.bin" -.else -.ifdef DEMO_JP - @ TODO only small differences - .incbin "gyorgFemale/gUnk_080D1AC4_1_DEMO_JP.bin" -.else -.ifdef EU - .incbin "gyorgFemale/gUnk_080D1AC4_2_EU.bin" -.else - .incbin "gyorgFemale/gUnk_080D1AC4_3_USA-DEMO_USA.bin" -.endif -.endif -.endif - -gUnk_080D1ADC:: @ 080D1ADC -.ifdef JP - @ TODO only small differences - .incbin "gyorgFemale/gUnk_080D1ADC_JP.bin" -.else -.ifdef DEMO_JP - @ TODO only small differences - .incbin "gyorgFemale/gUnk_080D1ADC_1_DEMO_JP.bin" -.else -.ifdef EU - .incbin "gyorgFemale/gUnk_080D1ADC_2_EU.bin" -.else - .incbin "gyorgFemale/gUnk_080D1ADC_3_USA-DEMO_USA.bin" -.endif -.endif -.endif - -gUnk_080D1AF4:: @ 080D1AF4 - .incbin "gyorgFemale/gUnk_080D1AF4.bin" - -gUnk_080D1AF8:: @ 080D1AF8 - .incbin "gyorgFemale/gUnk_080D1AF8.bin" diff --git a/data/const/enemy/gyorgFemaleEye.s b/data/const/enemy/gyorgFemaleEye.s deleted file mode 100644 index 00881c56..00000000 --- a/data/const/enemy/gyorgFemaleEye.s +++ /dev/null @@ -1,29 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - .align 2 - -gUnk_080D1F64:: @ 080D1F64 - .4byte sub_080489B4 - .4byte sub_080489CC - .4byte sub_08001324 - .4byte sub_0804A7D4 - .4byte sub_08001242 - .4byte sub_080489B4 - -gUnk_080D1F7C:: @ 080D1F7C - .4byte sub_08048AF0 - .4byte sub_08048B2C - .4byte sub_08048B84 - .4byte sub_08048BB0 - .4byte sub_08048CEC - -gUnk_080D1F90:: @ 080D1F90 - .incbin "gyorgFemaleEye/gUnk_080D1F90.bin" - -gUnk_080D2010:: @ 080D2010 - .incbin "gyorgFemaleEye/gUnk_080D2010.bin" - -gUnk_080D2030:: @ 080D2030 - .incbin "gyorgFemaleEye/gUnk_080D2030.bin" diff --git a/data/const/enemy/gyorgFemaleMouth.s b/data/const/enemy/gyorgFemaleMouth.s deleted file mode 100644 index 114c93c2..00000000 --- a/data/const/enemy/gyorgFemaleMouth.s +++ /dev/null @@ -1,42 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - .align 2 - -gUnk_080D28AC:: @ 080D28AC - .4byte gUnk_080D28DC - .4byte gUnk_080D28E4 - .4byte gUnk_080D28EC - .4byte gUnk_080D28F4 - .4byte gUnk_080D28FC - .4byte gUnk_080D2904 - .4byte gUnk_080D290C - .4byte gUnk_080D2914 - -gUnk_080D28CC:: @ 080D28CC - .incbin "gyorgFemaleMouth/gUnk_080D28CC.bin" - -gUnk_080D28DC:: @ 080D28DC - .incbin "gyorgFemaleMouth/gUnk_080D28DC.bin" - -gUnk_080D28E4:: @ 080D28E4 - .incbin "gyorgFemaleMouth/gUnk_080D28E4.bin" - -gUnk_080D28EC:: @ 080D28EC - .incbin "gyorgFemaleMouth/gUnk_080D28EC.bin" - -gUnk_080D28F4:: @ 080D28F4 - .incbin "gyorgFemaleMouth/gUnk_080D28F4.bin" - -gUnk_080D28FC:: @ 080D28FC - .incbin "gyorgFemaleMouth/gUnk_080D28FC.bin" - -gUnk_080D2904:: @ 080D2904 - .incbin "gyorgFemaleMouth/gUnk_080D2904.bin" - -gUnk_080D290C:: @ 080D290C - .incbin "gyorgFemaleMouth/gUnk_080D290C.bin" - -gUnk_080D2914:: @ 080D2914 - .incbin "gyorgFemaleMouth/gUnk_080D2914.bin" diff --git a/data/const/object/gyorgBossObject.s b/data/const/object/gyorgBossObject.s deleted file mode 100644 index eb5c2617..00000000 --- a/data/const/object/gyorgBossObject.s +++ /dev/null @@ -1,20 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - .align 2 - -gUnk_08124ED0:: @ 08124ED0 - .4byte sub_080A1704 - .4byte sub_080A184C - .4byte sub_080A189C - .4byte sub_080A190C - .4byte sub_080A1990 - .4byte sub_080A19FC - .4byte sub_080A1A80 - .4byte sub_080A1AE8 - .4byte sub_080A1B4C - .4byte sub_080A1C04 - -gUnk_08124EF8:: @ 08124EF8 - .incbin "gyorgBossObject/gUnk_08124EF8.bin" diff --git a/include/enemy.h b/include/enemy.h index 801eb97d..1b7d1a07 100644 --- a/include/enemy.h +++ b/include/enemy.h @@ -223,14 +223,14 @@ void FireballGuy(Entity*); void MiniFireballGuy(Entity*); void VaatiTransfiguredEye(Entity*); void BusinessScrubPrologue(Entity*); -void GyorgFemale(Entity*); -void GyorgMale(Entity*); +void GyorgFemale(); +void GyorgMale(); void Curtain(Entity*); void VaatiWrathEye(Entity*); -void GyorgChild(Entity*); -void GyorgFemaleEye(Entity*); +void GyorgChild(); +void GyorgFemaleEye(); void Enemy62(Entity*); -void GyorgFemaleMouth(Entity*); +void GyorgFemaleMouth(); void Enemy64(Entity*); void TreeItem(Entity*); void Enemy66(Entity*); diff --git a/include/enemy/gyorg.h b/include/enemy/gyorg.h new file mode 100644 index 00000000..a372dcdf --- /dev/null +++ b/include/enemy/gyorg.h @@ -0,0 +1,93 @@ +#ifndef ENEMY_GYORG_H +#define ENEMY_GYORG_H + +#include "enemy.h" + +typedef struct { + Entity base; + u8 unk_68[0x8]; + u16 unk_70; + u8 unk_72[0x6]; + u8 unk_78; + u8 unk_79; + u16 unk_7a; + u8 unk_7c; + u8 unk_7d; + u8 unk_7e[1]; + u8 unk_7f; + u8 unk_80; + u8 unk_81[1]; + u8 unk_82; + u8 unk_83[5]; +} GyorgFemaleEntity; + +typedef struct { + Entity base; + u8 unk_68[0x20]; +} GyorgFemaleEyeEntity; + +typedef struct { + Entity base; + u8 filler[0x20]; +} GyorgFemaleMouthEntity; + +typedef struct { + Entity base; + u8 unk_68[0x8]; + u16 unk_70; + u16 unk_72; + u16 unk_74; + u16 unk_76; + u16 unk_78; + u16 unk_7a; + u8 unk_7c; + u8 unk_7d; + u16 unk_7e; + u16 unk_80; + u16 unk_82; + u16 unk_84; + u16 unk_86; +} GyorgMaleEntity; + +typedef struct { + Entity base; + u8 unk_68[0xC]; + u16 unk_74; + u16 unk_76; + u16 unk_78; + u8 unk_7a; + u8 unk_7b; + u8 unk_7c[0xC]; +} GyorgChildEntity; + +typedef struct { + Entity base; + u8 unk_68[4]; + u16 unk_6c; + u16 unk_6e; + u16 unk_70; + u16 unk_72; + u8 unk_74; + u8 unk_75; + u16 unk_76; + u16 unk_78; + u8 unk_7a; + u8 unk_7b; + u16 unk_7c; + u8 unk_7e[0xa]; +} GyorgBossObjectEntity; + +typedef struct { + GyorgBossObjectEntity* boss; + GyorgFemaleEntity* female; + GyorgMaleEntity* male1; + GyorgMaleEntity* male2; + GyorgFemaleMouthEntity* unk_10; + GenericEntity* unk_14; + void* unk_18[0x8]; + u16 unk_38; + u16 unk_3a; + u8 unk_3c; +} GyorgHeap; + +#endif diff --git a/include/entity.h b/include/entity.h index 66b5190f..c3477e9e 100644 --- a/include/entity.h +++ b/include/entity.h @@ -195,7 +195,7 @@ typedef struct Entity_ { /*0x60*/ u16 spriteVramOffset; /*0x62*/ u8 spriteOffsetX; /*0x63*/ s8 spriteOffsetY; - /*0x64*/ u32* myHeap; /**< Heap data allocated with #zMalloc. */ + /*0x64*/ void* myHeap; /**< Heap data allocated with #zMalloc. */ #ifndef NENT_DEPRECATED /*0x68*/ union SplitHWord field_0x68; /*0x6a*/ union SplitHWord field_0x6a; @@ -214,6 +214,24 @@ typedef struct Entity_ { #endif } Entity; +typedef struct { + /*0x00*/ Entity base; + /*0x68*/ union SplitHWord field_0x68; + /*0x6a*/ union SplitHWord field_0x6a; + /*0x6c*/ union SplitHWord field_0x6c; + /*0x6e*/ union SplitHWord field_0x6e; + /*0x70*/ union SplitWord field_0x70; + /*0x74*/ union SplitHWord field_0x74; + /*0x76*/ union SplitHWord field_0x76; + /*0x78*/ union SplitHWord field_0x78; + /*0x7a*/ union SplitHWord field_0x7a; + /*0x7c*/ union SplitWord field_0x7c; + /*0x80*/ union SplitHWord field_0x80; + /*0x82*/ union SplitHWord field_0x82; + /*0x84*/ union SplitHWord cutsceneBeh; + /*0x86*/ union SplitHWord field_0x86; +} GenericEntity; + /** * Entity linked list structure. */ diff --git a/include/functions.h b/include/functions.h index 31ef2f13..7709868b 100644 --- a/include/functions.h +++ b/include/functions.h @@ -26,7 +26,7 @@ extern void sub_0806D02C(Entity*); extern void sub_0806FD3C(Entity*); extern void sub_0805ED14(u32*); extern void sub_080A7C18(u32, u32, u32); -extern void sub_0804AA30(Entity*, EntityActionArray); +extern void sub_0804AA30(Entity*, void (*const[])()); extern void sub_0804A720(Entity*); extern u32 sub_080AEFE0(Entity*); extern u32 sub_08049FA0(Entity*); @@ -49,7 +49,7 @@ extern void sub_080575C8(u32); extern void sub_08057688(void); extern void sub_080580B0(u32); extern void sub_080751E8(u32, u32, void*); -extern void sub_0808091C(ScreenTransitionData*, u32); +extern void sub_0808091C(const ScreenTransitionData*, u32); extern void sub_0805BC4C(void); extern void sub_0807BB68(u32*, u32, u32); extern void sub_08054570(void); @@ -96,7 +96,6 @@ extern u32 sub_0805F8F8(u32); extern u32 sub_0805F7A0(u32); extern u32* sub_0805F25C(u32); u32 sub_0806FCB8(Entity*, u32, u32, u32); -extern void sub_080A1D70(Entity*, u32); extern void sub_0806F62C(Entity*, u32, u32); extern void sub_080A1ED0(u32, u32, u32); extern u32 sub_0806F5B0(u32); diff --git a/include/room.h b/include/room.h index 7886d288..0cd7f3c2 100644 --- a/include/room.h +++ b/include/room.h @@ -215,6 +215,6 @@ void LoadRoomEntityList(EntityData* listPtr); void sub_0804B3C4(void*); void sub_0804B0B0(u32 arg0, u32 arg1); -void DoExitTransition(ScreenTransitionData* data); +void DoExitTransition(const ScreenTransitionData* data); #endif diff --git a/linker.ld b/linker.ld index a08e377b..ee11a873 100644 --- a/linker.ld +++ b/linker.ld @@ -414,14 +414,14 @@ SECTIONS { src/enemy/miniFireballGuy.o(.text); src/enemy/vaatiTransfiguredEye.o(.text); asm/enemy/businessScrubPrologue.o(.text); - asm/enemy/gyorgFemale.o(.text); + src/enemy/gyorgFemale.o(.text); src/enemy/gyorgMale.o(.text); src/enemy/curtain.o(.text); src/enemy/vaatiWrathEye.o(.text); - asm/enemy/gyorgChild.o(.text); - asm/enemy/gyorgFemaleEye.o(.text); + src/enemy/gyorgChild.o(.text); + src/enemy/gyorgFemaleEye.o(.text); asm/enemy/enemy62.o(.text); - asm/enemy/gyorgFemaleMouth.o(.text); + src/enemy/gyorgFemaleMouth.o(.text); asm/enemy/enemy64.o(.text); src/enemy/treeItem.o(.text); asm/enemy/enemy66.o(.text); @@ -836,7 +836,7 @@ SECTIONS { src/object/well.o(.text); asm/object/windTribeTeleporter.o(.text); asm/object/objectB9.o(.text); - asm/object/gyorgBossObject.o(.text); + src/object/gyorgBossObject.o(.text); src/object/windcrest.o(.text); asm/object/litArea.o(.text); asm/object/objectBD.o(.text); @@ -1098,20 +1098,20 @@ SECTIONS { src/enemy/vaatiTransfiguredEye.o(.rodata); data/animations/enemy/vaatiTransfiguredEye.o(.rodata); data/const/enemy/businessScrubPrologue.o(.rodata); - data/const/enemy/gyorgFemale.o(.rodata); + src/enemy/gyorgFemale.o(.rodata); src/enemy/gyorgMale.o(.rodata); data/animations/enemy/gyorgMale.o(.rodata); src/enemy/curtain.o(.rodata); data/animations/enemy/curtain.o(.rodata); src/enemy/vaatiWrathEye.o(.rodata); data/animations/enemy/vaatiWrathEye.o(.rodata); - data/const/enemy/gyorgChild.o(.rodata); + src/enemy/gyorgChild.o(.rodata); data/animations/enemy/gyorgChild.o(.rodata); - data/const/enemy/gyorgFemaleEye.o(.rodata); + src/enemy/gyorgFemaleEye.o(.rodata); data/animations/enemy/gyorgFemaleEye.o(.rodata); data/const/enemy/enemy62.o(.rodata); data/animations/enemy/enemy62.o(.rodata); - data/const/enemy/gyorgFemaleMouth.o(.rodata); + src/enemy/gyorgFemaleMouth.o(.rodata); data/animations/enemy/gyorgFemaleMouth.o(.rodata); data/const/enemy/enemy64.o(.rodata); src/enemy/treeItem.o(.rodata); @@ -1584,7 +1584,7 @@ SECTIONS { data/const/object/well.o(.rodata); data/const/object/windTribeTeleporter.o(.rodata); data/const/object/objectB9.o(.rodata); - data/const/object/gyorgBossObject.o(.rodata); + src/object/gyorgBossObject.o(.rodata); data/animations/object/gyorgBossObject.o(.rodata); data/const/object/windcrest.o(.rodata); data/const/object/objectBD.o(.rodata); diff --git a/src/enemy/gyorgChild.c b/src/enemy/gyorgChild.c new file mode 100644 index 00000000..c57e7dce --- /dev/null +++ b/src/enemy/gyorgChild.c @@ -0,0 +1,200 @@ +#define NENT_DEPRECATED +#include "global.h" +#include "room.h" +#include "asm.h" +#include "functions.h" +#include "enemy/gyorg.h" + +void sub_08048684(GyorgChildEntity*); +void sub_0804869C(GyorgChildEntity*); +void sub_080486AC(GyorgChildEntity*); + +void (*const gUnk_080D1E6C[])(GyorgChildEntity*) = { + sub_08048684, + sub_0804869C, + (void (*)(GyorgChildEntity*))sub_08001324, + (void (*)(GyorgChildEntity*))sub_0804A7D4, + (void (*)(GyorgChildEntity*))sub_08001242, + sub_080486AC, +}; + +void GyorgChild(Entity* this) { + if (gRoomTransition.field_0x39 == 0) { + this->flags &= ~0x80; + this->health = 0; + this->collisionLayer = 2; + } + gUnk_080D1E6C[GetNextFunction(this)]((GyorgChildEntity*)this); +} + +void sub_080486F4(GyorgChildEntity*); +void sub_0804877C(GyorgChildEntity*); +void sub_0804882C(GyorgChildEntity*); +void sub_08048904(GyorgChildEntity*); + +void sub_08048684(GyorgChildEntity* this) { + static void (*const gUnk_080D1E84[])(GyorgChildEntity*) = { + sub_080486F4, + sub_0804877C, + sub_0804882C, + sub_08048904, + }; + gUnk_080D1E84[super->action](this); +} + +void sub_0804869C(GyorgChildEntity* this) { + sub_0804AA30(super, gUnk_080D1E6C); +} + +void sub_080486D0(GyorgChildEntity*); +void sub_080486D8(GyorgChildEntity*); +void sub_080486E0(GyorgChildEntity*); + +void sub_080486AC(GyorgChildEntity* this) { + static void (*const gUnk_080D1E94[])(GyorgChildEntity*) = { + sub_080486D0, + sub_080486D8, + sub_080486E0, + }; + if (sub_0806F520()) { + gUnk_080D1E94[super->subAction](this); + } +} + +void sub_080486D0(GyorgChildEntity* this) { + super->subAction = 2; +} + +void sub_080486D8(GyorgChildEntity* this) { + sub_0806F4E8(super); +} + +void sub_080486E0(GyorgChildEntity* this) { + if (sub_0806F3E4(super)) { + sub_0804A7D4(super); + } +} + +void sub_080486F4(GyorgChildEntity* this) { + static const s8 gUnk_080D1EA0[] = { + 0x50, 0x1, 0x40, 0x1, 0x30, 0x1, 0x20, 0x1, 0x10, 0x1, 0, + 0, 0x10, -0x1, 0x20, -0x1, 0x30, -0x1, 0x40, -0x1, 0x50, -0x1, + }; + super->field_0x1c = 1; + super->spriteOrientation.flipY = 3; + super->spriteRendering.b3 = 3; + super->spritePriority.b0 = 7; + super->animationState = super->direction >> 2; + if (super->type == 0) { + s32 r; + InitializeAnimation(super, super->animationState); + super->action = 1; + super->flags |= 0x80; + r = (signed)Random() % 0xB; + super->direction += r; + super->direction -= 5; + super->direction &= 0x1F; + r *= 2; + super->actionDelay = gUnk_080D1EA0[r]; + this->unk_7b = gUnk_080D1EA0[r + 1]; + super->speed = 0x200; + } else { + super->action = 2; + super->actionDelay = 1; + super->spriteSettings.draw = 0; + } +} + +void sub_0804877C(GyorgChildEntity* this) { + LinearMoveUpdate(super); + if (super->actionDelay != 0) { + if ((--super->actionDelay & 0xF) == 0) { + super->direction += this->unk_7b; + super->direction &= 0x1F; + } + } + switch (super->animationState >> 1) { + case 0: + if (super->y.HALF.HI > gRoomControls.scroll_y - 0x18) { + return; + } + break; + case 1: + if (super->x.HALF.HI < gRoomControls.scroll_x + 0x108) { + return; + } + break; + case 2: + if (super->y.HALF.HI < gRoomControls.scroll_y + 0xb8) { + return; + } + break; + default: + if (super->x.HALF.HI > gRoomControls.scroll_x - 0x18) { + return; + } + break; + } + super->action = 2; + super->actionDelay = 90; + super->spriteSettings.draw = 0; +} + +void sub_0804882C(GyorgChildEntity* this) { + if (--super->actionDelay == 0) { + super->action = 3; + super->flags |= 0x80; + Random(); + super->spriteSettings.draw = 1; + super->spritePriority.b0 = 4; + super->speed = this->unk_78; + super->collisionLayer = 2; + UpdateSpriteForCollisionLayer(super); + super->direction = this->unk_7a; + super->animationState = super->direction >> 2; + InitializeAnimation(super, super->animationState); + switch (super->animationState >> 1) { + case 0: + case 2: + super->x.HALF.HI = gPlayerEntity.x.HALF.HI + this->unk_74; + super->y.HALF.HI = gRoomControls.scroll_y + this->unk_76; + break; + case 1: + default: + super->x.HALF.HI = gRoomControls.scroll_x + this->unk_74; + super->y.HALF.HI = gPlayerEntity.y.HALF.HI + this->unk_76; + break; + } + if (super->type2 == 0) { + SoundReq(SFX_198); + } + } +} + +void sub_08048904(GyorgChildEntity* this) { + LinearMoveUpdate(super); + GetNextFrame(super); + switch (super->animationState >> 1) { + case 0: + if (super->y.HALF.HI > gRoomControls.scroll_y - 0x28) { + return; + } + break; + case 1: + if (super->x.HALF.HI < gRoomControls.scroll_x + 0x118) { + return; + } + break; + case 2: + if (super->y.HALF.HI < gRoomControls.scroll_y + 0xc8) { + return; + } + break; + default: + if (super->x.HALF.HI > gRoomControls.scroll_x - 0x28) { + return; + } + break; + } + DeleteThisEntity(); +} diff --git a/src/enemy/gyorgFemale.c b/src/enemy/gyorgFemale.c new file mode 100644 index 00000000..3aa0c932 --- /dev/null +++ b/src/enemy/gyorgFemale.c @@ -0,0 +1,458 @@ +#define NENT_DEPRECATED +#include "global.h" +#include "entity.h" +#include "enemy.h" +#include "sound.h" +#include "asm.h" +#include "functions.h" +#include "enemy/gyorg.h" + +extern u8 gEntCount; +extern u8 gMapDataTopSpecial[]; + +extern u16 gUnk_02019EE0[]; + +extern void sub_080197D4(const void*); + +extern u32 sub_08000E62(u32); +extern void RegisterTransitionManager(void*, void (*)(), void (*)()); + +void sub_08046498(); +void sub_0804660C(GyorgFemaleEntity*, u32); +void sub_080464C0(GyorgFemaleEntity*); +void sub_08046634(GyorgFemaleEntity*, u32); +void sub_080465C8(void); +void sub_080466A8(GyorgFemaleEntity*); +void sub_08046668(GyorgFemaleEntity*); +void sub_08046518(void); +void sub_080467DC(GyorgFemaleEntity*); + +extern u8 gUpdateVisibleTiles; +extern u8 gUnk_080B3E80[]; +extern u8 gUnk_080B37A0[]; +extern u16 gMetatileTypesTop[]; + +extern const u8 gUnk_080D1A94[]; +extern const u8 gUnk_080D1AAC[]; +extern const u8 gUnk_080D1AC4[]; +extern const u8 gUnk_080D1ADC[]; + +void sub_0804614C(GyorgFemaleEntity*); +void sub_0804625C(GyorgFemaleEntity*); +void sub_0804632C(GyorgFemaleEntity*); +void sub_080463E4(GyorgFemaleEntity*); + +void GyorgFemale(Entity* this) { + static void (*const gUnk_080D1A64[])(GyorgFemaleEntity*) = { + sub_0804614C, + sub_0804625C, + sub_0804632C, + sub_080463E4, + }; + gUnk_080D1A64[this->action]((GyorgFemaleEntity*)this); +} + +void sub_0804614C(GyorgFemaleEntity* this) { + Entity* tmp; + if (gEntCount > 0x3d) + return; + tmp = CreateProjectile(0x22); + tmp->type = 0; + tmp->parent = super; + ((GyorgHeap*)super->myHeap)->unk_14 = (GenericEntity*)tmp; + tmp = CreateEnemy(GYORG_FEMALE_MOUTH, 0); + tmp->parent = super; + ((GyorgHeap*)super->myHeap)->unk_10 = (GyorgFemaleMouthEntity*)tmp; + tmp = CreateEnemy(GYORG_FEMALE_EYE, 0); + tmp->parent = super; + tmp = CreateEnemy(GYORG_FEMALE_EYE, 1); + tmp->parent = super; + tmp = CreateEnemy(GYORG_FEMALE_EYE, 2); + tmp->parent = super; + tmp = CreateEnemy(GYORG_FEMALE_EYE, 3); + tmp->parent = super; + tmp = CreateEnemy(GYORG_FEMALE_EYE, 4); + tmp->parent = super; + tmp = CreateEnemy(GYORG_FEMALE_EYE, 5); + tmp->parent = super; + tmp = CreateEnemy(GYORG_FEMALE_EYE, 6); + tmp->parent = super; + tmp = CreateEnemy(GYORG_FEMALE_EYE, 7); + tmp->parent = super; + super->action = 1; + super->spriteOrientation.flipY = 2; + super->spriteRendering.b3 = 2; + super->collisionLayer = 2; + this->unk_78 = 0; + this->unk_79 = 0; + this->unk_70 = 0x3C; + MemClear(&gUnk_02019EE0, 0x8000); + MemClear(&gMapDataTopSpecial, 0x8000); + sub_0804660C(this, 0); + sub_080464C0(this); + gPlayerEntity.collisionLayer = 2; + UpdateSpriteForCollisionLayer(&gPlayerEntity); +#ifndef EU + RegisterTransitionManager(this, sub_08046498, 0); +#else + RegisterTransitionManager(this, sub_080464C0, 0); +#endif +} + +void sub_0804625C(GyorgFemaleEntity* this) { + if (this->unk_79 & 0x80) { + this->unk_79 &= ~0x80; + this->unk_79 |= 0x40; + sub_0804660C(this, (this->unk_79 & 3) << 6); + } else { + if (this->unk_79 & 0x40) { + this->unk_79 &= ~0x40; + sub_080464C0(this); + } + } + sub_080465C8(); + if (((GyorgHeap*)super->myHeap)->boss->unk_6c & 0x38) { + super->action = 2; + super->actionDelay = 0; + this->unk_7a = 0; + this->unk_7c = 0; + this->unk_7d = 0; + this->unk_70 = 0x3c; + this->unk_80 = 0; + return; + } + if (((GyorgHeap*)super->myHeap)->boss->unk_6c & 0x40) { + super->action = 3; + this->unk_70 = 0x3c; + super->actionDelay = 0; + this->unk_7a = 0; + this->unk_7c = 0; + this->unk_7d = 0; + this->unk_80 = 0; + return; + } + if (((GyorgHeap*)super->myHeap)->boss->unk_6c & 0x100) { + if (--this->unk_70 == 0) { + this->unk_70 = 0x168; + sub_08046634(this, 1); + } + } +} + +void sub_0804632C(GyorgFemaleEntity* this) { + sub_080465C8(); + sub_080466A8(this); + if (++this->unk_7a > 0x59f) { + this->unk_7a = 0; + this->unk_7c = 0; + this->unk_7d = 0; + this->unk_80 = 0; + } else { + if (this->unk_7a == 0x78) { + sub_08046668(this); + } else { + if (this->unk_7a == 0x528) { + this->unk_78 = 0; +#ifndef EU + this->unk_7d = 0; + this->unk_7f = 0; +#endif + } + } + } + if (((GyorgHeap*)super->myHeap)->boss->unk_6c & 0x80 && --this->unk_70 == 0) { + this->unk_70 = 0x168; + sub_08046634(this, 0); + } + if ((((GyorgHeap*)super->myHeap)->boss->unk_6c & 0x38) == 0) { + super->action = 1; + this->unk_70 = 0x3c; +#ifndef EU + this->unk_78 = 0; +#endif + this->unk_80 = 0; + } +} + +void sub_080463E4(GyorgFemaleEntity* this) { + sub_080465C8(); + if (--this->unk_70 == 0) { + this->unk_70 = 0x168; + sub_08046634(this, 1); + } + sub_080466A8(this); + if (++this->unk_7a > 0x59f) { + this->unk_7a = 0; + this->unk_7c = 0; + this->unk_7d = 0; + this->unk_80 = 0; + } else { + if (this->unk_7a == 0x78) { + sub_08046668(this); + } else { + if (this->unk_7a == 0x528) { + this->unk_78 = 0; +#ifndef EU + this->unk_7d = 0; + this->unk_7f = 0; +#endif + } + } + } + if (super->health == 0) { + super->action = 1; +#ifdef EU + this->unk_78 = 0; +#endif + this->unk_70 = 0x3c; +#ifndef EU + this->unk_78 = 0; +#endif + this->unk_80 = 0; + SoundReq(SFX_BOSS_DIE); + } +} + +#ifndef EU +void sub_08046498(GyorgFemaleEntity* this) { + MemClear(&gUnk_02019EE0, 0x8000); + MemClear(&gMapDataTopSpecial, 0x8000); + sub_080464C0(this); +} +#endif + +void sub_080464C0(GyorgFemaleEntity* this) { + static const void* const gUnk_080D1A74[] = { + gUnk_080D1A94, + gUnk_080D1AAC, + gUnk_080D1AC4, + gUnk_080D1ADC, + }; + s32 i; + u8* src; + u8* dst; + sub_080197D4(gUnk_080D1A74[super->animationState >> 6]); + sub_08046518(); + for (i = 0x20, src = ((u8*)&gUnk_02019EE0), dst = ((u8*)&gUnk_02019EE0) + 0x3260; i != 0; i--) { + MemCopy(src, dst, 0x40); + dst += 0x100; + src += 0x40; + } + MemClear(&gUnk_02019EE0, 0x800); + gUpdateVisibleTiles = 1; +} + +NONMATCH("asm/non_matching/gyorg_female/sub_08046518.inc", void sub_08046518(void)) { + u32 r5; + u16* stack1; + u8* stack2; + u8* r6; + u32 i; + u16* sl; + sl = &gMetatileTypesTop[0xFFFFBCB0]; + stack1 = &gMetatileTypesTop[0xFFFFECB0]; + stack2 = (u8*)&gMetatileTypesTop[0x00006658]; + r6 = (u8*)&gMetatileTypesTop[0xFFFFD658]; + for (i = 0; i < 0x10; i++) { + sl += 0x40; + stack1 += 0x40; + for (r5 = 0; r5 < 0x10; r5++) { + stack1[r5] = sl[r5]; + stack2[r5] = gUnk_080B37A0[gMetatileTypesTop[sl[r5]]]; + r6[r5] = gUnk_080B3E80[gMetatileTypesTop[sl[r5]]]; + } + stack2 = stack2 + 0x40; + r6 = r6 + 0x40; + } +} +END_NONMATCH + +void sub_080465C8(void) { + s32 x, y; + x = (gPlayerEntity.x.HALF.HI - gRoomControls.origin_x) >> 3; + y = (gPlayerEntity.y.HALF.HI - gRoomControls.origin_y) >> 3; + if (gUnk_02019EE0[(y << 7) + x]) { + gPlayerState.field_0x14 = 1; + } +} + +void sub_0804660C(GyorgFemaleEntity* this, u32 unk1) { + static const u16 gUnk_080D1A84[] = { + 0x200, 0x258, 0x1B8, 0x210, 0x200, 0x1C8, 0x248, 0x210, + }; + const u16* p; + super->animationState = unk1; + p = &gUnk_080D1A84[unk1 >> 5]; + super->x.HALF.HI = p[0] + gRoomControls.origin_x; + super->y.HALF.HI = p[1] + gRoomControls.origin_y; +} + +// todo: correct type +const u8 gUnk_080D1A94[] = { +#if defined(JP) || defined(DEMO_JP) + 0x7C, +#elif defined(EU) + 0x50, +#else + 0x08, +#endif + 0x41, 0x22, 0x80, 0xE0, 0x9E, 0x01, 0x02, 0x00, 0x08, 0x00, 0x80, +#if defined(JP) || defined(DEMO_JP) + 0x2C, 0xD3, +#elif defined(EU) + 0x00, 0xD3, +#else + 0xB8, 0xD2, +#endif + 0x22, 0x00, 0x54, 0xB6, 0x00, 0x02, 0x80, 0x1F, 0x00, 0x80, +}; + +const u8 gUnk_080D1AAC[] = { +#if defined(JP) || defined(DEMO_JP) + 0xFC, +#elif defined(EU) + 0xD0, +#else + 0x88, +#endif + 0x3D, 0x22, 0x80, 0xE0, 0x9E, 0x01, 0x02, 0x00, 0x08, 0x00, 0x80, +#if defined(JP) || defined(DEMO_JP) + 0xF8, +#elif defined(EU) + 0xCC, +#else + 0x84, +#endif + 0xD6, 0x22, 0x00, 0x54, 0xB6, 0x00, 0x02, 0x80, 0x1F, 0x00, 0x80, +}; + +const u8 gUnk_080D1AC4[] = { +#if defined(JP) || defined(DEMO_JP) + 0xE4, +#elif defined(EU) + 0xB8, +#else + 0x70, +#endif + 0x36, 0x22, 0x80, 0xE0, 0x9E, 0x01, 0x02, 0x00, 0x08, 0x00, 0x80, +#if defined(JP) || defined(DEMO_JP) + 0xC0, +#elif defined(EU) + 0x94, +#else + 0x4C, +#endif + 0xDA, 0x22, 0x00, 0x54, 0xB6, 0x00, 0x02, 0x80, 0x1F, 0x00, 0x80, +}; + +const u8 gUnk_080D1ADC[] = { +#if defined(JP) || defined(DEMO_JP) + 0x78, +#elif defined(EU) + 0x4C, +#else + 0x04, +#endif + 0x3A, 0x22, 0x80, 0xE0, 0x9E, 0x01, 0x02, 0x00, 0x08, 0x00, 0x80, +#if defined(JP) || defined(DEMO_JP) + 0x88, +#elif defined(EU) + 0x5C, +#else + 0x14, +#endif + 0xDE, 0x22, 0x00, 0x54, 0xB6, 0x00, 0x02, 0x80, 0x1F, 0x00, 0x80, +}; + +void sub_08046634(GyorgFemaleEntity* this, u32 unk1) { + static const u8 gUnk_080D1AF4[] = { 2, 3, 6, 7 }; + u32 tmp; + if (unk1 == 0) { + tmp = gUnk_080D1AF4[Random() & 3]; + } else { + tmp = Random() & 7; + } + sub_080A1ED0(tmp, 0, super->animationState >> 3); +} + +void sub_08046668(GyorgFemaleEntity* this) { + static const u8 gUnk_080D1AF8[] = { 0x16, 0x92, 0x94, 0x86 }; + if (super->health == 0) { + return; + } +#ifndef EU + if (this->unk_78 == 0xFF) { + return; + } +#endif + this->unk_78 = gUnk_080D1AF8[Random() & 3]; + this->unk_7f = 0; + this->unk_82 = 0; + sub_080467DC(this); +} + +void sub_080466A8(GyorgFemaleEntity* this) { + if (this->unk_7c != 0) { + this->unk_7d |= this->unk_7c; + if (super->actionDelay == 0 && this->unk_78 != 0xFF) { +#ifndef EU + super->actionDelay = 4; +#else + super->actionDelay = 3; +#endif + } + if (sub_08000E62(this->unk_7d) > 2) { + super->actionDelay = 0; + this->unk_7d = 0; + this->unk_78 = 0xFF; + SoundReq(SFX_BOSS_HIT); + if (super->health != 0) { + InitScreenShake(8, 0); + if (++this->unk_82 <= 0xC) { + super->health--; + } + if (super->health == 0) { + this->unk_78 = 0; + this->unk_7a = 0x528; + } else { + if (this->unk_7f == 0) { + this->unk_7f = 1; + this->unk_7a = 0x438; + } + } + } + sub_080467DC(this); + } + } + if (super->actionDelay != 0 && this->unk_78 != 0xFF && --super->actionDelay == 0) { + Entity* tmp; + this->unk_80 |= this->unk_7d; + this->unk_7d = 0; + sub_080467DC(this); +#ifndef EU + if (((GyorgHeap*)super->myHeap)->unk_3c != 0xFF) { +#endif + tmp = &gPlayerEntity; + tmp->knockbackDirection = ((GyorgHeap*)super->myHeap)->unk_3c; + tmp->iframes = 0xF4; + tmp->knockbackDuration = 0xA; + tmp = CreateFx(super, 0x2C, 0); + if (tmp) { + tmp->x.HALF.HI = ((GyorgHeap*)super->myHeap)->unk_38; + tmp->y.HALF.HI = ((GyorgHeap*)super->myHeap)->unk_3a; + tmp->collisionLayer = 1; + UpdateSpriteForCollisionLayer(tmp); + } +#ifndef EU + } +#endif + } + this->unk_7c = 0; +} + +void sub_080467DC(GyorgFemaleEntity* this) { + u32 i; + for (i = 0; i < 8; i++) { + (*((GyorgHeap**)(&super->myHeap)))->unk_18[i] = 0; + } +} diff --git a/src/enemy/gyorgFemaleEye.c b/src/enemy/gyorgFemaleEye.c new file mode 100644 index 00000000..af10a307 --- /dev/null +++ b/src/enemy/gyorgFemaleEye.c @@ -0,0 +1,208 @@ +#define NENT_DEPRECATED +#include "global.h" +#include "entity.h" +#include "enemy.h" +#include "player.h" +#include "functions.h" +#include "enemy/gyorg.h" + +void sub_080489B4(GyorgFemaleEyeEntity*); +void sub_080489CC(GyorgFemaleEyeEntity*); + +void sub_08048AF0(GyorgFemaleEyeEntity*); +void sub_08048B2C(GyorgFemaleEyeEntity*); +void sub_08048B84(GyorgFemaleEyeEntity*); +void sub_08048BB0(GyorgFemaleEyeEntity*); +void sub_08048CEC(GyorgFemaleEyeEntity*); + +void sub_08048D20(GyorgFemaleEyeEntity*); +u32 sub_08048D70(GyorgFemaleEntity*); + +void (*const gUnk_080D1F64[])(GyorgFemaleEyeEntity*) = { + sub_080489B4, + sub_080489CC, + (void (*)(GyorgFemaleEyeEntity*))sub_08001324, + (void (*)(GyorgFemaleEyeEntity*))sub_0804A7D4, + (void (*)(GyorgFemaleEyeEntity*))sub_08001242, + sub_080489B4, +}; + +void GyorgFemaleEye(Entity* this) { + if (this->parent->next == NULL) { + DeleteThisEntity(); + } + gUnk_080D1F64[GetNextFunction(this)]((GyorgFemaleEyeEntity*)this); +} + +void sub_080489B4(GyorgFemaleEyeEntity* this) { + static void (*const gUnk_080D1F7C[])(GyorgFemaleEyeEntity*) = { + sub_08048AF0, sub_08048B2C, sub_08048B84, sub_08048BB0, sub_08048CEC, + }; + gUnk_080D1F7C[super->action](this); +} + +typedef struct { + u16 x, y; +} xy; + +const xy gUnk_080D1F90[] = { + { 0x1e8, 0x1d8 }, { 0x1f8, 0x1d8 }, { 0x208, 0x1d8 }, { 0x218, 0x1d8 }, { 0x1e8, 0x1e8 }, { 0x1f8, 0x1e8 }, + { 0x208, 0x1e8 }, { 0x218, 0x1e8 }, { 0x238, 0x1f8 }, { 0x238, 0x208 }, { 0x238, 0x218 }, { 0x238, 0x228 }, + { 0x228, 0x1f8 }, { 0x228, 0x208 }, { 0x228, 0x218 }, { 0x228, 0x228 }, { 0x218, 0x248 }, { 0x208, 0x248 }, + { 0x1f8, 0x248 }, { 0x1e8, 0x248 }, { 0x218, 0x238 }, { 0x208, 0x238 }, { 0x1f8, 0x238 }, { 0x1e8, 0x238 }, + { 0x1c8, 0x228 }, { 0x1c8, 0x218 }, { 0x1c8, 0x208 }, { 0x1c8, 0x1f8 }, { 0x1d8, 0x228 }, { 0x1d8, 0x218 }, + { 0x1d8, 0x208 }, { 0x1d8, 0x1f8 }, +}; + +const u8 gUnk_080D2010[] = { + 0, 0, 1, 1, 0, 0, 1, 1, 4, 4, 5, 5, 4, 4, 5, 5, 9, 9, 8, 8, 9, 9, 8, 8, 13, 13, 12, 12, 13, 13, 12, 12, +}; + +const u8 gUnk_080D2030[] = { + 2, 2, 3, 3, 2, 2, 3, 3, 6, 6, 7, 7, 6, 6, 7, 7, 11, 11, 10, 10, 11, 11, 10, 10, 15, 15, 14, 14, 15, 15, 14, 14, +}; + +void sub_080489CC(GyorgFemaleEyeEntity* this) { + GyorgFemaleEntity* parent; + if (super->health != 0xFF) { + parent = (GyorgFemaleEntity*)super->parent; +#ifndef EU + if ((parent->unk_78 >> super->type) & 1) { +#endif + parent->unk_7c |= (1 << super->type); +#ifndef EU + switch (super->bitfield & 0x7F) { + case 4 ... 6: + case 8 ... 13: + case 16 ... 18: + case 24 ... 26: +#endif + (*(((GyorgHeap**)&parent->base.myHeap)))->unk_18[super->type] = super->field_0x4c; + (*(((GyorgHeap**)&parent->base.myHeap)))->unk_38 = (gPlayerEntity.x.HALF.HI + super->x.HALF.HI) / 2; + (*(((GyorgHeap**)&parent->base.myHeap)))->unk_3a = (gPlayerEntity.y.HALF.HI + super->y.HALF.HI) / 2; + (*(((GyorgHeap**)&parent->base.myHeap)))->unk_3c = (super->knockbackDirection ^= 0x10); +#ifndef EU + break; + default: + ((GyorgHeap*)parent->base.myHeap)->unk_3c = 0xFF; + break; + } + } +#endif + } + super->health = 0xFF; + sub_0804AA30(super, (void (*const*)(Entity*))gUnk_080D1F64); +} + +void sub_08048AF0(GyorgFemaleEyeEntity* this) { + super->action = 1; + super->animationState = 0xFF; + super->spriteOrientation.flipY = 2; + super->spriteRendering.b3 = 2; + super->spritePriority.b0 = 7; + super->collisionLayer = 2; + sub_08048D20(this); +} + +void sub_08048B2C(GyorgFemaleEyeEntity* this) { + GyorgFemaleEntity* parent; + sub_08048D20(this); + parent = (GyorgFemaleEntity*)super->parent; + if (sub_08048D70(parent)) { + if (!super->spriteSettings.draw) { + CreateFx(super, 2, 0x40); + } + super->spriteSettings.draw = 1; + } else { + super->spriteSettings.draw = 0; + } + if ((parent->unk_78 >> super->type) & 1) { + super->action = 2; + } +} + +void sub_08048B84(GyorgFemaleEyeEntity* this) { + GetNextFrame(super); + if (super->frame & 0x80) { + super->action = 3; + super->flags |= 0x80; + super->hitType = 0x1E; + } +} + +void sub_08048BB0(GyorgFemaleEyeEntity* this) { + GyorgFemaleEntity* parent = (GyorgFemaleEntity*)super->parent; + if (!((parent->unk_78 >> super->type) & 1)) { + if (parent->base.health != 0) { + super->action = 4; + super->flags &= ~0x80; + InitializeAnimation(super, gUnk_080D2030[(super->animationState << 3) + super->type]); + } else { + super->action = 1; + super->flags &= ~0x80; + super->spriteSettings.draw = 0; + InitializeAnimation(super, gUnk_080D2010[(super->animationState << 3) + super->type]); + CreateFx(super, 2, 0x40); + } + } else { + if ((parent->unk_80 >> super->type) & 1) { + if (super->animIndex <= 0x13) { + super->iframes = 0xF4; + super->hitType = 0x89; + InitializeAnimation(super, (parent->base.animationState >> 6) + 0x14); + SoundReq(0x119); + } + GetNextFrame(super); + if (super->frame & 0x80) { + super->hitType = 0x1E; + InitializeAnimation(super, gUnk_080D2010[(super->animationState << 3) + super->type]); + UpdateAnimationVariableFrames(super, 7); + parent->unk_80 &= ~(1 << super->type); + } + } else { + if (parent->unk_78 == 0xFF) { + u32 tmp = super->animIndex; + if (tmp < 0x10 || tmp > 0x13) { + InitializeAnimation(super, super->animationState + 0x10); + UpdateAnimationVariableFrames(super, Random() & 0x1C); + } + GetNextFrame(super); + } + } + } +} + +void sub_08048CEC(GyorgFemaleEyeEntity* this) { + GetNextFrame(super); + if (super->frame & 0x80) { + super->action = 1; + InitializeAnimation(super, gUnk_080D2010[(super->animationState << 3) + super->type]); + } +} +void sub_08048D20(GyorgFemaleEyeEntity* this) { + GyorgFemaleEntity* parent = (GyorgFemaleEntity*)super->parent; + const xy* tmp; + u32 tmp2 = (parent->base.animationState >> 6); + if (tmp2 != super->animationState) { + super->animationState = tmp2; + tmp = &gUnk_080D1F90[super->type + (tmp2 << 3)]; + super->x.HALF.HI = tmp->x + gRoomControls.origin_x; + super->y.HALF.HI = tmp->y + gRoomControls.origin_y; + InitializeAnimation(super, gUnk_080D2010[super->type + (tmp2 << 3)]); + } +} + +u32 sub_08048D70(GyorgFemaleEntity* parent) { + GyorgMaleEntity* tmp; + if (parent->base.health != 0) { + return 1; + } + tmp = ((GyorgHeap*)parent->base.myHeap)->male1; + if (!tmp) { + tmp = ((GyorgHeap*)parent->base.myHeap)->male2; + } + if (tmp->base.health != 0) { + return 0; + } + return 1; +} diff --git a/src/enemy/gyorgFemaleMouth.c b/src/enemy/gyorgFemaleMouth.c new file mode 100644 index 00000000..525eb3be --- /dev/null +++ b/src/enemy/gyorgFemaleMouth.c @@ -0,0 +1,66 @@ +#define NENT_DEPRECATED +#include "global.h" +#include "player.h" +#include "room.h" +#include "enemy/gyorg.h" + +extern const Hitbox gUnk_080D28DC; +extern const Hitbox gUnk_080D28E4; +extern const Hitbox gUnk_080D28EC; +extern const Hitbox gUnk_080D28F4; +extern const Hitbox gUnk_080D28FC; +extern const Hitbox gUnk_080D2904; +extern const Hitbox gUnk_080D290C; +extern const Hitbox gUnk_080D2914; + +const Hitbox* const gUnk_080D28AC[] = { + &gUnk_080D28DC, &gUnk_080D28E4, &gUnk_080D28EC, &gUnk_080D28F4, + &gUnk_080D28FC, &gUnk_080D2904, &gUnk_080D290C, &gUnk_080D2914, +}; + +const u16 gUnk_080D28CC[] = { + 0x200, 0x1C8, 0x248, 0x210, 0x200, 0x258, 0x1b8, 0x210, +}; + +const Hitbox gUnk_080D28DC = { 0xE0, 0xF4, { 0, 0, 0, 0 }, 0x8, 0xA }; +const Hitbox gUnk_080D28E4 = { 0x20, 0xF4, { 0, 0, 0, 0 }, 0x8, 0xA }; +const Hitbox gUnk_080D28EC = { 0x0C, 0xE0, { 0, 0, 0, 0 }, 0xA, 0x8 }; +const Hitbox gUnk_080D28F4 = { 0x0C, 0x20, { 0, 0, 0, 0 }, 0xA, 0x8 }; +const Hitbox gUnk_080D28FC = { 0xE0, 0x0C, { 0, 0, 0, 0 }, 0x8, 0xA }; +const Hitbox gUnk_080D2904 = { 0x20, 0x0C, { 0, 0, 0, 0 }, 0x8, 0xA }; +const Hitbox gUnk_080D290C = { 0xF4, 0xE0, { 0, 0, 0, 0 }, 0xA, 0x8 }; +const Hitbox gUnk_080D2914 = { 0xF4, 0x20, { 0, 0, 0, 0 }, 0xA, 0x8 }; + +void GyorgFemaleMouth(Entity* this) { + u32 tmp; + if (this->parent->next == NULL) { + DeleteThisEntity(); + } + if (this->action == 0) { + this->action = 1; + this->spriteOrientation.flipY = 2; + this->spriteRendering.b3 = 2; + this->spritePriority.b0 = 7; + this->collisionLayer = 2; + this->animationState = 0xFF; + } + tmp = this->parent->animationState >> 5; + if (tmp != this->animationState) { + this->animationState = tmp; + this->x.HALF.HI = gUnk_080D28CC[tmp] + gRoomControls.origin_x; + this->y.HALF.HI = gUnk_080D28CC[tmp + 1] + gRoomControls.origin_y; + InitializeAnimation(this, tmp >> 1); + } else { + GetNextFrame(this); + } + if (tmp & 2) { + if (this->y.HALF.HI < gPlayerEntity.y.HALF.HI) { + tmp++; + } + } else { + if (this->x.HALF.HI < gPlayerEntity.x.HALF.HI) { + tmp++; + } + } + this->hitbox = (Hitbox*)gUnk_080D28AC[tmp]; // discarding const qualifier with cast +} diff --git a/src/enemy/gyorgMale.c b/src/enemy/gyorgMale.c index 95df10fe..4763fe56 100644 --- a/src/enemy/gyorgMale.c +++ b/src/enemy/gyorgMale.c @@ -5,391 +5,396 @@ * @brief Gyorg Male enemy */ +#define NENT_DEPRECATED #include "global.h" #include "enemy.h" #include "player.h" #include "fileselect.h" #include "functions.h" +#include "effects.h" +#include "enemy/gyorg.h" -void (*const gUnk_080D1AFC[8])(Entity*); -void (*const gUnk_080D1B1C[7])(Entity*); -void (*const gUnk_080D1B38[5])(Entity*); -void (*const gUnk_080D1B4C[5])(Entity*); +// todo: wrong types +extern void sub_080A1D70(Entity*, u32); + +void (*const gUnk_080D1AFC[8])(GyorgMaleEntity*); +void (*const gUnk_080D1B1C[7])(GyorgMaleEntity*); +void (*const gUnk_080D1B38[5])(GyorgMaleEntity*); +void (*const gUnk_080D1B4C[5])(GyorgMaleEntity*); const u16 gUnk_080D1B60[8]; const s16 gUnk_080D1B70[2]; // or 3? const u16 gUnk_080D1B74[0x10]; -void (*const gUnk_080D1B94[0xA])(Entity*); +void (*const gUnk_080D1B94[0xA])(GyorgMaleEntity*); const u16 gUnk_080D1BBC[2]; -void (*const gUnk_080D1BC0[7])(Entity*); -void (*const gUnk_080D1BDC[5])(Entity*); +void (*const gUnk_080D1BC0[7])(GyorgMaleEntity*); +void (*const gUnk_080D1BDC[5])(GyorgMaleEntity*); const s16 gUnk_080D1BF0[2]; -void (*const gUnk_080D1BF4[3])(Entity*); +void (*const gUnk_080D1BF4[3])(GyorgMaleEntity*); const s8 gUnk_080D1C00[4]; const u16 gUnk_080D1C04[0x20]; const u8 gUnk_080D1C44[0xC]; const u16 gUnk_080D1C50[8]; const u16 gUnk_080D1C60[8]; -void sub_08046898(Entity*); // action 0 -void sub_08046910(Entity*); // action 1 -void sub_08046930(Entity*); // action 1 subAction 0 -void sub_0804696C(Entity*); // action 1 subAction 1 -void sub_080469CC(Entity*); // action 1 subAction 2 -void sub_080469F4(Entity*); // action 1 subAction 3 -void sub_08046A30(Entity*); // action 1 subAction 4 -void sub_08046A54(Entity*); // action 1 subAction 5 -void sub_08046A78(Entity*); // action 1 subAction 6 -void sub_08046A9C(Entity*); // action 2 -void sub_08046AE8(Entity*); // action 2 subAction 0 -void sub_08046B18(Entity*); // action 2 subAction 1 -void sub_08046B8C(Entity*); // action 2 subAction 2 -void sub_08046C04(Entity*); // action 2 subAction 3 -void sub_08046C88(Entity*); // action 2 subAction 4 -void sub_08046CEC(Entity*); // action 3 -void sub_08046D44(Entity*); // action 3 subAction 0 -void sub_08046D98(Entity*); // action 3 subAction 1 -void sub_08046E0C(Entity*); // action 3 subAction 2 -void sub_08046E68(Entity*); // action 3 subAction 3 -void sub_08046EF4(Entity*); // action 3 subAction 4 -void sub_08046F64(Entity*); // action 4 -void sub_08046FE8(Entity*); // action 4 subAction 0 -void sub_0804702C(Entity*); // action 4 subAction 1 -void sub_080470B4(Entity*); // action 4 subAction 2 -void sub_08047140(Entity*); // action 4 subAction 3 -void sub_0804717C(Entity*); // action 4 subAction 4 -void sub_080471C8(Entity*); // action 4 subAction 5 -void sub_0804723C(Entity*); // action 4 subAction 6 -void sub_08047284(Entity*); // action 4 subAction 7 -void sub_080472BC(Entity*); // action 4 subAction 8 -void sub_08047310(Entity*); // action 4 subAction 9 -void sub_0804736C(Entity*); // action 5 -void sub_080473B8(Entity*); // action 5 subAction 0 -void sub_080473F0(Entity*); // action 5 subAction 1 -void sub_08047484(Entity*); // action 5 subAction 2 -void sub_08047508(Entity*); // action 5 subAction 3 -void sub_080475F4(Entity*); // action 5 subAction 4 -void sub_0804763C(Entity*); // action 5 subAction 5 -void sub_0804772C(Entity*); // action 5 subAction 6 -void sub_08047778(Entity*); // action 6 -void sub_08047798(Entity*); // action 6 subAction 0 -void sub_080477F0(Entity*); // action 6 subAction 1 -void sub_08047914(Entity*); // action 6 subAction 2 -void sub_08047978(Entity*); // action 6 subAction 3 -void sub_08047B08(Entity*); // action 6 subAction 4 -void sub_08047B84(Entity*); // action 7 -void sub_08047BA4(Entity*); // action 7 subAction 0 -void sub_08047BF0(Entity*); // action 7 subAction 1, also called elsewhere -void sub_08047D24(Entity*); // action 7 subAction 2 -void sub_08047D88(Entity*); // -void sub_08047DF0(Entity*, u32); -void sub_08047E48(Entity*); // -void sub_08047E58(Entity*); // -void sub_08047EA4(Entity*, u32); -u32 sub_08047F68(Entity*); // distance this to player? -void sub_08048004(Entity*); // -void sub_0804813C(Entity*); // +void sub_08046898(GyorgMaleEntity*); // action 0 +void sub_08046910(GyorgMaleEntity*); // action 1 +void sub_08046930(GyorgMaleEntity*); // action 1 subAction 0 +void sub_0804696C(GyorgMaleEntity*); // action 1 subAction 1 +void sub_080469CC(GyorgMaleEntity*); // action 1 subAction 2 +void sub_080469F4(GyorgMaleEntity*); // action 1 subAction 3 +void sub_08046A30(GyorgMaleEntity*); // action 1 subAction 4 +void sub_08046A54(GyorgMaleEntity*); // action 1 subAction 5 +void sub_08046A78(GyorgMaleEntity*); // action 1 subAction 6 +void sub_08046A9C(GyorgMaleEntity*); // action 2 +void sub_08046AE8(GyorgMaleEntity*); // action 2 subAction 0 +void sub_08046B18(GyorgMaleEntity*); // action 2 subAction 1 +void sub_08046B8C(GyorgMaleEntity*); // action 2 subAction 2 +void sub_08046C04(GyorgMaleEntity*); // action 2 subAction 3 +void sub_08046C88(GyorgMaleEntity*); // action 2 subAction 4 +void sub_08046CEC(GyorgMaleEntity*); // action 3 +void sub_08046D44(GyorgMaleEntity*); // action 3 subAction 0 +void sub_08046D98(GyorgMaleEntity*); // action 3 subAction 1 +void sub_08046E0C(GyorgMaleEntity*); // action 3 subAction 2 +void sub_08046E68(GyorgMaleEntity*); // action 3 subAction 3 +void sub_08046EF4(GyorgMaleEntity*); // action 3 subAction 4 +void sub_08046F64(GyorgMaleEntity*); // action 4 +void sub_08046FE8(GyorgMaleEntity*); // action 4 subAction 0 +void sub_0804702C(GyorgMaleEntity*); // action 4 subAction 1 +void sub_080470B4(GyorgMaleEntity*); // action 4 subAction 2 +void sub_08047140(GyorgMaleEntity*); // action 4 subAction 3 +void sub_0804717C(GyorgMaleEntity*); // action 4 subAction 4 +void sub_080471C8(GyorgMaleEntity*); // action 4 subAction 5 +void sub_0804723C(GyorgMaleEntity*); // action 4 subAction 6 +void sub_08047284(GyorgMaleEntity*); // action 4 subAction 7 +void sub_080472BC(GyorgMaleEntity*); // action 4 subAction 8 +void sub_08047310(GyorgMaleEntity*); // action 4 subAction 9 +void sub_0804736C(GyorgMaleEntity*); // action 5 +void sub_080473B8(GyorgMaleEntity*); // action 5 subAction 0 +void sub_080473F0(GyorgMaleEntity*); // action 5 subAction 1 +void sub_08047484(GyorgMaleEntity*); // action 5 subAction 2 +void sub_08047508(GyorgMaleEntity*); // action 5 subAction 3 +void sub_080475F4(GyorgMaleEntity*); // action 5 subAction 4 +void sub_0804763C(GyorgMaleEntity*); // action 5 subAction 5 +void sub_0804772C(GyorgMaleEntity*); // action 5 subAction 6 +void sub_08047778(GyorgMaleEntity*); // action 6 +void sub_08047798(GyorgMaleEntity*); // action 6 subAction 0 +void sub_080477F0(GyorgMaleEntity*); // action 6 subAction 1 +void sub_08047914(GyorgMaleEntity*); // action 6 subAction 2 +void sub_08047978(GyorgMaleEntity*); // action 6 subAction 3 +void sub_08047B08(GyorgMaleEntity*); // action 6 subAction 4 +void sub_08047B84(GyorgMaleEntity*); // action 7 +void sub_08047BA4(GyorgMaleEntity*); // action 7 subAction 0 +void sub_08047BF0(GyorgMaleEntity*); // action 7 subAction 1, also called elsewhere +void sub_08047D24(GyorgMaleEntity*); // action 7 subAction 2 +void sub_08047D88(GyorgMaleEntity*); // +void sub_08047DF0(GyorgMaleEntity*, u32); +void sub_08047E48(GyorgMaleEntity*); // +void sub_08047E58(GyorgMaleEntity*); // +void sub_08047EA4(GyorgMaleEntity*, u32); +u32 sub_08047F68(GyorgMaleEntity*); // distance this to player? +void sub_08048004(GyorgMaleEntity*); // +void sub_0804813C(GyorgMaleEntity*); // u32 sub_08048158(u32); -void sub_08048178(Entity*, u32); +void sub_08048178(GyorgMaleEntity*, u32); -void (*const gUnk_080D1AFC[8])(Entity*) = { sub_08046898, sub_08046910, sub_08046A9C, sub_08046CEC, - sub_08046F64, sub_0804736C, sub_08047778, sub_08047B84 }; +void (*const gUnk_080D1AFC[8])(GyorgMaleEntity*) = { sub_08046898, sub_08046910, sub_08046A9C, sub_08046CEC, + sub_08046F64, sub_0804736C, sub_08047778, sub_08047B84 }; -void GyorgMale(Entity* this) { - if (this->action) { - this->spriteSettings.draw = this->field_0x7c.BYTES.byte1; +void GyorgMale(GyorgMaleEntity* this) { + if (super->action) { + super->spriteSettings.draw = this->unk_7d; } - gUnk_080D1AFC[this->action](this); - if (this->action != 7) { - sub_0805EC9C(this, 0xaa, 0xaa, this->field_0x78.HWORD); + gUnk_080D1AFC[super->action](this); + if (super->action != 7) { + sub_0805EC9C(this, 0xaa, 0xaa, this->unk_78); } - this->animationState = -(this->field_0x78.HWORD >> 8); + super->animationState = -(this->unk_78 >> 8); sub_08048004(this); - this->field_0x7c.BYTES.byte1 = this->spriteSettings.draw; - if (this->spriteSettings.draw == 1 && (this->y.HALF.HI - gRoomControls.scroll_y + 0x30) > 0x100u) { - this->spriteSettings.draw = 0; + this->unk_7d = super->spriteSettings.draw; + if (super->spriteSettings.draw == 1 && (super->y.HALF.HI - gRoomControls.scroll_y + 0x30) > 0x100u) { + super->spriteSettings.draw = 0; } - this->cutsceneBeh.HWORD = gPlayerEntity.x.HALF.HI; - this->field_0x86.HWORD = gPlayerEntity.y.HALF.HI; + this->unk_84 = gPlayerEntity.x.HALF.HI; + this->unk_86 = gPlayerEntity.y.HALF.HI; } -void sub_08046898(Entity* this) { +void sub_08046898(GyorgMaleEntity* this) { Entity* tmp = CreateProjectile(0x22); u32 tmp2; if (!tmp) return; tmp->type = 1; - tmp->parent = this; - this->child = tmp; - this->action = 1; - this->subAction = 0; - this->spriteRendering.b0 = 3; - this->spriteSettings.draw = 1; - this->spriteOrientation.flipY = 2; - this->spriteRendering.b3 = 2; - this->field_0x3c |= 0x10; - this->collisionLayer = 2; - this->field_0x7c.BYTES.byte0 = 0; - this->field_0x78.HWORD = 0; - this->field_0x7a.HWORD = 0; - this->field_0x70.HALF.HI = 0; - InitAnimationForceUpdate(this, 0); + tmp->parent = super; + super->child = tmp; + super->action = 1; + super->subAction = 0; + super->spriteRendering.b0 = 3; + super->spriteSettings.draw = 1; + super->spriteOrientation.flipY = 2; + super->spriteRendering.b3 = 2; + super->field_0x3c |= 0x10; + super->collisionLayer = 2; + this->unk_7c = 0; + this->unk_78 = 0; + this->unk_7a = 0; + this->unk_72 = 0; + InitAnimationForceUpdate(super, 0); } -void (*const gUnk_080D1B1C[7])(Entity*) = { sub_08046930, sub_0804696C, sub_080469CC, sub_080469F4, - sub_08046A30, sub_08046A54, sub_08046A78 }; +void (*const gUnk_080D1B1C[7])(GyorgMaleEntity*) = { sub_08046930, sub_0804696C, sub_080469CC, sub_080469F4, + sub_08046A30, sub_08046A54, sub_08046A78 }; -void sub_08046910(Entity* this) { - gUnk_080D1B1C[this->subAction](this); - UpdateAnimationSingleFrame(this); +void sub_08046910(GyorgMaleEntity* this) { + gUnk_080D1B1C[super->subAction](this); + UpdateAnimationSingleFrame(super); } -void sub_08046930(Entity* this) { - if (this->type) { - this->subAction = 5; - this->direction = 0x20; +void sub_08046930(GyorgMaleEntity* this) { + if (super->type) { + super->subAction = 5; + super->direction = 0x20; #ifdef EU - this->speed = 0x200; + super->speed = 0x200; #else - this->speed = 0x280; + super->speed = 0x280; #endif } sub_08047D88(this); - if (this->field_0x7c.BYTES.byte0 == 0) + if (this->unk_7c == 0) return; - this->subAction = 1; - this->actionDelay = 1; - this->animationState = 0; - this->direction = 0; + super->subAction = 1; + super->actionDelay = 1; + super->animationState = 0; + super->direction = 0; #ifdef EU - this->speed = 0x200; + super->speed = 0x200; #else - this->speed = 0x280; + super->speed = 0x280; #endif } -void sub_0804696C(Entity* this) { +void sub_0804696C(GyorgMaleEntity* this) { sub_08047E48(this); - if (gRoomControls.origin_y + 0x130 > this->y.HALF.HI) { - this->subAction = 2; - this->direction = 0x80; - this->speed = 0x100; - this->spriteOrientation.flipY = 3; - this->spriteRendering.b3 = 3; + if (gRoomControls.origin_y + 0x130 > super->y.HALF.HI) { + super->subAction = 2; + super->direction = 0x80; + super->speed = 0x100; + super->spriteOrientation.flipY = 3; + super->spriteRendering.b3 = 3; #ifndef EU SoundReq(BGM_BOSS_THEME); #endif } - if (this->actionDelay) { + if (super->actionDelay) { #ifdef EU - if (gRoomControls.origin_y + 0x210 > this->y.HALF.HI) { + if (gRoomControls.origin_y + 0x210 > super->y.HALF.HI) { #else - if (gRoomControls.origin_y + 0x258 > this->y.HALF.HI) { + if (gRoomControls.origin_y + 0x258 > super->y.HALF.HI) { #endif - this->actionDelay = 0; + super->actionDelay = 0; SoundReq(SFX_APPARATE); } } } -void sub_080469CC(Entity* this) { +void sub_080469CC(GyorgMaleEntity* this) { sub_08047E48(this); - if (gRoomControls.origin_y + 0x210 < this->y.HALF.HI) { - this->subAction = 3; - this->direction = 0x90; + if (gRoomControls.origin_y + 0x210 < super->y.HALF.HI) { + super->subAction = 3; + super->direction = 0x90; } } -void sub_080469F4(Entity* this) { +void sub_080469F4(GyorgMaleEntity* this) { sub_08047E48(this); - if (gRoomControls.origin_y + 0x290 < this->y.HALF.HI) { - this->subAction = 4; - this->spriteOrientation.flipY = 2; - this->spriteRendering.b3 = 2; + if (gRoomControls.origin_y + 0x290 < super->y.HALF.HI) { + super->subAction = 4; + super->spriteOrientation.flipY = 2; + super->spriteRendering.b3 = 2; } } -void sub_08046A30(Entity* this) { +void sub_08046A30(GyorgMaleEntity* this) { sub_08047D88(this); - if (((Entity*)this->myHeap)->prev->field_0x6c.HWORD & 1) { - this->action = 2; - this->subAction = 0; + if (((GyorgHeap*)super->myHeap)->boss->unk_6c & 1) { + super->action = 2; + super->subAction = 0; } } -void sub_08046A54(Entity* this) { +void sub_08046A54(GyorgMaleEntity* this) { sub_08047E48(this); - if (gRoomControls.origin_x + 0x380 < this->x.HALF.HI) { - this->subAction = 6; + if (gRoomControls.origin_x + 0x380 < super->x.HALF.HI) { + super->subAction = 6; } } -void sub_08046A78(Entity* this) { +void sub_08046A78(GyorgMaleEntity* this) { sub_08047D88(this); - if (((Entity*)this->myHeap)->prev->field_0x6c.HWORD & 0x10) { - this->action = 3; - this->subAction = 0; + if (((GyorgHeap*)super->myHeap)->boss->unk_6c & 0x10) { + super->action = 3; + super->subAction = 0; } } -void (*const gUnk_080D1B38[5])(Entity*) = { sub_08046AE8, sub_08046B18, sub_08046B8C, sub_08046C04, sub_08046C88 }; +void (*const gUnk_080D1B38[5])(GyorgMaleEntity*) = { sub_08046AE8, sub_08046B18, sub_08046B8C, sub_08046C04, + sub_08046C88 }; -void sub_08046A9C(Entity* this) { - if (this->animIndex == 1) { - if (this->frame == 1) { - InitAnimationForceUpdate(this, 0); +void sub_08046A9C(GyorgMaleEntity* this) { + if (super->animIndex == 1) { + if (super->frame == 1) { + InitAnimationForceUpdate(super, 0); } } - gUnk_080D1B38[this->subAction](this); - UpdateAnimationSingleFrame(this); - if (this->field_0x7c.BYTES.byte0) { - this->action = 6; - this->subAction = 0; + gUnk_080D1B38[super->subAction](this); + UpdateAnimationSingleFrame(super); + if (this->unk_7c) { + super->action = 6; + super->subAction = 0; } } -void sub_08046AE8(Entity* this) { - this->subAction = 1; - this->speed = 0x180; - sub_08048178(this, ((Entity*)this->myHeap)->next->animationState >> 5); - this->field_0x76.HWORD = this->direction << 8; +void sub_08046AE8(GyorgMaleEntity* this) { + super->subAction = 1; + super->speed = 0x180; + sub_08048178(this, ((GyorgHeap*)super->myHeap)->female->base.animationState >> 5); + this->unk_76 = super->direction << 8; sub_08047D88(this); } -void sub_08046B18(Entity* this) { - u32 tmp = sub_080045DA(this->field_0x80.HWORD - this->x.HALF.HI, this->field_0x82.HWORD - this->y.HALF.HI); - if (tmp != this->direction) { - if (((tmp - this->direction) & 0xFF) > 0x80) { - this->field_0x76.HWORD -= 0x100; +void sub_08046B18(GyorgMaleEntity* this) { + u32 tmp = sub_080045DA(this->unk_80 - super->x.HALF.HI, this->unk_82 - super->y.HALF.HI); + if (tmp != super->direction) { + if (((tmp - super->direction) & 0xFF) > 0x80) { + this->unk_76 -= 0x100; } else { - this->field_0x76.HWORD += 0x100; + this->unk_76 += 0x100; } - this->direction = this->field_0x76.HWORD >> 8; + super->direction = this->unk_76 >> 8; } else { - this->subAction = 2; + super->subAction = 2; } sub_08047D88(this); - sub_08047EA4(this, ((0x100 - this->direction) & 0xFF) << 8); + sub_08047EA4(this, ((0x100 - super->direction) & 0xFF) << 8); } -void sub_08046B8C(Entity* this) { - if (sub_0806FCB8(this, this->field_0x80.HWORD, this->field_0x82.HWORD, 4)) { - this->subAction = 3; - this->field_0x76.HWORD = this->direction << 8; - this->field_0x80.HWORD = gRoomControls.origin_x + 0x200; - this->field_0x82.HWORD = gRoomControls.origin_y + 0x210; +void sub_08046B8C(GyorgMaleEntity* this) { + if (sub_0806FCB8(super, this->unk_80, this->unk_82, 4)) { + super->subAction = 3; + this->unk_76 = super->direction << 8; + this->unk_80 = gRoomControls.origin_x + 0x200; + this->unk_82 = gRoomControls.origin_y + 0x210; sub_08047D88(this); } else { - this->direction = - sub_080045DA(this->field_0x80.HWORD - this->x.HALF.HI, this->field_0x82.HWORD - this->y.HALF.HI); - sub_08047DF0(this, ((0x100 - this->direction) & 0xFF) << 8); + super->direction = sub_080045DA(this->unk_80 - super->x.HALF.HI, this->unk_82 - super->y.HALF.HI); + sub_08047DF0(this, ((0x100 - super->direction) & 0xFF) << 8); } } -void sub_08046C04(Entity* this) { - u32 tmp = sub_080045DA(this->field_0x80.HWORD - this->x.HALF.HI, this->field_0x82.HWORD - this->y.HALF.HI); - if (tmp != this->direction) { - if (((tmp - this->direction) & 0xFF) > 0x80) { - this->field_0x76.HWORD -= 0x100; +void sub_08046C04(GyorgMaleEntity* this) { + u32 tmp = sub_080045DA(this->unk_80 - super->x.HALF.HI, this->unk_82 - super->y.HALF.HI); + if (tmp != super->direction) { + if (((tmp - super->direction) & 0xFF) > 0x80) { + this->unk_76 -= 0x100; } else { - this->field_0x76.HWORD += 0x100; + this->unk_76 += 0x100; } - this->direction = this->field_0x76.HWORD >> 8; + super->direction = this->unk_76 >> 8; } else { - this->subAction = 4; - this->field_0x70.HALF.LO = ((tmp + 0x20) & 0xC0) >> 6; + super->subAction = 4; + this->unk_70 = ((tmp + 0x20) & 0xC0) >> 6; } sub_08047D88(this); - sub_08047EA4(this, ((0x100 - this->direction) & 0xFF) << 8); + sub_08047EA4(this, ((0x100 - super->direction) & 0xFF) << 8); } -void sub_08046C88(Entity* this) { - if (sub_0806FCB8(this, this->field_0x80.HWORD, this->field_0x82.HWORD, 4)) { - this->subAction = 1; - sub_08048178(this, sub_08048158(this->field_0x70.HALF_U.LO)); +void sub_08046C88(GyorgMaleEntity* this) { + if (sub_0806FCB8(super, this->unk_80, this->unk_82, 4)) { + super->subAction = 1; + sub_08048178(this, sub_08048158(this->unk_70)); sub_08047D88(this); } else { - this->direction = - sub_080045DA(this->field_0x80.HWORD - this->x.HALF.HI, this->field_0x82.HWORD - this->y.HALF.HI); - sub_08047DF0(this, ((0x100 - this->direction) & 0xFF) << 8); + super->direction = sub_080045DA(this->unk_80 - super->x.HALF.HI, this->unk_82 - super->y.HALF.HI); + sub_08047DF0(this, ((0x100 - super->direction) & 0xFF) << 8); } } -void (*const gUnk_080D1B4C[5])(Entity*) = { sub_08046D44, sub_08046D98, sub_08046E0C, sub_08046E68, sub_08046EF4 }; +void (*const gUnk_080D1B4C[5])(GyorgMaleEntity*) = { sub_08046D44, sub_08046D98, sub_08046E0C, sub_08046E68, + sub_08046EF4 }; -void sub_08046CEC(Entity* this) { - if (this->animIndex == 0) { - if (this->frame == 1) { - InitAnimationForceUpdate(this, 1); +void sub_08046CEC(GyorgMaleEntity* this) { + if (super->animIndex == 0) { + if (super->frame == 1) { + InitAnimationForceUpdate(super, 1); } } - gUnk_080D1B4C[this->subAction](this); - UpdateAnimationSingleFrame(this); - if (((Entity*)this->myHeap)->prev->field_0x6c.HWORD & 2) { - this->action = 2; - this->subAction = 0; - this->animationState = this->speed; + gUnk_080D1B4C[super->subAction](this); + UpdateAnimationSingleFrame(super); + if (((GyorgHeap*)super->myHeap)->boss->unk_6c & 2) { + super->action = 2; + super->subAction = 0; + super->animationState = super->speed; } } const u16 gUnk_080D1B60[8] = { 0x200, 0x184, 0x28C, 0x210, 0x200, 0x29C, 0x174, 0x210 }; -void sub_08046D44(Entity* this) { +void sub_08046D44(GyorgMaleEntity* this) { const u16* tmp; - this->subAction = 1; - this->speed = 0x200; - tmp = gUnk_080D1B60 + (((Entity*)this->myHeap)->next->animationState >> 5); - this->field_0x80.HWORD = tmp[0] + gRoomControls.origin_x; - this->field_0x82.HWORD = tmp[1] + gRoomControls.origin_y; - this->field_0x76.HWORD = this->direction << 8; + super->subAction = 1; + super->speed = 0x200; + tmp = gUnk_080D1B60 + (((Entity*)super->myHeap)->next->animationState >> 5); + this->unk_80 = tmp[0] + gRoomControls.origin_x; + this->unk_82 = tmp[1] + gRoomControls.origin_y; + this->unk_76 = super->direction << 8; sub_08047D88(this); } -void sub_08046D98(Entity* this) { - u32 tmp = sub_080045DA(this->field_0x80.HWORD - this->x.HALF.HI, this->field_0x82.HWORD - this->y.HALF.HI); - if (tmp != this->direction) { - if (((tmp - this->direction) & 0xFF) > 0x80) { - this->field_0x76.HWORD -= 0x100; +void sub_08046D98(GyorgMaleEntity* this) { + u32 tmp = sub_080045DA(this->unk_80 - super->x.HALF.HI, this->unk_82 - super->y.HALF.HI); + if (tmp != super->direction) { + if (((tmp - super->direction) & 0xFF) > 0x80) { + this->unk_76 -= 0x100; } else { - this->field_0x76.HWORD += 0x100; + this->unk_76 += 0x100; } - this->direction = this->field_0x76.HWORD >> 8; + super->direction = this->unk_76 >> 8; } else { - this->subAction = 2; + super->subAction = 2; } sub_08047D88(this); - sub_08047EA4(this, ((0x100 - this->direction) & 0xFF) << 8); + sub_08047EA4(this, ((0x100 - super->direction) & 0xFF) << 8); } -void sub_08046E0C(Entity* this) { - if (sub_0806FCB8(this, this->field_0x80.HWORD, this->field_0x82.HWORD, 4)) { - this->subAction = 3; - this->field_0x76.HWORD = this->direction << 8; +void sub_08046E0C(GyorgMaleEntity* this) { + if (sub_0806FCB8(super, this->unk_80, this->unk_82, 4)) { + super->subAction = 3; + this->unk_76 = super->direction << 8; sub_08047D88(this); } else { - this->direction = - sub_080045DA(this->field_0x80.HWORD - this->x.HALF.HI, this->field_0x82.HWORD - this->y.HALF.HI); - sub_08047DF0(this, ((0x100 - this->direction) & 0xFF) << 8); + super->direction = sub_080045DA(this->unk_80 - super->x.HALF.HI, this->unk_82 - super->y.HALF.HI); + sub_08047DF0(this, ((0x100 - super->direction) & 0xFF) << 8); } } const s16 gUnk_080D1B70[2] = { 0x40, -0x40 }; -void sub_08046E68(Entity* this) { - u32 tmp = ((Entity*)this->myHeap)->next->animationState ^ 0x80; - if (tmp != this->direction) { - if (((tmp - this->direction) & 0xFF) > 0x80) { - this->field_0x76.HWORD -= 0x100; +void sub_08046E68(GyorgMaleEntity* this) { + u32 tmp = ((GyorgHeap*)super->myHeap)->female->base.animationState ^ 0x80; + if (tmp != super->direction) { + if (((tmp - super->direction) & 0xFF) > 0x80) { + this->unk_76 -= 0x100; } else { - this->field_0x76.HWORD += 0x100; + this->unk_76 += 0x100; } - this->direction = this->field_0x76.HWORD >> 8; + super->direction = this->unk_76 >> 8; sub_08047D88(this); - sub_08047EA4(this, ((0x100 - this->direction) & 0xFF) << 8); + sub_08047EA4(this, ((0x100 - super->direction) & 0xFF) << 8); } else { - this->subAction = 4; - this->actionDelay = 0x3F; - this->field_0xf = 1; - this->direction = (gUnk_080D1B70[Random() & 1] + tmp) & 0xC0; + super->subAction = 4; + super->actionDelay = 0x3F; + super->field_0xf = 1; + super->direction = (gUnk_080D1B70[Random() & 1] + tmp) & 0xC0; sub_08047D88(this); } } @@ -397,534 +402,536 @@ void sub_08046E68(Entity* this) { const u16 gUnk_080D1B74[0x10] = { 0x20, 0x40, 0x60, 0x80, 0xA0, 0xC0, 0xE0, 0x100, 0x100, 0xE0, 0xC0, 0xA0, 0x80, 0x60, 0x40, 0x20 }; -void sub_08046EF4(Entity* this) { - if (--this->actionDelay == 0) { - this->actionDelay = 0x7F; - this->direction ^= 0x80; +void sub_08046EF4(GyorgMaleEntity* this) { + if (--super->actionDelay == 0) { + super->actionDelay = 0x7F; + super->direction ^= 0x80; } - this->speed = gUnk_080D1B74[(this->actionDelay >> 3) & 0xF]; - if ((--this->field_0xf & 0xFF) == 0) { + super->speed = gUnk_080D1B74[(super->actionDelay >> 3) & 0xF]; + if ((--super->field_0xf & 0xFF) == 0) { Entity* tmp; - this->field_0xf = (Random() & 0x38) + 0x78; + super->field_0xf = (Random() & 0x38) + 0x78; tmp = CreateProjectile(0x23); if (tmp) { tmp->collisionLayer = 2; - tmp->parent = this; + tmp->parent = super; UpdateSpriteForCollisionLayer(tmp); } } sub_08047E48(this); } -void (*const gUnk_080D1B94[0xA])(Entity*) = { sub_08046FE8, sub_0804702C, sub_080470B4, sub_08047140, sub_0804717C, - sub_080471C8, sub_0804723C, sub_08047284, sub_080472BC, sub_08047310 }; +void (*const gUnk_080D1B94[0xA])(GyorgMaleEntity*) = { sub_08046FE8, sub_0804702C, sub_080470B4, sub_08047140, + sub_0804717C, sub_080471C8, sub_0804723C, sub_08047284, + sub_080472BC, sub_08047310 }; -void sub_08046F64(Entity* this) { - if (this->animIndex == 0) { - if (this->frame == 1) { - InitAnimationForceUpdate(this, 1); +void sub_08046F64(GyorgMaleEntity* this) { + if (super->animIndex == 0) { + if (super->frame == 1) { + InitAnimationForceUpdate(super, 1); } } - gUnk_080D1B94[this->subAction](this); - UpdateAnimationSingleFrame(this); - if (--this->field_0x7c.HALF.HI == 0) { + gUnk_080D1B94[super->subAction](this); + UpdateAnimationSingleFrame(super); + if (--this->unk_7e == 0) { Entity* tmp; - this->field_0x7c.HALF.HI = 0x78; + this->unk_7e = 0x78; tmp = CreateProjectile(0x23); if (tmp) { tmp->collisionLayer = 2; - tmp->parent = this; + tmp->parent = super; UpdateSpriteForCollisionLayer(tmp); } } - if (((Entity*)this->myHeap)->prev->field_0x6c.HWORD & 4) { - this->action = 5; - this->subAction = 0; + if (((GyorgHeap*)super->myHeap)->boss->unk_6c & 4) { + super->action = 5; + super->subAction = 0; } } -void sub_08046FE8(Entity* this) { - this->subAction = 1; - this->speed = 0x1c0; - this->field_0x7c.HALF.HI = 0x1e; - this->field_0x80.HWORD = gRoomControls.origin_x + 0x290; - this->field_0x82.HWORD = gRoomControls.origin_y + 0x190; +void sub_08046FE8(GyorgMaleEntity* this) { + super->subAction = 1; + super->speed = 0x1c0; + this->unk_7e = 0x1e; + this->unk_80 = gRoomControls.origin_x + 0x290; + this->unk_82 = gRoomControls.origin_y + 0x190; sub_08047D88(this); } -void sub_0804702C(Entity* this) { - u32 tmp = sub_080045DA(this->field_0x80.HWORD - this->x.HALF.HI, this->field_0x82.HWORD - this->y.HALF.HI); - if (((this->direction - tmp + 2) & 0xFF) > 4) { - if ((tmp - this->direction) & 0x80) { - this->direction--; +void sub_0804702C(GyorgMaleEntity* this) { + u32 tmp = sub_080045DA(this->unk_80 - super->x.HALF.HI, this->unk_82 - super->y.HALF.HI); + if (((super->direction - tmp + 2) & 0xFF) > 4) { + if ((tmp - super->direction) & 0x80) { + super->direction--; } else { - this->direction++; + super->direction++; } } - sub_08047DF0(this, ((0x100 - this->direction) & 0xFF) << 8); - if (sub_0806FCB8(this, this->field_0x80.HWORD, this->field_0x82.HWORD, (this->speed >> 0x10) + 0x10)) { - this->subAction = 2; - this->field_0x76.HWORD = this->direction << 8; - this->speed = 0x280; + sub_08047DF0(this, ((0x100 - super->direction) & 0xFF) << 8); + if (sub_0806FCB8(super, this->unk_80, this->unk_82, (super->speed >> 0x10) + 0x10)) { + super->subAction = 2; + this->unk_76 = super->direction << 8; + super->speed = 0x280; } } const u16 gUnk_080D1BBC[2] = { 0x1A0, 0xE0 }; -void sub_080470B4(Entity* this) { +void sub_080470B4(GyorgMaleEntity* this) { u32 tmp = 0x40; - if (tmp != this->direction) { - if (((tmp - this->direction) & 0xFF) > 0x80) { - this->field_0x76.HWORD -= 0x100; + if (tmp != super->direction) { + if (((tmp - super->direction) & 0xFF) > 0x80) { + this->unk_76 -= 0x100; } else { - this->field_0x76.HWORD += 0x100; + this->unk_76 += 0x100; } - this->direction = this->field_0x76.HWORD >> 8; + super->direction = this->unk_76 >> 8; sub_08047D88(this); - sub_08047EA4(this, ((0x100 - this->direction) & 0xFF) << 8); + sub_08047EA4(this, ((0x100 - super->direction) & 0xFF) << 8); } else { - this->subAction = 3; - this->speed = 0x200; - this->field_0x76.HWORD = this->direction << 8; - this->field_0x74.HWORD = gUnk_080D1BBC[Random() & 1]; + super->subAction = 3; + super->speed = 0x200; + this->unk_76 = super->direction << 8; + this->unk_74 = gUnk_080D1BBC[Random() & 1]; sub_08047D88(this); } } -void sub_08047140(Entity* this) { - this->field_0x76.HWORD += this->field_0x74.HWORD; - this->direction = this->field_0x76.HWORD >> 8; - if (this->direction > 0xbf) { - this->direction = 0xC0; - this->subAction = 4; +void sub_08047140(GyorgMaleEntity* this) { + this->unk_76 += this->unk_74; + super->direction = this->unk_76 >> 8; + if (super->direction > 0xbf) { + super->direction = 0xC0; + super->subAction = 4; } - sub_08047DF0(this, ((0x100 - this->direction) & 0xFF) << 8); + sub_08047DF0(this, ((0x100 - super->direction) & 0xFF) << 8); } -void sub_0804717C(Entity* this) { - if (this->speed < 0x280) { - this->speed += 8; +void sub_0804717C(GyorgMaleEntity* this) { + if (super->speed < 0x280) { + super->speed += 8; } - sub_08047DF0(this, ((0x100 - this->direction) & 0xFF) << 8); - if (gRoomControls.origin_x + 0x200 > this->x.HALF.HI) { - this->subAction = 5; + sub_08047DF0(this, ((0x100 - super->direction) & 0xFF) << 8); + if (gRoomControls.origin_x + 0x200 > super->x.HALF.HI) { + super->subAction = 5; } } -void sub_080471C8(Entity* this) { - if (this->speed > 0x180) { - this->speed -= 0x10; +void sub_080471C8(GyorgMaleEntity* this) { + if (super->speed > 0x180) { + super->speed -= 0x10; } - if (this->direction < 0xe0) { - this->direction++; + if (super->direction < 0xe0) { + super->direction++; } - sub_08047DF0(this, ((0x100 - this->direction) & 0xFF) << 8); - if (gRoomControls.origin_y + 0x190 <= this->y.HALF.HI) + sub_08047DF0(this, ((0x100 - super->direction) & 0xFF) << 8); + if (gRoomControls.origin_y + 0x190 <= super->y.HALF.HI) return; - if (this->field_0x74.HWORD > 0x100) { + if (this->unk_74 > 0x100) { if (Random() & 1) { - this->subAction = 6; + super->subAction = 6; } else { - this->subAction = 0; + super->subAction = 0; } } else { - this->subAction = 0; + super->subAction = 0; } } -void sub_0804723C(Entity* this) { - this->direction -= 2; - if (this->direction < 0xc0) { - this->subAction = 7; - this->speed = 0x200; - this->direction = 0xc0; - this->field_0x76.HWORD = 0xc000; +void sub_0804723C(GyorgMaleEntity* this) { + super->direction -= 2; + if (super->direction < 0xc0) { + super->subAction = 7; + super->speed = 0x200; + super->direction = 0xc0; + this->unk_76 = 0xc000; } sub_08047D88(this); - sub_08047EA4(this, ((0x100 - this->direction) & 0xFF) << 8); + sub_08047EA4(this, ((0x100 - super->direction) & 0xFF) << 8); } -void sub_08047284(Entity* this) { - this->field_0x76.HWORD -= 0xe0; - this->direction = this->field_0x76.HWORD >> 8; - if (this->direction < 0x40) { - this->direction = 0x40; - this->subAction = 8; +void sub_08047284(GyorgMaleEntity* this) { + this->unk_76 -= 0xe0; + super->direction = this->unk_76 >> 8; + if (super->direction < 0x40) { + super->direction = 0x40; + super->subAction = 8; } - sub_08047DF0(this, ((0x100 - this->direction) & 0xFF) << 8); + sub_08047DF0(this, ((0x100 - super->direction) & 0xFF) << 8); } -void sub_080472BC(Entity* this) { - if (this->speed < 0x300) { - this->speed += 8; +void sub_080472BC(GyorgMaleEntity* this) { + if (super->speed < 0x300) { + super->speed += 8; } - sub_08047DF0(this, ((0x100 - this->direction) & 0xFF) << 8); - if (gRoomControls.origin_x + 0x2B0 >= this->x.HALF.HI) + sub_08047DF0(this, ((0x100 - super->direction) & 0xFF) << 8); + if (gRoomControls.origin_x + 0x2B0 >= super->x.HALF.HI) return; - this->subAction = 9; - this->field_0x76.HWORD = this->direction << 8; + super->subAction = 9; + this->unk_76 = super->direction << 8; } -void sub_08047310(Entity* this) { - if (this->speed < 0x180) { - this->speed -= 0x10; +void sub_08047310(GyorgMaleEntity* this) { + if (super->speed < 0x180) { + super->speed -= 0x10; } - this->field_0x76.HWORD -= 0x1D0; - this->direction = this->field_0x76.HWORD >> 8; - if ((u8)(this->direction + 0x7F) < 0x40) { - this->direction = 0xC0; - this->subAction = 4; + this->unk_76 -= 0x1D0; + super->direction = this->unk_76 >> 8; + if ((u8)(super->direction + 0x7F) < 0x40) { + super->direction = 0xC0; + super->subAction = 4; } - sub_08047DF0(this, ((0x100 - this->direction) & 0xFF) << 8); + sub_08047DF0(this, ((0x100 - super->direction) & 0xFF) << 8); } -void (*const gUnk_080D1BC0[7])(Entity*) = { sub_080473B8, sub_080473F0, sub_08047484, sub_08047508, - sub_080475F4, sub_0804763C, sub_0804772C }; +void (*const gUnk_080D1BC0[7])(GyorgMaleEntity*) = { sub_080473B8, sub_080473F0, sub_08047484, sub_08047508, + sub_080475F4, sub_0804763C, sub_0804772C }; -void sub_0804736C(Entity* this) { - if (this->animIndex == 1) { - if (this->frame == 1) { - InitAnimationForceUpdate(this, 0); +void sub_0804736C(GyorgMaleEntity* this) { + if (super->animIndex == 1) { + if (super->frame == 1) { + InitAnimationForceUpdate(super, 0); } } - gUnk_080D1BC0[this->subAction](this); - UpdateAnimationSingleFrame(this); - if (this->health == 0) { - this->action = 7; - this->subAction = 0; + gUnk_080D1BC0[super->subAction](this); + UpdateAnimationSingleFrame(super); + if (super->health == 0) { + super->action = 7; + super->subAction = 0; } } -void sub_080473B8(Entity* this) { - this->subAction = 1; - this->speed = 0x120; - this->field_0x80.HWORD = gRoomControls.origin_x + 0x200; - this->field_0x82.HWORD = gRoomControls.origin_y + 0x1D0; +void sub_080473B8(GyorgMaleEntity* this) { + super->subAction = 1; + super->speed = 0x120; + this->unk_80 = gRoomControls.origin_x + 0x200; + this->unk_82 = gRoomControls.origin_y + 0x1D0; sub_08047D88(this); } -void sub_080473F0(Entity* this) { - u32 tmp = sub_080045DA(this->field_0x80.HWORD - this->x.HALF.HI, this->field_0x82.HWORD - this->y.HALF.HI); - if (((this->direction - tmp + 2) & 0xFF) > 4) { - s32 tmp2 = tmp - this->direction; +void sub_080473F0(GyorgMaleEntity* this) { + u32 tmp = sub_080045DA(this->unk_80 - super->x.HALF.HI, this->unk_82 - super->y.HALF.HI); + if (((super->direction - tmp + 2) & 0xFF) > 4) { + s32 tmp2 = tmp - super->direction; if (tmp2 & 0x80) { if (tmp2 < -1) { - this->direction -= 2; + super->direction -= 2; } else { - this->direction -= 1; + super->direction -= 1; } } else { if (tmp2 > 1) { - this->direction += 2; + super->direction += 2; } else { - this->direction += 1; + super->direction += 1; } } } - sub_08047DF0(this, ((0x100 - this->direction) & 0xFF) << 8); - if (sub_0806FCB8(this, this->field_0x80.HWORD, this->field_0x82.HWORD, 8)) { - this->subAction = 2; - this->field_0x76.HWORD = this->direction << 8; - this->speed = 0x180; + sub_08047DF0(this, ((0x100 - super->direction) & 0xFF) << 8); + if (sub_0806FCB8(super, this->unk_80, this->unk_82, 8)) { + super->subAction = 2; + this->unk_76 = super->direction << 8; + super->speed = 0x180; } } -void sub_08047484(Entity* this) { +void sub_08047484(GyorgMaleEntity* this) { u32 tmp = 0x40; - if (tmp != this->direction) { - if (((tmp - this->direction) & 0xFF) > 0x80) { - this->field_0x76.HWORD -= 0x100; + if (tmp != super->direction) { + if (((tmp - super->direction) & 0xFF) > 0x80) { + this->unk_76 -= 0x100; } else { - this->field_0x76.HWORD += 0x100; + this->unk_76 += 0x100; } - this->direction = this->field_0x76.HWORD >> 8; + super->direction = this->unk_76 >> 8; sub_08047D88(this); - sub_08047EA4(this, ((0x100 - this->direction) & 0xFF) << 8); + sub_08047EA4(this, ((0x100 - super->direction) & 0xFF) << 8); } else { - this->subAction = 3; - this->speed = 0x200; - this->direction = 0x40; - this->field_0x76.HWORD = 0x4000; - this->field_0x74.HWORD = 0x180; - this->field_0x7c.HALF.HI = 0xF0; + super->subAction = 3; + super->speed = 0x200; + super->direction = 0x40; + this->unk_76 = 0x4000; + this->unk_74 = 0x180; + this->unk_7e = 0xF0; sub_08047D88(this); } } -void sub_08047508(Entity* this) { - if (gRoomControls.origin_x + 0x1A0 < this->x.HALF.HI) { - if (this->direction == 0) { - if (gRoomControls.origin_y + 0x208 >= this->y.HALF.HI) { - this->field_0x74.HWORD = -this->field_0x74.HWORD; - this->field_0x76.HWORD += this->field_0x74.HWORD; - this->direction = this->field_0x76.HWORD >> 8; +void sub_08047508(GyorgMaleEntity* this) { + if (gRoomControls.origin_x + 0x1A0 < super->x.HALF.HI) { + if (super->direction == 0) { + if (gRoomControls.origin_y + 0x208 >= super->y.HALF.HI) { + this->unk_74 = -this->unk_74; + this->unk_76 += this->unk_74; + super->direction = this->unk_76 >> 8; } } else { - s32 tmp = (s16)this->field_0x74.HWORD; + s32 tmp = (s16)this->unk_74; if (tmp < 0) { - this->field_0x76.HWORD += tmp; - this->direction = this->field_0x76.HWORD >> 8; - if (this->direction & 0x80) { - this->direction = 0; - this->field_0x76.HWORD = 0; + this->unk_76 += tmp; + super->direction = this->unk_76 >> 8; + if (super->direction & 0x80) { + super->direction = 0; + this->unk_76 = 0; } } else { - if (this->direction < 0x40) { - this->field_0x76.HWORD += tmp; - this->direction = this->field_0x76.HWORD >> 8; - if (this->direction >= 0x40) { - this->direction = 0x40; + if (super->direction < 0x40) { + this->unk_76 += tmp; + super->direction = this->unk_76 >> 8; + if (super->direction >= 0x40) { + super->direction = 0x40; } } } } } sub_08047E48(this); - if (gRoomControls.origin_x + 0x280 < this->x.HALF.HI) { - this->subAction = 4; - this->speed = 0x200; - this->animationState = this->direction; - this->field_0x76.HWORD = this->direction << 8; + if (gRoomControls.origin_x + 0x280 < super->x.HALF.HI) { + super->subAction = 4; + super->speed = 0x200; + super->animationState = super->direction; + this->unk_76 = super->direction << 8; } - if (--this->field_0x7c.HALF.HI == 0) { + if (--this->unk_7e == 0) { Entity* tmp = CreateEnemy(ENEMY_62, Random() & 3); if (tmp) { - tmp->parent = this; + tmp->parent = super; } } } -void sub_080475F4(Entity* this) { - this->field_0x76.HWORD += 0x180; - this->direction = this->field_0x76.HWORD >> 8; - if (this->direction >= 0xc0) { - this->direction = 0xc0; - this->subAction = 5; - this->speed = 0x200; - this->field_0x7c.HALF.HI = 0x3c; +void sub_080475F4(GyorgMaleEntity* this) { + this->unk_76 += 0x180; + super->direction = this->unk_76 >> 8; + if (super->direction >= 0xc0) { + super->direction = 0xc0; + super->subAction = 5; + super->speed = 0x200; + this->unk_7e = 0x3c; } - sub_08047DF0(this, ((0x100 - this->direction) & 0xFF) << 8); + sub_08047DF0(this, ((0x100 - super->direction) & 0xFF) << 8); } -void sub_0804763C(Entity* this) { - if (gRoomControls.origin_x + 0x1F0 > this->x.HALF.HI) { - if (this->direction == 0) { - if (gRoomControls.origin_y + 0x208 >= this->y.HALF.HI) { - this->field_0x74.HWORD = -this->field_0x74.HWORD; - this->field_0x76.HWORD += this->field_0x74.HWORD; - this->direction = this->field_0x76.HWORD >> 8; +void sub_0804763C(GyorgMaleEntity* this) { + if (gRoomControls.origin_x + 0x1F0 > super->x.HALF.HI) { + if (super->direction == 0) { + if (gRoomControls.origin_y + 0x208 >= super->y.HALF.HI) { + this->unk_74 = -this->unk_74; + this->unk_76 += this->unk_74; + super->direction = this->unk_76 >> 8; } } else { - s32 tmp = (s16)this->field_0x74.HWORD; + s32 tmp = (s16)this->unk_74; if (tmp > 0) { - this->field_0x76.HWORD += tmp; - this->direction = this->field_0x76.HWORD >> 8; - if ((this->direction & 0x80) == 0) { - this->direction = 0; - this->field_0x76.HWORD = 0; + this->unk_76 += tmp; + super->direction = this->unk_76 >> 8; + if ((super->direction & 0x80) == 0) { + super->direction = 0; + this->unk_76 = 0; } } else { - if (this->direction > 0xC0) { - this->field_0x76.HWORD += tmp; - this->direction = this->field_0x76.HWORD >> 8; - if (this->direction <= 0xC0) { - this->direction = 0xC0; + if (super->direction > 0xC0) { + this->unk_76 += tmp; + super->direction = this->unk_76 >> 8; + if (super->direction <= 0xC0) { + super->direction = 0xC0; } } } } } sub_08047E48(this); - if (gRoomControls.origin_x + 0x180 > this->x.HALF.HI) { - this->subAction = 6; - this->speed = 0x200; - this->animationState = this->direction; - this->field_0x76.HWORD = this->direction << 8; + if (gRoomControls.origin_x + 0x180 > super->x.HALF.HI) { + super->subAction = 6; + super->speed = 0x200; + super->animationState = super->direction; + this->unk_76 = super->direction << 8; } - if (--this->field_0x7c.HALF.HI == 0) { + if (--this->unk_7e == 0) { Entity* tmp = CreateEnemy(ENEMY_62, Random() & 3); if (tmp) { - tmp->parent = this; + tmp->parent = super; } } } -void sub_0804772C(Entity* this) { - this->field_0x76.HWORD -= 0x180; - this->direction = this->field_0x76.HWORD >> 8; - if (this->direction <= 0x40) { - this->direction = 0x40; - this->subAction = 3; - this->speed = 0x200; - this->field_0x7c.HALF.HI = 0x1e; +void sub_0804772C(GyorgMaleEntity* this) { + this->unk_76 -= 0x180; + super->direction = this->unk_76 >> 8; + if (super->direction <= 0x40) { + super->direction = 0x40; + super->subAction = 3; + super->speed = 0x200; + this->unk_7e = 0x1e; } - sub_08047DF0(this, ((0x100 - this->direction) & 0xFF) << 8); + sub_08047DF0(this, ((0x100 - super->direction) & 0xFF) << 8); } -void (*const gUnk_080D1BDC[5])(Entity*) = { sub_08047798, sub_080477F0, sub_08047914, sub_08047978, sub_08047B08 }; +void (*const gUnk_080D1BDC[5])(GyorgMaleEntity*) = { sub_08047798, sub_080477F0, sub_08047914, sub_08047978, + sub_08047B08 }; -void sub_08047778(Entity* this) { - gUnk_080D1BDC[this->subAction](this); - UpdateAnimationSingleFrame(this); +void sub_08047778(GyorgMaleEntity* this) { + gUnk_080D1BDC[super->subAction](this); + UpdateAnimationSingleFrame(super); } -void sub_08047798(Entity* this) { - this->subAction = 1; - this->speed = 0x80; - if (this->x.HALF.HI - gRoomControls.origin_x < 0x1F8) { - this->field_0x80.HWORD = 0xa8; +void sub_08047798(GyorgMaleEntity* this) { + super->subAction = 1; + super->speed = 0x80; + if (super->x.HALF.HI - gRoomControls.origin_x < 0x1F8) { + this->unk_80 = 0xa8; } else { - this->field_0x80.HWORD = 0x348; + this->unk_80 = 0x348; } - this->field_0x80.HWORD += gRoomControls.origin_x; - this->field_0x82.HWORD = gRoomControls.origin_y + 0x348; + this->unk_80 += gRoomControls.origin_x; + this->unk_82 = gRoomControls.origin_y + 0x348; sub_08047D88(this); } const s16 gUnk_080D1BF0[2] = { 0x80, -0x80 }; -void sub_080477F0(Entity* this) { - if (this->speed < 0x300) { - this->speed += 8; +void sub_080477F0(GyorgMaleEntity* this) { + if (super->speed < 0x300) { + super->speed += 8; } - this->direction = sub_080045DA(this->field_0x80.HWORD - this->x.HALF.HI, this->field_0x82.HWORD - this->y.HALF.HI); + super->direction = sub_080045DA(this->unk_80 - super->x.HALF.HI, this->unk_82 - super->y.HALF.HI); sub_08047E48(this); - if (!sub_0806FCB8(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x80)) { - this->action = 2; - this->subAction = 0; - this->spriteOrientation.flipY = 2; - this->spriteRendering.b3 = 2; - this->direction = this->animationState; + if (!sub_0806FCB8(super, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x80)) { + super->action = 2; + super->subAction = 0; + super->spriteOrientation.flipY = 2; + super->spriteRendering.b3 = 2; + super->direction = super->animationState; return; } - if (!sub_0806FCB8(this, gRoomControls.origin_x + 0x200, gRoomControls.origin_y + 0x210, 0x100)) { - this->spriteOrientation.flipY = 3; - this->spriteRendering.b3 = 3; + if (!sub_0806FCB8(super, gRoomControls.origin_x + 0x200, gRoomControls.origin_y + 0x210, 0x100)) { + super->spriteOrientation.flipY = 3; + super->spriteRendering.b3 = 3; } - if (sub_0806FCB8(this, this->field_0x80.HWORD, this->field_0x82.HWORD, 4)) { - this->subAction = 2; - this->field_0x76.HWORD = this->animationState << 8; - this->field_0x74.HWORD = gUnk_080D1BF0[Random() & 1]; - if (((Entity*)this->myHeap)->prev->field_0x6c.HWORD & 1) { - ((Entity*)this->myHeap)->next->field_0x78.HALF.HI = - gRoomControls.origin_x + 0x200 > this->x.HALF.HI ? 0x81 : 0x83; + if (sub_0806FCB8(super, this->unk_80, this->unk_82, 4)) { + super->subAction = 2; + this->unk_76 = super->animationState << 8; + this->unk_74 = gUnk_080D1BF0[Random() & 1]; + if (((GyorgHeap*)super->myHeap)->boss->unk_6c & 1) { + ((GyorgHeap*)super->myHeap)->female->unk_79 = + gRoomControls.origin_x + 0x200 > super->x.HALF.HI ? 0x81 : 0x83; } else { - ((Entity*)this->myHeap)->next->field_0x78.HALF.HI = 0x80; + ((GyorgHeap*)super->myHeap)->female->unk_79 = 0x80; } } } -void sub_08047914(Entity* this) { +void sub_08047914(GyorgMaleEntity* this) { sub_08047D88(this); - if (this->animationState & 0x1F) { - this->field_0x76.HWORD += this->field_0x74.HWORD; - this->animationState = this->field_0x76.HWORD >> 8; - sub_08047EA4(this, ((0x100 - this->animationState) & 0xFF) << 8); + if (super->animationState & 0x1F) { + this->unk_76 += this->unk_74; + super->animationState = this->unk_76 >> 8; + sub_08047EA4(this, ((0x100 - super->animationState) & 0xFF) << 8); } else { - this->subAction = 3; - this->field_0x70.HALF.LO = 0x3C; - this->field_0x7c.HALF.HI = ((this->type * 0xF) << 2) + 0x78; - sub_080A1D70(((Entity*)this->myHeap)->prev, this->animationState); + super->subAction = 3; + this->unk_70 = 0x3C; + this->unk_7e = ((super->type * 0xF) << 2) + 0x78; + sub_080A1D70(&(((GyorgHeap*)super->myHeap)->boss->base), super->animationState); } } -void sub_08047978(Entity* this) { +void sub_08047978(GyorgMaleEntity* this) { sub_08047D88(this); - if (this->health != 0) { - if (--this->field_0x70.HALF_U.LO == 0) { - this->field_0x70.HALF.HI = 1; - if (this->type == 0) { - this->field_0x70.HALF.LO = 0xB4; + if (super->health != 0) { + if (--this->unk_70 == 0) { + this->unk_72 = 1; + if (super->type == 0) { + this->unk_70 = 0xB4; } else { - this->field_0x70.HALF.LO = 0x168; + this->unk_70 = 0x168; } } else { - if (this->field_0x70.HALF_U.LO == 0xF0) { + if (this->unk_70 == 0xF0) { sub_0804813C(this); } } } else { - this->field_0x70.HALF.HI = 0; + this->unk_72 = 0; } - if (--this->field_0x7c.HALF.HI == 0) { + if (--this->unk_7e == 0) { Entity* tmp; - this->field_0x7c.HALF.HI = 0xF0; + this->unk_7e = 0xF0; tmp = CreateEnemy(ENEMY_62, Random() & 3); if (tmp) { - tmp->parent = this; + tmp->parent = super; } } - if (!sub_0806FCB8(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x80)) { - this->action = 2; - this->subAction = 0; - this->spriteOrientation.flipY = 2; - this->spriteRendering.b3 = 2; - this->direction = this->animationState; + if (!sub_0806FCB8(super, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x80)) { + super->action = 2; + super->subAction = 0; + super->spriteOrientation.flipY = 2; + super->spriteRendering.b3 = 2; + super->direction = super->animationState; } - if (this->health != 0) + if (super->health != 0) return; - if (this->child->action != 1) + if (super->child->action != 1) return; - this->subAction = 4; - if (this->type == 0) { - if ((((Entity*)this->myHeap)->next->animationState >> 6) == 1) { - this->field_0x80.HWORD = gRoomControls.origin_x + 0x1C0; - this->field_0x82.HWORD = gRoomControls.origin_y + 0x250; + super->subAction = 4; + if (super->type == 0) { + if ((((GyorgHeap*)super->myHeap)->female->base.animationState >> 6) == 1) { + this->unk_80 = gRoomControls.origin_x + 0x1C0; + this->unk_82 = gRoomControls.origin_y + 0x250; } else { - this->field_0x80.HWORD = gRoomControls.origin_x + 0x240; - this->field_0x82.HWORD = gRoomControls.origin_y + 0x250; + this->unk_80 = gRoomControls.origin_x + 0x240; + this->unk_82 = gRoomControls.origin_y + 0x250; } } else { - if (gRoomControls.origin_x + 0x200 < this->x.HALF.HI) { - this->field_0x80.HWORD = 0x190; + if (gRoomControls.origin_x + 0x200 < super->x.HALF.HI) { + this->unk_80 = 0x190; } else { - this->field_0x80.HWORD = 0x270; + this->unk_80 = 0x270; } - this->field_0x80.HWORD += gRoomControls.origin_x; - if (gRoomControls.origin_y + 0x210 < this->y.HALF.HI) { - this->field_0x82.HWORD = 0x1A0; + this->unk_80 += gRoomControls.origin_x; + if (gRoomControls.origin_y + 0x210 < super->y.HALF.HI) { + this->unk_82 = 0x1A0; } else { - this->field_0x82.HWORD = 0x280; + this->unk_82 = 0x280; } - this->field_0x82.HWORD += gRoomControls.origin_y; + this->unk_82 += gRoomControls.origin_y; } } -void sub_08047B08(Entity* this) { +void sub_08047B08(GyorgMaleEntity* this) { sub_08047D88(this); - this->direction = sub_080045DA(this->field_0x80.HWORD - this->x.HALF.HI, this->field_0x82.HWORD - this->y.HALF.HI); - this->speed = 0x200; + super->direction = sub_080045DA(this->unk_80 - super->x.HALF.HI, this->unk_82 - super->y.HALF.HI); + super->speed = 0x200; sub_08047E58(this); - if (!sub_0806FCB8(this, this->field_0x80.HWORD, this->field_0x82.HWORD, 4)) + if (!sub_0806FCB8(super, this->unk_80, this->unk_82, 4)) return; - if (this->type == 0) { - this->action = 7; - this->subAction = 0; - this->direction ^= 0x80; + if (super->type == 0) { + super->action = 7; + super->subAction = 0; + super->direction ^= 0x80; } else { - this->action = 4; - this->subAction = 0; - this->spriteOrientation.flipY = 2; - this->spriteRendering.b3 = 2; - this->direction = this->animationState; + super->action = 4; + super->subAction = 0; + super->spriteOrientation.flipY = 2; + super->spriteRendering.b3 = 2; + super->direction = super->animationState; } } -void (*const gUnk_080D1BF4[3])(Entity*) = { sub_08047BA4, sub_08047BF0, sub_08047D24 }; +void (*const gUnk_080D1BF4[3])(GyorgMaleEntity*) = { sub_08047BA4, sub_08047BF0, sub_08047D24 }; -void sub_08047B84(Entity* this) { - gUnk_080D1BF4[this->subAction](this); - UpdateAnimationSingleFrame(this); +void sub_08047B84(GyorgMaleEntity* this) { + gUnk_080D1BF4[super->subAction](this); + UpdateAnimationSingleFrame(super); } -void sub_08047BA4(Entity* this) { - this->subAction = 1; - this->actionDelay = 0x78; - this->field_0xf = 0; - if (gRoomControls.origin_x + 0x200 < this->x.HALF.HI) { - this->field_0x76.HWORD = 0x78; +void sub_08047BA4(GyorgMaleEntity* this) { + super->subAction = 1; + super->actionDelay = 0x78; + super->field_0xf = 0; + if (gRoomControls.origin_x + 0x200 < super->x.HALF.HI) { + this->unk_76 = 0x78; } else { - this->field_0x76.HWORD = 0x88; + this->unk_76 = 0x88; } SoundReq(SFX_1B5); sub_08047BF0(this); @@ -932,14 +939,14 @@ void sub_08047BA4(Entity* this) { const s8 gUnk_080D1C00[4] = { 0x40, -0x40, -0x40, 0x40 }; -void sub_08047BF0(Entity* this) { +void sub_08047BF0(GyorgMaleEntity* this) { Entity* tmp; - this->direction = gUnk_080D1C00[this->actionDelay & 3]; - this->speed = 0x100; + super->direction = gUnk_080D1C00[super->actionDelay & 3]; + super->speed = 0x100; sub_08047E48(this); - if (this->actionDelay == 0) { - if ((this->field_0xf++ & 0xF) == 0) { - tmp = CreateFx(this, FX_GIANT_EXPLOSION4, 0); + if (super->actionDelay == 0) { + if ((super->field_0xf++ & 0xF) == 0) { + tmp = CreateFx(super, FX_GIANT_EXPLOSION4, 0); if (tmp) { u32 rand = Random(); tmp->x.HALF.HI += (rand & 0x1E) + 0xFFF1; @@ -950,135 +957,135 @@ void sub_08047BF0(Entity* this) { UpdateSpriteForCollisionLayer(tmp); } } - this->direction = this->field_0x76.HWORD; - this->speed = 0x140; + super->direction = this->unk_76; + super->speed = 0x140; sub_08047E48(this); - if (this->y.HALF.HI > gRoomControls.origin_y + 0x270) { - this->subAction = 2; - this->field_0x7c.HALF.HI = 0xAA; + if (super->y.HALF.HI > gRoomControls.origin_y + 0x270) { + super->subAction = 2; + this->unk_7e = 0xAA; SoundReq(SFX_12D); - InitAnimationForceUpdate(this, 1); + InitAnimationForceUpdate(super, 1); } } else { - this->actionDelay--; - if (this->actionDelay == 0x5A) { - tmp = this->child; + super->actionDelay--; + if (super->actionDelay == 0x5A) { + tmp = super->child; tmp->spriteSettings.draw = 0; CreateFx(tmp, FX_GIANT_EXPLOSION4, 0); } else { - if (this->actionDelay == 0x3C) { - tmp = this->child->child; + if (super->actionDelay == 0x3C) { + tmp = super->child->child; tmp->spriteSettings.draw = 0; CreateFx(tmp, FX_GIANT_EXPLOSION4, 0); } else { - if (this->actionDelay == 0x1E) { - tmp = this->child->child->child; + if (super->actionDelay == 0x1E) { + tmp = super->child->child->child; tmp->spriteSettings.draw = 0; CreateFx(tmp, FX_GIANT_EXPLOSION4, 0); } } } } - sub_0805EC9C(this, 0xAA, 0xAA, this->field_0x78.HWORD); + sub_0805EC9C(this, 0xAA, 0xAA, this->unk_78); } -void sub_08047D24(Entity* this) { - this->field_0x7c.HALF_U.HI += 8; - if (this->field_0x7c.HALF_U.HI > 0x800) { - if (this->type == 0) { - ((u32*)this->myHeap)[2] = 0; +void sub_08047D24(GyorgMaleEntity* this) { + this->unk_7e += 8; + if (this->unk_7e > 0x800) { + if (super->type == 0) { + ((u32*)super->myHeap)[2] = 0; } else { - ((u32*)this->myHeap)[3] = 0; + ((u32*)super->myHeap)[3] = 0; } - this->myHeap = NULL; + super->myHeap = NULL; DeleteThisEntity(); } else { - if (this->field_0x7c.HALF_U.HI < 0x200) { + if (this->unk_7e < 0x200) { sub_08047E48(this); } else { sub_08047E58(this); } - sub_0805EC9C(this, this->field_0x7c.HALF_U.HI, this->field_0x7c.HALF_U.HI, this->field_0x78.HWORD); + sub_0805EC9C(this, this->unk_7e, this->unk_7e, this->unk_78); } } -void sub_08047D88(Entity* this) { +void sub_08047D88(GyorgMaleEntity* this) { u32 tmp2; - u32 tmp = this->field_0x7c.BYTES.byte0; + u32 tmp = this->unk_7c; tmp = ((tmp << 1) & 0x7F) | (tmp & 0x80); - this->field_0x7c.BYTES.byte0 = tmp; - tmp2 = this->spriteRendering.b3; + this->unk_7c = tmp; + tmp2 = super->spriteRendering.b3; if (tmp2 == 3 && gPlayerState.field_0x14 != 0) return; - if (this->animIndex == 1) + if (super->animIndex == 1) return; - if (!sub_0806FCB8(this, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x20)) + if (!sub_0806FCB8(super, gPlayerEntity.x.HALF.HI, gPlayerEntity.y.HALF.HI, 0x20)) return; gPlayerState.field_0x14 = 1; if (gPlayerEntity.z.HALF.HI != 0) return; - this->field_0x7c.BYTES.byte0 |= 1; + this->unk_7c |= 1; } -void sub_08047DF0(Entity* this, u32 unk1) { +void sub_08047DF0(GyorgMaleEntity* this, u32 unk1) { u32 oldX, oldY; sub_08047D88(this); sub_08047EA4(this, unk1); - oldX = this->x.HALF.HI; - oldY = this->y.HALF.HI; - sub_0806F62C(this, this->speed, this->direction); - if (this->field_0x7c.BYTES.byte0 & 1) { + oldX = super->x.HALF.HI; + oldY = super->y.HALF.HI; + sub_0806F62C(super, super->speed, super->direction); + if (this->unk_7c & 1) { if (sub_08079F8C()) { - gPlayerEntity.x.HALF.HI += this->x.HALF.HI - oldX; - gPlayerEntity.y.HALF.HI += this->y.HALF.HI - oldY; + gPlayerEntity.x.HALF.HI += super->x.HALF.HI - oldX; + gPlayerEntity.y.HALF.HI += super->y.HALF.HI - oldY; } } } -void sub_08047E48(Entity* this) { +void sub_08047E48(GyorgMaleEntity* this) { sub_08047D88(this); sub_08047E58(this); } -void sub_08047E58(Entity* this) { +void sub_08047E58(GyorgMaleEntity* this) { u32 oldX, oldY; - oldX = this->x.HALF.HI; - oldY = this->y.HALF.HI; - sub_0806F62C(this, this->speed, this->direction); - if (this->field_0x7c.BYTES.byte0 & 1) { + oldX = super->x.HALF.HI; + oldY = super->y.HALF.HI; + sub_0806F62C(super, super->speed, super->direction); + if (this->unk_7c & 1) { if (sub_08079F8C()) { - gPlayerEntity.x.HALF.HI += this->x.HALF.HI - oldX; - gPlayerEntity.y.HALF.HI += this->y.HALF.HI - oldY; + gPlayerEntity.x.HALF.HI += super->x.HALF.HI - oldX; + gPlayerEntity.y.HALF.HI += super->y.HALF.HI - oldY; } } } -void sub_08047EA4(Entity* this, u32 unk1) { +void sub_08047EA4(GyorgMaleEntity* this, u32 unk1) { s32 tmp; u32 tmp2, dir; - this->field_0x78.HWORD = unk1; - tmp = this->field_0x78.HWORD - this->field_0x7a.HWORD; + this->unk_78 = unk1; + tmp = this->unk_78 - this->unk_7a; if (tmp + 0x100 < 0x200u) return; - if (this->field_0x7c.BYTES.byte0 & 1) { + if (this->unk_7c & 1) { tmp2 = sub_08047F68(this) << 8; - dir = sub_080045DA(gPlayerEntity.x.HALF.HI - this->x.HALF.HI, gPlayerEntity.y.HALF.HI - this->y.HALF.HI); + dir = sub_080045DA(gPlayerEntity.x.HALF.HI - super->x.HALF.HI, gPlayerEntity.y.HALF.HI - super->y.HALF.HI); tmp = dir - (tmp / 256); tmp &= 0xFF; gPlayerEntity.x.WORD += (gSineTable[tmp] - gSineTable[dir]) * tmp2; gPlayerEntity.y.WORD -= (gSineTable[tmp + 0x40] - gSineTable[dir + 0x40]) * tmp2; } - this->field_0x7a.HWORD = this->field_0x78.HWORD; + this->unk_7a = this->unk_78; } const u16 gUnk_080D1C04[0x20] = { 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, 100, 121, 144, 169, 196, 225, 256, 289, 324, 361, 400, 441, 484, 529, 576, 625, 676, 729, 784, 841, 900, 961 }; -u32 sub_08047F68(Entity* this) { +u32 sub_08047F68(GyorgMaleEntity* this) { s32 diffX, diffY; s32 distSquared, approx; - diffX = gPlayerEntity.x.HALF.HI - this->x.HALF.HI; - diffY = gPlayerEntity.y.HALF.HI - this->y.HALF.HI; + diffX = gPlayerEntity.x.HALF.HI - super->x.HALF.HI; + diffY = gPlayerEntity.y.HALF.HI - super->y.HALF.HI; distSquared = (diffX * diffX) + (diffY * diffY); if (distSquared == 0x400) return 0x20; @@ -1112,53 +1119,53 @@ u32 sub_08047F68(Entity* this) { return approx; } -void sub_08048004(Entity* this) { - if (this->action == 0) +void sub_08048004(GyorgMaleEntity* this) { + if (super->action == 0) return; - if (this->animIndex == 0) { - COLLISION_OFF(this); + if (super->animIndex == 0) { + COLLISION_OFF(super); if (gPlayerEntity.z.HALF.HI != 0) return; if (!sub_08079F8C()) return; - if (this->field_0x7c.BYTES.byte0 & 1) { - u32 b = this->spriteRendering.b3; + if (this->unk_7c & 1) { + u32 b = super->spriteRendering.b3; if (b == 3) { s32 posX = ((gPlayerEntity.x.HALF.HI - gRoomControls.origin_x) >> 3); s32 posY = ((gPlayerEntity.y.HALF.HI - gRoomControls.origin_y) >> 3); u16* tmp = (u16*)&gUnk_02019EE0; if (tmp[(posY << 7) + posX]) { - if (!(this->field_0x7c.BYTES.byte0 & 2)) { - this->field_0x7c.BYTES.byte0 |= 0x80; + if (!(this->unk_7c & 2)) { + this->unk_7c |= 0x80; } - if ((this->field_0x7c.BYTES.byte0 & 0x80)) + if ((this->unk_7c & 0x80)) return; - gPlayerEntity.x.HALF.HI = this->cutsceneBeh.HWORD; - gPlayerEntity.y.HALF.HI = this->field_0x86.HWORD; + gPlayerEntity.x.HALF.HI = this->unk_84; + gPlayerEntity.y.HALF.HI = this->unk_86; return; } } - this->field_0x7c.BYTES.byte0 &= ~0x80; + this->unk_7c &= ~0x80; } else { - u32 b = this->spriteRendering.b3; + u32 b = super->spriteRendering.b3; if (b != 3) { - if (sub_0806FCB8(&gPlayerEntity, this->x.HALF.HI, this->y.HALF.HI, 0x24)) { - if (!(this->field_0x7c.BYTES.byte0 & 2)) { - u32 tmp = sub_080045DA(gPlayerEntity.x.HALF.HI - this->x.HALF.HI, - gPlayerEntity.y.HALF.HI - this->y.HALF.HI); - gPlayerEntity.x.WORD = this->x.WORD + (gSineTable[tmp] * 9216); - gPlayerEntity.y.WORD = this->y.WORD - (gSineTable[tmp + 0x40] * 9216); + if (sub_0806FCB8(&gPlayerEntity, super->x.HALF.HI, super->y.HALF.HI, 0x24)) { + if (!(this->unk_7c & 2)) { + u32 tmp = sub_080045DA(gPlayerEntity.x.HALF.HI - super->x.HALF.HI, + gPlayerEntity.y.HALF.HI - super->y.HALF.HI); + gPlayerEntity.x.WORD = super->x.WORD + (gSineTable[tmp] * 9216); + gPlayerEntity.y.WORD = super->y.WORD - (gSineTable[tmp + 0x40] * 9216); } } } - this->field_0x7c.BYTES.byte0 = 0; + this->unk_7c = 0; } } else { - COLLISION_ON(this); + COLLISION_ON(super); } } -void sub_0804813C(Entity* this) { +void sub_0804813C(GyorgMaleEntity* this) { u32 rand = Random(); sub_080A1ED0(rand & 7, 1, (rand >> 8) & 3); } @@ -1173,9 +1180,9 @@ const u16 gUnk_080D1C50[8] = { 0x200, 0x180, 0x2C0, 0x210, 0x200, 0x2A0, 0x140, const u16 gUnk_080D1C60[8] = { 0x200, 0x150, 0x290, 0x210, 0x200, 0x2D0, 0x170, 0x210 }; -void sub_08048178(Entity* this, u32 unk1) { - const u16* tmp = - ((((Entity*)this->myHeap)->next->animationState >> 6 & 1) ? gUnk_080D1C60 + unk1 : gUnk_080D1C50 + unk1); - this->field_0x80.HWORD = *tmp + gRoomControls.origin_x; - this->field_0x82.HWORD = *(tmp + 1) + gRoomControls.origin_y; +void sub_08048178(GyorgMaleEntity* this, u32 unk1) { + const u16* tmp = ((((GyorgHeap*)super->myHeap)->female->base.animationState >> 6 & 1) ? gUnk_080D1C60 + unk1 + : gUnk_080D1C50 + unk1); + this->unk_80 = *tmp + gRoomControls.origin_x; + this->unk_82 = *(tmp + 1) + gRoomControls.origin_y; } diff --git a/src/object/gyorgBossObject.c b/src/object/gyorgBossObject.c new file mode 100644 index 00000000..ea0dc245 --- /dev/null +++ b/src/object/gyorgBossObject.c @@ -0,0 +1,443 @@ +#define NENT_DEPRECATED +#include "global.h" +#include "entity.h" +#include "object.h" +#include "area.h" +#include "room.h" +#include "screen.h" +#include "functions.h" +#include "enemy/gyorg.h" + +extern const ScreenTransitionData gUnk_0813ABD0; + +extern u32 sub_08079F8C(void); +extern s16* const gUnk_08124FF0[]; + +extern void sub_080A1DCC(GyorgBossObjectEntity*); +extern void sub_080A1C9C(GyorgBossObjectEntity*); +void sub_080A1E54(GyorgBossObjectEntity*); + +void sub_080A1D8C(GyorgBossObjectEntity*, s32); + +void sub_080A1FF0(GyorgBossObjectEntity*); +u32 sub_080A20B8(GyorgBossObjectEntity*, GyorgMaleEntity*); +void sub_080A1D70(GyorgBossObjectEntity*, u32); + +void sub_080A1704(GyorgBossObjectEntity*); +void sub_080A184C(GyorgBossObjectEntity*); +void sub_080A189C(GyorgBossObjectEntity*); +void sub_080A190C(GyorgBossObjectEntity*); +void sub_080A1990(GyorgBossObjectEntity*); +void sub_080A19FC(GyorgBossObjectEntity*); +void sub_080A1A80(GyorgBossObjectEntity*); +void sub_080A1AE8(GyorgBossObjectEntity*); +void sub_080A1B4C(GyorgBossObjectEntity*); +void sub_080A1C04(GyorgBossObjectEntity*); + +void GyorgBossObject(Entity* this) { + static void (*const gUnk_08124ED0[])(GyorgBossObjectEntity*) = { + sub_080A1704, sub_080A184C, sub_080A189C, sub_080A190C, sub_080A1990, + sub_080A19FC, sub_080A1A80, sub_080A1AE8, sub_080A1B4C, sub_080A1C04, + }; + gUnk_08124ED0[this->action]((GyorgBossObjectEntity*)this); + sub_080A1DCC((GyorgBossObjectEntity*)this); + sub_080A1C9C((GyorgBossObjectEntity*)this); +} + +void sub_080A1704(GyorgBossObjectEntity* this) { + GyorgHeap* heap; + Entity* tmp; + if (CheckFlags(0x7B)) { + DeleteThisEntity(); + } + if (gEntCount > 0x45) + return; + heap = zMalloc(sizeof(GyorgHeap)); + if (!heap) + return; + super->action = 1; + super->myHeap = heap; + this->unk_6e = 0x258; + this->unk_6c = 0; + heap->boss = this; + tmp = CreateEnemy(GYORG_FEMALE, 0); + tmp->myHeap = heap; + heap->female = (GyorgFemaleEntity*)tmp; + tmp = CreateEnemy(GYORG_MALE, 0); + tmp->x.HALF.HI = gRoomControls.origin_x + 0x200; +#ifdef EU + tmp->y.HALF.HI = gRoomControls.origin_y + 0x380; +#else + tmp->y.HALF.HI = gRoomControls.origin_y + 0x330; +#endif + tmp->myHeap = heap; + heap->male1 = (GyorgMaleEntity*)tmp; + tmp = CreateEnemy(GYORG_MALE, 1); + tmp->x.HALF.HI = gRoomControls.origin_x + 0x260; +#ifdef EU + tmp->y.HALF.HI = gRoomControls.origin_y + 0x360; +#else + tmp->y.HALF.HI = gRoomControls.origin_y + 0x310; +#endif + tmp->myHeap = heap; + heap->male2 = (GyorgMaleEntity*)tmp; + gScreen.bg3.control = 0x1E07; + gScreen.lcd.displayControl |= 0x800; + this->unk_70 = 0; + this->unk_72 = 0; + this->unk_74 = 0; + this->unk_7a = 0; + this->unk_76 = 0xc0; + this->unk_78 = 0xc0; + gRoomTransition.field_0x39 = 1; + gPlayerState.flags |= 0x20000; + gPlayerState.startPosX = gRoomControls.origin_x + 0x200; + gPlayerState.startPosY = gRoomControls.origin_y + 0x210; +#ifndef EU + SoundReq(0x80100000); + gArea.bgm = gArea.queued_bgm; +#endif +} + +void sub_080A184C(GyorgBossObjectEntity* this) { + if (--this->unk_6e == 0) { + super->action = 2; + this->unk_6c = 8; + ((GyorgHeap*)super->myHeap)->female->base.health = 8; + } + gPlayerState.startPosX = gRoomControls.origin_x + 0x200; + gPlayerState.startPosY = gRoomControls.origin_y + 0x210; +} + +void sub_080A189C(GyorgBossObjectEntity* this) { + if (((GyorgHeap*)super->myHeap)->female->base.health == 0) { + super->action = 3; + super->actionDelay = 0x23; + this->unk_6c = 1; + this->unk_78 = 0x400; + this->unk_7b = 1; + ((GyorgHeap*)super->myHeap)->male1->base.health = 0xC; + SoundReq(0x128); + InitScreenShake(0x96, 1); + } + gPlayerState.startPosX = gRoomControls.origin_x + 0x200; + gPlayerState.startPosY = gRoomControls.origin_y + 0x210; +} + +void sub_080A190C(GyorgBossObjectEntity* this) { + sub_080A1FF0(this); + if (((GyorgHeap*)super->myHeap)->male1->base.health == 0) { + if (sub_080A20B8(this, ((GyorgHeap*)super->myHeap)->male1)) { + super->action = 4; + this->unk_6c = 0x10; + this->unk_78 = 0xC0; + sub_080A1D70(this, ((GyorgHeap*)super->myHeap)->female->base.animationState); + ((GyorgHeap*)super->myHeap)->female->base.health = 0x18; + } + gPlayerState.startPosX = gRoomControls.origin_x + 0x200; + gPlayerState.startPosY = gRoomControls.origin_y + 0x210; + } else { + gPlayerState.startPosX = ((GyorgHeap*)super->myHeap)->male1->base.x.HALF.HI; + gPlayerState.startPosY = ((GyorgHeap*)super->myHeap)->male1->base.y.HALF.HI; + } +} + +void sub_080A1990(GyorgBossObjectEntity* this) { + if (((GyorgHeap*)super->myHeap)->female->base.health == 0) { + ((GyorgHeap*)super->myHeap)->male1->base.health = 0xC; + super->action = 5; + super->actionDelay = 0x23; + this->unk_6c = 2; + this->unk_78 = 0x400; + this->unk_7b = 1; + SoundReq(0x128); + InitScreenShake(0x96, 1); + } + gPlayerState.startPosX = gRoomControls.origin_x + 0x200; + gPlayerState.startPosY = gRoomControls.origin_y + 0x210; +} + +void sub_080A19FC(GyorgBossObjectEntity* this) { + sub_080A1FF0(this); + if (((GyorgHeap*)super->myHeap)->male2->base.health == 0) { + if (sub_080A20B8(this, ((GyorgHeap*)super->myHeap)->male2)) { + super->action = 6; + this->unk_6c = 0x20; + this->unk_78 = 0xc0; + sub_080A1D70(this, ((GyorgHeap*)super->myHeap)->female->base.animationState); + ((GyorgHeap*)super->myHeap)->female->base.health = 0x18; + } + gPlayerState.startPosX = gRoomControls.origin_x + 0x200; + gPlayerState.startPosY = gRoomControls.origin_y + 0x210; + } else { + gPlayerState.startPosX = ((GyorgHeap*)super->myHeap)->male2->base.x.HALF.HI; + gPlayerState.startPosY = ((GyorgHeap*)super->myHeap)->male2->base.y.HALF.HI; + } +} + +void sub_080A1A80(GyorgBossObjectEntity* this) { + if (((GyorgHeap*)super->myHeap)->female->base.health == 0) { + ((GyorgHeap*)super->myHeap)->male2->base.health = 0xC; + super->action = 7; + super->actionDelay = 0x23; + this->unk_6c = 0x104; + this->unk_78 = 0x400; + SoundReq(SFX_BOSS_DIE); + InitScreenShake(0x96, 1); + } + gPlayerState.startPosX = gRoomControls.origin_x + 0x200; + gPlayerState.startPosY = gRoomControls.origin_y + 0x210; +} + +void sub_080A1AE8(GyorgBossObjectEntity* this) { + sub_080A1FF0(this); + if (((GyorgHeap*)super->myHeap)->male2->base.health == 0) { + if (sub_080A20B8(this, ((GyorgHeap*)super->myHeap)->male2)) { + super->action = 8; + this->unk_6c = 0x40; + this->unk_78 = 0xC0; + ((GyorgHeap*)super->myHeap)->female->base.health = 0xC; + } + } + gPlayerState.startPosX = gRoomControls.origin_x + 0x200; + gPlayerState.startPosY = gRoomControls.origin_y + 0x210; +} + +void sub_080A1B4C(GyorgBossObjectEntity* this) { + if (((GyorgHeap*)super->myHeap)->female->base.health == 0) { + if (this->unk_6c != 0) { + InitScreenShake(0x2d, 1); + SoundReq(SFX_BOSS_DIE); + this->unk_78 = 0x600; + } + this->unk_6c = 0; + gRoomTransition.field_0x39 = 0; + if (sub_08079F8C() && gPlayerEntity.z.HALF.HI == 0) { + super->action = 9; + super->actionDelay = 0; + super->field_0xf = 0xF0; + this->unk_6e = 0x1a4; + super->direction = 0; + super->speed = 0x60; + gPlayerState.flags &= ~0x20000; + CopyPosition(&gPlayerEntity, super); + gRoomControls.camera_target = super; + SetPlayerControl(2); + } + } + gPlayerState.startPosX = gRoomControls.origin_x + 0x200; + gPlayerState.startPosY = gRoomControls.origin_y + 0x210; +} + +void sub_080A1C04(GyorgBossObjectEntity* this) { + if (this->unk_6e == 0) { + LinearMoveUpdate(super); + sub_080A1E54(this); + if (--super->field_0xf == 0) { + SetFlag(0x7B); + sub_0808091C(&gUnk_0813ABD0, 8); + return; + } + if (super->field_0xf == 0x3C) { + SetFade(7, 4); + } + return; + } + if (--this->unk_6e < 0xb4) { + sub_080A1E54(this); + return; + } + switch (this->unk_6e) { + case 0xb4: + SoundReq(SFX_BOSS_DIE); + InitScreenShake(0x2d0, 2); + break; + case 0x12C: + SoundReq(SFX_BOSS_DIE); + InitScreenShake(0x4b, 1); + break; + } +} + +void sub_080A1C9C(GyorgBossObjectEntity* this) { + if (this->unk_7a) { + if (this->unk_74 != this->unk_75) { + this->unk_78 = 0; + sub_080A1D8C(this, 0xC); + if (this->unk_76 == 0) { + this->unk_74 = this->unk_75; + this->unk_78 = this->unk_7c; + } + } else { + sub_080A1D8C(this, 0xC); + if (this->unk_78 == this->unk_76) { + this->unk_7a = 0; + } + } + } else { + sub_080A1D8C(this, 8); + } + this->unk_70 += gSineTable[this->unk_74] * this->unk_76 / 0x100; + this->unk_72 -= gSineTable[this->unk_74 + 0x40] * this->unk_76 / 0x100; + gScreen.bg3.xOffset = this->unk_70 >> 0x8; + gScreen.bg3.yOffset = this->unk_72 >> 0x8; +} + +void sub_080A1D70(GyorgBossObjectEntity* this, u32 unk1) { + this->unk_75 = unk1; + this->unk_7a = 1; + this->unk_7c = this->unk_78; +} + +void sub_080A1D8C(GyorgBossObjectEntity* this, s32 unk1) { + if (this->unk_78 != this->unk_76) { + if (this->unk_78 > this->unk_76) { + if (unk1 < this->unk_78 - this->unk_76) { + this->unk_76 += unk1; + } else { + this->unk_76 = this->unk_78; + } + } else { + if (unk1 < this->unk_76 - this->unk_78) { + this->unk_76 -= unk1; + } else { + this->unk_76 = this->unk_78; + } + } + } +} + +void sub_080A1DCC(GyorgBossObjectEntity* this) { + GenericEntity* tmp; + if ((tmp = (GenericEntity*)((GyorgHeap*)super->myHeap)->male1) != NULL || + (tmp = (GenericEntity*)((GyorgHeap*)super->myHeap)->male2) != NULL) { + if (tmp->field_0x7c.BYTES.byte0 && tmp->base.spriteRendering.b3 == 2) { + ((GyorgHeap*)super->myHeap)->unk_10->base.flags &= ~0x80; + tmp = ((GyorgHeap*)super->myHeap)->unk_14; + tmp->base.flags &= ~0x80; + tmp = (GenericEntity*)tmp->base.child; + tmp->base.flags &= ~0x80; + tmp = (GenericEntity*)tmp->base.child; + tmp->base.flags &= ~0x80; + tmp = (GenericEntity*)tmp->base.child; + tmp->base.flags &= ~0x80; + return; + } + } + ((GyorgHeap*)super->myHeap)->unk_10->base.flags |= 0x80; + tmp = ((GyorgHeap*)super->myHeap)->unk_14; + tmp->base.flags |= 0x80; + tmp = (GenericEntity*)tmp->base.child; + tmp->base.flags |= 0x80; + tmp = (GenericEntity*)tmp->base.child; + tmp->base.flags |= 0x80; + tmp = (GenericEntity*)tmp->base.child; + tmp->base.flags |= 0x80; +} + +void sub_080A1E54(GyorgBossObjectEntity* this) { + Entity* fx; + if ((++super->actionDelay & 0x1F) == 0) { + fx = CreateFx(super, 0x51, 0); + if (fx) { + u32 r = Random(); + fx->x.HALF.HI = gRoomControls.origin_x + 0x200 + (r & 0xf0) - 0x78; + fx->y.HALF.HI = gRoomControls.origin_y + 0x210 + ((r >> 8) & 0x70) - 0x38; + fx->spritePriority.b0 = 5; + fx->collisionLayer = 2; + UpdateSpriteForCollisionLayer(fx); + } + } +} + +void sub_080A1ED0(u32 unk0, u32 unk1, u32 unk2) { + static const u16 gUnk_08124EF8[] = { 0x200, 0x1C0, 0x250, 0x210, 0x200, 0x260, 0x1B0, 0x210 }; + u32 i = 0; + s16* p; + u32 x, y; + x = gUnk_08124EF8[unk2 * 2] + gRoomControls.origin_x; + y = gUnk_08124EF8[unk2 * 2 + 1] + gRoomControls.origin_y; + p = gUnk_08124FF0[unk0]; + while (*p != 1) { + GyorgChildEntity* tmp = (GyorgChildEntity*)CreateEnemy(GYORG_CHILD, unk1); + if (tmp) { + tmp->base.type2 = i++; + tmp->base.x.HALF.HI = x; + tmp->base.y.HALF.HI = y; + tmp->base.direction = DirectionFromAnimationState(unk2); + tmp->unk_7a = DirectionTurnAround(DirectionFromAnimationState(unk2)); + tmp->unk_78 = p[2]; + switch (unk2) { + case 0: + tmp->unk_74 = p[0]; + tmp->unk_76 = -p[1]; + break; + case 1: + tmp->unk_74 = p[1] + 0xF0; + tmp->unk_76 = p[0]; + break; + case 2: + tmp->unk_74 = p[0]; + tmp->unk_76 = p[1] + 0xA0; + break; + case 3: + tmp->unk_74 = -p[1]; + tmp->unk_76 = p[0]; + break; + } + } + p += 3; + } + if (unk1 == 0) { + Entity* tmp; + tmp = CreateObject(SPECIAL_FX, 2, 0); + if (tmp) { + tmp->x.HALF.HI = x; + tmp->y.HALF.HI = y; + tmp->spriteOrientation.flipY = 3; + tmp->spriteRendering.b3 = 3; + tmp->collisionLayer = 1; + } + } +} + +void sub_080A1FF0(GyorgBossObjectEntity* this) { + if (super->actionDelay != 0) { + super->actionDelay--; + if (super->actionDelay <= 0x20 && (super->actionDelay & 0xF) == 0) { + Entity* fx; + fx = CreateFx(super, 0x51, 0); + if (fx) { + u32 r = Random(); + fx->x.HALF.HI = gRoomControls.origin_x + 0x200 + (r & 0x78) - 0x3C; + fx->y.HALF.HI = gRoomControls.origin_y + 0x210 + (r & 0x78) - 0x3C; + fx->spritePriority.b0 = 6; + fx->collisionLayer = 1; + UpdateSpriteForCollisionLayer(fx); + } + } + } + if (this->unk_7b) { + if (sub_0806FCB8(&gPlayerEntity, gRoomControls.origin_x + 0x200, gRoomControls.origin_y + 0x210, 0x100)) { + if (super->actionDelay == 0) { + super->actionDelay = 0x78; + } else { + if (super->actionDelay == 0x23) { + InitScreenShake(0x1e, 0); + } + } + } else { + this->unk_7b = 0; + } + } +} + +u32 sub_080A20B8(GyorgBossObjectEntity* this, GyorgMaleEntity* other) { + if (other == NULL) { + return 1; + } + if (sub_08079F8C() && gPlayerEntity.z.HALF.HI == 0) { + return other->unk_7c == 0 && gPlayerState.field_0x14 != 0; + } + return 0; +} diff --git a/src/object/objectAF.c b/src/object/objectAF.c index 0aff1ed3..f34ff4f2 100644 --- a/src/object/objectAF.c +++ b/src/object/objectAF.c @@ -47,7 +47,7 @@ void sub_080A0624(Entity* this) { void sub_080A0640(Entity* this) { if (this->type == 0) { - PositionRelative(*(Entity**)(this->parent->myHeap + 0x4), this, 0, 0x80000); + PositionRelative(*(((Entity**)this->parent->myHeap) + 4), this, 0, 0x80000); } else { CopyPosition(this->parent, this); } diff --git a/src/projectile/v3TennisBallProjectile.c b/src/projectile/v3TennisBallProjectile.c index 5d7438c0..00fc5da7 100644 --- a/src/projectile/v3TennisBallProjectile.c +++ b/src/projectile/v3TennisBallProjectile.c @@ -77,25 +77,25 @@ void V3TennisBallProjectile_Action2(Entity* this) { bool32 sub_080ACB40(Entity* this) { Entity* r1_grandparent = this->parent->parent; Entity* child = this->child; - Entity* tmp = ((Entity*)(r1_grandparent->myHeap[7]))->child; + Entity* tmp = ((Entity**)(r1_grandparent->myHeap))[7]->child; if (tmp != this && child == tmp->child) { return 0; } - tmp = ((Entity*)(r1_grandparent->myHeap[8]))->child; + tmp = ((Entity**)(r1_grandparent->myHeap))[8]->child; if (tmp != this && child == tmp->child) { return 0; } - tmp = ((Entity*)(r1_grandparent->myHeap[9]))->child; + tmp = ((Entity**)(r1_grandparent->myHeap))[9]->child; if (tmp != this && child == tmp->child) { return 0; } - tmp = ((Entity*)(r1_grandparent->myHeap[10]))->child; + tmp = ((Entity**)(r1_grandparent->myHeap))[10]->child; if (tmp != this && child == tmp->child) { return 0; diff --git a/src/scroll.c b/src/scroll.c index 26a6c6c1..cdae49f4 100644 --- a/src/scroll.c +++ b/src/scroll.c @@ -30,7 +30,7 @@ void sub_08080910(void) { gRoomTransition.type = TRANSITION_CUT; } -void sub_0808091C(ScreenTransitionData* param_1, u32 param_2) { +void sub_0808091C(const ScreenTransitionData* param_1, u32 param_2) { DoExitTransition(param_1); gRoomTransition.type = param_2; }