diff --git a/asm/daycare.s b/asm/daycare.s deleted file mode 100644 index a25f2a40c..000000000 --- a/asm/daycare.s +++ /dev/null @@ -1,3193 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start GetMonNick -GetMonNick: @ 806FA2C - push {r4,lr} - sub sp, 0x14 - adds r4, r1, 0 - movs r1, 0x2 - mov r2, sp - bl GetMonData - adds r0, r4, 0 - mov r1, sp - bl StringCopy10 - add sp, 0x14 - pop {r4} - pop {r1} - bx r1 - thumb_func_end GetMonNick - - thumb_func_start GetBoxMonNick -GetBoxMonNick: @ 806FA4C - push {r4,lr} - sub sp, 0x14 - adds r4, r1, 0 - movs r1, 0x2 - mov r2, sp - bl GetBoxMonData - adds r0, r4, 0 - mov r1, sp - bl StringCopy10 - add sp, 0x14 - pop {r4} - pop {r1} - bx r1 - thumb_func_end GetBoxMonNick - - thumb_func_start daycare_count_pokemon -daycare_count_pokemon: @ 806FA6C - push {r4-r6,lr} - adds r6, r0, 0 - movs r5, 0 - movs r4, 0 -_0806FA74: - movs r0, 0x8C - muls r0, r4 - adds r0, r6, r0 - movs r1, 0xB - bl GetBoxMonData - cmp r0, 0 - beq _0806FA8A - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 -_0806FA8A: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bls _0806FA74 - adds r0, r5, 0 - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end daycare_count_pokemon - - thumb_func_start sub_806FA9C -sub_806FA9C: @ 806FA9C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - mov r9, r0 - mov r10, r1 - movs r7, 0 - movs r5, 0 - mov r6, r10 - adds r6, 0x74 - movs r0, 0x1 - mov r8, r0 -_0806FAB6: - movs r0, 0x8C - muls r0, r5 - mov r1, r9 - adds r4, r1, r0 - adds r0, r4, 0 - movs r1, 0xB - bl GetBoxMonData - cmp r0, 0 - beq _0806FAE4 - adds r0, r7, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - adds r0, r4, 0 - movs r1, 0xC - bl GetBoxMonData - adds r1, r0, 0 - cmp r1, 0 - bne _0806FAE4 - lsls r0, r5, 1 - adds r0, r6, r0 - b _0806FAEA -_0806FAE4: - lsls r0, r5, 1 - adds r0, r6, r0 - mov r1, r8 -_0806FAEA: - strh r1, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x1 - bls _0806FAB6 - mov r0, r10 - str r7, [r0, 0x70] - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_806FA9C - - thumb_func_start daycare_empty_slot -@ u8 daycare_empty_slot(struct daycare_mon *dayCareMons) -daycare_empty_slot: @ 806FB08 - push {r4,r5,lr} - adds r5, r0, 0 - movs r4, 0 -_0806FB0E: - movs r0, 0x8C - muls r0, r4 - adds r0, r5, r0 - movs r1, 0xB - bl GetBoxMonData - cmp r0, 0 - bne _0806FB24 - lsls r0, r4, 24 - asrs r0, 24 - b _0806FB32 -_0806FB24: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bls _0806FB0E - movs r0, 0x1 - negs r0, r0 -_0806FB32: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end daycare_empty_slot - - thumb_func_start sub_806FB38 -@ void sub_806FB38(struct pokemon *mon, struct daycare_mon *dayCareMon) -sub_806FB38: @ 806FB38 - push {r4-r6,lr} - adds r6, r0, 0 - adds r5, r1, 0 - bl sub_80D43F0 - lsls r0, 24 - cmp r0, 0 - beq _0806FBBC - adds r0, r5, 0 - adds r0, 0x74 - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - bl StringCopy - adds r4, r5, 0 - adds r4, 0x7C - adds r0, r6, 0 - adds r1, r4, 0 - bl GetMonNick - adds r0, r4, 0 - bl StripExtCtrlCodes - adds r4, 0xB - ldrb r1, [r4] - movs r0, 0x10 - negs r0, r0 - ands r0, r1 - movs r1, 0x2 - orrs r0, r1 - strb r0, [r4] - adds r0, r6, 0 - movs r1, 0x3 - bl GetMonData - lsls r0, 4 - ldrb r2, [r4] - movs r1, 0xF - ands r1, r2 - orrs r1, r0 - strb r1, [r4] - adds r0, r6, 0 - movs r1, 0x40 - bl GetMonData - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gSaveBlock1Ptr - ldr r1, [r1] - lsls r2, r0, 3 - adds r2, r0 - lsls r2, 2 - adds r1, r2 - adds r0, r5, 0 - adds r0, 0x50 - ldr r2, =0x00002be0 - adds r1, r2 - ldm r1!, {r2-r4} - stm r0!, {r2-r4} - ldm r1!, {r2-r4} - stm r0!, {r2-r4} - ldm r1!, {r2-r4} - stm r0!, {r2-r4} - adds r0, r6, 0 - bl sub_80D4680 -_0806FBBC: - adds r0, r5, 0 - adds r1, r6, 0 - movs r2, 0x50 - bl memcpy - adds r0, r5, 0 - bl BoxMonRestorePP - adds r1, r5, 0 - adds r1, 0x88 - movs r0, 0 - str r0, [r1] - adds r0, r6, 0 - bl ZeroMonData - bl party_compaction - bl CalculatePlayerPartyCount - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806FB38 - - thumb_func_start daycare_send -@ void daycare_send(struct pokemon *mon, struct daycare_mon *dayCareMons) -daycare_send: @ 806FBF4 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - adds r0, r4, 0 - bl daycare_empty_slot - lsls r0, 24 - asrs r0, 24 - movs r1, 0x8C - muls r0, r1 - adds r4, r0 - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_806FB38 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end daycare_send - - thumb_func_start daycare_send_selected_pokemon -daycare_send_selected_pokemon: @ 806FC18 - push {lr} - bl brm_get_pokemon_selection - lsls r0, 24 - lsrs r0, 24 - movs r1, 0x64 - muls r0, r1 - ldr r1, =gPlayerParty - adds r0, r1 - ldr r1, =gSaveBlock1Ptr - ldr r1, [r1] - ldr r2, =0x00003030 - adds r1, r2 - bl daycare_send - pop {r0} - bx r0 - .pool - thumb_func_end daycare_send_selected_pokemon - - thumb_func_start sub_806FC48 -sub_806FC48: @ 806FC48 - push {r4-r6,lr} - adds r5, r0, 0 - adds r4, r5, 0 - adds r4, 0x8C - adds r0, r4, 0 - movs r1, 0xB - bl GetBoxMonData - cmp r0, 0 - beq _0806FC9E - adds r0, r5, 0 - movs r1, 0xB - bl GetBoxMonData - adds r6, r0, 0 - cmp r6, 0 - bne _0806FC9E - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0x50 - bl memcpy - adds r0, r4, 0 - bl ZeroBoxMonData - adds r4, 0x50 - adds r0, r5, 0 - adds r0, 0x50 - adds r1, r4, 0 - movs r2, 0x38 - bl memcpy - adds r2, r5, 0 - adds r2, 0x88 - movs r0, 0x8A - lsls r0, 1 - adds r1, r5, r0 - ldr r0, [r1] - str r0, [r2] - str r6, [r1] - adds r0, r4, 0 - bl sub_806FF80 -_0806FC9E: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_806FC48 - - thumb_func_start sub_806FCA4 -sub_806FCA4: @ 806FCA4 - push {r4-r7,lr} - adds r4, r0, 0 - movs r5, 0 - ldr r7, =0x0000ffff -_0806FCAC: - adds r0, r4, 0 - bl TryIncrementMonLevel - lsls r0, 24 - cmp r0, 0 - beq _0806FCE8 - movs r6, 0x1 - adds r5, 0x1 - b _0806FCD4 - .pool -_0806FCC4: - movs r6, 0 - cmp r0, r7 - bne _0806FCD4 - ldr r0, =gMoveToLearn - ldrh r1, [r0] - adds r0, r4, 0 - bl DeleteFirstMoveAndGiveMoveToMon -_0806FCD4: - adds r0, r4, 0 - adds r1, r6, 0 - bl MonTryLearningNewMove - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0 - bne _0806FCC4 - cmp r5, 0x63 - ble _0806FCAC -_0806FCE8: - adds r0, r4, 0 - bl CalculateMonStats - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_806FCA4 - - thumb_func_start sub_806FCF8 -sub_806FCF8: @ 806FCF8 - push {r4-r7,lr} - sub sp, 0x68 - adds r5, r0, 0 - ldr r1, =gStringVar1 - bl GetBoxMonNick - adds r0, r5, 0 - movs r1, 0xB - bl GetBoxMonData - lsls r0, 16 - lsrs r7, r0, 16 - adds r0, r5, 0 - mov r1, sp - bl sub_8069004 - mov r0, sp - movs r1, 0x38 - bl GetMonData - cmp r0, 0x64 - beq _0806FD46 - mov r0, sp - movs r1, 0x19 - bl GetMonData - adds r1, r5, 0 - adds r1, 0x88 - ldr r1, [r1] - adds r0, r1 - str r0, [sp, 0x64] - add r2, sp, 0x64 - mov r0, sp - movs r1, 0x19 - bl SetMonData - mov r0, sp - bl sub_806FCA4 -_0806FD46: - ldr r0, =gPlayerParty - movs r1, 0xFA - lsls r1, 1 - adds r6, r0, r1 - adds r0, r6, 0 - mov r1, sp - movs r2, 0x64 - bl memcpy - adds r0, r5, 0 - adds r0, 0x70 - ldrh r0, [r0] - cmp r0, 0 - beq _0806FD74 - adds r4, r5, 0 - adds r4, 0x50 - adds r0, r6, 0 - adds r1, r4, 0 - bl sub_80D460C - adds r0, r4, 0 - bl sub_806FF80 -_0806FD74: - adds r0, r5, 0 - bl ZeroBoxMonData - adds r1, r5, 0 - adds r1, 0x88 - movs r0, 0 - str r0, [r1] - bl party_compaction - bl CalculatePlayerPartyCount - adds r0, r7, 0 - add sp, 0x68 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806FCF8 - - thumb_func_start sub_806FD9C -sub_806FD9C: @ 806FD9C - push {r4,r5,lr} - adds r5, r0, 0 - lsls r1, 24 - lsrs r1, 24 - movs r0, 0x8C - muls r0, r1 - adds r0, r5, r0 - bl sub_806FCF8 - adds r4, r0, 0 - lsls r4, 16 - lsrs r4, 16 - adds r0, r5, 0 - bl sub_806FC48 - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_806FD9C - - thumb_func_start sub_806FDC4 -sub_806FDC4: @ 806FDC4 - push {lr} - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003030 - adds r0, r1 - ldr r1, =gSpecialVar_0x8004 - ldrb r1, [r1] - bl sub_806FD9C - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - .pool - thumb_func_end sub_806FDC4 - - thumb_func_start sub_806FDEC -sub_806FDEC: @ 806FDEC - push {r4,r5,lr} - sub sp, 0x54 - adds r4, r0, 0 - adds r5, r1, 0 - mov r0, sp - adds r1, r4, 0 - movs r2, 0x50 - bl memcpy - adds r0, r4, 0 - movs r1, 0x19 - bl GetBoxMonData - adds r0, r5 - str r0, [sp, 0x50] - add r2, sp, 0x50 - mov r0, sp - movs r1, 0x19 - bl SetBoxMonData - mov r0, sp - bl GetLevelFromBoxMonExp - lsls r0, 24 - lsrs r0, 24 - add sp, 0x54 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_806FDEC - - thumb_func_start sub_806FE28 -sub_806FE28: @ 806FE28 - push {r4,r5,lr} - adds r5, r0, 0 - bl GetLevelFromBoxMonExp - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r5, 0 - adds r0, 0x88 - ldr r1, [r0] - adds r0, r5, 0 - bl sub_806FDEC - lsls r0, 24 - lsrs r0, 24 - subs r0, r4 - lsls r0, 24 - lsrs r0, 24 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_806FE28 - - thumb_func_start sub_806FE54 -sub_806FE54: @ 806FE54 - push {r4,r5,lr} - adds r5, r0, 0 - bl sub_806FE28 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gStringVar2 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x2 - bl ConvertIntToDecimalStringN - ldr r1, =gStringVar1 - adds r0, r5, 0 - bl GetBoxMonNick - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806FE54 - - thumb_func_start sub_806FE88 -sub_806FE88: @ 806FE88 - push {r4,r5,lr} - adds r5, r0, 0 - bl sub_806FE28 - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r1, =gStringVar1 - adds r0, r5, 0 - bl GetBoxMonNick - movs r0, 0x64 - muls r4, r0 - adds r4, 0x64 - ldr r0, =gStringVar2 - adds r1, r4, 0 - movs r2, 0 - movs r3, 0x5 - bl ConvertIntToDecimalStringN - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806FE88 - - thumb_func_start sub_806FEC0 -sub_806FEC0: @ 806FEC0 - push {lr} - lsls r1, 24 - lsrs r1, 24 - movs r2, 0x8C - muls r1, r2 - adds r0, r1 - bl sub_806FE88 - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - thumb_func_end sub_806FEC0 - - thumb_func_start sub_806FED8 -sub_806FED8: @ 806FED8 - push {lr} - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003030 - adds r0, r1 - ldr r1, =gSpecialVar_0x8004 - ldrb r1, [r1] - bl sub_806FEC0 - ldr r1, =gSpecialVar_0x8005 - strh r0, [r1] - pop {r0} - bx r0 - .pool - thumb_func_end sub_806FED8 - - thumb_func_start sub_806FF04 -sub_806FF04: @ 806FF04 - lsls r0, 16 - lsrs r0, 16 - ldr r1, =gSaveBlock1Ptr - ldr r2, [r1] - ldr r1, =0x000030b8 - adds r3, r2, r1 - ldr r1, [r3] - adds r1, r0 - str r1, [r3] - ldr r1, =0x00003144 - adds r2, r1 - ldr r1, [r2] - adds r1, r0 - str r1, [r2] - bx lr - .pool - thumb_func_end sub_806FF04 - - thumb_func_start sub_806FF30 -sub_806FF30: @ 806FF30 - push {r4-r6,lr} - ldr r6, =gSaveBlock1Ptr - ldr r5, =gSpecialVar_0x8004 - ldrh r0, [r5] - movs r4, 0x8C - adds r1, r0, 0 - muls r1, r4 - ldr r0, =0x00003030 - adds r1, r0 - ldr r0, [r6] - adds r0, r1 - movs r1, 0xB - bl GetBoxMonData - cmp r0, 0 - bne _0806FF60 - movs r0, 0 - b _0806FF76 - .pool -_0806FF60: - ldrh r0, [r5] - adds r1, r0, 0 - muls r1, r4 - ldr r0, =0x00003030 - adds r1, r0 - ldr r0, [r6] - adds r0, r1 - bl sub_806FE54 - lsls r0, 24 - lsrs r0, 24 -_0806FF76: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_806FF30 - - thumb_func_start sub_806FF80 -sub_806FF80: @ 806FF80 - push {lr} - movs r3, 0 - movs r2, 0x7 - adds r1, r0, 0 - adds r1, 0x2B -_0806FF8A: - strb r3, [r1] - subs r1, 0x1 - subs r2, 0x1 - cmp r2, 0 - bge _0806FF8A - adds r2, r0, 0 - adds r2, 0x2C - movs r3, 0 - adds r1, r0, 0 - adds r1, 0x36 -_0806FF9E: - strb r3, [r1] - subs r1, 0x1 - cmp r1, r2 - bge _0806FF9E - bl sub_80D439C - pop {r0} - bx r0 - thumb_func_end sub_806FF80 - - thumb_func_start sub_806FFB0 -sub_806FFB0: @ 806FFB0 - push {r4,lr} - adds r4, r0, 0 - bl ZeroBoxMonData - adds r1, r4, 0 - adds r1, 0x88 - movs r0, 0 - str r0, [r1] - adds r4, 0x50 - adds r0, r4, 0 - bl sub_806FF80 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_806FFB0 - - thumb_func_start sub_806FFD0 -sub_806FFD0: @ 806FFD0 - push {r4-r6,lr} - adds r5, r0, 0 - movs r4, 0 - movs r6, 0x8C -_0806FFD8: - adds r0, r4, 0 - muls r0, r6 - adds r0, r5, r0 - bl sub_806FFB0 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x1 - bls _0806FFD8 - movs r1, 0x8C - lsls r1, 1 - adds r0, r5, r1 - movs r1, 0 - str r1, [r0] - movs r2, 0x8E - lsls r2, 1 - adds r0, r5, r2 - strb r1, [r0] - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_806FFD0 - - thumb_func_start sub_8070004 -sub_8070004: @ 8070004 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 16 - lsrs r2, r0, 16 - movs r0, 0 - mov r8, r0 - ldr r0, =gEvolutionTable - mov r12, r0 -_08070016: - movs r7, 0 - movs r6, 0x1 - movs r4, 0x80 - lsls r4, 9 - movs r5, 0x28 - mov r3, r12 - adds r3, 0x28 -_08070024: - movs r1, 0 - ldrh r0, [r3, 0x4] - cmp r0, r2 - bne _08070034 - lsrs r2, r4, 16 - b _08070060 - .pool -_08070034: - adds r1, 0x1 - cmp r1, 0x4 - bgt _0807004A - lsls r0, r1, 3 - adds r0, r5 - add r0, r12 - ldrh r0, [r0, 0x4] - cmp r0, r2 - bne _08070034 - lsrs r2, r4, 16 - movs r7, 0x1 -_0807004A: - cmp r7, 0 - bne _08070060 - movs r0, 0x80 - lsls r0, 9 - adds r4, r0 - adds r5, 0x28 - adds r3, 0x28 - adds r6, 0x1 - ldr r0, =0x0000019b - cmp r6, r0 - ble _08070024 -_08070060: - movs r0, 0xCE - lsls r0, 1 - cmp r6, r0 - beq _08070072 - movs r0, 0x1 - add r8, r0 - mov r0, r8 - cmp r0, 0x4 - ble _08070016 -_08070072: - adds r0, r2, 0 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8070004 - - thumb_func_start sub_8070084 -sub_8070084: @ 8070084 - push {r4-r7,lr} - sub sp, 0x8 - adds r6, r0, 0 - movs r7, 0x1 - negs r7, r7 - movs r4, 0 -_08070090: - movs r0, 0x8C - muls r0, r4 - adds r0, r6, r0 - bl GetBoxMonGender - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFE - bne _080700A4 - adds r7, r4, 0 -_080700A4: - adds r4, 0x1 - cmp r4, 0x1 - ble _08070090 - movs r5, 0 - movs r4, 0 -_080700AE: - movs r0, 0x8C - muls r0, r4 - adds r0, r6, r0 - movs r1, 0xB - bl GetBoxMonData - lsls r1, r4, 2 - add r1, sp - str r0, [r1] - cmp r0, 0x84 - bne _080700C8 - adds r5, 0x1 - adds r7, r4, 0 -_080700C8: - adds r4, 0x1 - cmp r4, 0x1 - ble _080700AE - cmp r5, 0x2 - bne _080700E2 - bl Random - lsls r0, 16 - ldr r1, =0x7ffe0000 - movs r7, 0x1 - cmp r0, r1 - bls _080700E2 - movs r7, 0 -_080700E2: - movs r0, 0x8C - muls r0, r7 - adds r0, r6, r0 - movs r1, 0xC - bl GetBoxMonData - cmp r0, 0xC3 - bne _080700FE - bl Random - lsls r0, 16 - ldr r1, =0x7ffe0000 - cmp r0, r1 - bls _08070108 -_080700FE: - movs r0, 0x1 - negs r0, r0 - b _0807010A - .pool -_08070108: - adds r0, r7, 0 -_0807010A: - add sp, 0x8 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_8070084 - - thumb_func_start sub_8070114 -sub_8070114: @ 8070114 - push {r4-r7,lr} - adds r5, r0, 0 - movs r6, 0 - ldr r0, =gMain - ldrh r0, [r0, 0x24] - bl SeedRng2 - adds r0, r5, 0 - bl sub_8070084 - adds r1, r0, 0 - cmp r1, 0 - bge _08070160 - bl Random2 - adds r4, r0, 0 - bl Random - movs r1, 0x8C - lsls r1, 1 - adds r5, r1 - lsls r4, 16 - lsls r0, 16 - lsrs r0, 16 - ldr r1, =0x0000fffe - bl __umodsi3 - lsls r0, 16 - lsrs r0, 16 - adds r0, 0x1 - orrs r4, r0 - str r4, [r5] - b _080701AC - .pool -_08070160: - movs r0, 0x8C - muls r0, r1 - adds r0, r5, r0 - movs r1, 0 - movs r2, 0 - bl GetBoxMonData - bl GetNatureFromPersonality - lsls r0, 24 - lsrs r7, r0, 24 -_08070176: - bl Random2 - adds r4, r0, 0 - bl Random - lsls r4, 16 - lsls r0, 16 - lsrs r0, 16 - orrs r4, r0 - adds r0, r4, 0 - bl GetNatureFromPersonality - lsls r0, 24 - lsrs r0, 24 - cmp r7, r0 - bne _0807019A - cmp r4, 0 - bne _080701A4 -_0807019A: - adds r6, 0x1 - movs r0, 0x96 - lsls r0, 4 - cmp r6, r0 - ble _08070176 -_080701A4: - movs r1, 0x8C - lsls r1, 1 - adds r0, r5, r1 - str r4, [r0] -_080701AC: - movs r0, 0x86 - bl FlagSet - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8070114 - - thumb_func_start sub_80701B8 -sub_80701B8: @ 80701B8 - push {r4,lr} - adds r4, r0, 0 - bl Random - movs r1, 0x8C - lsls r1, 1 - adds r4, r1 - movs r2, 0x80 - lsls r2, 8 - adds r1, r2, 0 - orrs r0, r1 - lsls r0, 16 - lsrs r0, 16 - str r0, [r4] - movs r0, 0x86 - bl FlagSet - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80701B8 - - thumb_func_start sub_80701E0 -sub_80701E0: @ 80701E0 - push {lr} - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003030 - adds r0, r1 - bl sub_8070114 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80701E0 - - thumb_func_start sub_80701FC -sub_80701FC: @ 80701FC - push {lr} - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003030 - adds r0, r1 - bl sub_80701B8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80701FC - - thumb_func_start sub_8070218 -sub_8070218: @ 8070218 - push {r4,lr} - sub sp, 0x8 - adds r4, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r1, r4, r1 - movs r0, 0xFF - strb r0, [r1] - movs r2, 0 -_0807022A: - mov r1, sp - adds r0, r1, r2 - adds r1, r4, r2 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x5 - ble _0807022A - movs r3, 0 - movs r2, 0 -_0807023E: - mov r1, sp - adds r0, r1, r2 - ldrb r1, [r0] - adds r0, r1, 0 - cmp r0, 0xFF - beq _08070250 - adds r0, r4, r3 - strb r1, [r0] - adds r3, 0x1 -_08070250: - adds r2, 0x1 - cmp r2, 0x5 - ble _0807023E - add sp, 0x8 - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_8070218 - - thumb_func_start sub_8070260 -sub_8070260: @ 8070260 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x14 - mov r9, r0 - mov r8, r1 - movs r5, 0 - add r1, sp, 0x4 - add r7, sp, 0xC - adds r2, r1, 0 -_08070276: - adds r0, r2, r5 - strb r5, [r0] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x5 - bls _08070276 - movs r5, 0 - adds r6, r1, 0 -_08070288: - bl Random - mov r1, sp - adds r4, r1, r5 - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x6 - subs r1, r5 - bl __modsi3 - adds r0, r6, r0 - ldrb r0, [r0] - strb r0, [r4] - adds r0, r6, 0 - adds r1, r5, 0 - bl sub_8070218 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x2 - bls _08070288 - movs r5, 0 - movs r4, 0x1 -_080702B8: - bl Random - adds r1, r7, r5 - lsls r0, 16 - lsrs r0, 16 - ands r0, r4 - strb r0, [r1] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x2 - bls _080702B8 - movs r5, 0 -_080702D2: - mov r1, sp - adds r0, r1, r5 - ldrb r0, [r0] - cmp r0, 0x5 - bhi _080703AE - lsls r0, 2 - ldr r1, =_080702EC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080702EC: - .4byte _08070304 - .4byte _08070322 - .4byte _0807033C - .4byte _08070356 - .4byte _08070370 - .4byte _08070390 -_08070304: - adds r0, r7, r5 - ldrb r1, [r0] - movs r0, 0x8C - muls r0, r1 - add r0, r8 - movs r1, 0x27 - bl GetBoxMonData - add r2, sp, 0x10 - strb r0, [r2] - mov r0, r9 - movs r1, 0x27 - bl SetMonData - b _080703AE -_08070322: - add r4, sp, 0x10 - adds r0, r7, r5 - ldrb r1, [r0] - movs r0, 0x8C - muls r0, r1 - add r0, r8 - movs r1, 0x28 - bl GetBoxMonData - strb r0, [r4] - mov r0, r9 - movs r1, 0x28 - b _08070388 -_0807033C: - add r4, sp, 0x10 - adds r0, r7, r5 - ldrb r1, [r0] - movs r0, 0x8C - muls r0, r1 - add r0, r8 - movs r1, 0x29 - bl GetBoxMonData - strb r0, [r4] - mov r0, r9 - movs r1, 0x29 - b _08070388 -_08070356: - add r4, sp, 0x10 - adds r0, r7, r5 - ldrb r1, [r0] - movs r0, 0x8C - muls r0, r1 - add r0, r8 - movs r1, 0x2A - bl GetBoxMonData - strb r0, [r4] - mov r0, r9 - movs r1, 0x2A - b _08070388 -_08070370: - add r4, sp, 0x10 - adds r0, r7, r5 - ldrb r1, [r0] - movs r0, 0x8C - muls r0, r1 - add r0, r8 - movs r1, 0x2B - bl GetBoxMonData - strb r0, [r4] - mov r0, r9 - movs r1, 0x2B -_08070388: - adds r2, r4, 0 - bl SetMonData - b _080703AE -_08070390: - add r4, sp, 0x10 - adds r0, r7, r5 - ldrb r1, [r0] - movs r0, 0x8C - muls r0, r1 - add r0, r8 - movs r1, 0x2C - bl GetBoxMonData - strb r0, [r4] - mov r0, r9 - movs r1, 0x2C - adds r2, r4, 0 - bl SetMonData -_080703AE: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x2 - bls _080702D2 - add sp, 0x14 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_8070260 - - thumb_func_start pokemon_get_eggmoves -pokemon_get_eggmoves: @ 80703C8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - mov r8, r1 - movs r6, 0 - movs r4, 0 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r3, r0, 16 - movs r2, 0 - ldr r5, =gEggMoves - ldrh r1, [r5] - ldr r7, =0x00004e20 - adds r0, r3, r7 - cmp r1, r0 - bne _080703F8 - movs r4, 0x1 - b _0807041A - .pool -_080703F8: - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - ldr r0, =0x00000471 - ldr r5, =gEggMoves - cmp r2, r0 - bhi _0807041A - lsls r0, r2, 1 - adds r0, r5 - ldrh r1, [r0] - ldr r7, =0x00004e20 - adds r0, r3, r7 - cmp r1, r0 - bne _080703F8 - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 -_0807041A: - movs r2, 0 - lsls r0, r4, 1 - adds r0, r5 - ldrh r0, [r0] - ldr r1, =0x00004e20 - cmp r0, r1 - bhi _08070456 - adds r7, r5, 0 - adds r3, r1, 0 -_0807042C: - lsls r1, r2, 1 - add r1, r8 - adds r0, r4, r2 - lsls r0, 1 - adds r0, r7 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0x9 - bhi _08070456 - adds r0, r4, r2 - lsls r0, 1 - adds r0, r5 - ldrh r0, [r0] - cmp r0, r3 - bls _0807042C -_08070456: - lsls r0, r6, 24 - lsrs r0, 24 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end pokemon_get_eggmoves - - thumb_func_start daycare_build_child_moveset -daycare_build_child_moveset: @ 8070470 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - adds r7, r0, 0 - mov r10, r1 - mov r9, r2 - movs r0, 0 - str r0, [sp] - movs r6, 0 - ldr r5, =gUnknown_02024A4C - movs r2, 0 - ldr r4, =gUnknown_02024A28 - ldr r3, =gUnknown_02024A30 -_08070490: - lsls r1, r6, 1 - adds r0, r1, r5 - strh r2, [r0] - adds r0, r1, r4 - strh r2, [r0] - adds r1, r3 - strh r2, [r1] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x3 - bls _08070490 - movs r6, 0 - ldr r2, =gUnknown_02024A38 - movs r1, 0 -_080704AE: - lsls r0, r6, 1 - adds r0, r2 - strh r1, [r0] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x9 - bls _080704AE - movs r6, 0 - ldr r2, =gUnknown_020249C4 - movs r1, 0 -_080704C4: - lsls r0, r6, 1 - adds r0, r2 - strh r1, [r0] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x31 - bls _080704C4 - adds r0, r7, 0 - movs r1, 0xB - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - ldr r1, =gUnknown_020249C4 - bl GetLevelUpMovesBySpecies - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - movs r6, 0 - ldr r1, =gUnknown_02024A28 - mov r8, r1 -_080704F2: - adds r5, r6, 0 - adds r5, 0xD - mov r0, r10 - adds r1, r5, 0 - bl GetBoxMonData - lsls r4, r6, 1 - mov r2, r8 - adds r1, r4, r2 - strh r0, [r1] - mov r0, r9 - adds r1, r5, 0 - bl GetBoxMonData - ldr r1, =gUnknown_02024A4C - adds r4, r1 - strh r0, [r4] - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - cmp r6, 0x3 - bls _080704F2 - ldr r1, =gUnknown_02024A38 - adds r0, r7, 0 - bl pokemon_get_eggmoves - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - movs r6, 0 -_0807052E: - ldr r0, =gUnknown_02024A28 - lsls r1, r6, 1 - adds r2, r1, r0 - ldrh r1, [r2] - mov r9, r0 - cmp r1, 0 - beq _080705A4 - movs r5, 0 - cmp r5, r8 - bcs _08070596 - adds r4, r2, 0 - ldr r2, =0x0000ffff -_08070546: - ldr r0, =gUnknown_02024A38 - lsls r1, r5, 1 - adds r1, r0 - ldrh r0, [r4] - ldrh r1, [r1] - cmp r0, r1 - bne _0807058C - adds r1, r0, 0 - adds r0, r7, 0 - str r2, [sp, 0x8] - bl GiveMoveToMon - lsls r0, 16 - lsrs r0, 16 - ldr r2, [sp, 0x8] - cmp r0, r2 - bne _08070596 - ldrh r1, [r4] - adds r0, r7, 0 - bl DeleteFirstMoveAndGiveMoveToMon - b _08070596 - .pool -_0807058C: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, r8 - bcc _08070546 -_08070596: - adds r0, r6, 0x1 - lsls r0, 16 - lsrs r6, r0, 16 - ldr r3, =gUnknown_02024A28 - mov r9, r3 - cmp r6, 0x3 - bls _0807052E -_080705A4: - movs r6, 0 -_080705A6: - lsls r0, r6, 1 - mov r2, r9 - adds r1, r0, r2 - ldrh r1, [r1] - adds r2, r0, 0 - adds r6, 0x1 - mov r8, r6 - cmp r1, 0 - beq _08070608 - movs r5, 0 - ldr r0, =gUnknown_02024A28 - adds r4, r2, r0 - ldr r6, =0x0000ffff - mov r9, r0 -_080705C2: - ldr r3, =0x00000121 - adds r0, r5, r3 - lsls r0, 16 - lsrs r0, 16 - bl ItemIdToBattleMoveId - ldrh r1, [r4] - lsls r0, 16 - lsrs r0, 16 - cmp r1, r0 - bne _080705FE - lsls r1, r5, 24 - lsrs r1, 24 - adds r0, r7, 0 - bl CanMonLearnTMHM - cmp r0, 0 - beq _080705FE - ldrh r1, [r4] - adds r0, r7, 0 - bl GiveMoveToMon - lsls r0, 16 - lsrs r0, 16 - cmp r0, r6 - bne _080705FE - ldrh r1, [r4] - adds r0, r7, 0 - bl DeleteFirstMoveAndGiveMoveToMon -_080705FE: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x39 - bls _080705C2 -_08070608: - mov r1, r8 - lsls r0, r1, 16 - lsrs r6, r0, 16 - cmp r6, 0x3 - bls _080705A6 - movs r6, 0 - mov r2, r9 - ldrh r0, [r2] - ldr r3, =gUnknown_02024A30 - mov r10, r3 - cmp r0, 0 - beq _08070672 - mov r4, r9 - ldr r0, =gUnknown_02024A4C - mov r9, r0 - mov r12, r10 -_08070628: - movs r5, 0 - lsls r2, r6, 1 - adds r6, 0x1 - mov r8, r6 - adds r3, r2, r4 -_08070632: - lsls r0, r5, 1 - add r0, r9 - ldrh r2, [r3] - adds r1, r2, 0 - ldrh r0, [r0] - cmp r1, r0 - bne _08070654 - cmp r1, 0 - beq _08070654 - ldr r1, [sp] - adds r0, r1, 0x1 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp] - lsls r1, 1 - add r1, r12 - strh r2, [r1] -_08070654: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - cmp r5, 0x3 - bls _08070632 - mov r1, r8 - lsls r0, r1, 16 - lsrs r6, r0, 16 - cmp r6, 0x3 - bhi _08070672 - lsls r0, r6, 1 - adds r0, r4 - ldrh r0, [r0] - cmp r0, 0 - bne _08070628 -_08070672: - movs r6, 0 - mov r2, r10 - ldrh r0, [r2] - cmp r0, 0 - beq _080706FC -_0807067C: - movs r5, 0 - adds r3, r6, 0x1 - mov r8, r3 - ldr r0, [sp, 0x4] - cmp r5, r0 - bcs _080706E4 - ldr r2, =0x0000ffff -_0807068A: - ldr r1, =gUnknown_020249C4 - lsls r0, r5, 1 - adds r0, r1 - ldrh r1, [r0] - cmp r1, 0 - beq _080706D8 - lsls r0, r6, 1 - mov r3, r10 - adds r4, r0, r3 - ldrh r0, [r4] - cmp r0, r1 - bne _080706D8 - adds r1, r0, 0 - adds r0, r7, 0 - str r2, [sp, 0x8] - bl GiveMoveToMon - lsls r0, 16 - lsrs r0, 16 - ldr r2, [sp, 0x8] - cmp r0, r2 - bne _080706E4 - ldrh r1, [r4] - adds r0, r7, 0 - bl DeleteFirstMoveAndGiveMoveToMon - b _080706E4 - .pool -_080706D8: - adds r0, r5, 0x1 - lsls r0, 16 - lsrs r5, r0, 16 - ldr r0, [sp, 0x4] - cmp r5, r0 - bcc _0807068A -_080706E4: - mov r1, r8 - lsls r0, r1, 16 - lsrs r6, r0, 16 - cmp r6, 0x3 - bhi _080706FC - ldr r0, =gUnknown_02024A30 - lsls r1, r6, 1 - adds r1, r0 - ldrh r1, [r1] - mov r10, r0 - cmp r1, 0 - bne _0807067C -_080706FC: - 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 daycare_build_child_moveset - - thumb_func_start sub_8070710 -sub_8070710: @ 8070710 - adds r2, r0, 0 - movs r1, 0x8C - lsls r1, 1 - adds r0, r2, r1 - movs r1, 0 - str r1, [r0] - movs r3, 0x8E - lsls r3, 1 - adds r0, r2, r3 - strb r1, [r0] - bx lr - thumb_func_end sub_8070710 - - thumb_func_start sub_8070728 -sub_8070728: @ 8070728 - push {lr} - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003030 - adds r0, r1 - bl sub_8070710 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8070728 - - thumb_func_start incense_effects -incense_effects: @ 8070744 - push {r4-r7,lr} - adds r4, r0, 0 - adds r5, r1, 0 - ldrh r1, [r4] - movs r7, 0xB4 - lsls r7, 1 - cmp r1, r7 - beq _0807075C - movs r0, 0xAF - lsls r0, 1 - cmp r1, r0 - bne _0807079E -_0807075C: - adds r0, r5, 0 - movs r1, 0xC - bl GetBoxMonData - lsls r0, 16 - lsrs r6, r0, 16 - adds r0, r5, 0 - adds r0, 0x8C - movs r1, 0xC - bl GetBoxMonData - lsls r0, 16 - lsrs r2, r0, 16 - ldrh r0, [r4] - cmp r0, r7 - bne _08070788 - cmp r6, 0xDD - beq _08070788 - cmp r2, 0xDD - beq _08070788 - movs r0, 0xCA - strh r0, [r4] -_08070788: - ldrh r1, [r4] - movs r0, 0xAF - lsls r0, 1 - cmp r1, r0 - bne _0807079E - cmp r6, 0xDC - beq _0807079E - cmp r2, 0xDC - beq _0807079E - movs r0, 0xB7 - strh r0, [r4] -_0807079E: - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end incense_effects - - thumb_func_start sub_80707A4 -sub_80707A4: @ 80707A4 - push {r4-r6,lr} - adds r6, r0, 0 - adds r4, r1, 0 - adds r0, r4, 0 - movs r1, 0xC - bl GetBoxMonData - adds r5, r0, 0 - adds r4, 0x8C - adds r0, r4, 0 - movs r1, 0xC - bl GetBoxMonData - cmp r5, 0xCA - beq _080707C6 - cmp r0, 0xCA - bne _080707E2 -_080707C6: - movs r4, 0xAC - lsls r4, 1 - adds r0, r6, 0 - adds r1, r4, 0 - bl GiveMoveToMon - lsls r0, 16 - ldr r1, =0xffff0000 - cmp r0, r1 - bne _080707E2 - adds r0, r6, 0 - adds r1, r4, 0 - bl DeleteFirstMoveAndGiveMoveToMon -_080707E2: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80707A4 - - thumb_func_start sub_80707EC -sub_80707EC: @ 80707EC - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - adds r7, r0, 0 - adds r6, r1, 0 - movs r4, 0 - movs r0, 0x1 - mov r8, r0 -_080707FE: - movs r0, 0x8C - muls r0, r4 - adds r5, r7, r0 - adds r0, r5, 0 - movs r1, 0xB - bl GetBoxMonData - lsls r1, r4, 1 - add r1, sp - strh r0, [r1] - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x84 - bne _08070826 - adds r0, r4, 0 - mov r1, r8 - eors r0, r1 - strb r0, [r6] - strb r4, [r6, 0x1] - b _0807083E -_08070826: - adds r0, r5, 0 - bl GetBoxMonGender - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFE - bne _0807083E - strb r4, [r6] - adds r0, r4, 0 - mov r1, r8 - eors r0, r1 - strb r0, [r6, 0x1] -_0807083E: - adds r0, r4, 0x1 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x1 - bls _080707FE - ldrb r0, [r6] - lsls r0, 1 - add r0, sp - ldrh r0, [r0] - bl sub_8070004 - lsls r0, 16 - lsrs r4, r0, 16 - cmp r4, 0x1D - bne _08070870 - movs r1, 0x8C - lsls r1, 1 - adds r0, r7, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _08070870 - movs r4, 0x20 -_08070870: - ldr r0, =0x00000183 - cmp r4, r0 - bne _0807088C - movs r1, 0x8C - lsls r1, 1 - adds r0, r7, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _0807088C - movs r4, 0xC1 - lsls r4, 1 -_0807088C: - ldrb r0, [r6, 0x1] - lsls r0, 1 - add r0, sp - ldrh r0, [r0] - cmp r0, 0x84 - bne _080708B4 - ldrb r1, [r6] - movs r0, 0x8C - muls r0, r1 - adds r0, r7, r0 - bl GetBoxMonGender - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFE - beq _080708B4 - ldrb r1, [r6, 0x1] - ldrb r0, [r6] - strb r0, [r6, 0x1] - strb r1, [r6] -_080708B4: - adds r0, r4, 0 - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80707EC - - thumb_func_start sub_80708C8 -sub_80708C8: @ 80708C8 - push {r4-r6,lr} - sub sp, 0x6C - adds r6, r0, 0 - add r5, sp, 0x64 - adds r1, r5, 0 - bl sub_80707EC - add r4, sp, 0x68 - strh r0, [r4] - adds r0, r4, 0 - adds r1, r6, 0 - bl incense_effects - ldrh r1, [r4] - mov r0, sp - adds r2, r6, 0 - bl sub_8070A0C - mov r0, sp - adds r1, r6, 0 - bl sub_8070260 - ldrb r0, [r5, 0x1] - movs r2, 0x8C - adds r1, r0, 0 - muls r1, r2 - adds r1, r6, r1 - ldrb r0, [r5] - muls r2, r0 - adds r2, r6, r2 - mov r0, sp - bl daycare_build_child_moveset - ldrh r0, [r4] - cmp r0, 0xAC - bne _08070918 - mov r0, sp - adds r1, r6, 0 - bl sub_80707A4 -_08070918: - mov r2, sp - adds r2, 0x6A - movs r0, 0x1 - strb r0, [r2] - mov r0, sp - movs r1, 0x2D - bl SetMonData - ldr r0, =gPlayerParty - movs r1, 0xFA - lsls r1, 1 - adds r0, r1 - mov r1, sp - movs r2, 0x64 - bl memcpy - bl party_compaction - bl CalculatePlayerPartyCount - adds r0, r6, 0 - bl sub_8070710 - add sp, 0x6C - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80708C8 - - thumb_func_start sub_8070954 -sub_8070954: @ 8070954 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x18 - adds r7, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - lsls r5, 16 - lsrs r5, 16 - lsls r6, 24 - lsrs r6, 24 - movs r4, 0 - str r4, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - str r4, [sp, 0xC] - adds r1, r5, 0 - movs r2, 0x5 - movs r3, 0x20 - bl CreateMon - movs r0, 0x12 - add r0, sp - mov r8, r0 - strb r4, [r0] - movs r1, 0x4 - add r0, sp, 0x10 - strh r1, [r0] - mov r4, sp - adds r4, 0x13 - movs r0, 0x1 - mov r9, r0 - mov r0, r9 - strb r0, [r4] - adds r0, r7, 0 - movs r1, 0x26 - add r2, sp, 0x10 - bl SetMonData - ldr r2, =gEggName - adds r0, r7, 0 - movs r1, 0x2 - bl SetMonData - lsls r2, r5, 3 - subs r2, r5 - lsls r2, 2 - ldr r0, =gBaseStats + 0x11 @ egg cycles offset - adds r2, r0 - adds r0, r7, 0 - movs r1, 0x20 - bl SetMonData - adds r0, r7, 0 - movs r1, 0x24 - mov r2, r8 - bl SetMonData - adds r0, r7, 0 - movs r1, 0x3 - adds r2, r4, 0 - bl SetMonData - cmp r6, 0 - beq _080709E6 - add r2, sp, 0x14 - movs r0, 0xFD - strb r0, [r2] - adds r0, r7, 0 - movs r1, 0x23 - bl SetMonData -_080709E6: - mov r2, sp - adds r2, 0x15 - mov r0, r9 - strb r0, [r2] - adds r0, r7, 0 - movs r1, 0x2D - bl SetMonData - add sp, 0x18 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8070954 - - thumb_func_start sub_8070A0C -sub_8070A0C: @ 8070A0C - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x14 - adds r6, r0, 0 - adds r5, r1, 0 - lsls r5, 16 - lsrs r5, 16 - movs r0, 0x8C - lsls r0, 1 - adds r2, r0 - ldr r0, [r2] - movs r1, 0x1 - mov r8, r1 - str r1, [sp] - str r0, [sp, 0x4] - movs r4, 0 - str r4, [sp, 0x8] - str r4, [sp, 0xC] - adds r0, r6, 0 - adds r1, r5, 0 - movs r2, 0x5 - movs r3, 0x20 - bl CreateMon - movs r0, 0x12 - add r0, sp - mov r9, r0 - strb r4, [r0] - movs r1, 0x4 - add r0, sp, 0x10 - strh r1, [r0] - mov r4, sp - adds r4, 0x13 - mov r1, r8 - strb r1, [r4] - adds r0, r6, 0 - movs r1, 0x26 - add r2, sp, 0x10 - bl SetMonData - ldr r2, =gEggName - adds r0, r6, 0 - movs r1, 0x2 - bl SetMonData - lsls r2, r5, 3 - subs r2, r5 - lsls r2, 2 - ldr r0, =gBaseStats + 0x11 @ egg cycles offset - adds r2, r0 - adds r0, r6, 0 - movs r1, 0x20 - bl SetMonData - adds r0, r6, 0 - movs r1, 0x24 - mov r2, r9 - bl SetMonData - adds r0, r6, 0 - movs r1, 0x3 - adds r2, r4, 0 - bl SetMonData - add sp, 0x14 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8070A0C - - thumb_func_start sp0B8_daycare -sp0B8_daycare: @ 8070AA8 - push {lr} - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003030 - adds r0, r1 - bl sub_80708C8 - pop {r0} - bx r0 - .pool - thumb_func_end sp0B8_daycare - - thumb_func_start sub_8070AC4 -sub_8070AC4: @ 8070AC4 - push {r4-r7,lr} - sub sp, 0x4 - adds r6, r0, 0 - movs r7, 0 - movs r5, 0 -_08070ACE: - movs r0, 0x8C - adds r4, r5, 0 - muls r4, r0 - adds r0, r6, r4 - movs r1, 0x5 - bl GetBoxMonData - cmp r0, 0 - beq _08070AEE - adds r1, r6, 0 - adds r1, 0x88 - adds r1, r4 - ldr r0, [r1] - adds r0, 0x1 - str r0, [r1] - adds r7, 0x1 -_08070AEE: - adds r5, 0x1 - cmp r5, 0x1 - bls _08070ACE - movs r1, 0x8C - lsls r1, 1 - adds r0, r6, r1 - ldr r0, [r0] - cmp r0, 0 - bne _08070B34 - cmp r7, 0x2 - bne _08070B34 - subs r1, 0x4 - adds r0, r6, r1 - ldrb r0, [r0] - cmp r0, 0xFF - bne _08070B34 - adds r0, r6, 0 - bl daycare_relationship_score - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - bl Random - lsls r0, 16 - lsrs r0, 16 - movs r1, 0x64 - muls r0, r1 - ldr r1, =0x0000ffff - bl __udivsi3 - cmp r4, r0 - bls _08070B34 - bl sub_80701E0 -_08070B34: - movs r0, 0x8E - lsls r0, 1 - adds r1, r6, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - bne _08070BC0 - bl GetEggStepsToSubtract - lsls r0, 24 - lsrs r6, r0, 24 - movs r5, 0 - ldr r0, =gPlayerPartyCount - ldrb r0, [r0] - cmp r5, r0 - bcs _08070BC0 - ldr r4, =gPlayerParty -_08070B5C: - adds r0, r4, 0 - movs r1, 0x2D - bl GetMonData - cmp r0, 0 - beq _08070BB4 - adds r0, r4, 0 - movs r1, 0x4 - bl GetMonData - cmp r0, 0 - bne _08070BB4 - adds r0, r4, 0 - movs r1, 0x20 - bl GetMonData - adds r1, r0, 0 - str r1, [sp] - cmp r0, 0 - beq _08070BA8 - cmp r0, r6 - bcc _08070B98 - subs r0, r6 - b _08070B9A - .pool -_08070B98: - subs r0, r1, 0x1 -_08070B9A: - str r0, [sp] - adds r0, r4, 0 - movs r1, 0x20 - mov r2, sp - bl SetMonData - b _08070BB4 -_08070BA8: - ldr r0, =gSpecialVar_0x8004 - strh r5, [r0] - movs r0, 0x1 - b _08070BC2 - .pool -_08070BB4: - adds r4, 0x64 - adds r5, 0x1 - ldr r0, =gPlayerPartyCount - ldrb r0, [r0] - cmp r5, r0 - bcc _08070B5C -_08070BC0: - movs r0, 0 -_08070BC2: - add sp, 0x4 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8070AC4 - - thumb_func_start sub_8070BD0 -sub_8070BD0: @ 8070BD0 - push {lr} - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003030 - adds r0, r1 - bl sub_8070AC4 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8070BD0 - - thumb_func_start sub_8070BF0 -sub_8070BF0: @ 8070BF0 - push {lr} - movs r1, 0x8C - lsls r1, 1 - adds r0, r1 - ldr r0, [r0] - cmp r0, 0 - beq _08070C00 - movs r0, 0x1 -_08070C00: - pop {r1} - bx r1 - thumb_func_end sub_8070BF0 - - thumb_func_start sub_8070C04 -sub_8070C04: @ 8070C04 - push {r4,lr} - sub sp, 0xC - adds r4, r0, 0 - movs r1, 0xB - bl GetBoxMonData - cmp r0, 0 - beq _08070C2E - ldr r1, =gStringVar1 - adds r0, r4, 0 - bl GetBoxMonNick - adds r0, r4, 0 - movs r1, 0x7 - mov r2, sp - bl GetBoxMonData - ldr r0, =gStringVar3 - mov r1, sp - bl StringCopy -_08070C2E: - adds r4, 0x8C - adds r0, r4, 0 - movs r1, 0xB - bl GetBoxMonData - cmp r0, 0 - beq _08070C44 - ldr r1, =gStringVar2 - adds r0, r4, 0 - bl GetBoxMonNick -_08070C44: - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8070C04 - - thumb_func_start sub_8070C58 -sub_8070C58: @ 8070C58 - push {r4,r5,lr} - bl brm_get_pokemon_selection - lsls r0, 24 - lsrs r0, 24 - movs r5, 0x64 - muls r0, r5 - ldr r4, =gPlayerParty - adds r0, r4 - ldr r1, =gStringVar1 - bl GetBoxMonNick - bl brm_get_pokemon_selection - lsls r0, 24 - lsrs r0, 24 - muls r0, r5 - adds r0, r4 - movs r1, 0xB - bl GetBoxMonData - lsls r0, 16 - lsrs r0, 16 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8070C58 - - thumb_func_start sp0B5_daycare -sp0B5_daycare: @ 8070C94 - push {lr} - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003030 - adds r0, r1 - bl sub_8070C04 - pop {r0} - bx r0 - .pool - thumb_func_end sp0B5_daycare - - thumb_func_start sp0B6_daycare -sp0B6_daycare: @ 8070CB0 - push {r4,lr} - ldr r4, =gSaveBlock1Ptr - ldr r0, [r4] - ldr r1, =0x00003030 - adds r0, r1 - bl sub_8070BF0 - lsls r0, 24 - cmp r0, 0 - beq _08070CD0 - movs r0, 0x1 - b _08070CF2 - .pool -_08070CD0: - ldr r0, [r4] - ldr r1, =0x00003030 - adds r0, r1 - bl daycare_count_pokemon - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _08070CEC - movs r0, 0 - b _08070CF2 - .pool -_08070CEC: - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 -_08070CF2: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sp0B6_daycare - - thumb_func_start sub_8070CF8 -sub_8070CF8: @ 8070CF8 - push {lr} - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003030 - adds r0, r1 - bl daycare_count_pokemon - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0 - bne _08070D10 - movs r0, 0 -_08070D10: - pop {r1} - bx r1 - .pool - thumb_func_end sub_8070CF8 - - thumb_func_start sub_8070D1C -sub_8070D1C: @ 8070D1C - push {r4-r6,lr} - adds r5, r1, 0 - movs r4, 0 - adds r1, r0, 0 -_08070D24: - movs r3, 0 - ldrh r0, [r1] - adds r2, r5, 0 -_08070D2A: - ldrh r6, [r2] - cmp r0, r6 - bne _08070D34 - movs r0, 0x1 - b _08070D46 -_08070D34: - adds r2, 0x2 - adds r3, 0x1 - cmp r3, 0x1 - ble _08070D2A - adds r1, 0x2 - adds r4, 0x1 - cmp r4, 0x1 - ble _08070D24 - movs r0, 0 -_08070D46: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_8070D1C - - thumb_func_start daycare_relationship_score -daycare_relationship_score: @ 8070D4C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x30 - str r0, [sp, 0x1C] - movs r7, 0 - mov r0, sp - adds r0, 0x8 - str r0, [sp, 0x20] - add r1, sp, 0xC - mov r9, r1 - mov r2, sp - adds r2, 0x14 - str r2, [sp, 0x24] - subs r0, 0x6 - ldr r1, =gBaseStats - mov r10, r1 - ldr r5, [sp, 0x20] - mov r8, r0 - mov r6, sp - str r2, [sp, 0x28] - mov r2, r9 - str r2, [sp, 0x2C] -_08070D7E: - movs r0, 0x8C - adds r4, r7, 0 - muls r4, r0 - ldr r0, [sp, 0x1C] - adds r4, r0, r4 - adds r0, r4, 0 - movs r1, 0xB - bl GetBoxMonData - strh r0, [r5] - adds r0, r4, 0 - movs r1, 0x1 - bl GetBoxMonData - ldr r1, [sp, 0x2C] - stm r1!, {r0} - str r1, [sp, 0x2C] - adds r0, r4, 0 - movs r1, 0 - bl GetBoxMonData - adds r1, r0, 0 - ldrh r0, [r5] - bl GetGenderFromSpeciesAndPersonality - lsls r0, 24 - lsrs r0, 24 - ldr r2, [sp, 0x28] - stm r2!, {r0} - str r2, [sp, 0x28] - ldrh r1, [r5] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r10 - ldrb r0, [r0, 0x14] - strh r0, [r6] - ldrh r1, [r5] - lsls r0, r1, 3 - subs r0, r1 - lsls r0, 2 - add r0, r10 - ldrb r0, [r0, 0x15] - mov r1, r8 - strh r0, [r1] - adds r5, 0x2 - movs r2, 0x4 - add r8, r2 - adds r6, 0x4 - adds r7, 0x1 - cmp r7, 0x1 - bls _08070D7E - mov r0, sp - ldrh r1, [r0] - cmp r1, 0xF - beq _08070DFC - ldrh r0, [r0, 0x4] - cmp r0, 0xF - beq _08070DFC - cmp r1, 0xD - bne _08070E04 - cmp r0, 0xD - bne _08070E08 -_08070DFC: - movs r0, 0 - b _08070E5C - .pool -_08070E04: - cmp r0, 0xD - bne _08070E14 -_08070E08: - ldr r1, [sp, 0xC] - mov r2, r9 - ldr r0, [r2, 0x4] - cmp r1, r0 - beq _08070E56 - b _08070E5A -_08070E14: - ldr r0, [sp, 0x14] - ldr r2, [sp, 0x24] - ldr r1, [r2, 0x4] - cmp r0, r1 - beq _08070DFC - cmp r0, 0xFF - beq _08070DFC - cmp r1, 0xFF - beq _08070DFC - add r1, sp, 0x4 - mov r0, sp - bl sub_8070D1C - lsls r0, 24 - cmp r0, 0 - beq _08070DFC - ldr r0, [sp, 0x20] - ldrh r1, [r0, 0x2] - ldrh r0, [r0] - cmp r0, r1 - bne _08070E4C - ldr r1, [sp, 0xC] - mov r2, r9 - ldr r0, [r2, 0x4] - cmp r1, r0 - beq _08070E5A - movs r0, 0x46 - b _08070E5C -_08070E4C: - ldr r1, [sp, 0xC] - mov r2, r9 - ldr r0, [r2, 0x4] - cmp r1, r0 - bne _08070E5A -_08070E56: - movs r0, 0x14 - b _08070E5C -_08070E5A: - movs r0, 0x32 -_08070E5C: - add sp, 0x30 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end daycare_relationship_score - - thumb_func_start daycare_relationship_score_from_savegame -daycare_relationship_score_from_savegame: @ 8070E6C - push {lr} - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldr r1, =0x00003030 - adds r0, r1 - bl daycare_relationship_score - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .pool - thumb_func_end daycare_relationship_score_from_savegame - - thumb_func_start sp0B9_daycare_relationship_comment -sp0B9_daycare_relationship_comment: @ 8070E8C - push {lr} - bl daycare_relationship_score_from_savegame - lsls r0, 24 - lsrs r0, 24 - adds r2, r0, 0 - movs r1, 0 - cmp r0, 0 - bne _08070EA0 - movs r1, 0x3 -_08070EA0: - cmp r0, 0x14 - bne _08070EA6 - movs r1, 0x2 -_08070EA6: - cmp r0, 0x32 - bne _08070EAC - movs r1, 0x1 -_08070EAC: - cmp r2, 0x46 - bne _08070EB2 - movs r1, 0 -_08070EB2: - ldr r0, =gStringVar4 - ldr r2, =gUnknown_0832B6F8 - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl StringCopy - pop {r0} - bx r0 - .pool - thumb_func_end sp0B9_daycare_relationship_comment - - thumb_func_start sub_8070ECC -sub_8070ECC: @ 8070ECC - push {r4,r5,lr} - sub sp, 0x4 - adds r4, r0, 0 - lsls r1, 24 - lsrs r5, r1, 24 - mov r2, sp - mov r1, sp - movs r0, 0 - strb r0, [r1, 0x1] - strb r0, [r2] - movs r3, 0 - ldrb r0, [r4] - cmp r0, 0xFF - beq _08070F10 -_08070EE8: - adds r1, r4, r3 - ldrb r0, [r1] - cmp r0, 0xB5 - bne _08070EF6 - ldrb r0, [r2] - adds r0, 0x1 - strb r0, [r2] -_08070EF6: - ldrb r0, [r1] - cmp r0, 0xB6 - bne _08070F02 - ldrb r0, [r2, 0x1] - adds r0, 0x1 - strb r0, [r2, 0x1] -_08070F02: - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - adds r0, r4, r3 - ldrb r0, [r0] - cmp r0, 0xFF - bne _08070EE8 -_08070F10: - cmp r5, 0 - bne _08070F24 - mov r0, sp - ldrb r0, [r0] - cmp r0, 0 - beq _08070F24 - mov r0, sp - ldrb r0, [r0, 0x1] - cmp r0, 0 - beq _08070F38 -_08070F24: - cmp r5, 0xFE - bne _08070F3C - mov r0, sp - ldrb r0, [r0, 0x1] - cmp r0, 0 - beq _08070F3C - mov r0, sp - ldrb r0, [r0] - cmp r0, 0 - bne _08070F3C -_08070F38: - movs r0, 0x1 - b _08070F3E -_08070F3C: - movs r0, 0 -_08070F3E: - add sp, 0x4 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8070ECC - - thumb_func_start sub_8070F48 -sub_8070F48: @ 8070F48 - push {r4,lr} - adds r4, r0, 0 - lsls r1, 24 - lsrs r1, 24 - cmp r1, 0 - bne _08070F68 - movs r1, 0 - bl sub_8070ECC - lsls r0, 24 - cmp r0, 0 - bne _08070F84 - ldr r1, =gUnknown_0832DAC7 - b _08070F86 - .pool -_08070F68: - cmp r1, 0xFE - bne _08070F84 - adds r0, r4, 0 - movs r1, 0xFE - bl sub_8070ECC - lsls r0, 24 - cmp r0, 0 - bne _08070F84 - ldr r1, =gUnknown_0832DAC9 - b _08070F86 - .pool -_08070F84: - ldr r1, =gUnknown_0832DACB -_08070F86: - adds r0, r4, 0 - bl StringAppend - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_8070F48 - - thumb_func_start sub_8070F98 -sub_8070F98: @ 8070F98 - push {r4,lr} - adds r4, r0, 0 - adds r0, r1, 0 - bl GetBoxMonGender - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl sub_8070F48 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_8070F98 - - thumb_func_start sub_8070FB4 -sub_8070FB4: @ 8070FB4 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x28 - mov r8, r0 - adds r7, r1, 0 - movs r0, 0xFF - strb r0, [r7] - movs r6, 0 - add r0, sp, 0x14 - mov r9, r0 -_08070FCC: - movs r0, 0x8C - adds r4, r6, 0 - muls r4, r0 - add r4, r8 - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 2 - mov r1, sp - adds r5, r1, r0 - adds r0, r4, 0 - adds r1, r5, 0 - bl GetBoxMonNick - adds r0, r5, 0 - adds r1, r4, 0 - bl sub_8070F98 - adds r0, r6, 0x1 - lsls r0, 24 - lsrs r6, r0, 24 - cmp r6, 0x1 - bls _08070FCC - adds r0, r7, 0 - mov r1, sp - bl StringCopy - ldr r4, =gText_NewLine2 - adds r0, r7, 0 - adds r1, r4, 0 - bl StringAppend - adds r0, r7, 0 - mov r1, r9 - bl StringAppend - adds r0, r7, 0 - adds r1, r4, 0 - bl StringAppend - ldr r1, =gText_Exit4 - adds r0, r7, 0 - bl StringAppend - add sp, 0x28 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8070FB4 - - thumb_func_start sub_8071038 -sub_8071038: @ 8071038 - push {r4-r6,lr} - sub sp, 0x14 - adds r6, r0, 0 - adds r4, r1, 0 - movs r0, 0xFF - strb r0, [r4] - movs r5, 0 -_08071046: - adds r0, r4, 0 - ldr r1, =gText_Lv - bl StringAppend - movs r0, 0x8C - adds r2, r5, 0 - muls r2, r0 - adds r0, r6, r2 - adds r1, r6, 0 - adds r1, 0x88 - adds r1, r2 - ldr r1, [r1] - bl sub_806FDEC - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r0, sp - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - adds r0, r4, 0 - mov r1, sp - bl StringAppend - adds r0, r4, 0 - ldr r1, =gText_NewLine2 - bl StringAppend - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x1 - bls _08071046 - add sp, 0x14 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8071038 - - thumb_func_start sub_807109C -sub_807109C: @ 807109C - push {r4-r6,lr} - sub sp, 0x10 - str r1, [sp] - mov r1, sp - movs r5, 0 - strb r0, [r1, 0x4] - mov r0, sp - movs r6, 0x1 - movs r4, 0x1 - strb r4, [r0, 0x5] - strb r2, [r0, 0x6] - strb r3, [r0, 0x7] - strb r2, [r0, 0x8] - strb r3, [r0, 0x9] - mov r3, sp - ldrb r1, [r3, 0xC] - movs r2, 0x10 - negs r2, r2 - adds r0, r2, 0 - ands r0, r1 - strb r0, [r3, 0xC] - ldr r3, =gTextFlags - ldrb r1, [r3] - movs r0, 0x3 - negs r0, r0 - ands r0, r1 - strb r0, [r3] - mov r0, sp - strb r5, [r0, 0xA] - strb r4, [r0, 0xB] - mov r3, sp - ldrb r1, [r3, 0xC] - movs r4, 0xF - adds r0, r4, 0 - ands r0, r1 - movs r1, 0x20 - orrs r0, r1 - strb r0, [r3, 0xC] - mov r1, sp - ldrb r0, [r1, 0xD] - ands r2, r0 - orrs r2, r6 - strb r2, [r1, 0xD] - ands r2, r4 - movs r0, 0x30 - orrs r2, r0 - strb r2, [r1, 0xD] - mov r0, sp - movs r1, 0xFF - movs r2, 0 - bl AddTextPrinter - add sp, 0x10 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_807109C - - thumb_func_start sub_8071110 -sub_8071110: @ 8071110 - push {r4-r6,lr} - sub sp, 0x14 - adds r5, r0, 0 - adds r4, r1, 0 - adds r6, r3, 0 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x8C - muls r0, r2 - adds r5, r0 - adds r0, r5, 0 - mov r1, sp - bl GetBoxMonNick - mov r0, sp - adds r1, r5, 0 - bl sub_8070F98 - adds r0, r4, 0 - mov r1, sp - movs r2, 0x8 - adds r3, r6, 0 - bl sub_807109C - add sp, 0x14 - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_8071110 - - thumb_func_start sub_8071148 -sub_8071148: @ 8071148 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0x14 - adds r4, r0, 0 - adds r5, r1, 0 - adds r6, r2, 0 - mov r8, r3 - lsls r5, 24 - lsrs r5, 24 - ldr r1, =gText_Lv - mov r0, sp - bl StringCopy - movs r0, 0x8C - adds r1, r6, 0 - muls r1, r0 - adds r0, r4, r1 - adds r4, 0x88 - adds r4, r1 - ldr r1, [r4] - bl sub_806FDEC - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - add r4, sp, 0xC - adds r0, r4, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - mov r0, sp - adds r1, r4, 0 - bl StringAppend - movs r0, 0x1 - mov r1, sp - movs r2, 0x70 - bl GetStringRightAlignXOffset - adds r2, r0, 0 - adds r0, r5, 0 - mov r1, sp - mov r3, r8 - bl sub_807109C - add sp, 0x14 - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8071148 - - thumb_func_start sub_80711B8 -sub_80711B8: @ 80711B8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r6, r1, 0 - lsls r0, 24 - lsrs r7, r0, 24 - lsls r2, 24 - lsrs r5, r2, 24 - cmp r6, 0x1 - bhi _080711F0 - ldr r0, =gSaveBlock1Ptr - mov r8, r0 - ldr r0, [r0] - ldr r4, =0x00003030 - adds r0, r4 - adds r1, r7, 0 - adds r2, r6, 0 - adds r3, r5, 0 - bl sub_8071110 - mov r1, r8 - ldr r0, [r1] - adds r0, r4 - adds r1, r7, 0 - adds r2, r6, 0 - adds r3, r5, 0 - bl sub_8071148 -_080711F0: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80711B8 - - thumb_func_start c3_080469FC -c3_080469FC: @ 8071204 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - adds r5, r0, 0 - ldr r1, =gTasks - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - adds r4, r0, r1 - ldrb r0, [r4, 0x8] - bl ListMenuHandleInput - adds r1, r0, 0 - ldr r0, =gMain - ldrh r2, [r0, 0x2E] - movs r0, 0x1 - ands r0, r2 - cmp r0, 0 - beq _08071284 - cmp r1, 0x1 - bls _0807123C - cmp r1, 0x5 - beq _08071248 - b _0807124E - .pool -_0807123C: - ldr r0, =gSpecialVar_Result - strh r1, [r0] - b _0807124E - .pool -_08071248: - ldr r1, =gSpecialVar_Result - movs r0, 0x2 - strh r0, [r1] -_0807124E: - ldr r0, =gTasks - lsls r4, r5, 2 - adds r4, r5 - lsls r4, 3 - adds r4, r0 - ldrb r0, [r4, 0x8] - movs r1, 0 - movs r2, 0 - bl sub_81AE6C8 - ldrb r0, [r4, 0xA] - movs r1, 0x1 - bl sub_819746C - ldrb r0, [r4, 0xA] - bl RemoveWindow - adds r0, r5, 0 - bl DestroyTask - bl EnableBothScriptContexts - b _080712B4 - .pool -_08071284: - movs r1, 0x2 - adds r0, r1, 0 - ands r0, r2 - cmp r0, 0 - beq _080712B4 - ldr r0, =gSpecialVar_Result - strh r1, [r0] - ldrb r0, [r4, 0x8] - movs r1, 0 - movs r2, 0 - bl sub_81AE6C8 - ldrb r0, [r4, 0xA] - movs r1, 0x1 - bl sub_819746C - ldrb r0, [r4, 0xA] - bl RemoveWindow - adds r0, r5, 0 - bl DestroyTask - bl EnableBothScriptContexts -_080712B4: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end c3_080469FC - - thumb_func_start sub_80712C0 -sub_80712C0: @ 80712C0 - push {r4,r5,lr} - sub sp, 0x18 - ldr r0, =gUnknown_0832B6C0 - bl AddWindow - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - movs r1, 0 - bl sub_81973FC - mov r1, sp - ldr r0, =gUnknown_0832B6E0 - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - ldm r0!, {r2,r3,r5} - stm r1!, {r2,r3,r5} - mov r0, sp - strb r4, [r0, 0x10] - movs r1, 0 - movs r2, 0 - bl ListMenuInit - adds r5, r0, 0 - lsls r5, 24 - lsrs r5, 24 - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - ldr r0, =c3_080469FC - movs r1, 0x3 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - strh r5, [r1, 0x8] - strh r4, [r1, 0xA] - add sp, 0x18 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80712C0 - - thumb_func_start sub_8071330 -sub_8071330: @ 8071330 - push {lr} - bl sub_81B9328 - ldr r1, =gMain - ldr r0, =c2_exit_to_overworld_2_switch - str r0, [r1, 0x8] - pop {r0} - bx r0 - .pool - thumb_func_end sub_8071330 - - .align 2, 0 @ Don't pad with nop. diff --git a/asm/field_control_avatar.s b/asm/field_control_avatar.s index 7ce989d94..b85c6de07 100644 --- a/asm/field_control_avatar.s +++ b/asm/field_control_avatar.s @@ -1390,7 +1390,7 @@ _0809CA04: b _0809CB28 .pool _0809CA48: - bl sub_8070BD0 + bl DoEggActions_CheckHatch lsls r0, 24 cmp r0, 0 beq _0809CA64 diff --git a/asm/field_effect.s b/asm/field_effect.s index 964bf8079..bfa563af1 100644 --- a/asm/field_effect.s +++ b/asm/field_effect.s @@ -1988,7 +1988,7 @@ task00_8084310: @ 80B6A24 lsls r0, 24 cmp r0, 0 beq _080B6A8A - bl brm_get_pokemon_selection + bl GetCursorSelectionMonId ldr r1, =gFieldEffectArguments lsls r0, 24 lsrs r0, 24 diff --git a/asm/fldeff_80F9BCC.s b/asm/fldeff_80F9BCC.s index 7ebf0bfa8..efdc114a2 100644 --- a/asm/fldeff_80F9BCC.s +++ b/asm/fldeff_80F9BCC.s @@ -642,7 +642,7 @@ _080FA0C4: thumb_func_start sub_80FA0DC sub_80FA0DC: @ 80FA0DC push {lr} - bl brm_get_pokemon_selection + bl GetCursorSelectionMonId ldr r1, =gFieldEffectArguments lsls r0, 24 lsrs r0, 24 @@ -777,7 +777,7 @@ sub_80FA1D8: @ 80FA1D8 thumb_func_start sub_80FA1E8 sub_80FA1E8: @ 80FA1E8 push {lr} - bl brm_get_pokemon_selection + bl GetCursorSelectionMonId ldr r1, =gFieldEffectArguments lsls r0, 24 lsrs r0, 24 @@ -950,7 +950,7 @@ sub_80FA33C: @ 80FA33C thumb_func_start sub_80FA34C sub_80FA34C: @ 80FA34C push {lr} - bl brm_get_pokemon_selection + bl GetCursorSelectionMonId ldr r1, =gFieldEffectArguments lsls r0, 24 lsrs r0, 24 diff --git a/asm/fldeff_cut.s b/asm/fldeff_cut.s index 5e2a99d18..71137b705 100755 --- a/asm/fldeff_cut.s +++ b/asm/fldeff_cut.s @@ -32,7 +32,7 @@ _080D3754: ldr r0, =gUnknown_0203AB40 adds r1, r0, 0x2 bl PlayerGetDestCoords - bl brm_get_pokemon_selection + bl GetCursorSelectionMonId lsls r0, 24 lsrs r0, 24 movs r1, 0x64 @@ -384,7 +384,7 @@ hm2_ruin_valley: @ 80D3A50 push {lr} movs r0, 0x1 bl FieldEffectStart - bl brm_get_pokemon_selection + bl GetCursorSelectionMonId ldr r1, =gFieldEffectArguments lsls r0, 24 lsrs r0, 24 @@ -420,7 +420,7 @@ sub_80D3A6C: @ 80D3A6C thumb_func_start sub_80D3A9C sub_80D3A9C: @ 80D3A9C push {lr} - bl brm_get_pokemon_selection + bl GetCursorSelectionMonId ldr r1, =gFieldEffectArguments lsls r0, 24 lsrs r0, 24 diff --git a/asm/fldeff_softboiled.s b/asm/fldeff_softboiled.s index 48d968d20..c3aa4f1ed 100755 --- a/asm/fldeff_softboiled.s +++ b/asm/fldeff_softboiled.s @@ -8,7 +8,7 @@ thumb_func_start hm_prepare_dive_probably hm_prepare_dive_probably: @ 8161508 push {r4-r6,lr} - bl brm_get_pokemon_selection + bl GetCursorSelectionMonId lsls r0, 24 lsrs r0, 24 movs r6, 0x64 @@ -20,7 +20,7 @@ hm_prepare_dive_probably: @ 8161508 adds r5, r0, 0 lsls r5, 16 lsrs r5, 16 - bl brm_get_pokemon_selection + bl GetCursorSelectionMonId lsls r0, 24 lsrs r0, 24 muls r0, r6 @@ -59,7 +59,7 @@ sub_8161560: @ 8161560 strb r1, [r0, 0xB] ldrb r1, [r0, 0x9] strb r1, [r0, 0xA] - bl brm_get_pokemon_selection + bl GetCursorSelectionMonId lsls r0, 24 lsrs r0, 24 movs r1, 0x1 diff --git a/asm/fldeff_strength.s b/asm/fldeff_strength.s index 3001ca259..53a088aa3 100644 --- a/asm/fldeff_strength.s +++ b/asm/fldeff_strength.s @@ -18,7 +18,7 @@ hm_prepare_rocksmash: @ 8145DC4 b _08145DF2 _08145DD8: ldr r4, =gSpecialVar_Result - bl brm_get_pokemon_selection + bl GetCursorSelectionMonId lsls r0, 24 lsrs r0, 24 strh r0, [r4] @@ -39,7 +39,7 @@ _08145DF2: thumb_func_start sub_8145E0C sub_8145E0C: @ 8145E0C push {lr} - bl brm_get_pokemon_selection + bl GetCursorSelectionMonId ldr r1, =gFieldEffectArguments lsls r0, 24 lsrs r0, 24 diff --git a/asm/fldeff_sweetscent.s b/asm/fldeff_sweetscent.s index 9510ca4a0..eea0df12f 100644 --- a/asm/fldeff_sweetscent.s +++ b/asm/fldeff_sweetscent.s @@ -23,7 +23,7 @@ hm2_sweet_scent: @ 8159F10 push {lr} movs r0, 0x33 bl FieldEffectStart - bl brm_get_pokemon_selection + bl GetCursorSelectionMonId ldr r1, =gFieldEffectArguments lsls r0, 24 lsrs r0, 24 diff --git a/asm/fldeff_teleport.s b/asm/fldeff_teleport.s index d77e29dd2..17bab1496 100644 --- a/asm/fldeff_teleport.s +++ b/asm/fldeff_teleport.s @@ -38,7 +38,7 @@ hm_teleport_run_dp02scr: @ 817C8FC bl sub_808469C movs r0, 0x3F bl FieldEffectStart - bl brm_get_pokemon_selection + bl GetCursorSelectionMonId ldr r1, =gFieldEffectArguments lsls r0, 24 lsrs r0, 24 diff --git a/asm/mail_data.s b/asm/mail_data.s index 94cb3e9e6..70fc856d1 100755 --- a/asm/mail_data.s +++ b/asm/mail_data.s @@ -18,7 +18,7 @@ _080D4372: adds r1, r0 ldr r0, [r5] adds r0, r1 - bl sub_80D439C + bl ClearMailStruct adds r0, r4, 0x1 lsls r0, 24 lsrs r4, r0, 24 @@ -30,8 +30,8 @@ _080D4372: .pool thumb_func_end ClearMailData - thumb_func_start sub_80D439C -sub_80D439C: @ 80D439C + thumb_func_start ClearMailStruct +ClearMailStruct: @ 80D439C push {r4-r6,lr} adds r3, r0, 0 ldr r0, =0x0000ffff @@ -76,10 +76,10 @@ _080D43D6: pop {r0} bx r0 .pool - thumb_func_end sub_80D439C + thumb_func_end ClearMailStruct - thumb_func_start sub_80D43F0 -sub_80D43F0: @ 80D43F0 + thumb_func_start MonHasMail +MonHasMail: @ 80D43F0 push {r4,lr} adds r4, r0, 0 movs r1, 0xC @@ -103,7 +103,7 @@ _080D441A: pop {r4} pop {r1} bx r1 - thumb_func_end sub_80D43F0 + thumb_func_end MonHasMail thumb_func_start sub_80D4420 sub_80D4420: @ 80D4420 @@ -349,8 +349,8 @@ _080D4606: bx r1 thumb_func_end sub_80D45E8 - thumb_func_start sub_80D460C -sub_80D460C: @ 80D460C + thumb_func_start GiveMailToMon2 +GiveMailToMon2: @ 80D460C push {r4-r7,lr} sub sp, 0x8 adds r6, r0, 0 @@ -401,7 +401,7 @@ _080D4672: pop {r4-r7} pop {r1} bx r1 - thumb_func_end sub_80D460C + thumb_func_end GiveMailToMon2 thumb_func_start sub_80D467C sub_80D467C: @ 80D467C @@ -409,12 +409,12 @@ sub_80D467C: @ 80D467C bx lr thumb_func_end sub_80D467C - thumb_func_start sub_80D4680 -sub_80D4680: @ 80D4680 + thumb_func_start TakeMailFromMon +TakeMailFromMon: @ 80D4680 push {r4,lr} sub sp, 0x8 adds r4, r0, 0 - bl sub_80D43F0 + bl MonHasMail lsls r0, 24 cmp r0, 0 beq _080D46D2 @@ -454,7 +454,7 @@ _080D46D2: pop {r0} bx r0 .pool - thumb_func_end sub_80D4680 + thumb_func_end TakeMailFromMon thumb_func_start sub_80D46E0 sub_80D46E0: @ 80D46E0 diff --git a/asm/mystery_event_script.s b/asm/mystery_event_script.s index ce8591981..fbcc5f036 100644 --- a/asm/mystery_event_script.s +++ b/asm/mystery_event_script.s @@ -727,9 +727,9 @@ _08153D86: beq _08153DA4 adds r0, r7, 0 mov r1, sp - bl sub_80D460C + bl GiveMailToMon2 _08153DA4: - bl party_compaction + bl CompactPartySlots bl CalculatePlayerPartyCount ldr r0, =gStringVar4 ldr r1, =gUnknown_08674BF0 diff --git a/asm/party_menu.s b/asm/party_menu.s index 0e6267b0d..018ee7b84 100755 --- a/asm/party_menu.s +++ b/asm/party_menu.s @@ -2111,13 +2111,13 @@ _081B134C: bx r0 thumb_func_end c3_0811FAB4 - thumb_func_start brm_get_pokemon_selection -brm_get_pokemon_selection: @ 81B1354 + thumb_func_start GetCursorSelectionMonId +GetCursorSelectionMonId: @ 81B1354 ldr r0, =gUnknown_0203CEC8 ldrb r0, [r0, 0x9] bx lr .pool - thumb_func_end brm_get_pokemon_selection + thumb_func_end GetCursorSelectionMonId thumb_func_start sub_81B1360 sub_81B1360: @ 81B1360 @@ -8140,7 +8140,7 @@ sub_81B4578: @ 81B4578 cmp r7, 0 bne _081B45F8 adds r0, r5, 0 - bl sub_80D4680 + bl TakeMailFromMon ldr r4, =gUnknown_0203CEFC adds r0, r5, 0 movs r1, 0xC @@ -8925,7 +8925,7 @@ _081B4CBE: ldrsb r0, [r1, r0] muls r0, r7 adds r0, r6 - bl sub_80D4680 + bl TakeMailFromMon ldr r0, =gText_MailTakenFromPkmn movs r1, 0 bl sub_81B1B5C @@ -10134,7 +10134,7 @@ _081B57FE: thumb_func_start hm_surf_run_dp02scr hm_surf_run_dp02scr: @ 81B5804 push {lr} - bl brm_get_pokemon_selection + bl GetCursorSelectionMonId ldr r1, =gFieldEffectArguments lsls r0, 24 lsrs r0, 24 @@ -10238,7 +10238,7 @@ sub_81B58A8: @ 81B58A8 thumb_func_start hm2_waterfall hm2_waterfall: @ 81B58D4 push {lr} - bl brm_get_pokemon_selection + bl GetCursorSelectionMonId ldr r1, =gFieldEffectArguments lsls r0, 24 lsrs r0, 24 @@ -10298,7 +10298,7 @@ _081B594E: thumb_func_start sub_81B5958 sub_81B5958: @ 81B5958 push {lr} - bl brm_get_pokemon_selection + bl GetCursorSelectionMonId ldr r1, =gFieldEffectArguments lsls r0, 24 lsrs r0, 24 @@ -14938,7 +14938,7 @@ sub_81B81A8: @ 81B81A8 cmp r0, 0 bne _081B8208 adds r0, r5, 0 - bl sub_80D4680 + bl TakeMailFromMon ldr r4, =gUnknown_0203CEFC adds r0, r5, 0 movs r1, 0xC @@ -15281,9 +15281,9 @@ sub_81B8474: @ 81B8474 _081B84DC: adds r0, r5, 0 adds r1, r4, 0 - bl sub_80D460C + bl GiveMailToMon2 adds r0, r4, 0 - bl sub_80D439C + bl ClearMailStruct ldr r0, =gText_MailTransferredFromMailbox movs r1, 0x1 bl sub_81B1B5C @@ -15994,7 +15994,7 @@ sub_81B8A7C: @ 81B8A7C push {r4-r7,lr} mov r7, r8 push {r7} - bl brm_get_pokemon_selection + bl GetCursorSelectionMonId lsls r0, 24 lsrs r5, r0, 24 bl sub_81B1250 @@ -17113,7 +17113,7 @@ sub_81B9354: @ 81B9354 sub_81B9390: @ 81B9390 push {r4,lr} ldr r4, =gSpecialVar_0x8004 - bl brm_get_pokemon_selection + bl GetCursorSelectionMonId lsls r0, 24 lsrs r0, 24 strh r0, [r4] @@ -17218,7 +17218,7 @@ _081B945C: thumb_func_start sub_81B9470 sub_81B9470: @ 81B9470 push {lr} - bl brm_get_pokemon_selection + bl GetCursorSelectionMonId ldr r2, =gUnknown_02039F24 strb r0, [r2] lsls r0, 24 @@ -17345,7 +17345,7 @@ _081B9574: sub_81B9588: @ 81B9588 push {r4,r5,lr} ldr r5, =gSpecialVar_0x8004 - bl brm_get_pokemon_selection + bl GetCursorSelectionMonId lsls r0, 24 lsrs r0, 24 strh r0, [r5] diff --git a/asm/player_pc.s b/asm/player_pc.s index 592cc0fe0..2287d4123 100644 --- a/asm/player_pc.s +++ b/asm/player_pc.s @@ -1444,7 +1444,7 @@ _0816BA68: adds r0, r6, 0 bl DisplayItemMessageOnField adds r0, r5, 0 - bl sub_80D439C + bl ClearMailStruct bl sub_816B54C ldrb r0, [r4, 0x5] subs r0, 0x1 diff --git a/asm/pokemon_1.s b/asm/pokemon_1.s index ed97cd672..15b4af009 100644 --- a/asm/pokemon_1.s +++ b/asm/pokemon_1.s @@ -1310,8 +1310,8 @@ _08068FF4: bx r0 thumb_func_end CalculateMonStats - thumb_func_start sub_8069004 -sub_8069004: @ 8069004 + thumb_func_start BoxMonToMon +BoxMonToMon: @ 8069004 push {r4,lr} sub sp, 0x4 adds r2, r0, 0 @@ -1346,7 +1346,7 @@ sub_8069004: @ 8069004 pop {r4} pop {r0} bx r0 - thumb_func_end sub_8069004 + thumb_func_end BoxMonToMon thumb_func_start GetLevelFromMonExp GetLevelFromMonExp: @ 8069054 diff --git a/asm/pokemon_storage_system.s b/asm/pokemon_storage_system.s index f7941335d..94245f93b 100755 --- a/asm/pokemon_storage_system.s +++ b/asm/pokemon_storage_system.s @@ -3323,7 +3323,7 @@ _080C8E38: b _080C8EA0 .pool _080C8E4C: - bl party_compaction + bl CompactPartySlots bl sub_80CB950 ldr r0, =gUnknown_02039D08 ldr r1, [r0] @@ -3483,7 +3483,7 @@ _080C8FA4: ldrb r0, [r0] cmp r0, 0 beq _080C8FD0 - bl party_compaction + bl CompactPartySlots bl sub_80CB950 b _080C905C .pool @@ -4237,7 +4237,7 @@ sub_80C9670: @ 80C9670 b _080C96AE .pool _080C9688: - bl party_compaction + bl CompactPartySlots bl sub_80CB950 ldr r1, [r4] ldrb r0, [r1] @@ -6351,7 +6351,7 @@ _080CA94C: movs r1, 0 strb r1, [r0] bl sub_80CBB9C - bl party_compaction + bl CompactPartySlots movs r0, 0x2 str r0, [sp] movs r1, 0 @@ -13977,8 +13977,8 @@ _080CE900: .pool thumb_func_end sub_80CE8E4 - thumb_func_start party_compaction -party_compaction: @ 80CE90C + thumb_func_start CompactPartySlots +CompactPartySlots: @ 80CE90C push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -14055,7 +14055,7 @@ _080CE992: pop {r1} bx r1 .pool - thumb_func_end party_compaction + thumb_func_end CompactPartySlots thumb_func_start sub_80CE9A8 sub_80CE9A8: @ 80CE9A8 @@ -20826,7 +20826,7 @@ sub_80D2054: @ 80D2054 lsls r1, 4 adds r0, r1 adds r1, r5, 0 - bl sub_8069004 + bl BoxMonToMon _080D2088: pop {r4,r5} pop {r0} diff --git a/asm/pokenav.s b/asm/pokenav.s index d3b0fae7d..9394307b7 100755 --- a/asm/pokenav.s +++ b/asm/pokenav.s @@ -25722,7 +25722,7 @@ sub_81D3AD8: @ 81D3AD8 adds r5, r0, 0 adds r4, r1, 0 movs r0, 0x1E - bl sub_81535DC + bl TryCopySpecialSaveSection cmp r0, 0x1 bne _081D3B04 ldr r2, =0x00000ee8 diff --git a/asm/record_mixing.s b/asm/record_mixing.s index d6b331834..b237ed072 100644 --- a/asm/record_mixing.s +++ b/asm/record_mixing.s @@ -3607,7 +3607,7 @@ sub_80E89F8: @ 80E89F8 ldr r1, =0x00003030 adds r0, r1 adds r1, r5, 0 - bl sub_806FA9C + bl InitDaycareMailRecordMixing ldr r0, =gUnknown_03001148 ldr r1, [r0] adds r0, r6, 0 diff --git a/asm/recorded_battle.s b/asm/recorded_battle.s deleted file mode 100644 index 2545e478d..000000000 --- a/asm/recorded_battle.s +++ /dev/null @@ -1,2749 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start sub_8184DA4 -sub_8184DA4: @ 8184DA4 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r12, r0 - ldr r0, =gUnknown_0203C7AC - mov r1, r12 - strb r1, [r0] - ldr r1, =gUnknown_0203CCD0 - movs r0, 0 - strb r0, [r1] - movs r2, 0 - movs r7, 0 - ldr r3, =gUnknown_0203C7BC - mov r10, r3 - ldr r6, =gUnknown_0203C794 - mov r9, r6 - ldr r0, =gUnknown_0203BD34 - mov r8, r0 -_08184DD0: - lsls r0, r2, 1 - mov r3, r9 - adds r1, r0, r3 - strh r7, [r1] - ldr r6, =gUnknown_0203C79C - adds r1, r0, r6 - strh r7, [r1] - ldr r1, =gUnknown_0203C7A4 - adds r0, r1 - strh r7, [r0] - adds r4, r2, 0x1 - mov r3, r12 - cmp r3, 0x1 - bne _08184E1C - ldr r5, =gBattleTypeFlags - movs r3, 0xFF - movs r1, 0xA6 - lsls r1, 2 - adds r0, r2, 0 - muls r0, r1 - mov r6, r8 - adds r2, r0, r6 -_08184DFC: - ldrb r0, [r2] - orrs r0, r3 - strb r0, [r2] - adds r2, 0x1 - subs r1, 0x1 - cmp r1, 0 - bne _08184DFC - ldr r0, [r5] - ldr r1, =gUnknown_0203C7B8 - str r0, [r1] - ldr r3, =gBattleResources - ldr r0, [r3] - ldr r0, [r0, 0x14] - ldr r0, [r0, 0xC] - mov r6, r10 - str r0, [r6] -_08184E1C: - adds r2, r4, 0 - cmp r2, 0x3 - ble _08184DD0 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8184DA4 - - thumb_func_start sub_8184E58 -sub_8184E58: @ 8184E58 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x20 - ldr r0, =gUnknown_0203C7AC - ldrb r0, [r0] - cmp r0, 0x1 - bne _08184EA0 - ldr r1, =gRecordedBattleRngSeed - ldr r0, =gRngValue - ldr r0, [r0] - str r0, [r1] - ldr r4, =gUnknown_0203C7AE - ldr r0, =0x000040cf - bl VarGet - strb r0, [r4] - ldr r4, =gUnknown_0203C7AF - bl sub_81A513C - strb r0, [r4] - b _08184EAC - .pool -_08184EA0: - cmp r0, 0x2 - bne _08184EAC - ldr r0, =gRngValue - ldr r1, =gRecordedBattleRngSeed - ldr r1, [r1] - str r1, [r0] -_08184EAC: - ldr r0, =gBattleTypeFlags - ldr r5, [r0] - movs r0, 0x2 - ands r5, r0 - cmp r5, 0 - beq _08184F64 - bl GetMultiplayerId - ldr r1, =gUnknown_0203C7B4 - strb r0, [r1] - bl GetLinkPlayerCount - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - movs r5, 0 - ldr r0, =gUnknown_0203CC80 - mov r9, r0 - ldr r6, =gLinkPlayers - movs r0, 0x8 - adds r0, r6 - mov r8, r0 - mov r7, r9 - adds r7, 0x4 -_08184EDC: - lsls r0, r5, 2 - adds r0, r5 - lsls r4, r0, 2 - mov r0, r9 - adds r2, r4, r0 - lsls r0, r5, 3 - subs r0, r5 - lsls r3, r0, 2 - adds r0, r6, 0x4 - adds r0, r3, r0 - ldr r0, [r0] - str r0, [r2] - adds r1, r3, r6 - ldrb r0, [r1, 0x13] - strb r0, [r2, 0xC] - ldrh r0, [r1, 0x18] - strh r0, [r2, 0xE] - ldrh r0, [r1, 0x1A] - strh r0, [r2, 0x10] - cmp r5, r10 - bge _08184F3C - mov r0, r8 - adds r1, r3, r0 - mov r0, sp - bl StringCopy - mov r0, sp - bl StripExtCtrlCodes - adds r0, r4, r7 - mov r1, sp - bl StringCopy - adds r5, 0x1 - b _08184F56 - .pool -_08184F3C: - adds r5, 0x1 - ldr r0, =gLinkPlayers + 8 - adds r1, r3, r0 - ldr r0, =gUnknown_0203CC84 - adds r2, r4, r0 - movs r3, 0x7 -_08184F48: - ldrb r0, [r1] - strb r0, [r2] - adds r1, 0x1 - adds r2, 0x1 - subs r3, 0x1 - cmp r3, 0 - bge _08184F48 -_08184F56: - cmp r5, 0x3 - ble _08184EDC - b _08184FA0 - .pool -_08184F64: - ldr r3, =gUnknown_0203CC80 - ldr r4, =gSaveBlock2Ptr - ldr r2, [r4] - ldrb r1, [r2, 0xA] - ldrb r0, [r2, 0xB] - lsls r0, 8 - orrs r1, r0 - ldrb r0, [r2, 0xC] - lsls r0, 16 - orrs r1, r0 - ldrb r0, [r2, 0xD] - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - ldrb r0, [r2, 0x8] - strb r0, [r3, 0xC] - strh r5, [r3, 0xE] - ldr r0, =gGameLanguage - ldrb r0, [r0] - strh r0, [r3, 0x10] - movs r5, 0 - adds r3, 0x4 -_08184F90: - adds r0, r5, r3 - ldr r1, [r4] - adds r1, r5 - ldrb r1, [r1] - strb r1, [r0] - adds r5, 0x1 - cmp r5, 0x7 - ble _08184F90 -_08184FA0: - add sp, 0x20 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8184E58 - - thumb_func_start RecordedBattle_SetBankAction -RecordedBattle_SetBankAction: @ 8184FBC - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r6, r1, 24 - ldr r1, =gUnknown_0203C794 - lsls r0, r5, 1 - adds r4, r0, r1 - ldrh r2, [r4] - adds r3, r2, 0 - ldr r0, =0x00000297 - cmp r3, r0 - bhi _08184FF0 - ldr r0, =gUnknown_0203C7AC - ldrb r0, [r0] - cmp r0, 0x2 - beq _08184FF0 - ldr r1, =gUnknown_0203BD34 - adds r0, r2, 0x1 - strh r0, [r4] - movs r0, 0xA6 - lsls r0, 2 - muls r0, r5 - adds r0, r3, r0 - adds r0, r1 - strb r6, [r0] -_08184FF0: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end RecordedBattle_SetBankAction - - thumb_func_start RecordedBattle_ClearBankAction -RecordedBattle_ClearBankAction: @ 8185008 - push {r4-r7,lr} - lsls r0, 24 - lsrs r5, r0, 24 - lsls r1, 24 - lsrs r4, r1, 24 - movs r3, 0 - cmp r3, r4 - bge _08185046 - ldr r0, =gUnknown_0203C794 - lsls r1, r5, 1 - adds r2, r1, r0 - ldr r7, =gUnknown_0203BD34 - movs r0, 0xA6 - lsls r0, 2 - muls r5, r0 - movs r6, 0xFF -_08185028: - ldrh r0, [r2] - subs r0, 0x1 - strh r0, [r2] - ldrh r1, [r2] - adds r1, r5 - adds r1, r7 - ldrb r0, [r1] - orrs r0, r6 - strb r0, [r1] - ldrh r0, [r2] - cmp r0, 0 - beq _08185046 - adds r3, 0x1 - cmp r3, r4 - blt _08185028 -_08185046: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end RecordedBattle_ClearBankAction - - thumb_func_start RecordedBattle_ReadBankAction -RecordedBattle_ReadBankAction: @ 8185054 - push {r4,lr} - sub sp, 0x4 - lsls r0, 24 - lsrs r3, r0, 24 - ldr r1, =gUnknown_0203C794 - lsls r0, r3, 1 - adds r2, r0, r1 - ldrh r1, [r2] - ldr r0, =0x00000297 - cmp r1, r0 - bhi _0818507A - ldr r4, =gUnknown_0203BD34 - adds r0, 0x1 - muls r3, r0 - adds r0, r1, r3 - adds r0, r4 - ldrb r0, [r0] - cmp r0, 0xFF - bne _081850BC -_0818507A: - ldr r2, =gSpecialVar_Result - ldr r1, =gBattleOutcome - movs r0, 0x5 - strb r0, [r1] - movs r0, 0x5 - strh r0, [r2] - bl ResetPaletteFadeControl - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r0, =CB2_QuitRecordedBattle - bl SetMainCallback2 - movs r0, 0xFF - b _081850C6 - .pool -_081850BC: - adds r0, r1, 0x1 - strh r0, [r2] - adds r0, r1, r3 - adds r0, r4 - ldrb r0, [r0] -_081850C6: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - thumb_func_end RecordedBattle_ReadBankAction - - thumb_func_start sub_81850D0 -sub_81850D0: @ 81850D0 - ldr r0, =gUnknown_0203C7AC - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_81850D0 - - thumb_func_start sub_81850DC -sub_81850DC: @ 81850DC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - mov r8, r0 - movs r7, 0 - movs r0, 0 - mov r12, r0 -_081850F0: - mov r1, r12 - lsls r3, r1, 1 - ldr r0, =gUnknown_0203C794 - adds r5, r3, r0 - ldr r1, =gUnknown_0203C79C - adds r6, r3, r1 - ldrh r0, [r5] - mov r9, r3 - mov r1, r12 - adds r1, 0x1 - str r1, [sp] - ldrh r1, [r6] - cmp r0, r1 - beq _0818517E - adds r1, r7, 0 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - adds r2, r7, 0 - add r1, r8 - mov r0, r12 - strb r0, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - add r2, r8 - ldrb r0, [r5] - ldrb r1, [r6] - subs r0, r1 - strb r0, [r2] - movs r4, 0 - ldrh r0, [r5] - ldrh r1, [r6] - subs r0, r1 - cmp r4, r0 - bge _08185172 - ldr r1, =gUnknown_0203BD34 - mov r10, r1 - ldr r6, =gUnknown_0203C79C - movs r0, 0xA6 - lsls r0, 2 - mov r5, r12 - muls r5, r0 -_08185146: - adds r1, r7, 0 - adds r0, r1, 0x1 - lsls r0, 24 - lsrs r7, r0, 24 - add r1, r8 - adds r2, r3, r6 - ldrh r0, [r2] - adds r0, r4 - adds r0, r5 - add r0, r10 - ldrb r0, [r0] - strb r0, [r1] - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gUnknown_0203C794 - adds r0, r3, r1 - ldrh r1, [r0] - ldrh r0, [r2] - subs r1, r0 - cmp r4, r1 - blt _08185146 -_08185172: - ldr r0, =gUnknown_0203C79C - add r0, r9 - ldr r1, =gUnknown_0203C794 - add r1, r9 - ldrh r1, [r1] - strh r1, [r0] -_0818517E: - ldr r1, [sp] - lsls r0, r1, 24 - lsrs r0, 24 - mov r12, r0 - cmp r0, 0x3 - bls _081850F0 - adds r0, r7, 0 - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_81850DC - - thumb_func_start sub_81851A8 -sub_81851A8: @ 81851A8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x8 - adds r7, r0, 0 - movs r1, 0x2 - mov r0, sp - strb r1, [r0] - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - ands r0, r1 - cmp r0, 0 - beq _0818525E - movs r5, 0 - ldr r4, =gLinkPlayers - b _081851DA - .pool -_081851D0: - ldrb r0, [r4] - cmp r0, 0x3 - bne _0818525E - adds r4, 0x1C - adds r5, 0x1 -_081851DA: - bl GetLinkPlayerCount - lsls r0, 24 - lsrs r0, 24 - cmp r5, r0 - blt _081851D0 - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - movs r1, 0x4 - ands r0, r1 - cmp r0, 0 - bne _0818525E - ldrb r0, [r7] - mov r4, sp - adds r4, 0x1 - strb r0, [r4] - ldrb r0, [r4] - mov r8, r4 - cmp r0, 0 - beq _0818525E -_08185202: - adds r0, r7, 0 - mov r1, sp - adds r2, r4, 0 - bl sub_8185278 - lsls r0, 24 - lsrs r6, r0, 24 - adds r0, r7, 0 - mov r1, sp - adds r2, r4, 0 - bl sub_8185278 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - beq _08185256 - ldr r3, =gUnknown_0203BD34 - ldr r0, =gUnknown_0203C7A4 - lsls r1, r6, 1 - adds r4, r1, r0 - adds r5, r2, 0 - movs r0, 0xA6 - lsls r0, 2 - muls r6, r0 -_08185232: - adds r0, r7, 0 - mov r1, sp - mov r2, r8 - str r3, [sp, 0x4] - bl sub_8185278 - ldrh r1, [r4] - adds r2, r1, 0x1 - strh r2, [r4] - lsls r1, 16 - lsrs r1, 16 - adds r1, r6 - ldr r3, [sp, 0x4] - adds r1, r3 - strb r0, [r1] - subs r5, 0x1 - cmp r5, 0 - bne _08185232 -_08185256: - mov r4, r8 - ldrb r0, [r4] - cmp r0, 0 - bne _08185202 -_0818525E: - add sp, 0x8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81851A8 - - thumb_func_start sub_8185278 -sub_8185278: @ 8185278 - ldrb r3, [r2] - subs r3, 0x1 - strb r3, [r2] - ldrb r2, [r1] - adds r3, r2, 0x1 - strb r3, [r1] - lsls r2, 24 - lsrs r2, 24 - adds r0, r2 - ldrb r0, [r0] - bx lr - thumb_func_end sub_8185278 - - thumb_func_start sub_8185290 -sub_8185290: @ 8185290 - push {r4,r5,lr} - movs r0, 0xF8 - lsls r0, 4 - bl AllocZeroed - adds r4, r0, 0 - bl start_ov_to_battle_anim - adds r5, r0, 0 - adds r0, r4, 0 - bl Free - adds r0, r5, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8185290 - - thumb_func_start sub_81852B0 -sub_81852B0: @ 81852B0 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r1, =0x000004ec - adds r0, r5, r1 - ldr r1, [r0] - cmp r1, 0 - beq _081852E8 - ldr r0, =0x7d007e92 - ands r1, r0 - cmp r1, 0 - bne _081852E8 - ldr r4, =0x00000f7c - adds r0, r5, 0 - adds r1, r4, 0 - bl CalcByteArraySum - adds r4, r5, r4 - ldr r1, [r4] - cmp r0, r1 - bne _081852E8 - movs r0, 0x1 - b _081852EA - .pool -_081852E8: - movs r0, 0 -_081852EA: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81852B0 - - thumb_func_start sub_81852F0 -sub_81852F0: @ 81852F0 - push {r4,r5,lr} - adds r4, r0, 0 - adds r5, r1, 0 - movs r2, 0x80 - lsls r2, 5 - adds r0, r5, 0 - movs r1, 0 - bl memset - movs r2, 0xF8 - lsls r2, 4 - adds r0, r5, 0 - adds r1, r4, 0 - bl memcpy - ldr r4, =0x00000f7c - adds r0, r5, 0 - adds r1, r4, 0 - bl CalcByteArraySum - adds r4, r5, r4 - str r0, [r4] - movs r0, 0x1F - adds r1, r5, 0 - bl sub_8153634 - cmp r0, 0x1 - bne _08185330 - movs r0, 0x1 - b _08185332 - .pool -_08185330: - movs r0, 0 -_08185332: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_81852F0 - - thumb_func_start MoveRecordedBattleToSaveData -MoveRecordedBattleToSaveData: @ 8185338 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - movs r0, 0 - str r0, [sp, 0x4] - movs r0, 0xF8 - lsls r0, 4 - bl AllocZeroed - adds r7, r0, 0 - movs r0, 0x80 - lsls r0, 5 - bl AllocZeroed - str r0, [sp] - movs r6, 0 -_0818535E: - movs r0, 0x64 - adds r4, r6, 0 - muls r4, r0 - adds r5, r7, r4 - ldr r1, =gUnknown_0203C7C0 - adds r1, r4, r1 - adds r0, r5, 0 - movs r2, 0x64 - bl memcpy - movs r1, 0x96 - lsls r1, 2 - adds r5, r1 - ldr r0, =gUnknown_0203CA18 - adds r4, r0 - adds r0, r5, 0 - adds r1, r4, 0 - movs r2, 0x64 - bl memcpy - adds r6, 0x1 - cmp r6, 0x5 - ble _0818535E - movs r6, 0 - ldr r2, =gSaveBlock2Ptr - mov r9, r2 - movs r3, 0x9A - lsls r3, 3 - adds r3, r7, r3 - str r3, [sp, 0x8] - ldr r5, =gUnknown_0203CC80 - mov r8, r6 - mov r12, r6 - movs r4, 0x96 - lsls r4, 3 - adds r4, r7 - mov r10, r4 - ldr r0, =0x000004e4 - adds r4, r7, r0 -_081853AC: - lsls r1, r6, 3 - ldr r0, =gUnknown_0203CC80 - adds r0, 0x4 - mov r3, r8 - adds r2, r3, r0 - add r1, r10 - movs r3, 0x7 -_081853BA: - ldrb r0, [r2] - strb r0, [r1] - adds r2, 0x1 - adds r1, 0x1 - subs r3, 0x1 - cmp r3, 0 - bge _081853BA - ldr r0, [sp, 0x8] - adds r1, r0, r6 - ldrb r0, [r5, 0xC] - strb r0, [r1] - ldrh r0, [r5, 0x10] - strb r0, [r4] - ldrh r0, [r5, 0xE] - strb r0, [r4, 0xC] - ldr r1, =0x000004d4 - adds r0, r7, r1 - add r0, r12 - ldr r1, [r5] - str r1, [r0] - adds r5, 0x14 - movs r2, 0x14 - add r8, r2 - movs r3, 0x4 - add r12, r3 - adds r4, 0x1 - adds r6, 0x1 - cmp r6, 0x3 - ble _081853AC - movs r4, 0x9D - lsls r4, 3 - adds r1, r7, r4 - ldr r5, =gRecordedBattleRngSeed - ldr r0, [r5] - str r0, [r1] - ldr r0, =gUnknown_0203C7B8 - ldr r2, [r0] - movs r0, 0x2 - ands r0, r2 - cmp r0, 0 - beq _081854DC - ldr r1, =0x000004ec - adds r3, r7, r1 - movs r1, 0x23 - negs r1, r1 - ands r1, r2 - movs r0, 0x80 - lsls r0, 18 - orrs r1, r0 - str r1, [r3] - movs r0, 0x4 - ands r0, r2 - cmp r0, 0 - beq _08185454 - movs r0, 0x80 - lsls r0, 24 - orrs r1, r0 - str r1, [r3] - b _081854E2 - .pool -_08185454: - movs r0, 0x40 - ands r2, r0 - cmp r2, 0 - beq _081854E2 - ldr r2, =gUnknown_0203CC80 - ldrh r0, [r2, 0xE] - cmp r0, 0x1 - beq _081854A8 - cmp r0, 0x1 - bgt _08185474 - cmp r0, 0 - beq _0818547E - b _081854E2 - .pool -_08185474: - cmp r0, 0x2 - beq _0818547E - cmp r0, 0x3 - beq _081854A8 - b _081854E2 -_0818547E: - ldr r3, =gUnknown_0203C7B4 - ldrb r1, [r3] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - ldr r4, =gUnknown_0203CC80 - adds r0, r4 - ldrh r1, [r0, 0xE] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _081854E2 - ldr r5, =0x000004ec - adds r0, r7, r5 - b _081854C4 - .pool -_081854A8: - ldr r0, =gUnknown_0203C7B4 - ldrb r1, [r0] - lsls r0, r1, 2 - adds r0, r1 - lsls r0, 2 - ldr r1, =gUnknown_0203CC80 - adds r0, r1 - ldrh r1, [r0, 0xE] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081854E2 - ldr r2, =0x000004ec - adds r0, r7, r2 -_081854C4: - ldr r1, [r0] - movs r2, 0x80 - lsls r2, 24 - orrs r1, r2 - str r1, [r0] - b _081854E2 - .pool -_081854DC: - ldr r3, =0x000004ec - adds r0, r7, r3 - str r2, [r0] -_081854E2: - ldr r4, =gTrainerBattleOpponent_A - ldrh r1, [r4] - ldr r5, =0x000004f4 - adds r0, r7, r5 - strh r1, [r0] - ldr r0, =gTrainerBattleOpponent_B - ldrh r1, [r0] - ldr r2, =0x000004f6 - adds r0, r7, r2 - strh r1, [r0] - ldr r3, =gPartnerTrainerId - ldrh r1, [r3] - movs r4, 0x9F - lsls r4, 3 - adds r0, r7, r4 - strh r1, [r0] - ldr r5, =gUnknown_0203C7B4 - ldrb r1, [r5] - adds r2, 0x4 - adds r0, r7, r2 - strh r1, [r0] - mov r3, r9 - ldr r0, [r3] - ldr r4, =0x00000ca9 - adds r0, r4 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - ldr r5, =0x000004fc - adds r1, r7, r5 - strb r0, [r1] - ldr r0, =gUnknown_0203C7AE - ldrb r1, [r0] - adds r2, 0x3 - adds r0, r7, r2 - strb r1, [r0] - ldr r3, =gUnknown_0203C7AF - ldrb r1, [r3] - ldr r4, =0x000004fe - adds r0, r7, r4 - strb r1, [r0] - mov r5, r9 - ldr r0, [r5] - ldrb r1, [r0, 0x15] - lsls r1, 29 - ldr r0, =0x000004ff - adds r3, r7, r0 - lsrs r1, 31 - ldrb r2, [r3] - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - ldr r1, [r5] - ldrb r1, [r1, 0x14] - lsls r1, 29 - lsrs r1, 28 - movs r2, 0xF - negs r2, r2 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - movs r2, 0xA0 - lsls r2, 3 - adds r1, r7, r2 - ldr r3, =gUnknown_0203C7BC - ldr r0, [r3] - str r0, [r1] - ldr r4, =0xfffffed4 - adds r1, r4, 0 - ldr r5, =gTrainerBattleOpponent_A - ldrh r5, [r5] - adds r0, r1, r5 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x63 - bls _08185580 - b _081856C4 -_08185580: - movs r6, 0 - ldr r0, =0x00000504 - adds r3, r7, r0 - mov r10, r9 - ldr r1, =gTrainerBattleOpponent_A - mov r12, r1 - adds r2, r4, 0 - mov r8, r2 - ldr r4, =0x0000073c -_08185592: - adds r2, r3, r6 - mov r5, r10 - ldr r1, [r5] - mov r5, r12 - ldrh r0, [r5] - add r0, r8 - movs r5, 0xEC - muls r0, r5 - adds r0, r6, r0 - adds r1, r4 - adds r1, r0 - ldrb r0, [r1] - strb r0, [r2] - adds r6, 0x1 - cmp r6, 0x7 - ble _08185592 - mov r0, r9 - ldr r2, [r0] - ldr r1, =gTrainerBattleOpponent_A - ldrh r0, [r1] - ldr r3, =0xfffffed4 - adds r0, r3 - movs r1, 0xEC - muls r0, r1 - adds r2, r0 - ldr r4, =0x00000739 - adds r2, r4 - ldrb r1, [r2] - ldr r5, =0x0000050c - adds r0, r7, r5 - strb r1, [r0] - ldr r1, =gUnknown_0203CCE8 - ldrb r0, [r1] - cmp r0, 0x1 - bne _08185664 - movs r6, 0 - ldr r2, =0x0000050e - adds r4, r7, r2 - mov r10, r9 - ldr r5, =gTrainerBattleOpponent_A - mov r8, r5 - adds r5, r3, 0 -_081855E6: - lsls r3, r6, 1 - mov r0, r10 - ldr r2, [r0] - mov r1, r8 - ldrh r0, [r1] - adds r0, r5 - movs r1, 0xEC - muls r0, r1 - adds r3, r0 - movs r0, 0xEC - lsls r0, 3 - adds r2, r0 - adds r2, r3 - ldrh r0, [r2] - strh r0, [r4] - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0x5 - ble _081855E6 - b _08185696 - .pool -_08185664: - movs r6, 0 - ldr r1, =0x0000050e - adds r4, r7, r1 - mov r10, r9 - ldr r2, =gTrainerBattleOpponent_A - mov r8, r2 - adds r5, r3, 0 -_08185672: - lsls r3, r6, 1 - mov r0, r10 - ldr r2, [r0] - mov r1, r8 - ldrh r0, [r1] - adds r0, r5 - movs r1, 0xEC - muls r0, r1 - adds r3, r0 - ldr r0, =0x00000754 - adds r2, r0 - adds r2, r3 - ldrh r0, [r2] - strh r0, [r4] - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0x5 - ble _08185672 -_08185696: - mov r1, r9 - ldr r2, [r1] - ldr r3, =gTrainerBattleOpponent_A - ldrh r0, [r3] - ldr r4, =0xfffffed4 - adds r0, r4 - movs r1, 0xEC - muls r0, r1 - adds r2, r0 - ldr r5, =0x0000081c - adds r2, r5 - ldrb r1, [r2] - b _08185856 - .pool -_081856C4: - ldr r3, =gTrainerBattleOpponent_B - ldrh r3, [r3] - adds r0, r1, r3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x63 - bls _081856D4 - b _081857E4 -_081856D4: - movs r6, 0 - ldr r4, =0x00000504 - adds r3, r7, r4 - mov r10, r9 - ldr r5, =gTrainerBattleOpponent_B - mov r12, r5 - ldr r0, =0xfffffed4 - mov r8, r0 - ldr r4, =0x0000073c -_081856E6: - adds r2, r3, r6 - mov r5, r10 - ldr r1, [r5] - mov r5, r12 - ldrh r0, [r5] - add r0, r8 - movs r5, 0xEC - muls r0, r5 - adds r0, r6, r0 - adds r1, r4 - adds r1, r0 - ldrb r0, [r1] - strb r0, [r2] - adds r6, 0x1 - cmp r6, 0x7 - ble _081856E6 - mov r0, r9 - ldr r2, [r0] - ldr r1, =gTrainerBattleOpponent_B - ldrh r0, [r1] - ldr r3, =0xfffffed4 - adds r0, r3 - movs r1, 0xEC - muls r0, r1 - adds r2, r0 - ldr r4, =0x00000739 - adds r2, r4 - ldrb r1, [r2] - ldr r5, =0x0000050c - adds r0, r7, r5 - strb r1, [r0] - ldr r1, =gUnknown_0203CCE8 - ldrb r0, [r1] - cmp r0, 0x1 - bne _08185784 - movs r6, 0 - ldr r2, =0x0000050e - adds r4, r7, r2 - mov r10, r9 - ldr r5, =gTrainerBattleOpponent_B - mov r8, r5 - adds r5, r3, 0 -_0818573A: - lsls r3, r6, 1 - mov r0, r10 - ldr r2, [r0] - mov r1, r8 - ldrh r0, [r1] - adds r0, r5 - movs r1, 0xEC - muls r0, r1 - adds r3, r0 - movs r0, 0xEC - lsls r0, 3 - adds r2, r0 - adds r2, r3 - ldrh r0, [r2] - strh r0, [r4] - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0x5 - ble _0818573A - b _081857B6 - .pool -_08185784: - movs r6, 0 - ldr r1, =0x0000050e - adds r4, r7, r1 - mov r10, r9 - ldr r2, =gTrainerBattleOpponent_B - mov r8, r2 - adds r5, r3, 0 -_08185792: - lsls r3, r6, 1 - mov r0, r10 - ldr r2, [r0] - mov r1, r8 - ldrh r0, [r1] - adds r0, r5 - movs r1, 0xEC - muls r0, r1 - adds r3, r0 - ldr r0, =0x00000754 - adds r2, r0 - adds r2, r3 - ldrh r0, [r2] - strh r0, [r4] - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0x5 - ble _08185792 -_081857B6: - mov r1, r9 - ldr r2, [r1] - ldr r3, =gTrainerBattleOpponent_B - ldrh r0, [r3] - ldr r4, =0xfffffed4 - adds r0, r4 - movs r1, 0xEC - muls r0, r1 - adds r2, r0 - ldr r5, =0x0000081c - adds r2, r5 - ldrb r1, [r2] - b _08185856 - .pool -_081857E4: - ldr r3, =gPartnerTrainerId - ldrh r3, [r3] - adds r0, r1, r3 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x63 - bhi _0818585C - movs r6, 0 - ldr r4, =0x00000504 - adds r3, r7, r4 - mov r10, r9 - ldr r5, =gPartnerTrainerId - mov r12, r5 - ldr r0, =0xfffffed4 - mov r8, r0 - ldr r4, =0x0000073c -_08185804: - adds r2, r3, r6 - mov r5, r10 - ldr r1, [r5] - mov r5, r12 - ldrh r0, [r5] - add r0, r8 - movs r5, 0xEC - muls r0, r5 - adds r0, r6, r0 - adds r1, r4 - adds r1, r0 - ldrb r0, [r1] - strb r0, [r2] - adds r6, 0x1 - cmp r6, 0x7 - ble _08185804 - mov r0, r9 - ldr r1, [r0] - ldr r2, =gPartnerTrainerId - ldrh r0, [r2] - ldr r3, =0xfffffed4 - adds r0, r3 - movs r2, 0xEC - muls r0, r2 - adds r1, r0 - ldr r4, =0x00000739 - adds r1, r4 - ldrb r1, [r1] - ldr r5, =0x0000050c - adds r0, r7, r5 - strb r1, [r0] - mov r0, r9 - ldr r1, [r0] - ldr r4, =gPartnerTrainerId - ldrh r0, [r4] - adds r0, r3 - muls r0, r2 - adds r1, r0 - ldr r5, =0x0000081c - adds r1, r5 - ldrb r1, [r1] -_08185856: - ldr r2, =0x0000051a - adds r0, r7, r2 - strb r1, [r0] -_0818585C: - ldr r3, =gTrainerBattleOpponent_A - ldrh r0, [r3] - ldr r1, =0x0000018f - cmp r0, r1 - bls _08185900 - mov r4, r9 - ldr r2, [r4] - adds r1, r0, 0 - ldr r3, =0xfffffe70 - adds r1, r3 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, r0 - adds r2, 0xDC - ldrb r0, [r2] - lsls r0, 27 - lsrs r0, 27 - ldr r5, =0x0000050d - adds r1, r7, r5 - strb r0, [r1] - movs r6, 0 - ldr r0, =0x0000050e - adds r4, r7, r0 - mov r10, r9 - ldr r1, =gTrainerBattleOpponent_A - mov r8, r1 - adds r5, r3, 0 -_08185894: - lsls r3, r6, 1 - mov r0, r10 - ldr r2, [r0] - mov r0, r8 - ldrh r1, [r0] - adds r1, r5 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r3, r0 - movs r1, 0x82 - lsls r1, 1 - adds r2, r1 - adds r2, r3 - ldrh r0, [r2] - strh r0, [r4] - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0x5 - ble _08185894 - mov r3, r9 - ldr r2, [r3] - ldr r4, =gTrainerBattleOpponent_A - ldrh r1, [r4] - ldr r5, =0xfffffe70 - adds r1, r5 - b _081859AC - .pool -_08185900: - ldr r3, =gTrainerBattleOpponent_B - ldrh r0, [r3] - cmp r0, r1 - bls _0818597C - mov r4, r9 - ldr r2, [r4] - adds r1, r0, 0 - ldr r3, =0xfffffe70 - adds r1, r3 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, r0 - adds r2, 0xDC - ldrb r0, [r2] - lsls r0, 27 - lsrs r0, 27 - ldr r5, =0x0000050d - adds r1, r7, r5 - strb r0, [r1] - movs r6, 0 - ldr r0, =0x0000050e - adds r4, r7, r0 - mov r10, r9 - ldr r1, =gTrainerBattleOpponent_B - mov r8, r1 - adds r5, r3, 0 -_08185936: - lsls r3, r6, 1 - mov r0, r10 - ldr r2, [r0] - mov r0, r8 - ldrh r1, [r0] - adds r1, r5 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r3, r0 - movs r1, 0x82 - lsls r1, 1 - adds r2, r1 - adds r2, r3 - ldrh r0, [r2] - strh r0, [r4] - adds r4, 0x2 - adds r6, 0x1 - cmp r6, 0x5 - ble _08185936 - mov r3, r9 - ldr r2, [r3] - ldr r4, =gTrainerBattleOpponent_B - ldrh r1, [r4] - ldr r5, =0xfffffe70 - adds r1, r5 - b _081859AC - .pool -_0818597C: - ldr r3, =gPartnerTrainerId - ldrh r0, [r3] - cmp r0, r1 - bls _081859C0 - mov r4, r9 - ldr r2, [r4] - adds r1, r0, 0 - ldr r3, =0xfffffe70 - adds r1, r3 - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, r0 - adds r2, 0xDC - ldrb r0, [r2] - lsls r0, 27 - lsrs r0, 27 - ldr r5, =0x0000050d - adds r1, r7, r5 - strb r0, [r1] - ldr r2, [r4] - ldr r0, =gPartnerTrainerId - ldrh r1, [r0] - adds r1, r3 -_081859AC: - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, r0 - ldr r1, =0x0000011b - adds r0, r2, r1 - ldrb r1, [r0] - ldr r2, =0x0000051b - adds r0, r7, r2 - strb r1, [r0] -_081859C0: - movs r6, 0 - ldr r3, =0x00000297 - mov r10, r3 - ldr r4, =gUnknown_0203BD34 - mov r9, r4 - movs r5, 0xA6 - lsls r5, 2 - mov r8, r5 - ldr r0, =0x0000051c - adds r5, r7, r0 -_081859D4: - adds r4, r6, 0x1 - mov r0, r8 - muls r0, r6 - mov r1, r9 - adds r2, r0, r1 - adds r1, r0, r5 - mov r3, r10 - adds r3, 0x1 -_081859E4: - ldrb r0, [r2] - strb r0, [r1] - adds r2, 0x1 - adds r1, 0x1 - subs r3, 0x1 - cmp r3, 0 - bne _081859E4 - adds r6, r4, 0 - cmp r6, 0x3 - ble _081859D4 -_081859F8: - adds r0, r7, 0 - ldr r1, [sp] - bl sub_81852F0 - adds r4, r0, 0 - cmp r4, 0x1 - beq _08185A14 - ldr r0, [sp, 0x4] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x4] - cmp r0, 0x2 - bls _081859F8 -_08185A14: - adds r0, r7, 0 - bl Free - ldr r0, [sp] - bl Free - adds r0, r4, 0 - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end MoveRecordedBattleToSaveData - - thumb_func_start sub_8185A54 -sub_8185A54: @ 8185A54 - push {r4,r5,lr} - adds r5, r0, 0 - adds r4, r1, 0 - movs r0, 0x1F - bl sub_81535DC - cmp r0, 0x1 - bne _08185A7E - movs r2, 0xF8 - lsls r2, 4 - adds r0, r5, 0 - adds r1, r4, 0 - bl memcpy - adds r0, r5, 0 - bl sub_81852B0 - cmp r0, 0 - beq _08185A7E - movs r0, 0x1 - b _08185A80 -_08185A7E: - movs r0, 0 -_08185A80: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8185A54 - - thumb_func_start start_ov_to_battle_anim -start_ov_to_battle_anim: @ 8185A88 - push {r4,r5,lr} - adds r4, r0, 0 - movs r0, 0x80 - lsls r0, 5 - bl AllocZeroed - adds r5, r0, 0 - adds r0, r4, 0 - adds r1, r5, 0 - bl sub_8185A54 - adds r4, r0, 0 - adds r0, r5, 0 - bl Free - adds r0, r4, 0 - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end start_ov_to_battle_anim - - thumb_func_start sub_8185AB0 -sub_8185AB0: @ 8185AB0 - push {lr} - ldr r0, =gSaveBlock2Ptr - ldr r2, [r0] - ldr r0, =gUnknown_0203C7AD - ldrb r0, [r0] - ldr r1, =0x00000ca9 - adds r2, r1 - movs r1, 0x3 - ands r1, r0 - ldrb r3, [r2] - movs r0, 0x4 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - ldr r1, =gBattleOutcome - movs r0, 0 - strb r0, [r1] - ldr r0, =gBattleTypeFlags - movs r1, 0 - str r1, [r0] - ldr r0, =gTrainerBattleOpponent_A - strh r1, [r0] - ldr r0, =gTrainerBattleOpponent_B - strh r1, [r0] - ldr r0, =gPartnerTrainerId - strh r1, [r0] - bl sub_8185EFC - ldr r0, =gUnknown_0203C7B0 - ldr r0, [r0] - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_8185AB0 - - thumb_func_start sub_8185B1C -sub_8185B1C: @ 8185B1C - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x8] - subs r1, 0x1 - strh r1, [r0, 0x8] - lsls r1, 16 - cmp r1, 0 - bne _08185B4A - ldr r0, =gMain - ldr r1, =sub_8185AB0 - str r1, [r0, 0x8] - ldr r0, =CB2_InitBattle - bl SetMainCallback2 - adds r0, r4, 0 - bl DestroyTask -_08185B4A: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8185B1C - - thumb_func_start sub_8185B60 -sub_8185B60: @ 8185B60 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - adds r7, r0, 0 - bl ZeroPlayerPartyMons - bl ZeroEnemyPartyMons - movs r6, 0 - ldr r0, =gPlayerParty - mov r8, r0 -_08185B7C: - movs r0, 0x64 - adds r4, r6, 0 - muls r4, r0 - mov r1, r8 - adds r0, r4, r1 - adds r5, r7, r4 - adds r1, r5, 0 - movs r2, 0x64 - bl memcpy - ldr r0, =gEnemyParty - adds r4, r0 - movs r2, 0x96 - lsls r2, 2 - adds r5, r2 - adds r0, r4, 0 - adds r1, r5, 0 - movs r2, 0x64 - bl memcpy - adds r6, 0x1 - cmp r6, 0x5 - ble _08185B7C - movs r6, 0 - ldr r3, =gLinkPlayers - mov r8, r3 - mov r0, r8 - adds r0, 0x8 - str r0, [sp] - mov r4, r8 - adds r4, 0x4 - mov r10, r6 - mov r9, r6 -_08185BBE: - movs r1, 0 - mov r12, r1 - lsls r5, r6, 2 - movs r2, 0x96 - lsls r2, 3 - adds r0, r7, r2 - mov r3, r9 - adds r2, r3, r0 - mov r0, r10 - lsls r1, r0, 2 - mov r0, r8 - adds r0, 0x8 - adds r1, r0 - movs r3, 0x7 -_08185BDA: - ldrb r0, [r2] - strb r0, [r1] - ldrb r0, [r2] - cmp r0, 0xFF - bne _08185BE8 - movs r0, 0x1 - mov r12, r0 -_08185BE8: - adds r2, 0x1 - adds r1, 0x1 - subs r3, 0x1 - cmp r3, 0 - bge _08185BDA - movs r1, 0x9A - lsls r1, 3 - adds r0, r7, r1 - adds r0, r6 - ldrb r0, [r0] - strb r0, [r4, 0xF] - ldr r2, =0x000004e4 - adds r0, r7, r2 - adds r0, r6 - ldrb r1, [r0] - strh r1, [r4, 0x16] - movs r3, 0x9E - lsls r3, 3 - adds r0, r7, r3 - adds r0, r6 - ldrb r0, [r0] - strh r0, [r4, 0x14] - subs r2, 0x10 - adds r0, r7, r2 - adds r0, r5 - ldr r0, [r0] - str r0, [r4] - mov r3, r12 - cmp r3, 0 - beq _08185C2A - ldr r0, [sp] - bl ConvertInternationalString -_08185C2A: - ldr r0, [sp] - adds r0, 0x1C - str r0, [sp] - adds r4, 0x1C - movs r1, 0x7 - add r10, r1 - movs r2, 0x8 - add r9, r2 - adds r6, 0x1 - cmp r6, 0x3 - ble _08185BBE - ldr r1, =gRecordedBattleRngSeed - movs r3, 0x9D - lsls r3, 3 - adds r0, r7, r3 - ldr r0, [r0] - str r0, [r1] - ldr r2, =gBattleTypeFlags - ldr r1, =0x000004ec - adds r0, r7, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 17 - orrs r0, r1 - str r0, [r2] - ldr r1, =gTrainerBattleOpponent_A - ldr r2, =0x000004f4 - adds r0, r7, r2 - ldrh r0, [r0] - strh r0, [r1] - ldr r1, =gTrainerBattleOpponent_B - adds r3, 0xE - adds r0, r7, r3 - ldrh r0, [r0] - strh r0, [r1] - ldr r1, =gPartnerTrainerId - adds r2, 0x4 - adds r0, r7, r2 - ldrh r0, [r0] - strh r0, [r1] - ldr r1, =gUnknown_0203C7B4 - adds r3, 0x4 - adds r0, r7, r3 - ldrh r0, [r0] - strb r0, [r1] - ldr r1, =gUnknown_0203C7AD - ldr r3, =gSaveBlock2Ptr - ldr r0, [r3] - ldr r2, =0x00000ca9 - adds r0, r2 - ldrb r0, [r0] - lsls r0, 30 - lsrs r0, 30 - strb r0, [r1] - ldr r1, =gUnknown_0203C7AE - ldr r2, =0x000004fd - adds r0, r7, r2 - ldrb r0, [r0] - strb r0, [r1] - ldr r1, =gUnknown_0203C7AF - adds r2, 0x1 - adds r0, r7, r2 - ldrb r0, [r0] - strb r0, [r1] - ldr r2, =gUnknown_0203C7B6 - ldr r1, =0x000004ff - adds r0, r7, r1 - ldrb r1, [r0] - lsls r0, r1, 31 - lsrs r0, 31 - strb r0, [r2] - ldr r0, =gUnknown_0203C7B7 - lsls r1, 28 - lsrs r1, 29 - strb r1, [r0] - ldr r1, =gUnknown_0203C7BC - movs r2, 0xA0 - lsls r2, 3 - adds r0, r7, r2 - ldr r0, [r0] - str r0, [r1] - movs r6, 0 - mov r10, r3 - ldr r2, =gUnknown_0203CCD9 - ldr r3, =gUnknown_0203CCDA - ldr r0, =gUnknown_03001278 - mov r8, r0 - ldr r1, =gUnknown_03001279 - mov r9, r1 - ldr r5, =gUnknown_0203CCD1 - ldr r0, =0x00000504 - adds r4, r7, r0 -_08185CE2: - adds r0, r6, r5 - adds r1, r4, r6 - ldrb r1, [r1] - strb r1, [r0] - adds r6, 0x1 - cmp r6, 0x7 - ble _08185CE2 - ldr r1, =0x0000050c - adds r0, r7, r1 - ldrb r0, [r0] - strb r0, [r2] - ldr r2, =0x0000050d - adds r0, r7, r2 - ldrb r0, [r0] - strb r0, [r3] - ldr r3, =0x0000051a - adds r0, r7, r3 - ldrb r0, [r0] - mov r1, r8 - strb r0, [r1] - adds r2, 0xE - adds r0, r7, r2 - ldrb r0, [r0] - mov r3, r9 - strb r0, [r3] - ldr r0, =0x0000050e - adds r1, r7, r0 - ldr r4, =gUnknown_0203CCDC - movs r6, 0x5 -_08185D1C: - ldrh r0, [r1] - strh r0, [r4] - adds r1, 0x2 - adds r4, 0x2 - subs r6, 0x1 - cmp r6, 0 - bge _08185D1C - mov r1, r10 - ldr r2, [r1] - ldr r3, =0x000004fc - adds r0, r7, r3 - ldrb r0, [r0] - ldr r1, =0x00000ca9 - adds r2, r1 - movs r1, 0x3 - ands r1, r0 - ldrb r3, [r2] - movs r0, 0x4 - negs r0, r0 - ands r0, r3 - orrs r0, r1 - strb r0, [r2] - movs r6, 0 - ldr r2, =0x00000297 - mov r10, r2 - ldr r3, =gUnknown_0203BD34 - mov r9, r3 - movs r0, 0xA6 - lsls r0, 2 - mov r8, r0 - ldr r1, =0x0000051c - adds r5, r7, r1 -_08185D5C: - adds r2, r6, 0x1 - mov r0, r8 - muls r0, r6 - adds r1, r0, r5 - mov r3, r9 - adds r4, r0, r3 - mov r3, r10 - adds r3, 0x1 -_08185D6C: - ldrb r0, [r1] - strb r0, [r4] - adds r1, 0x1 - adds r4, 0x1 - subs r3, 0x1 - cmp r3, 0 - bne _08185D6C - adds r6, r2, 0 - cmp r6, 0x3 - ble _08185D5C - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8185B60 - - thumb_func_start sub_8185E24 -sub_8185E24: @ 8185E24 - push {r4,r5,lr} - adds r5, r0, 0 - movs r0, 0xF8 - lsls r0, 4 - bl AllocZeroed - adds r4, r0, 0 - bl start_ov_to_battle_anim - cmp r0, 0x1 - bne _08185E6E - bl sub_8185EB8 - adds r0, r4, 0 - bl sub_8185B60 - ldr r0, =sub_8185B1C - movs r1, 0x1 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r0, 0x80 - strh r0, [r1, 0x8] - ldr r0, =gUnknown_0203C7B0 - str r5, [r0] - movs r0, 0 - bl PlayMapChosenOrBattleBGM - ldr r0, =sub_8185E8C - bl SetMainCallback2 -_08185E6E: - adds r0, r4, 0 - bl Free - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8185E24 - - thumb_func_start sub_8185E8C -sub_8185E8C: @ 8185E8C - push {lr} - bl AnimateSprites - bl BuildOamBuffer - bl RunTasks - pop {r0} - bx r0 - thumb_func_end sub_8185E8C - - thumb_func_start sub_8185EA0 -sub_8185EA0: @ 8185EA0 - ldr r0, =gUnknown_0203C7AE - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_8185EA0 - - thumb_func_start sub_8185EAC -sub_8185EAC: @ 8185EAC - ldr r0, =gUnknown_0203C7AF - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_8185EAC - - thumb_func_start sub_8185EB8 -sub_8185EB8: @ 8185EB8 - push {r4-r6,lr} - movs r5, 0 - ldr r6, =gUnknown_0203C7C0 -_08185EBE: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - adds r0, r4, r6 - ldr r1, =gPlayerParty - adds r1, r4, r1 - movs r2, 0x64 - bl memcpy - ldr r0, =gUnknown_0203CA18 - adds r0, r4, r0 - ldr r1, =gEnemyParty - adds r4, r1 - adds r1, r4, 0 - movs r2, 0x64 - bl memcpy - adds r5, 0x1 - cmp r5, 0x5 - ble _08185EBE - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8185EB8 - - thumb_func_start sub_8185EFC -sub_8185EFC: @ 8185EFC - push {r4-r6,lr} - movs r5, 0 - ldr r6, =gPlayerParty -_08185F02: - movs r0, 0x64 - adds r4, r5, 0 - muls r4, r0 - adds r0, r4, r6 - ldr r1, =gUnknown_0203C7C0 - adds r1, r4, r1 - movs r2, 0x64 - bl memcpy - ldr r0, =gEnemyParty - adds r0, r4, r0 - ldr r1, =gUnknown_0203CA18 - adds r4, r1 - adds r1, r4, 0 - movs r2, 0x64 - bl memcpy - adds r5, 0x1 - cmp r5, 0x5 - ble _08185F02 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8185EFC - - thumb_func_start sub_8185F40 -sub_8185F40: @ 8185F40 - push {r4,r5,lr} - movs r2, 0 - ldr r0, =gLinkPlayers - ldr r3, =gActiveBank - ldrh r1, [r0, 0x18] - adds r4, r0, 0 - ldrb r0, [r3] - cmp r1, r0 - beq _08185F64 - adds r1, r4, 0 -_08185F54: - adds r1, 0x1C - adds r2, 0x1 - cmp r2, 0x3 - bgt _08185F64 - ldrh r0, [r1, 0x18] - ldrb r5, [r3] - cmp r0, r5 - bne _08185F54 -_08185F64: - cmp r2, 0x4 - bne _08185F74 - movs r0, 0 - b _08185F7E - .pool -_08185F74: - lsls r0, r2, 3 - subs r0, r2 - lsls r0, 2 - adds r0, r4 - ldrb r0, [r0, 0x13] -_08185F7E: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_8185F40 - - thumb_func_start sub_8185F84 -sub_8185F84: @ 8185F84 - ldr r1, =gUnknown_0203C7B5 - movs r0, 0 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_8185F84 - - thumb_func_start sub_8185F90 -sub_8185F90: @ 8185F90 - lsls r0, 16 - lsrs r0, 16 - ldr r2, =gUnknown_0203C7B5 - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - lsls r0, 16 - lsrs r0, 31 - ldrb r1, [r2] - orrs r0, r1 - strb r0, [r2] - bx lr - .pool - thumb_func_end sub_8185F90 - - thumb_func_start sub_8185FAC -sub_8185FAC: @ 8185FAC - ldr r0, =gUnknown_0203C7B5 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_8185FAC - - thumb_func_start sub_8185FB8 -sub_8185FB8: @ 8185FB8 - ldr r0, =gUnknown_0203C7B6 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_8185FB8 - - thumb_func_start sub_8185FC4 -sub_8185FC4: @ 8185FC4 - ldr r0, =gUnknown_0203C7B7 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_8185FC4 - - thumb_func_start sub_8185FD0 -sub_8185FD0: @ 8185FD0 - push {r4-r7,lr} - ldr r4, =gActiveBank - ldrb r0, [r4] - bl GetBankSide - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _0818601C - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - ldr r1, =0x02000002 - ands r0, r1 - cmp r0, 0 - bne _0818601C - ldr r0, =gUnknown_0203C7AC - ldrb r0, [r0] - cmp r0, 0x2 - beq _0818601C - movs r3, 0 - ldr r7, =gUnknown_0203CC70 - adds r6, r4, 0 - ldr r5, =gBattleMons + 0xC - movs r4, 0x58 -_08186000: - lsls r2, r3, 1 - ldrb r1, [r6] - lsrs r0, r1, 1 - lsls r0, 3 - adds r0, r2, r0 - adds r0, r7 - muls r1, r4 - adds r2, r1 - adds r2, r5 - ldrh r1, [r2] - strh r1, [r0] - adds r3, 0x1 - cmp r3, 0x3 - ble _08186000 -_0818601C: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8185FD0 - - thumb_func_start sub_818603C -sub_818603C: @ 818603C - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x50 - lsls r0, 24 - lsrs r0, 24 - str r0, [sp, 0x24] - ldr r0, =gBattleTypeFlags - ldr r0, [r0] - ldr r1, =0x02000002 - ands r0, r1 - cmp r0, 0 - beq _0818605C - b _081863FC -_0818605C: - movs r0, 0 - mov r10, r0 - b _081863F2 - .pool -_0818606C: - mov r1, r10 - lsls r4, r1, 24 - lsrs r5, r4, 24 - adds r0, r5, 0 - bl GetBankSide - lsls r0, 24 - lsrs r0, 24 - str r4, [sp, 0x4C] - mov r2, r10 - adds r2, 0x1 - str r2, [sp, 0x38] - cmp r0, 0x1 - bne _0818608A - b _081863EE -_0818608A: - ldr r3, [sp, 0x24] - cmp r3, 0x1 - bne _0818611E - movs r5, 0 - ldr r4, =gUnknown_0203CC70 - mov r0, r10 - asrs r6, r0, 31 - subs r0, r6 - asrs r0, 1 - lsls r0, 3 - adds r2, r0, r4 - movs r1, 0x58 - mov r0, r10 - muls r0, r1 - ldr r3, =gBattleMons + 0xC - adds r1, r0, r3 -_081860AA: - ldrh r0, [r1] - ldrh r4, [r2] - cmp r0, r4 - bne _081860BC - adds r2, 0x2 - adds r1, 0x2 - adds r5, 0x1 - cmp r5, 0x3 - ble _081860AA -_081860BC: - cmp r5, 0x4 - bne _081860C2 - b _081863EE -_081860C2: - ldr r1, [sp, 0x4C] - lsrs r0, r1, 24 - movs r1, 0x6 - bl RecordedBattle_SetBankAction - movs r5, 0 - ldr r2, =gUnknown_0203CC70 - mov r8, r2 - movs r3, 0x58 - mov r7, r10 - muls r7, r3 - mov r4, r10 - subs r0, r4, r6 - asrs r4, r0, 1 -_081860DE: - movs r2, 0 - lsls r0, r5, 1 - adds r5, 0x1 - adds r0, r7 - ldr r1, =gBattleMons + 0xC - adds r3, r0, r1 - lsls r0, r4, 3 - mov r6, r8 - adds r1, r0, r6 -_081860F0: - ldrh r0, [r3] - ldrh r6, [r1] - cmp r0, r6 - bne _08186110 - lsls r1, r2, 24 - lsrs r1, 24 - ldr r2, [sp, 0x4C] - lsrs r0, r2, 24 - bl RecordedBattle_SetBankAction - b _08186118 - .pool -_08186110: - adds r1, 0x2 - adds r2, 0x1 - cmp r2, 0x3 - ble _081860F0 -_08186118: - cmp r5, 0x3 - ble _081860DE - b _081863EE -_0818611E: - ldr r3, =gUnknown_0203BD34 - ldr r1, =gUnknown_0203C794 - mov r4, r10 - lsls r2, r4, 1 - adds r1, r2, r1 - movs r0, 0xA6 - lsls r0, 2 - mov r6, r10 - muls r6, r0 - adds r0, r6, 0 - ldrh r1, [r1] - adds r0, r1 - adds r0, r3 - ldrb r0, [r0] - str r2, [sp, 0x44] - cmp r0, 0x6 - beq _08186142 - b _081863EE -_08186142: - adds r0, r5, 0 - bl RecordedBattle_ReadBankAction - movs r5, 0 - mov r0, sp - adds r0, 0x4 - str r0, [sp, 0x28] - mov r1, sp - adds r1, 0xC - str r1, [sp, 0x30] - mov r2, sp - adds r2, 0x14 - str r2, [sp, 0x34] - mov r3, sp - adds r3, 0x18 - str r3, [sp, 0x3C] - mov r4, sp - adds r4, 0x8 - str r4, [sp, 0x2C] - mov r6, r10 - lsls r6, 3 - str r6, [sp, 0x48] - movs r1, 0x58 - mov r0, r10 - muls r0, r1 - ldr r2, =gBattleMons - adds r0, r2 - adds r6, r0, 0 - adds r6, 0x3B - movs r4, 0x3 -_0818617E: - mov r0, sp - adds r3, r0, r5 - ldrb r1, [r6] - lsls r2, r5, 1 - adds r0, r4, 0 - lsls r0, r2 - ands r1, r0 - asrs r1, r2 - strb r1, [r3] - adds r5, 0x1 - cmp r5, 0x3 - ble _0818617E - movs r5, 0 - ldr r1, =gBattleMons - mov r9, r1 - movs r2, 0x58 - mov r7, r10 - muls r7, r2 - ldr r4, [sp, 0x28] - ldr r6, [sp, 0x30] -_081861A6: - ldr r3, [sp, 0x4C] - lsrs r0, r3, 24 - bl RecordedBattle_ReadBankAction - strb r0, [r4] - ldrb r0, [r4] - lsls r0, 1 - adds r0, r7 - movs r1, 0xC - add r1, r9 - mov r8, r1 - add r0, r8 - ldrh r0, [r0] - strh r0, [r6] - ldr r2, [sp, 0x34] - adds r1, r2, r5 - ldrb r0, [r4] - adds r0, r7 - ldr r3, =gBattleMons + 0x24 - adds r0, r3 - ldrb r0, [r0] - strb r0, [r1] - ldr r0, [sp, 0x3C] - adds r1, r0, r5 - ldrb r0, [r4] - add r0, sp - ldrb r0, [r0] - strb r0, [r1] - ldr r1, [sp, 0x2C] - adds r3, r1, r5 - ldr r2, [sp, 0x48] - mov r1, r10 - subs r0, r2, r1 - lsls r0, 2 - ldr r2, =gDisableStructs - adds r0, r2 - ldrb r1, [r0, 0x18] - lsrs r1, 4 - ldr r2, =gBitTable - lsls r0, r5, 2 - adds r0, r2 - ldr r0, [r0] - ands r1, r0 - lsrs r1, r5 - strb r1, [r3] - adds r4, 0x1 - adds r6, 0x2 - adds r5, 0x1 - cmp r5, 0x3 - ble _081861A6 - movs r5, 0 - movs r3, 0xC - negs r3, r3 - add r3, r8 - mov r12, r3 - ldr r4, =gDisableStructs - mov r9, r4 - movs r6, 0x58 - mov r1, r10 - muls r1, r6 - mov r0, r8 - adds r0, 0x18 - adds r4, r1, r0 - adds r3, r1, 0 - mov r7, r8 - ldr r6, [sp, 0x34] - ldr r2, [sp, 0x30] -_0818622C: - adds r1, r3, r7 - ldrh r0, [r2] - strh r0, [r1] - adds r0, r6, r5 - ldrb r0, [r0] - strb r0, [r4] - adds r4, 0x1 - adds r3, 0x2 - adds r2, 0x2 - adds r5, 0x1 - cmp r5, 0x3 - ble _0818622C - movs r0, 0x58 - mov r4, r10 - muls r4, r0 - mov r1, r12 - adds r0, r4, r1 - adds r0, 0x3B - movs r1, 0 - strb r1, [r0] - ldr r2, [sp, 0x48] - mov r6, r10 - subs r3, r2, r6 - lsls r3, 2 - mov r0, r9 - adds r2, r3, r0 - ldrb r1, [r2, 0x18] - movs r0, 0xF - ands r0, r1 - strb r0, [r2, 0x18] - movs r5, 0 - ldr r1, =gBattleMons - adds r4, r1 - adds r4, 0x3B - ldr r0, =gDisableStructs - adds r6, r3, r0 -_08186274: - ldr r2, [sp, 0x3C] - adds r0, r2, r5 - ldrb r0, [r0] - lsls r1, r5, 1 - lsls r0, r1 - ldrb r1, [r4] - orrs r0, r1 - strb r0, [r4] - ldrb r2, [r6, 0x18] - lsrs r3, r2, 4 - ldr r1, [sp, 0x2C] - adds r0, r1, r5 - ldrb r1, [r0] - lsls r1, r5 - orrs r1, r3 - lsls r1, 4 - movs r0, 0xF - ands r0, r2 - orrs r0, r1 - strb r0, [r6, 0x18] - adds r5, 0x1 - cmp r5, 0x3 - ble _08186274 - movs r2, 0x58 - mov r0, r10 - muls r0, r2 - mov r1, r12 - adds r1, 0x50 - adds r0, r1 - ldr r0, [r0] - movs r1, 0x80 - lsls r1, 14 - ands r0, r1 - cmp r0, 0 - beq _081862BC - b _081863CA -_081862BC: - movs r5, 0 - mov r3, sp - adds r3, 0x20 - str r3, [sp, 0x40] - ldr r0, =gBattlePartyID - ldr r4, [sp, 0x44] - adds r6, r4, r0 -_081862CA: - ldrh r1, [r6] - movs r0, 0x64 - muls r0, r1 - ldr r4, =gPlayerParty - adds r0, r4 - movs r1, 0x15 - movs r2, 0 - bl GetMonData - mov r1, sp - adds r3, r1, r5 - lsls r2, r5, 1 - movs r1, 0x3 - lsls r1, r2 - ands r0, r1 - lsrs r0, r2 - strb r0, [r3] - adds r5, 0x1 - cmp r5, 0x3 - ble _081862CA - movs r5, 0 - ldr r0, =gBattlePartyID - ldr r2, [sp, 0x44] - adds r7, r2, r0 - movs r3, 0x64 - mov r9, r3 - mov r8, r4 - ldr r4, [sp, 0x28] - ldr r6, [sp, 0x30] -_08186304: - ldrh r0, [r7] - mov r1, r9 - muls r1, r0 - adds r0, r1, 0 - add r0, r8 - ldrb r1, [r4] - adds r1, 0xD - movs r2, 0 - bl GetMonData - strh r0, [r6] - ldrh r0, [r7] - mov r2, r9 - muls r2, r0 - adds r0, r2, 0 - add r0, r8 - ldrb r1, [r4] - adds r1, 0x11 - movs r2, 0 - bl GetMonData - ldr r3, [sp, 0x34] - adds r1, r3, r5 - strb r0, [r1] - ldr r0, [sp, 0x3C] - adds r1, r0, r5 - ldrb r0, [r4] - add r0, sp - ldrb r0, [r0] - strb r0, [r1] - adds r4, 0x1 - adds r6, 0x2 - adds r5, 0x1 - cmp r5, 0x3 - ble _08186304 - movs r5, 0 - ldr r0, =gBattlePartyID - ldr r1, [sp, 0x44] - adds r7, r1, r0 - movs r2, 0x64 - mov r9, r2 - ldr r3, =gPlayerParty - mov r8, r3 - ldr r6, [sp, 0x30] - adds r6, 0x8 - ldr r4, [sp, 0x30] -_08186360: - ldrh r0, [r7] - mov r1, r9 - muls r1, r0 - adds r0, r1, 0 - add r0, r8 - adds r1, r5, 0 - adds r1, 0xD - adds r2, r4, 0 - bl SetMonData - ldrh r0, [r7] - mov r2, r9 - muls r2, r0 - adds r0, r2, 0 - add r0, r8 - adds r1, r5, 0 - adds r1, 0x11 - adds r2, r6, 0 - bl SetMonData - adds r6, 0x1 - adds r4, 0x2 - adds r5, 0x1 - cmp r5, 0x3 - ble _08186360 - movs r0, 0 - ldr r3, [sp, 0x40] - strb r0, [r3] - movs r5, 0 - ldr r4, =gBattlePartyID - ldr r6, =gPlayerParty - ldr r3, [sp, 0x3C] - ldr r2, [sp, 0x40] -_081863A2: - adds r0, r3, r5 - ldrb r1, [r0] - lsls r0, r5, 1 - lsls r1, r0 - ldrb r0, [r2] - orrs r0, r1 - strb r0, [r2] - adds r5, 0x1 - cmp r5, 0x3 - ble _081863A2 - ldr r1, [sp, 0x44] - adds r0, r1, r4 - ldrh r1, [r0] - movs r0, 0x64 - muls r0, r1 - adds r0, r6 - movs r1, 0x15 - ldr r2, [sp, 0x40] - bl SetMonData -_081863CA: - ldr r2, =gChosenMovesByBanks - ldr r3, [sp, 0x44] - adds r2, r3, r2 - ldr r0, =gBattleStruct - ldr r0, [r0] - add r0, r10 - adds r0, 0x80 - ldrb r0, [r0] - lsls r0, 1 - movs r4, 0x58 - mov r1, r10 - muls r1, r4 - adds r0, r1 - ldr r1, =gBattleMons - adds r1, 0xC - adds r0, r1 - ldrh r0, [r0] - strh r0, [r2] -_081863EE: - ldr r6, [sp, 0x38] - mov r10, r6 -_081863F2: - ldr r0, =gNoOfAllBanks - ldrb r0, [r0] - cmp r10, r0 - bge _081863FC - b _0818606C -_081863FC: - add sp, 0x50 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_818603C - - thumb_func_start GetAiScriptsInRecordedBattle -GetAiScriptsInRecordedBattle: @ 8186438 - ldr r0, =gUnknown_0203C7BC - ldr r0, [r0] - bx lr - .pool - thumb_func_end GetAiScriptsInRecordedBattle - - thumb_func_start sub_8186444 -sub_8186444: @ 8186444 - ldr r1, =gUnknown_0203CCD0 - movs r0, 0x1 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_8186444 - - thumb_func_start sub_8186450 -sub_8186450: @ 8186450 - push {lr} - movs r1, 0 - ldr r0, =gUnknown_0203CCD0 - ldrb r0, [r0] - cmp r0, 0 - bne _0818645E - movs r1, 0x1 -_0818645E: - adds r0, r1, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_8186450 - - thumb_func_start sub_8186468 -sub_8186468: @ 8186468 - push {r4,r5,lr} - adds r3, r0, 0 - movs r2, 0 - ldr r5, =gUnknown_03001278 - ldr r4, =gUnknown_0203CCD1 -_08186472: - adds r0, r3, r2 - adds r1, r2, r4 - ldrb r1, [r1] - strb r1, [r0] - adds r2, 0x1 - cmp r2, 0x7 - ble _08186472 - movs r0, 0xFF - strb r0, [r3, 0x7] - ldrb r1, [r5] - adds r0, r3, 0 - bl ConvertInternationalString - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_8186468 - - thumb_func_start sub_818649C -sub_818649C: @ 818649C - ldr r0, =gUnknown_0203CCD9 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_818649C - - thumb_func_start sub_81864A8 -sub_81864A8: @ 81864A8 - ldr r0, =gUnknown_0203CCDA - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_81864A8 - - thumb_func_start sub_81864B4 -sub_81864B4: @ 81864B4 - ldr r0, =gUnknown_03001278 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_81864B4 - - thumb_func_start sub_81864C0 -sub_81864C0: @ 81864C0 - ldr r0, =gUnknown_03001279 - ldrb r0, [r0] - bx lr - .pool - thumb_func_end sub_81864C0 - - thumb_func_start sub_81864CC -sub_81864CC: @ 81864CC - ldr r0, =gUnknown_0203CCE8 - ldr r1, =gBattleOutcome - ldrb r1, [r1] - strb r1, [r0] - bx lr - .pool - thumb_func_end sub_81864CC - - thumb_func_start sub_81864E0 -sub_81864E0: @ 81864E0 - ldr r0, =gUnknown_0203CCDC - bx lr - .pool - thumb_func_end sub_81864E0 - - .align 2, 0 @ Don't pad with nop. diff --git a/asm/rom6.s b/asm/rom6.s index 221c3cc1d..ba022f5a7 100644 --- a/asm/rom6.s +++ b/asm/rom6.s @@ -263,7 +263,7 @@ sub_8135654: @ 8135654 cmp r0, 0 beq _0813568C ldr r4, =gSpecialVar_Result - bl brm_get_pokemon_selection + bl GetCursorSelectionMonId lsls r0, 24 lsrs r0, 24 strh r0, [r4] @@ -302,7 +302,7 @@ _081356AC: thumb_func_start sub_81356C4 sub_81356C4: @ 81356C4 push {lr} - bl brm_get_pokemon_selection + bl GetCursorSelectionMonId ldr r1, =gFieldEffectArguments lsls r0, 24 lsrs r0, 24 @@ -379,7 +379,7 @@ hm2_dig: @ 8135760 bl flagmods_08054D70 movs r0, 0x26 bl FieldEffectStart - bl brm_get_pokemon_selection + bl GetCursorSelectionMonId ldr r1, =gFieldEffectArguments lsls r0, 24 lsrs r0, 24 @@ -3334,7 +3334,7 @@ sub_81370FC: @ 81370FC cmp r0, 0 beq _08137134 ldr r4, =gSpecialVar_Result - bl brm_get_pokemon_selection + bl GetCursorSelectionMonId lsls r0, 24 lsrs r0, 24 strh r0, [r4] @@ -3380,7 +3380,7 @@ hm2_flash: @ 8137178 adds r4, r0, 0 lsls r4, 24 lsrs r4, 24 - bl brm_get_pokemon_selection + bl GetCursorSelectionMonId ldr r1, =gFieldEffectArguments lsls r0, 24 lsrs r0, 24 diff --git a/asm/rom_8011DC0.s b/asm/rom_8011DC0.s index 7b1b0db02..6346285e9 100644 --- a/asm/rom_8011DC0.s +++ b/asm/rom_8011DC0.s @@ -3754,7 +3754,7 @@ _08014714: movs r1, 0x5 movs r2, 0x1 bl sub_8014290 - bl brm_get_pokemon_selection + bl GetCursorSelectionMonId lsls r0, 24 lsrs r0, 24 ldr r1, =c2_load_new_map @@ -3775,7 +3775,7 @@ _0801474C: movs r1, 0x5 movs r2, 0x1 bl sub_8014290 - bl brm_get_pokemon_selection + bl GetCursorSelectionMonId lsls r0, 24 lsrs r0, 24 ldr r1, =c2_load_new_map @@ -5645,7 +5645,7 @@ _080158E0: ldrh r0, [r4] cmp r0, 0 beq _080159A0 - bl brm_get_pokemon_selection + bl GetCursorSelectionMonId lsls r0, 24 lsrs r5, r0, 24 ldrh r0, [r4] @@ -5673,7 +5673,7 @@ _08015900: b _0801598E .pool _0801592C: - bl brm_get_pokemon_selection + bl GetCursorSelectionMonId lsls r0, 24 lsrs r0, 24 adds r1, r4, 0 @@ -5707,7 +5707,7 @@ _0801596C: ldr r1, =gUnknown_02022C2C movs r0, 0x44 strb r0, [r1] - bl brm_get_pokemon_selection + bl GetCursorSelectionMonId lsls r0, 24 lsrs r0, 24 adds r1, r4, 0 diff --git a/asm/script_pokemon_util_80F87D8.s b/asm/script_pokemon_util_80F87D8.s index 0e002d19a..3a3cf4269 100644 --- a/asm/script_pokemon_util_80F87D8.s +++ b/asm/script_pokemon_util_80F87D8.s @@ -1343,7 +1343,7 @@ ScriptGiveEgg: @ 80F92C8 lsrs r1, 16 mov r0, sp movs r2, 0x1 - bl sub_8070954 + bl CreateEgg add r2, sp, 0x64 movs r0, 0x1 strb r0, [r2] diff --git a/asm/trade.s b/asm/trade.s index ad72bf1a8..399cc506e 100644 --- a/asm/trade.s +++ b/asm/trade.s @@ -5112,7 +5112,7 @@ _08079DDE: _08079DF0: add r0, sp, 0xC movs r1, 0 - bl sub_8070ECC + bl NameHasGenderSymbol lsls r0, 24 movs r2, 0x83 cmp r0, 0 @@ -5122,7 +5122,7 @@ _08079DF0: _08079E04: add r0, sp, 0xC movs r1, 0xFE - bl sub_8070ECC + bl NameHasGenderSymbol lsls r0, 24 movs r2, 0x83 cmp r0, 0 @@ -7948,7 +7948,7 @@ sub_807B4D0: @ 807B4D0 adds r1, r2 ldr r0, [r0] adds r0, r1 - bl sub_80D439C + bl ClearMailStruct _0807B52A: ldr r4, =gUnknown_020322A0 ldr r0, [r4] @@ -7985,7 +7985,7 @@ _0807B566: ldr r0, =gUnknown_020321C0 adds r1, r0 adds r0, r7, 0 - bl sub_80D460C + bl GiveMailToMon2 _0807B57C: mov r0, r9 bl sub_807B464 diff --git a/asm/trainer_card.s b/asm/trainer_card.s index ddb0271a6..dc0a32b77 100644 --- a/asm/trainer_card.s +++ b/asm/trainer_card.s @@ -5000,7 +5000,7 @@ _080C5240: adds r0, r2 ldrh r0, [r0] strh r0, [r1, 0x6] - bl sub_8185290 + bl CanCopyRecordedBattleSaveData ldr r3, [r5] movs r1, 0x1 ands r0, r1 @@ -5825,7 +5825,7 @@ _080C5970: strh r0, [r1, 0x6] bl sub_80C52E4 ldr r0, =sub_80C58D4 - bl sub_8185E24 + bl PlayRecordedBattle b _080C599A .pool _080C5994: diff --git a/constants/flags.inc b/constants/flags.inc index 0b375f9d6..2e4b60d73 100644 --- a/constants/flags.inc +++ b/constants/flags.inc @@ -131,7 +131,7 @@ .equiv FLAG_0x083, 0x83 .equiv FLAG_0x084, 0x84 .equiv FLAG_0x085, 0x85 - .equiv FLAG_0x086, 0x86 + .equiv FLAG_PENDING_DAYCARE_EGG, 0x86 .equiv FLAG_0x087, 0x87 .equiv FLAG_0x088, 0x88 .equiv FLAG_0x089, 0x89 diff --git a/data/daycare.s b/data/daycare.s deleted file mode 100644 index c249a668c..000000000 --- a/data/daycare.s +++ /dev/null @@ -1,24 +0,0 @@ -@ the third big chunk of data - - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - - - -@ 832ADD8 - .include "data/egg_moves.inc" - - .align 2 -gUnknown_0832B6C0:: @ 832B6C0 - .incbin "baserom.gba", 0x32b6c0, 0x20 - -gUnknown_0832B6E0:: @ 832B6E0 - .incbin "baserom.gba", 0x32b6e0, 0x18 - -gUnknown_0832B6F8:: @ 832B6F8 - .incbin "baserom.gba", 0x32b6f8, 0x10 - -gEggName:: @ 832B708 - .string "タマゴ$" @ "tamago" ("egg" in Japanese) diff --git a/data/egg_moves.inc b/data/egg_moves.inc deleted file mode 100644 index 607f2aada..000000000 --- a/data/egg_moves.inc +++ /dev/null @@ -1,1306 +0,0 @@ - .align 2 -gEggMoves:: @ 832ADD8 - egg_moves_begin SPECIES_BULBASAUR - .2byte MOVE_LIGHT_SCREEN - .2byte MOVE_SKULL_BASH - .2byte MOVE_SAFEGUARD - .2byte MOVE_CHARM - .2byte MOVE_PETAL_DANCE - .2byte MOVE_MAGICAL_LEAF - .2byte MOVE_GRASS_WHISTLE - .2byte MOVE_CURSE - - egg_moves_begin SPECIES_CHARMANDER - .2byte MOVE_BELLY_DRUM - .2byte MOVE_ANCIENT_POWER - .2byte MOVE_ROCK_SLIDE - .2byte MOVE_BITE - .2byte MOVE_OUTRAGE - .2byte MOVE_BEAT_UP - .2byte MOVE_SWORDS_DANCE - .2byte MOVE_DRAGON_DANCE - - egg_moves_begin SPECIES_SQUIRTLE - .2byte MOVE_MIRROR_COAT - .2byte MOVE_HAZE - .2byte MOVE_MIST - .2byte MOVE_FORESIGHT - .2byte MOVE_FLAIL - .2byte MOVE_REFRESH - .2byte MOVE_MUD_SPORT - .2byte MOVE_YAWN - - egg_moves_begin SPECIES_PIDGEY - .2byte MOVE_PURSUIT - .2byte MOVE_FAINT_ATTACK - .2byte MOVE_FORESIGHT - .2byte MOVE_STEEL_WING - .2byte MOVE_AIR_CUTTER - - egg_moves_begin SPECIES_RATTATA - .2byte MOVE_SCREECH - .2byte MOVE_FLAME_WHEEL - .2byte MOVE_FURY_SWIPES - .2byte MOVE_BITE - .2byte MOVE_COUNTER - .2byte MOVE_REVERSAL - .2byte MOVE_UPROAR - .2byte MOVE_SWAGGER - - egg_moves_begin SPECIES_SPEAROW - .2byte MOVE_FAINT_ATTACK - .2byte MOVE_FALSE_SWIPE - .2byte MOVE_SCARY_FACE - .2byte MOVE_QUICK_ATTACK - .2byte MOVE_TRI_ATTACK - .2byte MOVE_ASTONISH - .2byte MOVE_SKY_ATTACK - - egg_moves_begin SPECIES_EKANS - .2byte MOVE_PURSUIT - .2byte MOVE_SLAM - .2byte MOVE_SPITE - .2byte MOVE_BEAT_UP - .2byte MOVE_POISON_FANG - - egg_moves_begin SPECIES_SANDSHREW - .2byte MOVE_FLAIL - .2byte MOVE_SAFEGUARD - .2byte MOVE_COUNTER - .2byte MOVE_RAPID_SPIN - .2byte MOVE_ROCK_SLIDE - .2byte MOVE_METAL_CLAW - .2byte MOVE_SWORDS_DANCE - .2byte MOVE_CRUSH_CLAW - - egg_moves_begin SPECIES_NIDORAN_F - .2byte MOVE_SUPERSONIC - .2byte MOVE_DISABLE - .2byte MOVE_TAKE_DOWN - .2byte MOVE_FOCUS_ENERGY - .2byte MOVE_CHARM - .2byte MOVE_COUNTER - .2byte MOVE_BEAT_UP - - egg_moves_begin SPECIES_NIDORAN_M - .2byte MOVE_COUNTER - .2byte MOVE_DISABLE - .2byte MOVE_SUPERSONIC - .2byte MOVE_TAKE_DOWN - .2byte MOVE_AMNESIA - .2byte MOVE_CONFUSION - .2byte MOVE_BEAT_UP - - egg_moves_begin SPECIES_VULPIX - .2byte MOVE_FAINT_ATTACK - .2byte MOVE_HYPNOSIS - .2byte MOVE_FLAIL - .2byte MOVE_SPITE - .2byte MOVE_DISABLE - .2byte MOVE_HOWL - .2byte MOVE_PSYCH_UP - .2byte MOVE_HEAT_WAVE - - egg_moves_begin SPECIES_ZUBAT - .2byte MOVE_QUICK_ATTACK - .2byte MOVE_PURSUIT - .2byte MOVE_FAINT_ATTACK - .2byte MOVE_GUST - .2byte MOVE_WHIRLWIND - .2byte MOVE_CURSE - - egg_moves_begin SPECIES_ODDISH - .2byte MOVE_SWORDS_DANCE - .2byte MOVE_RAZOR_LEAF - .2byte MOVE_FLAIL - .2byte MOVE_SYNTHESIS - .2byte MOVE_CHARM - .2byte MOVE_INGRAIN - - egg_moves_begin SPECIES_PARAS - .2byte MOVE_FALSE_SWIPE - .2byte MOVE_SCREECH - .2byte MOVE_COUNTER - .2byte MOVE_PSYBEAM - .2byte MOVE_FLAIL - .2byte MOVE_SWEET_SCENT - .2byte MOVE_LIGHT_SCREEN - .2byte MOVE_PURSUIT - - egg_moves_begin SPECIES_VENONAT - .2byte MOVE_BATON_PASS - .2byte MOVE_SCREECH - .2byte MOVE_GIGA_DRAIN - .2byte MOVE_SIGNAL_BEAM - - egg_moves_begin SPECIES_DIGLETT - .2byte MOVE_FAINT_ATTACK - .2byte MOVE_SCREECH - .2byte MOVE_ANCIENT_POWER - .2byte MOVE_PURSUIT - .2byte MOVE_BEAT_UP - .2byte MOVE_UPROAR - .2byte MOVE_ROCK_SLIDE - - egg_moves_begin SPECIES_MEOWTH - .2byte MOVE_SPITE - .2byte MOVE_CHARM - .2byte MOVE_HYPNOSIS - .2byte MOVE_AMNESIA - .2byte MOVE_PSYCH_UP - .2byte MOVE_ASSIST - - egg_moves_begin SPECIES_PSYDUCK - .2byte MOVE_HYPNOSIS - .2byte MOVE_PSYBEAM - .2byte MOVE_FORESIGHT - .2byte MOVE_LIGHT_SCREEN - .2byte MOVE_FUTURE_SIGHT - .2byte MOVE_PSYCHIC - .2byte MOVE_CROSS_CHOP - .2byte MOVE_REFRESH - - egg_moves_begin SPECIES_MANKEY - .2byte MOVE_ROCK_SLIDE - .2byte MOVE_FORESIGHT - .2byte MOVE_MEDITATE - .2byte MOVE_COUNTER - .2byte MOVE_REVERSAL - .2byte MOVE_BEAT_UP - .2byte MOVE_REVENGE - .2byte MOVE_SMELLING_SALT - - egg_moves_begin SPECIES_GROWLITHE - .2byte MOVE_BODY_SLAM - .2byte MOVE_SAFEGUARD - .2byte MOVE_CRUNCH - .2byte MOVE_THRASH - .2byte MOVE_FIRE_SPIN - .2byte MOVE_HOWL - .2byte MOVE_HEAT_WAVE - - egg_moves_begin SPECIES_POLIWAG - .2byte MOVE_MIST - .2byte MOVE_SPLASH - .2byte MOVE_BUBBLE_BEAM - .2byte MOVE_HAZE - .2byte MOVE_MIND_READER - .2byte MOVE_WATER_SPORT - .2byte MOVE_ICE_BALL - - egg_moves_begin SPECIES_ABRA - .2byte MOVE_ENCORE - .2byte MOVE_BARRIER - .2byte MOVE_KNOCK_OFF - .2byte MOVE_FIRE_PUNCH - .2byte MOVE_THUNDER_PUNCH - .2byte MOVE_ICE_PUNCH - - egg_moves_begin SPECIES_MACHOP - .2byte MOVE_LIGHT_SCREEN - .2byte MOVE_MEDITATE - .2byte MOVE_ROLLING_KICK - .2byte MOVE_ENCORE - .2byte MOVE_SMELLING_SALT - .2byte MOVE_COUNTER - .2byte MOVE_ROCK_SLIDE - - egg_moves_begin SPECIES_BELLSPROUT - .2byte MOVE_SWORDS_DANCE - .2byte MOVE_ENCORE - .2byte MOVE_REFLECT - .2byte MOVE_SYNTHESIS - .2byte MOVE_LEECH_LIFE - .2byte MOVE_INGRAIN - .2byte MOVE_MAGICAL_LEAF - - egg_moves_begin SPECIES_TENTACOOL - .2byte MOVE_AURORA_BEAM - .2byte MOVE_MIRROR_COAT - .2byte MOVE_RAPID_SPIN - .2byte MOVE_HAZE - .2byte MOVE_SAFEGUARD - .2byte MOVE_CONFUSE_RAY - - egg_moves_begin SPECIES_GEODUDE - .2byte MOVE_MEGA_PUNCH - .2byte MOVE_ROCK_SLIDE - .2byte MOVE_BLOCK - - egg_moves_begin SPECIES_PONYTA - .2byte MOVE_FLAME_WHEEL - .2byte MOVE_THRASH - .2byte MOVE_DOUBLE_KICK - .2byte MOVE_HYPNOSIS - .2byte MOVE_CHARM - .2byte MOVE_DOUBLE_EDGE - - egg_moves_begin SPECIES_SLOWPOKE - .2byte MOVE_SAFEGUARD - .2byte MOVE_BELLY_DRUM - .2byte MOVE_FUTURE_SIGHT - .2byte MOVE_STOMP - .2byte MOVE_MUD_SPORT - .2byte MOVE_SLEEP_TALK - .2byte MOVE_SNORE - - egg_moves_begin SPECIES_FARFETCH_D - .2byte MOVE_STEEL_WING - .2byte MOVE_FORESIGHT - .2byte MOVE_MIRROR_MOVE - .2byte MOVE_GUST - .2byte MOVE_QUICK_ATTACK - .2byte MOVE_FLAIL - .2byte MOVE_FEATHER_DANCE - .2byte MOVE_CURSE - - egg_moves_begin SPECIES_DODUO - .2byte MOVE_QUICK_ATTACK - .2byte MOVE_SUPERSONIC - .2byte MOVE_HAZE - .2byte MOVE_FAINT_ATTACK - .2byte MOVE_FLAIL - .2byte MOVE_ENDEAVOR - - egg_moves_begin SPECIES_SEEL - .2byte MOVE_LICK - .2byte MOVE_PERISH_SONG - .2byte MOVE_DISABLE - .2byte MOVE_HORN_DRILL - .2byte MOVE_SLAM - .2byte MOVE_ENCORE - .2byte MOVE_FAKE_OUT - .2byte MOVE_ICICLE_SPEAR - - egg_moves_begin SPECIES_GRIMER - .2byte MOVE_HAZE - .2byte MOVE_MEAN_LOOK - .2byte MOVE_LICK - .2byte MOVE_IMPRISON - .2byte MOVE_CURSE - .2byte MOVE_SHADOW_PUNCH - .2byte MOVE_EXPLOSION - - egg_moves_begin SPECIES_SHELLDER - .2byte MOVE_BUBBLE_BEAM - .2byte MOVE_TAKE_DOWN - .2byte MOVE_BARRIER - .2byte MOVE_RAPID_SPIN - .2byte MOVE_SCREECH - .2byte MOVE_ICICLE_SPEAR - - egg_moves_begin SPECIES_GASTLY - .2byte MOVE_PSYWAVE - .2byte MOVE_PERISH_SONG - .2byte MOVE_HAZE - .2byte MOVE_ASTONISH - .2byte MOVE_WILL_O_WISP - .2byte MOVE_GRUDGE - .2byte MOVE_EXPLOSION - - egg_moves_begin SPECIES_ONIX - .2byte MOVE_ROCK_SLIDE - .2byte MOVE_FLAIL - .2byte MOVE_EXPLOSION - .2byte MOVE_BLOCK - - egg_moves_begin SPECIES_DROWZEE - .2byte MOVE_BARRIER - .2byte MOVE_ASSIST - .2byte MOVE_ROLE_PLAY - .2byte MOVE_FIRE_PUNCH - .2byte MOVE_THUNDER_PUNCH - .2byte MOVE_ICE_PUNCH - - egg_moves_begin SPECIES_KRABBY - .2byte MOVE_DIG - .2byte MOVE_HAZE - .2byte MOVE_AMNESIA - .2byte MOVE_FLAIL - .2byte MOVE_SLAM - .2byte MOVE_KNOCK_OFF - .2byte MOVE_SWORDS_DANCE - - egg_moves_begin SPECIES_EXEGGCUTE - .2byte MOVE_SYNTHESIS - .2byte MOVE_MOONLIGHT - .2byte MOVE_REFLECT - .2byte MOVE_ANCIENT_POWER - .2byte MOVE_PSYCH_UP - .2byte MOVE_INGRAIN - .2byte MOVE_CURSE - - egg_moves_begin SPECIES_CUBONE - .2byte MOVE_ROCK_SLIDE - .2byte MOVE_ANCIENT_POWER - .2byte MOVE_BELLY_DRUM - .2byte MOVE_SCREECH - .2byte MOVE_SKULL_BASH - .2byte MOVE_PERISH_SONG - .2byte MOVE_SWORDS_DANCE - - egg_moves_begin SPECIES_LICKITUNG - .2byte MOVE_BELLY_DRUM - .2byte MOVE_MAGNITUDE - .2byte MOVE_BODY_SLAM - .2byte MOVE_CURSE - .2byte MOVE_SMELLING_SALT - .2byte MOVE_SLEEP_TALK - .2byte MOVE_SNORE - .2byte MOVE_SUBSTITUTE - - egg_moves_begin SPECIES_KOFFING - .2byte MOVE_SCREECH - .2byte MOVE_PSYWAVE - .2byte MOVE_PSYBEAM - .2byte MOVE_DESTINY_BOND - .2byte MOVE_PAIN_SPLIT - .2byte MOVE_WILL_O_WISP - - egg_moves_begin SPECIES_RHYHORN - .2byte MOVE_CRUNCH - .2byte MOVE_REVERSAL - .2byte MOVE_ROCK_SLIDE - .2byte MOVE_COUNTER - .2byte MOVE_MAGNITUDE - .2byte MOVE_SWORDS_DANCE - .2byte MOVE_CURSE - .2byte MOVE_CRUSH_CLAW - - egg_moves_begin SPECIES_CHANSEY - .2byte MOVE_PRESENT - .2byte MOVE_METRONOME - .2byte MOVE_HEAL_BELL - .2byte MOVE_AROMATHERAPY - .2byte MOVE_SUBSTITUTE - - egg_moves_begin SPECIES_TANGELA - .2byte MOVE_FLAIL - .2byte MOVE_CONFUSION - .2byte MOVE_MEGA_DRAIN - .2byte MOVE_REFLECT - .2byte MOVE_AMNESIA - .2byte MOVE_LEECH_SEED - .2byte MOVE_NATURE_POWER - - egg_moves_begin SPECIES_KANGASKHAN - .2byte MOVE_STOMP - .2byte MOVE_FORESIGHT - .2byte MOVE_FOCUS_ENERGY - .2byte MOVE_SAFEGUARD - .2byte MOVE_DISABLE - .2byte MOVE_COUNTER - .2byte MOVE_CRUSH_CLAW - .2byte MOVE_SUBSTITUTE - - egg_moves_begin SPECIES_HORSEA - .2byte MOVE_FLAIL - .2byte MOVE_AURORA_BEAM - .2byte MOVE_OCTAZOOKA - .2byte MOVE_DISABLE - .2byte MOVE_SPLASH - .2byte MOVE_DRAGON_RAGE - .2byte MOVE_DRAGON_BREATH - - egg_moves_begin SPECIES_GOLDEEN - .2byte MOVE_PSYBEAM - .2byte MOVE_HAZE - .2byte MOVE_HYDRO_PUMP - .2byte MOVE_SLEEP_TALK - .2byte MOVE_MUD_SPORT - - egg_moves_begin SPECIES_MR_MIME - .2byte MOVE_FUTURE_SIGHT - .2byte MOVE_HYPNOSIS - .2byte MOVE_MIMIC - .2byte MOVE_PSYCH_UP - .2byte MOVE_FAKE_OUT - .2byte MOVE_TRICK - - egg_moves_begin SPECIES_SCYTHER - .2byte MOVE_COUNTER - .2byte MOVE_SAFEGUARD - .2byte MOVE_BATON_PASS - .2byte MOVE_RAZOR_WIND - .2byte MOVE_REVERSAL - .2byte MOVE_LIGHT_SCREEN - .2byte MOVE_ENDURE - .2byte MOVE_SILVER_WIND - - egg_moves_begin SPECIES_PINSIR - .2byte MOVE_FURY_ATTACK - .2byte MOVE_FLAIL - .2byte MOVE_FALSE_SWIPE - .2byte MOVE_FAINT_ATTACK - - egg_moves_begin SPECIES_LAPRAS - .2byte MOVE_FORESIGHT - .2byte MOVE_SUBSTITUTE - .2byte MOVE_TICKLE - .2byte MOVE_REFRESH - .2byte MOVE_DRAGON_DANCE - .2byte MOVE_CURSE - .2byte MOVE_SLEEP_TALK - .2byte MOVE_HORN_DRILL - - egg_moves_begin SPECIES_EEVEE - .2byte MOVE_CHARM - .2byte MOVE_FLAIL - .2byte MOVE_ENDURE - .2byte MOVE_CURSE - .2byte MOVE_TICKLE - .2byte MOVE_WISH - - egg_moves_begin SPECIES_OMANYTE - .2byte MOVE_BUBBLE_BEAM - .2byte MOVE_AURORA_BEAM - .2byte MOVE_SLAM - .2byte MOVE_SUPERSONIC - .2byte MOVE_HAZE - .2byte MOVE_ROCK_SLIDE - .2byte MOVE_SPIKES - - egg_moves_begin SPECIES_KABUTO - .2byte MOVE_BUBBLE_BEAM - .2byte MOVE_AURORA_BEAM - .2byte MOVE_RAPID_SPIN - .2byte MOVE_DIG - .2byte MOVE_FLAIL - .2byte MOVE_KNOCK_OFF - .2byte MOVE_CONFUSE_RAY - - egg_moves_begin SPECIES_AERODACTYL - .2byte MOVE_WHIRLWIND - .2byte MOVE_PURSUIT - .2byte MOVE_FORESIGHT - .2byte MOVE_STEEL_WING - .2byte MOVE_DRAGON_BREATH - .2byte MOVE_CURSE - - egg_moves_begin SPECIES_SNORLAX - .2byte MOVE_LICK - .2byte MOVE_CHARM - .2byte MOVE_DOUBLE_EDGE - .2byte MOVE_CURSE - .2byte MOVE_FISSURE - .2byte MOVE_SUBSTITUTE - - egg_moves_begin SPECIES_DRATINI - .2byte MOVE_LIGHT_SCREEN - .2byte MOVE_MIST - .2byte MOVE_HAZE - .2byte MOVE_SUPERSONIC - .2byte MOVE_DRAGON_BREATH - .2byte MOVE_DRAGON_DANCE - - egg_moves_begin SPECIES_CHIKORITA - .2byte MOVE_VINE_WHIP - .2byte MOVE_LEECH_SEED - .2byte MOVE_COUNTER - .2byte MOVE_ANCIENT_POWER - .2byte MOVE_FLAIL - .2byte MOVE_NATURE_POWER - .2byte MOVE_INGRAIN - .2byte MOVE_GRASS_WHISTLE - - egg_moves_begin SPECIES_CYNDAQUIL - .2byte MOVE_FURY_SWIPES - .2byte MOVE_QUICK_ATTACK - .2byte MOVE_REVERSAL - .2byte MOVE_THRASH - .2byte MOVE_FORESIGHT - .2byte MOVE_COVET - .2byte MOVE_HOWL - .2byte MOVE_CRUSH_CLAW - - egg_moves_begin SPECIES_TOTODILE - .2byte MOVE_CRUNCH - .2byte MOVE_THRASH - .2byte MOVE_HYDRO_PUMP - .2byte MOVE_ANCIENT_POWER - .2byte MOVE_ROCK_SLIDE - .2byte MOVE_MUD_SPORT - .2byte MOVE_WATER_SPORT - .2byte MOVE_DRAGON_CLAW - - egg_moves_begin SPECIES_SENTRET - .2byte MOVE_DOUBLE_EDGE - .2byte MOVE_PURSUIT - .2byte MOVE_SLASH - .2byte MOVE_FOCUS_ENERGY - .2byte MOVE_REVERSAL - .2byte MOVE_SUBSTITUTE - .2byte MOVE_TRICK - .2byte MOVE_ASSIST - - egg_moves_begin SPECIES_HOOTHOOT - .2byte MOVE_MIRROR_MOVE - .2byte MOVE_SUPERSONIC - .2byte MOVE_FAINT_ATTACK - .2byte MOVE_WING_ATTACK - .2byte MOVE_WHIRLWIND - .2byte MOVE_SKY_ATTACK - .2byte MOVE_FEATHER_DANCE - - egg_moves_begin SPECIES_LEDYBA - .2byte MOVE_PSYBEAM - .2byte MOVE_BIDE - .2byte MOVE_SILVER_WIND - - egg_moves_begin SPECIES_SPINARAK - .2byte MOVE_PSYBEAM - .2byte MOVE_DISABLE - .2byte MOVE_SONIC_BOOM - .2byte MOVE_BATON_PASS - .2byte MOVE_PURSUIT - .2byte MOVE_SIGNAL_BEAM - - egg_moves_begin SPECIES_CHINCHOU - .2byte MOVE_FLAIL - .2byte MOVE_SCREECH - .2byte MOVE_AMNESIA - - egg_moves_begin SPECIES_PICHU - .2byte MOVE_REVERSAL - .2byte MOVE_BIDE - .2byte MOVE_PRESENT - .2byte MOVE_ENCORE - .2byte MOVE_DOUBLE_SLAP - .2byte MOVE_WISH - .2byte MOVE_CHARGE - - egg_moves_begin SPECIES_CLEFFA - .2byte MOVE_PRESENT - .2byte MOVE_METRONOME - .2byte MOVE_AMNESIA - .2byte MOVE_BELLY_DRUM - .2byte MOVE_SPLASH - .2byte MOVE_MIMIC - .2byte MOVE_WISH - .2byte MOVE_SUBSTITUTE - - egg_moves_begin SPECIES_IGGLYBUFF - .2byte MOVE_PERISH_SONG - .2byte MOVE_PRESENT - .2byte MOVE_FAINT_ATTACK - .2byte MOVE_WISH - .2byte MOVE_FAKE_TEARS - - egg_moves_begin SPECIES_TOGEPI - .2byte MOVE_PRESENT - .2byte MOVE_MIRROR_MOVE - .2byte MOVE_PECK - .2byte MOVE_FORESIGHT - .2byte MOVE_FUTURE_SIGHT - .2byte MOVE_SUBSTITUTE - .2byte MOVE_PSYCH_UP - - egg_moves_begin SPECIES_NATU - .2byte MOVE_HAZE - .2byte MOVE_DRILL_PECK - .2byte MOVE_QUICK_ATTACK - .2byte MOVE_FAINT_ATTACK - .2byte MOVE_STEEL_WING - .2byte MOVE_PSYCH_UP - .2byte MOVE_FEATHER_DANCE - .2byte MOVE_REFRESH - - egg_moves_begin SPECIES_MAREEP - .2byte MOVE_TAKE_DOWN - .2byte MOVE_BODY_SLAM - .2byte MOVE_SAFEGUARD - .2byte MOVE_SCREECH - .2byte MOVE_REFLECT - .2byte MOVE_ODOR_SLEUTH - .2byte MOVE_CHARGE - - egg_moves_begin SPECIES_MARILL - .2byte MOVE_LIGHT_SCREEN - .2byte MOVE_PRESENT - .2byte MOVE_AMNESIA - .2byte MOVE_FUTURE_SIGHT - .2byte MOVE_BELLY_DRUM - .2byte MOVE_PERISH_SONG - .2byte MOVE_SUPERSONIC - .2byte MOVE_SUBSTITUTE - - egg_moves_begin SPECIES_SUDOWOODO - .2byte MOVE_SELF_DESTRUCT - - egg_moves_begin SPECIES_HOPPIP - .2byte MOVE_CONFUSION - .2byte MOVE_ENCORE - .2byte MOVE_DOUBLE_EDGE - .2byte MOVE_REFLECT - .2byte MOVE_AMNESIA - .2byte MOVE_HELPING_HAND - .2byte MOVE_PSYCH_UP - - egg_moves_begin SPECIES_AIPOM - .2byte MOVE_COUNTER - .2byte MOVE_SCREECH - .2byte MOVE_PURSUIT - .2byte MOVE_AGILITY - .2byte MOVE_SPITE - .2byte MOVE_SLAM - .2byte MOVE_DOUBLE_SLAP - .2byte MOVE_BEAT_UP - - egg_moves_begin SPECIES_SUNKERN - .2byte MOVE_GRASS_WHISTLE - .2byte MOVE_ENCORE - .2byte MOVE_LEECH_SEED - .2byte MOVE_NATURE_POWER - .2byte MOVE_CURSE - .2byte MOVE_HELPING_HAND - - egg_moves_begin SPECIES_YANMA - .2byte MOVE_WHIRLWIND - .2byte MOVE_REVERSAL - .2byte MOVE_LEECH_LIFE - .2byte MOVE_SIGNAL_BEAM - .2byte MOVE_SILVER_WIND - - egg_moves_begin SPECIES_WOOPER - .2byte MOVE_BODY_SLAM - .2byte MOVE_ANCIENT_POWER - .2byte MOVE_SAFEGUARD - .2byte MOVE_CURSE - .2byte MOVE_MUD_SPORT - .2byte MOVE_STOCKPILE - .2byte MOVE_SWALLOW - .2byte MOVE_SPIT_UP - - egg_moves_begin SPECIES_MURKROW - .2byte MOVE_WHIRLWIND - .2byte MOVE_DRILL_PECK - .2byte MOVE_MIRROR_MOVE - .2byte MOVE_WING_ATTACK - .2byte MOVE_SKY_ATTACK - .2byte MOVE_CONFUSE_RAY - .2byte MOVE_FEATHER_DANCE - .2byte MOVE_PERISH_SONG - - egg_moves_begin SPECIES_MISDREAVUS - .2byte MOVE_SCREECH - .2byte MOVE_DESTINY_BOND - .2byte MOVE_PSYCH_UP - .2byte MOVE_IMPRISON - - egg_moves_begin SPECIES_GIRAFARIG - .2byte MOVE_TAKE_DOWN - .2byte MOVE_AMNESIA - .2byte MOVE_FORESIGHT - .2byte MOVE_FUTURE_SIGHT - .2byte MOVE_BEAT_UP - .2byte MOVE_PSYCH_UP - .2byte MOVE_WISH - .2byte MOVE_MAGIC_COAT - - egg_moves_begin SPECIES_PINECO - .2byte MOVE_REFLECT - .2byte MOVE_PIN_MISSILE - .2byte MOVE_FLAIL - .2byte MOVE_SWIFT - .2byte MOVE_COUNTER - .2byte MOVE_SAND_TOMB - - egg_moves_begin SPECIES_DUNSPARCE - .2byte MOVE_BIDE - .2byte MOVE_ANCIENT_POWER - .2byte MOVE_ROCK_SLIDE - .2byte MOVE_BITE - .2byte MOVE_HEADBUTT - .2byte MOVE_ASTONISH - .2byte MOVE_CURSE - - egg_moves_begin SPECIES_GLIGAR - .2byte MOVE_METAL_CLAW - .2byte MOVE_WING_ATTACK - .2byte MOVE_RAZOR_WIND - .2byte MOVE_COUNTER - .2byte MOVE_SAND_TOMB - - egg_moves_begin SPECIES_SNUBBULL - .2byte MOVE_METRONOME - .2byte MOVE_FAINT_ATTACK - .2byte MOVE_REFLECT - .2byte MOVE_PRESENT - .2byte MOVE_CRUNCH - .2byte MOVE_HEAL_BELL - .2byte MOVE_SNORE - .2byte MOVE_SMELLING_SALT - - egg_moves_begin SPECIES_QWILFISH - .2byte MOVE_FLAIL - .2byte MOVE_HAZE - .2byte MOVE_BUBBLE_BEAM - .2byte MOVE_SUPERSONIC - .2byte MOVE_ASTONISH - - egg_moves_begin SPECIES_SHUCKLE - .2byte MOVE_SWEET_SCENT - - egg_moves_begin SPECIES_HERACROSS - .2byte MOVE_HARDEN - .2byte MOVE_BIDE - .2byte MOVE_FLAIL - .2byte MOVE_FALSE_SWIPE - - egg_moves_begin SPECIES_SNEASEL - .2byte MOVE_COUNTER - .2byte MOVE_SPITE - .2byte MOVE_FORESIGHT - .2byte MOVE_REFLECT - .2byte MOVE_BITE - .2byte MOVE_CRUSH_CLAW - .2byte MOVE_FAKE_OUT - - egg_moves_begin SPECIES_TEDDIURSA - .2byte MOVE_CRUNCH - .2byte MOVE_TAKE_DOWN - .2byte MOVE_SEISMIC_TOSS - .2byte MOVE_COUNTER - .2byte MOVE_METAL_CLAW - .2byte MOVE_FAKE_TEARS - .2byte MOVE_YAWN - .2byte MOVE_SLEEP_TALK - - egg_moves_begin SPECIES_SLUGMA - .2byte MOVE_ACID_ARMOR - .2byte MOVE_HEAT_WAVE - - egg_moves_begin SPECIES_SWINUB - .2byte MOVE_TAKE_DOWN - .2byte MOVE_BITE - .2byte MOVE_BODY_SLAM - .2byte MOVE_ROCK_SLIDE - .2byte MOVE_ANCIENT_POWER - .2byte MOVE_MUD_SHOT - .2byte MOVE_ICICLE_SPEAR - .2byte MOVE_DOUBLE_EDGE - - egg_moves_begin SPECIES_CORSOLA - .2byte MOVE_ROCK_SLIDE - .2byte MOVE_SCREECH - .2byte MOVE_MIST - .2byte MOVE_AMNESIA - .2byte MOVE_BARRIER - .2byte MOVE_INGRAIN - .2byte MOVE_CONFUSE_RAY - .2byte MOVE_ICICLE_SPEAR - - egg_moves_begin SPECIES_REMORAID - .2byte MOVE_AURORA_BEAM - .2byte MOVE_OCTAZOOKA - .2byte MOVE_SUPERSONIC - .2byte MOVE_HAZE - .2byte MOVE_SCREECH - .2byte MOVE_THUNDER_WAVE - .2byte MOVE_ROCK_BLAST - - egg_moves_begin SPECIES_DELIBIRD - .2byte MOVE_AURORA_BEAM - .2byte MOVE_QUICK_ATTACK - .2byte MOVE_FUTURE_SIGHT - .2byte MOVE_SPLASH - .2byte MOVE_RAPID_SPIN - .2byte MOVE_ICE_BALL - - egg_moves_begin SPECIES_MANTINE - .2byte MOVE_TWISTER - .2byte MOVE_HYDRO_PUMP - .2byte MOVE_HAZE - .2byte MOVE_SLAM - .2byte MOVE_MUD_SPORT - .2byte MOVE_ROCK_SLIDE - - egg_moves_begin SPECIES_SKARMORY - .2byte MOVE_DRILL_PECK - .2byte MOVE_PURSUIT - .2byte MOVE_WHIRLWIND - .2byte MOVE_SKY_ATTACK - .2byte MOVE_CURSE - - egg_moves_begin SPECIES_HOUNDOUR - .2byte MOVE_FIRE_SPIN - .2byte MOVE_RAGE - .2byte MOVE_PURSUIT - .2byte MOVE_COUNTER - .2byte MOVE_SPITE - .2byte MOVE_REVERSAL - .2byte MOVE_BEAT_UP - .2byte MOVE_WILL_O_WISP - - egg_moves_begin SPECIES_PHANPY - .2byte MOVE_FOCUS_ENERGY - .2byte MOVE_BODY_SLAM - .2byte MOVE_ANCIENT_POWER - .2byte MOVE_SNORE - .2byte MOVE_COUNTER - .2byte MOVE_FISSURE - - egg_moves_begin SPECIES_STANTLER - .2byte MOVE_SPITE - .2byte MOVE_DISABLE - .2byte MOVE_BITE - .2byte MOVE_SWAGGER - .2byte MOVE_PSYCH_UP - .2byte MOVE_EXTRASENSORY - - egg_moves_begin SPECIES_TYROGUE - .2byte MOVE_RAPID_SPIN - .2byte MOVE_HI_JUMP_KICK - .2byte MOVE_MACH_PUNCH - .2byte MOVE_MIND_READER - .2byte MOVE_HELPING_HAND - - egg_moves_begin SPECIES_SMOOCHUM - .2byte MOVE_MEDITATE - .2byte MOVE_PSYCH_UP - .2byte MOVE_FAKE_OUT - .2byte MOVE_WISH - .2byte MOVE_ICE_PUNCH - - egg_moves_begin SPECIES_ELEKID - .2byte MOVE_KARATE_CHOP - .2byte MOVE_BARRIER - .2byte MOVE_ROLLING_KICK - .2byte MOVE_MEDITATE - .2byte MOVE_CROSS_CHOP - .2byte MOVE_FIRE_PUNCH - .2byte MOVE_ICE_PUNCH - - egg_moves_begin SPECIES_MAGBY - .2byte MOVE_KARATE_CHOP - .2byte MOVE_MEGA_PUNCH - .2byte MOVE_BARRIER - .2byte MOVE_SCREECH - .2byte MOVE_CROSS_CHOP - .2byte MOVE_THUNDER_PUNCH - - egg_moves_begin SPECIES_MILTANK - .2byte MOVE_PRESENT - .2byte MOVE_REVERSAL - .2byte MOVE_SEISMIC_TOSS - .2byte MOVE_ENDURE - .2byte MOVE_PSYCH_UP - .2byte MOVE_CURSE - .2byte MOVE_HELPING_HAND - .2byte MOVE_SLEEP_TALK - - egg_moves_begin SPECIES_LARVITAR - .2byte MOVE_PURSUIT - .2byte MOVE_STOMP - .2byte MOVE_OUTRAGE - .2byte MOVE_FOCUS_ENERGY - .2byte MOVE_ANCIENT_POWER - .2byte MOVE_DRAGON_DANCE - .2byte MOVE_CURSE - - egg_moves_begin SPECIES_TREECKO - .2byte MOVE_CRUNCH - .2byte MOVE_MUD_SPORT - .2byte MOVE_ENDEAVOR - .2byte MOVE_LEECH_SEED - .2byte MOVE_DRAGON_BREATH - .2byte MOVE_CRUSH_CLAW - - egg_moves_begin SPECIES_TORCHIC - .2byte MOVE_COUNTER - .2byte MOVE_REVERSAL - .2byte MOVE_ENDURE - .2byte MOVE_SWAGGER - .2byte MOVE_ROCK_SLIDE - .2byte MOVE_SMELLING_SALT - - egg_moves_begin SPECIES_MUDKIP - .2byte MOVE_REFRESH - .2byte MOVE_UPROAR - .2byte MOVE_CURSE - .2byte MOVE_STOMP - .2byte MOVE_ICE_BALL - .2byte MOVE_MIRROR_COAT - - egg_moves_begin SPECIES_POOCHYENA - .2byte MOVE_ASTONISH - .2byte MOVE_POISON_FANG - .2byte MOVE_COVET - .2byte MOVE_LEER - .2byte MOVE_YAWN - - egg_moves_begin SPECIES_ZIGZAGOON - .2byte MOVE_CHARM - .2byte MOVE_PURSUIT - .2byte MOVE_SUBSTITUTE - .2byte MOVE_TICKLE - .2byte MOVE_TRICK - - egg_moves_begin SPECIES_LOTAD - .2byte MOVE_SYNTHESIS - .2byte MOVE_RAZOR_LEAF - .2byte MOVE_SWEET_SCENT - .2byte MOVE_LEECH_SEED - .2byte MOVE_FLAIL - .2byte MOVE_WATER_GUN - - egg_moves_begin SPECIES_SEEDOT - .2byte MOVE_LEECH_SEED - .2byte MOVE_AMNESIA - .2byte MOVE_QUICK_ATTACK - .2byte MOVE_RAZOR_WIND - .2byte MOVE_TAKE_DOWN - .2byte MOVE_FALSE_SWIPE - - egg_moves_begin SPECIES_NINCADA - .2byte MOVE_ENDURE - .2byte MOVE_FAINT_ATTACK - .2byte MOVE_GUST - .2byte MOVE_SILVER_WIND - - egg_moves_begin SPECIES_TAILLOW - .2byte MOVE_PURSUIT - .2byte MOVE_SUPERSONIC - .2byte MOVE_REFRESH - .2byte MOVE_MIRROR_MOVE - .2byte MOVE_RAGE - .2byte MOVE_SKY_ATTACK - - egg_moves_begin SPECIES_SHROOMISH - .2byte MOVE_FAKE_TEARS - .2byte MOVE_SWAGGER - .2byte MOVE_CHARM - .2byte MOVE_FALSE_SWIPE - .2byte MOVE_HELPING_HAND - - egg_moves_begin SPECIES_SPINDA - .2byte MOVE_ENCORE - .2byte MOVE_ROCK_SLIDE - .2byte MOVE_ASSIST - .2byte MOVE_DISABLE - .2byte MOVE_BATON_PASS - .2byte MOVE_WISH - .2byte MOVE_TRICK - .2byte MOVE_SMELLING_SALT - - egg_moves_begin SPECIES_WINGULL - .2byte MOVE_MIST - .2byte MOVE_TWISTER - .2byte MOVE_AGILITY - .2byte MOVE_GUST - .2byte MOVE_WATER_SPORT - - egg_moves_begin SPECIES_SURSKIT - .2byte MOVE_FORESIGHT - .2byte MOVE_MUD_SHOT - .2byte MOVE_PSYBEAM - .2byte MOVE_HYDRO_PUMP - .2byte MOVE_MIND_READER - - egg_moves_begin SPECIES_WAILMER - .2byte MOVE_DOUBLE_EDGE - .2byte MOVE_THRASH - .2byte MOVE_SWAGGER - .2byte MOVE_SNORE - .2byte MOVE_SLEEP_TALK - .2byte MOVE_CURSE - .2byte MOVE_FISSURE - .2byte MOVE_TICKLE - - egg_moves_begin SPECIES_SKITTY - .2byte MOVE_HELPING_HAND - .2byte MOVE_PSYCH_UP - .2byte MOVE_UPROAR - .2byte MOVE_FAKE_TEARS - .2byte MOVE_WISH - .2byte MOVE_BATON_PASS - .2byte MOVE_SUBSTITUTE - .2byte MOVE_TICKLE - - egg_moves_begin SPECIES_KECLEON - .2byte MOVE_DISABLE - .2byte MOVE_MAGIC_COAT - .2byte MOVE_TRICK - - egg_moves_begin SPECIES_NOSEPASS - .2byte MOVE_MAGNITUDE - .2byte MOVE_ROLLOUT - .2byte MOVE_EXPLOSION - - egg_moves_begin SPECIES_TORKOAL - .2byte MOVE_ERUPTION - .2byte MOVE_ENDURE - .2byte MOVE_SLEEP_TALK - .2byte MOVE_YAWN - - egg_moves_begin SPECIES_SABLEYE - .2byte MOVE_PSYCH_UP - .2byte MOVE_RECOVER - .2byte MOVE_MOONLIGHT - - egg_moves_begin SPECIES_BARBOACH - .2byte MOVE_THRASH - .2byte MOVE_WHIRLPOOL - .2byte MOVE_SPARK - - egg_moves_begin SPECIES_LUVDISC - .2byte MOVE_SPLASH - .2byte MOVE_SUPERSONIC - .2byte MOVE_WATER_SPORT - .2byte MOVE_MUD_SPORT - - egg_moves_begin SPECIES_CORPHISH - .2byte MOVE_MUD_SPORT - .2byte MOVE_ENDEAVOR - .2byte MOVE_BODY_SLAM - .2byte MOVE_ANCIENT_POWER - - egg_moves_begin SPECIES_FEEBAS - .2byte MOVE_MIRROR_COAT - .2byte MOVE_DRAGON_BREATH - .2byte MOVE_MUD_SPORT - .2byte MOVE_HYPNOSIS - .2byte MOVE_LIGHT_SCREEN - .2byte MOVE_CONFUSE_RAY - - egg_moves_begin SPECIES_CARVANHA - .2byte MOVE_HYDRO_PUMP - .2byte MOVE_DOUBLE_EDGE - .2byte MOVE_THRASH - - egg_moves_begin SPECIES_TRAPINCH - .2byte MOVE_FOCUS_ENERGY - .2byte MOVE_QUICK_ATTACK - .2byte MOVE_GUST - - egg_moves_begin SPECIES_MAKUHITA - .2byte MOVE_FAINT_ATTACK - .2byte MOVE_DETECT - .2byte MOVE_FORESIGHT - .2byte MOVE_HELPING_HAND - .2byte MOVE_CROSS_CHOP - .2byte MOVE_REVENGE - .2byte MOVE_DYNAMIC_PUNCH - .2byte MOVE_COUNTER - - egg_moves_begin SPECIES_ELECTRIKE - .2byte MOVE_CRUNCH - .2byte MOVE_HEADBUTT - .2byte MOVE_UPROAR - .2byte MOVE_CURSE - .2byte MOVE_SWIFT - - egg_moves_begin SPECIES_NUMEL - .2byte MOVE_HOWL - .2byte MOVE_SCARY_FACE - .2byte MOVE_BODY_SLAM - .2byte MOVE_ROLLOUT - .2byte MOVE_DEFENSE_CURL - .2byte MOVE_STOMP - - egg_moves_begin SPECIES_SPHEAL - .2byte MOVE_WATER_SPORT - .2byte MOVE_STOCKPILE - .2byte MOVE_SWALLOW - .2byte MOVE_SPIT_UP - .2byte MOVE_YAWN - .2byte MOVE_ROCK_SLIDE - .2byte MOVE_CURSE - .2byte MOVE_FISSURE - - egg_moves_begin SPECIES_CACNEA - .2byte MOVE_GRASS_WHISTLE - .2byte MOVE_ACID - .2byte MOVE_TEETER_DANCE - .2byte MOVE_DYNAMIC_PUNCH - .2byte MOVE_COUNTER - - egg_moves_begin SPECIES_SNORUNT - .2byte MOVE_BLOCK - .2byte MOVE_SPIKES - - egg_moves_begin SPECIES_AZURILL - .2byte MOVE_ENCORE - .2byte MOVE_SING - .2byte MOVE_REFRESH - .2byte MOVE_SLAM - .2byte MOVE_TICKLE - - egg_moves_begin SPECIES_SPOINK - .2byte MOVE_FUTURE_SIGHT - .2byte MOVE_EXTRASENSORY - .2byte MOVE_SUBSTITUTE - .2byte MOVE_TRICK - - egg_moves_begin SPECIES_PLUSLE - .2byte MOVE_SUBSTITUTE - .2byte MOVE_WISH - - egg_moves_begin SPECIES_MINUN - .2byte MOVE_SUBSTITUTE - .2byte MOVE_WISH - - egg_moves_begin SPECIES_MAWILE - .2byte MOVE_SWORDS_DANCE - .2byte MOVE_FALSE_SWIPE - .2byte MOVE_POISON_FANG - .2byte MOVE_PSYCH_UP - .2byte MOVE_ANCIENT_POWER - .2byte MOVE_TICKLE - - egg_moves_begin SPECIES_MEDITITE - .2byte MOVE_FIRE_PUNCH - .2byte MOVE_THUNDER_PUNCH - .2byte MOVE_ICE_PUNCH - .2byte MOVE_FORESIGHT - .2byte MOVE_FAKE_OUT - .2byte MOVE_BATON_PASS - .2byte MOVE_DYNAMIC_PUNCH - - egg_moves_begin SPECIES_SWABLU - .2byte MOVE_AGILITY - .2byte MOVE_HAZE - .2byte MOVE_PURSUIT - .2byte MOVE_RAGE - - egg_moves_begin SPECIES_DUSKULL - .2byte MOVE_IMPRISON - .2byte MOVE_DESTINY_BOND - .2byte MOVE_PAIN_SPLIT - .2byte MOVE_GRUDGE - .2byte MOVE_MEMENTO - .2byte MOVE_FAINT_ATTACK - - egg_moves_begin SPECIES_ROSELIA - .2byte MOVE_SPIKES - .2byte MOVE_SYNTHESIS - .2byte MOVE_PIN_MISSILE - .2byte MOVE_COTTON_SPORE - - egg_moves_begin SPECIES_SLAKOTH - .2byte MOVE_PURSUIT - .2byte MOVE_SLASH - .2byte MOVE_BODY_SLAM - .2byte MOVE_SNORE - .2byte MOVE_CRUSH_CLAW - .2byte MOVE_CURSE - .2byte MOVE_SLEEP_TALK - - egg_moves_begin SPECIES_GULPIN - .2byte MOVE_DREAM_EATER - .2byte MOVE_ACID_ARMOR - .2byte MOVE_SMOG - .2byte MOVE_PAIN_SPLIT - - egg_moves_begin SPECIES_TROPIUS - .2byte MOVE_HEADBUTT - .2byte MOVE_SLAM - .2byte MOVE_RAZOR_WIND - .2byte MOVE_LEECH_SEED - .2byte MOVE_NATURE_POWER - - egg_moves_begin SPECIES_WHISMUR - .2byte MOVE_TAKE_DOWN - .2byte MOVE_SNORE - .2byte MOVE_SWAGGER - .2byte MOVE_EXTRASENSORY - .2byte MOVE_SMELLING_SALT - - egg_moves_begin SPECIES_CLAMPERL - .2byte MOVE_REFRESH - .2byte MOVE_MUD_SPORT - .2byte MOVE_BODY_SLAM - .2byte MOVE_SUPERSONIC - .2byte MOVE_BARRIER - .2byte MOVE_CONFUSE_RAY - - egg_moves_begin SPECIES_ABSOL - .2byte MOVE_BATON_PASS - .2byte MOVE_FAINT_ATTACK - .2byte MOVE_DOUBLE_EDGE - .2byte MOVE_MAGIC_COAT - .2byte MOVE_CURSE - .2byte MOVE_SUBSTITUTE - - egg_moves_begin SPECIES_SHUPPET - .2byte MOVE_DISABLE - .2byte MOVE_DESTINY_BOND - .2byte MOVE_FORESIGHT - .2byte MOVE_ASTONISH - .2byte MOVE_IMPRISON - - egg_moves_begin SPECIES_SEVIPER - .2byte MOVE_STOCKPILE - .2byte MOVE_SWALLOW - .2byte MOVE_SPIT_UP - .2byte MOVE_BODY_SLAM - - egg_moves_begin SPECIES_ZANGOOSE - .2byte MOVE_FLAIL - .2byte MOVE_DOUBLE_KICK - .2byte MOVE_RAZOR_WIND - .2byte MOVE_COUNTER - .2byte MOVE_ROAR - .2byte MOVE_CURSE - - egg_moves_begin SPECIES_RELICANTH - .2byte MOVE_MAGNITUDE - .2byte MOVE_SKULL_BASH - .2byte MOVE_WATER_SPORT - .2byte MOVE_AMNESIA - .2byte MOVE_SLEEP_TALK - .2byte MOVE_ROCK_SLIDE - - egg_moves_begin SPECIES_ARON - .2byte MOVE_ENDEAVOR - .2byte MOVE_BODY_SLAM - .2byte MOVE_STOMP - .2byte MOVE_SMELLING_SALT - - egg_moves_begin SPECIES_CASTFORM - .2byte MOVE_FUTURE_SIGHT - .2byte MOVE_PSYCH_UP - - egg_moves_begin SPECIES_VOLBEAT - .2byte MOVE_BATON_PASS - .2byte MOVE_SILVER_WIND - .2byte MOVE_TRICK - - egg_moves_begin SPECIES_ILLUMISE - .2byte MOVE_BATON_PASS - .2byte MOVE_SILVER_WIND - .2byte MOVE_GROWTH - - egg_moves_begin SPECIES_LILEEP - .2byte MOVE_BARRIER - .2byte MOVE_RECOVER - .2byte MOVE_MIRROR_COAT - .2byte MOVE_ROCK_SLIDE - - egg_moves_begin SPECIES_ANORITH - .2byte MOVE_RAPID_SPIN - .2byte MOVE_KNOCK_OFF - .2byte MOVE_SWORDS_DANCE - .2byte MOVE_ROCK_SLIDE - - egg_moves_begin SPECIES_RALTS - .2byte MOVE_DISABLE - .2byte MOVE_WILL_O_WISP - .2byte MOVE_MEAN_LOOK - .2byte MOVE_MEMENTO - .2byte MOVE_DESTINY_BOND - - egg_moves_begin SPECIES_BAGON - .2byte MOVE_HYDRO_PUMP - .2byte MOVE_THRASH - .2byte MOVE_DRAGON_RAGE - .2byte MOVE_TWISTER - .2byte MOVE_DRAGON_DANCE - - egg_moves_begin SPECIES_CHIMECHO - .2byte MOVE_DISABLE - .2byte MOVE_CURSE - .2byte MOVE_HYPNOSIS - .2byte MOVE_DREAM_EATER - - .2byte -1 diff --git a/data/scripts/day_care.inc b/data/scripts/day_care.inc index a7000460b..27e617128 100644 --- a/data/scripts/day_care.inc +++ b/data/scripts/day_care.inc @@ -1,8 +1,8 @@ Route117_EventScript_291C18:: @ 8291C18 lock faceplayer - special sp0B5_daycare - specialvar VAR_RESULT, sp0B6_daycare + special GetDaycareMonNicknames + specialvar VAR_RESULT, GetDaycareState compare_var_to_value VAR_RESULT, 1 goto_eq Route117_EventScript_291C4D compare_var_to_value VAR_RESULT, 2 @@ -21,8 +21,8 @@ Route117_EventScript_291C4D:: @ 8291C4D compare_var_to_value VAR_RESULT, 1 goto_eq Route117_EventScript_291C83 msgbox Route117_Text_292149, 4 - clearflag FLAG_0x086 - special sub_8070728 + clearflag FLAG_PENDING_DAYCARE_EGG + special RejectEggFromDayCare release end @@ -40,8 +40,8 @@ Route117_EventScript_291C9D:: @ 8291C9D waitfanfare waitbuttonpress msgbox Route117_Text_2921CF, 4 - special sp0B8_daycare - clearflag FLAG_0x086 + special GiveEggFromDaycare + clearflag FLAG_PENDING_DAYCARE_EGG release end @@ -56,7 +56,7 @@ Route117_EventScript_291CC8:: @ 8291CC8 return Route117_EventScript_291CD1:: @ 8291CD1 - special sp0B5_daycare + special GetDaycareMonNicknames msgbox Route117_Text_292114, 4 setvar VAR_0x8004, 0 call Route117_EventScript_291CB7 @@ -64,9 +64,9 @@ Route117_EventScript_291CD1:: @ 8291CD1 end Route117_EventScript_291CE8:: @ 8291CE8 - special sp0B5_daycare + special GetDaycareMonNicknames msgbox Route117_Text_292299, 4 - special sp0B9_daycare_relationship_comment + special SetDaycareCompatibilityString special sub_8138AC0 waitmessage waitbuttonpress @@ -80,7 +80,7 @@ Route117_EventScript_291CE8:: @ 8291CE8 Route117_PokemonDayCare_EventScript_291D11:: @ 8291D11 lock faceplayer - specialvar VAR_RESULT, sp0B6_daycare + specialvar VAR_RESULT, GetDaycareState compare_var_to_value VAR_RESULT, 1 goto_eq Route117_PokemonDayCare_EventScript_291E0B compare_var_to_value VAR_RESULT, 2 @@ -103,21 +103,21 @@ Route117_PokemonDayCare_EventScript_291D56:: @ 8291D56 goto_eq Route117_PokemonDayCare_EventScript_291E01 msgbox Route117_PokemonDayCare_Text_292349, 4 fadescreen 1 - special sub_8071330 + special ChooseSendDaycareMon waitstate compare_var_to_value VAR_0x8004, 255 goto_eq Route117_PokemonDayCare_EventScript_291DCA specialvar VAR_RESULT, CountPartyAliveNonEggMons_IgnoreVar0x8004Slot compare_var_to_value VAR_RESULT, 0 goto_eq Route117_PokemonDayCare_EventScript_291DF7 - specialvar VAR_0x8005, sub_8070C58 + specialvar VAR_0x8005, GetSelectedMonNickAndSpecies waitse playmoncry VAR_0x8005, 0 msgbox Route117_PokemonDayCare_Text_292370, 4 waitmoncry - special daycare_send_selected_pokemon + special StoreSelectedPokemonInDaycare incrementgamestat 47 - specialvar VAR_RESULT, sp0B6_daycare + specialvar VAR_RESULT, GetDaycareState compare_var_to_value VAR_RESULT, 2 goto_eq Route117_PokemonDayCare_EventScript_291DD4 release @@ -160,7 +160,7 @@ Route117_PokemonDayCare_EventScript_291E15:: @ 8291E15 return Route117_PokemonDayCare_EventScript_291E1E:: @ 8291E1E - specialvar VAR_RESULT, sub_806FF30 + specialvar VAR_RESULT, GetNumLevelsGainedFromDaycare compare_var_to_value VAR_RESULT, 0 call_if 5, Route117_PokemonDayCare_EventScript_291E15 return @@ -182,11 +182,11 @@ Route117_PokemonDayCare_EventScript_291E6D:: @ 8291E6D specialvar VAR_RESULT, CalculatePlayerPartyCount compare_var_to_value VAR_RESULT, 6 goto_eq Route117_PokemonDayCare_EventScript_291F3D - specialvar VAR_RESULT, sp0B6_daycare + specialvar VAR_RESULT, GetDaycareState setvar VAR_0x8004, 0 compare_var_to_value VAR_RESULT, 2 goto_eq Route117_PokemonDayCare_EventScript_291EAC - special sub_80712C0 + special ShowDaycareLevelMenu waitstate copyvar VAR_0x8004, VAR_RESULT compare_var_to_value VAR_RESULT, 2 @@ -195,7 +195,7 @@ Route117_PokemonDayCare_EventScript_291E6D:: @ 8291E6D end Route117_PokemonDayCare_EventScript_291EAC:: @ 8291EAC - special sub_806FED8 + special GetDaycareCost msgbox Route117_PokemonDayCare_Text_292549, 5 compare_var_to_value VAR_RESULT, 1 goto_eq Route117_PokemonDayCare_EventScript_291EC8 @@ -213,7 +213,7 @@ Route117_PokemonDayCare_EventScript_291EC8:: @ 8291EC8 Route117_PokemonDayCare_EventScript_291EE2:: @ 8291EE2 applymovement 1, Route117_PokemonDayCare_Movement_291F47 waitmovement 0 - specialvar VAR_RESULT, sub_806FDC4 + specialvar VAR_RESULT, TakePokemonFromDaycare special SubtractMoneyFromVar0x8005 playse SE_REGI msgbox Route117_PokemonDayCare_Text_292575, 4 @@ -221,7 +221,7 @@ Route117_PokemonDayCare_EventScript_291EE2:: @ 8291EE2 playmoncry VAR_RESULT, 0 msgbox Route117_PokemonDayCare_Text_292593, 4 waitmoncry - specialvar VAR_RESULT, sp0B6_daycare + specialvar VAR_RESULT, GetDaycareState compare_var_to_value VAR_RESULT, 2 goto_eq Route117_PokemonDayCare_EventScript_291F24 goto Route117_PokemonDayCare_EventScript_291DCA @@ -278,12 +278,12 @@ Route117_PokemonDayCare_EventScript_291F5C:: @ 8291F5C end Route117_PokemonDayCare_EventScript_291F95:: @ 8291F95 - special sub_80712C0 + special ShowDaycareLevelMenu waitstate compare_var_to_value VAR_RESULT, 2 goto_eq Route117_PokemonDayCare_EventScript_291DCA copyvar VAR_0x8004, VAR_RESULT - specialvar VAR_RESULT, sub_806FDC4 + specialvar VAR_RESULT, TakePokemonFromDaycare msgbox Route117_PokemonDayCare_Text_292575, 4 msgbox Route117_PokemonDayCare_Text_292476, 4 release diff --git a/data/scripts/maps/Route117.inc b/data/scripts/maps/Route117.inc index 23551d372..01463516b 100644 --- a/data/scripts/maps/Route117.inc +++ b/data/scripts/maps/Route117.inc @@ -7,7 +7,7 @@ Route117_MapScript1_1F3983: @ 81F3983 end Route117_EventScript_1F3989:: @ 81F3989 - checkflag FLAG_0x086 + checkflag FLAG_PENDING_DAYCARE_EGG goto_if 0, Route117_EventScript_1F3999 setobjectxyperm 3, 47, 6 diff --git a/data/specials.inc b/data/specials.inc index dd75cd7ca..eacb4dafb 100644 --- a/data/specials.inc +++ b/data/specials.inc @@ -191,18 +191,18 @@ gSpecials:: @ 81DBA64 def_special GabbyAndTyGetLastBattleTrivia def_special GabbyAndTySetScriptVarsToFieldObjectLocalIds def_special sub_8138B80 - def_special sp0B5_daycare - def_special sp0B6_daycare - def_special sub_8070728 - def_special sp0B8_daycare - def_special sp0B9_daycare_relationship_comment - def_special sub_8070C58 - def_special daycare_send_selected_pokemon - def_special sub_8071330 - def_special sub_80712C0 - def_special sub_806FF30 - def_special sub_806FED8 - def_special sub_806FDC4 + def_special GetDaycareMonNicknames + def_special GetDaycareState + def_special RejectEggFromDayCare + def_special GiveEggFromDaycare + def_special SetDaycareCompatibilityString + def_special GetSelectedMonNickAndSpecies + def_special StoreSelectedPokemonInDaycare + def_special ChooseSendDaycareMon + def_special ShowDaycareLevelMenu + def_special GetNumLevelsGainedFromDaycare + def_special GetDaycareCost + def_special TakePokemonFromDaycare def_special ScriptHatchMon def_special EggHatch def_special sub_8071614 @@ -534,4 +534,3 @@ gSpecials:: @ 81DBA64 def_special sub_813C5A0 def_special sub_8139C10 def_special sub_80B3BC4 - diff --git a/data/strings.s b/data/strings.s index ba32469bf..484c26d6e 100644 --- a/data/strings.s +++ b/data/strings.s @@ -5121,16 +5121,16 @@ gText_YouDontHaveThreeCoins:: @ 85EF734 gText_ReelTimeHelp:: @ 85EF750 .string "REEL TIME\nHere’s your chance to take\naim and nail marks!\nReel Time continues for the\nawarded number of spins.\nIt all ends on a Big Bonus.$" -gUnknown_085EF7DA:: @ 85EF7DA +gDaycareText_GetAlongVeryWell:: @ 85EF7DA .string "The two seem to get along\nvery well.$" -gUnknown_085EF7FF:: @ 85EF7FF +gDaycareText_GetAlong:: @ 85EF7FF .string "The two seem to get along.$" -gUnknown_085EF81A:: @ 85EF81A +gDaycareText_DontLikeOther:: @ 85EF81A .string "The two don’t seem to like\neach other much.$" -gUnknown_085EF846:: @ 85EF846 +gDaycareText_PlayOther:: @ 85EF846 .string "The two prefer to play with other\nPOKéMON than each other.$" gText_NewLine2:: @ 85EF881 diff --git a/data/trade.s b/data/trade.s index 601b597ed..3150269b0 100644 --- a/data/trade.s +++ b/data/trade.s @@ -19,13 +19,13 @@ gUnknown_0832D2BC:: @ 832D2BC gUnknown_0832DABC:: @ 832DABC .incbin "baserom.gba", 0x32dabc, 0xb -gUnknown_0832DAC7:: @ 832DAC7 - .incbin "baserom.gba", 0x32dac7, 0x2 +gText_MaleSymbol4:: @ 832DAC7 + .string "♂$" -gUnknown_0832DAC9:: @ 832DAC9 - .incbin "baserom.gba", 0x32dac9, 0x2 +gText_FemaleSymbol4:: @ 832DAC9 + .string "♀$" -gUnknown_0832DACB:: @ 832DACB +gText_GenderlessSymbol:: @ 832DACB .incbin "baserom.gba", 0x32dacb, 0x7 gUnknown_0832DAD2:: @ 832DAD2 diff --git a/include/data/pokemon/egg_moves.h b/include/data/pokemon/egg_moves.h new file mode 100644 index 000000000..3d74868b4 --- /dev/null +++ b/include/data/pokemon/egg_moves.h @@ -0,0 +1,1315 @@ +#ifndef POKEEMERALD_DAYCARE_H +#define POKEEMERALD_DAYCARE_H + +#define EGG_MOVES_SPECIES_OFFSET 20000 +#define EGG_MOVES_TERMINATOR 0xFFFF +#define egg_moves(species, moves...) (SPECIES_##species + EGG_MOVES_SPECIES_OFFSET), moves + +#endif // POKEEMERALD_DAYCARE_H + +const u16 gEggMoves[] = { + egg_moves(BULBASAUR, + MOVE_LIGHT_SCREEN, + MOVE_SKULL_BASH, + MOVE_SAFEGUARD, + MOVE_CHARM, + MOVE_PETAL_DANCE, + MOVE_MAGICAL_LEAF, + MOVE_GRASS_WHISTLE, + MOVE_CURSE), + + egg_moves(CHARMANDER, + MOVE_BELLY_DRUM, + MOVE_ANCIENT_POWER, + MOVE_ROCK_SLIDE, + MOVE_BITE, + MOVE_OUTRAGE, + MOVE_BEAT_UP, + MOVE_SWORDS_DANCE, + MOVE_DRAGON_DANCE), + + egg_moves(SQUIRTLE, + MOVE_MIRROR_COAT, + MOVE_HAZE, + MOVE_MIST, + MOVE_FORESIGHT, + MOVE_FLAIL, + MOVE_REFRESH, + MOVE_MUD_SPORT, + MOVE_YAWN), + + egg_moves(PIDGEY, + MOVE_PURSUIT, + MOVE_FAINT_ATTACK, + MOVE_FORESIGHT, + MOVE_STEEL_WING, + MOVE_AIR_CUTTER), + + egg_moves(RATTATA, + MOVE_SCREECH, + MOVE_FLAME_WHEEL, + MOVE_FURY_SWIPES, + MOVE_BITE, + MOVE_COUNTER, + MOVE_REVERSAL, + MOVE_UPROAR, + MOVE_SWAGGER), + + egg_moves(SPEAROW, + MOVE_FAINT_ATTACK, + MOVE_FALSE_SWIPE, + MOVE_SCARY_FACE, + MOVE_QUICK_ATTACK, + MOVE_TRI_ATTACK, + MOVE_ASTONISH, + MOVE_SKY_ATTACK), + + egg_moves(EKANS, + MOVE_PURSUIT, + MOVE_SLAM, + MOVE_SPITE, + MOVE_BEAT_UP, + MOVE_POISON_FANG), + + egg_moves(SANDSHREW, + MOVE_FLAIL, + MOVE_SAFEGUARD, + MOVE_COUNTER, + MOVE_RAPID_SPIN, + MOVE_ROCK_SLIDE, + MOVE_METAL_CLAW, + MOVE_SWORDS_DANCE, + MOVE_CRUSH_CLAW), + + egg_moves(NIDORAN_F, + MOVE_SUPERSONIC, + MOVE_DISABLE, + MOVE_TAKE_DOWN, + MOVE_FOCUS_ENERGY, + MOVE_CHARM, + MOVE_COUNTER, + MOVE_BEAT_UP), + + egg_moves(NIDORAN_M, + MOVE_COUNTER, + MOVE_DISABLE, + MOVE_SUPERSONIC, + MOVE_TAKE_DOWN, + MOVE_AMNESIA, + MOVE_CONFUSION, + MOVE_BEAT_UP), + + egg_moves(VULPIX, + MOVE_FAINT_ATTACK, + MOVE_HYPNOSIS, + MOVE_FLAIL, + MOVE_SPITE, + MOVE_DISABLE, + MOVE_HOWL, + MOVE_PSYCH_UP, + MOVE_HEAT_WAVE), + + egg_moves(ZUBAT, + MOVE_QUICK_ATTACK, + MOVE_PURSUIT, + MOVE_FAINT_ATTACK, + MOVE_GUST, + MOVE_WHIRLWIND, + MOVE_CURSE), + + egg_moves(ODDISH, + MOVE_SWORDS_DANCE, + MOVE_RAZOR_LEAF, + MOVE_FLAIL, + MOVE_SYNTHESIS, + MOVE_CHARM, + MOVE_INGRAIN), + + egg_moves(PARAS, + MOVE_FALSE_SWIPE, + MOVE_SCREECH, + MOVE_COUNTER, + MOVE_PSYBEAM, + MOVE_FLAIL, + MOVE_SWEET_SCENT, + MOVE_LIGHT_SCREEN, + MOVE_PURSUIT), + + egg_moves(VENONAT, + MOVE_BATON_PASS, + MOVE_SCREECH, + MOVE_GIGA_DRAIN, + MOVE_SIGNAL_BEAM), + + egg_moves(DIGLETT, + MOVE_FAINT_ATTACK, + MOVE_SCREECH, + MOVE_ANCIENT_POWER, + MOVE_PURSUIT, + MOVE_BEAT_UP, + MOVE_UPROAR, + MOVE_ROCK_SLIDE), + + egg_moves(MEOWTH, + MOVE_SPITE, + MOVE_CHARM, + MOVE_HYPNOSIS, + MOVE_AMNESIA, + MOVE_PSYCH_UP, + MOVE_ASSIST), + + egg_moves(PSYDUCK, + MOVE_HYPNOSIS, + MOVE_PSYBEAM, + MOVE_FORESIGHT, + MOVE_LIGHT_SCREEN, + MOVE_FUTURE_SIGHT, + MOVE_PSYCHIC, + MOVE_CROSS_CHOP, + MOVE_REFRESH), + + egg_moves(MANKEY, + MOVE_ROCK_SLIDE, + MOVE_FORESIGHT, + MOVE_MEDITATE, + MOVE_COUNTER, + MOVE_REVERSAL, + MOVE_BEAT_UP, + MOVE_REVENGE, + MOVE_SMELLING_SALT), + + egg_moves(GROWLITHE, + MOVE_BODY_SLAM, + MOVE_SAFEGUARD, + MOVE_CRUNCH, + MOVE_THRASH, + MOVE_FIRE_SPIN, + MOVE_HOWL, + MOVE_HEAT_WAVE), + + egg_moves(POLIWAG, + MOVE_MIST, + MOVE_SPLASH, + MOVE_BUBBLE_BEAM, + MOVE_HAZE, + MOVE_MIND_READER, + MOVE_WATER_SPORT, + MOVE_ICE_BALL), + + egg_moves(ABRA, + MOVE_ENCORE, + MOVE_BARRIER, + MOVE_KNOCK_OFF, + MOVE_FIRE_PUNCH, + MOVE_THUNDER_PUNCH, + MOVE_ICE_PUNCH), + + egg_moves(MACHOP, + MOVE_LIGHT_SCREEN, + MOVE_MEDITATE, + MOVE_ROLLING_KICK, + MOVE_ENCORE, + MOVE_SMELLING_SALT, + MOVE_COUNTER, + MOVE_ROCK_SLIDE), + + egg_moves(BELLSPROUT, + MOVE_SWORDS_DANCE, + MOVE_ENCORE, + MOVE_REFLECT, + MOVE_SYNTHESIS, + MOVE_LEECH_LIFE, + MOVE_INGRAIN, + MOVE_MAGICAL_LEAF), + + egg_moves(TENTACOOL, + MOVE_AURORA_BEAM, + MOVE_MIRROR_COAT, + MOVE_RAPID_SPIN, + MOVE_HAZE, + MOVE_SAFEGUARD, + MOVE_CONFUSE_RAY), + + egg_moves(GEODUDE, + MOVE_MEGA_PUNCH, + MOVE_ROCK_SLIDE, + MOVE_BLOCK), + + egg_moves(PONYTA, + MOVE_FLAME_WHEEL, + MOVE_THRASH, + MOVE_DOUBLE_KICK, + MOVE_HYPNOSIS, + MOVE_CHARM, + MOVE_DOUBLE_EDGE), + + egg_moves(SLOWPOKE, + MOVE_SAFEGUARD, + MOVE_BELLY_DRUM, + MOVE_FUTURE_SIGHT, + MOVE_STOMP, + MOVE_MUD_SPORT, + MOVE_SLEEP_TALK, + MOVE_SNORE), + + egg_moves(FARFETCHD, + MOVE_STEEL_WING, + MOVE_FORESIGHT, + MOVE_MIRROR_MOVE, + MOVE_GUST, + MOVE_QUICK_ATTACK, + MOVE_FLAIL, + MOVE_FEATHER_DANCE, + MOVE_CURSE), + + egg_moves(DODUO, + MOVE_QUICK_ATTACK, + MOVE_SUPERSONIC, + MOVE_HAZE, + MOVE_FAINT_ATTACK, + MOVE_FLAIL, + MOVE_ENDEAVOR), + + egg_moves(SEEL, + MOVE_LICK, + MOVE_PERISH_SONG, + MOVE_DISABLE, + MOVE_HORN_DRILL, + MOVE_SLAM, + MOVE_ENCORE, + MOVE_FAKE_OUT, + MOVE_ICICLE_SPEAR), + + egg_moves(GRIMER, + MOVE_HAZE, + MOVE_MEAN_LOOK, + MOVE_LICK, + MOVE_IMPRISON, + MOVE_CURSE, + MOVE_SHADOW_PUNCH, + MOVE_EXPLOSION), + + egg_moves(SHELLDER, + MOVE_BUBBLE_BEAM, + MOVE_TAKE_DOWN, + MOVE_BARRIER, + MOVE_RAPID_SPIN, + MOVE_SCREECH, + MOVE_ICICLE_SPEAR), + + egg_moves(GASTLY, + MOVE_PSYWAVE, + MOVE_PERISH_SONG, + MOVE_HAZE, + MOVE_ASTONISH, + MOVE_WILL_O_WISP, + MOVE_GRUDGE, + MOVE_EXPLOSION), + + egg_moves(ONIX, + MOVE_ROCK_SLIDE, + MOVE_FLAIL, + MOVE_EXPLOSION, + MOVE_BLOCK), + + egg_moves(DROWZEE, + MOVE_BARRIER, + MOVE_ASSIST, + MOVE_ROLE_PLAY, + MOVE_FIRE_PUNCH, + MOVE_THUNDER_PUNCH, + MOVE_ICE_PUNCH), + + egg_moves(KRABBY, + MOVE_DIG, + MOVE_HAZE, + MOVE_AMNESIA, + MOVE_FLAIL, + MOVE_SLAM, + MOVE_KNOCK_OFF, + MOVE_SWORDS_DANCE), + + egg_moves(EXEGGCUTE, + MOVE_SYNTHESIS, + MOVE_MOONLIGHT, + MOVE_REFLECT, + MOVE_ANCIENT_POWER, + MOVE_PSYCH_UP, + MOVE_INGRAIN, + MOVE_CURSE), + + egg_moves(CUBONE, + MOVE_ROCK_SLIDE, + MOVE_ANCIENT_POWER, + MOVE_BELLY_DRUM, + MOVE_SCREECH, + MOVE_SKULL_BASH, + MOVE_PERISH_SONG, + MOVE_SWORDS_DANCE), + + egg_moves(LICKITUNG, + MOVE_BELLY_DRUM, + MOVE_MAGNITUDE, + MOVE_BODY_SLAM, + MOVE_CURSE, + MOVE_SMELLING_SALT, + MOVE_SLEEP_TALK, + MOVE_SNORE, + MOVE_SUBSTITUTE), + + egg_moves(KOFFING, + MOVE_SCREECH, + MOVE_PSYWAVE, + MOVE_PSYBEAM, + MOVE_DESTINY_BOND, + MOVE_PAIN_SPLIT, + MOVE_WILL_O_WISP), + + egg_moves(RHYHORN, + MOVE_CRUNCH, + MOVE_REVERSAL, + MOVE_ROCK_SLIDE, + MOVE_COUNTER, + MOVE_MAGNITUDE, + MOVE_SWORDS_DANCE, + MOVE_CURSE, + MOVE_CRUSH_CLAW), + + egg_moves(CHANSEY, + MOVE_PRESENT, + MOVE_METRONOME, + MOVE_HEAL_BELL, + MOVE_AROMATHERAPY, + MOVE_SUBSTITUTE), + + egg_moves(TANGELA, + MOVE_FLAIL, + MOVE_CONFUSION, + MOVE_MEGA_DRAIN, + MOVE_REFLECT, + MOVE_AMNESIA, + MOVE_LEECH_SEED, + MOVE_NATURE_POWER), + + egg_moves(KANGASKHAN, + MOVE_STOMP, + MOVE_FORESIGHT, + MOVE_FOCUS_ENERGY, + MOVE_SAFEGUARD, + MOVE_DISABLE, + MOVE_COUNTER, + MOVE_CRUSH_CLAW, + MOVE_SUBSTITUTE), + + egg_moves(HORSEA, + MOVE_FLAIL, + MOVE_AURORA_BEAM, + MOVE_OCTAZOOKA, + MOVE_DISABLE, + MOVE_SPLASH, + MOVE_DRAGON_RAGE, + MOVE_DRAGON_BREATH), + + egg_moves(GOLDEEN, + MOVE_PSYBEAM, + MOVE_HAZE, + MOVE_HYDRO_PUMP, + MOVE_SLEEP_TALK, + MOVE_MUD_SPORT), + + egg_moves(MR_MIME, + MOVE_FUTURE_SIGHT, + MOVE_HYPNOSIS, + MOVE_MIMIC, + MOVE_PSYCH_UP, + MOVE_FAKE_OUT, + MOVE_TRICK), + + egg_moves(SCYTHER, + MOVE_COUNTER, + MOVE_SAFEGUARD, + MOVE_BATON_PASS, + MOVE_RAZOR_WIND, + MOVE_REVERSAL, + MOVE_LIGHT_SCREEN, + MOVE_ENDURE, + MOVE_SILVER_WIND), + + egg_moves(PINSIR, + MOVE_FURY_ATTACK, + MOVE_FLAIL, + MOVE_FALSE_SWIPE, + MOVE_FAINT_ATTACK), + + egg_moves(LAPRAS, + MOVE_FORESIGHT, + MOVE_SUBSTITUTE, + MOVE_TICKLE, + MOVE_REFRESH, + MOVE_DRAGON_DANCE, + MOVE_CURSE, + MOVE_SLEEP_TALK, + MOVE_HORN_DRILL), + + egg_moves(EEVEE, + MOVE_CHARM, + MOVE_FLAIL, + MOVE_ENDURE, + MOVE_CURSE, + MOVE_TICKLE, + MOVE_WISH), + + egg_moves(OMANYTE, + MOVE_BUBBLE_BEAM, + MOVE_AURORA_BEAM, + MOVE_SLAM, + MOVE_SUPERSONIC, + MOVE_HAZE, + MOVE_ROCK_SLIDE, + MOVE_SPIKES), + + egg_moves(KABUTO, + MOVE_BUBBLE_BEAM, + MOVE_AURORA_BEAM, + MOVE_RAPID_SPIN, + MOVE_DIG, + MOVE_FLAIL, + MOVE_KNOCK_OFF, + MOVE_CONFUSE_RAY), + + egg_moves(AERODACTYL, + MOVE_WHIRLWIND, + MOVE_PURSUIT, + MOVE_FORESIGHT, + MOVE_STEEL_WING, + MOVE_DRAGON_BREATH, + MOVE_CURSE), + + egg_moves(SNORLAX, + MOVE_LICK, + MOVE_CHARM, + MOVE_DOUBLE_EDGE, + MOVE_CURSE, + MOVE_FISSURE, + MOVE_SUBSTITUTE), + + egg_moves(DRATINI, + MOVE_LIGHT_SCREEN, + MOVE_MIST, + MOVE_HAZE, + MOVE_SUPERSONIC, + MOVE_DRAGON_BREATH, + MOVE_DRAGON_DANCE), + + egg_moves(CHIKORITA, + MOVE_VINE_WHIP, + MOVE_LEECH_SEED, + MOVE_COUNTER, + MOVE_ANCIENT_POWER, + MOVE_FLAIL, + MOVE_NATURE_POWER, + MOVE_INGRAIN, + MOVE_GRASS_WHISTLE), + + egg_moves(CYNDAQUIL, + MOVE_FURY_SWIPES, + MOVE_QUICK_ATTACK, + MOVE_REVERSAL, + MOVE_THRASH, + MOVE_FORESIGHT, + MOVE_COVET, + MOVE_HOWL, + MOVE_CRUSH_CLAW), + + egg_moves(TOTODILE, + MOVE_CRUNCH, + MOVE_THRASH, + MOVE_HYDRO_PUMP, + MOVE_ANCIENT_POWER, + MOVE_ROCK_SLIDE, + MOVE_MUD_SPORT, + MOVE_WATER_SPORT, + MOVE_DRAGON_CLAW), + + egg_moves(SENTRET, + MOVE_DOUBLE_EDGE, + MOVE_PURSUIT, + MOVE_SLASH, + MOVE_FOCUS_ENERGY, + MOVE_REVERSAL, + MOVE_SUBSTITUTE, + MOVE_TRICK, + MOVE_ASSIST), + + egg_moves(HOOTHOOT, + MOVE_MIRROR_MOVE, + MOVE_SUPERSONIC, + MOVE_FAINT_ATTACK, + MOVE_WING_ATTACK, + MOVE_WHIRLWIND, + MOVE_SKY_ATTACK, + MOVE_FEATHER_DANCE), + + egg_moves(LEDYBA, + MOVE_PSYBEAM, + MOVE_BIDE, + MOVE_SILVER_WIND), + + egg_moves(SPINARAK, + MOVE_PSYBEAM, + MOVE_DISABLE, + MOVE_SONIC_BOOM, + MOVE_BATON_PASS, + MOVE_PURSUIT, + MOVE_SIGNAL_BEAM), + + egg_moves(CHINCHOU, + MOVE_FLAIL, + MOVE_SCREECH, + MOVE_AMNESIA), + + egg_moves(PICHU, + MOVE_REVERSAL, + MOVE_BIDE, + MOVE_PRESENT, + MOVE_ENCORE, + MOVE_DOUBLE_SLAP, + MOVE_WISH, + MOVE_CHARGE), + + egg_moves(CLEFFA, + MOVE_PRESENT, + MOVE_METRONOME, + MOVE_AMNESIA, + MOVE_BELLY_DRUM, + MOVE_SPLASH, + MOVE_MIMIC, + MOVE_WISH, + MOVE_SUBSTITUTE), + + egg_moves(IGGLYBUFF, + MOVE_PERISH_SONG, + MOVE_PRESENT, + MOVE_FAINT_ATTACK, + MOVE_WISH, + MOVE_FAKE_TEARS), + + egg_moves(TOGEPI, + MOVE_PRESENT, + MOVE_MIRROR_MOVE, + MOVE_PECK, + MOVE_FORESIGHT, + MOVE_FUTURE_SIGHT, + MOVE_SUBSTITUTE, + MOVE_PSYCH_UP), + + egg_moves(NATU, + MOVE_HAZE, + MOVE_DRILL_PECK, + MOVE_QUICK_ATTACK, + MOVE_FAINT_ATTACK, + MOVE_STEEL_WING, + MOVE_PSYCH_UP, + MOVE_FEATHER_DANCE, + MOVE_REFRESH), + + egg_moves(MAREEP, + MOVE_TAKE_DOWN, + MOVE_BODY_SLAM, + MOVE_SAFEGUARD, + MOVE_SCREECH, + MOVE_REFLECT, + MOVE_ODOR_SLEUTH, + MOVE_CHARGE), + + egg_moves(MARILL, + MOVE_LIGHT_SCREEN, + MOVE_PRESENT, + MOVE_AMNESIA, + MOVE_FUTURE_SIGHT, + MOVE_BELLY_DRUM, + MOVE_PERISH_SONG, + MOVE_SUPERSONIC, + MOVE_SUBSTITUTE), + + egg_moves(SUDOWOODO, + MOVE_SELF_DESTRUCT), + + egg_moves(HOPPIP, + MOVE_CONFUSION, + MOVE_ENCORE, + MOVE_DOUBLE_EDGE, + MOVE_REFLECT, + MOVE_AMNESIA, + MOVE_HELPING_HAND, + MOVE_PSYCH_UP), + + egg_moves(AIPOM, + MOVE_COUNTER, + MOVE_SCREECH, + MOVE_PURSUIT, + MOVE_AGILITY, + MOVE_SPITE, + MOVE_SLAM, + MOVE_DOUBLE_SLAP, + MOVE_BEAT_UP), + + egg_moves(SUNKERN, + MOVE_GRASS_WHISTLE, + MOVE_ENCORE, + MOVE_LEECH_SEED, + MOVE_NATURE_POWER, + MOVE_CURSE, + MOVE_HELPING_HAND), + + egg_moves(YANMA, + MOVE_WHIRLWIND, + MOVE_REVERSAL, + MOVE_LEECH_LIFE, + MOVE_SIGNAL_BEAM, + MOVE_SILVER_WIND), + + egg_moves(WOOPER, + MOVE_BODY_SLAM, + MOVE_ANCIENT_POWER, + MOVE_SAFEGUARD, + MOVE_CURSE, + MOVE_MUD_SPORT, + MOVE_STOCKPILE, + MOVE_SWALLOW, + MOVE_SPIT_UP), + + egg_moves(MURKROW, + MOVE_WHIRLWIND, + MOVE_DRILL_PECK, + MOVE_MIRROR_MOVE, + MOVE_WING_ATTACK, + MOVE_SKY_ATTACK, + MOVE_CONFUSE_RAY, + MOVE_FEATHER_DANCE, + MOVE_PERISH_SONG), + + egg_moves(MISDREAVUS, + MOVE_SCREECH, + MOVE_DESTINY_BOND, + MOVE_PSYCH_UP, + MOVE_IMPRISON), + + egg_moves(GIRAFARIG, + MOVE_TAKE_DOWN, + MOVE_AMNESIA, + MOVE_FORESIGHT, + MOVE_FUTURE_SIGHT, + MOVE_BEAT_UP, + MOVE_PSYCH_UP, + MOVE_WISH, + MOVE_MAGIC_COAT), + + egg_moves(PINECO, + MOVE_REFLECT, + MOVE_PIN_MISSILE, + MOVE_FLAIL, + MOVE_SWIFT, + MOVE_COUNTER, + MOVE_SAND_TOMB), + + egg_moves(DUNSPARCE, + MOVE_BIDE, + MOVE_ANCIENT_POWER, + MOVE_ROCK_SLIDE, + MOVE_BITE, + MOVE_HEADBUTT, + MOVE_ASTONISH, + MOVE_CURSE), + + egg_moves(GLIGAR, + MOVE_METAL_CLAW, + MOVE_WING_ATTACK, + MOVE_RAZOR_WIND, + MOVE_COUNTER, + MOVE_SAND_TOMB), + + egg_moves(SNUBBULL, + MOVE_METRONOME, + MOVE_FAINT_ATTACK, + MOVE_REFLECT, + MOVE_PRESENT, + MOVE_CRUNCH, + MOVE_HEAL_BELL, + MOVE_SNORE, + MOVE_SMELLING_SALT), + + egg_moves(QWILFISH, + MOVE_FLAIL, + MOVE_HAZE, + MOVE_BUBBLE_BEAM, + MOVE_SUPERSONIC, + MOVE_ASTONISH), + + egg_moves(SHUCKLE, + MOVE_SWEET_SCENT), + + egg_moves(HERACROSS, + MOVE_HARDEN, + MOVE_BIDE, + MOVE_FLAIL, + MOVE_FALSE_SWIPE), + + egg_moves(SNEASEL, + MOVE_COUNTER, + MOVE_SPITE, + MOVE_FORESIGHT, + MOVE_REFLECT, + MOVE_BITE, + MOVE_CRUSH_CLAW, + MOVE_FAKE_OUT), + + egg_moves(TEDDIURSA, + MOVE_CRUNCH, + MOVE_TAKE_DOWN, + MOVE_SEISMIC_TOSS, + MOVE_COUNTER, + MOVE_METAL_CLAW, + MOVE_FAKE_TEARS, + MOVE_YAWN, + MOVE_SLEEP_TALK), + + egg_moves(SLUGMA, + MOVE_ACID_ARMOR, + MOVE_HEAT_WAVE), + + egg_moves(SWINUB, + MOVE_TAKE_DOWN, + MOVE_BITE, + MOVE_BODY_SLAM, + MOVE_ROCK_SLIDE, + MOVE_ANCIENT_POWER, + MOVE_MUD_SHOT, + MOVE_ICICLE_SPEAR, + MOVE_DOUBLE_EDGE), + + egg_moves(CORSOLA, + MOVE_ROCK_SLIDE, + MOVE_SCREECH, + MOVE_MIST, + MOVE_AMNESIA, + MOVE_BARRIER, + MOVE_INGRAIN, + MOVE_CONFUSE_RAY, + MOVE_ICICLE_SPEAR), + + egg_moves(REMORAID, + MOVE_AURORA_BEAM, + MOVE_OCTAZOOKA, + MOVE_SUPERSONIC, + MOVE_HAZE, + MOVE_SCREECH, + MOVE_THUNDER_WAVE, + MOVE_ROCK_BLAST), + + egg_moves(DELIBIRD, + MOVE_AURORA_BEAM, + MOVE_QUICK_ATTACK, + MOVE_FUTURE_SIGHT, + MOVE_SPLASH, + MOVE_RAPID_SPIN, + MOVE_ICE_BALL), + + egg_moves(MANTINE, + MOVE_TWISTER, + MOVE_HYDRO_PUMP, + MOVE_HAZE, + MOVE_SLAM, + MOVE_MUD_SPORT, + MOVE_ROCK_SLIDE), + + egg_moves(SKARMORY, + MOVE_DRILL_PECK, + MOVE_PURSUIT, + MOVE_WHIRLWIND, + MOVE_SKY_ATTACK, + MOVE_CURSE), + + egg_moves(HOUNDOUR, + MOVE_FIRE_SPIN, + MOVE_RAGE, + MOVE_PURSUIT, + MOVE_COUNTER, + MOVE_SPITE, + MOVE_REVERSAL, + MOVE_BEAT_UP, + MOVE_WILL_O_WISP), + + egg_moves(PHANPY, + MOVE_FOCUS_ENERGY, + MOVE_BODY_SLAM, + MOVE_ANCIENT_POWER, + MOVE_SNORE, + MOVE_COUNTER, + MOVE_FISSURE), + + egg_moves(STANTLER, + MOVE_SPITE, + MOVE_DISABLE, + MOVE_BITE, + MOVE_SWAGGER, + MOVE_PSYCH_UP, + MOVE_EXTRASENSORY), + + egg_moves(TYROGUE, + MOVE_RAPID_SPIN, + MOVE_HI_JUMP_KICK, + MOVE_MACH_PUNCH, + MOVE_MIND_READER, + MOVE_HELPING_HAND), + + egg_moves(SMOOCHUM, + MOVE_MEDITATE, + MOVE_PSYCH_UP, + MOVE_FAKE_OUT, + MOVE_WISH, + MOVE_ICE_PUNCH), + + egg_moves(ELEKID, + MOVE_KARATE_CHOP, + MOVE_BARRIER, + MOVE_ROLLING_KICK, + MOVE_MEDITATE, + MOVE_CROSS_CHOP, + MOVE_FIRE_PUNCH, + MOVE_ICE_PUNCH), + + egg_moves(MAGBY, + MOVE_KARATE_CHOP, + MOVE_MEGA_PUNCH, + MOVE_BARRIER, + MOVE_SCREECH, + MOVE_CROSS_CHOP, + MOVE_THUNDER_PUNCH), + + egg_moves(MILTANK, + MOVE_PRESENT, + MOVE_REVERSAL, + MOVE_SEISMIC_TOSS, + MOVE_ENDURE, + MOVE_PSYCH_UP, + MOVE_CURSE, + MOVE_HELPING_HAND, + MOVE_SLEEP_TALK), + + egg_moves(LARVITAR, + MOVE_PURSUIT, + MOVE_STOMP, + MOVE_OUTRAGE, + MOVE_FOCUS_ENERGY, + MOVE_ANCIENT_POWER, + MOVE_DRAGON_DANCE, + MOVE_CURSE), + + egg_moves(TREECKO, + MOVE_CRUNCH, + MOVE_MUD_SPORT, + MOVE_ENDEAVOR, + MOVE_LEECH_SEED, + MOVE_DRAGON_BREATH, + MOVE_CRUSH_CLAW), + + egg_moves(TORCHIC, + MOVE_COUNTER, + MOVE_REVERSAL, + MOVE_ENDURE, + MOVE_SWAGGER, + MOVE_ROCK_SLIDE, + MOVE_SMELLING_SALT), + + egg_moves(MUDKIP, + MOVE_REFRESH, + MOVE_UPROAR, + MOVE_CURSE, + MOVE_STOMP, + MOVE_ICE_BALL, + MOVE_MIRROR_COAT), + + egg_moves(POOCHYENA, + MOVE_ASTONISH, + MOVE_POISON_FANG, + MOVE_COVET, + MOVE_LEER, + MOVE_YAWN), + + egg_moves(ZIGZAGOON, + MOVE_CHARM, + MOVE_PURSUIT, + MOVE_SUBSTITUTE, + MOVE_TICKLE, + MOVE_TRICK), + + egg_moves(LOTAD, + MOVE_SYNTHESIS, + MOVE_RAZOR_LEAF, + MOVE_SWEET_SCENT, + MOVE_LEECH_SEED, + MOVE_FLAIL, + MOVE_WATER_GUN), + + egg_moves(SEEDOT, + MOVE_LEECH_SEED, + MOVE_AMNESIA, + MOVE_QUICK_ATTACK, + MOVE_RAZOR_WIND, + MOVE_TAKE_DOWN, + MOVE_FALSE_SWIPE), + + egg_moves(NINCADA, + MOVE_ENDURE, + MOVE_FAINT_ATTACK, + MOVE_GUST, + MOVE_SILVER_WIND), + + egg_moves(TAILLOW, + MOVE_PURSUIT, + MOVE_SUPERSONIC, + MOVE_REFRESH, + MOVE_MIRROR_MOVE, + MOVE_RAGE, + MOVE_SKY_ATTACK), + + egg_moves(SHROOMISH, + MOVE_FAKE_TEARS, + MOVE_SWAGGER, + MOVE_CHARM, + MOVE_FALSE_SWIPE, + MOVE_HELPING_HAND), + + egg_moves(SPINDA, + MOVE_ENCORE, + MOVE_ROCK_SLIDE, + MOVE_ASSIST, + MOVE_DISABLE, + MOVE_BATON_PASS, + MOVE_WISH, + MOVE_TRICK, + MOVE_SMELLING_SALT), + + egg_moves(WINGULL, + MOVE_MIST, + MOVE_TWISTER, + MOVE_AGILITY, + MOVE_GUST, + MOVE_WATER_SPORT), + + egg_moves(SURSKIT, + MOVE_FORESIGHT, + MOVE_MUD_SHOT, + MOVE_PSYBEAM, + MOVE_HYDRO_PUMP, + MOVE_MIND_READER), + + egg_moves(WAILMER, + MOVE_DOUBLE_EDGE, + MOVE_THRASH, + MOVE_SWAGGER, + MOVE_SNORE, + MOVE_SLEEP_TALK, + MOVE_CURSE, + MOVE_FISSURE, + MOVE_TICKLE), + + egg_moves(SKITTY, + MOVE_HELPING_HAND, + MOVE_PSYCH_UP, + MOVE_UPROAR, + MOVE_FAKE_TEARS, + MOVE_WISH, + MOVE_BATON_PASS, + MOVE_SUBSTITUTE, + MOVE_TICKLE), + + egg_moves(KECLEON, + MOVE_DISABLE, + MOVE_MAGIC_COAT, + MOVE_TRICK), + + egg_moves(NOSEPASS, + MOVE_MAGNITUDE, + MOVE_ROLLOUT, + MOVE_EXPLOSION), + + egg_moves(TORKOAL, + MOVE_ERUPTION, + MOVE_ENDURE, + MOVE_SLEEP_TALK, + MOVE_YAWN), + + egg_moves(SABLEYE, + MOVE_PSYCH_UP, + MOVE_RECOVER, + MOVE_MOONLIGHT), + + egg_moves(BARBOACH, + MOVE_THRASH, + MOVE_WHIRLPOOL, + MOVE_SPARK), + + egg_moves(LUVDISC, + MOVE_SPLASH, + MOVE_SUPERSONIC, + MOVE_WATER_SPORT, + MOVE_MUD_SPORT), + + egg_moves(CORPHISH, + MOVE_MUD_SPORT, + MOVE_ENDEAVOR, + MOVE_BODY_SLAM, + MOVE_ANCIENT_POWER), + + egg_moves(FEEBAS, + MOVE_MIRROR_COAT, + MOVE_DRAGON_BREATH, + MOVE_MUD_SPORT, + MOVE_HYPNOSIS, + MOVE_LIGHT_SCREEN, + MOVE_CONFUSE_RAY), + + egg_moves(CARVANHA, + MOVE_HYDRO_PUMP, + MOVE_DOUBLE_EDGE, + MOVE_THRASH), + + egg_moves(TRAPINCH, + MOVE_FOCUS_ENERGY, + MOVE_QUICK_ATTACK, + MOVE_GUST), + + egg_moves(MAKUHITA, + MOVE_FAINT_ATTACK, + MOVE_DETECT, + MOVE_FORESIGHT, + MOVE_HELPING_HAND, + MOVE_CROSS_CHOP, + MOVE_REVENGE, + MOVE_DYNAMIC_PUNCH, + MOVE_COUNTER), + + egg_moves(ELECTRIKE, + MOVE_CRUNCH, + MOVE_HEADBUTT, + MOVE_UPROAR, + MOVE_CURSE, + MOVE_SWIFT), + + egg_moves(NUMEL, + MOVE_HOWL, + MOVE_SCARY_FACE, + MOVE_BODY_SLAM, + MOVE_ROLLOUT, + MOVE_DEFENSE_CURL, + MOVE_STOMP), + + egg_moves(SPHEAL, + MOVE_WATER_SPORT, + MOVE_STOCKPILE, + MOVE_SWALLOW, + MOVE_SPIT_UP, + MOVE_YAWN, + MOVE_ROCK_SLIDE, + MOVE_CURSE, + MOVE_FISSURE), + + egg_moves(CACNEA, + MOVE_GRASS_WHISTLE, + MOVE_ACID, + MOVE_TEETER_DANCE, + MOVE_DYNAMIC_PUNCH, + MOVE_COUNTER), + + egg_moves(SNORUNT, + MOVE_BLOCK, + MOVE_SPIKES), + + egg_moves(AZURILL, + MOVE_ENCORE, + MOVE_SING, + MOVE_REFRESH, + MOVE_SLAM, + MOVE_TICKLE), + + egg_moves(SPOINK, + MOVE_FUTURE_SIGHT, + MOVE_EXTRASENSORY, + MOVE_SUBSTITUTE, + MOVE_TRICK), + + egg_moves(PLUSLE, + MOVE_SUBSTITUTE, + MOVE_WISH), + + egg_moves(MINUN, + MOVE_SUBSTITUTE, + MOVE_WISH), + + egg_moves(MAWILE, + MOVE_SWORDS_DANCE, + MOVE_FALSE_SWIPE, + MOVE_POISON_FANG, + MOVE_PSYCH_UP, + MOVE_ANCIENT_POWER, + MOVE_TICKLE), + + egg_moves(MEDITITE, + MOVE_FIRE_PUNCH, + MOVE_THUNDER_PUNCH, + MOVE_ICE_PUNCH, + MOVE_FORESIGHT, + MOVE_FAKE_OUT, + MOVE_BATON_PASS, + MOVE_DYNAMIC_PUNCH), + + egg_moves(SWABLU, + MOVE_AGILITY, + MOVE_HAZE, + MOVE_PURSUIT, + MOVE_RAGE), + + egg_moves(DUSKULL, + MOVE_IMPRISON, + MOVE_DESTINY_BOND, + MOVE_PAIN_SPLIT, + MOVE_GRUDGE, + MOVE_MEMENTO, + MOVE_FAINT_ATTACK), + + egg_moves(ROSELIA, + MOVE_SPIKES, + MOVE_SYNTHESIS, + MOVE_PIN_MISSILE, + MOVE_COTTON_SPORE), + + egg_moves(SLAKOTH, + MOVE_PURSUIT, + MOVE_SLASH, + MOVE_BODY_SLAM, + MOVE_SNORE, + MOVE_CRUSH_CLAW, + MOVE_CURSE, + MOVE_SLEEP_TALK), + + egg_moves(GULPIN, + MOVE_DREAM_EATER, + MOVE_ACID_ARMOR, + MOVE_SMOG, + MOVE_PAIN_SPLIT), + + egg_moves(TROPIUS, + MOVE_HEADBUTT, + MOVE_SLAM, + MOVE_RAZOR_WIND, + MOVE_LEECH_SEED, + MOVE_NATURE_POWER), + + egg_moves(WHISMUR, + MOVE_TAKE_DOWN, + MOVE_SNORE, + MOVE_SWAGGER, + MOVE_EXTRASENSORY, + MOVE_SMELLING_SALT), + + egg_moves(CLAMPERL, + MOVE_REFRESH, + MOVE_MUD_SPORT, + MOVE_BODY_SLAM, + MOVE_SUPERSONIC, + MOVE_BARRIER, + MOVE_CONFUSE_RAY), + + egg_moves(ABSOL, + MOVE_BATON_PASS, + MOVE_FAINT_ATTACK, + MOVE_DOUBLE_EDGE, + MOVE_MAGIC_COAT, + MOVE_CURSE, + MOVE_SUBSTITUTE), + + egg_moves(SHUPPET, + MOVE_DISABLE, + MOVE_DESTINY_BOND, + MOVE_FORESIGHT, + MOVE_ASTONISH, + MOVE_IMPRISON), + + egg_moves(SEVIPER, + MOVE_STOCKPILE, + MOVE_SWALLOW, + MOVE_SPIT_UP, + MOVE_BODY_SLAM), + + egg_moves(ZANGOOSE, + MOVE_FLAIL, + MOVE_DOUBLE_KICK, + MOVE_RAZOR_WIND, + MOVE_COUNTER, + MOVE_ROAR, + MOVE_CURSE), + + egg_moves(RELICANTH, + MOVE_MAGNITUDE, + MOVE_SKULL_BASH, + MOVE_WATER_SPORT, + MOVE_AMNESIA, + MOVE_SLEEP_TALK, + MOVE_ROCK_SLIDE), + + egg_moves(ARON, + MOVE_ENDEAVOR, + MOVE_BODY_SLAM, + MOVE_STOMP, + MOVE_SMELLING_SALT), + + egg_moves(CASTFORM, + MOVE_FUTURE_SIGHT, + MOVE_PSYCH_UP), + + egg_moves(VOLBEAT, + MOVE_BATON_PASS, + MOVE_SILVER_WIND, + MOVE_TRICK), + + egg_moves(ILLUMISE, + MOVE_BATON_PASS, + MOVE_SILVER_WIND, + MOVE_GROWTH), + + egg_moves(LILEEP, + MOVE_BARRIER, + MOVE_RECOVER, + MOVE_MIRROR_COAT, + MOVE_ROCK_SLIDE), + + egg_moves(ANORITH, + MOVE_RAPID_SPIN, + MOVE_KNOCK_OFF, + MOVE_SWORDS_DANCE, + MOVE_ROCK_SLIDE), + + egg_moves(RALTS, + MOVE_DISABLE, + MOVE_WILL_O_WISP, + MOVE_MEAN_LOOK, + MOVE_MEMENTO, + MOVE_DESTINY_BOND), + + egg_moves(BAGON, + MOVE_HYDRO_PUMP, + MOVE_THRASH, + MOVE_DRAGON_RAGE, + MOVE_TWISTER, + MOVE_DRAGON_DANCE), + + egg_moves(CHIMECHO, + MOVE_DISABLE, + MOVE_CURSE, + MOVE_HYPNOSIS, + MOVE_DREAM_EATER), + + EGG_MOVES_TERMINATOR +}; diff --git a/include/daycare.h b/include/daycare.h new file mode 100644 index 000000000..7db44e024 --- /dev/null +++ b/include/daycare.h @@ -0,0 +1,27 @@ +#ifndef GUARD_DAYCARE_H +#define GUARD_DAYCARE_H + +#define EGG_HATCH_LEVEL 5 + +u8 *GetMonNick(struct Pokemon *mon, u8 *dest); +u8 *GetBoxMonNick(struct BoxPokemon *mon, u8 *dest); +u8 CountPokemonInDaycare(struct DayCare *daycare); +void InitDaycareMailRecordMixing(struct DayCare *daycare, struct RecordMixingDayCareMail *daycareMail); +void StoreSelectedPokemonInDaycare(void); +u16 TakePokemonFromDaycare(void); +void GetDaycareCost(void); +u8 GetNumLevelsGainedFromDaycare(void); +void TriggerPendingDaycareEgg(void); +void RejectEggFromDayCare(void); +void CreateEgg(struct Pokemon *mon, u16 species, bool8 setHotSpringsLocation); +void GiveEggFromDaycare(void); +bool8 DoEggActions_CheckHatch(void); +u16 GetSelectedMonNickAndSpecies(void); +void GetDaycareMonNicknames(void); +u8 GetDaycareState(void); +void SetDaycareCompatibilityString(void); +bool8 NameHasGenderSymbol(const u8 *name, u8 genderRatio); +void ShowDaycareLevelMenu(void); +void ChooseSendDaycareMon(void); + +#endif // GUARD_DAYCARE_H diff --git a/include/egg_hatch.h b/include/egg_hatch.h new file mode 100644 index 000000000..862d33947 --- /dev/null +++ b/include/egg_hatch.h @@ -0,0 +1,10 @@ +#ifndef GUARD_EGG_HATCH_H +#define GUARD_EGG_HATCH_H + +void ScriptHatchMon(void); +bool8 sub_8071614(void); +void EggHatch(void); +u8 GetEggStepsToSubtract(void); +u16 sub_80722E0(void); + +#endif // GUARD_EGG_HATCH_H diff --git a/include/flags.h b/include/flags.h index 2ffe3c96a..f8b55e3b8 100644 --- a/include/flags.h +++ b/include/flags.h @@ -1,7 +1,10 @@ #ifndef GUARD_FLAGS_H #define GUARD_FLAGS_H +#define FLAG_PENDING_DAYCARE_EGG 0x86 + #define FLAG_TRAINER_FLAG_START 0x500 + #define TRAINERS_FLAG_NO 0x356 #define CODE_FLAGS (FLAG_TRAINER_FLAG_START + TRAINERS_FLAG_NO + 0xA) // 0x860 diff --git a/include/global.h b/include/global.h index 8cfbc2289..799378008 100644 --- a/include/global.h +++ b/include/global.h @@ -168,9 +168,31 @@ struct BerryCrush u32 unk; }; +#define PLAYER_NAME_LENGTH 8 + +struct UnknownSaveBlock2Struct +{ + u8 field_0; + u8 field_1; + u8 field_2[2]; + u8 field_4[8]; + u8 field_C[16]; + u16 field_1C[6]; + u16 field_28[6]; + u8 field_34[176]; + u8 field_E4; + u8 field_E5; + u8 field_E6; + u8 field_E7; + u8 field_E8; + u8 field_E9; + u8 field_EA; + u8 field_EB; +}; // sizeof = 0xEC + struct SaveBlock2 { - /*0x00*/ u8 playerName[8]; + /*0x00*/ u8 playerName[PLAYER_NAME_LENGTH]; /*0x08*/ u8 playerGender; // MALE, FEMALE /*0x09*/ u8 specialSaveWarp; /*0x0A*/ u8 playerTrainerId[4]; @@ -202,7 +224,8 @@ struct SaveBlock2 // All below could be a one giant struct - /*0x64C*/ u8 field_64C[0x588]; + /*0x64C*/ u8 field_64C[236]; + /*0x738*/ struct UnknownSaveBlock2Struct field_738[5]; // No idea here, it's probably wrong, no clue. /*0xBD4*/ u16 field_BD4; /*0xBD6*/ u16 field_BD6; /*0xBD8*/ u8 field_BD8[11]; @@ -219,7 +242,7 @@ struct SaveBlock2 /*0xCAA*/ u16 field_CAA[0x2e]; /*0xD06*/ u8 field_D06; /*0xD07*/ u8 field_D07; - /*0xd08*/ u8 filler_D08[0x112]; + /*0xD08*/ u8 filler_D08[0x112]; /*0xE1A*/ u16 battlePyramidFloor; // possibly? /*0xE1C*/ u8 field_E1C[16]; /*0xE2C*/ struct PyramidBag pyramidBag; @@ -427,30 +450,52 @@ struct ContestWinner u8 contestRank; }; +struct DaycareMiscMon +{ + struct MailStruct mail; + u8 OT_name[OT_NAME_LENGTH + 1]; + u8 monName[POKEMON_NAME_LENGTH + 1]; + u8 gameLanguage:4; + u8 monLanguage:4; +}; + struct DaycareMon { struct BoxPokemon mon; - struct MailStruct mail; - u8 OT_name[OT_NAME_LENGTH + 1]; - u8 monName[11]; - u8 language_maybe : 4; - u8 unknown : 4; - u32 stepsTaken; + struct DaycareMiscMon misc; + u32 steps; }; -struct DaycareData +#define DAYCARE_MON_COUNT 2 + +struct DayCare { - struct DaycareMon mons[2]; + struct DaycareMon mons[DAYCARE_MON_COUNT]; u32 offspringPersonality; u8 stepCounter; }; +struct DayCareMail +{ + /*0x00*/ struct MailStruct message; + /*0x24*/ u8 names[19]; +}; + +struct RecordMixingDayCareMail +{ + struct DayCareMail mail[DAYCARE_MON_COUNT]; + u32 numDaycareMons; + bool16 holdsItem[DAYCARE_MON_COUNT]; +}; + #define MAP_OBJECTS_COUNT 16 #define BERRY_TREES_COUNT 128 #define FLAGS_COUNT 300 #define VARS_COUNT 256 +#define MAIL_COUNT 16 -enum { +enum +{ LILYCOVE_LADY_QUIZ, LILYCOVE_LADY_FAVOUR, LILYCOVE_LADY_CONTEST @@ -580,15 +625,14 @@ struct SaveBlock1 /*0x2BB0*/ u16 unk2BB0[6]; /*0x2BBC*/ u16 unk2BBC[6]; /*0x2BC8*/ u16 unk2BC8[6]; - /*0x2BD4*/ u16 unk2BD4[3]; - /*0x2BE0*/ struct MailStruct mail[16]; + /*0x2BD4*/ u16 unk2BD4[6]; + /*0x2BE0*/ struct MailStruct mail[MAIL_COUNT]; /*0x2E20*/ u8 additionalPhrases[5]; // bitfield for 33 additional phrases in easy chat system /*0x2E25*/ u8 unk2E25[3]; // possibly padding? /*0x2E28*/ OldMan oldMan; /*0x2e64*/ struct EasyChatPair easyChatPairs[5]; //Dewford trend [0] and some other stuff - /*0x2e8c*/ u8 filler_2E8C[0x4]; /*0x2e90*/ struct ContestWinner contestWinners[13]; // 0 - 5 used in contest hall, 6 - 7 unused?, 8 - 12 museum - /*0x3030*/ struct DaycareData daycare; + /*0x3030*/ struct DayCare daycare; /*0x3150*/ struct LinkBattleRecord linkBattleRecords[5]; /*0x31A0*/ u8 unk_31A0; /*0x31A1*/ u8 filler_31A1[7]; diff --git a/include/items.h b/include/items.h index 69515f18e..1f6c288c5 100644 --- a/include/items.h +++ b/include/items.h @@ -386,4 +386,7 @@ enum ITEM_OLD_SEA_MAP, // 0x178 }; +#define NUM_TECHNICAL_MACHINES 50 +#define NUM_HIDDEN_MACHINES 8 + #endif // GUARD_ITEMS_H diff --git a/include/link.h b/include/link.h index 22be82d44..098307e98 100644 --- a/include/link.h +++ b/include/link.h @@ -122,7 +122,7 @@ struct LinkPlayer /* 0x08 */ u8 name[11]; /* 0x13 */ u8 gender; /* 0x14 */ u32 linkType; - /* 0x18 */ u16 lp_field_18; + /* 0x18 */ u16 lp_field_18; // battle bank in battles /* 0x1A */ u16 language; }; diff --git a/include/list_menu.h b/include/list_menu.h index 93005e482..0249b06af 100644 --- a/include/list_menu.h +++ b/include/list_menu.h @@ -5,31 +5,33 @@ // Exported RAM declarations -struct ListMenuItem { +struct ListMenuItem +{ const u8 *unk_00; s32 unk_04; }; struct ListMenu; -struct ListMenuTemplate { - struct ListMenuItem *unk_00; +struct ListMenuTemplate +{ + const struct ListMenuItem *items; void (* unk_04)(u32, bool8, struct ListMenu *); void (* unk_08)(u8, s32, u8); - u16 unk_0c; - u16 unk_0e; + u16 totalItems; + u16 maxShowed; u8 unk_10; u8 unk_11; u8 unk_12; - u8 unk_13; - u32 unk_14_0:4; - u32 unk_14_4:4; - u32 unk_15_0:4; - u32 unk_15_4:4; - u32 unk_16_0:1; - u32 unk_16_1:6; - u32 unk_16_7:1; - u32 unk_17_0:6; + u8 cursor_Y; + u32 upText_Y:4; // x1, x2, x4, x8 = xF + u32 cursorColor:4; // x10, x20, x40, x80 = xF0 + u32 fillColor:4; // x100, x200, x400, x800 = xF00 + u32 cursorShadowColor:4; // x1000, x2000, x4000, x8000 = xF000 + u32 unk_16_0:1; // x10000 + u32 spaceBetweenItems:6; // x20000, x40000, x80000, x100000, x200000, x400000 = x7E0000 + u32 unk_16_7:1; // x800000 + u32 unk_17_0:6; // x1000000, x2000000, x4000000, x8000000, x10000000, x20000000 = x3F000000 }; struct ListMenu { diff --git a/include/mail.h b/include/mail.h index 16ca1f676..1a29d73b5 100644 --- a/include/mail.h +++ b/include/mail.h @@ -16,4 +16,10 @@ || itemId == ITEM_FAB_MAIL \ || itemId == ITEM_RETRO_MAIL)) + +bool8 MonHasMail(struct Pokemon *mon); +void TakeMailFromMon(struct Pokemon *mon); +u8 GiveMailToMon2(struct Pokemon *mon, struct MailStruct *mail); +void ClearMailStruct(struct MailStruct *mail); + #endif // GUARD_MAIL_H diff --git a/include/pokemon.h b/include/pokemon.h index 69b9e71d5..1eb052f4e 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -509,9 +509,11 @@ struct Evolution u16 targetSpecies; }; +#define EVOS_PER_MON 5 + struct EvolutionData { - struct Evolution evolutions[5]; + struct Evolution evolutions[EVOS_PER_MON]; }; extern u8 gPlayerPartyCount; @@ -648,6 +650,9 @@ u16 PlayerGenderToFrontTrainerPicId(u8 playerGender); void sub_806A1C0(u16 arg0, u8 bankIdentity); void sub_806A12C(u16 trainerSpriteId, u8 bankIdentity); u8 GetSecretBaseTrainerPicIndex(void); +bool8 TryIncrementMonLevel(struct Pokemon *mon); +void BoxMonToMon(struct BoxPokemon *srcMon, struct Pokemon *dstMon); +u8 GetLevelUpMovesBySpecies(u16 species, u16 *moves); #include "sprite.h" diff --git a/include/pokemon_storage_system.h b/include/pokemon_storage_system.h index 9115ab054..9fcfdba96 100644 --- a/include/pokemon_storage_system.h +++ b/include/pokemon_storage_system.h @@ -7,6 +7,7 @@ u8* GetBoxNamePtr(u8 boxNumber); struct BoxPokemon *GetBoxedMonPtr(u8, u8); void SetBoxMonNickFromAnyBox(u8, u8, u8 *); +void CompactPartySlots(void); u32 GetBoxMonDataFromAnyBox(u8 boxId, u8 monPosition, u32 request); #endif // GUARD_POKEMON_STORAGE_SYSTEM_H diff --git a/include/recorded_battle.h b/include/recorded_battle.h index ae2ed1a79..adc4c6c85 100644 --- a/include/recorded_battle.h +++ b/include/recorded_battle.h @@ -2,23 +2,40 @@ #define GUARD_RECORDED_BATTLE_H extern u32 gRecordedBattleRngSeed; +extern u32 gBattlePalaceMoveSelectionRngValue; +extern u8 gUnknown_0203C7B4; void sub_8184DA4(u8 arg0); -void sub_8185F84(void); void sub_8184E58(void); -u8 RecordedBattle_ReadBankAction(u8 bank); void RecordedBattle_SetBankAction(u8 bank, u8 action); void RecordedBattle_ClearBankAction(u8 bank, u8 bytesToClear); -void sub_8185F90(u16 arg0); -bool8 sub_8186450(void); -u8 sub_8185FAC(void); -u8 sub_8185FB8(void); -u8 MoveRecordedBattleToSaveData(void); -void sub_818603C(u8); -void sub_8185FD0(void); -void sub_8186444(void); -void sub_8185EB8(void); +u8 RecordedBattle_ReadBankAction(u8 bank); +u8 sub_81850D0(void); u8 sub_81850DC(u8 *arg0); -u8 sub_8185F40(void); +void sub_81851A8(u8 *arg0); +bool32 CanCopyRecordedBattleSaveData(void); +u32 MoveRecordedBattleToSaveData(void); +void PlayRecordedBattle(void (*CB2_After)(void)); +u8 sub_8185EA0(void); +u8 sub_8185EAC(void); +void RecordedBattle_SaveParties(void); +u8 GetActiveBankLinkPlayerGender(void); +void sub_8185F84(void); +void sub_8185F90(u16 arg0); +u8 sub_8185FAC(void); +u8 GetBattleStyleInRecordedBattle(void); +u8 GetTextSpeedInRecordedBattle(void); +void RecordedBattle_CopyBankMoves(void); +void sub_818603C(u8 arg0); +u32 GetAiScriptsInRecordedBattle(void); +void sub_8186444(void); +bool8 sub_8186450(void); +void sub_8186468(u8 *dst); +u8 sub_818649C(void); +u8 sub_81864A8(void); +u8 sub_81864B4(void); +u8 sub_81864C0(void); +void sub_81864CC(void); +u16 *sub_81864E0(void); #endif // GUARD_RECORDED_BATTLE_H diff --git a/include/save.h b/include/save.h index f010b3415..3bd1ff8cf 100644 --- a/include/save.h +++ b/include/save.h @@ -56,41 +56,42 @@ enum HOF_DELETE_SAVE // unused }; +#define SECTION_ID_RECORDED_BATTLE 31 + void ClearSaveData(void); void ResetSaveCounters(void); -//bool32 ManipulateSectorBits(u8 op, u8 bit); -//u8 save_write_to_flash(u16 a1, const struct SaveSectionLocation *a2); -u8 HandleWriteSector(u16, const struct SaveSectionLocation *); -//u8 HandleWriteSectorNBytes(u8 sector, u8 *data, u16 size); -u8 TryWriteSector(u8, u8 *); -//u32 RestoreSaveBackupVarsAndIncrement(const struct SaveSectionLocation *location); -//u32 RestoreSaveBackupVars(const struct SaveSectionLocation *location); -//u8 sub_812550C(u16 a1, const struct SaveSectionLocation *location); +bool32 SetDamagedSectorBits(u8 op, u8 bit); +u8 save_write_to_flash(u16 a1, const struct SaveSectionLocation *location); +u8 HandleWriteSector(u16 a1, const struct SaveSectionLocation *location); +u8 HandleWriteSectorNBytes(u8 sector, u8 *data, u16 size); +u8 TryWriteSector(u8 sector, u8 *data); +u32 RestoreSaveBackupVarsAndIncrement(const struct SaveSectionLocation *location); +u32 RestoreSaveBackupVars(const struct SaveSectionLocation *location); +u8 sub_81529D4(u16 a1, const struct SaveSectionLocation *location); u8 sub_8152A34(u16 a1, const struct SaveSectionLocation *location); -u8 ClearSaveData_2(u16, const struct SaveSectionLocation *location); -//u8 sub_8125758(u16 a1, const struct SaveSectionLocation *location); -//u8 sub_81257F0(u16 a1, const struct SaveSectionLocation *location); -//u8 sub_812587C(u16 a1, const struct SaveSectionLocation *location); -u8 sub_8152E10(u16, const struct SaveSectionLocation *location); +u8 ClearSaveData_2(u16 a1, const struct SaveSectionLocation *location); +u8 sav12_xor_get(u16 a1, const struct SaveSectionLocation *location); +u8 sub_8152CAC(u16 a1, const struct SaveSectionLocation *location); +u8 sub_8152D44(u16 a1, const struct SaveSectionLocation *location); +u8 sub_8152DD0(u16 a1, const struct SaveSectionLocation *location); +u8 sub_8152E10(u16 a1, const struct SaveSectionLocation *location); u8 GetSaveValidStatus(const struct SaveSectionLocation *location); -//u8 sub_8125B88(u8 a1, u8 *data, u16 size); -u8 DoReadFlashWholeSection(u8, struct SaveSection *); -u16 CalculateChecksum(void *, u16); +u8 sub_81530DC(u8 a1, u8 *data, u16 size); +u8 DoReadFlashWholeSection(u8 sector, struct SaveSection *section); +u16 CalculateChecksum(void *data, u16 size); +void UpdateSaveAddresses(void); u8 HandleSavingData(u8 saveType); u8 TrySavingData(u8 saveType); -//u8 sub_8125D80(void); -//bool8 sub_8125DA8(void); -//u8 sub_8125DDC(void); -//u8 sub_8125E04(void); -//u8 sub_8125E2C(void); -//bool8 sub_8125E6C(void); -//u8 sub_8125EC8(u8 a1); -//bool8 unref_sub_8125F4C(struct UnkSaveSection *a1); -//u8 unref_sub_8125FA0(void); -//u8 unref_sub_8125FF0(u8 *data, u16 size); -//u8 unref_sub_8126068(u8 sector, u8 *data, u32 size); -//u8 unref_sub_8126080(u8 sector, u8 *data); +u8 sub_8153380(void); +bool8 sub_81533AC(void); +u8 sub_81533E0(void); +u8 sub_8153408(void); +u8 sub_8153430(void); +bool8 sub_8153474(void); +u8 sub_81534D0(u8 a1); u16 sub_815355C(void); -u8 sub_81534D0(u8); +u32 TryCopySpecialSaveSection(u8 sector, u8* dst); +u32 sub_8153634(u8 sector, u8* src); +void sub_8153688(u8 taskId); #endif // GUARD_SAVE_H diff --git a/ld_script.txt b/ld_script.txt index 86f89eb46..d0d16ca79 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -80,7 +80,7 @@ SECTIONS { src/rng.o(.text); src/util.o(.text); src/blend_palette.o(.text); - asm/daycare.o(.text); + src/daycare.o(.text); src/egg_hatch.o(.text); src/battle_interface.o(.text); asm/smokescreen.o(.text); @@ -235,7 +235,7 @@ SECTIONS { asm/fldeff_teleport.o(.text); asm/battle_link_817C95C.o(.text); asm/pokemon_animation.o(.text); - asm/recorded_battle.o(.text); + src/recorded_battle.o(.text); src/battle_controller_recorded_opponent.o(.text); src/battle_controller_recorded_player.o(.text); src/battle_dome_cards.o(.text); @@ -349,7 +349,7 @@ SECTIONS { data/data2c.o(.rodata); src/trig.o(.rodata); src/util.o(.rodata); - data/daycare.o(.rodata); + src/daycare.o(.rodata); src/egg_hatch.o(.rodata); src/battle_gfx_sfx_util.o(.rodata); src/battle_interface.o(.rodata); diff --git a/src/battle_2.c b/src/battle_2.c index ffec02d17..3692e618f 100644 --- a/src/battle_2.c +++ b/src/battle_2.c @@ -143,7 +143,6 @@ extern u8 gLastUsedAbility; extern u8 gUnknown_0203CF00[]; extern const u8* gBattlescriptPtrsForSelection[BATTLE_BANKS_COUNT]; extern const u8* gBattlescriptCurrInstr; -extern u32 gBattlePalaceMoveSelectionRngValue; extern u8 gActionsByTurnOrder[BATTLE_BANKS_COUNT]; extern u8 gCurrentTurnActionNumber; extern u16 gDynamicBasePower; @@ -2804,7 +2803,7 @@ static void BattleStartClearSetData(void) if (!(gBattleTypeFlags & BATTLE_TYPE_LINK) && gSaveBlock2Ptr->optionsBattleSceneOff == TRUE) gHitMarker |= HITMARKER_NO_ANIMATIONS; } - else if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000)) && sub_8185FB8()) + else if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000)) && GetBattleStyleInRecordedBattle()) gHitMarker |= HITMARKER_NO_ANIMATIONS; gBattleScripting.battleStyle = gSaveBlock2Ptr->optionsBattleStyle; @@ -3921,7 +3920,7 @@ static void HandleTurnActionSelectionState(void) switch (gBattleCommunication[gActiveBank]) { case STATE_TURN_START_RECORD: // recorded battle related on start of every turn - sub_8185FD0(); + RecordedBattle_CopyBankMoves(); gBattleCommunication[gActiveBank] = STATE_BEFORE_ACTION_CHOSEN; break; case STATE_BEFORE_ACTION_CHOSEN: // choose an action diff --git a/src/battle_controller_recorded_opponent.c b/src/battle_controller_recorded_opponent.c index 506ab46c7..b55d644ac 100644 --- a/src/battle_controller_recorded_opponent.c +++ b/src/battle_controller_recorded_opponent.c @@ -1261,7 +1261,7 @@ static void RecordedOpponentHandleDrawTrainerPic(void) } else { - trainerPicId = PlayerGenderToFrontTrainerPicId(sub_8185F40()); + trainerPicId = PlayerGenderToFrontTrainerPicId(GetActiveBankLinkPlayerGender()); } } else diff --git a/src/battle_controller_recorded_player.c b/src/battle_controller_recorded_player.c index 03a65961b..78e7497a5 100644 --- a/src/battle_controller_recorded_player.c +++ b/src/battle_controller_recorded_player.c @@ -1229,7 +1229,7 @@ static void RecordedPlayerHandleDrawTrainerPic(void) if (gBattleTypeFlags & BATTLE_TYPE_x2000000) { if (gBattleTypeFlags & BATTLE_TYPE_MULTI) - trainerPicId = sub_8185F40(); + trainerPicId = GetActiveBankLinkPlayerGender(); else trainerPicId = gLinkPlayers[gUnknown_0203C7B4].gender; } diff --git a/src/battle_controllers.c b/src/battle_controllers.c index b3d93d759..160e6a569 100644 --- a/src/battle_controllers.c +++ b/src/battle_controllers.c @@ -111,7 +111,7 @@ void sub_8032768(void) sub_8184DA4(2); if (!(gBattleTypeFlags & BATTLE_TYPE_RECORDED)) - sub_8185EB8(); + RecordedBattle_SaveParties(); if (gBattleTypeFlags & BATTLE_TYPE_LINK) SetControllersVariablesInLinkBattle(); diff --git a/src/battle_message.c b/src/battle_message.c index 4bd6ca5b7..9c37cf646 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -58,7 +58,7 @@ extern const u8* GetTrainer1LoseText(void); // battle_setup extern const u8* GetTrainer2LoseText(void); // battle_setup extern void GetFrontierTrainerName(u8 *dst, u16 trainerId); extern s32 GetStringCenterAlignXOffsetWithLetterSpacing(u8 fontId, const u8 *str, s32 totalWidth, s16 letterSpacing); -extern u8 sub_8185FC4(void); +extern u8 GetTextSpeedInRecordedBattle(void); extern u8 sav2_get_text_speed(void); // this file's functions @@ -2264,7 +2264,7 @@ void BattleHandleAddTextPrinter(const u8 *text, u8 arg1) if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000)) speed = 1; else if (gBattleTypeFlags & BATTLE_TYPE_RECORDED) - speed = sRecordedBattleTextSpeeds[sub_8185FC4()]; + speed = sRecordedBattleTextSpeeds[GetTextSpeedInRecordedBattle()]; else speed = sav2_get_text_speed(); diff --git a/src/braille_puzzles.c b/src/braille_puzzles.c index c8055470a..85b2bc509 100755 --- a/src/braille_puzzles.c +++ b/src/braille_puzzles.c @@ -13,7 +13,7 @@ extern void DrawWholeMapView(); // field_camera extern void SetCameraPanningCallback(void ( *callback)()); // field_camera extern void InstallCameraPanAheadCallback(void); extern void SetCameraPanning(s16 x, s16 y); -extern u8 brm_get_pokemon_selection(void); +extern u8 GetCursorSelectionMonId(void); extern void FieldEffectActiveListRemove(u8 id); // field_effect extern u8 oei_task_add(void); @@ -220,7 +220,7 @@ bool8 ShouldDoBrailleStrengthEffect(void) void sub_8179834(void) { - gFieldEffectArguments[0] = brm_get_pokemon_selection(); + gFieldEffectArguments[0] = GetCursorSelectionMonId(); FieldEffectStart(FLDEFF_USE_FLY_ANCIENT_TOMB); } @@ -256,7 +256,7 @@ bool8 ShouldDoBrailleFlyEffect(void) void sub_8179918(void) { - gFieldEffectArguments[0] = brm_get_pokemon_selection(); + gFieldEffectArguments[0] = GetCursorSelectionMonId(); FieldEffectStart(FLDEFF_USE_FLY_ANCIENT_TOMB); } diff --git a/src/daycare.c b/src/daycare.c new file mode 100644 index 000000000..8dd45863a --- /dev/null +++ b/src/daycare.c @@ -0,0 +1,1318 @@ +#include "global.h" +#include "pokemon.h" +#include "daycare.h" +#include "string_util.h" +#include "species.h" +#include "items.h" +#include "mail.h" +#include "pokemon_storage_system.h" +#include "event_data.h" +#include "rng.h" +#include "main.h" +#include "moves.h" +#include "egg_hatch.h" +#include "text.h" +#include "menu.h" +#include "international_string_util.h" +#include "script.h" +#include "task.h" +#include "window.h" +#include "list_menu.h" + +#define EGG_MOVES_ARRAY_COUNT 10 +#define EGG_LVL_UP_MOVES_ARRAY_COUNT 50 + +extern u16 gMoveToLearn; + +// text +extern const u8 gText_MaleSymbol4[]; +extern const u8 gText_FemaleSymbol4[]; +extern const u8 gText_GenderlessSymbol[]; +extern const u8 gText_NewLine2[]; +extern const u8 gText_Exit4[]; +extern const u8 gText_Lv[]; +extern const u8 gExpandedPlaceholder_Empty[]; +extern const u8 gText_Exit[]; +extern const u8 gDaycareText_GetAlongVeryWell[]; +extern const u8 gDaycareText_GetAlong[]; +extern const u8 gDaycareText_DontLikeOther[]; +extern const u8 gDaycareText_PlayOther[]; + +extern u8 GetCursorSelectionMonId(void); +extern u16 ItemIdToBattleMoveId(u16); +extern s32 ListMenuHandleInput(u8); +extern void sub_81AE6C8(u8, u16*, u16*); +extern void sub_819746C(u8, bool8); +extern void sub_81973FC(u8, bool8); +extern void sub_81B9328(void); +extern void sub_81AF078(u32, bool8, struct ListMenu *); +extern void c2_exit_to_overworld_2_switch(void); + +// this file's functions +static void ClearDaycareMonMisc(struct DaycareMiscMon *misc); +static void SetInitialEggData(struct Pokemon *mon, u16 species, struct DayCare *daycare); +static u8 GetDaycareCompatibilityScore(struct DayCare *daycare); +static void DaycarePrintMonInfo(u8 windowId, s32 daycareSlotId, u8 y); + +// RAM buffers used to assist with BuildEggMoveset() +EWRAM_DATA static u16 sHatchedEggLevelUpMoves[EGG_LVL_UP_MOVES_ARRAY_COUNT] = {0}; +EWRAM_DATA static u16 sHatchedEggFatherMoves[4] = {0}; +EWRAM_DATA static u16 sHatchedEggFinalMoves[4] = {0}; +EWRAM_DATA static u16 sHatchedEggEggMoves[EGG_MOVES_ARRAY_COUNT] = {0}; +EWRAM_DATA static u16 sHatchedEggMotherMoves[4] = {0}; + +#include "data/pokemon/egg_moves.h" + +static const struct WindowTemplate sDaycareLevelMenuWindowTemplate = {0, 0xF, 1, 0xE, 6, 0xF, 8}; + +static const struct ListMenuItem sLevelMenuItems[] = +{ + {gExpandedPlaceholder_Empty, 0}, + {gExpandedPlaceholder_Empty, 1}, + {gText_Exit, 5} +}; + +static const struct ListMenuTemplate sDaycareListMenuLevelTemplate = +{ + .items = sLevelMenuItems, + .unk_04 = sub_81AF078, + .unk_08 = DaycarePrintMonInfo, + .totalItems = 3, + .maxShowed = 3, + .unk_10 = 0, + .unk_11 = 0, + .unk_12 = 8, + .cursor_Y = 0, + .upText_Y = 1, + .cursorColor = 2, + .fillColor = 1, + .cursorShadowColor = 3, + .unk_16_0 = TRUE, + .spaceBetweenItems = 0, + .unk_16_7 = FALSE, + .unk_17_0 = 1 +}; + +static const u8 *const sCompatibilityMessages[] = +{ + gDaycareText_GetAlongVeryWell, + gDaycareText_GetAlong, + gDaycareText_DontLikeOther, + gDaycareText_PlayOther +}; + +static const u8 sJapaneseEggNickname[] = _("タマゴ"); // "tamago" ("egg" in Japanese) + +u8 *GetMonNick(struct Pokemon *mon, u8 *dest) +{ + u8 nickname[POKEMON_NAME_LENGTH * 2]; + + GetMonData(mon, MON_DATA_NICKNAME, nickname); + return StringCopy10(dest, nickname); +} + +u8 *GetBoxMonNick(struct BoxPokemon *mon, u8 *dest) +{ + u8 nickname[POKEMON_NAME_LENGTH * 2]; + + GetBoxMonData(mon, MON_DATA_NICKNAME, nickname); + return StringCopy10(dest, nickname); +} + +u8 CountPokemonInDaycare(struct DayCare *daycare) +{ + u8 i, count; + count = 0; + + for (i = 0; i < DAYCARE_MON_COUNT; i++) + { + if (GetBoxMonData(&daycare->mons[i].mon, MON_DATA_SPECIES) != 0) + count++; + } + + return count; +} + +void InitDaycareMailRecordMixing(struct DayCare *daycare, struct RecordMixingDayCareMail *daycareMail) +{ + u8 i; + u8 numDaycareMons = 0; + + for (i = 0; i < DAYCARE_MON_COUNT; i++) + { + if (GetBoxMonData(&daycare->mons[i].mon, MON_DATA_SPECIES) != SPECIES_NONE) + { + numDaycareMons++; + if (GetBoxMonData(&daycare->mons[i].mon, MON_DATA_HELD_ITEM) == ITEM_NONE) + { + daycareMail->holdsItem[i] = FALSE; + } + else + { + daycareMail->holdsItem[i] = TRUE; + } + } + else + { + daycareMail->holdsItem[i] = TRUE; + } + } + + daycareMail->numDaycareMons = numDaycareMons; +} + +static s8 Daycare_FindEmptySpot(struct DayCare *daycare) +{ + u8 i; + + for (i = 0; i < DAYCARE_MON_COUNT; i++) + { + if (GetBoxMonData(&daycare->mons[i].mon, MON_DATA_SPECIES) == 0) + return i; + } + + return -1; +} + +static void StorePokemonInDaycare(struct Pokemon *mon, struct DaycareMon *daycareMon) +{ + if (MonHasMail(mon)) + { + u8 mailId; + + StringCopy(daycareMon->misc.OT_name, gSaveBlock2Ptr->playerName); + GetMonNick(mon, daycareMon->misc.monName); + StripExtCtrlCodes(daycareMon->misc.monName); + daycareMon->misc.gameLanguage = LANGUAGE_ENGLISH; + daycareMon->misc.monLanguage = GetMonData(mon, MON_DATA_LANGUAGE); + mailId = GetMonData(mon, MON_DATA_MAIL); + daycareMon->misc.mail = gSaveBlock1Ptr->mail[mailId]; + TakeMailFromMon(mon); + } + + daycareMon->mon = mon->box; + BoxMonRestorePP(&daycareMon->mon); + daycareMon->steps = 0; + ZeroMonData(mon); + CompactPartySlots(); + CalculatePlayerPartyCount(); +} + +static void StorePokemonInEmptyDaycareSlot(struct Pokemon *mon, struct DayCare *daycare) +{ + s8 slotId = Daycare_FindEmptySpot(daycare); + StorePokemonInDaycare(mon, &daycare->mons[slotId]); +} + +void StoreSelectedPokemonInDaycare(void) +{ + u8 monId = GetCursorSelectionMonId(); + StorePokemonInEmptyDaycareSlot(&gPlayerParty[monId], &gSaveBlock1Ptr->daycare); +} + +// Shifts the second daycare pokemon slot into the first slot. +static void ShiftDaycareSlots(struct DayCare *daycare) +{ + // This condition is only satisfied when the player takes out the first pokemon from the daycare. + if (GetBoxMonData(&daycare->mons[1].mon, MON_DATA_SPECIES) != 0 + && GetBoxMonData(&daycare->mons[0].mon, MON_DATA_SPECIES) == 0) + { + daycare->mons[0].mon = daycare->mons[1].mon; + ZeroBoxMonData(&daycare->mons[1].mon); + + daycare->mons[0].misc = daycare->mons[1].misc; + daycare->mons[0].steps = daycare->mons[1].steps; + daycare->mons[1].steps = 0; + ClearDaycareMonMisc(&daycare->mons[1].misc); + } +} + +static void ApplyDaycareExperience(struct Pokemon *mon) +{ + s32 i; + bool8 firstMove; + u16 learnedMove; + + for (i = 0; i < MAX_MON_LEVEL; i++) + { + // Add the mon's gained daycare experience level by level until it can't level up anymore. + if (TryIncrementMonLevel(mon)) + { + // Teach the mon new moves it learned while in the daycare. + firstMove = TRUE; + while ((learnedMove = MonTryLearningNewMove(mon, firstMove)) != 0) + { + firstMove = FALSE; + if (learnedMove == 0xFFFF) + { + // Mon already knows 4 moves. + DeleteFirstMoveAndGiveMoveToMon(mon, gMoveToLearn); + } + } + } + else + { + break; + } + } + + // Re-calculate the mons stats at its new level. + CalculateMonStats(mon); +} + +static u16 TakeSelectedPokemonFromDaycare(struct DaycareMon *daycareMon) +{ + u16 species; + u32 experience; + struct Pokemon pokemon; + + GetBoxMonNick(&daycareMon->mon, gStringVar1); + species = GetBoxMonData(&daycareMon->mon, MON_DATA_SPECIES); + BoxMonToMon(&daycareMon->mon, &pokemon); + + if (GetMonData(&pokemon, MON_DATA_LEVEL) != MAX_MON_LEVEL) + { + experience = GetMonData(&pokemon, MON_DATA_EXP) + daycareMon->steps; + SetMonData(&pokemon, MON_DATA_EXP, &experience); + ApplyDaycareExperience(&pokemon); + } + + gPlayerParty[PARTY_SIZE - 1] = pokemon; + if (daycareMon->misc.mail.itemId) + { + GiveMailToMon2(&gPlayerParty[PARTY_SIZE - 1], &daycareMon->misc.mail); + ClearDaycareMonMisc(&daycareMon->misc); + } + + ZeroBoxMonData(&daycareMon->mon); + daycareMon->steps = 0; + CompactPartySlots(); + CalculatePlayerPartyCount(); + return species; +} + +static u16 TakeSelectedPokemonMonFromDaycareShiftSlots(struct DayCare *daycare, u8 slotId) +{ + u16 species = TakeSelectedPokemonFromDaycare(&daycare->mons[slotId]); + ShiftDaycareSlots(daycare); + return species; +} + +u16 TakePokemonFromDaycare(void) +{ + return TakeSelectedPokemonMonFromDaycareShiftSlots(&gSaveBlock1Ptr->daycare, gSpecialVar_0x8004); +} + +static u8 GetLevelAfterDaycareSteps(struct BoxPokemon *mon, u32 steps) +{ + struct BoxPokemon tempMon = *mon; + + u32 experience = GetBoxMonData(mon, MON_DATA_EXP) + steps; + SetBoxMonData(&tempMon, MON_DATA_EXP, &experience); + return GetLevelFromBoxMonExp(&tempMon); +} + +static u8 GetNumLevelsGainedFromSteps(struct DaycareMon *daycareMon) +{ + u8 levelBefore; + u8 levelAfter; + + levelBefore = GetLevelFromBoxMonExp(&daycareMon->mon); + levelAfter = GetLevelAfterDaycareSteps(&daycareMon->mon, daycareMon->steps); + return levelAfter - levelBefore; +} + +static u8 GetNumLevelsGainedForDaycareMon(struct DaycareMon *daycareMon) +{ + u8 numLevelsGained = GetNumLevelsGainedFromSteps(daycareMon); + ConvertIntToDecimalStringN(gStringVar2, numLevelsGained, STR_CONV_MODE_LEFT_ALIGN, 2); + GetBoxMonNick(&daycareMon->mon, gStringVar1); + return numLevelsGained; +} + +static u32 GetDaycareCostForSelectedMon(struct DaycareMon *daycareMon) +{ + u32 cost; + + u8 numLevelsGained = GetNumLevelsGainedFromSteps(daycareMon); + GetBoxMonNick(&daycareMon->mon, gStringVar1); + cost = 100 + 100 * numLevelsGained; + ConvertIntToDecimalStringN(gStringVar2, cost, STR_CONV_MODE_LEFT_ALIGN, 5); + return cost; +} + +static u16 GetDaycareCostForMon(struct DayCare *daycare, u8 slotId) +{ + return GetDaycareCostForSelectedMon(&daycare->mons[slotId]); +} + +void GetDaycareCost(void) +{ + gSpecialVar_0x8005 = GetDaycareCostForMon(&gSaveBlock1Ptr->daycare, gSpecialVar_0x8004); +} + +static void Debug_AddDaycareSteps(u16 numSteps) +{ + gSaveBlock1Ptr->daycare.mons[0].steps += numSteps; + gSaveBlock1Ptr->daycare.mons[1].steps += numSteps; +} + +u8 GetNumLevelsGainedFromDaycare(void) +{ + if (GetBoxMonData(&gSaveBlock1Ptr->daycare.mons[gSpecialVar_0x8004], MON_DATA_SPECIES) != 0) + return GetNumLevelsGainedForDaycareMon(&gSaveBlock1Ptr->daycare.mons[gSpecialVar_0x8004]); + + return 0; +} + +static void ClearDaycareMonMisc(struct DaycareMiscMon *misc) +{ + s32 i; + + for (i = 0; i < OT_NAME_LENGTH + 1; i++) + misc->OT_name[i] = 0; + for (i = 0; i < POKEMON_NAME_LENGTH + 1; i++) + misc->monName[i] = 0; + + ClearMailStruct(&misc->mail); +} + +static void ClearDaycareMon(struct DaycareMon *daycareMon) +{ + ZeroBoxMonData(&daycareMon->mon); + daycareMon->steps = 0; + ClearDaycareMonMisc(&daycareMon->misc); +} + +static void ClearAllDaycareData(struct DayCare *daycare) +{ + u8 i; + + for (i = 0; i < DAYCARE_MON_COUNT; i++) + ClearDaycareMon(&daycare->mons[i]); + + daycare->offspringPersonality = 0; + daycare->stepCounter = 0; +} + +// Determines what the species of an Egg would be based on the given species. +// It determines this by working backwards through the evolution chain of the +// given species. +static u16 GetEggSpecies(u16 species) +{ + int i, j, k; + bool8 found; + + // Working backwards up to 5 times seems arbitrary, since the maximum number + // of times would only be 3 for 3-stage evolutions. + for (i = 0; i < EVOS_PER_MON; i++) + { + found = FALSE; + for (j = 1; j < NUM_SPECIES; j++) + { + for (k = 0; k < EVOS_PER_MON; k++) + { + if (gEvolutionTable[j].evolutions[k].targetSpecies == species) + { + species = j; + found = TRUE; + break; + } + } + + if (found) + break; + } + + if (j == NUM_SPECIES) + break; + } + + return species; +} + +static s32 GetSlotToInheritNature(struct DayCare *daycare) +{ + u32 species[DAYCARE_MON_COUNT]; + s32 i; + s32 dittoCount; + s32 slot = -1; + + // search for female gender + for (i = 0; i < DAYCARE_MON_COUNT; i++) + { + if (GetBoxMonGender(&daycare->mons[i].mon) == MON_FEMALE) + slot = i; + } + + // search for ditto + for (dittoCount = 0, i = 0; i < DAYCARE_MON_COUNT; i++) + { + species[i] = GetBoxMonData(&daycare->mons[i].mon, MON_DATA_SPECIES); + if (species[i] == SPECIES_DITTO) + dittoCount++, slot = i; + } + + // coin flip on ...two Dittos + if (dittoCount == 2) + { + if (Random() >= USHRT_MAX / 2) + slot = 0; + else + slot = 1; + } + + // nature inheritance only if holds everstone + if (GetBoxMonData(&daycare->mons[slot].mon, MON_DATA_HELD_ITEM) != ITEM_EVERSTONE + || Random() >= USHRT_MAX / 2) + { + return -1; + } + + return slot; +} + +static void _TriggerPendingDaycareEgg(struct DayCare *daycare) +{ + s32 natureSlot; + s32 natureTries = 0; + + SeedRng2(gMain.vblankCounter2); + natureSlot = GetSlotToInheritNature(daycare); + + if (natureSlot < 0) + { + daycare->offspringPersonality = (Random2() << 0x10) | ((Random() % 0xfffe) + 1); + } + else + { + u8 wantedNature = GetNatureFromPersonality(GetBoxMonData(&daycare->mons[natureSlot].mon, MON_DATA_PERSONALITY, NULL)); + u32 personality; + + do + { + personality = (Random2() << 0x10) | (Random()); + if (wantedNature == GetNatureFromPersonality(personality) && personality != 0) + break; // we found a personality with the same nature + + natureTries++; + } while (natureTries <= 2400); + + daycare->offspringPersonality = personality; + } + + FlagSet(FLAG_PENDING_DAYCARE_EGG); +} + +static void _TriggerPendingDaycareMaleEgg(struct DayCare *daycare) +{ + daycare->offspringPersonality = (Random()) | (0x8000); + FlagSet(FLAG_PENDING_DAYCARE_EGG); +} + +void TriggerPendingDaycareEgg(void) +{ + _TriggerPendingDaycareEgg(&gSaveBlock1Ptr->daycare); +} + +static void TriggerPendingDaycareMaleEgg(void) +{ + _TriggerPendingDaycareMaleEgg(&gSaveBlock1Ptr->daycare); +} + +// Removes the selected index from the given IV list and shifts the remaining +// elements to the left. +static void RemoveIVIndexFromList(u8 *ivs, u8 selectedIv) +{ + s32 i, j; + u8 temp[NUM_STATS]; + + ivs[selectedIv] = 0xff; + for (i = 0; i < NUM_STATS; i++) + { + temp[i] = ivs[i]; + } + + j = 0; + for (i = 0; i < NUM_STATS; i++) + { + if (temp[i] != 0xff) + ivs[j++] = temp[i]; + } +} + +static void InheritIVs(struct Pokemon *egg, struct DayCare *daycare) +{ + u8 i; + u8 selectedIvs[3]; + u8 availableIVs[NUM_STATS]; + u8 whichParent[ARRAY_COUNT(selectedIvs)]; + u8 iv; + + // Initialize a list of IV indices. + for (i = 0; i < NUM_STATS; i++) + { + availableIVs[i] = i; + } + + // Select the 3 IVs that will be inherited. + for (i = 0; i < ARRAY_COUNT(selectedIvs); i++) + { + // Randomly pick an IV from the available list. + selectedIvs[i] = availableIVs[Random() % (NUM_STATS - i)]; + + // Remove the selected IV index from the available IV indices. + RemoveIVIndexFromList(availableIVs, i); + } + + // Determine which parent each of the selected IVs should inherit from. + for (i = 0; i < ARRAY_COUNT(selectedIvs); i++) + { + whichParent[i] = Random() % 2; + } + + // Set each of inherited IVs on the egg mon. + for (i = 0; i < ARRAY_COUNT(selectedIvs); i++) + { + switch (selectedIvs[i]) + { + case 0: + iv = GetBoxMonData(&daycare->mons[whichParent[i]].mon, MON_DATA_HP_IV); + SetMonData(egg, MON_DATA_HP_IV, &iv); + break; + case 1: + iv = GetBoxMonData(&daycare->mons[whichParent[i]].mon, MON_DATA_ATK_IV); + SetMonData(egg, MON_DATA_ATK_IV, &iv); + break; + case 2: + iv = GetBoxMonData(&daycare->mons[whichParent[i]].mon, MON_DATA_DEF_IV); + SetMonData(egg, MON_DATA_DEF_IV, &iv); + break; + case 3: + iv = GetBoxMonData(&daycare->mons[whichParent[i]].mon, MON_DATA_SPEED_IV); + SetMonData(egg, MON_DATA_SPEED_IV, &iv); + break; + case 4: + iv = GetBoxMonData(&daycare->mons[whichParent[i]].mon, MON_DATA_SPATK_IV); + SetMonData(egg, MON_DATA_SPATK_IV, &iv); + break; + case 5: + iv = GetBoxMonData(&daycare->mons[whichParent[i]].mon, MON_DATA_SPDEF_IV); + SetMonData(egg, MON_DATA_SPDEF_IV, &iv); + break; + } + } +} + +// Counts the number of egg moves a pokemon learns and stores the moves in +// the given array. +static u8 GetEggMoves(struct Pokemon *pokemon, u16 *eggMoves) +{ + u16 eggMoveIdx; + u16 numEggMoves; + u16 species; + u16 i; + + numEggMoves = 0; + eggMoveIdx = 0; + species = GetMonData(pokemon, MON_DATA_SPECIES); + for (i = 0; i < ARRAY_COUNT(gEggMoves) - 1; i++) + { + if (gEggMoves[i] == species + EGG_MOVES_SPECIES_OFFSET) + { + eggMoveIdx = i + 1; + break; + } + } + + for (i = 0; i < EGG_MOVES_ARRAY_COUNT; i++) + { + if (gEggMoves[eggMoveIdx + i] > EGG_MOVES_SPECIES_OFFSET) + { + // TODO: the curly braces around this if statement are required for a matching build. + break; + } + + eggMoves[i] = gEggMoves[eggMoveIdx + i]; + numEggMoves++; + } + + return numEggMoves; +} + +static void BuildEggMoveset(struct Pokemon *egg, struct BoxPokemon *father, struct BoxPokemon *mother) +{ + u16 numSharedParentMoves; + u32 numLevelUpMoves; + u16 numEggMoves; + u16 i, j; + + numSharedParentMoves = 0; + for (i = 0; i < 4; i++) + { + sHatchedEggMotherMoves[i] = 0; + sHatchedEggFatherMoves[i] = 0; + sHatchedEggFinalMoves[i] = 0; + } + for (i = 0; i < EGG_MOVES_ARRAY_COUNT; i++) + sHatchedEggEggMoves[i] = 0; + for (i = 0; i < EGG_LVL_UP_MOVES_ARRAY_COUNT; i++) + sHatchedEggLevelUpMoves[i] = 0; + + numLevelUpMoves = GetLevelUpMovesBySpecies(GetMonData(egg, MON_DATA_SPECIES), sHatchedEggLevelUpMoves); + for (i = 0; i < 4; i++) + { + sHatchedEggFatherMoves[i] = GetBoxMonData(father, MON_DATA_MOVE1 + i); + sHatchedEggMotherMoves[i] = GetBoxMonData(mother, MON_DATA_MOVE1 + i); + } + + numEggMoves = GetEggMoves(egg, sHatchedEggEggMoves); + + for (i = 0; i < 4; i++) + { + if (sHatchedEggFatherMoves[i] != MOVE_NONE) + { + for (j = 0; j < numEggMoves; j++) + { + if (sHatchedEggFatherMoves[i] == sHatchedEggEggMoves[j]) + { + if (GiveMoveToMon(egg, sHatchedEggFatherMoves[i]) == 0xffff) + DeleteFirstMoveAndGiveMoveToMon(egg, sHatchedEggFatherMoves[i]); + break; + } + } + } + else + { + break; + } + } + for (i = 0; i < 4; i++) + { + if (sHatchedEggFatherMoves[i] != MOVE_NONE) + { + for (j = 0; j < NUM_TECHNICAL_MACHINES + NUM_HIDDEN_MACHINES; j++) + { + if (sHatchedEggFatherMoves[i] == ItemIdToBattleMoveId(ITEM_TM01 + j) && CanMonLearnTMHM(egg, j)) + { + if (GiveMoveToMon(egg, sHatchedEggFatherMoves[i]) == 0xffff) + DeleteFirstMoveAndGiveMoveToMon(egg, sHatchedEggFatherMoves[i]); + } + } + } + } + for (i = 0; i < 4; i++) + { + if (sHatchedEggFatherMoves[i] == MOVE_NONE) + break; + for (j = 0; j < 4; j++) + { + if (sHatchedEggFatherMoves[i] == sHatchedEggMotherMoves[j] && sHatchedEggFatherMoves[i] != MOVE_NONE) + sHatchedEggFinalMoves[numSharedParentMoves++] = sHatchedEggFatherMoves[i]; + } + } + + for (i = 0; i < 4; i++) + { + if (sHatchedEggFinalMoves[i] == MOVE_NONE) + break; + for (j = 0; j < numLevelUpMoves; j++) + { + if (sHatchedEggLevelUpMoves[j] != MOVE_NONE && sHatchedEggFinalMoves[i] == sHatchedEggLevelUpMoves[j]) + { + if (GiveMoveToMon(egg, sHatchedEggFinalMoves[i]) == 0xffff) + DeleteFirstMoveAndGiveMoveToMon(egg, sHatchedEggFinalMoves[i]); + break; + } + } + } +} + +static void RemoveEggFromDayCare(struct DayCare *daycare) +{ + daycare->offspringPersonality = 0; + daycare->stepCounter = 0; +} + +void RejectEggFromDayCare(void) +{ + RemoveEggFromDayCare(&gSaveBlock1Ptr->daycare); +} + +static void AlterEggSpeciesWithIncenseItem(u16 *species, struct DayCare *daycare) +{ + u16 motherItem, fatherItem; + if (*species == SPECIES_WYNAUT || *species == SPECIES_AZURILL) + { + motherItem = GetBoxMonData(&daycare->mons[0].mon, MON_DATA_HELD_ITEM); + fatherItem = GetBoxMonData(&daycare->mons[1].mon, MON_DATA_HELD_ITEM); + if (*species == SPECIES_WYNAUT && motherItem != ITEM_LAX_INCENSE && fatherItem != ITEM_LAX_INCENSE) + { + *species = SPECIES_WOBBUFFET; + } + + if (*species == SPECIES_AZURILL && motherItem != ITEM_SEA_INCENSE && fatherItem != ITEM_SEA_INCENSE) + { + *species = SPECIES_MARILL; + } + } +} + +static void GiveVoltTackleIfLightBall(struct Pokemon *mon, struct DayCare *daycare) +{ + u32 motherItem = GetBoxMonData(&daycare->mons[0].mon, MON_DATA_HELD_ITEM); + u32 fatherItem = GetBoxMonData(&daycare->mons[1].mon, MON_DATA_HELD_ITEM); + + if (motherItem == ITEM_LIGHT_BALL || fatherItem == ITEM_LIGHT_BALL) + { + if (GiveMoveToMon(mon, MOVE_VOLT_TACKLE) == 0xFFFF) + DeleteFirstMoveAndGiveMoveToMon(mon, MOVE_VOLT_TACKLE); + } +} + +static u16 DetermineEggSpeciesAndParentSlots(struct DayCare *daycare, u8 *parentSlots) +{ + u16 i; + u16 species[2]; + u16 eggSpecies; + + // Determine which of the daycare mons is the mother and father of the egg. + // The 0th index of the parentSlots array is considered the mother slot, and the + // 1st index is the father slot. + for (i = 0; i < 2; i++) + { + species[i] = GetBoxMonData(&daycare->mons[i].mon, MON_DATA_SPECIES); + if (species[i] == SPECIES_DITTO) + { + parentSlots[0] = i ^ 1; + parentSlots[1] = i; + } + else if (GetBoxMonGender(&daycare->mons[i].mon) == MON_FEMALE) + { + parentSlots[0] = i; + parentSlots[1] = i ^ 1; + } + } + + eggSpecies = GetEggSpecies(species[parentSlots[0]]); + if (eggSpecies == SPECIES_NIDORAN_F && daycare->offspringPersonality & 0x8000) + { + eggSpecies = SPECIES_NIDORAN_M; + } + if (eggSpecies == SPECIES_ILLUMISE && daycare->offspringPersonality & 0x8000) + { + eggSpecies = SPECIES_VOLBEAT; + } + + // Make Ditto the "mother" slot if the other daycare mon is male. + if (species[parentSlots[1]] == SPECIES_DITTO && GetBoxMonGender(&daycare->mons[parentSlots[0]].mon) != MON_FEMALE) + { + u8 temp = parentSlots[1]; + parentSlots[1] = parentSlots[0]; + parentSlots[0] = temp; + } + + return eggSpecies; +} + +static void _GiveEggFromDaycare(struct DayCare *daycare) // give_egg +{ + struct Pokemon egg; + u16 species; + u8 parentSlots[2]; // 0th index is "mother" daycare slot, 1st is "father" + bool8 isEgg; + + species = DetermineEggSpeciesAndParentSlots(daycare, parentSlots); + AlterEggSpeciesWithIncenseItem(&species, daycare); + SetInitialEggData(&egg, species, daycare); + InheritIVs(&egg, daycare); + BuildEggMoveset(&egg, &daycare->mons[parentSlots[1]].mon, &daycare->mons[parentSlots[0]].mon); + + if (species == SPECIES_PICHU) + GiveVoltTackleIfLightBall(&egg, daycare); + + isEgg = TRUE; + SetMonData(&egg, MON_DATA_IS_EGG, &isEgg); + gPlayerParty[PARTY_SIZE - 1] = egg; + CompactPartySlots(); + CalculatePlayerPartyCount(); + RemoveEggFromDayCare(daycare); +} + +void CreateEgg(struct Pokemon *mon, u16 species, bool8 setHotSpringsLocation) +{ + u8 metLevel; + u16 ball; + u8 language; + u8 metLocation; + u8 isEgg; + + CreateMon(mon, species, EGG_HATCH_LEVEL, 0x20, FALSE, 0, FALSE, 0); + metLevel = 0; + ball = ITEM_POKE_BALL; + language = LANGUAGE_JAPANESE; + SetMonData(mon, MON_DATA_POKEBALL, &ball); + SetMonData(mon, MON_DATA_NICKNAME, sJapaneseEggNickname); + SetMonData(mon, MON_DATA_FRIENDSHIP, &gBaseStats[species].eggCycles); + SetMonData(mon, MON_DATA_MET_LEVEL, &metLevel); + SetMonData(mon, MON_DATA_LANGUAGE, &language); + if (setHotSpringsLocation) + { + metLocation = 253; // hot springs; see PokemonSummaryScreen_PrintEggTrainerMemo + SetMonData(mon, MON_DATA_MET_LOCATION, &metLocation); + } + + isEgg = TRUE; + SetMonData(mon, MON_DATA_IS_EGG, &isEgg); +} + +static void SetInitialEggData(struct Pokemon *mon, u16 species, struct DayCare *daycare) +{ + u32 personality; + u16 ball; + u8 metLevel; + u8 language; + + personality = daycare->offspringPersonality; + CreateMon(mon, species, EGG_HATCH_LEVEL, 0x20, TRUE, personality, FALSE, 0); + metLevel = 0; + ball = ITEM_POKE_BALL; + language = LANGUAGE_JAPANESE; + SetMonData(mon, MON_DATA_POKEBALL, &ball); + SetMonData(mon, MON_DATA_NICKNAME, sJapaneseEggNickname); + SetMonData(mon, MON_DATA_FRIENDSHIP, &gBaseStats[species].eggCycles); + SetMonData(mon, MON_DATA_MET_LEVEL, &metLevel); + SetMonData(mon, MON_DATA_LANGUAGE, &language); +} + +void GiveEggFromDaycare(void) +{ + _GiveEggFromDaycare(&gSaveBlock1Ptr->daycare); +} + +static bool8 _DoEggActions_CheckHatch(struct DayCare *daycare) +{ + u32 i, validEggs = 0; + + for (i = 0; i < DAYCARE_MON_COUNT; i++) + { + if (GetBoxMonData(&daycare->mons[i].mon, MON_DATA_SANITY_BIT2)) + daycare->mons[i].steps++, validEggs++; + } + + // try to trigger poke sex + if (daycare->offspringPersonality == 0 && validEggs == 2 && (daycare->mons[1].steps & 0xFF) == 0xFF) + { + u8 loveScore = GetDaycareCompatibilityScore(daycare); + if (loveScore > (Random() * 100u) / USHRT_MAX) + TriggerPendingDaycareEgg(); + } + + if (++daycare->stepCounter == 255) // hatch an egg + { + u32 steps; + u8 toSub = GetEggStepsToSubtract(); + + for (i = 0; i < gPlayerPartyCount; i++) + { + if (!GetMonData(&gPlayerParty[i], MON_DATA_IS_EGG)) + continue; + if (GetMonData(&gPlayerParty[i], MON_DATA_SANITY_BIT1)) + continue; + + steps = GetMonData(&gPlayerParty[i], MON_DATA_FRIENDSHIP); + if (steps != 0) // subtract needed steps + { + if (steps >= toSub) + steps -= toSub; + else + steps -= 1; + + SetMonData(&gPlayerParty[i], MON_DATA_FRIENDSHIP, &steps); + } + else // hatch the egg + { + gSpecialVar_0x8004 = i; + return TRUE; + } + } + } + + return FALSE; // no hatching +} + +bool8 DoEggActions_CheckHatch(void) +{ + return _DoEggActions_CheckHatch(&gSaveBlock1Ptr->daycare); +} + +static bool8 IsEggPending(struct DayCare *daycare) +{ + return (daycare->offspringPersonality != 0); +} + +// gStringVar1 = first mon's nickname +// gStringVar2 = second mon's nickname +// gStringVar3 = first mon trainer's name +static void _GetDaycareMonNicknames(struct DayCare *daycare) +{ + u8 text[12]; + if (GetBoxMonData(&daycare->mons[0].mon, MON_DATA_SPECIES) != 0) + { + GetBoxMonNick(&daycare->mons[0].mon, gStringVar1); + GetBoxMonData(&daycare->mons[0].mon, MON_DATA_OT_NAME, text); + StringCopy(gStringVar3, text); + } + + if (GetBoxMonData(&daycare->mons[1].mon, MON_DATA_SPECIES) != 0) + { + GetBoxMonNick(&daycare->mons[1].mon, gStringVar2); + } +} + +u16 GetSelectedMonNickAndSpecies(void) +{ + GetBoxMonNick(&gPlayerParty[GetCursorSelectionMonId()].box, gStringVar1); + return GetBoxMonData(&gPlayerParty[GetCursorSelectionMonId()].box, MON_DATA_SPECIES); +} + +void GetDaycareMonNicknames(void) +{ + _GetDaycareMonNicknames(&gSaveBlock1Ptr->daycare); +} + +u8 GetDaycareState(void) +{ + // The daycare can be in 4 possible states: + // 0: default state--no deposited mons, no egg + // 1: there is an egg waiting for the player to pick it up + // 2: there is a single pokemon in the daycare + // 3: there are two pokemon in the daycare, no egg + + u8 numMons; + if (IsEggPending(&gSaveBlock1Ptr->daycare)) + { + // There is an Egg waiting for the player. + return 1; + } + + numMons = CountPokemonInDaycare(&gSaveBlock1Ptr->daycare); + if (numMons != 0) + { + return numMons + 1; + } + + return 0; +} + +static u8 GetDaycarePokemonCount(void) +{ + u8 ret = CountPokemonInDaycare(&gSaveBlock1Ptr->daycare); + if (ret) + return ret; + + return 0; +} + +static bool8 EggGroupsOverlap(u16 *eggGroups1, u16 *eggGroups2) +{ + // Determine if the two given egg group lists contain any of the + // same egg groups. + s32 i, j; + + for (i = 0; i < 2; i++) + { + for (j = 0; j < 2; j++) + { + if (eggGroups1[i] == eggGroups2[j]) + return TRUE; + } + } + + return FALSE; +} + +static u8 GetDaycareCompatibilityScore(struct DayCare *daycare) +{ + u32 i; + u16 eggGroups[2][2]; + u16 species[2]; + u32 trainerIds[2]; + u32 genders[2]; + + for (i = 0; i < 2; i++) + { + u32 personality; + + species[i] = GetBoxMonData(&daycare->mons[i].mon, MON_DATA_SPECIES); + trainerIds[i] = GetBoxMonData(&daycare->mons[i].mon, MON_DATA_OT_ID); + personality = GetBoxMonData(&daycare->mons[i].mon, MON_DATA_PERSONALITY); + genders[i] = GetGenderFromSpeciesAndPersonality(species[i], personality); + eggGroups[i][0] = gBaseStats[species[i]].eggGroup1; + eggGroups[i][1] = gBaseStats[species[i]].eggGroup2; + } + + // check unbreedable egg group + if (eggGroups[0][0] == EGG_GROUP_UNDISCOVERED || eggGroups[1][0] == EGG_GROUP_UNDISCOVERED) + return 0; + // two Ditto can't breed + if (eggGroups[0][0] == EGG_GROUP_DITTO && eggGroups[1][0] == EGG_GROUP_DITTO) + return 0; + + // now that we checked, one ditto can breed with any other mon + if (eggGroups[0][0] == EGG_GROUP_DITTO || eggGroups[1][0] == EGG_GROUP_DITTO) + { + if (trainerIds[0] == trainerIds[1]) // same trainer + return 20; + + return 50; // different trainers, more chance of poke sex + } + else + { + if (genders[0] == genders[1]) // no homo + return 0; + if (genders[0] == MON_GENDERLESS || genders[1] == MON_GENDERLESS) + return 0; + if (!EggGroupsOverlap(eggGroups[0], eggGroups[1])) // not compatible with each other + return 0; + + if (species[0] == species[1]) // same species + { + if (trainerIds[0] == trainerIds[1]) // same species and trainer + return 50; + + return 70; // different trainers, same species + } + else + { + if (trainerIds[0] != trainerIds[1]) // different trainers, different species + return 50; + + return 20; // different species, same trainer + } + } +} + +static u8 GetDaycareCompatibilityScoreFromSave(void) +{ + return GetDaycareCompatibilityScore(&gSaveBlock1Ptr->daycare); +} + +void SetDaycareCompatibilityString(void) +{ + u8 whichString; + u8 relationshipScore; + + relationshipScore = GetDaycareCompatibilityScoreFromSave(); + whichString = 0; + if (relationshipScore == 0) + whichString = 3; + if (relationshipScore == 20) + whichString = 2; + if (relationshipScore == 50) + whichString = 1; + if (relationshipScore == 70) + whichString = 0; + + StringCopy(gStringVar4, sCompatibilityMessages[whichString]); +} + +bool8 NameHasGenderSymbol(const u8 *name, u8 genderRatio) +{ + u8 i; + u8 symbolsCount[2]; // male, female + symbolsCount[0] = symbolsCount[1] = 0; + + for (i = 0; name[i] != EOS; i++) + { + if (name[i] == CHAR_MALE) + symbolsCount[0]++; + if (name[i] == CHAR_FEMALE) + symbolsCount[1]++; + } + + if (genderRatio == MON_MALE && symbolsCount[0] != 0 && symbolsCount[1] == 0) + return TRUE; + if (genderRatio == MON_FEMALE && symbolsCount[1] != 0 && symbolsCount[0] == 0) + return TRUE; + + return FALSE; +} + +static u8 *AppendGenderSymbol(u8 *name, u8 gender) +{ + if (gender == MON_MALE) + { + if (!NameHasGenderSymbol(name, MON_MALE)) + return StringAppend(name, gText_MaleSymbol4); + } + else if (gender == MON_FEMALE) + { + if (!NameHasGenderSymbol(name, MON_FEMALE)) + return StringAppend(name, gText_FemaleSymbol4); + } + + return StringAppend(name, gText_GenderlessSymbol); +} + +static u8 *AppendMonGenderSymbol(u8 *name, struct BoxPokemon *boxMon) +{ + return AppendGenderSymbol(name, GetBoxMonGender(boxMon)); +} + +static void GetDaycareLevelMenuText(struct DayCare *daycare, u8 *dest) +{ + u8 monNames[2][20]; + u8 i; + + *dest = EOS; + for (i = 0; i < 2; i++) + { + GetBoxMonNick(&daycare->mons[i].mon, monNames[i]); + AppendMonGenderSymbol(monNames[i], &daycare->mons[i].mon); + } + + StringCopy(dest, monNames[0]); + StringAppend(dest, gText_NewLine2); + StringAppend(dest, monNames[1]); + StringAppend(dest, gText_NewLine2); + StringAppend(dest, gText_Exit4); +} + +static void GetDaycareLevelMenuLevelText(struct DayCare *daycare, u8 *dest) +{ + u8 i; + u8 level; + u8 text[20]; + + *dest = EOS; + for (i = 0; i < 2; i++) + { + StringAppend(dest, gText_Lv); + level = GetLevelAfterDaycareSteps(&daycare->mons[i].mon, daycare->mons[i].steps); + ConvertIntToDecimalStringN(text, level, STR_CONV_MODE_LEFT_ALIGN, 3); + StringAppend(dest, text); + StringAppend(dest, gText_NewLine2); + } +} + +static void DaycareAddTextPrinter(u8 windowId, const u8 *text, u32 x, u32 y) +{ + struct TextSubPrinter printer; + + printer.current_text_offset = text; + printer.windowId = windowId; + printer.fontId = 1; + printer.x = x; + printer.y = y; + printer.currentX = x; + printer.currentY = y; + printer.fontColor_l = 0; + gTextFlags.flag_1 = 0; + printer.letterSpacing = 0; + printer.lineSpacing = 1; + printer.fontColor_h = 2; + printer.bgColor = 1; + printer.shadowColor = 3; + + AddTextPrinter(&printer, 0xFF, NULL); +} + +static void DaycarePrintMonNick(struct DayCare *daycare, u8 windowId, u32 daycareSlotId, u32 y) +{ + u8 nick[POKEMON_NAME_LENGTH * 2]; + + GetBoxMonNick(&daycare->mons[daycareSlotId].mon, nick); + AppendMonGenderSymbol(nick, &daycare->mons[daycareSlotId].mon); + DaycareAddTextPrinter(windowId, nick, 8, y); +} + +static void DaycarePrintMonLvl(struct DayCare *daycare, u8 windowId, u32 daycareSlotId, u32 y) +{ + u8 level; + u32 x; + u8 lvlText[12]; + u8 intText[8]; + + StringCopy(lvlText, gText_Lv); + level = GetLevelAfterDaycareSteps(&daycare->mons[daycareSlotId].mon, daycare->mons[daycareSlotId].steps); + ConvertIntToDecimalStringN(intText, level, STR_CONV_MODE_LEFT_ALIGN, 3); + StringAppend(lvlText, intText); + x = GetStringRightAlignXOffset(1, lvlText, 112); + DaycareAddTextPrinter(windowId, lvlText, x, y); +} + +static void DaycarePrintMonInfo(u8 windowId, s32 daycareSlotId, u8 y) +{ + if (daycareSlotId < (unsigned) DAYCARE_MON_COUNT) + { + DaycarePrintMonNick(&gSaveBlock1Ptr->daycare, windowId, daycareSlotId, y); + DaycarePrintMonLvl(&gSaveBlock1Ptr->daycare, windowId, daycareSlotId, y); + } +} + +#define tMenuListTaskId data[0] +#define tWindowId data[1] + +static void Task_HandleDaycareLevelMenuInput(u8 taskId) +{ + u32 var = ListMenuHandleInput(gTasks[taskId].tMenuListTaskId); + + if (gMain.newKeys & A_BUTTON) + { + switch (var) + { + case 0: + case 1: + gSpecialVar_Result = var; + break; + case 5: + gSpecialVar_Result = 2; + break; + } + sub_81AE6C8(gTasks[taskId].tMenuListTaskId, NULL, NULL); + sub_819746C(gTasks[taskId].tWindowId, TRUE); + RemoveWindow(gTasks[taskId].tWindowId); + DestroyTask(taskId); + EnableBothScriptContexts(); + } + else if (gMain.newKeys & B_BUTTON) + { + gSpecialVar_Result = 2; + sub_81AE6C8(gTasks[taskId].tMenuListTaskId, NULL, NULL); + sub_819746C(gTasks[taskId].tWindowId, TRUE); + RemoveWindow(gTasks[taskId].tWindowId); + DestroyTask(taskId); + EnableBothScriptContexts(); + } +} + +void ShowDaycareLevelMenu(void) +{ + struct ListMenuTemplate menuTemplate; + u8 windowId; + u8 listMenuTaskId; + u8 daycareMenuTaskId; + + windowId = AddWindow(&sDaycareLevelMenuWindowTemplate); + sub_81973FC(windowId, FALSE); + + menuTemplate = sDaycareListMenuLevelTemplate; + menuTemplate.unk_10 = windowId; + listMenuTaskId = ListMenuInit(&menuTemplate, 0, 0); + + CopyWindowToVram(windowId, 3); + + daycareMenuTaskId = CreateTask(Task_HandleDaycareLevelMenuInput, 3); + gTasks[daycareMenuTaskId].tMenuListTaskId = listMenuTaskId; + gTasks[daycareMenuTaskId].tWindowId = windowId; +} + +#undef tMenuListTaskId +#undef tWindowId + +void ChooseSendDaycareMon(void) +{ + sub_81B9328(); + gMain.savedCallback = c2_exit_to_overworld_2_switch; +} diff --git a/src/decoration.c b/src/decoration.c index f622662d3..adcdc583b 100644 --- a/src/decoration.c +++ b/src/decoration.c @@ -1,5 +1,3 @@ - -// Includes #include "global.h" #include "decompress.h" #include "malloc.h" @@ -68,27 +66,27 @@ struct DecorRearrangementDataBuffer { // Static RAM declarations EWRAM_DATA u8 *gCurDecorInventoryItems = NULL; -EWRAM_DATA u8 sSecretBasePCMenuCursorPos = 0; -EWRAM_DATA u8 sCurDecorCatCount = 0; -EWRAM_DATA u8 sSecretBaseItemsIndicesBuffer[16] = {}; -EWRAM_DATA u8 sPlayerRoomItemsIndicesBuffer[12] = {}; -EWRAM_DATA u16 sSecretBasePCSelectDecorLineNo = 0; -EWRAM_DATA u16 sSecretBasePCSelectDecorPageNo = 0; +EWRAM_DATA static u8 sSecretBasePCMenuCursorPos = 0; +EWRAM_DATA static u8 sCurDecorCatCount = 0; +EWRAM_DATA static u8 sSecretBaseItemsIndicesBuffer[16] = {}; +EWRAM_DATA static u8 sPlayerRoomItemsIndicesBuffer[12] = {}; +EWRAM_DATA static u16 sSecretBasePCSelectDecorLineNo = 0; +EWRAM_DATA static u16 sSecretBasePCSelectDecorPageNo = 0; EWRAM_DATA u8 gCurDecorationIndex = 0; -EWRAM_DATA u8 sCurDecorationCategory = DECORCAT_DESK; -EWRAM_DATA u32 filler_0203a174[2] = {}; +EWRAM_DATA static u8 sCurDecorationCategory = DECORCAT_DESK; +EWRAM_DATA static u32 filler_0203a174[2] = {}; EWRAM_DATA struct DecorPCPointers gUnknown_0203A17C = {}; -EWRAM_DATA u8 sDecorMenuWindowIndices[4] = {}; +EWRAM_DATA static u8 sDecorMenuWindowIndices[4] = {}; EWRAM_DATA struct DecorPCBuffer *sDecorPCBuffer = NULL; EWRAM_DATA struct PlaceDecorationGraphicsDataBuffer sPlaceDecorationGraphicsDataBuffer = {}; -EWRAM_DATA u16 sCurDecorMapX = 0; -EWRAM_DATA u16 sCurDecorMapY = 0; -EWRAM_DATA u8 sDecor_CameraSpriteObjectIdx1 = 0; -EWRAM_DATA u8 sDecor_CameraSpriteObjectIdx2 = 0; -EWRAM_DATA u8 sDecorationLastDirectionMoved = 0; -EWRAM_DATA struct OamData sDecorSelectorOam = {}; -EWRAM_DATA struct DecorRearrangementDataBuffer sDecorRearrangementDataBuffer[16] = {}; -EWRAM_DATA u8 sCurDecorSelectedInRearrangement = 0; +EWRAM_DATA static u16 sCurDecorMapX = 0; +EWRAM_DATA static u16 sCurDecorMapY = 0; +EWRAM_DATA static u8 sDecor_CameraSpriteObjectIdx1 = 0; +EWRAM_DATA static u8 sDecor_CameraSpriteObjectIdx2 = 0; +EWRAM_DATA static u8 sDecorationLastDirectionMoved = 0; +EWRAM_DATA static struct OamData sDecorSelectorOam = {}; +EWRAM_DATA static struct DecorRearrangementDataBuffer sDecorRearrangementDataBuffer[16] = {}; +EWRAM_DATA static u8 sCurDecorSelectedInRearrangement = 0; // Static ROM declarations @@ -800,9 +798,9 @@ void sub_8127330(u8 taskId) sDecorPCBuffer->items[i].unk_04 = -2; gUnknown_03006310 = gUnknown_085A6BD0; gUnknown_03006310.unk_10 = sDecorMenuWindowIndices[1]; - gUnknown_03006310.unk_0c = sDecorPCBuffer->unk_520; - gUnknown_03006310.unk_00 = sDecorPCBuffer->items; - gUnknown_03006310.unk_0e = sDecorPCBuffer->unk_521; + gUnknown_03006310.totalItems = sDecorPCBuffer->unk_520; + gUnknown_03006310.items = sDecorPCBuffer->items; + gUnknown_03006310.maxShowed = sDecorPCBuffer->unk_521; } void sub_8127454(u8 *dest, u16 decorId) diff --git a/src/egg_hatch.c b/src/egg_hatch.c index a6f02ea23..270983716 100644 --- a/src/egg_hatch.c +++ b/src/egg_hatch.c @@ -1,5 +1,6 @@ #include "global.h" #include "pokemon.h" +#include "egg_hatch.h" #include "pokedex.h" #include "items.h" #include "script.h" @@ -23,6 +24,7 @@ #include "m4a.h" #include "window.h" #include "abilities.h" +#include "daycare.h" #include "battle.h" // to get rid of later struct EggHatchData @@ -321,7 +323,7 @@ static void CreatedHatchedMon(struct Pokemon *egg, struct Pokemon *temp) pokerus = GetMonData(egg, MON_DATA_POKERUS); obedience = GetMonData(egg, MON_DATA_OBEDIENCE); - CreateMon(temp, species, 5, 32, TRUE, personality, 0, 0); + CreateMon(temp, species, EGG_HATCH_LEVEL, 32, TRUE, personality, 0, 0); for (i = 0; i < 4; i++) { @@ -387,19 +389,19 @@ void ScriptHatchMon(void) AddHatchedMonToParty(gSpecialVar_0x8004); } -static bool8 sub_807158C(struct DaycareData* daycare, u8 daycareId) +static bool8 sub_807158C(struct DayCare *daycare, u8 daycareId) { u8 nick[0x20]; - struct DaycareMon* daycareMon = &daycare->mons[daycareId]; + struct DaycareMon *daycareMon = &daycare->mons[daycareId]; GetBoxMonNick(&daycareMon->mon, nick); - if (daycareMon->mail.itemId != 0 - && (StringCompareWithoutExtCtrlCodes(nick, daycareMon->monName) != 0 - || StringCompareWithoutExtCtrlCodes(gSaveBlock2Ptr->playerName, daycareMon->OT_name) != 0)) + if (daycareMon->misc.mail.itemId != 0 + && (StringCompareWithoutExtCtrlCodes(nick, daycareMon->misc.monName) != 0 + || StringCompareWithoutExtCtrlCodes(gSaveBlock2Ptr->playerName, daycareMon->misc.OT_name) != 0)) { StringCopy(gStringVar1, nick); - TVShowConvertInternationalString(gStringVar2, daycareMon->OT_name, daycareMon->language_maybe); - TVShowConvertInternationalString(gStringVar3, daycareMon->monName, daycareMon->unknown); + TVShowConvertInternationalString(gStringVar2, daycareMon->misc.OT_name, daycareMon->misc.gameLanguage); + TVShowConvertInternationalString(gStringVar3, daycareMon->misc.monName, daycareMon->misc.monLanguage); return TRUE; } return FALSE; diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index 838e91d90..d09cbc407 100755 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -97,7 +97,6 @@ extern u8 gUnknown_08D97D0C; extern void reset_temp_tile_data_buffers(); extern void decompress_and_copy_tile_data_to_vram(u8 a, void* tiledata, u8 b, u8 c, u8 d); 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); @@ -667,7 +666,7 @@ void sub_81C0098(struct Pokemon *mon) else { struct BoxPokemon *boxMon = gUnknown_0203CF1C->unk0->boxMon; - sub_8069004(&boxMon[gUnknown_0203CF1C->unk40BE], mon); + BoxMonToMon(&boxMon[gUnknown_0203CF1C->unk40BE], mon); } } @@ -1810,7 +1809,7 @@ void sub_81C171C(u8 taskId) void sub_81C174C(u8 taskId) { s16* data = gTasks[taskId].data; - + if (sub_81221EC() != 1) { if (gPaletteFade.active != 1) @@ -1857,7 +1856,7 @@ void sub_81C174C(u8 taskId) gUnknown_0203CF21 = 4; gSpecialVar_0x8005 = 4; sub_81C044C(taskId); - } + } } } } @@ -1907,7 +1906,7 @@ void sub_81C1940(u8 taskId) { if (gUnknown_0203CF1C->unk40C0 != 2) { - + ClearWindowTilemap(19); if (!gSprites[gUnknown_0203CF1C->unk40D5].invisible) ClearWindowTilemap(13); @@ -2224,7 +2223,7 @@ void sub_81C1E20(u8 taskId) { if (gUnknown_0203CF1C->unk40C0 == 2) PutWindowTilemap(14); - + } else { @@ -2277,7 +2276,7 @@ void sub_81C1F80(u8 taskId) PutWindowTilemap(15); sub_81C240C(data[2]); } - else + else { if (!gSprites[gUnknown_0203CF1C->unk40D5].invisible) { @@ -3645,7 +3644,7 @@ void sub_81C3D54(u8 taskId) { s16 *data = gTasks[taskId].data; s16 dataa = data[0] - 1; - + switch (dataa) { case 0: @@ -3676,4 +3675,4 @@ void sub_81C3D54(u8 taskId) return; } data[0]++; -} \ No newline at end of file +} diff --git a/src/recorded_battle.c b/src/recorded_battle.c new file mode 100644 index 000000000..e843ff7cb --- /dev/null +++ b/src/recorded_battle.c @@ -0,0 +1,1676 @@ +#include "global.h" +#include "battle.h" +#include "recorded_battle.h" +#include "main.h" +#include "pokemon.h" +#include "rng.h" +#include "event_data.h" +#include "link.h" +#include "string_util.h" +#include "palette.h" +#include "save.h" +#include "malloc.h" +#include "util.h" +#include "task.h" +#include "text.h" + +#define BANK_RECORD_SIZE 664 +#define ILLEGAL_BATTLE_TYPES ((BATTLE_TYPE_LINK | BATTLE_TYPE_SAFARI | BATTLE_TYPE_FIRST_BATTLE \ + | BATTLE_TYPE_WALLY_TUTORIAL | BATTLE_TYPE_ROAMER | BATTLE_TYPE_EREADER_TRAINER \ + | BATTLE_TYPE_KYOGRE_GROUDON | BATTLE_TYPE_LEGENDARY | BATTLE_TYPE_REGI \ + | BATTLE_TYPE_RECORDED | BATTLE_TYPE_x4000000 | BATTLE_TYPE_SECRET_BASE \ + | BATTLE_TYPE_GROUDON | BATTLE_TYPE_KYORGE | BATTLE_TYPE_RAYQUAZA)) + +extern u32 gBattleTypeFlags; +extern u16 gTrainerBattleOpponent_A; +extern u16 gTrainerBattleOpponent_B; +extern u16 gPartnerTrainerId; +extern u8 gActiveBank; +extern u8 gNoOfAllBanks; +extern u16 gBattlePartyID[BATTLE_BANKS_COUNT]; +extern struct BattlePokemon gBattleMons[BATTLE_BANKS_COUNT]; +extern u16 gChosenMovesByBanks[BATTLE_BANKS_COUNT]; +extern u8 gUnknown_03001278; +extern u8 gUnknown_03001279; + +struct PlayerInfo +{ + u32 trainerId; + u8 name[PLAYER_NAME_LENGTH]; + u8 gender; + u16 bank; + u16 language; +}; + +struct MovePp +{ + u16 moves[4]; + u8 pp[4]; +}; + +struct RecordedBattleSave +{ + struct Pokemon playerParty[PARTY_SIZE]; + struct Pokemon opponentParty[PARTY_SIZE]; + u8 playersName[BATTLE_BANKS_COUNT][PLAYER_NAME_LENGTH]; + u8 playersGender[BATTLE_BANKS_COUNT]; + u32 playersTrainerId[BATTLE_BANKS_COUNT]; + u8 playersLanguage[BATTLE_BANKS_COUNT]; + u32 rngSeed; + u32 battleFlags; + u8 playersBank[BATTLE_BANKS_COUNT]; + u16 opponentA; + u16 opponentB; + u16 partnerId; + u16 field_4FA; + u8 field_4FC; + u8 field_4FD; + u8 field_4FE; + u8 battleStyle : 1; + u8 textSpeed : 3; + u32 AI_scripts; + u8 field_504[8]; + u8 field_50C; + u8 field_50D; + u16 field_50E[6]; + u8 field_51A; + u8 field_51B; + u8 battleRecord[BATTLE_BANKS_COUNT][BANK_RECORD_SIZE]; + u32 checksum; +}; + +EWRAM_DATA u32 gRecordedBattleRngSeed = 0; +EWRAM_DATA u32 gBattlePalaceMoveSelectionRngValue = 0; +EWRAM_DATA static u8 sBattleRecords[BATTLE_BANKS_COUNT][BANK_RECORD_SIZE] = {0}; +EWRAM_DATA static u16 sRecordedBytesNo[BATTLE_BANKS_COUNT] = {0}; +EWRAM_DATA static u16 sUnknown_0203C79C[4] = {0}; +EWRAM_DATA static u16 sUnknown_0203C7A4[4] = {0}; +EWRAM_DATA static u8 sUnknown_0203C7AC = 0; +EWRAM_DATA static u8 sUnknown_0203C7AD = 0; +EWRAM_DATA static u8 sUnknown_0203C7AE = 0; +EWRAM_DATA static u8 sUnknown_0203C7AF = 0; +EWRAM_DATA static MainCallback sCallback2_AfterRecordedBattle = NULL; +EWRAM_DATA u8 gUnknown_0203C7B4 = 0; +EWRAM_DATA static u8 sUnknown_0203C7B5 = 0; +EWRAM_DATA static u8 sRecordedBattle_BattleStyle = 0; +EWRAM_DATA static u8 sRecordedBattle_TextSpeed = 0; +EWRAM_DATA static u32 sRecordedBattle_BattleFlags = 0; +EWRAM_DATA static u32 sRecordedBattle_AI_Scripts = 0; +EWRAM_DATA static struct Pokemon sSavedPlayerParty[PARTY_SIZE] = {0}; +EWRAM_DATA static struct Pokemon sSavedOpponentParty[PARTY_SIZE] = {0}; +EWRAM_DATA static u16 sRecordedBattle_PlayerMonMoves[2][4] = {0}; +EWRAM_DATA static struct PlayerInfo sRecordedBattle_Players[BATTLE_BANKS_COUNT] = {0}; +EWRAM_DATA static u8 sUnknown_0203CCD0 = 0; +EWRAM_DATA static u8 sUnknown_0203CCD1[8] = {0}; +EWRAM_DATA static u8 sUnknown_0203CCD9 = 0; +EWRAM_DATA static u8 sUnknown_0203CCDA = 0; +EWRAM_DATA static u16 sUnknown_0203CCDC[6] = {0}; +EWRAM_DATA static u8 sUnknown_0203CCE8 = 0; + +extern u32 sub_81A513C(void); +extern void PlayMapChosenOrBattleBGM(bool8); + +// this file's functions +static u8 sub_8185278(u8 *arg0, u8 *arg1, u8 *arg2); +static bool32 AllocTryCopyRecordedBattleSaveData(struct RecordedBattleSave *dst); +static void RecordedBattle_RestoreSavedParties(void); +static void CB2_RecordedBattle(void); + +void sub_8184DA4(u8 arg0) +{ + s32 i, j; + + sUnknown_0203C7AC = arg0; + sUnknown_0203CCD0 = 0; + + for (i = 0; i < BATTLE_BANKS_COUNT; i++) + { + sRecordedBytesNo[i] = 0; + sUnknown_0203C79C[i] = 0; + sUnknown_0203C7A4[i] = 0; + + if (arg0 == 1) + { + for (j = 0; j < BANK_RECORD_SIZE; j++) + { + sBattleRecords[i][j] |= 0xFF; + } + sRecordedBattle_BattleFlags = gBattleTypeFlags; + sRecordedBattle_AI_Scripts = gBattleResources->ai->aiFlags; + } + } +} + +void sub_8184E58(void) +{ + s32 i, j; + + if (sUnknown_0203C7AC == 1) + { + gRecordedBattleRngSeed = gRngValue; + sUnknown_0203C7AE = VarGet(VAR_FRONTIER_FACILITY); + sUnknown_0203C7AF = sub_81A513C(); + } + else if (sUnknown_0203C7AC == 2) + { + gRngValue = gRecordedBattleRngSeed; + } + + if (gBattleTypeFlags & BATTLE_TYPE_LINK) + { + u8 linkPlayersCount; + u8 text[30]; + + gUnknown_0203C7B4 = GetMultiplayerId(); + linkPlayersCount = GetLinkPlayerCount(); + + for (i = 0; i < BATTLE_BANKS_COUNT; i++) + { + sRecordedBattle_Players[i].trainerId = gLinkPlayers[i].trainerId; + sRecordedBattle_Players[i].gender = gLinkPlayers[i].gender; + sRecordedBattle_Players[i].bank = gLinkPlayers[i].lp_field_18; + sRecordedBattle_Players[i].language = gLinkPlayers[i].language; + + if (i < linkPlayersCount) + { + StringCopy(text, gLinkPlayers[i].name); + StripExtCtrlCodes(text); + StringCopy(sRecordedBattle_Players[i].name, text); + } + else + { + for (j = 0; j < PLAYER_NAME_LENGTH; j++) + sRecordedBattle_Players[i].name[j] = gLinkPlayers[i].name[j]; + } + } + } + else + { + sRecordedBattle_Players[0].trainerId = (gSaveBlock2Ptr->playerTrainerId[0]) + | (gSaveBlock2Ptr->playerTrainerId[1] << 8) + | (gSaveBlock2Ptr->playerTrainerId[2] << 16) + | (gSaveBlock2Ptr->playerTrainerId[3] << 24); + + sRecordedBattle_Players[0].gender = gSaveBlock2Ptr->playerGender; + sRecordedBattle_Players[0].bank = 0; + sRecordedBattle_Players[0].language = gGameLanguage; + + for (i = 0; i < PLAYER_NAME_LENGTH; i++) + sRecordedBattle_Players[0].name[i] = gSaveBlock2Ptr->playerName[i]; + } +} + +void RecordedBattle_SetBankAction(u8 bank, u8 action) +{ + if (sRecordedBytesNo[bank] < BANK_RECORD_SIZE && sUnknown_0203C7AC != 2) + { + sBattleRecords[bank][sRecordedBytesNo[bank]++] = action; + } +} + +void RecordedBattle_ClearBankAction(u8 bank, u8 bytesToClear) +{ + s32 i; + + for (i = 0; i < bytesToClear; i++) + { + sRecordedBytesNo[bank]--; + sBattleRecords[bank][sRecordedBytesNo[bank]] |= 0xFF; + if (sRecordedBytesNo[bank] == 0) + break; + } +} + +u8 RecordedBattle_ReadBankAction(u8 bank) +{ + // trying to read past array or invalid action byte, battle is over + if (sRecordedBytesNo[bank] >= BANK_RECORD_SIZE || sBattleRecords[bank][sRecordedBytesNo[bank]] == 0xFF) + { + gSpecialVar_Result = gBattleOutcome = BATTLE_PLAYER_TELEPORTED; // hah + ResetPaletteFadeControl(); + BeginNormalPaletteFade(-1, 0, 0, 0x10, 0); + SetMainCallback2(CB2_QuitRecordedBattle); + return -1; + } + else + { + return sBattleRecords[bank][sRecordedBytesNo[bank]++]; + } +} + +u8 sub_81850D0(void) +{ + return sUnknown_0203C7AC; +} + +u8 sub_81850DC(u8 *arg0) +{ + u8 i, j; + u8 ret = 0; + + for (i = 0; i < BATTLE_BANKS_COUNT; i++) + { + if (sRecordedBytesNo[i] != sUnknown_0203C79C[i]) + { + arg0[ret++] = i; + arg0[ret++] = sRecordedBytesNo[i] - sUnknown_0203C79C[i]; + + for (j = 0; j < sRecordedBytesNo[i] - sUnknown_0203C79C[i]; j++) + { + arg0[ret++] = sBattleRecords[i][sUnknown_0203C79C[i] + j]; + } + + sUnknown_0203C79C[i] = sRecordedBytesNo[i]; + } + } + + return ret; +} + +void sub_81851A8(u8 *arg0) +{ + s32 i; + u8 var1 = 2; + u8 var2; + + if (!(gBattleTypeFlags & BATTLE_TYPE_LINK)) + return; + + for (i = 0; i < GetLinkPlayerCount(); i++) + { + if ((gLinkPlayers[i].version & 0xFF) != VERSION_EMERALD) + return; + } + + if (!(gBattleTypeFlags & BATTLE_TYPE_WILD)) + { + for (var2 = *arg0; var2 != 0;) + { + u8 unkVar = sub_8185278(arg0, &var1, &var2); + u8 unkVar2 = sub_8185278(arg0, &var1, &var2); + + for (i = 0; i < unkVar2; i++) + { + sBattleRecords[unkVar][sUnknown_0203C7A4[unkVar]++] = sub_8185278(arg0, &var1, &var2); + } + } + } +} + +static u8 sub_8185278(u8 *arg0, u8 *arg1, u8 *arg2) +{ + (*arg2)--; + return arg0[(*arg1)++]; +} + +bool32 CanCopyRecordedBattleSaveData(void) +{ + struct RecordedBattleSave *dst = AllocZeroed(sizeof(struct RecordedBattleSave)); + bool32 ret = AllocTryCopyRecordedBattleSaveData(dst); + Free(dst); + return ret; +} + +static bool32 IsRecordedBattleSaveValid(struct RecordedBattleSave *save) +{ + if (save->battleFlags == 0) + return FALSE; + if (save->battleFlags & ILLEGAL_BATTLE_TYPES) + return FALSE; + if (CalcByteArraySum((void*)(save), sizeof(*save) - 4) != save->checksum) + return FALSE; + + return TRUE; +} + +static bool32 sub_81852F0(struct RecordedBattleSave *battleSave, struct RecordedBattleSave *saveSection) +{ + memset(saveSection, 0, sizeof(struct SaveSection)); + memcpy(saveSection, battleSave, sizeof(*battleSave)); + + saveSection->checksum = CalcByteArraySum((void*)(saveSection), sizeof(*saveSection) - 4); + + if (sub_8153634(31, (void*)(saveSection)) != 1) + return FALSE; + + return TRUE; +} + +#ifdef NONMATCHING +u32 MoveRecordedBattleToSaveData(void) +{ + s32 i, j; + u8 var = 0; + struct RecordedBattleSave *battleSave = AllocZeroed(sizeof(struct RecordedBattleSave)); + struct SaveSection *savSection = AllocZeroed(sizeof(struct SaveSection)); + + for (i = 0; i < PARTY_SIZE; i++) + { + battleSave->playerParty[i] = sSavedPlayerParty[i]; + battleSave->opponentParty[i] = sSavedOpponentParty[i]; + } + + for (i = 0; i < BATTLE_BANKS_COUNT; i++) + { + for (j = 0; j < PLAYER_NAME_LENGTH; j++) + { + battleSave->playersName[i][j] = sRecordedBattle_Players[i].name[j]; + } + battleSave->playersGender[i] = sRecordedBattle_Players[i].gender; + battleSave->playersLanguage[i] = sRecordedBattle_Players[i].language; + battleSave->playersBank[i] = sRecordedBattle_Players[i].bank; + battleSave->playersTrainerId[i] = sRecordedBattle_Players[i].trainerId; + } + + battleSave->rngSeed = gRecordedBattleRngSeed; + + if (sRecordedBattle_BattleFlags & BATTLE_TYPE_LINK) + { + battleSave->battleFlags = (sRecordedBattle_BattleFlags & ~(BATTLE_TYPE_LINK | BATTLE_TYPE_20)); + battleSave->battleFlags |= BATTLE_TYPE_x2000000; + + if (sRecordedBattle_BattleFlags & BATTLE_TYPE_WILD) + { + battleSave->battleFlags |= BATTLE_TYPE_x80000000; + } + else if (sRecordedBattle_BattleFlags & BATTLE_TYPE_MULTI) + { + switch (sRecordedBattle_Players[0].bank) + { + case 0: + case 2: + if (!(sRecordedBattle_Players[gUnknown_0203C7B4].bank & 1)) + battleSave->battleFlags |= BATTLE_TYPE_x80000000; + break; + case 1: + case 3: + if ((sRecordedBattle_Players[gUnknown_0203C7B4].bank & 1)) + battleSave->battleFlags |= BATTLE_TYPE_x80000000; + break; + } + } + } + else + { + battleSave->battleFlags = sRecordedBattle_BattleFlags; + } + + battleSave->opponentA = gTrainerBattleOpponent_A; + battleSave->opponentB = gTrainerBattleOpponent_B; + battleSave->partnerId = gPartnerTrainerId; + battleSave->field_4FA = gUnknown_0203C7B4; + battleSave->field_4FC = gSaveBlock2Ptr->field_CA9_b; + battleSave->field_4FD = sUnknown_0203C7AE; + battleSave->field_4FE = sUnknown_0203C7AF; + battleSave->battleStyle = gSaveBlock2Ptr->optionsBattleStyle; + battleSave->textSpeed = gSaveBlock2Ptr->optionsTextSpeed; + battleSave->AI_scripts = sRecordedBattle_AI_Scripts; + + /* Can't match it without proper knowledge of the Saveblock 2. + if (gTrainerBattleOpponent_A >= 300 && gTrainerBattleOpponent_A <= 399) + { + for (i = 0; i < 8; i++) + { + battleSave->field_504[i] = gSaveBlock2Ptr->field_738[gTrainerBattleOpponent_A - 300].field_4[i]; + } + battleSave->field_50C = gSaveBlock2Ptr->field_738[gTrainerBattleOpponent_A - 300].field_1; + + if (sUnknown_0203CCE8 == 1) + { + for (i = 0; i < 6; i++) + { + battleSave->field_50E[i] = gSaveBlock2Ptr->field_738[gTrainerBattleOpponent_A - 300].field_28[i]; + } + } + else + { + for (i = 0; i < 6; i++) + { + battleSave->field_50E[i] = gSaveBlock2Ptr->field_738[gTrainerBattleOpponent_A - 300].field_1C[i]; + } + } + battleSave->field_51A = gSaveBlock2Ptr->field_738[gTrainerBattleOpponent_A - 300].field_E4; + } + else if (gTrainerBattleOpponent_B >= 300 && gTrainerBattleOpponent_B <= 399) + { + for (i = 0; i < 8; i++) + { + battleSave->field_504[i] = gSaveBlock2Ptr->field_738[gTrainerBattleOpponent_B - 300].field_4[i]; + } + battleSave->field_50C = gSaveBlock2Ptr->field_738[gTrainerBattleOpponent_B - 300].field_1; + + if (sUnknown_0203CCE8 == 1) + { + for (i = 0; i < 6; i++) + { + battleSave->field_50E[i] = gSaveBlock2Ptr->field_738[gTrainerBattleOpponent_B - 300].field_28[i]; + } + } + else + { + for (i = 0; i < 6; i++) + { + battleSave->field_50E[i] = gSaveBlock2Ptr->field_738[gTrainerBattleOpponent_B - 300].field_1C[i]; + } + } + battleSave->field_51A = gSaveBlock2Ptr->field_738[gTrainerBattleOpponent_B - 300].field_E4; + } + else if (gPartnerTrainerId >= 300 && gPartnerTrainerId <= 399) + { + for (i = 0; i < 8; i++) + { + battleSave->field_504[i] = gSaveBlock2Ptr->field_738[gPartnerTrainerId - 300].field_4[i]; + } + battleSave->field_50C = gSaveBlock2Ptr->field_738[gPartnerTrainerId - 300].field_1; + + if (sUnknown_0203CCE8 == 1) + { + for (i = 0; i < 6; i++) + { + battleSave->field_50E[i] = gSaveBlock2Ptr->field_738[gPartnerTrainerId - 300].field_28[i]; + } + } + else + { + for (i = 0; i < 6; i++) + { + battleSave->field_50E[i] = gSaveBlock2Ptr->field_738[gPartnerTrainerId - 300].field_1C[i]; + } + } + battleSave->field_51A = gSaveBlock2Ptr->field_738[gPartnerTrainerId - 300].field_E4; + } + + */ +} + +#else +__attribute__((naked)) +u32 MoveRecordedBattleToSaveData(void) +{ + 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\ + movs r0, 0\n\ + str r0, [sp, 0x4]\n\ + movs r0, 0xF8\n\ + lsls r0, 4\n\ + bl AllocZeroed\n\ + adds r7, r0, 0\n\ + movs r0, 0x80\n\ + lsls r0, 5\n\ + bl AllocZeroed\n\ + str r0, [sp]\n\ + movs r6, 0\n\ +_0818535E:\n\ + movs r0, 0x64\n\ + adds r4, r6, 0\n\ + muls r4, r0\n\ + adds r5, r7, r4\n\ + ldr r1, =sSavedPlayerParty\n\ + adds r1, r4, r1\n\ + adds r0, r5, 0\n\ + movs r2, 0x64\n\ + bl memcpy\n\ + movs r1, 0x96\n\ + lsls r1, 2\n\ + adds r5, r1\n\ + ldr r0, =sSavedOpponentParty\n\ + adds r4, r0\n\ + adds r0, r5, 0\n\ + adds r1, r4, 0\n\ + movs r2, 0x64\n\ + bl memcpy\n\ + adds r6, 0x1\n\ + cmp r6, 0x5\n\ + ble _0818535E\n\ + movs r6, 0\n\ + ldr r2, =gSaveBlock2Ptr\n\ + mov r9, r2\n\ + movs r3, 0x9A\n\ + lsls r3, 3\n\ + adds r3, r7, r3\n\ + str r3, [sp, 0x8]\n\ + ldr r5, =sRecordedBattle_Players\n\ + mov r8, r6\n\ + mov r12, r6\n\ + movs r4, 0x96\n\ + lsls r4, 3\n\ + adds r4, r7\n\ + mov r10, r4\n\ + ldr r0, =0x000004e4\n\ + adds r4, r7, r0\n\ +_081853AC:\n\ + lsls r1, r6, 3\n\ + ldr r0, =sRecordedBattle_Players\n\ + adds r0, 0x4\n\ + mov r3, r8\n\ + adds r2, r3, r0\n\ + add r1, r10\n\ + movs r3, 0x7\n\ +_081853BA:\n\ + ldrb r0, [r2]\n\ + strb r0, [r1]\n\ + adds r2, 0x1\n\ + adds r1, 0x1\n\ + subs r3, 0x1\n\ + cmp r3, 0\n\ + bge _081853BA\n\ + ldr r0, [sp, 0x8]\n\ + adds r1, r0, r6\n\ + ldrb r0, [r5, 0xC]\n\ + strb r0, [r1]\n\ + ldrh r0, [r5, 0x10]\n\ + strb r0, [r4]\n\ + ldrh r0, [r5, 0xE]\n\ + strb r0, [r4, 0xC]\n\ + ldr r1, =0x000004d4\n\ + adds r0, r7, r1\n\ + add r0, r12\n\ + ldr r1, [r5]\n\ + str r1, [r0]\n\ + adds r5, 0x14\n\ + movs r2, 0x14\n\ + add r8, r2\n\ + movs r3, 0x4\n\ + add r12, r3\n\ + adds r4, 0x1\n\ + adds r6, 0x1\n\ + cmp r6, 0x3\n\ + ble _081853AC\n\ + movs r4, 0x9D\n\ + lsls r4, 3\n\ + adds r1, r7, r4\n\ + ldr r5, =gRecordedBattleRngSeed\n\ + ldr r0, [r5]\n\ + str r0, [r1]\n\ + ldr r0, =sRecordedBattle_BattleFlags\n\ + ldr r2, [r0]\n\ + movs r0, 0x2\n\ + ands r0, r2\n\ + cmp r0, 0\n\ + beq _081854DC\n\ + ldr r1, =0x000004ec\n\ + adds r3, r7, r1\n\ + movs r1, 0x23\n\ + negs r1, r1\n\ + ands r1, r2\n\ + movs r0, 0x80\n\ + lsls r0, 18\n\ + orrs r1, r0\n\ + str r1, [r3]\n\ + movs r0, 0x4\n\ + ands r0, r2\n\ + cmp r0, 0\n\ + beq _08185454\n\ + movs r0, 0x80\n\ + lsls r0, 24\n\ + orrs r1, r0\n\ + str r1, [r3]\n\ + b _081854E2\n\ + .pool\n\ +_08185454:\n\ + movs r0, 0x40\n\ + ands r2, r0\n\ + cmp r2, 0\n\ + beq _081854E2\n\ + ldr r2, =sRecordedBattle_Players\n\ + ldrh r0, [r2, 0xE]\n\ + cmp r0, 0x1\n\ + beq _081854A8\n\ + cmp r0, 0x1\n\ + bgt _08185474\n\ + cmp r0, 0\n\ + beq _0818547E\n\ + b _081854E2\n\ + .pool\n\ +_08185474:\n\ + cmp r0, 0x2\n\ + beq _0818547E\n\ + cmp r0, 0x3\n\ + beq _081854A8\n\ + b _081854E2\n\ +_0818547E:\n\ + ldr r3, =gUnknown_0203C7B4\n\ + ldrb r1, [r3]\n\ + lsls r0, r1, 2\n\ + adds r0, r1\n\ + lsls r0, 2\n\ + ldr r4, =sRecordedBattle_Players\n\ + adds r0, r4\n\ + ldrh r1, [r0, 0xE]\n\ + movs r0, 0x1\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + bne _081854E2\n\ + ldr r5, =0x000004ec\n\ + adds r0, r7, r5\n\ + b _081854C4\n\ + .pool\n\ +_081854A8:\n\ + ldr r0, =gUnknown_0203C7B4\n\ + ldrb r1, [r0]\n\ + lsls r0, r1, 2\n\ + adds r0, r1\n\ + lsls r0, 2\n\ + ldr r1, =sRecordedBattle_Players\n\ + adds r0, r1\n\ + ldrh r1, [r0, 0xE]\n\ + movs r0, 0x1\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _081854E2\n\ + ldr r2, =0x000004ec\n\ + adds r0, r7, r2\n\ +_081854C4:\n\ + ldr r1, [r0]\n\ + movs r2, 0x80\n\ + lsls r2, 24\n\ + orrs r1, r2\n\ + str r1, [r0]\n\ + b _081854E2\n\ + .pool\n\ +_081854DC:\n\ + ldr r3, =0x000004ec\n\ + adds r0, r7, r3\n\ + str r2, [r0]\n\ +_081854E2:\n\ + ldr r4, =gTrainerBattleOpponent_A\n\ + ldrh r1, [r4]\n\ + ldr r5, =0x000004f4\n\ + adds r0, r7, r5\n\ + strh r1, [r0]\n\ + ldr r0, =gTrainerBattleOpponent_B\n\ + ldrh r1, [r0]\n\ + ldr r2, =0x000004f6\n\ + adds r0, r7, r2\n\ + strh r1, [r0]\n\ + ldr r3, =gPartnerTrainerId\n\ + ldrh r1, [r3]\n\ + movs r4, 0x9F\n\ + lsls r4, 3\n\ + adds r0, r7, r4\n\ + strh r1, [r0]\n\ + ldr r5, =gUnknown_0203C7B4\n\ + ldrb r1, [r5]\n\ + adds r2, 0x4\n\ + adds r0, r7, r2\n\ + strh r1, [r0]\n\ + mov r3, r9\n\ + ldr r0, [r3]\n\ + ldr r4, =0x00000ca9\n\ + adds r0, r4\n\ + ldrb r0, [r0]\n\ + lsls r0, 30\n\ + lsrs r0, 30\n\ + ldr r5, =0x000004fc\n\ + adds r1, r7, r5\n\ + strb r0, [r1]\n\ + ldr r0, =sUnknown_0203C7AE\n\ + ldrb r1, [r0]\n\ + adds r2, 0x3\n\ + adds r0, r7, r2\n\ + strb r1, [r0]\n\ + ldr r3, =sUnknown_0203C7AF\n\ + ldrb r1, [r3]\n\ + ldr r4, =0x000004fe\n\ + adds r0, r7, r4\n\ + strb r1, [r0]\n\ + mov r5, r9\n\ + ldr r0, [r5]\n\ + ldrb r1, [r0, 0x15]\n\ + lsls r1, 29\n\ + ldr r0, =0x000004ff\n\ + adds r3, r7, r0\n\ + lsrs r1, 31\n\ + ldrb r2, [r3]\n\ + movs r0, 0x2\n\ + negs r0, r0\n\ + ands r0, r2\n\ + orrs r0, r1\n\ + strb r0, [r3]\n\ + ldr r1, [r5]\n\ + ldrb r1, [r1, 0x14]\n\ + lsls r1, 29\n\ + lsrs r1, 28\n\ + movs r2, 0xF\n\ + negs r2, r2\n\ + ands r0, r2\n\ + orrs r0, r1\n\ + strb r0, [r3]\n\ + movs r2, 0xA0\n\ + lsls r2, 3\n\ + adds r1, r7, r2\n\ + ldr r3, =sRecordedBattle_AI_Scripts\n\ + ldr r0, [r3]\n\ + str r0, [r1]\n\ + ldr r4, =0xfffffed4\n\ + adds r1, r4, 0\n\ + ldr r5, =gTrainerBattleOpponent_A\n\ + ldrh r5, [r5]\n\ + adds r0, r1, r5\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + cmp r0, 0x63\n\ + bls _08185580\n\ + b _081856C4\n\ +_08185580:\n\ + movs r6, 0\n\ + ldr r0, =0x00000504\n\ + adds r3, r7, r0\n\ + mov r10, r9\n\ + ldr r1, =gTrainerBattleOpponent_A\n\ + mov r12, r1\n\ + adds r2, r4, 0\n\ + mov r8, r2\n\ + ldr r4, =0x0000073c\n\ +_08185592:\n\ + adds r2, r3, r6\n\ + mov r5, r10\n\ + ldr r1, [r5]\n\ + mov r5, r12\n\ + ldrh r0, [r5]\n\ + add r0, r8\n\ + movs r5, 0xEC\n\ + muls r0, r5\n\ + adds r0, r6, r0\n\ + adds r1, r4\n\ + adds r1, r0\n\ + ldrb r0, [r1]\n\ + strb r0, [r2]\n\ + adds r6, 0x1\n\ + cmp r6, 0x7\n\ + ble _08185592\n\ + mov r0, r9\n\ + ldr r2, [r0]\n\ + ldr r1, =gTrainerBattleOpponent_A\n\ + ldrh r0, [r1]\n\ + ldr r3, =0xfffffed4\n\ + adds r0, r3\n\ + movs r1, 0xEC\n\ + muls r0, r1\n\ + adds r2, r0\n\ + ldr r4, =0x00000739\n\ + adds r2, r4\n\ + ldrb r1, [r2]\n\ + ldr r5, =0x0000050c\n\ + adds r0, r7, r5\n\ + strb r1, [r0]\n\ + ldr r1, =sUnknown_0203CCE8\n\ + ldrb r0, [r1]\n\ + cmp r0, 0x1\n\ + bne _08185664\n\ + movs r6, 0\n\ + ldr r2, =0x0000050e\n\ + adds r4, r7, r2\n\ + mov r10, r9\n\ + ldr r5, =gTrainerBattleOpponent_A\n\ + mov r8, r5\n\ + adds r5, r3, 0\n\ +_081855E6:\n\ + lsls r3, r6, 1\n\ + mov r0, r10\n\ + ldr r2, [r0]\n\ + mov r1, r8\n\ + ldrh r0, [r1]\n\ + adds r0, r5\n\ + movs r1, 0xEC\n\ + muls r0, r1\n\ + adds r3, r0\n\ + movs r0, 0xEC\n\ + lsls r0, 3\n\ + adds r2, r0\n\ + adds r2, r3\n\ + ldrh r0, [r2]\n\ + strh r0, [r4]\n\ + adds r4, 0x2\n\ + adds r6, 0x1\n\ + cmp r6, 0x5\n\ + ble _081855E6\n\ + b _08185696\n\ + .pool\n\ +_08185664:\n\ + movs r6, 0\n\ + ldr r1, =0x0000050e\n\ + adds r4, r7, r1\n\ + mov r10, r9\n\ + ldr r2, =gTrainerBattleOpponent_A\n\ + mov r8, r2\n\ + adds r5, r3, 0\n\ +_08185672:\n\ + lsls r3, r6, 1\n\ + mov r0, r10\n\ + ldr r2, [r0]\n\ + mov r1, r8\n\ + ldrh r0, [r1]\n\ + adds r0, r5\n\ + movs r1, 0xEC\n\ + muls r0, r1\n\ + adds r3, r0\n\ + ldr r0, =0x00000754\n\ + adds r2, r0\n\ + adds r2, r3\n\ + ldrh r0, [r2]\n\ + strh r0, [r4]\n\ + adds r4, 0x2\n\ + adds r6, 0x1\n\ + cmp r6, 0x5\n\ + ble _08185672\n\ +_08185696:\n\ + mov r1, r9\n\ + ldr r2, [r1]\n\ + ldr r3, =gTrainerBattleOpponent_A\n\ + ldrh r0, [r3]\n\ + ldr r4, =0xfffffed4\n\ + adds r0, r4\n\ + movs r1, 0xEC\n\ + muls r0, r1\n\ + adds r2, r0\n\ + ldr r5, =0x0000081c\n\ + adds r2, r5\n\ + ldrb r1, [r2]\n\ + b _08185856\n\ + .pool\n\ +_081856C4:\n\ + ldr r3, =gTrainerBattleOpponent_B\n\ + ldrh r3, [r3]\n\ + adds r0, r1, r3\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + cmp r0, 0x63\n\ + bls _081856D4\n\ + b _081857E4\n\ +_081856D4:\n\ + movs r6, 0\n\ + ldr r4, =0x00000504\n\ + adds r3, r7, r4\n\ + mov r10, r9\n\ + ldr r5, =gTrainerBattleOpponent_B\n\ + mov r12, r5\n\ + ldr r0, =0xfffffed4\n\ + mov r8, r0\n\ + ldr r4, =0x0000073c\n\ +_081856E6:\n\ + adds r2, r3, r6\n\ + mov r5, r10\n\ + ldr r1, [r5]\n\ + mov r5, r12\n\ + ldrh r0, [r5]\n\ + add r0, r8\n\ + movs r5, 0xEC\n\ + muls r0, r5\n\ + adds r0, r6, r0\n\ + adds r1, r4\n\ + adds r1, r0\n\ + ldrb r0, [r1]\n\ + strb r0, [r2]\n\ + adds r6, 0x1\n\ + cmp r6, 0x7\n\ + ble _081856E6\n\ + mov r0, r9\n\ + ldr r2, [r0]\n\ + ldr r1, =gTrainerBattleOpponent_B\n\ + ldrh r0, [r1]\n\ + ldr r3, =0xfffffed4\n\ + adds r0, r3\n\ + movs r1, 0xEC\n\ + muls r0, r1\n\ + adds r2, r0\n\ + ldr r4, =0x00000739\n\ + adds r2, r4\n\ + ldrb r1, [r2]\n\ + ldr r5, =0x0000050c\n\ + adds r0, r7, r5\n\ + strb r1, [r0]\n\ + ldr r1, =sUnknown_0203CCE8\n\ + ldrb r0, [r1]\n\ + cmp r0, 0x1\n\ + bne _08185784\n\ + movs r6, 0\n\ + ldr r2, =0x0000050e\n\ + adds r4, r7, r2\n\ + mov r10, r9\n\ + ldr r5, =gTrainerBattleOpponent_B\n\ + mov r8, r5\n\ + adds r5, r3, 0\n\ +_0818573A:\n\ + lsls r3, r6, 1\n\ + mov r0, r10\n\ + ldr r2, [r0]\n\ + mov r1, r8\n\ + ldrh r0, [r1]\n\ + adds r0, r5\n\ + movs r1, 0xEC\n\ + muls r0, r1\n\ + adds r3, r0\n\ + movs r0, 0xEC\n\ + lsls r0, 3\n\ + adds r2, r0\n\ + adds r2, r3\n\ + ldrh r0, [r2]\n\ + strh r0, [r4]\n\ + adds r4, 0x2\n\ + adds r6, 0x1\n\ + cmp r6, 0x5\n\ + ble _0818573A\n\ + b _081857B6\n\ + .pool\n\ +_08185784:\n\ + movs r6, 0\n\ + ldr r1, =0x0000050e\n\ + adds r4, r7, r1\n\ + mov r10, r9\n\ + ldr r2, =gTrainerBattleOpponent_B\n\ + mov r8, r2\n\ + adds r5, r3, 0\n\ +_08185792:\n\ + lsls r3, r6, 1\n\ + mov r0, r10\n\ + ldr r2, [r0]\n\ + mov r1, r8\n\ + ldrh r0, [r1]\n\ + adds r0, r5\n\ + movs r1, 0xEC\n\ + muls r0, r1\n\ + adds r3, r0\n\ + ldr r0, =0x00000754\n\ + adds r2, r0\n\ + adds r2, r3\n\ + ldrh r0, [r2]\n\ + strh r0, [r4]\n\ + adds r4, 0x2\n\ + adds r6, 0x1\n\ + cmp r6, 0x5\n\ + ble _08185792\n\ +_081857B6:\n\ + mov r1, r9\n\ + ldr r2, [r1]\n\ + ldr r3, =gTrainerBattleOpponent_B\n\ + ldrh r0, [r3]\n\ + ldr r4, =0xfffffed4\n\ + adds r0, r4\n\ + movs r1, 0xEC\n\ + muls r0, r1\n\ + adds r2, r0\n\ + ldr r5, =0x0000081c\n\ + adds r2, r5\n\ + ldrb r1, [r2]\n\ + b _08185856\n\ + .pool\n\ +_081857E4:\n\ + ldr r3, =gPartnerTrainerId\n\ + ldrh r3, [r3]\n\ + adds r0, r1, r3\n\ + lsls r0, 16\n\ + lsrs r0, 16\n\ + cmp r0, 0x63\n\ + bhi _0818585C\n\ + movs r6, 0\n\ + ldr r4, =0x00000504\n\ + adds r3, r7, r4\n\ + mov r10, r9\n\ + ldr r5, =gPartnerTrainerId\n\ + mov r12, r5\n\ + ldr r0, =0xfffffed4\n\ + mov r8, r0\n\ + ldr r4, =0x0000073c\n\ +_08185804:\n\ + adds r2, r3, r6\n\ + mov r5, r10\n\ + ldr r1, [r5]\n\ + mov r5, r12\n\ + ldrh r0, [r5]\n\ + add r0, r8\n\ + movs r5, 0xEC\n\ + muls r0, r5\n\ + adds r0, r6, r0\n\ + adds r1, r4\n\ + adds r1, r0\n\ + ldrb r0, [r1]\n\ + strb r0, [r2]\n\ + adds r6, 0x1\n\ + cmp r6, 0x7\n\ + ble _08185804\n\ + mov r0, r9\n\ + ldr r1, [r0]\n\ + ldr r2, =gPartnerTrainerId\n\ + ldrh r0, [r2]\n\ + ldr r3, =0xfffffed4\n\ + adds r0, r3\n\ + movs r2, 0xEC\n\ + muls r0, r2\n\ + adds r1, r0\n\ + ldr r4, =0x00000739\n\ + adds r1, r4\n\ + ldrb r1, [r1]\n\ + ldr r5, =0x0000050c\n\ + adds r0, r7, r5\n\ + strb r1, [r0]\n\ + mov r0, r9\n\ + ldr r1, [r0]\n\ + ldr r4, =gPartnerTrainerId\n\ + ldrh r0, [r4]\n\ + adds r0, r3\n\ + muls r0, r2\n\ + adds r1, r0\n\ + ldr r5, =0x0000081c\n\ + adds r1, r5\n\ + ldrb r1, [r1]\n\ +_08185856:\n\ + ldr r2, =0x0000051a\n\ + adds r0, r7, r2\n\ + strb r1, [r0]\n\ +_0818585C:\n\ + ldr r3, =gTrainerBattleOpponent_A\n\ + ldrh r0, [r3]\n\ + ldr r1, =0x0000018f\n\ + cmp r0, r1\n\ + bls _08185900\n\ + mov r4, r9\n\ + ldr r2, [r4]\n\ + adds r1, r0, 0\n\ + ldr r3, =0xfffffe70\n\ + adds r1, r3\n\ + lsls r0, r1, 4\n\ + adds r0, r1\n\ + lsls r0, 2\n\ + adds r2, r0\n\ + adds r2, 0xDC\n\ + ldrb r0, [r2]\n\ + lsls r0, 27\n\ + lsrs r0, 27\n\ + ldr r5, =0x0000050d\n\ + adds r1, r7, r5\n\ + strb r0, [r1]\n\ + movs r6, 0\n\ + ldr r0, =0x0000050e\n\ + adds r4, r7, r0\n\ + mov r10, r9\n\ + ldr r1, =gTrainerBattleOpponent_A\n\ + mov r8, r1\n\ + adds r5, r3, 0\n\ +_08185894:\n\ + lsls r3, r6, 1\n\ + mov r0, r10\n\ + ldr r2, [r0]\n\ + mov r0, r8\n\ + ldrh r1, [r0]\n\ + adds r1, r5\n\ + lsls r0, r1, 4\n\ + adds r0, r1\n\ + lsls r0, 2\n\ + adds r3, r0\n\ + movs r1, 0x82\n\ + lsls r1, 1\n\ + adds r2, r1\n\ + adds r2, r3\n\ + ldrh r0, [r2]\n\ + strh r0, [r4]\n\ + adds r4, 0x2\n\ + adds r6, 0x1\n\ + cmp r6, 0x5\n\ + ble _08185894\n\ + mov r3, r9\n\ + ldr r2, [r3]\n\ + ldr r4, =gTrainerBattleOpponent_A\n\ + ldrh r1, [r4]\n\ + ldr r5, =0xfffffe70\n\ + adds r1, r5\n\ + b _081859AC\n\ + .pool\n\ +_08185900:\n\ + ldr r3, =gTrainerBattleOpponent_B\n\ + ldrh r0, [r3]\n\ + cmp r0, r1\n\ + bls _0818597C\n\ + mov r4, r9\n\ + ldr r2, [r4]\n\ + adds r1, r0, 0\n\ + ldr r3, =0xfffffe70\n\ + adds r1, r3\n\ + lsls r0, r1, 4\n\ + adds r0, r1\n\ + lsls r0, 2\n\ + adds r2, r0\n\ + adds r2, 0xDC\n\ + ldrb r0, [r2]\n\ + lsls r0, 27\n\ + lsrs r0, 27\n\ + ldr r5, =0x0000050d\n\ + adds r1, r7, r5\n\ + strb r0, [r1]\n\ + movs r6, 0\n\ + ldr r0, =0x0000050e\n\ + adds r4, r7, r0\n\ + mov r10, r9\n\ + ldr r1, =gTrainerBattleOpponent_B\n\ + mov r8, r1\n\ + adds r5, r3, 0\n\ +_08185936:\n\ + lsls r3, r6, 1\n\ + mov r0, r10\n\ + ldr r2, [r0]\n\ + mov r0, r8\n\ + ldrh r1, [r0]\n\ + adds r1, r5\n\ + lsls r0, r1, 4\n\ + adds r0, r1\n\ + lsls r0, 2\n\ + adds r3, r0\n\ + movs r1, 0x82\n\ + lsls r1, 1\n\ + adds r2, r1\n\ + adds r2, r3\n\ + ldrh r0, [r2]\n\ + strh r0, [r4]\n\ + adds r4, 0x2\n\ + adds r6, 0x1\n\ + cmp r6, 0x5\n\ + ble _08185936\n\ + mov r3, r9\n\ + ldr r2, [r3]\n\ + ldr r4, =gTrainerBattleOpponent_B\n\ + ldrh r1, [r4]\n\ + ldr r5, =0xfffffe70\n\ + adds r1, r5\n\ + b _081859AC\n\ + .pool\n\ +_0818597C:\n\ + ldr r3, =gPartnerTrainerId\n\ + ldrh r0, [r3]\n\ + cmp r0, r1\n\ + bls _081859C0\n\ + mov r4, r9\n\ + ldr r2, [r4]\n\ + adds r1, r0, 0\n\ + ldr r3, =0xfffffe70\n\ + adds r1, r3\n\ + lsls r0, r1, 4\n\ + adds r0, r1\n\ + lsls r0, 2\n\ + adds r2, r0\n\ + adds r2, 0xDC\n\ + ldrb r0, [r2]\n\ + lsls r0, 27\n\ + lsrs r0, 27\n\ + ldr r5, =0x0000050d\n\ + adds r1, r7, r5\n\ + strb r0, [r1]\n\ + ldr r2, [r4]\n\ + ldr r0, =gPartnerTrainerId\n\ + ldrh r1, [r0]\n\ + adds r1, r3\n\ +_081859AC:\n\ + lsls r0, r1, 4\n\ + adds r0, r1\n\ + lsls r0, 2\n\ + adds r2, r0\n\ + ldr r1, =0x0000011b\n\ + adds r0, r2, r1\n\ + ldrb r1, [r0]\n\ + ldr r2, =0x0000051b\n\ + adds r0, r7, r2\n\ + strb r1, [r0]\n\ +_081859C0:\n\ + movs r6, 0\n\ + ldr r3, =0x00000297\n\ + mov r10, r3\n\ + ldr r4, =sBattleRecords\n\ + mov r9, r4\n\ + movs r5, 0xA6\n\ + lsls r5, 2\n\ + mov r8, r5\n\ + ldr r0, =0x0000051c\n\ + adds r5, r7, r0\n\ +_081859D4:\n\ + adds r4, r6, 0x1\n\ + mov r0, r8\n\ + muls r0, r6\n\ + mov r1, r9\n\ + adds r2, r0, r1\n\ + adds r1, r0, r5\n\ + mov r3, r10\n\ + adds r3, 0x1\n\ +_081859E4:\n\ + ldrb r0, [r2]\n\ + strb r0, [r1]\n\ + adds r2, 0x1\n\ + adds r1, 0x1\n\ + subs r3, 0x1\n\ + cmp r3, 0\n\ + bne _081859E4\n\ + adds r6, r4, 0\n\ + cmp r6, 0x3\n\ + ble _081859D4\n\ +_081859F8:\n\ + adds r0, r7, 0\n\ + ldr r1, [sp]\n\ + bl sub_81852F0\n\ + adds r4, r0, 0\n\ + cmp r4, 0x1\n\ + beq _08185A14\n\ + ldr r0, [sp, 0x4]\n\ + adds r0, 0x1\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + str r0, [sp, 0x4]\n\ + cmp r0, 0x2\n\ + bls _081859F8\n\ +_08185A14:\n\ + adds r0, r7, 0\n\ + bl Free\n\ + ldr r0, [sp]\n\ + bl Free\n\ + adds r0, r4, 0\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 {r1}\n\ + bx r1\n\ + .pool\n\ + .syntax divided"); +} +#endif // NONMATCHING + +static bool32 TryCopyRecordedBattleSaveData(struct RecordedBattleSave *dst, struct SaveSection *saveBuffer) +{ + if (TryCopySpecialSaveSection(SECTION_ID_RECORDED_BATTLE, (void*)(saveBuffer)) != 1) + return FALSE; + + memcpy(dst, saveBuffer, sizeof(struct RecordedBattleSave)); + + if (!IsRecordedBattleSaveValid(dst)) + return FALSE; + + return TRUE; +} + +static bool32 AllocTryCopyRecordedBattleSaveData(struct RecordedBattleSave *dst) +{ + struct SaveSection *savBuffer = AllocZeroed(sizeof(struct SaveSection)); + bool32 ret = TryCopyRecordedBattleSaveData(dst, savBuffer); + Free(savBuffer); + + return ret; +} + +static void CB2_RecordedBattleEnd(void) +{ + gSaveBlock2Ptr->frontierChosenLvl = sUnknown_0203C7AD; + gBattleOutcome = 0; + gBattleTypeFlags = 0; + gTrainerBattleOpponent_A = 0; + gTrainerBattleOpponent_B = 0; + gPartnerTrainerId = 0; + + RecordedBattle_RestoreSavedParties(); + SetMainCallback2(sCallback2_AfterRecordedBattle); +} + +#define tFramesToWait data[0] + +static void Task_StartAfterCountdown(u8 taskId) +{ + if (--gTasks[taskId].tFramesToWait == 0) + { + gMain.savedCallback = CB2_RecordedBattleEnd; + SetMainCallback2(CB2_InitBattle); + DestroyTask(taskId); + } +} + +static void SetRecordedBattleVarsFromSave(struct RecordedBattleSave *src) +{ + bool8 var; + s32 i, j; + + ZeroPlayerPartyMons(); + ZeroEnemyPartyMons(); + + for (i = 0; i < PARTY_SIZE; i++) + { + gPlayerParty[i] = src->playerParty[i]; + gEnemyParty[i] = src->opponentParty[i]; + } + + for (i = 0; i < BATTLE_BANKS_COUNT; i++) + { + for (var = FALSE, j = 0; j < PLAYER_NAME_LENGTH; j++) + { + gLinkPlayers[i].name[j] = src->playersName[i][j]; + if (src->playersName[i][j] == EOS) + var = TRUE; + } + gLinkPlayers[i].gender = src->playersGender[i]; + gLinkPlayers[i].language = src->playersLanguage[i]; + gLinkPlayers[i].lp_field_18 = src->playersBank[i]; + gLinkPlayers[i].trainerId = src->playersTrainerId[i]; + + if (var) + ConvertInternationalString(gLinkPlayers[i].name, gLinkPlayers[i].language); + } + + gRecordedBattleRngSeed = src->rngSeed; + gBattleTypeFlags = src->battleFlags | BATTLE_TYPE_RECORDED; + gTrainerBattleOpponent_A = src->opponentA; + gTrainerBattleOpponent_B = src->opponentB; + gPartnerTrainerId = src->partnerId; + gUnknown_0203C7B4 = src->field_4FA; + sUnknown_0203C7AD = gSaveBlock2Ptr->frontierChosenLvl; + sUnknown_0203C7AE = src->field_4FD; + sUnknown_0203C7AF = src->field_4FE; + sRecordedBattle_BattleStyle = src->battleStyle; + sRecordedBattle_TextSpeed = src->textSpeed; + sRecordedBattle_AI_Scripts = src->AI_scripts; + + for (i = 0; i < 8; i++) + { + sUnknown_0203CCD1[i] = src->field_504[i]; + } + + sUnknown_0203CCD9 = src->field_50C; + sUnknown_0203CCDA = src->field_50D; + gUnknown_03001278 = src->field_51A; + gUnknown_03001279 = src->field_51B; + + for (i = 0; i < 6; i++) + { + sUnknown_0203CCDC[i] = src->field_50E[i]; + } + + gSaveBlock2Ptr->frontierChosenLvl = src->field_4FC; + + for (i = 0; i < BATTLE_BANKS_COUNT; i++) + { + for (j = 0; j < BANK_RECORD_SIZE; j++) + { + sBattleRecords[i][j] = src->battleRecord[i][j]; + } + } +} + +void PlayRecordedBattle(void (*CB2_After)(void)) +{ + struct RecordedBattleSave *battleSave = AllocZeroed(sizeof(struct RecordedBattleSave)); + if (AllocTryCopyRecordedBattleSaveData(battleSave) == TRUE) + { + u8 taskId; + + RecordedBattle_SaveParties(); + SetRecordedBattleVarsFromSave(battleSave); + + taskId = CreateTask(Task_StartAfterCountdown, 1); + gTasks[taskId].tFramesToWait = 128; + + sCallback2_AfterRecordedBattle = CB2_After; + PlayMapChosenOrBattleBGM(FALSE); + SetMainCallback2(CB2_RecordedBattle); + } + Free(battleSave); +} + +#undef tFramesToWait + +static void CB2_RecordedBattle(void) +{ + AnimateSprites(); + BuildOamBuffer(); + RunTasks(); +} + +u8 sub_8185EA0(void) +{ + return sUnknown_0203C7AE; +} + +u8 sub_8185EAC(void) +{ + return sUnknown_0203C7AF; +} + +void RecordedBattle_SaveParties(void) +{ + s32 i; + + for (i = 0; i < PARTY_SIZE; i++) + { + sSavedPlayerParty[i] = gPlayerParty[i]; + sSavedOpponentParty[i] = gEnemyParty[i]; + } +} + +static void RecordedBattle_RestoreSavedParties(void) +{ + s32 i; + + for (i = 0; i < PARTY_SIZE; i++) + { + gPlayerParty[i] = sSavedPlayerParty[i]; + gEnemyParty[i] = sSavedOpponentParty[i]; + } +} + +u8 GetActiveBankLinkPlayerGender(void) +{ + s32 i; + + for (i = 0; i < MAX_LINK_PLAYERS; i++) + { + if (gLinkPlayers[i].lp_field_18 == gActiveBank) + break; + } + + if (i != MAX_LINK_PLAYERS) + return gLinkPlayers[i].gender; + + return 0; +} + +void sub_8185F84(void) +{ + sUnknown_0203C7B5 = 0; +} + +void sub_8185F90(u16 arg0) +{ + sUnknown_0203C7B5 |= (arg0 & 0x8000) >> 0xF; +} + +u8 sub_8185FAC(void) +{ + return sUnknown_0203C7B5; +} + +u8 GetBattleStyleInRecordedBattle(void) +{ + return sRecordedBattle_BattleStyle; +} + +u8 GetTextSpeedInRecordedBattle(void) +{ + return sRecordedBattle_TextSpeed; +} + +void RecordedBattle_CopyBankMoves(void) +{ + s32 i; + + if (GetBankSide(gActiveBank) == SIDE_OPPONENT) + return; + if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000)) + return; + if (sUnknown_0203C7AC == 2) + return; + + for (i = 0; i < 4; i++) + { + sRecordedBattle_PlayerMonMoves[gActiveBank / 2][i] = gBattleMons[gActiveBank].moves[i]; + } +} + +#define ACTION_MOVE_CHANGE 6 + +void sub_818603C(u8 arg0) +{ + s32 bank, j, k; + + if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000)) + return; + + for (bank = 0; bank < gNoOfAllBanks; bank++) + { + if (GetBankSide(bank) != SIDE_OPPONENT) // player's side only + { + if (arg0 == 1) + { + for (j = 0; j < 4; j++) + { + if (gBattleMons[bank].moves[j] != sRecordedBattle_PlayerMonMoves[bank / 2][j]) + break; + } + if (j != 4) // player's mon's move has been changed + { + RecordedBattle_SetBankAction(bank, ACTION_MOVE_CHANGE); + for (j = 0; j < 4; j++) + { + for (k = 0; k < 4; k++) + { + if (gBattleMons[bank].moves[j] == sRecordedBattle_PlayerMonMoves[bank / 2][k]) + { + RecordedBattle_SetBankAction(bank, k); + break; + } + } + } + } + } + else + { + if (sBattleRecords[bank][sRecordedBytesNo[bank]] == ACTION_MOVE_CHANGE) + { + u8 ppBonuses[4]; + u8 array1[4]; + u8 array2[4]; + struct MovePp movePp; + u8 array3[8]; + u8 var; + + RecordedBattle_ReadBankAction(bank); + for (j = 0; j < 4; j++) + { + ppBonuses[j] = ((gBattleMons[bank].ppBonuses & ((3 << (j << 1)))) >> (j << 1)); + } + for (j = 0; j < 4; j++) + { + array1[j] = RecordedBattle_ReadBankAction(bank); + movePp.moves[j] = gBattleMons[bank].moves[array1[j]]; + movePp.pp[j] = gBattleMons[bank].pp[array1[j]]; + array3[j] = ppBonuses[array1[j]]; + array2[j] = (gDisableStructs[bank].unk18_b & gBitTable[j]) >> j; + } + for (j = 0; j < 4; j++) + { + gBattleMons[bank].moves[j] = movePp.moves[j]; + gBattleMons[bank].pp[j] = movePp.pp[j]; + } + gBattleMons[bank].ppBonuses = 0; + gDisableStructs[bank].unk18_b = 0; + for (j = 0; j < 4; j++) + { + gBattleMons[bank].ppBonuses |= (array3[j]) << (j << 1); + gDisableStructs[bank].unk18_b |= (array2[j]) << (j); + } + + if (!(gBattleMons[bank].status2 & STATUS2_TRANSFORMED)) + { + for (j = 0; j < 4; j++) + { + ppBonuses[j] = ((GetMonData(&gPlayerParty[gBattlePartyID[bank]], MON_DATA_PP_BONUSES, NULL) & ((3 << (j << 1)))) >> (j << 1)); + } + for (j = 0; j < 4; j++) + { + movePp.moves[j] = GetMonData(&gPlayerParty[gBattlePartyID[bank]], MON_DATA_MOVE1 + array1[j], NULL); + movePp.pp[j] = GetMonData(&gPlayerParty[gBattlePartyID[bank]], MON_DATA_PP1 + array1[j], NULL); + array3[j] = ppBonuses[array1[j]]; + } + for (j = 0; j < 4; j++) + { + SetMonData(&gPlayerParty[gBattlePartyID[bank]], MON_DATA_MOVE1 + j, &movePp.moves[j]); + SetMonData(&gPlayerParty[gBattlePartyID[bank]], MON_DATA_PP1 + j, &movePp.pp[j]); + } + var = 0; + for (j = 0; j < 4; j++) + { + var |= (array3[j]) << (j << 1); + } + SetMonData(&gPlayerParty[gBattlePartyID[bank]], MON_DATA_PP_BONUSES, &var); + } + + gChosenMovesByBanks[bank] = gBattleMons[bank].moves[*(gBattleStruct->chosenMovePositions + bank)]; + } + } + } + } +} + +u32 GetAiScriptsInRecordedBattle(void) +{ + return sRecordedBattle_AI_Scripts; +} + +void sub_8186444(void) +{ + sUnknown_0203CCD0 = 1; +} + +bool8 sub_8186450(void) +{ + return (sUnknown_0203CCD0 == 0); +} + +void sub_8186468(u8 *dst) +{ + s32 i; + + for (i = 0; i < 8; i++) + dst[i] = sUnknown_0203CCD1[i]; + + dst[7] = EOS; + ConvertInternationalString(dst, gUnknown_03001278); +} + +u8 sub_818649C(void) +{ + return sUnknown_0203CCD9; +} + +u8 sub_81864A8(void) +{ + return sUnknown_0203CCDA; +} + +u8 sub_81864B4(void) +{ + return gUnknown_03001278; +} + +u8 sub_81864C0(void) +{ + return gUnknown_03001279; +} + +void sub_81864CC(void) +{ + sUnknown_0203CCE8 = gBattleOutcome; +} + +u16 *sub_81864E0(void) +{ + return sUnknown_0203CCDC; +} diff --git a/src/save.c b/src/save.c index 2c1b26ca9..528c67145 100644 --- a/src/save.c +++ b/src/save.c @@ -797,7 +797,7 @@ u16 sub_815355C(void) return 0; } -u32 sub_81535DC(u8 sector, u8* dst) +u32 TryCopySpecialSaveSection(u8 sector, u8* dst) { s32 i; s32 size; @@ -826,6 +826,7 @@ u32 sub_8153634(u8 sector, u8* src) if (sector != 30 && sector != 31) return 0xFF; + savDataBuffer = &gSaveDataBuffer; *(u32*)(savDataBuffer) = 0xB39D; diff --git a/src/secret_base.c b/src/secret_base.c index 89e276e80..de2b7221a 100644 --- a/src/secret_base.c +++ b/src/secret_base.c @@ -1099,9 +1099,9 @@ void game_continue(u8 taskId) } gUnknown_03006310 = gUnknown_0858D07C; gUnknown_03006310.unk_10 = data[6]; - gUnknown_03006310.unk_0c = data[0]; - gUnknown_03006310.unk_00 = gUnknown_0203A020->items; - gUnknown_03006310.unk_0e = data[3]; + gUnknown_03006310.totalItems = data[0]; + gUnknown_03006310.items = gUnknown_0203A020->items; + gUnknown_03006310.maxShowed = data[3]; } void sub_80E9DEC(u32 a0, bool8 flag, struct ListMenu *menu) @@ -1866,7 +1866,7 @@ void sub_80EAF80(void *records, size_t recordSize, u8 linkIdx) { struct SecretBaseRecordMixer mixers[3]; u16 i; - + if (FlagGet(0x60)) { switch (GetLinkPlayerCount()) diff --git a/sym_ewram.txt b/sym_ewram.txt index 0e1c490fc..fb7959281 100644 --- a/sym_ewram.txt +++ b/sym_ewram.txt @@ -486,23 +486,7 @@ gUnknown_020249B4: @ 20249B4 .space 0x8 .include "src/rng.o" - - .align 2 -gUnknown_020249C4: @ 20249C4 - .space 0x64 - -gUnknown_02024A28: @ 2024A28 - .space 0x8 - -gUnknown_02024A30: @ 2024A30 - .space 0x8 - -gUnknown_02024A38: @ 2024A38 - .space 0x14 - -gUnknown_02024A4C: @ 2024A4C - .space 0x8 - + .include "src/daycare.o" .include "src/load_save.o" gUnknown_02031C58: @ 2031C58 @@ -1386,90 +1370,7 @@ gUnknown_0203BD26: @ 203BD26 gUnknown_0203BD28: @ 203BD28 .space 0x4 -gRecordedBattleRngSeed: @ 203BD2C - .space 0x4 - -gBattlePalaceMoveSelectionRngValue: @ 203BD30 - .space 0x4 - -gUnknown_0203BD34: @ 203BD34 - .space 0xA60 - -gUnknown_0203C794: @ 203C794 - .space 0x8 - -gUnknown_0203C79C: @ 203C79C - .space 0x8 - -gUnknown_0203C7A4: @ 203C7A4 - .space 0x8 - -gUnknown_0203C7AC: @ 203C7AC - .space 0x1 - -gUnknown_0203C7AD: @ 203C7AD - .space 0x1 - -gUnknown_0203C7AE: @ 203C7AE - .space 0x1 - -gUnknown_0203C7AF: @ 203C7AF - .space 0x1 - -gUnknown_0203C7B0: @ 203C7B0 - .space 0x4 - -gUnknown_0203C7B4: @ 203C7B4 - .space 0x1 - -gUnknown_0203C7B5: @ 203C7B5 - .space 0x1 - -gUnknown_0203C7B6: @ 203C7B6 - .space 0x1 - -gUnknown_0203C7B7: @ 203C7B7 - .space 0x1 - -gUnknown_0203C7B8: @ 203C7B8 - .space 0x4 - -gUnknown_0203C7BC: @ 203C7BC - .space 0x4 - -gUnknown_0203C7C0: @ 203C7C0 - .space 0x258 - -gUnknown_0203CA18: @ 203CA18 - .space 0x258 - -gUnknown_0203CC70: @ 203CC70 - .space 0x10 - -gUnknown_0203CC80: @ 203CC80 - .space 0x4 - -gUnknown_0203CC84: @ 203CC84 - .space 0x4C - -gUnknown_0203CCD0: @ 203CCD0 - .space 0x1 - -gUnknown_0203CCD1: @ 203CCD1 - .space 0x8 - -gUnknown_0203CCD9: @ 203CCD9 - .space 0x1 - -gUnknown_0203CCDA: @ 203CCDA - .space 0x2 - -gUnknown_0203CCDC: @ 203CCDC - .space 0xC - -gUnknown_0203CCE8: @ 203CCE8 - .space 0x4 - + .include "src/recorded_battle.o" .include "src/battle_dome_cards.o" .include "src/lilycove_lady.o"