diff --git a/asm/rom_8011DC0.s b/asm/rom_8011DC0.s index 4bfd02b182..1639841087 100644 --- a/asm/rom_8011DC0.s +++ b/asm/rom_8011DC0.s @@ -5,7 +5,1856 @@ .text + thumb_func_start sub_80156E0 +sub_80156E0: @ 80156E0 + push {r4-r7,lr} + sub sp, 0xC + lsls r0, 24 + lsrs r4, r0, 24 + movs r5, 0 + ldr r0, =gUnknown_02022C30 + ldr r6, [r0] + lsls r0, r4, 2 + adds r0, r4 + lsls r0, 3 + ldr r1, =gTasks + 0x8 + adds r7, r0, r1 + ldrb r0, [r6, 0x14] + cmp r0, 0x38 + bls _08015702 + bl _08016878 +_08015702: + lsls r0, 2 + ldr r1, =_08015718 + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .pool + .align 2, 0 +_08015718: + .4byte _080157FC + .4byte _08015854 + .4byte _08015878 + .4byte _080158C8 + .4byte _080159A6 + .4byte _08015E5C + .4byte _08015C54 + .4byte _08015E5C + .4byte _08016864 + .4byte _080161C8 + .4byte _080162D4 + .4byte _080160AC + .4byte _080160C6 + .4byte _08016324 + .4byte _08016348 + .4byte _08016350 + .4byte _08016360 + .4byte _0801638E + .4byte _080163A2 + .4byte _08015F32 + .4byte _08015FB8 + .4byte _08015FD6 + .4byte _0801604A + .4byte _08015ADA + .4byte _08015B00 + .4byte _08015B78 + .4byte _08016838 + .4byte _08015D4C + .4byte _08015D34 + .4byte _08015DD0 + .4byte _08015C2A + .4byte _08015DA6 + .4byte _08015D9C + .4byte _08016158 + .4byte _08016178 + .4byte _080161B8 + .4byte _080162DC + .4byte _08016318 + .4byte _08015BF4 + .4byte _08016104 + .4byte _08015E94 + .4byte _08015EC4 + .4byte _080163CC + .4byte _0801645C + .4byte _080165A8 + .4byte _08016610 + .4byte _0801662C + .4byte _08016478 + .4byte _08016634 + .4byte _08016738 + .4byte _0801676C + .4byte _080167F4 + .4byte _0801652C + .4byte _080164E0 + .4byte _080164F4 + .4byte _0801658C + .4byte _080165DC +_080157FC: + movs r0, 0x70 + bl AllocZeroed + str r0, [r6, 0x4] + movs r0, 0x70 + bl AllocZeroed + str r0, [r6, 0xC] + movs r0, 0x80 + lsls r0, 1 + bl AllocZeroed + str r0, [r6] + movs r0, 0x20 + bl AllocZeroed + str r0, [r6, 0x8] + ldr r0, [r6] + movs r1, 0x8 + bl sub_8017580 + ldr r1, =gUnknown_02022C2C + movs r0, 0x40 + strb r0, [r1] + ldr r0, [r6, 0xC] + ldr r1, [r6, 0x4] + movs r2, 0x9 + bl sub_8016DF0 + adds r1, r6, 0 + adds r1, 0x20 + strb r0, [r1] + adds r0, r6, 0 + adds r0, 0xA0 + bl sub_8019BA8 + bl sub_8019F2C + movs r0, 0x1 + bl _08016876 + .pool +_08015854: + adds r0, r6, 0 + adds r0, 0x21 + movs r2, 0 + ldrsh r1, [r7, r2] + bl sub_8019E70 + ldrh r0, [r7] + adds r0, 0x1 + strh r0, [r7] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x8 + beq _08015872 + bl _08016878 +_08015872: + movs r0, 0x2 + bl _08016876 +_08015878: + movs r0, 0x40 + movs r1, 0 + movs r2, 0 + bl sub_8010F84 + ldr r2, =gUnknown_02022C40 + ldrh r0, [r2, 0x2] + ldrh r1, [r2, 0xA] + ldrh r2, [r2, 0xC] + bl sub_8010FCC + bl sub_800B488 + bl OpenLink + bl sub_8011C84 + ldr r0, [r6, 0x8] + movs r1, 0x1 + bl sub_8017580 + ldr r0, [r6, 0x4] + movs r1, 0x4 + bl sub_80175EC + ldr r0, [r6, 0xC] + movs r1, 0x4 + bl sub_80175EC + ldr r1, =gSpecialVar_Result + movs r0, 0 + strh r0, [r1] + movs r0, 0x3 + bl _08016876 + .pool +_080158C8: + bl sub_81B1360 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x8 + beq _080158E0 + bl sub_81B1360 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x9 + bne _080159A0 +_080158E0: + ldr r4, =gUnknown_02022C40 + ldrh r0, [r4] + cmp r0, 0 + beq _080159A0 + bl GetCursorSelectionMonId + lsls r0, 24 + lsrs r5, r0, 24 + ldrh r0, [r4] + cmp r0, 0x1 + beq _08015900 + cmp r0, 0x2 + beq _08015950 + b _0801598E + .pool +_08015900: + movs r0, 0x54 + movs r1, 0 + movs r2, 0x1 + bl sub_8011090 + cmp r5, 0x5 + bls _0801592C + adds r0, r4, 0 + bl sub_801807C + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl sub_8010FCC + ldr r0, =gUnknown_082EF4FC + bl sub_801568C + b _0801598E + .pool +_0801592C: + bl GetCursorSelectionMonId + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + bl sub_80180A0 + cmp r0, 0 + bne _0801594C + ldr r1, =gUnknown_082EF47C + movs r0, 0x34 + bl sub_8015664 + b _0801598E + .pool +_0801594C: + movs r0, 0x37 + b _0801598C +_08015950: + adds r0, r6, 0 + bl sub_80156C8 + ldrb r0, [r4, 0x8] + strh r0, [r7, 0x2] + cmp r5, 0x5 + bls _0801596C + ldr r0, =gUnknown_082EF544 + bl sub_801568C + b _0801598E + .pool +_0801596C: + movs r0, 0x54 + movs r1, 0 + movs r2, 0x1 + bl sub_8011090 + ldr r1, =gUnknown_02022C2C + movs r0, 0x44 + strb r0, [r1] + bl GetCursorSelectionMonId + lsls r0, 24 + lsrs r0, 24 + adds r1, r4, 0 + bl sub_80180E8 + movs r0, 0x33 +_0801598C: + strb r0, [r6, 0x14] +_0801598E: + ldr r1, =gUnknown_02022C40 + movs r0, 0 + strh r0, [r1] + bl _08016878 + .pool +_080159A0: + movs r0, 0x4 + bl _08016876 +_080159A6: + ldr r4, =gSpecialVar_Result + ldrh r0, [r4] + cmp r0, 0 + beq _08015A0A + cmp r0, 0x9 + bne _080159E0 + movs r0, 0x54 + movs r1, 0 + movs r2, 0x1 + bl sub_8011090 + movs r0, 0x2 + bl PlaySE + ldr r0, =gStringVar1 + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + bl StringCopy + movs r1, 0 + movs r0, 0x2A + b _08015A02 + .pool +_080159E0: + cmp r0, 0xB + bne _080159F4 + movs r0, 0x54 + movs r1, 0 + movs r2, 0x1 + bl sub_8011090 + movs r1, 0 + movs r0, 0x17 + b _08015A02 +_080159F4: + movs r0, 0 + strh r0, [r7] + ldrh r0, [r4] + subs r0, 0x1 + strh r0, [r7, 0x2] + movs r1, 0 + movs r0, 0x18 +_08015A02: + strb r0, [r6, 0x14] + strh r1, [r4] + bl _08016878 +_08015A0A: + bl ScriptContext2_IsEnabled + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x1 + bne _08015A1A + bl _08016878 +_08015A1A: + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08015A80 + ldr r0, [r6] + adds r2, r7, 0x2 + adds r3, r6, 0 + adds r3, 0x21 + adds r1, r7, 0 + bl sub_801A2A8 + cmp r0, 0 + beq _08015A4C + movs r0, 0x5 + bl PlaySE + bl sub_80181CC + movs r0, 0x18 + bl _08016876 + .pool +_08015A4C: + bl sub_8017940 + cmp r0, 0 + beq _08015A80 + movs r0, 0x54 + movs r1, 0 + movs r2, 0x1 + bl sub_8011090 + movs r0, 0x2 + bl PlaySE + bl sub_80181CC + ldr r0, =gStringVar1 + ldr r1, =gSaveBlock2Ptr + ldr r1, [r1] + bl StringCopy + movs r0, 0x2D + bl _08016876 + .pool +_08015A80: + bl sub_8016B00 + lsls r0, 24 + lsrs r0, 24 + cmp r0, 0x2 + beq _08015AA2 + cmp r0, 0x2 + bgt _08015A96 + cmp r0, 0x1 + beq _08015A9C + b _08015AD0 +_08015A96: + cmp r0, 0x4 + beq _08015AAA + b _08015AD0 +_08015A9C: + movs r0, 0x2 + bl PlaySE +_08015AA2: + adds r0, r6, 0 + bl sub_801A274 + b _08015AD0 +_08015AAA: + movs r0, 0xB + strb r0, [r6, 0x14] + bl sub_80181CC + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl sub_8010FCC + adds r0, r6, 0 + bl sub_80181DC + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + movs r0, 0x53 + movs r2, 0 + bl sub_8011090 +_08015AD0: + adds r0, r6, 0 + bl sub_801A284 + bl _08016878 +_08015ADA: + ldr r0, =sub_809FA34 + bl FuncIsActiveTask + lsls r0, 24 + cmp r0, 0 + beq _08015AEA + bl _08016878 +_08015AEA: + movs r0, 0x40 + movs r1, 0 + movs r2, 0 + bl sub_8011090 + movs r0, 0x4 + bl _08016876 + .pool +_08015B00: + bl sub_801704C + movs r3, 0x2 + ldrsh r0, [r7, r3] + ldr r1, [r6] + bl sub_8017CF8 + adds r4, r0, 0 + movs r0, 0x54 + movs r1, 0 + movs r2, 0x1 + bl sub_8011090 + ldr r0, [r6] + ldrb r1, [r7] + ldrb r2, [r7, 0x2] + adds r3, r4, 0 + bl sub_80179D4 + cmp r0, 0x1 + beq _08015B44 + cmp r0, 0x1 + bgt _08015B36 + cmp r0, 0 + beq _08015B3E + bl _08016878 +_08015B36: + cmp r0, 0x2 + beq _08015B68 + bl _08016878 +_08015B3E: + movs r0, 0x1A + bl _08016876 +_08015B44: + movs r1, 0x2 + ldrsh r0, [r7, r1] + lsls r0, 5 + ldr r1, [r6] + adds r1, r0 + adds r0, r1, 0 + adds r0, 0x10 + ldr r2, =gUnknown_02022C2C + ldrb r2, [r2] + bl sub_8012188 + strh r5, [r6, 0x12] + movs r0, 0x19 + bl _08016876 + .pool +_08015B68: + ldr r1, =gStringVar4 + movs r0, 0x13 + bl sub_8015664 + bl _08016878 + .pool +_08015B78: + bl sub_801704C + bl sub_8011A74 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x1 + blt _08015BBE + cmp r4, 0x2 + ble _08015B9A + cmp r4, 0x4 + bne _08015BBE + movs r0, 0x1 + bl sub_801818C + strb r4, [r6, 0x14] + b _08015BBE +_08015B9A: + bl sub_8011B90 + cmp r0, 0x1 + bne _08015BB0 + ldr r0, =gUnknown_082EE6C8 + bl sub_801568C + b _08015BB8 + .pool +_08015BB0: + ldr r1, =gUnknown_082EE6C8 + movs r0, 0x1E + bl sub_8015664 +_08015BB8: + ldr r1, =gUnknown_02022C2C + movs r0, 0x40 + strb r0, [r1] +_08015BBE: + ldr r0, =gReceivedRemoteLinkPlayers + ldrb r0, [r0] + cmp r0, 0 + bne _08015BCA + bl _08016878 +_08015BCA: + ldr r0, =gBlockSendBuffer + movs r1, 0x1 + bl sub_80143E4 + ldr r0, =sub_80140E0 + movs r1, 0x5 + bl CreateTask + movs r0, 0x26 + bl _08016876 + .pool +_08015BF4: + ldr r0, =sub_80140E0 + bl FuncIsActiveTask + lsls r0, 24 + cmp r0, 0 + beq _08015C04 + bl _08016878 +_08015C04: + ldr r0, =gUnknown_02022C2C + ldrb r0, [r0] + cmp r0, 0x44 + bne _08015C24 + ldr r1, =gUnknown_082EE004 + movs r0, 0x1F + bl sub_8015664 + bl _08016878 + .pool +_08015C24: + movs r0, 0x5 + bl _08016876 +_08015C2A: + ldr r0, =gReceivedRemoteLinkPlayers + ldrb r0, [r0] + cmp r0, 0 + beq _08015C36 + bl _08016878 +_08015C36: + movs r0, 0 + bl sub_801818C + movs r2, 0 + ldrsh r0, [r7, r2] + movs r3, 0x2 + ldrsh r1, [r7, r3] + ldr r2, [r6] + bl sub_801A3D0 + movs r0, 0x2 + bl _08016876 + .pool +_08015C54: + adds r0, r6, 0 + adds r0, 0x16 + adds r1, r6, 0 + adds r1, 0x1B + adds r2, r6, 0 + adds r2, 0x1C + ldr r3, =gUnknown_082F021C + ldr r4, =gUnknown_082F0244 + str r4, [sp] + bl sub_8017178 + adds r5, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r5, r0 + bne _08015C78 + bl _08016878 +_08015C78: + ldr r0, =gReceivedRemoteLinkPlayers + ldrb r0, [r0] + cmp r0, 0 + bne _08015C94 + movs r0, 0x1C + bl _08016876 + .pool +_08015C94: + adds r1, r6, 0 + adds r1, 0x98 + movs r0, 0 + strh r0, [r1] + movs r2, 0x2 + ldrsh r0, [r7, r2] + ldr r1, [r6] + bl sub_8017CF8 + movs r0, 0x2 + negs r0, r0 + cmp r5, r0 + beq _08015CB2 + cmp r5, 0x40 + bne _08015CE4 +_08015CB2: + adds r0, r6, 0 + adds r0, 0x4C + movs r1, 0x40 + strh r1, [r0] + bl sub_800FE50 + ldr r0, =gStringVar4 + ldr r2, =gUnknown_082EEB80 + ldr r1, =gLinkPlayers + ldrb r1, [r1, 0x13] + lsls r1, 2 + adds r1, r2 + ldr r1, [r1] + bl StringCopy + movs r0, 0x20 + bl _08016876 + .pool +_08015CE4: + ldr r0, =gUnknown_02022C2C + strb r5, [r0] + ldr r1, =gUnknown_02022C2D + lsrs r0, r5, 8 + strb r0, [r1] + lsls r0, r5, 24 + lsrs r0, 24 + cmp r0, 0x41 + bne _08015D18 + bl sub_8018024 + cmp r0, 0 + bne _08015D18 + ldr r1, =gUnknown_082EEBD0 + movs r0, 0x5 + bl sub_8015664 + bl _08016878 + .pool +_08015D18: + ldr r0, =gUnknown_02022C2C + ldrb r0, [r0] + movs r1, 0x40 + orrs r1, r0 + adds r0, r6, 0 + adds r0, 0x4C + strh r1, [r0] + bl sub_800FE50 + movs r0, 0x1B + bl _08016876 + .pool +_08015D34: + ldr r0, =gStringVar4 + ldr r1, =gUnknown_082EEB88 + bl StringCopy + movs r0, 0x24 + bl _08016876 + .pool +_08015D4C: + adds r0, r6, 0 + bl sub_8017FD8 + movs r3, 0x2 + ldrsh r0, [r7, r3] + ldr r1, [r6] + bl sub_8017CF8 + adds r4, r0, 0 + adds r0, r6, 0 + adds r0, 0x4C + ldrh r1, [r0] + movs r0, 0x3F + ands r0, r1 + bl sub_8017984 + adds r5, r0, 0 + adds r0, r6, 0 + adds r0, 0x16 + ldr r3, =gUnknown_082EE82C + lsls r1, r5, 2 + lsls r2, r4, 4 + adds r1, r2 + adds r1, r3 + ldr r1, [r1] + bl PrintOnTextbox + lsls r0, 24 + cmp r0, 0 + bne _08015D8C + bl _08016878 +_08015D8C: + movs r0, 0 + strh r0, [r7, 0x6] + movs r0, 0x1D + bl _08016876 + .pool +_08015D9C: + bl sub_800AC34 + movs r0, 0x24 + bl _08016876 +_08015DA6: + adds r0, r6, 0 + adds r0, 0x4C + movs r1, 0x44 + strh r1, [r0] + ldr r2, =gUnknown_02022C40 + ldrh r1, [r2, 0xE] + adds r3, r6, 0 + adds r3, 0x4E + strh r1, [r3] + ldrh r2, [r2, 0x10] + adds r1, r6, 0 + adds r1, 0x50 + strh r2, [r1] + bl sub_800FE50 + movs r0, 0x1D + bl _08016876 + .pool +_08015DD0: + ldr r0, =gReceivedRemoteLinkPlayers + ldrb r0, [r0] + cmp r0, 0 + bne _08015DF4 + ldr r0, =gStringVar4 + ldr r1, =gUnknown_082EEB88 + bl StringCopy + movs r0, 0x1C + bl _08016876 + .pool +_08015DF4: + adds r0, r6, 0 + bl sub_8017FD8 + adds r0, r6, 0 + adds r0, 0x98 + ldrh r0, [r0] + cmp r0, 0x51 + bne _08015E2A + ldr r0, =gUnknown_02022C2C + ldrb r0, [r0] + cmp r0, 0x8 + bne _08015E24 + ldr r0, =gStringVar4 + adds r1, r6, 0 + movs r2, 0 + bl sub_8018220 + movs r0, 0x28 + bl _08016876 + .pool +_08015E24: + movs r0, 0xD + bl _08016876 +_08015E2A: + cmp r0, 0x52 + beq _08015E32 + bl _08016878 +_08015E32: + movs r5, 0 + movs r0, 0x20 + strb r0, [r6, 0x14] + ldr r0, =gStringVar4 + ldr r4, =gUnknown_02022C2C + ldrb r2, [r4] + movs r1, 0x40 + orrs r1, r2 + ldr r2, =gLinkPlayers + ldrb r2, [r2, 0x13] + bl sub_8017D9C + strb r5, [r4] + bl _08016878 + .pool +_08015E5C: + movs r0, 0x2 + ldrsh r1, [r7, r0] + lsls r1, 5 + ldr r0, [r6] + adds r0, r1 + bl sub_80179AC + adds r5, r0, 0 + movs r1, 0x2 + ldrsh r0, [r7, r1] + ldr r1, [r6] + bl sub_8017CF8 + adds r4, r0, 0 + ldr r2, =gUnknown_082EE24C + lsls r0, r4, 2 + lsls r1, r5, 3 + adds r0, r1 + adds r0, r2 + ldr r1, [r0] + movs r0, 0x6 + bl sub_8015664 + bl _08016878 + .pool +_08015E94: + adds r0, r6, 0 + adds r0, 0x16 + ldr r1, =gStringVar4 + bl PrintOnTextbox + lsls r0, 24 + cmp r0, 0 + bne _08015EA8 + bl _08016878 +_08015EA8: + movs r4, 0 + movs r0, 0x29 + strb r0, [r6, 0x14] + bl sub_800ADF8 + adds r0, r6, 0 + adds r0, 0x98 + strh r4, [r0] + adds r0, 0x2 + strh r4, [r0] + bl _08016878 + .pool +_08015EC4: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _08015ED2 + bl _08016878 +_08015ED2: + bl GetMultiplayerId + lsls r0, 24 + cmp r0, 0 + bne _08015F2C + ldr r5, =gStringVar1 + bl GetMultiplayerId + movs r1, 0x1 + eors r0, r1 + lsls r0, 24 + lsrs r0, 24 + lsls r1, r0, 3 + subs r1, r0 + lsls r1, 2 + ldr r4, =gLinkPlayers + 8 + adds r1, r4 + adds r0, r5, 0 + bl StringCopy + ldrh r0, [r4, 0x18] + adds r4, 0x1C + adds r1, r4, 0 + bl sub_800E540 + adds r5, r0, 0 + ldr r0, =gStringVar4 + ldr r2, =gUnknown_082EE378 + lsls r1, r5, 2 + adds r1, r2 + ldr r1, [r1] + bl StringExpandPlaceholders + movs r0, 0x21 + bl _08016876 + .pool +_08015F2C: + movs r0, 0x7 + bl _08016876 +_08015F32: + adds r0, r6, 0 + adds r0, 0x16 + movs r1, 0 + bl sub_80170B8 + lsls r0, 24 + asrs r5, r0, 24 + cmp r5, 0 + beq _08015F5C + cmp r5, 0 + bgt _08015F54 + movs r0, 0x1 + negs r0, r0 + cmp r5, r0 + beq _08015F98 + bl _08016878 +_08015F54: + cmp r5, 0x1 + beq _08015F98 + bl _08016878 +_08015F5C: + movs r0, 0 + bl CopyBgTilemapBufferToVram + ldr r4, =gUnknown_02022C2C + movs r0, 0x45 + strb r0, [r4] + movs r0, 0x45 + movs r1, 0 + movs r2, 0x1 + bl sub_8011090 + movs r2, 0x2 + ldrsh r0, [r7, r2] + lsls r0, 5 + ldr r1, [r6] + adds r1, r0 + adds r0, r1, 0 + adds r0, 0x10 + ldrb r2, [r4] + bl sub_8012188 + ldrh r0, [r7, 0x2] + strh r0, [r6, 0x12] + movs r0, 0x14 + strb r0, [r6, 0x14] + strh r5, [r7, 0x6] + bl _08016878 + .pool +_08015F98: + movs r3, 0x2 + ldrsh r0, [r7, r3] + ldr r1, [r6] + bl sub_8017CF8 + adds r4, r0, 0 + ldr r1, =gUnknown_082EEC9C + lsls r0, r4, 2 + adds r0, r1 + ldr r0, [r0] + bl sub_801568C + bl _08016878 + .pool +_08015FB8: + ldrh r0, [r7, 0x4] + adds r0, 0x1 + strh r0, [r7, 0x4] + lsls r0, 16 + asrs r0, 16 + cmp r0, 0x3C + bgt _08015FCA + bl _08016878 +_08015FCA: + movs r1, 0 + movs r0, 0x15 + strb r0, [r6, 0x14] + strh r1, [r7, 0x4] + bl _08016878 +_08015FD6: + bl sub_8011A74 + lsls r0, 24 + lsrs r4, r0, 24 + cmp r4, 0x3 + beq _0801603C + cmp r4, 0x3 + ble _08015FF4 + cmp r4, 0x4 + bne _08016040 + movs r0, 0x1 + bl sub_801818C + strb r4, [r6, 0x14] + b _08016040 +_08015FF4: + cmp r4, 0x1 + blt _08016040 + movs r1, 0x2 + ldrsh r0, [r7, r1] + ldr r1, [r6] + bl sub_8017CF8 + adds r4, r0, 0 + movs r0, 0x54 + movs r1, 0 + movs r2, 0x1 + bl sub_8011090 + bl sub_8011B90 + cmp r0, 0x1 + bne _08016028 + ldr r0, =gUnknown_082EED3C + lsls r1, r4, 2 + adds r1, r0 + ldr r0, [r1] + bl sub_801568C + b _08016040 + .pool +_08016028: + ldr r0, =gUnknown_082EED3C + lsls r1, r4, 2 + adds r1, r0 + ldr r1, [r1] + movs r0, 0x1E + bl sub_8015664 + b _08016040 + .pool +_0801603C: + movs r0, 0x16 + strb r0, [r6, 0x14] +_08016040: + ldrh r0, [r7, 0x6] + adds r0, 0x1 + strh r0, [r7, 0x6] + bl _08016878 +_0801604A: + bl sub_8011A80 + cmp r0, 0 + beq _08016092 + movs r2, 0x2 + ldrsh r0, [r7, r2] + ldr r1, [r6] + bl sub_8017CF8 + adds r4, r0, 0 + movs r0, 0x54 + movs r1, 0 + movs r2, 0x1 + bl sub_8011090 + bl sub_8011B90 + cmp r0, 0x1 + bne _08016084 + ldr r0, =gUnknown_082EED3C + lsls r1, r4, 2 + adds r1, r0 + ldr r0, [r1] + bl sub_801568C + b _08016092 + .pool +_08016084: + ldr r0, =gUnknown_082EED3C + lsls r1, r4, 2 + adds r1, r0 + ldr r1, [r1] + movs r0, 0x1E + bl sub_8015664 +_08016092: + ldr r0, =gReceivedRemoteLinkPlayers + ldrb r0, [r0] + cmp r0, 0 + bne _0801609E + bl _08016878 +_0801609E: + movs r0, 0x10 + bl _08016876 + .pool +_080160AC: + movs r0, 0x49 + bl PlaySE + bl sub_800EF7C + movs r0, 0 + movs r1, 0xC + strb r1, [r6, 0x14] + adds r1, r6, 0 + adds r1, 0x9A + strh r0, [r1] + bl _08016878 +_080160C6: + bl sub_8011A80 + cmp r0, 0 + beq _080160DA + movs r0, 0 + bl sub_801818C + movs r0, 0x2 + bl _08016876 +_080160DA: + ldr r0, =gReceivedRemoteLinkPlayers + ldrb r0, [r0] + cmp r0, 0 + bne _080160E4 + b _08016878 +_080160E4: + ldr r0, =gBlockSendBuffer + movs r1, 0x1 + bl sub_80143E4 + ldr r0, =sub_80140E0 + movs r1, 0x5 + bl CreateTask + movs r0, 0x27 + b _08016876 + .pool +_08016104: + adds r0, r6, 0 + bl sub_801689C + ldr r0, =sub_80140E0 + bl FuncIsActiveTask + lsls r0, 24 + cmp r0, 0 + beq _08016118 + b _08016878 +_08016118: + movs r0, 0x21 + strb r0, [r6, 0x14] + ldr r0, =gStringVar1 + ldr r4, =gLinkPlayers + 0x1C + 0x08 @ &gLinkPlayers[1].name + adds r1, r4, 0 + bl StringCopy + adds r0, r4, 0 + subs r0, 0x24 + ldrh r0, [r0, 0x20] + adds r1, r4, 0 + bl sub_800E540 + adds r5, r0, 0 + ldr r0, =gStringVar4 + ldr r2, =gUnknown_082EE324 + lsls r1, r5, 2 + adds r1, r2 + ldr r1, [r1] + bl StringExpandPlaceholders + b _08016878 + .pool +_08016158: + adds r0, r6, 0 + bl sub_801689C + adds r0, r6, 0 + adds r0, 0x16 + ldr r1, =gStringVar4 + bl PrintOnTextbox + lsls r0, 24 + cmp r0, 0 + bne _08016170 + b _08016878 +_08016170: + movs r0, 0x22 + b _08016876 + .pool +_08016178: + adds r0, r6, 0 + bl sub_801689C + adds r0, r6, 0 + bl sub_80168DC + cmp r0, 0 + bne _0801618A + b _08016878 +_0801618A: + ldr r0, =gMain + ldrh r1, [r0, 0x2E] + movs r0, 0x2 + ands r0, r1 + cmp r0, 0 + bne _08016198 + b _08016878 +_08016198: + movs r0, 0x1 + bl sub_8011DE0 + ldr r0, =gStringVar4 + ldr r1, =gUnknown_082EE598 + bl StringCopy + movs r0, 0x24 + b _08016876 + .pool +_080161B8: + ldr r1, =gStringVar4 + movs r0, 0x9 + bl sub_8015664 + b _08016878 + .pool +_080161C8: + adds r0, r6, 0 + adds r0, 0x16 + movs r1, 0 + bl sub_80170B8 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _080161EE + cmp r1, 0 + bgt _080161E8 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080162AE + b _08016878 +_080161E8: + cmp r1, 0x1 + beq _080162AE + b _08016878 +_080161EE: + adds r0, r6, 0 + adds r0, 0x4C + movs r1, 0x51 + strh r1, [r0] + ldr r1, =gUnknown_02022C2C + ldrb r1, [r1] + adds r5, r0, 0 + cmp r1, 0x45 + bne _08016220 + movs r4, 0x40 + orrs r4, r1 + movs r0, 0x1 + bl sub_801100C + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + movs r2, 0 + bl sub_8011090 + b _0801623E + .pool +_08016220: + movs r0, 0x40 + adds r4, r1, 0 + orrs r4, r0 + lsls r4, 24 + lsrs r4, 24 + movs r0, 0x1 + bl sub_801100C + adds r1, r0, 0 + lsls r1, 24 + lsrs r1, 24 + adds r0, r4, 0 + movs r2, 0x1 + bl sub_8011090 +_0801623E: + ldr r1, [r6, 0x8] + movs r0, 0 + strb r0, [r1, 0x1B] + strh r0, [r7, 0x6] + ldr r0, =gUnknown_02022C2C + ldrb r0, [r0] + cmp r0, 0x41 + bne _08016286 + bl sub_8018024 + cmp r0, 0 + bne _0801627C + movs r0, 0x52 + strh r0, [r5] + adds r0, r5, 0 + bl sub_800FE50 + movs r0, 0xA + strb r0, [r6, 0x14] + ldr r0, =gStringVar4 + ldr r1, =gUnknown_082EEC14 + bl StringCopy + b _08016878 + .pool +_0801627C: + adds r0, r5, 0 + bl sub_800FE50 + movs r0, 0xD + b _08016876 +_08016286: + cmp r0, 0x48 + bne _080162A4 + adds r0, r5, 0 + bl sub_800FE50 + ldr r0, =gStringVar4 + adds r1, r6, 0 + movs r2, 0x1 + bl sub_8018220 + movs r0, 0x28 + b _08016876 + .pool +_080162A4: + adds r0, r5, 0 + bl sub_800FE50 + movs r0, 0xD + b _08016876 +_080162AE: + adds r0, r6, 0 + adds r0, 0x4C + movs r1, 0x52 + strh r1, [r0] + bl sub_800FE50 + movs r0, 0xA + strb r0, [r6, 0x14] + ldr r0, =gStringVar4 + ldr r1, =gUnknown_02022C2C + ldrb r1, [r1] + bl sub_8013078 + b _08016878 + .pool +_080162D4: + bl sub_800AC34 + movs r0, 0x24 + b _08016876 +_080162DC: + ldr r0, =gReceivedRemoteLinkPlayers + ldrb r4, [r0] + cmp r4, 0 + beq _080162E6 + b _08016878 +_080162E6: + ldr r1, =gUnknown_02022C2C + movs r0, 0x40 + strb r0, [r1] + ldr r1, =gStringVar4 + movs r0, 0x25 + bl sub_8015664 + adds r0, r6, 0 + adds r0, 0x4C + movs r1, 0 + movs r2, 0xC + bl memset + adds r0, r6, 0 + adds r0, 0x9A + strh r4, [r0] + subs r0, 0x2 + strh r4, [r0] + b _08016878 + .pool +_08016318: + movs r0, 0x2 + strb r0, [r6, 0x14] + movs r0, 0 + bl sub_801818C + b _08016878 +_08016324: + ldr r4, =gStringVar4 + ldr r0, =gUnknown_02022C2C + ldrb r0, [r0] + movs r1, 0x40 + orrs r1, r0 + adds r0, r4, 0 + bl sub_8017E00 + movs r0, 0xE + adds r1, r4, 0 + bl sub_8015664 + b _08016878 + .pool +_08016348: + bl sub_800ADF8 + movs r0, 0xF + b _08016876 +_08016350: + bl sub_800A520 + lsls r0, 24 + cmp r0, 0 + bne _0801635C + b _08016878 +_0801635C: + movs r0, 0x10 + b _08016876 +_08016360: + ldr r0, [r6, 0x8] + bl Free + ldr r0, [r6] + bl Free + ldr r0, [r6, 0xC] + bl Free + ldr r0, [r6, 0x4] + bl Free + adds r0, r6, 0 + adds r0, 0x20 + ldrb r0, [r0] + bl DestroyTask + adds r0, r6, 0 + adds r0, 0x21 + bl sub_8019F04 + movs r0, 0x11 + b _08016876 +_0801638E: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + movs r0, 0x12 + b _08016876 +_080163A2: + bl UpdatePaletteFade + lsls r0, 24 + cmp r0, 0 + beq _080163AE + b _08016878 +_080163AE: + bl sub_8019E3C + adds r0, r4, 0 + bl DestroyTask + ldr r0, =gUnknown_02022C30 + ldr r0, [r0] + bl Free + bl sub_80149D8 + b _08016878 + .pool +_080163CC: + bl sub_800F7DC + ldrh r1, [r0, 0x8] + ldr r4, =0x000003ff + adds r0, r4, 0 + ands r0, r1 + cmp r0, 0 + bne _080163E4 + movs r0, 0x2B + b _08016876 + .pool +_080163E4: + bl sub_800F7DC + ldrh r1, [r0, 0x8] + adds r0, r4, 0 + ands r0, r1 + movs r1, 0xCE + lsls r1, 1 + cmp r0, r1 + bne _08016408 + ldr r0, =gStringVar4 + ldr r1, =gUnknown_082EF590 + bl StringCopy + b _0801643E + .pool +_08016408: + ldr r4, =gStringVar1 + bl sub_800F7DC + ldrh r0, [r0, 0x8] + lsls r0, 22 + lsrs r0, 22 + movs r1, 0xB + muls r1, r0 + ldr r0, =gSpeciesNames + adds r1, r0 + adds r0, r4, 0 + bl StringCopy + ldr r4, =gStringVar2 + bl sub_800F7DC + ldrb r1, [r0, 0xB] + lsrs r1, 1 + adds r0, r4, 0 + movs r2, 0 + movs r3, 0x3 + bl ConvertIntToDecimalStringN + ldr r0, =gStringVar4 + ldr r1, =gUnknown_082EF564 + bl StringExpandPlaceholders +_0801643E: + ldr r1, =gStringVar4 + movs r0, 0x2C + bl sub_8015664 + b _08016878 + .pool +_0801645C: + adds r0, r6, 0 + adds r0, 0x16 + ldr r1, =gUnknown_082EF20C + bl PrintOnTextbox + lsls r0, 24 + cmp r0, 0 + bne _0801646E + b _08016878 +_0801646E: + movs r0, 0x2F + b _08016876 + .pool +_08016478: + adds r0, r6, 0 + adds r0, 0x16 + adds r1, r6, 0 + adds r1, 0x1D + adds r2, r6, 0 + adds r2, 0x1E + ldr r3, =gUnknown_082F025C + ldr r4, =gUnknown_082F027C + str r4, [sp] + bl sub_8017178 + adds r5, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r5, r0 + bne _0801649A + b _08016878 +_0801649A: + subs r0, 0x1 + cmp r5, r0 + beq _080164A4 + cmp r5, 0x3 + bne _080164B8 +_080164A4: + movs r0, 0x4 + strb r0, [r6, 0x14] + movs r0, 0x1 + bl sub_801818C + b _08016878 + .pool +_080164B8: + cmp r5, 0x1 + beq _080164C2 + cmp r5, 0x2 + beq _080164D0 + b _08016878 +_080164C2: + ldr r1, =gUnknown_082EF4C4 + movs r0, 0x35 + bl sub_8015664 + b _08016878 + .pool +_080164D0: + ldr r1, =gUnknown_082EF298 + movs r0, 0x2F + bl sub_8015664 + b _08016878 + .pool +_080164E0: + movs r0, 0x1 + negs r0, r0 + movs r1, 0 + str r1, [sp] + movs r2, 0 + movs r3, 0x10 + bl BeginNormalPaletteFade + movs r0, 0x36 + b _08016876 +_080164F4: + ldr r0, =gPaletteFade + ldrb r1, [r0, 0x7] + movs r0, 0x80 + ands r0, r1 + cmp r0, 0 + beq _08016502 + b _08016878 +_08016502: + ldr r1, =gUnknown_02022C40 + movs r0, 0x1 + strh r0, [r1] + ldr r1, =gFieldCallback + ldr r0, =sub_80AF128 + str r0, [r1] + ldr r1, =CB2_ReturnToField + movs r0, 0x8 + bl sub_81B8904 + b _08016878 + .pool +_0801652C: + adds r0, r6, 0 + adds r0, 0x16 + adds r1, r6, 0 + adds r1, 0x1D + adds r2, r6, 0 + adds r2, 0x1E + ldr r3, =gUnknown_082F0294 + ldr r4, =gUnknown_082F032C + str r4, [sp] + bl sub_8017178 + adds r5, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r5, r0 + bne _0801654E + b _08016878 +_0801654E: + subs r0, 0x1 + cmp r5, r0 + beq _08016558 + cmp r5, 0x12 + bne _08016580 +_08016558: + ldr r0, =gUnknown_02022C40 + bl sub_801807C + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl sub_8010FCC + ldr r0, =gUnknown_082EF4FC + bl sub_801568C + b _08016878 + .pool +_08016580: + ldr r0, =gUnknown_02022C40 + strh r5, [r0, 0x2] + movs r0, 0x37 + b _08016876 + .pool +_0801658C: + ldr r2, =gUnknown_02022C40 + ldrh r0, [r2, 0x2] + ldrh r1, [r2, 0xA] + ldrh r2, [r2, 0xC] + bl sub_8010FCC + ldr r0, =gUnknown_082EF520 + bl sub_801568C + b _08016878 + .pool +_080165A8: + adds r0, r6, 0 + adds r0, 0x16 + movs r1, 0 + bl sub_80170B8 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _080165CE + cmp r1, 0 + bgt _080165C8 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _080165D2 + b _08016878 +_080165C8: + cmp r1, 0x1 + beq _080165D2 + b _08016878 +_080165CE: + movs r0, 0x38 + b _08016876 +_080165D2: + movs r0, 0x1 + bl sub_801818C + movs r0, 0x4 + b _08016876 +_080165DC: + adds r0, r6, 0 + adds r0, 0x16 + ldr r1, =gUnknown_082EF5B8 + bl PrintOnTextbox + lsls r0, 24 + cmp r0, 0 + bne _080165EE + b _08016878 +_080165EE: + movs r0, 0 + movs r1, 0 + movs r2, 0 + bl sub_8010FCC + ldr r0, =gUnknown_02022C40 + bl sub_801807C + movs r0, 0x1 + bl sub_801818C + movs r0, 0x4 + b _08016876 + .pool +_08016610: + adds r0, r6, 0 + adds r0, 0x16 + ldr r1, =gUnknown_082EF1EC + bl PrintOnTextbox + lsls r0, 24 + cmp r0, 0 + bne _08016622 + b _08016878 +_08016622: + movs r0, 0x2E + b _08016876 + .pool +_0801662C: + bl sub_80173B0 + movs r0, 0x30 + b _08016876 +_08016634: + adds r0, r6, 0 + adds r0, 0x16 + adds r1, r6, 0 + adds r1, 0x1D + adds r2, r6, 0 + adds r2, 0x4A + adds r3, r6, 0 + adds r3, 0x1E + ldr r4, =gUnknown_082F034C + str r4, [sp] + ldr r4, =gUnknown_082F03A4 + str r4, [sp, 0x4] + ldr r4, [r6] + str r4, [sp, 0x8] + bl sub_80172A0 + adds r5, r0, 0 + movs r0, 0x1 + negs r0, r0 + cmp r5, r0 + bne _08016660 + b _08016878 +_08016660: + subs r0, 0x1 + cmp r5, r0 + beq _0801666A + cmp r5, 0x8 + bne _0801667C +_0801666A: + movs r0, 0x1 + bl sub_801818C + movs r0, 0x4 + b _08016876 + .pool +_0801667C: + bl sub_80173B0 + ldr r1, [r6] + lsls r4, r5, 5 + adds r1, r4 + ldrb r0, [r1, 0x9] + lsrs r0, 2 + ldrh r1, [r1, 0x8] + lsls r1, 22 + lsrs r1, 22 + bl sub_8017D04 + cmp r0, 0x1 + beq _080166C8 + cmp r0, 0x1 + bgt _080166A2 + cmp r0, 0 + beq _080166A8 + b _08016878 +_080166A2: + cmp r0, 0x2 + beq _080166FC + b _08016878 +_080166A8: + ldr r0, =gStringVar1 + ldr r1, [r6] + adds r1, r4 + bl sub_8018404 + ldr r1, =gUnknown_082EF65C + movs r0, 0x31 + bl sub_8015664 + strh r5, [r7, 0x2] + b _08016878 + .pool +_080166C8: + ldr r0, =gStringVar1 + ldr r1, [r6] + adds r1, r4 + bl sub_8018404 + ldr r0, =gStringVar2 + ldr r1, [r6] + adds r1, r4 + ldrb r2, [r1, 0x9] + lsrs r2, 2 + lsls r1, r2, 3 + subs r1, r2 + ldr r2, =gTypeNames + adds r1, r2 + bl StringCopy + ldr r1, =gUnknown_082EF6E4 + b _0801671E + .pool +_080166FC: + ldr r0, =gStringVar1 + ldr r1, [r6] + adds r1, r4 + bl sub_8018404 + ldr r0, =gStringVar2 + ldr r1, [r6] + adds r1, r4 + ldrb r2, [r1, 0x9] + lsrs r2, 2 + lsls r1, r2, 3 + subs r1, r2 + ldr r2, =gTypeNames + adds r1, r2 + bl StringCopy + ldr r1, =gUnknown_082EF718 +_0801671E: + movs r0, 0x2E + bl sub_8015664 + b _08016878 + .pool +_08016738: + adds r0, r6, 0 + adds r0, 0x16 + movs r1, 0 + bl sub_80170B8 + lsls r0, 24 + asrs r1, r0, 24 + cmp r1, 0 + beq _0801675E + cmp r1, 0 + bgt _08016758 + movs r0, 0x1 + negs r0, r0 + cmp r1, r0 + beq _08016762 + b _08016878 +_08016758: + cmp r1, 0x1 + beq _08016762 + b _08016878 +_0801675E: + movs r0, 0x32 + b _08016876 +_08016762: + movs r0, 0x1 + bl sub_801818C + movs r0, 0x4 + b _08016876 +_0801676C: + adds r0, r6, 0 + adds r0, 0x16 + ldr r1, =gUnknown_082EF4C4 + bl PrintOnTextbox + lsls r0, 24 + cmp r0, 0 + bne _0801677E + b _08016878 +_0801677E: + ldr r4, =gUnknown_02022C40 + movs r0, 0x2 + strh r0, [r4] + ldr r2, =gUnknown_02022C38 + movs r3, 0x2 + ldrsh r0, [r7, r3] + ldr r1, [r6] + lsls r0, 5 + adds r0, r1 + ldr r0, [r0] + str r0, [r2] + ldr r2, =gUnknown_02022C3E + ldr r1, [r6] + movs r3, 0x2 + ldrsh r0, [r7, r3] + lsls r0, 5 + adds r1, r0 + ldrb r0, [r1, 0x9] + lsrs r0, 2 + strb r0, [r2] + ldr r2, =gUnknown_02022C3C + ldr r1, [r6] + movs r3, 0x2 + ldrsh r0, [r7, r3] + lsls r0, 5 + adds r1, r0 + ldrh r0, [r1, 0x8] + lsls r0, 22 + lsrs r0, 22 + strh r0, [r2] + ldr r1, =gFieldCallback + ldr r0, =sub_80AF128 + str r0, [r1] + ldr r1, =CB2_ReturnToField + movs r0, 0x9 + bl sub_81B8904 + adds r0, r6, 0 + bl sub_80156B0 + ldrh r0, [r7, 0x2] + strb r0, [r4, 0x8] + b _08016878 + .pool +_080167F4: + ldr r1, =gUnknown_02022C2C + movs r0, 0x44 + strb r0, [r1] + movs r1, 0x2 + ldrsh r0, [r7, r1] + lsls r0, 5 + ldr r1, [r6] + adds r1, r0 + adds r0, r1, 0 + adds r0, 0x10 + movs r2, 0x44 + bl sub_8012188 + ldr r0, =gStringVar1 + movs r3, 0x2 + ldrsh r2, [r7, r3] + lsls r2, 5 + ldr r1, [r6] + adds r1, r2 + bl sub_8018404 + ldr r0, =gUnknown_082EE17C + ldr r0, [r0, 0x8] + bl sub_8017020 + movs r0, 0x19 + b _08016876 + .pool +_08016838: + adds r0, r6, 0 + adds r0, 0x16 + ldr r1, =gStringVar4 + bl PrintOnTextbox + lsls r0, 24 + cmp r0, 0 + beq _08016878 + movs r0, 0x1 + bl sub_801818C + movs r1, 0 + ldrsh r0, [r7, r1] + movs r2, 0x2 + ldrsh r1, [r7, r2] + ldr r2, [r6] + bl sub_801A3D0 + movs r0, 0x4 + b _08016876 + .pool +_08016864: + adds r0, r6, 0 + adds r0, 0x16 + ldr r1, =gStringVar4 + bl PrintOnTextbox + lsls r0, 24 + cmp r0, 0 + beq _08016878 + ldrb r0, [r6, 0x15] +_08016876: + strb r0, [r6, 0x14] +_08016878: + add sp, 0xC + pop {r4-r7} + pop {r0} + bx r0 + .pool + thumb_func_end sub_80156E0 + thumb_func_start var_800D_set_xB +var_800D_set_xB: @ 8016884 + push {lr} + bl InUnionRoom + cmp r0, 0x1 + bne _08016894 + ldr r1, =gSpecialVar_Result + movs r0, 0xB + strh r0, [r1] +_08016894: + pop {r0} + bx r0 + .pool +thumb_func_end var_800D_set_xB thumb_func_start sub_801689C sub_801689C: @ 801689C diff --git a/data/maps/events/LilycoveCity_ContestLobby.inc b/data/maps/events/LilycoveCity_ContestLobby.inc index 6fc324f760..a654fe5f70 100644 --- a/data/maps/events/LilycoveCity_ContestLobby.inc +++ b/data/maps/events/LilycoveCity_ContestLobby.inc @@ -32,7 +32,7 @@ LilycoveCity_ContestLobby_MapWarps: @ 853178C warp_def 21, 1, 0, 1, LILYCOVE_CITY_CONTEST_HALL LilycoveCity_ContestLobby_MapBGEvents: @ 85317AC - bg_event 23, 5, 0, 0, 0, LilycoveCity_ContestLobby_EventScript_294055 + bg_event 23, 5, 0, 0, 0, EventScript_PblockLink bg_event 23, 9, 0, 0, 0, LilycoveCity_ContestLobby_EventScript_293E1E bg_event 23, 1, 0, 0, 0, LilycoveCity_ContestLobby_EventScript_21A753 bg_event 25, 1, 0, 0, 0, LilycoveCity_ContestLobby_EventScript_21A75A @@ -41,7 +41,7 @@ LilycoveCity_ContestLobby_MapBGEvents: @ 85317AC bg_event 3, 1, 0, 0, 0, LilycoveCity_ContestLobby_EventScript_21A73E bg_event 5, 1, 0, 0, 0, LilycoveCity_ContestLobby_EventScript_21A745 bg_event 7, 1, 0, 0, 0, LilycoveCity_ContestLobby_EventScript_21A74C - bg_event 27, 5, 0, 0, 0, LilycoveCity_ContestLobby_EventScript_293C3E + bg_event 27, 5, 0, 0, 0, EventScript_Pblock1_Ask bg_event 27, 9, 0, 0, 0, LilycoveCity_ContestLobby_EventScript_293D4D bg_event 18, 3, 0, 0, 0, LilycoveCity_ContestLobby_EventScript_21A784 diff --git a/data/scripts/pokeblocks.inc b/data/scripts/pokeblocks.inc index 81a83c857e..f694db3309 100644 --- a/data/scripts/pokeblocks.inc +++ b/data/scripts/pokeblocks.inc @@ -245,7 +245,7 @@ LilycoveCity_ContestLobby_Text_293BB4: @ 8293BB4 .string "But, I don’t have any to spare today.\n" .string "Sorry about that.$" -EventScript_Pblock1_Ask: @ 8293C3E +EventScript_Pblock1_Ask:: @ 8293C3E lockall checkflag FLAG_0x340 goto_if 0, LilycoveCity_ContestLobby_EventScript_293EFB @@ -332,7 +332,7 @@ EventScript_Pblock1_NoPokeblock: @ 8293D43 releaseall end -LilycoveCity_ContestLobby_EventScript_293D4D: @ 8293D4D +LilycoveCity_ContestLobby_EventScript_293D4D:: @ 8293D4D lockall setvar VAR_0x8009, 2 applymovement 10, LilycoveCity_ContestLobby_Movement_2725A2 @@ -396,7 +396,7 @@ LilycoveCity_ContestLobby_EventScript_293E14: @ 8293E14 releaseall end -LilycoveCity_ContestLobby_EventScript_293E1E: @ 8293E1E +LilycoveCity_ContestLobby_EventScript_293E1E:: @ 8293E1E lockall setvar VAR_0x8008, 15 setvar VAR_0x8009, 3 @@ -513,19 +513,19 @@ LilycoveCity_ContestLobby_EventScript_293F98: @ 8293F98 releaseall end -LilycoveCity_ContestLobby_EventScript_293FA2: @ 8293FA2 +LilycoveCity_ContestLobby_EventScript_293FA2:: @ 8293FA2 msgbox LilycoveCity_ContestLobby_Text_2937F9, 2 end -LilycoveCity_ContestLobby_EventScript_293FAB: @ 8293FAB +LilycoveCity_ContestLobby_EventScript_293FAB:: @ 8293FAB msgbox LilycoveCity_ContestLobby_Text_293842, 2 end -LilycoveCity_ContestLobby_EventScript_293FB4: @ 8293FB4 +LilycoveCity_ContestLobby_EventScript_293FB4:: @ 8293FB4 msgbox LilycoveCity_ContestLobby_Text_29388F, 2 end -LilycoveCity_ContestLobby_EventScript_293FBD: @ 8293FBD +LilycoveCity_ContestLobby_EventScript_293FBD:: @ 8293FBD setvar VAR_0x8008, 15 goto LilycoveCity_ContestLobby_EventScript_293FC8 end @@ -576,7 +576,7 @@ LilycoveCity_ContestLobby_Movement_294053: @ 8294053 step_28 step_end -EventScript_PblockLink: @ 8294055 +EventScript_PblockLink:: @ 8294055 lockall specialvar VAR_RESULT, PlayerHasBerries compare VAR_RESULT, 0 diff --git a/include/librfu.h b/include/librfu.h index dc3d336da5..9d131f0278 100644 --- a/include/librfu.h +++ b/include/librfu.h @@ -81,7 +81,7 @@ struct UnkLinkRfuStruct_02022B14Substruct u8 playerTrainerId[2]; }; -struct UnkLinkRfuStruct_02022B14 +struct __attribute__((packed)) UnkLinkRfuStruct_02022B14 { struct UnkLinkRfuStruct_02022B14Substruct unk_00; u8 unk_04[4]; diff --git a/src/battle_bg.c b/src/battle_bg.c index d4bfd297aa..6520438a09 100644 --- a/src/battle_bg.c +++ b/src/battle_bg.c @@ -278,7 +278,7 @@ static void sub_8035C4C(void) { if (gBattleOutcome == B_OUTCOME_WON) { - switch (gLinkPlayers[gBattleScripting.multiplayerId].lp_field_18) + switch (gLinkPlayers[gBattleScripting.multiplayerId].id) { case 0: BattleHandleAddTextPrinter(gText_Win, 0x16); @@ -300,7 +300,7 @@ static void sub_8035C4C(void) } else { - switch (gLinkPlayers[gBattleScripting.multiplayerId].lp_field_18) + switch (gLinkPlayers[gBattleScripting.multiplayerId].id) { case 0: BattleHandleAddTextPrinter(gText_Win, 0x17); @@ -323,7 +323,7 @@ static void sub_8035C4C(void) } else if (gBattleOutcome == B_OUTCOME_WON) { - if (gLinkPlayers[gBattleScripting.multiplayerId].lp_field_18 != 0) + if (gLinkPlayers[gBattleScripting.multiplayerId].id != 0) { BattleHandleAddTextPrinter(gText_Win, 0x17); BattleHandleAddTextPrinter(gText_Loss, 0x16); @@ -336,7 +336,7 @@ static void sub_8035C4C(void) } else { - if (gLinkPlayers[gBattleScripting.multiplayerId].lp_field_18 != 0) + if (gLinkPlayers[gBattleScripting.multiplayerId].id != 0) { BattleHandleAddTextPrinter(gText_Win, 0x16); BattleHandleAddTextPrinter(gText_Loss, 0x17); @@ -365,23 +365,23 @@ void sub_8035D74(u8 taskId) name = gLinkPlayers[i].name; linkPlayer = &gLinkPlayers[i]; - switch (linkPlayer->lp_field_18) + switch (linkPlayer->id) { case 0: BattleHandleAddTextPrinter(name, 0x11); - sub_8035AE4(taskId, linkPlayer->lp_field_18, 1, 2, 4); + sub_8035AE4(taskId, linkPlayer->id, 1, 2, 4); break; case 1: BattleHandleAddTextPrinter(name, 0x12); - sub_8035AE4(taskId, linkPlayer->lp_field_18, 2, 2, 4); + sub_8035AE4(taskId, linkPlayer->id, 2, 2, 4); break; case 2: BattleHandleAddTextPrinter(name, 0x13); - sub_8035AE4(taskId, linkPlayer->lp_field_18, 1, 2, 8); + sub_8035AE4(taskId, linkPlayer->id, 1, 2, 8); break; case 3: BattleHandleAddTextPrinter(name, 0x14); - sub_8035AE4(taskId, linkPlayer->lp_field_18, 2, 2, 8); + sub_8035AE4(taskId, linkPlayer->id, 2, 2, 8); break; } } @@ -392,7 +392,7 @@ void sub_8035D74(u8 taskId) u8 opponentId = playerId ^ BIT_SIDE; u8 opponentId_copy = opponentId; - if (gLinkPlayers[playerId].lp_field_18 != 0) + if (gLinkPlayers[playerId].id != 0) opponentId = playerId, playerId = opponentId_copy; name = gLinkPlayers[playerId].name; diff --git a/src/battle_controllers.c b/src/battle_controllers.c index 2b918d0180..9fe4b7a744 100644 --- a/src/battle_controllers.c +++ b/src/battle_controllers.c @@ -264,67 +264,67 @@ static void InitSinglePlayerBtlControllers(void) for (var = gUnknown_0203C7B4, i = 0; i < MAX_BATTLERS_COUNT; i++) { - switch (gLinkPlayers[i].lp_field_18) + switch (gLinkPlayers[i].id) { case 0: case 3: - sub_81B8D64(gLinkPlayers[i].lp_field_18, 0); + sub_81B8D64(gLinkPlayers[i].id, 0); break; case 1: case 2: - sub_81B8D64(gLinkPlayers[i].lp_field_18, 1); + sub_81B8D64(gLinkPlayers[i].id, 1); break; } if (i == var) { - gBattlerControllerFuncs[gLinkPlayers[i].lp_field_18] = SetControllerToRecordedPlayer; - switch (gLinkPlayers[i].lp_field_18) + gBattlerControllerFuncs[gLinkPlayers[i].id] = SetControllerToRecordedPlayer; + switch (gLinkPlayers[i].id) { case 0: case 3: - gBattlerPositions[gLinkPlayers[i].lp_field_18] = B_POSITION_PLAYER_LEFT; - gBattlerPartyIndexes[gLinkPlayers[i].lp_field_18] = 0; + gBattlerPositions[gLinkPlayers[i].id] = B_POSITION_PLAYER_LEFT; + gBattlerPartyIndexes[gLinkPlayers[i].id] = 0; break; case 1: case 2: - gBattlerPositions[gLinkPlayers[i].lp_field_18] = B_POSITION_PLAYER_RIGHT; - gBattlerPartyIndexes[gLinkPlayers[i].lp_field_18] = 3; + gBattlerPositions[gLinkPlayers[i].id] = B_POSITION_PLAYER_RIGHT; + gBattlerPartyIndexes[gLinkPlayers[i].id] = 3; break; } } - else if ((!(gLinkPlayers[i].lp_field_18 & 1) && !(gLinkPlayers[var].lp_field_18 & 1)) - || ((gLinkPlayers[i].lp_field_18 & 1) && (gLinkPlayers[var].lp_field_18 & 1))) + else if ((!(gLinkPlayers[i].id & 1) && !(gLinkPlayers[var].id & 1)) + || ((gLinkPlayers[i].id & 1) && (gLinkPlayers[var].id & 1))) { - gBattlerControllerFuncs[gLinkPlayers[i].lp_field_18] = SetControllerToRecordedPlayer; - switch (gLinkPlayers[i].lp_field_18) + gBattlerControllerFuncs[gLinkPlayers[i].id] = SetControllerToRecordedPlayer; + switch (gLinkPlayers[i].id) { case 0: case 3: - gBattlerPositions[gLinkPlayers[i].lp_field_18] = B_POSITION_PLAYER_LEFT; - gBattlerPartyIndexes[gLinkPlayers[i].lp_field_18] = 0; + gBattlerPositions[gLinkPlayers[i].id] = B_POSITION_PLAYER_LEFT; + gBattlerPartyIndexes[gLinkPlayers[i].id] = 0; break; case 1: case 2: - gBattlerPositions[gLinkPlayers[i].lp_field_18] = B_POSITION_PLAYER_RIGHT; - gBattlerPartyIndexes[gLinkPlayers[i].lp_field_18] = 3; + gBattlerPositions[gLinkPlayers[i].id] = B_POSITION_PLAYER_RIGHT; + gBattlerPartyIndexes[gLinkPlayers[i].id] = 3; break; } } else { - gBattlerControllerFuncs[gLinkPlayers[i].lp_field_18] = SetControllerToRecordedOpponent; - switch (gLinkPlayers[i].lp_field_18) + gBattlerControllerFuncs[gLinkPlayers[i].id] = SetControllerToRecordedOpponent; + switch (gLinkPlayers[i].id) { case 0: case 3: - gBattlerPositions[gLinkPlayers[i].lp_field_18] = B_POSITION_OPPONENT_LEFT; - gBattlerPartyIndexes[gLinkPlayers[i].lp_field_18] = 0; + gBattlerPositions[gLinkPlayers[i].id] = B_POSITION_OPPONENT_LEFT; + gBattlerPartyIndexes[gLinkPlayers[i].id] = 0; break; case 1: case 2: - gBattlerPositions[gLinkPlayers[i].lp_field_18] = B_POSITION_OPPONENT_RIGHT; - gBattlerPartyIndexes[gLinkPlayers[i].lp_field_18] = 3; + gBattlerPositions[gLinkPlayers[i].id] = B_POSITION_OPPONENT_RIGHT; + gBattlerPartyIndexes[gLinkPlayers[i].id] = 3; break; } } @@ -506,69 +506,69 @@ static void InitLinkBtlControllers(void) for (i = 0; i < MAX_BATTLERS_COUNT; i++) { - switch (gLinkPlayers[i].lp_field_18) + switch (gLinkPlayers[i].id) { case 0: case 3: - sub_81B8D64(gLinkPlayers[i].lp_field_18, 0); + sub_81B8D64(gLinkPlayers[i].id, 0); break; case 1: case 2: - sub_81B8D64(gLinkPlayers[i].lp_field_18, 1); + sub_81B8D64(gLinkPlayers[i].id, 1); break; } if (i == multiplayerId) { - gBattlerControllerFuncs[gLinkPlayers[i].lp_field_18] = SetControllerToPlayer; - switch (gLinkPlayers[i].lp_field_18) + gBattlerControllerFuncs[gLinkPlayers[i].id] = SetControllerToPlayer; + switch (gLinkPlayers[i].id) { case 0: case 3: - gBattlerPositions[gLinkPlayers[i].lp_field_18] = 0; - gBattlerPartyIndexes[gLinkPlayers[i].lp_field_18] = 0; + gBattlerPositions[gLinkPlayers[i].id] = 0; + gBattlerPartyIndexes[gLinkPlayers[i].id] = 0; break; case 1: case 2: - gBattlerPositions[gLinkPlayers[i].lp_field_18] = 2; - gBattlerPartyIndexes[gLinkPlayers[i].lp_field_18] = 3; + gBattlerPositions[gLinkPlayers[i].id] = 2; + gBattlerPartyIndexes[gLinkPlayers[i].id] = 3; break; } } else { - if ((!(gLinkPlayers[i].lp_field_18 & 1) && !(gLinkPlayers[multiplayerId].lp_field_18 & 1)) - || ((gLinkPlayers[i].lp_field_18 & 1) && (gLinkPlayers[multiplayerId].lp_field_18 & 1))) + if ((!(gLinkPlayers[i].id & 1) && !(gLinkPlayers[multiplayerId].id & 1)) + || ((gLinkPlayers[i].id & 1) && (gLinkPlayers[multiplayerId].id & 1))) { - gBattlerControllerFuncs[gLinkPlayers[i].lp_field_18] = SetControllerToLinkPartner; - switch (gLinkPlayers[i].lp_field_18) + gBattlerControllerFuncs[gLinkPlayers[i].id] = SetControllerToLinkPartner; + switch (gLinkPlayers[i].id) { case 0: case 3: - gBattlerPositions[gLinkPlayers[i].lp_field_18] = 0; - gBattlerPartyIndexes[gLinkPlayers[i].lp_field_18] = 0; + gBattlerPositions[gLinkPlayers[i].id] = 0; + gBattlerPartyIndexes[gLinkPlayers[i].id] = 0; break; case 1: case 2: - gBattlerPositions[gLinkPlayers[i].lp_field_18] = 2; - gBattlerPartyIndexes[gLinkPlayers[i].lp_field_18] = 3; + gBattlerPositions[gLinkPlayers[i].id] = 2; + gBattlerPartyIndexes[gLinkPlayers[i].id] = 3; break; } } else { - gBattlerControllerFuncs[gLinkPlayers[i].lp_field_18] = SetControllerToLinkOpponent; - switch (gLinkPlayers[i].lp_field_18) + gBattlerControllerFuncs[gLinkPlayers[i].id] = SetControllerToLinkOpponent; + switch (gLinkPlayers[i].id) { case 0: case 3: - gBattlerPositions[gLinkPlayers[i].lp_field_18] = 1; - gBattlerPartyIndexes[gLinkPlayers[i].lp_field_18] = 0; + gBattlerPositions[gLinkPlayers[i].id] = 1; + gBattlerPartyIndexes[gLinkPlayers[i].id] = 0; break; case 1: case 2: - gBattlerPositions[gLinkPlayers[i].lp_field_18] = 3; - gBattlerPartyIndexes[gLinkPlayers[i].lp_field_18] = 3; + gBattlerPositions[gLinkPlayers[i].id] = 3; + gBattlerPartyIndexes[gLinkPlayers[i].id] = 3; break; } } diff --git a/src/battle_main.c b/src/battle_main.c index 8649209c0f..6af44a6dfd 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -821,7 +821,7 @@ static void SetAllPlayersBerryData(void) for (i = 0; i < numPlayers; i++) { src = (struct BattleEnigmaBerry *)(gBlockRecvBuffer[i] + 2); - r4 = gLinkPlayers[i].lp_field_18; + r4 = gLinkPlayers[i].id; for (j = 0; j < BERRY_NAME_COUNT - 1; j++) gEnigmaBerries[r4].name[j] = src->name[j]; @@ -958,8 +958,8 @@ static void CB2_HandleStartBattle(void) if (gTrainerBattleOpponent_A == TRAINER_OPPONENT_C00) { - gLinkPlayers[0].lp_field_18 = 0; - gLinkPlayers[1].lp_field_18 = 1; + gLinkPlayers[0].id = 0; + gLinkPlayers[1].id = 1; } SendBlock(bitmask_all_link_players_but_self(), &gBattleStruct->field_180, 32); @@ -1146,10 +1146,10 @@ static void CB2_HandleStartMultiPartnerBattle(void) { u8 language; - gLinkPlayers[0].lp_field_18 = 0; - gLinkPlayers[1].lp_field_18 = 2; - gLinkPlayers[2].lp_field_18 = 1; - gLinkPlayers[3].lp_field_18 = 3; + gLinkPlayers[0].id = 0; + gLinkPlayers[1].id = 2; + gLinkPlayers[2].id = 1; + gLinkPlayers[3].id = 3; GetFrontierTrainerName(gLinkPlayers[2].name, gTrainerBattleOpponent_A); GetFrontierTrainerName(gLinkPlayers[3].name, gTrainerBattleOpponent_B); sub_8165B88(&language, gTrainerBattleOpponent_A); @@ -1207,7 +1207,7 @@ static void CB2_HandleStartMultiPartnerBattle(void) if ((GetBlockReceivedStatus() & 3) == 3) { ResetBlockReceivedFlags(); - if (gLinkPlayers[playerMultiplayerId].lp_field_18 != 0) + if (gLinkPlayers[playerMultiplayerId].id != 0) { memcpy(gPlayerParty, gBlockRecvBuffer[enemyMultiplayerId], sizeof(struct Pokemon) * 2); memcpy(gPlayerParty + 3, gBlockRecvBuffer[playerMultiplayerId], sizeof(struct Pokemon) * 2); @@ -1231,7 +1231,7 @@ static void CB2_HandleStartMultiPartnerBattle(void) if ((GetBlockReceivedStatus() & 3) == 3) { ResetBlockReceivedFlags(); - if (gLinkPlayers[playerMultiplayerId].lp_field_18 != 0) + if (gLinkPlayers[playerMultiplayerId].id != 0) { memcpy(gPlayerParty + 2, gBlockRecvBuffer[enemyMultiplayerId], sizeof(struct Pokemon)); memcpy(gPlayerParty + 5, gBlockRecvBuffer[playerMultiplayerId], sizeof(struct Pokemon)); @@ -1422,8 +1422,8 @@ static void CB2_PreInitMultiBattle(void) if (numPlayers == 4) { - if ((!(gLinkPlayers[i].lp_field_18 & 1) && !(gLinkPlayers[playerMultiplierId].lp_field_18 & 1)) - || (gLinkPlayers[i].lp_field_18 & 1 && gLinkPlayers[playerMultiplierId].lp_field_18 & 1)) + if ((!(gLinkPlayers[i].id & 1) && !(gLinkPlayers[playerMultiplierId].id & 1)) + || (gLinkPlayers[i].id & 1 && gLinkPlayers[playerMultiplierId].id & 1)) { memcpy(gUnknown_02022FF8, gBlockRecvBuffer[i], sizeof(struct UnknownPokemonStruct4) * 3); } @@ -1583,7 +1583,7 @@ static void CB2_HandleStartMultiBattle(void) for (id = 0; id < MAX_LINK_PLAYERS; id++) { sub_8185F90(gBlockRecvBuffer[id][1]); - switch (gLinkPlayers[id].lp_field_18) + switch (gLinkPlayers[id].id) { case 0: gTasks[var].data[3] |= gBlockRecvBuffer[id][1] & 0x3F; @@ -1620,7 +1620,7 @@ static void CB2_HandleStartMultiBattle(void) { if (id == playerMultiplayerId) { - switch (gLinkPlayers[id].lp_field_18) + switch (gLinkPlayers[id].id) { case 0: case 3: @@ -1634,10 +1634,10 @@ static void CB2_HandleStartMultiBattle(void) } else { - if ((!(gLinkPlayers[id].lp_field_18 & 1) && !(gLinkPlayers[playerMultiplayerId].lp_field_18 & 1)) - || ((gLinkPlayers[id].lp_field_18 & 1) && (gLinkPlayers[playerMultiplayerId].lp_field_18 & 1))) + if ((!(gLinkPlayers[id].id & 1) && !(gLinkPlayers[playerMultiplayerId].id & 1)) + || ((gLinkPlayers[id].id & 1) && (gLinkPlayers[playerMultiplayerId].id & 1))) { - switch (gLinkPlayers[id].lp_field_18) + switch (gLinkPlayers[id].id) { case 0: case 3: @@ -1651,7 +1651,7 @@ static void CB2_HandleStartMultiBattle(void) } else { - switch (gLinkPlayers[id].lp_field_18) + switch (gLinkPlayers[id].id) { case 0: case 3: @@ -1683,7 +1683,7 @@ static void CB2_HandleStartMultiBattle(void) { if (id == playerMultiplayerId) { - switch (gLinkPlayers[id].lp_field_18) + switch (gLinkPlayers[id].id) { case 0: case 3: @@ -1697,10 +1697,10 @@ static void CB2_HandleStartMultiBattle(void) } else { - if ((!(gLinkPlayers[id].lp_field_18 & 1) && !(gLinkPlayers[playerMultiplayerId].lp_field_18 & 1)) - || ((gLinkPlayers[id].lp_field_18 & 1) && (gLinkPlayers[playerMultiplayerId].lp_field_18 & 1))) + if ((!(gLinkPlayers[id].id & 1) && !(gLinkPlayers[playerMultiplayerId].id & 1)) + || ((gLinkPlayers[id].id & 1) && (gLinkPlayers[playerMultiplayerId].id & 1))) { - switch (gLinkPlayers[id].lp_field_18) + switch (gLinkPlayers[id].id) { case 0: case 3: @@ -1714,7 +1714,7 @@ static void CB2_HandleStartMultiBattle(void) } else { - switch (gLinkPlayers[id].lp_field_18) + switch (gLinkPlayers[id].id) { case 0: case 3: @@ -2088,7 +2088,7 @@ static void sub_8038B94(u8 taskId) if (gBattleTypeFlags & BATTLE_TYPE_MULTI) { - switch (gLinkPlayers[r2].lp_field_18) + switch (gLinkPlayers[r2].id) { case 0: case 2: diff --git a/src/battle_message.c b/src/battle_message.c index 1f338db925..2bdbacf991 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -1843,25 +1843,25 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst) toCpy = text; break; case B_TXT_LINK_PLAYER_MON1_NAME: // link first player poke name - GetMonData(&gPlayerParty[gBattlerPartyIndexes[gLinkPlayers[multiplayerID].lp_field_18]], + GetMonData(&gPlayerParty[gBattlerPartyIndexes[gLinkPlayers[multiplayerID].id]], MON_DATA_NICKNAME, text); StringGetEnd10(text); toCpy = text; break; case B_TXT_LINK_OPPONENT_MON1_NAME: // link first opponent poke name - GetMonData(&gEnemyParty[gBattlerPartyIndexes[gLinkPlayers[multiplayerID].lp_field_18 ^ 1]], + GetMonData(&gEnemyParty[gBattlerPartyIndexes[gLinkPlayers[multiplayerID].id ^ 1]], MON_DATA_NICKNAME, text); StringGetEnd10(text); toCpy = text; break; case B_TXT_LINK_PLAYER_MON2_NAME: // link second player poke name - GetMonData(&gPlayerParty[gBattlerPartyIndexes[gLinkPlayers[multiplayerID].lp_field_18 ^ 2]], + GetMonData(&gPlayerParty[gBattlerPartyIndexes[gLinkPlayers[multiplayerID].id ^ 2]], MON_DATA_NICKNAME, text); StringGetEnd10(text); toCpy = text; break; case B_TXT_LINK_OPPONENT_MON2_NAME: // link second opponent poke name - GetMonData(&gEnemyParty[gBattlerPartyIndexes[gLinkPlayers[multiplayerID].lp_field_18 ^ 3]], + GetMonData(&gEnemyParty[gBattlerPartyIndexes[gLinkPlayers[multiplayerID].id ^ 3]], MON_DATA_NICKNAME, text); StringGetEnd10(text); toCpy = text; @@ -1927,7 +1927,7 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst) } else { - if (gLinkPlayers[gBattleScripting.multiplayerId].lp_field_18 == gPotentialItemEffectBattler) + if (gLinkPlayers[gBattleScripting.multiplayerId].id == gPotentialItemEffectBattler) { StringCopy(text, gEnigmaBerries[gPotentialItemEffectBattler].name); StringAppend(text, sText_BerrySuffix); @@ -2022,13 +2022,13 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst) toCpy = gLinkPlayers[multiplayerID].name; break; case B_TXT_1F: // link partner name? - toCpy = gLinkPlayers[GetBattlerMultiplayerId(2 ^ gLinkPlayers[multiplayerID].lp_field_18)].name; + toCpy = gLinkPlayers[GetBattlerMultiplayerId(2 ^ gLinkPlayers[multiplayerID].id)].name; break; case B_TXT_20: // link opponent 1 name? - toCpy = gLinkPlayers[GetBattlerMultiplayerId(1 ^ gLinkPlayers[multiplayerID].lp_field_18)].name; + toCpy = gLinkPlayers[GetBattlerMultiplayerId(1 ^ gLinkPlayers[multiplayerID].id)].name; break; case B_TXT_21: // link opponent 2 name? - toCpy = gLinkPlayers[GetBattlerMultiplayerId(3 ^ gLinkPlayers[multiplayerID].lp_field_18)].name; + toCpy = gLinkPlayers[GetBattlerMultiplayerId(3 ^ gLinkPlayers[multiplayerID].id)].name; break; case B_TXT_22: // link scripting active name toCpy = gLinkPlayers[GetBattlerMultiplayerId(gBattleScripting.battler)].name; @@ -2296,7 +2296,7 @@ static void ExpandBattleTextBuffPlaceholders(const u8 *src, u8 *dst) { if (hword == ITEM_ENIGMA_BERRY) { - if (gLinkPlayers[gBattleScripting.multiplayerId].lp_field_18 == gPotentialItemEffectBattler) + if (gLinkPlayers[gBattleScripting.multiplayerId].id == gPotentialItemEffectBattler) { StringCopy(dst, gEnigmaBerries[gPotentialItemEffectBattler].name); StringAppend(dst, sText_BerrySuffix); diff --git a/src/link.c b/src/link.c index acdb6cae06..0e8e062158 100644 --- a/src/link.c +++ b/src/link.c @@ -304,7 +304,7 @@ void LinkTestScreen(void) void sub_8009628(u8 a0) { - gLocalLinkPlayer.lp_field_18 = a0; + gLocalLinkPlayer.id = a0; } static void InitLocalLinkPlayer(void) diff --git a/src/pokemon.c b/src/pokemon.c index 800b7c0cd4..5bff1f2d33 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -1752,7 +1752,7 @@ bool8 sub_80688F8(u8 caseId, u8 battlerId) return FALSE; if (!gMain.inBattle) return FALSE; - if (gLinkPlayers[GetMultiplayerId()].lp_field_18 == battlerId) + if (gLinkPlayers[GetMultiplayerId()].id == battlerId) return FALSE; break; case 2: @@ -1774,7 +1774,7 @@ bool8 sub_80688F8(u8 caseId, u8 battlerId) return FALSE; if (gBattleTypeFlags & BATTLE_TYPE_MULTI) { - if (gLinkPlayers[GetMultiplayerId()].lp_field_18 == battlerId) + if (gLinkPlayers[GetMultiplayerId()].id == battlerId) return FALSE; } else @@ -4805,7 +4805,7 @@ void EvolutionRenameMon(struct Pokemon *mon, u16 oldSpecies, u16 newSpecies) bool8 sub_806D7EC(void) { bool8 retVal = FALSE; - switch (gLinkPlayers[GetMultiplayerId()].lp_field_18) + switch (gLinkPlayers[GetMultiplayerId()].id) { case 0: case 3: @@ -4822,7 +4822,7 @@ bool8 sub_806D7EC(void) bool16 sub_806D82C(u8 id) { bool16 retVal = FALSE; - switch (gLinkPlayers[id].lp_field_18) + switch (gLinkPlayers[id].id) { case 0: case 3: @@ -4840,7 +4840,7 @@ s32 GetBattlerMultiplayerId(u16 a1) { s32 id; for (id = 0; id < MAX_LINK_PLAYERS; id++) - if (gLinkPlayers[id].lp_field_18 == a1) + if (gLinkPlayers[id].id == a1) break; return id; } @@ -5691,7 +5691,7 @@ const u8 *GetTrainerPartnerName(void) else { u8 id = GetMultiplayerId(); - return gLinkPlayers[GetBattlerMultiplayerId(gLinkPlayers[id].lp_field_18 ^ 2)].name; + return gLinkPlayers[GetBattlerMultiplayerId(gLinkPlayers[id].id ^ 2)].name; } } @@ -5821,7 +5821,7 @@ u8 sub_806EF08(u8 arg0) s32 i; s32 var = 0; u8 multiplayerId = GetMultiplayerId(); - switch (gLinkPlayers[multiplayerId].lp_field_18) + switch (gLinkPlayers[multiplayerId].id) { case 0: case 2: @@ -5834,7 +5834,7 @@ u8 sub_806EF08(u8 arg0) } for (i = 0; i < 4; i++) { - if (gLinkPlayers[i].lp_field_18 == (s16)(var)) + if (gLinkPlayers[i].id == (s16)(var)) break; } return i; @@ -5844,7 +5844,7 @@ u8 sub_806EF84(u8 arg0, u8 arg1) { s32 i; s32 var = 0; - switch (gLinkPlayers[arg1].lp_field_18) + switch (gLinkPlayers[arg1].id) { case 0: case 2: @@ -5857,7 +5857,7 @@ u8 sub_806EF84(u8 arg0, u8 arg1) } for (i = 0; i < 4; i++) { - if (gLinkPlayers[i].lp_field_18 == (s16)(var)) + if (gLinkPlayers[i].id == (s16)(var)) break; } return i; diff --git a/src/recorded_battle.c b/src/recorded_battle.c index eb48ab15a3..1eed9aec75 100644 --- a/src/recorded_battle.c +++ b/src/recorded_battle.c @@ -159,7 +159,7 @@ void sub_8184E58(void) { sRecordedBattle_Players[i].trainerId = gLinkPlayers[i].trainerId; sRecordedBattle_Players[i].gender = gLinkPlayers[i].gender; - sRecordedBattle_Players[i].battlerId = gLinkPlayers[i].lp_field_18; + sRecordedBattle_Players[i].battlerId = gLinkPlayers[i].id; sRecordedBattle_Players[i].language = gLinkPlayers[i].language; if (i < linkPlayersCount) @@ -1340,7 +1340,7 @@ static void SetRecordedBattleVarsFromSave(struct RecordedBattleSave *src) } gLinkPlayers[i].gender = src->playersGender[i]; gLinkPlayers[i].language = src->playersLanguage[i]; - gLinkPlayers[i].lp_field_18 = src->playersBattlers[i]; + gLinkPlayers[i].id = src->playersBattlers[i]; gLinkPlayers[i].trainerId = src->playersTrainerId[i]; if (var) @@ -1453,7 +1453,7 @@ u8 GetActiveBattlerLinkPlayerGender(void) for (i = 0; i < MAX_LINK_PLAYERS; i++) { - if (gLinkPlayers[i].lp_field_18 == gActiveBattler) + if (gLinkPlayers[i].id == gActiveBattler) break; } diff --git a/src/rom_8011DC0.c b/src/rom_8011DC0.c index 81aef45c67..0a751a9f5f 100644 --- a/src/rom_8011DC0.c +++ b/src/rom_8011DC0.c @@ -38,6 +38,7 @@ extern void HealPlayerParty(void); struct UnkStruct_Shared { struct UnkLinkRfuStruct_02022B14 field_0; + u8 needingPadding[3]; u8 playerName[PLAYER_NAME_LENGTH]; }; @@ -2508,6 +2509,8 @@ void sub_80156C8(struct UnkStruct_URoom *data) memcpy(data->field_0, &gDecompressionBuffer[0x3F00], 0x100); } +// Cannot match, please fix later. +/* void sub_80156E0(u8 taskId) { u32 id = 0; @@ -3257,3 +3260,5 @@ void var_800D_set_xB(void) if (InUnionRoom() == TRUE) gSpecialVar_Result = 11; } + +*/