diff --git a/asm/pokemon_jump.s b/asm/pokemon_jump.s index f230dac71..8a705e32e 100755 --- a/asm/pokemon_jump.s +++ b/asm/pokemon_jump.s @@ -5,1241 +5,6 @@ .text - thumb_func_start sub_802B3D4 -sub_802B3D4: @ 802B3D4 - push {r4,lr} - ldr r4, =gUnknown_02022CFC - ldr r0, [r4] - ldrh r0, [r0, 0x8] - cmp r0, 0x1 - beq _0802B40C - cmp r0, 0x1 - bgt _0802B3F0 - cmp r0, 0 - beq _0802B3F6 - b _0802B468 - .pool -_0802B3F0: - cmp r0, 0x2 - beq _0802B460 - b _0802B468 -_0802B3F6: - bl sub_802C538 - bl sub_802C5DC - cmp r0, 0 - beq _0802B468 - ldr r1, [r4] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0802B468 -_0802B40C: - bl sub_802B964 - cmp r0, 0 - bne _0802B468 - bl sub_802C7BC - cmp r0, 0 - beq _0802B42E - bl sub_802C7E0 - ldr r1, [r4] - adds r2, r1, 0 - adds r2, 0x72 - strh r0, [r2] - adds r1, 0x4C - movs r0, 0x7 - b _0802B454 -_0802B42E: - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0x74 - ldrh r0, [r0] - cmp r0, 0xC7 - bls _0802B448 - ldrh r0, [r1, 0xE] - adds r2, r1, 0 - adds r2, 0x72 - strh r0, [r2] - adds r1, 0x4C - movs r0, 0x8 - b _0802B454 -_0802B448: - ldrh r0, [r1, 0xE] - adds r2, r1, 0 - adds r2, 0x72 - strh r0, [r2] - adds r1, 0x4C - movs r0, 0x4 -_0802B454: - strb r0, [r1] - ldr r0, =gUnknown_02022CFC - ldr r1, [r0] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] -_0802B460: - movs r0, 0 - b _0802B46A - .pool -_0802B468: - movs r0, 0x1 -_0802B46A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802B3D4 - - thumb_func_start sub_802B470 -sub_802B470: @ 802B470 - push {r4,lr} - ldr r4, =gUnknown_02022CFC - ldr r0, [r4] - ldrh r0, [r0, 0x8] - cmp r0, 0x1 - beq _0802B4B0 - cmp r0, 0x1 - bgt _0802B48C - cmp r0, 0 - beq _0802B492 - b _0802B4C4 - .pool -_0802B48C: - cmp r0, 0x2 - beq _0802B4C0 - b _0802B4C4 -_0802B492: - bl sub_802C538 - cmp r0, 0 - bne _0802B49E - bl sub_802C0B8 -_0802B49E: - bl sub_802C5DC - cmp r0, 0 - beq _0802B4C4 - ldr r1, [r4] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0802B4C4 -_0802B4B0: - bl sub_802B964 - cmp r0, 0 - bne _0802B4C4 - ldr r1, [r4] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] -_0802B4C0: - movs r0, 0 - b _0802B4C6 -_0802B4C4: - movs r0, 0x1 -_0802B4C6: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802B470 - - thumb_func_start sub_802B4CC -sub_802B4CC: @ 802B4CC - push {r4,lr} - ldr r4, =gUnknown_02022CFC - ldr r0, [r4] - ldrh r1, [r0, 0x8] - cmp r1, 0x1 - beq _0802B500 - cmp r1, 0x1 - bgt _0802B4E8 - cmp r1, 0 - beq _0802B4F2 - b _0802B560 - .pool -_0802B4E8: - cmp r1, 0x2 - beq _0802B52C - cmp r1, 0x3 - beq _0802B556 - b _0802B560 -_0802B4F2: - movs r0, 0x4 - bl sub_802AE14 - ldr r1, [r4] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] -_0802B500: - bl sub_802BB84 - cmp r0, 0 - bne _0802B560 - ldr r4, =gUnknown_02022CFC - ldr r2, [r4] - ldr r0, [r2, 0x78] - adds r1, r2, 0 - adds r1, 0x74 - ldrh r1, [r1] - adds r2, 0x72 - ldrh r2, [r2] - bl sub_802E354 - ldr r1, [r4] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0802B560 - .pool -_0802B52C: - adds r0, 0x49 - ldrb r0, [r0] - cmp r0, 0 - beq _0802B560 - bl sub_802C650 - cmp r0, 0 - beq _0802B544 - ldr r0, [r4] - adds r0, 0x4C - movs r1, 0x5 - b _0802B54A -_0802B544: - ldr r0, [r4] - adds r0, 0x4C - movs r1, 0x6 -_0802B54A: - strb r1, [r0] - ldr r0, =gUnknown_02022CFC - ldr r1, [r0] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] -_0802B556: - movs r0, 0 - b _0802B562 - .pool -_0802B560: - movs r0, 0x1 -_0802B562: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802B4CC - - thumb_func_start sub_802B568 -sub_802B568: @ 802B568 - push {r4,lr} - ldr r4, =gUnknown_02022CFC - ldr r0, [r4] - ldrh r0, [r0, 0x8] - cmp r0, 0 - beq _0802B580 - cmp r0, 0x1 - beq _0802B58E - b _0802B5C0 - .pool -_0802B580: - movs r0, 0 - bl sub_802AE14 - ldr r1, [r4] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] -_0802B58E: - bl sub_802BB84 - cmp r0, 0 - bne _0802B5C0 - ldr r4, =gUnknown_02022CFC - ldr r2, [r4] - ldr r0, [r2, 0x78] - adds r1, r2, 0 - adds r1, 0x74 - ldrh r1, [r1] - adds r2, 0x72 - ldrh r2, [r2] - bl sub_802E354 - ldr r0, [r4] - adds r1, r0, 0 - adds r1, 0x45 - ldrb r1, [r1] - adds r0, 0x42 - strh r1, [r0] - movs r0, 0 - b _0802B5C2 - .pool -_0802B5C0: - movs r0, 0x1 -_0802B5C2: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802B568 - - thumb_func_start sub_802B5C8 -sub_802B5C8: @ 802B5C8 - push {r4,lr} - ldr r4, =gUnknown_02022CFC - ldr r1, [r4] - ldrh r0, [r1, 0x8] - cmp r0, 0 - beq _0802B5E0 - cmp r0, 0x1 - beq _0802B5F2 - b _0802B61E - .pool -_0802B5E0: - bl sub_802BD30 - cmp r0, 0 - bne _0802B61E - ldr r1, [r4] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0802B61E -_0802B5F2: - adds r0, r1, 0 - adds r0, 0x49 - ldrb r0, [r0] - cmp r0, 0 - beq _0802B61E - adds r0, r1, 0 - bl sub_802AA94 - bl Random - ldr r1, [r4] - lsls r0, 16 - lsrs r0, 16 - str r0, [r1, 0x24] - adds r3, r1, 0 - adds r3, 0x72 - movs r2, 0 - strh r0, [r3] - adds r1, 0x4C - strb r2, [r1] - movs r0, 0 - b _0802B620 -_0802B61E: - movs r0, 0x1 -_0802B620: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802B5C8 - - thumb_func_start sub_802B628 -sub_802B628: @ 802B628 - push {r4,lr} - ldr r4, =gUnknown_02022CFC - ldr r0, [r4] - ldrh r0, [r0, 0x8] - cmp r0, 0 - beq _0802B640 - cmp r0, 0x1 - beq _0802B656 - b _0802B65A - .pool -_0802B640: - bl sub_802BD30 - cmp r0, 0 - bne _0802B65A - ldr r0, [r4] - bl sub_802AA94 - ldr r1, [r4] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] -_0802B656: - movs r0, 0 - b _0802B65C -_0802B65A: - movs r0, 0x1 -_0802B65C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802B628 - - thumb_func_start sub_802B664 -sub_802B664: @ 802B664 - push {r4,lr} - ldr r4, =gUnknown_02022CFC - ldr r1, [r4] - ldrh r0, [r1, 0x8] - cmp r0, 0x1 - beq _0802B68C - cmp r0, 0x1 - bgt _0802B680 - cmp r0, 0 - beq _0802B686 - b _0802B6B0 - .pool -_0802B680: - cmp r0, 0x2 - beq _0802B69C - b _0802B6B0 -_0802B686: - movs r0, 0x1 - strh r0, [r1, 0x8] - b _0802B6B0 -_0802B68C: - movs r0, 0 - bl sub_802AE14 - ldr r1, [r4] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0802B6B0 -_0802B69C: - bl sub_802BC60 - cmp r0, 0 - bne _0802B6B0 - ldr r0, [r4] - ldr r0, [r0] - bl SetMainCallback2 - bl sub_802AA48 -_0802B6B0: - movs r0, 0x1 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802B664 - - thumb_func_start sub_802B6B8 -sub_802B6B8: @ 802B6B8 - push {r4,lr} - ldr r4, =gUnknown_02022CFC - ldr r0, [r4] - ldrh r0, [r0, 0x8] - cmp r0, 0 - beq _0802B6D0 - cmp r0, 0x1 - beq _0802B6E0 - b _0802B6FC - .pool -_0802B6D0: - movs r0, 0x4 - bl sub_802AE14 - ldr r1, [r4] - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0802B6FC -_0802B6E0: - bl sub_802BA58 - cmp r0, 0 - bne _0802B6FC - ldr r0, [r4] - ldrh r1, [r0, 0xE] - adds r2, r0, 0 - adds r2, 0x72 - strh r1, [r2] - adds r0, 0x4C - movs r1, 0x8 - strb r1, [r0] - movs r0, 0 - b _0802B6FE -_0802B6FC: - movs r0, 0x1 -_0802B6FE: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802B6B8 - - thumb_func_start sub_802B704 -sub_802B704: @ 802B704 - push {lr} - movs r0, 0 - bl sub_802AE14 - bl sub_802BA58 - cmp r0, 0 - beq _0802B718 - movs r0, 0x1 - b _0802B71A -_0802B718: - movs r0, 0 -_0802B71A: - pop {r1} - bx r1 - thumb_func_end sub_802B704 - - thumb_func_start sub_802B720 -sub_802B720: @ 802B720 - push {r4,lr} - ldr r1, =gUnknown_02022CFC - ldr r0, [r1] - ldrh r0, [r0, 0x8] - adds r4, r1, 0 - cmp r0, 0x4 - bhi _0802B7D8 - lsls r0, 2 - ldr r1, =_0802B740 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0802B740: - .4byte _0802B754 - .4byte _0802B770 - .4byte _0802B780 - .4byte _0802B798 - .4byte _0802B7BC -_0802B754: - ldr r2, [r4] - ldr r0, [r2, 0x78] - adds r1, r2, 0 - adds r1, 0x74 - ldrh r1, [r1] - adds r2, 0x72 - ldrh r2, [r2] - bl sub_802E354 - movs r0, 0x5 - bl sub_802D0C8 - ldr r1, [r4] - b _0802B7AC -_0802B770: - bl sub_802D0F0 - cmp r0, 0 - bne _0802B7D8 - movs r0, 0 - bl sub_802AE14 - b _0802B7A8 -_0802B780: - bl sub_802C70C - cmp r0, 0 - beq _0802B7D8 - ldr r0, =sub_8153688 - movs r1, 0x6 - bl CreateTask - b _0802B7A8 - .pool -_0802B798: - ldr r0, =sub_8153688 - bl FuncIsActiveTask - lsls r0, 24 - cmp r0, 0 - bne _0802B7D8 - bl sub_802DA14 -_0802B7A8: - ldr r0, =gUnknown_02022CFC - ldr r1, [r0] -_0802B7AC: - ldrh r0, [r1, 0x8] - adds r0, 0x1 - strh r0, [r1, 0x8] - b _0802B7D8 - .pool -_0802B7BC: - bl sub_802DA44 - cmp r0, 0 - bne _0802B7D8 - ldr r0, =gUnknown_02022CFC - ldr r0, [r0] - adds r0, 0x4C - movs r1, 0x4 - strb r1, [r0] - movs r0, 0 - b _0802B7DA - .pool -_0802B7D8: - movs r0, 0x1 -_0802B7DA: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802B720 - - thumb_func_start sub_802B7E0 -sub_802B7E0: @ 802B7E0 - push {r4,r5,lr} - ldr r1, =gUnknown_02022CFC - ldr r0, [r1] - ldrh r0, [r0, 0xA] - adds r4, r1, 0 - cmp r0, 0x7 - bhi _0802B8C4 - lsls r0, 2 - ldr r1, =_0802B800 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0802B800: - .4byte _0802B820 - .4byte _0802B82C - .4byte _0802B84C - .4byte _0802B866 - .4byte _0802B878 - .4byte _0802B880 - .4byte _0802B8A0 - .4byte _0802B8BA -_0802B820: - movs r0, 0x2 - bl sub_802D0C8 - bl sub_802DDE0 - b _0802B890 -_0802B82C: - bl sub_802D0F0 - adds r5, r0, 0 - cmp r5, 0 - bne _0802B8C4 - ldr r4, =gUnknown_02022CFC - ldr r0, [r4] - ldrb r0, [r0, 0x6] - bl sub_802DDF4 - ldr r1, [r4] - strh r5, [r1, 0x3C] - b _0802B894 - .pool -_0802B84C: - ldr r1, [r4] - ldrh r0, [r1, 0x3C] - adds r0, 0x1 - strh r0, [r1, 0x3C] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x78 - bls _0802B8C4 - movs r0, 0x3 - bl sub_802D0C8 - ldr r1, [r4] - b _0802B894 -_0802B866: - bl sub_802D0F0 - cmp r0, 0x1 - beq _0802B8C4 - bl sub_802DE08 - cmp r0, 0x1 - beq _0802B8C4 - b _0802B890 -_0802B878: - movs r0, 0x9 - bl sub_802D0C8 - b _0802B890 -_0802B880: - bl sub_802D0F0 - cmp r0, 0 - bne _0802B8C4 - bl sub_802C260 - bl sub_802D764 -_0802B890: - ldr r0, =gUnknown_02022CFC - ldr r1, [r0] -_0802B894: - ldrh r0, [r1, 0xA] - adds r0, 0x1 - strh r0, [r1, 0xA] - b _0802B8C4 - .pool -_0802B8A0: - bl sub_802D788 - cmp r0, 0 - bne _0802B8C4 - bl sub_802C270 - bl sub_802BEA0 - ldr r0, =gUnknown_02022CFC - ldr r1, [r0] - ldrh r0, [r1, 0xA] - adds r0, 0x1 - strh r0, [r1, 0xA] -_0802B8BA: - movs r0, 0 - b _0802B8C6 - .pool -_0802B8C4: - movs r0, 0x1 -_0802B8C6: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_802B7E0 - - thumb_func_start sub_802B8CC -sub_802B8CC: @ 802B8CC - push {r4,r5,lr} - bl sub_802BEE4 - ldr r5, =gUnknown_02022CFC - ldr r1, [r5] - ldrh r4, [r1, 0x36] - cmp r4, 0 - beq _0802B8E8 - movs r0, 0 - strh r0, [r1, 0x36] - b _0802B95C - .pool -_0802B8E8: - ldrh r0, [r1, 0xA] - cmp r0, 0x1 - beq _0802B914 - cmp r0, 0x1 - bgt _0802B8F8 - cmp r0, 0 - beq _0802B902 - b _0802B95A -_0802B8F8: - cmp r0, 0x2 - beq _0802B938 - cmp r0, 0x3 - beq _0802B94C - b _0802B95A -_0802B902: - movs r0, 0 - bl sub_802C130 - cmp r0, 0 - beq _0802B95A - ldr r1, [r5] - ldrh r0, [r1, 0xA] - adds r0, 0x1 - strh r0, [r1, 0xA] -_0802B914: - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0802B95A - bl sub_802C164 - movs r0, 0x3 - bl sub_802AE14 - ldr r0, =gUnknown_02022CFC - ldr r1, [r0] - b _0802B944 - .pool -_0802B938: - movs r0, 0x1 - bl sub_802C130 - cmp r0, 0x1 - bne _0802B95A - ldr r1, [r5] -_0802B944: - ldrh r0, [r1, 0xA] - adds r0, 0x1 - strh r0, [r1, 0xA] - b _0802B95A -_0802B94C: - movs r0, 0 - bl sub_802C130 - cmp r0, 0x1 - bne _0802B95A - ldr r0, [r5] - strh r4, [r0, 0xA] -_0802B95A: - movs r0, 0x1 -_0802B95C: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_802B8CC - - thumb_func_start sub_802B964 -sub_802B964: @ 802B964 - push {r4-r6,lr} - ldr r1, =gUnknown_02022CFC - ldr r0, [r1] - ldrh r0, [r0, 0xA] - adds r5, r1, 0 - cmp r0, 0x4 - bhi _0802BA50 - lsls r0, 2 - ldr r1, =_0802B984 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0802B984: - .4byte _0802B998 - .4byte _0802B9BC - .4byte _0802BA00 - .4byte _0802BA24 - .4byte _0802BA46 -_0802B998: - movs r4, 0 - ldr r0, [r5] - ldrb r0, [r0, 0x5] - cmp r4, r0 - bge _0802B9B8 - adds r6, r5, 0 -_0802B9A4: - adds r0, r4, 0 - bl sub_802DDB8 - cmp r0, 0x1 - beq _0802BA50 - adds r4, 0x1 - ldr r0, [r6] - ldrb r0, [r0, 0x5] - cmp r4, r0 - blt _0802B9A4 -_0802B9B8: - ldr r1, [r5] - b _0802BA1C -_0802B9BC: - movs r4, 0 - ldr r0, [r5] - ldrb r0, [r0, 0x5] - cmp r4, r0 - bge _0802B9EC - adds r6, r5, 0 - movs r5, 0 -_0802B9CA: - ldr r0, [r6] - adds r0, r5 - ldr r1, =0x000082f4 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0x2 - bne _0802B9E0 - lsls r0, r4, 24 - lsrs r0, 24 - bl sub_802DDA0 -_0802B9E0: - adds r5, 0x28 - adds r4, 0x1 - ldr r0, [r6] - ldrb r0, [r0, 0x5] - cmp r4, r0 - blt _0802B9CA -_0802B9EC: - movs r0, 0x1 - bl sub_802D0C8 - ldr r0, =gUnknown_02022CFC - ldr r1, [r0] - b _0802BA18 - .pool -_0802BA00: - ldr r1, [r5] - ldrh r0, [r1, 0x3C] - adds r0, 0x1 - strh r0, [r1, 0x3C] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x64 - bls _0802BA50 - movs r0, 0x3 - bl sub_802D0C8 - ldr r1, [r5] -_0802BA18: - movs r0, 0 - strh r0, [r1, 0x3C] -_0802BA1C: - ldrh r0, [r1, 0xA] - adds r0, 0x1 - strh r0, [r1, 0xA] - b _0802BA50 -_0802BA24: - bl sub_802D0F0 - adds r5, r0, 0 - cmp r5, 0 - bne _0802BA50 - bl sub_802DDCC - ldr r4, =gUnknown_02022CFC - ldr r0, [r4] - adds r0, 0x71 - strb r5, [r0] - bl sub_802C114 - ldr r1, [r4] - ldrh r0, [r1, 0xA] - adds r0, 0x1 - strh r0, [r1, 0xA] -_0802BA46: - movs r0, 0 - b _0802BA52 - .pool -_0802BA50: - movs r0, 0x1 -_0802BA52: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_802B964 - - thumb_func_start sub_802BA58 -sub_802BA58: @ 802BA58 - push {r4,lr} - ldr r1, =gUnknown_02022CFC - ldr r0, [r1] - ldrh r0, [r0, 0xA] - adds r4, r1, 0 - cmp r0, 0x6 - bls _0802BA68 - b _0802BB7C -_0802BA68: - lsls r0, 2 - ldr r1, =_0802BA7C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0802BA7C: - .4byte _0802BA98 - .4byte _0802BAB8 - .4byte _0802BAD0 - .4byte _0802BB00 - .4byte _0802BAB8 - .4byte _0802BAD0 - .4byte _0802BB70 -_0802BA98: - ldr r2, [r4] - adds r0, r2, 0 - adds r0, 0x72 - ldrh r0, [r0] - adds r1, r2, 0 - adds r1, 0x3E - adds r2, 0x40 - bl sub_802C808 - ldr r1, [r4] - ldrh r0, [r1, 0x3E] - adds r1, 0x40 - ldrh r1, [r1] - bl sub_802D7E8 - b _0802BAF0 -_0802BAB8: - bl sub_802D974 - adds r2, r0, 0 - cmp r2, 0 - bne _0802BB7C - ldr r0, =gUnknown_02022CFC - ldr r1, [r0] - strh r2, [r1, 0x3C] - b _0802BAF2 - .pool -_0802BAD0: - ldr r1, [r4] - ldrh r0, [r1, 0x3C] - adds r2, r0, 0x1 - strh r2, [r1, 0x3C] - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x3 - ands r0, r1 - cmp r0, 0 - bne _0802BAEC - lsls r0, r2, 16 - lsrs r0, 16 - cmp r0, 0xB4 - bls _0802BB7C -_0802BAEC: - bl sub_802DA14 -_0802BAF0: - ldr r1, [r4] -_0802BAF2: - ldrh r0, [r1, 0xA] - adds r0, 0x1 - strh r0, [r1, 0xA] - b _0802BB7C - .pool -_0802BB00: - bl sub_802DA44 - cmp r0, 0 - bne _0802BB7C - ldr r4, =gUnknown_02022CFC - ldr r1, [r4] - ldrh r0, [r1, 0x3E] - adds r1, 0x40 - ldrh r1, [r1] - bl sub_802C880 - ldr r1, [r4] - adds r2, r1, 0 - adds r2, 0x40 - strh r0, [r2] - lsls r0, 16 - cmp r0, 0 - beq _0802BB58 - ldrh r0, [r1, 0x3E] - ldrh r1, [r2] - bl AddBagItem - lsls r0, 24 - cmp r0, 0 - beq _0802BB58 - ldr r0, [r4] - ldrh r0, [r0, 0x3E] - movs r1, 0x1 - bl CheckBagHasSpace - lsls r0, 24 - cmp r0, 0 - bne _0802BB50 - ldr r0, [r4] - ldrh r0, [r0, 0x3E] - bl sub_802D884 - b _0802BB62 - .pool -_0802BB50: - ldr r1, [r4] - movs r0, 0x6 - strh r0, [r1, 0xA] - b _0802BB7C -_0802BB58: - ldr r4, =gUnknown_02022CFC - ldr r0, [r4] - ldrh r0, [r0, 0x3E] - bl sub_802D8FC -_0802BB62: - ldr r1, [r4] - movs r0, 0x4 - strh r0, [r1, 0xA] - b _0802BB7C - .pool -_0802BB70: - bl sub_802DA44 - cmp r0, 0 - bne _0802BB7C - movs r0, 0 - b _0802BB7E -_0802BB7C: - movs r0, 0x1 -_0802BB7E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802BA58 - - thumb_func_start sub_802BB84 -sub_802BB84: @ 802BB84 - push {r4,lr} - ldr r0, =gUnknown_02022CFC - ldr r0, [r0] - ldrh r0, [r0, 0xA] - cmp r0, 0x6 - bhi _0802BC58 - lsls r0, 2 - ldr r1, =_0802BBA4 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0802BBA4: - .4byte _0802BBC0 - .4byte _0802BBC4 - .4byte _0802BBCE - .4byte _0802BC1C - .4byte _0802BC26 - .4byte _0802BC3C - .4byte _0802BC4E -_0802BBC0: - movs r0, 0x4 - b _0802BC28 -_0802BBC4: - bl sub_802D0F0 - cmp r0, 0 - bne _0802BC58 - b _0802BC2C -_0802BBCE: - bl sub_802DA8C - lsls r0, 24 - asrs r1, r0, 24 - cmp r1, 0 - beq _0802BC04 - cmp r1, 0 - bgt _0802BBE8 - movs r0, 0x1 - negs r0, r0 - cmp r1, r0 - beq _0802BBEC - b _0802BC58 -_0802BBE8: - cmp r1, 0x1 - bne _0802BC58 -_0802BBEC: - ldr r4, =gUnknown_02022CFC - ldr r0, [r4] - adds r0, 0x45 - movs r1, 0x1 - strb r1, [r0] - movs r0, 0x6 - bl sub_802D0C8 - ldr r1, [r4] - b _0802BC30 - .pool -_0802BC04: - ldr r4, =gUnknown_02022CFC - ldr r0, [r4] - adds r0, 0x45 - movs r1, 0x2 - strb r1, [r0] - movs r0, 0x6 - bl sub_802D0C8 - ldr r1, [r4] - b _0802BC30 - .pool -_0802BC1C: - bl sub_802D0F0 - cmp r0, 0 - bne _0802BC58 - b _0802BC2C -_0802BC26: - movs r0, 0x8 -_0802BC28: - bl sub_802D0C8 -_0802BC2C: - ldr r0, =gUnknown_02022CFC - ldr r1, [r0] -_0802BC30: - ldrh r0, [r1, 0xA] - adds r0, 0x1 - strh r0, [r1, 0xA] - b _0802BC58 - .pool -_0802BC3C: - bl sub_802D0F0 - cmp r0, 0 - bne _0802BC58 - ldr r0, =gUnknown_02022CFC - ldr r1, [r0] - ldrh r0, [r1, 0xA] - adds r0, 0x1 - strh r0, [r1, 0xA] -_0802BC4E: - movs r0, 0 - b _0802BC5A - .pool -_0802BC58: - movs r0, 0x1 -_0802BC5A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802BB84 - - thumb_func_start sub_802BC60 -sub_802BC60: @ 802BC60 - push {r4,lr} - sub sp, 0x4 - ldr r1, =gUnknown_02022CFC - ldr r0, [r1] - ldrh r0, [r0, 0xA] - adds r4, r1, 0 - cmp r0, 0x5 - bhi _0802BD24 - lsls r0, 2 - ldr r1, =_0802BC84 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_0802BC84: - .4byte _0802BC9C - .4byte _0802BCA2 - .4byte _0802BCB2 - .4byte _0802BCC8 - .4byte _0802BCEE - .4byte _0802BD14 -_0802BC9C: - bl sub_802DA14 - b _0802BCFE -_0802BCA2: - bl sub_802DA44 - cmp r0, 0 - bne _0802BD24 - movs r0, 0x7 - bl sub_802D0C8 - b _0802BCFE -_0802BCB2: - bl sub_802D0F0 - adds r2, r0, 0 - cmp r2, 0 - bne _0802BD24 - ldr r0, =gUnknown_02022CFC - ldr r1, [r0] - strh r2, [r1, 0x3C] - b _0802BD02 - .pool -_0802BCC8: - ldr r1, [r4] - ldrh r0, [r1, 0x3C] - adds r0, 0x1 - strh r0, [r1, 0x3C] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x78 - bls _0802BD24 - movs r1, 0x1 - negs r1, r1 - movs r0, 0 - str r0, [sp] - adds r0, r1, 0 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r1, [r4] - b _0802BD02 -_0802BCEE: - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _0802BD24 - bl sub_800AC34 -_0802BCFE: - ldr r0, =gUnknown_02022CFC - ldr r1, [r0] -_0802BD02: - ldrh r0, [r1, 0xA] - adds r0, 0x1 - strh r0, [r1, 0xA] - b _0802BD24 - .pool -_0802BD14: - ldr r0, =gReceivedRemoteLinkPlayers - ldrb r0, [r0] - cmp r0, 0 - bne _0802BD24 - movs r0, 0 - b _0802BD26 - .pool -_0802BD24: - movs r0, 0x1 -_0802BD26: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802BC60 - - thumb_func_start sub_802BD30 -sub_802BD30: @ 802BD30 - push {r4,lr} - ldr r4, =gUnknown_02022CFC - ldr r0, [r4] - ldrh r0, [r0, 0xA] - cmp r0, 0x1 - beq _0802BD66 - cmp r0, 0x1 - bgt _0802BD4C - cmp r0, 0 - beq _0802BD52 - b _0802BD7A - .pool -_0802BD4C: - cmp r0, 0x2 - beq _0802BD76 - b _0802BD7A -_0802BD52: - bl sub_802DA14 - movs r0, 0 - bl sub_802DD64 - ldr r1, [r4] - ldrh r0, [r1, 0xA] - adds r0, 0x1 - strh r0, [r1, 0xA] - b _0802BD7A -_0802BD66: - bl sub_802DA44 - cmp r0, 0 - bne _0802BD7A - ldr r1, [r4] - ldrh r0, [r1, 0xA] - adds r0, 0x1 - strh r0, [r1, 0xA] -_0802BD76: - movs r0, 0 - b _0802BD7C -_0802BD7A: - movs r0, 0x1 -_0802BD7C: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_802BD30 - thumb_func_start sub_802BD84 sub_802BD84: @ 802BD84 push {r4-r7,lr} diff --git a/src/pokemon_jump.c b/src/pokemon_jump.c index d49ee293b..a62c9af77 100755 --- a/src/pokemon_jump.c +++ b/src/pokemon_jump.c @@ -1,8 +1,12 @@ #include "global.h" #include "alloc.h" +#include "item.h" #include "link.h" #include "main.h" +#include "menu.h" #include "palette.h" +#include "random.h" +#include "save.h" #include "sound.h" #include "sprite.h" #include "task.h" @@ -35,7 +39,7 @@ struct PokemonJump1_82E4 struct PokemonJump1 { - MainCallback unk0; + MainCallback returnCallback; u8 unk4; u8 unk5; u8 unk6; @@ -53,12 +57,16 @@ struct PokemonJump1 u8 filler28[0x4]; int unk2C; u32 unk30; - u8 filler34[0x6]; + u8 filler34[0x2]; + u16 unk36; + u8 filler38[0x2]; u16 unk3A; - u8 filler3C[0x6]; + u16 unk3C; + u16 unk3E; + u16 unk40; u16 unk42; u8 unk44; - u8 filler45[0x1]; + u8 unk45; u8 unk46; u8 isLeader; u8 unk48; @@ -119,43 +127,77 @@ static void sub_802AF80(u8 taskId); static void sub_802B008(void); static void sub_802B194(u8 taskId); static void sub_802B1FC(void); -bool32 sub_802B248(void); -bool32 sub_802B2D4(void); -bool32 sub_802B368(void); -bool32 sub_802B3D4(void); -bool32 sub_802B4CC(void); -bool32 sub_802B5C8(void); -bool32 sub_802B664(void); -bool32 sub_802B6B8(void); -bool32 sub_802B720(void); -bool32 sub_802B29C(void); -bool32 sub_802B31C(void); -bool32 sub_802B3B4(void); -bool32 sub_802B470(void); -bool32 sub_802B568(void); -bool32 sub_802B628(void); -bool32 sub_802B664(void); -bool32 sub_802B704(void); -bool32 sub_802B720(void); -bool32 sub_802B7E0(void); -bool32 sub_802B8CC(void); +static bool32 sub_802B248(void); +static bool32 sub_802B2D4(void); +static bool32 sub_802B368(void); +static bool32 sub_802B3D4(void); +static bool32 sub_802B470(void); +static bool32 sub_802B4CC(void); +static bool32 sub_802B568(void); +static bool32 sub_802B5C8(void); +static bool32 sub_802B628(void); +static bool32 sub_802B664(void); +static bool32 sub_802B6B8(void); +static bool32 sub_802B704(void); +static bool32 sub_802B720(void); +static bool32 sub_802B7E0(void); +static bool32 sub_802B8CC(void); +static bool32 sub_802B964(void); +static bool32 sub_802B29C(void); +static bool32 sub_802B31C(void); +static bool32 sub_802B3B4(void); +static bool32 sub_802BA58(void); +static bool32 sub_802BB84(void); +static bool32 sub_802BC60(void); +static bool32 sub_802BD30(void); void sub_802BD84(u8 taskId); void sub_802BE60(TaskFunc func, u8 taskPriority); void sub_802BE80(void); +void sub_802BEA0(void); +void sub_802BEE4(void); void sub_802C0B8(void); void sub_802C0E8(void); +void sub_802C114(void); +void sub_802C164(void); void sub_802C1DC(void); +bool32 sub_802C130(u16); +void sub_802C260(void); +void sub_802C270(void); void sub_802C43C(void); +void sub_802C808(u16, u16 *, u16 *); bool32 sub_802C538(void); +bool32 sub_802C650(void); +bool32 sub_802C5DC(void); bool32 sub_802C70C(void); +bool32 sub_802C7BC(void); +u16 sub_802C7E0(void); +u16 sub_802C880(u16, u16); void sub_802D074(void *); void sub_802D0AC(void); +void sub_802D0C8(int); int sub_802D0F0(void); +void sub_802D764(void); +bool32 sub_802D788(void); +void sub_802D7E8(u16, u16); +void sub_802D884(u16); +void sub_802D8FC(u16); +bool32 sub_802D974(void); +void sub_802DA14(void); +bool32 sub_802DA44(void); +void sub_802DD64(int); +s8 sub_802DA8C(void); +void sub_802DDA0(u8); +int sub_802DDB8(int); +void sub_802DDCC(void); +void sub_802DDE0(void); +void sub_802DDF4(int); +int sub_802DE08(void); void sub_802E138(struct PokemonJump1_82E4 *, u8 *); bool32 sub_802E1BC(struct PokemonJump1_82E4 *, struct Unk802B078 *); void sub_802E234(struct PokemonJump1_82E4 *, u8 , u16); bool32 sub_802E264(struct PokemonJump1_82E4 *, int, u8 *, u16 *); bool32 sub_802E2D0(struct PokemonJump1_82E4 *, int); +int sub_802E354(int, u16, u16); void sub_802E3A8(void); extern struct PokemonJump1 *gUnknown_02022CFC; @@ -302,7 +344,7 @@ void sub_802A9A8(u16 partyIndex, MainCallback callback) ResetTasks(); taskId = CreateTask(sub_802ACA0, 1); gUnknown_02022CFC->unk8 = 0; - gUnknown_02022CFC->unk0 = callback; + gUnknown_02022CFC->returnCallback = callback; gUnknown_02022CFC->unk4 = taskId; gUnknown_02022CFC->unk6 = GetMultiplayerId(); sub_802AC2C(&gUnknown_02022CFC->unk82A8[gUnknown_02022CFC->unk6], &gPlayerParty[partyIndex]); @@ -316,7 +358,7 @@ void sub_802A9A8(u16 partyIndex, MainCallback callback) SetMainCallback2(callback); } -void sub_802AA48(void) +static void sub_802AA48(void) { sub_802D0AC(); Free(gUnknown_02022CFC); @@ -728,7 +770,7 @@ static void sub_802B1FC(void) } } -bool32 sub_802B248(void) +static bool32 sub_802B248(void) { switch (gUnknown_02022CFC->unk8) { @@ -749,7 +791,7 @@ bool32 sub_802B248(void) return TRUE; } -bool32 sub_802B29C(void) +static bool32 sub_802B29C(void) { switch (gUnknown_02022CFC->unk8) { @@ -765,7 +807,7 @@ bool32 sub_802B29C(void) return TRUE; } -bool32 sub_802B2D4(void) +static bool32 sub_802B2D4(void) { switch (gUnknown_02022CFC->unk8) { @@ -786,7 +828,7 @@ bool32 sub_802B2D4(void) return TRUE; } -bool32 sub_802B31C(void) +static bool32 sub_802B31C(void) { switch (gUnknown_02022CFC->unk8) { @@ -805,7 +847,7 @@ bool32 sub_802B31C(void) return TRUE; } -bool32 sub_802B368(void) +static bool32 sub_802B368(void) { if (!sub_802B8CC()) { @@ -825,7 +867,7 @@ bool32 sub_802B368(void) return FALSE; } -bool32 sub_802B3B4(void) +static bool32 sub_802B3B4(void) { if (!sub_802B8CC()) ; @@ -836,3 +878,589 @@ bool32 sub_802B3B4(void) return FALSE; } + +static bool32 sub_802B3D4(void) +{ + switch (gUnknown_02022CFC->unk8) + { + case 0: + sub_802C538(); + if (sub_802C5DC()) + gUnknown_02022CFC->unk8++; + break; + case 1: + if (!sub_802B964()) + { + if (sub_802C7BC()) + { + gUnknown_02022CFC->unk72 = sub_802C7E0(); + gUnknown_02022CFC->unk4C = 7; + } + else if (gUnknown_02022CFC->unk74 >= 200) + { + gUnknown_02022CFC->unk72 = gUnknown_02022CFC->unkE; + gUnknown_02022CFC->unk4C = 8; + } + else + { + gUnknown_02022CFC->unk72 = gUnknown_02022CFC->unkE; + gUnknown_02022CFC->unk4C = 4; + } + + gUnknown_02022CFC->unk8++; + return FALSE; + } + break; + case 2: + return FALSE; + } + + return TRUE; +} + +static bool32 sub_802B470(void) +{ + switch (gUnknown_02022CFC->unk8) + { + case 0: + if (!sub_802C538()) + sub_802C0B8(); + if (sub_802C5DC()) + gUnknown_02022CFC->unk8++; + break; + case 1: + if (!sub_802B964()) + { + gUnknown_02022CFC->unk8++; + return FALSE; + } + break; + case 2: + return FALSE; + } + + return TRUE; +} + +static bool32 sub_802B4CC(void) +{ + switch (gUnknown_02022CFC->unk8) + { + case 0: + sub_802AE14(4); + gUnknown_02022CFC->unk8++; + // fall through + case 1: + if (!sub_802BB84()) + { + sub_802E354(gUnknown_02022CFC->unk78, gUnknown_02022CFC->unk74, gUnknown_02022CFC->unk72); + gUnknown_02022CFC->unk8++; + } + break; + case 2: + if (gUnknown_02022CFC->unk49) + { + if (sub_802C650()) + gUnknown_02022CFC->unk4C = 5; + else + gUnknown_02022CFC->unk4C = 6; + + gUnknown_02022CFC->unk8++; + return FALSE; + } + break; + case 3: + return FALSE; + } + + return TRUE; +} + +static bool32 sub_802B568(void) +{ + switch (gUnknown_02022CFC->unk8) + { + case 0: + sub_802AE14(0); + gUnknown_02022CFC->unk8++; + // fall through + case 1: + if (!sub_802BB84()) + { + sub_802E354(gUnknown_02022CFC->unk78, gUnknown_02022CFC->unk74, gUnknown_02022CFC->unk72); + gUnknown_02022CFC->unk42 = gUnknown_02022CFC->unk45; + return FALSE; + } + break; + } + + return TRUE; +} + +static bool32 sub_802B5C8(void) +{ + switch (gUnknown_02022CFC->unk8) + { + case 0: + if (!sub_802BD30()) + gUnknown_02022CFC->unk8++; + break; + case 1: + if (gUnknown_02022CFC->unk49) + { + sub_802AA94(gUnknown_02022CFC); + gUnknown_02022CFC->unk24 = Random(); + gUnknown_02022CFC->unk72 = gUnknown_02022CFC->unk24; + gUnknown_02022CFC->unk4C = 0; + return FALSE; + } + break; + } + + return TRUE; +} + +static bool32 sub_802B628(void) +{ + switch (gUnknown_02022CFC->unk8) + { + case 0: + if (!sub_802BD30()) + { + sub_802AA94(gUnknown_02022CFC); + gUnknown_02022CFC->unk8++; + return FALSE; + } + break; + case 1: + return FALSE; + } + + return TRUE; +} + +static bool32 sub_802B664(void) +{ + switch (gUnknown_02022CFC->unk8) + { + case 0: + gUnknown_02022CFC->unk8 = 1; + break; + case 1: + sub_802AE14(0); + gUnknown_02022CFC->unk8++; + break; + case 2: + if (!sub_802BC60()) + { + SetMainCallback2(gUnknown_02022CFC->returnCallback); + sub_802AA48(); + } + break; + } + + return TRUE; +} + +static bool32 sub_802B6B8(void) +{ + switch (gUnknown_02022CFC->unk8) + { + case 0: + sub_802AE14(4); + gUnknown_02022CFC->unk8++; + break; + case 1: + if (!sub_802BA58()) + { + gUnknown_02022CFC->unk72 = gUnknown_02022CFC->unkE; + gUnknown_02022CFC->unk4C = 8; + return FALSE; + } + break; + } + + return TRUE; +} + +static bool32 sub_802B704(void) +{ + sub_802AE14(0); + if (!sub_802BA58()) + return FALSE; + else + return TRUE; +} + +static bool32 sub_802B720(void) +{ + switch (gUnknown_02022CFC->unk8) + { + case 0: + sub_802E354(gUnknown_02022CFC->unk78, gUnknown_02022CFC->unk74, gUnknown_02022CFC->unk72); + sub_802D0C8(5); + gUnknown_02022CFC->unk8++; + break; + case 1: + if (!sub_802D0F0()) + { + sub_802AE14(0); + gUnknown_02022CFC->unk8++; + } + break; + case 2: + if (sub_802C70C()) + { + CreateTask(sub_8153688, 6); + gUnknown_02022CFC->unk8++; + } + break; + case 3: + if (!FuncIsActiveTask(sub_8153688)) + { + sub_802DA14(); + gUnknown_02022CFC->unk8++; + } + break; + case 4: + if (!sub_802DA44()) + { + gUnknown_02022CFC->unk4C = 4; + return FALSE; + } + break; + } + + return TRUE; +} + +static bool32 sub_802B7E0(void) +{ + int var0; + + switch (gUnknown_02022CFC->unkA) + { + case 0: + sub_802D0C8(2); + sub_802DDE0(); + gUnknown_02022CFC->unkA++; + break; + case 1: + var0 = sub_802D0F0(); + if (!var0) + { + sub_802DDF4(gUnknown_02022CFC->unk6); + gUnknown_02022CFC->unk3C = 0; + gUnknown_02022CFC->unkA++; + } + break; + case 2: + if (++gUnknown_02022CFC->unk3C > 120) + { + sub_802D0C8(3); + gUnknown_02022CFC->unkA++; + } + break; + case 3: + if (sub_802D0F0() != 1 && sub_802DE08() != 1) + gUnknown_02022CFC->unkA++; + break; + case 4: + sub_802D0C8(9); + gUnknown_02022CFC->unkA++; + break; + case 5: + if (!sub_802D0F0()) + { + sub_802C260(); + sub_802D764(); + gUnknown_02022CFC->unkA++; + } + break; + case 6: + if (!sub_802D788()) + { + sub_802C270(); + sub_802BEA0(); + gUnknown_02022CFC->unkA++; + return FALSE; + } + break; + case 7: + return FALSE; + } + + return TRUE; +} + +static bool32 sub_802B8CC(void) +{ + sub_802BEE4(); + if (gUnknown_02022CFC->unk36) + { + gUnknown_02022CFC->unk36 = 0; + return FALSE; + } + + switch (gUnknown_02022CFC->unkA) + { + case 0: + if (sub_802C130(0)) + gUnknown_02022CFC->unkA++; + else + break; + // fall through + case 1: + if (gMain.newKeys & A_BUTTON) + { + sub_802C164(); + sub_802AE14(3); + gUnknown_02022CFC->unkA++; + } + break; + case 2: + if (sub_802C130(1) == TRUE) + gUnknown_02022CFC->unkA++; + break; + case 3: + if (sub_802C130(0) == TRUE) + gUnknown_02022CFC->unkA = 0; + break; + } + + return TRUE; +} + +static bool32 sub_802B964(void) +{ + int i; + + switch (gUnknown_02022CFC->unkA) + { + case 0: + for (i = 0; i < gUnknown_02022CFC->unk5; i++) + { + if (sub_802DDB8(i) == 1) + return TRUE; + } + + gUnknown_02022CFC->unkA++; + break; + case 1: + for (i = 0; i < gUnknown_02022CFC->unk5; i++) + { + if (gUnknown_02022CFC->unk82E4[i].unk10 == 2) + sub_802DDA0(i); + } + + sub_802D0C8(1); + gUnknown_02022CFC->unk3C = 0; + gUnknown_02022CFC->unkA++; + break; + case 2: + if (++gUnknown_02022CFC->unk3C > 100) + { + sub_802D0C8(3); + gUnknown_02022CFC->unk3C = 0; + gUnknown_02022CFC->unkA++; + } + break; + case 3: + if (!sub_802D0F0()) + { + sub_802DDCC(); + gUnknown_02022CFC->unk71 = 0; + sub_802C114(); + gUnknown_02022CFC->unkA++; + return FALSE; + } + break; + case 4: + return FALSE; + } + + return TRUE; +} + +static bool32 sub_802BA58(void) +{ + switch (gUnknown_02022CFC->unkA) + { + case 0: + sub_802C808(gUnknown_02022CFC->unk72, &gUnknown_02022CFC->unk3E, &gUnknown_02022CFC->unk40); + sub_802D7E8(gUnknown_02022CFC->unk3E, gUnknown_02022CFC->unk40); + gUnknown_02022CFC->unkA++; + break; + case 1: + case 4: + if (!sub_802D974()) + { + gUnknown_02022CFC->unk3C = 0; + gUnknown_02022CFC->unkA++; + } + break; + case 2: + case 5: + gUnknown_02022CFC->unk3C++; + if (gMain.newKeys & (A_BUTTON | B_BUTTON) || gUnknown_02022CFC->unk3C > 180) + { + sub_802DA14(); + gUnknown_02022CFC->unkA++; + } + break; + case 3: + if (!sub_802DA44()) + { + gUnknown_02022CFC->unk40 = sub_802C880(gUnknown_02022CFC->unk3E, gUnknown_02022CFC->unk40); + if (gUnknown_02022CFC->unk40 && AddBagItem(gUnknown_02022CFC->unk3E, gUnknown_02022CFC->unk40)) + { + if (!CheckBagHasSpace(gUnknown_02022CFC->unk3E, 1)) + { + sub_802D884(gUnknown_02022CFC->unk3E); + gUnknown_02022CFC->unkA = 4; + } + else + { + gUnknown_02022CFC->unkA = 6; + break; + } + } + else + { + sub_802D8FC(gUnknown_02022CFC->unk3E); + gUnknown_02022CFC->unkA = 4; + } + } + break; + case 6: + if (!sub_802DA44()) + return FALSE; + break; + } + + return TRUE; +} + +static bool32 sub_802BB84(void) +{ + s8 input; + + switch (gUnknown_02022CFC->unkA) + { + case 0: + sub_802D0C8(4); + gUnknown_02022CFC->unkA++; + break; + case 1: + if (!sub_802D0F0()) + gUnknown_02022CFC->unkA++; + break; + case 2: + input = sub_802DA8C(); + switch (input) + { + case MENU_B_PRESSED: + case 1: + gUnknown_02022CFC->unk45 = 1; + sub_802D0C8(6); + gUnknown_02022CFC->unkA++; + break; + case 0: + gUnknown_02022CFC->unk45 = 2; + sub_802D0C8(6); + gUnknown_02022CFC->unkA++; + break; + } + break; + case 3: + if (!sub_802D0F0()) + gUnknown_02022CFC->unkA++; + break; + case 4: + sub_802D0C8(8); + gUnknown_02022CFC->unkA++; + break; + case 5: + if (!sub_802D0F0()) + { + gUnknown_02022CFC->unkA++; + return FALSE; + } + break; + case 6: + return FALSE; + } + + return TRUE; +} + +static bool32 sub_802BC60(void) +{ + int var0; + + switch (gUnknown_02022CFC->unkA) + { + case 0: + sub_802DA14(); + gUnknown_02022CFC->unkA++; + break; + case 1: + if (!sub_802DA44()) + { + sub_802D0C8(7); + gUnknown_02022CFC->unkA++; + } + break; + case 2: + var0 = sub_802D0F0(); + if (!var0) + { + gUnknown_02022CFC->unk3C = var0; + gUnknown_02022CFC->unkA++; + } + break; + case 3: + if (++gUnknown_02022CFC->unk3C > 120) + { + BeginNormalPaletteFade(0xFFFFFFFF, -1, 0, 16, RGB_BLACK); + gUnknown_02022CFC->unkA++; + } + break; + case 4: + if (!gPaletteFade.active) + { + sub_800AC34(); + gUnknown_02022CFC->unkA++; + } + break; + case 5: + if (!gReceivedRemoteLinkPlayers) + return FALSE; + break; + } + + return TRUE; +} + +static bool32 sub_802BD30(void) +{ + switch (gUnknown_02022CFC->unkA) + { + case 0: + sub_802DA14(); + sub_802DD64(0); + gUnknown_02022CFC->unkA++; + break; + case 1: + if (!sub_802DA44()) + { + gUnknown_02022CFC->unkA++; + return FALSE; + } + break; + case 2: + return FALSE; + } + + return TRUE; +}