diff --git a/asm/intro.s b/asm/intro.s index 2f9a9ed..c475ab8 100644 --- a/asm/intro.s +++ b/asm/intro.s @@ -4,2066 +4,6 @@ .text - thumb_func_start sub_978C -sub_978C: @ 0x0800978C - push {r4, r5, r6, lr} - bl sub_9CB8 - ldr r1, _080097C0 @ =gUnknown_0201A450 - ldrh r2, [r1, #8] - movs r3, #8 - ldrsh r0, [r1, r3] - cmp r0, #0x24 - bne _080097CC - ldrh r0, [r1, #0xa] - adds r0, #1 - movs r2, #0 - strh r0, [r1, #0xa] - lsls r0, r0, #0x10 - asrs r0, r0, #0x10 - cmp r0, #0x1b - ble _0800981A - strh r2, [r1, #0xa] - ldr r0, _080097C4 @ =gUnknown_0202A578 - strh r2, [r0] - ldr r1, _080097C8 @ =gUnknown_0202C790 - ldrb r0, [r1] - adds r0, #1 - strb r0, [r1] - b _0800981A - .align 2, 0 -_080097C0: .4byte gUnknown_0201A450 -_080097C4: .4byte gUnknown_0202A578 -_080097C8: .4byte gUnknown_0202C790 -_080097CC: - ldrh r0, [r1, #0xa] - adds r0, #1 - strh r0, [r1, #0xa] - lsls r0, r0, #0x10 - asrs r0, r0, #0x10 - cmp r0, #1 - ble _080097E2 - movs r0, #0 - strh r0, [r1, #0xa] - adds r0, r2, #1 - strh r0, [r1, #8] -_080097E2: - ldr r3, _08009820 @ =gUnknown_0202BF10 - ldr r5, _08009824 @ =gUnknown_086A77A8 - ldr r4, _08009828 @ =gUnknown_0202A578 - movs r6, #0 - ldrsh r2, [r4, r6] - lsls r2, r2, #2 - ldr r0, _0800982C @ =gUnknown_0202C5A8 - movs r1, #0 - ldrsb r1, [r0, r1] - lsls r0, r1, #2 - adds r0, r0, r1 - lsls r0, r0, #3 - adds r2, r2, r0 - adds r0, r5, #2 - adds r0, r2, r0 - movs r6, #0 - ldrsh r1, [r3, r6] - movs r3, #0 - ldrsh r0, [r0, r3] - cmp r1, r0 - blt _0800981A - adds r0, r2, r5 - ldrh r0, [r0] - bl m4aSongNumStart - ldrh r0, [r4] - adds r0, #1 - strh r0, [r4] -_0800981A: - pop {r4, r5, r6} - pop {r0} - bx r0 - .align 2, 0 -_08009820: .4byte gUnknown_0202BF10 -_08009824: .4byte gUnknown_086A77A8 -_08009828: .4byte gUnknown_0202A578 -_0800982C: .4byte gUnknown_0202C5A8 - - thumb_func_start sub_9830 -sub_9830: @ 0x08009830 - push {lr} - ldr r0, _08009868 @ =gUnknown_02019C30 - ldr r2, [r0] - subs r2, #0x10 - str r2, [r0] - ldr r1, _0800986C @ =gUnknown_0201C188 - ldr r0, [r1] - subs r0, #0x10 - str r0, [r1] - ldr r1, _08009870 @ =gUnknown_0201A450 - ldrh r0, [r1] - subs r0, #1 - strh r0, [r1] - cmp r2, #0x1f - bgt _0800985E - movs r0, #0 - strh r0, [r1, #0xa] - movs r0, #0x25 - strh r0, [r1, #8] - ldr r1, _08009874 @ =gUnknown_0202C790 - ldrb r0, [r1] - adds r0, #1 - strb r0, [r1] -_0800985E: - bl sub_9D70 - pop {r0} - bx r0 - .align 2, 0 -_08009868: .4byte gUnknown_02019C30 -_0800986C: .4byte gUnknown_0201C188 -_08009870: .4byte gUnknown_0201A450 -_08009874: .4byte gUnknown_0202C790 - - thumb_func_start sub_9878 -sub_9878: @ 0x08009878 - push {lr} - ldr r1, _080098AC @ =gUnknown_0201A450 - ldrh r0, [r1, #0xa] - adds r0, #1 - strh r0, [r1, #0xa] - lsls r0, r0, #0x10 - asrs r0, r0, #0x10 - cmp r0, #3 - ble _080098A8 - movs r0, #0 - strh r0, [r1, #0xa] - movs r0, #0x78 - strh r0, [r1] - movs r0, #0x58 - strh r0, [r1, #2] - movs r0, #1 - strb r0, [r1, #0xc] - movs r0, #0xd8 - bl m4aSongNumStart - ldr r1, _080098B0 @ =gUnknown_0202C790 - ldrb r0, [r1] - adds r0, #1 - strb r0, [r1] -_080098A8: - pop {r0} - bx r0 - .align 2, 0 -_080098AC: .4byte gUnknown_0201A450 -_080098B0: .4byte gUnknown_0202C790 - - thumb_func_start sub_98B4 -sub_98B4: @ 0x080098B4 - push {lr} - ldr r1, _080098F0 @ =gUnknown_0201A450 - ldrh r2, [r1, #8] - movs r3, #8 - ldrsh r0, [r1, r3] - cmp r0, #0x2b - bne _08009900 - ldrh r0, [r1, #0xa] - adds r0, #1 - strh r0, [r1, #0xa] - lsls r0, r0, #0x10 - asrs r0, r0, #0x10 - cmp r0, #1 - ble _08009916 - movs r0, #0 - strb r0, [r1, #0xc] - ldr r0, _080098F4 @ =gIntroScene1Sprites_Pals+0x1C0 - ldr r1, _080098F8 @ =0x050000E0 - movs r2, #0x20 - movs r3, #0 - bl sub_10170 - movs r0, #8 - bl m4aSongNumStart - ldr r1, _080098FC @ =gUnknown_0202C790 - ldrb r0, [r1] - adds r0, #1 - strb r0, [r1] - b _08009916 - .align 2, 0 -_080098F0: .4byte gUnknown_0201A450 -_080098F4: .4byte gIntroScene1Sprites_Pals+0x1C0 -_080098F8: .4byte 0x050000E0 -_080098FC: .4byte gUnknown_0202C790 -_08009900: - ldrh r0, [r1, #0xa] - adds r0, #1 - strh r0, [r1, #0xa] - lsls r0, r0, #0x10 - asrs r0, r0, #0x10 - cmp r0, #1 - ble _08009916 - movs r0, #0 - strh r0, [r1, #0xa] - adds r0, r2, #1 - strh r0, [r1, #8] -_08009916: - bl sub_9CB8 - pop {r0} - bx r0 - - thumb_func_start sub_9920 -sub_9920: @ 0x08009920 - push {lr} - ldr r0, _08009954 @ =gUnknown_0202BF10 - movs r1, #0 - ldrsh r0, [r0, r1] - movs r1, #3 - bl __modsi3 - lsls r0, r0, #0x10 - cmp r0, #0 - bne _08009982 - ldr r1, _08009958 @ =gUnknown_0202C594 - ldrh r2, [r1] - movs r3, #0 - ldrsh r0, [r1, r3] - cmp r0, #7 - bgt _08009964 - adds r0, r2, #1 - strh r0, [r1] - ldr r1, _0800995C @ =gUnknown_0201C1B8 - ldrb r0, [r1] - adds r0, #1 - strb r0, [r1] - ldr r1, _08009960 @ =gUnknown_0202ADD4 - ldrb r0, [r1] - subs r0, #1 - b _08009976 - .align 2, 0 -_08009954: .4byte gUnknown_0202BF10 -_08009958: .4byte gUnknown_0202C594 -_0800995C: .4byte gUnknown_0201C1B8 -_08009960: .4byte gUnknown_0202ADD4 -_08009964: - ldr r0, _0800998C @ =gUnknown_0201C1C0 - ldr r1, _08009990 @ =0x060036E0 - movs r2, #8 - movs r3, #8 - bl sub_10708 - ldr r1, _08009994 @ =gUnknown_0202C790 - ldrb r0, [r1] - adds r0, #1 -_08009976: - strb r0, [r1] - ldr r2, _08009998 @ =gUnknown_0201A450 - ldrh r1, [r2, #0x18] - movs r0, #1 - subs r0, r0, r1 - strh r0, [r2, #0x18] -_08009982: - bl sub_9E90 - pop {r0} - bx r0 - .align 2, 0 -_0800998C: .4byte gUnknown_0201C1C0 -_08009990: .4byte 0x060036E0 -_08009994: .4byte gUnknown_0202C790 -_08009998: .4byte gUnknown_0201A450 - - thumb_func_start sub_999C -sub_999C: @ 0x0800999C - push {r4, r5, lr} - ldr r5, _08009A84 @ =gUnknown_0202BEF0 - ldr r0, [r5] - cmp r0, #0 - ble _080099D0 - subs r0, #2 - str r0, [r5] - cmp r0, #0 - bgt _080099B2 - movs r0, #0 - str r0, [r5] -_080099B2: - ldr r4, _08009A88 @ =gIntroScene1Sprites_Pals - movs r1, #0xa0 - lsls r1, r1, #0x13 - movs r2, #0x80 - lsls r2, r2, #2 - ldrh r3, [r5] - adds r0, r4, #0 - bl sub_10170 - ldr r1, _08009A8C @ =0x05000200 - ldrh r3, [r5] - adds r0, r4, #0 - movs r2, #0x20 - bl sub_10170 -_080099D0: - ldr r5, _08009A90 @ =gUnknown_0202BF10 - movs r1, #0 - ldrsh r0, [r5, r1] - movs r1, #3 - bl __modsi3 - lsls r0, r0, #0x10 - cmp r0, #0 - bne _080099EC - ldr r2, _08009A94 @ =gUnknown_0201A450 - ldrh r1, [r2, #0x18] - movs r0, #1 - subs r0, r0, r1 - strh r0, [r2, #0x18] -_080099EC: - ldr r4, _08009A98 @ =gUnknown_0202ADA0 - ldrh r0, [r4] - subs r0, #1 - strh r0, [r4] - ldrh r0, [r5] - movs r5, #1 - ands r0, r5 - cmp r0, #0 - bne _08009A04 - ldrh r0, [r4, #2] - subs r0, #1 - strh r0, [r4, #2] -_08009A04: - ldr r1, _08009A9C @ =gMain - ldrh r2, [r4] - movs r3, #0xba - lsls r3, r3, #2 - adds r0, r1, r3 - strh r2, [r0] - ldrh r0, [r4, #2] - ldr r2, _08009AA0 @ =0x000002EA - adds r1, r1, r2 - strh r0, [r1] - ldrh r0, [r4, #0xa] - adds r0, #1 - strh r0, [r4, #0xa] - ldr r2, _08009AA4 @ =gUnknown_086A7768 - movs r1, #8 - ldrsh r3, [r4, r1] - lsls r1, r3, #2 - adds r1, r1, r2 - lsls r0, r0, #0x10 - asrs r0, r0, #0x10 - movs r2, #2 - ldrsh r1, [r1, r2] - cmp r0, r1 - ble _08009A78 - ldr r1, _08009AA8 @ =gUnknown_086A7788 - lsls r0, r3, #1 - adds r0, r0, r1 - movs r3, #0 - ldrsh r0, [r0, r3] - lsls r0, r0, #1 - ldr r1, _08009AAC @ =gUnknown_0201C1C0 - adds r0, r0, r1 - ldr r1, _08009AB0 @ =0x060036E0 - movs r2, #8 - movs r3, #8 - bl sub_10708 - ldrh r0, [r4, #8] - adds r0, #1 - strh r0, [r4, #8] - lsls r0, r0, #0x10 - asrs r0, r0, #0x10 - cmp r0, #3 - ble _08009A78 - ldr r1, _08009A94 @ =gUnknown_0201A450 - adds r0, r1, #0 - adds r0, #0x3c - strb r5, [r0] - subs r0, #0x10 - strb r5, [r0] - movs r0, #0 - strb r0, [r1, #0x1c] - movs r0, #0 - strh r0, [r4, #0x14] - ldr r1, _08009AB4 @ =gUnknown_0202C790 - ldrb r0, [r1] - adds r0, #1 - strb r0, [r1] -_08009A78: - bl sub_9E90 - pop {r4, r5} - pop {r0} - bx r0 - .align 2, 0 -_08009A84: .4byte gUnknown_0202BEF0 -_08009A88: .4byte gIntroScene1Sprites_Pals -_08009A8C: .4byte 0x05000200 -_08009A90: .4byte gUnknown_0202BF10 -_08009A94: .4byte gUnknown_0201A450 -_08009A98: .4byte gUnknown_0202ADA0 -_08009A9C: .4byte gMain -_08009AA0: .4byte 0x000002EA -_08009AA4: .4byte gUnknown_086A7768 -_08009AA8: .4byte gUnknown_086A7788 -_08009AAC: .4byte gUnknown_0201C1C0 -_08009AB0: .4byte 0x060036E0 -_08009AB4: .4byte gUnknown_0202C790 - - thumb_func_start sub_9AB8 -sub_9AB8: @ 0x08009AB8 - push {r4, lr} - ldr r1, _08009B54 @ =gUnknown_0201A450 - ldrh r0, [r1, #0x30] - subs r0, #0xe - strh r0, [r1, #0x30] - ldrh r0, [r1, #0x32] - subs r0, #0xd - strh r0, [r1, #0x32] - ldr r3, _08009B58 @ =gUnknown_0202ADA0 - ldrh r0, [r3, #0x24] - subs r0, #0x10 - strh r0, [r3, #0x24] - ldrh r0, [r3, #0x26] - adds r0, #1 - strh r0, [r3, #0x26] - ldrh r0, [r3, #0xc] - subs r0, #0x10 - strh r0, [r3, #0xc] - ldrh r0, [r1, #0x20] - subs r0, #0xe - strh r0, [r1, #0x20] - ldrh r0, [r1, #0x22] - subs r0, #0xd - strh r0, [r1, #0x22] - adds r2, r1, #0 - adds r2, #0x40 - ldrh r0, [r2] - adds r0, #0xb - strh r0, [r2] - adds r1, #0x42 - ldrh r0, [r1] - subs r0, #2 - strh r0, [r1] - ldr r0, _08009B5C @ =gUnknown_0202BF10 - ldrh r0, [r0] - movs r1, #1 - ands r0, r1 - adds r4, r3, #0 - cmp r0, #0 - bne _08009B14 - ldrh r0, [r4] - subs r0, #1 - strh r0, [r4] - ldrh r0, [r4, #2] - subs r0, #1 - strh r0, [r4, #2] -_08009B14: - ldrh r0, [r4, #0xa] - adds r0, #1 - strh r0, [r4, #0xa] - ldr r2, _08009B60 @ =gUnknown_086A7768 - movs r1, #8 - ldrsh r3, [r4, r1] - lsls r1, r3, #2 - adds r1, r1, r2 - lsls r0, r0, #0x10 - asrs r0, r0, #0x10 - movs r2, #2 - ldrsh r1, [r1, r2] - cmp r0, r1 - ble _08009B94 - adds r0, r3, #0 - cmp r0, #6 - bgt _08009B70 - ldr r1, _08009B64 @ =gUnknown_086A7788 - lsls r0, r3, #1 - adds r0, r0, r1 - movs r2, #0 - ldrsh r0, [r0, r2] - lsls r0, r0, #1 - ldr r1, _08009B68 @ =gUnknown_0201C1C0 - adds r0, r0, r1 - ldr r1, _08009B6C @ =0x060036E0 - movs r2, #8 - movs r3, #8 - bl sub_10708 - b _08009B8A - .align 2, 0 -_08009B54: .4byte gUnknown_0201A450 -_08009B58: .4byte gUnknown_0202ADA0 -_08009B5C: .4byte gUnknown_0202BF10 -_08009B60: .4byte gUnknown_086A7768 -_08009B64: .4byte gUnknown_086A7788 -_08009B68: .4byte gUnknown_0201C1C0 -_08009B6C: .4byte 0x060036E0 -_08009B70: - ldr r1, _08009BF0 @ =gUnknown_086A7788 - lsls r0, r3, #1 - adds r0, r0, r1 - movs r3, #0 - ldrsh r0, [r0, r3] - lsls r0, r0, #1 - ldr r1, _08009BF4 @ =gUnknown_0201C1C0 - adds r0, r0, r1 - ldr r1, _08009BF8 @ =0x060032C0 - movs r2, #0xa - movs r3, #0xa - bl sub_10708 -_08009B8A: - ldr r1, _08009BFC @ =gUnknown_0202ADA0 - ldrh r0, [r1, #8] - adds r0, #1 - strh r0, [r1, #8] - adds r4, r1, #0 -_08009B94: - adds r1, r4, #0 - ldrh r0, [r1, #0x14] - adds r0, #1 - strh r0, [r1, #0x14] - lsls r0, r0, #0x10 - asrs r0, r0, #0x10 - cmp r0, #9 - ble _08009BB0 - movs r0, #0 - strh r0, [r1, #0x14] - ldr r1, _08009C00 @ =gUnknown_0202C790 - ldrb r0, [r1] - adds r0, #2 - strb r0, [r1] -_08009BB0: - bl sub_9E90 - ldr r1, _08009C04 @ =gMain - ldrh r2, [r4] - movs r3, #0xba - lsls r3, r3, #2 - adds r0, r1, r3 - strh r2, [r0] - ldrh r2, [r4, #2] - adds r3, #2 - adds r0, r1, r3 - strh r2, [r0] - ldrh r2, [r4, #0x24] - adds r3, #2 - adds r0, r1, r3 - strh r2, [r0] - ldrh r2, [r4, #0x26] - adds r3, #2 - adds r0, r1, r3 - strh r2, [r0] - ldrh r2, [r4, #0xc] - adds r3, #2 - adds r0, r1, r3 - strh r2, [r0] - ldrh r0, [r4, #0xe] - ldr r2, _08009C08 @ =0x000002F2 - adds r1, r1, r2 - strh r0, [r1] - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_08009BF0: .4byte gUnknown_086A7788 -_08009BF4: .4byte gUnknown_0201C1C0 -_08009BF8: .4byte 0x060032C0 -_08009BFC: .4byte gUnknown_0202ADA0 -_08009C00: .4byte gUnknown_0202C790 -_08009C04: .4byte gMain -_08009C08: .4byte 0x000002F2 - - thumb_func_start nullsub_4 -nullsub_4: @ 0x08009C0C - bx lr - - thumb_func_start sub_9C10 -sub_9C10: @ 0x08009C10 - push {r4, lr} - ldr r4, _08009C7C @ =gUnknown_0202ADA0 - ldrh r0, [r4, #0x18] - adds r0, #1 - strh r0, [r4, #0x18] - ldr r0, _08009C80 @ =gUnknown_0202BF10 - ldrh r0, [r0] - movs r1, #1 - ands r0, r1 - cmp r0, #0 - bne _08009C40 - ldr r1, _08009C84 @ =gUnknown_0201A450 - ldrh r0, [r1, #0x30] - subs r0, #1 - strh r0, [r1, #0x30] - ldrh r0, [r1, #0x32] - subs r0, #1 - strh r0, [r1, #0x32] - ldrh r0, [r1, #0x20] - subs r0, #2 - strh r0, [r1, #0x20] - ldrh r0, [r1, #0x22] - subs r0, #2 - strh r0, [r1, #0x22] -_08009C40: - bl sub_9E90 - ldr r1, _08009C88 @ =gMain - ldrh r2, [r4, #0x18] - movs r3, #0xbd - lsls r3, r3, #2 - adds r0, r1, r3 - strh r2, [r0] - ldrh r0, [r4, #0x1a] - ldr r2, _08009C8C @ =0x000002F6 - adds r1, r1, r2 - strh r0, [r1] - ldr r1, _08009C84 @ =gUnknown_0201A450 - ldrh r0, [r1, #0x3a] - adds r0, #1 - strh r0, [r1, #0x3a] - lsls r0, r0, #0x10 - asrs r0, r0, #0x10 - cmp r0, #0x14 - ble _08009C74 - movs r0, #0 - strh r0, [r1, #0x3a] - ldr r1, _08009C90 @ =gUnknown_0202C790 - ldrb r0, [r1] - adds r0, #3 - strb r0, [r1] -_08009C74: - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_08009C7C: .4byte gUnknown_0202ADA0 -_08009C80: .4byte gUnknown_0202BF10 -_08009C84: .4byte gUnknown_0201A450 -_08009C88: .4byte gMain -_08009C8C: .4byte 0x000002F6 -_08009C90: .4byte gUnknown_0202C790 - - thumb_func_start nullsub_5 -nullsub_5: @ 0x08009C94 - bx lr - - thumb_func_start nullsub_17 -nullsub_17: @ 0x08009C98 - bx lr - - thumb_func_start sub_9C9C -sub_9C9C: @ 0x08009C9C - push {lr} - bl sub_10480 - bl sub_10544 - ldr r1, _08009CB4 @ =gUnknown_0202C790 - ldrb r0, [r1] - adds r0, #1 - strb r0, [r1] - pop {r0} - bx r0 - .align 2, 0 -_08009CB4: .4byte gUnknown_0202C790 - - thumb_func_start sub_9CB8 -sub_9CB8: @ 0x08009CB8 - push {r4, r5, r6, r7, lr} - mov r7, r8 - push {r7} - ldr r4, _08009D54 @ =gUnknown_0201A450 - movs r0, #8 - ldrsh r1, [r4, r0] - movs r0, #0xb8 - muls r0, r1, r0 - ldr r2, _08009D58 @ =gUnknown_0200B698 - adds r5, r0, r2 - movs r0, #0xc - ldrsb r0, [r4, r0] - strh r0, [r5] - ldr r6, _08009D5C @ =gUnknown_086A769C - ldr r1, _08009D60 @ =0xFFFFFD20 - adds r2, r2, r1 - adds r0, r6, #0 - movs r1, #0x31 - bl LoadSpriteSets - ldrh r0, [r5] - cmp r0, #1 - bne _08009D46 - ldrh r0, [r4] - strh r0, [r5, #2] - ldrh r0, [r4, #2] - strh r0, [r5, #4] - movs r2, #8 - ldrsh r0, [r4, r2] - adds r0, #4 - lsls r0, r0, #2 - adds r0, r0, r6 - ldr r7, [r0] - movs r6, #0 - ldrh r0, [r7] - cmp r6, r0 - bge _08009D46 - ldr r1, _08009D64 @ =gOamBuffer - mov ip, r1 - ldr r2, _08009D68 @ =0xFFFFFE00 - mov r8, r2 - adds r4, r5, #0 - adds r4, #8 -_08009D0E: - ldrh r3, [r4] - lsls r3, r3, #3 - add r3, ip - movs r0, #2 - ldrsh r1, [r4, r0] - movs r2, #2 - ldrsh r0, [r5, r2] - adds r1, r1, r0 - ldr r2, _08009D6C @ =0x000001FF - adds r0, r2, #0 - ands r1, r0 - ldrh r2, [r3, #2] - mov r0, r8 - ands r0, r2 - orrs r0, r1 - strh r0, [r3, #2] - ldrh r1, [r4] - lsls r1, r1, #3 - add r1, ip - ldrb r0, [r5, #4] - ldrb r2, [r4, #4] - adds r0, r0, r2 - strb r0, [r1] - adds r4, #8 - adds r6, #1 - ldrh r0, [r7] - cmp r6, r0 - blt _08009D0E -_08009D46: - movs r0, #0 - strh r0, [r5] - pop {r3} - mov r8, r3 - pop {r4, r5, r6, r7} - pop {r0} - bx r0 - .align 2, 0 -_08009D54: .4byte gUnknown_0201A450 -_08009D58: .4byte gUnknown_0200B698 -_08009D5C: .4byte gUnknown_086A769C -_08009D60: .4byte 0xFFFFFD20 -_08009D64: .4byte gOamBuffer -_08009D68: .4byte 0xFFFFFE00 -_08009D6C: .4byte 0x000001FF - - thumb_func_start sub_9D70 -sub_9D70: @ 0x08009D70 - push {r4, r5, r6, r7, lr} - mov r7, sl - mov r6, sb - mov r5, r8 - push {r5, r6, r7} - sub sp, #4 - ldr r0, _08009E68 @ =gUnknown_0200D078 - mov r8, r0 - ldr r6, _08009E6C @ =gUnknown_0201A450 - movs r0, #0xc - ldrsb r0, [r6, r0] - mov r1, r8 - strh r0, [r1] - ldr r0, _08009E70 @ =gUnknown_086A769C - ldr r2, _08009E74 @ =0xFFFFE340 - add r2, r8 - movs r1, #0x31 - bl LoadSpriteSets - mov r2, r8 - ldrh r0, [r2] - cmp r0, #1 - bne _08009E50 - ldr r5, _08009E78 @ =gUnknown_02019C30 - movs r3, #0 - ldrsh r0, [r5, r3] - ldr r4, _08009E7C @ =gUnknown_0201C188 - movs r2, #0 - ldrsh r1, [r4, r2] - movs r2, #0 - bl SetMatrixScale - ldrh r0, [r6] - mov r3, r8 - strh r0, [r3, #2] - ldrh r0, [r6, #2] - strh r0, [r3, #4] - movs r7, #0 - ldr r6, _08009E80 @ =gOamBuffer - mov sl, r5 - mov sb, r4 - mov r5, r8 - adds r5, #8 - movs r0, #0xf - rsbs r0, r0, #0 - mov ip, r0 -_08009DCC: - ldrh r0, [r5] - lsls r0, r0, #3 - adds r3, r0, r6 - lsls r0, r7, #2 - ldr r1, _08009E84 @ =gUnknown_086A7798 - adds r4, r0, r1 - movs r2, #0 - ldrsh r1, [r4, r2] - mov r2, sl - ldr r0, [r2] - muls r1, r0, r1 - cmp r1, #0 - bge _08009DE8 - adds r1, #0xff -_08009DE8: - asrs r1, r1, #8 - str r1, [sp] - mov r1, r8 - movs r2, #2 - ldrsh r0, [r1, r2] - ldr r2, [sp] - adds r1, r2, r0 - ldr r2, _08009E88 @ =0x000001FF - adds r0, r2, #0 - ands r1, r0 - ldrh r2, [r3, #2] - ldr r0, _08009E8C @ =0xFFFFFE00 - ands r0, r2 - orrs r0, r1 - strh r0, [r3, #2] - ldrh r0, [r5] - lsls r0, r0, #3 - adds r2, r0, r6 - movs r3, #2 - ldrsh r1, [r4, r3] - mov r3, sb - ldr r0, [r3] - muls r0, r1, r0 - cmp r0, #0 - bge _08009E1C - adds r0, #0xff -_08009E1C: - asrs r0, r0, #8 - mov r1, r8 - ldrb r1, [r1, #4] - adds r0, r0, r1 - strb r0, [r2] - ldrh r2, [r5] - lsls r2, r2, #3 - adds r2, r2, r6 - ldrb r1, [r2, #1] - movs r0, #4 - rsbs r0, r0, #0 - ands r0, r1 - movs r1, #1 - orrs r0, r1 - strb r0, [r2, #1] - ldrh r1, [r5] - lsls r1, r1, #3 - adds r1, r1, r6 - ldrb r2, [r1, #3] - mov r0, ip - ands r0, r2 - strb r0, [r1, #3] - adds r5, #8 - adds r7, #1 - cmp r7, #3 - ble _08009DCC -_08009E50: - movs r0, #0 - mov r2, r8 - strh r0, [r2] - add sp, #4 - pop {r3, r4, r5} - mov r8, r3 - mov sb, r4 - mov sl, r5 - pop {r4, r5, r6, r7} - pop {r0} - bx r0 - .align 2, 0 -_08009E68: .4byte gUnknown_0200D078 -_08009E6C: .4byte gUnknown_0201A450 -_08009E70: .4byte gUnknown_086A769C -_08009E74: .4byte 0xFFFFE340 -_08009E78: .4byte gUnknown_02019C30 -_08009E7C: .4byte gUnknown_0201C188 -_08009E80: .4byte gOamBuffer -_08009E84: .4byte gUnknown_086A7798 -_08009E88: .4byte 0x000001FF -_08009E8C: .4byte 0xFFFFFE00 - - thumb_func_start sub_9E90 -sub_9E90: @ 0x08009E90 - push {r4, r5, r6, r7, lr} - mov r7, sl - mov r6, sb - mov r5, r8 - push {r5, r6, r7} - sub sp, #4 - ldr r3, _0800A12C @ =gMain - ldrh r0, [r3, #0x38] - movs r0, #0xf1 - lsls r0, r0, #4 - strh r0, [r3, #0x38] - ldr r0, _0800A130 @ =gUnknown_0201C1B8 - ldrb r1, [r0] - ldr r0, _0800A134 @ =gUnknown_0202ADD4 - ldrb r0, [r0] - lsls r0, r0, #8 - orrs r1, r0 - ldrh r0, [r3, #0x3a] - strh r1, [r3, #0x3a] - ldr r1, _0800A138 @ =0x04000050 - ldrh r0, [r3, #0x38] - strh r0, [r1] - adds r1, #2 - ldrh r0, [r3, #0x3a] - strh r0, [r1] - ldr r4, _0800A13C @ =gUnknown_0201A450 - movs r0, #0x18 - ldrsh r1, [r4, r0] - movs r0, #0xb8 - muls r0, r1, r0 - movs r1, #0xbe - lsls r1, r1, #2 - adds r2, r3, r1 - adds r0, r0, r2 - mov r8, r0 - movs r6, #0xa4 - lsls r6, r6, #3 - adds r6, r6, r3 - mov sb, r6 - movs r7, #0x8d - lsls r7, r7, #3 - adds r7, r7, r3 - mov sl, r7 - movs r0, #0x1c - ldrsb r0, [r4, r0] - mov r1, r8 - strh r0, [r1] - adds r0, r4, #0 - adds r0, #0x2c - ldrb r0, [r0] - lsls r0, r0, #0x18 - asrs r0, r0, #0x18 - strh r0, [r6] - adds r0, r4, #0 - adds r0, #0x3c - ldrb r0, [r0] - lsls r0, r0, #0x18 - asrs r0, r0, #0x18 - strh r0, [r7] - adds r0, r4, #0 - adds r0, #0x4c - ldrb r0, [r0] - lsls r0, r0, #0x18 - asrs r0, r0, #0x18 - ldr r6, _0800A140 @ =gUnknown_0200D638 - strh r0, [r6] - ldr r5, _0800A144 @ =gUnknown_086A769C - adds r0, r5, #0 - movs r1, #0x31 - bl LoadSpriteSets - mov r7, r8 - ldrh r0, [r7] - cmp r0, #1 - bne _08009F9E - ldrh r0, [r4, #0x10] - strh r0, [r7, #2] - ldrh r0, [r4, #0x12] - strh r0, [r7, #4] - movs r1, #0x18 - ldrsh r0, [r4, r1] - lsls r0, r0, #2 - adds r0, r0, r5 - ldr r0, [r0] - str r0, [sp] - movs r5, #0 - ldrh r2, [r0] - cmp r5, r2 - bge _08009F9E - ldr r7, _0800A148 @ =gOamBuffer - ldr r6, _0800A14C @ =0xFFFFFE00 - mov ip, r6 - mov r4, r8 - adds r4, #8 -_08009F4C: - ldrh r2, [r4] - lsls r2, r2, #3 - adds r2, r2, r7 - ldrb r1, [r2, #1] - movs r0, #0xd - rsbs r0, r0, #0 - ands r0, r1 - movs r1, #4 - orrs r0, r1 - strb r0, [r2, #1] - ldrh r3, [r4] - lsls r3, r3, #3 - adds r3, r3, r7 - movs r0, #2 - ldrsh r1, [r4, r0] - mov r2, r8 - movs r6, #2 - ldrsh r0, [r2, r6] - adds r1, r1, r0 - ldr r2, _0800A150 @ =0x000001FF - adds r0, r2, #0 - ands r1, r0 - ldrh r2, [r3, #2] - mov r0, ip - ands r0, r2 - orrs r0, r1 - strh r0, [r3, #2] - ldrh r1, [r4] - lsls r1, r1, #3 - adds r1, r1, r7 - mov r6, r8 - ldrb r0, [r6, #4] - ldrb r2, [r4, #4] - adds r0, r0, r2 - strb r0, [r1] - adds r4, #8 - adds r5, #1 - ldr r6, [sp] - ldrh r6, [r6] - cmp r5, r6 - blt _08009F4C -_08009F9E: - mov r7, sb - ldrh r0, [r7] - cmp r0, #1 - bne _0800A01C - ldr r0, _0800A13C @ =gUnknown_0201A450 - ldrh r1, [r0, #0x20] - strh r1, [r7, #2] - ldrh r0, [r0, #0x22] - strh r0, [r7, #4] - ldr r6, _0800A148 @ =gOamBuffer - movs r0, #0xd - rsbs r0, r0, #0 - mov ip, r0 - mov r4, sb - adds r4, #8 - movs r5, #3 -_08009FBE: - ldrh r1, [r4] - lsls r1, r1, #3 - adds r1, r1, r6 - ldrb r2, [r1, #1] - mov r0, ip - ands r0, r2 - movs r2, #4 - orrs r0, r2 - strb r0, [r1, #1] - ldrh r1, [r4] - lsls r1, r1, #3 - adds r1, r1, r6 - ldrb r2, [r1, #5] - mov r0, ip - ands r0, r2 - movs r7, #4 - orrs r0, r7 - strb r0, [r1, #5] - ldrh r3, [r4] - lsls r3, r3, #3 - adds r3, r3, r6 - movs r0, #2 - ldrsh r1, [r4, r0] - mov r2, sb - movs r7, #2 - ldrsh r0, [r2, r7] - adds r1, r1, r0 - ldr r2, _0800A150 @ =0x000001FF - adds r0, r2, #0 - ands r1, r0 - ldrh r2, [r3, #2] - ldr r0, _0800A14C @ =0xFFFFFE00 - ands r0, r2 - orrs r0, r1 - strh r0, [r3, #2] - ldrh r1, [r4] - lsls r1, r1, #3 - adds r1, r1, r6 - mov r7, sb - ldrb r0, [r7, #4] - ldrb r2, [r4, #4] - adds r0, r0, r2 - strb r0, [r1] - adds r4, #8 - subs r5, #1 - cmp r5, #0 - bge _08009FBE -_0800A01C: - mov r6, sl - ldrh r0, [r6] - cmp r0, #1 - bne _0800A098 - ldr r0, _0800A13C @ =gUnknown_0201A450 - ldrh r1, [r0, #0x30] - strh r1, [r6, #2] - ldrh r0, [r0, #0x32] - strh r0, [r6, #4] - ldr r6, _0800A148 @ =gOamBuffer - ldr r7, _0800A14C @ =0xFFFFFE00 - mov ip, r7 - mov r4, sl - adds r4, #8 - movs r5, #3 -_0800A03A: - ldrh r1, [r4] - lsls r1, r1, #3 - adds r1, r1, r6 - ldrb r2, [r1, #1] - movs r0, #0xd - rsbs r0, r0, #0 - ands r0, r2 - strb r0, [r1, #1] - ldrh r2, [r4] - lsls r2, r2, #3 - adds r2, r2, r6 - ldrb r1, [r2, #5] - movs r0, #0xd - rsbs r0, r0, #0 - ands r0, r1 - movs r1, #4 - orrs r0, r1 - strb r0, [r2, #5] - ldrh r3, [r4] - lsls r3, r3, #3 - adds r3, r3, r6 - movs r0, #2 - ldrsh r1, [r4, r0] - mov r2, sl - movs r7, #2 - ldrsh r0, [r2, r7] - adds r1, r1, r0 - ldr r2, _0800A150 @ =0x000001FF - adds r0, r2, #0 - ands r1, r0 - ldrh r2, [r3, #2] - mov r0, ip - ands r0, r2 - orrs r0, r1 - strh r0, [r3, #2] - ldrh r1, [r4] - lsls r1, r1, #3 - adds r1, r1, r6 - mov r7, sl - ldrb r0, [r7, #4] - ldrb r2, [r4, #4] - adds r0, r0, r2 - strb r0, [r1] - adds r4, #8 - subs r5, #1 - cmp r5, #0 - bge _0800A03A -_0800A098: - ldr r6, _0800A140 @ =gUnknown_0200D638 - ldrh r0, [r6] - cmp r0, #1 - bne _0800A10A - ldr r0, _0800A13C @ =gUnknown_0201A450 - adds r1, r0, #0 - adds r1, #0x40 - ldrh r1, [r1] - strh r1, [r6, #2] - adds r0, #0x42 - ldrh r0, [r0] - strh r0, [r6, #4] - ldr r6, _0800A148 @ =gOamBuffer - movs r7, #0xd - rsbs r7, r7, #0 - mov ip, r7 - ldr r4, _0800A140 @ =gUnknown_0200D638 - adds r4, #8 - movs r5, #7 -_0800A0BE: - ldrh r2, [r4] - lsls r2, r2, #3 - adds r2, r2, r6 - ldrb r1, [r2, #5] - mov r0, ip - ands r0, r1 - movs r1, #8 - orrs r0, r1 - strb r0, [r2, #5] - ldrh r3, [r4] - lsls r3, r3, #3 - adds r3, r3, r6 - movs r0, #2 - ldrsh r1, [r4, r0] - ldr r2, _0800A140 @ =gUnknown_0200D638 - movs r7, #2 - ldrsh r0, [r2, r7] - adds r1, r1, r0 - ldr r2, _0800A150 @ =0x000001FF - adds r0, r2, #0 - ands r1, r0 - ldrh r2, [r3, #2] - ldr r0, _0800A14C @ =0xFFFFFE00 - ands r0, r2 - orrs r0, r1 - strh r0, [r3, #2] - ldrh r1, [r4] - lsls r1, r1, #3 - adds r1, r1, r6 - ldr r7, _0800A140 @ =gUnknown_0200D638 - ldrb r0, [r7, #4] - ldrb r2, [r4, #4] - adds r0, r0, r2 - strb r0, [r1] - adds r4, #8 - subs r5, #1 - cmp r5, #0 - bge _0800A0BE -_0800A10A: - movs r0, #0 - mov r6, r8 - strh r0, [r6] - mov r7, sb - strh r0, [r7] - mov r1, sl - strh r0, [r1] - ldr r2, _0800A140 @ =gUnknown_0200D638 - strh r0, [r2] - add sp, #4 - pop {r3, r4, r5} - mov r8, r3 - mov sb, r4 - mov sl, r5 - pop {r4, r5, r6, r7} - pop {r0} - bx r0 - .align 2, 0 -_0800A12C: .4byte gMain -_0800A130: .4byte gUnknown_0201C1B8 -_0800A134: .4byte gUnknown_0202ADD4 -_0800A138: .4byte 0x04000050 -_0800A13C: .4byte gUnknown_0201A450 -_0800A140: .4byte gUnknown_0200D638 -_0800A144: .4byte gUnknown_086A769C -_0800A148: .4byte gOamBuffer -_0800A14C: .4byte 0xFFFFFE00 -_0800A150: .4byte 0x000001FF - - thumb_func_start sub_A154 -sub_A154: @ 0x0800A154 - push {lr} - bl sub_0518 - ldr r1, _0800A168 @ =gUnknown_0202C790 - ldrb r0, [r1] - adds r0, #1 - strb r0, [r1] - pop {r0} - bx r0 - .align 2, 0 -_0800A168: .4byte gUnknown_0202C790 - - thumb_func_start sub_A16C -sub_A16C: @ 0x0800A16C - push {r4, lr} - movs r2, #0x80 - lsls r2, r2, #0x13 - movs r0, #0 - strh r0, [r2] - ldr r1, _0800A250 @ =0x04000008 - movs r3, #0xcc - lsls r3, r3, #8 - adds r0, r3, #0 - strh r0, [r1] - ldrh r0, [r2] - movs r4, #0x80 - lsls r4, r4, #1 - adds r1, r4, #0 - orrs r0, r1 - strh r0, [r2] - ldr r1, _0800A254 @ =0x0400000A - ldr r3, _0800A258 @ =0x0000DA01 - adds r0, r3, #0 - strh r0, [r1] - ldrh r0, [r2] - movs r4, #0x80 - lsls r4, r4, #2 - adds r1, r4, #0 - orrs r0, r1 - strh r0, [r2] - ldr r1, _0800A25C @ =0x0400000E - ldr r3, _0800A260 @ =0x00001E03 - adds r0, r3, #0 - strh r0, [r1] - ldrh r0, [r2] - movs r4, #0x80 - lsls r4, r4, #4 - adds r1, r4, #0 - orrs r0, r1 - strh r0, [r2] - ldr r0, _0800A264 @ =0x040000D4 - ldr r1, _0800A268 @ =gUnknown_080D0700 - str r1, [r0] - ldr r1, _0800A26C @ =0x06006000 - str r1, [r0, #4] - ldr r2, _0800A270 @ =0x80001000 - str r2, [r0, #8] - ldr r1, [r0, #8] - ldr r1, _0800A274 @ =gUnknown_080D2700 - str r1, [r0] - ldr r1, _0800A278 @ =0x0600D000 - str r1, [r0, #4] - str r2, [r0, #8] - ldr r1, [r0, #8] - ldr r1, _0800A27C @ =gUnknown_080CBEE0 - str r1, [r0] - ldr r1, _0800A280 @ =0x0600F000 - str r1, [r0, #4] - ldr r1, _0800A284 @ =0x80000400 - str r1, [r0, #8] - ldr r1, [r0, #8] - ldr r1, _0800A288 @ =gUnknown_080CC6E0 - str r1, [r0] - movs r1, #0xc0 - lsls r1, r1, #0x13 - str r1, [r0, #4] - ldr r1, _0800A28C @ =0x80001E00 - str r1, [r0, #8] - ldr r1, [r0, #8] - ldr r1, _0800A290 @ =gUnknown_080CBCE0 - str r1, [r0] - movs r1, #0xa0 - lsls r1, r1, #0x13 - str r1, [r0, #4] - ldr r1, _0800A294 @ =0x80000040 - str r1, [r0, #8] - ldr r0, [r0, #8] - bl sub_A2A8 - ldr r1, _0800A298 @ =gMain - ldr r3, _0800A29C @ =gUnknown_0202ADA0 - ldrh r2, [r3] - movs r4, #0xba - lsls r4, r4, #2 - adds r0, r1, r4 - strh r2, [r0] - ldrh r2, [r3, #2] - adds r4, #2 - adds r0, r1, r4 - strh r2, [r0] - ldrh r2, [r3, #0xc] - adds r4, #2 - adds r0, r1, r4 - strh r2, [r0] - ldrh r2, [r3, #0xe] - adds r4, #2 - adds r0, r1, r4 - strh r2, [r0] - ldrh r2, [r3, #0x18] - adds r4, #6 - adds r0, r1, r4 - strh r2, [r0] - ldrh r0, [r3, #0x1a] - ldr r2, _0800A2A0 @ =0x000002F6 - adds r1, r1, r2 - strh r0, [r1] - bl sub_0CBC - bl sub_10424 - ldr r1, _0800A2A4 @ =gUnknown_0202C790 - ldrb r0, [r1] - adds r0, #2 - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_0800A250: .4byte 0x04000008 -_0800A254: .4byte 0x0400000A -_0800A258: .4byte 0x0000DA01 -_0800A25C: .4byte 0x0400000E -_0800A260: .4byte 0x00001E03 -_0800A264: .4byte 0x040000D4 -_0800A268: .4byte gUnknown_080D0700 -_0800A26C: .4byte 0x06006000 -_0800A270: .4byte 0x80001000 -_0800A274: .4byte gUnknown_080D2700 -_0800A278: .4byte 0x0600D000 -_0800A27C: .4byte gUnknown_080CBEE0 -_0800A280: .4byte 0x0600F000 -_0800A284: .4byte 0x80000400 -_0800A288: .4byte gUnknown_080CC6E0 -_0800A28C: .4byte 0x80001E00 -_0800A290: .4byte gUnknown_080CBCE0 -_0800A294: .4byte 0x80000040 -_0800A298: .4byte gMain -_0800A29C: .4byte gUnknown_0202ADA0 -_0800A2A0: .4byte 0x000002F6 -_0800A2A4: .4byte gUnknown_0202C790 - - thumb_func_start sub_A2A8 -sub_A2A8: @ 0x0800A2A8 - ldr r0, _0800A2D8 @ =gUnknown_0202ADA0 - movs r2, #0 - movs r1, #0x1c - strh r1, [r0] - ldr r1, _0800A2DC @ =0x0000FF2C - strh r1, [r0, #2] - strh r2, [r0, #4] - movs r1, #0xe - strh r1, [r0, #6] - ldr r1, _0800A2E0 @ =0x0000FF5C - strh r1, [r0, #0xc] - subs r1, #0x54 - strh r1, [r0, #0xe] - strh r2, [r0, #0x10] - movs r1, #0x10 - strh r1, [r0, #0x12] - strh r2, [r0, #0x18] - strh r2, [r0, #0x1a] - strh r2, [r0, #0x20] - ldr r0, _0800A2E4 @ =gUnknown_0202BF10 - strh r2, [r0] - ldr r0, _0800A2E8 @ =gUnknown_0202A578 - strh r2, [r0] - bx lr - .align 2, 0 -_0800A2D8: .4byte gUnknown_0202ADA0 -_0800A2DC: .4byte 0x0000FF2C -_0800A2E0: .4byte 0x0000FF5C -_0800A2E4: .4byte gUnknown_0202BF10 -_0800A2E8: .4byte gUnknown_0202A578 - - thumb_func_start nullsub_6 -nullsub_6: @ 0x0800A2EC - bx lr - - thumb_func_start sub_A2F0 -sub_A2F0: @ 0x0800A2F0 - push {r4, lr} - ldr r3, _0800A384 @ =gUnknown_0202ADA0 - ldrh r4, [r3, #6] - ldrh r1, [r3, #2] - adds r0, r4, r1 - strh r0, [r3, #2] - ldrh r2, [r3, #0x12] - ldrh r1, [r3, #0xe] - adds r0, r2, r1 - strh r0, [r3, #0xe] - ldrh r0, [r3, #0x18] - subs r0, #1 - strh r0, [r3, #0x18] - ldrh r0, [r3, #0x1a] - subs r0, #1 - strh r0, [r3, #0x1a] - ldrh r0, [r3] - subs r0, #1 - strh r0, [r3] - ldrh r0, [r3, #0xc] - adds r0, #1 - strh r0, [r3, #0xc] - ldr r0, _0800A388 @ =gUnknown_0202BF10 - ldrh r0, [r0] - movs r1, #1 - ands r0, r1 - cmp r0, #0 - bne _0800A330 - subs r0, r4, #1 - strh r0, [r3, #6] - subs r0, r2, #1 - strh r0, [r3, #0x12] -_0800A330: - ldr r1, _0800A38C @ =gMain - ldrh r2, [r3] - movs r4, #0xba - lsls r4, r4, #2 - adds r0, r1, r4 - strh r2, [r0] - ldrh r2, [r3, #2] - adds r4, #2 - adds r0, r1, r4 - strh r2, [r0] - ldrh r2, [r3, #0xc] - adds r4, #2 - adds r0, r1, r4 - strh r2, [r0] - ldrh r2, [r3, #0xe] - adds r4, #2 - adds r0, r1, r4 - strh r2, [r0] - ldrh r2, [r3, #0x18] - adds r4, #6 - adds r0, r1, r4 - strh r2, [r0] - ldrh r0, [r3, #0x1a] - ldr r2, _0800A390 @ =0x000002F6 - adds r1, r1, r2 - strh r0, [r1] - ldrh r0, [r3, #0x20] - adds r0, #1 - strh r0, [r3, #0x20] - lsls r0, r0, #0x10 - asrs r0, r0, #0x10 - cmp r0, #0x27 - ble _0800A37E - movs r0, #0 - strh r0, [r3, #0x20] - ldr r1, _0800A394 @ =gUnknown_0202C790 - ldrb r0, [r1] - adds r0, #2 - strb r0, [r1] -_0800A37E: - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_0800A384: .4byte gUnknown_0202ADA0 -_0800A388: .4byte gUnknown_0202BF10 -_0800A38C: .4byte gMain -_0800A390: .4byte 0x000002F6 -_0800A394: .4byte gUnknown_0202C790 - - thumb_func_start nullsub_7 -nullsub_7: @ 0x0800A398 - bx lr - - thumb_func_start sub_A39C -sub_A39C: @ 0x0800A39C - push {r4, lr} - ldr r3, _0800A428 @ =gUnknown_0202ADA0 - ldrh r0, [r3, #2] - adds r0, #1 - strh r0, [r3, #2] - ldrh r0, [r3, #0xe] - adds r0, #1 - strh r0, [r3, #0xe] - ldrh r0, [r3, #0x18] - subs r0, #1 - strh r0, [r3, #0x18] - ldrh r0, [r3, #0x1a] - subs r0, #1 - strh r0, [r3, #0x1a] - ldrh r0, [r3] - subs r0, #1 - strh r0, [r3] - ldrh r0, [r3, #0xc] - adds r0, #1 - strh r0, [r3, #0xc] - ldr r0, _0800A42C @ =gUnknown_0202BF10 - ldrh r0, [r0] - movs r1, #1 - ands r0, r1 - cmp r0, #0 - bne _0800A3DC - ldrh r0, [r3, #6] - subs r0, #1 - strh r0, [r3, #6] - ldrh r0, [r3, #0x12] - subs r0, #1 - strh r0, [r3, #0x12] -_0800A3DC: - ldr r1, _0800A430 @ =gMain - ldrh r2, [r3] - movs r4, #0xba - lsls r4, r4, #2 - adds r0, r1, r4 - strh r2, [r0] - ldrh r2, [r3, #2] - adds r4, #2 - adds r0, r1, r4 - strh r2, [r0] - ldrh r2, [r3, #0xc] - adds r4, #2 - adds r0, r1, r4 - strh r2, [r0] - ldrh r2, [r3, #0xe] - adds r4, #2 - adds r0, r1, r4 - strh r2, [r0] - ldrh r2, [r3, #0x18] - adds r4, #6 - adds r0, r1, r4 - strh r2, [r0] - ldrh r0, [r3, #0x1a] - ldr r2, _0800A434 @ =0x000002F6 - adds r1, r1, r2 - strh r0, [r1] - bl sub_10480 - bl sub_10544 - ldr r1, _0800A438 @ =gUnknown_0202C790 - ldrb r0, [r1] - adds r0, #1 - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_0800A428: .4byte gUnknown_0202ADA0 -_0800A42C: .4byte gUnknown_0202BF10 -_0800A430: .4byte gMain -_0800A434: .4byte 0x000002F6 -_0800A438: .4byte gUnknown_0202C790 - - thumb_func_start sub_A43C -sub_A43C: @ 0x0800A43C - push {lr} - bl sub_0518 - ldr r1, _0800A450 @ =gUnknown_0202C790 - ldrb r0, [r1] - adds r0, #1 - strb r0, [r1] - pop {r0} - bx r0 - .align 2, 0 -_0800A450: .4byte gUnknown_0202C790 - - thumb_func_start sub_A454 -sub_A454: @ 0x0800A454 - push {r4, lr} - movs r2, #0x80 - lsls r2, r2, #0x13 - movs r1, #0x80 - lsls r1, r1, #5 - adds r0, r1, #0 - strh r0, [r2] - ldr r1, _0800A5A0 @ =0x04000008 - movs r3, #0xb4 - lsls r3, r3, #7 - adds r0, r3, #0 - strh r0, [r1] - ldrh r0, [r2] - movs r4, #0x80 - lsls r4, r4, #1 - adds r1, r4, #0 - orrs r0, r1 - strh r0, [r2] - ldr r1, _0800A5A4 @ =0x0400000A - ldr r3, _0800A5A8 @ =0x00001C01 - adds r0, r3, #0 - strh r0, [r1] - ldrh r0, [r2] - movs r4, #0x80 - lsls r4, r4, #2 - adds r1, r4, #0 - orrs r0, r1 - strh r0, [r2] - ldr r1, _0800A5AC @ =0x0400000C - ldr r3, _0800A5B0 @ =0x00005D02 - adds r0, r3, #0 - strh r0, [r1] - ldrh r0, [r2] - movs r4, #0x80 - lsls r4, r4, #3 - adds r1, r4, #0 - orrs r0, r1 - strh r0, [r2] - ldr r1, _0800A5B4 @ =0x0400000E - ldr r3, _0800A5B8 @ =0x00001F03 - adds r0, r3, #0 - strh r0, [r1] - ldrh r0, [r2] - movs r4, #0x80 - lsls r4, r4, #4 - adds r1, r4, #0 - orrs r0, r1 - strh r0, [r2] - ldr r0, _0800A5BC @ =0x040000D4 - ldr r1, _0800A5C0 @ =gUnknown_080DE520 - str r1, [r0] - ldr r1, _0800A5C4 @ =0x0600D000 - str r1, [r0, #4] - ldr r3, _0800A5C8 @ =0x80000800 - str r3, [r0, #8] - ldr r1, [r0, #8] - ldr r1, _0800A5CC @ =gUnknown_080DCD20 - str r1, [r0] - ldr r1, _0800A5D0 @ =0x0600E000 - str r1, [r0, #4] - ldr r2, _0800A5D4 @ =0x80000400 - str r2, [r0, #8] - ldr r1, [r0, #8] - ldr r1, _0800A5D8 @ =gUnknown_080D4900 - str r1, [r0] - ldr r1, _0800A5DC @ =0x0600E800 - str r1, [r0, #4] - str r3, [r0, #8] - ldr r1, [r0, #8] - ldr r1, _0800A5E0 @ =gUnknown_080D5900 - str r1, [r0] - ldr r1, _0800A5E4 @ =0x0600F800 - str r1, [r0, #4] - str r2, [r0, #8] - ldr r1, [r0, #8] - ldr r1, _0800A5E8 @ =gUnknown_080DD520 - str r1, [r0] - ldr r1, _0800A5EC @ =gUnknown_03005C00 - str r1, [r0, #4] - str r2, [r0, #8] - ldr r1, [r0, #8] - ldr r1, _0800A5F0 @ =gUnknown_080DDD20 - str r1, [r0] - ldr r1, _0800A5F4 @ =gUnknown_0201B180 - str r1, [r0, #4] - str r2, [r0, #8] - ldr r1, [r0, #8] - ldr r1, _0800A5F8 @ =gUnknown_080D6100 - str r1, [r0] - movs r1, #0xc0 - lsls r1, r1, #0x13 - str r1, [r0, #4] - ldr r1, _0800A5FC @ =0x80003600 - str r1, [r0, #8] - ldr r1, [r0, #8] - ldr r3, _0800A600 @ =gUnknown_080D4700 - str r3, [r0] - movs r1, #0xa0 - lsls r1, r1, #0x13 - str r1, [r0, #4] - ldr r2, _0800A604 @ =0x80000070 - str r2, [r0, #8] - ldr r1, [r0, #8] - ldr r1, _0800A608 @ =gUnknown_080DF520 - str r1, [r0] - ldr r1, _0800A60C @ =0x06010000 - str r1, [r0, #4] - ldr r1, _0800A610 @ =0x80001000 - str r1, [r0, #8] - ldr r1, [r0, #8] - str r3, [r0] - ldr r1, _0800A614 @ =0x05000200 - str r1, [r0, #4] - str r2, [r0, #8] - ldr r0, [r0, #8] - bl sub_A628 - bl sub_A87C - ldr r1, _0800A618 @ =gMain - ldr r2, _0800A61C @ =gUnknown_0202ADA0 - ldrh r3, [r2] - movs r4, #0xba - lsls r4, r4, #2 - adds r0, r1, r4 - strh r3, [r0] - ldrh r3, [r2, #2] - adds r4, #2 - adds r0, r1, r4 - strh r3, [r0] - ldrh r3, [r2, #0xc] - adds r4, #2 - adds r0, r1, r4 - strh r3, [r0] - ldrh r3, [r2, #0xe] - adds r4, #2 - adds r0, r1, r4 - strh r3, [r0] - ldrh r3, [r2, #0x18] - adds r4, #2 - adds r0, r1, r4 - strh r3, [r0] - ldrh r3, [r2, #0x1a] - adds r4, #2 - adds r0, r1, r4 - strh r3, [r0] - ldrh r3, [r2, #0x24] - adds r4, #2 - adds r0, r1, r4 - strh r3, [r0] - ldrh r0, [r2, #0x26] - ldr r2, _0800A620 @ =0x000002F6 - adds r1, r1, r2 - strh r0, [r1] - bl sub_0CBC - bl sub_10424 - ldr r1, _0800A624 @ =gUnknown_0202C790 - ldrb r0, [r1] - adds r0, #1 - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_0800A5A0: .4byte 0x04000008 -_0800A5A4: .4byte 0x0400000A -_0800A5A8: .4byte 0x00001C01 -_0800A5AC: .4byte 0x0400000C -_0800A5B0: .4byte 0x00005D02 -_0800A5B4: .4byte 0x0400000E -_0800A5B8: .4byte 0x00001F03 -_0800A5BC: .4byte 0x040000D4 -_0800A5C0: .4byte gUnknown_080DE520 -_0800A5C4: .4byte 0x0600D000 -_0800A5C8: .4byte 0x80000800 -_0800A5CC: .4byte gUnknown_080DCD20 -_0800A5D0: .4byte 0x0600E000 -_0800A5D4: .4byte 0x80000400 -_0800A5D8: .4byte gUnknown_080D4900 -_0800A5DC: .4byte 0x0600E800 -_0800A5E0: .4byte gUnknown_080D5900 -_0800A5E4: .4byte 0x0600F800 -_0800A5E8: .4byte gUnknown_080DD520 -_0800A5EC: .4byte gUnknown_03005C00 -_0800A5F0: .4byte gUnknown_080DDD20 -_0800A5F4: .4byte gUnknown_0201B180 -_0800A5F8: .4byte gUnknown_080D6100 -_0800A5FC: .4byte 0x80003600 -_0800A600: .4byte gUnknown_080D4700 -_0800A604: .4byte 0x80000070 -_0800A608: .4byte gUnknown_080DF520 -_0800A60C: .4byte 0x06010000 -_0800A610: .4byte 0x80001000 -_0800A614: .4byte 0x05000200 -_0800A618: .4byte gMain -_0800A61C: .4byte gUnknown_0202ADA0 -_0800A620: .4byte 0x000002F6 -_0800A624: .4byte gUnknown_0202C790 - - thumb_func_start sub_A628 -sub_A628: @ 0x0800A628 - ldr r1, _0800A65C @ =gUnknown_0202ADA0 - movs r2, #0 - movs r0, #0x2c - strh r0, [r1] - ldr r0, _0800A660 @ =0x0000FF8E - strh r0, [r1, #2] - ldr r3, _0800A664 @ =gUnknown_0201A450 - adds r0, #0x46 - strh r0, [r3] - movs r0, #0x72 - strh r0, [r3, #2] - ldr r0, _0800A668 @ =0x0000FFCE - strh r0, [r1, #0xc] - movs r0, #0x1e - strh r0, [r1, #0xe] - strh r2, [r1, #0x18] - strh r2, [r1, #0x1a] - strh r2, [r1, #0x20] - strh r2, [r1, #0x24] - strh r2, [r1, #0x26] - ldr r0, _0800A66C @ =gUnknown_0202BF10 - strh r2, [r0] - ldr r0, _0800A670 @ =gUnknown_0202A578 - strh r2, [r0] - bx lr - .align 2, 0 -_0800A65C: .4byte gUnknown_0202ADA0 -_0800A660: .4byte 0x0000FF8E -_0800A664: .4byte gUnknown_0201A450 -_0800A668: .4byte 0x0000FFCE -_0800A66C: .4byte gUnknown_0202BF10 -_0800A670: .4byte gUnknown_0202A578 - - thumb_func_start sub_A674 -sub_A674: @ 0x0800A674 - push {r4, lr} - ldr r4, _0800A6FC @ =gUnknown_0202ADA0 - ldrh r0, [r4] - subs r0, #0x11 - strh r0, [r4] - ldrh r0, [r4, #2] - adds r0, #0xa - strh r0, [r4, #2] - ldr r1, _0800A700 @ =gUnknown_0201A450 - ldrh r0, [r1] - adds r0, #0x11 - strh r0, [r1] - ldrh r0, [r1, #2] - subs r0, #0xa - strh r0, [r1, #2] - ldrh r0, [r4, #0x18] - adds r0, #0x10 - strh r0, [r4, #0x18] - ldrh r0, [r4, #0xc] - adds r0, #4 - strh r0, [r4, #0xc] - ldrh r0, [r4, #0xe] - subs r0, #8 - strh r0, [r4, #0xe] - ldrh r0, [r4, #0x20] - adds r0, #1 - strh r0, [r4, #0x20] - lsls r0, r0, #0x10 - asrs r0, r0, #0x10 - cmp r0, #9 - ble _0800A6BE - movs r0, #0 - strh r0, [r4, #0x20] - ldr r1, _0800A704 @ =gUnknown_0202C790 - ldrb r0, [r1] - adds r0, #1 - strb r0, [r1] -_0800A6BE: - bl sub_A87C - ldr r1, _0800A708 @ =gMain - ldrh r2, [r4] - movs r3, #0xba - lsls r3, r3, #2 - adds r0, r1, r3 - strh r2, [r0] - ldrh r2, [r4, #2] - adds r3, #2 - adds r0, r1, r3 - strh r2, [r0] - ldrh r2, [r4, #0xc] - adds r3, #2 - adds r0, r1, r3 - strh r2, [r0] - ldrh r2, [r4, #0xe] - adds r3, #2 - adds r0, r1, r3 - strh r2, [r0] - ldrh r2, [r4, #0x18] - adds r3, #2 - adds r0, r1, r3 - strh r2, [r0] - ldrh r0, [r4, #0x1a] - ldr r2, _0800A70C @ =0x000002F2 - adds r1, r1, r2 - strh r0, [r1] - pop {r4} - pop {r0} - bx r0 - .align 2, 0 -_0800A6FC: .4byte gUnknown_0202ADA0 -_0800A700: .4byte gUnknown_0201A450 -_0800A704: .4byte gUnknown_0202C790 -_0800A708: .4byte gMain -_0800A70C: .4byte 0x000002F2 - - thumb_func_start sub_A710 -sub_A710: @ 0x0800A710 - push {r4, r5, r6, lr} - ldr r5, _0800A7C8 @ =gUnknown_0202ADA0 - ldrh r0, [r5, #0x24] - subs r0, #1 - movs r6, #0 - strh r0, [r5, #0x24] - ldr r2, _0800A7CC @ =gUnknown_0202BF10 - ldrh r0, [r2] - movs r1, #1 - ands r0, r1 - cmp r0, #0 - bne _0800A742 - ldrh r0, [r5] - subs r0, #1 - strh r0, [r5] - ldrh r0, [r5, #2] - adds r0, #1 - strh r0, [r5, #2] - ldr r1, _0800A7D0 @ =gUnknown_0201A450 - ldrh r0, [r1] - adds r0, #2 - strh r0, [r1] - ldrh r0, [r1, #2] - subs r0, #2 - strh r0, [r1, #2] -_0800A742: - movs r1, #0 - ldrsh r0, [r2, r1] - movs r1, #3 - bl __modsi3 - lsls r0, r0, #0x10 - cmp r0, #0 - bne _0800A776 - ldr r0, _0800A7D4 @ =0x040000D4 - movs r3, #0xa0 - lsls r3, r3, #0x13 - str r3, [r0] - ldr r4, _0800A7D8 @ =gUnknown_0202BE70 - str r4, [r0, #4] - ldr r1, _0800A7DC @ =0x80000010 - str r1, [r0, #8] - ldr r2, [r0, #8] - ldr r2, _0800A7E0 @ =0x05000040 - str r2, [r0] - str r3, [r0, #4] - str r1, [r0, #8] - ldr r3, [r0, #8] - str r4, [r0] - str r2, [r0, #4] - str r1, [r0, #8] - ldr r0, [r0, #8] -_0800A776: - ldr r4, _0800A7E4 @ =gMain - ldrh r1, [r5] - movs r2, #0xba - lsls r2, r2, #2 - adds r0, r4, r2 - strh r1, [r0] - ldrh r1, [r5, #2] - adds r2, #2 - adds r0, r4, r2 - strh r1, [r0] - ldrh r1, [r5, #0x24] - adds r2, #0xa - adds r0, r4, r2 - strh r1, [r0] - ldrh r1, [r5, #0x26] - adds r2, #2 - adds r0, r4, r2 - strh r1, [r0] - bl sub_A87C - movs r1, #0x20 - ldrsh r0, [r5, r1] - cmp r0, #2 - bne _0800A7F4 - ldr r1, _0800A7D4 @ =0x040000D4 - ldr r0, _0800A7E8 @ =gUnknown_03005C00 - str r0, [r1] - ldr r0, _0800A7EC @ =0x0600E000 - str r0, [r1, #4] - ldr r0, _0800A7F0 @ =0x80000400 - str r0, [r1, #8] - ldr r0, [r1, #8] - strh r6, [r5, #0xc] - strh r6, [r5, #0xe] - movs r2, #0xbb - lsls r2, r2, #2 - adds r0, r4, r2 - strh r6, [r0] - movs r1, #0 - adds r2, #2 - b _0800A818 - .align 2, 0 -_0800A7C8: .4byte gUnknown_0202ADA0 -_0800A7CC: .4byte gUnknown_0202BF10 -_0800A7D0: .4byte gUnknown_0201A450 -_0800A7D4: .4byte 0x040000D4 -_0800A7D8: .4byte gUnknown_0202BE70 -_0800A7DC: .4byte 0x80000010 -_0800A7E0: .4byte 0x05000040 -_0800A7E4: .4byte gMain -_0800A7E8: .4byte gUnknown_03005C00 -_0800A7EC: .4byte 0x0600E000 -_0800A7F0: .4byte 0x80000400 -_0800A7F4: - cmp r0, #4 - bne _0800A81C - ldr r1, _0800A840 @ =0x040000D4 - ldr r0, _0800A844 @ =gUnknown_0201B180 - str r0, [r1] - ldr r0, _0800A848 @ =0x0600E000 - str r0, [r1, #4] - ldr r0, _0800A84C @ =0x80000400 - str r0, [r1, #8] - ldr r0, [r1, #8] - strh r6, [r5, #0xc] - strh r6, [r5, #0xe] - movs r1, #0xbb - lsls r1, r1, #2 - adds r0, r4, r1 - strh r6, [r0] - movs r1, #0 - ldr r2, _0800A850 @ =0x000002EE -_0800A818: - adds r0, r4, r2 - strh r1, [r0] -_0800A81C: - ldr r1, _0800A854 @ =gUnknown_0202ADA0 - ldrh r0, [r1, #0x20] - adds r0, #1 - strh r0, [r1, #0x20] - lsls r0, r0, #0x10 - asrs r0, r0, #0x10 - cmp r0, #0x1d - ble _0800A838 - movs r0, #0 - strh r0, [r1, #0x20] - ldr r1, _0800A858 @ =gUnknown_0202C790 - ldrb r0, [r1] - adds r0, #2 - strb r0, [r1] -_0800A838: - pop {r4, r5, r6} - pop {r0} - bx r0 - .align 2, 0 -_0800A840: .4byte 0x040000D4 -_0800A844: .4byte gUnknown_0201B180 -_0800A848: .4byte 0x0600E000 -_0800A84C: .4byte 0x80000400 -_0800A850: .4byte 0x000002EE -_0800A854: .4byte gUnknown_0202ADA0 -_0800A858: .4byte gUnknown_0202C790 - - thumb_func_start nullsub_8 -nullsub_8: @ 0x0800A85C - bx lr - thumb_func_start sub_A860 sub_A860: @ 0x0800A860 push {lr} diff --git a/include/functions.h b/include/functions.h index c246e50..539fc27 100644 --- a/include/functions.h +++ b/include/functions.h @@ -172,11 +172,11 @@ extern void sub_FF74(void (*func)(void)); extern void sub_1001C(int); //extern ? sub_10170(); //extern ? sub_102A8(); -//extern ? sub_10424(); -//extern ? sub_10480(); +extern void sub_10424(void); +extern void sub_10480(void); extern void sub_1050C(void); //extern ? sub_10528(); -//extern ? sub_10544(); +extern void sub_10544(void); //extern ? sub_105A0(); // src/intro.c @@ -204,12 +204,12 @@ extern void nullsub_4(void); //extern ? nullsub_5(); //extern ? nullsub_17(); //extern ? sub_9C9C(); -//extern ? sub_9CB8(); -//extern ? sub_9D70(); -//extern ? sub_9E90(); +extern void sub_9CB8(void); +extern void sub_9D70(void); +extern void sub_9E90(void); //extern ? sub_A154(); //extern ? sub_A16C(); -//extern ? sub_A2A8(); +extern void sub_A2A8(void); //extern ? nullsub_6(); //extern ? sub_A2F0(); //extern ? nullsub_7(); diff --git a/include/variables.h b/include/variables.h index 66e7ed1..68449ec 100644 --- a/include/variables.h +++ b/include/variables.h @@ -247,6 +247,7 @@ extern u16 gUnknown_0805C7C0[]; extern u16 gUnknown_0202A590[]; extern u16 gUnknown_08086B40[]; extern s16 gUnknown_086A61BC[]; +extern s16 gUnknown_086A77A8[][10][2]; extern u8 gUnknown_0201B124; extern struct PokemonSpecies gUnknown_086A3700[]; @@ -266,4 +267,13 @@ extern s8 gUnknown_0202A564; extern s8 gUnknown_02019C20; extern s8 gUnknown_0202ADE8; +extern struct UnkStruct_086A7768 gUnknown_086A7768[0x8]; +extern s16 gUnknown_086A7788[0x8]; +extern s16 gUnknown_0202ADA0[]; +extern s32 gUnknown_0202BEF0; +extern const struct SpriteSet *const gUnknown_086A769C[]; +extern struct SpriteGroup gUnknown_0200D078[]; +extern struct UnkStruct_086A7768 gUnknown_086A7798[0x4]; +extern s32 gUnknown_0201C188; + #endif // GUARD_VARIABLES_H diff --git a/src/intro.c b/src/intro.c index 3f1a62b..2cc578d 100644 --- a/src/intro.c +++ b/src/intro.c @@ -2,10 +2,13 @@ #include "functions.h" #include "main.h" #include "m4a.h" +#include "variables.h" #include "titlescreen.h" extern void sub_10170(u8 *, u32, u32, u32); void sub_FEB8(u32, u8 *, u32); +void sub_A628(void); +void sub_A87C(void); extern StateFunc gIntroStateFuncs[15]; extern u8 gUnknown_080798C0[]; @@ -21,19 +24,39 @@ extern u8 gUnknown_080BB4C0[]; extern u8 gUnknown_080B3CA0[]; extern u8 gUnknown_080B44A0[]; extern u8 gUnknown_080BD4C0[]; +extern s16 gUnknown_086A7788[0x8]; -extern u8 gUnknown_0201C1C0[]; -extern u16 gUnknown_0202ADA0[]; +extern u16 gUnknown_0201C1C0[]; +extern s16 gUnknown_0202ADA0[]; extern s16 gUnknown_0202BF10; extern u8 gUnknown_0201C1B8; extern u8 gUnknown_0202ADD4; -extern u16 gUnknown_0202C594; -extern u32 gUnknown_02019C30; -extern u32 gUnknown_0201C188; +extern s16 gUnknown_0202C594; +extern s32 gUnknown_02019C30; +extern s32 gUnknown_0201C188; extern s16 gUnknown_0202A578; -extern u32 gUnknown_0202BEF0; +extern s32 gUnknown_0202BEF0; extern s8 gUnknown_0202C5A8; extern s8 gUnknown_0202C790; +extern u8 gUnknown_0202BE70[]; + +extern u8 gUnknown_080CBEE0[]; +extern u8 gUnknown_080CC6E0[]; +extern u8 gUnknown_080CBCE0[]; +extern u8 gUnknown_080D0700[]; +extern u8 gUnknown_080D2700[]; + +extern u8 gUnknown_0201B180[]; + +extern u8 gUnknown_080D4700[]; +extern u8 gUnknown_080DE520[]; +extern u8 gUnknown_080DCD20[]; +extern u8 gUnknown_080D4900[]; +extern u8 gUnknown_080D5900[]; +extern u8 gUnknown_080D6100[]; +extern u8 gUnknown_080DD520[]; +extern u8 gUnknown_080DDD20[]; +extern u8 gUnknown_080DF520[]; typedef void (*OtherFunc)(void); extern OtherFunc gUnknown_080792E0[10]; @@ -44,8 +67,8 @@ struct unkStruct_201A450 u16 unk2; u8 fill4[0x8 - 4]; s16 unk8; - u16 unkA; - u8 unkC; + s16 unkA; + s8 unkC; u8 fillD[0x10 - 0xD]; u16 unk10; u16 unk12; @@ -62,7 +85,7 @@ struct unkStruct_201A450 u16 unk30; u16 unk32; u8 fill34[0x3A - 0x34]; - u16 unk3A; + s16 unk3A; u8 unk3C; u8 fill3D[0x40 - 0x3D]; u16 unk40; @@ -73,6 +96,14 @@ struct unkStruct_201A450 extern struct unkStruct_201A450 gUnknown_0201A450; +struct UnkStruct_086A7768 { + s16 unk0; + s16 unk2; +}; + +extern struct UnkStruct_086A7768 gUnknown_086A7768[0x8]; +extern struct UnkStruct_086A7768 gUnknown_086A7798[0x4]; + void IntroMain(void) { gIntroStateFuncs[gMain.subState](); } @@ -188,44 +219,1160 @@ void sub_9498(void) { void sub_96A8(void) { - gUnknown_0201A450.unk10 = 0x78; - gUnknown_0201A450.unk12 = 0x50; - gUnknown_0201A450.unk18 = 0; - gUnknown_0201A450.unk1C = 1; - gUnknown_0201A450.unk30 = 0x9c; - gUnknown_0201A450.unk32 = 0x92; - gUnknown_0201A450.unk3C = 0; - gUnknown_0201A450.unk3A = 0; - gUnknown_0201A450.unk20 = 0x9d; - gUnknown_0201A450.unk22 = 0x93; - gUnknown_0201A450.unk2C = 0; - gUnknown_0201A450.unk40 = 0x80; - gUnknown_0201A450.unk42 = 0x80; - gUnknown_0201A450.unk4C = 1; - gUnknown_0202ADA0[0] = 0xffa8; - gUnknown_0202ADA0[1] = 0xffca; - gUnknown_0202ADA0[4] = 0; - gUnknown_0202ADA0[5] = 0; - gUnknown_0202ADA0[6] = 0x100; - gUnknown_0202ADA0[7] = 0; - gUnknown_0202ADA0[10] = 0; - gUnknown_0202ADA0[18] = 0xfb; - gUnknown_0202ADA0[19] = 0; - gUnknown_0202ADA0[22] = 0; - gUnknown_0202ADA0[12] = 0; - gUnknown_0202ADA0[13] = 0; - gUnknown_0201A450.unk0 = 0x78; - gUnknown_0201A450.unk2 = 0x50; - gUnknown_0201A450.unk8 = 0; - gUnknown_0201A450.unkA = 0; - gUnknown_0201A450.unkC = 1; - gUnknown_0201C1B8 = 0; - gUnknown_0202ADD4 = 0x10; - gUnknown_0202C594 = 0; - gUnknown_02019C30 = 0x100; - gUnknown_0201C188 = 0x100; - gUnknown_0202BF10 = 0; - gUnknown_0202A578 = 0; - gUnknown_0202BEF0 = 0x20; - gUnknown_0202C5A8 = 8; + gUnknown_0201A450.unk10 = 0x78; + gUnknown_0201A450.unk12 = 0x50; + gUnknown_0201A450.unk18 = 0; + gUnknown_0201A450.unk1C = 1; + gUnknown_0201A450.unk30 = 0x9c; + gUnknown_0201A450.unk32 = 0x92; + gUnknown_0201A450.unk3C = 0; + gUnknown_0201A450.unk3A = 0; + gUnknown_0201A450.unk20 = 0x9d; + gUnknown_0201A450.unk22 = 0x93; + gUnknown_0201A450.unk2C = 0; + gUnknown_0201A450.unk40 = 0x80; + gUnknown_0201A450.unk42 = 0x80; + gUnknown_0201A450.unk4C = 1; + gUnknown_0202ADA0[0] = 0xffa8; + gUnknown_0202ADA0[1] = 0xffca; + gUnknown_0202ADA0[4] = 0; + gUnknown_0202ADA0[5] = 0; + gUnknown_0202ADA0[6] = 0x100; + gUnknown_0202ADA0[7] = 0; + gUnknown_0202ADA0[10] = 0; + gUnknown_0202ADA0[18] = 0xfb; + gUnknown_0202ADA0[19] = 0; + gUnknown_0202ADA0[22] = 0; + gUnknown_0202ADA0[12] = 0; + gUnknown_0202ADA0[13] = 0; + gUnknown_0201A450.unk0 = 0x78; + gUnknown_0201A450.unk2 = 0x50; + gUnknown_0201A450.unk8 = 0; + gUnknown_0201A450.unkA = 0; + gUnknown_0201A450.unkC = 1; + gUnknown_0201C1B8 = 0; + gUnknown_0202ADD4 = 0x10; + gUnknown_0202C594 = 0; + gUnknown_02019C30 = 0x100; + gUnknown_0201C188 = 0x100; + gUnknown_0202BF10 = 0; + gUnknown_0202A578 = 0; + gUnknown_0202BEF0 = 0x20; + gUnknown_0202C5A8 = 8; +} + +void sub_978C(void) +{ + sub_9CB8(); + + if (gUnknown_0201A450.unk8 == 0x24) { + gUnknown_0201A450.unkA = gUnknown_0201A450.unkA + 1; + + if (0x1b < gUnknown_0201A450.unkA) { + gUnknown_0201A450.unkA = 0; + gUnknown_0202A578 = 0; + gUnknown_0202C790++; + } + } + else { + gUnknown_0201A450.unkA = gUnknown_0201A450.unkA + 1; + + if (1 < gUnknown_0201A450.unkA) { + gUnknown_0201A450.unkA = 0; + gUnknown_0201A450.unk8 = gUnknown_0201A450.unk8 + 1; + } + + if (gUnknown_0202BF10 >= gUnknown_086A77A8[gUnknown_0202C5A8][gUnknown_0202A578][1]) { + m4aSongNumStart(gUnknown_086A77A8[gUnknown_0202C5A8][gUnknown_0202A578][0]); + gUnknown_0202A578 = gUnknown_0202A578 + 1; + } + } +} + +void sub_9830(void) +{ + gUnknown_02019C30 -= 0x10; + gUnknown_0201C188 -= 0x10; + gUnknown_0201A450.unk0--; + + if (gUnknown_02019C30 < 0x20) + { + gUnknown_0201A450.unkA = 0; + gUnknown_0201A450.unk8 = 0x25; + gUnknown_0202C790++; + } + + sub_9D70(); +} + +void sub_9878(void) +{ + gUnknown_0201A450.unkA++; + + if (gUnknown_0201A450.unkA > 3) + { + gUnknown_0201A450.unkA = 0; + gUnknown_0201A450.unk0 = 0x78; + gUnknown_0201A450.unk2 = 0x58; + gUnknown_0201A450.unkC = 1; + m4aSongNumStart(0xD8); + gUnknown_0202C790++; + } +} + +void sub_98B4(void) +{ + if (gUnknown_0201A450.unk8 == 0x2B) + { + gUnknown_0201A450.unkA++; + if (gUnknown_0201A450.unkA > 1) + { + gUnknown_0201A450.unkC = 0; + sub_10170(&gIntroScene1Sprites_Pals[0x1C0], BG_PLTT + 0xE0, 0x20, 0); + m4aSongNumStart(0x8); + gUnknown_0202C790++; + } + } + else + { + gUnknown_0201A450.unkA++; + if (gUnknown_0201A450.unkA > 1) + { + gUnknown_0201A450.unkA = 0; + gUnknown_0201A450.unk8++; + } + } + + sub_9CB8(); +} + +void sub_9920(void) +{ + s32 remainder; + + remainder = gUnknown_0202BF10 % 3; + if (remainder == 0) + { + if (gUnknown_0202C594 < 8) + { + gUnknown_0202C594++; + gUnknown_0201C1B8++; + gUnknown_0202ADD4--; + } + else + { + sub_10708(&gUnknown_0201C1C0, (void *) 0x60036e0, 8, 8); + gUnknown_0202C790++; + } + + gUnknown_0201A450.unk18 = 1 - gUnknown_0201A450.unk18; + } + + sub_9E90(); +} + +void sub_999C(void) +{ + if (gUnknown_0202BEF0 > 0) + { + gUnknown_0202BEF0 -= 2; + if (gUnknown_0202BEF0 < 1) + { + gUnknown_0202BEF0 = 0; + } + sub_10170(gIntroScene1Sprites_Pals, BG_PLTT, 0x200, (u16) gUnknown_0202BEF0); + sub_10170(gIntroScene1Sprites_Pals, OBJ_PLTT, 0x20, (u16) gUnknown_0202BEF0); + } + + if (gUnknown_0202BF10 % 3 == 0) + { + gUnknown_0201A450.unk18 = 1 - gUnknown_0201A450.unk18; + } + + gUnknown_0202ADA0[0]--; + + if ((gUnknown_0202BF10 % 2) == 0) + { + gUnknown_0202ADA0[1]--; + } + + gMain.unk2E8[0].unk0 = gUnknown_0202ADA0[0]; + gMain.unk2E8[0].unk2 = gUnknown_0202ADA0[1]; + gUnknown_0202ADA0[5]++; + + if (gUnknown_0202ADA0[5] > gUnknown_086A7768[gUnknown_0202ADA0[4]].unk2) + { + sub_10708(&gUnknown_0201C1C0[gUnknown_086A7788[gUnknown_0202ADA0[4]]], (void *) 0x60036E0, 8, 8); + gUnknown_0202ADA0[4]++; + if (gUnknown_0202ADA0[4] > 3) + { + gUnknown_0201A450.unk3C = 1; + gUnknown_0201A450.unk2C = 1; + gUnknown_0201A450.unk1C = 0; + gUnknown_0202ADA0[10] = 0; + gUnknown_0202C790++; + } + } + + sub_9E90(); +} + +void sub_9AB8(void) +{ + gUnknown_0201A450.unk30 -= 0xE; + gUnknown_0201A450.unk32 -= 0xD; + + gUnknown_0202ADA0[0x12] -= 0x10; + gUnknown_0202ADA0[0x13] += 1; + gUnknown_0202ADA0[0x6] -= 0x10; + + gUnknown_0201A450.unk20 -= 0xE; + gUnknown_0201A450.unk22 -= 0xD; + gUnknown_0201A450.unk40 += 0xB; + gUnknown_0201A450.unk42 -= 0x2; + + if (gUnknown_0202BF10 % 2 == 0) + { + gUnknown_0202ADA0[0x0]--; + gUnknown_0202ADA0[0x1]--; + } + + gUnknown_0202ADA0[0x5]++; + + if (gUnknown_0202ADA0[0x5] > gUnknown_086A7768[gUnknown_0202ADA0[0x4]].unk2) + { + if (gUnknown_0202ADA0[0x4] < 7) + { + sub_10708(&gUnknown_0201C1C0[gUnknown_086A7788[gUnknown_0202ADA0[0x4]]], (void *)0x60036e0, 8, 8); + } + else + { + sub_10708(&gUnknown_0201C1C0[gUnknown_086A7788[gUnknown_0202ADA0[0x4]]], (void *)0x60032c0, 10, 10); + } + gUnknown_0202ADA0[0x4]++; + } + + gUnknown_0202ADA0[0xA]++; + if (gUnknown_0202ADA0[0xA] > 9) + { + gUnknown_0202ADA0[0xA] = 0; + gUnknown_0202C790 += 2; + } + + sub_9E90(); + gMain.unk2E8[0].unk0 = gUnknown_0202ADA0[0x0]; + gMain.unk2E8[0].unk2 = gUnknown_0202ADA0[0x1]; + gMain.unk2E8[1].unk0 = gUnknown_0202ADA0[0x12]; + gMain.unk2E8[1].unk2 = gUnknown_0202ADA0[0x13]; + gMain.unk2E8[2].unk0 = gUnknown_0202ADA0[0x6]; + gMain.unk2E8[2].unk2 = gUnknown_0202ADA0[0x7]; +} + +void nullsub_4(void) +{ +} + +void sub_9C10(void) +{ + gUnknown_0202ADA0[0xC]++; + + if (gUnknown_0202BF10 % 2 == 0) + { + gUnknown_0201A450.unk30--; + gUnknown_0201A450.unk32--; + gUnknown_0201A450.unk20 -= 2; + gUnknown_0201A450.unk22 -= 2; + } + + sub_9E90(); + + gMain.unk2E8[3].unk0 = gUnknown_0202ADA0[0xC]; + gMain.unk2E8[3].unk2 = gUnknown_0202ADA0[0xD]; + gUnknown_0201A450.unk3A++; + + if (gUnknown_0201A450.unk3A > 0x14) + { + gUnknown_0201A450.unk3A = 0; + gUnknown_0202C790 += 3; + } +} + +void nullsub_5(void) +{ +} + +void nullsub_17(void) +{ +} + +void sub_9C9C(void) +{ + sub_10480(); + sub_10544(); + gUnknown_0202C790++; +} + +void sub_9CB8(void) +{ + s32 i; + struct OamDataSimple *test2; + struct SpriteGroup *puVar4; + const struct SpriteSet *puVar6; + + puVar4 = &gUnknown_0200B3B8[4 + gUnknown_0201A450.unk8]; + puVar4->available = gUnknown_0201A450.unkC; + LoadSpriteSets(gUnknown_086A769C, 0x31, gUnknown_0200B3B8); + + if (puVar4->available == 1) + { + puVar4->baseX = gUnknown_0201A450.unk0; + puVar4->baseY = gUnknown_0201A450.unk2; + + puVar6 = gUnknown_086A769C[gUnknown_0201A450.unk8 + 4]; + for (i = 0; i < puVar6->count; i++) + { + test2 = &puVar4->oam[i]; + gOamBuffer[test2->oamId].x = test2->xOffset + puVar4->baseX; + gOamBuffer[test2->oamId].y = test2->yOffset + puVar4->baseY; + } + } + + puVar4->available = 0; +} + +void sub_9D70(void) +{ + s32 i; + struct SpriteGroup *puVar4; + struct OamDataSimple *puVar2; + + puVar4 = &gUnknown_0200B3B8[0x28]; + puVar4->available = gUnknown_0201A450.unkC; + LoadSpriteSets(gUnknown_086A769C, 0x31, gUnknown_0200B3B8); + + if (puVar4->available == 1) + { + SetMatrixScale(gUnknown_02019C30, gUnknown_0201C188, 0); + puVar4->baseX = gUnknown_0201A450.unk0; + puVar4->baseY = gUnknown_0201A450.unk2; + + for (i = 0; i < 4; i++) + { + puVar2 = &puVar4->oam[i]; + gOamBuffer[puVar2->oamId].x = gUnknown_086A7798[i].unk0 * gUnknown_02019C30 / 0x100 + puVar4->baseX; + gOamBuffer[puVar2->oamId].y = gUnknown_086A7798[i].unk2 * gUnknown_0201C188 / 0x100 + puVar4->baseY; + + gOamBuffer[puVar2->oamId].affineMode = 1; + gOamBuffer[puVar2->oamId].matrixNum = 0; + } + } + puVar4->available = 0; +} + +#ifdef NONMATCHING +void sub_9E90(void) +{ + gMain.blendControl = 0xF10; + gMain.blendAlpha = gUnknown_0201C1B8 | (gUnknown_0202ADD4 << 8); + REG_BLDCNT = gMain.blendControl; + REG_BLDALPHA = gMain.blendAlpha; + + gMain.spriteGroups[gUnknown_0201A450.unk18].available = gUnknown_0201A450.unk1C; + gMain.spriteGroups[3].available = gUnknown_0201A450.unk2C; + gMain.spriteGroups[2].available = gUnknown_0201A450.unk3C; + gMain.spriteGroups[0x30].available = gUnknown_0201A450.unk4C; // 80 + LoadSpriteSets(gUnknown_086A769C, 0x31, gMain.spriteGroups); + + if (gUnknown_0201A450.unk1C == 1) + { + // ... + } + // ... +} +#else +NAKED +void sub_9E90(void) +{ + asm_unified("\n\ + push {r4, r5, r6, r7, lr}\n\ + mov r7, sl\n\ + mov r6, sb\n\ + mov r5, r8\n\ + push {r5, r6, r7}\n\ + sub sp, #4\n\ + ldr r3, _0800A12C @ =gMain\n\ + ldrh r0, [r3, #0x38]\n\ + movs r0, #0xf1\n\ + lsls r0, r0, #4\n\ + strh r0, [r3, #0x38]\n\ + ldr r0, _0800A130 @ =gUnknown_0201C1B8\n\ + ldrb r1, [r0]\n\ + ldr r0, _0800A134 @ =gUnknown_0202ADD4\n\ + ldrb r0, [r0]\n\ + lsls r0, r0, #8\n\ + orrs r1, r0\n\ + ldrh r0, [r3, #0x3a]\n\ + strh r1, [r3, #0x3a]\n\ + ldr r1, _0800A138 @ =0x04000050\n\ + ldrh r0, [r3, #0x38]\n\ + strh r0, [r1]\n\ + adds r1, #2\n\ + ldrh r0, [r3, #0x3a]\n\ + strh r0, [r1]\n\ + ldr r4, _0800A13C @ =gUnknown_0201A450\n\ + movs r0, #0x18\n\ + ldrsh r1, [r4, r0]\n\ + movs r0, #0xb8\n\ + muls r0, r1, r0\n\ + movs r1, #0xbe\n\ + lsls r1, r1, #2\n\ + adds r2, r3, r1\n\ + adds r0, r0, r2\n\ + mov r8, r0\n\ + movs r6, #0xa4\n\ + lsls r6, r6, #3\n\ + adds r6, r6, r3\n\ + mov sb, r6\n\ + movs r7, #0x8d\n\ + lsls r7, r7, #3\n\ + adds r7, r7, r3\n\ + mov sl, r7\n\ + movs r0, #0x1c\n\ + ldrsb r0, [r4, r0]\n\ + mov r1, r8\n\ + strh r0, [r1]\n\ + adds r0, r4, #0\n\ + adds r0, #0x2c\n\ + ldrb r0, [r0]\n\ + lsls r0, r0, #0x18\n\ + asrs r0, r0, #0x18\n\ + strh r0, [r6]\n\ + adds r0, r4, #0\n\ + adds r0, #0x3c\n\ + ldrb r0, [r0]\n\ + lsls r0, r0, #0x18\n\ + asrs r0, r0, #0x18\n\ + strh r0, [r7]\n\ + adds r0, r4, #0\n\ + adds r0, #0x4c\n\ + ldrb r0, [r0]\n\ + lsls r0, r0, #0x18\n\ + asrs r0, r0, #0x18\n\ + ldr r6, _0800A140 @ =gUnknown_0200D638\n\ + strh r0, [r6]\n\ + ldr r5, _0800A144 @ =gUnknown_086A769C\n\ + adds r0, r5, #0\n\ + movs r1, #0x31\n\ + bl LoadSpriteSets\n\ + mov r7, r8\n\ + ldrh r0, [r7]\n\ + cmp r0, #1\n\ + bne _08009F9E\n\ + ldrh r0, [r4, #0x10]\n\ + strh r0, [r7, #2]\n\ + ldrh r0, [r4, #0x12]\n\ + strh r0, [r7, #4]\n\ + movs r1, #0x18\n\ + ldrsh r0, [r4, r1]\n\ + lsls r0, r0, #2\n\ + adds r0, r0, r5\n\ + ldr r0, [r0]\n\ + str r0, [sp]\n\ + movs r5, #0\n\ + ldrh r2, [r0]\n\ + cmp r5, r2\n\ + bge _08009F9E\n\ + ldr r7, _0800A148 @ =gOamBuffer\n\ + ldr r6, _0800A14C @ =0xFFFFFE00\n\ + mov ip, r6\n\ + mov r4, r8\n\ + adds r4, #8\n\ +_08009F4C:\n\ + ldrh r2, [r4]\n\ + lsls r2, r2, #3\n\ + adds r2, r2, r7\n\ + ldrb r1, [r2, #1]\n\ + movs r0, #0xd\n\ + rsbs r0, r0, #0\n\ + ands r0, r1\n\ + movs r1, #4\n\ + orrs r0, r1\n\ + strb r0, [r2, #1]\n\ + ldrh r3, [r4]\n\ + lsls r3, r3, #3\n\ + adds r3, r3, r7\n\ + movs r0, #2\n\ + ldrsh r1, [r4, r0]\n\ + mov r2, r8\n\ + movs r6, #2\n\ + ldrsh r0, [r2, r6]\n\ + adds r1, r1, r0\n\ + ldr r2, _0800A150 @ =0x000001FF\n\ + adds r0, r2, #0\n\ + ands r1, r0\n\ + ldrh r2, [r3, #2]\n\ + mov r0, ip\n\ + ands r0, r2\n\ + orrs r0, r1\n\ + strh r0, [r3, #2]\n\ + ldrh r1, [r4]\n\ + lsls r1, r1, #3\n\ + adds r1, r1, r7\n\ + mov r6, r8\n\ + ldrb r0, [r6, #4]\n\ + ldrb r2, [r4, #4]\n\ + adds r0, r0, r2\n\ + strb r0, [r1]\n\ + adds r4, #8\n\ + adds r5, #1\n\ + ldr r6, [sp]\n\ + ldrh r6, [r6]\n\ + cmp r5, r6\n\ + blt _08009F4C\n\ +_08009F9E:\n\ + mov r7, sb\n\ + ldrh r0, [r7]\n\ + cmp r0, #1\n\ + bne _0800A01C\n\ + ldr r0, _0800A13C @ =gUnknown_0201A450\n\ + ldrh r1, [r0, #0x20]\n\ + strh r1, [r7, #2]\n\ + ldrh r0, [r0, #0x22]\n\ + strh r0, [r7, #4]\n\ + ldr r6, _0800A148 @ =gOamBuffer\n\ + movs r0, #0xd\n\ + rsbs r0, r0, #0\n\ + mov ip, r0\n\ + mov r4, sb\n\ + adds r4, #8\n\ + movs r5, #3\n\ +_08009FBE:\n\ + ldrh r1, [r4]\n\ + lsls r1, r1, #3\n\ + adds r1, r1, r6\n\ + ldrb r2, [r1, #1]\n\ + mov r0, ip\n\ + ands r0, r2\n\ + movs r2, #4\n\ + orrs r0, r2\n\ + strb r0, [r1, #1]\n\ + ldrh r1, [r4]\n\ + lsls r1, r1, #3\n\ + adds r1, r1, r6\n\ + ldrb r2, [r1, #5]\n\ + mov r0, ip\n\ + ands r0, r2\n\ + movs r7, #4\n\ + orrs r0, r7\n\ + strb r0, [r1, #5]\n\ + ldrh r3, [r4]\n\ + lsls r3, r3, #3\n\ + adds r3, r3, r6\n\ + movs r0, #2\n\ + ldrsh r1, [r4, r0]\n\ + mov r2, sb\n\ + movs r7, #2\n\ + ldrsh r0, [r2, r7]\n\ + adds r1, r1, r0\n\ + ldr r2, _0800A150 @ =0x000001FF\n\ + adds r0, r2, #0\n\ + ands r1, r0\n\ + ldrh r2, [r3, #2]\n\ + ldr r0, _0800A14C @ =0xFFFFFE00\n\ + ands r0, r2\n\ + orrs r0, r1\n\ + strh r0, [r3, #2]\n\ + ldrh r1, [r4]\n\ + lsls r1, r1, #3\n\ + adds r1, r1, r6\n\ + mov r7, sb\n\ + ldrb r0, [r7, #4]\n\ + ldrb r2, [r4, #4]\n\ + adds r0, r0, r2\n\ + strb r0, [r1]\n\ + adds r4, #8\n\ + subs r5, #1\n\ + cmp r5, #0\n\ + bge _08009FBE\n\ +_0800A01C:\n\ + mov r6, sl\n\ + ldrh r0, [r6]\n\ + cmp r0, #1\n\ + bne _0800A098\n\ + ldr r0, _0800A13C @ =gUnknown_0201A450\n\ + ldrh r1, [r0, #0x30]\n\ + strh r1, [r6, #2]\n\ + ldrh r0, [r0, #0x32]\n\ + strh r0, [r6, #4]\n\ + ldr r6, _0800A148 @ =gOamBuffer\n\ + ldr r7, _0800A14C @ =0xFFFFFE00\n\ + mov ip, r7\n\ + mov r4, sl\n\ + adds r4, #8\n\ + movs r5, #3\n\ +_0800A03A:\n\ + ldrh r1, [r4]\n\ + lsls r1, r1, #3\n\ + adds r1, r1, r6\n\ + ldrb r2, [r1, #1]\n\ + movs r0, #0xd\n\ + rsbs r0, r0, #0\n\ + ands r0, r2\n\ + strb r0, [r1, #1]\n\ + ldrh r2, [r4]\n\ + lsls r2, r2, #3\n\ + adds r2, r2, r6\n\ + ldrb r1, [r2, #5]\n\ + movs r0, #0xd\n\ + rsbs r0, r0, #0\n\ + ands r0, r1\n\ + movs r1, #4\n\ + orrs r0, r1\n\ + strb r0, [r2, #5]\n\ + ldrh r3, [r4]\n\ + lsls r3, r3, #3\n\ + adds r3, r3, r6\n\ + movs r0, #2\n\ + ldrsh r1, [r4, r0]\n\ + mov r2, sl\n\ + movs r7, #2\n\ + ldrsh r0, [r2, r7]\n\ + adds r1, r1, r0\n\ + ldr r2, _0800A150 @ =0x000001FF\n\ + adds r0, r2, #0\n\ + ands r1, r0\n\ + ldrh r2, [r3, #2]\n\ + mov r0, ip\n\ + ands r0, r2\n\ + orrs r0, r1\n\ + strh r0, [r3, #2]\n\ + ldrh r1, [r4]\n\ + lsls r1, r1, #3\n\ + adds r1, r1, r6\n\ + mov r7, sl\n\ + ldrb r0, [r7, #4]\n\ + ldrb r2, [r4, #4]\n\ + adds r0, r0, r2\n\ + strb r0, [r1]\n\ + adds r4, #8\n\ + subs r5, #1\n\ + cmp r5, #0\n\ + bge _0800A03A\n\ +_0800A098:\n\ + ldr r6, _0800A140 @ =gUnknown_0200D638\n\ + ldrh r0, [r6]\n\ + cmp r0, #1\n\ + bne _0800A10A\n\ + ldr r0, _0800A13C @ =gUnknown_0201A450\n\ + adds r1, r0, #0\n\ + adds r1, #0x40\n\ + ldrh r1, [r1]\n\ + strh r1, [r6, #2]\n\ + adds r0, #0x42\n\ + ldrh r0, [r0]\n\ + strh r0, [r6, #4]\n\ + ldr r6, _0800A148 @ =gOamBuffer\n\ + movs r7, #0xd\n\ + rsbs r7, r7, #0\n\ + mov ip, r7\n\ + ldr r4, _0800A140 @ =gUnknown_0200D638\n\ + adds r4, #8\n\ + movs r5, #7\n\ +_0800A0BE:\n\ + ldrh r2, [r4]\n\ + lsls r2, r2, #3\n\ + adds r2, r2, r6\n\ + ldrb r1, [r2, #5]\n\ + mov r0, ip\n\ + ands r0, r1\n\ + movs r1, #8\n\ + orrs r0, r1\n\ + strb r0, [r2, #5]\n\ + ldrh r3, [r4]\n\ + lsls r3, r3, #3\n\ + adds r3, r3, r6\n\ + movs r0, #2\n\ + ldrsh r1, [r4, r0]\n\ + ldr r2, _0800A140 @ =gUnknown_0200D638\n\ + movs r7, #2\n\ + ldrsh r0, [r2, r7]\n\ + adds r1, r1, r0\n\ + ldr r2, _0800A150 @ =0x000001FF\n\ + adds r0, r2, #0\n\ + ands r1, r0\n\ + ldrh r2, [r3, #2]\n\ + ldr r0, _0800A14C @ =0xFFFFFE00\n\ + ands r0, r2\n\ + orrs r0, r1\n\ + strh r0, [r3, #2]\n\ + ldrh r1, [r4]\n\ + lsls r1, r1, #3\n\ + adds r1, r1, r6\n\ + ldr r7, _0800A140 @ =gUnknown_0200D638\n\ + ldrb r0, [r7, #4]\n\ + ldrb r2, [r4, #4]\n\ + adds r0, r0, r2\n\ + strb r0, [r1]\n\ + adds r4, #8\n\ + subs r5, #1\n\ + cmp r5, #0\n\ + bge _0800A0BE\n\ +_0800A10A:\n\ + movs r0, #0\n\ + mov r6, r8\n\ + strh r0, [r6]\n\ + mov r7, sb\n\ + strh r0, [r7]\n\ + mov r1, sl\n\ + strh r0, [r1]\n\ + ldr r2, _0800A140 @ =gUnknown_0200D638\n\ + strh r0, [r2]\n\ + add sp, #4\n\ + pop {r3, r4, r5}\n\ + mov r8, r3\n\ + mov sb, r4\n\ + mov sl, r5\n\ + pop {r4, r5, r6, r7}\n\ + pop {r0}\n\ + bx r0\n\ + .align 2, 0\n\ +_0800A12C: .4byte gMain\n\ +_0800A130: .4byte gUnknown_0201C1B8\n\ +_0800A134: .4byte gUnknown_0202ADD4\n\ +_0800A138: .4byte 0x04000050\n\ +_0800A13C: .4byte gUnknown_0201A450\n\ +_0800A140: .4byte gUnknown_0200D638\n\ +_0800A144: .4byte gUnknown_086A769C\n\ +_0800A148: .4byte gOamBuffer\n\ +_0800A14C: .4byte 0xFFFFFE00\n\ +_0800A150: .4byte 0x000001FF"); +} +#endif + +void sub_A154(void) +{ + sub_0518(); + gUnknown_0202C790++; +} + +void sub_A16C(void) +{ + // TODO use proper constants - see LoadEReaderGraphics? + REG_DISPCNT = 0; + REG_BG0CNT = 0xCC00; + REG_DISPCNT |= 0x100; + REG_BG1CNT = 0xDA01; + REG_DISPCNT |= 0x200; + REG_BG3CNT = 0x1E03; + REG_DISPCNT |= 0x800; + + DmaCopy16(3, gUnknown_080D0700, (void*) 0x06006000, 0x2000); + DmaCopy16(3, gUnknown_080D2700, (void*) 0x0600D000, 0x2000); + DmaCopy16(3, gUnknown_080CBEE0, (void*) 0x0600F000, 0x800); + DmaCopy16(3, gUnknown_080CC6E0, (void*) 0x06000000, 0x3C00); + DmaCopy16(3, gUnknown_080CBCE0, (void*) PLTT, 0x80); + sub_A2A8(); + gMain.unk2E8[0].unk0 = gUnknown_0202ADA0[0x0]; + gMain.unk2E8[0].unk2 = gUnknown_0202ADA0[0x1]; + gMain.unk2E8[1].unk0 = gUnknown_0202ADA0[0x6]; + gMain.unk2E8[1].unk2 = gUnknown_0202ADA0[0x7]; + gMain.unk2E8[3].unk0 = gUnknown_0202ADA0[0xC]; + gMain.unk2E8[3].unk2 = gUnknown_0202ADA0[0xD]; + sub_0CBC(); + sub_10424(); + gUnknown_0202C790 += 2; +} + +void sub_A2A8(void) +{ + gUnknown_0202ADA0[0x0] = 0x1C; + gUnknown_0202ADA0[0x1] = 0xFF2C; + gUnknown_0202ADA0[0x2] = 0; + gUnknown_0202ADA0[0x3] = 0xE; + gUnknown_0202ADA0[0x6] = 0xFF5C; + gUnknown_0202ADA0[0x7] = 0xFF08; + gUnknown_0202ADA0[0x8] = 0; + gUnknown_0202ADA0[0x9] = 0x10; + gUnknown_0202ADA0[0xC] = 0; + gUnknown_0202ADA0[0xD] = 0; + gUnknown_0202ADA0[0x10] = 0; + gUnknown_0202BF10 = 0; + gUnknown_0202A578 = 0; +} + +void nullsub_6(void) +{ +} + +void sub_A2F0(void) +{ + gUnknown_0202ADA0[0x1] += gUnknown_0202ADA0[0x3]; + gUnknown_0202ADA0[0x7] += gUnknown_0202ADA0[0x9]; + gUnknown_0202ADA0[0xC]--; + gUnknown_0202ADA0[0xD]--; + gUnknown_0202ADA0[0x0]--; + gUnknown_0202ADA0[0x6]++; + + if (gUnknown_0202BF10 % 2 == 0) + { + gUnknown_0202ADA0[0x3]--; + gUnknown_0202ADA0[0x9]--; + } + + // TODO same as sub_A16C - possible inline function? + gMain.unk2E8[0].unk0 = gUnknown_0202ADA0[0x0]; + gMain.unk2E8[0].unk2 = gUnknown_0202ADA0[0x1]; + gMain.unk2E8[1].unk0 = gUnknown_0202ADA0[0x6]; + gMain.unk2E8[1].unk2 = gUnknown_0202ADA0[0x7]; + gMain.unk2E8[3].unk0 = gUnknown_0202ADA0[0xC]; + gMain.unk2E8[3].unk2 = gUnknown_0202ADA0[0xD]; + + gUnknown_0202ADA0[0x10]++; + if (gUnknown_0202ADA0[0x10] > 0x27) + { + gUnknown_0202ADA0[0x10] = 0; + gUnknown_0202C790 += 2; + } +} + +void nullsub_7(void) +{ +} + +void sub_A39C(void) +{ + gUnknown_0202ADA0[0x1]++; + gUnknown_0202ADA0[0x7]++; + gUnknown_0202ADA0[0xC]--; + gUnknown_0202ADA0[0xD]--; + gUnknown_0202ADA0[0x0]--; + gUnknown_0202ADA0[0x6]++; + + // TODO same as sub_A2F0 - possible inline function? + if (gUnknown_0202BF10 % 2 == 0) + { + gUnknown_0202ADA0[0x3]--; + gUnknown_0202ADA0[0x9]--; + } + + // TODO same as sub_A16C - possible inline function? + gMain.unk2E8[0].unk0 = gUnknown_0202ADA0[0x0]; + gMain.unk2E8[0].unk2 = gUnknown_0202ADA0[0x1]; + gMain.unk2E8[1].unk0 = gUnknown_0202ADA0[0x6]; + gMain.unk2E8[1].unk2 = gUnknown_0202ADA0[0x7]; + gMain.unk2E8[3].unk0 = gUnknown_0202ADA0[0xC]; + gMain.unk2E8[3].unk2 = gUnknown_0202ADA0[0xD]; + + sub_10480(); + sub_10544(); + gUnknown_0202C790++; +} + +void sub_A43C(void) +{ + sub_0518(); + gUnknown_0202C790++; +} + +void sub_A454(void) +{ + // TODO use proper constants - see LoadEReaderGraphics? + REG_DISPCNT = 0x1000; + REG_BG0CNT = 0x5A00; + REG_DISPCNT |= 0x100; + REG_BG1CNT = 0x1C01; + REG_DISPCNT |= 0x200; + REG_BG2CNT = 0x5D02; + REG_DISPCNT |= 0x400; + REG_BG3CNT = 0x1F03; + REG_DISPCNT |= 0x800; + + DmaCopy16(3, gUnknown_080DE520, (void*) 0x0600D000, 0x1000); + DmaCopy16(3, gUnknown_080DCD20, (void*) 0x0600E000, 0x800); + DmaCopy16(3, gUnknown_080D4900, (void*) 0x0600E800, 0x1000); + DmaCopy16(3, gUnknown_080D5900, (void*) 0x0600F800, 0x800); + DmaCopy16(3, gUnknown_080DD520, gUnknown_03005C00, 0x800); + DmaCopy16(3, gUnknown_080DDD20, gUnknown_0201B180, 0x800); + DmaCopy16(3, gUnknown_080D6100, (void*) 0x06000000, 0x6C00); + DmaCopy16(3, gUnknown_080D4700, (void*) PLTT, 0xE0); + DmaCopy16(3, gUnknown_080DF520, (void*) 0x06010000, 0x2000); + DmaCopy16(3, gUnknown_080D4700, (void*) OBJ_PLTT, 0xE0); + + sub_A628(); + sub_A87C(); + + gMain.unk2E8[0].unk0 = gUnknown_0202ADA0[0x0]; + gMain.unk2E8[0].unk2 = gUnknown_0202ADA0[0x1]; + gMain.unk2E8[1].unk0 = gUnknown_0202ADA0[0x6]; + gMain.unk2E8[1].unk2 = gUnknown_0202ADA0[0x7]; + gMain.unk2E8[2].unk0 = gUnknown_0202ADA0[0xC]; + gMain.unk2E8[2].unk2 = gUnknown_0202ADA0[0xD]; + gMain.unk2E8[3].unk0 = gUnknown_0202ADA0[0x12]; + gMain.unk2E8[3].unk2 = gUnknown_0202ADA0[0x13]; + + sub_0CBC(); + sub_10424(); + gUnknown_0202C790++; +} + +void sub_A628(void) +{ + gUnknown_0202ADA0[0x0] = 0x2C; + gUnknown_0202ADA0[0x1] = 0xFF8E; + + gUnknown_0201A450.unk0 = 0xFFD4; + gUnknown_0201A450.unk2 = 0x72; + + gUnknown_0202ADA0[0x6] = 0xFFCE; + gUnknown_0202ADA0[0x7] = 0x1E; + gUnknown_0202ADA0[0xC] = 0; + gUnknown_0202ADA0[0xD] = 0; + gUnknown_0202ADA0[0x10] = 0; + gUnknown_0202ADA0[0x12] = 0; + gUnknown_0202ADA0[0x13] = 0; + + gUnknown_0202BF10 = 0; + gUnknown_0202A578 = 0; +} + +void sub_A674(void) +{ + gUnknown_0202ADA0[0x0] -= 0x11; + gUnknown_0202ADA0[0x1] += 0xA; + + gUnknown_0201A450.unk0 += 0x11; + gUnknown_0201A450.unk2 -= 0xA; + + gUnknown_0202ADA0[0xC] += 0x10; + gUnknown_0202ADA0[0x6] += 0x4; + gUnknown_0202ADA0[0x7] -= 0x8; + gUnknown_0202ADA0[0x10]++; + + if (gUnknown_0202ADA0[0x10] > 9) + { + gUnknown_0202ADA0[0x10] = 0; + gUnknown_0202C790++; + } + + sub_A87C(); + gMain.unk2E8[0].unk0 = gUnknown_0202ADA0[0x0]; + gMain.unk2E8[0].unk2 = gUnknown_0202ADA0[0x1]; + gMain.unk2E8[1].unk0 = gUnknown_0202ADA0[0x6]; + gMain.unk2E8[1].unk2 = gUnknown_0202ADA0[0x7]; + gMain.unk2E8[2].unk0 = gUnknown_0202ADA0[0xC]; + gMain.unk2E8[2].unk2 = gUnknown_0202ADA0[0xD]; +} + +#ifdef NONMATCHING +void sub_A710(void) +{ + gUnknown_0202ADA0[0x12]--; + + if (gUnknown_0202BF10 % 2 == 0) + { + gUnknown_0202ADA0[0x0]--; + gUnknown_0202ADA0[0x1]++; + gUnknown_0201A450.unk0 += 2; + gUnknown_0201A450.unk2 -= 2; + } + if (gUnknown_0202BF10 % 3 == 0) + { + DmaCopy16(3, (void *) 0x05000000, gUnknown_0202BE70, 0x20); + DmaCopy16(3, (void *) 0x05000040, 0x05000000, 0x20); + DmaCopy16(3, (void *) gUnknown_0202BE70, 0x05000040, 0x20); + } + + gMain.unk2E8[0].unk0 = gUnknown_0202ADA0[0x0]; + gMain.unk2E8[0].unk2 = gUnknown_0202ADA0[0x1]; + gMain.unk2E8[3].unk0 = gUnknown_0202ADA0[0x12]; + gMain.unk2E8[3].unk2 = gUnknown_0202ADA0[0x13]; + sub_A87C(); + + if (gUnknown_0202ADA0[0x10] == 2) + { + DmaCopy16(3, gUnknown_03005C00, (void*) 0x0600E000, 0x800); + gUnknown_0202ADA0[0x6] = 0; + gUnknown_0202ADA0[0x7] = 0; + gMain.unk2E8[1].unk0 = 0; + // gMain.unk2E8[1].unk2 = 0; // TODO uncomment this line without everything falling apart + } + else if (gUnknown_0202ADA0[0x10] == 4) + { + DmaCopy16(3, gUnknown_0201B180, (void*) 0x0600E000, 0x800); + gUnknown_0202ADA0[0x6] = 0; + gUnknown_0202ADA0[0x7] = 0; + gMain.unk2E8[1].unk0 = 0; + gMain.unk2E8[1].unk2 = 0; + } + + gUnknown_0202ADA0[0x10]++; + if (gUnknown_0202ADA0[0x10] > 0x1D) + { + gUnknown_0202ADA0[0x10] = 0; + gUnknown_0202C790 += 2; + } +} +#else +NAKED +void sub_A710(void) +{ + asm_unified("\n\ + push {r4, r5, r6, lr}\n\ + ldr r5, _0800A7C8 @ =gUnknown_0202ADA0\n\ + ldrh r0, [r5, #0x24]\n\ + subs r0, #1\n\ + movs r6, #0\n\ + strh r0, [r5, #0x24]\n\ + ldr r2, _0800A7CC @ =gUnknown_0202BF10\n\ + ldrh r0, [r2]\n\ + movs r1, #1\n\ + ands r0, r1\n\ + cmp r0, #0\n\ + bne _0800A742\n\ + ldrh r0, [r5]\n\ + subs r0, #1\n\ + strh r0, [r5]\n\ + ldrh r0, [r5, #2]\n\ + adds r0, #1\n\ + strh r0, [r5, #2]\n\ + ldr r1, _0800A7D0 @ =gUnknown_0201A450\n\ + ldrh r0, [r1]\n\ + adds r0, #2\n\ + strh r0, [r1]\n\ + ldrh r0, [r1, #2]\n\ + subs r0, #2\n\ + strh r0, [r1, #2]\n\ +_0800A742:\n\ + movs r1, #0\n\ + ldrsh r0, [r2, r1]\n\ + movs r1, #3\n\ + bl __modsi3\n\ + lsls r0, r0, #0x10\n\ + cmp r0, #0\n\ + bne _0800A776\n\ + ldr r0, _0800A7D4 @ =0x040000D4\n\ + movs r3, #0xa0\n\ + lsls r3, r3, #0x13\n\ + str r3, [r0]\n\ + ldr r4, _0800A7D8 @ =gUnknown_0202BE70\n\ + str r4, [r0, #4]\n\ + ldr r1, _0800A7DC @ =0x80000010\n\ + str r1, [r0, #8]\n\ + ldr r2, [r0, #8]\n\ + ldr r2, _0800A7E0 @ =0x05000040\n\ + str r2, [r0]\n\ + str r3, [r0, #4]\n\ + str r1, [r0, #8]\n\ + ldr r3, [r0, #8]\n\ + str r4, [r0]\n\ + str r2, [r0, #4]\n\ + str r1, [r0, #8]\n\ + ldr r0, [r0, #8]\n\ +_0800A776:\n\ + ldr r4, _0800A7E4 @ =gMain\n\ + ldrh r1, [r5]\n\ + movs r2, #0xba\n\ + lsls r2, r2, #2\n\ + adds r0, r4, r2\n\ + strh r1, [r0]\n\ + ldrh r1, [r5, #2]\n\ + adds r2, #2\n\ + adds r0, r4, r2\n\ + strh r1, [r0]\n\ + ldrh r1, [r5, #0x24]\n\ + adds r2, #0xa\n\ + adds r0, r4, r2\n\ + strh r1, [r0]\n\ + ldrh r1, [r5, #0x26]\n\ + adds r2, #2\n\ + adds r0, r4, r2\n\ + strh r1, [r0]\n\ + bl sub_A87C\n\ + movs r1, #0x20\n\ + ldrsh r0, [r5, r1]\n\ + cmp r0, #2\n\ + bne _0800A7F4\n\ + ldr r1, _0800A7D4 @ =0x040000D4\n\ + ldr r0, _0800A7E8 @ =gUnknown_03005C00\n\ + str r0, [r1]\n\ + ldr r0, _0800A7EC @ =0x0600E000\n\ + str r0, [r1, #4]\n\ + ldr r0, _0800A7F0 @ =0x80000400\n\ + str r0, [r1, #8]\n\ + ldr r0, [r1, #8]\n\ + strh r6, [r5, #0xc]\n\ + strh r6, [r5, #0xe]\n\ + movs r2, #0xbb\n\ + lsls r2, r2, #2\n\ + adds r0, r4, r2\n\ + strh r6, [r0]\n\ + movs r1, #0\n\ + adds r2, #2\n\ + b _0800A818\n\ + .align 2, 0\n\ +_0800A7C8: .4byte gUnknown_0202ADA0\n\ +_0800A7CC: .4byte gUnknown_0202BF10\n\ +_0800A7D0: .4byte gUnknown_0201A450\n\ +_0800A7D4: .4byte 0x040000D4\n\ +_0800A7D8: .4byte gUnknown_0202BE70\n\ +_0800A7DC: .4byte 0x80000010\n\ +_0800A7E0: .4byte 0x05000040\n\ +_0800A7E4: .4byte gMain\n\ +_0800A7E8: .4byte gUnknown_03005C00\n\ +_0800A7EC: .4byte 0x0600E000\n\ +_0800A7F0: .4byte 0x80000400\n\ +_0800A7F4:\n\ + cmp r0, #4\n\ + bne _0800A81C\n\ + ldr r1, _0800A840 @ =0x040000D4\n\ + ldr r0, _0800A844 @ =gUnknown_0201B180\n\ + str r0, [r1]\n\ + ldr r0, _0800A848 @ =0x0600E000\n\ + str r0, [r1, #4]\n\ + ldr r0, _0800A84C @ =0x80000400\n\ + str r0, [r1, #8]\n\ + ldr r0, [r1, #8]\n\ + strh r6, [r5, #0xc]\n\ + strh r6, [r5, #0xe]\n\ + movs r1, #0xbb\n\ + lsls r1, r1, #2\n\ + adds r0, r4, r1\n\ + strh r6, [r0]\n\ + movs r1, #0\n\ + ldr r2, _0800A850 @ =0x000002EE\n\ +_0800A818:\n\ + adds r0, r4, r2\n\ + strh r1, [r0]\n\ +_0800A81C:\n\ + ldr r1, _0800A854 @ =gUnknown_0202ADA0\n\ + ldrh r0, [r1, #0x20]\n\ + adds r0, #1\n\ + strh r0, [r1, #0x20]\n\ + lsls r0, r0, #0x10\n\ + asrs r0, r0, #0x10\n\ + cmp r0, #0x1d\n\ + ble _0800A838\n\ + movs r0, #0\n\ + strh r0, [r1, #0x20]\n\ + ldr r1, _0800A858 @ =gUnknown_0202C790\n\ + ldrb r0, [r1]\n\ + adds r0, #2\n\ + strb r0, [r1]\n\ +_0800A838:\n\ + pop {r4, r5, r6}\n\ + pop {r0}\n\ + bx r0\n\ + .align 2, 0\n\ +_0800A840: .4byte 0x040000D4\n\ +_0800A844: .4byte gUnknown_0201B180\n\ +_0800A848: .4byte 0x0600E000\n\ +_0800A84C: .4byte 0x80000400\n\ +_0800A850: .4byte 0x000002EE\n\ +_0800A854: .4byte gUnknown_0202ADA0\n\ +_0800A858: .4byte gUnknown_0202C790"); +} +#endif + +void nullsub_8(void) +{ } diff --git a/src/rom_9BC.c b/src/rom_9BC.c index 81e0417..5780435 100644 --- a/src/rom_9BC.c +++ b/src/rom_9BC.c @@ -1,5 +1,7 @@ #include "global.h" #include "functions.h" +#include "main.h" +#include "variables.h" extern u32 gUnknown_0202ADD0; extern s16 gUnknown_0201A444;