From 11f9a27640a9f921c6dc1858261d9a609a6599ca Mon Sep 17 00:00:00 2001 From: "U-User-PC\\User" Date: Wed, 18 Oct 2017 19:25:08 -0400 Subject: [PATCH] decompiled up to sub_81C3D54 --- asm/pokemon_summary_screen.s | 3095 ---------------------------------- src/pokemon_summary_screen.c | 1356 ++++++++++++++- 2 files changed, 1354 insertions(+), 3097 deletions(-) diff --git a/asm/pokemon_summary_screen.s b/asm/pokemon_summary_screen.s index 7ca5f879a7..fd2518075e 100755 --- a/asm/pokemon_summary_screen.s +++ b/asm/pokemon_summary_screen.s @@ -5,3101 +5,6 @@ .text - thumb_func_start sub_81C22CC -sub_81C22CC: @ 81C22CC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - adds r6, r1, 0 - adds r6, 0x70 - ldrb r1, [r6, 0x5] - mov r8, r0 - cmp r1, 0x63 - bhi _081C2340 - ldr r5, =gExperienceTables - adds r2, r1, 0 - adds r1, r2, 0x1 - lsls r1, 2 - ldr r4, =gBaseStats - ldrh r3, [r6] - lsls r0, r3, 3 - subs r0, r3 - lsls r0, 2 - adds r0, r4 - ldrb r3, [r0, 0x13] - movs r0, 0xCA - lsls r0, 1 - muls r0, r3 - adds r1, r0 - adds r1, r5 - lsls r2, 2 - adds r2, r0 - adds r2, r5 - ldr r1, [r1] - ldr r2, [r2] - subs r1, r2 - ldr r0, [r6, 0x10] - subs r4, r0, r2 - lsls r0, r4, 6 - bl __udivsi3 - adds r6, r0, 0 - movs r7, 0 - adds r0, r7, 0 - orrs r0, r6 - cmp r0, 0 - bne _081C2344 - cmp r4, 0 - beq _081C2344 - movs r6, 0x1 - movs r7, 0 - b _081C2344 - .pool -_081C2340: - movs r6, 0 - movs r7, 0 -_081C2344: - mov r1, r8 - ldr r0, [r1] - ldr r2, =0x00001d66 - adds r2, r0 - mov r9, r2 - movs r0, 0 - mov r12, r0 - ldr r1, =0x00002062 - mov r10, r1 -_081C2356: - cmp r7, 0 - bgt _081C2362 - cmp r7, 0 - bne _081C237C - cmp r6, 0x7 - bls _081C237C -_081C2362: - mov r2, r12 - lsls r0, r2, 1 - add r0, r9 - ldr r2, =0x0000206a - adds r1, r2, 0 - strh r1, [r0] - b _081C23B6 - .pool -_081C237C: - mov r1, r12 - lsls r0, r1, 1 - add r0, r9 - mov r8, r0 - adds r5, r7, 0 - adds r4, r6, 0 - cmp r7, 0 - bge _081C2394 - movs r4, 0x7 - movs r5, 0 - adds r4, r6 - adcs r5, r7 -_081C2394: - lsls r3, r5, 29 - lsrs r2, r4, 3 - adds r0, r3, 0 - orrs r0, r2 - asrs r1, r5, 3 - lsrs r5, r0, 29 - lsls r4, r1, 3 - adds r3, r5, 0 - orrs r3, r4 - lsls r2, r0, 3 - adds r1, r7, 0 - adds r0, r6, 0 - subs r0, r2 - sbcs r1, r3 - add r0, r10 - mov r2, r8 - strh r0, [r2] -_081C23B6: - movs r0, 0x8 - negs r0, r0 - asrs r1, r0, 31 - adds r6, r0 - adcs r7, r1 - cmp r7, 0 - bge _081C23C8 - movs r6, 0 - movs r7, 0 -_081C23C8: - mov r0, r12 - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - mov r12, r0 - cmp r0, 0x7 - bls _081C2356 - movs r0, 0x1 - bl GetBgTilemapBuffer - ldr r1, =gUnknown_0203CF1C - ldr r1, [r1] - ldr r2, =0x000010bc - adds r1, r2 - cmp r0, r1 - bne _081C23F8 - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - b _081C23FE - .pool -_081C23F8: - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram -_081C23FE: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81C22CC - - thumb_func_start sub_81C240C -sub_81C240C: @ 81C240C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 16 - lsrs r3, r0, 16 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000038bc - adds r5, r0, r1 - cmp r3, 0 - beq _081C2510 - ldr r1, =gContestEffects - ldr r2, =gContestMoves - lsls r3, 3 - adds r0, r3, r2 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldrb r4, [r0, 0x1] - mov r9, r1 - mov r8, r2 - mov r10, r3 - cmp r4, 0xFF - beq _081C244C - adds r0, r4, 0 - movs r1, 0xA - bl __udivsi3 - lsls r0, 24 - lsrs r4, r0, 24 -_081C244C: - movs r2, 0 - movs r6, 0x3 - movs r3, 0xF3 - lsls r3, 2 -_081C2454: - cmp r4, 0xFF - beq _081C2484 - cmp r2, r4 - bcs _081C2484 - lsrs r0, r2, 2 - adds r1, r2, 0 - ands r1, r6 - lsls r0, 5 - adds r0, r1 - lsls r0, 1 - adds r0, r5 - adds r0, r3 - ldr r7, =0x0000103a - b _081C2496 - .pool -_081C2484: - lsrs r0, r2, 2 - adds r1, r2, 0 - ands r1, r6 - lsls r0, 5 - adds r0, r1 - lsls r0, 1 - adds r0, r5 - adds r0, r3 - ldr r7, =0x00001039 -_081C2496: - adds r1, r7, 0 - strh r1, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x7 - bls _081C2454 - mov r0, r10 - add r0, r8 - ldrb r0, [r0] - lsls r0, 2 - add r0, r9 - ldrb r4, [r0, 0x2] - cmp r4, 0xFF - beq _081C24C0 - adds r0, r4, 0 - movs r1, 0xA - bl __udivsi3 - lsls r0, 24 - lsrs r4, r0, 24 -_081C24C0: - movs r2, 0 - movs r6, 0x3 - ldr r3, =0x0000044c -_081C24C6: - cmp r4, 0xFF - beq _081C24F0 - cmp r2, r4 - bcs _081C24F0 - lsrs r0, r2, 2 - adds r1, r2, 0 - ands r1, r6 - lsls r0, 5 - adds r0, r1 - lsls r0, 1 - adds r0, r5 - adds r0, r3 - ldr r7, =0x0000103c - b _081C2502 - .pool -_081C24F0: - lsrs r0, r2, 2 - adds r1, r2, 0 - ands r1, r6 - lsls r0, 5 - adds r0, r1 - lsls r0, 1 - adds r0, r5 - adds r0, r3 - ldr r7, =0x0000103d -_081C2502: - adds r1, r7, 0 - strh r1, [r0] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x7 - bls _081C24C6 -_081C2510: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C240C - - thumb_func_start sub_81C2524 -sub_81C2524: @ 81C2524 - push {lr} - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r0, 0x74 - ldrb r0, [r0] - cmp r0, 0 - beq _081C2544 - movs r1, 0x80 - lsls r1, 9 - movs r0, 0x3 - movs r2, 0 - bl ChangeBgX - b _081C254E - .pool -_081C2544: - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgX -_081C254E: - pop {r0} - bx r0 - thumb_func_end sub_81C2524 - - thumb_func_start sub_81C2554 -sub_81C2554: @ 81C2554 - push {r4,r5,lr} - ldr r0, =gUnknown_0861CC24 - bl InitWindows - bl DeactivateAllTextPrinters - movs r4, 0 -_081C2562: - adds r0, r4, 0 - movs r1, 0 - bl FillWindowPixelBuffer - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x13 - bls _081C2562 - movs r4, 0 - ldr r5, =gUnknown_0203CF1C - ldr r3, =0x000040cb - movs r2, 0xFF -_081C257C: - ldr r0, [r5] - adds r0, r3 - adds r0, r4 - ldrb r1, [r0] - orrs r1, r2 - strb r1, [r0] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x7 - bls _081C257C - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2554 - - thumb_func_start sub_81C25A4 -sub_81C25A4: @ 81C25A4 - push {r4-r6,lr} - sub sp, 0x14 - ldr r4, [sp, 0x24] - ldr r5, [sp, 0x28] - lsls r0, 24 - lsrs r0, 24 - lsls r2, 24 - lsrs r2, 24 - lsls r3, 24 - lsrs r3, 24 - lsls r4, 24 - lsrs r4, 24 - lsls r5, 24 - lsrs r5, 24 - movs r6, 0 - str r6, [sp] - str r4, [sp, 0x4] - lsls r4, r5, 1 - adds r4, r5 - ldr r5, =gUnknown_0861CD2C - adds r4, r5 - str r4, [sp, 0x8] - str r6, [sp, 0xC] - str r1, [sp, 0x10] - movs r1, 0x1 - bl AddTextPrinterParametrized2 - add sp, 0x14 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C25A4 - - thumb_func_start sub_81C25E8 -sub_81C25E8: @ 81C25E8 - push {lr} - movs r0, 0x11 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x12 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x13 - movs r1, 0 - bl FillWindowPixelBuffer - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r0, 0x74 - ldrb r0, [r0] - cmp r0, 0 - bne _081C2618 - bl sub_81C2628 - b _081C261C - .pool -_081C2618: - bl sub_81C2794 -_081C261C: - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - pop {r0} - bx r0 - thumb_func_end sub_81C25E8 - - thumb_func_start sub_81C2628 -sub_81C2628: @ 81C2628 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x18 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - movs r1, 0xC - adds r1, r0 - mov r8, r1 - adds r7, r0, 0 - adds r7, 0x70 - ldrh r0, [r7] - bl SpeciesToPokedexNum - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, =0x0000ffff - cmp r5, r0 - beq _081C26CE - ldr r6, =gStringVar1 - ldr r1, =gText_UnkCtrlF908Clear01 - adds r0, r6, 0 - bl StringCopy - ldr r4, =gStringVar2 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x2 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - adds r0, r6, 0 - adds r1, r4, 0 - bl StringAppend - mov r0, r8 - bl IsMonShiny - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _081C26AC - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - movs r0, 0x11 - adds r1, r6, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - movs r0, 0 - bl sub_81C228C - b _081C26C6 - .pool -_081C26AC: - movs r0, 0 - str r0, [sp] - movs r0, 0x7 - str r0, [sp, 0x4] - movs r0, 0x11 - adds r1, r6, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - movs r0, 0x1 - bl sub_81C228C -_081C26C6: - movs r0, 0x11 - bl PutWindowTilemap - b _081C26EE -_081C26CE: - movs r0, 0x11 - bl ClearWindowTilemap - mov r0, r8 - bl IsMonShiny - lsls r0, 24 - cmp r0, 0 - bne _081C26E8 - movs r0, 0 - bl sub_81C228C - b _081C26EE -_081C26E8: - movs r0, 0x1 - bl sub_81C228C -_081C26EE: - ldr r4, =gStringVar1 - ldr r1, =gText_LevelSymbol - adds r0, r4, 0 - bl StringCopy - ldr r5, =gStringVar2 - ldrb r1, [r7, 0x5] - adds r0, r5, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - adds r0, r4, 0 - adds r1, r5, 0 - bl StringAppend - movs r6, 0 - str r6, [sp] - movs r5, 0x1 - str r5, [sp, 0x4] - movs r0, 0x13 - adds r1, r4, 0 - movs r2, 0x18 - movs r3, 0x11 - bl sub_81C25A4 - mov r0, r8 - adds r1, r4, 0 - bl GetMonNickname - str r6, [sp] - str r5, [sp, 0x4] - movs r0, 0x12 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - add r1, sp, 0x8 - movs r0, 0xBA - strb r0, [r1] - mov r0, sp - adds r0, 0x9 - ldrh r2, [r7, 0x2] - movs r1, 0xB - muls r1, r2 - ldr r2, =gSpeciesNames - adds r1, r2 - bl StringCopy - str r6, [sp] - str r5, [sp, 0x4] - movs r0, 0x13 - add r1, sp, 0x8 - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldrh r1, [r7, 0x2] - mov r0, r8 - bl sub_81C27DC - movs r0, 0x12 - bl PutWindowTilemap - movs r0, 0x13 - bl PutWindowTilemap - add sp, 0x18 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2628 - - thumb_func_start sub_81C2794 -sub_81C2794: @ 81C2794 - push {r4,lr} - sub sp, 0x8 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r0, 0xC - ldr r4, =gStringVar1 - adds r1, r4, 0 - bl GetMonNickname - movs r0, 0 - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - movs r0, 0x12 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - movs r0, 0x12 - bl PutWindowTilemap - movs r0, 0x11 - bl ClearWindowTilemap - movs r0, 0x13 - bl ClearWindowTilemap - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2794 - - thumb_func_start sub_81C27DC -sub_81C27DC: @ 81C27DC - push {lr} - sub sp, 0x8 - lsls r1, 16 - lsrs r1, 16 - cmp r1, 0x20 - beq _081C282C - cmp r1, 0x1D - beq _081C282C - bl GetMonGender - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - beq _081C27FE - cmp r0, 0xFE - beq _081C2818 - b _081C282C -_081C27FE: - ldr r1, =gText_MaleSymbol - str r0, [sp] - movs r0, 0x3 - str r0, [sp, 0x4] - movs r0, 0x13 - movs r2, 0x39 - movs r3, 0x11 - bl sub_81C25A4 - b _081C282C - .pool -_081C2818: - ldr r1, =gText_FemaleSymbol - movs r0, 0 - str r0, [sp] - movs r0, 0x4 - str r0, [sp, 0x4] - movs r0, 0x13 - movs r2, 0x39 - movs r3, 0x11 - bl sub_81C25A4 -_081C282C: - add sp, 0x8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C27DC - - thumb_func_start sub_81C2838 -sub_81C2838: @ 81C2838 - push {r4,lr} - sub sp, 0x8 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - ldr r3, =gUnknown_0861CDD3 - cmp r1, 0 - bne _081C284A - subs r3, 0x80 -_081C284A: - lsls r2, 16 - lsrs r2, 16 - movs r0, 0x10 - str r0, [sp] - str r0, [sp, 0x4] - adds r0, r4, 0 - adds r1, r3, 0 - movs r3, 0 - bl BlitBitmapToWindow - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2838 - - thumb_func_start sub_81C286C -sub_81C286C: @ 81C286C - push {r4-r7,lr} - sub sp, 0x8 - ldr r1, =gText_PkmnInfo - movs r5, 0 - str r5, [sp] - movs r6, 0x1 - str r6, [sp, 0x4] - movs r0, 0 - movs r2, 0x2 - movs r3, 0x1 - bl sub_81C25A4 - ldr r1, =gText_PkmnSkills - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0x1 - movs r2, 0x2 - movs r3, 0x1 - bl sub_81C25A4 - ldr r1, =gText_BattleMoves - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0x2 - movs r2, 0x2 - movs r3, 0x1 - bl sub_81C25A4 - ldr r1, =gText_ContestMoves - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0x3 - movs r2, 0x2 - movs r3, 0x1 - bl sub_81C25A4 - ldr r7, =gText_Cancel2 - movs r0, 0x1 - adds r1, r7, 0 - movs r2, 0x3E - bl GetStringRightAlignXOffset - adds r4, r0, 0 - adds r2, r4, 0 - subs r2, 0x10 - cmp r2, 0 - bge _081C28CC - movs r2, 0 -_081C28CC: - movs r0, 0x4 - movs r1, 0 - bl sub_81C2838 - lsls r2, r4, 24 - lsrs r2, 24 - str r5, [sp] - str r5, [sp, 0x4] - movs r0, 0x4 - adds r1, r7, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldr r7, =gText_Info - movs r0, 0x1 - adds r1, r7, 0 - movs r2, 0x3E - bl GetStringRightAlignXOffset - adds r4, r0, 0 - adds r2, r4, 0 - subs r2, 0x10 - cmp r2, 0 - bge _081C28FE - movs r2, 0 -_081C28FE: - movs r0, 0x5 - movs r1, 0 - bl sub_81C2838 - lsls r2, r4, 24 - lsrs r2, 24 - str r5, [sp] - str r5, [sp, 0x4] - movs r0, 0x5 - adds r1, r7, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldr r7, =gText_Switch - movs r0, 0x1 - adds r1, r7, 0 - movs r2, 0x3E - bl GetStringRightAlignXOffset - adds r4, r0, 0 - adds r2, r4, 0 - subs r2, 0x10 - cmp r2, 0 - bge _081C2930 - movs r2, 0 -_081C2930: - movs r0, 0x6 - movs r1, 0 - bl sub_81C2838 - lsls r2, r4, 24 - lsrs r2, 24 - str r5, [sp] - str r5, [sp, 0x4] - movs r0, 0x6 - adds r1, r7, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldr r1, =gText_RentalPkmn - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0x8 - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldr r1, =gText_TypeSlash - str r5, [sp] - str r5, [sp, 0x4] - movs r0, 0x9 - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldr r4, =gText_HP4 - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x2A - bl GetStringCenterAlignXOffset - adds r0, 0x6 - lsls r2, r0, 24 - lsrs r2, 24 - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xA - adds r1, r4, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldr r4, =gText_Attack3 - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x2A - bl GetStringCenterAlignXOffset - adds r0, 0x6 - lsls r2, r0, 24 - lsrs r2, 24 - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xA - adds r1, r4, 0 - movs r3, 0x11 - bl sub_81C25A4 - ldr r4, =gText_Defense3 - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x2A - bl GetStringCenterAlignXOffset - adds r0, 0x6 - lsls r2, r0, 24 - lsrs r2, 24 - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xA - adds r1, r4, 0 - movs r3, 0x21 - bl sub_81C25A4 - ldr r4, =gText_SpAtk4 - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x24 - bl GetStringCenterAlignXOffset - adds r0, 0x2 - lsls r2, r0, 24 - lsrs r2, 24 - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xB - adds r1, r4, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldr r4, =gText_SpDef4 - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x24 - bl GetStringCenterAlignXOffset - adds r0, 0x2 - lsls r2, r0, 24 - lsrs r2, 24 - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xB - adds r1, r4, 0 - movs r3, 0x11 - bl sub_81C25A4 - ldr r4, =gText_Speed2 - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x24 - bl GetStringCenterAlignXOffset - adds r0, 0x2 - lsls r2, r0, 24 - lsrs r2, 24 - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xB - adds r1, r4, 0 - movs r3, 0x21 - bl sub_81C25A4 - ldr r1, =gText_ExpPoints - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xC - movs r2, 0x6 - movs r3, 0x1 - bl sub_81C25A4 - ldr r1, =gText_NextLv - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xC - movs r2, 0x6 - movs r3, 0x11 - bl sub_81C25A4 - ldr r1, =gText_Status - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xD - movs r2, 0x2 - movs r3, 0x1 - bl sub_81C25A4 - ldr r1, =gText_Power - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xE - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldr r1, =gText_Accuracy2 - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xE - movs r2, 0 - movs r3, 0x11 - bl sub_81C25A4 - ldr r1, =gText_Appeal - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xF - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldr r1, =gText_Jam - str r5, [sp] - str r6, [sp, 0x4] - movs r0, 0xF - movs r2, 0 - movs r3, 0x11 - bl sub_81C25A4 - add sp, 0x8 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C286C - - thumb_func_start sub_81C2AFC -sub_81C2AFC: @ 81C2AFC - push {r4,r5,lr} - lsls r0, 24 - lsrs r4, r0, 24 - adds r5, r4, 0 - movs r0, 0 - bl ClearWindowTilemap - movs r0, 0x1 - bl ClearWindowTilemap - movs r0, 0x2 - bl ClearWindowTilemap - movs r0, 0x3 - bl ClearWindowTilemap - cmp r4, 0x1 - beq _081C2B66 - cmp r4, 0x1 - bgt _081C2B2A - cmp r4, 0 - beq _081C2B34 - b _081C2C06 -_081C2B2A: - cmp r5, 0x2 - beq _081C2B80 - cmp r5, 0x3 - beq _081C2BC4 - b _081C2C06 -_081C2B34: - movs r0, 0 - bl PutWindowTilemap - movs r0, 0x4 - bl PutWindowTilemap - bl sub_81A6BF4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C2B58 - bl sub_81B9E94 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C2B5E -_081C2B58: - movs r0, 0x8 - bl PutWindowTilemap -_081C2B5E: - movs r0, 0x9 - bl PutWindowTilemap - b _081C2C06 -_081C2B66: - movs r0, 0x1 - bl PutWindowTilemap - movs r0, 0xA - bl PutWindowTilemap - movs r0, 0xB - bl PutWindowTilemap - movs r0, 0xC - bl PutWindowTilemap - b _081C2C06 -_081C2B80: - movs r0, 0x2 - bl PutWindowTilemap - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - ldr r2, =0x000040bc - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C2BBC - adds r2, 0x8 - adds r0, r1, r2 - ldr r0, [r0] - ldr r1, =0x00ffffff - ands r0, r1 - movs r1, 0x80 - lsls r1, 11 - cmp r0, r1 - beq _081C2C06 - movs r0, 0xE - bl PutWindowTilemap - b _081C2C06 - .pool -_081C2BBC: - movs r0, 0x5 - bl PutWindowTilemap - b _081C2C06 -_081C2BC4: - movs r0, 0x3 - bl PutWindowTilemap - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - ldr r2, =0x000040bc - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C2C00 - adds r2, 0x8 - adds r0, r1, r2 - ldr r0, [r0] - ldr r1, =0x00ffffff - ands r0, r1 - movs r1, 0x80 - lsls r1, 11 - cmp r0, r1 - beq _081C2C06 - movs r0, 0xF - bl PutWindowTilemap - b _081C2C06 - .pool -_081C2C00: - movs r0, 0x5 - bl PutWindowTilemap -_081C2C06: - movs r4, 0 - ldr r5, =gUnknown_0203CF1C -_081C2C0A: - ldr r0, [r5] - ldr r1, =0x000040cb - adds r0, r1 - adds r0, r4 - ldrb r0, [r0] - bl PutWindowTilemap - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x7 - bls _081C2C0A - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2AFC - - thumb_func_start sub_81C2C38 -sub_81C2C38: @ 81C2C38 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - adds r1, r0, 0 - cmp r0, 0x1 - beq _081C2C84 - cmp r0, 0x1 - bgt _081C2C4E - cmp r0, 0 - beq _081C2C58 - b _081C2D0E -_081C2C4E: - cmp r1, 0x2 - beq _081C2C98 - cmp r1, 0x3 - beq _081C2CD4 - b _081C2D0E -_081C2C58: - movs r0, 0x4 - bl ClearWindowTilemap - bl sub_81A6BF4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C2C76 - bl sub_81B9E94 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C2C7C -_081C2C76: - movs r0, 0x8 - bl ClearWindowTilemap -_081C2C7C: - movs r0, 0x9 - bl ClearWindowTilemap - b _081C2D0E -_081C2C84: - movs r0, 0xA - bl ClearWindowTilemap - movs r0, 0xB - bl ClearWindowTilemap - movs r0, 0xC - bl ClearWindowTilemap - b _081C2D0E -_081C2C98: - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - ldr r2, =0x000040bc - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C2CCC - adds r2, 0x8 - adds r0, r1, r2 - ldr r0, [r0] - ldr r1, =0x00ffffff - ands r0, r1 - movs r1, 0x80 - lsls r1, 11 - cmp r0, r1 - beq _081C2D0E - movs r0, 0xE - bl ClearWindowTilemap - b _081C2D0E - .pool -_081C2CCC: - movs r0, 0x5 - bl ClearWindowTilemap - b _081C2D0E -_081C2CD4: - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - ldr r2, =0x000040bc - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C2D08 - adds r2, 0x8 - adds r0, r1, r2 - ldr r0, [r0] - ldr r1, =0x00ffffff - ands r0, r1 - movs r1, 0x80 - lsls r1, 11 - cmp r0, r1 - beq _081C2D0E - movs r0, 0xF - bl ClearWindowTilemap - b _081C2D0E - .pool -_081C2D08: - movs r0, 0x5 - bl ClearWindowTilemap -_081C2D0E: - movs r4, 0 -_081C2D10: - adds r0, r4, 0 - bl sub_81C2D68 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x7 - bls _081C2D10 - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81C2C38 - - thumb_func_start sub_81C2D2C -sub_81C2D2C: @ 81C2D2C - push {r4,lr} - adds r3, r0, 0 - lsls r1, 24 - lsrs r2, r1, 24 - ldr r0, =gUnknown_0203CF1C - ldr r4, =0x000040cb - adds r1, r2, r4 - ldr r0, [r0] - adds r4, r0, r1 - ldrb r0, [r4] - cmp r0, 0xFF - bne _081C2D56 - lsls r0, r2, 3 - adds r0, r3, r0 - bl AddWindow - strb r0, [r4] - ldrb r0, [r4] - movs r1, 0 - bl FillWindowPixelBuffer -_081C2D56: - ldrb r0, [r4] - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81C2D2C - - thumb_func_start sub_81C2D68 -sub_81C2D68: @ 81C2D68 - push {r4,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0203CF1C - ldr r2, =0x000040cb - adds r0, r2 - ldr r1, [r1] - adds r4, r1, r0 - ldrb r0, [r4] - cmp r0, 0xFF - beq _081C2D8C - bl ClearWindowTilemap - ldrb r0, [r4] - bl RemoveWindow - movs r0, 0xFF - strb r0, [r4] -_081C2D8C: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2D68 - - thumb_func_start sub_81C2D9C -sub_81C2D9C: @ 81C2D9C - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 -_081C2DA4: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040cb - adds r0, r1 - adds r1, r0, r4 - ldrb r0, [r1] - cmp r0, 0xFF - beq _081C2DBA - movs r1, 0 - bl FillWindowPixelBuffer -_081C2DBA: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x7 - bls _081C2DA4 - ldr r0, =gUnknown_0861CE54 - lsls r1, r5, 2 - adds r1, r0 - ldr r0, [r1] - bl _call_via_r0 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2D9C - - thumb_func_start sub_81C2DE4 -sub_81C2DE4: @ 81C2DE4 - push {lr} - lsls r0, 24 - ldr r1, =gUnknown_0861CE64 - lsrs r0, 22 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x10 - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2DE4 - - thumb_func_start sub_81C2E00 -sub_81C2E00: @ 81C2E00 - push {lr} - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r0, 0x74 - ldrb r0, [r0] - cmp r0, 0 - beq _081C2E24 - bl sub_81C335C - bl sub_81C33CC - bl sub_81C3428 - bl sub_81C349C - b _081C2E3C - .pool -_081C2E24: - bl sub_81C2EC4 - bl sub_81C2F5C - bl sub_81C2FD8 - bl sub_81C302C - bl sub_81C307C - bl sub_81C3194 -_081C2E3C: - pop {r0} - bx r0 - thumb_func_end sub_81C2E00 - - thumb_func_start sub_81C2E40 -sub_81C2E40: @ 81C2E40 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - ldrh r0, [r4] - subs r0, 0x1 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - bhi _081C2EB8 - lsls r0, 2 - ldr r1, =_081C2E70 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081C2E70: - .4byte _081C2E8C - .4byte _081C2E92 - .4byte _081C2E98 - .4byte _081C2E9E - .4byte _081C2EA4 - .4byte _081C2EAA - .4byte _081C2EB0 -_081C2E8C: - bl sub_81C2EC4 - b _081C2EB8 -_081C2E92: - bl sub_81C2F5C - b _081C2EB8 -_081C2E98: - bl sub_81C2FD8 - b _081C2EB8 -_081C2E9E: - bl sub_81C302C - b _081C2EB8 -_081C2EA4: - bl sub_81C307C - b _081C2EB8 -_081C2EAA: - bl sub_81C3194 - b _081C2EB8 -_081C2EB0: - adds r0, r2, 0 - bl DestroyTask - b _081C2EBE -_081C2EB8: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] -_081C2EBE: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81C2E40 - - thumb_func_start sub_81C2EC4 -sub_81C2EC4: @ 81C2EC4 - push {r4-r6,lr} - sub sp, 0x8 - bl sub_81A6BF4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C2F54 - bl sub_81B9E94 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C2F54 - ldr r0, =gUnknown_0861CCCC - movs r1, 0 - bl sub_81C2D2C - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =gText_OTSlash - movs r6, 0 - str r6, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0 - bl GetStringWidth - adds r2, r0, 0 - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0xA2 - ldrb r0, [r0] - cmp r0, 0 - bne _081C2F40 - adds r1, 0xA6 - lsls r2, 24 - lsrs r2, 24 - str r6, [sp] - movs r0, 0x5 - str r0, [sp, 0x4] - adds r0, r5, 0 - movs r3, 0x1 - bl sub_81C25A4 - b _081C2F54 - .pool -_081C2F40: - adds r1, 0xA6 - lsls r2, 24 - lsrs r2, 24 - str r6, [sp] - movs r0, 0x6 - str r0, [sp, 0x4] - adds r0, r5, 0 - movs r3, 0x1 - bl sub_81C25A4 -_081C2F54: - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81C2EC4 - - thumb_func_start sub_81C2F5C -sub_81C2F5C: @ 81C2F5C - push {r4,r5,lr} - sub sp, 0x8 - bl sub_81A6BF4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C2FC0 - bl sub_81B9E94 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C2FC0 - ldr r5, =gStringVar1 - ldr r1, =gText_UnkCtrlF907F908 - adds r0, r5, 0 - bl StringCopy - ldr r1, =gUnknown_0203CF1C - ldr r1, [r1] - adds r1, 0xB8 - ldrh r1, [r1] - movs r2, 0x2 - movs r3, 0x5 - bl ConvertIntToDecimalStringN - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x38 - bl GetStringRightAlignXOffset - adds r4, r0, 0 - ldr r0, =gUnknown_0861CCCC - movs r1, 0x1 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsrs r4, 24 - movs r1, 0 - str r1, [sp] - movs r1, 0x1 - str r1, [sp, 0x4] - adds r1, r5, 0 - adds r2, r4, 0 - movs r3, 0x1 - bl sub_81C25A4 -_081C2FC0: - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2F5C - - thumb_func_start sub_81C2FD8 -sub_81C2FD8: @ 81C2FD8 - push {r4,lr} - sub sp, 0x8 - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0x70 - ldrh r0, [r0] - adds r1, 0x78 - ldrb r1, [r1] - bl GetAbilityBySpecies - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_0861CCCC - movs r1, 0x2 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - movs r1, 0xD - muls r1, r4 - ldr r2, =gAbilityNames - adds r1, r2 - movs r2, 0 - str r2, [sp] - movs r2, 0x1 - str r2, [sp, 0x4] - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C2FD8 - - thumb_func_start sub_81C302C -sub_81C302C: @ 81C302C - push {r4,lr} - sub sp, 0x8 - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - adds r0, r1, 0 - adds r0, 0x70 - ldrh r0, [r0] - adds r1, 0x78 - ldrb r1, [r1] - bl GetAbilityBySpecies - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_0861CCCC - movs r1, 0x2 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gAbilityDescriptionPointers - lsls r4, 2 - adds r4, r1 - ldr r1, [r4] - movs r2, 0 - str r2, [sp] - str r2, [sp, 0x4] - movs r3, 0x11 - bl sub_81C25A4 - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C302C - - thumb_func_start sub_81C307C -sub_81C307C: @ 81C307C - push {r4-r6,lr} - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r4, r0, 0 - adds r4, 0x70 - bl sub_81AFBF0 - ldr r1, =gUnknown_0861CE74 - movs r0, 0 - bl sub_81AFC0C - ldr r1, =gUnknown_0861CE7B - movs r0, 0x1 - bl sub_81AFC0C - bl sub_81C31C0 - bl sub_81A6BF4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C30C2 - bl sub_81B9E94 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C30C2 - bl sub_81C3304 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C30E0 -_081C30C2: - ldr r0, =gStringVar4 - ldr r1, =gText_XNature - bl sub_81AFC28 - b _081C3182 - .pool -_081C30E0: - movs r0, 0x20 - bl Alloc - adds r6, r0, 0 - movs r0, 0x20 - bl Alloc - adds r5, r0, 0 - adds r0, r6, 0 - bl sub_81C31F0 - ldrb r0, [r4, 0x9] - cmp r0, 0xD4 - bhi _081C310C - adds r1, r0, 0 - adds r0, r5, 0 - bl sub_8124610 - movs r0, 0x4 - adds r1, r5, 0 - bl sub_81AFC0C -_081C310C: - bl sub_81C3220 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C3148 - ldrb r0, [r4, 0xA] - cmp r0, 0 - bne _081C3134 - ldrb r0, [r4, 0x9] - ldr r1, =gText_XNatureHatchedAtYZ - cmp r0, 0xD4 - bls _081C3170 - ldr r1, =gText_XNatureHatchedSomewhereAt - b _081C3170 - .pool -_081C3134: - ldrb r0, [r4, 0x9] - ldr r1, =gText_XNatureMetAtYZ - cmp r0, 0xD4 - bls _081C3170 - ldr r1, =gText_XNatureMetSomewhereAt - b _081C3170 - .pool -_081C3148: - ldrb r0, [r4, 0x9] - cmp r0, 0xFF - bne _081C3158 - ldr r1, =gText_XNatureFatefulEncounter - b _081C3170 - .pool -_081C3158: - cmp r0, 0xFE - beq _081C316E - bl sub_81C32BC - lsls r0, 24 - cmp r0, 0 - beq _081C316E - ldrb r0, [r4, 0x9] - ldr r1, =gText_XNatureProbablyMetAt - cmp r0, 0xD4 - bls _081C3170 -_081C316E: - ldr r1, =gText_XNatureObtainedInTrade -_081C3170: - ldr r0, =gStringVar4 - bl sub_81AFC28 - adds r0, r6, 0 - bl Free - adds r0, r5, 0 - bl Free -_081C3182: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C307C - - thumb_func_start sub_81C3194 -sub_81C3194: @ 81C3194 - push {lr} - sub sp, 0x8 - ldr r0, =gUnknown_0861CCCC - movs r1, 0x3 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gStringVar4 - movs r2, 0 - str r2, [sp] - str r2, [sp, 0x4] - movs r3, 0x1 - bl sub_81C25A4 - add sp, 0x8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C3194 - - thumb_func_start sub_81C31C0 -sub_81C31C0: @ 81C31C0 - push {lr} - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =gNatureNamePointers - adds r0, 0xA3 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r1, [r0] - movs r0, 0x2 - bl sub_81AFC0C - ldr r1, =gText_EmptyString5 - movs r0, 0x5 - bl sub_81AFC0C - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C31C0 - - thumb_func_start sub_81C31F0 -sub_81C31F0: @ 81C31F0 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r0, 0x7A - ldrb r1, [r0] - cmp r1, 0 - bne _081C3202 - movs r1, 0x5 -_081C3202: - adds r0, r4, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - movs r0, 0x3 - adds r1, r4, 0 - bl sub_81AFC0C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C31F0 - - thumb_func_start sub_81C3220 -sub_81C3220: @ 81C3220 - push {r4-r6,lr} - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r6, r0, 0 - adds r6, 0x70 - ldr r1, [r0] - ldr r0, =gEnemyParty - cmp r1, r0 - bne _081C326C - bl GetMultiplayerId - movs r1, 0x1 - eors r0, r1 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gLinkPlayers - lsls r1, r0, 3 - subs r1, r0 - lsls r1, 2 - adds r0, r2, 0x4 - adds r0, r1, r0 - ldrh r4, [r0] - adds r0, r1, r2 - ldrb r5, [r0, 0x13] - ldr r0, =gStringVar1 - adds r2, 0x8 - adds r1, r2 - bl StringCopy - b _081C3282 - .pool -_081C326C: - bl sub_80F0020 - adds r4, r0, 0 - ldr r0, =0x0000ffff - ands r4, r0 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - ldrb r5, [r1, 0x8] - ldr r0, =gStringVar1 - bl StringCopy -_081C3282: - adds r0, r6, 0 - adds r0, 0x32 - ldrb r0, [r0] - cmp r5, r0 - bne _081C32A4 - ldr r0, [r6, 0x48] - ldr r1, =0x0000ffff - ands r0, r1 - cmp r4, r0 - bne _081C32A4 - ldr r0, =gStringVar1 - adds r1, r6, 0 - adds r1, 0x36 - bl StringCompareWithoutExtCtrlCodes - cmp r0, 0 - beq _081C32B4 -_081C32A4: - movs r0, 0 - b _081C32B6 - .pool -_081C32B4: - movs r0, 0x1 -_081C32B6: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81C3220 - - thumb_func_start sub_81C32BC -sub_81C32BC: @ 81C32BC - push {lr} - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r0, 0x70 - ldrb r0, [r0, 0xB] - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bls _081C32D8 - movs r0, 0 - b _081C32DA - .pool -_081C32D8: - movs r0, 0x1 -_081C32DA: - pop {r1} - bx r1 - thumb_func_end sub_81C32BC - - thumb_func_start sub_81C32E0 -sub_81C32E0: @ 81C32E0 - push {lr} - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r0, 0x70 - ldrb r0, [r0, 0xB] - subs r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bls _081C32FC - movs r0, 0 - b _081C32FE - .pool -_081C32FC: - movs r0, 0x1 -_081C32FE: - pop {r1} - bx r1 - thumb_func_end sub_81C32E0 - - thumb_func_start sub_81C3304 -sub_81C3304: @ 81C3304 - push {lr} - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 15 - ands r0, r1 - cmp r0, 0 - beq _081C3354 - ldr r0, =gMain - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081C3354 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040be - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _081C333A - cmp r0, 0x4 - beq _081C333A - cmp r0, 0x5 - bne _081C3354 -_081C333A: - movs r0, 0x1 - b _081C3356 - .pool -_081C3354: - movs r0, 0 -_081C3356: - pop {r1} - bx r1 - thumb_func_end sub_81C3304 - - thumb_func_start sub_81C335C -sub_81C335C: @ 81C335C - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x8 - ldr r0, =gUnknown_0861CCCC - movs r1, 0 - bl sub_81C2D2C - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gText_OTSlash - mov r8, r0 - movs r0, 0x1 - mov r1, r8 - movs r2, 0 - bl GetStringWidth - adds r5, r0, 0 - movs r0, 0 - mov r9, r0 - str r0, [sp] - movs r6, 0x1 - str r6, [sp, 0x4] - adds r0, r4, 0 - mov r1, r8 - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldr r1, =gText_FiveMarks - lsls r5, 24 - lsrs r5, 24 - mov r0, r9 - str r0, [sp] - str r6, [sp, 0x4] - adds r0, r4, 0 - adds r2, r5, 0 - movs r3, 0x1 - bl sub_81C25A4 - add sp, 0x8 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C335C - - thumb_func_start sub_81C33CC -sub_81C33CC: @ 81C33CC - push {r4,r5,lr} - sub sp, 0x8 - ldr r5, =gStringVar1 - ldr r1, =gText_UnkCtrlF907F908 - adds r0, r5, 0 - bl StringCopy - ldr r1, =gText_FiveMarks - adds r0, r5, 0 - bl StringAppend - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x38 - bl GetStringRightAlignXOffset - adds r4, r0, 0 - ldr r0, =gUnknown_0861CCCC - movs r1, 0x1 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsrs r4, 24 - movs r1, 0 - str r1, [sp] - movs r1, 0x1 - str r1, [sp, 0x4] - adds r1, r5, 0 - adds r2, r4, 0 - movs r3, 0x1 - bl sub_81C25A4 - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C33CC - - thumb_func_start sub_81C3428 -sub_81C3428: @ 81C3428 - push {r4,lr} - sub sp, 0x8 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r1, r0, 0 - adds r1, 0x70 - adds r0, 0xA5 - ldrb r0, [r0] - cmp r0, 0x1 - bne _081C3448 - ldr r4, =gText_EggWillTakeALongTime - b _081C346C - .pool -_081C3448: - ldrh r0, [r1, 0x30] - cmp r0, 0x5 - bhi _081C3458 - ldr r4, =gText_EggAboutToHatch - b _081C346C - .pool -_081C3458: - cmp r0, 0xA - bhi _081C3464 - ldr r4, =gText_EggWillHatchSoon - b _081C346C - .pool -_081C3464: - ldr r4, =gText_EggWillTakeALongTime - cmp r0, 0x28 - bhi _081C346C - ldr r4, =gText_EggWillTakeSomeTime -_081C346C: - ldr r0, =gUnknown_0861CCCC - movs r1, 0x2 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - str r1, [sp] - str r1, [sp, 0x4] - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C3428 - - thumb_func_start sub_81C349C -sub_81C349C: @ 81C349C - push {r4,lr} - sub sp, 0x8 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r4, r0, 0 - adds r4, 0x70 - adds r0, 0xA5 - ldrb r0, [r0] - cmp r0, 0x1 - beq _081C3500 - ldrb r0, [r4, 0x9] - cmp r0, 0xFF - bne _081C34C4 - ldr r4, =gText_PeculiarEggNicePlace - b _081C3502 - .pool -_081C34C4: - bl sub_81C32BC - lsls r0, 24 - cmp r0, 0 - beq _081C34D8 - bl sub_81C3220 - lsls r0, 24 - cmp r0, 0 - bne _081C34E0 -_081C34D8: - ldr r4, =gText_PeculiarEggTrade - b _081C3502 - .pool -_081C34E0: - ldrb r0, [r4, 0x9] - cmp r0, 0xFD - bne _081C3500 - bl sub_81C32E0 - lsls r0, 24 - lsrs r0, 24 - ldr r4, =gText_EggFromTraveler - cmp r0, 0x1 - bne _081C3502 - ldr r4, =gText_EggFromHotSprings - b _081C3502 - .pool -_081C3500: - ldr r4, =gText_OddEggFoundByCouple -_081C3502: - ldr r0, =gUnknown_0861CCCC - movs r1, 0x3 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - movs r1, 0 - str r1, [sp] - str r1, [sp, 0x4] - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x1 - bl sub_81C25A4 - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C349C - - thumb_func_start sub_81C3530 -sub_81C3530: @ 81C3530 - push {lr} - bl sub_81C35E4 - bl sub_81C3690 - bl sub_81C3710 - bl sub_81C37D8 - bl sub_81C3808 - bl sub_81C3890 - bl sub_81C38C0 - pop {r0} - bx r0 - thumb_func_end sub_81C3530 - - thumb_func_start sub_81C3554 -sub_81C3554: @ 81C3554 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - ldrh r0, [r4] - subs r0, 0x1 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - bhi _081C35D6 - lsls r0, 2 - ldr r1, =_081C3584 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081C3584: - .4byte _081C35A4 - .4byte _081C35AA - .4byte _081C35B0 - .4byte _081C35B6 - .4byte _081C35BC - .4byte _081C35C2 - .4byte _081C35C8 - .4byte _081C35CE -_081C35A4: - bl sub_81C35E4 - b _081C35D6 -_081C35AA: - bl sub_81C3690 - b _081C35D6 -_081C35B0: - bl sub_81C3710 - b _081C35D6 -_081C35B6: - bl sub_81C37D8 - b _081C35D6 -_081C35BC: - bl sub_81C3808 - b _081C35D6 -_081C35C2: - bl sub_81C3890 - b _081C35D6 -_081C35C8: - bl sub_81C38C0 - b _081C35D6 -_081C35CE: - adds r0, r2, 0 - bl DestroyTask - b _081C35DC -_081C35D6: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] -_081C35DC: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81C3554 - - thumb_func_start sub_81C35E4 -sub_81C35E4: @ 81C35E4 - push {r4,r5,lr} - sub sp, 0x8 - ldr r4, =gUnknown_0203CF1C - ldr r0, [r4] - adds r0, 0x9E - ldrh r0, [r0] - cmp r0, 0xAF - bne _081C3628 - bl sub_81B1250 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C3628 - ldr r0, [r4] - ldr r1, =0x000040be - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _081C3614 - cmp r0, 0x4 - beq _081C3614 - cmp r0, 0x5 - bne _081C3628 -_081C3614: - movs r0, 0xAF - bl ItemId_GetItem - adds r5, r0, 0 - b _081C3650 - .pool -_081C3628: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r1, r0, 0 - adds r1, 0x9E - ldrh r0, [r1] - cmp r0, 0 - bne _081C3644 - ldr r5, =gText_None - b _081C3650 - .pool -_081C3644: - ldrh r0, [r1] - ldr r4, =gStringVar1 - adds r1, r4, 0 - bl CopyItemName - adds r5, r4, 0 -_081C3650: - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x48 - bl GetStringCenterAlignXOffset - adds r4, r0, 0 - adds r4, 0x6 - ldr r0, =gUnknown_0861CCEC - movs r1, 0 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsrs r4, 24 - movs r1, 0 - str r1, [sp] - str r1, [sp, 0x4] - adds r1, r5, 0 - adds r2, r4, 0 - movs r3, 0x1 - bl sub_81C25A4 - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C35E4 - - thumb_func_start sub_81C3690 -sub_81C3690: @ 81C3690 - push {r4,r5,lr} - sub sp, 0x8 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r1, r0, 0 - adds r1, 0x76 - ldrb r0, [r1] - cmp r0, 0 - bne _081C36B0 - ldr r5, =gText_None - b _081C36C8 - .pool -_081C36B0: - ldr r0, =gStringVar1 - ldrb r1, [r1] - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar4 - ldr r1, =gText_RibbonsVar1 - adds r0, r4, 0 - bl StringExpandPlaceholders - adds r5, r4, 0 -_081C36C8: - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x46 - bl GetStringCenterAlignXOffset - adds r4, r0, 0 - adds r4, 0x6 - ldr r0, =gUnknown_0861CCEC - movs r1, 0x1 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - lsls r4, 24 - lsrs r4, 24 - movs r1, 0 - str r1, [sp] - str r1, [sp, 0x4] - adds r1, r5, 0 - adds r2, r4, 0 - movs r3, 0x1 - bl sub_81C25A4 - add sp, 0x8 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C3690 - - thumb_func_start sub_81C3710 -sub_81C3710: @ 81C3710 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - movs r0, 0x8 - bl Alloc - mov r9, r0 - movs r0, 0x8 - bl Alloc - mov r8, r0 - movs r0, 0x8 - bl Alloc - adds r6, r0, 0 - movs r0, 0x8 - bl Alloc - adds r5, r0, 0 - ldr r4, =gUnknown_0203CF1C - ldr r0, [r4] - adds r0, 0x90 - ldrh r1, [r0] - mov r0, r9 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r0, [r4] - adds r0, 0x92 - ldrh r1, [r0] - mov r0, r8 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r0, [r4] - adds r0, 0x94 - ldrh r1, [r0] - adds r0, r6, 0 - movs r2, 0x1 - movs r3, 0x7 - bl ConvertIntToDecimalStringN - ldr r0, [r4] - adds r0, 0x96 - ldrh r1, [r0] - adds r0, r5, 0 - movs r2, 0x1 - movs r3, 0x7 - bl ConvertIntToDecimalStringN - bl sub_81AFBF0 - movs r0, 0 - mov r1, r9 - bl sub_81AFC0C - movs r0, 0x1 - mov r1, r8 - bl sub_81AFC0C - movs r0, 0x2 - adds r1, r6, 0 - bl sub_81AFC0C - movs r0, 0x3 - adds r1, r5, 0 - bl sub_81AFC0C - ldr r0, =gStringVar4 - ldr r1, =gUnknown_0861CE82 - bl sub_81AFC28 - mov r0, r9 - bl Free - mov r0, r8 - bl Free - adds r0, r6, 0 - bl Free - adds r0, r5, 0 - bl Free - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C3710 - - thumb_func_start sub_81C37D8 -sub_81C37D8: @ 81C37D8 - push {lr} - sub sp, 0x8 - ldr r0, =gUnknown_0861CCEC - movs r1, 0x2 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gStringVar4 - movs r2, 0 - str r2, [sp] - str r2, [sp, 0x4] - movs r2, 0x4 - movs r3, 0x1 - bl sub_81C25A4 - add sp, 0x8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C37D8 - - thumb_func_start sub_81C3808 -sub_81C3808: @ 81C3808 - push {r4-r6,lr} - mov r6, r8 - push {r6} - ldr r0, =gStringVar1 - mov r8, r0 - ldr r4, =gUnknown_0203CF1C - ldr r0, [r4] - adds r0, 0x98 - ldrh r1, [r0] - mov r0, r8 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r6, =gStringVar2 - ldr r0, [r4] - adds r0, 0x9A - ldrh r1, [r0] - adds r0, r6, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r5, =gStringVar3 - ldr r0, [r4] - adds r0, 0x9C - ldrh r1, [r0] - adds r0, r5, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - bl sub_81AFBF0 - movs r0, 0 - mov r1, r8 - bl sub_81AFC0C - movs r0, 0x1 - adds r1, r6, 0 - bl sub_81AFC0C - movs r0, 0x2 - adds r1, r5, 0 - bl sub_81AFC0C - ldr r0, =gStringVar4 - ldr r1, =gUnknown_0861CE8E - bl sub_81AFC28 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C3808 - - thumb_func_start sub_81C3890 -sub_81C3890: @ 81C3890 - push {lr} - sub sp, 0x8 - ldr r0, =gUnknown_0861CCEC - movs r1, 0x3 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gStringVar4 - movs r2, 0 - str r2, [sp] - str r2, [sp, 0x4] - movs r2, 0x2 - movs r3, 0x1 - bl sub_81C25A4 - add sp, 0x8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C3890 - - thumb_func_start sub_81C38C0 -sub_81C38C0: @ 81C38C0 - push {r4-r6,lr} - sub sp, 0x8 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r5, r0, 0 - adds r5, 0x70 - ldr r0, =gUnknown_0861CCEC - movs r1, 0x4 - bl sub_81C2D2C - lsls r0, 24 - lsrs r6, r0, 24 - ldr r4, =gStringVar1 - ldr r1, [r5, 0x10] - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0x7 - bl ConvertIntToDecimalStringN - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x2A - bl GetStringRightAlignXOffset - adds r0, 0x2 - lsls r2, r0, 24 - lsrs r2, 24 - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - adds r0, r6, 0 - adds r1, r4, 0 - movs r3, 0x1 - bl sub_81C25A4 - ldrb r0, [r5, 0x5] - cmp r0, 0x63 - bhi _081C3948 - ldr r4, =gExperienceTables - adds r1, r0, 0 - adds r1, 0x1 - lsls r1, 2 - ldr r3, =gBaseStats - ldrh r2, [r5] - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r3 - ldrb r2, [r0, 0x13] - movs r0, 0xCA - lsls r0, 1 - muls r0, r2 - adds r1, r0 - adds r1, r4 - ldr r1, [r1] - ldr r0, [r5, 0x10] - subs r1, r0 - b _081C394A - .pool -_081C3948: - movs r1, 0 -_081C394A: - ldr r4, =gStringVar1 - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0x6 - bl ConvertIntToDecimalStringN - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x2A - bl GetStringRightAlignXOffset - adds r0, 0x2 - lsls r2, r0, 24 - lsrs r2, 24 - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - adds r0, r6, 0 - adds r1, r4, 0 - movs r3, 0x11 - bl sub_81C25A4 - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C38C0 - - thumb_func_start sub_81C3984 -sub_81C3984: @ 81C3984 - push {r4,lr} - movs r0, 0 - bl sub_81C3B08 - movs r0, 0x1 - bl sub_81C3B08 - movs r0, 0x2 - bl sub_81C3B08 - movs r0, 0x3 - bl sub_81C3B08 - ldr r4, =gUnknown_0203CF1C - ldr r0, [r4] - ldr r1, =0x000040bc - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C39EA - bl sub_81C3F44 - ldr r1, [r4] - ldr r0, =0x000040c6 - adds r2, r1, r0 - ldrb r0, [r2] - cmp r0, 0x4 - bne _081C39DC - ldr r0, =0x000040c4 - adds r1, r0 - ldrh r0, [r1] - cmp r0, 0 - beq _081C39EA - bl sub_81C3E9C - b _081C39EA - .pool -_081C39DC: - ldrb r0, [r2] - lsls r0, 1 - adds r1, 0x84 - adds r1, r0 - ldrh r0, [r1] - bl sub_81C3E9C -_081C39EA: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81C3984 - - thumb_func_start sub_81C39F0 -sub_81C39F0: @ 81C39F0 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - ldrh r0, [r4] - subs r0, 0x1 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x7 - bhi _081C3AFC - lsls r0, 2 - ldr r1, =_081C3A20 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081C3A20: - .4byte _081C3A40 - .4byte _081C3A48 - .4byte _081C3A50 - .4byte _081C3A58 - .4byte _081C3A60 - .4byte _081C3A7C - .4byte _081C3ABE - .4byte _081C3AF4 -_081C3A40: - movs r0, 0 - bl sub_81C3B08 - b _081C3AFC -_081C3A48: - movs r0, 0x1 - bl sub_81C3B08 - b _081C3AFC -_081C3A50: - movs r0, 0x2 - bl sub_81C3B08 - b _081C3AFC -_081C3A58: - movs r0, 0x3 - bl sub_81C3B08 - b _081C3AFC -_081C3A60: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040bc - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C3AFC - bl sub_81C3F44 - b _081C3AFC - .pool -_081C3A7C: - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - ldr r2, =0x000040bc - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C3AFC - ldr r0, =0x000040c6 - adds r2, r1, r0 - ldrb r0, [r2] - cmp r0, 0x4 - bne _081C3AB0 - ldr r2, =0x000040c4 - adds r0, r1, r2 - ldrh r0, [r0] - strh r0, [r4, 0x2] - b _081C3AFC - .pool -_081C3AB0: - ldrb r0, [r2] - lsls r0, 1 - adds r1, 0x84 - adds r1, r0 - ldrh r0, [r1] - strh r0, [r4, 0x2] - b _081C3AFC -_081C3ABE: - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - ldr r2, =0x000040bc - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C3AFC - adds r2, 0x8 - adds r0, r1, r2 - ldr r0, [r0] - ldr r1, =0x00ffffff - ands r0, r1 - movs r1, 0x80 - lsls r1, 11 - cmp r0, r1 - beq _081C3AFC - ldrh r0, [r4, 0x2] - bl sub_81C3E9C - b _081C3AFC - .pool -_081C3AF4: - adds r0, r2, 0 - bl DestroyTask - b _081C3B02 -_081C3AFC: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] -_081C3B02: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81C39F0 - - thumb_func_start sub_81C3B08 -sub_81C3B08: @ 81C3B08 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - lsls r0, 24 - lsrs r7, r0, 24 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - mov r10, r0 - ldr r4, =gUnknown_0861CD14 - adds r0, r4, 0 - movs r1, 0 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81C2D2C - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x8] - lsls r1, r7, 1 - mov r0, r10 - adds r0, 0x84 - adds r0, r1 - ldrh r5, [r0] - cmp r5, 0 - beq _081C3C00 - mov r0, r10 - adds r0, 0xA4 - ldrb r1, [r0] - adds r0, r5, 0 - adds r2, r7, 0 - bl CalculatePPWithBonus - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - movs r0, 0xD - adds r1, r5, 0 - muls r1, r0 - ldr r0, =gMoveNames - adds r1, r0 - lsls r0, r7, 4 - mov r9, r0 - mov r3, r9 - adds r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0 - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - mov r0, r8 - movs r2, 0 - bl sub_81C25A4 - ldr r0, =gStringVar1 - mov r8, r0 - mov r5, r10 - adds r5, 0x8C - adds r5, r7 - ldrb r1, [r5] - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalStringN - ldr r4, =gStringVar2 - adds r0, r4, 0 - adds r1, r6, 0 - movs r2, 0x1 - movs r3, 0x2 - bl ConvertIntToDecimalStringN - bl sub_81AFBF0 - movs r0, 0 - mov r1, r8 - bl sub_81AFC0C - movs r0, 0x1 - adds r1, r4, 0 - bl sub_81AFC0C - ldr r4, =gStringVar4 - ldr r1, =gUnknown_0861CE97 - adds r0, r4, 0 - bl sub_81AFC28 - adds r7, r4, 0 - ldrb r0, [r5] - adds r1, r6, 0 - bl sub_814FC20 - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - adds r5, 0x9 - movs r0, 0x1 - adds r1, r7, 0 - movs r2, 0x2C - bl GetStringRightAlignXOffset - mov r4, r9 - b _081C3C26 - .pool -_081C3C00: - ldr r1, =gText_OneDash - lsls r4, r7, 4 - adds r3, r4, 0x1 - lsls r3, 24 - lsrs r3, 24 - str r5, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - mov r0, r8 - movs r2, 0 - bl sub_81C25A4 - ldr r7, =gText_TwoDashes - movs r5, 0xC - movs r0, 0x1 - adds r1, r7, 0 - movs r2, 0x2C - bl GetStringCenterAlignXOffset -_081C3C26: - lsls r2, r0, 24 - lsrs r2, 24 - adds r3, r4, 0x1 - lsls r3, 24 - lsrs r3, 24 - movs r0, 0 - str r0, [sp] - lsls r0, r5, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - ldr r0, [sp, 0x8] - adds r1, r7, 0 - bl sub_81C25A4 - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C3B08 - - thumb_func_start sub_81C3C5C -sub_81C3C5C: @ 81C3C5C - push {r4-r6,lr} - sub sp, 0x8 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0 - beq _081C3CFC - movs r0, 0x13 - str r0, [sp] - movs r0, 0x20 - str r0, [sp, 0x4] - movs r0, 0xE - movs r1, 0 - movs r2, 0x35 - movs r3, 0 - bl FillWindowPixelRect - ldr r2, =gBattleMoves - lsls r1, r5, 1 - adds r0, r1, r5 - lsls r0, 2 - adds r2, r0, r2 - ldrb r0, [r2, 0x1] - adds r6, r1, 0 - cmp r0, 0x1 - bhi _081C3C9C - ldr r1, =gText_ThreeDashes - b _081C3CAC - .pool -_081C3C9C: - ldr r4, =gStringVar1 - ldrb r1, [r2, 0x1] - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - adds r1, r4, 0 -_081C3CAC: - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0xE - movs r2, 0x35 - movs r3, 0x1 - bl sub_81C25A4 - ldr r1, =gBattleMoves - adds r0, r6, r5 - lsls r0, 2 - adds r1, r0, r1 - ldrb r0, [r1, 0x3] - cmp r0, 0 - bne _081C3CDC - ldr r1, =gText_ThreeDashes - b _081C3CEC - .pool -_081C3CDC: - ldr r4, =gStringVar1 - ldrb r1, [r1, 0x3] - adds r0, r4, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - adds r1, r4, 0 -_081C3CEC: - movs r0, 0 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0xE - movs r2, 0x35 - movs r3, 0x11 - bl sub_81C25A4 -_081C3CFC: - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C3C5C - - thumb_func_start sub_81C3D08 -sub_81C3D08: @ 81C3D08 - push {r4,lr} - movs r0, 0 - bl sub_81C3B08 - movs r0, 0x1 - bl sub_81C3B08 - movs r0, 0x2 - bl sub_81C3B08 - movs r0, 0x3 - bl sub_81C3B08 - ldr r4, =gUnknown_0203CF1C - ldr r0, [r4] - ldr r1, =0x000040bc - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C3D40 - bl sub_81C3F44 - ldr r0, [r4] - ldr r1, =0x000040c6 - adds r0, r1 - ldrb r0, [r0] - bl sub_81C3E2C -_081C3D40: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C3D08 - - thumb_func_start sub_81C3D54 -sub_81C3D54: @ 81C3D54 - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - ldrh r0, [r4] - subs r0, 0x1 - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - bhi _081C3E20 - lsls r0, 2 - ldr r1, =_081C3D84 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081C3D84: - .4byte _081C3DA0 - .4byte _081C3DA8 - .4byte _081C3DB0 - .4byte _081C3DB8 - .4byte _081C3DC0 - .4byte _081C3DDC - .4byte _081C3E18 -_081C3DA0: - movs r0, 0 - bl sub_81C3B08 - b _081C3E20 -_081C3DA8: - movs r0, 0x1 - bl sub_81C3B08 - b _081C3E20 -_081C3DB0: - movs r0, 0x2 - bl sub_81C3B08 - b _081C3E20 -_081C3DB8: - movs r0, 0x3 - bl sub_81C3B08 - b _081C3E20 -_081C3DC0: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040bc - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C3E20 - bl sub_81C3F44 - b _081C3E20 - .pool -_081C3DDC: - ldr r0, =gUnknown_0203CF1C - ldr r2, [r0] - ldr r1, =0x000040bc - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0x3 - bne _081C3E20 - adds r1, 0x8 - adds r0, r2, r1 - ldr r0, [r0] - ldr r1, =0x00ffffff - ands r0, r1 - movs r1, 0x80 - lsls r1, 11 - cmp r0, r1 - beq _081C3E20 - ldr r1, =0x000040c6 - adds r0, r2, r1 - ldrb r0, [r0] - bl sub_81C3E2C - b _081C3E20 - .pool -_081C3E18: - adds r0, r2, 0 - bl DestroyTask - b _081C3E26 -_081C3E20: - ldrh r0, [r4] - adds r0, 0x1 - strh r0, [r4] -_081C3E26: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81C3D54 - thumb_func_start sub_81C3E2C sub_81C3E2C: @ 81C3E2C push {r4,lr} diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index 4c748073e9..a44102b4b8 100755 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -2,18 +2,41 @@ #include "battle.h" #include "bg.h" #include "decompress.h" +#include "item.h" +#include "items.h" +#include "link.h" #include "m4a.h" #include "main.h" #include "malloc.h" +#include "moves.h" #include "palette.h" #include "pokemon.h" #include "songs.h" #include "sound.h" +#include "species.h" #include "sprite.h" #include "string_util.h" #include "task.h" +#include "text.h" #include "window.h" +struct contestMove +{ + u8 effect; + u8 type; + u8 comboID; + u8 combo[4]; +}; + +struct contestEffect +{ + u8 type; + u8 appeal; + u8 jam; +}; + + + extern struct unkSummaryStruct* gUnknown_0203CF1C; extern struct BgTemplate gUnknown_0861CBB4; extern u8 gUnknown_0203CF20; @@ -27,6 +50,21 @@ extern struct unkStruct_61CC04 gUnknown_0861CC10; extern struct unkStruct_61CC04 gUnknown_0861CBEC; extern struct unkStruct_61CC04 gUnknown_0861CBF8; extern u16 gUnknown_08DC3CD4[]; +extern struct contestMove gContestMoves[]; +extern struct contestEffect gContestEffects[]; +extern struct WindowTemplate gUnknown_0861CC24; +extern struct TextColor gUnknown_0861CD2C[]; +extern const u8 gSpeciesNames[][POKEMON_NAME_LENGTH + 1]; +extern u8 gText_MaleSymbol[]; +extern u8 gText_FemaleSymbol[]; +extern u8 gUnknown_0861CDD3[]; +extern void (*const gUnknown_0861CE54[])(); +extern void (*const gUnknown_0861CE64[])(u8 taskId); +extern struct WindowTemplate gUnknown_0861CCCC; +extern u8 gUnknown_0861CE74[]; +extern u8 gUnknown_0861CE7B[]; +extern struct WindowTemplate gUnknown_0861CCEC; +extern struct WindowTemplate gUnknown_0861CD14; extern void sub_806F2AC(u8 a, u8 b); void sub_81C488C(u8 a); @@ -61,9 +99,81 @@ extern void decompress_and_copy_tile_data_to_vram(u8 a, void* tiledata, u8 b, u8 extern u8 free_temp_tile_data_buffers_if_possible(); extern void sub_8069004(struct BoxPokemon* a, void* b); extern void sub_81C1E20(u8 taskId); +extern u8 *GetMonNickname(struct Pokemon *mon, u8 *dest); +extern u16 SpeciesToPokedexNum(u16 species); +extern u8 gText_UnkCtrlF908Clear01[]; +extern u8 gText_LevelSymbol[]; +extern u8 gText_PkmnInfo[]; +extern u8 gText_PkmnSkills[]; +extern u8 gText_BattleMoves[]; +extern u8 gText_ContestMoves[]; +extern u8 gText_Cancel2[]; +extern u8 gText_Info[]; +extern u8 gText_Switch[]; +extern u8 gText_RentalPkmn[]; +extern u8 gText_TypeSlash[]; +extern u8 gText_HP4[]; +extern u8 gText_Attack3[]; +extern u8 gText_Defense3[]; +extern u8 gText_SpAtk4[]; +extern u8 gText_SpDef4[]; +extern u8 gText_Speed2[]; +extern u8 gText_ExpPoints[]; +extern u8 gText_NextLv[]; +extern u8 gText_Status[]; +extern u8 gText_Power[]; +extern u8 gText_Accuracy2[]; +extern u8 gText_Appeal[]; +extern u8 gText_Jam[]; +extern u8 gText_OTSlash[]; +extern u8 gText_UnkCtrlF907F908[]; +extern u8 gAbilityNames[][13]; +extern u8 *gAbilityDescriptionPointers[]; +extern u8 gText_XNature[]; +extern u8 gText_XNatureHatchedAtYZ[]; +extern u8 gText_XNatureHatchedSomewhereAt[]; +extern u8 gText_XNatureMetAtYZ[]; +extern u8 gText_XNatureMetSomewhereAt[]; +extern u8 gText_XNatureFatefulEncounter[]; +extern u8 gText_XNatureProbablyMetAt[]; +extern u8 gText_XNatureObtainedInTrade[]; +extern u8 *gNatureNamePointers[]; +extern u8 gText_EmptyString5[]; +extern u32 gBattleTypeFlags; +extern u8 gText_FiveMarks[]; +extern u8 gText_EggWillTakeALongTime[]; +extern u8 gText_EggAboutToHatch[]; +extern u8 gText_EggWillHatchSoon[]; +extern u8 gText_EggWillTakeSomeTime[]; +extern u8 gText_PeculiarEggNicePlace[]; +extern u8 gText_PeculiarEggTrade[]; +extern u8 gText_EggFromTraveler[]; +extern u8 gText_EggFromHotSprings[]; +extern u8 gText_OddEggFoundByCouple[]; +extern u8 gText_None[]; +extern u8 gText_RibbonsVar1[]; +extern u8 gUnknown_0861CE82[]; +extern u8 gUnknown_0861CE8E[]; +extern u8 gMoveNames[][13]; +extern u8 gText_OneDash[]; +extern u8 gText_TwoDashes[]; +extern u8 gText_ThreeDashes[]; +extern u8 gUnknown_0861CE97[]; +extern struct BattleMove gBattleMoves[]; extern u32 ChangeBgX(u8 bg, u32 value, u8 op); extern void sub_8199C30(u8 a, u8 b, u8 c, u8 d, u8 e, u8 f); +extern void AddTextPrinterParametrized2(u8 windowId, u8 fontId, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, struct TextColor* colors, s8 speed, u8 *str); +extern s32 GetStringCenterAlignXOffset(u8 fontId, u8 *str, s32 totalWidth); +extern s32 GetStringRightAlignXOffset(u8 fontId, u8 *str, s32 totalWidth); +extern u8 sub_81A6BF4(); +extern u8 sub_81B9E94(); +extern void sub_81AFBF0(); +extern u8 sub_81AFC0C(u8 a, u8 *b); +extern void sub_81AFC28(u8 *a, u8 *b); +extern void sub_8124610(u8 *a, u8 b); +extern int sub_80F0020(); +extern u8 sub_814FC20(u8 a, u8 b); void sub_81BFAE4(void); void sub_81BFE24(); @@ -111,7 +221,7 @@ void sub_81C20F0(u8 taskId); bool8 sub_81C0A50(struct Pokemon* mon); void sub_81C49E0(); void sub_81C0E24(); -void sub_81C2C38(); +void sub_81C2C38(u8 a); void sub_81C0B8C(u8 taskId); void sub_81C0CC4(u8 taskId); void sub_81C2DE4(u8 a); @@ -144,6 +254,34 @@ u8 sub_81B6D14(u16 a); void sub_81C1940(u8 taskId); void sub_81C4154(); void sub_81C1F80(u8 taskId); +void sub_81C2628(); +void sub_81C2794(); +void sub_81C27DC(struct Pokemon *mon, u16 a); +void sub_81C2D68(u8 a); +void sub_81C335C(); +void sub_81C33CC(); +void sub_81C3428(); +void sub_81C349C(); +void sub_81C2EC4(); +void sub_81C2F5C(); +void sub_81C2FD8(); +void sub_81C302C(); +void sub_81C307C(); +void sub_81C3194(); +void sub_81C31C0(); +u8 sub_81C3304(); +void sub_81C31F0(u8 *a); +u8 sub_81C3220(); +u8 sub_81C32BC(); +void sub_81C35E4(); +void sub_81C3690(); +void sub_81C3710(); +void sub_81C37D8(); +void sub_81C3808(); +void sub_81C3890(); +void sub_81C38C0(); +void sub_81C3B08(u8 a); +void sub_81C3E2C(u8 a); void SetBgAttribute(u8 bg, u8 attributeId, u8 value); @@ -221,7 +359,8 @@ struct unkSummaryStruct u8 unk40C7; u8 unk40C8; u8 unk40C9; - u8 unk_filler2[0x9]; + u8 unk40CA; + u8 unk40CB[8]; u8 unk40D3; u8 unk40D4; u8 unk40D5; @@ -2326,4 +2465,1217 @@ void sub_81C228C(u8 a) else sub_8199C30(3, 1, 4, 8, 8, 5); schedule_bg_copy_tilemap_to_vram(3); +} + +void sub_81C22CC(struct Pokemon *unused) +{ + s64 r6r7; + struct pokeSummary *summary = &gUnknown_0203CF1C->summary; + u16 *r9; + u8 i; + + if (summary->level < MAX_MON_LEVEL) + { + u32 r1 = gExperienceTables[gBaseStats[summary->species].growthRate][summary->level + 1] - gExperienceTables[gBaseStats[summary->species].growthRate][summary->level]; + u32 r4 = summary->exp - gExperienceTables[gBaseStats[summary->species].growthRate][summary->level]; + + r6r7 = r4 * 64 / r1; + if (r6r7 == 0 && r4 != 0) + r6r7 = 1; + } + else + { + r6r7 = 0; + } + + r9 = &gUnknown_0203CF1C->unkTilemap1_1[0x255]; + for (i = 0; i < 8; i++) + { + if (r6r7 > 7) + r9[i] = 0x206A; + else + r9[i] = 0x2062 + (r6r7 % 8); + r6r7 -= 8; + if (r6r7 < 0) + r6r7 = 0; + } + + if (GetBgTilemapBuffer(1) == gUnknown_0203CF1C->unkTilemap1) + schedule_bg_copy_tilemap_to_vram(1); + else + schedule_bg_copy_tilemap_to_vram(2); +} + +void sub_81C240C(u16 move) +{ + u16* r5 = &gUnknown_0203CF1C->unkTilemap3_1[0]; + u8 i; + u8 r4; + if (move != MOVE_NONE) + { + r4 = gContestEffects[gContestMoves[move].effect].appeal; + if (r4 != 0xFF) + r4 /= 10; + for (i = 0;i < 8; i++) + { + if (r4 != 0xFF && i < r4) + { + r5[((i>>2)*32)+(i&3)+0x1E6] = 0x103A; + } + else + r5[((i>>2)*32)+(i&3)+0x1E6] = 0x1039; + } + r4 = gContestEffects[gContestMoves[move].effect].jam; + if (r4 != 0xFF) + r4 /= 10; + for (i = 0;i < 8; i++) + { + if (r4 != 0xFF && i < r4) + { + r5[((i>>2)*32)+(i&3)+0x226] = 0x103C; + } + else + r5[((i>>2)*32)+(i&3)+0x226] = 0x103D; + } + } +} + +void sub_81C2524() +{ + if (gUnknown_0203CF1C->summary.isEgg != 0) + ChangeBgX(3, 0x10000, 0); + else + ChangeBgX(3, 0, 0); +} + +void sub_81C2554() +{ + u8 i; + InitWindows(&gUnknown_0861CC24); + DeactivateAllTextPrinters(); + for (i = 0; i < 20; i++) + FillWindowPixelBuffer(i, 0); + for (i = 0; i < 8; i++) + gUnknown_0203CF1C->unk40CB[i] |= 0xFF; +} + +void sub_81C25A4(u8 a, u8 *b, u8 c, u8 d, u8 e, u8 f) +{ + AddTextPrinterParametrized2(a, 1, c, d, 0, e, &gUnknown_0861CD2C[f], 0, b); +} + +void sub_81C25E8() +{ + FillWindowPixelBuffer(17, 0); + FillWindowPixelBuffer(18, 0); + FillWindowPixelBuffer(19, 0); + if (gUnknown_0203CF1C->summary.isEgg == 0) + sub_81C2628(); + else + sub_81C2794(); + schedule_bg_copy_tilemap_to_vram(0); +} + +void sub_81C2628() +{ + u8 strArray[16]; + struct Pokemon *mon = &gUnknown_0203CF1C->currentPoke; + struct pokeSummary *summary = &gUnknown_0203CF1C->summary; + u16 r5 = SpeciesToPokedexNum(summary->species); + if (r5 != 0xFFFF) + { + StringCopy(gStringVar1, &gText_UnkCtrlF908Clear01[0]); + ConvertIntToDecimalStringN(gStringVar2, r5, 2, 3); + StringAppend(gStringVar1, gStringVar2); + if (IsMonShiny(mon) == 0) + { + sub_81C25A4(17, gStringVar1, 0, 1, 0, 1); + sub_81C228C(0); + } + else + { + sub_81C25A4(17, gStringVar1, 0, 1, 0, 7); + sub_81C228C(1); + } + PutWindowTilemap(17); + } + else + { + ClearWindowTilemap(17); + if (IsMonShiny(mon) == 0) + sub_81C228C(0); + else + sub_81C228C(1); + } + StringCopy(gStringVar1, &gText_LevelSymbol[0]); + ConvertIntToDecimalStringN(gStringVar2, summary->level, 0, 3); + StringAppend(gStringVar1, gStringVar2); + sub_81C25A4(19, gStringVar1, 0x18, 17, 0, 1); + GetMonNickname(mon, gStringVar1); + sub_81C25A4(18, gStringVar1, 0, 1, 0, 1); + strArray[0] = CHAR_SLASH; + StringCopy(&strArray[1], &gSpeciesNames[summary->species2][0]); + sub_81C25A4(19, &strArray[0], 0, 1, 0, 1); + sub_81C27DC(mon, summary->species2); + PutWindowTilemap(18); + PutWindowTilemap(19); +} + +void sub_81C2794() +{ + GetMonNickname(&gUnknown_0203CF1C->currentPoke, gStringVar1); + sub_81C25A4(18, gStringVar1, 0, 1, 0, 1); + PutWindowTilemap(18); + ClearWindowTilemap(17); + ClearWindowTilemap(19); +} + +void sub_81C27DC(struct Pokemon *mon, u16 a) +{ + if (a != SPECIES_NIDORAN_M && a != SPECIES_NIDORAN_F) + { + u8 gender = GetMonGender(mon); + switch (gender) + { + case 0: + sub_81C25A4(0x13, &gText_MaleSymbol[0], 0x39, 17, 0, 3); + break; + case 0xFE: + sub_81C25A4(0x13, &gText_FemaleSymbol[0], 0x39, 17, 0, 4); + break; + } + } +} + +void sub_81C2838(u8 a, u8 b, u32 c) +{ + BlitBitmapToWindow(a, (b) ? &gUnknown_0861CDD3[0] : &gUnknown_0861CDD3[0] - 0x80, c, 0, 16, 16); +} + +void sub_81C286C() +{ + int r4; + int r2; + int temp; + sub_81C25A4(0, gText_PkmnInfo, 2, 1, 0, 1); + sub_81C25A4(1, gText_PkmnSkills, 2, 1, 0, 1); + sub_81C25A4(2, gText_BattleMoves, 2, 1, 0, 1); + sub_81C25A4(3, gText_ContestMoves, 2, 1, 0, 1); + r4 = GetStringRightAlignXOffset(1, gText_Cancel2, 0x3E); + r2 = r4 - 16; + if (r2 < 0) + r2 = 0; + sub_81C2838(4, 0, r2); + sub_81C25A4(4, gText_Cancel2, r4, 1, 0, 0); + r4 = GetStringRightAlignXOffset(1, gText_Info, 0x3E); + r2 = r4 - 16; + if (r2 < 0) + r2 = 0; + sub_81C2838(5, 0, r2); + sub_81C25A4(5, gText_Info, r4, 1, 0, 0); + r4 = GetStringRightAlignXOffset(1, gText_Switch, 0x3E); + r2 = r4 - 16; + if (r2 < 0) + r2 = 0; + sub_81C2838(6, 0, r2); + sub_81C25A4(6, gText_Switch, r4, 1, 0, 0); + sub_81C25A4(8, gText_RentalPkmn, 0, 1, 0, 1); + sub_81C25A4(9, gText_TypeSlash, 0, 1, 0, 0); + temp = 6; + temp += GetStringCenterAlignXOffset(1, gText_HP4, 42); + sub_81C25A4(10, gText_HP4, temp, 1, 0, 1); + temp = 6; + temp += GetStringCenterAlignXOffset(1, gText_Attack3, 42); + sub_81C25A4(10, gText_Attack3, temp, 17, 0, 1); + temp = 6; + temp += GetStringCenterAlignXOffset(1, gText_Defense3, 42); + sub_81C25A4(10, gText_Defense3, temp, 33, 0, 1); + temp = 2; + temp += GetStringCenterAlignXOffset(1, gText_SpAtk4, 36); + sub_81C25A4(11, gText_SpAtk4, temp, 1, 0, 1); + temp = 2; + temp += GetStringCenterAlignXOffset(1, gText_SpDef4, 36); + sub_81C25A4(11, gText_SpDef4, temp, 17, 0, 1); + temp = 2; + temp += GetStringCenterAlignXOffset(1, gText_Speed2, 36); + sub_81C25A4(11, gText_Speed2, temp, 33, 0, 1); + sub_81C25A4(12, gText_ExpPoints, 6, 1, 0, 1); + sub_81C25A4(12, gText_NextLv, 6, 17, 0, 1); + sub_81C25A4(13, gText_Status, 2, 1, 0, 1); + sub_81C25A4(14, gText_Power, 0, 1, 0, 1); + sub_81C25A4(14, gText_Accuracy2, 0, 17, 0, 1); + sub_81C25A4(15, gText_Appeal, 0, 1, 0, 1); + sub_81C25A4(15, gText_Jam, 0, 17, 0, 1); +} + +void sub_81C2AFC(u8 a) +{ + u8 i; + ClearWindowTilemap(0); + ClearWindowTilemap(1); + ClearWindowTilemap(2); + ClearWindowTilemap(3); + switch (a) + { + case 0: + PutWindowTilemap(0); + PutWindowTilemap(4); + if (sub_81A6BF4() == 1 || sub_81B9E94() == 1) + PutWindowTilemap(8); + PutWindowTilemap(9); + break; + case 1: + PutWindowTilemap(1); + PutWindowTilemap(10); + PutWindowTilemap(11); + PutWindowTilemap(12); + break; + case 2: + PutWindowTilemap(2); + if (gUnknown_0203CF1C->unk40BC == 3) + { + if(!(gUnknown_0203CF1C->unk40C4 == 0 && gUnknown_0203CF1C->unk40C6 == 4)) + PutWindowTilemap(14); + } + else + PutWindowTilemap(5); + break; + case 3: + PutWindowTilemap(3); + if (gUnknown_0203CF1C->unk40BC == 3) + { + if(!(gUnknown_0203CF1C->unk40C4 == 0 && gUnknown_0203CF1C->unk40C6 == 4)) + PutWindowTilemap(15); + } + else + PutWindowTilemap(5); + break; + } + for (i = 0; i < 8; i++) + { + PutWindowTilemap(gUnknown_0203CF1C->unk40CB[i]); + } + schedule_bg_copy_tilemap_to_vram(0); +} + +void sub_81C2C38(u8 a) +{ + u8 i; + switch (a) + { + case 0: + ClearWindowTilemap(4); + if (sub_81A6BF4() == 1 || sub_81B9E94() == 1) + ClearWindowTilemap(8); + ClearWindowTilemap(9); + break; + case 1: + ClearWindowTilemap(10); + ClearWindowTilemap(11); + ClearWindowTilemap(12); + break; + case 2: + if (gUnknown_0203CF1C->unk40BC == 3) + { + if(!(gUnknown_0203CF1C->unk40C4 == 0 && gUnknown_0203CF1C->unk40C6 == 4)) + ClearWindowTilemap(14); + } + else + ClearWindowTilemap(5); + break; + case 3: + if (gUnknown_0203CF1C->unk40BC == 3) + { + if(!(gUnknown_0203CF1C->unk40C4 == 0 && gUnknown_0203CF1C->unk40C6 == 4)) + ClearWindowTilemap(15); + } + else + ClearWindowTilemap(5); + break; + } + for (i = 0; i < 8; i++) + sub_81C2D68(i); + schedule_bg_copy_tilemap_to_vram(0); +} + + + +#ifdef NONMATCHING +u8 sub_81C2D2C(struct WindowTemplate *template, u8 a) +{ + u8 *r4 = gUnknown_0203CF1C->unk40CB; + if (r4[a] == 0xFF) + { + r4[a] = AddWindow(&template[a]); + FillWindowPixelBuffer(r4[a], 0); + } + return r4[a]; +} +#else +__attribute__((naked)) +u8 sub_81C2D2C(struct WindowTemplate *template, u8 a) +{ + asm(".syntax unified\n\ + push {r4,lr}\n\ + adds r3, r0, 0\n\ + lsls r1, 24\n\ + lsrs r2, r1, 24\n\ + ldr r0, =gUnknown_0203CF1C\n\ + ldr r4, =0x000040cb\n\ + adds r1, r2, r4\n\ + ldr r0, [r0]\n\ + adds r4, r0, r1\n\ + ldrb r0, [r4]\n\ + cmp r0, 0xFF\n\ + bne _081C2D56\n\ + lsls r0, r2, 3\n\ + adds r0, r3, r0\n\ + bl AddWindow\n\ + strb r0, [r4]\n\ + ldrb r0, [r4]\n\ + movs r1, 0\n\ + bl FillWindowPixelBuffer\n\ +_081C2D56:\n\ + ldrb r0, [r4]\n\ + pop {r4}\n\ + pop {r1}\n\ + bx r1\n\ + .pool\n\ + .syntax divided\n"); +} +#endif + +#ifdef NONMATCHING +void sub_81C2D68(u8 a) +{ + u8 *r4 = gUnknown_0203CF1C->unk40CB; + if (r4[a] != 0xFF) + { + ClearWindowTilemap(r4[a]); + RemoveWindow(r4[a]); + r4[a] = 0xFF; + } +} +#else +__attribute__((naked)) +void sub_81C2D68(u8 a) +{ + asm(".syntax unified\n\ + push {r4,lr}\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + ldr r1, =gUnknown_0203CF1C\n\ + ldr r2, =0x000040cb\n\ + adds r0, r2\n\ + ldr r1, [r1]\n\ + adds r4, r1, r0\n\ + ldrb r0, [r4]\n\ + cmp r0, 0xFF\n\ + beq _081C2D8C\n\ + bl ClearWindowTilemap\n\ + ldrb r0, [r4]\n\ + bl RemoveWindow\n\ + movs r0, 0xFF\n\ + strb r0, [r4]\n\ +_081C2D8C:\n\ + pop {r4}\n\ + pop {r0}\n\ + bx r0\n\ + .pool\n\ + .syntax divided\n"); +} +#endif + +void sub_81C2D9C(u8 a) +{ + u16 i; + for (i = 0; i < 8; i++) + { + if (gUnknown_0203CF1C->unk40CB[i] != 0xFF) + FillWindowPixelBuffer(gUnknown_0203CF1C->unk40CB[i], 0); + } + gUnknown_0861CE54[a](); +} + +void sub_81C2DE4(u8 a) +{ + CreateTask(gUnknown_0861CE64[a], 16); +} + +void sub_81C2E00() +{ + if (gUnknown_0203CF1C->summary.isEgg) + { + sub_81C335C(); + sub_81C33CC(); + sub_81C3428(); + sub_81C349C(); + } + else + { + sub_81C2EC4(); + sub_81C2F5C(); + sub_81C2FD8(); + sub_81C302C(); + sub_81C307C(); + sub_81C3194(); + } +} + +void sub_81C2E40(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + s16 dataa = data[0] - 1; + switch (dataa) + { + case 0: + sub_81C2EC4(); + break; + case 1: + sub_81C2F5C(); + break; + case 2: + sub_81C2FD8(); + break; + case 3: + sub_81C302C(); + break; + case 4: + sub_81C307C(); + break; + case 5: + sub_81C3194(); + break; + case 6: + DestroyTask(taskId); + return; + } + data[0]++; +} + +void sub_81C2EC4() +{ + u8 r5; + int r2; + if (sub_81A6BF4() != 1 && sub_81B9E94() != 1) + { + r5 = sub_81C2D2C(&gUnknown_0861CCCC, 0); + sub_81C25A4(r5, gText_OTSlash, 0, 1, 0, 1); + r2 = GetStringWidth(1, gText_OTSlash, 0); + if (gUnknown_0203CF1C->summary.OTGender == 0) + sub_81C25A4(r5, gUnknown_0203CF1C->summary.OTName, r2, 1, 0, 5); + else + sub_81C25A4(r5, gUnknown_0203CF1C->summary.OTName, r2, 1, 0, 6); + } +} + +void sub_81C2F5C() +{ + int r4; + if (sub_81A6BF4() != 1 && sub_81B9E94() != 1) + { + ConvertIntToDecimalStringN(StringCopy(gStringVar1, gText_UnkCtrlF907F908), (u16)gUnknown_0203CF1C->summary.OTID, 2, 5); + r4 = GetStringRightAlignXOffset(1, gStringVar1, 0x38); + sub_81C25A4(sub_81C2D2C(&gUnknown_0861CCCC, 1), gStringVar1, r4, 1, 0, 1); + } +} + +void sub_81C2FD8() +{ + u8 ability = GetAbilityBySpecies(gUnknown_0203CF1C->summary.species, gUnknown_0203CF1C->summary.altability); + sub_81C25A4(sub_81C2D2C(&gUnknown_0861CCCC, 2), gAbilityNames[ability], 0, 1, 0, 1); +} + +void sub_81C302C() +{ + u8 ability = GetAbilityBySpecies(gUnknown_0203CF1C->summary.species, gUnknown_0203CF1C->summary.altability); + sub_81C25A4(sub_81C2D2C(&gUnknown_0861CCCC, 2), gAbilityDescriptionPointers[ability], 0, 17, 0, 0); +} + +void sub_81C307C() +{ + struct pokeSummary *sum = &gUnknown_0203CF1C->summary; + u8 *text; + sub_81AFBF0(); + sub_81AFC0C(0, gUnknown_0861CE74); + sub_81AFC0C(1, gUnknown_0861CE7B); + sub_81C31C0(); + if (sub_81A6BF4() == 1 || sub_81B9E94() == 1 || sub_81C3304() == 1) + sub_81AFC28(gStringVar4, gText_XNature); + else + { + u8 *alloced1 = Alloc(32); + u8 *alloced2 = Alloc(32); + sub_81C31F0(alloced1); + if (sum->metLocation <= 0xD4) + { + sub_8124610(alloced2, sum->metLocation); + sub_81AFC0C(4, alloced2); + } + if (sub_81C3220() == 1) + { + if (sum->metLevel == 0) + text = (sum->metLocation > 0xD4) ? gText_XNatureHatchedSomewhereAt : gText_XNatureHatchedAtYZ; + else + text = (sum->metLocation > 0xD4) ? gText_XNatureMetSomewhereAt : gText_XNatureMetAtYZ; + } + else if (sum->metLocation == 0xFF) + text = gText_XNatureFatefulEncounter; + else if (sum->metLocation != 0xFE && sub_81C32BC()) + text = (sum->metLocation > 0xD4) ? gText_XNatureObtainedInTrade : gText_XNatureProbablyMetAt; + else + text = gText_XNatureObtainedInTrade; + sub_81AFC28(gStringVar4, text); + Free(alloced1); + Free(alloced2); + } +} + +void sub_81C3194() +{ + sub_81C25A4(sub_81C2D2C(&gUnknown_0861CCCC, 3), gStringVar4, 0, 1, 0, 0); +} + +void sub_81C31C0() +{ + struct unkSummaryStruct *sumStruct = gUnknown_0203CF1C; + sub_81AFC0C(2, gNatureNamePointers[sumStruct->summary.nature]); + sub_81AFC0C(5, gText_EmptyString5); +} + +void sub_81C31F0(u8 *a) +{ + u8 level = gUnknown_0203CF1C->summary.metLevel; + if (level == 0) + level = 5; + ConvertIntToDecimalStringN(a, level, 0, 3); + sub_81AFC0C(3, a); +} + +u8 sub_81C3220() +{ + struct pokeSummary *sum = &gUnknown_0203CF1C->summary; + u32 r4; + u8 r5; + if (gUnknown_0203CF1C->unk0 == (union unkUnion *)&gEnemyParty) + { + u8 multiID = GetMultiplayerId()^1; + r4 = (u16)gLinkPlayers[multiID].trainerId; + r5 = gLinkPlayers[multiID].gender; + StringCopy(gStringVar1, gLinkPlayers[multiID].name); + } + else + { + r4 = sub_80F0020() & 0xFFFF; + r5 = gSaveBlock2Ptr->playerGender; + StringCopy(gStringVar1, gSaveBlock2Ptr->playerName); + } + if (r5 != sum->OTGender || r4 != (sum->OTID & 0xFFFF) || StringCompareWithoutExtCtrlCodes(gStringVar1, sum->OTName)) + { + return 0; + } + return 1; +} + +u8 sub_81C32BC() +{ + struct pokeSummary *sum = &gUnknown_0203CF1C->summary; + u8 r0 = sum->metGame - 1; + if (r0 <= 4) + return 1; + return 0; +} + +u8 sub_81C32E0() +{ + struct pokeSummary *sum = &gUnknown_0203CF1C->summary; + u8 r0 = sum->metGame - 1; + if (r0 <= 2) + return 1; + return 0; +} + +u8 sub_81C3304() +{ + if ((gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER) && gMain.inBattle) + { + if (gUnknown_0203CF1C->unk40BE == 1 || gUnknown_0203CF1C->unk40BE == 4 || gUnknown_0203CF1C->unk40BE == 5) + return 1; + } + return 0; +} + +#ifdef NONMATCHING +void sub_81C335C() +{ + u8 r4 = sub_81C2D2C(&gUnknown_0861CCCC, 0); + u32 r5 = GetStringWidth(1, gText_OTSlash, 0); + sub_81C25A4(r4, gText_OTSlash, 0, 1, 0, 1); + sub_81C25A4(r4, gText_FiveMarks, r5, 1, 0, 1); +} +#else +__attribute__((naked)) +void sub_81C335C() +{ + asm(".syntax unified\n\ + push {r4-r6,lr}\n\ + mov r6, r9\n\ + mov r5, r8\n\ + push {r5,r6}\n\ + sub sp, 0x8\n\ + ldr r0, =gUnknown_0861CCCC\n\ + movs r1, 0\n\ + bl sub_81C2D2C\n\ + adds r4, r0, 0\n\ + lsls r4, 24\n\ + lsrs r4, 24\n\ + ldr r0, =gText_OTSlash\n\ + mov r8, r0\n\ + movs r0, 0x1\n\ + mov r1, r8\n\ + movs r2, 0\n\ + bl GetStringWidth\n\ + adds r5, r0, 0\n\ + movs r0, 0\n\ + mov r9, r0\n\ + str r0, [sp]\n\ + movs r6, 0x1\n\ + str r6, [sp, 0x4]\n\ + adds r0, r4, 0\n\ + mov r1, r8\n\ + movs r2, 0\n\ + movs r3, 0x1\n\ + bl sub_81C25A4\n\ + ldr r1, =gText_FiveMarks\n\ + lsls r5, 24\n\ + lsrs r5, 24\n\ + mov r0, r9\n\ + str r0, [sp]\n\ + str r6, [sp, 0x4]\n\ + adds r0, r4, 0\n\ + adds r2, r5, 0\n\ + movs r3, 0x1\n\ + bl sub_81C25A4\n\ + add sp, 0x8\n\ + pop {r3,r4}\n\ + mov r8, r3\n\ + mov r9, r4\n\ + pop {r4-r6}\n\ + pop {r0}\n\ + bx r0\n\ + .pool\n\ + .syntax divided\n"); +} +#endif + +void sub_81C33CC() +{ + int r4; + StringCopy(gStringVar1, gText_UnkCtrlF907F908); + StringAppend(gStringVar1, gText_FiveMarks); + r4 = GetStringRightAlignXOffset(1, gStringVar1, 0x38); + sub_81C25A4(sub_81C2D2C(&gUnknown_0861CCCC, 1), gStringVar1, r4, 1, 0, 1); +} + +void sub_81C3428() +{ + u8 *text; + struct pokeSummary *sum = &gUnknown_0203CF1C->summary; + if (gUnknown_0203CF1C->summary.sanity == 1) + text = gText_EggWillTakeALongTime; + else if (sum->friendship <= 5) + text = gText_EggAboutToHatch; + else if (sum->friendship <= 10) + text = gText_EggWillHatchSoon; + else if (sum->friendship <= 40) + text = gText_EggWillTakeSomeTime; + else + text = gText_EggWillTakeALongTime; + sub_81C25A4(sub_81C2D2C(&gUnknown_0861CCCC, 2), text, 0, 1, 0, 0); +} + +void sub_81C349C() +{ + u8 *text; + struct pokeSummary *sum = &gUnknown_0203CF1C->summary; + if (gUnknown_0203CF1C->summary.sanity != 1) + { + if (sum->metLocation == 0xFF) + text = gText_PeculiarEggNicePlace; + else if (sub_81C32BC() == 0 || sub_81C3220() == 0) + text = gText_PeculiarEggTrade; + else if (sum->metLocation == 0xFD) + text = (sub_81C32E0() == 1) ? gText_EggFromHotSprings : gText_EggFromTraveler; + else + text = gText_OddEggFoundByCouple; + } + else + text = gText_OddEggFoundByCouple; + sub_81C25A4(sub_81C2D2C(&gUnknown_0861CCCC, 3), text, 0, 1, 0, 0); +} + +void sub_81C3530() +{ + sub_81C35E4(); + sub_81C3690(); + sub_81C3710(); + sub_81C37D8(); + sub_81C3808(); + sub_81C3890(); + sub_81C38C0(); +} + +void sub_81C3554(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + s16 dataa = data[0] - 1; + switch (dataa) + { + case 0: + sub_81C35E4(); + break; + case 1: + sub_81C3690(); + break; + case 2: + sub_81C3710(); + break; + case 3: + sub_81C37D8(); + break; + case 4: + sub_81C3808(); + break; + case 5: + sub_81C3890(); + break; + case 6: + sub_81C38C0(); + break; + case 7: + DestroyTask(taskId); + return; + } + data[0]++; +} + +void sub_81C35E4() +{ + u8 *text; + int offset; + if (gUnknown_0203CF1C->summary.item == ITEM_ENIGMA_BERRY && sub_81B1250() == 1 && (gUnknown_0203CF1C->unk40BE == 1 || gUnknown_0203CF1C->unk40BE == 4 || gUnknown_0203CF1C->unk40BE == 5)) + { + text = (u8*)ItemId_GetItem(ITEM_ENIGMA_BERRY); + } + else if (gUnknown_0203CF1C->summary.item == ITEM_NONE) + text = gText_None; + else + { + CopyItemName(gUnknown_0203CF1C->summary.item, gStringVar1); + text = gStringVar1; + } + offset = GetStringCenterAlignXOffset(1, text, 0x48) + 6; + sub_81C25A4(sub_81C2D2C(&gUnknown_0861CCEC, 0), text, offset, 1, 0, 0); +} + +void sub_81C3690() +{ + u8 *text; + int offset; + if (gUnknown_0203CF1C->summary.ribbons == 0) + text = gText_None; + else + { + ConvertIntToDecimalStringN(gStringVar1, gUnknown_0203CF1C->summary.ribbons, 1, 2); + StringExpandPlaceholders(gStringVar4, gText_RibbonsVar1); + text = gStringVar4; + } + offset = GetStringCenterAlignXOffset(1, text, 0x46) + 6; + sub_81C25A4(sub_81C2D2C(&gUnknown_0861CCEC, 1), text, offset, 1, 0, 0); +} + +void sub_81C3710() +{ + u8 *alloced1 = Alloc(8); + u8 *alloced2 = Alloc(8); + u8 *alloced3 = Alloc(8); + u8 *alloced4 = Alloc(8); + ConvertIntToDecimalStringN(alloced1, gUnknown_0203CF1C->summary.currentHP, 1, 3); + ConvertIntToDecimalStringN(alloced2, gUnknown_0203CF1C->summary.maxHP, 1, 3); + ConvertIntToDecimalStringN(alloced3, gUnknown_0203CF1C->summary.atk, 1, 7); + ConvertIntToDecimalStringN(alloced4, gUnknown_0203CF1C->summary.def, 1, 7); + sub_81AFBF0(); + sub_81AFC0C(0, alloced1); + sub_81AFC0C(1, alloced2); + sub_81AFC0C(2, alloced3); + sub_81AFC0C(3, alloced4); + sub_81AFC28(gStringVar4, gUnknown_0861CE82); + Free(alloced1); + Free(alloced2); + Free(alloced3); + Free(alloced4); +} + +void sub_81C37D8() +{ + sub_81C25A4(sub_81C2D2C(&gUnknown_0861CCEC, 2), gStringVar4, 4, 1, 0, 0); +} + +void sub_81C3808() +{ + ConvertIntToDecimalStringN(gStringVar1, gUnknown_0203CF1C->summary.spatk, 1, 3); + ConvertIntToDecimalStringN(gStringVar2, gUnknown_0203CF1C->summary.spdef, 1, 3); + ConvertIntToDecimalStringN(gStringVar3, gUnknown_0203CF1C->summary.speed, 1, 3); + sub_81AFBF0(); + sub_81AFC0C(0, gStringVar1); + sub_81AFC0C(1, gStringVar2); + sub_81AFC0C(2, gStringVar3); + sub_81AFC28(gStringVar4, gUnknown_0861CE8E); +} + +void sub_81C3890() +{ + sub_81C25A4(sub_81C2D2C(&gUnknown_0861CCEC, 3), gStringVar4, 2, 1, 0, 0); +} + +void sub_81C38C0() +{ + struct pokeSummary *sum = &gUnknown_0203CF1C->summary; + u8 r6 = sub_81C2D2C(&gUnknown_0861CCEC, 4); + int offset; + u32 expToNextLevel; + ConvertIntToDecimalStringN(gStringVar1, sum->exp, 1, 7); + offset = GetStringRightAlignXOffset(1, gStringVar1, 0x2A) + 2; + sub_81C25A4(r6, gStringVar1, offset, 1, 0, 0); + if (sum->level < MAX_MON_LEVEL) + expToNextLevel = gExperienceTables[gBaseStats[sum->species].growthRate][sum->level + 1] - sum->exp; + else + expToNextLevel = 0; + ConvertIntToDecimalStringN(gStringVar1, expToNextLevel, 1, 6); + offset = GetStringRightAlignXOffset(1, gStringVar1, 0x2A) + 2; + sub_81C25A4(r6, gStringVar1, offset, 17, 0, 0); +} + +void sub_81C3984() +{ + sub_81C3B08(0); + sub_81C3B08(1); + sub_81C3B08(2); + sub_81C3B08(3); + if (gUnknown_0203CF1C->unk40BC == 3) + { + sub_81C3F44(); + if (gUnknown_0203CF1C->unk40C6 == 4) + { + if (gUnknown_0203CF1C->unk40C4 != 0) + sub_81C3E9C(gUnknown_0203CF1C->unk40C4); + } + else + sub_81C3E9C(gUnknown_0203CF1C->summary.moves[gUnknown_0203CF1C->unk40C6]); + } +} + +void sub_81C39F0(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + s16 dataa = data[0] - 1; + + switch (dataa) + { + case 0: + sub_81C3B08(0); + break; + case 1: + sub_81C3B08(1); + break; + case 2: + sub_81C3B08(2); + break; + case 3: + sub_81C3B08(3); + break; + case 4: + if (gUnknown_0203CF1C->unk40BC == 3) + sub_81C3F44(); + break; + case 5: + if (gUnknown_0203CF1C->unk40BC == 3) + { + if (gUnknown_0203CF1C->unk40C6 == 4) + data[1] = gUnknown_0203CF1C->unk40C4; + else + data[1] = gUnknown_0203CF1C->summary.moves[gUnknown_0203CF1C->unk40C6]; + } + break; + case 6: + if (gUnknown_0203CF1C->unk40BC == 3) + { + if (!(gUnknown_0203CF1C->unk40C4 == 0 && gUnknown_0203CF1C->unk40C6 == 4)) + sub_81C3E9C(data[1]); + } + break; + case 7: + DestroyTask(taskId); + return; + } + data[0]++; +} + +#ifdef NONMATCHING +void sub_81C3B08(u8 a) +{ + struct unkSummaryStruct *r10 = gUnknown_0203CF1C; + u8 r8 = sub_81C2D2C(&gUnknown_0861CD14, 0); + u8 sp = sub_81C2D2C(&gUnknown_0861CD14, 1); + u8 r6; + u8 r5; + u8 *text; + int offset; + u16 move; + if (r10->summary.moves[a] != 0) + { + move = r10->summary.moves[a]; + r6 = CalculatePPWithBonus(move, r10->summary.ppBonuses, a); + sub_81C25A4(r8, gMoveNames[move], 0, (a<<4) + 1, 0, 1); + ConvertIntToDecimalStringN(gStringVar1, r10->summary.pp[a], 1, 2); + ConvertIntToDecimalStringN(gStringVar2, r6, 1, 2); + sub_81AFBF0(); + sub_81AFC0C(0, gStringVar1); + sub_81AFC0C(1, gStringVar2); + sub_81AFC28(gStringVar4, gUnknown_0861CE97); + text = gStringVar4; + r5 = sub_814FC20(r10->summary.pp[a], r6) + 9; + offset = GetStringRightAlignXOffset(1, text, 0x2C); + } + else + { + sub_81C25A4(r8, gText_OneDash, 0, (a<<4) + 1, 0, 1); + text = gText_TwoDashes; + r5 = 12; + offset = GetStringCenterAlignXOffset(1, text, 0x2C); + } + sub_81C25A4(sp, text, offset, (a<<4), 0, r5); +} +#else +__attribute__((naked)) +void sub_81C3B08(u8 a) +{ + asm(".syntax unified\n\ + push {r4-r7,lr}\n\ + mov r7, r10\n\ + mov r6, r9\n\ + mov r5, r8\n\ + push {r5-r7}\n\ + sub sp, 0xC\n\ + lsls r0, 24\n\ + lsrs r7, r0, 24\n\ + ldr r0, =gUnknown_0203CF1C\n\ + ldr r0, [r0]\n\ + mov r10, r0\n\ + ldr r4, =gUnknown_0861CD14\n\ + adds r0, r4, 0\n\ + movs r1, 0\n\ + bl sub_81C2D2C\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + mov r8, r0\n\ + adds r0, r4, 0\n\ + movs r1, 0x1\n\ + bl sub_81C2D2C\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + str r0, [sp, 0x8]\n\ + lsls r1, r7, 1\n\ + mov r0, r10\n\ + adds r0, 0x84\n\ + adds r0, r1\n\ + ldrh r5, [r0]\n\ + cmp r5, 0\n\ + beq _081C3C00\n\ + mov r0, r10\n\ + adds r0, 0xA4\n\ + ldrb r1, [r0]\n\ + adds r0, r5, 0\n\ + adds r2, r7, 0\n\ + bl CalculatePPWithBonus\n\ + adds r6, r0, 0\n\ + lsls r6, 24\n\ + lsrs r6, 24\n\ + movs r0, 0xD\n\ + adds r1, r5, 0\n\ + muls r1, r0\n\ + ldr r0, =gMoveNames\n\ + adds r1, r0\n\ + lsls r0, r7, 4\n\ + mov r9, r0\n\ + mov r3, r9\n\ + adds r3, 0x1\n\ + lsls r3, 24\n\ + lsrs r3, 24\n\ + movs r0, 0\n\ + str r0, [sp]\n\ + movs r0, 0x1\n\ + str r0, [sp, 0x4]\n\ + mov r0, r8\n\ + movs r2, 0\n\ + bl sub_81C25A4\n\ + ldr r0, =gStringVar1\n\ + mov r8, r0\n\ + mov r5, r10\n\ + adds r5, 0x8C\n\ + adds r5, r7\n\ + ldrb r1, [r5]\n\ + movs r2, 0x1\n\ + movs r3, 0x2\n\ + bl ConvertIntToDecimalStringN\n\ + ldr r4, =gStringVar2\n\ + adds r0, r4, 0\n\ + adds r1, r6, 0\n\ + movs r2, 0x1\n\ + movs r3, 0x2\n\ + bl ConvertIntToDecimalStringN\n\ + bl sub_81AFBF0\n\ + movs r0, 0\n\ + mov r1, r8\n\ + bl sub_81AFC0C\n\ + movs r0, 0x1\n\ + adds r1, r4, 0\n\ + bl sub_81AFC0C\n\ + ldr r4, =gStringVar4\n\ + ldr r1, =gUnknown_0861CE97\n\ + adds r0, r4, 0\n\ + bl sub_81AFC28\n\ + adds r7, r4, 0\n\ + ldrb r0, [r5]\n\ + adds r1, r6, 0\n\ + bl sub_814FC20\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + adds r5, r0, 0\n\ + adds r5, 0x9\n\ + movs r0, 0x1\n\ + adds r1, r7, 0\n\ + movs r2, 0x2C\n\ + bl GetStringRightAlignXOffset\n\ + mov r4, r9\n\ + b _081C3C26\n\ + .pool\n\ +_081C3C00:\n\ + ldr r1, =gText_OneDash\n\ + lsls r4, r7, 4\n\ + adds r3, r4, 0x1\n\ + lsls r3, 24\n\ + lsrs r3, 24\n\ + str r5, [sp]\n\ + movs r0, 0x1\n\ + str r0, [sp, 0x4]\n\ + mov r0, r8\n\ + movs r2, 0\n\ + bl sub_81C25A4\n\ + ldr r7, =gText_TwoDashes\n\ + movs r5, 0xC\n\ + movs r0, 0x1\n\ + adds r1, r7, 0\n\ + movs r2, 0x2C\n\ + bl GetStringCenterAlignXOffset\n\ +_081C3C26:\n\ + lsls r2, r0, 24\n\ + lsrs r2, 24\n\ + adds r3, r4, 0x1\n\ + lsls r3, 24\n\ + lsrs r3, 24\n\ + movs r0, 0\n\ + str r0, [sp]\n\ + lsls r0, r5, 24\n\ + lsrs r0, 24\n\ + str r0, [sp, 0x4]\n\ + ldr r0, [sp, 0x8]\n\ + adds r1, r7, 0\n\ + bl sub_81C25A4\n\ + add sp, 0xC\n\ + pop {r3-r5}\n\ + mov r8, r3\n\ + mov r9, r4\n\ + mov r10, r5\n\ + pop {r4-r7}\n\ + pop {r0}\n\ + bx r0\n\ + .pool\n\ + .syntax divided\n"); +} +#endif + +void sub_81C3C5C(u16 move) +{ + u8 *text; + if (move != 0) + { + FillWindowPixelRect(14, 0, 0x35, 0, 0x13, 0x20); + if (gBattleMoves[move].power <= 1) + text = gText_ThreeDashes; + else + { + ConvertIntToDecimalStringN(gStringVar1, gBattleMoves[move].power, 1, 3); + text = gStringVar1; + } + sub_81C25A4(14, text, 0x35, 1, 0, 0); + if (gBattleMoves[move].accuracy == 0) + text = gText_ThreeDashes; + else + { + ConvertIntToDecimalStringN(gStringVar1, gBattleMoves[move].accuracy, 1, 3); + text = gStringVar1; + } + sub_81C25A4(14, text, 0x35, 17, 0, 0); + } +} + +void sub_81C3D08() +{ + sub_81C3B08(0); + sub_81C3B08(1); + sub_81C3B08(2); + sub_81C3B08(3); + if (gUnknown_0203CF1C->unk40BC == 3) + { + sub_81C3F44(); + sub_81C3E2C(gUnknown_0203CF1C->unk40C6); + } +} + +void sub_81C3D54(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + s16 dataa = data[0] - 1; + + switch (dataa) + { + case 0: + sub_81C3B08(0); + break; + case 1: + sub_81C3B08(1); + break; + case 2: + sub_81C3B08(2); + break; + case 3: + sub_81C3B08(3); + break; + case 4: + if (gUnknown_0203CF1C->unk40BC == 3) + sub_81C3F44(); + break; + case 5: + if (gUnknown_0203CF1C->unk40BC == 3) + { + if (!(gUnknown_0203CF1C->unk40C4 == 0 && gUnknown_0203CF1C->unk40C6 == 4)) + sub_81C3E2C(gUnknown_0203CF1C->unk40C6); + } + break; + case 6: + DestroyTask(taskId); + return; + } + data[0]++; } \ No newline at end of file