diff --git a/asm/code_801EE10_1.s b/asm/code_801EE10_1.s index beedcfd3..7d5c77ec 100644 --- a/asm/code_801EE10_1.s +++ b/asm/code_801EE10_1.s @@ -151,1188 +151,4 @@ _08023854: bx r0 .align 2, 0 _08023864: .4byte gUnknown_3001B5C - thumb_func_end sub_80237E0 - - thumb_func_start sub_8023868 -sub_8023868: - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - adds r5, r0, 0 - mov r8, r1 - mov r9, r2 - mov r10, r3 - bl sub_8024108 - lsls r0, 24 - cmp r0, 0 - beq _08023888 - movs r0, 0 - b _08023A6E -_08023888: - ldr r4, _080238AC - ldr r0, [r4] - cmp r0, 0 - bne _0802389C - movs r0, 0xFE - lsls r0, 2 - movs r1, 0x8 - bl MemoryAlloc - str r0, [r4] -_0802389C: - ldr r1, [r4] - str r5, [r1] - ldr r0, _080238B0 - ldr r0, [r0] - cmp r0, r5 - beq _080238B4 - movs r0, 0x1 - b _080238B8 - .align 2, 0 -_080238AC: .4byte gUnknown_3001B60 -_080238B0: .4byte gUnknown_203B2A0 -_080238B4: - ldr r0, _080238E4 - ldr r0, [r0] -_080238B8: - str r0, [r1, 0x4] - ldr r2, _080238E8 - ldr r0, [r2] - movs r1, 0 - strb r1, [r0, 0x14] - ldr r0, [r2] - strb r1, [r0, 0x15] - ldr r0, [r2] - strb r1, [r0, 0x16] - ldr r0, [r2] - strb r1, [r0, 0x17] - ldr r0, [r2] - strb r1, [r0, 0x18] - ldr r0, [r2] - ldr r0, [r0] - cmp r0, 0x4 - bhi _08023980 - lsls r0, 2 - ldr r1, _080238EC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .align 2, 0 -_080238E4: .4byte gUnknown_203B2A4 -_080238E8: .4byte gUnknown_3001B60 -_080238EC: .4byte _080238F0 - .align 2, 0 -_080238F0: - .4byte _08023958 - .4byte _08023904 - .4byte _08023914 - .4byte _08023924 - .4byte _0802393C -_08023904: - ldr r0, _08023910 - ldr r1, [r0] - movs r0, 0x1 - strb r0, [r1, 0x18] - b _08023958 - .align 2, 0 -_08023910: .4byte gUnknown_3001B60 -_08023914: - ldr r0, _08023920 - ldr r1, [r0] - movs r0, 0x1 - strb r0, [r1, 0x14] - b _08023958 - .align 2, 0 -_08023920: .4byte gUnknown_3001B60 -_08023924: - ldr r2, _08023938 - ldr r0, [r2] - movs r1, 0x1 - strb r1, [r0, 0x17] - ldr r0, [r2] - strb r1, [r0, 0x15] - ldr r0, [r2] - strb r1, [r0, 0x16] - b _08023958 - .align 2, 0 -_08023938: .4byte gUnknown_3001B60 -_0802393C: - ldr r5, _0802397C - ldr r0, [r5] - movs r4, 0x1 - strb r4, [r0, 0x18] - ldr r0, [r5] - strb r4, [r0, 0x15] - movs r0, 0x9 - bl sub_80023E4 - lsls r0, 24 - cmp r0, 0 - bne _08023958 - ldr r0, [r5] - strb r4, [r0, 0x16] -_08023958: - ldr r4, _0802397C - ldr r0, [r4] - ldr r0, [r0] - cmp r0, 0x4 - bne _08023980 - bl sub_80A5728 - lsls r0, 16 - asrs r0, 16 - bl sub_8002658 - ldr r1, [r4] - movs r2, 0xD5 - lsls r2, 2 - adds r1, r2 - strb r0, [r1] - b _0802398E - .align 2, 0 -_0802397C: .4byte gUnknown_3001B60 -_08023980: - ldr r0, _08023A7C - ldr r0, [r0] - movs r3, 0xD5 - lsls r3, 2 - adds r0, r3 - movs r1, 0 - strb r1, [r0] -_0802398E: - ldr r5, _08023A7C - ldr r0, [r5] - movs r4, 0xE3 - lsls r4, 2 - adds r1, r0, r4 - mov r2, r8 - str r2, [r1] - movs r7, 0xE4 - lsls r7, 2 - adds r2, r0, r7 - mov r3, r8 - lsls r1, r3, 1 - add r1, r8 - lsls r1, 3 - movs r6, 0xE5 - lsls r6, 2 - adds r1, r6 - adds r1, r0, r1 - str r1, [r2] - adds r0, r6 - bl sub_8006518 - ldr r1, [r5] - adds r4, r1, r4 - ldr r2, [r4] - lsls r0, r2, 1 - adds r0, r2 - lsls r0, 3 - adds r1, r0 - adds r1, r6 - ldr r0, _08023A80 - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldm r0!, {r2-r4} - stm r1!, {r2-r4} - ldr r2, [r5] - adds r0, r2, r7 - ldr r1, [r0] - movs r4, 0xFD - lsls r4, 2 - adds r0, r2, r4 - str r0, [r1, 0x14] - mov r0, r9 - cmp r0, 0 - beq _08023A04 - movs r1, 0xE3 - lsls r1, 2 - adds r0, r2, r1 - ldr r1, [r0] - lsls r0, r1, 1 - adds r0, r1 - lsls r0, 3 - movs r3, 0xE7 - lsls r3, 2 - adds r1, r2, r3 - adds r1, r0 - mov r4, r9 - ldr r0, [r4] - str r0, [r1] -_08023A04: - ldr r0, [r5] - adds r0, r7 - ldr r0, [r0] - mov r1, r10 - bl sub_8012D08 - bl ResetUnusedInputStruct - ldr r0, [r5] - adds r0, r6 - movs r1, 0x1 - movs r2, 0x1 - bl sub_800641C - ldr r4, [r5] - movs r0, 0xD6 - lsls r0, 2 - adds r4, r0 - bl sub_8023F8C - adds r1, r0, 0 - adds r0, r4, 0 - mov r2, r10 - mov r3, r8 - bl sub_8013818 - ldr r0, _08023A84 - ldr r4, [r5] - ldr r1, [r0] - ldr r0, [r4] - cmp r1, r0 - bne _08023A64 - ldr r0, _08023A88 - ldrh r1, [r0] - movs r2, 0xDC - lsls r2, 2 - adds r0, r4, r2 - strh r1, [r0] - ldr r0, _08023A8C - ldrh r1, [r0] - ldr r3, _08023A90 - adds r0, r4, r3 - strh r1, [r0] - movs r1, 0xD6 - lsls r1, 2 - adds r0, r4, r1 - bl sub_8013984 -_08023A64: - bl sub_8023CF4 - bl sub_8023DA4 - movs r0, 0x1 -_08023A6E: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .align 2, 0 -_08023A7C: .4byte gUnknown_3001B60 -_08023A80: .4byte gUnknown_80DC968 -_08023A84: .4byte gUnknown_203B2A0 -_08023A88: .4byte gUnknown_203B2A8 -_08023A8C: .4byte gUnknown_203B2AA -_08023A90: .4byte 0x00000376 - thumb_func_end sub_8023868 - - thumb_func_start sub_8023A94 -sub_8023A94: - push {r4,lr} - lsls r0, 24 - cmp r0, 0 - bne _08023AB4 - ldr r0, _08023AB0 - ldr r0, [r0] - movs r1, 0xD6 - lsls r1, 2 - adds r0, r1 - bl sub_8013660 - movs r0, 0 - b _08023B3E - .align 2, 0 -_08023AB0: .4byte gUnknown_3001B60 -_08023AB4: - ldr r4, _08023AD0 - ldr r0, [r4] - movs r1, 0xD6 - lsls r1, 2 - adds r0, r1 - bl GetKeyPress - cmp r0, 0x2 - beq _08023ADE - cmp r0, 0x2 - bgt _08023AD4 - cmp r0, 0x1 - beq _08023AF2 - b _08023B16 - .align 2, 0 -_08023AD0: .4byte gUnknown_3001B60 -_08023AD4: - cmp r0, 0x3 - beq _08023AFC - cmp r0, 0x4 - beq _08023AE8 - b _08023B16 -_08023ADE: - movs r0, 0x1 - bl PlayMenuSoundEffect - movs r0, 0x2 - b _08023B3E -_08023AE8: - movs r0, 0x4 - bl PlayMenuSoundEffect - movs r0, 0x4 - b _08023B3E -_08023AF2: - movs r0, 0 - bl PlayMenuSoundEffect - movs r0, 0x3 - b _08023B3E -_08023AFC: - movs r0, 0x5 - bl PlayMenuSoundEffect - ldr r0, [r4] - ldr r1, [r0, 0x4] - movs r2, 0x1 - cmp r1, 0x2 - bhi _08023B0E - adds r2, r1, 0x1 -_08023B0E: - str r2, [r0, 0x4] - bl sub_8023F8C - b _08023B34 -_08023B16: - ldr r0, _08023B30 - ldr r0, [r0] - movs r1, 0xD6 - lsls r1, 2 - adds r0, r1 - movs r1, 0x1 - bl sub_80138B8 - lsls r0, 24 - cmp r0, 0 - bne _08023B34 - movs r0, 0 - b _08023B3E - .align 2, 0 -_08023B30: .4byte gUnknown_3001B60 -_08023B34: - bl sub_8023CF4 - bl sub_8023DA4 - movs r0, 0x1 -_08023B3E: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8023A94 - - thumb_func_start sub_8023B44 -sub_8023B44: - ldr r0, _08023B74 - ldr r0, [r0] - ldr r2, _08023B78 - adds r1, r0, r2 - movs r3, 0 - ldrsh r2, [r1, r3] - movs r3, 0xDD - lsls r3, 2 - adds r1, r0, r3 - movs r3, 0 - ldrsh r1, [r1, r3] - muls r1, r2 - movs r3, 0xDC - lsls r3, 2 - adds r2, r0, r3 - movs r3, 0 - ldrsh r2, [r2, r3] - adds r1, r2 - lsls r1, 1 - adds r0, 0x1A - adds r0, r1 - movs r1, 0 - ldrsh r0, [r0, r1] - bx lr - .align 2, 0 -_08023B74: .4byte gUnknown_3001B60 -_08023B78: .4byte 0x00000376 - thumb_func_end sub_8023B44 - - thumb_func_start sub_8023B7C -sub_8023B7C: - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl ResetUnusedInputStruct - ldr r5, _08023BD0 - ldr r0, [r5] - movs r1, 0xE5 - lsls r1, 2 - adds r0, r1 - movs r1, 0 - movs r2, 0 - bl sub_800641C - bl sub_8023BD8 - adds r2, r0, 0 - ldr r0, [r5] - ldr r3, _08023BD4 - adds r1, r0, r3 - strh r2, [r1] - movs r1, 0xD6 - lsls r1, 2 - adds r0, r1 - bl sub_8013984 - bl sub_8023CF4 - bl sub_8023DA4 - cmp r4, 0 - beq _08023BCA - ldr r0, [r5] - movs r3, 0xD6 - lsls r3, 2 - adds r0, r3 - bl AddMenuCursorSprite -_08023BCA: - pop {r4,r5} - pop {r0} - bx r0 - .align 2, 0 -_08023BD0: .4byte gUnknown_3001B60 -_08023BD4: .4byte 0x0000037a - thumb_func_end sub_8023B7C - - thumb_func_start sub_8023BD8 -sub_8023BD8: - push {r4-r7,lr} - mov r7, r8 - push {r7} - movs r3, 0 - ldr r1, _08023C58 - ldr r0, [r1] - ldr r0, [r0, 0x8] - adds r7, r1, 0 - cmp r3, r0 - bge _08023C4A - ldr r0, _08023C5C - mov r8, r0 - mov r12, r7 -_08023BF2: - ldr r2, [r1] - lsls r4, r3, 1 - adds r0, r2, 0 - adds r0, 0x1A - adds r0, r4 - movs r5, 0 - ldrsh r1, [r0, r5] - movs r0, 0x58 - muls r0, r1 - mov r5, r8 - ldr r1, [r5] - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x1 - ands r0, r1 - adds r6, r3, 0x1 - cmp r0, 0 - bne _08023C3E - ldr r0, [r2, 0x8] - subs r0, 0x1 - str r0, [r2, 0x8] - cmp r3, r0 - bge _08023C3E - mov r5, r12 - adds r4, 0x2 -_08023C24: - ldr r2, [r5] - lsls r1, r3, 1 - adds r0, r2, 0 - adds r0, 0x1A - adds r1, r0, r1 - adds r0, r4 - ldrh r0, [r0] - strh r0, [r1] - adds r4, 0x2 - adds r3, 0x1 - ldr r0, [r2, 0x8] - cmp r3, r0 - blt _08023C24 -_08023C3E: - adds r3, r6, 0 - adds r1, r7, 0 - ldr r0, [r7] - ldr r0, [r0, 0x8] - cmp r3, r0 - blt _08023BF2 -_08023C4A: - ldr r0, [r7] - ldr r0, [r0, 0x8] - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .align 2, 0 -_08023C58: .4byte gUnknown_3001B60 -_08023C5C: .4byte gRecruitedPokemonRef - thumb_func_end sub_8023BD8 - - thumb_func_start sub_8023C60 -sub_8023C60: - push {r4-r6,lr} - ldr r5, _08023CCC - ldr r2, [r5] - cmp r2, 0 - beq _08023CC6 - ldr r1, _08023CD0 - ldr r0, [r2] - str r0, [r1] - ldr r1, _08023CD4 - ldr r0, [r2, 0x4] - str r0, [r1] - ldr r1, _08023CD8 - movs r3, 0xDC - lsls r3, 2 - adds r0, r2, r3 - ldrh r0, [r0] - strh r0, [r1] - ldr r1, _08023CDC - ldr r6, _08023CE0 - adds r0, r2, r6 - ldrh r0, [r0] - strh r0, [r1] - movs r1, 0xE3 - lsls r1, 2 - adds r0, r2, r1 - ldr r0, [r0] - lsls r1, r0, 1 - adds r1, r0 - lsls r1, 3 - adds r1, r2, r1 - movs r4, 0xE5 - lsls r4, 2 - adds r1, r4 - ldr r0, _08023CE4 - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - bl ResetUnusedInputStruct - ldr r0, [r5] - adds r0, r4 - movs r1, 0x1 - movs r2, 0x1 - bl sub_800641C - ldr r0, [r5] - bl MemoryFree - movs r0, 0 - str r0, [r5] -_08023CC6: - pop {r4-r6} - pop {r0} - bx r0 - .align 2, 0 -_08023CCC: .4byte gUnknown_3001B60 -_08023CD0: .4byte gUnknown_203B2A0 -_08023CD4: .4byte gUnknown_203B2A4 -_08023CD8: .4byte gUnknown_203B2A8 -_08023CDC: .4byte gUnknown_203B2AA -_08023CE0: .4byte 0x00000376 -_08023CE4: .4byte gUnknown_80DC950 - thumb_func_end sub_8023C60 - - thumb_func_start sub_8023CE8 -sub_8023CE8: - ldr r0, _08023CF0 - ldr r0, [r0] - bx lr - .align 2, 0 -_08023CF0: .4byte gUnknown_3001B60 - thumb_func_end sub_8023CE8 - - thumb_func_start sub_8023CF4 -sub_8023CF4: - push {r4,r5,lr} - ldr r2, _08023D28 - ldr r0, [r2] - movs r1, 0xFD - lsls r1, 2 - adds r0, r1 - movs r3, 0 - movs r1, 0x1 - strb r1, [r0] - ldr r0, [r2] - ldr r1, _08023D2C - adds r0, r1 - strb r3, [r0] - ldr r0, [r2] - adds r1, 0x2 - adds r0, r1 - strb r3, [r0] - ldr r1, [r2] - ldr r0, [r1] - adds r5, r2, 0 - cmp r0, 0x2 - bne _08023D34 - ldr r0, _08023D30 - adds r1, r0 - b _08023D38 - .align 2, 0 -_08023D28: .4byte gUnknown_3001B60 -_08023D2C: .4byte 0x000003f5 -_08023D30: .4byte 0x000003f6 -_08023D34: - ldr r2, _08023D98 - adds r1, r2 -_08023D38: - movs r0, 0xC - strb r0, [r1] - ldr r0, [r5] - ldr r1, _08023D9C - adds r0, r1 - movs r2, 0 - ldrsh r0, [r0, r2] - movs r1, 0xC - bl sub_80095E4 - adds r0, 0x2 - ldr r3, [r5] - movs r1, 0xE3 - lsls r1, 2 - adds r4, r3, r1 - ldr r2, [r4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 3 - adds r1, r3, r1 - ldr r2, _08023DA0 - adds r1, r2 - lsls r0, 16 - lsrs r0, 16 - strh r0, [r1] - ldr r2, [r4] - lsls r1, r2, 1 - adds r1, r2 - lsls r1, 3 - adds r3, r1 - movs r1, 0xE9 - lsls r1, 2 - adds r3, r1 - strh r0, [r3] - bl ResetUnusedInputStruct - ldr r0, [r5] - movs r2, 0xE5 - lsls r2, 2 - adds r0, r2 - movs r1, 0x1 - movs r2, 0x1 - bl sub_800641C - pop {r4,r5} - pop {r0} - bx r0 - .align 2, 0 -_08023D98: .4byte 0x000003f6 -_08023D9C: .4byte 0x00000372 -_08023DA0: .4byte 0x000003a2 - thumb_func_end sub_8023CF4 - - thumb_func_start sub_8023DA4 -sub_8023DA4: - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x58 - ldr r4, _08023DD8 - ldr r0, [r4] - movs r5, 0xE3 - lsls r5, 2 - adds r0, r5 - ldr r0, [r0] - bl sub_8008C54 - ldr r0, [r4] - adds r0, r5 - ldr r0, [r0] - bl sub_80073B8 - ldr r0, [r4] - ldr r1, [r0] - cmp r1, 0x2 - beq _08023DE0 - cmp r1, 0x4 - beq _08023E00 - ldr r2, _08023DDC - b _08023E02 - .align 2, 0 -_08023DD8: .4byte gUnknown_3001B60 -_08023DDC: .4byte gUnknown_80DC988 -_08023DE0: - add r0, sp, 0x8 - bl sub_80920D8 - ldr r0, [r4] - movs r1, 0xE3 - lsls r1, 2 - adds r0, r1 - ldr r3, [r0] - movs r0, 0 - str r0, [sp] - movs r0, 0xA - movs r1, 0 - add r2, sp, 0x8 - bl xxx_call_draw_string - b _08023E3C -_08023E00: - ldr r2, _08023EBC -_08023E02: - adds r0, r5 - ldr r3, [r0] - movs r0, 0 - str r0, [sp] - movs r0, 0xA - movs r1, 0 - bl xxx_call_draw_string - ldr r1, [r4] - ldr r2, _08023EC0 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 3 - adds r3, r0, 0x4 - ldr r4, _08023EC4 - adds r0, r1, r4 - movs r4, 0 - ldrsh r2, [r0, r4] - adds r2, 0x1 - movs r0, 0x7 - str r0, [sp] - adds r1, r5 - ldr r0, [r1] - str r0, [sp, 0x4] - adds r0, r3, 0 - movs r1, 0 - movs r3, 0x2 - bl sub_8012BC4 -_08023E3C: - movs r7, 0 - ldr r1, _08023EC8 - ldr r0, [r1] - ldr r2, _08023ECC - adds r0, r2 - movs r4, 0 - ldrsh r0, [r0, r4] - cmp r7, r0 - blt _08023E50 - b _08023F62 -_08023E50: - mov r8, r1 - add r0, sp, 0x30 - mov r9, r0 -_08023E56: - ldr r3, [r1] - ldr r1, _08023EC4 - adds r0, r3, r1 - movs r2, 0 - ldrsh r1, [r0, r2] - movs r4, 0xDD - lsls r4, 2 - adds r0, r3, r4 - movs r2, 0 - ldrsh r0, [r0, r2] - muls r1, r0 - adds r1, r7 - lsls r1, 1 - adds r0, r3, 0 - adds r0, 0x1A - adds r0, r1 - movs r4, 0 - ldrsh r5, [r0, r4] - ldr r2, _08023ED0 - movs r0, 0x58 - adds r1, r5, 0 - muls r1, r0 - ldr r0, [r2] - adds r4, r0, r1 - movs r6, 0x7 - ldrh r0, [r4] - lsrs r0, 1 - movs r1, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08023ED4 - movs r0, 0 - ldrb r1, [r4, 0x4] - cmp r1, 0x41 - bne _08023E9E - movs r0, 0x1 -_08023E9E: - cmp r0, 0 - beq _08023EA4 - movs r6, 0x6 -_08023EA4: - movs r0, 0 - cmp r1, 0x40 - bne _08023EAC - movs r0, 0x1 -_08023EAC: - cmp r0, 0 - beq _08023EB2 - movs r6, 0x6 -_08023EB2: - ldrb r0, [r4, 0x2] - cmp r0, 0 - beq _08023EEA - movs r6, 0x5 - b _08023EEA - .align 2, 0 -_08023EBC: .4byte gUnknown_80DC980 -_08023EC0: .4byte 0x000003f6 -_08023EC4: .4byte 0x00000376 -_08023EC8: .4byte gUnknown_3001B60 -_08023ECC: .4byte 0x00000372 -_08023ED0: .4byte gRecruitedPokemonRef -_08023ED4: - ldrb r0, [r3, 0x18] - cmp r0, 0 - beq _08023EEA - adds r0, r5, 0 - bl sub_808D750 - lsls r0, 24 - movs r6, 0x2 - cmp r0, 0 - beq _08023EEA - movs r6, 0x4 -_08023EEA: - mov r0, r8 - ldr r1, [r0] - ldr r0, [r1] - cmp r0, 0x4 - bne _08023F02 - movs r2, 0xD5 - lsls r2, 2 - adds r0, r1, r2 - ldrb r1, [r0] - adds r0, r4, 0 - bl sub_8024184 -_08023F02: - adds r1, r4, 0 - adds r1, 0x4C - mov r0, r9 - movs r2, 0xA - bl sub_80922B4 - movs r0, 0x8 - ldrsh r1, [r4, r0] - add r0, sp, 0x44 - bl sub_808D930 - add r0, sp, 0x8 - ldr r1, _08023F80 - adds r2, r6, 0 - mov r3, r9 - bl sprintfStatic - mov r1, r8 - ldr r0, [r1] - movs r2, 0xD6 - lsls r2, 2 - adds r0, r2 - adds r1, r7, 0 - bl sub_8013800 - adds r1, r0, 0 - mov r4, r8 - ldr r0, [r4] - movs r2, 0xE3 - lsls r2, 2 - adds r0, r2 - ldr r3, [r0] - movs r0, 0 - str r0, [sp] - movs r0, 0x8 - add r2, sp, 0x8 - bl xxx_call_draw_string - adds r7, 0x1 - mov r1, r8 - ldr r0, [r4] - ldr r4, _08023F84 - adds r0, r4 - movs r2, 0 - ldrsh r0, [r0, r2] - cmp r7, r0 - bge _08023F62 - b _08023E56 -_08023F62: - ldr r0, _08023F88 - ldr r0, [r0] - movs r4, 0xE3 - lsls r4, 2 - adds r0, r4 - ldr r0, [r0] - bl sub_80073E0 - add sp, 0x58 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .align 2, 0 -_08023F80: .4byte gUnknown_80DC998 -_08023F84: .4byte 0x00000372 -_08023F88: .4byte gUnknown_3001B60 - thumb_func_end sub_8023DA4 - - thumb_func_start sub_8023F8C -sub_8023F8C: - push {r4-r7,lr} - ldr r2, _08023FD0 - ldr r1, [r2] - movs r0, 0 - str r0, [r1, 0x8] - ldrb r0, [r1, 0x15] - adds r6, r2, 0 - cmp r0, 0 - bne _08023FE2 - movs r4, 0 - ldr r2, _08023FD4 -_08023FA2: - movs r0, 0x58 - adds r1, r4, 0 - muls r1, r0 - ldr r0, [r2] - adds r1, r0, r1 - ldrb r0, [r1, 0x2] - cmp r0, 0 - beq _08023FD8 - ldrb r1, [r1] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _08023FD8 - ldr r3, [r6] - ldr r1, [r3, 0x8] - lsls r2, r1, 1 - adds r0, r3, 0 - adds r0, 0x1A - adds r0, r2 - strh r4, [r0] - adds r1, 0x1 - str r1, [r3, 0x8] - b _08023FE2 - .align 2, 0 -_08023FD0: .4byte gUnknown_3001B60 -_08023FD4: .4byte gRecruitedPokemonRef -_08023FD8: - adds r4, 0x1 - movs r0, 0xCE - lsls r0, 1 - cmp r4, r0 - ble _08023FA2 -_08023FE2: - ldr r0, [r6] - ldrb r0, [r0, 0x16] - cmp r0, 0 - bne _08024042 - movs r4, 0 - ldr r3, _08024034 -_08023FEE: - movs r0, 0x58 - adds r1, r4, 0 - muls r1, r0 - ldr r0, [r3] - adds r1, r0, r1 - movs r2, 0 - ldrb r0, [r1, 0x4] - cmp r0, 0x41 - bne _08024002 - movs r2, 0x1 -_08024002: - cmp r2, 0 - beq _08024038 - ldrb r0, [r1, 0x2] - cmp r0, 0 - bne _08024038 - ldrh r1, [r1] - lsrs r0, r1, 1 - movs r2, 0x1 - ands r0, r2 - cmp r0, 0 - beq _08024038 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - beq _08024038 - ldr r3, [r6] - ldr r1, [r3, 0x8] - lsls r2, r1, 1 - adds r0, r3, 0 - adds r0, 0x1A - adds r0, r2 - strh r4, [r0] - adds r1, 0x1 - str r1, [r3, 0x8] - b _08024042 - .align 2, 0 -_08024034: .4byte gRecruitedPokemonRef -_08024038: - adds r4, 0x1 - movs r0, 0xCE - lsls r0, 1 - cmp r4, r0 - ble _08023FEE -_08024042: - ldr r0, [r6] - ldr r1, [r0, 0x8] - str r1, [r0, 0xC] - ldrb r0, [r0, 0x17] - cmp r0, 0 - bne _080240A4 - movs r4, 0 - ldr r7, _08024100 - movs r5, 0x1 -_08024054: - movs r0, 0x58 - adds r1, r4, 0 - muls r1, r0 - ldr r0, [r7] - adds r1, r0, r1 - ldrh r2, [r1] - lsrs r0, r2, 1 - ands r0, r5 - cmp r0, 0 - beq _0802409A - adds r0, r5, 0 - ands r0, r2 - cmp r0, 0 - beq _0802409A - ldrb r0, [r1, 0x2] - cmp r0, 0 - bne _0802409A - movs r2, 0 - ldrb r0, [r1, 0x4] - cmp r0, 0x41 - bne _08024080 - movs r2, 0x1 -_08024080: - cmp r2, 0 - bne _0802409A - ldr r3, [r6] - ldr r1, [r3, 0x8] - lsls r2, r1, 1 - adds r0, r3, 0 - adds r0, 0x1A - adds r0, r2 - strh r4, [r0] - adds r1, 0x1 - str r1, [r3, 0x8] - cmp r1, 0x3 - bgt _080240A4 -_0802409A: - adds r4, 0x1 - movs r0, 0xCE - lsls r0, 1 - cmp r4, r0 - ble _08024054 -_080240A4: - ldr r0, [r6] - ldr r1, [r0, 0x8] - str r1, [r0, 0x10] - ldrb r0, [r0, 0x14] - cmp r0, 0 - bne _080240EE - movs r4, 0 - ldr r7, _08024100 - movs r5, 0x1 -_080240B6: - movs r0, 0x58 - adds r1, r4, 0 - muls r1, r0 - ldr r0, [r7] - adds r1, r0, r1 - ldrh r1, [r1] - adds r0, r5, 0 - ands r0, r1 - cmp r0, 0 - beq _080240E4 - lsrs r0, r1, 1 - ands r0, r5 - cmp r0, 0 - bne _080240E4 - ldr r3, [r6] - ldr r1, [r3, 0x8] - lsls r2, r1, 1 - adds r0, r3, 0 - adds r0, 0x1A - adds r0, r2 - strh r4, [r0] - adds r1, 0x1 - str r1, [r3, 0x8] -_080240E4: - adds r4, 0x1 - movs r0, 0xCE - lsls r0, 1 - cmp r4, r0 - ble _080240B6 -_080240EE: - bl sub_80241A8 - ldr r0, _08024104 - ldr r0, [r0] - ldr r0, [r0, 0x8] - pop {r4-r7} - pop {r1} - bx r1 - .align 2, 0 -_08024100: .4byte gRecruitedPokemonRef -_08024104: .4byte gUnknown_3001B60 - thumb_func_end sub_8023F8C - - thumb_func_start sub_8024108 -sub_8024108: - push {r4-r7,lr} - adds r5, r0, 0 - movs r7, 0 - movs r6, 0x1 -_08024110: - ldr r2, _08024134 - movs r0, 0x58 - adds r1, r7, 0 - muls r1, r0 - ldr r0, [r2] - adds r4, r0, r1 - ldrh r1, [r4] - adds r0, r6, 0 - ands r0, r1 - cmp r0, 0 - beq _08024172 - cmp r5, 0x2 - bne _08024138 - lsrs r0, r1, 1 - ands r0, r6 - cmp r0, 0 - beq _08024172 - b _0802416E - .align 2, 0 -_08024134: .4byte gRecruitedPokemonRef -_08024138: - cmp r5, 0x3 - bne _08024140 - lsrs r0, r1, 1 - b _08024168 -_08024140: - cmp r5, 0x4 - bne _0802416E - ldrb r0, [r4, 0x2] - cmp r0, 0 - bne _08024172 - movs r0, 0x9 - bl sub_80023E4 - lsls r0, 24 - cmp r0, 0 - bne _0802416E - movs r1, 0 - ldrb r0, [r4, 0x4] - cmp r0, 0x41 - bne _08024160 - movs r1, 0x1 -_08024160: - cmp r1, 0 - beq _0802416E - ldrh r0, [r4] - lsrs r0, 1 -_08024168: - ands r0, r6 - cmp r0, 0 - bne _08024172 -_0802416E: - movs r0, 0 - b _0802417E -_08024172: - adds r7, 0x1 - movs r0, 0xCE - lsls r0, 1 - cmp r7, r0 - ble _08024110 - movs r0, 0x1 -_0802417E: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8024108 - - .align 2,0 + thumb_func_end sub_80237E0 \ No newline at end of file diff --git a/asm/code_8023868.s b/asm/code_8023868.s new file mode 100644 index 00000000..4ea50d5e --- /dev/null +++ b/asm/code_8023868.s @@ -0,0 +1,1190 @@ + #include "asm/constants/gba_constants.inc" + #include "asm/macros.inc" + + .syntax unified + + .text + + thumb_func_start sub_8023868 +sub_8023868: + push {r4-r7,lr} + mov r7, r10 + mov r6, r9 + mov r5, r8 + push {r5-r7} + adds r5, r0, 0 + mov r8, r1 + mov r9, r2 + mov r10, r3 + bl sub_8024108 + lsls r0, 24 + cmp r0, 0 + beq _08023888 + movs r0, 0 + b _08023A6E +_08023888: + ldr r4, _080238AC + ldr r0, [r4] + cmp r0, 0 + bne _0802389C + movs r0, 0xFE + lsls r0, 2 + movs r1, 0x8 + bl MemoryAlloc + str r0, [r4] +_0802389C: + ldr r1, [r4] + str r5, [r1] + ldr r0, _080238B0 + ldr r0, [r0] + cmp r0, r5 + beq _080238B4 + movs r0, 0x1 + b _080238B8 + .align 2, 0 +_080238AC: .4byte gUnknown_3001B60 +_080238B0: .4byte gUnknown_203B2A0 +_080238B4: + ldr r0, _080238E4 + ldr r0, [r0] +_080238B8: + str r0, [r1, 0x4] + ldr r2, _080238E8 + ldr r0, [r2] + movs r1, 0 + strb r1, [r0, 0x14] + ldr r0, [r2] + strb r1, [r0, 0x15] + ldr r0, [r2] + strb r1, [r0, 0x16] + ldr r0, [r2] + strb r1, [r0, 0x17] + ldr r0, [r2] + strb r1, [r0, 0x18] + ldr r0, [r2] + ldr r0, [r0] + cmp r0, 0x4 + bhi _08023980 + lsls r0, 2 + ldr r1, _080238EC + adds r0, r1 + ldr r0, [r0] + mov pc, r0 + .align 2, 0 +_080238E4: .4byte gUnknown_203B2A4 +_080238E8: .4byte gUnknown_3001B60 +_080238EC: .4byte _080238F0 + .align 2, 0 +_080238F0: + .4byte _08023958 + .4byte _08023904 + .4byte _08023914 + .4byte _08023924 + .4byte _0802393C +_08023904: + ldr r0, _08023910 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x18] + b _08023958 + .align 2, 0 +_08023910: .4byte gUnknown_3001B60 +_08023914: + ldr r0, _08023920 + ldr r1, [r0] + movs r0, 0x1 + strb r0, [r1, 0x14] + b _08023958 + .align 2, 0 +_08023920: .4byte gUnknown_3001B60 +_08023924: + ldr r2, _08023938 + ldr r0, [r2] + movs r1, 0x1 + strb r1, [r0, 0x17] + ldr r0, [r2] + strb r1, [r0, 0x15] + ldr r0, [r2] + strb r1, [r0, 0x16] + b _08023958 + .align 2, 0 +_08023938: .4byte gUnknown_3001B60 +_0802393C: + ldr r5, _0802397C + ldr r0, [r5] + movs r4, 0x1 + strb r4, [r0, 0x18] + ldr r0, [r5] + strb r4, [r0, 0x15] + movs r0, 0x9 + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + bne _08023958 + ldr r0, [r5] + strb r4, [r0, 0x16] +_08023958: + ldr r4, _0802397C + ldr r0, [r4] + ldr r0, [r0] + cmp r0, 0x4 + bne _08023980 + bl sub_80A5728 + lsls r0, 16 + asrs r0, 16 + bl sub_8002658 + ldr r1, [r4] + movs r2, 0xD5 + lsls r2, 2 + adds r1, r2 + strb r0, [r1] + b _0802398E + .align 2, 0 +_0802397C: .4byte gUnknown_3001B60 +_08023980: + ldr r0, _08023A7C + ldr r0, [r0] + movs r3, 0xD5 + lsls r3, 2 + adds r0, r3 + movs r1, 0 + strb r1, [r0] +_0802398E: + ldr r5, _08023A7C + ldr r0, [r5] + movs r4, 0xE3 + lsls r4, 2 + adds r1, r0, r4 + mov r2, r8 + str r2, [r1] + movs r7, 0xE4 + lsls r7, 2 + adds r2, r0, r7 + mov r3, r8 + lsls r1, r3, 1 + add r1, r8 + lsls r1, 3 + movs r6, 0xE5 + lsls r6, 2 + adds r1, r6 + adds r1, r0, r1 + str r1, [r2] + adds r0, r6 + bl sub_8006518 + ldr r1, [r5] + adds r4, r1, r4 + ldr r2, [r4] + lsls r0, r2, 1 + adds r0, r2 + lsls r0, 3 + adds r1, r0 + adds r1, r6 + ldr r0, _08023A80 + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldm r0!, {r2-r4} + stm r1!, {r2-r4} + ldr r2, [r5] + adds r0, r2, r7 + ldr r1, [r0] + movs r4, 0xFD + lsls r4, 2 + adds r0, r2, r4 + str r0, [r1, 0x14] + mov r0, r9 + cmp r0, 0 + beq _08023A04 + movs r1, 0xE3 + lsls r1, 2 + adds r0, r2, r1 + ldr r1, [r0] + lsls r0, r1, 1 + adds r0, r1 + lsls r0, 3 + movs r3, 0xE7 + lsls r3, 2 + adds r1, r2, r3 + adds r1, r0 + mov r4, r9 + ldr r0, [r4] + str r0, [r1] +_08023A04: + ldr r0, [r5] + adds r0, r7 + ldr r0, [r0] + mov r1, r10 + bl sub_8012D08 + bl ResetUnusedInputStruct + ldr r0, [r5] + adds r0, r6 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r4, [r5] + movs r0, 0xD6 + lsls r0, 2 + adds r4, r0 + bl sub_8023F8C + adds r1, r0, 0 + adds r0, r4, 0 + mov r2, r10 + mov r3, r8 + bl sub_8013818 + ldr r0, _08023A84 + ldr r4, [r5] + ldr r1, [r0] + ldr r0, [r4] + cmp r1, r0 + bne _08023A64 + ldr r0, _08023A88 + ldrh r1, [r0] + movs r2, 0xDC + lsls r2, 2 + adds r0, r4, r2 + strh r1, [r0] + ldr r0, _08023A8C + ldrh r1, [r0] + ldr r3, _08023A90 + adds r0, r4, r3 + strh r1, [r0] + movs r1, 0xD6 + lsls r1, 2 + adds r0, r4, r1 + bl sub_8013984 +_08023A64: + bl sub_8023CF4 + bl sub_8023DA4 + movs r0, 0x1 +_08023A6E: + pop {r3-r5} + mov r8, r3 + mov r9, r4 + mov r10, r5 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08023A7C: .4byte gUnknown_3001B60 +_08023A80: .4byte sUnknown_80DC968 +_08023A84: .4byte gUnknown_203B2A0 +_08023A88: .4byte gUnknown_203B2A8 +_08023A8C: .4byte gUnknown_203B2AA +_08023A90: .4byte 0x00000376 + thumb_func_end sub_8023868 + + thumb_func_start sub_8023A94 +sub_8023A94: + push {r4,lr} + lsls r0, 24 + cmp r0, 0 + bne _08023AB4 + ldr r0, _08023AB0 + ldr r0, [r0] + movs r1, 0xD6 + lsls r1, 2 + adds r0, r1 + bl sub_8013660 + movs r0, 0 + b _08023B3E + .align 2, 0 +_08023AB0: .4byte gUnknown_3001B60 +_08023AB4: + ldr r4, _08023AD0 + ldr r0, [r4] + movs r1, 0xD6 + lsls r1, 2 + adds r0, r1 + bl GetKeyPress + cmp r0, 0x2 + beq _08023ADE + cmp r0, 0x2 + bgt _08023AD4 + cmp r0, 0x1 + beq _08023AF2 + b _08023B16 + .align 2, 0 +_08023AD0: .4byte gUnknown_3001B60 +_08023AD4: + cmp r0, 0x3 + beq _08023AFC + cmp r0, 0x4 + beq _08023AE8 + b _08023B16 +_08023ADE: + movs r0, 0x1 + bl PlayMenuSoundEffect + movs r0, 0x2 + b _08023B3E +_08023AE8: + movs r0, 0x4 + bl PlayMenuSoundEffect + movs r0, 0x4 + b _08023B3E +_08023AF2: + movs r0, 0 + bl PlayMenuSoundEffect + movs r0, 0x3 + b _08023B3E +_08023AFC: + movs r0, 0x5 + bl PlayMenuSoundEffect + ldr r0, [r4] + ldr r1, [r0, 0x4] + movs r2, 0x1 + cmp r1, 0x2 + bhi _08023B0E + adds r2, r1, 0x1 +_08023B0E: + str r2, [r0, 0x4] + bl sub_8023F8C + b _08023B34 +_08023B16: + ldr r0, _08023B30 + ldr r0, [r0] + movs r1, 0xD6 + lsls r1, 2 + adds r0, r1 + movs r1, 0x1 + bl sub_80138B8 + lsls r0, 24 + cmp r0, 0 + bne _08023B34 + movs r0, 0 + b _08023B3E + .align 2, 0 +_08023B30: .4byte gUnknown_3001B60 +_08023B34: + bl sub_8023CF4 + bl sub_8023DA4 + movs r0, 0x1 +_08023B3E: + pop {r4} + pop {r1} + bx r1 + thumb_func_end sub_8023A94 + + thumb_func_start sub_8023B44 +sub_8023B44: + ldr r0, _08023B74 + ldr r0, [r0] + ldr r2, _08023B78 + adds r1, r0, r2 + movs r3, 0 + ldrsh r2, [r1, r3] + movs r3, 0xDD + lsls r3, 2 + adds r1, r0, r3 + movs r3, 0 + ldrsh r1, [r1, r3] + muls r1, r2 + movs r3, 0xDC + lsls r3, 2 + adds r2, r0, r3 + movs r3, 0 + ldrsh r2, [r2, r3] + adds r1, r2 + lsls r1, 1 + adds r0, 0x1A + adds r0, r1 + movs r1, 0 + ldrsh r0, [r0, r1] + bx lr + .align 2, 0 +_08023B74: .4byte gUnknown_3001B60 +_08023B78: .4byte 0x00000376 + thumb_func_end sub_8023B44 + + thumb_func_start sub_8023B7C +sub_8023B7C: + push {r4,r5,lr} + adds r4, r0, 0 + lsls r4, 24 + lsrs r4, 24 + bl ResetUnusedInputStruct + ldr r5, _08023BD0 + ldr r0, [r5] + movs r1, 0xE5 + lsls r1, 2 + adds r0, r1 + movs r1, 0 + movs r2, 0 + bl sub_800641C + bl sub_8023BD8 + adds r2, r0, 0 + ldr r0, [r5] + ldr r3, _08023BD4 + adds r1, r0, r3 + strh r2, [r1] + movs r1, 0xD6 + lsls r1, 2 + adds r0, r1 + bl sub_8013984 + bl sub_8023CF4 + bl sub_8023DA4 + cmp r4, 0 + beq _08023BCA + ldr r0, [r5] + movs r3, 0xD6 + lsls r3, 2 + adds r0, r3 + bl AddMenuCursorSprite +_08023BCA: + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08023BD0: .4byte gUnknown_3001B60 +_08023BD4: .4byte 0x0000037a + thumb_func_end sub_8023B7C + + thumb_func_start sub_8023BD8 +sub_8023BD8: + push {r4-r7,lr} + mov r7, r8 + push {r7} + movs r3, 0 + ldr r1, _08023C58 + ldr r0, [r1] + ldr r0, [r0, 0x8] + adds r7, r1, 0 + cmp r3, r0 + bge _08023C4A + ldr r0, _08023C5C + mov r8, r0 + mov r12, r7 +_08023BF2: + ldr r2, [r1] + lsls r4, r3, 1 + adds r0, r2, 0 + adds r0, 0x1A + adds r0, r4 + movs r5, 0 + ldrsh r1, [r0, r5] + movs r0, 0x58 + muls r0, r1 + mov r5, r8 + ldr r1, [r5] + adds r0, r1 + ldrb r1, [r0] + movs r0, 0x1 + ands r0, r1 + adds r6, r3, 0x1 + cmp r0, 0 + bne _08023C3E + ldr r0, [r2, 0x8] + subs r0, 0x1 + str r0, [r2, 0x8] + cmp r3, r0 + bge _08023C3E + mov r5, r12 + adds r4, 0x2 +_08023C24: + ldr r2, [r5] + lsls r1, r3, 1 + adds r0, r2, 0 + adds r0, 0x1A + adds r1, r0, r1 + adds r0, r4 + ldrh r0, [r0] + strh r0, [r1] + adds r4, 0x2 + adds r3, 0x1 + ldr r0, [r2, 0x8] + cmp r3, r0 + blt _08023C24 +_08023C3E: + adds r3, r6, 0 + adds r1, r7, 0 + ldr r0, [r7] + ldr r0, [r0, 0x8] + cmp r3, r0 + blt _08023BF2 +_08023C4A: + ldr r0, [r7] + ldr r0, [r0, 0x8] + pop {r3} + mov r8, r3 + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08023C58: .4byte gUnknown_3001B60 +_08023C5C: .4byte gRecruitedPokemonRef + thumb_func_end sub_8023BD8 + + thumb_func_start sub_8023C60 +sub_8023C60: + push {r4-r6,lr} + ldr r5, _08023CCC + ldr r2, [r5] + cmp r2, 0 + beq _08023CC6 + ldr r1, _08023CD0 + ldr r0, [r2] + str r0, [r1] + ldr r1, _08023CD4 + ldr r0, [r2, 0x4] + str r0, [r1] + ldr r1, _08023CD8 + movs r3, 0xDC + lsls r3, 2 + adds r0, r2, r3 + ldrh r0, [r0] + strh r0, [r1] + ldr r1, _08023CDC + ldr r6, _08023CE0 + adds r0, r2, r6 + ldrh r0, [r0] + strh r0, [r1] + movs r1, 0xE3 + lsls r1, 2 + adds r0, r2, r1 + ldr r0, [r0] + lsls r1, r0, 1 + adds r1, r0 + lsls r1, 3 + adds r1, r2, r1 + movs r4, 0xE5 + lsls r4, 2 + adds r1, r4 + ldr r0, _08023CE4 + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + ldm r0!, {r2,r3,r6} + stm r1!, {r2,r3,r6} + bl ResetUnusedInputStruct + ldr r0, [r5] + adds r0, r4 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + ldr r0, [r5] + bl MemoryFree + movs r0, 0 + str r0, [r5] +_08023CC6: + pop {r4-r6} + pop {r0} + bx r0 + .align 2, 0 +_08023CCC: .4byte gUnknown_3001B60 +_08023CD0: .4byte gUnknown_203B2A0 +_08023CD4: .4byte gUnknown_203B2A4 +_08023CD8: .4byte gUnknown_203B2A8 +_08023CDC: .4byte gUnknown_203B2AA +_08023CE0: .4byte 0x00000376 +_08023CE4: .4byte sUnknown_80DC950 + thumb_func_end sub_8023C60 + + thumb_func_start sub_8023CE8 +sub_8023CE8: + ldr r0, _08023CF0 + ldr r0, [r0] + bx lr + .align 2, 0 +_08023CF0: .4byte gUnknown_3001B60 + thumb_func_end sub_8023CE8 + + thumb_func_start sub_8023CF4 +sub_8023CF4: + push {r4,r5,lr} + ldr r2, _08023D28 + ldr r0, [r2] + movs r1, 0xFD + lsls r1, 2 + adds r0, r1 + movs r3, 0 + movs r1, 0x1 + strb r1, [r0] + ldr r0, [r2] + ldr r1, _08023D2C + adds r0, r1 + strb r3, [r0] + ldr r0, [r2] + adds r1, 0x2 + adds r0, r1 + strb r3, [r0] + ldr r1, [r2] + ldr r0, [r1] + adds r5, r2, 0 + cmp r0, 0x2 + bne _08023D34 + ldr r0, _08023D30 + adds r1, r0 + b _08023D38 + .align 2, 0 +_08023D28: .4byte gUnknown_3001B60 +_08023D2C: .4byte 0x000003f5 +_08023D30: .4byte 0x000003f6 +_08023D34: + ldr r2, _08023D98 + adds r1, r2 +_08023D38: + movs r0, 0xC + strb r0, [r1] + ldr r0, [r5] + ldr r1, _08023D9C + adds r0, r1 + movs r2, 0 + ldrsh r0, [r0, r2] + movs r1, 0xC + bl sub_80095E4 + adds r0, 0x2 + ldr r3, [r5] + movs r1, 0xE3 + lsls r1, 2 + adds r4, r3, r1 + ldr r2, [r4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 3 + adds r1, r3, r1 + ldr r2, _08023DA0 + adds r1, r2 + lsls r0, 16 + lsrs r0, 16 + strh r0, [r1] + ldr r2, [r4] + lsls r1, r2, 1 + adds r1, r2 + lsls r1, 3 + adds r3, r1 + movs r1, 0xE9 + lsls r1, 2 + adds r3, r1 + strh r0, [r3] + bl ResetUnusedInputStruct + ldr r0, [r5] + movs r2, 0xE5 + lsls r2, 2 + adds r0, r2 + movs r1, 0x1 + movs r2, 0x1 + bl sub_800641C + pop {r4,r5} + pop {r0} + bx r0 + .align 2, 0 +_08023D98: .4byte 0x000003f6 +_08023D9C: .4byte 0x00000372 +_08023DA0: .4byte 0x000003a2 + thumb_func_end sub_8023CF4 + + thumb_func_start sub_8023DA4 +sub_8023DA4: + push {r4-r7,lr} + mov r7, r9 + mov r6, r8 + push {r6,r7} + sub sp, 0x58 + ldr r4, _08023DD8 + ldr r0, [r4] + movs r5, 0xE3 + lsls r5, 2 + adds r0, r5 + ldr r0, [r0] + bl sub_8008C54 + ldr r0, [r4] + adds r0, r5 + ldr r0, [r0] + bl sub_80073B8 + ldr r0, [r4] + ldr r1, [r0] + cmp r1, 0x2 + beq _08023DE0 + cmp r1, 0x4 + beq _08023E00 + ldr r2, _08023DDC + b _08023E02 + .align 2, 0 +_08023DD8: .4byte gUnknown_3001B60 +_08023DDC: .4byte sUnknown_80DC988 +_08023DE0: + add r0, sp, 0x8 + bl sub_80920D8 + ldr r0, [r4] + movs r1, 0xE3 + lsls r1, 2 + adds r0, r1 + ldr r3, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0xA + movs r1, 0 + add r2, sp, 0x8 + bl xxx_call_draw_string + b _08023E3C +_08023E00: + ldr r2, _08023EBC +_08023E02: + adds r0, r5 + ldr r3, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0xA + movs r1, 0 + bl xxx_call_draw_string + ldr r1, [r4] + ldr r2, _08023EC0 + adds r0, r1, r2 + ldrb r0, [r0] + lsls r0, 3 + adds r3, r0, 0x4 + ldr r4, _08023EC4 + adds r0, r1, r4 + movs r4, 0 + ldrsh r2, [r0, r4] + adds r2, 0x1 + movs r0, 0x7 + str r0, [sp] + adds r1, r5 + ldr r0, [r1] + str r0, [sp, 0x4] + adds r0, r3, 0 + movs r1, 0 + movs r3, 0x2 + bl sub_8012BC4 +_08023E3C: + movs r7, 0 + ldr r1, _08023EC8 + ldr r0, [r1] + ldr r2, _08023ECC + adds r0, r2 + movs r4, 0 + ldrsh r0, [r0, r4] + cmp r7, r0 + blt _08023E50 + b _08023F62 +_08023E50: + mov r8, r1 + add r0, sp, 0x30 + mov r9, r0 +_08023E56: + ldr r3, [r1] + ldr r1, _08023EC4 + adds r0, r3, r1 + movs r2, 0 + ldrsh r1, [r0, r2] + movs r4, 0xDD + lsls r4, 2 + adds r0, r3, r4 + movs r2, 0 + ldrsh r0, [r0, r2] + muls r1, r0 + adds r1, r7 + lsls r1, 1 + adds r0, r3, 0 + adds r0, 0x1A + adds r0, r1 + movs r4, 0 + ldrsh r5, [r0, r4] + ldr r2, _08023ED0 + movs r0, 0x58 + adds r1, r5, 0 + muls r1, r0 + ldr r0, [r2] + adds r4, r0, r1 + movs r6, 0x7 + ldrh r0, [r4] + lsrs r0, 1 + movs r1, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08023ED4 + movs r0, 0 + ldrb r1, [r4, 0x4] + cmp r1, 0x41 + bne _08023E9E + movs r0, 0x1 +_08023E9E: + cmp r0, 0 + beq _08023EA4 + movs r6, 0x6 +_08023EA4: + movs r0, 0 + cmp r1, 0x40 + bne _08023EAC + movs r0, 0x1 +_08023EAC: + cmp r0, 0 + beq _08023EB2 + movs r6, 0x6 +_08023EB2: + ldrb r0, [r4, 0x2] + cmp r0, 0 + beq _08023EEA + movs r6, 0x5 + b _08023EEA + .align 2, 0 +_08023EBC: .4byte sUnknown_80DC980 +_08023EC0: .4byte 0x000003f6 +_08023EC4: .4byte 0x00000376 +_08023EC8: .4byte gUnknown_3001B60 +_08023ECC: .4byte 0x00000372 +_08023ED0: .4byte gRecruitedPokemonRef +_08023ED4: + ldrb r0, [r3, 0x18] + cmp r0, 0 + beq _08023EEA + adds r0, r5, 0 + bl sub_808D750 + lsls r0, 24 + movs r6, 0x2 + cmp r0, 0 + beq _08023EEA + movs r6, 0x4 +_08023EEA: + mov r0, r8 + ldr r1, [r0] + ldr r0, [r1] + cmp r0, 0x4 + bne _08023F02 + movs r2, 0xD5 + lsls r2, 2 + adds r0, r1, r2 + ldrb r1, [r0] + adds r0, r4, 0 + bl sub_8024184 +_08023F02: + adds r1, r4, 0 + adds r1, 0x4C + mov r0, r9 + movs r2, 0xA + bl sub_80922B4 + movs r0, 0x8 + ldrsh r1, [r4, r0] + add r0, sp, 0x44 + bl sub_808D930 + add r0, sp, 0x8 + ldr r1, _08023F80 + adds r2, r6, 0 + mov r3, r9 + bl sprintfStatic + mov r1, r8 + ldr r0, [r1] + movs r2, 0xD6 + lsls r2, 2 + adds r0, r2 + adds r1, r7, 0 + bl sub_8013800 + adds r1, r0, 0 + mov r4, r8 + ldr r0, [r4] + movs r2, 0xE3 + lsls r2, 2 + adds r0, r2 + ldr r3, [r0] + movs r0, 0 + str r0, [sp] + movs r0, 0x8 + add r2, sp, 0x8 + bl xxx_call_draw_string + adds r7, 0x1 + mov r1, r8 + ldr r0, [r4] + ldr r4, _08023F84 + adds r0, r4 + movs r2, 0 + ldrsh r0, [r0, r2] + cmp r7, r0 + bge _08023F62 + b _08023E56 +_08023F62: + ldr r0, _08023F88 + ldr r0, [r0] + movs r4, 0xE3 + lsls r4, 2 + adds r0, r4 + ldr r0, [r0] + bl sub_80073E0 + add sp, 0x58 + pop {r3,r4} + mov r8, r3 + mov r9, r4 + pop {r4-r7} + pop {r0} + bx r0 + .align 2, 0 +_08023F80: .4byte sUnknown_80DC998 +_08023F84: .4byte 0x00000372 +_08023F88: .4byte gUnknown_3001B60 + thumb_func_end sub_8023DA4 + + thumb_func_start sub_8023F8C +sub_8023F8C: + push {r4-r7,lr} + ldr r2, _08023FD0 + ldr r1, [r2] + movs r0, 0 + str r0, [r1, 0x8] + ldrb r0, [r1, 0x15] + adds r6, r2, 0 + cmp r0, 0 + bne _08023FE2 + movs r4, 0 + ldr r2, _08023FD4 +_08023FA2: + movs r0, 0x58 + adds r1, r4, 0 + muls r1, r0 + ldr r0, [r2] + adds r1, r0, r1 + ldrb r0, [r1, 0x2] + cmp r0, 0 + beq _08023FD8 + ldrb r1, [r1] + movs r0, 0x1 + ands r0, r1 + cmp r0, 0 + beq _08023FD8 + ldr r3, [r6] + ldr r1, [r3, 0x8] + lsls r2, r1, 1 + adds r0, r3, 0 + adds r0, 0x1A + adds r0, r2 + strh r4, [r0] + adds r1, 0x1 + str r1, [r3, 0x8] + b _08023FE2 + .align 2, 0 +_08023FD0: .4byte gUnknown_3001B60 +_08023FD4: .4byte gRecruitedPokemonRef +_08023FD8: + adds r4, 0x1 + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + ble _08023FA2 +_08023FE2: + ldr r0, [r6] + ldrb r0, [r0, 0x16] + cmp r0, 0 + bne _08024042 + movs r4, 0 + ldr r3, _08024034 +_08023FEE: + movs r0, 0x58 + adds r1, r4, 0 + muls r1, r0 + ldr r0, [r3] + adds r1, r0, r1 + movs r2, 0 + ldrb r0, [r1, 0x4] + cmp r0, 0x41 + bne _08024002 + movs r2, 0x1 +_08024002: + cmp r2, 0 + beq _08024038 + ldrb r0, [r1, 0x2] + cmp r0, 0 + bne _08024038 + ldrh r1, [r1] + lsrs r0, r1, 1 + movs r2, 0x1 + ands r0, r2 + cmp r0, 0 + beq _08024038 + adds r0, r2, 0 + ands r0, r1 + cmp r0, 0 + beq _08024038 + ldr r3, [r6] + ldr r1, [r3, 0x8] + lsls r2, r1, 1 + adds r0, r3, 0 + adds r0, 0x1A + adds r0, r2 + strh r4, [r0] + adds r1, 0x1 + str r1, [r3, 0x8] + b _08024042 + .align 2, 0 +_08024034: .4byte gRecruitedPokemonRef +_08024038: + adds r4, 0x1 + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + ble _08023FEE +_08024042: + ldr r0, [r6] + ldr r1, [r0, 0x8] + str r1, [r0, 0xC] + ldrb r0, [r0, 0x17] + cmp r0, 0 + bne _080240A4 + movs r4, 0 + ldr r7, _08024100 + movs r5, 0x1 +_08024054: + movs r0, 0x58 + adds r1, r4, 0 + muls r1, r0 + ldr r0, [r7] + adds r1, r0, r1 + ldrh r2, [r1] + lsrs r0, r2, 1 + ands r0, r5 + cmp r0, 0 + beq _0802409A + adds r0, r5, 0 + ands r0, r2 + cmp r0, 0 + beq _0802409A + ldrb r0, [r1, 0x2] + cmp r0, 0 + bne _0802409A + movs r2, 0 + ldrb r0, [r1, 0x4] + cmp r0, 0x41 + bne _08024080 + movs r2, 0x1 +_08024080: + cmp r2, 0 + bne _0802409A + ldr r3, [r6] + ldr r1, [r3, 0x8] + lsls r2, r1, 1 + adds r0, r3, 0 + adds r0, 0x1A + adds r0, r2 + strh r4, [r0] + adds r1, 0x1 + str r1, [r3, 0x8] + cmp r1, 0x3 + bgt _080240A4 +_0802409A: + adds r4, 0x1 + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + ble _08024054 +_080240A4: + ldr r0, [r6] + ldr r1, [r0, 0x8] + str r1, [r0, 0x10] + ldrb r0, [r0, 0x14] + cmp r0, 0 + bne _080240EE + movs r4, 0 + ldr r7, _08024100 + movs r5, 0x1 +_080240B6: + movs r0, 0x58 + adds r1, r4, 0 + muls r1, r0 + ldr r0, [r7] + adds r1, r0, r1 + ldrh r1, [r1] + adds r0, r5, 0 + ands r0, r1 + cmp r0, 0 + beq _080240E4 + lsrs r0, r1, 1 + ands r0, r5 + cmp r0, 0 + bne _080240E4 + ldr r3, [r6] + ldr r1, [r3, 0x8] + lsls r2, r1, 1 + adds r0, r3, 0 + adds r0, 0x1A + adds r0, r2 + strh r4, [r0] + adds r1, 0x1 + str r1, [r3, 0x8] +_080240E4: + adds r4, 0x1 + movs r0, 0xCE + lsls r0, 1 + cmp r4, r0 + ble _080240B6 +_080240EE: + bl sub_80241A8 + ldr r0, _08024104 + ldr r0, [r0] + ldr r0, [r0, 0x8] + pop {r4-r7} + pop {r1} + bx r1 + .align 2, 0 +_08024100: .4byte gRecruitedPokemonRef +_08024104: .4byte gUnknown_3001B60 + thumb_func_end sub_8023F8C + + thumb_func_start sub_8024108 +sub_8024108: + push {r4-r7,lr} + adds r5, r0, 0 + movs r7, 0 + movs r6, 0x1 +_08024110: + ldr r2, _08024134 + movs r0, 0x58 + adds r1, r7, 0 + muls r1, r0 + ldr r0, [r2] + adds r4, r0, r1 + ldrh r1, [r4] + adds r0, r6, 0 + ands r0, r1 + cmp r0, 0 + beq _08024172 + cmp r5, 0x2 + bne _08024138 + lsrs r0, r1, 1 + ands r0, r6 + cmp r0, 0 + beq _08024172 + b _0802416E + .align 2, 0 +_08024134: .4byte gRecruitedPokemonRef +_08024138: + cmp r5, 0x3 + bne _08024140 + lsrs r0, r1, 1 + b _08024168 +_08024140: + cmp r5, 0x4 + bne _0802416E + ldrb r0, [r4, 0x2] + cmp r0, 0 + bne _08024172 + movs r0, 0x9 + bl sub_80023E4 + lsls r0, 24 + cmp r0, 0 + bne _0802416E + movs r1, 0 + ldrb r0, [r4, 0x4] + cmp r0, 0x41 + bne _08024160 + movs r1, 0x1 +_08024160: + cmp r1, 0 + beq _0802416E + ldrh r0, [r4] + lsrs r0, 1 +_08024168: + ands r0, r6 + cmp r0, 0 + bne _08024172 +_0802416E: + movs r0, 0 + b _0802417E +_08024172: + adds r7, 0x1 + movs r0, 0xCE + lsls r0, 1 + cmp r7, r0 + ble _08024110 + movs r0, 0x1 +_0802417E: + pop {r4-r7} + pop {r1} + bx r1 + thumb_func_end sub_8024108 + + .align 2,0 \ No newline at end of file diff --git a/data/data_80DC464.s b/data/data_80DC464.s index d3fde0ea..4e248f01 100644 --- a/data/data_80DC464.s +++ b/data/data_80DC464.s @@ -185,67 +185,4 @@ gUnknown_80DC934: @ 80DC934 .global gUnknown_80DC93C gUnknown_80DC93C: @ 80DC93C - .string "{COLOR_2}%c%s{END_COLOR_TEXT_2}\0" - .align 2,0 - -@ code_801EE10_1 -.string "pksdir0\0" - .align 2,0 - - .global gUnknown_80DC950 -gUnknown_80DC950: @ 80DC950 - .byte 0x00, 0x00, 0x00, 0x00 - .byte 0x03, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00 - - .global gUnknown_80DC968 -gUnknown_80DC968: @ 80DC968 - .byte 0x00, 0x00, 0x00, 0x00 - .byte 0x06, 0x00, 0x00, 0x00 - .byte 0x02, 0x00, 0x02, 0x00 - .byte 0x0f, 0x00, 0x0e, 0x00 - .byte 0x0e, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00 - - .global gUnknown_80DC980 -gUnknown_80DC980: @ 80DC980 - .string "Friends\0" - - .global gUnknown_80DC988 -gUnknown_80DC988: @ 80DC988 - .string "Pokémon Friends\0" - - .global gUnknown_80DC998 -gUnknown_80DC998: @ 80DC998 - .string "{COLOR_2}%c%s{END_COLOR_TEXT_2}\0" - .align 2,0 - - .global gUnknown_80DC9A4 -gUnknown_80DC9A4: @ 80DC9A4 - .string "%s\0" - .align 2,0 - -@ code_801EE10_1 #2 -.string "pksdir0\0" - .align 2,0 - - .global gUnknown_80DC9B0 -gUnknown_80DC9B0: @ 80DC9B0 - .byte 0x00, 0x00, 0x00, 0x00 - .byte 0x03, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00 - .byte 0x00, 0x00, 0x00, 0x00 - - .global gUnknown_80DC9C8 -gUnknown_80DC9C8: @ 80DC9C8 - .byte 0x00, 0x00, 0x00, 0x00 - .byte 0x06, 0x00, 0x00, 0x00 - .byte 0x02, 0x00, 0x02, 0x00 - .byte 0x12, 0x00, 0x0e, 0x00 - .byte 0x12, 0x00, 0x02, 0x00 - .byte 0x00, 0x00, 0x00, 0x00 \ No newline at end of file + .string "{COLOR_2}%c%s{END_COLOR_TEXT_2}\0" \ No newline at end of file diff --git a/include/code_801EE10_1.h b/include/code_801EE10_1.h deleted file mode 100644 index f900a056..00000000 --- a/include/code_801EE10_1.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef GUARD_CODE_801EE10_1_H -#define GUARD_CODE_801EE10_1_H - -bool8 sub_8024458(s16 speciesNum, s32); -u32 sub_80244E4(void); -void sub_802453C(void); - -// code_801EE10_1.s -extern void sub_8023868(u32, u32, u32, u32); -extern u32 sub_8023A94(bool8); -extern s16 sub_8023B44(void); -extern void sub_8023B7C(u32); -extern void sub_8023C60(void); -extern void sub_8023DA4(void); -extern bool8 sub_8024108(u32); - -#endif // GUARD_CODE_801EE10_1_H \ No newline at end of file diff --git a/include/code_8023868.h b/include/code_8023868.h new file mode 100644 index 00000000..548472a7 --- /dev/null +++ b/include/code_8023868.h @@ -0,0 +1,30 @@ +#ifndef GUARD_CODE_8023868_H +#define GUARD_CODE_8023868_H + +struct unkStruct_3001B60 +{ + u32 unk0; + u32 sortMethod; + u32 unk8; + u32 unkC; + u32 unk10; + u8 fill14[0x18 - 0x14]; + s16 unk18; + s16 unk1A[2]; + u8 fill1C[0x370 - 0x1E]; + s16 unk370; + s16 unk372; + s16 unk374; + s16 unk376; +}; + +// code_8023868.s +extern void sub_8023868(u32, u32, u32, u32); +extern u32 sub_8023A94(bool8); +extern s16 sub_8023B44(void); +extern void sub_8023B7C(u32); +extern void sub_8023C60(void); +extern void sub_8023DA4(void); +extern bool8 sub_8024108(u32); + +#endif // GUARD_CODE_8023868_H \ No newline at end of file diff --git a/include/code_8024458.h b/include/code_8024458.h new file mode 100644 index 00000000..3c271f45 --- /dev/null +++ b/include/code_8024458.h @@ -0,0 +1,28 @@ +#ifndef GUARD_CODE_8024458_H +#define GUARD_CODE_8024458_H + +#include "input.h" +#include "text.h" + +struct unkStruct_203B2AC +{ + MenuInputStruct input; + u32 unk34[3]; + u8 unk40[0x48 - 0x40]; + s16 speciesNum; + u32 unk4C; + u8 unk50[0xB0 - 0x50]; + u32 unkB0; + u8 fillB4[0xE0 - 0xB4]; + u32 unkE0; + UnkTextStruct2 *unkE4; + UnkTextStruct2 unkE8[4]; + u8 unk148[4]; +}; + +bool8 sub_8024458(s16 speciesNum, s32); +u32 sub_80244E4(void); +void sub_802452C(void); +void sub_802453C(void); + +#endif // GUARD_CODE_8024458_H \ No newline at end of file diff --git a/include/pokemon_3.h b/include/pokemon_3.h index 50a4d1e2..1891b89c 100644 --- a/include/pokemon_3.h +++ b/include/pokemon_3.h @@ -30,4 +30,8 @@ void SetDefaultIQSkills(u8 *param_1, bool8 enableSelfCurer); void sub_808F468(PokemonStruct1 *param_1, EvolveStatus *evolveStatus, u8 param_3); u32 sub_808F734(PokemonStruct1 *pokemon, s16 _species); +// pokemon_3.s +extern void CreatePokemonInfoTabScreen(u32, s16, u32 *, u32 *, u32); +extern void sub_808FF20(u32 *, PokemonStruct1 *, bool8); + #endif // GUARD_POKEMON_3_H \ No newline at end of file diff --git a/include/pokemon_mid.h b/include/pokemon_mid.h index 2e638ea8..4d261c99 100644 --- a/include/pokemon_mid.h +++ b/include/pokemon_mid.h @@ -3,6 +3,7 @@ #include "pokemon.h" +bool8 ComparePokemonNames(s16, s16); void PrintPokeNameToBuffer(u8 *buffer, PokemonStruct1 *pokemon); bool8 sub_808DA44(s32, u32); diff --git a/ld_script.txt b/ld_script.txt index eee1ecb1..d4b0e54a 100755 --- a/ld_script.txt +++ b/ld_script.txt @@ -125,7 +125,9 @@ SECTIONS { asm/code_8023144.o(.text); src/code_8023144.o(.text); asm/code_801EE10_1.o(.text); - src/code_801EE10_1.o(.text); + asm/code_8023868.o(.text); + src/code_8023868.o(.text); + src/code_8024458.o(.text); src/luminous_cave.o(.text); src/friend_list_menu.o(.text); src/party_list_menu.o(.text); @@ -436,6 +438,8 @@ SECTIONS { src/wigglytuff_shop2.o(.rodata); src/wigglytuff_shop3.o(.rodata); data/data_80DC464.o(.rodata); + src/code_8023868.o(.rodata); + src/code_8024458.o(.rodata); src/luminous_cave.o(.rodata); src/friend_list_menu.o(.rodata); src/party_list_menu.o(.rodata); diff --git a/src/code_801D014.c b/src/code_801D014.c index cefdcfea..f8b6a17d 100644 --- a/src/code_801D014.c +++ b/src/code_801D014.c @@ -4,8 +4,9 @@ #include "code_80130A8.h" #include "code_801BEEC.h" #include "code_801D014.h" -#include "code_801EE10_1.h" #include "code_8023144.h" +#include "code_8023868.h" +#include "code_8024458.h" #include "code_8096AF8.h" #include "common_strings.h" #include "constants/friend_area.h" diff --git a/src/code_801EE10_1.c b/src/code_801EE10_1.c deleted file mode 100644 index a5e3fb2e..00000000 --- a/src/code_801EE10_1.c +++ /dev/null @@ -1,318 +0,0 @@ -#include "global.h" -#include "code_801EE10_1.h" -#include "constants/input.h" -#include "code_800D090.h" -#include "pokemon.h" -#include "input.h" -#include "memory.h" -#include "text1.h" -#include "text2.h" -#include "text_util.h" -#include "menu_input.h" -#include "code_80118A4.h" -#include "event_flag.h" - -struct unkStruct_203B2AC -{ - MenuInputStruct input; - u32 unk34[3]; - u8 unk40[0x48 - 0x40]; - s16 speciesNum; - u32 unk4C; - u8 unk50[0xB0 - 0x50]; - u32 unkB0; - u8 fillB4[0xE0 - 0xB4]; - u32 unkE0; - UnkTextStruct2 *unkE4; - UnkTextStruct2 unkE8[4]; - u8 unk148[4]; -}; -extern struct unkStruct_203B2AC *gUnknown_203B2AC; - -struct unkStruct_3001B60 -{ - u32 unk0; - u32 sortMethod; - u32 unk8; - u32 unkC; - u32 unk10; - u8 fill14[0x18 - 0x14]; - s16 unk18; - s16 unk1A[2]; - u8 fill1C[0x370 - 0x1E]; - s16 unk370; - s16 unk372; - s16 unk374; - s16 unk376; -}; - -extern struct unkStruct_3001B60 *gUnknown_3001B60; - -extern UnkTextStruct2 gUnknown_80DC9B0; -extern UnkTextStruct2 gUnknown_80DC9C8; - -extern void sub_808FF20(u32 *, PokemonStruct1 *, bool8); -extern void CreatePokemonInfoTabScreen(u32, s16, u32 *, u32 *, u32); -extern void sub_802452C(void); -bool8 ComparePokemonNames(s16 a1, s16 a2); - -void sub_8024588(void); -void sub_80245D0(void); -void sub_8024604(void); - -extern u8 gUnknown_80DC9A4[]; - -void SortbyInternalNo(s32 param_1, s32 param_2); -void SortbyAlphabetNo(s32 param_1,s32 param_2); -void SortbyName(s32 param_1,s32 param_2); - -bool8 sub_8024184(PokemonStruct1 *pokemon, u8 area) -{ - if(area == GetFriendArea(pokemon->speciesNum)) - return TRUE; - else - return FALSE; -} - -void sub_80241A8(void) -{ - switch(gUnknown_3001B60->sortMethod) - { - case 2: - if (gUnknown_3001B60->unkC != gUnknown_3001B60->unk10) { - SortbyAlphabetNo(gUnknown_3001B60->unkC, gUnknown_3001B60->unk10); - } - if (gUnknown_3001B60->unk10 != gUnknown_3001B60->unk8) { - SortbyAlphabetNo(gUnknown_3001B60->unk10, gUnknown_3001B60->unk8); - } - break; - case 3: - if (gUnknown_3001B60->unkC != gUnknown_3001B60->unk10) { - SortbyName(gUnknown_3001B60->unkC, gUnknown_3001B60->unk10); - } - if (gUnknown_3001B60->unk10 != gUnknown_3001B60->unk8) { - SortbyName(gUnknown_3001B60->unk10, gUnknown_3001B60->unk8); - } - break; - case 1: - if (gUnknown_3001B60->unkC != gUnknown_3001B60->unk10) { - SortbyInternalNo(gUnknown_3001B60->unkC, gUnknown_3001B60->unk10); - } - if (gUnknown_3001B60->unk10 != gUnknown_3001B60->unk8) { - SortbyInternalNo(gUnknown_3001B60->unk10, gUnknown_3001B60->unk8); - } - break; - } -} - - -void SortbyInternalNo(s32 param_1, s32 param_2) -{ - s16 *r4; - s32 iVar4; - s16 *r10; - s16 *r5; - s32 r6; - s32 r1; - s32 r7; - s32 r9; - - r10 = &gUnknown_3001B60->unk18 + param_2; - r7 = param_1; - r1 = param_2 - 1; - if (r7 < r1) { - r9 = r1; - do { - r4 = r10; - r6 = r1; - iVar4 = r7 + 1; - for (; r6 > r7; r6--) { - if (GetInternalNo(gRecruitedPokemonRef->pokemon[r5 = r4 - 1, *r5].speciesNum) > GetInternalNo(gRecruitedPokemonRef->pokemon[*r4].speciesNum)) { - r1 = *r4; - *r4 = *r5; - *r5 = r1; - } - r4 = r5; - } - r7 = iVar4; - r1 = r9; - } while (iVar4 < r1); - } -} - -void SortbyAlphabetNo(s32 param_1,s32 param_2) -{ - s16 *r4; - s32 iVar4; - s16 *r10; - s16 *r5; - s32 r6; - s32 r1; - s32 r7; - s32 r9; - - r10 = &gUnknown_3001B60->unk18 + param_2; - r7 = param_1; - r1 = param_2 - 1; - if (r7 < r1) { - r9 = r1; - do { - r4 = r10; - r6 = r1; - iVar4 = r7 + 1; - for (; r6 > r7; r6--) { - if (GetAlphabetParentNo(gRecruitedPokemonRef->pokemon[r5 = r4 - 1, *r5].speciesNum, 0) > GetAlphabetParentNo(gRecruitedPokemonRef->pokemon[*r4].speciesNum, 0)) { - r1 = *r4; - *r4 = *r5; - *r5 = r1; - } - r4 = r5; - } - r7 = iVar4; - r1 = r9; - } while (iVar4 < r1); - } -} - -void SortbyName(s32 param_1,s32 param_2) -{ - s16 *r4; - s32 iVar4; - s16 *r10; - s16 *r5; - s32 r6; - s32 r1; - s32 r7; - s32 r9; - - r10 = &gUnknown_3001B60->unk18 + param_2; - r7 = param_1; - r1 = param_2 - 1; - if (r7 < r1) { - r9 = r1; - do { - r4 = r10; - r6 = r1; - iVar4 = r7 + 1; - for (; r6 > r7; r6--) { - r5 = r4 - 1; - if (ComparePokemonNames(*r5, *r4)) { - r1 = *r4; - *r4 = *r5; - *r5 = r1; - } - r4 = r5; - } - r7 = iVar4; - r1 = r9; - } while (iVar4 < r1); - } -} - -PokemonStruct1 *sub_80243E8(void) -{ - u8 buffer [40]; - u8 nameBuffer [20]; - PokemonStruct1 *pokeStruct = &gRecruitedPokemonRef->pokemon[gUnknown_3001B60->unk1A[gUnknown_3001B60->unk376 * gUnknown_3001B60->unk374 + gUnknown_3001B60->unk370]]; - - sub_80922B4(nameBuffer, pokeStruct->name, POKEMON_NAME_LENGTH); - sprintfStatic(buffer, gUnknown_80DC9A4,nameBuffer); // %s - return pokeStruct; -} - - - - - -// THIS IS A NEW FILE: - - - - - -bool8 sub_8024458(s16 speciesNum, s32 param_2) -{ - s32 speciesNum_s32 = speciesNum; - gUnknown_203B2AC = MemoryAlloc(sizeof(struct unkStruct_203B2AC), 8); - gUnknown_203B2AC->speciesNum = speciesNum_s32; - gUnknown_203B2AC->unkE0 = param_2; - gUnknown_203B2AC->unkE4 = &gUnknown_203B2AC->unkE8[param_2]; - sub_8006518(gUnknown_203B2AC->unkE8); - gUnknown_203B2AC->unkE8[gUnknown_203B2AC->unkE0] = gUnknown_80DC9C8; - gUnknown_203B2AC->unkE4->unk14 = gUnknown_203B2AC->unk148; - gUnknown_203B2AC->unk148[2] = 10; - sub_8024604(); - sub_802452C(); - sub_8013984(&gUnknown_203B2AC->input); - return TRUE; -} - -u32 sub_80244E4(void) -{ - switch(GetKeyPress(&gUnknown_203B2AC->input)) - { - case INPUT_B_BUTTON: - PlayMenuSoundEffect(1); - return 2; - case INPUT_A_BUTTON: - PlayMenuSoundEffect(0); - return 3; - default: - if (sub_8013938(&gUnknown_203B2AC->input) != 0) { - sub_802452C(); - return 1; - } - else { - return 0; - } - } -} - -void sub_802452C(void) -{ - sub_8024588(); - sub_80245D0(); -} - -void sub_802453C(void) -{ - if(gUnknown_203B2AC) - { - gUnknown_203B2AC->unkE8[gUnknown_203B2AC->unkE0] = gUnknown_80DC9B0; - ResetUnusedInputStruct(); - sub_800641C(gUnknown_203B2AC->unkE8, TRUE, TRUE); - MemoryFree(gUnknown_203B2AC); - gUnknown_203B2AC = NULL; - } -} - -void sub_8024588(void) -{ - gUnknown_203B2AC->unk148[0] = gUnknown_203B2AC->input.unk20; - gUnknown_203B2AC->unk148[1] = gUnknown_203B2AC->input.unk1E; - gUnknown_203B2AC->unk148[3] = 0; - ResetUnusedInputStruct(); - sub_800641C(gUnknown_203B2AC->unkE8, TRUE, TRUE); -} - -void sub_80245D0(void) -{ - CreatePokemonInfoTabScreen - (gUnknown_203B2AC->unk34[gUnknown_203B2AC->input.unk1E], - gUnknown_203B2AC->input.unk1E,&gUnknown_203B2AC->unk4C, - &gUnknown_203B2AC->unkB0,gUnknown_203B2AC->unkE0); -} - -void sub_8024604(void) -{ - PokemonStruct1 *pokeStruct; - u32 *iVar3; - - gUnknown_203B2AC->unk34[0] = 2; - gUnknown_203B2AC->unk34[1] = 3; - gUnknown_203B2AC->unk34[2] = 5; - sub_8013818(&gUnknown_203B2AC->input,3,1,gUnknown_203B2AC->unkE0); - iVar3 = &gUnknown_203B2AC->unk4C; - pokeStruct = &gRecruitedPokemonRef->pokemon[gUnknown_203B2AC->speciesNum]; - sub_808FF20(iVar3,pokeStruct, sub_80023E4(7)); -} diff --git a/src/code_8023868.c b/src/code_8023868.c new file mode 100644 index 00000000..33e3d0c2 --- /dev/null +++ b/src/code_8023868.c @@ -0,0 +1,174 @@ +#include "global.h" +#include "code_800D090.h" +#include "code_8023868.h" +#include "pokemon.h" +#include "pokemon_mid.h" +#include "text.h" +#include "text_util.h" + +//static // MAKE STATIC WHEN code_8023868.s IS DONE +IWRAM_DATA struct unkStruct_3001B60 *gUnknown_3001B60 = {0}; + +#include "data/code_8023868.h" + +static void SortbyAlphabetNo(s32, s32); +static void SortbyInternalNo(s32, s32); +static void SortbyName(s32, s32); + +//static bool8 sub_8024184(PokemonStruct1 *pokemon, u8 area); +//static void sub_80241A8(void); + +// THE REMAINING CODE FROM THIS FILE IS IN code_8023868.s STARTING WITH sub_8023868 + +//static // MAKE STATIC WHEN code_8023868.s IS DONE +bool8 sub_8024184(PokemonStruct1 *pokemon, u8 area) +{ + if (area == GetFriendArea(pokemon->speciesNum)) + return TRUE; + return FALSE; +} + +//static // MAKE STATIC WHEN code_8023868.s IS DONE +void sub_80241A8(void) +{ + switch (gUnknown_3001B60->sortMethod) { + case 2: + if (gUnknown_3001B60->unkC != gUnknown_3001B60->unk10) + SortbyAlphabetNo(gUnknown_3001B60->unkC, gUnknown_3001B60->unk10); + + if (gUnknown_3001B60->unk10 != gUnknown_3001B60->unk8) + SortbyAlphabetNo(gUnknown_3001B60->unk10, gUnknown_3001B60->unk8); + break; + case 3: + if (gUnknown_3001B60->unkC != gUnknown_3001B60->unk10) + SortbyName(gUnknown_3001B60->unkC, gUnknown_3001B60->unk10); + + if (gUnknown_3001B60->unk10 != gUnknown_3001B60->unk8) + SortbyName(gUnknown_3001B60->unk10, gUnknown_3001B60->unk8); + break; + case 1: + if (gUnknown_3001B60->unkC != gUnknown_3001B60->unk10) + SortbyInternalNo(gUnknown_3001B60->unkC, gUnknown_3001B60->unk10); + + if (gUnknown_3001B60->unk10 != gUnknown_3001B60->unk8) + SortbyInternalNo(gUnknown_3001B60->unk10, gUnknown_3001B60->unk8); + break; + } +} + +// TODO: Remove hacky if/do +static void SortbyInternalNo(s32 param_1, s32 param_2) +{ + s16 *r4; + s32 iVar4; + s16 *r10; + s16 *r5; + s32 r6; + s32 r1; + s32 r7; + s32 r9; + + r10 = &gUnknown_3001B60->unk18 + param_2; + r7 = param_1; + r1 = param_2 - 1; + if (r7 < r1) { + r9 = r1; + do { + r4 = r10; + r6 = r1; + iVar4 = r7 + 1; + for (; r6 > r7; r6--) { + if (GetInternalNo(gRecruitedPokemonRef->pokemon[r5 = r4 - 1, *r5].speciesNum) > GetInternalNo(gRecruitedPokemonRef->pokemon[*r4].speciesNum)) { + r1 = *r4; + *r4 = *r5; + *r5 = r1; + } + r4 = r5; + } + r7 = iVar4; + r1 = r9; + } while (iVar4 < r1); + } +} + +// TODO: Remove hacky if/do +static void SortbyAlphabetNo(s32 param_1, s32 param_2) +{ + s16 *r4; + s32 iVar4; + s16 *r10; + s16 *r5; + s32 r6; + s32 r1; + s32 r7; + s32 r9; + + r10 = &gUnknown_3001B60->unk18 + param_2; + r7 = param_1; + r1 = param_2 - 1; + if (r7 < r1) { + r9 = r1; + do { + r4 = r10; + r6 = r1; + iVar4 = r7 + 1; + for (; r6 > r7; r6--) { + if (GetAlphabetParentNo(gRecruitedPokemonRef->pokemon[r5 = r4 - 1, *r5].speciesNum, 0) > GetAlphabetParentNo(gRecruitedPokemonRef->pokemon[*r4].speciesNum, 0)) { + r1 = *r4; + *r4 = *r5; + *r5 = r1; + } + r4 = r5; + } + r7 = iVar4; + r1 = r9; + } while (iVar4 < r1); + } +} + +// TODO: Remove hacky if/do +static void SortbyName(s32 param_1, s32 param_2) +{ + s16 *r4; + s32 iVar4; + s16 *r10; + s16 *r5; + s32 r6; + s32 r1; + s32 r7; + s32 r9; + + r10 = &gUnknown_3001B60->unk18 + param_2; + r7 = param_1; + r1 = param_2 - 1; + if (r7 < r1) { + r9 = r1; + do { + r4 = r10; + r6 = r1; + iVar4 = r7 + 1; + for (; r6 > r7; r6--) { + r5 = r4 - 1; + if (ComparePokemonNames(*r5, *r4)) { + r1 = *r4; + *r4 = *r5; + *r5 = r1; + } + r4 = r5; + } + r7 = iVar4; + r1 = r9; + } while (iVar4 < r1); + } +} + +UNUSED static PokemonStruct1 *sub_80243E8(void) +{ + u8 buffer[40]; + u8 nameBuffer[20]; + PokemonStruct1 *pokeStruct = &gRecruitedPokemonRef->pokemon[gUnknown_3001B60->unk1A[(gUnknown_3001B60->unk376 * gUnknown_3001B60->unk374) + gUnknown_3001B60->unk370]]; + + sub_80922B4(nameBuffer, pokeStruct->name, POKEMON_NAME_LENGTH); + sprintfStatic(buffer, sUnknown_80DC9A4, nameBuffer); + return pokeStruct; +} \ No newline at end of file diff --git a/src/code_8024458.c b/src/code_8024458.c new file mode 100644 index 00000000..59ed7c2a --- /dev/null +++ b/src/code_8024458.c @@ -0,0 +1,101 @@ +#include "global.h" +#include "code_80118A4.h" +#include "code_8024458.h" +#include "constants/input.h" +#include "event_flag.h" +#include "memory.h" +#include "menu_input.h" +#include "pokemon.h" +#include "pokemon_3.h" +#include "text1.h" +#include "text2.h" + +static EWRAM_DATA_2 struct unkStruct_203B2AC *sUnknown_203B2AC = {0}; + +#include "data/code_8024458.h" + +static void sub_8024588(void); +static void sub_80245D0(void); +static void sub_8024604(void); + +bool8 sub_8024458(s16 speciesNum, s32 a1) +{ + s32 speciesNum_s32 = speciesNum; + + sUnknown_203B2AC = MemoryAlloc(sizeof(struct unkStruct_203B2AC), 8); + sUnknown_203B2AC->speciesNum = speciesNum_s32; + sUnknown_203B2AC->unkE0 = a1; + sUnknown_203B2AC->unkE4 = &sUnknown_203B2AC->unkE8[a1]; + sub_8006518(sUnknown_203B2AC->unkE8); + sUnknown_203B2AC->unkE8[sUnknown_203B2AC->unkE0] = sUnknown_80DC9C8; + sUnknown_203B2AC->unkE4->unk14 = sUnknown_203B2AC->unk148; + sUnknown_203B2AC->unk148[2] = 10; + sub_8024604(); + sub_802452C(); + sub_8013984(&sUnknown_203B2AC->input); + return TRUE; +} + +u32 sub_80244E4(void) +{ + switch (GetKeyPress(&sUnknown_203B2AC->input)) { + case INPUT_B_BUTTON: + PlayMenuSoundEffect(1); + return 2; + case INPUT_A_BUTTON: + PlayMenuSoundEffect(0); + return 3; + default: + if (sub_8013938(&sUnknown_203B2AC->input)) { + sub_802452C(); + return 1; + } + return 0; + } +} + +void sub_802452C(void) +{ + sub_8024588(); + sub_80245D0(); +} + +void sub_802453C(void) +{ + if (sUnknown_203B2AC != NULL) { + sUnknown_203B2AC->unkE8[sUnknown_203B2AC->unkE0] = sUnknown_80DC9B0; + ResetUnusedInputStruct(); + sub_800641C(sUnknown_203B2AC->unkE8, TRUE, TRUE); + MemoryFree(sUnknown_203B2AC); + sUnknown_203B2AC = NULL; + } +} + +static void sub_8024588(void) +{ + sUnknown_203B2AC->unk148[0] = sUnknown_203B2AC->input.unk20; + sUnknown_203B2AC->unk148[1] = sUnknown_203B2AC->input.unk1E; + sUnknown_203B2AC->unk148[3] = 0; + ResetUnusedInputStruct(); + sub_800641C(sUnknown_203B2AC->unkE8, TRUE, TRUE); +} + +static void sub_80245D0(void) +{ + CreatePokemonInfoTabScreen(sUnknown_203B2AC->unk34[sUnknown_203B2AC->input.unk1E], sUnknown_203B2AC->input.unk1E, &sUnknown_203B2AC->unk4C, &sUnknown_203B2AC->unkB0, sUnknown_203B2AC->unkE0); +} + +static void sub_8024604(void) +{ + PokemonStruct1 *pokeStruct; + u32 *iVar3; + + sUnknown_203B2AC->unk34[0] = 2; + sUnknown_203B2AC->unk34[1] = 3; + sUnknown_203B2AC->unk34[2] = 5; + + sub_8013818(&sUnknown_203B2AC->input, 3, 1, sUnknown_203B2AC->unkE0); + iVar3 = &sUnknown_203B2AC->unk4C; + pokeStruct = &gRecruitedPokemonRef->pokemon[sUnknown_203B2AC->speciesNum]; + sub_808FF20(iVar3, pokeStruct, sub_80023E4(7)); +} \ No newline at end of file diff --git a/src/data/code_8023868.h b/src/data/code_8023868.h new file mode 100644 index 00000000..0b23b586 --- /dev/null +++ b/src/data/code_8023868.h @@ -0,0 +1,29 @@ +ALIGNED(4) static const u8 sFill[] = _("pksdir0"); + +//static // MAKE STATIC WHEN code_8023868.s IS DONE +const UnkTextStruct2 sUnknown_80DC950 = { + 0, 0, 0, 0, + 3, + 0, 0, + 0, 0, + 0, 0, + NULL +}; +//static // MAKE STATIC WHEN code_8023868.s IS DONE +const UnkTextStruct2 sUnknown_80DC968 = { + 0, 0, 0, 0, + 6, + 2, 2, + 15, 14, + 14, 0, + NULL +}; + +ALIGNED(4) //static // MAKE STATIC WHEN code_8023868.s IS DONE +const u8 sUnknown_80DC980[] = _("Friends"); +ALIGNED(4) //static // MAKE STATIC WHEN code_8023868.s IS DONE +const u8 sUnknown_80DC988[] = _("Pokémon Friends"); +ALIGNED(4) //static // MAKE STATIC WHEN code_8023868.s IS DONE +const u8 sUnknown_80DC998[] = _("{COLOR_2}%c%s{END_COLOR_TEXT_2}"); +ALIGNED(4) //static // MAKE STATIC WHEN code_8023868.s IS DONE +const u8 sUnknown_80DC9A4[] = _("%s"); \ No newline at end of file diff --git a/src/data/code_8024458.h b/src/data/code_8024458.h new file mode 100644 index 00000000..0686a44a --- /dev/null +++ b/src/data/code_8024458.h @@ -0,0 +1,19 @@ +ALIGNED(4) static const u8 sFill[] = _("pksdir0"); + +static const UnkTextStruct2 sUnknown_80DC9B0 = { + 0, 0, 0, 0, + 3, + 0, 0, + 0, 0, + 0, 0, + NULL +}; + +static const UnkTextStruct2 sUnknown_80DC9C8 = { + 0, 0, 0, 0, + 6, + 2, 2, + 18, 14, + 18, 2, + NULL +}; \ No newline at end of file diff --git a/src/data/wigglytuff_shop1.h b/src/data/wigglytuff_shop1.h index fbeacc69..baa53029 100644 --- a/src/data/wigglytuff_shop1.h +++ b/src/data/wigglytuff_shop1.h @@ -1,6 +1,6 @@ ALIGNED(4) static const u8 sFill[] = _("pksdir0"); -static const UnkTextStruct2 gUnknown_80DC464 = { +static const UnkTextStruct2 sUnknown_80DC464 = { 0, 0, 0, 0, 3, 0, 0, @@ -9,7 +9,7 @@ static const UnkTextStruct2 gUnknown_80DC464 = { NULL }; -static const UnkTextStruct2 gUnknown_80DC47C = { +static const UnkTextStruct2 sUnknown_80DC47C = { 0, 0, 0, 0, 6, 2, 2, @@ -18,6 +18,6 @@ static const UnkTextStruct2 gUnknown_80DC47C = { NULL }; -ALIGNED(4) static const u8 gUnknown_80DC494[] = _("Friend Areas"); -ALIGNED(4) static const u8 gUnknown_80DC4A4[] = _("{COLOR_1 RED}%s{END_COLOR_TEXT_1}"); -ALIGNED(4) static const u8 gUnknown_80DC4AC[] = _("{COLOR_1 GREEN}%s{END_COLOR_TEXT_1}"); \ No newline at end of file +ALIGNED(4) static const u8 sFriendAreas[] = _("Friend Areas"); +ALIGNED(4) static const u8 sFmtRedString[] = _("{COLOR_1 RED}%s{END_COLOR_TEXT_1}"); +ALIGNED(4) static const u8 sFmtGreenString[] = _("{COLOR_1 GREEN}%s{END_COLOR_TEXT_1}"); \ No newline at end of file diff --git a/src/data/wigglytuff_shop2.h b/src/data/wigglytuff_shop2.h index 20870f33..c686529a 100644 --- a/src/data/wigglytuff_shop2.h +++ b/src/data/wigglytuff_shop2.h @@ -1,6 +1,6 @@ ALIGNED(4) static const u8 sFill[] = _("pksdir0"); -static const UnkTextStruct2 gUnknown_80DC4BC = { +static const UnkTextStruct2 sUnknown_80DC4BC = { 0, 0, 0, 0, 3, 0, 0, @@ -10,7 +10,7 @@ static const UnkTextStruct2 gUnknown_80DC4BC = { }; static const u8 sUnknown_80DC4D4[] = {1, 0, 18, 0}; -static const UnkTextStruct2 gUnknown_80DC4D8 = { +static const UnkTextStruct2 sUnknown_80DC4D8 = { 0, 0, 0, 0, 6, 2, 2, @@ -19,6 +19,6 @@ static const UnkTextStruct2 gUnknown_80DC4D8 = { sUnknown_80DC4D4 }; -ALIGNED(4) static const u8 gUnknown_80DC4F0[] = _("Inhabitants (Friends: {COLOR_2 CYAN}Light blue{END_COLOR_TEXT_2})"); -ALIGNED(4) static const u8 gUnknown_80DC518[] = _("Inhabitants"); -ALIGNED(4) static const u8 gUnknown_80DC524[] = _("{COLOR_2 CYAN}%s{END_COLOR_TEXT_2}"); \ No newline at end of file +ALIGNED(4) static const u8 sUnknown_80DC4F0[] = _("Inhabitants (Friends: {COLOR_2 CYAN}Light blue{END_COLOR_TEXT_2})"); +ALIGNED(4) static const u8 sInhabitants[] = _("Inhabitants"); +ALIGNED(4) static const u8 sFmtCyanString[] = _("{COLOR_2 CYAN}%s{END_COLOR_TEXT_2}"); \ No newline at end of file diff --git a/src/data/wigglytuff_shop3.h b/src/data/wigglytuff_shop3.h index f94e1e67..be6359c7 100644 --- a/src/data/wigglytuff_shop3.h +++ b/src/data/wigglytuff_shop3.h @@ -1,6 +1,6 @@ ALIGNED(4) static const u8 sFill[] = _("pksdir0"); -static const UnkTextStruct2 gUnknown_80DC534 = { +static const UnkTextStruct2 sUnknown_80DC534 = { 0, 0, 0, 0, 3, 0, 0, @@ -9,7 +9,7 @@ static const UnkTextStruct2 gUnknown_80DC534 = { NULL }; -static const UnkTextStruct2 gUnknown_80DC54C = { +static const UnkTextStruct2 sUnknown_80DC54C = { 0, 0, 0, 0, 3, 21, 4, @@ -18,7 +18,7 @@ static const UnkTextStruct2 gUnknown_80DC54C = { NULL }; -static const UnkTextStruct2 gUnknown_80DC564 = { +static const UnkTextStruct2 sUnknown_80DC564 = { 0, 0, 0, 0, 3, 21, 14, diff --git a/src/debug_menu4.c b/src/debug_menu4.c index 7903afb9..26813102 100644 --- a/src/debug_menu4.c +++ b/src/debug_menu4.c @@ -1,7 +1,7 @@ #include "global.h" #include "code_8012A18_1.h" #include "code_80130A8.h" -#include "code_801EE10_1.h" +#include "code_8023868.h" #include "debug_menu4.h" #include "memory.h" #include "menu_input.h" diff --git a/src/friend_area_action_menu.c b/src/friend_area_action_menu.c index fffc4081..e04df070 100644 --- a/src/friend_area_action_menu.c +++ b/src/friend_area_action_menu.c @@ -3,8 +3,9 @@ #include "code_801B3C0.h" #include "code_801BEEC.h" #include "code_801EE10.h" -#include "code_801EE10_1.h" #include "code_801EE10_mid.h" +#include "code_8023868.h" +#include "code_8024458.h" #include "code_8098BDC.h" #include "common_strings.h" #include "constants/dungeon.h" diff --git a/src/friend_list_menu.c b/src/friend_list_menu.c index 56e144f5..6a3a37a6 100644 --- a/src/friend_list_menu.c +++ b/src/friend_list_menu.c @@ -5,8 +5,9 @@ #include "code_801B3C0.h" #include "code_801BEEC.h" #include "code_801EE10.h" -#include "code_801EE10_1.h" #include "code_801EE10_mid.h" +#include "code_8023868.h" +#include "code_8024458.h" #include "code_8098BDC.h" #include "common_strings.h" #include "constants/dungeon.h" diff --git a/src/friend_rescue.c b/src/friend_rescue.c index 08793e2a..1b81310e 100644 --- a/src/friend_rescue.c +++ b/src/friend_rescue.c @@ -2,8 +2,9 @@ #include "code_80118A4.h" #include "code_80130A8.h" #include "code_801B3C0.h" -#include "code_801EE10_1.h" #include "code_801C8C4.h" +#include "code_8023868.h" +#include "code_8024458.h" #include "code_8094F88.h" #include "constants/communication_error_codes.h" #include "constants/monster.h" @@ -266,7 +267,6 @@ extern u8 sub_80307EC(void); extern u32 sub_8031DCC(void); extern void sub_8031E10(void); extern void sub_8031E00(void); -extern void sub_802452C(void); extern u32 sub_8039068(u32, u8 *passwordBuffer, unkStruct_203B480 *r0); extern void sub_803084C(void); diff --git a/src/gulpin_shop_801FB50.c b/src/gulpin_shop_801FB50.c index 3e242ce6..a65f5785 100644 --- a/src/gulpin_shop_801FB50.c +++ b/src/gulpin_shop_801FB50.c @@ -3,8 +3,9 @@ #include "code_80130A8.h" #include "code_801BEEC.h" #include "code_801EE10.h" -#include "code_801EE10_1.h" #include "code_801EE10_mid.h" +#include "code_8023868.h" +#include "code_8024458.h" #include "common_strings.h" #include "felicity_bank.h" #include "gulpin_shop.h" diff --git a/src/party_list_menu.c b/src/party_list_menu.c index 9b6eee69..c4bc5f50 100644 --- a/src/party_list_menu.c +++ b/src/party_list_menu.c @@ -5,9 +5,9 @@ #include "code_801B3C0.h" #include "code_801BEEC.h" #include "code_801EE10.h" -#include "code_801EE10_1.h" #include "code_801EE10_mid.h" #include "code_8023144.h" +#include "code_8024458.h" #include "code_8098BDC.h" #include "common_strings.h" #include "constants/dungeon.h" diff --git a/src/pokemon_mid.c b/src/pokemon_mid.c index 49dc259c..d108fe99 100644 --- a/src/pokemon_mid.c +++ b/src/pokemon_mid.c @@ -207,7 +207,8 @@ bool8 IsPokemonRenamed(PokemonStruct1* pokemon) { return TRUE; } -bool8 ComparePokemonNames(s16 a1, s16 a2) { +bool8 ComparePokemonNames(s16 a1, s16 a2) +{ s32 index1 = a1; s32 index2 = a2; u8* name1 = gRecruitedPokemonRef->pokemon[index1].name; diff --git a/src/wigglytuff_shop1.c b/src/wigglytuff_shop1.c index fa37d1c3..3122cb8b 100644 --- a/src/wigglytuff_shop1.c +++ b/src/wigglytuff_shop1.c @@ -31,7 +31,7 @@ bool8 sub_80211AC(u32 mode, u32 a1) sWigglytuffShop1Work->unk74 = a1; sWigglytuffShop1Work->unk78 = &sWigglytuffShop1Work->unk7C[sWigglytuffShop1Work->unk74]; sub_8006518(sWigglytuffShop1Work->unk7C); - sWigglytuffShop1Work->unk7C[sWigglytuffShop1Work->unk74] = gUnknown_80DC47C; + sWigglytuffShop1Work->unk7C[sWigglytuffShop1Work->unk74] = sUnknown_80DC47C; sWigglytuffShop1Work->unk78->unk14 = sWigglytuffShop1Work->unkDC; ResetUnusedInputStruct(); sub_800641C(sWigglytuffShop1Work->unk7C, TRUE, TRUE); @@ -102,7 +102,7 @@ void sub_80213A0(void) sUnknown_203B284 = sWigglytuffShop1Work->mode; sUnknown_203B288 = sWigglytuffShop1Work->unk40.menuIndex; sUnknown_203B28A = sWigglytuffShop1Work->unk40.unk1E; - sWigglytuffShop1Work->unk7C[sWigglytuffShop1Work->unk74] = gUnknown_80DC464; + sWigglytuffShop1Work->unk7C[sWigglytuffShop1Work->unk74] = sUnknown_80DC464; ResetUnusedInputStruct(); sub_800641C(sWigglytuffShop1Work->unk7C, TRUE, TRUE); MemoryFree(sWigglytuffShop1Work); @@ -185,7 +185,7 @@ void sub_8021494(void) sub_8008C54(sWigglytuffShop1Work->unk74); sub_80073B8(sWigglytuffShop1Work->unk74); - xxx_call_draw_string(10, 0, gUnknown_80DC494, sWigglytuffShop1Work->unk74, 0); + xxx_call_draw_string(10, 0, sFriendAreas, sWigglytuffShop1Work->unk74, 0); sub_8012BC4((sWigglytuffShop1Work->unkDC[2] * 8) + 4, 0, sWigglytuffShop1Work->unk40.unk1E + 1, 1, 7, sWigglytuffShop1Work->unk74); @@ -198,7 +198,7 @@ void sub_8021494(void) if (GetFriendAreaPrice(friendAreaIndex) <= gTeamInventoryRef->teamMoney) xxx_call_draw_string(8,sub_8013800(&sWigglytuffShop1Work->unk40, i), buffer1, sWigglytuffShop1Work->unk74, 0); else { - sprintfStatic(buffer2, gUnknown_80DC4A4, buffer1); + sprintfStatic(buffer2, sFmtRedString, buffer1); xxx_call_draw_string(8, sub_8013800(&sWigglytuffShop1Work->unk40, i), buffer2, sWigglytuffShop1Work->unk74, 0); } } @@ -206,7 +206,7 @@ void sub_8021494(void) if (gFriendAreas[friendAreaIndex] == TRUE) xxx_call_draw_string(8, sub_8013800(&sWigglytuffShop1Work->unk40, i), GetFriendAreaName(friendAreaIndex), sWigglytuffShop1Work->unk74, 0); else { - sprintfStatic(buffer2, gUnknown_80DC4AC, GetFriendAreaName(friendAreaIndex)); + sprintfStatic(buffer2, sFmtGreenString, GetFriendAreaName(friendAreaIndex)); xxx_call_draw_string(8, sub_8013800(&sWigglytuffShop1Work->unk40, i), buffer2, sWigglytuffShop1Work->unk74, 0); } } diff --git a/src/wigglytuff_shop2.c b/src/wigglytuff_shop2.c index e3531601..473a5ae2 100644 --- a/src/wigglytuff_shop2.c +++ b/src/wigglytuff_shop2.c @@ -32,7 +32,7 @@ bool8 sub_8021774(u8 friendArea, bool8 a1, s32 a2) sWigglytuffShop2Work->unk74 = a2; sWigglytuffShop2Work->unk78 = &sWigglytuffShop2Work->unk7C[a2]; sub_8006518(sWigglytuffShop2Work->unk7C); - sWigglytuffShop2Work->unk7C[sWigglytuffShop2Work->unk74] = gUnknown_80DC4D8; + sWigglytuffShop2Work->unk7C[sWigglytuffShop2Work->unk74] = sUnknown_80DC4D8; sub_8021820(); return TRUE; } @@ -60,7 +60,7 @@ static void sub_8021820(void) void sub_8021830(void) { if (sWigglytuffShop2Work) { - sWigglytuffShop2Work->unk7C[sWigglytuffShop2Work->unk74] = gUnknown_80DC4BC; + sWigglytuffShop2Work->unk7C[sWigglytuffShop2Work->unk74] = sUnknown_80DC4BC; ResetUnusedInputStruct(); sub_800641C(sWigglytuffShop2Work->unk7C, TRUE, TRUE); MemoryFree(sWigglytuffShop2Work); @@ -91,9 +91,9 @@ static void sub_8021894(void) xxx_call_draw_string(10, 20, string, sWigglytuffShop2Work->unk74, 0); if (sWigglytuffShop2Work->unkD != 0) - xxx_call_draw_string(32, 60, gUnknown_80DC4F0, sWigglytuffShop2Work->unk74, 0); + xxx_call_draw_string(32, 60, sUnknown_80DC4F0, sWigglytuffShop2Work->unk74, 0); else - xxx_call_draw_string(32, 60, gUnknown_80DC518, sWigglytuffShop2Work->unk74, 0); + xxx_call_draw_string(32, 60, sInhabitants, sWigglytuffShop2Work->unk74, 0); sub_800792C(sWigglytuffShop2Work->unk74, 4, 64, 20, 4); @@ -119,7 +119,7 @@ static void sub_8021894(void) xxx_call_draw_string(x, y, buffer2, sWigglytuffShop2Work->unk74, 0); break; case 2: - sprintfStatic(buffer1, gUnknown_80DC524, buffer2); + sprintfStatic(buffer1, sFmtCyanString, buffer2); xxx_call_draw_string(x, y, buffer1, sWigglytuffShop2Work->unk74, 0); break; } diff --git a/src/wigglytuff_shop3.c b/src/wigglytuff_shop3.c index 04710413..a98776ae 100644 --- a/src/wigglytuff_shop3.c +++ b/src/wigglytuff_shop3.c @@ -141,16 +141,16 @@ static void sub_8021D5C(void) switch (sWigglytuffShop3Work->state) { case WIGGLYTUFF_UNK9: case WIGGLYTUFF_UNKA: - sWigglytuffShop3Work->unkD0[0] = gUnknown_80DC534; - sWigglytuffShop3Work->unkD0[2] = gUnknown_80DC534; - sWigglytuffShop3Work->unkD0[1] = gUnknown_80DC564; + sWigglytuffShop3Work->unkD0[0] = sUnknown_80DC534; + sWigglytuffShop3Work->unkD0[2] = sUnknown_80DC534; + sWigglytuffShop3Work->unkD0[1] = sUnknown_80DC564; break; case WIGGLYTUFF_UNKB: - sWigglytuffShop3Work->unkD0[2] = gUnknown_80DC54C; + sWigglytuffShop3Work->unkD0[2] = sUnknown_80DC54C; break; default: for (i = 0; i < 4; i++) - sWigglytuffShop3Work->unkD0[i] = gUnknown_80DC534; + sWigglytuffShop3Work->unkD0[i] = sUnknown_80DC534; break; } diff --git a/src/wonder_mail.c b/src/wonder_mail.c index c2365a6c..56b88298 100644 --- a/src/wonder_mail.c +++ b/src/wonder_mail.c @@ -1,7 +1,8 @@ #include "global.h" #include "code_80118A4.h" -#include "code_801EE10_1.h" #include "code_80130A8.h" +#include "code_8023868.h" +#include "code_8024458.h" #include "code_8094F88.h" #include "code_80A26CC.h" #include "constants/communication_error_codes.h" @@ -46,7 +47,6 @@ extern u32 sub_80154F0(); extern u32 sub_8039068(u32, u8 *r1, unkStruct_203B480 *r0); extern void sub_8095274(u32); extern void sub_80155F0(); -extern void sub_802452C(); extern u32 sub_8031DCC(); extern void sub_8031E10(); extern void sub_8031E00(); diff --git a/sym_ewram2.txt b/sym_ewram2.txt index deb468df..cb615395 100644 --- a/sym_ewram2.txt +++ b/sym_ewram2.txt @@ -207,9 +207,7 @@ gUnknown_203B2A8: /* 203B2A8 (sub_8023868 - sub_8023C60) */ gUnknown_203B2AA: /* 203B2AA (sub_8023868 - sub_8023C60) */ .space 0x2 -gUnknown_203B2AC: /* 203B2AC (sub_8024458 - sub_8024604) */ - .space 0x4 - +.include "src/code_8024458.o" .include "src/luminous_cave.o" .include "src/friend_list_menu.o" .include "src/party_list_menu.o" diff --git a/sym_iwram.txt b/sym_iwram.txt index 9abe20db..39a8e9b3 100644 --- a/sym_iwram.txt +++ b/sym_iwram.txt @@ -29,8 +29,7 @@ gUnknown_3001B5A: /* 3001B5A */ gUnknown_3001B5C: /* 3001B5C */ .space 0x4 -gUnknown_3001B60: /* 3001B60 */ - .space 0x4 +.include "src/code_8023868.o" gUnknown_3001B64: /* 3001B64 */ .space 0x4