diff --git a/asm/slot_machine.s b/asm/slot_machine.s index d700bf5c54..c3fc4d140b 100644 --- a/asm/slot_machine.s +++ b/asm/slot_machine.s @@ -5,3295 +5,6 @@ .text - - thumb_func_start sub_8105100 -sub_8105100: @ 812E33C - push {r4,r5,lr} - sub sp, 0x18 - ldr r4, =gUnknown_0203AAE4 - ldr r0, [r4] - cmp r0, 0 - bne _0812E350 - movs r0, 0x28 - bl AllocZeroed - str r0, [r4] -_0812E350: - ldr r2, [r4] - ldr r0, =gUnknown_0203AAD8 - ldr r1, [r0] - str r1, [r2] - movs r3, 0x80 - lsls r3, 4 - strh r3, [r2, 0x4] - adds r0, r1, r3 - str r0, [r2, 0x8] - strh r3, [r2, 0xC] - movs r4, 0x80 - lsls r4, 5 - adds r0, r1, r4 - str r0, [r2, 0x10] - strh r3, [r2, 0x14] - movs r5, 0xC0 - lsls r5, 5 - adds r0, r1, r5 - str r0, [r2, 0x18] - strh r3, [r2, 0x1C] - movs r0, 0x80 - lsls r0, 6 - adds r1, r0 - str r1, [r2, 0x20] - strh r3, [r2, 0x24] - mov r1, sp - ldr r0, =gSpriteTemplate_83ED45C - ldm r0!, {r3-r5} - stm r1!, {r3-r5} - ldm r0!, {r3-r5} - stm r1!, {r3-r5} - str r2, [sp, 0xC] - movs r1, 0x8C - lsls r1, 1 - mov r0, sp - movs r2, 0x50 - movs r3, 0x1 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gSprites - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - adds r2, r1 - ldrb r3, [r2, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r3 - movs r3, 0x4 - orrs r1, r3 - strb r1, [r2, 0x5] - adds r2, 0x3E - ldrb r1, [r2] - movs r3, 0x2 - orrs r1, r3 - strb r1, [r2] - ldr r1, =sSlotMachine - ldr r1, [r1] - adds r1, 0x3F - strb r0, [r1] - add sp, 0x18 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8105100 - thumb_func_start sub_810514C -sub_810514C: @ 812E3E8 - push {r4,lr} - ldr r0, =sSlotMachine - ldr r0, [r0] - adds r0, 0x3F - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl DestroySprite - ldr r4, =gUnknown_0203AAE4 - ldr r0, [r4] - cmp r0, 0 - beq _0812E410 - bl Free - movs r0, 0 - str r0, [r4] -_0812E410: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810514C - - thumb_func_start sub_812E424 -sub_812E424: @ 812E424 - push {lr} - adds r2, r0, 0 - movs r0, 0 - strh r0, [r2, 0x24] - strh r0, [r2, 0x26] - adds r0, r2, 0 - adds r0, 0x2A - ldrb r0, [r0] - cmp r0, 0x4 - bne _0812E46A - movs r0, 0x8 - strh r0, [r2, 0x24] - strh r0, [r2, 0x26] - adds r0, r2, 0 - adds r0, 0x2B - ldrb r0, [r0] - cmp r0, 0 - beq _0812E458 - adds r0, r2, 0 - adds r0, 0x2C - ldrb r1, [r0] - movs r0, 0x3F - ands r0, r1 - cmp r0, 0 - bne _0812E466 - b _0812E46A -_0812E458: - adds r0, r2, 0 - adds r0, 0x2C - ldrb r1, [r0] - movs r0, 0x3F - ands r0, r1 - cmp r0, 0 - bne _0812E46A -_0812E466: - ldr r0, =0x0000fff8 - strh r0, [r2, 0x26] -_0812E46A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_812E424 - - thumb_func_start sub_81051C0 -sub_81051C0: @ 812E474 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x18 - ldr r4, =gUnknown_0203AAE8 - ldr r0, [r4] - cmp r0, 0 - bne _0812E490 - movs r0, 0x8 - bl AllocZeroed - str r0, [r4] -_0812E490: - ldr r2, [r4] - ldr r0, =gUnknown_0203AAD8 - mov r10, r0 - ldr r0, [r0] - movs r1, 0xA0 - lsls r1, 6 - adds r0, r1 - str r0, [r2] - movs r0, 0xC0 - lsls r0, 2 - strh r0, [r2, 0x4] - mov r1, sp - ldr r0, =gUnknown_085A7D40 - ldm r0!, {r3-r5} - stm r1!, {r3-r5} - ldm r0!, {r3,r4,r7} - stm r1!, {r3,r4,r7} - str r2, [sp, 0xC] - mov r0, sp - movs r1, 0xB8 - lsls r1, 1 - movs r2, 0x34 - movs r3, 0x7 - bl CreateSprite - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - ldr r5, =gSprites - mov r9, r5 - adds r2, r0, r5 - ldrb r1, [r2, 0x5] - movs r7, 0xD - negs r7, r7 - mov r8, r7 - mov r0, r8 - ands r0, r1 - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2, 0x5] - adds r1, r2, 0 - adds r1, 0x3E - ldrb r0, [r1] - movs r6, 0x2 - orrs r0, r6 - strb r0, [r1] - ldr r1, =gUnknown_085A7FE0 - adds r0, r2, 0 - bl SetSubspriteTables - ldr r5, =sSlotMachine - ldr r0, [r5] - adds r0, 0x49 - strb r4, [r0] - ldr r4, =gUnknown_0203AAEC - ldr r0, [r4] - cmp r0, 0 - bne _0812E510 - movs r0, 0x8 - bl AllocZeroed - str r0, [r4] -_0812E510: - ldr r2, [r4] - mov r3, r10 - ldr r0, [r3] - movs r4, 0xAC - lsls r4, 6 - adds r0, r4 - str r0, [r2] - movs r0, 0xA0 - lsls r0, 3 - strh r0, [r2, 0x4] - mov r1, sp - ldr r0, =gUnknown_085A7D58 - ldm r0!, {r3,r4,r7} - stm r1!, {r3,r4,r7} - ldm r0!, {r3,r4,r7} - stm r1!, {r3,r4,r7} - str r2, [sp, 0xC] - mov r0, sp - movs r1, 0xB8 - lsls r1, 1 - movs r2, 0x54 - movs r3, 0x7 - bl CreateSprite - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - mov r7, r9 - adds r2, r0, r7 - ldrb r1, [r2, 0x5] - mov r0, r8 - ands r0, r1 - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2, 0x5] - adds r1, r2, 0 - adds r1, 0x3E - ldrb r0, [r1] - orrs r0, r6 - strb r0, [r1] - ldr r1, =gUnknown_085A7FF4 - adds r0, r2, 0 - bl SetSubspriteTables - ldr r0, [r5] - adds r0, 0x4A - strb r4, [r0] - add sp, 0x18 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81051C0 - - thumb_func_start sub_8105284_ -sub_8105284_: @ 812E5A8 - push {r4,r5,lr} - sub sp, 0x18 - ldr r4, =gUnknown_0203AAF0 - ldr r0, [r4] - cmp r0, 0 - bne _0812E5BC - movs r0, 0x8 - bl AllocZeroed - str r0, [r4] -_0812E5BC: - ldr r2, [r4] - ldr r0, =gUnknown_0203AAD8 - ldr r0, [r0] - movs r1, 0xC0 - lsls r1, 6 - adds r0, r1 - str r0, [r2] - movs r0, 0xC0 - lsls r0, 3 - strh r0, [r2, 0x4] - mov r1, sp - ldr r0, =gUnknown_085A7D70 - ldm r0!, {r3-r5} - stm r1!, {r3-r5} - ldm r0!, {r3-r5} - stm r1!, {r3-r5} - str r2, [sp, 0xC] - ldr r0, =gSpriteCoordOffsetX - ldrh r0, [r0] - movs r1, 0xA8 - subs r1, r0 - lsls r1, 16 - asrs r1, 16 - mov r0, sp - movs r2, 0x50 - movs r3, 0x7 - bl CreateSprite - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - ldrb r2, [r0, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r2 - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0, 0x5] - adds r3, r0, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r2, 0x2 - orrs r1, r2 - strb r1, [r3] - ldr r1, =gUnknown_085A8010 - bl SetSubspriteTables - ldr r0, =sSlotMachine - ldr r0, [r0] - adds r0, 0x42 - strb r4, [r0] - add sp, 0x18 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8105284_ - - thumb_func_start sub_81052EC -sub_81052EC: @ 812E650 - push {r4-r6,lr} - movs r4, 0 - movs r5, 0 -_0812E656: - ldr r0, =gUnknown_085A7D88 - movs r1, 0xB8 - lsls r1, 1 - movs r2, 0 - movs r3, 0xA - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - lsls r3, r0, 4 - adds r3, r0 - lsls r3, 2 - ldr r1, =gSprites - adds r3, r1 - ldrb r2, [r3, 0x5] - movs r6, 0xD - negs r6, r6 - adds r1, r6, 0 - ands r2, r1 - movs r1, 0x4 - orrs r2, r1 - strb r2, [r3, 0x5] - movs r1, 0x3E - adds r1, r3 - mov r12, r1 - ldrb r1, [r1] - movs r2, 0x2 - orrs r1, r2 - mov r2, r12 - strb r1, [r2] - strh r5, [r3, 0x3C] - ldr r1, =sSlotMachine - ldr r1, [r1] - adds r1, 0x4B - adds r1, r4 - strb r0, [r1] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r5, 16 - movs r6, 0xA0 - lsls r6, 13 - adds r0, r6 - lsrs r5, r0, 16 - cmp r4, 0x2 - bls _0812E656 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81052EC - - thumb_func_start sub_810535C -sub_810535C: @ 812E6C4 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =sSlotMachine - ldr r1, [r0] - ldrh r0, [r4, 0x3C] - ldrh r1, [r1, 0x14] - adds r0, r1 - lsls r0, 16 - asrs r0, 16 - movs r1, 0x28 - bl __modsi3 - lsls r0, 16 - asrs r0, 16 - adds r1, r0, 0 - adds r1, 0x3B - strh r1, [r4, 0x22] - movs r1, 0x14 - bl __divsi3 - lsls r0, 16 - asrs r0, 16 - bl sub_8102C48 - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartSpriteAnimIfDifferent - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810535C - - thumb_func_start sub_81053A0 -sub_81053A0: @ 812E70C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - movs r1, 0xB8 - lsls r1, 1 - ldr r0, =gUnknown_085A7DA0 - movs r2, 0x64 - movs r3, 0x9 - bl CreateSprite - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - ldr r7, =gSprites - adds r2, r0, r7 - adds r1, r2, 0 - adds r1, 0x3E - ldrb r0, [r1] - movs r3, 0x2 - mov r10, r3 - mov r3, r10 - orrs r0, r3 - strb r0, [r1] - ldrb r1, [r2, 0x5] - movs r5, 0xD - negs r5, r5 - adds r0, r5, 0 - ands r0, r1 - movs r1, 0x4 - mov r8, r1 - mov r3, r8 - orrs r0, r3 - strb r0, [r2, 0x5] - ldr r0, =gUnknown_085A8028 - mov r9, r0 - adds r0, r2, 0 - mov r1, r9 - bl SetSubspriteTables - ldr r6, =sSlotMachine - ldr r0, [r6] - adds r0, 0x4E - strb r4, [r0] - movs r1, 0x90 - lsls r1, 1 - ldr r0, =gUnknown_085A7DA0 - movs r2, 0x68 - movs r3, 0x4 - bl CreateSprite - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - adds r2, r0, r7 - adds r1, r2, 0 - adds r1, 0x3E - ldrb r0, [r1] - mov r3, r10 - orrs r0, r3 - strb r0, [r1] - ldrb r0, [r2, 0x5] - ands r5, r0 - mov r0, r8 - orrs r5, r0 - strb r5, [r2, 0x5] - adds r0, r2, 0 - mov r1, r9 - bl SetSubspriteTables - ldr r0, [r6] - adds r0, 0x4F - strb r4, [r0] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81053A0 - - thumb_func_start sub_810545C -sub_810545C: @ 812E7CC - push {r4,lr} - ldr r0, =gUnknown_085A7DB8 - movs r1, 0xB8 - lsls r1, 1 - movs r2, 0x4C - movs r3, 0xB - bl CreateSprite - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - adds r3, r0, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r2, 0x2 - orrs r1, r2 - strb r1, [r3] - ldrb r2, [r0, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r2 - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0, 0x5] - ldr r1, =gUnknown_085A803C - bl SetSubspriteTables - ldr r0, =sSlotMachine - ldr r0, [r0] - adds r0, 0x40 - strb r4, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810545C - - thumb_func_start sub_81054B8 -sub_81054B8: @ 812E82C - push {r4,lr} - ldr r0, =sSlotMachine - ldr r0, [r0] - adds r0, 0x40 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl DestroySprite - movs r4, 0 -_0812E846: - ldr r0, =sSlotMachine - ldr r0, [r0] - adds r0, 0x49 - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl DestroySprite - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bls _0812E846 - ldr r4, =gUnknown_0203AAE8 - ldr r0, [r4] - cmp r0, 0 - beq _0812E878 - bl Free - movs r0, 0 - str r0, [r4] -_0812E878: - ldr r4, =gUnknown_0203AAEC - ldr r0, [r4] - cmp r0, 0 - beq _0812E888 - bl Free - movs r0, 0 - str r0, [r4] -_0812E888: - movs r4, 0 -_0812E88A: - ldr r0, =sSlotMachine - ldr r0, [r0] - adds r0, 0x4B - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl DestroySprite - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _0812E88A - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81054B8 - - thumb_func_start sub_8105524 -sub_8105524: @ 812E8C4 - push {r4,lr} - movs r4, 0 -_0812E8C8: - ldr r0, =sSlotMachine - ldr r0, [r0] - adds r0, 0x4E - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl DestroySprite - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bls _0812E8C8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8105524 - - thumb_func_start sub_8105554 -sub_8105554: @ 812E8F8 - push {r4,lr} - ldr r0, =sSlotMachine - ldr r0, [r0] - adds r0, 0x42 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl DestroySprite - ldr r4, =gUnknown_0203AAF0 - ldr r0, [r4] - cmp r0, 0 - beq _0812E920 - bl Free - movs r0, 0 - str r0, [r4] -_0812E920: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8105554 - - thumb_func_start sub_8105578 -sub_8105578: @ 812E934 - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - ldr r0, =gUnknown_085A7DD0 - mov r10, r0 - movs r1, 0x98 - movs r2, 0x20 - movs r3, 0x5 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r2, =gSprites - mov r9, r2 - adds r3, r1, r2 - ldrb r2, [r3, 0x5] - movs r4, 0xD - negs r4, r4 - adds r1, r4, 0 - ands r1, r2 - movs r2, 0x4 - mov r8, r2 - mov r2, r8 - orrs r1, r2 - strb r1, [r3, 0x5] - adds r5, r3, 0 - adds r5, 0x3F - ldrb r1, [r5] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r5] - ldr r6, =sSlotMachine - ldr r1, [r6] - adds r1, 0x50 - strb r0, [r1] - movs r0, 0x8 - strh r0, [r3, 0x2E] - ldr r0, =0x0000ffff - strh r0, [r3, 0x30] - movs r0, 0x1 - negs r0, r0 - strh r0, [r3, 0x32] - movs r5, 0x20 - strh r5, [r3, 0x3C] - mov r0, r10 - movs r1, 0xB8 - movs r2, 0x20 - movs r3, 0x5 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - mov r2, r9 - adds r3, r1, r2 - ldrb r1, [r3, 0x5] - ands r4, r1 - mov r1, r8 - orrs r4, r1 - strb r4, [r3, 0x5] - ldr r1, [r6] - adds r1, 0x51 - strb r0, [r1] - movs r0, 0x1 - strh r0, [r3, 0x30] - subs r0, 0x2 - strh r0, [r3, 0x32] - strh r5, [r3, 0x3C] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8105578 - - thumb_func_start sub_812E9E8 -sub_812E9E8: @ 812E9E8 - push {r4,lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x2E] - movs r1, 0x2E - ldrsh r4, [r2, r1] - cmp r4, 0 - beq _0812EA0C - subs r0, 0x1 - movs r1, 0 - strh r0, [r2, 0x2E] - strh r1, [r2, 0x24] - strh r1, [r2, 0x26] - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - b _0812EA3E -_0812EA0C: - adds r3, r2, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r3] - ldrh r0, [r2, 0x30] - ldrh r1, [r2, 0x24] - adds r0, r1 - strh r0, [r2, 0x24] - ldrh r0, [r2, 0x32] - ldrh r1, [r2, 0x26] - adds r0, r1 - strh r0, [r2, 0x26] - ldrh r0, [r2, 0x34] - adds r0, 0x1 - strh r0, [r2, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - ble _0812EA3E - ldrh r0, [r2, 0x3C] - strh r0, [r2, 0x2E] - strh r4, [r2, 0x34] -_0812EA3E: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_812E9E8 - - thumb_func_start sub_8105688 -sub_8105688: @ 812EA44 - push {r4,lr} - lsls r0, 16 - lsrs r0, 16 - ldr r4, =gSprites - ldr r1, =sSlotMachine - ldr r3, [r1] - adds r1, r3, 0 - adds r1, 0x50 - ldrb r2, [r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - strh r0, [r1, 0x3C] - adds r3, 0x51 - ldrb r2, [r3] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r4 - strh r0, [r1, 0x3C] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8105688 - - thumb_func_start sub_81056C0 -sub_81056C0: @ 812EA7C - push {r4,lr} - movs r4, 0 -_0812EA80: - ldr r0, =sSlotMachine - ldr r0, [r0] - adds r0, 0x50 - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl DestroySprite - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bls _0812EA80 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81056C0 - - thumb_func_start sub_81056F0 -sub_81056F0: @ 812EAB0 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - ldr r0, =gUnknown_085A7DE8 - mov r8, r0 - movs r1, 0x48 - movs r2, 0x50 - movs r3, 0x3 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gSprites - mov r9, r1 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - add r2, r9 - ldrb r3, [r2, 0x5] - movs r4, 0xD - negs r4, r4 - adds r1, r4, 0 - ands r1, r3 - movs r6, 0x4 - orrs r1, r6 - strb r1, [r2, 0x5] - movs r3, 0 - movs r1, 0x1 - strh r1, [r2, 0x2E] - strh r3, [r2, 0x38] - movs r1, 0x10 - strh r1, [r2, 0x3A] - movs r1, 0x8 - strh r1, [r2, 0x3C] - ldr r5, =sSlotMachine - ldr r1, [r5] - adds r1, 0x52 - strb r0, [r1] - mov r0, r8 - movs r1, 0x68 - movs r2, 0x50 - movs r3, 0x3 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - add r1, r9 - ldrb r2, [r1, 0x5] - ands r4, r2 - orrs r4, r6 - strb r4, [r1, 0x5] - adds r1, 0x3F - ldrb r2, [r1] - movs r3, 0x1 - orrs r2, r3 - strb r2, [r1] - ldr r1, [r5] - adds r1, 0x53 - strb r0, [r1] - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81056F0 - - thumb_func_start sub_812EB48 -sub_812EB48: @ 812EB48 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - ldr r1, =gUnknown_085A7614 - mov r0, sp - movs r2, 0x2 - bl memcpy - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0812EB9A - ldrh r0, [r4, 0x3A] - subs r0, 0x1 - strh r0, [r4, 0x3A] - lsls r0, 16 - cmp r0, 0 - bgt _0812EB9A - movs r0, 0x7 - bl IndexOfSpritePaletteTag - lsls r0, 24 - lsrs r0, 4 - ldr r2, =0x01030000 - adds r0, r2 - lsrs r0, 16 - movs r2, 0x38 - ldrsh r1, [r4, r2] - add r1, sp - ldrb r3, [r1] - adds r1, r3, 0 - adds r2, r3, 0 - bl MultiplyInvertedPaletteRGBComponents - ldrh r0, [r4, 0x38] - adds r0, 0x1 - movs r1, 0x1 - ands r0, r1 - strh r0, [r4, 0x38] - ldrh r0, [r4, 0x3C] - strh r0, [r4, 0x3A] -_0812EB9A: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812EB48 - - thumb_func_start sub_81057E8 -sub_81057E8: @ 812EBAC - ldr r3, =gSprites - ldr r1, =sSlotMachine - ldr r1, [r1] - adds r1, 0x52 - ldrb r2, [r1] - lsls r1, r2, 4 - adds r1, r2 - lsls r1, 2 - adds r1, r3 - strh r0, [r1, 0x3C] - bx lr - .pool - thumb_func_end sub_81057E8 - - thumb_func_start sub_8105804 -sub_8105804: @ 812EBCC - push {r4,lr} - movs r0, 0x7 - bl IndexOfSpritePaletteTag - lsls r0, 24 - lsrs r0, 4 - ldr r1, =0x01030000 - adds r0, r1 - lsrs r0, 16 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl MultiplyInvertedPaletteRGBComponents - movs r4, 0 -_0812EBEA: - ldr r0, =sSlotMachine - ldr r0, [r0] - adds r0, 0x52 - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl DestroySprite - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bls _0812EBEA - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8105804 - - thumb_func_start sub_8105854 -sub_8105854: @ 812EC20 - push {lr} - ldr r0, =gUnknown_085A7E00 - movs r1, 0xA8 - movs r2, 0x50 - movs r3, 0x6 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gSprites - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - ldrb r3, [r1, 0x5] - movs r2, 0xD - negs r2, r2 - ands r2, r3 - movs r3, 0x4 - orrs r2, r3 - strb r2, [r1, 0x5] - ldr r1, =sSlotMachine - ldr r1, [r1] - adds r1, 0x41 - strb r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8105854 - - thumb_func_start sub_812EC64 -sub_812EC64: @ 812EC64 - ldr r1, =gSpriteCoordOffsetY - ldrh r1, [r1] - strh r1, [r0, 0x26] - bx lr - .pool - thumb_func_end sub_812EC64 - - thumb_func_start sub_81058A0 -sub_81058A0: @ 812EC70 - push {lr} - ldr r0, =sSlotMachine - ldr r0, [r0] - adds r0, 0x41 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl DestroySprite - pop {r0} - bx r0 - .pool - thumb_func_end sub_81058A0 - - thumb_func_start sub_81058C4 -sub_81058C4: @ 812EC94 - push {r4,r5,lr} - sub sp, 0x8 - ldr r1, =gUnknown_085A7616 - mov r0, sp - movs r2, 0x8 - bl memcpy - movs r4, 0 -_0812ECA4: - ldr r0, =gSpriteCoordOffsetX - ldrh r0, [r0] - movs r1, 0x50 - subs r1, r0 - lsls r1, 16 - asrs r1, 16 - ldr r0, =gUnknown_085A7E18 - movs r2, 0x44 - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - lsls r3, r0, 4 - adds r3, r0 - lsls r3, 2 - ldr r1, =gSprites - adds r3, r1 - ldrb r2, [r3, 0x5] - movs r5, 0xD - negs r5, r5 - adds r1, r5, 0 - ands r2, r1 - movs r1, 0x4 - orrs r2, r1 - strb r2, [r3, 0x5] - movs r1, 0x3E - adds r1, r3 - mov r12, r1 - ldrb r1, [r1] - movs r2, 0x2 - orrs r1, r2 - mov r2, r12 - strb r1, [r2] - lsls r1, r4, 1 - add r1, sp - ldrh r1, [r1] - strh r1, [r3, 0x2E] - ldr r1, =sSlotMachine - ldr r1, [r1] - adds r1, 0x54 - adds r1, r4 - strb r0, [r1] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _0812ECA4 - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81058C4 - - thumb_func_start sub_812ED20 -sub_812ED20: @ 812ED20 - push {r4,r5,lr} - adds r5, r0, 0 - ldrh r0, [r5, 0x2E] - subs r0, 0x2 - movs r4, 0 - movs r1, 0xFF - ands r0, r1 - strh r0, [r5, 0x2E] - movs r1, 0x2E - ldrsh r0, [r5, r1] - movs r1, 0x14 - bl Cos - strh r0, [r5, 0x24] - movs r2, 0x2E - ldrsh r0, [r5, r2] - movs r1, 0x6 - bl Sin - strh r0, [r5, 0x26] - adds r1, r5, 0 - adds r1, 0x43 - strb r4, [r1] - movs r2, 0x2E - ldrsh r0, [r5, r2] - cmp r0, 0x7F - ble _0812ED5A - movs r0, 0x2 - strb r0, [r1] -_0812ED5A: - ldrh r0, [r5, 0x30] - adds r0, 0x1 - strh r0, [r5, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xF - ble _0812ED84 - adds r3, r5, 0 - adds r3, 0x3F - ldrb r2, [r3] - lsls r0, r2, 31 - lsrs r0, 31 - movs r1, 0x1 - eors r1, r0 - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - movs r0, 0 - strh r0, [r5, 0x30] -_0812ED84: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_812ED20 - - thumb_func_start sub_81059B8 -sub_81059B8: @ 812ED8C - push {r4,lr} - movs r4, 0 -_0812ED90: - ldr r0, =sSlotMachine - ldr r0, [r0] - adds r0, 0x54 - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl DestroySprite - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3 - bls _0812ED90 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81059B8 - - thumb_func_start sub_81059E8 -sub_81059E8: @ 812EDC0 - push {r4,lr} - ldr r0, =gUnknown_085A7E30 - movs r1, 0xA8 - movs r2, 0x3C - movs r3, 0x8 - bl CreateSprite - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - ldrb r2, [r0, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r2 - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0, 0x5] - ldrb r1, [r0, 0x1] - movs r2, 0x3 - orrs r1, r2 - strb r1, [r0, 0x1] - bl InitSpriteAffineAnim - ldr r0, =sSlotMachine - ldr r0, [r0] - adds r0, 0x43 - strb r4, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81059E8 - - thumb_func_start sub_812EE14 -sub_812EE14: @ 812EE14 - push {lr} - adds r3, r0, 0 - ldrh r2, [r3, 0x2E] - movs r1, 0x2E - ldrsh r0, [r3, r1] - cmp r0, 0 - bne _0812EE36 - adds r0, r3, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0812EE90 - adds r0, r2, 0x1 - strh r0, [r3, 0x2E] - b _0812EE90 -_0812EE36: - cmp r0, 0x1 - bne _0812EE72 - movs r0, 0x3E - adds r0, r3 - mov r12, r0 - ldrb r2, [r0] - lsls r0, r2, 29 - lsrs r0, 31 - movs r1, 0x1 - eors r1, r0 - lsls r1, 2 - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - mov r1, r12 - strb r0, [r1] - ldrh r0, [r3, 0x32] - adds r0, 0x1 - strh r0, [r3, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x17 - ble _0812EE90 - ldrh r0, [r3, 0x2E] - adds r0, 0x1 - strh r0, [r3, 0x2E] - movs r0, 0 - strh r0, [r3, 0x32] - b _0812EE90 -_0812EE72: - adds r2, r3, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldrh r0, [r3, 0x32] - adds r0, 0x1 - strh r0, [r3, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xF - ble _0812EE90 - movs r0, 0x1 - strh r0, [r3, 0x3C] -_0812EE90: - ldrh r0, [r3, 0x30] - movs r1, 0xFF - ands r1, r0 - adds r1, 0x10 - strh r1, [r3, 0x30] - lsrs r1, 8 - ldrh r0, [r3, 0x26] - subs r0, r1 - strh r0, [r3, 0x26] - pop {r0} - bx r0 - thumb_func_end sub_812EE14 - - thumb_func_start sub_8105ACC -sub_8105ACC: @ 812EEA8 - ldr r2, =gSprites - ldr r0, =sSlotMachine - ldr r0, [r0] - adds r0, 0x43 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x3C] - lsls r0, 24 - lsrs r0, 24 - bx lr - .pool - thumb_func_end sub_8105ACC - - thumb_func_start sub_8105AEC -sub_8105AEC: @ 812EECC - push {r4,lr} - ldr r0, =sSlotMachine - ldr r0, [r0] - adds r0, 0x43 - ldrb r0, [r0] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =gSprites - adds r4, r0 - ldrb r0, [r4, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl FreeOamMatrix - adds r0, r4, 0 - bl DestroySprite - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8105AEC - - thumb_func_start sub_8105B1C -sub_8105B1C: @ 812EF00 - push {r4,lr} - adds r3, r0, 0 - adds r2, r1, 0 - ldr r0, =gUnknown_085A7F98 - lsls r3, 16 - asrs r3, 16 - lsls r2, 16 - asrs r2, 16 - adds r1, r3, 0 - movs r3, 0xC - bl CreateSprite - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r0, r4, 4 - adds r0, r4 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - ldrb r2, [r0, 0x5] - movs r1, 0xD - negs r1, r1 - ands r1, r2 - movs r2, 0x8 - orrs r1, r2 - strb r1, [r0, 0x5] - ldrb r1, [r0, 0x1] - movs r2, 0x3 - orrs r1, r2 - strb r1, [r0, 0x1] - bl InitSpriteAffineAnim - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8105B1C - - thumb_func_start sub_812EF54 -sub_812EF54: @ 812EF54 - push {lr} - adds r2, r0, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0812EF68 - movs r0, 0x1 - strh r0, [r2, 0x3C] -_0812EF68: - pop {r0} - bx r0 - thumb_func_end sub_812EF54 - - thumb_func_start sub_8105B88 -sub_8105B88: @ 812EF6C - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r0, =gSprites - adds r4, r0 - ldrb r0, [r4, 0x3] - lsls r0, 26 - lsrs r0, 27 - bl FreeOamMatrix - adds r0, r4, 0 - bl DestroySprite - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8105B88 - - thumb_func_start sub_8105BB4 -sub_8105BB4: @ 812EF98 - push {r4-r6,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - ldr r3, =gUnknown_085A78C8 - lsrs r1, 22 - adds r3, r1, r3 - ldr r5, [r3] - ldr r3, =gUnknown_085A783A - adds r4, r1, r3 - movs r6, 0 - ldrsh r4, [r4, r6] - adds r3, 0x2 - adds r1, r3 - movs r6, 0 - ldrsh r3, [r1, r6] - lsls r2, 16 - asrs r2, 16 - str r2, [sp] - adds r1, r5, 0 - adds r2, r4, 0 - bl sub_8105BF8 - lsls r0, 24 - lsrs r0, 24 - add sp, 0x4 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8105BB4 - - thumb_func_start sub_8105BF8 -sub_8105BF8: @ 812EFDC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x18 - adds r4, r0, 0 - mov r8, r1 - adds r1, r2, 0 - adds r2, r3, 0 - ldr r5, [sp, 0x34] - lsls r4, 24 - lsls r5, 16 - lsrs r5, 16 - mov r9, r5 - ldr r0, =gUnknown_085A8264 - lsrs r4, 22 - adds r0, r4, r0 - mov r3, sp - ldr r0, [r0] - ldm r0!, {r5-r7} - stm r3!, {r5-r7} - ldm r0!, {r5-r7} - stm r3!, {r5-r7} - ldr r0, =gUnknown_03001188 - adds r0, r4, r0 - ldr r0, [r0] - str r0, [sp, 0xC] - lsls r1, 16 - asrs r1, 16 - lsls r2, 16 - asrs r2, 16 - mov r0, sp - movs r3, 0x10 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - adds r7, r0, 0 - lsls r0, r7, 4 - adds r0, r7 - lsls r0, 2 - ldr r1, =gSprites - adds r2, r0, r1 - ldrb r0, [r2, 0x5] - movs r1, 0xC - orrs r0, r1 - strb r0, [r2, 0x5] - mov r0, r8 - str r0, [r2, 0x1C] - mov r5, r9 - strh r5, [r2, 0x3A] - movs r0, 0x1 - strh r0, [r2, 0x3C] - ldr r0, =gUnknown_085A82CC - adds r4, r0 - ldr r1, [r4] - cmp r1, 0 - beq _0812F056 - adds r0, r2, 0 - bl SetSubspriteTables -_0812F056: - adds r0, r7, 0 - add sp, 0x18 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8105BF8 - - thumb_func_start sub_812F078 -sub_812F078: @ 812F078 - movs r1, 0 - strh r1, [r0, 0x3C] - bx lr - thumb_func_end sub_812F078 - - thumb_func_start sub_812F080 -sub_812F080: @ 812F080 - push {r4,r5,lr} - sub sp, 0x10 - adds r4, r0, 0 - ldr r1, =gUnknown_085A761E - mov r0, sp - movs r2, 0x8 - bl memcpy - add r5, sp, 0x8 - ldr r1, =gUnknown_085A7626 - adds r0, r5, 0 - movs r2, 0x8 - bl memcpy - ldrh r0, [r4, 0x30] - adds r1, r0, 0x1 - strh r1, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xF - ble _0812F0C6 - adds r3, r4, 0 - adds r3, 0x42 - ldrb r2, [r3] - lsls r0, r2, 26 - lsrs r0, 26 - movs r1, 0x1 - eors r1, r0 - movs r0, 0x40 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - movs r0, 0 - strh r0, [r4, 0x30] -_0812F0C6: - movs r0, 0 - strh r0, [r4, 0x24] - strh r0, [r4, 0x26] - adds r0, r4, 0 - adds r0, 0x42 - ldrb r1, [r0] - movs r0, 0x3F - ands r0, r1 - cmp r0, 0 - beq _0812F0F2 - movs r1, 0x3A - ldrsh r0, [r4, r1] - lsls r0, 1 - add r0, sp - ldrh r0, [r0] - strh r0, [r4, 0x24] - movs r1, 0x3A - ldrsh r0, [r4, r1] - lsls r0, 1 - adds r0, r5, r0 - ldrh r0, [r0] - strh r0, [r4, 0x26] -_0812F0F2: - add sp, 0x10 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812F080 - - thumb_func_start sub_812F104 -sub_812F104: @ 812F104 - push {lr} - adds r3, r0, 0 - adds r3, 0x3F - ldrb r1, [r3] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r3] - bl sub_812F080 - pop {r0} - bx r0 - thumb_func_end sub_812F104 - - thumb_func_start sub_812F11C -sub_812F11C: @ 812F11C - push {lr} - adds r3, r0, 0 - adds r3, 0x3F - ldrb r1, [r3] - movs r2, 0x2 - orrs r1, r2 - strb r1, [r3] - bl sub_812F080 - pop {r0} - bx r0 - thumb_func_end sub_812F11C - - thumb_func_start sub_812F134 -sub_812F134: @ 812F134 - push {lr} - adds r3, r0, 0 - adds r3, 0x3F - ldrb r1, [r3] - movs r2, 0x1 - orrs r1, r2 - movs r2, 0x2 - orrs r1, r2 - strb r1, [r3] - bl sub_812F080 - pop {r0} - bx r0 - thumb_func_end sub_812F134 - - thumb_func_start sub_812F150 -sub_812F150: @ 812F150 - push {lr} - adds r2, r0, 0 - movs r1, 0x2E - ldrsh r0, [r2, r1] - cmp r0, 0x1 - beq _0812F184 - cmp r0, 0x1 - bgt _0812F166 - cmp r0, 0 - beq _0812F170 - b _0812F1B4 -_0812F166: - cmp r0, 0x2 - beq _0812F194 - cmp r0, 0x3 - beq _0812F1B0 - b _0812F1B4 -_0812F170: - ldrh r0, [r2, 0x20] - adds r0, 0x4 - strh r0, [r2, 0x20] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xCF - ble _0812F1B4 - movs r0, 0xD0 - strh r0, [r2, 0x20] - b _0812F1A2 -_0812F184: - ldrh r0, [r2, 0x30] - adds r0, 0x1 - strh r0, [r2, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5A - ble _0812F1B4 - b _0812F1A2 -_0812F194: - ldrh r0, [r2, 0x20] - adds r0, 0x4 - strh r0, [r2, 0x20] - lsls r0, 16 - ldr r1, =0x010f0000 - cmp r0, r1 - ble _0812F1B4 -_0812F1A2: - ldrh r0, [r2, 0x2E] - adds r0, 0x1 - strh r0, [r2, 0x2E] - b _0812F1B4 - .pool -_0812F1B0: - movs r0, 0 - strh r0, [r2, 0x3C] -_0812F1B4: - pop {r0} - bx r0 - thumb_func_end sub_812F150 - - thumb_func_start sub_812F1B8 -sub_812F1B8: @ 812F1B8 - push {lr} - adds r1, r0, 0 - movs r2, 0x2E - ldrsh r0, [r1, r2] - cmp r0, 0x1 - beq _0812F1EC - cmp r0, 0x1 - bgt _0812F1CE - cmp r0, 0 - beq _0812F1D8 - b _0812F216 -_0812F1CE: - cmp r0, 0x2 - beq _0812F1FC - cmp r0, 0x3 - beq _0812F212 - b _0812F216 -_0812F1D8: - ldrh r0, [r1, 0x20] - subs r0, 0x4 - strh r0, [r1, 0x20] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xD0 - bgt _0812F216 - movs r0, 0xD0 - strh r0, [r1, 0x20] - b _0812F20A -_0812F1EC: - ldrh r0, [r1, 0x30] - adds r0, 0x1 - strh r0, [r1, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5A - ble _0812F216 - b _0812F20A -_0812F1FC: - ldrh r0, [r1, 0x20] - subs r0, 0x4 - strh r0, [r1, 0x20] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x90 - bgt _0812F216 -_0812F20A: - ldrh r0, [r1, 0x2E] - adds r0, 0x1 - strh r0, [r1, 0x2E] - b _0812F216 -_0812F212: - movs r0, 0 - strh r0, [r1, 0x3C] -_0812F216: - pop {r0} - bx r0 - thumb_func_end sub_812F1B8 - - thumb_func_start sub_812F21C -sub_812F21C: @ 812F21C - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x5 - bhi _0812F2C6 - lsls r0, 2 - ldr r1, =_0812F238 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0812F238: - .4byte _0812F250 - .4byte _0812F268 - .4byte _0812F288 - .4byte _0812F29C - .4byte _0812F2AC - .4byte _0812F2C2 -_0812F250: - ldr r0, =sSlotMachine - ldr r0, [r0] - ldrb r1, [r0, 0xA] - subs r1, 0x1 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartSpriteAnim - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] -_0812F268: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - ble _0812F2C6 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - movs r0, 0 - strh r0, [r4, 0x30] - b _0812F2C6 - .pool -_0812F288: - ldrh r0, [r4, 0x20] - adds r0, 0x4 - strh r0, [r4, 0x20] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xCF - ble _0812F2C6 - movs r0, 0xD0 - strh r0, [r4, 0x20] - b _0812F2BA -_0812F29C: - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5A - ble _0812F2C6 - b _0812F2BA -_0812F2AC: - ldrh r0, [r4, 0x20] - adds r0, 0x4 - strh r0, [r4, 0x20] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xF7 - ble _0812F2C6 -_0812F2BA: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _0812F2C6 -_0812F2C2: - movs r0, 0 - strh r0, [r4, 0x3C] -_0812F2C6: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_812F21C - - thumb_func_start sub_812F2CC -sub_812F2CC: @ 812F2CC - push {lr} - adds r3, r0, 0 - movs r1, 0x2E - ldrsh r0, [r3, r1] - cmp r0, 0x1 - beq _0812F2FA - cmp r0, 0x1 - bgt _0812F2E2 - cmp r0, 0 - beq _0812F2E8 - b _0812F368 -_0812F2E2: - cmp r0, 0x2 - beq _0812F318 - b _0812F368 -_0812F2E8: - adds r2, r3, 0 - adds r2, 0x2C - ldrb r0, [r2] - movs r1, 0x40 - orrs r0, r1 - strb r0, [r2] - ldrh r0, [r3, 0x2E] - adds r0, 0x1 - strh r0, [r3, 0x2E] -_0812F2FA: - ldrh r0, [r3, 0x22] - adds r0, 0x8 - strh r0, [r3, 0x22] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6F - ble _0812F368 - movs r0, 0x70 - strh r0, [r3, 0x22] - movs r0, 0x10 - strh r0, [r3, 0x30] - ldrh r0, [r3, 0x2E] - adds r0, 0x1 - strh r0, [r3, 0x2E] - b _0812F368 -_0812F318: - movs r0, 0x32 - ldrsh r2, [r3, r0] - cmp r2, 0 - bne _0812F35E - ldrh r0, [r3, 0x22] - ldrh r1, [r3, 0x30] - subs r0, r1 - strh r0, [r3, 0x22] - negs r1, r1 - strh r1, [r3, 0x30] - ldrh r0, [r3, 0x34] - adds r0, 0x1 - strh r0, [r3, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1 - ble _0812F35E - lsls r0, r1, 16 - asrs r0, 18 - strh r0, [r3, 0x30] - strh r2, [r3, 0x34] - adds r1, r0, 0 - cmp r1, 0 - bne _0812F35E - ldrh r0, [r3, 0x2E] - adds r0, 0x1 - strh r0, [r3, 0x2E] - strh r1, [r3, 0x3C] - adds r2, r3, 0 - adds r2, 0x2C - ldrb r1, [r2] - movs r0, 0x41 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_0812F35E: - ldrh r0, [r3, 0x32] - adds r0, 0x1 - movs r1, 0x7 - ands r0, r1 - strh r0, [r3, 0x32] -_0812F368: - pop {r0} - bx r0 - thumb_func_end sub_812F2CC - - thumb_func_start sub_812F36C -sub_812F36C: @ 812F36C - push {lr} - adds r1, r0, 0 - movs r2, 0x2E - ldrsh r0, [r1, r2] - cmp r0, 0 - beq _0812F37E - cmp r0, 0x1 - beq _0812F394 - b _0812F3B0 -_0812F37E: - ldrh r0, [r1, 0x30] - adds r0, 0x1 - strh r0, [r1, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8 - ble _0812F3B0 - ldrh r0, [r1, 0x2E] - adds r0, 0x1 - strh r0, [r1, 0x2E] - b _0812F3B0 -_0812F394: - ldrh r0, [r1, 0x22] - adds r0, 0x2 - strh r0, [r1, 0x22] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x2F - ble _0812F3B0 - movs r0, 0x30 - strh r0, [r1, 0x22] - ldrh r0, [r1, 0x2E] - adds r0, 0x1 - strh r0, [r1, 0x2E] - movs r0, 0 - strh r0, [r1, 0x3C] -_0812F3B0: - pop {r0} - bx r0 - thumb_func_end sub_812F36C - - thumb_func_start sub_812F3B4 -sub_812F3B4: @ 812F3B4 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0812F3C6 - cmp r0, 0x1 - beq _0812F416 - b _0812F468 -_0812F3C6: - adds r2, r4, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldrh r0, [r4, 0x30] - adds r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x20 - ble _0812F468 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - movs r0, 0x5 - strh r0, [r4, 0x30] - ldrb r0, [r4, 0x1] - movs r1, 0x10 - orrs r0, r1 - strb r0, [r4, 0x1] - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r2] - adds r0, r4, 0 - movs r1, 0x1 - bl StartSpriteAnim - ldrh r0, [r4, 0x30] - lsls r1, r0, 4 - orrs r1, r0 - lsls r1, 24 - lsrs r1, 16 - movs r0, 0x4C - bl SetGpuReg - b _0812F468 -_0812F416: - ldrh r1, [r4, 0x32] - lsls r1, 16 - asrs r1, 24 - ldrh r0, [r4, 0x30] - subs r0, r1 - strh r0, [r4, 0x30] - lsls r0, 16 - cmp r0, 0 - bge _0812F42C - movs r0, 0 - strh r0, [r4, 0x30] -_0812F42C: - ldrh r0, [r4, 0x30] - lsls r1, r0, 4 - orrs r1, r0 - lsls r1, 24 - lsrs r1, 16 - movs r0, 0x4C - bl SetGpuReg - ldrh r1, [r4, 0x32] - movs r0, 0xFF - ands r0, r1 - adds r0, 0x80 - strh r0, [r4, 0x32] - movs r0, 0x30 - ldrsh r1, [r4, r0] - cmp r1, 0 - bne _0812F468 - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - strh r1, [r4, 0x3C] - ldrb r1, [r4, 0x1] - movs r0, 0x11 - negs r0, r0 - ands r0, r1 - strb r0, [r4, 0x1] - adds r0, r4, 0 - movs r1, 0 - bl StartSpriteAnim -_0812F468: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_812F3B4 - - thumb_func_start sub_812F470 -sub_812F470: @ 812F470 - push {r4,r5,lr} - adds r5, r0, 0 - movs r1, 0x30 - ldrsh r0, [r5, r1] - cmp r0, 0x2 - bgt _0812F4C0 - ldr r1, =gUnknown_085A8510 - lsls r0, 2 - adds r0, r1 - ldr r4, [r0] - movs r0, 0x6 - bl IndexOfSpritePaletteTag - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 4 - movs r0, 0x80 - lsls r0, 17 - adds r1, r0 - lsrs r1, 16 - adds r0, r4, 0 - movs r2, 0x20 - bl LoadPalette - ldrh r0, [r5, 0x32] - adds r0, 0x1 - strh r0, [r5, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3 - ble _0812F4FC - ldrh r0, [r5, 0x30] - adds r0, 0x1 - strh r0, [r5, 0x30] - movs r0, 0 - strh r0, [r5, 0x32] - b _0812F4FC - .pool -_0812F4C0: - ldr r1, =gUnknown_085A8510 - movs r2, 0x30 - ldrsh r0, [r5, r2] - lsls r0, 2 - adds r0, r1 - ldr r4, [r0] - movs r0, 0x6 - bl IndexOfSpritePaletteTag - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 4 - movs r0, 0x80 - lsls r0, 17 - adds r1, r0 - lsrs r1, 16 - adds r0, r4, 0 - movs r2, 0x20 - bl LoadPalette - ldrh r0, [r5, 0x32] - adds r0, 0x1 - movs r1, 0 - strh r0, [r5, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x18 - ble _0812F4FC - strh r1, [r5, 0x30] - strh r1, [r5, 0x32] -_0812F4FC: - adds r0, r5, 0 - movs r1, 0x1 - bl StartSpriteAnimIfDifferent - movs r0, 0 - strh r0, [r5, 0x3C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812F470 - - thumb_func_start sub_812F514 -sub_812F514: @ 812F514 - push {r4-r6,lr} - sub sp, 0x30 - adds r4, r0, 0 - ldr r1, =gUnknown_085A762E - mov r0, sp - movs r2, 0x10 - bl memcpy - add r6, sp, 0x10 - ldr r1, =gUnknown_085A763E - adds r0, r6, 0 - movs r2, 0x10 - bl memcpy - add r5, sp, 0x20 - ldr r1, =gUnknown_085A764E - adds r0, r5, 0 - movs r2, 0x10 - bl memcpy - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _0812F58C - cmp r0, 0x1 - bgt _0812F55C - cmp r0, 0 - beq _0812F562 - b _0812F5D8 - .pool -_0812F55C: - cmp r0, 0x2 - beq _0812F5A0 - b _0812F5D8 -_0812F562: - movs r2, 0x3A - ldrsh r0, [r4, r2] - lsls r0, 1 - add r0, sp - ldrh r0, [r0] - strh r0, [r4, 0x24] - movs r1, 0x3A - ldrsh r0, [r4, r1] - lsls r0, 1 - adds r0, r6, r0 - ldrh r0, [r0] - strh r0, [r4, 0x26] - movs r2, 0x3A - ldrsh r0, [r4, r2] - lsls r0, 1 - adds r0, r5, r0 - ldrh r0, [r0] - strh r0, [r4, 0x30] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] -_0812F58C: - ldrh r0, [r4, 0x30] - subs r0, 0x1 - strh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _0812F5D8 - b _0812F5D2 -_0812F5A0: - ldrh r0, [r4, 0x24] - movs r2, 0x24 - ldrsh r1, [r4, r2] - cmp r1, 0 - ble _0812F5AE - subs r0, 0x4 - b _0812F5B4 -_0812F5AE: - cmp r1, 0 - bge _0812F5B6 - adds r0, 0x4 -_0812F5B4: - strh r0, [r4, 0x24] -_0812F5B6: - ldrh r0, [r4, 0x26] - movs r2, 0x26 - ldrsh r1, [r4, r2] - cmp r1, 0 - ble _0812F5C4 - subs r0, 0x4 - b _0812F5CA -_0812F5C4: - cmp r1, 0 - bge _0812F5CC - adds r0, 0x4 -_0812F5CA: - strh r0, [r4, 0x26] -_0812F5CC: - ldr r0, [r4, 0x24] - cmp r0, 0 - bne _0812F5D8 -_0812F5D2: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] -_0812F5D8: - add sp, 0x30 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_812F514 - - thumb_func_start sub_812F5E0 -sub_812F5E0: @ 812F5E0 - push {r4,lr} - sub sp, 0x10 - adds r4, r0, 0 - ldr r1, =gUnknown_085A765E - mov r0, sp - movs r2, 0x10 - bl memcpy - ldrh r1, [r4, 0x2E] - movs r2, 0x2E - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _0812F602 - adds r0, r1, 0x1 - strh r0, [r4, 0x2E] - movs r0, 0xC - strh r0, [r4, 0x30] -_0812F602: - movs r1, 0x3A - ldrsh r0, [r4, r1] - lsls r0, 1 - add r0, sp - movs r2, 0 - ldrsh r0, [r0, r2] - movs r2, 0x30 - ldrsh r1, [r4, r2] - bl Cos - strh r0, [r4, 0x24] - movs r1, 0x3A - ldrsh r0, [r4, r1] - lsls r0, 1 - add r0, sp - movs r2, 0 - ldrsh r0, [r0, r2] - movs r2, 0x30 - ldrsh r1, [r4, r2] - bl Sin - strh r0, [r4, 0x26] - ldrh r1, [r4, 0x30] - movs r2, 0x30 - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _0812F63C - subs r0, r1, 0x1 - strh r0, [r4, 0x30] -_0812F63C: - add sp, 0x10 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812F5E0 - - thumb_func_start sub_812F648 -sub_812F648: @ 812F648 - push {r4-r6,lr} - sub sp, 0x4 - adds r5, r0, 0 - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0x1 - beq _0812F694 - cmp r0, 0x1 - bgt _0812F660 - cmp r0, 0 - beq _0812F66A - b _0812F76C -_0812F660: - cmp r0, 0x2 - beq _0812F6E0 - cmp r0, 0x3 - beq _0812F71C - b _0812F76C -_0812F66A: - ldr r0, =sSlotMachine - ldr r2, [r0] - adds r1, r2, 0 - adds r1, 0x5C - movs r0, 0x2F - strh r0, [r1] - adds r1, 0x2 - movs r0, 0x3F - strh r0, [r1] - subs r1, 0x4 - ldr r0, =0x00002088 - strh r0, [r1] - adds r2, r5, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2] - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] -_0812F694: - ldrh r0, [r5, 0x30] - adds r2, r0, 0x2 - strh r2, [r5, 0x30] - adds r0, 0xB2 - strh r0, [r5, 0x32] - movs r1, 0xF0 - subs r1, r2 - strh r1, [r5, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xD0 - ble _0812F6B0 - movs r0, 0xD0 - strh r0, [r5, 0x32] -_0812F6B0: - movs r1, 0x34 - ldrsh r0, [r5, r1] - cmp r0, 0xCF - bgt _0812F6BC - movs r0, 0xD0 - strh r0, [r5, 0x34] -_0812F6BC: - ldr r0, =sSlotMachine - ldr r2, [r0] - ldrh r0, [r5, 0x32] - lsls r0, 8 - ldrh r1, [r5, 0x34] - orrs r0, r1 - adds r1, r2, 0 - adds r1, 0x58 - strh r0, [r1] - movs r1, 0x30 - ldrsh r0, [r5, r1] - cmp r0, 0x33 - ble _0812F76C - b _0812F75E - .pool -_0812F6E0: - ldr r6, =sSlotMachine - ldr r0, [r6] - movs r1, 0x12 - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _0812F76C - ldr r1, =SpriteCallbackDummy - movs r4, 0 - str r4, [sp] - movs r0, 0x5 - movs r2, 0xD0 - movs r3, 0x74 - bl sub_8104D30 - ldr r2, [r6] - adds r1, r2, 0 - adds r1, 0x58 - ldr r0, =0x0000c0e0 - strh r0, [r1] - adds r1, 0x2 - movs r0, 0xD1 - lsls r0, 7 - strh r0, [r1] - adds r1, 0x2 - movs r0, 0x2F - strh r0, [r1] - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - strh r4, [r5, 0x30] -_0812F71C: - ldrh r0, [r5, 0x30] - adds r2, r0, 0x2 - strh r2, [r5, 0x30] - adds r0, 0xC2 - strh r0, [r5, 0x32] - movs r1, 0xE0 - subs r1, r2 - strh r1, [r5, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xD0 - ble _0812F738 - movs r0, 0xD0 - strh r0, [r5, 0x32] -_0812F738: - movs r1, 0x34 - ldrsh r0, [r5, r1] - cmp r0, 0xCF - bgt _0812F744 - movs r0, 0xD0 - strh r0, [r5, 0x34] -_0812F744: - ldr r0, =sSlotMachine - ldr r2, [r0] - ldrh r0, [r5, 0x32] - lsls r0, 8 - ldrh r1, [r5, 0x34] - orrs r0, r1 - adds r1, r2, 0 - adds r1, 0x58 - strh r0, [r1] - movs r1, 0x30 - ldrsh r0, [r5, r1] - cmp r0, 0xF - ble _0812F76C -_0812F75E: - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - adds r1, r2, 0 - adds r1, 0x5C - movs r0, 0x3F - strh r0, [r1] -_0812F76C: - add sp, 0x4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812F648 - - thumb_func_start nullsub_101 -nullsub_101: @ 812F780 - bx lr - thumb_func_end nullsub_101 - - thumb_func_start sub_812F784 -sub_812F784: @ 812F784 - push {lr} - movs r0, 0x4C - movs r1, 0 - bl SetGpuReg - pop {r0} - bx r0 - thumb_func_end sub_812F784 - - thumb_func_start sub_812F794 -sub_812F794: @ 812F794 - push {r4,lr} - ldr r0, =gUnknown_085A8520 - ldr r4, [r0] - movs r0, 0x6 - bl IndexOfSpritePaletteTag - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 4 - movs r0, 0x80 - lsls r0, 17 - adds r1, r0 - lsrs r1, 16 - adds r0, r4, 0 - movs r2, 0x20 - bl LoadPalette - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812F794 - - thumb_func_start sub_812F7C0 -sub_812F7C0: @ 812F7C0 - ldr r0, =sSlotMachine - ldr r2, [r0] - adds r1, r2, 0 - adds r1, 0x58 - movs r0, 0xF0 - strh r0, [r1] - adds r1, 0x2 - movs r0, 0xA0 - strh r0, [r1] - adds r0, r2, 0 - adds r0, 0x5C - movs r1, 0x3F - strh r1, [r0] - adds r0, 0x2 - strh r1, [r0] - bx lr - .pool - thumb_func_end sub_812F7C0 - - thumb_func_start sub_812F7E4 -sub_812F7E4: @ 812F7E4 - push {r4-r6,lr} - bl sub_812F8A0 - ldr r4, =gUnknown_0203AAD4 - movs r0, 0xC8 - lsls r0, 6 - bl Alloc - adds r1, r0, 0 - str r1, [r4] - ldr r0, =gSlotMachineReelTime_Gfx - bl LZDecompressWram - ldr r4, =gUnknown_0203AAD8 - movs r0, 0xD8 - lsls r0, 6 - bl Alloc - adds r1, r0, 0 - str r1, [r4] - ldr r0, =gUnknown_085A858C - bl LZDecompressWram - ldr r4, =gUnknown_0203AB30 - movs r0, 0xB0 - bl AllocZeroed - str r0, [r4] - movs r3, 0 - ldr r5, =gUnknown_085A8334 - adds r6, r4, 0 -_0812F822: - ldr r2, [r4] - lsls r1, r3, 3 - adds r2, r1, r2 - adds r1, r5 - ldr r0, [r1] - str r0, [r2] - ldrh r0, [r1, 0x4] - strh r0, [r2, 0x4] - ldrh r0, [r1, 0x6] - strh r0, [r2, 0x6] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x15 - bls _0812F822 - ldr r3, [r6] - adds r2, r3, 0 - adds r2, 0x88 - ldr r0, =gUnknown_0203AAD4 - ldr r1, [r0] - movs r4, 0xA0 - lsls r4, 4 - adds r0, r1, r4 - str r0, [r2] - adds r2, 0x8 - movs r4, 0xA0 - lsls r4, 5 - adds r0, r1, r4 - str r0, [r2] - adds r2, 0x8 - movs r4, 0xB0 - lsls r4, 5 - adds r0, r1, r4 - str r0, [r2] - adds r0, r3, 0 - adds r0, 0xA0 - movs r2, 0xC8 - lsls r2, 5 - adds r1, r2 - str r1, [r0] - adds r0, r3, 0 - bl LoadSpriteSheets - ldr r0, =gUnknown_085A8544 - bl LoadSpritePalettes - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812F7E4 - - thumb_func_start sub_812F8A0 -sub_812F8A0: @ 812F8A0 - push {r4-r6,lr} - ldr r5, =gUnknown_0203AB2C - movs r0, 0x8 - bl AllocZeroed - str r0, [r5] - ldr r4, =gUnknown_0203AAE0 - movs r0, 0x80 - lsls r0, 6 - bl AllocZeroed - str r0, [r4] - adds r3, r0, 0 - movs r1, 0 - adds r6, r4, 0 - ldr r0, =gUnknown_085A83E4 - ldr r4, [r0] -_0812F8C2: - movs r2, 0 - adds r1, 0x1 -_0812F8C6: - adds r0, r4, r2 - ldrb r0, [r0] - strb r0, [r3] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - adds r3, 0x1 - cmp r2, 0x1F - bls _0812F8C6 - lsls r0, r1, 24 - lsrs r1, r0, 24 - cmp r1, 0x3F - bls _0812F8C2 - ldr r0, [r5] - ldr r1, [r6] - str r1, [r0] - movs r1, 0x80 - lsls r1, 4 - strh r1, [r0, 0x4] - movs r1, 0x11 - strh r1, [r0, 0x6] - bl LoadSpriteSheet - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812F8A0 - - thumb_func_start sub_812F908 -sub_812F908: @ 812F908 - push {r4,r5,lr} - ldr r4, =gUnknown_0203AAC8 - movs r5, 0x88 - lsls r5, 6 - adds r0, r5, 0 - bl Alloc - adds r1, r0, 0 - str r1, [r4] - ldr r0, =gSlotMachineMenu_Gfx - bl LZDecompressWram - ldr r1, [r4] - movs r0, 0x2 - adds r2, r5, 0 - movs r3, 0 - bl LoadBgTiles - ldr r0, =gSlotMachineMenu_Pal - movs r1, 0 - movs r2, 0xA0 - bl LoadPalette - ldr r0, =gUnknown_085A8524 - movs r1, 0xD0 - movs r2, 0x20 - bl LoadPalette - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812F908 - - thumb_func_start sub_812F958 -sub_812F958: @ 812F958 - push {lr} - bl sub_812F968 - bl sub_812F980 - pop {r0} - bx r0 - thumb_func_end sub_812F958 - - thumb_func_start sub_812F968 -sub_812F968: @ 812F968 - push {lr} - ldr r1, =gSlotMachineMenu_Tilemap - movs r2, 0xA0 - lsls r2, 3 - movs r0, 0x2 - movs r3, 0 - bl LoadBgTilemap - pop {r0} - bx r0 - .pool - thumb_func_end sub_812F968 - - thumb_func_start sub_812F980 -sub_812F980: @ 812F980 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - movs r1, 0x4 - ldr r0, =gUnknown_0203AAD0 - mov r8, r0 -_0812F98E: - movs r0, 0 - lsls r1, 16 - mov r9, r1 -_0812F994: - mov r2, r8 - ldr r1, [r2] - mov r2, r9 - asrs r6, r2, 16 - lsls r4, r0, 16 - asrs r4, 16 - adds r5, r6, r4 - adds r3, r5, 0 - adds r3, 0xA0 - lsls r3, 16 - lsrs r3, 16 - movs r0, 0x3 - movs r2, 0x2 - bl LoadBgTilemap - mov r0, r8 - ldr r1, [r0] - adds r1, 0x2 - movs r2, 0xD0 - lsls r2, 1 - adds r3, r5, r2 - lsls r3, 16 - lsrs r3, 16 - movs r0, 0x3 - movs r2, 0x2 - bl LoadBgTilemap - mov r0, r8 - ldr r1, [r0] - adds r1, 0x4 - adds r3, r5, 0 - adds r3, 0xC0 - lsls r3, 16 - lsrs r3, 16 - movs r0, 0x3 - movs r2, 0x2 - bl LoadBgTilemap - mov r2, r8 - ldr r1, [r2] - adds r1, 0x6 - movs r0, 0xC0 - lsls r0, 1 - adds r7, r0, 0 - adds r3, r5, r7 - lsls r3, 16 - lsrs r3, 16 - movs r0, 0x3 - movs r2, 0x2 - bl LoadBgTilemap - adds r4, 0x1 - lsls r4, 16 - lsrs r0, r4, 16 - asrs r4, 16 - cmp r4, 0x3 - ble _0812F994 - mov r2, r8 - ldr r1, [r2] - adds r1, 0x8 - adds r3, r6, 0 - adds r3, 0xC0 - lsls r3, 16 - lsrs r3, 16 - movs r0, 0x3 - movs r2, 0x2 - bl LoadBgTilemap - mov r0, r8 - ldr r1, [r0] - adds r1, 0xA - adds r3, r6, r7 - lsls r3, 16 - lsrs r3, 16 - movs r0, 0x3 - movs r2, 0x2 - bl LoadBgTilemap - movs r0, 0x7 -_0812FA32: - mov r2, r8 - ldr r1, [r2] - adds r1, 0xC - lsls r4, r0, 16 - asrs r4, 16 - lsls r3, r4, 5 - mov r0, r9 - asrs r5, r0, 16 - adds r3, r5, r3 - lsls r3, 16 - lsrs r3, 16 - movs r0, 0x3 - movs r2, 0x2 - bl LoadBgTilemap - adds r4, 0x1 - lsls r4, 16 - lsrs r0, r4, 16 - asrs r4, 16 - cmp r4, 0xB - ble _0812FA32 - adds r0, r5, 0x5 - lsls r0, 16 - lsrs r1, r0, 16 - asrs r0, 16 - cmp r0, 0x11 - ble _0812F98E - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812F980 - - thumb_func_start sub_81065A8 -sub_81065A8: @ 812FA78 - push {r4-r6,lr} - adds r4, r0, 0 - ldr r5, [sp, 0x10] - ldr r6, =gUnknown_0203AADC - ldr r0, [r6] - strh r1, [r0] - ldr r1, [r6] - strh r2, [r1, 0x2] - strh r3, [r1, 0x4] - strh r5, [r1, 0x6] - lsls r4, 16 - asrs r5, r4, 16 - movs r0, 0xF0 - lsls r0, 17 - adds r4, r0 - lsrs r4, 16 - movs r0, 0x2 - movs r2, 0x2 - adds r3, r4, 0 - bl LoadBgTilemap - ldr r1, [r6] - adds r1, 0x2 - ldr r0, =0x000001e1 - adds r3, r5, r0 - lsls r3, 16 - lsrs r3, 16 - movs r0, 0x2 - movs r2, 0x2 - bl LoadBgTilemap - ldr r1, [r6] - adds r1, 0x4 - movs r0, 0x80 - lsls r0, 2 - adds r3, r5, r0 - lsls r3, 16 - lsrs r3, 16 - movs r0, 0x2 - movs r2, 0x2 - bl LoadBgTilemap - ldr r1, [r6] - adds r1, 0x6 - ldr r0, =0x00000201 - adds r5, r0 - lsls r5, 16 - lsrs r5, 16 - movs r0, 0x2 - movs r2, 0x2 - adds r3, r5, 0 - bl LoadBgTilemap - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81065A8 - - thumb_func_start sub_81065DC -sub_81065DC: @ 812FAF4 - push {lr} - ldr r1, =gUnknown_08DCEC70 - movs r2, 0xA0 - lsls r2, 3 - movs r0, 0x2 - movs r3, 0 - bl LoadBgTilemap - movs r0, 0x3 - bl HideBg - pop {r0} - bx r0 - .pool - thumb_func_end sub_81065DC - - thumb_func_start SlotMachineSetup_9_0 -SlotMachineSetup_9_0: @ 812FB14 - ldr r1, =gUnknown_03001188 - ldr r0, =gUnknown_0203AAF4 - ldr r0, [r0] - str r0, [r1] - ldr r0, =gUnknown_0203AAF8 - ldr r0, [r0] - str r0, [r1, 0x4] - ldr r0, =gUnknown_0203AAFC - ldr r0, [r0] - str r0, [r1, 0x8] - ldr r0, =gUnknown_0203AB04 - ldr r0, [r0] - str r0, [r1, 0xC] - ldr r0, =gUnknown_0203AB08 - ldr r0, [r0] - str r0, [r1, 0x10] - ldr r0, =gUnknown_0203AB18 - ldr r0, [r0] - str r0, [r1, 0x14] - ldr r0, =gUnknown_0203AB1C - ldr r0, [r0] - str r0, [r1, 0x18] - ldr r0, =gUnknown_0203AB20 - ldr r0, [r0] - str r0, [r1, 0x1C] - ldr r0, =gUnknown_0203AB24 - ldr r0, [r0] - str r0, [r1, 0x20] - ldr r0, =gUnknown_0203AB28 - ldr r0, [r0] - str r0, [r1, 0x24] - ldr r0, =gUnknown_0203AB00 - ldr r0, [r0] - str r0, [r1, 0x28] - str r0, [r1, 0x2C] - str r0, [r1, 0x30] - str r0, [r1, 0x34] - ldr r0, =gUnknown_0203AB0C - ldr r0, [r0] - str r0, [r1, 0x38] - str r0, [r1, 0x3C] - str r0, [r1, 0x40] - str r0, [r1, 0x44] - str r0, [r1, 0x48] - ldr r0, =gUnknown_0203AB10 - ldr r0, [r0] - str r0, [r1, 0x4C] - str r0, [r1, 0x50] - str r0, [r1, 0x54] - ldr r0, =gUnknown_0203AB14 - ldr r0, [r0] - str r0, [r1, 0x58] - str r0, [r1, 0x5C] - str r0, [r1, 0x60] - movs r0, 0 - str r0, [r1, 0x64] - bx lr - .pool - thumb_func_end SlotMachineSetup_9_0 - - thumb_func_start SlotMachineSetup_8_0 -SlotMachineSetup_8_0: @ 812FBC4 - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r4, =gUnknown_0203AAF4 - movs r0, 0x8 - bl AllocZeroed - str r0, [r4] - ldr r6, =gUnknown_0203AAD4 - ldr r1, [r6] - str r1, [r0] - movs r5, 0xC0 - lsls r5, 3 - strh r5, [r0, 0x4] - ldr r4, =gUnknown_0203AAF8 - movs r0, 0x8 - bl AllocZeroed - str r0, [r4] - ldr r1, [r6] - adds r1, r5 - str r1, [r0] - movs r1, 0x80 - lsls r1, 2 - mov r8, r1 - mov r2, r8 - strh r2, [r0, 0x4] - ldr r4, =gUnknown_0203AAFC - movs r0, 0x8 - bl AllocZeroed - str r0, [r4] - ldr r1, [r6] - movs r3, 0x80 - lsls r3, 4 - adds r1, r3 - str r1, [r0] - mov r4, r8 - strh r4, [r0, 0x4] - ldr r4, =gUnknown_0203AB00 - movs r0, 0x8 - bl AllocZeroed - str r0, [r4] - ldr r1, [r6] - movs r2, 0xA0 - lsls r2, 4 - adds r1, r2 - str r1, [r0] - mov r3, r8 - strh r3, [r0, 0x4] - ldr r4, =gUnknown_0203AB04 - movs r0, 0x8 - bl AllocZeroed - str r0, [r4] - ldr r1, [r6] - movs r4, 0xC0 - lsls r4, 4 - adds r1, r4 - str r1, [r0] - movs r5, 0xC0 - lsls r5, 2 - strh r5, [r0, 0x4] - ldr r4, =gUnknown_0203AB08 - movs r0, 0x8 - bl AllocZeroed - str r0, [r4] - ldr r1, [r6] - movs r2, 0x80 - lsls r2, 5 - adds r1, r2 - str r1, [r0] - movs r1, 0x80 - lsls r1, 3 - strh r1, [r0, 0x4] - ldr r4, =gUnknown_0203AB0C - movs r0, 0x8 - bl AllocZeroed - str r0, [r4] - ldr r1, [r6] - movs r3, 0xA0 - lsls r3, 5 - adds r1, r3 - str r1, [r0] - mov r4, r8 - strh r4, [r0, 0x4] - ldr r4, =gUnknown_0203AB10 - movs r0, 0x8 - bl AllocZeroed - str r0, [r4] - ldr r1, [r6] - movs r2, 0xB0 - lsls r2, 5 - adds r1, r2 - str r1, [r0] - strh r5, [r0, 0x4] - ldr r4, =gUnknown_0203AB14 - movs r0, 0x8 - bl AllocZeroed - str r0, [r4] - ldr r1, [r6] - movs r3, 0xC8 - lsls r3, 5 - adds r1, r3 - str r1, [r0] - strh r5, [r0, 0x4] - ldr r4, =gUnknown_0203AB18 - movs r0, 0x10 - bl AllocZeroed - str r0, [r4] - ldr r1, [r6] - movs r4, 0xE0 - lsls r4, 5 - adds r2, r1, r4 - str r2, [r0] - mov r2, r8 - strh r2, [r0, 0x4] - movs r3, 0xF0 - lsls r3, 5 - adds r1, r3 - str r1, [r0, 0x8] - strh r2, [r0, 0xC] - ldr r4, =gUnknown_0203AB1C - movs r0, 0x8 - bl AllocZeroed - str r0, [r4] - ldr r1, [r6] - movs r4, 0x80 - lsls r4, 6 - adds r1, r4 - str r1, [r0] - movs r1, 0xA0 - lsls r1, 2 - strh r1, [r0, 0x4] - ldr r4, =gUnknown_0203AB20 - movs r0, 0x28 - bl AllocZeroed - str r0, [r4] - ldr r2, [r6] - movs r3, 0x8A - lsls r3, 6 - adds r1, r2, r3 - str r1, [r0] - movs r3, 0x80 - strh r3, [r0, 0x4] - movs r4, 0x8C - lsls r4, 6 - adds r1, r2, r4 - str r1, [r0, 0x8] - strh r3, [r0, 0xC] - adds r4, 0x80 - adds r1, r2, r4 - str r1, [r0, 0x10] - strh r3, [r0, 0x14] - adds r4, 0x80 - adds r1, r2, r4 - str r1, [r0, 0x18] - strh r3, [r0, 0x1C] - movs r1, 0x92 - lsls r1, 6 - adds r2, r1 - str r2, [r0, 0x20] - strh r3, [r0, 0x24] - ldr r4, =gUnknown_0203AB24 - movs r0, 0x10 - bl AllocZeroed - str r0, [r4] - ldr r2, [r6] - movs r3, 0x98 - lsls r3, 6 - adds r1, r2, r3 - str r1, [r0] - movs r1, 0x90 - lsls r1, 3 - strh r1, [r0, 0x4] - movs r4, 0xAA - lsls r4, 6 - adds r2, r4 - str r2, [r0, 0x8] - strh r1, [r0, 0xC] - ldr r4, =gUnknown_0203AB28 - movs r0, 0x10 - bl AllocZeroed - str r0, [r4] - ldr r2, [r6] - movs r3, 0xBC - lsls r3, 6 - adds r1, r2, r3 - str r1, [r0] - movs r1, 0xC0 - lsls r1, 1 - strh r1, [r0, 0x4] - movs r4, 0xC2 - lsls r4, 6 - adds r2, r4 - str r2, [r0, 0x8] - strh r1, [r0, 0xC] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end SlotMachineSetup_8_0 .align 2, 0 @ Don't pad with nop. diff --git a/data/slot_machine.s b/data/slot_machine.s index bbbba9652f..1a57f6abd1 100644 --- a/data/slot_machine.s +++ b/data/slot_machine.s @@ -2,195 +2,45 @@ .include "constants/constants.inc" .section .rodata - .align 2, 0 -gUnknown_085A7614:: @ 85A7614 - .2byte 16 - -gUnknown_085A7616:: @ 85A7616 - .2byte 0, 0x40, 0x80, 0xC0 - -gUnknown_085A761E:: @ 85A761E - .2byte 4, -4, 4, -4 - -gUnknown_085A7626:: @ 85A7626 - .2byte 4, 4, -4, -4 - -gUnknown_085A762E:: @ 85A762E - .2byte 0, 0xFFD8, 0, 0, 0x30, 0, 0x18, 0 - -gUnknown_085A763E:: @ 85A763E - .2byte 0xFFE0, 0, 0xFFE0, 0xFFD0, 0, 0xFFD0, 0, 0xFFD0 - -gUnknown_085A764E:: @ 85A764E - .2byte 16, 12, 16, 0, 0, 4, 8, 8 - -gUnknown_085A765E:: @ 85A765E - .2byte 0xA0, 0xC0, 0xE0, 0x68, 0x50, 0x40, 0x30, 0x18 - -sReelSymbols:: @ 85A766E - .byte 0, 4, 2, 6, 5, 3, 1, 3, 4, 5, 6, 2, 0, 5, 3, 6, 2, 1, 5, 3, 6 - .byte 0, 4, 6, 3, 2, 4, 6, 5, 5, 3, 1, 3, 6, 4, 2, 3, 6, 4, 3, 6, 4 - .byte 0, 5, 1, 6, 3, 2, 6, 3, 5, 2, 6, 3, 2, 5, 6, 3, 2, 5, 6, 3, 4 - -gUnknown_083ECCF1:: @ 85A76AD - .byte 1, 0, 5, 4, 3, 2, 0 - -gUnknown_083ECCF8:: @ 85A76B4 - .2byte 0, 6, 0, 10, 0, 2 - -gUnknown_083ECD04:: @ 85A76C0 - .byte 1, 1, 12 - .byte 1, 1, 14 - .byte 2, 2, 14 - .byte 2, 2, 14 - .byte 2, 3, 16 - .byte 3, 3, 16 - -gUnknown_083ECD16:: @ 85A76D2 - .byte 0x19, 0x19, 0x1E, 0x28, 0x28, 0x32 - .byte 0x19, 0x19, 0x1E, 0x1E, 0x23, 0x23 - .byte 0x19, 0x19, 0x1E, 0x19, 0x19, 0x1E - -gUnknown_083ECD28:: @ 85A76E4 - .byte 0x14, 0x19, 0x19, 0x14, 0x19, 0x19 - .byte 0xC, 0xF, 0xF, 0x12, 0x13, 0x16 - .byte 0x19, 0x19, 0x19, 0x1E, 0x1E, 0x28 - .byte 0x19, 0x19, 0x14, 0x14, 0xF, 0xF - .byte 0x28, 0x28, 0x23, 0x23, 0x28, 0x28 - -gUnknown_083ECD46:: @ 85A7702 - .byte 0xF3, 0xF3, 0xF3, 0x50, 0x50, 0x50, 0x50, 0x28, 0x28, 0x28, 0x28, 0x28, 0x28, 0x5, 0x5, 0x5, 0x5 - .byte 0x5, 0x5, 0x5, 0x96, 0x96, 0x96, 0x96, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x64, 0x64, 0x64, 0x5 - .byte 0x4, 0x4, 0x4, 0x14, 0x14, 0x14, 0x14, 0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x64, 0x64, 0x64, 0x28 - .byte 0x2, 0x2, 0x2, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x3, 0x2D, 0x2D, 0x2D, 0x64 - .byte 0x1, 0x1, 0x1, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x2, 0x5, 0x5, 0x5, 0x64 - .byte 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x6 - -gUnknown_083ECDAC:: @ 85A7768 - .byte 0xF3, 0xF3, 0xF3, 0xC8, 0xC8, 0xC8, 0xC8, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0x46, 0x46, 0x46, 0x05 - .byte 0x05, 0x05, 0x05, 0x19, 0x19, 0x19, 0x19, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x02, 0x02, 0x02, 0x06 - .byte 0x04, 0x04, 0x04, 0x19, 0x19, 0x19, 0x19, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x28, 0x28, 0x28, 0x23 - .byte 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x64, 0x64, 0x64, 0x32 - .byte 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x28, 0x28, 0x28, 0x64 - .byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x04, 0x04, 0x04, 0x3C - -gUnknown_083ECE12:: @ 85A77CE - .2byte 0x80, 0xAF, 0xC8, 0xE1, 0x100 - -gUnknown_083ECE1C:: @ 85A77D8 - .byte 10, 0, 5, 0 - .byte 10, 0, 10, 0 - .byte 10, 0, 15, 0 - .byte 10, 0, 25, 0 - .byte 10, 0, 35, 0 - -gUnknown_083ECE30:: @ 85A77EC - .byte 0, 0 - .byte 5, 0 - .byte 10, 0 - .byte 15, 0 - .byte 20, 0 - -gUnknown_083ECE3A:: @ 85A77F6 - .byte 6, 4, 3, 2, 5, 0, 0, 0 - -gUnknown_083ECE42:: @ 85A77FE - .byte 0x80, 0 - .byte 0x20, 0 - .byte 0x40, 0 - -gUnknown_083ECE48:: @ 85A7804 - .byte 16, 0 - .byte 8, 0 - .byte 4, 0 - .byte 2, 0 - .byte 1, 0 - -sSym2Match:: @ 85A780E - .byte 7, 8, 4, 3, 0, 5, 2, 0 - -sSlotMatchFlags:: @ 85A7816 - .2byte 1, 2, 4, 8, 16, 32, 64, 128, 256 - -sSlotPayouts:: @ 85A7828 - .2byte 2, 4, 0, 6, 12, 3, 0x5A, 0x12C, 0x12C - -gUnknown_085A783A:: @ 85A783A - .2byte 0xD0, 0x38 - .2byte 0xB8, 0 - .2byte 0xC8, 8 - .2byte 0xD8, 0x10 - .2byte 0xE8, 0x18 - .2byte 0xD0, 0x48 - .2byte 0xD0, 8 - .2byte 0xD0, 0x40 - .2byte 0xD0, 0x38 - .2byte 0xC0, 0x58 - .2byte 0xE0, 0x58 - .2byte 0xC0, 0x78 - .2byte 0xE0, 0x78 - .2byte 0x90, 0x38 - .2byte 0x110, 0x58 - .2byte 0xA8, 0x70 - .2byte 0xD0, 0x54 - .2byte 0xD0, 0x70 - .2byte 0xBC, 0x34 - .2byte 0xD0, 0x34 - .2byte 0xE4, 0x34 - .2byte 0xB8, 0x48 - .2byte 0xC4, 0x48 - .2byte 0xD0, 0x48 - .2byte 0xDC, 0x48 - .2byte 0xE8, 0x48 - .2byte 0xBC, 0x34 - .2byte 0xD0, 0x34 - .2byte 0xE4, 0x34 - .2byte 0xB8, 0x48 - .2byte 0xC4, 0x48 - .2byte 0xD0, 0x48 - .2byte 0xDC, 0x48 - .2byte 0xE8, 0x48 - .2byte 0x00, 0x00 - .2byte 0 +.align 2 - -gUnknown_085A78C8:: @ 85A78C8 - .4byte sub_812F078 - .4byte sub_812F36C - .4byte sub_812F36C - .4byte sub_812F36C - .4byte sub_812F36C - .4byte sub_812F3B4 - .4byte sub_812F2CC - .4byte sub_812F078 - .4byte sub_812F078 - .4byte sub_812F080 - .4byte sub_812F104 - .4byte sub_812F11C - .4byte sub_812F134 - .4byte sub_812F150 - .4byte sub_812F1B8 - .4byte sub_812F21C - .4byte sub_812F078 - .4byte sub_812F470 - .4byte sub_812F514 - .4byte sub_812F514 - .4byte sub_812F514 - .4byte sub_812F514 - .4byte sub_812F514 - .4byte sub_812F514 - .4byte sub_812F514 - .4byte sub_812F514 - .4byte sub_812F5E0 - .4byte sub_812F5E0 - .4byte sub_812F5E0 - .4byte sub_812F5E0 - .4byte sub_812F5E0 - .4byte sub_812F5E0 - .4byte sub_812F5E0 - .4byte sub_812F5E0 - .4byte sub_812F648 +gUnknown_083ECF0C:: @ 85A78C8 + .4byte sub_8105C64 + .4byte sub_8105F54 + .4byte sub_8105F54 + .4byte sub_8105F54 + .4byte sub_8105F54 + .4byte sub_8105F9C + .4byte sub_8105EB4 + .4byte sub_8105C64 + .4byte sub_8105C64 + .4byte sub_8105C6C + .4byte sub_8105CF0 + .4byte sub_8105D08 + .4byte sub_8105D20 + .4byte sub_8105D3C + .4byte sub_8105DA4 + .4byte sub_8105E08 + .4byte sub_8105C64 + .4byte sub_8106058 + .4byte sub_81060FC + .4byte sub_81060FC + .4byte sub_81060FC + .4byte sub_81060FC + .4byte sub_81060FC + .4byte sub_81060FC + .4byte sub_81060FC + .4byte sub_81060FC + .4byte sub_81061C8 + .4byte sub_81061C8 + .4byte sub_81061C8 + .4byte sub_81061C8 + .4byte sub_81061C8 + .4byte sub_81061C8 + .4byte sub_81061C8 + .4byte sub_81061C8 + .4byte sub_8106230 gUnknown_085A7954:: @ 85A7954 .byte 0x19 @@ -348,13 +198,13 @@ gUnknown_083ED048:: @ 85A7A04 .4byte gUnknown_085A79B4 gUnknown_083ED064:: @ 85A7A20 - .4byte sub_812F7C0 - .4byte sub_812F784 - .4byte sub_812F794 - .4byte nullsub_101 - .4byte nullsub_101 - .4byte sub_812F794 - .4byte sub_812F794 + .4byte sub_810639C + .4byte sub_8106364 + .4byte sub_8106370 + .4byte nullsub_70 + .4byte nullsub_70 + .4byte sub_8106370 + .4byte sub_8106370 gUnknown_085A7A3C:: @ 85A7A3C .2byte 0 @@ -663,40 +513,40 @@ gSpriteTemplate_83ED444:: @ 85A7D10 spr_template 17, 0, gUnknown_085A7A74, gUnknown_085A7BF8, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy gSpriteTemplate_83ED45C:: @ 85A7D28 - spr_template 0xFFFF, 1, gUnknown_085A7A74, gUnknown_085A7C00, NULL, gDummySpriteAffineAnimTable, sub_812E424 + spr_template 0xFFFF, 1, gUnknown_085A7A74, gUnknown_085A7C00, NULL, gDummySpriteAffineAnimTable, sub_8105170 -gUnknown_085A7D40:: @ 85A7D40 +gSpriteTemplate_83ED474:: @ 85A7D40 spr_template 0xFFFF, 2, gUnknown_085A7A44, gUnknown_085A7BF8, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy -gUnknown_085A7D58:: @ 85A7D58 +gSpriteTemplate_83ED48C:: @ 85A7D58 spr_template 0xFFFF, 3, gUnknown_085A7A44, gUnknown_085A7BF8, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy -gUnknown_085A7D70:: @ 85A7D70 +gSpriteTemplate_83ED4A4:: @ 85A7D70 spr_template 0xFFFF, 3, gUnknown_085A7A44, gUnknown_085A7BF8, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy -gUnknown_085A7D88:: @ 85A7D88 +gSpriteTemplate_83ED4BC:: @ 85A7D88 spr_template 0xFFFF, 4, gUnknown_085A7A4C, gUnknown_085A7C18, gUnknown_085A7A7C, gDummySpriteAffineAnimTable, sub_810535C -gUnknown_085A7DA0:: @ 85A7DA0 +gSpriteTemplate_83ED4D4:: @ 85A7DA0 spr_template 0xFFFF, 4, gUnknown_085A7A4C, gUnknown_085A7BF8, gUnknown_085A7AAC, gDummySpriteAffineAnimTable, SpriteCallbackDummy -gUnknown_085A7DB8:: @ 85A7DB8 +gSpriteTemplate_83ED4EC:: @ 85A7DB8 spr_template 0xFFFF, 4, gUnknown_085A7A4C, gUnknown_085A7BF8, gUnknown_085A7AB4, gDummySpriteAffineAnimTable, SpriteCallbackDummy -gUnknown_085A7DD0:: @ 85A7DD0 - spr_template 0xFFFF, 4, gUnknown_085A7A54, gUnknown_085A7C30, gUnknown_085A7ABC, gDummySpriteAffineAnimTable, sub_812E9E8 +gSpriteTemplate_83ED504:: @ 85A7DD0 + spr_template 0xFFFF, 4, gUnknown_085A7A54, gUnknown_085A7C30, gUnknown_085A7ABC, gDummySpriteAffineAnimTable, sub_810562C -gUnknown_085A7DE8:: @ 85A7DE8 - spr_template 0xFFFF, 7, gUnknown_085A7A64, gUnknown_085A7BF8, gUnknown_085A7ACC, gDummySpriteAffineAnimTable, sub_812EB48 +gSpriteTemplate_83ED51C:: @ 85A7DE8 + spr_template 0xFFFF, 7, gUnknown_085A7A64, gUnknown_085A7BF8, gUnknown_085A7ACC, gDummySpriteAffineAnimTable, sub_8105784 -gUnknown_085A7E00:: @ 85A7E00 - spr_template 0xFFFF, 5, gUnknown_085A7A5C, gUnknown_085A7C34, gUnknown_085A7AD4, gDummySpriteAffineAnimTable, sub_812EC64 +gSpriteTemplate_83ED534:: @ 85A7E00 + spr_template 0xFFFF, 5, gUnknown_085A7A5C, gUnknown_085A7C34, gUnknown_085A7AD4, gDummySpriteAffineAnimTable, sub_8105894 -gUnknown_085A7E18:: @ 85A7E18 - spr_template 0xFFFF, 4, gUnknown_085A7A3C, gUnknown_085A7BFC, gUnknown_085A7AE4, gDummySpriteAffineAnimTable, sub_812ED20 +gSpriteTemplate_83ED54C:: @ 85A7E18 + spr_template 0xFFFF, 4, gUnknown_085A7A3C, gUnknown_085A7BFC, gUnknown_085A7AE4, gDummySpriteAffineAnimTable, sub_810594C -gUnknown_085A7E30:: @ 85A7E30 - spr_template 0xFFFF, 4, gUnknown_085A7A4C, gUnknown_085A7BF8, gUnknown_085A7AEC, gUnknown_085A7C88, sub_812EE14 +gSpriteTemplate_83ED564:: @ 85A7E30 + spr_template 0xFFFF, 4, gUnknown_085A7A4C, gUnknown_085A7BF8, gUnknown_085A7AEC, gUnknown_085A7C88, sub_8105A38 gUnknown_085A7E48:: @ 85A7E48 spr_template 0xFFFF, 6, gUnknown_085A7A3C, gUnknown_085A7BF8, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy @@ -740,8 +590,8 @@ gUnknown_085A7F68:: @ 85A7F68 gUnknown_085A7F80:: @ 85A7F80 spr_template 0xFFFF, 6, gUnknown_085A7A3C, gUnknown_085A7C40, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy -gUnknown_085A7F98:: @ 85A7F98 - spr_template 0xFFFF, 4, gUnknown_085A7A3C, gUnknown_085A7BF8, gUnknown_085A7AF4, gUnknown_085A7CDC, sub_812EF54 +gSpriteTemplate_83ED6CC:: @ 85A7F98 + spr_template 0xFFFF, 4, gUnknown_085A7A3C, gUnknown_085A7BF8, gUnknown_085A7AF4, gUnknown_085A7CDC, sub_8105B70 gUnknown_085A7FB0:: @ 85A7FB0 subsprite -64, -64, 3, 0, 64x64 @@ -760,7 +610,7 @@ gUnknown_085A7FC8:: @ 85A7FC8 subsprite -32, 4, 1, 16, 32x8 subsprite 0, 4, 1, 20, 32x8 -gUnknown_085A7FE0:: @ 85A7FE0 +gSubspriteTables_83ED73C:: @ 85A7FE0 .4byte 6, gUnknown_085A7FC8 gUnknown_085A7FE8:: @ 85A7FE8 @@ -768,7 +618,7 @@ gUnknown_085A7FE8:: @ 85A7FE8 subsprite -32, 12, 1, 32, 32x8 subsprite 0, 12, 1, 36, 32x8 -gUnknown_085A7FF4:: @ 85A7FF4 +gSubspriteTables_83ED75C:: @ 85A7FF4 .4byte 3, gUnknown_085A7FE8 gUnknown_085A7FFC:: @ 85A7FFC @@ -778,7 +628,7 @@ gUnknown_085A7FFC:: @ 85A7FFC subsprite -32, 16, 1, 40, 32x8 subsprite 0, 16, 1, 44, 32x8 -gUnknown_085A8010:: @ 85A8010 +gSubspriteTables_83ED78C:: @ 85A8010 .4byte 5, gUnknown_085A7FFC gUnknown_085A8018:: @ 85A8018 @@ -787,7 +637,7 @@ gUnknown_085A8018:: @ 85A8018 subsprite -32, 0, 1, 8, 32x8 subsprite 0, 0, 1, 12, 32x8 -gUnknown_085A8028:: @ 85A8028 +gSubspriteTables_83ED7B4:: @ 85A8028 .4byte 4, gUnknown_085A8018 gUnknown_085A8030:: @ 85A8030 @@ -795,7 +645,7 @@ gUnknown_085A8030:: @ 85A8030 subsprite -8, -4, 1, 0, 16x8 subsprite -8, 4, 1, 0, 16x8 -gUnknown_085A803C:: @ 85A803C +gSubspriteTables_83ED7D4:: @ 85A803C .4byte 3, gUnknown_085A8030 gUnknown_085A8044:: @ 85A8044 @@ -1006,7 +856,7 @@ gUnknown_085A8244:: @ 85A8244 gUnknown_085A825C:: @ 85A825C .4byte 6, gUnknown_085A8244 -gUnknown_085A8264:: @ 85A8264 +gUnknown_083EDB5C:: @ 85A8264 .4byte gUnknown_085A7E48 .4byte gUnknown_085A7E60 .4byte gUnknown_085A7E78 @@ -1034,7 +884,7 @@ gUnknown_085A8264:: @ 85A8264 .4byte gUnknown_085A7F08 .4byte gDummySpriteTemplate -gUnknown_085A82CC:: @ 85A82CC +gUnknown_083EDBC4:: @ 85A82CC .4byte gUnknown_085A8058 .4byte gUnknown_085A8070 .4byte gUnknown_085A8088 @@ -1063,7 +913,7 @@ gUnknown_085A82CC:: @ 85A82CC .4byte NULL .align 2 -gUnknown_085A8334:: @ 85A8334 +sSlotMachineSpriteSheets:: @ 85A8334 obj_tiles gSlotMachineReelSymbol1Tiles, 0x0200, 0x0000 obj_tiles gSlotMachineReelSymbol2Tiles, 0x0200, 0x0001 obj_tiles gSlotMachineReelSymbol3Tiles, 0x0200, 0x0002 @@ -1085,7 +935,7 @@ gUnknown_085A8334:: @ 85A8334 .align 2 .byte 0, 0, 0, 0, 0, 2, 0x12, 0, 0, 0, 0, 0, 0, 2, 0x13, 0, 0, 0, 0, 0, 0, 3, 0x14, 0, 0, 0, 0, 0, 0, 3, 0x15, 0, 0, 0, 0, 0, 0, 0, 0, 0 -gUnknown_085A83E4:: @ 85A83E4 +gUnknown_083EDCDC:: @ 85A83E4 .4byte gUnknown_08DD19F8 @ might be a palette idk .byte 0x7B, 0x6F, 0x68, 0x69, 0xAB, 0x36, 0xFF, 0x7F, 0x50, 0x57, 0xC0, 0x7E, 0xBA, 2, 0xBA, 2, 0xFD, 1, 0xFD, 1 @@ -1157,20 +1007,20 @@ gUnknown_085A84D0:: @ 85A84D0 gUnknown_085A84F0:: @ 85A84F0 .incbin "graphics/slot_machine/85A84F0.gbapal" -gUnknown_085A8510:: @ 85A8510 +gUnknown_083EDE10:: @ 85A8510 .4byte gUnknown_085A84B0 .4byte gUnknown_085A84D0 .4byte gUnknown_085A84F0 .4byte gUnknown_08DCF230 -gUnknown_085A8520:: @ 85A8520 +gUnknown_083EDE20:: @ 85A8520 .4byte gUnknown_08DCF230 -gUnknown_085A8524:: @ 85A8524 +gPalette_83EDE24:: @ 85A8524 .incbin "graphics/slot_machine/85A8524.bin" .align 2 -gUnknown_085A8544:: @ 85A8544 +gSlotMachineSpritePalettes:: @ 85A8544 obj_pal gUnknown_08DCF170, 0 obj_pal gUnknown_08DCF190, 1 obj_pal gUnknown_08DCF1B0, 2 @@ -1181,7 +1031,7 @@ gUnknown_085A8544:: @ 85A8544 obj_pal gUnknown_08DCF1F0, 7 null_obj_pal -gUnknown_085A858C:: @ 85A858C +sReelTimeGfx:: @ 85A858C .incbin "graphics/slot_machine/reel_time_gfx.4bpp.lz" sReelTimeWindowTilemap:: @ 85A96E0 diff --git a/src/slot_machine.c b/src/slot_machine.c index 4ee4a2fe4f..ec5640b912 100644 --- a/src/slot_machine.c +++ b/src/slot_machine.c @@ -30,29 +30,31 @@ extern u16 *gUnknown_0203AAC8; extern u16 *gUnknown_0203AACC; extern u16 *gUnknown_0203AAD0; extern u16 *gUnknown_0203AADC; -extern void *gUnknown_0203AAF4; -extern void *gUnknown_0203AAF8; -extern void *gUnknown_0203AAFC; -extern void *gUnknown_0203AB00; -extern void *gUnknown_0203AB04; -extern void *gUnknown_0203AB08; -extern void *gUnknown_0203AB0C; -extern void *gUnknown_0203AB10; -extern void *gUnknown_0203AB14; -extern void *gUnknown_0203AB18; -extern void *gUnknown_0203AB1C; -extern void *gUnknown_0203AB20; -extern void *gUnknown_0203AB24; -extern void *gUnknown_0203AB28; -extern void *gUnknown_0203AAE4; -extern void *gUnknown_0203AAE8; -extern void *gUnknown_0203AAEC; -extern void *gUnknown_0203AAF0; -extern void *gUnknown_0203AAD4; -extern void *gUnknown_0203AAD8; -extern void *gUnknown_0203AAE0; -extern void *gUnknown_0203AB2C; -extern void *gUnknown_0203AB30; +extern struct SpriteFrameImage *gUnknown_0203AAF4; +extern struct SpriteFrameImage *gUnknown_0203AAF8; +extern struct SpriteFrameImage *gUnknown_0203AAFC; +extern struct SpriteFrameImage *gUnknown_0203AB00; +extern struct SpriteFrameImage *gUnknown_0203AB04; +extern struct SpriteFrameImage *gUnknown_0203AB08; +extern struct SpriteFrameImage *gUnknown_0203AB0C; +extern struct SpriteFrameImage *gUnknown_0203AB10; +extern struct SpriteFrameImage *gUnknown_0203AB14; +extern struct SpriteFrameImage *gUnknown_0203AB18; +extern struct SpriteFrameImage *gUnknown_0203AB1C; +extern struct SpriteFrameImage *gUnknown_0203AB20; +extern struct SpriteFrameImage *gUnknown_0203AB24; +extern struct SpriteFrameImage *gUnknown_0203AB28; +extern struct SpriteFrameImage *gUnknown_0203AAE4; +extern struct SpriteFrameImage *gUnknown_0203AAE8; +extern struct SpriteFrameImage *gUnknown_0203AAEC; +extern struct SpriteFrameImage *gUnknown_0203AAF0; +extern u8 *gUnknown_0203AAD4; +extern u8 *gUnknown_0203AAD8; +extern u8 *gUnknown_0203AAE0; +extern struct SpriteSheet *gUnknown_0203AB2C; +extern struct SpriteSheet *gUnknown_0203AB30; + +extern struct SpriteFrameImage *gUnknown_03001188[]; // Text extern const u8 gText_YouDontHaveThreeCoins[]; @@ -61,6 +63,9 @@ extern const u8 gText_YouveGot9999Coins[]; extern const u8 gText_YouveRunOutOfCoins[]; extern const u8 gText_ReelTimeHelp[]; +// gfx +extern const u8 gSlotMachineReelTime_Gfx[]; + enum { SLOT_MACHINE_TAG_7_RED, @@ -345,9 +350,7 @@ bool8 sub_81020C8(struct Task *task); /*static*/void sub_81064B8(void); /*static*/void sub_81065A8(s16 arg0, u16 arg1, u16 arg2, u16 arg3, u16 arg4); /*static*/void sub_81065DC(void); -/*static*/void sub_812F908(void); /*static*/void sub_812F958(void); -/*static*/void sub_812F7E4(void); /*static*/void sub_812F968(void); void LoadSlotMachineWheelOverlay(void); u8 sub_8105BB4(u8 templateIdx, u8 cbAndCoordsIdx, s16 a2); @@ -359,11 +362,28 @@ u8 sub_8105BB4(u8 templateIdx, u8 cbAndCoordsIdx, s16 a2); /*static*/extern const u8 gUnknown_083ECE3A[]; /*static*/extern const u16 gUnknown_083ECE42[]; /*static*/extern const u16 gUnknown_083ECE48[]; +extern const s16 gUnknown_083ECE7E[][2]; +extern const SpriteCallback gUnknown_083ECF0C[]; +extern const struct SpriteTemplate *const gUnknown_083EDB5C[]; +extern const struct SubspriteTable *const gUnknown_083EDBC4[]; +extern const struct SpriteTemplate gSpriteTemplate_83ED6CC; +extern const struct SpriteTemplate gSpriteTemplate_83ED564; +extern const struct SpriteTemplate gSpriteTemplate_83ED54C; +extern const struct SpriteTemplate gSpriteTemplate_83ED534; +extern const u8 gUnknown_083ECC58[2]; // don't remove this until decompiled through gUnknown_083ECCF8 +extern const struct SpriteTemplate gSpriteTemplate_83ED51C; extern const u16 gUnknown_083ECE12[]; +extern const u16 *const gUnknown_083EDE10[]; extern const u16 gUnknown_083ECE1C[][2]; extern const u16 gUnknown_083ECE30[]; extern const u16 sSlotMatchFlags[]; extern const u16 sSlotPayouts[]; +extern const u8 *const gUnknown_083EDCE4; +extern const u8 *const gUnknown_083EDCDC; +extern const u8 sReelTimeGfx[]; +extern const struct SpriteSheet sSlotMachineSpriteSheets[]; +extern const struct SpritePalette gSlotMachineSpritePalettes[]; +extern const u16 *const gUnknown_083EDE20; extern const s16 gUnknown_083ECCF8[][2]; extern const struct BgTemplate gUnknown_085A7424[4]; extern const struct WindowTemplate gUnknown_085A7434[]; @@ -869,9 +889,9 @@ void SlotMachineSetup_4_0(void) void SlotMachineSetup_5_0(void) { - sub_812F908(); - sub_812F958(); - sub_812F7E4(); + sub_8106448(); + sub_81064B8(); + sub_81063C0(); LoadMessageBoxGfx(0, 0x200, 0xF0); LoadUserWindowBorderGfx(0, 0x214, 0xE0); PutWindowTilemap(0); @@ -3227,3 +3247,1245 @@ void sub_81050C4(void) gSprites[spriteId].oam.priority = 3; SetSubspriteTables(gSprites + spriteId, gSubspriteTables_83ED704); } + +void sub_8105100(void) +{ + struct SpriteTemplate spriteTemplate; + u8 spriteId; + if (gUnknown_0203AAE4 == NULL) + gUnknown_0203AAE4 = AllocZeroed(sizeof(struct SpriteFrameImage) * 5); + + gUnknown_0203AAE4[0].data = gUnknown_0203AAD8 + (0 * 0x800); + gUnknown_0203AAE4[0].size = 0x800; + gUnknown_0203AAE4[1].data = gUnknown_0203AAD8 + (1 * 0x800); + gUnknown_0203AAE4[1].size = 0x800; + gUnknown_0203AAE4[2].data = gUnknown_0203AAD8 + (2 * 0x800); + gUnknown_0203AAE4[2].size = 0x800; + gUnknown_0203AAE4[3].data = gUnknown_0203AAD8 + (3 * 0x800); + gUnknown_0203AAE4[3].size = 0x800; + gUnknown_0203AAE4[4].data = gUnknown_0203AAD8 + (4 * 0x800); + gUnknown_0203AAE4[4].size = 0x800; + + spriteTemplate = gSpriteTemplate_83ED45C; + spriteTemplate.images = gUnknown_0203AAE4; + spriteId = CreateSprite(&spriteTemplate, 280, 80, 1); + gSprites[spriteId].oam.priority = 1; + gSprites[spriteId].coordOffsetEnabled = TRUE; + sSlotMachine->unk3F = spriteId; +} + +void sub_810514C(void) +{ + DestroySprite(gSprites + sSlotMachine->unk3F); + if (gUnknown_0203AAE4 != NULL) + FREE_AND_SET_NULL(gUnknown_0203AAE4); +} + +void sub_8105170(struct Sprite *sprite) +{ + sprite->pos2.y = sprite->pos2.x = 0; + if (sprite->animNum == 4) + { + sprite->pos2.y = sprite->pos2.x = 8; + if ((sprite->animCmdIndex != 0 && sprite->animDelayCounter != 0) || (sprite->animCmdIndex == 0 && sprite->animDelayCounter == 0)) + sprite->pos2.y = -8; + } +} + +void sub_81051C0(void) +{ + struct SpriteTemplate spriteTemplate; + u8 spriteId; + struct Sprite *sprite; + + if (gUnknown_0203AAE8 == NULL) + gUnknown_0203AAE8 = AllocZeroed(sizeof(struct SpriteFrameImage) * 1); + + gUnknown_0203AAE8[0].data = gUnknown_0203AAD8 + 0x2800; + gUnknown_0203AAE8[0].size = 0x300; + spriteTemplate = gSpriteTemplate_83ED474; + spriteTemplate.images = gUnknown_0203AAE8; + spriteId = CreateSprite(&spriteTemplate, 368, 52, 7); + sprite = &gSprites[spriteId]; + sprite->oam.priority = 1; + sprite->coordOffsetEnabled = TRUE; + SetSubspriteTables(sprite, gSubspriteTables_83ED73C); + sSlotMachine->unk49[0] = spriteId; + + if (gUnknown_0203AAEC == NULL) + gUnknown_0203AAEC = AllocZeroed(sizeof(struct SpriteFrameImage) * 1); + + gUnknown_0203AAEC[0].data = gUnknown_0203AAD8 + 0x2800 + 0x300; + gUnknown_0203AAEC[0].size = 0x500; + spriteTemplate = gSpriteTemplate_83ED48C; + spriteTemplate.images = gUnknown_0203AAEC; + spriteId = CreateSprite(&spriteTemplate, 368, 84, 7); + sprite = &gSprites[spriteId]; + sprite->oam.priority = 1; + sprite->coordOffsetEnabled = TRUE; + SetSubspriteTables(sprite, gSubspriteTables_83ED75C); + sSlotMachine->unk49[1] = spriteId; +} + +void sub_8105284_(void) +{ + struct SpriteTemplate spriteTemplate; + u8 spriteId; + struct Sprite *sprite; + + if (gUnknown_0203AAF0 == NULL) + gUnknown_0203AAF0 = AllocZeroed(sizeof(struct SpriteFrameImage) * 1); + + gUnknown_0203AAF0[0].data = gUnknown_0203AAD8 + 0x3000; + gUnknown_0203AAF0[0].size = 0x600; + spriteTemplate = gSpriteTemplate_83ED4A4; + spriteTemplate.images = gUnknown_0203AAF0; + spriteId = CreateSprite(&spriteTemplate, 0xa8 - gSpriteCoordOffsetX, 0x50, 7); + sprite = &gSprites[spriteId]; + sprite->oam.priority = 1; + sprite->coordOffsetEnabled = TRUE; + SetSubspriteTables(sprite, gSubspriteTables_83ED78C); + sSlotMachine->unk42 = spriteId; +} + +void sub_81052EC(void) +{ + u8 i; + s16 r5; + for (i = 0, r5 = 0; i < 3; i++, r5 += 20) + { + u8 spriteId = CreateSprite(&gSpriteTemplate_83ED4BC, 0x170, 0, 10); + struct Sprite *sprite = &gSprites[spriteId]; + sprite->oam.priority = 1; + sprite->coordOffsetEnabled = TRUE; + sprite->data[7] = r5; + sSlotMachine->unk4B[i] = spriteId; + } +} + +void sub_810535C(struct Sprite *sprite) +{ + s16 r0 = (u16)(sSlotMachine->unk14 + sprite->data[7]); + r0 %= 40; + sprite->pos1.y = r0 + 59; + StartSpriteAnimIfDifferent(sprite, sub_8102C48(r0 / 20)); +} + +void sub_81053A0(void) +{ + u8 spriteId = CreateSprite(&gSpriteTemplate_83ED4D4, 0x170, 0x64, 9); + struct Sprite *sprite = &gSprites[spriteId]; + sprite->coordOffsetEnabled = TRUE; + sprite->oam.priority = 1; + SetSubspriteTables(sprite, gSubspriteTables_83ED7B4); + sSlotMachine->unk4E[0] = spriteId; + + spriteId = CreateSprite(&gSpriteTemplate_83ED4D4, 0x120, 0x68, 4); + sprite = &gSprites[spriteId]; + sprite->coordOffsetEnabled = TRUE; + sprite->oam.priority = 1; + SetSubspriteTables(sprite, gSubspriteTables_83ED7B4); + sSlotMachine->unk4E[1] = spriteId; +} + +void sub_810545C(void) +{ + u8 spriteId = CreateSprite(&gSpriteTemplate_83ED4EC, 0x170, 0x4c, 11); + struct Sprite *sprite = &gSprites[spriteId]; + sprite->coordOffsetEnabled = TRUE; + sprite->oam.priority = 1; + SetSubspriteTables(sprite, gSubspriteTables_83ED7D4); + sSlotMachine->unk40 = spriteId; +} + +void sub_81054B8(void) +{ + u8 i; + + DestroySprite(&gSprites[sSlotMachine->unk40]); + for (i = 0; i < 2; i++) + DestroySprite(&gSprites[sSlotMachine->unk49[i]]); + + if (gUnknown_0203AAE8 != NULL) + FREE_AND_SET_NULL(gUnknown_0203AAE8); + if (gUnknown_0203AAEC != NULL) + FREE_AND_SET_NULL(gUnknown_0203AAEC); + + for (i = 0; i < 3; i++) + DestroySprite(&gSprites[sSlotMachine->unk4B[i]]); +} + +void sub_8105524(void) +{ + u8 i; + + for (i = 0; i < 2; i++) + DestroySprite(&gSprites[sSlotMachine->unk4E[i]]); +} + +void sub_8105554(void) +{ + DestroySprite(&gSprites[sSlotMachine->unk42]); + if (gUnknown_0203AAF0 != NULL) + FREE_AND_SET_NULL(gUnknown_0203AAF0); +} + +void sub_8105578(void) +{ + u8 spriteId = CreateSprite(&gSpriteTemplate_83ED504, 0x98, 0x20, 5); + struct Sprite *sprite = &gSprites[spriteId]; + sprite->oam.priority = 1; + sprite->hFlip = TRUE; + sSlotMachine->unk50[0] = spriteId; + sprite->data[0] = 8; + sprite->data[1] = -1; + sprite->data[2] = -1; + sprite->data[7] = 0x20; + + spriteId = CreateSprite(&gSpriteTemplate_83ED504, 0xb8, 0x20, 5); + sprite = &gSprites[spriteId]; + sprite->oam.priority = 1; + sSlotMachine->unk50[1] = spriteId; + sprite->data[1] = 1; + sprite->data[2] = -1; + sprite->data[7] = 0x20; +} + +void sub_810562C(struct Sprite *sprite) +{ + if (sprite->data[0] != 0) + { + sprite->data[0]--; + sprite->pos2.x = 0; + sprite->pos2.y = 0; + sprite->invisible = TRUE; + } + else + { + sprite->invisible = FALSE; + sprite->pos2.x += sprite->data[1]; + sprite->pos2.y += sprite->data[2]; + if (++sprite->data[3] >= 8) + { + sprite->data[0] = sprite->data[7]; + sprite->data[3] = 0; + } + } +} + +void sub_8105688(s16 a0) +{ + gSprites[sSlotMachine->unk50[0]].data[7] = a0; + gSprites[sSlotMachine->unk50[1]].data[7] = a0; +} + +void sub_81056C0(void) +{ + u8 i; + + for (i = 0; i < 2; i++) + DestroySprite(&gSprites[sSlotMachine->unk50[i]]); +} + +void sub_81056F0(void) +{ + u8 spriteId = CreateSprite(&gSpriteTemplate_83ED51C, 0x48, 0x50, 3); + gSprites[spriteId].oam.priority = 1; + gSprites[spriteId].data[0] = 1; + gSprites[spriteId].data[5] = 0; + gSprites[spriteId].data[6] = 16; + gSprites[spriteId].data[7] = 8; + sSlotMachine->unk52[0] = spriteId; + + spriteId = CreateSprite(&gSpriteTemplate_83ED51C, 0x68, 0x50, 3); + gSprites[spriteId].oam.priority = 1; + gSprites[spriteId].hFlip = TRUE; + sSlotMachine->unk52[1] = spriteId; +} + +void sub_8105784(struct Sprite *sprite) +{ + u8 sp[] = {16, 0}; + if (sprite->data[0] && --sprite->data[6] <= 0) + { + MultiplyInvertedPaletteRGBComponents((IndexOfSpritePaletteTag(7) << 4) + 0x103, sp[sprite->data[5]], sp[sprite->data[5]], sp[sprite->data[5]]); + ++sprite->data[5]; + sprite->data[5] &= 1; + sprite->data[6] = sprite->data[7]; + } +} + +void sub_81057E8(s16 a0) +{ + gSprites[sSlotMachine->unk52[0]].data[7] = a0; +} + +void sub_8105804(void) +{ + u8 i; + MultiplyInvertedPaletteRGBComponents((IndexOfSpritePaletteTag(7) << 4) + 0x103, 0, 0, 0); + for (i = 0; i < 2; i++) + DestroySprite(&gSprites[sSlotMachine->unk52[i]]); +} + +void sub_8105854(void) +{ + u8 spriteId = CreateSprite(&gSpriteTemplate_83ED534, 0xa8, 0x50, 6); + gSprites[spriteId].oam.priority = 1; + sSlotMachine->unk41 = spriteId; +} + +void sub_8105894(struct Sprite *sprite) +{ + sprite->pos2.y = gSpriteCoordOffsetY; +} + +void sub_81058A0(void) +{ + DestroySprite(&gSprites[sSlotMachine->unk41]); +} + +void sub_81058C4(void) +{ + u8 i; + u16 sp[] = {0x0, 0x40, 0x80, 0xC0}; + for (i = 0; i < 4; i++) + { + u8 spriteId = CreateSprite(&gSpriteTemplate_83ED54C, 0x50 - gSpriteCoordOffsetX, 0x44, 0); + struct Sprite *sprite = &gSprites[spriteId]; + sprite->oam.priority = 1; + sprite->coordOffsetEnabled = TRUE; + sprite->data[0] = sp[i]; + sSlotMachine->unk54[i] = spriteId; + } +} + +void sub_810594C(struct Sprite *sprite) +{ + sprite->data[0] -= 2; + sprite->data[0] &= 0xff; + sprite->pos2.x = Cos(sprite->data[0], 20); + sprite->pos2.y = Sin(sprite->data[0], 6); + sprite->subpriority = 0; + if (sprite->data[0] >= 0x80) + { + sprite->subpriority = 2; + } + if (++sprite->data[1] >= 16) + { + sprite->hFlip ^= 1; + sprite->data[1] = 0; + } +} + +void sub_81059B8(void) +{ + u8 i; + for (i = 0; i < 4; i++) + { + DestroySprite(&gSprites[sSlotMachine->unk54[i]]); + } +} + +void sub_81059E8(void) +{ + u8 spriteId = CreateSprite(&gSpriteTemplate_83ED564, 0xa8, 0x3c, 8); + struct Sprite *sprite = &gSprites[spriteId]; + sprite->oam.priority = 1; + sprite->oam.affineMode = ST_OAM_AFFINE_DOUBLE; + InitSpriteAffineAnim(sprite); + sSlotMachine->unk43 = spriteId; +} + +void sub_8105A38(struct Sprite *sprite) +{ + if (sprite->data[0] == 0) + { + if (sprite->affineAnimEnded) + sprite->data[0]++; + } + else if (sprite->data[0] == 1) + { + sprite->invisible ^= 1; + if (++sprite->data[2] >= 24) + { + sprite->data[0]++; + sprite->data[2] = 0; + } + } + else + { + sprite->invisible = TRUE; + if (++sprite->data[2] >= 16) + sprite->data[7] = 1; + } + sprite->data[1] &= 0xff; + sprite->data[1] += 16; + sprite->pos2.y -= (sprite->data[1] >> 8); +} + +u8 sub_8105ACC(void) +{ + return gSprites[sSlotMachine->unk43].data[7]; +} + +void sub_8105AEC(void) +{ + struct Sprite *sprite = &gSprites[sSlotMachine->unk43]; + FreeOamMatrix(sprite->oam.matrixNum); + DestroySprite(sprite); +} + +u8 sub_8105B1C(s16 x, s16 y) +{ + u8 spriteId = CreateSprite(&gSpriteTemplate_83ED6CC, x, y, 12); + struct Sprite *sprite = &gSprites[spriteId]; + sprite->oam.priority = 2; + sprite->oam.affineMode = ST_OAM_AFFINE_DOUBLE; + InitSpriteAffineAnim(sprite); + return spriteId; +} + +void sub_8105B70(struct Sprite *sprite) +{ + if (sprite->affineAnimEnded) + sprite->data[7] = 1; +} + +void sub_8105B88(u8 spriteId) +{ + struct Sprite *sprite = &gSprites[spriteId]; + FreeOamMatrix(sprite->oam.matrixNum); + DestroySprite(sprite); +} + +u8 sub_8105BB4(u8 templateIdx, u8 cbAndCoordsIdx, s16 a2) +{ + return sub_8105BF8(templateIdx, gUnknown_083ECF0C[cbAndCoordsIdx], gUnknown_083ECE7E[cbAndCoordsIdx][0], gUnknown_083ECE7E[cbAndCoordsIdx][1], a2); +} + +u8 sub_8105BF8(u8 templateIdx, SpriteCallback callback, s16 x, s16 y, s16 a4) +{ + struct SpriteTemplate spriteTemplate; + u8 spriteId; + struct Sprite *sprite; + + spriteTemplate = *gUnknown_083EDB5C[templateIdx]; + spriteTemplate.images = gUnknown_03001188[templateIdx]; + spriteId = CreateSprite(&spriteTemplate, x, y, 16); + sprite = &gSprites[spriteId]; + sprite->oam.priority = 3; + sprite->callback = callback; + sprite->data[6] = a4; + sprite->data[7] = 1; + if (gUnknown_083EDBC4[templateIdx]) + SetSubspriteTables(sprite, gUnknown_083EDBC4[templateIdx]); + return spriteId; +} + +void sub_8105C64(struct Sprite *sprite) +{ + sprite->data[7] = 0; +} + +void sub_8105C6C(struct Sprite *sprite) +{ + s16 sp0[] = {4, -4, 4, -4}; + s16 sp8[] = {4, 4, -4, -4}; + + if (sprite->data[1]++ >= 16) + { + sprite->subspriteTableNum ^= 1; + sprite->data[1] = 0; + } + sprite->pos2.x = 0; + sprite->pos2.y = 0; + if (sprite->subspriteTableNum != 0) + { + sprite->pos2.x = sp0[sprite->data[6]]; + sprite->pos2.y = sp8[sprite->data[6]]; + } +} + +void sub_8105CF0(struct Sprite *sprite) +{ + sprite->hFlip = TRUE; + sub_8105C6C(sprite); +} + +void sub_8105D08(struct Sprite *sprite) +{ + sprite->vFlip = TRUE; + sub_8105C6C(sprite); +} + +void sub_8105D20(struct Sprite *sprite) +{ + sprite->hFlip = TRUE; + sprite->vFlip = TRUE; + sub_8105C6C(sprite); +} + +void sub_8105D3C(struct Sprite *sprite) +{ + switch (sprite->data[0]) + { + case 0: + sprite->pos1.x += 4; + if (sprite->pos1.x >= 0xd0) + { + sprite->pos1.x = 0xd0; + sprite->data[0]++; + } + break; + case 1: + if (++sprite->data[1] > 90) + sprite->data[0]++; + break; + case 2: + sprite->pos1.x += 4; + if (sprite->pos1.x >= 0x110) + sprite->data[0]++; + break; + case 3: + sprite->data[7] = 0; + break; + } +} + +void sub_8105DA4(struct Sprite *sprite) +{ + switch (sprite->data[0]) + { + case 0: + sprite->pos1.x -= 4; + if (sprite->pos1.x <= 0xd0) + { + sprite->pos1.x = 0xd0; + sprite->data[0]++; + } + break; + case 1: + if (++sprite->data[1] > 90) + sprite->data[0]++; + break; + case 2: + sprite->pos1.x -= 4; + if (sprite->pos1.x <= 0x90) + sprite->data[0]++; + break; + case 3: + sprite->data[7] = 0; + break; + } +} + +void sub_8105E08(struct Sprite *sprite) +{ + switch (sprite->data[0]) + { + case 0: + StartSpriteAnim(sprite, sSlotMachine->unk0A - 1); + sprite->data[0]++; + // fallthrough + case 1: + if (++sprite->data[1] >= 4) + { + sprite->data[0]++; + sprite->data[1] = 0; + } + break; + case 2: + sprite->pos1.x += 4; + if (sprite->pos1.x >= 0xd0) + { + sprite->pos1.x = 0xd0; + sprite->data[0]++; + } + break; + case 3: + if (++sprite->data[1] > 90) + sprite->data[0]++; + break; + case 4: + sprite->pos1.x += 4; + if (sprite->pos1.x >= 0xf8) + sprite->data[0]++; + break; + case 5: + sprite->data[7] = 0; + break; + } +} + +void sub_8105EB4(struct Sprite *sprite) +{ + switch (sprite->data[0]) + { + case 0: + sprite->animPaused = TRUE; + sprite->data[0]++; + // fallthrough + case 1: + sprite->pos1.y += 8; + if (sprite->pos1.y >= 0x70) + { + sprite->pos1.y = 0x70; + sprite->data[1] = 16; + sprite->data[0]++; + } + break; + case 2: + if (sprite->data[2] == 0) + { + sprite->pos1.y -= sprite->data[1]; + sprite->data[1] = -sprite->data[1]; + if (++sprite->data[3] >= 2) + { + sprite->data[1] >>= 2; + sprite->data[3] = 0; + if (sprite->data[1] == 0) + { + sprite->data[0]++; + sprite->data[7] = 0; + sprite->animPaused = FALSE; + } + } + } + sprite->data[2]++; + sprite->data[2] &= 0x07; + break; + } +} + +void sub_8105F54(struct Sprite *sprite) +{ + switch (sprite->data[0]) + { + case 0: + if (++sprite->data[1] > 8) + sprite->data[0]++; + break; + case 1: + sprite->pos1.y += 2; + if (sprite->pos1.y >= 0x30) + { + sprite->pos1.y = 0x30; + sprite->data[0]++; + sprite->data[7] = 0; + } + break; + } +} + +void sub_8105F9C(struct Sprite *sprite) +{ + switch (sprite->data[0]) + { + case 0: + sprite->invisible = TRUE; + if (++sprite->data[1] > 0x20) + { + sprite->data[0]++; + sprite->data[1] = 5; + sprite->oam.mosaic = TRUE; + sprite->invisible = FALSE; + StartSpriteAnim(sprite, 1); + SetGpuReg(REG_OFFSET_MOSAIC, ((sprite->data[1] << 4) | sprite->data[1]) << 8); + } + break; + case 1: + sprite->data[1] -= (sprite->data[2] >> 8); + if (sprite->data[1] < 0) + sprite->data[1] = 0; + SetGpuReg(REG_OFFSET_MOSAIC, ((sprite->data[1] << 4) | sprite->data[1]) << 8); + sprite->data[2] &= 0xff; + sprite->data[2] += 0x80; + if (sprite->data[1] == 0) + { + sprite->data[0]++; + sprite->data[7] = 0; + sprite->oam.mosaic = FALSE; + StartSpriteAnim(sprite, 0); + } + break; + } +} + +void sub_8106058(struct Sprite *sprite) +{ + if (sprite->data[1] < 3) + { + LoadPalette(gUnknown_083EDE10[sprite->data[1]], (IndexOfSpritePaletteTag(6) << 4) + 0x100, 0x20); + if (++sprite->data[2] >= 4) + { + sprite->data[1]++; + sprite->data[2] = 0; + } + } + else + { + LoadPalette(gUnknown_083EDE10[sprite->data[1]], (IndexOfSpritePaletteTag(6) << 4) + 0x100, 0x20); + if (++sprite->data[2] >= 25) + { + sprite->data[1] = 0; + sprite->data[2] = 0; + } + } + StartSpriteAnimIfDifferent(sprite, 1); + sprite->data[7] = 0; +} + +void sub_81060FC(struct Sprite *sprite) +{ + s16 sp00[] = {0, -40, 0, 0, 48, 0, 24, 0}; + s16 sp10[] = {-32, 0, -32, -48, 0, -48, 0, -48}; + s16 sp20[] = {16, 12, 16, 0, 0, 4, 8, 8}; + + switch (sprite->data[0]) + { + case 0: + sprite->pos2.x = sp00[sprite->data[6]]; + sprite->pos2.y = sp10[sprite->data[6]]; + sprite->data[1] = sp20[sprite->data[6]]; + sprite->data[0]++; + // fallthrough + case 1: + if (sprite->data[1]-- == 0) + sprite->data[0]++; + break; + case 2: + if (sprite->pos2.x > 0) + sprite->pos2.x -= 4; + else if (sprite->pos2.x < 0) + sprite->pos2.x += 4; + + if (sprite->pos2.y > 0) + sprite->pos2.y -= 4; + else if (sprite->pos2.y < 0) + sprite->pos2.y += 4; + + if (sprite->pos2.x == 0 && sprite->pos2.y == 0) + sprite->data[0]++; + break; + } +} + +void sub_81061C8(struct Sprite *sprite) +{ + s16 sp0[] = {160, 192, 224, 104, 80, 64, 48, 24}; + + if (sprite->data[0] == 0) + { + sprite->data[0]++; + sprite->data[1] = 12; + } + sprite->pos2.x = Cos(sp0[sprite->data[6]], sprite->data[1]); + sprite->pos2.y = Sin(sp0[sprite->data[6]], sprite->data[1]); + if (sprite->data[1] != 0) + sprite->data[1]--; +} + +void sub_8106230(struct Sprite *sprite) +{ + switch (sprite->data[0]) + { + case 0: + sSlotMachine->winIn = 0x2f; + sSlotMachine->winOut = 0x3f; + sSlotMachine->win0v = 0x2088; + sprite->invisible = TRUE; + sprite->data[0]++; + // fallthrough + case 1: + sprite->data[1] += 2; + sprite->data[2] = sprite->data[1] + 0xb0; + sprite->data[3] = 0xf0 - sprite->data[1]; + if (sprite->data[2] > 0xd0) + sprite->data[2] = 0xd0; + if (sprite->data[3] < 0xd0) + sprite->data[3] = 0xd0; + sSlotMachine->win0h = (sprite->data[2] << 8) | sprite->data[3]; + if (sprite->data[1] > 0x33) + { + sprite->data[0]++; + sSlotMachine->winIn = 0x3f; + } + break; + case 2: + if (sSlotMachine->bet == 0) + break; + sub_8104D30(5, SpriteCallbackDummy, 0xd0, 0x74, 0); + sSlotMachine->win0h = 0xc0e0; + sSlotMachine->win0v = 0x6880; + sSlotMachine->winIn = 0x2f; + sprite->data[0]++; + sprite->data[1] = 0; + // fallthrough + case 3: + sprite->data[1] += 2; + sprite->data[2] = sprite->data[1] + 0xc0; + sprite->data[3] = 0xe0 - sprite->data[1]; + if (sprite->data[2] > 0xd0) + sprite->data[2] = 0xd0; + if (sprite->data[3] < 0xd0) + sprite->data[3] = 0xd0; + sSlotMachine->win0h = (sprite->data[2] << 8) | sprite->data[3]; + if (sprite->data[1] > 0x0f) + { + sprite->data[0]++; + sSlotMachine->winIn = 0x3f; + } + break; + } +} + +void nullsub_70(void) +{ +} + +void sub_8106364(void) +{ + SetGpuReg(REG_OFFSET_MOSAIC, 0); +} + +void sub_8106370(void) +{ + LoadPalette(gUnknown_083EDE20, (IndexOfSpritePaletteTag(6) << 4) + 0x100, 0x20); +} + +void sub_810639C(void) +{ + sSlotMachine->win0h = 0xf0; + sSlotMachine->win0v = 0xa0; + sSlotMachine->winIn = 0x3f; + sSlotMachine->winOut = 0x3f; +} + +void sub_81063C0(void) +{ + u8 i; + + sub_8106404(); + gUnknown_0203AAD4 = Alloc(0x3200); + LZDecompressWram(gSlotMachineReelTime_Gfx, gUnknown_0203AAD4); + gUnknown_0203AAD8 = Alloc(0x3600); + LZDecompressWram(sReelTimeGfx, gUnknown_0203AAD8); + gUnknown_0203AB30 = AllocZeroed(sizeof(struct SpriteSheet) * 22); + for (i = 0; i < 22; i++) + { + gUnknown_0203AB30[i].data = sSlotMachineSpriteSheets[i].data; + gUnknown_0203AB30[i].size = sSlotMachineSpriteSheets[i].size; + gUnknown_0203AB30[i].tag = sSlotMachineSpriteSheets[i].tag; + } + gUnknown_0203AB30[17].data = gUnknown_0203AAD4 + 0xA00; + gUnknown_0203AB30[18].data = gUnknown_0203AAD4 + 0x1400; + gUnknown_0203AB30[19].data = gUnknown_0203AAD4 + 0x1600; + gUnknown_0203AB30[20].data = gUnknown_0203AAD4 + 0x1900; + LoadSpriteSheets(gUnknown_0203AB30); + LoadSpritePalettes(gSlotMachineSpritePalettes); +} + +void sub_8106404(void) +{ + u8 *dest; + u8 i, j; + + gUnknown_0203AB2C = AllocZeroed(sizeof(struct SpriteSheet)); + gUnknown_0203AAE0 = AllocZeroed(0x2000); + dest = gUnknown_0203AAE0; + for (i = 0; i < 0x40; i++) + { + for (j = 0; j < 0x20; j++, dest++) + *dest = gUnknown_083EDCDC[j]; + } + gUnknown_0203AB2C->data = gUnknown_0203AAE0; + gUnknown_0203AB2C->size = 0x800; + gUnknown_0203AB2C->tag = 0x11; + LoadSpriteSheet(gUnknown_0203AB2C); +} + +extern const u8 gSlotMachineMenu_Gfx[]; +extern const u8 gSlotMachineMenu_Tilemap[]; +extern const u8 gUnknown_08DCEC70[]; +extern const u16 gSlotMachineMenu_Pal[]; + +void sub_8106448(void) +{ + gUnknown_0203AAC8 = Alloc(0x2200); + LZDecompressWram(gSlotMachineMenu_Gfx, gUnknown_0203AAC8); + LoadBgTiles(2, gUnknown_0203AAC8, 0x2200, 0); + LoadPalette(gSlotMachineMenu_Pal, 0, 160); + LoadPalette(gPalette_83EDE24, 208, 32); +} + +void sub_81064B8(void) +{ + sub_812F968(); + LoadSlotMachineWheelOverlay(); +} + +void sub_812F968(void) +{ + LoadBgTilemap(2, gSlotMachineMenu_Tilemap, 0x500, 0); +} + +void LoadSlotMachineWheelOverlay(void) +{ + s16 x, y, dx; + + for (x = 4; x < 18; x += 5) + { + for (dx = 0; dx < 4; dx++) + { + LoadBgTilemap(3, gUnknown_0203AAD0, 2, x + dx + 5 * 32); + LoadBgTilemap(3, gUnknown_0203AAD0 + 1, 2, x + dx + 13 * 32); + LoadBgTilemap(3, gUnknown_0203AAD0 + 2, 2, x + dx + 6 * 32); + LoadBgTilemap(3, gUnknown_0203AAD0 + 3, 2, x + dx + 12 * 32); + } + + LoadBgTilemap(3, gUnknown_0203AAD0 + 4, 2, x + 6 * 32); + LoadBgTilemap(3, gUnknown_0203AAD0 + 5, 2, x + 12 * 32); + + for (y = 7; y <= 11; y++) + LoadBgTilemap(3, gUnknown_0203AAD0 + 6, 2, x + y * 32); + } +} + +void sub_81065A8(s16 arg0, u16 arg1, u16 arg2, u16 arg3, u16 arg4) +{ + gUnknown_0203AADC[0] = arg1; + gUnknown_0203AADC[1] = arg2; + gUnknown_0203AADC[2] = arg3; + gUnknown_0203AADC[3] = arg4; + + LoadBgTilemap(2, gUnknown_0203AADC, 2, 15 * 32 + arg0); + LoadBgTilemap(2, gUnknown_0203AADC + 1, 2, 15 * 32 + 1 + arg0); + LoadBgTilemap(2, gUnknown_0203AADC + 2, 2, 16 * 32 + arg0); + LoadBgTilemap(2, gUnknown_0203AADC + 3, 2, 16 * 32 + 1 + arg0); +} + +void sub_81065DC(void) +{ + LoadBgTilemap(2, gUnknown_08DCEC70, 0x500, 0); + HideBg(3); +} + +void SlotMachineSetup_9_0(void) +{ + gUnknown_03001188[0] = gUnknown_0203AAF4; + gUnknown_03001188[1] = gUnknown_0203AAF8; + gUnknown_03001188[2] = gUnknown_0203AAFC; + gUnknown_03001188[3] = gUnknown_0203AB04; + gUnknown_03001188[4] = gUnknown_0203AB08; + gUnknown_03001188[5] = gUnknown_0203AB18; + gUnknown_03001188[6] = gUnknown_0203AB1C; + gUnknown_03001188[7] = gUnknown_0203AB20; + gUnknown_03001188[8] = gUnknown_0203AB24; + gUnknown_03001188[9] = gUnknown_0203AB28; + gUnknown_03001188[10] = gUnknown_0203AB00; + gUnknown_03001188[11] = gUnknown_0203AB00; + gUnknown_03001188[12] = gUnknown_0203AB00; + gUnknown_03001188[13] = gUnknown_0203AB00; + gUnknown_03001188[14] = gUnknown_0203AB0C; + gUnknown_03001188[15] = gUnknown_0203AB0C; + gUnknown_03001188[16] = gUnknown_0203AB0C; + gUnknown_03001188[17] = gUnknown_0203AB0C; + gUnknown_03001188[18] = gUnknown_0203AB0C; + gUnknown_03001188[19] = gUnknown_0203AB10; + gUnknown_03001188[20] = gUnknown_0203AB10; + gUnknown_03001188[21] = gUnknown_0203AB10; + gUnknown_03001188[22] = gUnknown_0203AB14; + gUnknown_03001188[23] = gUnknown_0203AB14; + gUnknown_03001188[24] = gUnknown_0203AB14; + gUnknown_03001188[25] = NULL; +} + +void SlotMachineSetup_8_0(void) +{ + gUnknown_0203AAF4 = AllocZeroed(sizeof(struct SpriteFrameImage) * 1); + gUnknown_0203AAF4[0].data = gUnknown_0203AAD4; + gUnknown_0203AAF4[0].size = 0x600; + + gUnknown_0203AAF8 = AllocZeroed(sizeof(struct SpriteFrameImage) * 1); + gUnknown_0203AAF8[0].data = gUnknown_0203AAD4 + 0x600; + gUnknown_0203AAF8[0].size = 0x200; + + gUnknown_0203AAFC = AllocZeroed(sizeof(struct SpriteFrameImage) * 1); + gUnknown_0203AAFC[0].data = gUnknown_0203AAD4 + 0x800; + gUnknown_0203AAFC[0].size = 0x200; + + gUnknown_0203AB00 = AllocZeroed(sizeof(struct SpriteFrameImage) * 1); + gUnknown_0203AB00[0].data = gUnknown_0203AAD4 + 0xA00; + gUnknown_0203AB00[0].size = 0x200; + + gUnknown_0203AB04 = AllocZeroed(sizeof(struct SpriteFrameImage) * 1); + gUnknown_0203AB04[0].data = gUnknown_0203AAD4 + 0xC00; + gUnknown_0203AB04[0].size = 0x300; + + gUnknown_0203AB08 = AllocZeroed(sizeof(struct SpriteFrameImage) * 1); + gUnknown_0203AB08[0].data = gUnknown_0203AAD4 + 0x1000; + gUnknown_0203AB08[0].size = 0x400; + + gUnknown_0203AB0C = AllocZeroed(sizeof(struct SpriteFrameImage) * 1); + gUnknown_0203AB0C[0].data = gUnknown_0203AAD4 + 0x1400; + gUnknown_0203AB0C[0].size = 0x200; + + gUnknown_0203AB10 = AllocZeroed(sizeof(struct SpriteFrameImage) * 1); + gUnknown_0203AB10[0].data = gUnknown_0203AAD4 + 0x1600; + gUnknown_0203AB10[0].size = 0x300; + + gUnknown_0203AB14 = AllocZeroed(sizeof(struct SpriteFrameImage) * 1); + gUnknown_0203AB14[0].data = gUnknown_0203AAD4 + 0x1900; + gUnknown_0203AB14[0].size = 0x300; + + gUnknown_0203AB18 = AllocZeroed(sizeof(struct SpriteFrameImage) * 2); + gUnknown_0203AB18[0].data = gUnknown_0203AAD4 + 0x1C00; + gUnknown_0203AB18[0].size = 0x200; + gUnknown_0203AB18[1].data = gUnknown_0203AAD4 + 0x1E00; + gUnknown_0203AB18[1].size = 0x200; + + gUnknown_0203AB1C = AllocZeroed(sizeof(struct SpriteFrameImage) * 1); + gUnknown_0203AB1C[0].data = gUnknown_0203AAD4 + 0x2000; + gUnknown_0203AB1C[0].size = 640; + + gUnknown_0203AB20 = AllocZeroed(sizeof(struct SpriteFrameImage) * 5); + gUnknown_0203AB20[0].data = gUnknown_0203AAD4 + 0x2280; + gUnknown_0203AB20[0].size = 0x80; + gUnknown_0203AB20[1].data = gUnknown_0203AAD4 + 0x2300; + gUnknown_0203AB20[1].size = 0x80; + gUnknown_0203AB20[2].data = gUnknown_0203AAD4 + 0x2380; + gUnknown_0203AB20[2].size = 0x80; + gUnknown_0203AB20[3].data = gUnknown_0203AAD4 + 0x2400; + gUnknown_0203AB20[3].size = 0x80; + gUnknown_0203AB20[4].data = gUnknown_0203AAD4 + 0x2480; + gUnknown_0203AB20[4].size = 0x80; + + gUnknown_0203AB24 = AllocZeroed(sizeof(struct SpriteFrameImage) * 2); + gUnknown_0203AB24[0].data = gUnknown_0203AAD4 + 0x2600; + gUnknown_0203AB24[0].size = 0x480; + gUnknown_0203AB24[1].data = gUnknown_0203AAD4 + 10880; + gUnknown_0203AB24[1].size = 0x480; + + gUnknown_0203AB28 = AllocZeroed(sizeof(struct SpriteFrameImage) * 2); + gUnknown_0203AB28[0].data = gUnknown_0203AAD4 + 0x2F00; + gUnknown_0203AB28[0].size = 0x180; + gUnknown_0203AB28[1].data = gUnknown_0203AAD4 + 0x3080; + gUnknown_0203AB28[1].size = 0x180; +} + +const u8 sReelSymbols[][21] = +{ + { + SLOT_MACHINE_TAG_7_RED, + SLOT_MACHINE_TAG_CHERRY, + SLOT_MACHINE_TAG_AZURILL, + SLOT_MACHINE_TAG_REPLAY, + SLOT_MACHINE_TAG_POWER, + SLOT_MACHINE_TAG_LOTAD, + SLOT_MACHINE_TAG_7_BLUE, + SLOT_MACHINE_TAG_LOTAD, + SLOT_MACHINE_TAG_CHERRY, + SLOT_MACHINE_TAG_POWER, + SLOT_MACHINE_TAG_REPLAY, + SLOT_MACHINE_TAG_AZURILL, + SLOT_MACHINE_TAG_7_RED, + SLOT_MACHINE_TAG_POWER, + SLOT_MACHINE_TAG_LOTAD, + SLOT_MACHINE_TAG_REPLAY, + SLOT_MACHINE_TAG_AZURILL, + SLOT_MACHINE_TAG_7_BLUE, + SLOT_MACHINE_TAG_POWER, + SLOT_MACHINE_TAG_LOTAD, + SLOT_MACHINE_TAG_REPLAY + }, + { + SLOT_MACHINE_TAG_7_RED, + SLOT_MACHINE_TAG_CHERRY, + SLOT_MACHINE_TAG_REPLAY, + SLOT_MACHINE_TAG_LOTAD, + SLOT_MACHINE_TAG_AZURILL, + SLOT_MACHINE_TAG_CHERRY, + SLOT_MACHINE_TAG_REPLAY, + SLOT_MACHINE_TAG_POWER, + SLOT_MACHINE_TAG_POWER, + SLOT_MACHINE_TAG_LOTAD, + SLOT_MACHINE_TAG_7_BLUE, + SLOT_MACHINE_TAG_LOTAD, + SLOT_MACHINE_TAG_REPLAY, + SLOT_MACHINE_TAG_CHERRY, + SLOT_MACHINE_TAG_AZURILL, + SLOT_MACHINE_TAG_LOTAD, + SLOT_MACHINE_TAG_REPLAY, + SLOT_MACHINE_TAG_CHERRY, + SLOT_MACHINE_TAG_LOTAD, + SLOT_MACHINE_TAG_REPLAY, + SLOT_MACHINE_TAG_CHERRY + }, + { + SLOT_MACHINE_TAG_7_RED, + SLOT_MACHINE_TAG_POWER, + SLOT_MACHINE_TAG_7_BLUE, + SLOT_MACHINE_TAG_REPLAY, + SLOT_MACHINE_TAG_LOTAD, + SLOT_MACHINE_TAG_AZURILL, + SLOT_MACHINE_TAG_REPLAY, + SLOT_MACHINE_TAG_LOTAD, + SLOT_MACHINE_TAG_POWER, + SLOT_MACHINE_TAG_AZURILL, + SLOT_MACHINE_TAG_REPLAY, + SLOT_MACHINE_TAG_LOTAD, + SLOT_MACHINE_TAG_AZURILL, + SLOT_MACHINE_TAG_POWER, + SLOT_MACHINE_TAG_REPLAY, + SLOT_MACHINE_TAG_LOTAD, + SLOT_MACHINE_TAG_AZURILL, + SLOT_MACHINE_TAG_POWER, + SLOT_MACHINE_TAG_REPLAY, + SLOT_MACHINE_TAG_LOTAD, + SLOT_MACHINE_TAG_CHERRY + }, +}; + +const u8 gUnknown_083ECCF1[] = { + 1, 0, 5, 4, 3, 2 +}; + +const s16 gUnknown_083ECCF8[][2] = { + {0, 6}, + {0, 10}, + {0, 2} +}; + +const u8 gUnknown_083ECD04[][3] = { + {1, 1, 12}, + {1, 1, 14}, + {2, 2, 14}, + {2, 2, 14}, + {2, 3, 16}, + {3, 3, 16} +}; + +const u8 gUnknown_083ECD16[][6] = { + {25, 25, 30, 40, 40, 50}, + {25, 25, 30, 30, 35, 35}, + {25, 25, 30, 25, 25, 30} +}; + +const u8 gUnknown_083ECD28[][6] = { + {20, 25, 25, 20, 25, 25}, + {12, 15, 15, 18, 19, 22}, + {25, 25, 25, 30, 30, 40}, + {25, 25, 20, 20, 15, 15}, + {40, 40, 35, 35, 40, 40} +}; + +const u8 gUnknown_083ECD46[][17] = { + {243, 243, 243, 80, 80, 80, 80, 40, 40, 40, 40, 40, 40, 5, 5, 5, 5}, + { 5, 5, 5, 150, 150, 150, 150, 130, 130, 130, 130, 130, 130, 100, 100, 100, 5}, + { 4, 4, 4, 20, 20, 20, 20, 80, 80, 80, 80, 80, 80, 100, 100, 100, 40}, + { 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 45, 45, 45, 100}, + { 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 5, 5, 5, 100}, + { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6} +}; + +const u8 gUnknown_083ECDAC[][17] = { + { 243, 243, 243, 200, 200, 200, 200, 160, 160, 160, 160, 160, 160, 70, 70, 70, 5}, + { 5, 5, 5, 25, 25, 25, 25, 5, 5, 5, 5, 5, 5, 2, 2, 2, 6}, + { 4, 4, 4, 25, 25, 25, 25, 30, 30, 30, 30, 30, 30, 40, 40, 40, 35}, + { 2, 2, 2, 3, 3, 3, 3, 30, 30, 30, 30, 30, 30, 100, 100, 100, 50}, + { 1, 1, 1, 2, 2, 2, 2, 30, 30, 30, 30, 30, 30, 40, 40, 40, 100}, + { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 4, 60} +}; + +const u16 gUnknown_083ECE12[] = { + 0x80, 0xaf, 0xc8, 0xe1, 0x100 +}; + +const u16 gUnknown_083ECE1C[][2] = { + {10, 5}, + {10, 10}, + {10, 15}, + {10, 25}, + {10, 35} +}; + +const u16 gUnknown_083ECE30[] = { + 0, 5, 10, 15, 20 +}; + +const u8 gUnknown_083ECE3A[] = { + 6, 4, 3, 2, 5, 0, 0, 0 +}; + +const u16 gUnknown_083ECE42[] = { + 0x80, 0x20, 0x40 +}; + +const u16 gUnknown_083ECE48[] = { + 0x10, 0x08, 0x04, 0x02, 0x01 +}; + +const u8 sSym2Match[] = { + SLOT_MACHINE_MATCHED_777_RED, + SLOT_MACHINE_MATCHED_777_BLUE, + SLOT_MACHINE_MATCHED_AZURILL, + SLOT_MACHINE_MATCHED_LOTAD, + SLOT_MACHINE_MATCHED_1CHERRY, + SLOT_MACHINE_MATCHED_POWER, + SLOT_MACHINE_MATCHED_REPLAY +}; + +const u16 sSlotMatchFlags[] = { + 1 << SLOT_MACHINE_MATCHED_1CHERRY, + 1 << SLOT_MACHINE_MATCHED_2CHERRY, + 1 << SLOT_MACHINE_MATCHED_REPLAY, + 1 << SLOT_MACHINE_MATCHED_LOTAD, + 1 << SLOT_MACHINE_MATCHED_AZURILL, + 1 << SLOT_MACHINE_MATCHED_POWER, + 1 << SLOT_MACHINE_MATCHED_777_MIXED, + 1 << SLOT_MACHINE_MATCHED_777_RED, + 1 << SLOT_MACHINE_MATCHED_777_BLUE +}; + +const u16 sSlotPayouts[] = { + 2, 4, 0, 6, 12, 3, 90, 300, 300 +}; + +const s16 gUnknown_083ECE7E[][2] = { + { 0xd0, 0x38}, + { 0xb8, 0x00}, + { 0xc8, 0x08}, + { 0xd8, 0x10}, + { 0xe8, 0x18}, + { 0xd0, 0x48}, + { 0xd0, 0x08}, + { 0xd0, 0x40}, + { 0xd0, 0x38}, + { 0xc0, 0x58}, + { 0xe0, 0x58}, + { 0xc0, 0x78}, + { 0xe0, 0x78}, + { 0x90, 0x38}, + {0x110, 0x58}, + { 0xa8, 0x70}, + { 0xd0, 0x54}, + { 0xd0, 0x70}, + { 0xbc, 0x34}, + { 0xd0, 0x34}, + { 0xe4, 0x34}, + { 0xb8, 0x48}, + { 0xc4, 0x48}, + { 0xd0, 0x48}, + { 0xdc, 0x48}, + { 0xe8, 0x48}, + { 0xbc, 0x34}, + { 0xd0, 0x34}, + { 0xe4, 0x34}, + { 0xb8, 0x48}, + { 0xc4, 0x48}, + { 0xd0, 0x48}, + { 0xdc, 0x48}, + { 0xe8, 0x48}, + { 0x00, 0x00} +};