From 0547e260a4d1e89b6efac0c85c276316186d370c Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sat, 15 Sep 2018 18:01:20 +0200 Subject: [PATCH 1/3] More of slot machine --- asm/slot_machine.s | 5426 +--------------------------------------- data/slot_machine.s | 207 +- include/field_effect.h | 2 + include/sprite.h | 6 +- src/slot_machine.c | 1989 ++++++++++++++- 5 files changed, 2047 insertions(+), 5583 deletions(-) diff --git a/asm/slot_machine.s b/asm/slot_machine.s index e6828cb70..d700bf5c5 100644 --- a/asm/slot_machine.s +++ b/asm/slot_machine.s @@ -5,5245 +5,9 @@ .text - thumb_func_start sub_8102A64 -sub_8102A64: @ 812BAFC - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_085A74C4 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_0812BB0E: - movs r1, 0x8 - ldrsh r0, [r4, r1] - lsls r0, 2 - adds r0, r5 - ldr r1, [r0] - adds r0, r4, 0 - bl _call_via_r1 - lsls r0, 24 - cmp r0, 0 - bne _0812BB0E - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8102A64 - - thumb_func_start sub_812BB34 -sub_812BB34: @ 812BB34 - push {r4,lr} - adds r4, r0, 0 - bl sub_812CF6C - lsls r0, 24 - cmp r0, 0 - beq _0812BB60 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - ldr r0, =sSlotMachine - ldr r0, [r0] - movs r1, 0xE - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0812BB60 - movs r0, 0x2 - strh r0, [r4, 0x8] - movs r0, 0x1 - b _0812BB62 - .pool -_0812BB60: - movs r0, 0 -_0812BB62: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_812BB34 - - thumb_func_start sub_812BB68 -sub_812BB68: @ 812BB68 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0xA] - subs r0, 0x1 - strh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _0812BBBC - bl IsFanfareTaskInactive - lsls r0, 24 - cmp r0, 0 - beq _0812BB8E - movs r0, 0x15 - bl PlaySE -_0812BB8E: - ldr r0, =sSlotMachine - ldr r2, [r0] - ldrh r0, [r2, 0xE] - subs r0, 0x1 - strh r0, [r2, 0xE] - ldrh r3, [r2, 0xC] - movs r0, 0xC - ldrsh r1, [r2, r0] - ldr r0, =0x0000270e - cmp r1, r0 - bgt _0812BBA8 - adds r0, r3, 0x1 - strh r0, [r2, 0xC] -_0812BBA8: - movs r0, 0x8 - strh r0, [r4, 0xA] - ldr r0, =gMain - ldrh r1, [r0, 0x2C] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0812BBBC - movs r0, 0x4 - strh r0, [r4, 0xA] -_0812BBBC: - bl IsFanfareTaskInactive - lsls r0, 24 - cmp r0, 0 - beq _0812BBF6 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x8 - ands r0, r1 - cmp r0, 0 - beq _0812BBF6 - movs r0, 0x15 - bl PlaySE - ldr r1, =sSlotMachine - ldr r2, [r1] - ldrh r0, [r2, 0xE] - ldrh r3, [r2, 0xC] - adds r0, r3 - strh r0, [r2, 0xC] - lsls r0, 16 - asrs r0, 16 - ldr r3, =0x0000270f - cmp r0, r3 - ble _0812BBF0 - strh r3, [r2, 0xC] -_0812BBF0: - ldr r1, [r1] - movs r0, 0 - strh r0, [r1, 0xE] -_0812BBF6: - ldr r0, =sSlotMachine - ldr r0, [r0] - movs r1, 0xE - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0812BC08 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_0812BC08: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_812BB68 - - thumb_func_start sub_812BC20 -sub_812BC20: @ 812BC20 - push {lr} - bl sub_812CFB8 - lsls r0, 24 - cmp r0, 0 - beq _0812BC3A - ldr r0, =sub_8102A64 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_0812BC3A: - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_812BC20 - - thumb_func_start GetTagOfReelSymbolOnScreenAtPos -GetTagOfReelSymbolOnScreenAtPos: @ 812BC44 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - adds r4, r0, 0 - ldr r0, =sSlotMachine - ldr r0, [r0] - lsls r2, r4, 1 - adds r0, 0x28 - adds r0, r2 - movs r2, 0 - ldrsh r0, [r0, r2] - lsls r1, 16 - asrs r1, 16 - adds r0, r1 - movs r1, 0x15 - bl __modsi3 - lsls r0, 16 - lsrs r1, r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _0812BC76 - adds r0, 0x15 - lsls r0, 16 - lsrs r1, r0, 16 -_0812BC76: - ldr r2, =gUnknown_085A766E - lsls r1, 16 - asrs r1, 16 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 2 - adds r0, r4 - adds r1, r0 - adds r1, r2 - ldrb r0, [r1] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end GetTagOfReelSymbolOnScreenAtPos - - thumb_func_start sub_812BC98 -sub_812BC98: @ 812BC98 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - adds r4, r0, 0 - lsls r1, 16 - lsrs r5, r1, 16 - movs r6, 0 - ldr r0, =sSlotMachine - ldr r0, [r0] - lsls r1, r4, 1 - adds r0, 0x1C - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - movs r1, 0x18 - bl __modsi3 - lsls r0, 16 - cmp r0, 0 - beq _0812BCC2 - ldr r6, =0x0000ffff -_0812BCC2: - lsls r1, r5, 16 - asrs r1, 16 - lsls r0, r6, 16 - asrs r0, 16 - adds r1, r0 - lsls r1, 16 - asrs r1, 16 - adds r0, r4, 0 - bl GetTagOfReelSymbolOnScreenAtPos - lsls r0, 24 - lsrs r0, 24 - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_812BC98 - - thumb_func_start sub_812BCE8 -sub_812BCE8: @ 812BCE8 - push {lr} - ldr r1, =sSlotMachine - ldr r1, [r1] - movs r2, 0x16 - ldrsh r1, [r1, r2] - lsls r0, 16 - asrs r0, 16 - adds r1, r0 - adds r0, r1, 0 - movs r1, 0x6 - bl __modsi3 - lsls r0, 16 - lsrs r1, r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _0812BD10 - adds r0, 0x6 - lsls r0, 16 - lsrs r1, r0, 16 -_0812BD10: - ldr r0, =gUnknown_085A76AD - lsls r1, 16 - asrs r1, 16 - adds r1, r0 - ldrb r0, [r1] - pop {r1} - bx r1 - .pool - thumb_func_end sub_812BCE8 - - thumb_func_start sub_812BD28 -sub_812BD28: @ 812BD28 - push {r4-r6,lr} - adds r5, r0, 0 - lsls r5, 24 - ldr r0, =sSlotMachine - ldr r6, [r0] - lsrs r5, 23 - adds r4, r6, 0 - adds r4, 0x1C - adds r4, r5 - lsls r1, 16 - asrs r1, 16 - ldrh r0, [r4] - adds r1, r0 - strh r1, [r4] - movs r1, 0 - ldrsh r0, [r4, r1] - movs r1, 0xFC - lsls r1, 1 - bl __modsi3 - strh r0, [r4] - adds r6, 0x28 - adds r6, r5 - movs r1, 0 - ldrsh r0, [r4, r1] - movs r1, 0x18 - bl __divsi3 - movs r1, 0x15 - subs r1, r0 - strh r1, [r6] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812BD28 - - thumb_func_start sub_812BD70 -sub_812BD70: @ 812BD70 - push {r4-r7,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - lsls r1, 16 - lsrs r4, r1, 16 - ldr r7, =sSlotMachine - ldr r0, [r7] - lsls r6, r5, 1 - adds r0, 0x1C - adds r0, r6 - movs r1, 0 - ldrsh r0, [r0, r1] - movs r1, 0x18 - bl __modsi3 - lsls r0, 16 - lsrs r0, 16 - lsls r2, r0, 16 - asrs r1, r2, 16 - cmp r1, 0 - beq _0812BDC4 - lsls r0, r4, 16 - asrs r0, 16 - cmp r1, r0 - bge _0812BDA6 - lsrs r4, r2, 16 -_0812BDA6: - lsls r1, r4, 16 - asrs r1, 16 - adds r0, r5, 0 - bl sub_812BD28 - ldr r0, [r7] - adds r0, 0x1C - adds r0, r6 - movs r1, 0 - ldrsh r0, [r0, r1] - movs r1, 0x18 - bl __modsi3 - lsls r0, 16 - lsrs r0, 16 -_0812BDC4: - lsls r0, 16 - asrs r0, 16 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_812BD70 - - thumb_func_start sub_812BDD4 -sub_812BDD4: @ 812BDD4 - push {r4,lr} - ldr r1, =sSlotMachine - ldr r4, [r1] - lsls r0, 16 - asrs r0, 16 - ldrh r1, [r4, 0x14] - adds r0, r1 - strh r0, [r4, 0x14] - movs r1, 0x14 - ldrsh r0, [r4, r1] - movs r1, 0x78 - bl __modsi3 - strh r0, [r4, 0x14] - movs r1, 0x14 - ldrsh r0, [r4, r1] - movs r1, 0x14 - bl __divsi3 - movs r1, 0x6 - subs r1, r0 - strh r1, [r4, 0x16] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812BDD4 - - thumb_func_start sub_812BE0C -sub_812BE0C: @ 812BE0C - push {r4,r5,lr} - lsls r0, 16 - lsrs r4, r0, 16 - ldr r5, =sSlotMachine - ldr r0, [r5] - movs r1, 0x14 - ldrsh r0, [r0, r1] - movs r1, 0x14 - bl __modsi3 - lsls r0, 16 - lsrs r0, 16 - lsls r2, r0, 16 - asrs r1, r2, 16 - cmp r1, 0 - beq _0812BE4E - lsls r0, r4, 16 - asrs r0, 16 - cmp r1, r0 - bge _0812BE36 - lsrs r4, r2, 16 -_0812BE36: - lsls r0, r4, 16 - asrs r0, 16 - bl sub_812BDD4 - ldr r0, [r5] - movs r1, 0x14 - ldrsh r0, [r0, r1] - movs r1, 0x14 - bl __modsi3 - lsls r0, 16 - lsrs r0, 16 -_0812BE4E: - lsls r0, 16 - asrs r0, 16 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_812BE0C - - thumb_func_start sub_8102DA8 -sub_8102DA8: @ 812BE5C - push {r4-r6,lr} - movs r4, 0 - ldr r5, =sub_812BF2C - ldr r6, =gTasks -_0812BE64: - adds r0, r5, 0 - movs r1, 0x2 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r6 - strh r4, [r1, 0x26] - ldr r1, =sSlotMachine - ldr r1, [r1] - adds r1, 0x3A - adds r1, r4 - strb r0, [r1] - bl _call_via_r5 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _0812BE64 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8102DA8 - - thumb_func_start sub_8102DEC -sub_8102DEC: @ 812BEA4 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r4, =gTasks - ldr r1, =sSlotMachine - ldr r2, [r1] - adds r2, 0x3A - adds r2, r0 - ldrb r1, [r2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - movs r3, 0x1 - strh r3, [r0, 0x8] - ldrb r1, [r2] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r4 - strh r3, [r0, 0x24] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8102DEC - - thumb_func_start sub_8102E1C -sub_8102E1C: @ 812BEDC - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - ldr r1, =sSlotMachine - ldr r1, [r1] - adds r1, 0x3A - adds r1, r0 - ldrb r1, [r1] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r1, 0x2 - strh r1, [r0, 0x8] - bx lr - .pool - thumb_func_end sub_8102E1C - - thumb_func_start sub_8102E40 -sub_8102E40: @ 812BF04 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - ldr r1, =sSlotMachine - ldr r1, [r1] - adds r1, 0x3A - adds r1, r0 - ldrb r1, [r1] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrh r0, [r0, 0x24] - lsls r0, 24 - lsrs r0, 24 - bx lr - .pool - thumb_func_end sub_8102E40 - - thumb_func_start sub_812BF2C -sub_812BF2C: @ 812BF2C - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_085A74D0 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_0812BF3E: - movs r1, 0x8 - ldrsh r0, [r4, r1] - lsls r0, 2 - adds r0, r5 - ldr r1, [r0] - adds r0, r4, 0 - bl _call_via_r1 - lsls r0, 24 - cmp r0, 0 - bne _0812BF3E - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812BF2C - - thumb_func_start sub_812BF64 -sub_812BF64: @ 812BF64 - movs r0, 0 - bx lr - thumb_func_end sub_812BF64 - - thumb_func_start sub_812BF68 -sub_812BF68: @ 812BF68 - push {lr} - ldrh r0, [r0, 0x26] - lsls r0, 24 - lsrs r0, 24 - ldr r1, =sSlotMachine - ldr r1, [r1] - movs r2, 0x1A - ldrsh r1, [r1, r2] - bl sub_812BD28 - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_812BF68 - - thumb_func_start sub_812BF88 -sub_812BF88: @ 812BF88 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - movs r2, 0 - strh r0, [r4, 0x8] - ldr r0, =sSlotMachine - ldr r3, [r0] - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r1, 1 - adds r0, r3, 0 - adds r0, 0x34 - adds r0, r1 - strh r2, [r0] - movs r0, 0x26 - ldrsh r1, [r4, r0] - lsls r1, 1 - adds r0, r3, 0 - adds r0, 0x2E - adds r0, r1 - strh r2, [r0] - ldrb r0, [r3, 0xA] - cmp r0, 0 - bne _0812BFF4 - ldrb r0, [r3, 0x4] - cmp r0, 0 - beq _0812BFDC - ldrb r0, [r3, 0x6] - cmp r0, 0 - beq _0812BFDC - ldr r1, =gUnknown_085A74E4 - movs r2, 0x26 - ldrsh r0, [r4, r2] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - lsls r0, 24 - cmp r0, 0 - bne _0812BFF4 -_0812BFDC: - ldr r0, =sSlotMachine - ldr r1, [r0] - movs r0, 0 - strb r0, [r1, 0x6] - ldr r1, =gUnknown_085A74F0 - movs r2, 0x26 - ldrsh r0, [r4, r2] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 -_0812BFF4: - ldr r0, =sSlotMachine - ldr r1, [r0] - movs r2, 0x26 - ldrsh r0, [r4, r2] - lsls r0, 1 - adds r1, 0x2E - adds r1, r0 - ldrh r0, [r1] - strh r0, [r4, 0xA] - movs r0, 0x1 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_812BF88 - - thumb_func_start sub_812C01C -sub_812C01C: @ 812C01C - push {r4-r7,lr} - sub sp, 0xC - adds r4, r0, 0 - ldr r1, =gUnknown_085A74FC - mov r0, sp - movs r2, 0xA - bl memcpy - ldr r7, =sSlotMachine - ldr r5, [r7] - movs r1, 0x26 - ldrsh r0, [r4, r1] - lsls r6, r0, 1 - adds r0, r5, 0 - adds r0, 0x1C - adds r0, r6 - movs r2, 0 - ldrsh r0, [r0, r2] - movs r1, 0x18 - bl __modsi3 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r0, 0 - beq _0812C068 - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - movs r6, 0x1A - ldrsh r1, [r5, r6] - bl sub_812BD70 - b _0812C0A0 - .pool -_0812C068: - adds r0, r5, 0 - adds r0, 0x2E - adds r1, r0, r6 - ldrh r3, [r1] - movs r6, 0 - ldrsh r0, [r1, r6] - cmp r0, 0 - beq _0812C0A4 - subs r0, r3, 0x1 - strh r0, [r1] - ldrh r0, [r4, 0x26] - lsls r0, 24 - lsrs r0, 24 - movs r2, 0x1A - ldrsh r1, [r5, r2] - bl sub_812BD28 - ldr r1, [r7] - movs r6, 0x26 - ldrsh r0, [r4, r6] - lsls r0, 1 - adds r1, 0x1C - adds r1, r0 - movs r2, 0 - ldrsh r0, [r1, r2] - movs r1, 0x18 - bl __modsi3 -_0812C0A0: - lsls r0, 16 - lsrs r2, r0, 16 -_0812C0A4: - cmp r2, 0 - bne _0812C0D2 - ldr r0, =sSlotMachine - ldr r1, [r0] - movs r6, 0x26 - ldrsh r0, [r4, r6] - lsls r0, 1 - adds r1, 0x2E - adds r1, r0 - movs r0, 0 - ldrsh r1, [r1, r0] - cmp r1, 0 - bne _0812C0D2 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r2, 0xA - ldrsh r0, [r4, r2] - lsls r0, 1 - add r0, sp - ldrh r0, [r0] - strh r0, [r4, 0xA] - strh r1, [r4, 0xC] -_0812C0D2: - movs r0, 0 - add sp, 0xC - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_812C01C - - thumb_func_start sub_812C0E0 -sub_812C0E0: @ 812C0E0 - push {r4,lr} - adds r2, r0, 0 - ldr r4, =sSlotMachine - ldr r1, [r4] - movs r3, 0x26 - ldrsh r0, [r2, r3] - lsls r0, 1 - adds r1, 0x22 - adds r1, r0 - ldrh r0, [r2, 0xA] - strh r0, [r1] - ldrh r0, [r2, 0xA] - negs r3, r0 - strh r3, [r2, 0xA] - ldrh r0, [r2, 0xC] - adds r0, 0x1 - strh r0, [r2, 0xC] - movs r1, 0x3 - ands r0, r1 - cmp r0, 0 - bne _0812C110 - lsls r0, r3, 16 - asrs r0, 17 - strh r0, [r2, 0xA] -_0812C110: - movs r0, 0xA - ldrsh r3, [r2, r0] - cmp r3, 0 - bne _0812C12A - strh r3, [r2, 0x8] - strh r3, [r2, 0x24] - ldr r1, [r4] - movs r4, 0x26 - ldrsh r0, [r2, r4] - lsls r0, 1 - adds r1, 0x22 - adds r1, r0 - strh r3, [r1] -_0812C12A: - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_812C0E0 - - thumb_func_start sub_812C138 -sub_812C138: @ 812C138 - push {r4,r5,lr} - ldr r4, =sSlotMachine - ldr r0, [r4] - ldrb r0, [r0, 0x4] - bl sub_810250C - lsls r0, 24 - lsrs r3, r0, 24 - adds r5, r3, 0 - ldr r4, [r4] - ldrb r1, [r4, 0x4] - movs r0, 0xC0 - ands r0, r1 - cmp r0, 0 - beq _0812C15A - movs r5, 0 - movs r3, 0x1 -_0812C15A: - ldr r1, =gUnknown_085A7508 - movs r2, 0x12 - ldrsh r0, [r4, r2] - subs r0, 0x1 - lsls r0, 2 - adds r0, r1 - ldr r2, [r0] - adds r0, r5, 0 - adds r1, r3, 0 - bl _call_via_r2 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_812C138 - - thumb_func_start sub_812C184 -sub_812C184: @ 812C184 - push {r4,r5,lr} - adds r3, r0, 0 - adds r4, r1, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r2, 24 - lsrs r5, r2, 24 - lsls r3, 16 - asrs r3, 16 - movs r0, 0 - adds r1, r3, 0 - bl sub_812BC98 - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - cmp r0, r4 - beq _0812C1AC - cmp r0, r5 - bne _0812C1BC -_0812C1AC: - ldr r0, =sSlotMachine - ldr r0, [r0] - strb r1, [r0, 0x7] - movs r0, 0x1 - b _0812C1BE - .pool -_0812C1BC: - movs r0, 0 -_0812C1BE: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_812C184 - - thumb_func_start sub_812C1C4 -sub_812C1C4: @ 812C1C4 - push {r4,lr} - movs r1, 0x1 - lsls r0, 16 - asrs r4, r0, 16 - subs r1, r4 - lsls r1, 16 - asrs r1, 16 - movs r0, 0 - bl sub_812BC98 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - beq _0812C20C - movs r1, 0x2 - subs r1, r4 - lsls r1, 16 - asrs r1, 16 - movs r0, 0 - bl sub_812BC98 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - beq _0812C20C - movs r1, 0x3 - subs r1, r4 - lsls r1, 16 - asrs r1, 16 - movs r0, 0 - bl sub_812BC98 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bne _0812C210 -_0812C20C: - movs r0, 0x1 - b _0812C212 -_0812C210: - movs r0, 0 -_0812C212: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_812C1C4 - - thumb_func_start sub_812C218 -sub_812C218: @ 812C218 - push {lr} - ldr r0, =sSlotMachine - ldr r0, [r0] - ldrb r1, [r0, 0x4] - movs r0, 0xC2 - ands r0, r1 - cmp r0, 0 - bne _0812C230 - movs r0, 0 - b _0812C232 - .pool -_0812C230: - movs r0, 0x1 -_0812C232: - pop {r1} - bx r1 - thumb_func_end sub_812C218 - - thumb_func_start sub_812C238 -sub_812C238: @ 812C238 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r7, r0, 24 - lsls r1, 24 - lsrs r6, r1, 24 - movs r5, 0 - movs r0, 0x2 - mov r8, r0 -_0812C24C: - lsls r0, r5, 16 - asrs r4, r0, 16 - mov r1, r8 - subs r0, r1, r4 - lsls r0, 16 - asrs r0, 16 - adds r1, r7, 0 - adds r2, r6, 0 - bl sub_812C184 - lsls r0, 24 - cmp r0, 0 - beq _0812C278 - ldr r0, =sSlotMachine - ldr r1, [r0] - movs r0, 0x2 - strh r0, [r1, 0x34] - strh r5, [r1, 0x2E] - movs r0, 0x1 - b _0812C286 - .pool -_0812C278: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - asrs r0, 16 - cmp r0, 0x4 - ble _0812C24C - movs r0, 0 -_0812C286: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_812C238 - - thumb_func_start sub_812C290 -sub_812C290: @ 812C290 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r9, r0 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - bl sub_812C218 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - bne _0812C2BE - movs r0, 0 - bl sub_812C1C4 - lsls r0, 24 - cmp r0, 0 - bne _0812C2F4 -_0812C2BE: - movs r7, 0x1 - movs r6, 0 -_0812C2C2: - lsls r0, r7, 16 - asrs r4, r0, 16 - adds r0, r4, 0 - mov r1, r9 - mov r2, r8 - bl sub_812C184 - lsls r0, 24 - cmp r0, 0 - beq _0812C2E8 - ldr r0, =sSlotMachine - ldr r0, [r0] - strh r7, [r0, 0x34] - strh r6, [r0, 0x2E] - movs r0, 0x1 - b _0812C390 - .pool -_0812C2E8: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r7, r0, 16 - asrs r0, 16 - cmp r0, 0x3 - ble _0812C2C2 -_0812C2F4: - movs r7, 0x1 - adds r6, r5, 0 - ldr r0, =sSlotMachine - mov r10, r0 -_0812C2FC: - lsls r5, r7, 16 - cmp r6, 0 - bne _0812C30E - asrs r0, r5, 16 - bl sub_812C1C4 - lsls r0, 24 - cmp r0, 0 - bne _0812C380 -_0812C30E: - movs r0, 0x1 - asrs r4, r5, 16 - subs r0, r4 - lsls r0, 16 - asrs r0, 16 - mov r1, r9 - mov r2, r8 - bl sub_812C184 - lsls r0, 24 - cmp r0, 0 - beq _0812C380 - cmp r4, 0x1 - bne _0812C34C - cmp r6, 0 - bne _0812C33A - movs r0, 0x3 - bl sub_812C1C4 - lsls r0, 24 - cmp r0, 0 - bne _0812C34C -_0812C33A: - mov r0, r10 - ldr r1, [r0] - movs r0, 0x3 - strh r0, [r1, 0x34] - strh r0, [r1, 0x2E] - movs r0, 0x1 - b _0812C390 - .pool -_0812C34C: - asrs r0, r5, 16 - cmp r0, 0x3 - bgt _0812C374 - adds r4, r0, 0x1 - cmp r6, 0 - bne _0812C366 - lsls r0, r4, 16 - asrs r0, 16 - bl sub_812C1C4 - lsls r0, 24 - cmp r0, 0 - bne _0812C374 -_0812C366: - mov r0, r10 - ldr r1, [r0] - movs r0, 0x2 - strh r0, [r1, 0x34] - strh r4, [r1, 0x2E] - movs r0, 0x1 - b _0812C390 -_0812C374: - mov r0, r10 - ldr r1, [r0] - movs r0, 0x1 - strh r0, [r1, 0x34] - strh r7, [r1, 0x2E] - b _0812C390 -_0812C380: - movs r1, 0x80 - lsls r1, 9 - adds r0, r5, r1 - lsrs r7, r0, 16 - asrs r0, 16 - cmp r0, 0x4 - ble _0812C2FC - movs r0, 0 -_0812C390: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_812C290 - - thumb_func_start sub_812C3A0 -sub_812C3A0: @ 812C3A0 - push {lr} - ldr r1, =gUnknown_085A7514 - ldr r0, =sSlotMachine - ldr r0, [r0] - movs r2, 0x12 - ldrsh r0, [r0, r2] - subs r0, 0x1 - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_812C3A0 - - thumb_func_start sub_812C3C8 -sub_812C3C8: @ 812C3C8 - push {r4-r7,lr} - ldr r0, =sSlotMachine - ldr r0, [r0] - movs r5, 0 - ldrh r7, [r0, 0x34] - movs r1, 0x34 - ldrsh r6, [r0, r1] -_0812C3D6: - lsls r0, r5, 16 - asrs r4, r0, 16 - subs r1, r6, r4 - lsls r1, 16 - asrs r1, 16 - movs r0, 0x1 - bl sub_812BC98 - ldr r1, =sSlotMachine - ldr r1, [r1] - lsls r0, 24 - lsrs r0, 24 - ldrb r2, [r1, 0x7] - cmp r0, r2 - bne _0812C400 - strh r7, [r1, 0x36] - strh r5, [r1, 0x30] - movs r0, 0x1 - b _0812C40E - .pool -_0812C400: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - asrs r0, 16 - cmp r0, 0x4 - ble _0812C3D6 - movs r0, 0 -_0812C40E: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_812C3C8 - - thumb_func_start sub_812C414 -sub_812C414: @ 812C414 - push {r4-r6,lr} - bl sub_812C3C8 - lsls r0, 24 - cmp r0, 0 - beq _0812C476 - ldr r0, =sSlotMachine - ldr r1, [r0] - movs r2, 0x34 - ldrsh r0, [r1, r2] - cmp r0, 0x2 - beq _0812C472 - movs r2, 0x30 - ldrsh r0, [r1, r2] - cmp r0, 0x1 - ble _0812C472 - cmp r0, 0x4 - beq _0812C472 - movs r5, 0 - movs r6, 0x2 -_0812C43C: - lsls r0, r5, 16 - asrs r4, r0, 16 - subs r1, r6, r4 - lsls r1, 16 - asrs r1, 16 - movs r0, 0x1 - bl sub_812BC98 - ldr r1, =sSlotMachine - ldr r1, [r1] - lsls r0, 24 - lsrs r0, 24 - ldrb r2, [r1, 0x7] - cmp r0, r2 - beq _0812C46C - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - asrs r0, 16 - cmp r0, 0x4 - ble _0812C43C - b _0812C472 - .pool -_0812C46C: - movs r0, 0x2 - strh r0, [r1, 0x36] - strh r5, [r1, 0x30] -_0812C472: - movs r0, 0x1 - b _0812C4B2 -_0812C476: - ldr r0, =sSlotMachine - ldr r0, [r0] - movs r1, 0x34 - ldrsh r0, [r0, r1] - cmp r0, 0x2 - beq _0812C4B0 - movs r5, 0 - movs r6, 0x2 -_0812C486: - lsls r0, r5, 16 - asrs r4, r0, 16 - subs r1, r6, r4 - lsls r1, 16 - asrs r1, 16 - movs r0, 0x1 - bl sub_812BC98 - ldr r1, =sSlotMachine - ldr r1, [r1] - lsls r0, 24 - lsrs r0, 24 - ldrb r2, [r1, 0x7] - cmp r0, r2 - beq _0812C46C - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - asrs r0, 16 - cmp r0, 0x4 - ble _0812C486 -_0812C4B0: - movs r0, 0 -_0812C4B2: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_812C414 - - thumb_func_start sub_812C4BC -sub_812C4BC: @ 812C4BC - push {r4,lr} - ldr r2, =sSlotMachine - ldr r0, [r2] - ldrb r3, [r0, 0x7] - adds r4, r3, 0 - ldrb r1, [r0, 0x4] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _0812C4D8 - movs r3, 0 - cmp r4, 0 - bne _0812C4D8 - movs r3, 0x1 -_0812C4D8: - ldr r1, =gUnknown_085A7520 - ldr r0, [r2] - movs r2, 0x12 - ldrsh r0, [r0, r2] - subs r0, 0x1 - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - adds r0, r3, 0 - bl _call_via_r1 - lsls r0, 24 - lsrs r0, 24 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_812C4BC - - thumb_func_start sub_812C500 -sub_812C500: @ 812C500 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =sSlotMachine - ldr r0, [r0] - movs r5, 0 - ldrh r1, [r0, 0x36] - mov r8, r1 - movs r1, 0x36 - ldrsh r6, [r0, r1] -_0812C518: - lsls r0, r5, 16 - asrs r4, r0, 16 - subs r1, r6, r4 - lsls r1, 16 - asrs r1, 16 - movs r0, 0x2 - bl sub_812BC98 - lsls r0, 24 - lsrs r0, 24 - cmp r0, r7 - bne _0812C544 - ldr r0, =sSlotMachine - ldr r0, [r0] - mov r1, r8 - strh r1, [r0, 0x38] - strh r5, [r0, 0x32] - movs r0, 0x1 - b _0812C552 - .pool -_0812C544: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - asrs r0, 16 - cmp r0, 0x4 - ble _0812C518 - movs r0, 0 -_0812C552: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_812C500 - - thumb_func_start sub_812C55C -sub_812C55C: @ 812C55C - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =sSlotMachine - ldr r0, [r0] - movs r2, 0x34 - ldrsh r1, [r0, r2] - movs r2, 0x36 - ldrsh r0, [r0, r2] - cmp r1, r0 - bne _0812C59C - adds r0, r6, 0 - bl sub_812C500 - lsls r0, 24 - lsrs r0, 24 - b _0812C5D2 - .pool -_0812C588: - ldr r0, =sSlotMachine - ldr r0, [r0] - strh r5, [r0, 0x32] - mov r1, r8 - strh r1, [r0, 0x38] - movs r0, 0x1 - b _0812C5D2 - .pool -_0812C59C: - movs r2, 0x1 - mov r8, r2 - cmp r1, 0x1 - bne _0812C5A8 - movs r0, 0x3 - mov r8, r0 -_0812C5A8: - movs r5, 0 - mov r7, r8 -_0812C5AC: - lsls r0, r5, 16 - asrs r4, r0, 16 - subs r1, r7, r4 - lsls r1, 16 - asrs r1, 16 - movs r0, 0x2 - bl sub_812BC98 - lsls r0, 24 - lsrs r0, 24 - cmp r0, r6 - beq _0812C588 - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - asrs r0, 16 - cmp r0, 0x4 - ble _0812C5AC - movs r0, 0 -_0812C5D2: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_812C55C - - thumb_func_start sub_812C5DC -sub_812C5DC: @ 812C5DC - push {r4,r5,lr} - movs r5, 0 - b _0812C5E8 -_0812C5E2: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 -_0812C5E8: - lsls r0, r5, 16 - asrs r4, r0, 16 - adds r0, r4, 0 - bl sub_812C1C4 - lsls r0, 24 - cmp r0, 0 - bne _0812C5E2 - ldr r0, =sSlotMachine - ldr r0, [r0] - strh r5, [r0, 0x2E] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812C5DC - - thumb_func_start sub_812C608 -sub_812C608: @ 812C608 - push {lr} - adds r1, r0, 0 - ldrb r0, [r1] - cmp r0, 0 - bne _0812C616 - movs r0, 0x1 - b _0812C620 -_0812C616: - cmp r0, 0x1 - beq _0812C61E - movs r0, 0 - b _0812C624 -_0812C61E: - movs r0, 0 -_0812C620: - strb r0, [r1] - movs r0, 0x1 -_0812C624: - pop {r1} - bx r1 - thumb_func_end sub_812C608 - - thumb_func_start sub_812C628 -sub_812C628: @ 812C628 - push {lr} - ldr r1, =gUnknown_085A752C - ldr r0, =sSlotMachine - ldr r0, [r0] - movs r2, 0x12 - ldrsh r0, [r0, r2] - subs r0, 0x1 - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_812C628 - - thumb_func_start sub_812C64C -sub_812C64C: @ 812C64C - push {r4-r7,lr} - sub sp, 0x4 - ldr r0, =sSlotMachine - ldr r2, [r0] - movs r1, 0x34 - ldrsh r0, [r2, r1] - cmp r0, 0 - beq _0812C6C4 - ldrb r1, [r2, 0x4] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0812C6C4 - ldrh r0, [r2, 0x2E] - movs r1, 0x2 - subs r1, r0 - lsls r1, 16 - asrs r1, 16 - movs r0, 0 - bl sub_812BC98 - mov r1, sp - strb r0, [r1] - mov r0, sp - bl sub_812C608 - lsls r0, 24 - cmp r0, 0 - beq _0812C6C4 - movs r5, 0 - mov r6, sp - movs r7, 0x2 -_0812C68C: - lsls r0, r5, 16 - asrs r4, r0, 16 - subs r1, r7, r4 - lsls r1, 16 - asrs r1, 16 - movs r0, 0x1 - bl sub_812BC98 - ldrb r1, [r6] - lsls r0, 24 - lsrs r0, 24 - cmp r1, r0 - bne _0812C6B8 - ldr r0, =sSlotMachine - ldr r1, [r0] - movs r0, 0x2 - strh r0, [r1, 0x36] - strh r5, [r1, 0x30] - b _0812C6C4 - .pool -_0812C6B8: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - asrs r0, 16 - cmp r0, 0x4 - ble _0812C68C -_0812C6C4: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_812C64C - - thumb_func_start j5_08111E84 -j5_08111E84: @ 812C6CC - push {r4-r7,lr} - sub sp, 0x4 - ldr r4, =sSlotMachine - ldr r2, [r4] - ldrh r3, [r2, 0x34] - movs r1, 0x34 - ldrsh r0, [r2, r1] - cmp r0, 0 - beq _0812C744 - ldrb r1, [r2, 0x4] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0812C744 - ldrh r1, [r2, 0x2E] - subs r1, r3, r1 - lsls r1, 16 - asrs r1, 16 - movs r0, 0 - bl sub_812BC98 - mov r1, sp - strb r0, [r1] - mov r0, sp - bl sub_812C608 - lsls r0, 24 - cmp r0, 0 - beq _0812C744 - movs r5, 0 - mov r7, sp - adds r6, r4, 0 -_0812C70C: - ldr r0, [r6] - ldrh r1, [r0, 0x34] - lsls r0, r5, 16 - asrs r4, r0, 16 - subs r1, r4 - lsls r1, 16 - asrs r1, 16 - movs r0, 0x1 - bl sub_812BC98 - ldrb r1, [r7] - lsls r0, 24 - lsrs r0, 24 - cmp r1, r0 - bne _0812C738 - ldr r0, [r6] - ldrh r1, [r0, 0x34] - strh r1, [r0, 0x36] - strh r5, [r0, 0x30] - b _0812C744 - .pool -_0812C738: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - asrs r0, 16 - cmp r0, 0x4 - ble _0812C70C -_0812C744: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end j5_08111E84 - - thumb_func_start sub_812C74C -sub_812C74C: @ 812C74C - push {r4-r7,lr} - sub sp, 0x4 - ldr r6, =sSlotMachine - ldr r2, [r6] - ldrh r4, [r2, 0x34] - movs r0, 0x34 - ldrsh r3, [r2, r0] - cmp r3, 0 - beq _0812C84A - ldrb r1, [r2, 0x4] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0812C84A - cmp r3, 0x2 - bne _0812C796 - bl j5_08111E84 - b _0812C84A - .pool -_0812C778: - ldr r0, =sSlotMachine - ldr r0, [r0] - movs r1, 0 - strh r5, [r0, 0x36] - strh r1, [r0, 0x30] - b _0812C84A - .pool -_0812C788: - movs r0, 0x2 - strh r0, [r1, 0x36] - adds r0, r4, 0x1 - strh r0, [r1, 0x30] - b _0812C84A -_0812C792: - movs r0, 0x3 - b _0812C824 -_0812C796: - ldrh r1, [r2, 0x2E] - subs r1, r4, r1 - lsls r1, 16 - asrs r1, 16 - movs r0, 0 - bl sub_812BC98 - mov r1, sp - strb r0, [r1] - mov r0, sp - bl sub_812C608 - lsls r0, 24 - cmp r0, 0 - beq _0812C84A - movs r5, 0x2 - ldr r0, [r6] - movs r1, 0x34 - ldrsh r0, [r0, r1] - cmp r0, 0x3 - bne _0812C7C2 - movs r5, 0x3 -_0812C7C2: - movs r6, 0 - mov r7, sp -_0812C7C6: - lsls r0, r5, 16 - asrs r4, r0, 16 - movs r0, 0x1 - adds r1, r4, 0 - bl sub_812BC98 - ldrb r1, [r7] - lsls r0, 24 - lsrs r0, 24 - cmp r1, r0 - beq _0812C778 - lsls r1, r6, 16 - movs r2, 0x80 - lsls r2, 9 - adds r1, r2 - subs r0, r4, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - lsrs r6, r1, 16 - asrs r1, 16 - cmp r1, 0x1 - ble _0812C7C6 - movs r5, 0x1 - mov r7, sp - ldr r6, =sSlotMachine -_0812C7F8: - ldr r0, [r6] - ldrh r1, [r0, 0x34] - lsls r0, r5, 16 - asrs r4, r0, 16 - subs r1, r4 - lsls r1, 16 - asrs r1, 16 - movs r0, 0x1 - bl sub_812BC98 - ldrb r1, [r7] - lsls r0, 24 - lsrs r0, 24 - cmp r1, r0 - bne _0812C83E - ldr r1, [r6] - movs r2, 0x34 - ldrsh r0, [r1, r2] - cmp r0, 0x1 - bne _0812C830 - cmp r4, 0x2 - ble _0812C788 -_0812C824: - strh r0, [r1, 0x36] - strh r5, [r1, 0x30] - b _0812C84A - .pool -_0812C830: - cmp r4, 0x2 - ble _0812C792 - movs r0, 0x2 - strh r0, [r1, 0x36] - subs r0, r4, 0x1 - strh r0, [r1, 0x30] - b _0812C84A -_0812C83E: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - asrs r0, 16 - cmp r0, 0x4 - ble _0812C7F8 -_0812C84A: - add sp, 0x4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_812C74C - - thumb_func_start sub_812C854 -sub_812C854: @ 812C854 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - adds r2, r1, 0 - cmp r0, 0 - bne _0812C868 - cmp r1, 0x1 - beq _0812C870 -_0812C868: - cmp r0, 0x1 - bne _0812C874 - cmp r2, 0 - bne _0812C874 -_0812C870: - movs r0, 0x1 - b _0812C876 -_0812C874: - movs r0, 0 -_0812C876: - pop {r1} - bx r1 - thumb_func_end sub_812C854 - - thumb_func_start sub_812C87C -sub_812C87C: @ 812C87C - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - cmp r0, 0 - bne _0812C896 - cmp r1, 0x1 - bne _0812C896 - cmp r2, 0 - beq _0812C8A2 -_0812C896: - cmp r0, 0x1 - bne _0812C8A6 - cmp r1, 0 - bne _0812C8A6 - cmp r2, 0x1 - bne _0812C8A6 -_0812C8A2: - movs r0, 0x1 - b _0812C8A8 -_0812C8A6: - movs r0, 0 -_0812C8A8: - pop {r1} - bx r1 - thumb_func_end sub_812C87C - - thumb_func_start sub_812C8AC -sub_812C8AC: @ 812C8AC - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - lsls r2, 24 - lsrs r2, 24 - cmp r0, 0 - bne _0812C8C6 - cmp r1, 0x1 - bne _0812C8C6 - cmp r2, 0 - beq _0812C8F2 -_0812C8C6: - cmp r0, 0x1 - bne _0812C8D2 - cmp r1, 0 - bne _0812C8D2 - cmp r2, 0x1 - beq _0812C8F2 -_0812C8D2: - cmp r0, 0 - bne _0812C8DE - cmp r1, 0 - bne _0812C8DE - cmp r2, 0x1 - beq _0812C8F2 -_0812C8DE: - cmp r0, 0x1 - bne _0812C8EA - cmp r1, 0x1 - bne _0812C8EA - cmp r2, 0 - beq _0812C8F2 -_0812C8EA: - cmp r0, r1 - bne _0812C8F6 - cmp r0, r2 - bne _0812C8F6 -_0812C8F2: - movs r0, 0 - b _0812C8F8 -_0812C8F6: - movs r0, 0x1 -_0812C8F8: - pop {r1} - bx r1 - thumb_func_end sub_812C8AC - - thumb_func_start sub_812C8FC -sub_812C8FC: @ 812C8FC - push {lr} - ldr r1, =gUnknown_085A7538 - ldr r0, =sSlotMachine - ldr r0, [r0] - movs r2, 0x12 - ldrsh r0, [r0, r2] - subs r0, 0x1 - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - bl _call_via_r0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_812C8FC - - thumb_func_start sub_812C920 -sub_812C920: @ 812C920 - push {r4-r7,lr} - movs r6, 0 - ldr r7, =sSlotMachine - ldr r0, [r7] - ldrh r1, [r0, 0x2E] - movs r4, 0x2 - subs r1, r4, r1 - lsls r1, 16 - asrs r1, 16 - movs r0, 0 - bl sub_812BC98 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, [r7] - ldrh r0, [r0, 0x30] - subs r4, r0 - lsls r4, 16 - asrs r4, 16 - movs r0, 0x1 - adds r1, r4, 0 - bl sub_812BC98 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r5, r1 - bne _0812C994 - movs r4, 0x2 - b _0812C96A - .pool -_0812C960: - lsls r0, r6, 16 - movs r1, 0x80 - lsls r1, 9 - adds r0, r1 - lsrs r6, r0, 16 -_0812C96A: - lsls r1, r6, 16 - asrs r1, 16 - subs r1, r4, r1 - lsls r1, 16 - asrs r1, 16 - movs r0, 0x2 - bl sub_812BC98 - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - beq _0812C960 - cmp r5, 0 - bne _0812C98A - cmp r0, 0x1 - beq _0812C960 -_0812C98A: - cmp r5, 0x1 - bne _0812C9F6 - cmp r0, 0 - beq _0812C960 - b _0812C9F6 -_0812C994: - adds r0, r5, 0 - bl sub_812C854 - lsls r0, 24 - cmp r0, 0 - beq _0812C9F6 - ldr r0, [r7] - ldrb r1, [r0, 0x4] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0812C9D2 - movs r7, 0x2 -_0812C9AE: - lsls r0, r6, 16 - asrs r4, r0, 16 - subs r1, r7, r4 - lsls r1, 16 - asrs r1, 16 - movs r0, 0x2 - bl sub_812BC98 - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - beq _0812C9F6 - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - asrs r0, 16 - cmp r0, 0x4 - ble _0812C9AE -_0812C9D2: - movs r6, 0 - movs r7, 0x2 - b _0812C9DE -_0812C9D8: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 -_0812C9DE: - lsls r0, r6, 16 - asrs r4, r0, 16 - subs r1, r7, r4 - lsls r1, 16 - asrs r1, 16 - movs r0, 0x2 - bl sub_812BC98 - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - beq _0812C9D8 -_0812C9F6: - ldr r0, =sSlotMachine - ldr r0, [r0] - strh r6, [r0, 0x32] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812C920 - - thumb_func_start sub_812CA08 -sub_812CA08: @ 812CA08 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - movs r0, 0 - str r0, [sp] - ldr r4, =sSlotMachine - ldr r2, [r4] - movs r5, 0x36 - ldrsh r1, [r2, r5] - cmp r1, 0 - beq _0812CAA4 - ldrh r3, [r2, 0x34] - movs r5, 0x34 - ldrsh r0, [r2, r5] - cmp r0, r1 - bne _0812CAA4 - ldrb r1, [r2, 0x4] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0812CAA4 - ldrh r1, [r2, 0x2E] - subs r1, r3, r1 - lsls r1, 16 - asrs r1, 16 - movs r0, 0 - bl sub_812BC98 - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, [r4] - ldrh r1, [r0, 0x36] - ldrh r0, [r0, 0x30] - subs r1, r0 - lsls r1, 16 - asrs r1, 16 - movs r0, 0x1 - bl sub_812BC98 - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r7, 0 - adds r1, r6, 0 - bl sub_812C854 - lsls r0, 24 - cmp r0, 0 - beq _0812CAA4 - movs r5, 0 - b _0812CA7E - .pool -_0812CA78: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 -_0812CA7E: - lsls r6, r5, 16 - asrs r5, r6, 16 - cmp r5, 0x4 - bgt _0812CAA4 - ldr r0, =sSlotMachine - ldr r0, [r0] - ldrh r1, [r0, 0x36] - subs r1, r5 - lsls r1, 16 - asrs r1, 16 - movs r0, 0x2 - bl sub_812BC98 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r7, r4 - bne _0812CA78 - lsrs r6, 16 - str r6, [sp] -_0812CAA4: - ldr r0, =sSlotMachine - mov r9, r0 -_0812CAA8: - movs r5, 0x1 - movs r1, 0 - mov r8, r1 - ldr r2, [sp] - lsls r2, 16 - mov r10, r2 -_0812CAB4: - mov r1, r9 - ldr r0, [r1] - ldrh r1, [r0, 0x2E] - lsls r5, 16 - asrs r4, r5, 16 - subs r1, r4, r1 - lsls r1, 16 - asrs r1, 16 - movs r0, 0 - bl sub_812BC98 - lsls r0, 24 - lsrs r7, r0, 24 - mov r2, r9 - ldr r0, [r2] - ldrh r1, [r0, 0x30] - subs r1, r4, r1 - lsls r1, 16 - asrs r1, 16 - movs r0, 0x1 - bl sub_812BC98 - lsls r0, 24 - lsrs r6, r0, 24 - mov r1, r10 - asrs r0, r1, 16 - subs r4, r0 - lsls r4, 16 - asrs r4, 16 - movs r0, 0x2 - adds r1, r4, 0 - bl sub_812BC98 - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r7, 0 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_812C8AC - lsls r0, 24 - cmp r0, 0 - bne _0812CB3C - adds r0, r7, 0 - adds r1, r6, 0 - adds r2, r4, 0 - bl sub_812C87C - lsls r0, 24 - cmp r0, 0 - beq _0812CB28 - mov r2, r9 - ldr r0, [r2] - ldrb r1, [r0, 0x4] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0812CB3C -_0812CB28: - mov r5, r8 - lsls r0, r5, 16 - movs r1, 0x80 - lsls r1, 9 - adds r0, r1 - lsrs r0, 16 - mov r8, r0 - b _0812CB4A - .pool -_0812CB3C: - movs r2, 0x80 - lsls r2, 9 - adds r0, r5, r2 - lsrs r5, r0, 16 - asrs r0, 16 - cmp r0, 0x3 - ble _0812CAB4 -_0812CB4A: - mov r5, r8 - cmp r5, 0 - beq _0812CB60 - ldr r1, [sp] - lsls r0, r1, 16 - movs r2, 0x80 - lsls r2, 9 - adds r0, r2 - lsrs r0, 16 - str r0, [sp] - b _0812CAA8 -_0812CB60: - ldr r0, =sSlotMachine - ldr r0, [r0] - mov r5, sp - ldrh r5, [r5] - strh r5, [r0, 0x32] - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812CA08 - - thumb_func_start sub_812CB80 -sub_812CB80: @ 812CB80 - push {r4-r7,lr} - mov r7, r8 - push {r7} - bl sub_812CA08 - ldr r4, =sSlotMachine - ldr r2, [r4] - movs r0, 0x36 - ldrsh r1, [r2, r0] - cmp r1, 0 - beq _0812CC34 - ldrh r3, [r2, 0x34] - movs r5, 0x34 - ldrsh r0, [r2, r5] - cmp r0, r1 - beq _0812CC34 - ldrb r1, [r2, 0x4] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _0812CC34 - ldrh r1, [r2, 0x2E] - subs r1, r3, r1 - lsls r1, 16 - asrs r1, 16 - movs r0, 0 - bl sub_812BC98 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, [r4] - ldrh r1, [r0, 0x36] - ldrh r0, [r0, 0x30] - subs r1, r0 - lsls r1, 16 - asrs r1, 16 - movs r0, 0x1 - bl sub_812BC98 - lsls r0, 24 - lsrs r5, r0, 24 - adds r0, r6, 0 - adds r1, r5, 0 - bl sub_812C854 - lsls r0, 24 - cmp r0, 0 - beq _0812CC34 - movs r1, 0x1 - ldr r0, [r4] - movs r2, 0x34 - ldrsh r0, [r0, r2] - cmp r0, 0x1 - bne _0812CBEE - movs r1, 0x3 -_0812CBEE: - movs r3, 0 - lsls r1, 16 - mov r8, r1 - adds r7, r4, 0 -_0812CBF6: - ldr r0, [r7] - ldrh r2, [r0, 0x32] - lsls r0, r3, 16 - asrs r5, r0, 16 - adds r2, r5, r2 - mov r0, r8 - asrs r1, r0, 16 - subs r1, r2 - lsls r1, 16 - asrs r1, 16 - movs r0, 0x2 - bl sub_812BC98 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r6, r4 - bne _0812CC28 - ldr r1, [r7] - ldrh r0, [r1, 0x32] - adds r0, r5, r0 - strh r0, [r1, 0x32] - b _0812CC34 - .pool -_0812CC28: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r3, r0, 16 - asrs r0, 16 - cmp r0, 0x4 - ble _0812CBF6 -_0812CC34: - ldr r7, =sSlotMachine -_0812CC36: - ldr r0, [r7] - ldrh r0, [r0, 0x2E] - movs r1, 0x1 - subs r1, r0 - lsls r1, 16 - asrs r1, 16 - movs r0, 0 - bl sub_812BC98 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, [r7] - ldrh r0, [r0, 0x30] - movs r1, 0x2 - subs r1, r0 - lsls r1, 16 - asrs r1, 16 - movs r0, 0x1 - bl sub_812BC98 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, [r7] - ldrh r0, [r0, 0x32] - movs r1, 0x3 - subs r1, r0 - lsls r1, 16 - asrs r1, 16 - movs r0, 0x2 - bl sub_812BC98 - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r6, 0 - adds r1, r5, 0 - adds r2, r4, 0 - bl sub_812C8AC - lsls r0, 24 - cmp r0, 0 - bne _0812CCB4 - adds r0, r6, 0 - adds r1, r5, 0 - adds r2, r4, 0 - bl sub_812C87C - lsls r0, 24 - cmp r0, 0 - beq _0812CCA4 - ldr r0, [r7] - ldrb r1, [r0, 0x4] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0812CCB4 -_0812CCA4: - ldr r1, [r7] - ldrh r0, [r1, 0x32] - adds r0, 0x1 - strh r0, [r1, 0x32] - b _0812CC36 - .pool -_0812CCB4: - ldr r7, =sSlotMachine -_0812CCB6: - ldr r0, [r7] - ldrh r0, [r0, 0x2E] - movs r1, 0x3 - subs r1, r0 - lsls r1, 16 - asrs r1, 16 - movs r0, 0 - bl sub_812BC98 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, [r7] - ldrh r0, [r0, 0x30] - movs r1, 0x2 - subs r1, r0 - lsls r1, 16 - asrs r1, 16 - movs r0, 0x1 - bl sub_812BC98 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, [r7] - ldrh r0, [r0, 0x32] - movs r1, 0x1 - subs r1, r0 - lsls r1, 16 - asrs r1, 16 - movs r0, 0x2 - bl sub_812BC98 - lsls r0, 24 - lsrs r4, r0, 24 - adds r0, r6, 0 - adds r1, r5, 0 - adds r2, r4, 0 - bl sub_812C8AC - lsls r0, 24 - cmp r0, 0 - bne _0812CD34 - adds r0, r6, 0 - adds r1, r5, 0 - adds r2, r4, 0 - bl sub_812C87C - lsls r0, 24 - cmp r0, 0 - beq _0812CD24 - ldr r0, [r7] - ldrb r1, [r0, 0x4] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0812CD34 -_0812CD24: - ldr r1, [r7] - ldrh r0, [r1, 0x32] - adds r0, 0x1 - strh r0, [r1, 0x32] - b _0812CCB6 - .pool -_0812CD34: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_812CB80 - - thumb_func_start sub_8103C14 -sub_8103C14: @ 812CD40 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =sub_812CD74 - adds r0, r5, 0 - movs r1, 0x5 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0x26] - bl _call_via_r5 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8103C14 - - thumb_func_start sub_812CD74 -sub_812CD74: @ 812CD74 - push {r4,lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r3, =gUnknown_085A7544 - ldr r2, =gTasks - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r4, 0x8 - ldrsh r2, [r0, r4] - lsls r2, 2 - adds r2, r3 - ldr r2, [r2] - bl _call_via_r2 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812CD74 - - thumb_func_start sub_812CDA4 -sub_812CDA4: @ 812CDA4 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - ldr r1, =gUnknown_085A7550 - movs r2, 0x26 - ldrsh r0, [r4, r2] - lsls r0, 1 - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - movs r1, 0x73 - str r1, [sp] - movs r1, 0x62 - movs r2, 0x63 - movs r3, 0x72 - bl sub_812FA78 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812CDA4 - - thumb_func_start sub_812CDD8 -sub_812CDD8: @ 812CDD8 - push {lr} - adds r1, r0, 0 - ldrh r0, [r1, 0xA] - adds r0, 0x1 - strh r0, [r1, 0xA] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xB - ble _0812CDF0 - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] -_0812CDF0: - pop {r0} - bx r0 - thumb_func_end sub_812CDD8 - - thumb_func_start sub_812CDF4 -sub_812CDF4: @ 812CDF4 - push {r4,lr} - sub sp, 0x4 - lsls r4, r1, 24 - lsrs r4, 24 - ldr r1, =gUnknown_085A7550 - movs r2, 0x26 - ldrsh r0, [r0, r2] - lsls r0, 1 - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - movs r1, 0x53 - str r1, [sp] - movs r1, 0x42 - movs r2, 0x43 - movs r3, 0x52 - bl sub_812FA78 - adds r0, r4, 0 - bl DestroyTask - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812CDF4 - - thumb_func_start sub_812CE2C -sub_812CE2C: @ 812CE2C - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gUnknown_085A8408 - lsls r1, r0, 2 - adds r1, r2 - ldr r2, [r1] - ldr r1, =gUnknown_085A8430 - adds r0, r1 - ldrb r1, [r0] - adds r0, r2, 0 - movs r2, 0x2 - bl LoadPalette - pop {r0} - bx r0 - .pool - thumb_func_end sub_812CE2C - - thumb_func_start sub_812CE54 -sub_812CE54: @ 812CE54 - push {lr} - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gUnknown_085A841C - lsls r1, r0, 2 - adds r1, r2 - ldr r2, [r1] - ldr r1, =gUnknown_085A8430 - adds r0, r1 - ldrb r1, [r0] - adds r0, r2, 0 - movs r2, 0x2 - bl LoadPalette - pop {r0} - bx r0 - .pool - thumb_func_end sub_812CE54 - - thumb_func_start sub_8103D50 -sub_8103D50: @ 812CE7C - push {r4-r7,lr} - lsls r0, 24 - lsrs r1, r0, 24 - movs r4, 0 - ldr r0, =gUnknown_085A843B - adds r0, r1, r0 - ldrb r0, [r0] - cmp r4, r0 - bcs _0812CEA8 - ldr r7, =gUnknown_085A8435 - adds r6, r0, 0 - lsls r5, r1, 1 -_0812CE94: - adds r0, r4, r5 - adds r0, r7 - ldrb r0, [r0] - bl sub_812CE2C - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r6 - bcc _0812CE94 -_0812CEA8: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8103D50 - - thumb_func_start sub_8103D8C -sub_8103D8C: @ 812CEB8 - push {r4-r7,lr} - lsls r0, 24 - lsrs r1, r0, 24 - movs r4, 0 - ldr r0, =gUnknown_085A843B - adds r0, r1, r0 - ldrb r0, [r0] - cmp r4, r0 - bcs _0812CEE4 - ldr r7, =gUnknown_085A8435 - adds r6, r0, 0 - lsls r5, r1, 1 -_0812CED0: - adds r0, r4, r5 - adds r0, r7 - ldrb r0, [r0] - bl sub_812CE54 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, r6 - bcc _0812CED0 -_0812CEE4: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8103D8C - - thumb_func_start sub_8103DC8 -sub_8103DC8: @ 812CEF4 - push {r4,r5,lr} - movs r4, 0 - ldr r5, =gSprites -_0812CEFA: - ldr r0, =sub_812D024 - bl CreateInvisibleSprite - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r5 - strh r4, [r1, 0x2E] - ldr r1, =sSlotMachine - ldr r1, [r1] - adds r1, 0x44 - adds r1, r4 - strb r0, [r1] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x4 - bls _0812CEFA - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8103DC8 - - thumb_func_start sub_8103E04 -sub_8103E04: @ 812CF34 - lsls r0, 24 - lsrs r0, 24 - ldr r1, =sSlotMachine - ldr r1, [r1] - adds r1, 0x44 - adds r1, r0 - ldrb r1, [r1] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - movs r2, 0 - movs r1, 0x1 - strh r1, [r0, 0x30] - movs r1, 0x4 - strh r1, [r0, 0x32] - strh r2, [r0, 0x34] - strh r2, [r0, 0x36] - movs r1, 0x2 - strh r1, [r0, 0x38] - strh r2, [r0, 0x3C] - bx lr - .pool - thumb_func_end sub_8103E04 - - thumb_func_start sub_812CF6C -sub_812CF6C: @ 812CF6C - push {r4,r5,lr} - movs r2, 0 - ldr r0, =sSlotMachine - ldr r0, [r0] - adds r3, r0, 0 - adds r3, 0x44 - ldr r4, =gSprites -_0812CF7A: - adds r0, r3, r2 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r0, r4 - movs r5, 0x30 - ldrsh r0, [r1, r5] - cmp r0, 0 - beq _0812CFA4 - movs r5, 0x32 - ldrsh r0, [r1, r5] - cmp r0, 0 - beq _0812CFA4 - movs r0, 0 - b _0812CFB0 - .pool -_0812CFA4: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x4 - bls _0812CF7A - movs r0, 0x1 -_0812CFB0: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_812CF6C - - thumb_func_start sub_812CFB8 -sub_812CFB8: @ 812CFB8 - push {r4,lr} - movs r4, 0 -_0812CFBC: - ldr r0, =sSlotMachine - ldr r0, [r0] - adds r0, 0x44 - adds r0, r4 - ldrb r0, [r0] - bl sub_812CFEC - lsls r0, 24 - cmp r0, 0 - bne _0812CFD8 - movs r0, 0 - b _0812CFE4 - .pool -_0812CFD8: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x4 - bls _0812CFBC - movs r0, 0x1 -_0812CFE4: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_812CFB8 - - thumb_func_start sub_812CFEC -sub_812CFEC: @ 812CFEC - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =gSprites - adds r1, r0 - movs r2, 0x30 - ldrsh r0, [r1, r2] - cmp r0, 0 - bne _0812D00C - movs r0, 0x1 - b _0812D01E - .pool -_0812D00C: - ldrh r2, [r1, 0x3C] - movs r3, 0x3C - ldrsh r0, [r1, r3] - cmp r0, 0 - beq _0812D01A - movs r0, 0 - strh r0, [r1, 0x30] -_0812D01A: - lsls r0, r2, 24 - lsrs r0, 24 -_0812D01E: - pop {r1} - bx r1 - thumb_func_end sub_812CFEC - - thumb_func_start sub_812D024 -sub_812D024: @ 812D024 - push {r4-r7,lr} - adds r2, r0, 0 - movs r1, 0x30 - ldrsh r0, [r2, r1] - cmp r0, 0 - beq _0812D0A6 - ldrh r0, [r2, 0x34] - subs r0, 0x1 - strh r0, [r2, 0x34] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _0812D08E - movs r0, 0 - strh r0, [r2, 0x3C] - movs r6, 0x1 - strh r6, [r2, 0x34] - ldrh r1, [r2, 0x38] - ldrh r3, [r2, 0x36] - adds r0, r1, r3 - strh r0, [r2, 0x36] - movs r4, 0x4 - ldrh r5, [r2, 0x32] - movs r7, 0x32 - ldrsh r3, [r2, r7] - cmp r3, 0 - beq _0812D060 - movs r4, 0x8 -_0812D060: - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bgt _0812D078 - strh r6, [r2, 0x3C] - negs r0, r1 - strh r0, [r2, 0x38] - cmp r3, 0 - beq _0812D08E - subs r0, r5, 0x1 - strh r0, [r2, 0x32] - b _0812D080 -_0812D078: - cmp r0, r4 - blt _0812D080 - negs r0, r1 - strh r0, [r2, 0x38] -_0812D080: - movs r1, 0x32 - ldrsh r0, [r2, r1] - cmp r0, 0 - beq _0812D08E - ldrh r0, [r2, 0x34] - lsls r0, 1 - strh r0, [r2, 0x34] -_0812D08E: - ldr r1, =gUnknown_085A8430 - movs r3, 0x2E - ldrsh r0, [r2, r3] - adds r0, r1 - ldrb r0, [r0] - ldrh r3, [r2, 0x36] - lsls r3, 24 - lsrs r3, 24 - adds r1, r3, 0 - adds r2, r3, 0 - bl MultiplyPaletteRGBComponents -_0812D0A6: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812D024 - - thumb_func_start sub_8103F70 -sub_8103F70: @ 812D0B0 - push {r4,lr} - ldr r4, =sub_812D128 - adds r0, r4, 0 - movs r1, 0x6 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r2, 0x1 - strh r2, [r1, 0xE] - bl _call_via_r4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8103F70 - - thumb_func_start sub_8103FA0 -sub_8103FA0: @ 812D0E0 - push {lr} - ldr r0, =sub_812D128 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r2, r0, 24 - ldr r1, =gTasks - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - adds r0, r1 - movs r1, 0xC - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _0812D10C - movs r0, 0 - b _0812D120 - .pool -_0812D10C: - adds r0, r2, 0 - bl DestroyTask - ldr r0, =gUnknown_085A84AC - ldr r0, [r0] - movs r1, 0x10 - movs r2, 0x20 - bl LoadPalette - movs r0, 0x1 -_0812D120: - pop {r1} - bx r1 - .pool - thumb_func_end sub_8103FA0 - - thumb_func_start sub_812D128 -sub_812D128: @ 812D128 - push {lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - ldr r0, =gTasks - adds r2, r1, r0 - ldrh r0, [r2, 0xA] - subs r0, 0x1 - strh r0, [r2, 0xA] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _0812D166 - movs r0, 0x4 - strh r0, [r2, 0xA] - ldrh r1, [r2, 0xE] - ldrh r3, [r2, 0xC] - adds r0, r1, r3 - strh r0, [r2, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - beq _0812D162 - cmp r0, 0x2 - bne _0812D166 -_0812D162: - negs r0, r1 - strh r0, [r2, 0xE] -_0812D166: - ldr r0, =gUnknown_085A84A0 - movs r3, 0xC - ldrsh r1, [r2, r3] - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] - movs r1, 0x10 - movs r2, 0x20 - bl LoadPalette - pop {r0} - bx r0 - .pool - thumb_func_end sub_812D128 - - thumb_func_start sub_8104048 -sub_8104048: @ 812D188 - push {lr} - ldr r0, =sub_812D230 - movs r1, 0x8 - bl CreateTask - ldr r1, =sSlotMachine - ldr r1, [r1] - adds r1, 0x3E - strb r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104048 - - thumb_func_start sub_8104064 -sub_8104064: @ 812D1A8 - push {r4,lr} - ldr r0, =sSlotMachine - ldr r0, [r0] - adds r0, 0x3E - ldrb r0, [r0] - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =gTasks - adds r4, r0 - adds r0, r4, 0 - bl sub_812D394 - movs r1, 0x1 - strh r1, [r4, 0x8] - ldrh r0, [r4, 0xA] - adds r0, 0x1 - strh r0, [r4, 0xA] - strh r1, [r4, 0x26] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104064 - - thumb_func_start sub_812D1DC -sub_812D1DC: @ 812D1DC - push {r4,lr} - ldr r0, =sSlotMachine - ldr r0, [r0] - adds r0, 0x3E - ldrb r0, [r0] - lsls r4, r0, 2 - adds r4, r0 - lsls r4, 3 - ldr r0, =gTasks - adds r4, r0 - adds r0, r4, 0 - bl sub_812D394 - movs r0, 0x3 - strh r0, [r4, 0x8] - movs r0, 0x1 - strh r0, [r4, 0x26] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812D1DC - - thumb_func_start sub_81040C8 -sub_81040C8: @ 812D20C - ldr r2, =gTasks - ldr r0, =sSlotMachine - ldr r0, [r0] - adds r0, 0x3E - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - ldrh r0, [r0, 0x26] - lsls r0, 24 - lsrs r0, 24 - bx lr - .pool - thumb_func_end sub_81040C8 - - thumb_func_start sub_812D230 -sub_812D230: @ 812D230 - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r3, =gUnknown_085A7558 - ldr r2, =gTasks - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r2, 0x8 - ldrsh r1, [r0, r2] - lsls r1, 2 - adds r1, r3 - ldr r1, [r1] - bl _call_via_r1 - pop {r0} - bx r0 - .pool - thumb_func_end sub_812D230 - - thumb_func_start nullsub_50 -nullsub_50: @ 812D260 - bx lr - thumb_func_end nullsub_50 - - thumb_func_start sub_812D264 -sub_812D264: @ 812D264 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0xA] - lsls r0, 19 - movs r1, 0xA0 - lsls r1, 13 - adds r0, r1 - asrs r0, 16 - movs r1, 0x14 - bl sub_812EF00 - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0xC] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_812D264 - - thumb_func_start sub_812D28C -sub_812D28C: @ 812D28C - push {r4,r5,lr} - adds r4, r0, 0 - ldr r2, =gSprites - movs r0, 0xC - ldrsh r1, [r4, r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - movs r1, 0x3C - ldrsh r0, [r0, r1] - cmp r0, 0 - beq _0812D2FC - ldrh r1, [r4, 0xA] - adds r0, r1, 0x2 - lsls r0, 16 - lsrs r5, r0, 16 - movs r3, 0 - movs r2, 0 - lsls r1, 16 - asrs r1, 16 - cmp r1, 0x1 - bne _0812D2C4 - movs r3, 0x1 - movs r2, 0x1 - b _0812D2CC - .pool -_0812D2C4: - cmp r1, 0x10 - bne _0812D2CC - movs r3, 0x2 - movs r2, 0x2 -_0812D2CC: - ldr r0, =gUnknown_0203AACC - ldr r0, [r0] - lsls r1, r2, 1 - adds r1, r0 - ldr r2, =gUnknown_085A7568 - lsls r0, r3, 2 - adds r0, r2 - ldrh r0, [r0] - strh r0, [r1] - lsls r3, r5, 16 - movs r0, 0x80 - lsls r0, 15 - adds r3, r0 - lsrs r3, 16 - movs r0, 0x2 - movs r2, 0x2 - bl LoadBgTilemap - ldrb r0, [r4, 0xC] - bl sub_812EF6C - movs r0, 0 - strh r0, [r4, 0x8] - strh r0, [r4, 0x26] -_0812D2FC: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812D28C - - thumb_func_start sub_812D30C -sub_812D30C: @ 812D30C - push {r4,r5,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0xA] - adds r0, r1, 0x2 - lsls r0, 16 - lsrs r5, r0, 16 - movs r3, 0 - movs r2, 0x3 - lsls r1, 16 - asrs r1, 16 - cmp r1, 0x1 - bne _0812D32A - movs r3, 0x1 - movs r2, 0x1 - b _0812D332 -_0812D32A: - cmp r1, 0x10 - bne _0812D332 - movs r3, 0x2 - movs r2, 0x2 -_0812D332: - movs r1, 0xC - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0812D366 - ldr r0, =gUnknown_0203AACC - ldr r0, [r0] - lsls r1, r2, 1 - adds r1, r0 - ldr r0, =gUnknown_085A7568 - lsls r2, r3, 2 - adds r0, 0x2 - adds r2, r0 - ldrh r0, [r2] - strh r0, [r1] - lsls r3, r5, 16 - movs r0, 0x80 - lsls r0, 15 - adds r3, r0 - lsrs r3, 16 - movs r0, 0x2 - movs r2, 0x2 - bl LoadBgTilemap - ldrh r0, [r4, 0xA] - subs r0, 0x1 - strh r0, [r4, 0xA] -_0812D366: - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x13 - ble _0812D378 - movs r0, 0 - strh r0, [r4, 0xC] -_0812D378: - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0812D384 - strh r0, [r4, 0x8] - strh r0, [r4, 0x26] -_0812D384: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812D30C - - thumb_func_start sub_812D394 -sub_812D394: @ 812D394 - push {lr} - movs r1, 0x2 - adds r2, r0, 0 - adds r2, 0x8 - movs r3, 0 -_0812D39E: - lsls r0, r1, 1 - adds r0, r2, r0 - strh r3, [r0] - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xF - bls _0812D39E - pop {r0} - bx r0 - thumb_func_end sub_812D394 - - thumb_func_start sub_810423C -sub_810423C: @ 812D3B4 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - movs r4, 0x3 - movs r5, 0 - cmp r5, r6 - bge _0812D41E - ldr r7, =gUnknown_085A7568 -_0812D3C4: - movs r3, 0 - movs r1, 0 - lsls r0, r5, 16 - asrs r0, 16 - cmp r0, 0 - bne _0812D3DC - movs r3, 0x1 - movs r1, 0x1 - b _0812D3E4 - .pool -_0812D3DC: - cmp r0, 0xF - bne _0812D3E4 - movs r3, 0x2 - movs r1, 0x2 -_0812D3E4: - ldr r0, =gUnknown_0203AACC - ldr r0, [r0] - lsls r1, 1 - adds r1, r0 - lsls r0, r3, 2 - adds r0, r7 - ldrh r0, [r0] - strh r0, [r1] - lsls r3, r4, 16 - asrs r4, r3, 16 - movs r0, 0x80 - lsls r0, 15 - adds r3, r0 - lsrs r3, 16 - movs r0, 0x2 - movs r2, 0x2 - bl LoadBgTilemap - lsls r0, r5, 16 - movs r1, 0x80 - lsls r1, 9 - adds r0, r1 - adds r4, 0x1 - lsls r4, 16 - lsrs r4, 16 - lsrs r5, r0, 16 - asrs r0, 16 - cmp r0, r6 - blt _0812D3C4 -_0812D41E: - lsls r2, r5, 16 - asrs r0, r2, 16 - cmp r0, 0xF - bgt _0812D484 - ldr r7, =gUnknown_085A756A -_0812D428: - movs r3, 0 - movs r1, 0x3 - asrs r0, r2, 16 - cmp r0, 0 - bne _0812D440 - movs r3, 0x1 - movs r1, 0x1 - b _0812D448 - .pool -_0812D440: - cmp r0, 0xF - bne _0812D448 - movs r3, 0x2 - movs r1, 0x2 -_0812D448: - ldr r0, =gUnknown_0203AACC - ldr r0, [r0] - lsls r1, 1 - adds r1, r0 - lsls r0, r3, 2 - adds r0, r7 - ldrh r0, [r0] - strh r0, [r1] - lsls r3, r4, 16 - asrs r4, r3, 16 - movs r0, 0x80 - lsls r0, 15 - adds r3, r0 - lsrs r3, 16 - movs r0, 0x2 - movs r2, 0x2 - bl LoadBgTilemap - lsls r0, r5, 16 - movs r1, 0x80 - lsls r1, 9 - adds r0, r1 - lsrs r5, r0, 16 - adds r4, 0x1 - lsls r4, 16 - lsrs r4, 16 - lsls r2, r5, 16 - asrs r0, r2, 16 - cmp r0, 0xF - ble _0812D428 -_0812D484: - ldr r2, =gTasks - ldr r0, =sSlotMachine - ldr r0, [r0] - adds r0, 0x3E - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - strh r6, [r0, 0xA] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810423C - - thumb_func_start sub_810430C -sub_810430C: @ 812D4AC - push {r4,lr} - ldr r4, =sub_812D4EC - adds r0, r4, 0 - movs r1, 0x7 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - bl _call_via_r4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810430C - - thumb_func_start sub_810432C -sub_810432C: @ 812D4CC - push {lr} - ldr r0, =sub_812D4EC - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _0812D4E4 - movs r0, 0 - b _0812D4E6 - .pool -_0812D4E4: - movs r0, 0x1 -_0812D4E6: - pop {r1} - bx r1 - thumb_func_end sub_810432C - - thumb_func_start sub_812D4EC -sub_812D4EC: @ 812D4EC - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r3, =gUnknown_085A7574 - ldr r2, =gTasks - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r2, 0x8 - ldrsh r1, [r0, r2] - lsls r1, 2 - adds r1, r3 - ldr r1, [r1] - bl _call_via_r1 - pop {r0} - bx r0 - .pool - thumb_func_end sub_812D4EC - - thumb_func_start sub_812D51C -sub_812D51C: @ 812D51C - push {lr} - ldr r3, =sSlotMachine - ldr r1, [r3] - movs r2, 0 - strb r2, [r1, 0xA] - ldr r1, [r3] - strh r2, [r1, 0x14] - strh r2, [r1, 0x16] - ldrh r1, [r0, 0x8] - adds r1, 0x1 - strh r1, [r0, 0x8] - strh r2, [r0, 0xA] - movs r1, 0x1E - strh r1, [r0, 0xC] - movs r1, 0xA0 - lsls r1, 3 - strh r1, [r0, 0x10] - ldr r0, =gSpriteCoordOffsetX - strh r2, [r0] - ldr r0, =gSpriteCoordOffsetY - strh r2, [r0] - movs r0, 0x14 - movs r1, 0 - bl SetGpuReg - movs r0, 0x16 - movs r1, 0 - bl SetGpuReg - movs r0, 0x1E - movs r1, 0 - bl sub_812DC08 - bl sub_812E474 - bl sub_812E33C - bl sub_812E650 - bl sub_812E70C - bl sub_812E7CC - bl sub_8102680 - bl StopMapMusic - movs r0, 0xC4 - lsls r0, 1 - bl PlayNewMapMusic - pop {r0} - bx r0 - .pool - thumb_func_end sub_812D51C - - thumb_func_start sub_812D594 -sub_812D594: @ 812D594 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r1, =gSpriteCoordOffsetX - ldrh r0, [r1] - subs r0, 0x8 - strh r0, [r1] - ldrh r1, [r4, 0xA] - adds r1, 0x8 - strh r1, [r4, 0xA] - movs r2, 0xA - ldrsh r0, [r4, r2] - adds r0, 0xF0 - movs r2, 0xFF - ands r0, r2 - lsrs r5, r0, 3 - ldr r0, =0x000001ff - ands r1, r0 - movs r0, 0x14 - bl SetGpuReg - adds r2, r5, 0 - movs r1, 0xC - ldrsh r0, [r4, r1] - cmp r2, r0 - beq _0812D5E2 - movs r1, 0xE - ldrsh r0, [r4, r1] - cmp r0, 0x12 - bgt _0812D5E2 - strh r5, [r4, 0xC] - ldrh r0, [r4, 0xA] - lsls r0, 16 - asrs r0, 19 - strh r0, [r4, 0xE] - movs r0, 0xE - ldrsh r1, [r4, r0] - adds r0, r2, 0 - bl sub_812DC08 -_0812D5E2: - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0xC7 - ble _0812D5F4 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - movs r1, 0 - strh r0, [r4, 0x8] - strh r1, [r4, 0xE] -_0812D5F4: - ldrh r0, [r4, 0x10] - lsls r0, 16 - asrs r0, 24 - bl sub_812BDD4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812D594 - - thumb_func_start sub_812D60C -sub_812D60C: @ 812D60C - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x10] - lsls r0, 16 - asrs r0, 24 - bl sub_812BDD4 - ldrh r0, [r4, 0x12] - adds r0, 0x1 - strh r0, [r4, 0x12] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3B - ble _0812D636 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - bl sub_812E934 - bl sub_812EAB0 -_0812D636: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_812D60C - - thumb_func_start sub_812D63C -sub_812D63C: @ 812D63C - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x14 - adds r7, r0, 0 - ldr r1, =gUnknown_085A75C0 - mov r0, sp - movs r2, 0x4 - bl memcpy - add r0, sp, 0x4 - mov r8, r0 - ldr r1, =gUnknown_085A75C4 - movs r2, 0x8 - bl memcpy - add r6, sp, 0xC - ldr r1, =gUnknown_085A75CC - adds r0, r6, 0 - movs r2, 0x8 - bl memcpy - ldrh r0, [r7, 0x10] - lsls r0, 16 - asrs r0, 24 - bl sub_812BDD4 - ldrh r0, [r7, 0x10] - subs r0, 0x4 - strh r0, [r7, 0x10] - lsls r0, 16 - asrs r0, 24 - movs r5, 0x4 - subs r5, r0 - lsls r4, r5, 1 - add r8, r4 - mov r1, r8 - movs r2, 0 - ldrsh r0, [r1, r2] - bl sub_812EA44 - adds r6, r4 - movs r1, 0 - ldrsh r0, [r6, r1] - bl sub_812EBAC - 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 - mov r2, sp - adds r1, r2, r5 - ldrb r1, [r1] - bl StartSpriteAnimIfDifferent - movs r1, 0x10 - ldrsh r0, [r7, r1] - movs r1, 0x80 - lsls r1, 1 - cmp r0, r1 - bgt _0812D6CC - ldrh r0, [r7, 0x8] - adds r0, 0x1 - strh r0, [r7, 0x8] - strh r1, [r7, 0x10] - movs r0, 0 - strh r0, [r7, 0x12] -_0812D6CC: - add sp, 0x14 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812D63C - - thumb_func_start sub_812D6EC -sub_812D6EC: @ 812D6EC - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x10] - lsls r0, 16 - asrs r0, 24 - bl sub_812BDD4 - ldrh r0, [r4, 0x12] - adds r0, 0x1 - strh r0, [r4, 0x12] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4F - ble _0812D730 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - strh r0, [r4, 0x12] - movs r0, 0x2 - bl sub_812EBAC - 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 - movs r1, 0x3 - bl StartSpriteAnimIfDifferent -_0812D730: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812D6EC - - thumb_func_start sub_812D740 -sub_812D740: @ 812D740 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x10] - lsls r0, 16 - asrs r0, 24 - bl sub_812BDD4 - ldrb r0, [r4, 0x10] - adds r0, 0x80 - strh r0, [r4, 0x10] - ldrh r0, [r4, 0x12] - adds r0, 0x1 - strh r0, [r4, 0x12] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x4F - ble _0812D76C - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - strh r0, [r4, 0x12] -_0812D76C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_812D740 - - thumb_func_start sub_812D774 -sub_812D774: @ 812D774 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x10] - lsls r0, 16 - asrs r0, 24 - bl sub_812BDD4 - ldrb r0, [r4, 0x10] - adds r0, 0x40 - strh r0, [r4, 0x10] - ldrh r0, [r4, 0x12] - adds r0, 0x1 - strh r0, [r4, 0x12] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x27 - ble _0812D7DC - movs r0, 0 - strh r0, [r4, 0x12] - ldr r0, =sSlotMachine - ldr r1, [r0] - ldrb r0, [r1, 0x5] - cmp r0, 0 - beq _0812D7B8 - ldrb r1, [r1, 0xA] - movs r2, 0x14 - ldrsh r0, [r4, r2] - cmp r1, r0 - bgt _0812D7D6 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - b _0812D7D4 - .pool -_0812D7B8: - movs r1, 0x14 - ldrsh r0, [r4, r1] - cmp r0, 0x3 - ble _0812D7C6 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - b _0812D7D4 -_0812D7C6: - ldrh r0, [r4, 0x14] - bl sub_81026DC - lsls r0, 24 - cmp r0, 0 - beq _0812D7D6 - movs r0, 0xE -_0812D7D4: - strh r0, [r4, 0x8] -_0812D7D6: - ldrh r0, [r4, 0x14] - adds r0, 0x1 - strh r0, [r4, 0x14] -_0812D7DC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_812D774 - - thumb_func_start sub_812D7E4 -sub_812D7E4: @ 812D7E4 - push {r4-r6,lr} - adds r4, r0, 0 - ldr r6, =sSlotMachine - ldr r0, [r6] - movs r1, 0x14 - ldrsh r0, [r0, r1] - movs r1, 0x14 - bl __modsi3 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r0, 0 - beq _0812D810 - ldrh r0, [r4, 0x10] - lsls r0, 16 - asrs r0, 24 - bl sub_812BE0C - b _0812D838 - .pool -_0812D810: - movs r0, 0x1 - bl sub_812BCE8 - ldr r1, [r6] - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1, 0x5] - cmp r0, r1 - beq _0812D842 - ldrh r0, [r4, 0x10] - lsls r0, 16 - asrs r0, 24 - bl sub_812BDD4 - ldr r0, [r6] - movs r1, 0x14 - ldrsh r0, [r0, r1] - movs r1, 0x14 - bl __modsi3 -_0812D838: - lsls r0, 16 - lsrs r5, r0, 16 - ldrb r0, [r4, 0x10] - adds r0, 0x40 - strh r0, [r4, 0x10] -_0812D842: - lsls r0, r5, 16 - asrs r5, r0, 16 - cmp r5, 0 - bne _0812D866 - movs r0, 0x1 - bl sub_812BCE8 - ldr r1, =sSlotMachine - ldr r1, [r1] - lsls r0, 24 - lsrs r0, 24 - ldrb r1, [r1, 0x5] - cmp r0, r1 - bne _0812D866 - strh r5, [r4, 0x10] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_0812D866: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812D7E4 - - thumb_func_start sub_812D870 -sub_812D870: @ 812D870 - push {r4-r6,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x10] - adds r0, 0x1 - movs r6, 0 - strh r0, [r4, 0x10] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x3B - ble _0812D914 - bl StopMapMusic - bl sub_812EA7C - bl sub_812EBCC - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - ldr r5, =sSlotMachine - ldr r1, [r5] - ldrb r0, [r1, 0x5] - cmp r0, 0 - bne _0812D8D0 - movs r0, 0xA0 - strh r0, [r4, 0x10] - adds r0, r1, 0 - adds r0, 0x3F - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - movs r1, 0x5 - bl StartSpriteAnimIfDifferent - ldr r0, =0x00000187 - bl PlayFanfare - b _0812D914 - .pool -_0812D8D0: - movs r0, 0xC0 - strh r0, [r4, 0x10] - adds r0, r1, 0 - adds r0, 0x3F - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r4, =gSprites - adds r0, r4 - movs r1, 0x4 - bl StartSpriteAnimIfDifferent - ldr r0, [r5] - adds r0, 0x3F - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - adds r0, 0x2B - strb r6, [r0] - ldr r0, [r5] - ldrb r0, [r0, 0x2] - cmp r0, 0 - beq _0812D90C - bl sub_812D1DC - ldr r0, [r5] - strb r6, [r0, 0x2] -_0812D90C: - movs r0, 0xC3 - lsls r0, 1 - bl PlayFanfare -_0812D914: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812D870 - - thumb_func_start sub_812D920 -sub_812D920: @ 812D920 - push {r4,lr} - adds r4, r0, 0 - ldrh r1, [r4, 0x10] - movs r2, 0x10 - ldrsh r0, [r4, r2] - cmp r0, 0 - beq _0812D938 - subs r0, r1, 0x1 - strh r0, [r4, 0x10] - lsls r0, 16 - cmp r0, 0 - bne _0812D948 -_0812D938: - bl sub_81040C8 - lsls r0, 24 - cmp r0, 0 - bne _0812D948 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_0812D948: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_812D920 - - thumb_func_start sub_812D950 -sub_812D950: @ 812D950 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r1, =gSpriteCoordOffsetX - ldrh r0, [r1] - subs r0, 0x8 - strh r0, [r1] - ldrh r1, [r4, 0xA] - adds r1, 0x8 - strh r1, [r4, 0xA] - ldrh r0, [r4, 0xE] - adds r0, 0x8 - strh r0, [r4, 0xE] - movs r2, 0xA - ldrsh r0, [r4, r2] - subs r0, 0x8 - movs r2, 0xFF - ands r0, r2 - lsrs r5, r0, 3 - ldr r0, =0x000001ff - ands r1, r0 - movs r0, 0x14 - bl SetGpuReg - ldrh r0, [r4, 0xE] - lsls r0, 16 - asrs r0, 19 - cmp r0, 0x19 - bgt _0812D998 - adds r0, r5, 0 - bl sub_812DC50 - b _0812D99E - .pool -_0812D998: - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_0812D99E: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_812D950 - - thumb_func_start sub_812D9A4 -sub_812D9A4: @ 812D9A4 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r4, =sSlotMachine - ldr r0, [r4] - movs r6, 0 - strb r6, [r0, 0xB] - ldr r1, [r4] - ldrb r0, [r1, 0x5] - strb r0, [r1, 0xA] - ldr r0, =gSpriteCoordOffsetX - strh r6, [r0] - movs r0, 0x14 - movs r1, 0 - bl SetGpuReg - ldr r1, [r4] - movs r0, 0x8 - strh r0, [r1, 0x1A] - bl sub_812E3E8 - bl sub_812E82C - bl sub_812E8C4 - ldr r0, [r4] - adds r0, 0x60 - ldrh r0, [r0] - bl PlayNewMapMusic - ldr r0, [r4] - ldrb r0, [r0, 0xA] - cmp r0, 0 - bne _0812DA04 - ldr r0, =sub_812D4EC - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - b _0812DA1A - .pool -_0812DA04: - movs r0, 0x4 - bl sub_8104CAC - bl dp15_jump_random_unknown - strh r0, [r5, 0xA] - strh r6, [r5, 0xC] - strh r6, [r5, 0xE] - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] -_0812DA1A: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_812D9A4 - - thumb_func_start sub_812DA20 -sub_812DA20: @ 812DA20 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r0, =sSlotMachine - ldr r5, [r0] - movs r0, 0x1A - ldrsh r1, [r5, r0] - movs r2, 0xA - ldrsh r0, [r4, r2] - cmp r1, r0 - bne _0812DA40 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - b _0812DA66 - .pool -_0812DA40: - movs r1, 0x1C - ldrsh r0, [r5, r1] - movs r1, 0x18 - bl __modsi3 - lsls r0, 16 - cmp r0, 0 - bne _0812DA66 - ldrh r0, [r4, 0xC] - adds r0, 0x1 - strh r0, [r4, 0xC] - movs r1, 0x7 - ands r0, r1 - cmp r0, 0 - bne _0812DA66 - ldrh r0, [r5, 0x1A] - lsls r0, 16 - asrs r0, 17 - strh r0, [r5, 0x1A] -_0812DA66: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_812DA20 - - thumb_func_start sub_812DA6C -sub_812DA6C: @ 812DA6C - push {lr} - bl sub_8104E18 - lsls r0, 24 - cmp r0, 0 - beq _0812DA86 - ldr r0, =sub_812D4EC - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask -_0812DA86: - pop {r0} - bx r0 - .pool - thumb_func_end sub_812DA6C - - thumb_func_start sub_812DA90 -sub_812DA90: @ 812DA90 - push {r4,r5,lr} - adds r4, r0, 0 - bl sub_812E82C - bl sub_812EA7C - bl sub_812EBCC - bl sub_812EC20 - ldr r5, =gSprites - ldr r3, =sSlotMachine - ldr r0, [r3] - adds r0, 0x4E - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - adds r0, 0x3E - ldrb r1, [r0] - movs r2, 0x4 - orrs r1, r2 - strb r1, [r0] - ldr r0, [r3] - adds r0, 0x3F - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r5 - movs r1, 0x5 - bl StartSpriteAnimIfDifferent - ldrh r0, [r4, 0x8] - adds r0, 0x1 - movs r1, 0 - strh r0, [r4, 0x8] - movs r0, 0x4 - strh r0, [r4, 0x10] - strh r1, [r4, 0x12] - bl StopMapMusic - ldr r0, =0x00000187 - bl PlayFanfare - movs r0, 0xB2 - bl PlaySE - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812DA90 - - thumb_func_start sub_812DB04 -sub_812DB04: @ 812DB04 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r1, =gSpriteCoordOffsetY - ldrh r0, [r4, 0x10] - strh r0, [r1] - ldrh r1, [r4, 0x10] - movs r0, 0x16 - bl SetGpuReg - ldrh r1, [r4, 0x12] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0812DB26 - ldrh r0, [r4, 0x10] - negs r0, r0 - strh r0, [r4, 0x10] -_0812DB26: - ldrh r0, [r4, 0x12] - adds r0, 0x1 - strh r0, [r4, 0x12] - movs r1, 0x1F - ands r0, r1 - cmp r0, 0 - bne _0812DB3C - ldrh r0, [r4, 0x10] - lsls r0, 16 - asrs r0, 17 - strh r0, [r4, 0x10] -_0812DB3C: - movs r0, 0x10 - ldrsh r5, [r4, r0] - cmp r5, 0 - bne _0812DB7A - bl sub_812EC70 - bl sub_812EC94 - bl sub_812E5A8 - bl sub_812EDC0 - ldr r2, =gSprites - ldr r0, =sSlotMachine - ldr r0, [r0] - adds r0, 0x4E - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r2, [r0] - movs r1, 0x5 - negs r1, r1 - ands r1, r2 - strb r1, [r0] - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - strh r5, [r4, 0x12] -_0812DB7A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812DB04 - - thumb_func_start sub_812DB8C -sub_812DB8C: @ 812DB8C - push {r4,lr} - adds r4, r0, 0 - ldr r1, =gSpriteCoordOffsetY - movs r0, 0 - strh r0, [r1] - movs r0, 0x16 - movs r1, 0 - bl SetGpuReg - bl sub_812EEA8 - lsls r0, 24 - cmp r0, 0 - beq _0812DBB2 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - bl sub_812EECC -_0812DBB2: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812DB8C - - thumb_func_start sub_812DBBC -sub_812DBBC: @ 812DBBC - push {lr} - ldr r1, =gSpriteCoordOffsetX - movs r0, 0 - strh r0, [r1] - movs r0, 0x14 - movs r1, 0 - bl SetGpuReg - ldr r0, =sSlotMachine - ldr r0, [r0] - adds r0, 0x60 - ldrh r0, [r0] - bl PlayNewMapMusic - bl sub_812E3E8 - bl sub_812E8F8 - bl sub_812E8C4 - bl sub_812ED8C - ldr r0, =sub_812D4EC - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_812DBBC - - thumb_func_start sub_812DC08 -sub_812DC08: @ 812DC08 - push {r4-r6,lr} - movs r2, 0x4 - lsls r1, 16 - asrs r6, r1, 16 - lsls r0, 16 - asrs r5, r0, 16 -_0812DC14: - lsls r4, r2, 16 - asrs r4, 16 - subs r0, r4, 0x4 - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 2 - adds r1, r6, r1 - lsls r1, 1 - ldr r0, =gUnknown_085A96E0 - adds r1, r0 - lsls r3, r4, 5 - adds r3, r5, r3 - lsls r3, 16 - lsrs r3, 16 - movs r0, 0x1 - movs r2, 0x2 - bl LoadBgTilemap - adds r4, 0x1 - lsls r4, 16 - lsrs r2, r4, 16 - asrs r4, 16 - cmp r4, 0xE - ble _0812DC14 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812DC08 - - thumb_func_start sub_812DC50 -sub_812DC50: @ 812DC50 - push {r4,r5,lr} - movs r4, 0x4 - lsls r0, 16 - asrs r5, r0, 16 -_0812DC58: - lsls r3, r4, 5 - adds r3, r5, r3 - lsls r3, 16 - lsrs r3, 16 - movs r0, 0x1 - ldr r1, =gUnknown_085A9898 - movs r2, 0x2 - bl LoadBgTilemap - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xE - bls _0812DC58 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812DC50 - - thumb_func_start sub_8104AB8 -sub_8104AB8: @ 812DC80 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =sub_812DCD4 - adds r0, r5, 0 - movs r1, 0x1 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r4, [r1, 0xA] - bl _call_via_r5 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104AB8 - - thumb_func_start sub_8104AEC -sub_8104AEC: @ 812DCB4 - push {lr} - ldr r0, =sub_812DCD4 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _0812DCCC - movs r0, 0 - b _0812DCCE - .pool -_0812DCCC: - movs r0, 0x1 -_0812DCCE: - pop {r1} - bx r1 - thumb_func_end sub_8104AEC - - thumb_func_start sub_812DCD4 -sub_812DCD4: @ 812DCD4 - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r3, =gUnknown_085A75D4 - ldr r2, =gTasks - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r2, 0x8 - ldrsh r1, [r0, r2] - lsls r1, 2 - adds r1, r3 - ldr r1, [r1] - bl _call_via_r1 - pop {r0} - bx r0 - .pool - thumb_func_end sub_812DCD4 - - thumb_func_start sub_812DD04 -sub_812DD04: @ 812DD04 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_812DD04 - - thumb_func_start sub_812DD28 -sub_812DD28: @ 812DD28 - push {lr} - adds r2, r0, 0 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0812DD3E - ldrh r0, [r2, 0x8] - adds r0, 0x1 - strh r0, [r2, 0x8] -_0812DD3E: - pop {r0} - bx r0 - .pool - thumb_func_end sub_812DD28 - - thumb_func_start sub_812DD48 -sub_812DD48: @ 812DD48 - push {r4,lr} - adds r4, r0, 0 - bl sub_8104DA4 - bl sub_812FAF4 - ldr r0, =gUnknown_085A7444 - bl AddWindow - movs r0, 0x1 - bl PutWindowTilemap - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812DD48 - - thumb_func_start sub_812DD78 -sub_812DD78: @ 812DD78 - push {r4,r5,lr} - sub sp, 0xC - adds r5, r0, 0 - ldr r0, =gUnknown_085A744C - str r0, [sp] - movs r4, 0 - str r4, [sp, 0x4] - ldr r0, =gText_ReelTimeHelp - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x2 - movs r3, 0x5 - bl AddTextPrinterParameterized3 - movs r0, 0x1 - movs r1, 0x3 - bl CopyWindowToVram - movs r0, 0x1 - negs r0, r0 - str r4, [sp] - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812DD78 - - thumb_func_start sub_812DDC4 -sub_812DDC4: @ 812DDC4 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x6 - ands r0, r1 - cmp r0, 0 - beq _0812DE08 - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x1 - bl ClearWindowTilemap - movs r0, 0x1 - movs r1, 0x1 - bl CopyWindowToVram - movs r0, 0x1 - bl RemoveWindow - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_0812DE08: - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812DDC4 - - thumb_func_start sub_812DE14 -sub_812DE14: @ 812DE14 - push {r4,lr} - adds r4, r0, 0 - bl sub_812F968 - movs r0, 0x3 - bl ShowBg - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_812DE14 - - thumb_func_start sub_812DE30 -sub_812DE30: @ 812DE30 - push {r4,lr} - adds r4, r0, 0 - ldrb r0, [r4, 0xA] - bl sub_8104CAC - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_812DE30 - - thumb_func_start sub_812DE48 -sub_812DE48: @ 812DE48 - push {r4,lr} - sub sp, 0x4 - adds r4, r0, 0 - ldr r0, =sSlotMachine - ldr r0, [r0] - ldrb r0, [r0, 0x2] - bl sub_810423C - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - add sp, 0x4 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812DE48 - - thumb_func_start sub_812DE7C -sub_812DE7C: @ 812DE7C - push {lr} - ldr r0, =sub_812DCD4 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_812DE7C - - thumb_func_start sub_8104C5C -sub_8104C5C: @ 812DE94 - push {lr} - ldr r0, =sub_812E0B0 - movs r1, 0x3 - bl CreateTask - lsls r0, 24 - lsrs r1, r0, 24 - ldr r0, =sSlotMachine - ldr r0, [r0] - adds r0, 0x3D - strb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - ldr r1, =gTasks - adds r0, r1 - ldr r1, =0x0000ffff - strh r1, [r0, 0xA] - movs r1, 0x4 - adds r2, r0, 0 - adds r2, 0x8 - movs r3, 0x40 -_0812DEC0: - lsls r0, r1, 1 - adds r0, r2, r0 - strh r3, [r0] - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0xF - bls _0812DEC0 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104C5C - - thumb_func_start sub_8104CAC -sub_8104CAC: @ 812DEE4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl sub_8104DA4 - ldr r0, =sSlotMachine - ldr r0, [r0] - adds r0, 0x3D - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - ldr r1, =gTasks - adds r7, r0, r1 - strh r4, [r7, 0xA] - movs r6, 0 - ldr r1, =gUnknown_085A7A04 - lsls r5, r4, 2 - adds r0, r5, r1 - ldr r0, [r0] - ldrb r0, [r0] - cmp r0, 0xFF - beq _0812DF52 - mov r8, r1 -_0812DF1A: - mov r0, r8 - adds r4, r5, r0 - ldr r0, [r4] - lsls r2, r6, 2 - adds r2, r0 - ldrb r0, [r2] - ldrb r1, [r2, 0x1] - movs r3, 0x2 - ldrsh r2, [r2, r3] - bl sub_812EF98 - lsls r0, 24 - lsrs r0, 24 - adds r2, r6, 0x4 - lsls r2, 1 - adds r1, r7, 0 - adds r1, 0x8 - adds r1, r2 - strh r0, [r1] - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - ldr r1, [r4] - lsls r0, r6, 2 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0xFF - bne _0812DF1A -_0812DF52: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104CAC - - thumb_func_start sub_812DF68 -sub_812DF68: @ 812DF68 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - mov r8, r1 - ldr r4, [sp, 0x1C] - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =sSlotMachine - ldr r0, [r0] - adds r0, 0x3D - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - ldr r1, =gTasks - adds r0, r1 - mov r12, r0 - movs r5, 0x4 - lsls r4, 16 - asrs r6, r4, 16 - lsls r2, 16 - lsls r3, 16 -_0812DF96: - lsls r0, r5, 1 - mov r1, r12 - adds r1, 0x8 - adds r4, r1, r0 - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0x40 - bne _0812DFC4 - str r6, [sp] - adds r0, r7, 0 - mov r1, r8 - asrs r2, 16 - asrs r3, 16 - bl sub_812EFDC - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4] - b _0812DFCE - .pool -_0812DFC4: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0xF - bls _0812DF96 -_0812DFCE: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_812DF68 - - thumb_func_start sub_8104DA4 -sub_8104DA4: @ 812DFDC - push {r4-r6,lr} - ldr r0, =sSlotMachine - ldr r0, [r0] - adds r0, 0x3D - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - ldr r1, =gTasks - adds r4, r0, r1 - ldrh r1, [r4, 0xA] - ldr r0, =0x0000ffff - cmp r1, r0 - beq _0812E008 - ldr r0, =gUnknown_085A7A20 - movs r2, 0xA - ldrsh r1, [r4, r2] - lsls r1, 2 - adds r1, r0 - ldr r0, [r1] - bl _call_via_r0 -_0812E008: - movs r5, 0x4 - adds r6, r4, 0 - adds r6, 0x8 -_0812E00E: - lsls r0, r5, 1 - adds r4, r6, r0 - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0x40 - beq _0812E02E - adds r1, r0, 0 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - bl DestroySprite - movs r0, 0x40 - strh r0, [r4] -_0812E02E: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0xF - bls _0812E00E - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104DA4 - - thumb_func_start sub_8104E18 -sub_8104E18: @ 812E054 - push {r4,r5,lr} - ldr r0, =sSlotMachine - ldr r0, [r0] - adds r0, 0x3D - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - ldr r1, =gTasks - adds r0, r1 - movs r2, 0x4 - adds r3, r0, 0 - adds r3, 0x8 - ldr r4, =gSprites -_0812E070: - lsls r0, r2, 1 - adds r1, r3, r0 - movs r5, 0 - ldrsh r0, [r1, r5] - cmp r0, 0x40 - beq _0812E09C - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - movs r5, 0x3C - ldrsh r0, [r1, r5] - cmp r0, 0 - beq _0812E09C - movs r0, 0 - b _0812E0A8 - .pool -_0812E09C: - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0xF - bls _0812E070 - movs r0, 0x1 -_0812E0A8: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8104E18 - - thumb_func_start sub_812E0B0 -sub_812E0B0: @ 812E0B0 - push {lr} - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r3, =gUnknown_085A7610 - ldr r2, =gTasks - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 3 - adds r0, r2 - movs r2, 0x8 - ldrsh r1, [r0, r2] - lsls r1, 2 - adds r1, r3 - ldr r1, [r1] - bl _call_via_r1 - pop {r0} - bx r0 - .pool - thumb_func_end sub_812E0B0 - - thumb_func_start nullsub_51 -nullsub_51: @ 812E0E0 - bx lr - thumb_func_end nullsub_51 - - thumb_func_start sub_8104EA8 -sub_8104EA8: @ 812E0E4 - push {r4-r7,lr} - movs r6, 0 - movs r0, 0x30 -_0812E0EA: - movs r4, 0 - lsls r5, r0, 16 - lsls r7, r6, 16 -_0812E0F0: - ldr r0, =gUnknown_085A7CE0 - asrs r1, r5, 16 - movs r2, 0 - movs r3, 0xE - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =gSprites - adds r1, r0 - ldrb r0, [r1, 0x5] - movs r2, 0xC - orrs r0, r2 - strb r0, [r1, 0x5] - strh r6, [r1, 0x2E] - strh r4, [r1, 0x30] - ldr r0, =0x0000ffff - strh r0, [r1, 0x34] - lsls r0, r4, 16 - movs r1, 0xC0 - lsls r1, 13 - adds r0, r1 - lsrs r4, r0, 16 - asrs r0, 16 - cmp r0, 0x77 - ble _0812E0F0 - movs r2, 0x80 - lsls r2, 9 - adds r1, r7, r2 - movs r2, 0xA0 - lsls r2, 14 - adds r0, r5, r2 - lsrs r0, 16 - lsrs r6, r1, 16 - asrs r1, 16 - cmp r1, 0x2 - ble _0812E0EA - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104EA8 - - thumb_func_start sub_812E154 -sub_812E154: @ 812E154 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, =sSlotMachine - ldr r4, [r0] - movs r1, 0x2E - ldrsh r0, [r5, r1] - lsls r0, 1 - adds r1, r4, 0 - adds r1, 0x1C - adds r1, r0 - ldrh r0, [r5, 0x30] - ldrh r1, [r1] - adds r0, r1 - strh r0, [r5, 0x32] - movs r2, 0x32 - ldrsh r0, [r5, r2] - movs r1, 0x78 - bl __modsi3 - strh r0, [r5, 0x32] - movs r2, 0x2E - ldrsh r1, [r5, r2] - lsls r1, 1 - adds r4, 0x22 - adds r4, r1 - ldrh r1, [r4] - adds r1, 0x1C - adds r0, r1 - strh r0, [r5, 0x22] - ldrh r4, [r5, 0x2E] - lsls r4, 24 - lsrs r4, 24 - movs r1, 0x32 - ldrsh r0, [r5, r1] - movs r1, 0x18 - bl __divsi3 - adds r1, r0, 0 - lsls r1, 16 - asrs r1, 16 - adds r0, r4, 0 - bl GetTagOfReelSymbolOnScreenAtPos - lsls r0, 24 - lsrs r0, 24 - bl GetSpriteTileStartByTag - adds r1, r5, 0 - adds r1, 0x40 - strh r0, [r1] - adds r0, r5, 0 - bl SetSpriteSheetFrameTileNum - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812E154 - - thumb_func_start sub_8104F8C -sub_8104F8C: @ 812E1C8 - push {r4-r6,lr} - movs r4, 0xCB - movs r5, 0x1 - ldr r6, =0x0000270f -_0812E1D0: - lsls r4, 16 - asrs r4, 16 - lsls r5, 16 - asrs r5, 16 - adds r0, r4, 0 - movs r1, 0x17 - movs r2, 0 - adds r3, r5, 0 - bl sub_812E230 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 17 - subs r4, 0x7 - lsls r4, 16 - lsrs r4, 16 - lsrs r5, r0, 16 - asrs r0, 16 - cmp r0, r6 - ble _0812E1D0 - movs r4, 0xEB - movs r5, 0x1 - ldr r6, =0x0000270f -_0812E1FE: - lsls r4, 16 - asrs r4, 16 - lsls r5, 16 - asrs r5, 16 - adds r0, r4, 0 - movs r1, 0x17 - movs r2, 0x1 - adds r3, r5, 0 - bl sub_812E230 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 17 - subs r4, 0x7 - lsls r4, 16 - lsrs r4, 16 - lsrs r5, r0, 16 - asrs r0, 16 - cmp r0, r6 - ble _0812E1FE - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8104F8C - - thumb_func_start sub_812E230 -sub_812E230: @ 812E230 - push {r4-r6,lr} - mov r6, r8 - push {r6} - adds r5, r0, 0 - adds r6, r1, 0 - mov r8, r2 - adds r4, r3, 0 - mov r0, r8 - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r4, 16 - lsrs r4, 16 - ldr r0, =gUnknown_085A7CF8 - lsls r5, 16 - asrs r5, 16 - lsls r6, 16 - asrs r6, 16 - adds r1, r5, 0 - adds r2, r6, 0 - movs r3, 0xD - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - lsls r2, r0, 4 - adds r2, r0 - lsls r2, 2 - ldr r0, =gSprites - adds r2, r0 - ldrb r1, [r2, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - movs r1, 0x8 - orrs r0, r1 - strb r0, [r2, 0x5] - mov r0, r8 - strh r0, [r2, 0x2E] - strh r4, [r2, 0x30] - lsls r4, 16 - asrs r4, 16 - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 1 - strh r0, [r2, 0x32] - ldr r0, =0x0000ffff - strh r0, [r2, 0x34] - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812E230 - - thumb_func_start sub_812E2A8 -sub_812E2A8: @ 812E2A8 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =sSlotMachine - ldr r1, [r0] - ldrh r2, [r1, 0xC] - movs r3, 0x2E - ldrsh r0, [r4, r3] - cmp r0, 0 - beq _0812E2BC - ldrh r2, [r1, 0xE] -_0812E2BC: - movs r1, 0x34 - ldrsh r0, [r4, r1] - cmp r0, r2 - beq _0812E2F6 - strh r2, [r4, 0x34] - ldrh r1, [r4, 0x32] - adds r0, r2, 0 - bl __umodsi3 - lsls r0, 16 - lsrs r2, r0, 16 - ldrh r1, [r4, 0x30] - adds r0, r2, 0 - bl __udivsi3 - lsls r0, 16 - movs r3, 0xE0 - lsls r3, 11 - adds r0, r3 - lsrs r2, r0, 16 - adds r0, r2, 0 - bl GetSpriteTileStartByTag - adds r1, r4, 0 - adds r1, 0x40 - strh r0, [r1] - adds r0, r4, 0 - bl SetSpriteSheetFrameTileNum -_0812E2F6: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_812E2A8 - - thumb_func_start sub_81050C4 -sub_81050C4: @ 812E300 - push {lr} - ldr r0, =gUnknown_085A7D10 - movs r1, 0x58 - movs r2, 0x48 - movs r3, 0xF - bl CreateSprite - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gSprites - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - ldrb r1, [r0, 0x5] - movs r2, 0xC - orrs r1, r2 - strb r1, [r0, 0x5] - ldr r1, =gUnknown_085A7FC0 - bl SetSubspriteTables - pop {r0} - bx r0 - .pool - thumb_func_end sub_81050C4 - - thumb_func_start sub_812E33C -sub_812E33C: @ 812E33C + + thumb_func_start sub_8105100 +sub_8105100: @ 812E33C push {r4,r5,lr} sub sp, 0x18 ldr r4, =gUnknown_0203AAE4 @@ -5280,7 +44,7 @@ _0812E350: str r1, [r2, 0x20] strh r3, [r2, 0x24] mov r1, sp - ldr r0, =gUnknown_085A7D28 + ldr r0, =gSpriteTemplate_83ED45C ldm r0!, {r3-r5} stm r1!, {r3-r5} ldm r0!, {r3-r5} @@ -5320,10 +84,10 @@ _0812E350: pop {r0} bx r0 .pool - thumb_func_end sub_812E33C + thumb_func_end sub_8105100 - thumb_func_start sub_812E3E8 -sub_812E3E8: @ 812E3E8 + thumb_func_start sub_810514C +sub_810514C: @ 812E3E8 push {r4,lr} ldr r0, =sSlotMachine ldr r0, [r0] @@ -5347,7 +111,7 @@ _0812E410: pop {r0} bx r0 .pool - thumb_func_end sub_812E3E8 + thumb_func_end sub_810514C thumb_func_start sub_812E424 sub_812E424: @ 812E424 @@ -5394,8 +158,8 @@ _0812E46A: .pool thumb_func_end sub_812E424 - thumb_func_start sub_812E474 -sub_812E474: @ 812E474 + thumb_func_start sub_81051C0 +sub_81051C0: @ 812E474 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -5528,10 +292,10 @@ _0812E510: pop {r0} bx r0 .pool - thumb_func_end sub_812E474 + thumb_func_end sub_81051C0 - thumb_func_start sub_812E5A8 -sub_812E5A8: @ 812E5A8 + thumb_func_start sub_8105284_ +sub_8105284_: @ 812E5A8 push {r4,r5,lr} sub sp, 0x18 ldr r4, =gUnknown_0203AAF0 @@ -5601,10 +365,10 @@ _0812E5BC: pop {r0} bx r0 .pool - thumb_func_end sub_812E5A8 + thumb_func_end sub_8105284_ - thumb_func_start sub_812E650 -sub_812E650: @ 812E650 + thumb_func_start sub_81052EC +sub_81052EC: @ 812E650 push {r4-r6,lr} movs r4, 0 movs r5, 0 @@ -5658,10 +422,10 @@ _0812E656: pop {r0} bx r0 .pool - thumb_func_end sub_812E650 + thumb_func_end sub_81052EC - thumb_func_start sub_812E6C4 -sub_812E6C4: @ 812E6C4 + thumb_func_start sub_810535C +sub_810535C: @ 812E6C4 push {r4,lr} adds r4, r0, 0 ldr r0, =sSlotMachine @@ -5682,7 +446,7 @@ sub_812E6C4: @ 812E6C4 bl __divsi3 lsls r0, 16 asrs r0, 16 - bl sub_812BCE8 + bl sub_8102C48 adds r1, r0, 0 lsls r1, 24 lsrs r1, 24 @@ -5692,10 +456,10 @@ sub_812E6C4: @ 812E6C4 pop {r0} bx r0 .pool - thumb_func_end sub_812E6C4 + thumb_func_end sub_810535C - thumb_func_start sub_812E70C -sub_812E70C: @ 812E70C + thumb_func_start sub_81053A0 +sub_81053A0: @ 812E70C push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -5780,10 +544,10 @@ sub_812E70C: @ 812E70C pop {r0} bx r0 .pool - thumb_func_end sub_812E70C + thumb_func_end sub_81053A0 - thumb_func_start sub_812E7CC -sub_812E7CC: @ 812E7CC + thumb_func_start sub_810545C +sub_810545C: @ 812E7CC push {r4,lr} ldr r0, =gUnknown_085A7DB8 movs r1, 0xB8 @@ -5822,10 +586,10 @@ sub_812E7CC: @ 812E7CC pop {r0} bx r0 .pool - thumb_func_end sub_812E7CC + thumb_func_end sub_810545C - thumb_func_start sub_812E82C -sub_812E82C: @ 812E82C + thumb_func_start sub_81054B8 +sub_81054B8: @ 812E82C push {r4,lr} ldr r0, =sSlotMachine ldr r0, [r0] @@ -5893,10 +657,10 @@ _0812E88A: pop {r0} bx r0 .pool - thumb_func_end sub_812E82C + thumb_func_end sub_81054B8 - thumb_func_start sub_812E8C4 -sub_812E8C4: @ 812E8C4 + thumb_func_start sub_8105524 +sub_8105524: @ 812E8C4 push {r4,lr} movs r4, 0 _0812E8C8: @@ -5920,10 +684,10 @@ _0812E8C8: pop {r0} bx r0 .pool - thumb_func_end sub_812E8C4 + thumb_func_end sub_8105524 - thumb_func_start sub_812E8F8 -sub_812E8F8: @ 812E8F8 + thumb_func_start sub_8105554 +sub_8105554: @ 812E8F8 push {r4,lr} ldr r0, =sSlotMachine ldr r0, [r0] @@ -5947,10 +711,10 @@ _0812E920: pop {r0} bx r0 .pool - thumb_func_end sub_812E8F8 + thumb_func_end sub_8105554 - thumb_func_start sub_812E934 -sub_812E934: @ 812E934 + thumb_func_start sub_8105578 +sub_8105578: @ 812E934 push {r4-r6,lr} mov r6, r10 mov r5, r9 @@ -6032,7 +796,7 @@ sub_812E934: @ 812E934 pop {r0} bx r0 .pool - thumb_func_end sub_812E934 + thumb_func_end sub_8105578 thumb_func_start sub_812E9E8 sub_812E9E8: @ 812E9E8 @@ -6086,8 +850,8 @@ _0812EA3E: bx r0 thumb_func_end sub_812E9E8 - thumb_func_start sub_812EA44 -sub_812EA44: @ 812EA44 + thumb_func_start sub_8105688 +sub_8105688: @ 812EA44 push {r4,lr} lsls r0, 16 lsrs r0, 16 @@ -6113,10 +877,10 @@ sub_812EA44: @ 812EA44 pop {r0} bx r0 .pool - thumb_func_end sub_812EA44 + thumb_func_end sub_8105688 - thumb_func_start sub_812EA7C -sub_812EA7C: @ 812EA7C + thumb_func_start sub_81056C0 +sub_81056C0: @ 812EA7C push {r4,lr} movs r4, 0 _0812EA80: @@ -6140,10 +904,10 @@ _0812EA80: pop {r0} bx r0 .pool - thumb_func_end sub_812EA7C + thumb_func_end sub_81056C0 - thumb_func_start sub_812EAB0 -sub_812EAB0: @ 812EAB0 + thumb_func_start sub_81056F0 +sub_81056F0: @ 812EAB0 push {r4-r6,lr} mov r6, r9 mov r5, r8 @@ -6212,7 +976,7 @@ sub_812EAB0: @ 812EAB0 pop {r0} bx r0 .pool - thumb_func_end sub_812EAB0 + thumb_func_end sub_81056F0 thumb_func_start sub_812EB48 sub_812EB48: @ 812EB48 @@ -6262,8 +1026,8 @@ _0812EB9A: .pool thumb_func_end sub_812EB48 - thumb_func_start sub_812EBAC -sub_812EBAC: @ 812EBAC + thumb_func_start sub_81057E8 +sub_81057E8: @ 812EBAC ldr r3, =gSprites ldr r1, =sSlotMachine ldr r1, [r1] @@ -6276,10 +1040,10 @@ sub_812EBAC: @ 812EBAC strh r0, [r1, 0x3C] bx lr .pool - thumb_func_end sub_812EBAC + thumb_func_end sub_81057E8 - thumb_func_start sub_812EBCC -sub_812EBCC: @ 812EBCC + thumb_func_start sub_8105804 +sub_8105804: @ 812EBCC push {r4,lr} movs r0, 0x7 bl IndexOfSpritePaletteTag @@ -6314,10 +1078,10 @@ _0812EBEA: pop {r0} bx r0 .pool - thumb_func_end sub_812EBCC + thumb_func_end sub_8105804 - thumb_func_start sub_812EC20 -sub_812EC20: @ 812EC20 + thumb_func_start sub_8105854 +sub_8105854: @ 812EC20 push {lr} ldr r0, =gUnknown_085A7E00 movs r1, 0xA8 @@ -6345,7 +1109,7 @@ sub_812EC20: @ 812EC20 pop {r0} bx r0 .pool - thumb_func_end sub_812EC20 + thumb_func_end sub_8105854 thumb_func_start sub_812EC64 sub_812EC64: @ 812EC64 @@ -6356,8 +1120,8 @@ sub_812EC64: @ 812EC64 .pool thumb_func_end sub_812EC64 - thumb_func_start sub_812EC70 -sub_812EC70: @ 812EC70 + thumb_func_start sub_81058A0 +sub_81058A0: @ 812EC70 push {lr} ldr r0, =sSlotMachine ldr r0, [r0] @@ -6372,10 +1136,10 @@ sub_812EC70: @ 812EC70 pop {r0} bx r0 .pool - thumb_func_end sub_812EC70 + thumb_func_end sub_81058A0 - thumb_func_start sub_812EC94 -sub_812EC94: @ 812EC94 + thumb_func_start sub_81058C4 +sub_81058C4: @ 812EC94 push {r4,r5,lr} sub sp, 0x8 ldr r1, =gUnknown_085A7616 @@ -6436,7 +1200,7 @@ _0812ECA4: pop {r0} bx r0 .pool - thumb_func_end sub_812EC94 + thumb_func_end sub_81058C4 thumb_func_start sub_812ED20 sub_812ED20: @ 812ED20 @@ -6495,8 +1259,8 @@ _0812ED84: bx r0 thumb_func_end sub_812ED20 - thumb_func_start sub_812ED8C -sub_812ED8C: @ 812ED8C + thumb_func_start sub_81059B8 +sub_81059B8: @ 812ED8C push {r4,lr} movs r4, 0 _0812ED90: @@ -6520,10 +1284,10 @@ _0812ED90: pop {r0} bx r0 .pool - thumb_func_end sub_812ED8C + thumb_func_end sub_81059B8 - thumb_func_start sub_812EDC0 -sub_812EDC0: @ 812EDC0 + thumb_func_start sub_81059E8 +sub_81059E8: @ 812EDC0 push {r4,lr} ldr r0, =gUnknown_085A7E30 movs r1, 0xA8 @@ -6558,7 +1322,7 @@ sub_812EDC0: @ 812EDC0 pop {r0} bx r0 .pool - thumb_func_end sub_812EDC0 + thumb_func_end sub_81059E8 thumb_func_start sub_812EE14 sub_812EE14: @ 812EE14 @@ -6640,8 +1404,8 @@ _0812EE90: bx r0 thumb_func_end sub_812EE14 - thumb_func_start sub_812EEA8 -sub_812EEA8: @ 812EEA8 + thumb_func_start sub_8105ACC +sub_8105ACC: @ 812EEA8 ldr r2, =gSprites ldr r0, =sSlotMachine ldr r0, [r0] @@ -6656,10 +1420,10 @@ sub_812EEA8: @ 812EEA8 lsrs r0, 24 bx lr .pool - thumb_func_end sub_812EEA8 + thumb_func_end sub_8105ACC - thumb_func_start sub_812EECC -sub_812EECC: @ 812EECC + thumb_func_start sub_8105AEC +sub_8105AEC: @ 812EECC push {r4,lr} ldr r0, =sSlotMachine ldr r0, [r0] @@ -6680,10 +1444,10 @@ sub_812EECC: @ 812EECC pop {r0} bx r0 .pool - thumb_func_end sub_812EECC + thumb_func_end sub_8105AEC - thumb_func_start sub_812EF00 -sub_812EF00: @ 812EF00 + thumb_func_start sub_8105B1C +sub_8105B1C: @ 812EF00 push {r4,lr} adds r3, r0, 0 adds r2, r1, 0 @@ -6720,7 +1484,7 @@ sub_812EF00: @ 812EF00 pop {r1} bx r1 .pool - thumb_func_end sub_812EF00 + thumb_func_end sub_8105B1C thumb_func_start sub_812EF54 sub_812EF54: @ 812EF54 @@ -6739,8 +1503,8 @@ _0812EF68: bx r0 thumb_func_end sub_812EF54 - thumb_func_start sub_812EF6C -sub_812EF6C: @ 812EF6C + thumb_func_start sub_8105B88 +sub_8105B88: @ 812EF6C push {r4,lr} lsls r0, 24 lsrs r0, 24 @@ -6759,10 +1523,10 @@ sub_812EF6C: @ 812EF6C pop {r0} bx r0 .pool - thumb_func_end sub_812EF6C + thumb_func_end sub_8105B88 - thumb_func_start sub_812EF98 -sub_812EF98: @ 812EF98 + thumb_func_start sub_8105BB4 +sub_8105BB4: @ 812EF98 push {r4-r6,lr} sub sp, 0x4 lsls r0, 24 @@ -6785,7 +1549,7 @@ sub_812EF98: @ 812EF98 str r2, [sp] adds r1, r5, 0 adds r2, r4, 0 - bl sub_812EFDC + bl sub_8105BF8 lsls r0, 24 lsrs r0, 24 add sp, 0x4 @@ -6793,10 +1557,10 @@ sub_812EF98: @ 812EF98 pop {r1} bx r1 .pool - thumb_func_end sub_812EF98 + thumb_func_end sub_8105BB4 - thumb_func_start sub_812EFDC -sub_812EFDC: @ 812EFDC + thumb_func_start sub_8105BF8 +sub_8105BF8: @ 812EFDC push {r4-r7,lr} mov r7, r9 mov r6, r8 @@ -6866,7 +1630,7 @@ _0812F056: pop {r1} bx r1 .pool - thumb_func_end sub_812EFDC + thumb_func_end sub_8105BF8 thumb_func_start sub_812F078 sub_812F078: @ 812F078 @@ -7762,7 +2526,7 @@ _0812F6E0: movs r0, 0x5 movs r2, 0xD0 movs r3, 0x74 - bl sub_812DF68 + bl sub_8104D30 ldr r2, [r6] adds r1, r2, 0 adds r1, 0x58 @@ -8194,8 +2958,8 @@ _0812FA32: .pool thumb_func_end sub_812F980 - thumb_func_start sub_812FA78 -sub_812FA78: @ 812FA78 + thumb_func_start sub_81065A8 +sub_81065A8: @ 812FA78 push {r4-r6,lr} adds r4, r0, 0 ldr r5, [sp, 0x10] @@ -8249,10 +3013,10 @@ sub_812FA78: @ 812FA78 pop {r0} bx r0 .pool - thumb_func_end sub_812FA78 + thumb_func_end sub_81065A8 - thumb_func_start sub_812FAF4 -sub_812FAF4: @ 812FAF4 + thumb_func_start sub_81065DC +sub_81065DC: @ 812FAF4 push {lr} ldr r1, =gUnknown_08DCEC70 movs r2, 0xA0 @@ -8265,7 +3029,7 @@ sub_812FAF4: @ 812FAF4 pop {r0} bx r0 .pool - thumb_func_end sub_812FAF4 + thumb_func_end sub_81065DC thumb_func_start SlotMachineSetup_9_0 SlotMachineSetup_9_0: @ 812FB14 diff --git a/data/slot_machine.s b/data/slot_machine.s index 0896d6348..bbbba9652 100644 --- a/data/slot_machine.s +++ b/data/slot_machine.s @@ -4,173 +4,6 @@ .section .rodata .align 2, 0 -gUnknown_085A7424:: @ 85A7424 - .4byte 0x1F8 - .4byte 0x11C5 - .4byte 0x21D6 - .4byte 0x11E7 - -gUnknown_085A7434:: @ 85A7434 - window_template 0, 2, 15, 0x1B, 4, 15, 0x194 - null_window_template - -gUnknown_085A7444:: @ 85A7444 - window_template 0, 1, 3, 20, 13, 13, 1 - -gUnknown_085A744C:: @ 85A744C - .byte 3, 1, 2, 0 - -gUnknown_083ECAAC:: @ 85A7450 - .4byte sub_8101D5C - .4byte sub_8101D8C - .4byte sub_8101DB0 - .4byte sub_8101DF4 - .4byte sub_8101E10 - .4byte sub_8101E3C - .4byte sub_8101F44 - .4byte sub_8101F60 - .4byte sub_8101F88 - .4byte sub_8101FA4 - .4byte sub_8102008 - .4byte sub_8102034 - .4byte sub_8102058 - .4byte sub_8102090 - .4byte sub_81020C8 - .4byte sub_81021E0 - .4byte sub_81021FC - .4byte sub_8102264 - .4byte sub_81022A0 - .4byte sub_81022CC - .4byte sub_81022F0 - .4byte sub_8102318 - .4byte sub_8102344 - .4byte sub_810239C - .4byte sub_81023B8 - .4byte sub_81023E0_ - .4byte sub_81023FC - .4byte sub_8102424 - .4byte sub_8102460 - -gUnknown_085A74C4:: @ 85A74C4 - .4byte sub_812BB34 - .4byte sub_812BB68 - .4byte sub_812BC20 - -gUnknown_085A74D0:: @ 85A74D0 - .4byte sub_812BF64 - .4byte sub_812BF68 - .4byte sub_812BF88 - .4byte sub_812C01C - .4byte sub_812C0E0 - -gUnknown_085A74E4:: @ 85A74E4 - .4byte sub_812C138 - .4byte sub_812C3A0 - .4byte sub_812C4BC - -gUnknown_085A74F0:: @ 85A74F0 - .4byte sub_812C5DC - .4byte sub_812C628 - .4byte sub_812C8FC - -gUnknown_085A74FC:: @ 85A74FC - .2byte 2, 4, 4, 4, 8, 0 - -gUnknown_085A7508:: @ 85A7508 - .4byte sub_812C238 - .4byte sub_812C290 - .4byte sub_812C290 - -gUnknown_085A7514:: @ 85A7514 - .4byte sub_812C3C8 - .4byte sub_812C3C8 - .4byte sub_812C414 - -gUnknown_085A7520:: @ 85A7520 - .4byte sub_812C500 - .4byte sub_812C500 - .4byte sub_812C55C - -gUnknown_085A752C:: @ 85A752C - .4byte sub_812C64C - .4byte j5_08111E84 - .4byte sub_812C74C - -gUnknown_085A7538:: @ 85A7538 - .4byte sub_812C920 - .4byte sub_812CA08 - .4byte sub_812CB80 - -gUnknown_085A7544:: @ 85A7544 - .4byte sub_812CDA4 - .4byte sub_812CDD8 - .4byte sub_812CDF4 - -gUnknown_085A7550:: @ 85A7550 - .2byte 5, 10, 15, 0 - -gUnknown_085A7558:: @ 85A7558 - .4byte nullsub_50 - .4byte sub_812D264 - .4byte sub_812D28C - .4byte sub_812D30C - -gUnknown_085A7568:: @ 85A7568 - .2byte 0x9E - -gUnknown_085A756A:: @ 85A756A - .2byte 0x6E, 0x9F, 0x6F, 0xAF, 0x7F - -gUnknown_085A7574:: @ 85A7574 - .4byte sub_812D51C - .4byte sub_812D594 - .4byte sub_812D60C - .4byte sub_812D63C - .4byte sub_812D6EC - .4byte sub_812D740 - .4byte sub_812D774 - .4byte sub_812D7E4 - .4byte sub_812D870 - .4byte sub_812D920 - .4byte sub_812D950 - .4byte sub_812D9A4 - .4byte sub_812DA20 - .4byte sub_812DA6C - .4byte sub_812DA90 - .4byte sub_812DB04 - .4byte sub_812DB8C - .4byte sub_812D950 - .4byte sub_812DBBC - -gUnknown_085A75C0:: @ 85A75C0 - .byte 1, 1, 2, 2 - -gUnknown_085A75C4:: @ 85A75C4 - .2byte 0x40, 0x30, 0x18, 8 - -gUnknown_085A75CC:: @ 85A75CC - .2byte 10, 8, 6, 4 - -gUnknown_085A75D4:: @ 85A75D4 - .4byte sub_812DD04 - .4byte sub_812DD28 - .4byte sub_812DD48 - .4byte sub_812DD28 - .4byte sub_812DD78 - .4byte sub_812DD28 - .4byte sub_812DDC4 - .4byte sub_812DD28 - .4byte sub_812DE14 - .4byte sub_812DD28 - .4byte sub_812DE30 - .4byte sub_812DD28 - .4byte sub_812DE48 - .4byte sub_812DD28 - .4byte sub_812DE7C - -gUnknown_085A7610:: @ 85A7610 - .4byte nullsub_51 - gUnknown_085A7614:: @ 85A7614 .2byte 16 @@ -195,12 +28,12 @@ gUnknown_085A764E:: @ 85A764E gUnknown_085A765E:: @ 85A765E .2byte 0xA0, 0xC0, 0xE0, 0x68, 0x50, 0x40, 0x30, 0x18 -gUnknown_085A766E:: @ 85A766E +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_085A76AD:: @ 85A76AD +gUnknown_083ECCF1:: @ 85A76AD .byte 1, 0, 5, 4, 3, 2, 0 gUnknown_083ECCF8:: @ 85A76B4 @@ -505,7 +338,7 @@ gUnknown_085A79DC:: @ 85A79DC .byte 0 .2byte 0 -gUnknown_085A7A04:: @ 85A7A04 +gUnknown_083ED048:: @ 85A7A04 .4byte gUnknown_085A7954 .4byte gUnknown_085A7964 .4byte gUnknown_085A7980 @@ -514,7 +347,7 @@ gUnknown_085A7A04:: @ 85A7A04 .4byte gUnknown_085A79DC .4byte gUnknown_085A79B4 -gUnknown_085A7A20:: @ 85A7A20 +gUnknown_083ED064:: @ 85A7A20 .4byte sub_812F7C0 .4byte sub_812F784 .4byte sub_812F794 @@ -820,16 +653,16 @@ gUnknown_085A7C8C:: @ 85A7C8C gUnknown_085A7CDC:: @ 85A7CDC .4byte gUnknown_085A7C8C -gUnknown_085A7CE0:: @ 85A7CE0 - spr_template 0, 0, gUnknown_085A7A5C, gUnknown_085A7BF8, NULL, gDummySpriteAffineAnimTable, sub_812E154 +gSpriteTemplate_83ED414:: @ 85A7CE0 + spr_template 0, 0, gUnknown_085A7A5C, gUnknown_085A7BF8, NULL, gDummySpriteAffineAnimTable, sub_8104F18 -gUnknown_085A7CF8:: @ 85A7CF8 - spr_template 7, 4, gUnknown_085A7A44, gUnknown_085A7BF8, NULL, gDummySpriteAffineAnimTable, sub_812E2A8 +gSpriteTemplate_83ED42C:: @ 85A7CF8 + spr_template 7, 4, gUnknown_085A7A44, gUnknown_085A7BF8, NULL, gDummySpriteAffineAnimTable, sub_810506C -gUnknown_085A7D10:: @ 85A7D10 +gSpriteTemplate_83ED444:: @ 85A7D10 spr_template 17, 0, gUnknown_085A7A74, gUnknown_085A7BF8, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy -gUnknown_085A7D28:: @ 85A7D28 +gSpriteTemplate_83ED45C:: @ 85A7D28 spr_template 0xFFFF, 1, gUnknown_085A7A74, gUnknown_085A7C00, NULL, gDummySpriteAffineAnimTable, sub_812E424 gUnknown_085A7D40:: @ 85A7D40 @@ -842,7 +675,7 @@ gUnknown_085A7D70:: @ 85A7D70 spr_template 0xFFFF, 3, gUnknown_085A7A44, gUnknown_085A7BF8, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy gUnknown_085A7D88:: @ 85A7D88 - spr_template 0xFFFF, 4, gUnknown_085A7A4C, gUnknown_085A7C18, gUnknown_085A7A7C, gDummySpriteAffineAnimTable, sub_812E6C4 + spr_template 0xFFFF, 4, gUnknown_085A7A4C, gUnknown_085A7C18, gUnknown_085A7A7C, gDummySpriteAffineAnimTable, sub_810535C gUnknown_085A7DA0:: @ 85A7DA0 spr_template 0xFFFF, 4, gUnknown_085A7A4C, gUnknown_085A7BF8, gUnknown_085A7AAC, gDummySpriteAffineAnimTable, SpriteCallbackDummy @@ -916,7 +749,7 @@ gUnknown_085A7FB0:: @ 85A7FB0 subsprite -64, 0, 3, 0, 64x64 subsprite 0, 0, 3, 0, 64x64 -gUnknown_085A7FC0:: @ 85A7FC0 +gSubspriteTables_83ED704:: @ 85A7FC0 .4byte 4, gUnknown_085A7FB0 gUnknown_085A7FC8:: @ 85A7FC8 @@ -1272,29 +1105,29 @@ gUnknown_085A8402:: @ 85A8402 gUnknown_085A8404:: @ 85A8404 .byte 0xBF, 0x4A, 0, 0 -gUnknown_085A8408:: @ 85A8408 +gUnknown_083EDD08:: @ 85A8408 .4byte gUnknown_085A83FC .4byte gUnknown_085A83FE .4byte gUnknown_085A8400 .4byte gUnknown_085A8402 .4byte gUnknown_085A8404 -gUnknown_085A841C:: @ 85A841C +gUnknown_083EDD1C:: @ 85A841C .4byte gSlotMachineMenu_Pal + 0x94 .4byte gSlotMachineMenu_Pal + 0x96 .4byte gSlotMachineMenu_Pal + 0x98 .4byte gSlotMachineMenu_Pal + 0x9A .4byte gSlotMachineMenu_Pal + 0x9C -gUnknown_085A8430:: @ 85A8430 +gUnknown_083EDD30:: @ 85A8430 .byte 0x4A, 0x4B, 0x4C, 0x4E, 0x4D -gUnknown_085A8435:: @ 85A8435 +gUnknown_083EDD35:: @ 85A8435 .byte 0, 0 .byte 1, 2 .byte 3, 4 -gUnknown_085A843B:: @ 85A843B +gUnknown_083EDD3B:: @ 85A843B .byte 1, 2, 2 gUnknown_085A843E:: @ 85A843E @@ -1307,12 +1140,12 @@ gUnknown_085A847E:: @ 85A847E .incbin "graphics/slot_machine/85A847E.gbapal" .align 2 -gUnknown_085A84A0:: @ 85A84A0 +gUnknown_083EDDA0:: @ 85A84A0 .4byte gUnknown_085A843E .4byte gUnknown_085A845E .4byte gUnknown_085A847E -gUnknown_085A84AC:: @ 85A84AC +gUnknown_083EDDAC:: @ 85A84AC .4byte gSlotMachineMenu_Pal + 0x20 gUnknown_085A84B0:: @ 85A84B0 @@ -1351,7 +1184,7 @@ gUnknown_085A8544:: @ 85A8544 gUnknown_085A858C:: @ 85A858C .incbin "graphics/slot_machine/reel_time_gfx.4bpp.lz" -gUnknown_085A96E0:: @ 85A96E0 +sReelTimeWindowTilemap:: @ 85A96E0 @if anyone knows what this tilemap is please do share .incbin "graphics/slot_machine/85A96E0.bin" diff --git a/include/field_effect.h b/include/field_effect.h index cdabd5c99..e05ded621 100644 --- a/include/field_effect.h +++ b/include/field_effect.h @@ -236,4 +236,6 @@ void sub_80B9CDC(s16*, u8); void sub_80B7CAC(struct Sprite*); void sub_80B7A58(struct Sprite*); +void MultiplyPaletteRGBComponents(u16 i, u8 r, u8 g, u8 b); + #endif //GUARD_FIELD_EFFECTS_H diff --git a/include/sprite.h b/include/sprite.h index 26263737b..8fc45d501 100644 --- a/include/sprite.h +++ b/include/sprite.h @@ -160,6 +160,8 @@ struct SubspriteTable struct Sprite; +typedef void (*SpriteCallback)(struct Sprite *); + struct SpriteTemplate { u16 tileTag; @@ -168,7 +170,7 @@ struct SpriteTemplate const union AnimCmd *const *anims; const struct SpriteFrameImage *images; const union AffineAnimCmd *const *affineAnims; - void (*callback)(struct Sprite *); + SpriteCallback callback; }; struct Sprite @@ -179,7 +181,7 @@ struct Sprite /*0x10*/ const union AffineAnimCmd *const *affineAnims; /*0x14*/ const struct SpriteTemplate *template; /*0x18*/ const struct SubspriteTable *subspriteTables; - /*0x1C*/ void (*callback)(struct Sprite *); + /*0x1C*/ SpriteCallback callback; /*0x20*/ struct Coords16 pos1; /*0x24*/ struct Coords16 pos2; diff --git a/src/slot_machine.c b/src/slot_machine.c index 5edd31e99..4ee4a2fe4 100644 --- a/src/slot_machine.c +++ b/src/slot_machine.c @@ -22,6 +22,44 @@ #include "text_window.h" #include "constants/rgb.h" #include "main_menu.h" +#include "bg.h" +#include "window.h" + +extern u8 gOamLimit; +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; + +// Text +extern const u8 gText_YouDontHaveThreeCoins[]; +extern const u8 gText_QuitTheGame[]; +extern const u8 gText_YouveGot9999Coins[]; +extern const u8 gText_YouveRunOutOfCoins[]; +extern const u8 gText_ReelTimeHelp[]; enum { @@ -220,7 +258,7 @@ bool8 sub_81020C8(struct Task *task); /*static*/void sub_8103EE4(struct Sprite *sprite); /*static*/void sub_8103F70(void); /*static*/bool8 sub_8103FA0(void); -/*static*/void sub_8103FE8(u8 taskId); +/*static*/void sub_8103FE8_(u8 taskId); /*static*/void sub_8104048(void); /*static*/void sub_8104064(u8 pikaPower); /*static*/bool8 sub_81040C8(void); @@ -229,7 +267,7 @@ bool8 sub_81020C8(struct Task *task); /*static*/void sub_810411C(struct Task *task); /*static*/void sub_8104144(struct Task *task); /*static*/void sub_81041AC(struct Task *task); -/*static*/void sub_810421C(struct Task *task); +/*static*/void sub_812D394(struct Task *task); /*static*/void sub_810423C(u8 pikaPower); /*static*/void sub_810430C(void); /*static*/bool8 sub_810432C(void); @@ -261,13 +299,16 @@ bool8 sub_81020C8(struct Task *task); /*static*/void sub_8104B60(struct Task *task); /*static*/void sub_8104B80(struct Task *task); /*static*/void sub_8104BC8(struct Task *task); +/*static*/void sub_812DD78(struct Task *task); /*static*/void sub_8104BFC(struct Task *task); +/*static*/void sub_812DE14(struct Task *task); +/*static*/void sub_812DE30(struct Task *task); /*static*/void sub_8104C44(struct Task *task); /*static*/void sub_8104C5C(void); /*static*/void sub_8104CAC(u8 arg0); /*static*/bool8 sub_8104E18(void); /*static*/void nullsub_69(struct Task *task); -/*static*/void sub_8104E74(u8 taskId); +/*static*/void sub_8104E74_(u8 taskId); /*static*/void sub_8104EA8(void); /*static*/void sub_8104F8C(void); /*static*/void sub_8104FF4(s16 x, s16 y, u8 a2, s16 a3); @@ -275,7 +316,7 @@ bool8 sub_81020C8(struct Task *task); /*static*/void sub_8105100(void); /*static*/void sub_810514C(void); /*static*/void sub_81051C0(void); -/*static*/void sub_8105284(void); +/*static*/void sub_8105284_(void); /*static*/void sub_81052EC(void); /*static*/void sub_81053A0(void); /*static*/void sub_810545C(void); @@ -304,12 +345,291 @@ 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); + +// Const rom data. /*static*/extern const struct UnkStruct1 *const gUnknown_083ED048[]; /*static*/extern const u16 gPalette_83EDE24[]; /*static*/extern const u8 gUnknown_083ECD04[][3]; /*static*/extern const u8 gUnknown_083ECE3A[]; /*static*/extern const u16 gUnknown_083ECE42[]; /*static*/extern const u16 gUnknown_083ECE48[]; +extern const u16 gUnknown_083ECE12[]; +extern const u16 gUnknown_083ECE1C[][2]; +extern const u16 gUnknown_083ECE30[]; +extern const u16 sSlotMatchFlags[]; +extern const u16 sSlotPayouts[]; +extern const s16 gUnknown_083ECCF8[][2]; +extern const struct BgTemplate gUnknown_085A7424[4]; +extern const struct WindowTemplate gUnknown_085A7434[]; +extern const u8 gUnknown_083ECD16[][6]; +extern const u8 gUnknown_083ECD28[][6]; +extern const u8 gUnknown_083ECD46[][17]; +extern const u8 gUnknown_083ECDAC[][17]; +extern const u8 sSym2Match[]; +extern const u8 gUnknown_083ECCF1[]; +extern const u8 sReelSymbols[][21]; +extern const u16 *const gUnknown_083EDD08[]; +extern const u16 *const gUnknown_083EDD1C[]; +extern const u8 gUnknown_083EDD30[]; +extern const u8 gUnknown_083EDD35[][2]; +extern const u8 gUnknown_083EDD3B[]; +extern const u16 *const gUnknown_083EDDA0[]; +extern const u16 *const gUnknown_083EDDAC; +extern const u16 sReelTimeWindowTilemap[]; +extern const u16 gUnknown_085A9898[]; +extern void (*const gUnknown_083ED064[])(void); + +const struct BgTemplate gUnknown_085A7424[] = +{ + { + .bg = 0, + .charBaseIndex = 2, + .mapBaseIndex = 31, + .screenSize = 0, + .paletteMode = 0, + .priority = 0, + .baseTile = 0 + }, + { + .bg = 1, + .charBaseIndex = 1, + .mapBaseIndex = 28, + .screenSize = 0, + .paletteMode = 0, + .priority = 1, + .baseTile = 0 + }, + { + .bg = 2, + .charBaseIndex = 1, + .mapBaseIndex = 29, + .screenSize = 0, + .paletteMode = 0, + .priority = 2, + .baseTile = 0 + }, + { + .bg = 3, + .charBaseIndex = 1, + .mapBaseIndex = 30, + .screenSize = 0, + .paletteMode = 0, + .priority = 1, + .baseTile = 0 + }, +}; + +const struct WindowTemplate gUnknown_085A7434[] = +{ + {0, 2, 15, 0x1B, 4, 15, 0x194}, + DUMMY_WIN_TEMPLATE +}; + +const struct WindowTemplate gUnknown_085A7444 = +{ + 0, 1, 3, 20, 13, 13, 1 +}; + +const u8 gUnknown_085A744C[] = {3, 1, 2, 0}; + +bool8 (*const gUnknown_083ECAAC[])(struct Task *task) = +{ + sub_8101D5C, + sub_8101D8C, + sub_8101DB0, + sub_8101DF4, + sub_8101E10, + sub_8101E3C, + sub_8101F44, + sub_8101F60, + sub_8101F88, + sub_8101FA4, + sub_8102008, + sub_8102034, + sub_8102058, + sub_8102090, + sub_81020C8, + sub_81021E0, + sub_81021FC, + sub_8102264, + sub_81022A0, + sub_81022CC, + sub_81022F0, + sub_8102318, + sub_8102344, + sub_810239C, + sub_81023B8, + sub_81023E0_, + sub_81023FC, + sub_8102424, + sub_8102460, +}; + +bool8 (*const gUnknown_083ECB20[])(struct Task *task) = +{ + sub_8102A9C, + sub_8102AD0, + sub_8102B80 +}; + +bool8 (*const gUnknown_083ECB2C[])(struct Task *task) = +{ + sub_8102EA0, + sub_8102EA4, + sub_8102EC0, + sub_8102F4C, + sub_8103008 +}; + +bool8 (*const gUnknown_083ECB40[])(void) = +{ + sub_810305C, + sub_81032C0, + sub_81033DC +}; + +void (*const gUnknown_083ECB4C[])(void) = +{ + sub_81034F4, + sub_8103540, + sub_810380C +}; + +const u16 gUnknown_085A74FC[] = {2, 4, 4, 4, 8}; + +bool8 (*const gUnknown_083ECB64[])(u8 a0, u8 a1) = +{ + sub_8103154, + sub_81031B4, + sub_81031B4 +}; + +bool8 (*const gUnknown_083ECB70[])(void) = +{ + sub_81032E8, + sub_81032E8, + sub_810333C +}; + +bool8 (*const gUnknown_083ECB7C[])(u8 a0) = +{ + sub_810341C, + sub_810341C, + sub_810347C +}; + +void (*const gUnknown_083ECB88[])(void) = +{ + sub_8103564, + j5_08111E84, + sub_8103668 +}; + +void (*const gUnknown_083ECB94[])(void) = +{ + sub_8103830, + sub_8103910, + sub_8103A78 +}; + +void (*const gUnknown_083ECBA0[])(struct Task *task, u8 taskId) = +{ + sub_8103C78, + sub_8103CAC, + sub_8103CC8 +}; + +const s16 gUnknown_083ECBAC[] = {5, 10, 15}; + +void (*const gUnknown_083ECBB4[])(struct Task *task) = +{ + nullsub_68, + sub_810411C, + sub_8104144, + sub_81041AC +}; + +const u16 gUnknown_083ECBC4[][2] = +{ + {0x9e, 0x6e}, + {0x9f, 0x6f}, + {0xaf, 0x7f}, +}; + +void (*const gUnknown_083ECBD0[])(struct Task *task) = +{ + sub_810437C, + sub_81043EC, + sub_8104468, + sub_8104498, + sub_8104548, + sub_8104598, + sub_81045CC, + sub_810463C, + sub_81046C0, + sub_8104764, + sub_8104794, + sub_81047EC, + sub_8104860, + sub_81048A8, + sub_81048CC, + sub_8104940, + sub_81049C8, + sub_8104794, + sub_81049F8 +}; + +const u8 gUnknown_085A75C0[] = {1, 1, 2, 2}; +const s16 gUnknown_085A75C4[] = {0x40, 0x30, 0x18, 0x08}; +const s16 gUnknown_085A75CC[] = {10, 8, 6, 4}; + +void (*const gUnknown_083ECC30[])(struct Task *task) = +{ + sub_8104B3C, + sub_8104B60, + sub_8104B80, + sub_8104B60, + sub_812DD78, + sub_8104B60, + sub_8104BC8, + sub_8104B60, + sub_812DE14, + sub_8104B60, + sub_812DE30, + sub_8104B60, + sub_8104BFC, + sub_8104B60, + sub_8104C44, +}; + +void (*const gUnknown_083ECC54[])(struct Task *task) = +{ + nullsub_69, +}; + +extern const struct SpriteTemplate gSpriteTemplate_83ED504; +extern const struct SpriteTemplate gSpriteTemplate_83ED4EC; +extern const struct SubspriteTable gSubspriteTables_83ED7D4[]; +extern const struct SpriteTemplate gSpriteTemplate_83ED4D4; +extern const struct SubspriteTable gSubspriteTables_83ED7B4[]; +extern const struct SpriteTemplate gSpriteTemplate_83ED4BC; +extern const struct SpriteTemplate gSpriteTemplate_83ED4A4; +extern const struct SubspriteTable gSubspriteTables_83ED78C[]; +extern const struct SpriteTemplate gSpriteTemplate_83ED474; +extern const struct SpriteTemplate gSpriteTemplate_83ED48C; +extern const struct SubspriteTable gSubspriteTables_83ED73C[]; +extern const struct SubspriteTable gSubspriteTables_83ED75C[]; +extern const struct SpriteTemplate gSpriteTemplate_83ED444; +extern const struct SubspriteTable gSubspriteTables_83ED704[]; +extern const struct SpriteTemplate gSpriteTemplate_83ED42C; +extern const struct SpriteTemplate gSpriteTemplate_83ED414; +extern const struct SpriteTemplate gSpriteTemplate_83ED45C; // code #define tState data[0] @@ -442,9 +762,6 @@ void SlotMachineDummyTask(u8 taskId) { } -extern const struct BgTemplate gUnknown_085A7424[4]; -extern const struct WindowTemplate gUnknown_085A7434[]; - void SlotMachineSetup_0_0(void) { SetVBlankCallback(NULL); @@ -493,8 +810,6 @@ void SlotMachineSetup_2_1(void) SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(9, 8)); } -extern const s16 gUnknown_083ECCF8[][2]; - void SlotMachineSetup_0_1(void) { u8 i; @@ -528,8 +843,6 @@ void SlotMachineSetup_0_1(void) sub_80EDE70(GetCoins()); } -extern u8 gOamLimit; - void SlotMachineSetup_3_0(void) { ResetPaletteFade(); @@ -539,34 +852,6 @@ void SlotMachineSetup_3_0(void) ResetTasks(); } -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; - void SlotMachineSetup_4_0(void) { gUnknown_0203AACC = Alloc(8); @@ -582,10 +867,6 @@ void SlotMachineSetup_4_0(void) gUnknown_0203AAD0[6] = 0x20BF; } -/*static*/void sub_812F908(void); -/*static*/void sub_812F958(void); -/*static*/void sub_812F7E4(void); - void SlotMachineSetup_5_0(void) { sub_812F908(); @@ -617,8 +898,6 @@ void sub_8101D04(void) sub_8101D24(CreateTask(sub_8101D24, 0)); } -extern bool8 (*const gUnknown_083ECAAC[])(struct Task *task); - void sub_8101D24(u8 taskId) { while (gUnknown_083ECAAC[sSlotMachine->state](gTasks + taskId)) @@ -717,11 +996,6 @@ bool8 sub_8101E3C(struct Task *task) return FALSE; } -extern const u8 gText_YouDontHaveThreeCoins[]; -extern const u8 gText_QuitTheGame[]; -extern const u8 gText_YouveGot9999Coins[]; -extern const u8 gText_YouveRunOutOfCoins[]; - bool8 sub_8101F44(struct Task *task) { NewMenuHelpers_DrawDialogueFrame(0, 0); @@ -1139,11 +1413,6 @@ bool8 sub_8102540_(void) return FALSE; } -extern const u8 gUnknown_083ECD16[][6]; -extern const u8 gUnknown_083ECD28[][6]; -extern const u8 gUnknown_083ECD46[][17]; -extern const u8 gUnknown_083ECDAC[][17]; - u8 sub_8102578(void) { s16 i; @@ -1210,12 +1479,6 @@ void sub_8102680(void) sSlotMachine->unk05 = i; } -extern const u16 gUnknown_083ECE12[]; -extern const u16 gUnknown_083ECE1C[][2]; -extern const u16 gUnknown_083ECE30[]; -extern const u16 sSlotMatchFlags[]; -extern const u16 sSlotPayouts[]; - bool8 sub_81026DC(u16 a0) { u16 rval = Random() & 0xff; @@ -1337,8 +1600,6 @@ void CheckMatch_Diagonals(void) } } -extern const u8 sSym2Match[]; - u8 GetMatchFromSymbolsInRow(u8 c1, u8 c2, u8 c3) { if (c1 == c2 && c1 == c3) @@ -1364,3 +1625,1605 @@ bool8 sub_8102A44(void) else return FALSE; } + +void sub_8102A64(u8 taskId) +{ + while (gUnknown_083ECB20[gTasks[taskId].data[0]](gTasks + taskId)) + ; +} + +bool8 sub_8102A9C(struct Task *task) +{ + if (sub_8103E38()) + { + task->data[0]++; + if (sSlotMachine->payout == 0) + { + task->data[0] = 2; + return TRUE; + } + } + return FALSE; +} + +bool8 sub_8102AD0(struct Task *task) +{ + if (!task->data[1]--) + { + if (IsFanfareTaskInactive()) + PlaySE(SE_PIN); + sSlotMachine->payout--; + if (sSlotMachine->coins < 9999) + sSlotMachine->coins++; + task->data[1] = 8; + if (gMain.heldKeys & A_BUTTON) + task->data[1] = 4; + } + if (IsFanfareTaskInactive() && gMain.newKeys & START_BUTTON) + { + PlaySE(SE_PIN); + sSlotMachine->coins += sSlotMachine->payout; + if (sSlotMachine->coins > 9999) + sSlotMachine->coins = 9999; + sSlotMachine->payout = 0; + } + if (sSlotMachine->payout == 0) + task->data[0]++; + return FALSE; +} + +bool8 sub_8102B80(struct Task *task) +{ + if (sub_8103E7C()) + DestroyTask(FindTaskIdByFunc(sub_8102A64)); + return FALSE; +} + +u8 GetTagOfReelSymbolOnScreenAtPos(u8 x, s16 y) +{ + s16 offset = (sSlotMachine->reelPositions[x] + y) % 21; + if (offset < 0) + offset += 21; + return sReelSymbols[x][offset]; +} + +u8 GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(u8 x, s16 y) +{ + s16 r6 = 0; + s16 result = sSlotMachine->unk1C[x] % 24; + if (result != 0) + r6 = -1; + return GetTagOfReelSymbolOnScreenAtPos(x, y + r6); +} + +u8 sub_8102C48(s16 a0) +{ + s16 r1 = (sSlotMachine->unk16 + a0) % 6; + if (r1 < 0) + r1 += 6; + return gUnknown_083ECCF1[r1]; +} + +void sub_8102C84(u8 a0, s16 a1) +{ + sSlotMachine->unk1C[a0] += a1; + sSlotMachine->unk1C[a0] %= 504; + sSlotMachine->reelPositions[a0] = 21 - sSlotMachine->unk1C[a0] / 24; +} + +s16 sub_8102CCC(u8 a0, s16 a1) +{ + s16 r1 = sSlotMachine->unk1C[a0] % 24; + if (r1 != 0) + { + if (r1 < a1) + a1 = r1; + sub_8102C84(a0, a1); + r1 = sSlotMachine->unk1C[a0] % 24; + } + return r1; +} + +void sub_8102D28(s16 a0) +{ + sSlotMachine->unk14 += a0; + sSlotMachine->unk14 %= 120; + sSlotMachine->unk16 = 6 - sSlotMachine->unk14 / 20; +} + +s16 sub_8102D5C(s16 a0) +{ + s16 r1 = sSlotMachine->unk14 % 20; + if (r1 != 0) + { + if (r1 < a0) + a0 = r1; + sub_8102D28(a0); + r1 = sSlotMachine->unk14 % 20; + } + return r1; +} + +void sub_8102DA8(void) +{ + u8 i; + for (i = 0; i < 3; i++) + { + u8 taskId = CreateTask(sub_8102E68, 2); + gTasks[taskId].data[15] = i; + sSlotMachine->reelTasks[i] = taskId; + sub_8102E68(taskId); + } +} + +void sub_8102DEC(u8 a0) +{ + gTasks[sSlotMachine->reelTasks[a0]].data[0] = 1; + gTasks[sSlotMachine->reelTasks[a0]].data[14] = 1; +} + +void sub_8102E1C(u8 a0) +{ + gTasks[sSlotMachine->reelTasks[a0]].data[0] = 2; +} + +bool8 sub_8102E40(u8 a0) +{ + return gTasks[sSlotMachine->reelTasks[a0]].data[14]; +} + +void sub_8102E68(u8 taskId) +{ + while (gUnknown_083ECB2C[gTasks[taskId].data[0]](gTasks + taskId)) + ; +} + +bool8 sub_8102EA0(struct Task *task) +{ + return FALSE; +} + +bool8 sub_8102EA4(struct Task *task) +{ + sub_8102C84(task->data[15], sSlotMachine->unk1A); + return FALSE; +} + + +bool8 sub_8102EC0(struct Task *task) +{ + task->data[0]++; + sSlotMachine->unk34[task->data[15]] = 0; + sSlotMachine->unk2E[task->data[15]] = 0; + if (sSlotMachine->unk0A == 0 && (sSlotMachine->unk04 == 0 || sSlotMachine->unk06 == 0 || !gUnknown_083ECB40[task->data[15]]())) + { + sSlotMachine->unk06 = 0; + gUnknown_083ECB4C[task->data[15]](); + } + task->data[1] = sSlotMachine->unk2E[task->data[15]]; + return TRUE; +} + +bool8 sub_8102F4C(struct Task *task) +{ + u16 sp[ARRAY_COUNT(gUnknown_085A74FC)]; + s16 r2; + + memcpy(sp, gUnknown_085A74FC, sizeof(gUnknown_085A74FC)); + r2 = sSlotMachine->unk1C[task->data[15]] % 24; + if (r2 != 0) + r2 = sub_8102CCC(task->data[15], sSlotMachine->unk1A); + else if (sSlotMachine->unk2E[task->data[15]]) + { + sSlotMachine->unk2E[task->data[15]]--; + sub_8102C84(task->data[15], sSlotMachine->unk1A); + r2 = sSlotMachine->unk1C[task->data[15]] % 24; + } + if (r2 == 0 && sSlotMachine->unk2E[task->data[15]] == 0) + { + task->data[0]++; + task->data[1] = sp[task->data[1]]; + task->data[2] = 0; + } + return FALSE; +} + +bool8 sub_8103008(struct Task *task) +{ + sSlotMachine->unk22[task->data[15]] = task->data[1]; + task->data[1] = -task->data[1]; + task->data[2]++; + if ((task->data[2] & 0x3) == 0) + task->data[1] >>= 1; + if (task->data[1] == 0) + { + task->data[0] = 0; + task->data[14] = 0; + sSlotMachine->unk22[task->data[15]] = 0; + } + return FALSE; +} + +bool8 sub_810305C(void) +{ + u8 r3 = sub_810250C(sSlotMachine->unk04); + u8 r5 = r3; + if (sSlotMachine->unk04 & 0xc0) + { + r5 = 0; + r3 = 1; + } + return gUnknown_083ECB64[sSlotMachine->bet - 1](r5, r3); +} + +bool8 sub_81030A4(s16 y, u8 tag1, u8 tag2) +{ + u8 tag = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(0, y); + if (tag == tag1 || tag == tag2) + { + sSlotMachine->unk07 = tag; + return TRUE; + } + return FALSE; +} + +bool8 sub_81030E0(s16 y) +{ + if (GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(0, 1 - y) == 4 || GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(0, 2 - y) == 4 || GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(0, 3 - y) == 4) + return TRUE; + else + return FALSE; +} + +bool8 sub_8103134(void) +{ + if (sSlotMachine->unk04 & 0xc2) + return TRUE; + else + return FALSE; +} + +bool8 sub_8103154(u8 a0, u8 a1) +{ + s16 i; + + for (i = 0; i < 5; i++) + { + if (sub_81030A4(2 - i, a0, a1)) + { + sSlotMachine->unk34[0] = 2; + sSlotMachine->unk2E[0] = i; + return TRUE; + } + } + return FALSE; +} + +bool8 sub_81031B4(u8 tag1, u8 tag2) +{ + s16 i; + bool8 r6 = sub_8103134(); + if (r6 || !sub_81030E0(0)) + { + for (i = 1; i < 4; i++) + { + if (sub_81030A4(i, tag1, tag2)) + { + sSlotMachine->unk34[0] = i; + sSlotMachine->unk2E[0] = 0; + return TRUE; + } + } + } + for (i = 1; i < 5; i++) + { + bool8 r7 = r6; + if (r7 || !sub_81030E0(i)) + { + if (sub_81030A4(1 - i, tag1, tag2)) + { + if (i == 1 && (r7 || !sub_81030E0(3))) + { + sSlotMachine->unk34[0] = 3; + sSlotMachine->unk2E[0] = 3; + return TRUE; + } + if (i < 4 && (r7 || !sub_81030E0(i + 1))) + { + sSlotMachine->unk34[0] = 2; + sSlotMachine->unk2E[0] = i + 1; + return TRUE; + } + sSlotMachine->unk34[0] = 1; + sSlotMachine->unk2E[0] = i; + return TRUE; + } + } + } + return FALSE; +} + +bool8 sub_81032C0(void) +{ + return gUnknown_083ECB70[sSlotMachine->bet - 1](); +} + +bool8 sub_81032E8(void) +{ + s16 i; + s16 unk34_0 = sSlotMachine->unk34[0]; + + for (i = 0; i < 5; i++) + { + if (GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(1, unk34_0 - i) == sSlotMachine->unk07) + { + sSlotMachine->unk34[1] = unk34_0; + sSlotMachine->unk2E[1] = i; + return TRUE; + } + } + return FALSE; +} + +bool8 sub_810333C(void) +{ + s16 i; + if (sub_81032E8()) + { + if (sSlotMachine->unk34[0] != 2 && sSlotMachine->unk2E[1] > 1 && sSlotMachine->unk2E[1] != 4) + { + for (i = 0; i < 5; i++) + { + if (GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(1, 2 - i) == sSlotMachine->unk07) + { + sSlotMachine->unk34[1] = 2; + sSlotMachine->unk2E[1] = i; + break; + } + } + } + return TRUE; + } + if (sSlotMachine->unk34[0] != 2) + { + for (i = 0; i < 5; i++) + { + if (GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(1, 2 - i) == sSlotMachine->unk07) + { + sSlotMachine->unk34[1] = 2; + sSlotMachine->unk2E[1] = i; + return TRUE; + } + } + } + return FALSE; +} + +bool8 sub_81033DC(void) +{ + u8 r3 = sSlotMachine->unk07; + if (sSlotMachine->unk04 & 0x40) + { + r3 = 0; + if (sSlotMachine->unk07 == 0) + { + r3 = 1; + } + } + return gUnknown_083ECB7C[sSlotMachine->bet - 1](r3); +} + +bool8 sub_810341C(u8 a0) +{ + s16 i; + s16 unk34_1 = sSlotMachine->unk34[1]; + + for (i = 0; i < 5; i++) + { + if (GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(2, unk34_1 - i) == a0) + { + sSlotMachine->unk34[2] = unk34_1; + sSlotMachine->unk2E[2] = i; + return TRUE; + } + } + return FALSE; +} + +bool8 sub_810347C(u8 a0) +{ + s16 i; + s16 r8; + if (sSlotMachine->unk34[0] == sSlotMachine->unk34[1]) + return sub_810341C(a0); + if (sSlotMachine->unk34[0] == 1) + r8 = 3; + else + r8 = 1; + for (i = 0; i < 5; i++) + { + if (GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(2, r8 - i) == a0) + { + sSlotMachine->unk2E[2] = i; + sSlotMachine->unk34[2] = r8; + return TRUE; + } + } + return FALSE; +} + +void sub_81034F4(void) +{ + s16 i = 0; + + while (sub_81030E0(i) != 0) + i++; + sSlotMachine->unk2E[0] = i; +} + +bool8 sub_8103520(u8 *a0) +{ + if (*a0 == 0) + { + *a0 = 1; + return TRUE; + } + if (*a0 == 1) + { + *a0 = 0; + return TRUE; + } + return FALSE; +} + +void sub_8103540(void) +{ + gUnknown_083ECB88[sSlotMachine->bet - 1](); +} + +void sub_8103564(void) +{ + if (sSlotMachine->unk34[0] != 0 && sSlotMachine->unk04 & 0x80) + { + u8 sp0 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(0, 2 - sSlotMachine->unk2E[0]); + if (sub_8103520(&sp0)) + { + s16 i; + for (i = 0; i < 5; i++) + { + if (sp0 == GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(1, 2 - i)) + { + sSlotMachine->unk34[1] = 2; + sSlotMachine->unk2E[1] = i; + break; + } + } + } + } +} + +void j5_08111E84(void) +{ + if (sSlotMachine->unk34[0] != 0 && sSlotMachine->unk04 & 0x80) + { + u8 sp0 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(0, sSlotMachine->unk34[0] - sSlotMachine->unk2E[0]); + if (sub_8103520(&sp0)) + { + s16 i; + for (i = 0; i < 5; i++) + { + if (sp0 == GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(1, sSlotMachine->unk34[0] - i)) + { + sSlotMachine->unk34[1] = sSlotMachine->unk34[0]; + sSlotMachine->unk2E[1] = i; + break; + } + } + } + } +} + +void sub_8103668(void) +{ + s16 i; + s16 j; + if (sSlotMachine->unk34[0] != 0 && sSlotMachine->unk04 & 0x80) + { + if (sSlotMachine->unk34[0] == 2) + { + j5_08111E84(); + } + else + { + u8 sp0 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(0, sSlotMachine->unk34[0] - sSlotMachine->unk2E[0]); + if (sub_8103520(&sp0)) + { + j = 2; + if (sSlotMachine->unk34[0] == 3) + j = 3; + for (i = 0; i < 2; i++, j--) + { + if (sp0 == GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(1, j)) + { + sSlotMachine->unk34[1] = j; + sSlotMachine->unk2E[1] = 0; + return; + } + } + for (j = 1; j < 5; j++) + { + if (sp0 == GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(1, sSlotMachine->unk34[0] - j)) + { + if (sSlotMachine->unk34[0] == 1) + { + if (j < 3) + { + sSlotMachine->unk34[1] = 2; + sSlotMachine->unk2E[1] = j + 1; + } + else + { + sSlotMachine->unk34[1] = 1; + sSlotMachine->unk2E[1] = j; + } + } + else + { + if (j < 3) + { + sSlotMachine->unk34[1] = 3; + sSlotMachine->unk2E[1] = j; + } + else + { + sSlotMachine->unk34[1] = 2; + sSlotMachine->unk2E[1] = j - 1; + } + } + return; + } + } + } + } + } +} + +bool8 sub_8103764(u8 a0, u8 a1) +{ + if ((a0 == 0 && a1 == 1) || (a0 == 1 && a1 == 0)) + return TRUE; + else + return FALSE; +} + +bool8 sub_810378C(u8 a0, u8 a1, u8 a2) +{ + if ((a0 == 0 && a1 == 1 && a2 == 0) || (a0 == 1 && a1 == 0 && a2 == 1)) + return TRUE; + else + return FALSE; +} + +bool8 sub_81037BC(u8 a0, u8 a1, u8 a2) +{ + if ((a0 == 0 && a1 == 1 && a2 == 0) || + (a0 == 1 && a1 == 0 && a2 == 1) || + (a0 == 0 && a1 == 0 && a2 == 1) || + (a0 == 1 && a1 == 1 && a2 == 0) || + (a0 == a1 && a0 == a2)) + { + return FALSE; + } + return TRUE; +} + +void sub_810380C(void) +{ + gUnknown_083ECB94[sSlotMachine->bet - 1](); +} + +void sub_8103830(void) +{ + s16 i = 0; + u8 r5 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(0, 2 - sSlotMachine->unk2E[0]); + u8 r1 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(1, 2 - sSlotMachine->unk2E[1]); + if (r5 == r1) + { + while (1) + { + u8 r0; + if (!(r5 == (r0 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(2, 2 - i)) || (r5 == 0 && r0 == 1) || (r5 == 1 && r0 == 0))) + break; + i++; + } + } + else if (sub_8103764(r5, r1)) + { + if (sSlotMachine->unk04 & 0x80) + { + for (i = 0; i < 5; i++) + { + if (r5 == GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(2, 2 - i)) + { + sSlotMachine->unk2E[2] = i; + return; + } + } + } + i = 0; + while (1) + { + if (r5 != GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(2, 2 - i)) + break; + i++; + } + } + sSlotMachine->unk2E[2] = i; +} + +void sub_8103910(void) +{ + s16 sp0 = 0; + s16 i; + u8 r7; + u8 r6; + u8 r4; + + if (sSlotMachine->unk34[1] != 0 && sSlotMachine->unk34[0] == sSlotMachine->unk34[1] && sSlotMachine->unk04 & 0x80) + { + r7 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(0, sSlotMachine->unk34[0] - sSlotMachine->unk2E[0]); + r6 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(1, sSlotMachine->unk34[1] - sSlotMachine->unk2E[1]); + if (sub_8103764(r7, r6)) + { + for (i = 0; i < 5; i++) + { + r4 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(2, sSlotMachine->unk34[1] - i); + if (r7 == r4) + { + sp0 = i; + break; + } + } + } + } + while (1) + { + s16 r8; + for (i = 1, r8 = 0; i < 4; i++) + { + r7 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(0, i - sSlotMachine->unk2E[0]); + r6 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(1, i - sSlotMachine->unk2E[1]); + r4 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(2, i - sp0); + if (!sub_81037BC(r7, r6, r4) && (!sub_810378C(r7, r6, r4) || !(sSlotMachine->unk04 & 0x80))) + { + r8++; + break; + } + } + if (r8 == 0) + break; + sp0++; + } + sSlotMachine->unk2E[2] = sp0; +} + +void sub_8103A78(void) +{ + u8 r6; + u8 r5; + u8 r4; + s16 r8; + s16 i; + + sub_8103910(); + if (sSlotMachine->unk34[1] != 0 && sSlotMachine->unk34[0] != sSlotMachine->unk34[1] && sSlotMachine->unk04 & 0x80) + { + r6 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(0, sSlotMachine->unk34[0] - sSlotMachine->unk2E[0]); + r5 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(1, sSlotMachine->unk34[1] - sSlotMachine->unk2E[1]); + if (sub_8103764(r6, r5)) + { + r8 = 1; + if (sSlotMachine->unk34[0] == 1) + r8 = 3; + for (i = 0; i < 5; i++) + { + r4 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(2, r8 - (sSlotMachine->unk2E[2] + i)); + if (r6 == r4) + { + sSlotMachine->unk2E[2] += i; + break; + } + } + } + } + while (1) + { + r6 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(0, 1 - sSlotMachine->unk2E[0]); + r5 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(1, 2 - sSlotMachine->unk2E[1]); + r4 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(2, 3 - sSlotMachine->unk2E[2]); + if (sub_81037BC(r6, r5, r4) || (sub_810378C(r6, r5, r4) && sSlotMachine->unk04 & 0x80)) + break; + sSlotMachine->unk2E[2]++; + } + while (1) + { + r6 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(0, 3 - sSlotMachine->unk2E[0]); + r5 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(1, 2 - sSlotMachine->unk2E[1]); + r4 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(2, 1 - sSlotMachine->unk2E[2]); + if (sub_81037BC(r6, r5, r4) || (sub_810378C(r6, r5, r4) && sSlotMachine->unk04 & 0x80)) + break; + sSlotMachine->unk2E[2]++; + } +} + +void sub_8103C14(u8 a0) +{ + u8 taskId = CreateTask(sub_8103C48, 5); + gTasks[taskId].data[15] = a0; + sub_8103C48(taskId); +} + +void sub_8103C48(u8 taskId) +{ + gUnknown_083ECBA0[gTasks[taskId].data[0]](gTasks + taskId, taskId); +} + +void sub_8103C78(struct Task *task, u8 taskId) +{ + sub_81065A8(gUnknown_083ECBAC[task->data[15]], 0x62, 0x63, 0x72, 0x73); + task->data[0]++; +} + +void sub_8103CAC(struct Task *task, u8 taskId) +{ + if (++task->data[1] > 11) + task->data[0]++; +} + +void sub_8103CC8(struct Task *task, u8 taskId) +{ + sub_81065A8(gUnknown_083ECBAC[task->data[15]], 0x42, 0x43, 0x52, 0x53); + DestroyTask(taskId); +} + +void sub_8103D00(u8 a0) +{ + LoadPalette(gUnknown_083EDD08[a0], gUnknown_083EDD30[a0], 2); +} + +void sub_8103D28(u8 a0) +{ + LoadPalette(gUnknown_083EDD1C[a0], gUnknown_083EDD30[a0], 2); +} + +void sub_8103D50(u8 a0) +{ + u8 i; + for (i = 0; i < gUnknown_083EDD3B[a0]; i++) + sub_8103D00(gUnknown_083EDD35[a0][i]); +} + +void sub_8103D8C(u8 a0) +{ + u8 i; + for (i = 0; i < gUnknown_083EDD3B[a0]; i++) + sub_8103D28(gUnknown_083EDD35[a0][i]); +} + +void sub_8103DC8(void) +{ + u8 i; + for (i = 0; i < 5; i++) + { + u8 spriteId = CreateInvisibleSprite(sub_8103EE4); + gSprites[spriteId].data[0] = i; + sSlotMachine->unk44[i] = spriteId; + } +} + +void sub_8103E04(u8 a0) +{ + struct Sprite *sprite = gSprites + sSlotMachine->unk44[a0]; + sprite->data[1] = 1; + sprite->data[2] = 4; + sprite->data[3] = 0; + sprite->data[4] = 0; + sprite->data[5] = 2; + sprite->data[7] = 0; +} + +bool8 sub_8103E38(void) +{ + u8 i; + for (i = 0; i < 5; i++) + { + struct Sprite *sprite = &gSprites[sSlotMachine->unk44[i]]; + if (sprite->data[1] && sprite->data[2]) + return FALSE; + } + return TRUE; +} + +bool8 sub_8103E7C(void) +{ + u8 i; + for (i = 0; i < 5; i++) + { + if (!sub_8103EAC(sSlotMachine->unk44[i])) + return FALSE; + } + return TRUE; +} + +bool8 sub_8103EAC(u8 spriteId) +{ + struct Sprite *sprite = gSprites + spriteId; + if (!sprite->data[1]) + return TRUE; + if (sprite->data[7]) + sprite->data[1] = 0; + return sprite->data[7]; +} + +void sub_8103EE4(struct Sprite *sprite) +{ + s16 r4; + if (sprite->data[1]) + { + if (!sprite->data[3]--) + { + sprite->data[7] = 0; + sprite->data[3] = 1; + sprite->data[4] += sprite->data[5]; + r4 = 4; + if (sprite->data[2]) + r4 = 8; + if (sprite->data[4] <= 0) + { + sprite->data[7] = 1; + sprite->data[5] = -sprite->data[5]; + if (sprite->data[2]) + sprite->data[2]--; + } + else if (sprite->data[4] >= r4) + sprite->data[5] = -sprite->data[5]; + if (sprite->data[2]) + sprite->data[3] <<= 1; + } + MultiplyPaletteRGBComponents(gUnknown_083EDD30[sprite->data[0]], sprite->data[4], sprite->data[4], sprite->data[4]); + } +} + +void sub_8103F70(void) +{ + u8 taskId = CreateTask(sub_8103FE8_, 6); + gTasks[taskId].data[3] = 1; + sub_8103FE8_(taskId); +} + +bool8 sub_8103FA0(void) +{ + u8 taskId = FindTaskIdByFunc(sub_8103FE8_); + if (!gTasks[taskId].data[2]) + { + DestroyTask(taskId); + LoadPalette(gUnknown_083EDDAC, 0x10, 0x20); + return TRUE; + } + return FALSE; +} + +void sub_8103FE8_(u8 taskId) +{ + struct Task *task = gTasks + taskId; + if (!task->data[1]--) + { + task->data[1] = 4; + task->data[2] += task->data[3]; + if (task->data[2] == 0 || task->data[2] == 2) + task->data[3] = -task->data[3]; + } + LoadPalette(gUnknown_083EDDA0[task->data[2]], 0x10, 0x20); +} + +void sub_8104048(void) +{ + sSlotMachine->unk3E = CreateTask(sub_81040E8, 8); +} + +void sub_8104064(u8 pikaPower) +{ + struct Task *task = gTasks + sSlotMachine->unk3E; + sub_812D394(task); + task->data[0] = 1; + task->data[1]++; + task->data[15] = 1; +} + +void sub_8104098(void) +{ + struct Task *task = gTasks + sSlotMachine->unk3E; + sub_812D394(task); + task->data[0] = 3; + task->data[15] = 1; +} + +bool8 sub_81040C8(void) +{ + return gTasks[sSlotMachine->unk3E].data[15]; +} + +void sub_81040E8(u8 taskId) +{ + gUnknown_083ECBB4[gTasks[taskId].data[0]](gTasks + taskId); +} + +void nullsub_68(struct Task *task) +{ +} + +void sub_810411C(struct Task *task) +{ + task->data[2] = sub_8105B1C((task->data[1] << 3) + 20, 20); + task->data[0]++; +} + +void sub_8104144(struct Task *task) +{ + if (gSprites[task->data[2]].data[7]) + { + s16 r5 = task->data[1] + 2; + s16 r3 = 0; + s16 r2 = 0; + if (task->data[1] == 1) + r3 = 1, r2 = 1; + else if (task->data[1] == 16) + r3 = 2, r2 = 2; + gUnknown_0203AACC[r2] = gUnknown_083ECBC4[r3][0]; + LoadBgTilemap(2, &gUnknown_0203AACC[r2], 2, r5 + 0x40); + sub_8105B88(task->data[2]); + task->data[0] = 0; + task->data[15] = 0; + } +} + +void sub_81041AC(struct Task *task) +{ + s16 r5 = task->data[1] + 2; + s16 r3 = 0; + s16 r2 = 3; + if (task->data[1] == 1) + r3 = 1, r2 = 1; + else if (task->data[1] == 16) + r3 = 2, r2 = 2; + if (task->data[2] == 0) + { + gUnknown_0203AACC[r2] = gUnknown_083ECBC4[r3][1]; + LoadBgTilemap(2, &gUnknown_0203AACC[r2], 2, r5 + 0x40); + task->data[1]--; + } + if (++task->data[2] >= 20) + task->data[2] = 0; + if (task->data[1] == 0) + { + task->data[0] = 0; + task->data[15] = 0; + } +} + +void sub_812D394(struct Task *task) +{ + u8 i; + + for (i = 2; i < 16; i++) + task->data[i] = 0; +} + +void sub_810423C(u8 pikaPower) +{ + s16 i; + s16 r3 = 0, r1 = 0; + s16 r4 = 3; + for (i = 0; i < pikaPower; i++, r4++) + { + r3 = 0, r1 = 0; + if (i == 0) + r3 = 1, r1 = 1; + else if (i == 15) + r3 = 2, r1 = 2; + gUnknown_0203AACC[r1] = gUnknown_083ECBC4[r3][0]; + LoadBgTilemap(2, &gUnknown_0203AACC[r1], 2, r4 + 0x40); + } + for (; i < 16; i++, r4++) + { + r3 = 0, r1 = 3; + if (i == 0) + r3 = 1, r1 = 1; + else if (i == 15) + r3 = 2, r1 = 2; + gUnknown_0203AACC[r1] = gUnknown_083ECBC4[r3][1]; + LoadBgTilemap(2, &gUnknown_0203AACC[r1], 2, r4 + 0x40); + } + gTasks[sSlotMachine->unk3E].data[1] = pikaPower; +} + +void sub_810430C(void) +{ + u8 taskId = CreateTask(sub_810434C, 7); + sub_810434C(taskId); +} + +bool8 sub_810432C(void) +{ + if (FindTaskIdByFunc(sub_810434C) == 0xFF) + return TRUE; + return FALSE; +} + +void sub_810434C(u8 taskId) +{ + gUnknown_083ECBD0[gTasks[taskId].data[0]](gTasks + taskId); +} + +void sub_810437C(struct Task *task) +{ + sSlotMachine->unk0A = 0; + sSlotMachine->unk14 = 0; + sSlotMachine->unk16 = 0; + task->data[0]++; + task->data[1] = 0; + task->data[2] = 30; + task->data[4] = 1280; + gSpriteCoordOffsetX = 0; + gSpriteCoordOffsetY = 0; + SetGpuReg(REG_OFFSET_BG1HOFS, 0); + SetGpuReg(REG_OFFSET_BG1VOFS, 0); + sub_8104A40(REG_OFFSET_BG3VOFS, 0); + sub_81051C0(); + sub_8105100(); + sub_81052EC(); + sub_81053A0(); + sub_810545C(); + sub_8102680(); + StopMapMusic(); + PlayNewMapMusic(MUS_BD_TIME); +} + +void sub_81043EC(struct Task *task) +{ + s16 r3; + gSpriteCoordOffsetX -= 8; + task->data[1] += 8; + r3 = ((task->data[1] + 240) & 0xff) >> 3; + SetGpuReg(REG_OFFSET_BG1HOFS, task->data[1] & 0x1ff); + if (r3 != task->data[2] && task->data[3] <= 18) + { + task->data[2] = r3; + task->data[3] = task->data[1] >> 3; + sub_8104A40(r3, task->data[3]); + } + if (task->data[1] >= 200) + { + task->data[0]++; + task->data[3] = 0; + } + sub_8102D28(task->data[4] >> 8); +} + +void sub_8104468(struct Task *task) +{ + sub_8102D28(task->data[4] >> 8); + if (++task->data[5] >= 60) + { + task->data[0]++; + sub_8105578(); + sub_81056F0(); + } +} + +void sub_8104498(struct Task *task) +{ + int r5; + u8 sp0[ARRAY_COUNT(gUnknown_085A75C0)]; + s16 sp4[ARRAY_COUNT(gUnknown_085A75C4)]; + s16 spC[ARRAY_COUNT(gUnknown_085A75CC)]; + + memcpy(sp0, gUnknown_085A75C0, sizeof(gUnknown_085A75C0)); + memcpy(sp4, gUnknown_085A75C4, sizeof(gUnknown_085A75C4)); + memcpy(spC, gUnknown_085A75CC, sizeof(gUnknown_085A75CC)); + + sub_8102D28(task->data[4] >> 8); + task->data[4] -= 4; + r5 = 4 - (task->data[4] >> 8); + sub_8105688(sp4[r5]); + sub_81057E8(spC[r5]); + StartSpriteAnimIfDifferent(gSprites + sSlotMachine->unk3F, sp0[r5]); + if (task->data[4] <= 0x100) + { + task->data[0]++; + task->data[4] = 0x100; + task->data[5] = 0; + } +} + +void sub_8104548(struct Task *task) +{ + sub_8102D28(task->data[4] >> 8); + if (++task->data[5] >= 80) + { + task->data[0]++; + task->data[5] = 0; + sub_81057E8(2); + StartSpriteAnimIfDifferent(gSprites + sSlotMachine->unk3F, 3); + } +} + +void sub_8104598(struct Task *task) +{ + sub_8102D28(task->data[4] >> 8); + task->data[4] = (u8)task->data[4] + 0x80; + if (++task->data[5] >= 80) + { + task->data[0]++; + task->data[5] = 0; + } +} + +void sub_81045CC(struct Task *task) +{ + sub_8102D28(task->data[4] >> 8); + task->data[4] = (u8)task->data[4] + 0x40; + if (++task->data[5] >= 40) + { + task->data[5] = 0; + if (sSlotMachine->unk05) + { + if (sSlotMachine->unk0A <= task->data[6]) + task->data[0]++; + } + else if (task->data[6] > 3) + { + task->data[0]++; + } + else if (sub_81026DC(task->data[6])) + { + task->data[0] = 14; + } + task->data[6]++; + } +} + +void sub_810463C(struct Task *task) +{ + s16 r5 = sSlotMachine->unk14 % 20; + if (r5) + { + r5 = sub_8102D5C(task->data[4] >> 8); + task->data[4] = (u8)task->data[4] + 0x40; + } + else if (sub_8102C48(1) != sSlotMachine->unk05) + { + sub_8102D28(task->data[4] >> 8); + r5 = sSlotMachine->unk14 % 20; + task->data[4] = (u8)task->data[4] + 0x40; + } + if (r5 == 0 && sub_8102C48(1) == sSlotMachine->unk05) + { + task->data[4] = 0; + task->data[0]++; + } +} + +void sub_81046C0(struct Task *task) +{ + if (++task->data[4] >= 60) + { + StopMapMusic(); + sub_81056C0(); + sub_8105804(); + task->data[0]++; + if(sSlotMachine->unk05 == 0) + { + task->data[4] = 0xa0; + StartSpriteAnimIfDifferent(gSprites + sSlotMachine->unk3F, 5); + PlayFanfare(MUS_ME_ZANNEN); + } + else + { + task->data[4] = 0xc0; + StartSpriteAnimIfDifferent(gSprites + sSlotMachine->unk3F, 4); + gSprites[sSlotMachine->unk3F].animCmdIndex = 0; + if (sSlotMachine->pikaPower) + { + sub_8104098(); + sSlotMachine->pikaPower = 0; + } + PlayFanfare(MUS_ME_B_SMALL); + } + } +} + +void sub_8104764(struct Task *task) +{ + if ((task->data[4] == 0 || --task->data[4] == 0) && !sub_81040C8()) + task->data[0]++; +} + +void sub_8104794(struct Task *task) +{ + s16 r4; + gSpriteCoordOffsetX -= 8; + task->data[1] += 8; + task->data[3] += 8; + r4 = ((task->data[1] - 8) & 0xff) >> 3; + SetGpuReg(REG_OFFSET_BG1HOFS, task->data[1] & 0x1ff); + if (task->data[3] >> 3 <= 25) + sub_8104A88(r4); + else + task->data[0]++; +} + +void sub_81047EC(struct Task *task) +{ + sSlotMachine->unk0B = 0; + sSlotMachine->unk0A = sSlotMachine->unk05; + gSpriteCoordOffsetX = 0; + SetGpuReg(REG_OFFSET_BG1HOFS, 0); + sSlotMachine->unk1A = 8; + sub_810514C(); + sub_81054B8(); + sub_8105524(); + PlayNewMapMusic(sSlotMachine->backupMapMusic); + if (sSlotMachine->unk0A == 0) + { + DestroyTask(FindTaskIdByFunc(sub_810434C)); + } + else + { + sub_8104CAC(4); + task->data[1] = dp15_jump_random_unknown(); + task->data[2] = 0; + task->data[3] = 0; + task->data[0]++; + } +} + +void sub_8104860(struct Task *task) +{ + if (sSlotMachine->unk1A == task->data[1]) + task->data[0]++; + else if (sSlotMachine->unk1C[0] % 24 == 0 && (++task->data[2]& 0x07) == 0) + sSlotMachine->unk1A >>= 1; +} + +void sub_81048A8(struct Task *task) +{ + if (sub_8104E18()) + DestroyTask(FindTaskIdByFunc(sub_810434C)); +} + +void sub_81048CC(struct Task *task) +{ + sub_81054B8(); + sub_81056C0(); + sub_8105804(); + sub_8105854(); + gSprites[sSlotMachine->unk4E[0]].invisible = TRUE; + StartSpriteAnimIfDifferent(gSprites + sSlotMachine->unk3F, 5); + task->data[0]++; + task->data[4] = 4; + task->data[5] = 0; + StopMapMusic(); + PlayFanfare(MUS_ME_ZANNEN); + PlaySE(SE_W153); +} + +void sub_8104940(struct Task *task) +{ + gSpriteCoordOffsetY = task->data[4]; + SetGpuReg(REG_OFFSET_BG1VOFS, task->data[4]); + if (task->data[5] & 0x01) + task->data[4] = -task->data[4]; + if ((++task->data[5] & 0x1f) == 0) + task->data[4] >>= 1; + if (task->data[4] == 0) + { + sub_81058A0(); + sub_81058C4(); + sub_8105284_(); + sub_81059E8(); + gSprites[sSlotMachine->unk4E[0]].invisible = FALSE; + task->data[0]++; + task->data[5] = 0; + } +} + +void sub_81049C8(struct Task *task) +{ + gSpriteCoordOffsetY = 0; + SetGpuReg(REG_OFFSET_BG1VOFS, 0); + if (sub_8105ACC()) + { + task->data[0]++; + sub_8105AEC(); + } +} + +void sub_81049F8(struct Task *task) +{ + gSpriteCoordOffsetX = 0; + SetGpuReg(REG_OFFSET_BG1HOFS, 0); + PlayNewMapMusic(sSlotMachine->backupMapMusic); + sub_810514C(); + sub_8105554(); + sub_8105524(); + sub_81059B8(); + DestroyTask(FindTaskIdByFunc(sub_810434C)); +} + +void sub_8104A40(s16 a0, s16 a1) +{ + s16 i; + + for (i = 4; i < 15; i++) + { + LoadBgTilemap(1, &sReelTimeWindowTilemap[a1 + (i - 4) * 20], 2, 32 * i + a0); + } +} + +void sub_8104A88(s16 a0) +{ + u8 i; + + for (i = 4; i < 15; i++) + { + LoadBgTilemap(1, gUnknown_085A9898, 2, 32 * i + a0); + } +} + +void sub_8104AB8(u8 a0) +{ + u8 taskId = CreateTask(sub_8104B0C, 1); + gTasks[taskId].data[1] = a0; + sub_8104B0C(taskId); +} + +bool8 sub_8104AEC(void) +{ + if (FindTaskIdByFunc(sub_8104B0C) == 0xFF) + return TRUE; + else + return FALSE; +} + +void sub_8104B0C(u8 taskId) +{ + gUnknown_083ECC30[gTasks[taskId].data[0]](gTasks + taskId); +} + +void sub_8104B3C(struct Task *task) +{ + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB(0, 0, 0)); + task->data[0]++; +} + +void sub_8104B60(struct Task *task) +{ + if (!gPaletteFade.active) + task->data[0]++; +} + +void sub_8104B80(struct Task *task) +{ + sub_8104DA4(); + sub_81065DC(); + AddWindow(&gUnknown_085A7444); + PutWindowTilemap(1); + FillWindowPixelBuffer(1, 0); + task->data[0]++; +} + +void sub_812DD78(struct Task *task) +{ + AddTextPrinterParameterized3(1, 1, 2, 5, gUnknown_085A744C, 0, gText_ReelTimeHelp); + CopyWindowToVram(1, 3); + BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB(0, 0, 0)); + task->data[0]++; +} + +void sub_8104BC8(struct Task *task) +{ + if (gMain.newKeys & (B_BUTTON | SELECT_BUTTON)) + { + FillWindowPixelBuffer(1, 0); + ClearWindowTilemap(1); + CopyWindowToVram(1, 1); + RemoveWindow(1); + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB(0, 0, 0)); + task->data[0]++; + } +} + +void sub_812DE14(struct Task *task) +{ + sub_812F968(); + ShowBg(3); + task->data[0]++; +} + +void sub_812DE30(struct Task *task) +{ + sub_8104CAC(task->data[1]); + task->data[0]++; +} + +void sub_8104BFC(struct Task *task) +{ + sub_810423C(sSlotMachine->pikaPower); + BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB(0, 0, 0)); + task->data[0]++; +} + +void sub_8104C44(struct Task *task) +{ + DestroyTask(FindTaskIdByFunc(sub_8104B0C)); +} + +void sub_8104C5C(void) +{ + u8 i; + struct Task *task; + i = CreateTask(sub_8104E74_, 3); + sSlotMachine->unk3D = i; + task = gTasks + i; + task->data[1] = -1; + for (i = 4; i < 16; i++) + task->data[i] = MAX_SPRITES; +} + +void sub_8104CAC(u8 arg0) +{ + u8 i; + struct Task *task; + + sub_8104DA4(); + + task = gTasks + sSlotMachine->unk3D; + task->data[1] = arg0; + + for (i = 0; gUnknown_083ED048[arg0][i].unk00 != 0xFF; i++) + { + u8 spriteId; + spriteId = sub_8105BB4( + gUnknown_083ED048[arg0][i].unk00, + gUnknown_083ED048[arg0][i].unk01, + gUnknown_083ED048[arg0][i].unk02 + ); + task->data[4 + i] = spriteId; + } +} + +void sub_8104D30(u8 a0, SpriteCallback a1, s16 a2, s16 a3, s16 a4) +{ + u8 i; + struct Task *task = gTasks + sSlotMachine->unk3D; + for (i = 4; i < 16; i++) + { + if (task->data[i] == MAX_SPRITES) + { + task->data[i] = sub_8105BF8(a0, a1, a2, a3, a4); + break; + } + } +} + +void sub_8104DA4(void) +{ + u8 i; + struct Task *task = gTasks + sSlotMachine->unk3D; + if ((u16)task->data[1] != 0xFFFF) + gUnknown_083ED064[task->data[1]](); + for (i = 4; i < 16; i++) + { + if (task->data[i] != MAX_SPRITES) + { + DestroySprite(gSprites + task->data[i]); + task->data[i] = MAX_SPRITES; + } + } +} + +bool8 sub_8104E18(void) +{ + u8 i; + struct Task *task = gTasks + sSlotMachine->unk3D; + for (i = 4; i < 16; i++) + { + if (task->data[i] != MAX_SPRITES) + { + if (gSprites[task->data[i]].data[7]) + return FALSE; + } + } + return TRUE; +} + +void sub_8104E74_(u8 taskId) +{ + gUnknown_083ECC54[gTasks[taskId].data[0]](gTasks + taskId); +} + +void nullsub_69(struct Task *task) +{ +} + +void sub_8104EA8(void) +{ + s16 i; + s16 j; + s16 x; + for (i = 0, x = 0x30; i < 3; i++, x += 0x28) + { + for (j = 0; j < 120; j += 24) + { + struct Sprite *sprite = gSprites + CreateSprite(&gSpriteTemplate_83ED414, x, 0, 14); + sprite->oam.priority = 3; + sprite->data[0] = i; + sprite->data[1] = j; + sprite->data[3] = -1; + } + } +} + +void sub_8104F18(struct Sprite *sprite) +{ + sprite->data[2] = sSlotMachine->unk1C[sprite->data[0]] + sprite->data[1]; + sprite->data[2] %= 120; + sprite->pos1.y = sSlotMachine->unk22[sprite->data[0]] + 28 + sprite->data[2]; + sprite->sheetTileStart = GetSpriteTileStartByTag(GetTagOfReelSymbolOnScreenAtPos(sprite->data[0], sprite->data[2] / 24)); + SetSpriteSheetFrameTileNum(sprite); +} + +void sub_8104F8C(void) +{ + s16 i; + s16 x; + + for (x = 203, i = 1; i < 10000; i *= 10, x -= 7) + sub_8104FF4(x, 23, 0, i); + for (x = 235, i = 1; i < 10000; i *= 10, x -= 7) + sub_8104FF4(x, 23, 1, i); +} + +void sub_8104FF4(s16 x, s16 y, u8 a2, s16 a3) +{ + struct Sprite *sprite = gSprites + CreateSprite(&gSpriteTemplate_83ED42C, x, y, 13); + sprite->oam.priority = 2; + sprite->data[0] = a2; + sprite->data[1] = a3; + sprite->data[2] = a3 * 10; + sprite->data[3] = -1; +} + +void sub_810506C(struct Sprite *sprite) +{ + u16 tag = sSlotMachine->coins; + if (sprite->data[0]) + tag = sSlotMachine->payout; + if (sprite->data[3] != tag) + { + sprite->data[3] = tag; + tag %= (u16)sprite->data[2]; + tag /= (u16)sprite->data[1]; + tag += 7; + sprite->sheetTileStart = GetSpriteTileStartByTag(tag); + SetSpriteSheetFrameTileNum(sprite); + } +} + +void sub_81050C4(void) +{ + u8 spriteId = CreateSprite(&gSpriteTemplate_83ED444, 0x58, 0x48, 15); + gSprites[spriteId].oam.priority = 3; + SetSubspriteTables(gSprites + spriteId, gSubspriteTables_83ED704); +} From db248dada23086ed8a5fd26d7fcce52b575768d2 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sat, 15 Sep 2018 22:59:45 +0200 Subject: [PATCH 2/3] slot machine is decompiled --- asm/slot_machine.s | 3289 ------------------------------------------- data/slot_machine.s | 304 +--- src/slot_machine.c | 1318 ++++++++++++++++- 3 files changed, 1367 insertions(+), 3544 deletions(-) diff --git a/asm/slot_machine.s b/asm/slot_machine.s index d700bf5c5..c3fc4d140 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 bbbba9652..1a57f6abd 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 4ee4a2fe4..ec5640b91 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} +}; From 4d2637883a55d916badb0b7b6107da5b9145b529 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sat, 15 Sep 2018 23:19:37 +0200 Subject: [PATCH 3/3] Slot machine is decompiled. --- asm/slot_machine.s | 10 - data/slot_machine.s | 201 -------- ld_script.txt | 1 - src/slot_machine.c | 1109 ++++++++++++++++++++++++------------------- sym_bss.txt | 4 +- sym_ewram.txt | 89 +--- 6 files changed, 619 insertions(+), 795 deletions(-) delete mode 100644 asm/slot_machine.s diff --git a/asm/slot_machine.s b/asm/slot_machine.s deleted file mode 100644 index c3fc4d140..000000000 --- a/asm/slot_machine.s +++ /dev/null @@ -1,10 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - - - .align 2, 0 @ Don't pad with nop. diff --git a/data/slot_machine.s b/data/slot_machine.s index 1a57f6abd..4a354d71c 100644 --- a/data/slot_machine.s +++ b/data/slot_machine.s @@ -4,207 +4,6 @@ .section .rodata .align 2 - -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 - .byte 0x22 - .2byte 0 - .byte 0x2 - .byte 0 - .2byte 0 - .byte 0x9 - .byte 0x10 - .2byte 0 - .byte 0xFF - .byte 0 - .2byte 0 - -gUnknown_085A7964:: @ 85A7964 - .byte 0xA - .byte 0x1 - .2byte 0 - .byte 0xB - .byte 2 - .2byte 0 - .byte 0xC - .byte 0x3 - .2byte 0 - .byte 0xD - .byte 4 - .2byte 0 - .byte 0x5 - .byte 5 - .2byte 0 - .byte 0x8 - .byte 0x6 - .2byte 0 - .byte 0xFF - .byte 0 - .2byte 0 - -gUnknown_085A7980:: @ 85A7980 - .byte 0x3 - .byte 0x7 - .2byte 0 - .byte 0x8 - .byte 0x11 - .2byte 0 - .byte 0xFF - .byte 0 - .2byte 0 - -gUnknown_085A798C:: @ 85A798C - .byte 0x4 - .byte 0x8 - .2byte 0 - .byte 0x6 - .byte 0x9 - .2byte 0 - .byte 0x6 - .byte 0xA - .2byte 1 - .byte 0x6 - .byte 0xB - .2byte 2 - .byte 0x6 - .byte 0xC - .2byte 3 - .byte 0xFF - .byte 0 - .2byte 0 - -gUnknown_085A79A4:: @ 85A79A4 - .byte 0 - .byte 0xD - .2byte 0 - .byte 1 - .byte 0xE - .2byte 0 - .byte 0x7 - .byte 0xF - .2byte 0 - .byte 0xFF - .byte 0 - .2byte 0 - -gUnknown_085A79B4:: @ 85A79B4 - .byte 0x13 - .byte 0x1A - .2byte 0 - .byte 0x14 - .byte 0x1B - .2byte 1 - .byte 0x15 - .byte 0x1C - .2byte 2 - .byte 0xE - .byte 0x1D - .2byte 3 - .byte 0xF - .byte 0x1E - .2byte 4 - .byte 0x10 - .byte 0x1F - .2byte 5 - .byte 0x11 - .byte 0x20 - .2byte 6 - .byte 0x12 - .byte 0x21 - .2byte 7 - .byte 0x8 - .byte 0x11 - .2byte 0 - .byte 0xFF - .byte 0 - .2byte 0 - -gUnknown_085A79DC:: @ 85A79DC - .byte 0x16 - .byte 0x12 - .2byte 0 - .byte 0x17 - .byte 0x13 - .2byte 1 - .byte 0x18 - .byte 0x14 - .2byte 2 - .byte 0xE - .byte 0x15 - .2byte 3 - .byte 0xF - .byte 0x16 - .2byte 4 - .byte 0x10 - .byte 0x17 - .2byte 5 - .byte 0x11 - .byte 0x18 - .2byte 6 - .byte 0x12 - .byte 0x19 - .2byte 7 - .byte 0x8 - .byte 0x11 - .2byte 0 - .byte 0xFF - .byte 0 - .2byte 0 - -gUnknown_083ED048:: @ 85A7A04 - .4byte gUnknown_085A7954 - .4byte gUnknown_085A7964 - .4byte gUnknown_085A7980 - .4byte gUnknown_085A798C - .4byte gUnknown_085A79A4 - .4byte gUnknown_085A79DC - .4byte gUnknown_085A79B4 - -gUnknown_083ED064:: @ 85A7A20 - .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 diff --git a/ld_script.txt b/ld_script.txt index 2e3616121..e2ea3e542 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -171,7 +171,6 @@ SECTIONS { asm/cute_sketch.o(.text); src/decoration.o(.text); src/slot_machine.o(.text); - asm/slot_machine.o(.text); asm/contest_painting.o(.text); src/battle_ai_script_commands.o(.text); src/trader.o(.text); diff --git a/src/slot_machine.c b/src/slot_machine.c index ec5640b91..ef52b7171 100644 --- a/src/slot_machine.c +++ b/src/slot_machine.c @@ -26,35 +26,6 @@ #include "window.h" extern u8 gOamLimit; -extern u16 *gUnknown_0203AAC8; -extern u16 *gUnknown_0203AACC; -extern u16 *gUnknown_0203AAD0; -extern u16 *gUnknown_0203AADC; -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[]; @@ -140,8 +111,6 @@ struct SlotMachineEwramStruct /*0x64*/ MainCallback prevMainCb; }; -extern struct SlotMachineEwramStruct *sSlotMachine; - struct UnkStruct1 { /*0x00*/ u8 unk00; @@ -151,217 +120,250 @@ struct UnkStruct1 #define SLOTMACHINE_GFX_TILES 233 -/*static*/void CB2_SlotMachineSetup(void); -/*static*/void CB2_SlotMachineLoop(void); -/*static*/void PlaySlotMachine_Internal(u8 arg0, MainCallback cb); -/*static*/void SlotMachineDummyTask(u8 taskId); -/*static*/void SlotMachineSetup_0_0(void); -/*static*/void SlotMachineSetup_6_2(void); -/*static*/void SlotMachineSetup_1_0(void); -/*static*/void SlotMachineSetup_2_0(void); -/*static*/void SlotMachineSetup_2_1(void); -/*static*/void SlotMachineSetup_0_1(void); -/*static*/void SlotMachineSetup_3_0(void); -/*static*/void SlotMachineSetup_4_0(void); -/*static*/void SlotMachineSetup_5_0(void); -/*static*/void SlotMachineSetup_6_0(void); -/*static*/void SlotMachineSetup_6_1(void); -/*static*/void SlotMachineSetup_8_0(void); -/*static*/void SlotMachineSetup_9_0(void); -/*static*/void SlotMachineSetup_10_0(void); -/*static*/void SlotMachineSetup_10_1(void); -/*static*/void sub_8101D04(void); -/*static*/void sub_8104DA4(void); -/*static*/void sub_8101D24(u8 taskId); -/*static*/bool8 sub_8101D5C(struct Task *task); -/*static*/bool8 sub_8101D8C(struct Task *task); -/*static*/bool8 sub_8101DB0(struct Task *task); -/*static*/bool8 sub_8101DF4(struct Task *task); -/*static*/bool8 sub_8101E10(struct Task *task); -/*static*/bool8 sub_8101E3C(struct Task *task); -/*static*/bool8 sub_8101F44(struct Task *task); -/*static*/bool8 sub_8101F60(struct Task *task); -/*static*/bool8 sub_8101F88(struct Task *task); -/*static*/bool8 sub_8101FA4(struct Task *task); -/*static*/bool8 sub_8102008(struct Task *task); -/*static*/bool8 sub_8102034(struct Task *task); -/*static*/bool8 sub_8102058(struct Task *task); -/*static*/bool8 sub_8102090(struct Task *task); -bool8 sub_81020C8(struct Task *task); -/*static*/bool8 sub_81021E0(struct Task *task); -/*static*/bool8 sub_81021FC(struct Task *task); -/*static*/bool8 sub_8102264(struct Task *task); -/*static*/bool8 sub_81022A0(struct Task *task); -/*static*/bool8 sub_81022CC(struct Task *task); -/*static*/bool8 sub_81022F0(struct Task *task); -/*static*/bool8 sub_8102318(struct Task *task); -/*static*/bool8 sub_8102344(struct Task *task); -/*static*/bool8 sub_810239C(struct Task *task); -/*static*/bool8 sub_81023B8(struct Task *task); -/*static*/bool8 sub_81023E0_(struct Task *task); -/*static*/bool8 sub_81023FC(struct Task *task); -/*static*/bool8 sub_8102424(struct Task *task); -/*static*/bool8 sub_8102460(struct Task *task); -/*static*/void sub_8102484(void); -/*static*/void sub_81024F0(void); -/*static*/bool8 sub_8102540_(void); -/*static*/u8 sub_8102578(void); -/*static*/u16 dp15_jump_random_unknown(void); -/*static*/u8 sub_81025BC(void); -/*static*/void CheckMatch(void); -/*static*/void CheckMatch_CenterRow(void); -/*static*/void CheckMatch_TopAndBottom(void); -/*static*/void CheckMatch_Diagonals(void); -/*static*/u8 GetMatchFromSymbolsInRow(u8 c1, u8 c2, u8 c3); -/*static*/void sub_8102A24(void); -/*static*/void sub_8102A64(u8 taskId); -/*static*/bool8 sub_8102A44(void); -/*static*/bool8 sub_8102A9C(struct Task *task); -/*static*/bool8 sub_8102AD0(struct Task *task); -/*static*/bool8 sub_8102B80(struct Task *task); -/*static*/u8 GetTagOfReelSymbolOnScreenAtPos(u8 x, s16 y); -/*static*/void sub_8102DA8(void); -/*static*/void sub_8102DEC(u8 a0); -/*static*/void sub_8102E1C(u8 a0); -/*static*/bool8 sub_8102E40(u8 a0); -/*static*/void sub_8102E68(u8 taskId); -/*static*/bool8 sub_8102EA0(struct Task *task); -/*static*/bool8 sub_8102EA4(struct Task *task); -/*static*/bool8 sub_8102EC0(struct Task *task); -/*static*/bool8 sub_8102F4C(struct Task *task); -/*static*/bool8 sub_8103008(struct Task *task); -/*static*/bool8 sub_810305C(void); -/*static*/bool8 sub_8103154(u8 a0, u8 a1); -/*static*/bool8 sub_81031B4(u8 a0, u8 a1); -/*static*/bool8 sub_81032C0(void); -/*static*/bool8 sub_81032E8(void); -/*static*/bool8 sub_810333C(void); -/*static*/bool8 sub_81033DC(void); -/*static*/bool8 sub_810341C(u8 a0); -/*static*/bool8 sub_810347C(u8 a0); -/*static*/void sub_81034F4(void); -/*static*/void sub_8103540(void); -/*static*/void sub_8103564(void); -/*static*/void j5_08111E84(void); -/*static*/void sub_8103668(void); -/*static*/void sub_810380C(void); -/*static*/void sub_8103830(void); -/*static*/void sub_8103910(void); -/*static*/void sub_8103A78(void); -/*static*/void sub_8103C14(u8 a0); -/*static*/void sub_8103C48(u8 taskId); -/*static*/void sub_8103D50(u8 a0); -/*static*/void sub_8103C78(struct Task *task, u8 taskId); -/*static*/void sub_8103CAC(struct Task *task, u8 taskId); -/*static*/void sub_8103CC8(struct Task *task, u8 taskId); -/*static*/void sub_8103D8C(u8 a0); -/*static*/void sub_8103DC8(void); -/*static*/void sub_8103E04(u8 a0); -/*static*/bool8 sub_8103E38(void); -/*static*/bool8 sub_8103E7C(void); -/*static*/bool8 sub_8103EAC(u8 spriteId); -/*static*/void sub_8103EE4(struct Sprite *sprite); -/*static*/void sub_8103F70(void); -/*static*/bool8 sub_8103FA0(void); -/*static*/void sub_8103FE8_(u8 taskId); -/*static*/void sub_8104048(void); -/*static*/void sub_8104064(u8 pikaPower); -/*static*/bool8 sub_81040C8(void); -/*static*/void sub_81040E8(u8 taskId); -/*static*/void nullsub_68(struct Task *task); -/*static*/void sub_810411C(struct Task *task); -/*static*/void sub_8104144(struct Task *task); -/*static*/void sub_81041AC(struct Task *task); -/*static*/void sub_812D394(struct Task *task); -/*static*/void sub_810423C(u8 pikaPower); -/*static*/void sub_810430C(void); -/*static*/bool8 sub_810432C(void); -/*static*/void sub_810434C(u8 taskId); -/*static*/void sub_810437C(struct Task *task); -/*static*/void sub_81043EC(struct Task *task); -/*static*/void sub_8104468(struct Task *task); -/*static*/void sub_8104498(struct Task *task); -/*static*/void sub_8104548(struct Task *task); -/*static*/void sub_8104598(struct Task *task); -/*static*/void sub_81045CC(struct Task *task); -/*static*/void sub_810463C(struct Task *task); -/*static*/void sub_81046C0(struct Task *task); -/*static*/void sub_8104764(struct Task *task); -/*static*/void sub_8104794(struct Task *task); -/*static*/void sub_81047EC(struct Task *task); -/*static*/void sub_8104860(struct Task *task); -/*static*/void sub_81048A8(struct Task *task); -/*static*/void sub_81048CC(struct Task *task); -/*static*/void sub_8104940(struct Task *task); -/*static*/void sub_81049C8(struct Task *task); -/*static*/void sub_81049F8(struct Task *task); -/*static*/void sub_8104A40(s16 a0, s16 a1); -/*static*/void sub_8104A88(s16 a0); -/*static*/void sub_8104AB8(u8 a0); -/*static*/bool8 sub_8104AEC(void); -/*static*/void sub_8104B0C(u8 taskId); -/*static*/void sub_8104B3C(struct Task *task); -/*static*/void sub_8104B60(struct Task *task); -/*static*/void sub_8104B80(struct Task *task); -/*static*/void sub_8104BC8(struct Task *task); -/*static*/void sub_812DD78(struct Task *task); -/*static*/void sub_8104BFC(struct Task *task); -/*static*/void sub_812DE14(struct Task *task); -/*static*/void sub_812DE30(struct Task *task); -/*static*/void sub_8104C44(struct Task *task); -/*static*/void sub_8104C5C(void); -/*static*/void sub_8104CAC(u8 arg0); -/*static*/bool8 sub_8104E18(void); -/*static*/void nullsub_69(struct Task *task); -/*static*/void sub_8104E74_(u8 taskId); -/*static*/void sub_8104EA8(void); -/*static*/void sub_8104F8C(void); -/*static*/void sub_8104FF4(s16 x, s16 y, u8 a2, s16 a3); -/*static*/void sub_81050C4(void); -/*static*/void sub_8105100(void); -/*static*/void sub_810514C(void); -/*static*/void sub_81051C0(void); -/*static*/void sub_8105284_(void); -/*static*/void sub_81052EC(void); -/*static*/void sub_81053A0(void); -/*static*/void sub_810545C(void); -/*static*/void sub_81054B8(void); -/*static*/void sub_8105524(void); -/*static*/void sub_8105554(void); -/*static*/void sub_8105578(void); -/*static*/void sub_8105688(s16 a0); -/*static*/void sub_81056C0(void); -/*static*/void sub_81056F0(void); -/*static*/void sub_81057E8(s16 a0); -/*static*/void sub_8105804(void); -/*static*/void sub_8105854(void); -/*static*/void sub_81058A0(void); -/*static*/void sub_81058C4(void); -/*static*/void sub_81059B8(void); -/*static*/void sub_81059E8(void); -/*static*/bool8 sub_8105ACC(void); -/*static*/void sub_8105AEC(void); -/*static*/u8 sub_8105B1C(s16 x, s16 y); -/*static*/void sub_8105B88(u8 spriteId); -/*static*/u8 sub_8105BF8(u8 templateIdx, void (*callback)(struct Sprite*), s16 x, s16 y, s16 a4); -/*static*/void sub_81063C0(void); -/*static*/void sub_8106404(void); -/*static*/void sub_8106448(void); -/*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_812F958(void); -/*static*/void sub_812F968(void); -void LoadSlotMachineWheelOverlay(void); -u8 sub_8105BB4(u8 templateIdx, u8 cbAndCoordsIdx, s16 a2); +/*static */void CB2_SlotMachineSetup(void); +/*static */void CB2_SlotMachineLoop(void); +/*static */void PlaySlotMachine_Internal(u8 arg0, MainCallback cb); +/*static */void SlotMachineDummyTask(u8 taskId); +/*static */void SlotMachineSetup_0_0(void); +/*static */void SlotMachineSetup_6_2(void); +/*static */void SlotMachineSetup_1_0(void); +/*static */void SlotMachineSetup_2_0(void); +/*static */void SlotMachineSetup_2_1(void); +/*static */void SlotMachineSetup_0_1(void); +/*static */void SlotMachineSetup_3_0(void); +/*static */void SlotMachineSetup_4_0(void); +/*static */void SlotMachineSetup_5_0(void); +/*static */void SlotMachineSetup_6_0(void); +/*static */void SlotMachineSetup_6_1(void); +/*static */void SlotMachineSetup_8_0(void); +/*static */void SlotMachineSetup_9_0(void); +/*static */void SlotMachineSetup_10_0(void); +/*static */void SlotMachineSetup_10_1(void); +/*static */void sub_8101D04(void); +/*static */void sub_8104DA4(void); +/*static */void sub_8101D24(u8 taskId); +/*static */bool8 sub_8101D5C(struct Task *task); +/*static */bool8 sub_8101D8C(struct Task *task); +/*static */bool8 sub_8101DB0(struct Task *task); +/*static */bool8 sub_8101DF4(struct Task *task); +/*static */bool8 sub_8101E10(struct Task *task); +/*static */bool8 sub_8101E3C(struct Task *task); +/*static */bool8 sub_8101F44(struct Task *task); +/*static */bool8 sub_8101F60(struct Task *task); +/*static */bool8 sub_8101F88(struct Task *task); +/*static */bool8 sub_8101FA4(struct Task *task); +/*static */bool8 sub_8102008(struct Task *task); +/*static */bool8 sub_8102034(struct Task *task); +/*static */bool8 sub_8102058(struct Task *task); +/*static */bool8 sub_8102090(struct Task *task); +/*static */bool8 sub_81020C8(struct Task *task); +/*static */bool8 sub_81021E0(struct Task *task); +/*static */bool8 sub_81021FC(struct Task *task); +/*static */bool8 sub_8102264(struct Task *task); +/*static */bool8 sub_81022A0(struct Task *task); +/*static */bool8 sub_81022CC(struct Task *task); +/*static */bool8 sub_81022F0(struct Task *task); +/*static */bool8 sub_8102318(struct Task *task); +/*static */bool8 sub_8102344(struct Task *task); +/*static */bool8 sub_810239C(struct Task *task); +/*static */bool8 sub_81023B8(struct Task *task); +/*static */bool8 sub_81023E0_(struct Task *task); +/*static */bool8 sub_81023FC(struct Task *task); +/*static */bool8 sub_8102424(struct Task *task); +/*static */bool8 sub_8102460(struct Task *task); +/*static */void sub_8102484(void); +/*static */void sub_81024F0(void); +/*static */bool8 sub_8102540_(void); +/*static */u8 sub_8102578(void); +/*static */u16 dp15_jump_random_unknown(void); +/*static */u8 sub_81025BC(void); +/*static */void CheckMatch(void); +/*static */void CheckMatch_CenterRow(void); +/*static */void CheckMatch_TopAndBottom(void); +/*static */void CheckMatch_Diagonals(void); +/*static */u8 GetMatchFromSymbolsInRow(u8 c1, u8 c2, u8 c3); +/*static */void sub_8102A24(void); +/*static */void sub_8102A64(u8 taskId); +/*static */bool8 sub_8102A44(void); +/*static */bool8 sub_8102A9C(struct Task *task); +/*static */bool8 sub_8102AD0(struct Task *task); +/*static */bool8 sub_8102B80(struct Task *task); +/*static */u8 GetTagOfReelSymbolOnScreenAtPos(u8 x, s16 y); +/*static */void sub_8102DA8(void); +/*static */void sub_8102DEC(u8 a0); +/*static */void sub_8102E1C(u8 a0); +/*static */bool8 sub_8102E40(u8 a0); +/*static */void sub_8102E68(u8 taskId); +/*static */bool8 sub_8102EA0(struct Task *task); +/*static */bool8 sub_8102EA4(struct Task *task); +/*static */bool8 sub_8102EC0(struct Task *task); +/*static */bool8 sub_8102F4C(struct Task *task); +/*static */bool8 sub_8103008(struct Task *task); +/*static */bool8 sub_810305C(void); +/*static */bool8 sub_8103154(u8 a0, u8 a1); +/*static */bool8 sub_81031B4(u8 a0, u8 a1); +/*static */bool8 sub_81032C0(void); +/*static */bool8 sub_81032E8(void); +/*static */bool8 sub_810333C(void); +/*static */bool8 sub_81033DC(void); +/*static */bool8 sub_810341C(u8 a0); +/*static */bool8 sub_810347C(u8 a0); +/*static */void sub_81034F4(void); +/*static */void sub_8103540(void); +/*static */void sub_8103564(void); +/*static */void j5_08111E84(void); +/*static */void sub_8103668(void); +/*static */void sub_810380C(void); +/*static */void sub_8103830(void); +/*static */void sub_8103910(void); +/*static */void sub_8103A78(void); +/*static */void sub_8103C14(u8 a0); +/*static */void sub_8103C48(u8 taskId); +/*static */void sub_8103D50(u8 a0); +/*static */void sub_8103C78(struct Task *task, u8 taskId); +/*static */void sub_8103CAC(struct Task *task, u8 taskId); +/*static */void sub_8103CC8(struct Task *task, u8 taskId); +/*static */void sub_8103D8C(u8 a0); +/*static */void sub_8103DC8(void); +/*static */void sub_8103E04(u8 a0); +/*static */bool8 sub_8103E38(void); +/*static */bool8 sub_8103E7C(void); +/*static */bool8 sub_8103EAC(u8 spriteId); +/*static */void sub_8103EE4(struct Sprite *sprite); +/*static */void sub_8103F70(void); +/*static */bool8 sub_8103FA0(void); +/*static */void sub_8103FE8_(u8 taskId); +/*static */void sub_8104048(void); +/*static */void sub_8104064(u8 pikaPower); +/*static */bool8 sub_81040C8(void); +/*static */void sub_81040E8(u8 taskId); +/*static */void nullsub_68(struct Task *task); +/*static */void sub_810411C(struct Task *task); +/*static */void sub_8104144(struct Task *task); +/*static */void sub_81041AC(struct Task *task); +/*static */void sub_812D394(struct Task *task); +/*static */void sub_810423C(u8 pikaPower); +/*static */void sub_810430C(void); +/*static */bool8 sub_810432C(void); +/*static */void sub_810434C(u8 taskId); +/*static */void sub_810437C(struct Task *task); +/*static */void sub_81043EC(struct Task *task); +/*static */void sub_8104468(struct Task *task); +/*static */void sub_8104498(struct Task *task); +/*static */void sub_8104548(struct Task *task); +/*static */void sub_8104598(struct Task *task); +/*static */void sub_81045CC(struct Task *task); +/*static */void sub_810463C(struct Task *task); +/*static */void sub_81046C0(struct Task *task); +/*static */void sub_8104764(struct Task *task); +/*static */void sub_8104794(struct Task *task); +/*static */void sub_81047EC(struct Task *task); +/*static */void sub_8104860(struct Task *task); +/*static */void sub_81048A8(struct Task *task); +/*static */void sub_81048CC(struct Task *task); +/*static */void sub_8104940(struct Task *task); +/*static */void sub_81049C8(struct Task *task); +/*static */void sub_81049F8(struct Task *task); +/*static */void sub_8104A40(s16 a0, s16 a1); +/*static */void sub_8104A88(s16 a0); +/*static */void sub_8104AB8(u8 a0); +/*static */bool8 sub_8104AEC(void); +/*static */void sub_8104B0C(u8 taskId); +/*static */void sub_8104B3C(struct Task *task); +/*static */void sub_8104B60(struct Task *task); +/*static */void sub_8104B80(struct Task *task); +/*static */void sub_8104BC8(struct Task *task); +/*static */void sub_812DD78(struct Task *task); +/*static */void sub_8104BFC(struct Task *task); +/*static */void sub_812DE14(struct Task *task); +/*static */void sub_812DE30(struct Task *task); +/*static */void sub_8104C44(struct Task *task); +/*static */void sub_8104C5C(void); +/*static */void sub_8104CAC(u8 arg0); +/*static */bool8 sub_8104E18(void); +/*static */void nullsub_69(struct Task *task); +/*static */void sub_8104E74_(u8 taskId); +/*static */void sub_8104EA8(void); +/*static */void sub_8104F8C(void); +/*static */void sub_8104FF4(s16 x, s16 y, u8 a2, s16 a3); +/*static */void sub_81050C4(void); +/*static */void sub_8105100(void); +/*static */void sub_810514C(void); +/*static */void sub_81051C0(void); +/*static */void sub_8105284_(void); +/*static */void sub_81052EC(void); +/*static */void sub_81053A0(void); +/*static */void sub_810545C(void); +/*static */void sub_81054B8(void); +/*static */void sub_8105524(void); +/*static */void sub_8105554(void); +/*static */void sub_8105578(void); +/*static */void sub_8105688(s16 a0); +/*static */void sub_81056C0(void); +/*static */void sub_81056F0(void); +/*static */void sub_81057E8(s16 a0); +/*static */void sub_8105804(void); +/*static */void sub_8105854(void); +/*static */void sub_81058A0(void); +/*static */void sub_81058C4(void); +/*static */void sub_81059B8(void); +/*static */void sub_81059E8(void); +/*static */bool8 sub_8105ACC(void); +/*static */void sub_8105AEC(void); +/*static */u8 sub_8105B1C(s16 x, s16 y); +/*static */void sub_8105B88(u8 spriteId); +/*static */u8 sub_8105BF8(u8 templateIdx, void (*callback)(struct Sprite*), s16 x, s16 y, s16 a4); +/*static */void sub_81063C0(void); +/*static */void sub_8106404(void); +/*static */void sub_8106448(void); +/*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_812F958(void); +/*static */void sub_812F968(void); +/*static */void LoadSlotMachineWheelOverlay(void); +/*static */u8 sub_8105BB4(u8 templateIdx, u8 cbAndCoordsIdx, s16 a2); + +// Ewram variables +static EWRAM_DATA u16 *gUnknown_0203AAC8 = NULL; +static EWRAM_DATA u16 *gUnknown_0203AACC = NULL; +static EWRAM_DATA u16 *gUnknown_0203AAD0 = NULL; +static EWRAM_DATA u8 *gUnknown_0203AAD4 = NULL; +static EWRAM_DATA u8 *gUnknown_0203AAD8 = NULL; +static EWRAM_DATA u16 *gUnknown_0203AADC = NULL; +static EWRAM_DATA u8 *gUnknown_0203AAE0 = NULL; +static EWRAM_DATA struct SpriteFrameImage *gUnknown_0203AAE4 = NULL; +static EWRAM_DATA struct SpriteFrameImage *gUnknown_0203AAE8 = NULL; +static EWRAM_DATA struct SpriteFrameImage *gUnknown_0203AAEC = NULL; +static EWRAM_DATA struct SpriteFrameImage *gUnknown_0203AAF0 = NULL; +static EWRAM_DATA struct SpriteFrameImage *gUnknown_0203AAF4 = NULL; +static EWRAM_DATA struct SpriteFrameImage *gUnknown_0203AAF8 = NULL; +static EWRAM_DATA struct SpriteFrameImage *gUnknown_0203AAFC = NULL; +static EWRAM_DATA struct SpriteFrameImage *gUnknown_0203AB00 = NULL; +static EWRAM_DATA struct SpriteFrameImage *gUnknown_0203AB04 = NULL; +static EWRAM_DATA struct SpriteFrameImage *gUnknown_0203AB08 = NULL; +static EWRAM_DATA struct SpriteFrameImage *gUnknown_0203AB0C = NULL; +static EWRAM_DATA struct SpriteFrameImage *gUnknown_0203AB10 = NULL; +static EWRAM_DATA struct SpriteFrameImage *gUnknown_0203AB14 = NULL; +static EWRAM_DATA struct SpriteFrameImage *gUnknown_0203AB18 = NULL; +static EWRAM_DATA struct SpriteFrameImage *gUnknown_0203AB1C = NULL; +static EWRAM_DATA struct SpriteFrameImage *gUnknown_0203AB20 = NULL; +static EWRAM_DATA struct SpriteFrameImage *gUnknown_0203AB24 = NULL; +static EWRAM_DATA struct SpriteFrameImage *gUnknown_0203AB28 = NULL; +static EWRAM_DATA struct SpriteSheet *gUnknown_0203AB2C = NULL; +static EWRAM_DATA struct SpriteSheet *gUnknown_0203AB30 = NULL; +static EWRAM_DATA struct SlotMachineEwramStruct *sSlotMachine = NULL; + +// IWRAM bss +static IWRAM_DATA struct SpriteFrameImage *gUnknown_03001188[26]; // Const rom data. -/*static*/extern const struct UnkStruct1 *const gUnknown_083ED048[]; -/*static*/extern const u16 gPalette_83EDE24[]; -/*static*/extern const u8 gUnknown_083ECD04[][3]; -/*static*/extern const u8 gUnknown_083ECE3A[]; -/*static*/extern const u16 gUnknown_083ECE42[]; -/*static*/extern const u16 gUnknown_083ECE48[]; +extern const struct UnkStruct1 *const gUnknown_083ED048[]; +extern const u16 gPalette_83EDE24[]; +extern const u8 gUnknown_083ECD04[][3]; +extern const u8 gUnknown_083ECE3A[]; +extern const u16 gUnknown_083ECE42[]; +extern const u16 gUnknown_083ECE48[]; extern const s16 gUnknown_083ECE7E[][2]; extern const SpriteCallback gUnknown_083ECF0C[]; extern const struct SpriteTemplate *const gUnknown_083EDB5C[]; @@ -370,7 +372,7 @@ 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 u8 gUnknown_083ECC58[2]; extern const struct SpriteTemplate gSpriteTemplate_83ED51C; extern const u16 gUnknown_083ECE12[]; extern const u16 *const gUnknown_083EDE10[]; @@ -654,7 +656,7 @@ extern const struct SpriteTemplate gSpriteTemplate_83ED45C; // code #define tState data[0] -void Task_FadeToSlotMachine(u8 taskId) +/*static */void Task_FadeToSlotMachine(u8 taskId) { switch (gTasks[taskId].tState) { @@ -684,7 +686,7 @@ void PlaySlotMachine(u8 arg0, MainCallback cb) #undef tState -void CB2_SlotMachineSetup(void) +/*static */void CB2_SlotMachineSetup(void) { switch (gMain.state) { @@ -745,7 +747,7 @@ void CB2_SlotMachineSetup(void) } } -void CB2_SlotMachineLoop(void) +/*static */void CB2_SlotMachineLoop(void) { RunTasks(); AnimateSprites(); @@ -753,7 +755,7 @@ void CB2_SlotMachineLoop(void) UpdatePaletteFade(); } -void SlotMachine_VBlankCallback(void) +/*static */void SlotMachine_VBlankCallback(void) { LoadOam(); ProcessSpriteCopyRequests(); @@ -764,25 +766,25 @@ void SlotMachine_VBlankCallback(void) SetGpuReg(REG_OFFSET_WINOUT, sSlotMachine->winOut); } -void PlaySlotMachine_Internal(u8 arg0, MainCallback cb) +/*static */void PlaySlotMachine_Internal(u8 arg0, MainCallback cb) { struct Task *task = gTasks + CreateTask(SlotMachineDummyTask, 0xFF); task->data[0] = arg0; StoreWordInTwoHalfwords(task->data + 1, (intptr_t)cb); } -void sub_81019EC(void) +/*static */void sub_81019EC(void) { struct Task *task = gTasks + FindTaskIdByFunc(SlotMachineDummyTask); sSlotMachine->unk01 = task->data[0]; LoadWordFromTwoHalfwords((u16 *)(task->data + 1), (u32 *)&sSlotMachine->prevMainCb); } -void SlotMachineDummyTask(u8 taskId) +/*static */void SlotMachineDummyTask(u8 taskId) { } -void SlotMachineSetup_0_0(void) +/*static */void SlotMachineSetup_0_0(void) { SetVBlankCallback(NULL); SetHBlankCallback(NULL); @@ -793,24 +795,24 @@ void SlotMachineSetup_0_0(void) DeactivateAllTextPrinters(); } -void SlotMachineSetup_6_0(void) +/*static */void SlotMachineSetup_6_0(void) { SetVBlankCallback(SlotMachine_VBlankCallback); EnableInterrupts(INTR_FLAG_VBLANK); SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_1D_MAP | DISPCNT_OBJ_ON | DISPCNT_WIN0_ON); } -void SlotMachineSetup_1_0(void) +/*static */void SlotMachineSetup_1_0(void) { DmaClearLarge16(3, (u16 *)(BG_VRAM), BG_VRAM_SIZE, 0x1000); } -void SlotMachineSetup_2_0(void) +/*static */void SlotMachineSetup_2_0(void) { DmaClear16(3, (u16 *)OAM, OAM_SIZE); } -void SlotMachineSetup_2_1(void) +/*static */void SlotMachineSetup_2_1(void) { SetGpuReg(REG_OFFSET_BG0CNT, 0); SetGpuReg(REG_OFFSET_BG1CNT, 0); @@ -830,7 +832,7 @@ void SlotMachineSetup_2_1(void) SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(9, 8)); } -void SlotMachineSetup_0_1(void) +/*static */void SlotMachineSetup_0_1(void) { u8 i; @@ -863,7 +865,7 @@ void SlotMachineSetup_0_1(void) sub_80EDE70(GetCoins()); } -void SlotMachineSetup_3_0(void) +/*static */void SlotMachineSetup_3_0(void) { ResetPaletteFade(); ResetSpriteData(); @@ -872,7 +874,7 @@ void SlotMachineSetup_3_0(void) ResetTasks(); } -void SlotMachineSetup_4_0(void) +/*static */void SlotMachineSetup_4_0(void) { gUnknown_0203AACC = Alloc(8); gUnknown_0203AAD0 = AllocZeroed(0xE); @@ -887,7 +889,7 @@ void SlotMachineSetup_4_0(void) gUnknown_0203AAD0[6] = 0x20BF; } -void SlotMachineSetup_5_0(void) +/*static */void SlotMachineSetup_5_0(void) { sub_8106448(); sub_81064B8(); @@ -897,7 +899,7 @@ void SlotMachineSetup_5_0(void) PutWindowTilemap(0); } -void SlotMachineSetup_10_0(void) +/*static */void SlotMachineSetup_10_0(void) { sub_8104EA8(); sub_8104F8C(); @@ -905,7 +907,7 @@ void SlotMachineSetup_10_0(void) sub_81050C4(); } -void SlotMachineSetup_10_1(void) +/*static */void SlotMachineSetup_10_1(void) { sub_8104048(); sub_8102DA8(); @@ -913,18 +915,18 @@ void SlotMachineSetup_10_1(void) sub_8101D04(); } -void sub_8101D04(void) +/*static */void sub_8101D04(void) { sub_8101D24(CreateTask(sub_8101D24, 0)); } -void sub_8101D24(u8 taskId) +/*static */void sub_8101D24(u8 taskId) { while (gUnknown_083ECAAC[sSlotMachine->state](gTasks + taskId)) ; } -bool8 sub_8101D5C(struct Task *task) +/*static */bool8 sub_8101D5C(struct Task *task) { BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB(0, 0, 0)); sub_810423C(sSlotMachine->pikaPower); @@ -932,14 +934,14 @@ bool8 sub_8101D5C(struct Task *task) return FALSE; } -bool8 sub_8101D8C(struct Task *task) +/*static */bool8 sub_8101D8C(struct Task *task) { if (!gPaletteFade.active) sSlotMachine->state++; return FALSE; } -bool8 sub_8101DB0(struct Task *task) +/*static */bool8 sub_8101DB0(struct Task *task) { sSlotMachine->payout = 0; sSlotMachine->bet = 0; @@ -958,14 +960,14 @@ bool8 sub_8101DB0(struct Task *task) return TRUE; } -bool8 sub_8101DF4(struct Task *task) +/*static */bool8 sub_8101DF4(struct Task *task) { if (sub_8104E18()) sSlotMachine->state = 4; return FALSE; } -bool8 sub_8101E10(struct Task *task) +/*static */bool8 sub_8101E10(struct Task *task) { sub_8104CAC(0); sSlotMachine->state = 5; @@ -974,7 +976,7 @@ bool8 sub_8101E10(struct Task *task) return TRUE; } -bool8 sub_8101E3C(struct Task *task) +/*static */bool8 sub_8101E3C(struct Task *task) { s16 i; @@ -1016,7 +1018,7 @@ bool8 sub_8101E3C(struct Task *task) return FALSE; } -bool8 sub_8101F44(struct Task *task) +/*static */bool8 sub_8101F44(struct Task *task) { NewMenuHelpers_DrawDialogueFrame(0, 0); AddTextPrinterParameterized(0, 1, gText_YouDontHaveThreeCoins, 0, 1, 0, 0); @@ -1025,7 +1027,7 @@ bool8 sub_8101F44(struct Task *task) return FALSE; } -bool8 sub_8101F60(struct Task *task) +/*static */bool8 sub_8101F60(struct Task *task) { if (gMain.newKeys & (A_BUTTON | B_BUTTON)) { @@ -1035,14 +1037,14 @@ bool8 sub_8101F60(struct Task *task) return FALSE; } -bool8 sub_8101F88(struct Task *task) +/*static */bool8 sub_8101F88(struct Task *task) { if (sub_8104AEC()) sSlotMachine->state = 5; return FALSE; } -bool8 sub_8101FA4(struct Task *task) +/*static */bool8 sub_8101FA4(struct Task *task) { sub_8102484(); sub_8104DA4(); @@ -1067,7 +1069,7 @@ bool8 sub_8101FA4(struct Task *task) return FALSE; } -bool8 sub_8102008(struct Task *task) +/*static */bool8 sub_8102008(struct Task *task) { if (sub_810432C()) { @@ -1078,7 +1080,7 @@ bool8 sub_8102008(struct Task *task) return FALSE; } -bool8 sub_8102034(struct Task *task) +/*static */bool8 sub_8102034(struct Task *task) { if (++task->data[0] >= 30) { @@ -1088,7 +1090,7 @@ bool8 sub_8102034(struct Task *task) return FALSE; } -bool8 sub_8102058(struct Task *task) +/*static */bool8 sub_8102058(struct Task *task) { if (gMain.newKeys & A_BUTTON) { @@ -1100,7 +1102,7 @@ bool8 sub_8102058(struct Task *task) return FALSE; } -bool8 sub_8102090(struct Task *task) +/*static */bool8 sub_8102090(struct Task *task) { if (!sub_8102E40(sSlotMachine->unk18)) { @@ -1115,7 +1117,7 @@ bool8 sub_8102090(struct Task *task) return FALSE; } -bool8 sub_81020C8(struct Task *task) +/*static */bool8 sub_81020C8(struct Task *task) { sSlotMachine->unk04 &= 0xc0; CheckMatch(); @@ -1177,14 +1179,14 @@ bool8 sub_81020C8(struct Task *task) return FALSE; } -bool8 sub_81021E0(struct Task *task) +/*static */bool8 sub_81021E0(struct Task *task) { if (sub_8102A44()) sSlotMachine->state = 16; return FALSE; } -bool8 sub_81021FC(struct Task *task) +/*static */bool8 sub_81021FC(struct Task *task) { if (sub_8103FA0()) { @@ -1207,7 +1209,7 @@ bool8 sub_81021FC(struct Task *task) return FALSE; } -bool8 sub_8102264(struct Task *task) +/*static */bool8 sub_8102264(struct Task *task) { if (!sub_81040C8()) { @@ -1225,7 +1227,7 @@ bool8 sub_8102264(struct Task *task) return FALSE; } -bool8 sub_81022A0(struct Task *task) +/*static */bool8 sub_81022A0(struct Task *task) { if (sub_8104E18()) { @@ -1238,7 +1240,7 @@ bool8 sub_81022A0(struct Task *task) return FALSE; } -bool8 sub_81022CC(struct Task *task) +/*static */bool8 sub_81022CC(struct Task *task) { sub_8103D8C(0); sub_8103D8C(1); @@ -1247,7 +1249,7 @@ bool8 sub_81022CC(struct Task *task) return FALSE; } -bool8 sub_81022F0(struct Task *task) +/*static */bool8 sub_81022F0(struct Task *task) { if (++task->data[1] > 64) { @@ -1257,7 +1259,7 @@ bool8 sub_81022F0(struct Task *task) return FALSE; } -bool8 sub_8102318(struct Task *task) +/*static */bool8 sub_8102318(struct Task *task) { NewMenuHelpers_DrawDialogueFrame(0, 0); AddTextPrinterParameterized(0, 1, gText_QuitTheGame, 0, 1, 0, 0); @@ -1267,7 +1269,7 @@ bool8 sub_8102318(struct Task *task) return FALSE; } -bool8 sub_8102344(struct Task *task) +/*static */bool8 sub_8102344(struct Task *task) { s8 input = Menu_ProcessInputNoWrap_(); if (input == 0) @@ -1287,7 +1289,7 @@ bool8 sub_8102344(struct Task *task) return FALSE; } -bool8 sub_810239C(struct Task *task) +/*static */bool8 sub_810239C(struct Task *task) { NewMenuHelpers_DrawDialogueFrame(0, 0); AddTextPrinterParameterized(0, 1, gText_YouveGot9999Coins, 0, 1, 0, 0); @@ -1296,7 +1298,7 @@ bool8 sub_810239C(struct Task *task) return FALSE; } -bool8 sub_81023B8(struct Task *task) +/*static */bool8 sub_81023B8(struct Task *task) { if (gMain.newKeys & (A_BUTTON | B_BUTTON)) { @@ -1306,7 +1308,7 @@ bool8 sub_81023B8(struct Task *task) return FALSE; } -bool8 sub_81023E0_(struct Task *task) +/*static */bool8 sub_81023E0_(struct Task *task) { NewMenuHelpers_DrawDialogueFrame(0, 0); AddTextPrinterParameterized(0, 1, gText_YouveRunOutOfCoins, 0, 1, 0, 0); @@ -1315,7 +1317,7 @@ bool8 sub_81023E0_(struct Task *task) return FALSE; } -bool8 sub_81023FC(struct Task *task) +/*static */bool8 sub_81023FC(struct Task *task) { if (gMain.newKeys & (A_BUTTON | B_BUTTON)) { @@ -1325,7 +1327,7 @@ bool8 sub_81023FC(struct Task *task) return FALSE; } -bool8 sub_8102424(struct Task *task) +/*static */bool8 sub_8102424(struct Task *task) { SetCoins(sSlotMachine->coins); sub_80EDD78(GetCoins()); @@ -1334,7 +1336,7 @@ bool8 sub_8102424(struct Task *task) return FALSE; } -bool8 sub_8102460(struct Task *task) +/*static */bool8 sub_8102460(struct Task *task) { if (!gPaletteFade.active) { @@ -1376,7 +1378,7 @@ bool8 sub_8102460(struct Task *task) return FALSE; } -void sub_8102484(void) +/*static */void sub_8102484(void) { u8 r3; @@ -1405,14 +1407,14 @@ void sub_8102484(void) } } -void sub_81024F0(void) +/*static */void sub_81024F0(void) { sSlotMachine->unk06 = 0; if (sSlotMachine->unk04) sSlotMachine->unk06 = 1; } -u8 sub_810250C(u8 a0) +/*static */u8 sub_810250C(u8 a0) { u8 i; @@ -1425,7 +1427,7 @@ u8 sub_810250C(u8 a0) return 0; } -bool8 sub_8102540_(void) +/*static */bool8 sub_8102540_(void) { u8 rval = Random(); if (gUnknown_083ECD04[sSlotMachine->unk01][sSlotMachine->bet - 1] > rval) @@ -1433,7 +1435,7 @@ bool8 sub_8102540_(void) return FALSE; } -u8 sub_8102578(void) +/*static */u8 sub_8102578(void) { s16 i; @@ -1447,7 +1449,7 @@ u8 sub_8102578(void) return i; } -u8 sub_81025BC(void) +/*static */u8 sub_81025BC(void) { s16 i; @@ -1473,7 +1475,7 @@ u8 sub_81025BC(void) return i; } -u8 sub_810264C(u8 a0) +/*static */u8 sub_810264C(u8 a0) { if (sSlotMachine->unk03 == 0) return gUnknown_083ECD46[a0][sSlotMachine->pikaPower]; @@ -1481,7 +1483,7 @@ u8 sub_810264C(u8 a0) return gUnknown_083ECDAC[a0][sSlotMachine->pikaPower]; } -void sub_8102680(void) +/*static */void sub_8102680(void) { u8 rval; s16 i; @@ -1499,7 +1501,7 @@ void sub_8102680(void) sSlotMachine->unk05 = i; } -bool8 sub_81026DC(u16 a0) +/*static */bool8 sub_81026DC(u16 a0) { u16 rval = Random() & 0xff; if (rval < gUnknown_083ECE12[a0]) @@ -1508,7 +1510,7 @@ bool8 sub_81026DC(u16 a0) return FALSE; } -u16 dp15_jump_random_unknown(void) +/*static */u16 dp15_jump_random_unknown(void) { u8 r4 = 0; u8 rval; @@ -1532,7 +1534,7 @@ u16 dp15_jump_random_unknown(void) return 8; } -void CheckMatch(void) +/*static */void CheckMatch(void) { sSlotMachine->matchedSymbols = 0; CheckMatch_CenterRow(); @@ -1542,7 +1544,7 @@ void CheckMatch(void) CheckMatch_Diagonals(); } -void CheckMatch_CenterRow(void) +/*static */void CheckMatch_CenterRow(void) { u8 c1, c2, c3, match; @@ -1558,7 +1560,7 @@ void CheckMatch_CenterRow(void) } } -void CheckMatch_TopAndBottom(void) +/*static */void CheckMatch_TopAndBottom(void) { u8 c1, c2, c3, match; @@ -1588,7 +1590,7 @@ void CheckMatch_TopAndBottom(void) } } -void CheckMatch_Diagonals(void) +/*static */void CheckMatch_Diagonals(void) { u8 c1, c2, c3, match; @@ -1620,7 +1622,7 @@ void CheckMatch_Diagonals(void) } } -u8 GetMatchFromSymbolsInRow(u8 c1, u8 c2, u8 c3) +/*static */u8 GetMatchFromSymbolsInRow(u8 c1, u8 c2, u8 c3) { if (c1 == c2 && c1 == c3) return sSym2Match[c1]; @@ -1633,12 +1635,12 @@ u8 GetMatchFromSymbolsInRow(u8 c1, u8 c2, u8 c3) return SLOT_MACHINE_MATCHED_NONE; } -void sub_8102A24(void) +/*static */void sub_8102A24(void) { sub_8102A64(CreateTask(sub_8102A64, 4)); } -bool8 sub_8102A44(void) +/*static */bool8 sub_8102A44(void) { if (FindTaskIdByFunc(sub_8102A64) == 0xff) return TRUE; @@ -1646,13 +1648,13 @@ bool8 sub_8102A44(void) return FALSE; } -void sub_8102A64(u8 taskId) +/*static */void sub_8102A64(u8 taskId) { while (gUnknown_083ECB20[gTasks[taskId].data[0]](gTasks + taskId)) ; } -bool8 sub_8102A9C(struct Task *task) +/*static */bool8 sub_8102A9C(struct Task *task) { if (sub_8103E38()) { @@ -1666,7 +1668,7 @@ bool8 sub_8102A9C(struct Task *task) return FALSE; } -bool8 sub_8102AD0(struct Task *task) +/*static */bool8 sub_8102AD0(struct Task *task) { if (!task->data[1]--) { @@ -1692,14 +1694,14 @@ bool8 sub_8102AD0(struct Task *task) return FALSE; } -bool8 sub_8102B80(struct Task *task) +/*static */bool8 sub_8102B80(struct Task *task) { if (sub_8103E7C()) DestroyTask(FindTaskIdByFunc(sub_8102A64)); return FALSE; } -u8 GetTagOfReelSymbolOnScreenAtPos(u8 x, s16 y) +/*static */u8 GetTagOfReelSymbolOnScreenAtPos(u8 x, s16 y) { s16 offset = (sSlotMachine->reelPositions[x] + y) % 21; if (offset < 0) @@ -1707,7 +1709,7 @@ u8 GetTagOfReelSymbolOnScreenAtPos(u8 x, s16 y) return sReelSymbols[x][offset]; } -u8 GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(u8 x, s16 y) +/*static */u8 GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(u8 x, s16 y) { s16 r6 = 0; s16 result = sSlotMachine->unk1C[x] % 24; @@ -1716,7 +1718,7 @@ u8 GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(u8 x, s16 y) return GetTagOfReelSymbolOnScreenAtPos(x, y + r6); } -u8 sub_8102C48(s16 a0) +/*static */u8 sub_8102C48(s16 a0) { s16 r1 = (sSlotMachine->unk16 + a0) % 6; if (r1 < 0) @@ -1724,7 +1726,7 @@ u8 sub_8102C48(s16 a0) return gUnknown_083ECCF1[r1]; } -void sub_8102C84(u8 a0, s16 a1) +/*static */void sub_8102C84(u8 a0, s16 a1) { sSlotMachine->unk1C[a0] += a1; sSlotMachine->unk1C[a0] %= 504; @@ -1744,7 +1746,7 @@ s16 sub_8102CCC(u8 a0, s16 a1) return r1; } -void sub_8102D28(s16 a0) +/*static */void sub_8102D28(s16 a0) { sSlotMachine->unk14 += a0; sSlotMachine->unk14 %= 120; @@ -1764,7 +1766,7 @@ s16 sub_8102D5C(s16 a0) return r1; } -void sub_8102DA8(void) +/*static */void sub_8102DA8(void) { u8 i; for (i = 0; i < 3; i++) @@ -1776,41 +1778,41 @@ void sub_8102DA8(void) } } -void sub_8102DEC(u8 a0) +/*static */void sub_8102DEC(u8 a0) { gTasks[sSlotMachine->reelTasks[a0]].data[0] = 1; gTasks[sSlotMachine->reelTasks[a0]].data[14] = 1; } -void sub_8102E1C(u8 a0) +/*static */void sub_8102E1C(u8 a0) { gTasks[sSlotMachine->reelTasks[a0]].data[0] = 2; } -bool8 sub_8102E40(u8 a0) +/*static */bool8 sub_8102E40(u8 a0) { return gTasks[sSlotMachine->reelTasks[a0]].data[14]; } -void sub_8102E68(u8 taskId) +/*static */void sub_8102E68(u8 taskId) { while (gUnknown_083ECB2C[gTasks[taskId].data[0]](gTasks + taskId)) ; } -bool8 sub_8102EA0(struct Task *task) +/*static */bool8 sub_8102EA0(struct Task *task) { return FALSE; } -bool8 sub_8102EA4(struct Task *task) +/*static */bool8 sub_8102EA4(struct Task *task) { sub_8102C84(task->data[15], sSlotMachine->unk1A); return FALSE; } -bool8 sub_8102EC0(struct Task *task) +/*static */bool8 sub_8102EC0(struct Task *task) { task->data[0]++; sSlotMachine->unk34[task->data[15]] = 0; @@ -1824,7 +1826,7 @@ bool8 sub_8102EC0(struct Task *task) return TRUE; } -bool8 sub_8102F4C(struct Task *task) +/*static */bool8 sub_8102F4C(struct Task *task) { u16 sp[ARRAY_COUNT(gUnknown_085A74FC)]; s16 r2; @@ -1848,7 +1850,7 @@ bool8 sub_8102F4C(struct Task *task) return FALSE; } -bool8 sub_8103008(struct Task *task) +/*static */bool8 sub_8103008(struct Task *task) { sSlotMachine->unk22[task->data[15]] = task->data[1]; task->data[1] = -task->data[1]; @@ -1864,7 +1866,7 @@ bool8 sub_8103008(struct Task *task) return FALSE; } -bool8 sub_810305C(void) +/*static */bool8 sub_810305C(void) { u8 r3 = sub_810250C(sSlotMachine->unk04); u8 r5 = r3; @@ -1876,7 +1878,7 @@ bool8 sub_810305C(void) return gUnknown_083ECB64[sSlotMachine->bet - 1](r5, r3); } -bool8 sub_81030A4(s16 y, u8 tag1, u8 tag2) +/*static */bool8 sub_81030A4(s16 y, u8 tag1, u8 tag2) { u8 tag = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(0, y); if (tag == tag1 || tag == tag2) @@ -1887,7 +1889,7 @@ bool8 sub_81030A4(s16 y, u8 tag1, u8 tag2) return FALSE; } -bool8 sub_81030E0(s16 y) +/*static */bool8 sub_81030E0(s16 y) { if (GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(0, 1 - y) == 4 || GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(0, 2 - y) == 4 || GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(0, 3 - y) == 4) return TRUE; @@ -1895,7 +1897,7 @@ bool8 sub_81030E0(s16 y) return FALSE; } -bool8 sub_8103134(void) +/*static */bool8 sub_8103134(void) { if (sSlotMachine->unk04 & 0xc2) return TRUE; @@ -1903,7 +1905,7 @@ bool8 sub_8103134(void) return FALSE; } -bool8 sub_8103154(u8 a0, u8 a1) +/*static */bool8 sub_8103154(u8 a0, u8 a1) { s16 i; @@ -1919,7 +1921,7 @@ bool8 sub_8103154(u8 a0, u8 a1) return FALSE; } -bool8 sub_81031B4(u8 tag1, u8 tag2) +/*static */bool8 sub_81031B4(u8 tag1, u8 tag2) { s16 i; bool8 r6 = sub_8103134(); @@ -1963,12 +1965,12 @@ bool8 sub_81031B4(u8 tag1, u8 tag2) return FALSE; } -bool8 sub_81032C0(void) +/*static */bool8 sub_81032C0(void) { return gUnknown_083ECB70[sSlotMachine->bet - 1](); } -bool8 sub_81032E8(void) +/*static */bool8 sub_81032E8(void) { s16 i; s16 unk34_0 = sSlotMachine->unk34[0]; @@ -1985,7 +1987,7 @@ bool8 sub_81032E8(void) return FALSE; } -bool8 sub_810333C(void) +/*static */bool8 sub_810333C(void) { s16 i; if (sub_81032E8()) @@ -2019,7 +2021,7 @@ bool8 sub_810333C(void) return FALSE; } -bool8 sub_81033DC(void) +/*static */bool8 sub_81033DC(void) { u8 r3 = sSlotMachine->unk07; if (sSlotMachine->unk04 & 0x40) @@ -2033,7 +2035,7 @@ bool8 sub_81033DC(void) return gUnknown_083ECB7C[sSlotMachine->bet - 1](r3); } -bool8 sub_810341C(u8 a0) +/*static */bool8 sub_810341C(u8 a0) { s16 i; s16 unk34_1 = sSlotMachine->unk34[1]; @@ -2050,7 +2052,7 @@ bool8 sub_810341C(u8 a0) return FALSE; } -bool8 sub_810347C(u8 a0) +/*static */bool8 sub_810347C(u8 a0) { s16 i; s16 r8; @@ -2072,7 +2074,7 @@ bool8 sub_810347C(u8 a0) return FALSE; } -void sub_81034F4(void) +/*static */void sub_81034F4(void) { s16 i = 0; @@ -2081,7 +2083,7 @@ void sub_81034F4(void) sSlotMachine->unk2E[0] = i; } -bool8 sub_8103520(u8 *a0) +/*static */bool8 sub_8103520(u8 *a0) { if (*a0 == 0) { @@ -2096,12 +2098,12 @@ bool8 sub_8103520(u8 *a0) return FALSE; } -void sub_8103540(void) +/*static */void sub_8103540(void) { gUnknown_083ECB88[sSlotMachine->bet - 1](); } -void sub_8103564(void) +/*static */void sub_8103564(void) { if (sSlotMachine->unk34[0] != 0 && sSlotMachine->unk04 & 0x80) { @@ -2122,7 +2124,7 @@ void sub_8103564(void) } } -void j5_08111E84(void) +/*static */void j5_08111E84(void) { if (sSlotMachine->unk34[0] != 0 && sSlotMachine->unk04 & 0x80) { @@ -2143,7 +2145,7 @@ void j5_08111E84(void) } } -void sub_8103668(void) +/*static */void sub_8103668(void) { s16 i; s16 j; @@ -2208,7 +2210,7 @@ void sub_8103668(void) } } -bool8 sub_8103764(u8 a0, u8 a1) +/*static */bool8 sub_8103764(u8 a0, u8 a1) { if ((a0 == 0 && a1 == 1) || (a0 == 1 && a1 == 0)) return TRUE; @@ -2216,7 +2218,7 @@ bool8 sub_8103764(u8 a0, u8 a1) return FALSE; } -bool8 sub_810378C(u8 a0, u8 a1, u8 a2) +/*static */bool8 sub_810378C(u8 a0, u8 a1, u8 a2) { if ((a0 == 0 && a1 == 1 && a2 == 0) || (a0 == 1 && a1 == 0 && a2 == 1)) return TRUE; @@ -2224,7 +2226,7 @@ bool8 sub_810378C(u8 a0, u8 a1, u8 a2) return FALSE; } -bool8 sub_81037BC(u8 a0, u8 a1, u8 a2) +/*static */bool8 sub_81037BC(u8 a0, u8 a1, u8 a2) { if ((a0 == 0 && a1 == 1 && a2 == 0) || (a0 == 1 && a1 == 0 && a2 == 1) || @@ -2237,12 +2239,12 @@ bool8 sub_81037BC(u8 a0, u8 a1, u8 a2) return TRUE; } -void sub_810380C(void) +/*static */void sub_810380C(void) { gUnknown_083ECB94[sSlotMachine->bet - 1](); } -void sub_8103830(void) +/*static */void sub_8103830(void) { s16 i = 0; u8 r5 = GetTagOfReelSymbolOnScreenAtPos_AdjustForPixelOffset(0, 2 - sSlotMachine->unk2E[0]); @@ -2281,7 +2283,7 @@ void sub_8103830(void) sSlotMachine->unk2E[2] = i; } -void sub_8103910(void) +/*static */void sub_8103910(void) { s16 sp0 = 0; s16 i; @@ -2327,7 +2329,7 @@ void sub_8103910(void) sSlotMachine->unk2E[2] = sp0; } -void sub_8103A78(void) +/*static */void sub_8103A78(void) { u8 r6; u8 r5; @@ -2376,61 +2378,61 @@ void sub_8103A78(void) } } -void sub_8103C14(u8 a0) +/*static */void sub_8103C14(u8 a0) { u8 taskId = CreateTask(sub_8103C48, 5); gTasks[taskId].data[15] = a0; sub_8103C48(taskId); } -void sub_8103C48(u8 taskId) +/*static */void sub_8103C48(u8 taskId) { gUnknown_083ECBA0[gTasks[taskId].data[0]](gTasks + taskId, taskId); } -void sub_8103C78(struct Task *task, u8 taskId) +/*static */void sub_8103C78(struct Task *task, u8 taskId) { sub_81065A8(gUnknown_083ECBAC[task->data[15]], 0x62, 0x63, 0x72, 0x73); task->data[0]++; } -void sub_8103CAC(struct Task *task, u8 taskId) +/*static */void sub_8103CAC(struct Task *task, u8 taskId) { if (++task->data[1] > 11) task->data[0]++; } -void sub_8103CC8(struct Task *task, u8 taskId) +/*static */void sub_8103CC8(struct Task *task, u8 taskId) { sub_81065A8(gUnknown_083ECBAC[task->data[15]], 0x42, 0x43, 0x52, 0x53); DestroyTask(taskId); } -void sub_8103D00(u8 a0) +/*static */void sub_8103D00(u8 a0) { LoadPalette(gUnknown_083EDD08[a0], gUnknown_083EDD30[a0], 2); } -void sub_8103D28(u8 a0) +/*static */void sub_8103D28(u8 a0) { LoadPalette(gUnknown_083EDD1C[a0], gUnknown_083EDD30[a0], 2); } -void sub_8103D50(u8 a0) +/*static */void sub_8103D50(u8 a0) { u8 i; for (i = 0; i < gUnknown_083EDD3B[a0]; i++) sub_8103D00(gUnknown_083EDD35[a0][i]); } -void sub_8103D8C(u8 a0) +/*static */void sub_8103D8C(u8 a0) { u8 i; for (i = 0; i < gUnknown_083EDD3B[a0]; i++) sub_8103D28(gUnknown_083EDD35[a0][i]); } -void sub_8103DC8(void) +/*static */void sub_8103DC8(void) { u8 i; for (i = 0; i < 5; i++) @@ -2441,7 +2443,7 @@ void sub_8103DC8(void) } } -void sub_8103E04(u8 a0) +/*static */void sub_8103E04(u8 a0) { struct Sprite *sprite = gSprites + sSlotMachine->unk44[a0]; sprite->data[1] = 1; @@ -2452,7 +2454,7 @@ void sub_8103E04(u8 a0) sprite->data[7] = 0; } -bool8 sub_8103E38(void) +/*static */bool8 sub_8103E38(void) { u8 i; for (i = 0; i < 5; i++) @@ -2464,7 +2466,7 @@ bool8 sub_8103E38(void) return TRUE; } -bool8 sub_8103E7C(void) +/*static */bool8 sub_8103E7C(void) { u8 i; for (i = 0; i < 5; i++) @@ -2475,7 +2477,7 @@ bool8 sub_8103E7C(void) return TRUE; } -bool8 sub_8103EAC(u8 spriteId) +/*static */bool8 sub_8103EAC(u8 spriteId) { struct Sprite *sprite = gSprites + spriteId; if (!sprite->data[1]) @@ -2485,7 +2487,7 @@ bool8 sub_8103EAC(u8 spriteId) return sprite->data[7]; } -void sub_8103EE4(struct Sprite *sprite) +/*static */void sub_8103EE4(struct Sprite *sprite) { s16 r4; if (sprite->data[1]) @@ -2514,14 +2516,14 @@ void sub_8103EE4(struct Sprite *sprite) } } -void sub_8103F70(void) +/*static */void sub_8103F70(void) { u8 taskId = CreateTask(sub_8103FE8_, 6); gTasks[taskId].data[3] = 1; sub_8103FE8_(taskId); } -bool8 sub_8103FA0(void) +/*static */bool8 sub_8103FA0(void) { u8 taskId = FindTaskIdByFunc(sub_8103FE8_); if (!gTasks[taskId].data[2]) @@ -2533,7 +2535,7 @@ bool8 sub_8103FA0(void) return FALSE; } -void sub_8103FE8_(u8 taskId) +/*static */void sub_8103FE8_(u8 taskId) { struct Task *task = gTasks + taskId; if (!task->data[1]--) @@ -2546,12 +2548,12 @@ void sub_8103FE8_(u8 taskId) LoadPalette(gUnknown_083EDDA0[task->data[2]], 0x10, 0x20); } -void sub_8104048(void) +/*static */void sub_8104048(void) { sSlotMachine->unk3E = CreateTask(sub_81040E8, 8); } -void sub_8104064(u8 pikaPower) +/*static */void sub_8104064(u8 pikaPower) { struct Task *task = gTasks + sSlotMachine->unk3E; sub_812D394(task); @@ -2560,7 +2562,7 @@ void sub_8104064(u8 pikaPower) task->data[15] = 1; } -void sub_8104098(void) +/*static */void sub_8104098(void) { struct Task *task = gTasks + sSlotMachine->unk3E; sub_812D394(task); @@ -2568,27 +2570,27 @@ void sub_8104098(void) task->data[15] = 1; } -bool8 sub_81040C8(void) +/*static */bool8 sub_81040C8(void) { return gTasks[sSlotMachine->unk3E].data[15]; } -void sub_81040E8(u8 taskId) +/*static */void sub_81040E8(u8 taskId) { gUnknown_083ECBB4[gTasks[taskId].data[0]](gTasks + taskId); } -void nullsub_68(struct Task *task) +/*static */void nullsub_68(struct Task *task) { } -void sub_810411C(struct Task *task) +/*static */void sub_810411C(struct Task *task) { task->data[2] = sub_8105B1C((task->data[1] << 3) + 20, 20); task->data[0]++; } -void sub_8104144(struct Task *task) +/*static */void sub_8104144(struct Task *task) { if (gSprites[task->data[2]].data[7]) { @@ -2607,7 +2609,7 @@ void sub_8104144(struct Task *task) } } -void sub_81041AC(struct Task *task) +/*static */void sub_81041AC(struct Task *task) { s16 r5 = task->data[1] + 2; s16 r3 = 0; @@ -2631,7 +2633,7 @@ void sub_81041AC(struct Task *task) } } -void sub_812D394(struct Task *task) +/*static */void sub_812D394(struct Task *task) { u8 i; @@ -2639,7 +2641,7 @@ void sub_812D394(struct Task *task) task->data[i] = 0; } -void sub_810423C(u8 pikaPower) +/*static */void sub_810423C(u8 pikaPower) { s16 i; s16 r3 = 0, r1 = 0; @@ -2667,25 +2669,25 @@ void sub_810423C(u8 pikaPower) gTasks[sSlotMachine->unk3E].data[1] = pikaPower; } -void sub_810430C(void) +/*static */void sub_810430C(void) { u8 taskId = CreateTask(sub_810434C, 7); sub_810434C(taskId); } -bool8 sub_810432C(void) +/*static */bool8 sub_810432C(void) { if (FindTaskIdByFunc(sub_810434C) == 0xFF) return TRUE; return FALSE; } -void sub_810434C(u8 taskId) +/*static */void sub_810434C(u8 taskId) { gUnknown_083ECBD0[gTasks[taskId].data[0]](gTasks + taskId); } -void sub_810437C(struct Task *task) +/*static */void sub_810437C(struct Task *task) { sSlotMachine->unk0A = 0; sSlotMachine->unk14 = 0; @@ -2709,7 +2711,7 @@ void sub_810437C(struct Task *task) PlayNewMapMusic(MUS_BD_TIME); } -void sub_81043EC(struct Task *task) +/*static */void sub_81043EC(struct Task *task) { s16 r3; gSpriteCoordOffsetX -= 8; @@ -2730,7 +2732,7 @@ void sub_81043EC(struct Task *task) sub_8102D28(task->data[4] >> 8); } -void sub_8104468(struct Task *task) +/*static */void sub_8104468(struct Task *task) { sub_8102D28(task->data[4] >> 8); if (++task->data[5] >= 60) @@ -2741,7 +2743,7 @@ void sub_8104468(struct Task *task) } } -void sub_8104498(struct Task *task) +/*static */void sub_8104498(struct Task *task) { int r5; u8 sp0[ARRAY_COUNT(gUnknown_085A75C0)]; @@ -2766,7 +2768,7 @@ void sub_8104498(struct Task *task) } } -void sub_8104548(struct Task *task) +/*static */void sub_8104548(struct Task *task) { sub_8102D28(task->data[4] >> 8); if (++task->data[5] >= 80) @@ -2778,7 +2780,7 @@ void sub_8104548(struct Task *task) } } -void sub_8104598(struct Task *task) +/*static */void sub_8104598(struct Task *task) { sub_8102D28(task->data[4] >> 8); task->data[4] = (u8)task->data[4] + 0x80; @@ -2789,7 +2791,7 @@ void sub_8104598(struct Task *task) } } -void sub_81045CC(struct Task *task) +/*static */void sub_81045CC(struct Task *task) { sub_8102D28(task->data[4] >> 8); task->data[4] = (u8)task->data[4] + 0x40; @@ -2813,7 +2815,7 @@ void sub_81045CC(struct Task *task) } } -void sub_810463C(struct Task *task) +/*static */void sub_810463C(struct Task *task) { s16 r5 = sSlotMachine->unk14 % 20; if (r5) @@ -2834,7 +2836,7 @@ void sub_810463C(struct Task *task) } } -void sub_81046C0(struct Task *task) +/*static */void sub_81046C0(struct Task *task) { if (++task->data[4] >= 60) { @@ -2863,13 +2865,13 @@ void sub_81046C0(struct Task *task) } } -void sub_8104764(struct Task *task) +/*static */void sub_8104764(struct Task *task) { if ((task->data[4] == 0 || --task->data[4] == 0) && !sub_81040C8()) task->data[0]++; } -void sub_8104794(struct Task *task) +/*static */void sub_8104794(struct Task *task) { s16 r4; gSpriteCoordOffsetX -= 8; @@ -2883,7 +2885,7 @@ void sub_8104794(struct Task *task) task->data[0]++; } -void sub_81047EC(struct Task *task) +/*static */void sub_81047EC(struct Task *task) { sSlotMachine->unk0B = 0; sSlotMachine->unk0A = sSlotMachine->unk05; @@ -2908,7 +2910,7 @@ void sub_81047EC(struct Task *task) } } -void sub_8104860(struct Task *task) +/*static */void sub_8104860(struct Task *task) { if (sSlotMachine->unk1A == task->data[1]) task->data[0]++; @@ -2916,13 +2918,13 @@ void sub_8104860(struct Task *task) sSlotMachine->unk1A >>= 1; } -void sub_81048A8(struct Task *task) +/*static */void sub_81048A8(struct Task *task) { if (sub_8104E18()) DestroyTask(FindTaskIdByFunc(sub_810434C)); } -void sub_81048CC(struct Task *task) +/*static */void sub_81048CC(struct Task *task) { sub_81054B8(); sub_81056C0(); @@ -2938,7 +2940,7 @@ void sub_81048CC(struct Task *task) PlaySE(SE_W153); } -void sub_8104940(struct Task *task) +/*static */void sub_8104940(struct Task *task) { gSpriteCoordOffsetY = task->data[4]; SetGpuReg(REG_OFFSET_BG1VOFS, task->data[4]); @@ -2958,7 +2960,7 @@ void sub_8104940(struct Task *task) } } -void sub_81049C8(struct Task *task) +/*static */void sub_81049C8(struct Task *task) { gSpriteCoordOffsetY = 0; SetGpuReg(REG_OFFSET_BG1VOFS, 0); @@ -2969,7 +2971,7 @@ void sub_81049C8(struct Task *task) } } -void sub_81049F8(struct Task *task) +/*static */void sub_81049F8(struct Task *task) { gSpriteCoordOffsetX = 0; SetGpuReg(REG_OFFSET_BG1HOFS, 0); @@ -2981,7 +2983,7 @@ void sub_81049F8(struct Task *task) DestroyTask(FindTaskIdByFunc(sub_810434C)); } -void sub_8104A40(s16 a0, s16 a1) +/*static */void sub_8104A40(s16 a0, s16 a1) { s16 i; @@ -2991,7 +2993,7 @@ void sub_8104A40(s16 a0, s16 a1) } } -void sub_8104A88(s16 a0) +/*static */void sub_8104A88(s16 a0) { u8 i; @@ -3001,14 +3003,14 @@ void sub_8104A88(s16 a0) } } -void sub_8104AB8(u8 a0) +/*static */void sub_8104AB8(u8 a0) { u8 taskId = CreateTask(sub_8104B0C, 1); gTasks[taskId].data[1] = a0; sub_8104B0C(taskId); } -bool8 sub_8104AEC(void) +/*static */bool8 sub_8104AEC(void) { if (FindTaskIdByFunc(sub_8104B0C) == 0xFF) return TRUE; @@ -3016,24 +3018,24 @@ bool8 sub_8104AEC(void) return FALSE; } -void sub_8104B0C(u8 taskId) +/*static */void sub_8104B0C(u8 taskId) { gUnknown_083ECC30[gTasks[taskId].data[0]](gTasks + taskId); } -void sub_8104B3C(struct Task *task) +/*static */void sub_8104B3C(struct Task *task) { BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB(0, 0, 0)); task->data[0]++; } -void sub_8104B60(struct Task *task) +/*static */void sub_8104B60(struct Task *task) { if (!gPaletteFade.active) task->data[0]++; } -void sub_8104B80(struct Task *task) +/*static */void sub_8104B80(struct Task *task) { sub_8104DA4(); sub_81065DC(); @@ -3043,7 +3045,7 @@ void sub_8104B80(struct Task *task) task->data[0]++; } -void sub_812DD78(struct Task *task) +/*static */void sub_812DD78(struct Task *task) { AddTextPrinterParameterized3(1, 1, 2, 5, gUnknown_085A744C, 0, gText_ReelTimeHelp); CopyWindowToVram(1, 3); @@ -3051,7 +3053,7 @@ void sub_812DD78(struct Task *task) task->data[0]++; } -void sub_8104BC8(struct Task *task) +/*static */void sub_8104BC8(struct Task *task) { if (gMain.newKeys & (B_BUTTON | SELECT_BUTTON)) { @@ -3064,32 +3066,32 @@ void sub_8104BC8(struct Task *task) } } -void sub_812DE14(struct Task *task) +/*static */void sub_812DE14(struct Task *task) { sub_812F968(); ShowBg(3); task->data[0]++; } -void sub_812DE30(struct Task *task) +/*static */void sub_812DE30(struct Task *task) { sub_8104CAC(task->data[1]); task->data[0]++; } -void sub_8104BFC(struct Task *task) +/*static */void sub_8104BFC(struct Task *task) { sub_810423C(sSlotMachine->pikaPower); BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, RGB(0, 0, 0)); task->data[0]++; } -void sub_8104C44(struct Task *task) +/*static */void sub_8104C44(struct Task *task) { DestroyTask(FindTaskIdByFunc(sub_8104B0C)); } -void sub_8104C5C(void) +/*static */void sub_8104C5C(void) { u8 i; struct Task *task; @@ -3101,7 +3103,7 @@ void sub_8104C5C(void) task->data[i] = MAX_SPRITES; } -void sub_8104CAC(u8 arg0) +/*static */void sub_8104CAC(u8 arg0) { u8 i; struct Task *task; @@ -3123,7 +3125,7 @@ void sub_8104CAC(u8 arg0) } } -void sub_8104D30(u8 a0, SpriteCallback a1, s16 a2, s16 a3, s16 a4) +/*static */void sub_8104D30(u8 a0, SpriteCallback a1, s16 a2, s16 a3, s16 a4) { u8 i; struct Task *task = gTasks + sSlotMachine->unk3D; @@ -3137,7 +3139,7 @@ void sub_8104D30(u8 a0, SpriteCallback a1, s16 a2, s16 a3, s16 a4) } } -void sub_8104DA4(void) +/*static */void sub_8104DA4(void) { u8 i; struct Task *task = gTasks + sSlotMachine->unk3D; @@ -3153,7 +3155,7 @@ void sub_8104DA4(void) } } -bool8 sub_8104E18(void) +/*static */bool8 sub_8104E18(void) { u8 i; struct Task *task = gTasks + sSlotMachine->unk3D; @@ -3168,16 +3170,16 @@ bool8 sub_8104E18(void) return TRUE; } -void sub_8104E74_(u8 taskId) +/*static */void sub_8104E74_(u8 taskId) { gUnknown_083ECC54[gTasks[taskId].data[0]](gTasks + taskId); } -void nullsub_69(struct Task *task) +/*static */void nullsub_69(struct Task *task) { } -void sub_8104EA8(void) +/*static */void sub_8104EA8(void) { s16 i; s16 j; @@ -3195,7 +3197,7 @@ void sub_8104EA8(void) } } -void sub_8104F18(struct Sprite *sprite) +/*static */void sub_8104F18(struct Sprite *sprite) { sprite->data[2] = sSlotMachine->unk1C[sprite->data[0]] + sprite->data[1]; sprite->data[2] %= 120; @@ -3204,7 +3206,7 @@ void sub_8104F18(struct Sprite *sprite) SetSpriteSheetFrameTileNum(sprite); } -void sub_8104F8C(void) +/*static */void sub_8104F8C(void) { s16 i; s16 x; @@ -3215,7 +3217,7 @@ void sub_8104F8C(void) sub_8104FF4(x, 23, 1, i); } -void sub_8104FF4(s16 x, s16 y, u8 a2, s16 a3) +/*static */void sub_8104FF4(s16 x, s16 y, u8 a2, s16 a3) { struct Sprite *sprite = gSprites + CreateSprite(&gSpriteTemplate_83ED42C, x, y, 13); sprite->oam.priority = 2; @@ -3225,7 +3227,7 @@ void sub_8104FF4(s16 x, s16 y, u8 a2, s16 a3) sprite->data[3] = -1; } -void sub_810506C(struct Sprite *sprite) +/*static */void sub_810506C(struct Sprite *sprite) { u16 tag = sSlotMachine->coins; if (sprite->data[0]) @@ -3241,14 +3243,14 @@ void sub_810506C(struct Sprite *sprite) } } -void sub_81050C4(void) +/*static */void sub_81050C4(void) { u8 spriteId = CreateSprite(&gSpriteTemplate_83ED444, 0x58, 0x48, 15); gSprites[spriteId].oam.priority = 3; SetSubspriteTables(gSprites + spriteId, gSubspriteTables_83ED704); } -void sub_8105100(void) +/*static */void sub_8105100(void) { struct SpriteTemplate spriteTemplate; u8 spriteId; @@ -3274,14 +3276,14 @@ void sub_8105100(void) sSlotMachine->unk3F = spriteId; } -void sub_810514C(void) +/*static */void sub_810514C(void) { DestroySprite(gSprites + sSlotMachine->unk3F); if (gUnknown_0203AAE4 != NULL) FREE_AND_SET_NULL(gUnknown_0203AAE4); } -void sub_8105170(struct Sprite *sprite) +/*static */void sub_8105170(struct Sprite *sprite) { sprite->pos2.y = sprite->pos2.x = 0; if (sprite->animNum == 4) @@ -3292,7 +3294,7 @@ void sub_8105170(struct Sprite *sprite) } } -void sub_81051C0(void) +/*static */void sub_81051C0(void) { struct SpriteTemplate spriteTemplate; u8 spriteId; @@ -3327,7 +3329,7 @@ void sub_81051C0(void) sSlotMachine->unk49[1] = spriteId; } -void sub_8105284_(void) +/*static */void sub_8105284_(void) { struct SpriteTemplate spriteTemplate; u8 spriteId; @@ -3348,7 +3350,7 @@ void sub_8105284_(void) sSlotMachine->unk42 = spriteId; } -void sub_81052EC(void) +/*static */void sub_81052EC(void) { u8 i; s16 r5; @@ -3363,7 +3365,7 @@ void sub_81052EC(void) } } -void sub_810535C(struct Sprite *sprite) +/*static */void sub_810535C(struct Sprite *sprite) { s16 r0 = (u16)(sSlotMachine->unk14 + sprite->data[7]); r0 %= 40; @@ -3371,7 +3373,7 @@ void sub_810535C(struct Sprite *sprite) StartSpriteAnimIfDifferent(sprite, sub_8102C48(r0 / 20)); } -void sub_81053A0(void) +/*static */void sub_81053A0(void) { u8 spriteId = CreateSprite(&gSpriteTemplate_83ED4D4, 0x170, 0x64, 9); struct Sprite *sprite = &gSprites[spriteId]; @@ -3388,7 +3390,7 @@ void sub_81053A0(void) sSlotMachine->unk4E[1] = spriteId; } -void sub_810545C(void) +/*static */void sub_810545C(void) { u8 spriteId = CreateSprite(&gSpriteTemplate_83ED4EC, 0x170, 0x4c, 11); struct Sprite *sprite = &gSprites[spriteId]; @@ -3398,7 +3400,7 @@ void sub_810545C(void) sSlotMachine->unk40 = spriteId; } -void sub_81054B8(void) +/*static */void sub_81054B8(void) { u8 i; @@ -3415,7 +3417,7 @@ void sub_81054B8(void) DestroySprite(&gSprites[sSlotMachine->unk4B[i]]); } -void sub_8105524(void) +/*static */void sub_8105524(void) { u8 i; @@ -3423,14 +3425,14 @@ void sub_8105524(void) DestroySprite(&gSprites[sSlotMachine->unk4E[i]]); } -void sub_8105554(void) +/*static */void sub_8105554(void) { DestroySprite(&gSprites[sSlotMachine->unk42]); if (gUnknown_0203AAF0 != NULL) FREE_AND_SET_NULL(gUnknown_0203AAF0); } -void sub_8105578(void) +/*static */void sub_8105578(void) { u8 spriteId = CreateSprite(&gSpriteTemplate_83ED504, 0x98, 0x20, 5); struct Sprite *sprite = &gSprites[spriteId]; @@ -3451,7 +3453,7 @@ void sub_8105578(void) sprite->data[7] = 0x20; } -void sub_810562C(struct Sprite *sprite) +/*static */void sub_810562C(struct Sprite *sprite) { if (sprite->data[0] != 0) { @@ -3473,13 +3475,13 @@ void sub_810562C(struct Sprite *sprite) } } -void sub_8105688(s16 a0) +/*static */void sub_8105688(s16 a0) { gSprites[sSlotMachine->unk50[0]].data[7] = a0; gSprites[sSlotMachine->unk50[1]].data[7] = a0; } -void sub_81056C0(void) +/*static */void sub_81056C0(void) { u8 i; @@ -3487,7 +3489,7 @@ void sub_81056C0(void) DestroySprite(&gSprites[sSlotMachine->unk50[i]]); } -void sub_81056F0(void) +/*static */void sub_81056F0(void) { u8 spriteId = CreateSprite(&gSpriteTemplate_83ED51C, 0x48, 0x50, 3); gSprites[spriteId].oam.priority = 1; @@ -3503,7 +3505,7 @@ void sub_81056F0(void) sSlotMachine->unk52[1] = spriteId; } -void sub_8105784(struct Sprite *sprite) +/*static */void sub_8105784(struct Sprite *sprite) { u8 sp[] = {16, 0}; if (sprite->data[0] && --sprite->data[6] <= 0) @@ -3515,12 +3517,12 @@ void sub_8105784(struct Sprite *sprite) } } -void sub_81057E8(s16 a0) +/*static */void sub_81057E8(s16 a0) { gSprites[sSlotMachine->unk52[0]].data[7] = a0; } -void sub_8105804(void) +/*static */void sub_8105804(void) { u8 i; MultiplyInvertedPaletteRGBComponents((IndexOfSpritePaletteTag(7) << 4) + 0x103, 0, 0, 0); @@ -3528,24 +3530,24 @@ void sub_8105804(void) DestroySprite(&gSprites[sSlotMachine->unk52[i]]); } -void sub_8105854(void) +/*static */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) +/*static */void sub_8105894(struct Sprite *sprite) { sprite->pos2.y = gSpriteCoordOffsetY; } -void sub_81058A0(void) +/*static */void sub_81058A0(void) { DestroySprite(&gSprites[sSlotMachine->unk41]); } -void sub_81058C4(void) +/*static */void sub_81058C4(void) { u8 i; u16 sp[] = {0x0, 0x40, 0x80, 0xC0}; @@ -3560,7 +3562,7 @@ void sub_81058C4(void) } } -void sub_810594C(struct Sprite *sprite) +/*static */void sub_810594C(struct Sprite *sprite) { sprite->data[0] -= 2; sprite->data[0] &= 0xff; @@ -3578,7 +3580,7 @@ void sub_810594C(struct Sprite *sprite) } } -void sub_81059B8(void) +/*static */void sub_81059B8(void) { u8 i; for (i = 0; i < 4; i++) @@ -3587,7 +3589,7 @@ void sub_81059B8(void) } } -void sub_81059E8(void) +/*static */void sub_81059E8(void) { u8 spriteId = CreateSprite(&gSpriteTemplate_83ED564, 0xa8, 0x3c, 8); struct Sprite *sprite = &gSprites[spriteId]; @@ -3597,7 +3599,7 @@ void sub_81059E8(void) sSlotMachine->unk43 = spriteId; } -void sub_8105A38(struct Sprite *sprite) +/*static */void sub_8105A38(struct Sprite *sprite) { if (sprite->data[0] == 0) { @@ -3624,19 +3626,19 @@ void sub_8105A38(struct Sprite *sprite) sprite->pos2.y -= (sprite->data[1] >> 8); } -u8 sub_8105ACC(void) +/*static */u8 sub_8105ACC(void) { return gSprites[sSlotMachine->unk43].data[7]; } -void sub_8105AEC(void) +/*static */void sub_8105AEC(void) { struct Sprite *sprite = &gSprites[sSlotMachine->unk43]; FreeOamMatrix(sprite->oam.matrixNum); DestroySprite(sprite); } -u8 sub_8105B1C(s16 x, s16 y) +/*static */u8 sub_8105B1C(s16 x, s16 y) { u8 spriteId = CreateSprite(&gSpriteTemplate_83ED6CC, x, y, 12); struct Sprite *sprite = &gSprites[spriteId]; @@ -3646,25 +3648,25 @@ u8 sub_8105B1C(s16 x, s16 y) return spriteId; } -void sub_8105B70(struct Sprite *sprite) +/*static */void sub_8105B70(struct Sprite *sprite) { if (sprite->affineAnimEnded) sprite->data[7] = 1; } -void sub_8105B88(u8 spriteId) +/*static */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) +/*static */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) +/*static */u8 sub_8105BF8(u8 templateIdx, SpriteCallback callback, s16 x, s16 y, s16 a4) { struct SpriteTemplate spriteTemplate; u8 spriteId; @@ -3683,12 +3685,12 @@ u8 sub_8105BF8(u8 templateIdx, SpriteCallback callback, s16 x, s16 y, s16 a4) return spriteId; } -void sub_8105C64(struct Sprite *sprite) +/*static */void sub_8105C64(struct Sprite *sprite) { sprite->data[7] = 0; } -void sub_8105C6C(struct Sprite *sprite) +/*static */void sub_8105C6C(struct Sprite *sprite) { s16 sp0[] = {4, -4, 4, -4}; s16 sp8[] = {4, 4, -4, -4}; @@ -3707,26 +3709,26 @@ void sub_8105C6C(struct Sprite *sprite) } } -void sub_8105CF0(struct Sprite *sprite) +/*static */void sub_8105CF0(struct Sprite *sprite) { sprite->hFlip = TRUE; sub_8105C6C(sprite); } -void sub_8105D08(struct Sprite *sprite) +/*static */void sub_8105D08(struct Sprite *sprite) { sprite->vFlip = TRUE; sub_8105C6C(sprite); } -void sub_8105D20(struct Sprite *sprite) +/*static */void sub_8105D20(struct Sprite *sprite) { sprite->hFlip = TRUE; sprite->vFlip = TRUE; sub_8105C6C(sprite); } -void sub_8105D3C(struct Sprite *sprite) +/*static */void sub_8105D3C(struct Sprite *sprite) { switch (sprite->data[0]) { @@ -3753,7 +3755,7 @@ void sub_8105D3C(struct Sprite *sprite) } } -void sub_8105DA4(struct Sprite *sprite) +/*static */void sub_8105DA4(struct Sprite *sprite) { switch (sprite->data[0]) { @@ -3780,7 +3782,7 @@ void sub_8105DA4(struct Sprite *sprite) } } -void sub_8105E08(struct Sprite *sprite) +/*static */void sub_8105E08(struct Sprite *sprite) { switch (sprite->data[0]) { @@ -3818,7 +3820,7 @@ void sub_8105E08(struct Sprite *sprite) } } -void sub_8105EB4(struct Sprite *sprite) +/*static */void sub_8105EB4(struct Sprite *sprite) { switch (sprite->data[0]) { @@ -3858,7 +3860,7 @@ void sub_8105EB4(struct Sprite *sprite) } } -void sub_8105F54(struct Sprite *sprite) +/*static */void sub_8105F54(struct Sprite *sprite) { switch (sprite->data[0]) { @@ -3878,7 +3880,7 @@ void sub_8105F54(struct Sprite *sprite) } } -void sub_8105F9C(struct Sprite *sprite) +/*static */void sub_8105F9C(struct Sprite *sprite) { switch (sprite->data[0]) { @@ -3912,7 +3914,7 @@ void sub_8105F9C(struct Sprite *sprite) } } -void sub_8106058(struct Sprite *sprite) +/*static */void sub_8106058(struct Sprite *sprite) { if (sprite->data[1] < 3) { @@ -3936,7 +3938,7 @@ void sub_8106058(struct Sprite *sprite) sprite->data[7] = 0; } -void sub_81060FC(struct Sprite *sprite) +/*static */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}; @@ -3971,7 +3973,7 @@ void sub_81060FC(struct Sprite *sprite) } } -void sub_81061C8(struct Sprite *sprite) +/*static */void sub_81061C8(struct Sprite *sprite) { s16 sp0[] = {160, 192, 224, 104, 80, 64, 48, 24}; @@ -3986,7 +3988,7 @@ void sub_81061C8(struct Sprite *sprite) sprite->data[1]--; } -void sub_8106230(struct Sprite *sprite) +/*static */void sub_8106230(struct Sprite *sprite) { switch (sprite->data[0]) { @@ -4040,21 +4042,21 @@ void sub_8106230(struct Sprite *sprite) } } -void nullsub_70(void) +/*static */void nullsub_70(void) { } -void sub_8106364(void) +/*static */void sub_8106364(void) { SetGpuReg(REG_OFFSET_MOSAIC, 0); } -void sub_8106370(void) +/*static */void sub_8106370(void) { LoadPalette(gUnknown_083EDE20, (IndexOfSpritePaletteTag(6) << 4) + 0x100, 0x20); } -void sub_810639C(void) +/*static */void sub_810639C(void) { sSlotMachine->win0h = 0xf0; sSlotMachine->win0v = 0xa0; @@ -4062,7 +4064,7 @@ void sub_810639C(void) sSlotMachine->winOut = 0x3f; } -void sub_81063C0(void) +/*static */void sub_81063C0(void) { u8 i; @@ -4086,7 +4088,7 @@ void sub_81063C0(void) LoadSpritePalettes(gSlotMachineSpritePalettes); } -void sub_8106404(void) +/*static */void sub_8106404(void) { u8 *dest; u8 i, j; @@ -4110,7 +4112,7 @@ extern const u8 gSlotMachineMenu_Tilemap[]; extern const u8 gUnknown_08DCEC70[]; extern const u16 gSlotMachineMenu_Pal[]; -void sub_8106448(void) +/*static */void sub_8106448(void) { gUnknown_0203AAC8 = Alloc(0x2200); LZDecompressWram(gSlotMachineMenu_Gfx, gUnknown_0203AAC8); @@ -4119,18 +4121,18 @@ void sub_8106448(void) LoadPalette(gPalette_83EDE24, 208, 32); } -void sub_81064B8(void) +/*static */void sub_81064B8(void) { sub_812F968(); LoadSlotMachineWheelOverlay(); } -void sub_812F968(void) +/*static */void sub_812F968(void) { LoadBgTilemap(2, gSlotMachineMenu_Tilemap, 0x500, 0); } -void LoadSlotMachineWheelOverlay(void) +/*static */void LoadSlotMachineWheelOverlay(void) { s16 x, y, dx; @@ -4152,7 +4154,7 @@ void LoadSlotMachineWheelOverlay(void) } } -void sub_81065A8(s16 arg0, u16 arg1, u16 arg2, u16 arg3, u16 arg4) +/*static */void sub_81065A8(s16 arg0, u16 arg1, u16 arg2, u16 arg3, u16 arg4) { gUnknown_0203AADC[0] = arg1; gUnknown_0203AADC[1] = arg2; @@ -4165,13 +4167,13 @@ void sub_81065A8(s16 arg0, u16 arg1, u16 arg2, u16 arg3, u16 arg4) LoadBgTilemap(2, gUnknown_0203AADC + 3, 2, 16 * 32 + 1 + arg0); } -void sub_81065DC(void) +/*static */void sub_81065DC(void) { LoadBgTilemap(2, gUnknown_08DCEC70, 0x500, 0); HideBg(3); } -void SlotMachineSetup_9_0(void) +/*static */void SlotMachineSetup_9_0(void) { gUnknown_03001188[0] = gUnknown_0203AAF4; gUnknown_03001188[1] = gUnknown_0203AAF8; @@ -4201,7 +4203,7 @@ void SlotMachineSetup_9_0(void) gUnknown_03001188[25] = NULL; } -void SlotMachineSetup_8_0(void) +/*static */void SlotMachineSetup_8_0(void) { gUnknown_0203AAF4 = AllocZeroed(sizeof(struct SpriteFrameImage) * 1); gUnknown_0203AAF4[0].data = gUnknown_0203AAD4; @@ -4489,3 +4491,126 @@ const s16 gUnknown_083ECE7E[][2] = { { 0xe8, 0x48}, { 0x00, 0x00} }; + +const SpriteCallback gUnknown_083ECF0C[] = { + sub_8105C64, + sub_8105F54, + sub_8105F54, + sub_8105F54, + sub_8105F54, + sub_8105F9C, + sub_8105EB4, + sub_8105C64, + sub_8105C64, + sub_8105C6C, + sub_8105CF0, + sub_8105D08, + sub_8105D20, + sub_8105D3C, + sub_8105DA4, + sub_8105E08, + sub_8105C64, + sub_8106058, + sub_81060FC, + sub_81060FC, + sub_81060FC, + sub_81060FC, + sub_81060FC, + sub_81060FC, + sub_81060FC, + sub_81060FC, + sub_81061C8, + sub_81061C8, + sub_81061C8, + sub_81061C8, + sub_81061C8, + sub_81061C8, + sub_81061C8, + sub_81061C8, + sub_8106230 +}; + +const struct UnkStruct1 Unknown_83ECF98[] = { + {25, 34, 0}, + {2, 0, 0}, + {9, 16, 0}, + {255, 0, 0} +}; + +const struct UnkStruct1 Unknown_83ECFA8[] = { + {10, 1, 0}, + {11, 2, 0}, + {12, 3, 0}, + {13, 4, 0}, + {5, 5, 0}, + {8, 6, 0}, + {255, 0, 0} +}; + +const struct UnkStruct1 Unknown_83ECFC4[] = { + {3, 7, 0}, + {8, 17, 0}, + {255, 0, 0} +}; + +const struct UnkStruct1 Unknown_83ECFD0[] = { + {4, 8, 0}, + {6, 9, 0}, + {6, 10, 1}, + {6, 11, 2}, + {6, 12, 3}, + {255, 0, 0} +}; + +const struct UnkStruct1 Unknown_83ECFE8[] = { + {0, 13, 0}, + {1, 14, 0}, + {7, 15, 0}, + {255, 0, 0} +}; + +const struct UnkStruct1 Unknown_83ECFF8[] = { + {19, 26, 0}, + {20, 27, 1}, + {21, 28, 2}, + {14, 29, 3}, + {15, 30, 4}, + {16, 31, 5}, + {17, 32, 6}, + {18, 33, 7}, + {8, 17, 0}, + {255, 0, 0} +}; + +const struct UnkStruct1 Unknown_83ED020[] = { + {22, 18, 0}, + {23, 19, 1}, + {24, 20, 2}, + {14, 21, 3}, + {15, 22, 4}, + {16, 23, 5}, + {17, 24, 6}, + {18, 25, 7}, + {8, 17, 0}, + {255, 0, 0} +}; + +const struct UnkStruct1 *const gUnknown_083ED048[] = { + Unknown_83ECF98, + Unknown_83ECFA8, + Unknown_83ECFC4, + Unknown_83ECFD0, + Unknown_83ECFE8, + Unknown_83ED020, + Unknown_83ECFF8 +}; + +void (*const gUnknown_083ED064[])(void) = { + sub_810639C, + sub_8106364, + sub_8106370, + nullsub_70, + nullsub_70, + sub_8106370, + sub_8106370 +}; diff --git a/sym_bss.txt b/sym_bss.txt index 08b1a58bd..7df5e3055 100644 --- a/sym_bss.txt +++ b/sym_bss.txt @@ -31,9 +31,7 @@ .include "src/mauville_old_man.o" .include "src/menu_helpers.o" .include "src/region_map.o" - -gUnknown_03001188: @ 3001188 - .space 0x68 + .include "src/slot_machine.o" gUnknown_030011F0: @ 30011F0 .space 0x2 diff --git a/sym_ewram.txt b/sym_ewram.txt index 8515e9119..ddd121bee 100644 --- a/sym_ewram.txt +++ b/sym_ewram.txt @@ -448,94 +448,7 @@ gUnknown_0203A120: @ 203A120 .include "src/menu_helpers.o" .include "src/region_map.o" .include "src/decoration.o" - .align 2 - -@ slot_machine - -gUnknown_0203AAC8: @ 203AAC8 - .space 0x4 - -gUnknown_0203AACC: @ 203AACC - .space 0x4 - -gUnknown_0203AAD0: @ 203AAD0 - .space 0x4 - -gUnknown_0203AAD4: @ 203AAD4 - .space 0x4 - -gUnknown_0203AAD8: @ 203AAD8 - .space 0x4 - -gUnknown_0203AADC: @ 203AADC - .space 0x4 - -gUnknown_0203AAE0: @ 203AAE0 - .space 0x4 - -gUnknown_0203AAE4: @ 203AAE4 - .space 0x4 - -gUnknown_0203AAE8: @ 203AAE8 - .space 0x4 - -gUnknown_0203AAEC: @ 203AAEC - .space 0x4 - -gUnknown_0203AAF0: @ 203AAF0 - .space 0x4 - -gUnknown_0203AAF4: @ 203AAF4 - .space 0x4 - -gUnknown_0203AAF8: @ 203AAF8 - .space 0x4 - -gUnknown_0203AAFC: @ 203AAFC - .space 0x4 - -gUnknown_0203AB00: @ 203AB00 - .space 0x4 - -gUnknown_0203AB04: @ 203AB04 - .space 0x4 - -gUnknown_0203AB08: @ 203AB08 - .space 0x4 - -gUnknown_0203AB0C: @ 203AB0C - .space 0x4 - -gUnknown_0203AB10: @ 203AB10 - .space 0x4 - -gUnknown_0203AB14: @ 203AB14 - .space 0x4 - -gUnknown_0203AB18: @ 203AB18 - .space 0x4 - -gUnknown_0203AB1C: @ 203AB1C - .space 0x4 - -gUnknown_0203AB20: @ 203AB20 - .space 0x4 - -gUnknown_0203AB24: @ 203AB24 - .space 0x4 - -gUnknown_0203AB28: @ 203AB28 - .space 0x4 - -gUnknown_0203AB2C: @ 203AB2C - .space 0x4 - -gUnknown_0203AB30: @ 203AB30 - .space 0x4 - -sSlotMachine: @ 203AB34 - .space 0x4 - + .include "src/slot_machine.o" .include "src/battle_ai_script_commands.o" .align 2