diff --git a/asm/battle_1.s b/asm/battle_1.s index 0b8ad7365c..f62617600d 100644 --- a/asm/battle_1.s +++ b/asm/battle_1.s @@ -179,7 +179,7 @@ sub_800F324: @ 800F324 push {lr} movs r0, 0 bl ResetBgsAndClearDma3BusyFlags - ldr r1, _0800F344 @ =gUnknown_8248320 + ldr r1, _0800F344 @ =gBattleBgTemplates movs r0, 0 movs r2, 0x4 bl InitBgsFromTemplates @@ -189,7 +189,7 @@ sub_800F324: @ 800F324 pop {r0} bx r0 .align 2, 0 -_0800F344: .4byte gUnknown_8248320 +_0800F344: .4byte gBattleBgTemplates _0800F348: .4byte gUnknown_8248330 thumb_func_end sub_800F324 diff --git a/asm/battle_2.s b/asm/battle_2.s index bb696b4ab7..13277fc925 100644 --- a/asm/battle_2.s +++ b/asm/battle_2.s @@ -5,8 +5,8 @@ .text - thumb_func_start sub_800FD9C -sub_800FD9C: @ 800FD9C + thumb_func_start CB2_InitBattle +CB2_InitBattle: @ 800FD9C push {r4,lr} bl MoveSaveBlocks_ResetHeap bl AllocateBattleResources @@ -19,7 +19,7 @@ sub_800FD9C: @ 800FD9C cmp r0, 0 beq _0800FDD8 bl HandleLinkBattleSetup - ldr r0, _0800FDD0 @ =sub_80109C8 + ldr r0, _0800FDD0 @ =CB2_PreInitMultiBattle bl SetMainCallback2 ldr r1, _0800FDD4 @ =gBattleCommunication movs r0, 0 @@ -27,10 +27,10 @@ sub_800FD9C: @ 800FD9C b _0800FE1C .align 2, 0 _0800FDCC: .4byte gBattleTypeFlags -_0800FDD0: .4byte sub_80109C8 +_0800FDD0: .4byte CB2_PreInitMultiBattle _0800FDD4: .4byte gBattleCommunication _0800FDD8: - bl sub_800FE24 + bl CB2_InitBattleInternal ldr r1, [r4] movs r0, 0x2 ands r0, r1 @@ -66,10 +66,10 @@ _0800FE1C: pop {r4} pop {r0} bx r0 - thumb_func_end sub_800FD9C + thumb_func_end CB2_InitBattle - thumb_func_start sub_800FE24 -sub_800FE24: @ 800FE24 + thumb_func_start CB2_InitBattleInternal +CB2_InitBattleInternal: @ 800FE24 push {r4,r5,lr} sub sp, 0x4 movs r0, 0 @@ -120,7 +120,7 @@ _0800FE88: cmp r1, 0 bge _0800FE88 movs r1, 0x50 - ldr r4, _0800FF3C @ =gUnknown_824EFE4 + ldr r4, _0800FF3C @ =sIntroScanlineParams16Bit ldr r0, _0800FF38 @ =gScanlineEffectRegBuffers ldr r3, _0800FF40 @ =0x0000ff10 movs r5, 0x82 @@ -178,7 +178,7 @@ _0800FEA6: ands r0, r1 cmp r0, 0 beq _0800FF78 - ldr r0, _0800FF74 @ =sub_8010BA0 + ldr r0, _0800FF74 @ =CB2_HandleStartMultiBattle bl SetMainCallback2 b _0800FF7E .align 2, 0 @@ -187,7 +187,7 @@ _0800FF2C: .4byte 0x00005051 _0800FF30: .4byte gBattle_WIN0H _0800FF34: .4byte gBattle_WIN0V _0800FF38: .4byte gScanlineEffectRegBuffers -_0800FF3C: .4byte gUnknown_824EFE4 +_0800FF3C: .4byte sIntroScanlineParams16Bit _0800FF40: .4byte 0x0000ff10 _0800FF44: .4byte gBattle_BG0_X _0800FF48: .4byte gBattle_BG0_Y @@ -201,9 +201,9 @@ _0800FF64: .4byte gBattleTerrain _0800FF68: .4byte gReservedSpritePaletteCount _0800FF6C: .4byte VBlankCB_Battle _0800FF70: .4byte gBattleTypeFlags -_0800FF74: .4byte sub_8010BA0 +_0800FF74: .4byte CB2_HandleStartMultiBattle _0800FF78: - ldr r0, _0800FFCC @ =sub_8010508 + ldr r0, _0800FFCC @ =CB2_HandleStartBattle bl SetMainCallback2 _0800FF7E: ldr r0, _0800FFD0 @ =gBattleTypeFlags @@ -215,7 +215,7 @@ _0800FF7E: ldr r0, _0800FFD4 @ =gEnemyParty ldr r1, _0800FFD8 @ =gTrainerBattleOpponent_A ldrh r1, [r1] - bl sub_80112E0 + bl CreateNPCTrainerParty bl SetWildMonHeldItem _0800FF98: ldr r0, _0800FFDC @ =gMain @@ -244,7 +244,7 @@ _0800FFAE: pop {r0} bx r0 .align 2, 0 -_0800FFCC: .4byte sub_8010508 +_0800FFCC: .4byte CB2_HandleStartBattle _0800FFD0: .4byte gBattleTypeFlags _0800FFD4: .4byte gEnemyParty _0800FFD8: .4byte gTrainerBattleOpponent_A @@ -252,7 +252,7 @@ _0800FFDC: .4byte gMain _0800FFE0: .4byte 0x00000439 _0800FFE4: .4byte gPlayerParty _0800FFE8: .4byte gBattleCommunication - thumb_func_end sub_800FE24 + thumb_func_end CB2_InitBattleInternal thumb_func_start sub_800FFEC sub_800FFEC: @ 800FFEC @@ -361,8 +361,8 @@ _080100B0: .4byte gPlayerParty _080100B4: .4byte gBattleStruct thumb_func_end sub_800FFEC - thumb_func_start sub_80100B8 -sub_80100B8: @ 80100B8 + thumb_func_start SetPlayerBerryDataInBattleStruct +SetPlayerBerryDataInBattleStruct: @ 80100B8 push {r4-r7,lr} ldr r0, _08010120 @ =gBattleStruct ldr r5, [r0] @@ -460,10 +460,10 @@ _08010174: pop {r4-r7} pop {r0} bx r0 - thumb_func_end sub_80100B8 + thumb_func_end SetPlayerBerryDataInBattleStruct - thumb_func_start sub_801017C -sub_801017C: @ 801017C + thumb_func_start SetAllPlayersBerryData +SetAllPlayersBerryData: @ 801017C push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -798,7 +798,7 @@ _080103FC: .align 2, 0 _0801040C: .4byte gEnigmaBerries _08010410: .4byte gBlockRecvBuffer + 4 - thumb_func_end sub_801017C + thumb_func_end SetAllPlayersBerryData thumb_func_start sub_8010414 sub_8010414: @ 8010414 @@ -936,8 +936,8 @@ _080104FC: bx r0 thumb_func_end sub_8010414 - thumb_func_start sub_8010508 -sub_8010508: @ 8010508 + thumb_func_start CB2_HandleStartBattle +CB2_HandleStartBattle: @ 8010508 push {r4-r6,lr} bl RunTasks bl AnimateSprites @@ -1045,7 +1045,7 @@ _080105EC: adds r0, r1 strb r6, [r0] bl sub_800FFEC - bl sub_80100B8 + bl SetPlayerBerryDataInBattleStruct bl bitmask_all_link_players_but_self lsls r0, 24 lsrs r0, 24 @@ -1080,7 +1080,7 @@ _08010658: ldr r1, _0801066C @ =gBattleCommunication movs r0, 0xF strb r0, [r1] - bl sub_801017C + bl SetAllPlayersBerryData b _080108B8 .align 2, 0 _0801066C: .4byte gBattleCommunication @@ -1096,7 +1096,7 @@ _0801067E: movs r0, 0x2 adds r1, r4, 0 bl sub_8010414 - bl sub_801017C + bl SetAllPlayersBerryData ldr r0, _080106E0 @ =sub_800F6FC movs r1, 0 bl CreateTask @@ -1253,21 +1253,21 @@ _080107CC: bl memcpy ldr r1, _08010828 @ =0xfffffe70 adds r0, r4, r1 - bl sub_8011D0C + bl TryCorrectShedinjaLanguage ldr r1, _0801082C @ =0xfffffed4 adds r0, r4, r1 - bl sub_8011D0C + bl TryCorrectShedinjaLanguage adds r0, r4, 0 subs r0, 0xC8 - bl sub_8011D0C + bl TryCorrectShedinjaLanguage adds r0, r4, 0 subs r0, 0x64 - bl sub_8011D0C + bl TryCorrectShedinjaLanguage adds r0, r4, 0 - bl sub_8011D0C + bl TryCorrectShedinjaLanguage adds r0, r4, 0 adds r0, 0x64 - bl sub_8011D0C + bl TryCorrectShedinjaLanguage ldr r1, _08010830 @ =gBattleCommunication b _080108B2 .align 2, 0 @@ -1299,7 +1299,7 @@ _0801084C: ldr r1, _08010888 @ =gMain ldr r0, [r1] str r0, [r2] - ldr r0, _0801088C @ =sub_80123E4 + ldr r0, _0801088C @ =BattleMainCB1 str r0, [r1] ldr r0, _08010890 @ =BattleMainCB2 bl SetMainCallback2 @@ -1317,7 +1317,7 @@ _0801084C: _08010880: .4byte gUnknown_2023E83 _08010884: .4byte gPreBattleCallback1 _08010888: .4byte gMain -_0801088C: .4byte sub_80123E4 +_0801088C: .4byte BattleMainCB1 _08010890: .4byte BattleMainCB2 _08010894: .4byte gBattleTypeFlags _08010898: @@ -1345,7 +1345,7 @@ _080108B8: bx r0 .align 2, 0 _080108C0: .4byte gBattleCommunication - thumb_func_end sub_8010508 + thumb_func_end CB2_HandleStartBattle thumb_func_start sub_80108C4 sub_80108C4: @ 80108C4 @@ -1472,8 +1472,8 @@ _080109C0: .4byte gPlayerParty _080109C4: .4byte gBattleStruct thumb_func_end sub_80108C4 - thumb_func_start sub_80109C8 -sub_80109C8: @ 80109C8 + thumb_func_start CB2_PreInitMultiBattle +CB2_PreInitMultiBattle: @ 80109C8 push {r4-r7,lr} mov r7, r9 mov r6, r8 @@ -1608,7 +1608,7 @@ _08010ABA: ldr r0, [r0] mov r2, r8 strh r0, [r2] - ldr r0, _08010AF8 @ =sub_80109C8 + ldr r0, _08010AF8 @ =CB2_PreInitMultiBattle str r0, [r1, 0x8] bl sub_8128198 b _08010B82 @@ -1618,7 +1618,7 @@ _08010AE8: .4byte gUnknown_2022B58 _08010AEC: .4byte gBattleCommunication _08010AF0: .4byte gMain _08010AF4: .4byte gBattleTypeFlags -_08010AF8: .4byte sub_80109C8 +_08010AF8: .4byte CB2_PreInitMultiBattle _08010AFC: ldr r0, _08010B1C @ =gPaletteFade ldrb r1, [r0, 0x7] @@ -1657,14 +1657,14 @@ _08010B2A: mov r2, r9 ldr r0, [r2] str r0, [r1, 0x8] - ldr r0, _08010B60 @ =sub_800FE24 + ldr r0, _08010B60 @ =CB2_InitBattleInternal bl SetMainCallback2 b _08010B82 .align 2, 0 _08010B54: .4byte gWirelessCommType _08010B58: .4byte gBattleTypeFlags _08010B5C: .4byte gMain -_08010B60: .4byte sub_800FE24 +_08010B60: .4byte CB2_InitBattleInternal _08010B64: ldr r0, _08010B90 @ =gReceivedRemoteLinkPlayers ldrb r0, [r0] @@ -1678,7 +1678,7 @@ _08010B64: mov r2, r9 ldr r0, [r2] str r0, [r1, 0x8] - ldr r0, _08010B9C @ =sub_800FE24 + ldr r0, _08010B9C @ =CB2_InitBattleInternal bl SetMainCallback2 _08010B82: pop {r3,r4} @@ -1691,11 +1691,11 @@ _08010B82: _08010B90: .4byte gReceivedRemoteLinkPlayers _08010B94: .4byte gBattleTypeFlags _08010B98: .4byte gMain -_08010B9C: .4byte sub_800FE24 - thumb_func_end sub_80109C8 +_08010B9C: .4byte CB2_InitBattleInternal + thumb_func_end CB2_PreInitMultiBattle - thumb_func_start sub_8010BA0 -sub_8010BA0: @ 8010BA0 + thumb_func_start CB2_HandleStartMultiBattle +CB2_HandleStartMultiBattle: @ 8010BA0 push {r4-r7,lr} mov r7, r8 push {r7} @@ -1792,7 +1792,7 @@ _08010C66: movs r0, 0x2 strb r0, [r1] bl sub_800FFEC - bl sub_80100B8 + bl SetPlayerBerryDataInBattleStruct bl bitmask_all_link_players_but_self lsls r0, 24 lsrs r0, 24 @@ -1833,7 +1833,7 @@ _08010CE2: movs r0, 0x4 adds r1, r7, 0 bl sub_8010414 - bl sub_801017C + bl SetAllPlayersBerryData bl SetDeoxysStats ldr r0, _08010D4C @ =gDecompressionBuffer ldr r1, _08010D50 @ =gPlayerParty @@ -2233,46 +2233,46 @@ _08010FDE: ble _08010F20 ldr r4, _08011060 @ =gPlayerParty adds r0, r4, 0 - bl sub_8011D0C + bl TryCorrectShedinjaLanguage adds r0, r4, 0 adds r0, 0x64 - bl sub_8011D0C + bl TryCorrectShedinjaLanguage adds r0, r4, 0 adds r0, 0xC8 - bl sub_8011D0C + bl TryCorrectShedinjaLanguage movs r1, 0x96 lsls r1, 1 adds r0, r4, r1 - bl sub_8011D0C + bl TryCorrectShedinjaLanguage movs r2, 0xC8 lsls r2, 1 adds r0, r4, r2 - bl sub_8011D0C + bl TryCorrectShedinjaLanguage movs r1, 0xFA lsls r1, 1 adds r0, r4, r1 - bl sub_8011D0C + bl TryCorrectShedinjaLanguage ldr r4, _08011064 @ =gEnemyParty adds r0, r4, 0 - bl sub_8011D0C + bl TryCorrectShedinjaLanguage adds r0, r4, 0 adds r0, 0x64 - bl sub_8011D0C + bl TryCorrectShedinjaLanguage adds r0, r4, 0 adds r0, 0xC8 - bl sub_8011D0C + bl TryCorrectShedinjaLanguage movs r2, 0x96 lsls r2, 1 adds r0, r4, r2 - bl sub_8011D0C + bl TryCorrectShedinjaLanguage movs r1, 0xC8 lsls r1, 1 adds r0, r4, r1 - bl sub_8011D0C + bl TryCorrectShedinjaLanguage movs r2, 0xFA lsls r2, 1 adds r0, r4, r2 - bl sub_8011D0C + bl TryCorrectShedinjaLanguage ldr r1, _08011068 @ =gBattleCommunication b _080110EA .align 2, 0 @@ -2303,7 +2303,7 @@ _08011084: ldr r1, _080110C0 @ =gMain ldr r0, [r1] str r0, [r2] - ldr r0, _080110C4 @ =sub_80123E4 + ldr r0, _080110C4 @ =BattleMainCB1 str r0, [r1] ldr r0, _080110C8 @ =BattleMainCB2 bl SetMainCallback2 @@ -2321,7 +2321,7 @@ _08011084: _080110B8: .4byte gUnknown_2023E83 _080110BC: .4byte gPreBattleCallback1 _080110C0: .4byte gMain -_080110C4: .4byte sub_80123E4 +_080110C4: .4byte BattleMainCB1 _080110C8: .4byte BattleMainCB2 _080110CC: .4byte gBattleTypeFlags _080110D0: @@ -2351,7 +2351,7 @@ _080110F0: bx r0 .align 2, 0 _080110FC: .4byte gBattleCommunication - thumb_func_end sub_8010BA0 + thumb_func_end CB2_HandleStartMultiBattle thumb_func_start BattleMainCB2 BattleMainCB2: @ 8011100 @@ -2389,7 +2389,7 @@ BattleMainCB2: @ 8011100 movs r2, 0 movs r3, 0x10 bl BeginNormalPaletteFade - ldr r0, _08011170 @ =CB2_QuitRecordedBattle + ldr r0, _08011170 @ =CB2_QuitPokeDudeBattle bl SetMainCallback2 _08011158: add sp, 0x4 @@ -2400,7 +2400,7 @@ _08011160: .4byte gMain _08011164: .4byte gBattleTypeFlags _08011168: .4byte gSpecialVar_Result _0801116C: .4byte gBattleOutcome -_08011170: .4byte CB2_QuitRecordedBattle +_08011170: .4byte CB2_QuitPokeDudeBattle thumb_func_end BattleMainCB2 thumb_func_start FreeRestoreBattleData @@ -2435,8 +2435,8 @@ _080111B4: .4byte gScanlineEffect _080111B8: .4byte 0x00000439 thumb_func_end FreeRestoreBattleData - thumb_func_start CB2_QuitRecordedBattle -CB2_QuitRecordedBattle: @ 80111BC + thumb_func_start CB2_QuitPokeDudeBattle +CB2_QuitPokeDudeBattle: @ 80111BC push {lr} bl UpdatePaletteFade ldr r0, _080111E4 @ =gPaletteFade @@ -2456,7 +2456,7 @@ _080111DE: .align 2, 0 _080111E4: .4byte gPaletteFade _080111E8: .4byte gMain - thumb_func_end CB2_QuitRecordedBattle + thumb_func_end CB2_QuitPokeDudeBattle thumb_func_start sub_80111EC sub_80111EC: @ 80111EC @@ -2575,7 +2575,7 @@ _080112A0: movs r0, 0 str r0, [r4] _080112CA: - ldr r0, _080112DC @ =sub_800FD9C + ldr r0, _080112DC @ =CB2_InitBattle bl SetMainCallback2 _080112D0: pop {r4-r7} @@ -2583,11 +2583,11 @@ _080112D0: bx r0 .align 2, 0 _080112D8: .4byte gUnknown_2022BC0 -_080112DC: .4byte sub_800FD9C +_080112DC: .4byte CB2_InitBattle thumb_func_end sub_80111FC - thumb_func_start sub_80112E0 -sub_80112E0: @ 80112E0 + thumb_func_start CreateNPCTrainerParty +CreateNPCTrainerParty: @ 80112E0 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -3096,7 +3096,7 @@ _080116BC: .4byte gSpeciesNames _080116C0: .4byte gBattleMoves+0x4 _080116C4: .4byte gTrainers _080116C8: .4byte gBattleTypeFlags - thumb_func_end sub_80112E0 + thumb_func_end CreateNPCTrainerParty thumb_func_start sub_80116CC sub_80116CC: @ 80116CC @@ -3165,11 +3165,11 @@ VBlankCB_Battle: @ 80116F4 ldrh r1, [r0] movs r0, 0x44 bl SetGpuReg - ldr r0, _080117B0 @ =gUnknown_2022988 + ldr r0, _080117B0 @ =gBattle_WIN1H ldrh r1, [r0] movs r0, 0x42 bl SetGpuReg - ldr r0, _080117B4 @ =gUnknown_202298A + ldr r0, _080117B4 @ =gBattle_WIN1V ldrh r1, [r0] movs r0, 0x46 bl SetGpuReg @@ -3190,8 +3190,8 @@ _080117A0: .4byte gBattle_BG3_X _080117A4: .4byte gBattle_BG3_Y _080117A8: .4byte gBattle_WIN0H _080117AC: .4byte gBattle_WIN0V -_080117B0: .4byte gUnknown_2022988 -_080117B4: .4byte gUnknown_202298A +_080117B0: .4byte gBattle_WIN1H +_080117B4: .4byte gBattle_WIN1V thumb_func_end VBlankCB_Battle thumb_func_start nullsub_9 @@ -3776,7 +3776,7 @@ _08011C64: .4byte _08011CE4 .4byte _08011CF8 _08011C80: - ldr r0, _08011C90 @ =gUnknown_8248320 + ldr r0, _08011C90 @ =gBattleBgTemplates lsls r1, r2, 2 adds r1, r0 ldrb r0, [r1] @@ -3784,9 +3784,9 @@ _08011C80: lsrs r0, 30 b _08011D04 .align 2, 0 -_08011C90: .4byte gUnknown_8248320 +_08011C90: .4byte gBattleBgTemplates _08011C94: - ldr r0, _08011CA4 @ =gUnknown_8248320 + ldr r0, _08011CA4 @ =gBattleBgTemplates lsls r1, r2, 2 adds r1, r0 ldrb r0, [r1] @@ -3794,9 +3794,9 @@ _08011C94: lsrs r0, 30 b _08011D04 .align 2, 0 -_08011CA4: .4byte gUnknown_8248320 +_08011CA4: .4byte gBattleBgTemplates _08011CA8: - ldr r0, _08011CB8 @ =gUnknown_8248320 + ldr r0, _08011CB8 @ =gBattleBgTemplates lsls r1, r2, 2 adds r1, r0 ldrh r0, [r1] @@ -3804,9 +3804,9 @@ _08011CA8: lsrs r0, 27 b _08011D04 .align 2, 0 -_08011CB8: .4byte gUnknown_8248320 +_08011CB8: .4byte gBattleBgTemplates _08011CBC: - ldr r0, _08011CCC @ =gUnknown_8248320 + ldr r0, _08011CCC @ =gBattleBgTemplates lsls r1, r2, 2 adds r1, r0 ldrb r0, [r1, 0x1] @@ -3814,9 +3814,9 @@ _08011CBC: lsrs r0, 30 b _08011D04 .align 2, 0 -_08011CCC: .4byte gUnknown_8248320 +_08011CCC: .4byte gBattleBgTemplates _08011CD0: - ldr r0, _08011CE0 @ =gUnknown_8248320 + ldr r0, _08011CE0 @ =gBattleBgTemplates lsls r1, r2, 2 adds r1, r0 ldrb r0, [r1, 0x1] @@ -3824,9 +3824,9 @@ _08011CD0: lsrs r0, 31 b _08011D04 .align 2, 0 -_08011CE0: .4byte gUnknown_8248320 +_08011CE0: .4byte gBattleBgTemplates _08011CE4: - ldr r0, _08011CF4 @ =gUnknown_8248320 + ldr r0, _08011CF4 @ =gBattleBgTemplates lsls r1, r2, 2 adds r1, r0 ldrb r0, [r1, 0x1] @@ -3834,9 +3834,9 @@ _08011CE4: lsrs r0, 30 b _08011D04 .align 2, 0 -_08011CF4: .4byte gUnknown_8248320 +_08011CF4: .4byte gBattleBgTemplates _08011CF8: - ldr r0, _08011D08 @ =gUnknown_8248320 + ldr r0, _08011D08 @ =gBattleBgTemplates lsls r1, r2, 2 adds r1, r0 ldr r0, [r1] @@ -3846,11 +3846,11 @@ _08011D04: pop {r1} bx r1 .align 2, 0 -_08011D08: .4byte gUnknown_8248320 +_08011D08: .4byte gBattleBgTemplates thumb_func_end sub_8011C44 - thumb_func_start sub_8011D0C -sub_8011D0C: @ 8011D0C + thumb_func_start TryCorrectShedinjaLanguage +TryCorrectShedinjaLanguage: @ 8011D0C push {r4,r5,lr} sub sp, 0x10 adds r4, r0, 0 @@ -3873,7 +3873,7 @@ sub_8011D0C: @ 8011D0C movs r1, 0x2 mov r2, sp bl GetMonData - ldr r1, _08011D60 @ =gUnknown_824F008 + ldr r1, _08011D60 @ =sText_ShedinjaJpnName mov r0, sp bl StringCompareWithoutExtCtrlCodes cmp r0, 0 @@ -3889,14 +3889,14 @@ _08011D54: bx r0 .align 2, 0 _08011D5C: .4byte 0x0000012f -_08011D60: .4byte gUnknown_824F008 - thumb_func_end sub_8011D0C +_08011D60: .4byte sText_ShedinjaJpnName + thumb_func_end TryCorrectShedinjaLanguage - thumb_func_start oac_poke_opponent -oac_poke_opponent: @ 8011D64 + thumb_func_start SpriteCB_WildMon +SpriteCB_WildMon: @ 8011D64 push {lr} sub sp, 0x4 - ldr r1, _08011D8C @ =sub_8011D94 + ldr r1, _08011D8C @ =SpriteCB_MoveWildMonToRight str r1, [r0, 0x1C] movs r1, 0 bl StartSpriteAnimIfDifferent @@ -3912,12 +3912,12 @@ oac_poke_opponent: @ 8011D64 pop {r0} bx r0 .align 2, 0 -_08011D8C: .4byte sub_8011D94 +_08011D8C: .4byte SpriteCB_MoveWildMonToRight _08011D90: .4byte 0x00002108 - thumb_func_end oac_poke_opponent + thumb_func_end SpriteCB_WildMon - thumb_func_start sub_8011D94 -sub_8011D94: @ 8011D94 + thumb_func_start SpriteCB_MoveWildMonToRight +SpriteCB_MoveWildMonToRight: @ 8011D94 push {lr} adds r2, r0, 0 ldr r0, _08011DC0 @ =gIntroSlideFlags @@ -3932,7 +3932,7 @@ sub_8011D94: @ 8011D94 lsls r0, 16 cmp r0, 0 bne _08011DBC - ldr r0, _08011DC4 @ =sub_8011DC8 + ldr r0, _08011DC4 @ =SpriteCB_WildMonShowHealthbox str r0, [r2, 0x1C] ldrh r0, [r2, 0x32] movs r1, 0x19 @@ -3942,11 +3942,11 @@ _08011DBC: bx r0 .align 2, 0 _08011DC0: .4byte gIntroSlideFlags -_08011DC4: .4byte sub_8011DC8 - thumb_func_end sub_8011D94 +_08011DC4: .4byte SpriteCB_WildMonShowHealthbox + thumb_func_end SpriteCB_MoveWildMonToRight - thumb_func_start sub_8011DC8 -sub_8011DC8: @ 8011DC8 + thumb_func_start SpriteCB_WildMonShowHealthbox +SpriteCB_WildMonShowHealthbox: @ 8011DC8 push {r4,lr} sub sp, 0x4 adds r4, r0, 0 @@ -3966,7 +3966,7 @@ sub_8011DC8: @ 8011DC8 adds r0, r1 ldrb r0, [r0] bl SetHealthboxSpriteVisible - ldr r0, _08011E1C @ =nullsub_10 + ldr r0, _08011E1C @ =SpriteCallbackDummy2 str r0, [r4, 0x1C] adds r0, r4, 0 movs r1, 0 @@ -3986,14 +3986,14 @@ _08011E10: bx r0 .align 2, 0 _08011E18: .4byte gHealthboxSpriteIds -_08011E1C: .4byte nullsub_10 +_08011E1C: .4byte SpriteCallbackDummy2 _08011E20: .4byte 0x00002108 - thumb_func_end sub_8011DC8 + thumb_func_end SpriteCB_WildMonShowHealthbox - thumb_func_start nullsub_10 -nullsub_10: @ 8011E24 + thumb_func_start SpriteCallbackDummy2 +SpriteCallbackDummy2: @ 8011E24 bx lr - thumb_func_end nullsub_10 + thumb_func_end SpriteCallbackDummy2 thumb_func_start sub_8011E28 sub_8011E28: @ 8011E28 @@ -4048,7 +4048,7 @@ sub_8011E3C: @ 8011E3C ands r0, r1 mov r1, r12 strb r0, [r1] - ldr r0, _08011E98 @ =nullsub_10 + ldr r0, _08011E98 @ =SpriteCallbackDummy2 str r0, [r3, 0x1C] ldr r0, _08011E9C @ =gUnknown_2022AE8 str r2, [r0] @@ -4057,7 +4057,7 @@ _08011E90: pop {r0} bx r0 .align 2, 0 -_08011E98: .4byte nullsub_10 +_08011E98: .4byte SpriteCallbackDummy2 _08011E9C: .4byte gUnknown_2022AE8 thumb_func_end sub_8011E3C @@ -4190,7 +4190,7 @@ _08011F8C: strh r0, [r1, 0x34] movs r0, 0x1 strh r0, [r1, 0x36] - ldr r0, _08011FB0 @ =sub_8011FB4 + ldr r0, _08011FB0 @ =SpriteCB_AnimFaintOpponent str r0, [r1, 0x1C] pop {r3,r4} mov r8, r3 @@ -4200,11 +4200,11 @@ _08011F8C: bx r0 .align 2, 0 _08011FAC: .4byte gMonFrontPicCoords -_08011FB0: .4byte sub_8011FB4 +_08011FB0: .4byte SpriteCB_AnimFaintOpponent thumb_func_end SpriteCB_FaintOpponentMon - thumb_func_start sub_8011FB4 -sub_8011FB4: @ 8011FB4 + thumb_func_start SpriteCB_AnimFaintOpponent +SpriteCB_AnimFaintOpponent: @ 8011FB4 push {r4,lr} adds r4, r0, 0 ldrh r0, [r4, 0x36] @@ -4274,7 +4274,7 @@ _08012034: .align 2, 0 _0801203C: .4byte gMonSpritesGfxPtr _08012040: .4byte gBattleMonForms - thumb_func_end sub_8011FB4 + thumb_func_end SpriteCB_AnimFaintOpponent thumb_func_start sub_8012044 sub_8012044: @ 8012044 @@ -4344,11 +4344,11 @@ sub_8012098: @ 8012098 strb r1, [r2] movs r1, 0 strh r1, [r0, 0x36] - ldr r1, _080120C0 @ =nullsub_10 + ldr r1, _080120C0 @ =SpriteCallbackDummy2 str r1, [r0, 0x1C] bx lr .align 2, 0 -_080120C0: .4byte nullsub_10 +_080120C0: .4byte SpriteCallbackDummy2 thumb_func_end sub_8012098 thumb_func_start sub_80120C4 @@ -4377,7 +4377,7 @@ oac_poke_ally_: @ 80120D0 asrs r1, r0, 16 cmp r1, 0 bne _080120F4 - ldr r0, _080120FC @ =nullsub_11 + ldr r0, _080120FC @ =SpriteCallbackDummy3 str r0, [r2, 0x1C] strh r1, [r2, 0x30] _080120F4: @@ -4385,22 +4385,22 @@ _080120F4: bx r0 .align 2, 0 _080120F8: .4byte gIntroSlideFlags -_080120FC: .4byte nullsub_11 +_080120FC: .4byte SpriteCallbackDummy3 thumb_func_end oac_poke_ally_ thumb_func_start sub_8012100 sub_8012100: @ 8012100 - ldr r1, _08012108 @ =nullsub_11 + ldr r1, _08012108 @ =SpriteCallbackDummy3 str r1, [r0, 0x1C] bx lr .align 2, 0 -_08012108: .4byte nullsub_11 +_08012108: .4byte SpriteCallbackDummy3 thumb_func_end sub_8012100 - thumb_func_start nullsub_11 -nullsub_11: @ 801210C + thumb_func_start SpriteCallbackDummy3 +SpriteCallbackDummy3: @ 801210C bx lr - thumb_func_end nullsub_11 + thumb_func_end SpriteCallbackDummy3 thumb_func_start sub_8012110 sub_8012110: @ 8012110 @@ -4474,7 +4474,7 @@ _08012186: adds r6, r2, 0 cmp r0, 0 bne _0801223C - ldr r0, _080121D4 @ =SpriteCB_HealthBoxBounce + ldr r0, _080121D4 @ =SpriteCB_BounceEffect bl CreateInvisibleSpriteWithCallback lsls r0, 24 lsrs r5, r0, 24 @@ -4507,7 +4507,7 @@ _08012186: b _0801220E .align 2, 0 _080121D0: .4byte gBattleSpritesDataPtr -_080121D4: .4byte SpriteCB_HealthBoxBounce +_080121D4: .4byte SpriteCB_BounceEffect _080121D8: .4byte gHealthboxSpriteIds _080121DC: .4byte gSprites _080121E0: @@ -4662,8 +4662,8 @@ _08012300: .4byte gBattleSpritesDataPtr _08012304: .4byte gSprites thumb_func_end EndBounceEffect - thumb_func_start SpriteCB_HealthBoxBounce -SpriteCB_HealthBoxBounce: @ 8012308 + thumb_func_start SpriteCB_BounceEffect +SpriteCB_BounceEffect: @ 8012308 push {r4,r5,lr} adds r4, r0, 0 ldrh r0, [r4, 0x34] @@ -4702,7 +4702,7 @@ _08012324: bx r0 .align 2, 0 _08012350: .4byte gSprites - thumb_func_end SpriteCB_HealthBoxBounce + thumb_func_end SpriteCB_BounceEffect thumb_func_start sub_8012354 sub_8012354: @ 8012354 @@ -4757,14 +4757,14 @@ sub_8012398: @ 8012398 ands r0, r1 cmp r0, 0 beq _080123B2 - ldr r0, _080123B8 @ =nullsub_11 + ldr r0, _080123B8 @ =SpriteCallbackDummy3 str r0, [r4, 0x1C] _080123B2: pop {r4} pop {r0} bx r0 .align 2, 0 -_080123B8: .4byte nullsub_11 +_080123B8: .4byte SpriteCallbackDummy3 thumb_func_end sub_8012398 thumb_func_start nullsub_12 @@ -4775,7 +4775,7 @@ nullsub_12: @ 80123BC thumb_func_start BeginBattleIntro BeginBattleIntro: @ 80123C0 push {lr} - bl sub_8012434 + bl BattleStartClearSetData ldr r1, _080123D8 @ =gBattleCommunication movs r0, 0 strb r0, [r1, 0x1] @@ -4790,8 +4790,8 @@ _080123DC: .4byte gBattleMainFunc _080123E0: .4byte BattleIntroGetMonsData thumb_func_end BeginBattleIntro - thumb_func_start sub_80123E4 -sub_80123E4: @ 80123E4 + thumb_func_start BattleMainCB1 +BattleMainCB1: @ 80123E4 push {r4,r5,lr} ldr r0, _08012424 @ =gBattleMainFunc ldr r0, [r0] @@ -4829,10 +4829,10 @@ _08012424: .4byte gBattleMainFunc _08012428: .4byte gActiveBattler _0801242C: .4byte gBattlersCount _08012430: .4byte gBattlerControllerFuncs - thumb_func_end sub_80123E4 + thumb_func_end BattleMainCB1 - thumb_func_start sub_8012434 -sub_8012434: @ 8012434 + thumb_func_start BattleStartClearSetData +BattleStartClearSetData: @ 8012434 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -5208,7 +5208,7 @@ _08012750: .4byte gEnemyParty _08012754: .4byte gBaseStats _08012758: .4byte 0x000004fb _0801275C: .4byte gBattleResults - thumb_func_end sub_8012434 + thumb_func_end BattleStartClearSetData thumb_func_start SwitchInClearSetData SwitchInClearSetData: @ 8012760 @@ -6336,7 +6336,7 @@ BattleIntroPrepareBackgroundSlide: @ 8013020 ldrb r0, [r4] bl MarkBattlerForControllerExec ldr r1, _08013064 @ =gBattleMainFunc - ldr r0, _08013068 @ =sub_8013070 + ldr r0, _08013068 @ =BattleIntroDrawTrainersOrMonsSprites str r0, [r1] ldr r0, _0801306C @ =gBattleCommunication strb r5, [r0] @@ -6350,12 +6350,12 @@ _08013058: .4byte gBattleControllerExecFlags _0801305C: .4byte gActiveBattler _08013060: .4byte gBattleTerrain _08013064: .4byte gBattleMainFunc -_08013068: .4byte sub_8013070 +_08013068: .4byte BattleIntroDrawTrainersOrMonsSprites _0801306C: .4byte gBattleCommunication thumb_func_end BattleIntroPrepareBackgroundSlide - thumb_func_start sub_8013070 -sub_8013070: @ 8013070 + thumb_func_start BattleIntroDrawTrainersOrMonsSprites +BattleIntroDrawTrainersOrMonsSprites: @ 8013070 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -6691,7 +6691,7 @@ _0801332C: .4byte gActiveBattler _08013330: .4byte gBattlersCount _08013334: .4byte gBattleMainFunc _08013338: .4byte BattleIntroDrawPartySummaryScreens - thumb_func_end sub_8013070 + thumb_func_end BattleIntroDrawTrainersOrMonsSprites thumb_func_start BattleIntroDrawPartySummaryScreens BattleIntroDrawPartySummaryScreens: @ 801333C @@ -6909,7 +6909,7 @@ BattleIntroPrintTrainerWantsToBattle: @ 80134DC movs r0, 0 bl PrepareStringBattle ldr r1, _0801350C @ =gBattleMainFunc - ldr r0, _08013510 @ =sub_8013568 + ldr r0, _08013510 @ =BattleIntroPrintWildMonAttacked str r0, [r1] _080134FE: pop {r0} @@ -6918,7 +6918,7 @@ _080134FE: _08013504: .4byte gBattleControllerExecFlags _08013508: .4byte gActiveBattler _0801350C: .4byte gBattleMainFunc -_08013510: .4byte sub_8013568 +_08013510: .4byte BattleIntroPrintWildMonAttacked thumb_func_end BattleIntroPrintTrainerWantsToBattle thumb_func_start sub_8013514 @@ -6929,7 +6929,7 @@ sub_8013514: @ 8013514 cmp r0, 0 bne _0801354A ldr r1, _08013554 @ =gBattleMainFunc - ldr r0, _08013558 @ =sub_80136E4 + ldr r0, _08013558 @ =BattleIntroPrintPlayerSendsOut str r0, [r1] movs r0, 0 movs r1, 0 @@ -6953,14 +6953,14 @@ _0801354A: .align 2, 0 _08013550: .4byte gBattleControllerExecFlags _08013554: .4byte gBattleMainFunc -_08013558: .4byte sub_80136E4 +_08013558: .4byte BattleIntroPrintPlayerSendsOut _0801355C: .4byte gBattleTypeFlags _08013560: .4byte gBattleScripting _08013564: .4byte gUnknown_81D91A1 thumb_func_end sub_8013514 - thumb_func_start sub_8013568 -sub_8013568: @ 8013568 + thumb_func_start BattleIntroPrintWildMonAttacked +BattleIntroPrintWildMonAttacked: @ 8013568 push {lr} ldr r0, _08013590 @ =gBattleControllerExecFlags ldr r0, [r0] @@ -6974,7 +6974,7 @@ sub_8013568: @ 8013568 movs r0, 0x1 bl PrepareStringBattle ldr r1, _08013594 @ =gBattleMainFunc - ldr r0, _08013598 @ =sub_801359C + ldr r0, _08013598 @ =BattleIntroOpponentSendsOutMonAnimation str r0, [r1] _0801358A: pop {r0} @@ -6982,11 +6982,11 @@ _0801358A: .align 2, 0 _08013590: .4byte gBattleControllerExecFlags _08013594: .4byte gBattleMainFunc -_08013598: .4byte sub_801359C - thumb_func_end sub_8013568 +_08013598: .4byte BattleIntroOpponentSendsOutMonAnimation + thumb_func_end BattleIntroPrintWildMonAttacked - thumb_func_start sub_801359C -sub_801359C: @ 801359C + thumb_func_start BattleIntroOpponentSendsOutMonAnimation +BattleIntroOpponentSendsOutMonAnimation: @ 801359C push {r4,lr} ldr r0, _08013614 @ =gBattleControllerExecFlags ldr r1, [r0] @@ -7039,7 +7039,7 @@ _080135F4: bcc _080135B4 _08013606: ldr r1, _08013624 @ =gBattleMainFunc - ldr r0, _08013628 @ =sub_801362C + ldr r0, _08013628 @ =BattleIntroRecordMonsToDex str r0, [r1] _0801360C: pop {r4} @@ -7051,11 +7051,11 @@ _08013618: .4byte gActiveBattler _0801361C: .4byte gBattlersCount _08013620: .4byte gBattleTypeFlags _08013624: .4byte gBattleMainFunc -_08013628: .4byte sub_801362C - thumb_func_end sub_801359C +_08013628: .4byte BattleIntroRecordMonsToDex + thumb_func_end BattleIntroOpponentSendsOutMonAnimation - thumb_func_start sub_801362C -sub_801362C: @ 801362C + thumb_func_start BattleIntroRecordMonsToDex +BattleIntroRecordMonsToDex: @ 801362C push {r4-r7,lr} ldr r0, _080136A4 @ =gBattleControllerExecFlags ldr r1, [r0] @@ -7110,7 +7110,7 @@ _08013684: bcc _0801364C _08013696: ldr r1, _080136BC @ =gBattleMainFunc - ldr r0, _080136C0 @ =sub_80136E4 + ldr r0, _080136C0 @ =BattleIntroPrintPlayerSendsOut str r0, [r1] _0801369C: pop {r4-r7} @@ -7124,8 +7124,8 @@ _080136B0: .4byte gBattleMons _080136B4: .4byte gBattleTypeFlags _080136B8: .4byte 0x0001aa02 _080136BC: .4byte gBattleMainFunc -_080136C0: .4byte sub_80136E4 - thumb_func_end sub_801362C +_080136C0: .4byte BattleIntroPrintPlayerSendsOut + thumb_func_end BattleIntroRecordMonsToDex thumb_func_start sub_80136C4 sub_80136C4: @ 80136C4 @@ -7135,7 +7135,7 @@ sub_80136C4: @ 80136C4 cmp r0, 0 bne _080136D4 ldr r1, _080136DC @ =gBattleMainFunc - ldr r0, _080136E0 @ =sub_80136E4 + ldr r0, _080136E0 @ =BattleIntroPrintPlayerSendsOut str r0, [r1] _080136D4: pop {r0} @@ -7143,11 +7143,11 @@ _080136D4: .align 2, 0 _080136D8: .4byte gBattleControllerExecFlags _080136DC: .4byte gBattleMainFunc -_080136E0: .4byte sub_80136E4 +_080136E0: .4byte BattleIntroPrintPlayerSendsOut thumb_func_end sub_80136C4 - thumb_func_start sub_80136E4 -sub_80136E4: @ 80136E4 + thumb_func_start BattleIntroPrintPlayerSendsOut +BattleIntroPrintPlayerSendsOut: @ 80136E4 push {lr} ldr r0, _08013718 @ =gBattleControllerExecFlags ldr r0, [r0] @@ -7168,7 +7168,7 @@ sub_80136E4: @ 80136E4 bl PrepareStringBattle _0801370C: ldr r1, _08013720 @ =gBattleMainFunc - ldr r0, _08013724 @ =sub_8013728 + ldr r0, _08013724 @ =BattleIntroPlayerSendsOutMonAnimation str r0, [r1] _08013712: pop {r0} @@ -7177,11 +7177,11 @@ _08013712: _08013718: .4byte gBattleControllerExecFlags _0801371C: .4byte gBattleTypeFlags _08013720: .4byte gBattleMainFunc -_08013724: .4byte sub_8013728 - thumb_func_end sub_80136E4 +_08013724: .4byte BattleIntroPlayerSendsOutMonAnimation + thumb_func_end BattleIntroPrintPlayerSendsOut - thumb_func_start sub_8013728 -sub_8013728: @ 8013728 + thumb_func_start BattleIntroPlayerSendsOutMonAnimation +BattleIntroPlayerSendsOutMonAnimation: @ 8013728 push {r4,lr} ldr r0, _080137B4 @ =gBattleControllerExecFlags ldr r1, [r0] @@ -7244,7 +7244,7 @@ _08013790: adds r0, 0xB6 strb r1, [r0] ldr r1, _080137C8 @ =gBattleMainFunc - ldr r0, _080137CC @ =sub_801385C + ldr r0, _080137CC @ =TryDoEventsBeforeFirstTurn str r0, [r1] _080137AC: pop {r4} @@ -7257,8 +7257,8 @@ _080137BC: .4byte gBattlersCount _080137C0: .4byte gBattleTypeFlags _080137C4: .4byte gBattleStruct _080137C8: .4byte gBattleMainFunc -_080137CC: .4byte sub_801385C - thumb_func_end sub_8013728 +_080137CC: .4byte TryDoEventsBeforeFirstTurn + thumb_func_end BattleIntroPlayerSendsOutMonAnimation thumb_func_start sub_80137D0 sub_80137D0: @ 80137D0 @@ -7313,7 +7313,7 @@ _0801381E: adds r0, 0xB6 strb r1, [r0] ldr r1, _08013854 @ =gBattleMainFunc - ldr r0, _08013858 @ =sub_801385C + ldr r0, _08013858 @ =TryDoEventsBeforeFirstTurn str r0, [r1] _0801383A: pop {r4,r5} @@ -7326,11 +7326,11 @@ _08013848: .4byte gBattlersCount _0801384C: .4byte gBattlerPartyIndexes _08013850: .4byte gBattleStruct _08013854: .4byte gBattleMainFunc -_08013858: .4byte sub_801385C +_08013858: .4byte TryDoEventsBeforeFirstTurn thumb_func_end sub_80137D0 - thumb_func_start sub_801385C -sub_801385C: @ 801385C + thumb_func_start TryDoEventsBeforeFirstTurn +TryDoEventsBeforeFirstTurn: @ 801385C push {r4-r7,lr} mov r7, r9 mov r6, r8 @@ -7599,7 +7599,7 @@ _08013A32: ldrb r1, [r1] strb r1, [r0] ldr r1, _08013B00 @ =gBattleMainFunc - ldr r0, _08013B04 @ =sub_8014040 + ldr r0, _08013B04 @ =HandleTurnActionSelectionState str r0, [r1] bl ResetSentPokesToOpponentValue ldr r1, _08013B08 @ =gBattleCommunication @@ -7656,7 +7656,7 @@ _08013AA6: strb r1, [r0, 0x3] strb r1, [r7] bl Random - ldr r1, _08013B18 @ =gUnknown_2023E80 + ldr r1, _08013B18 @ =gRandomTurnNumber strh r0, [r1] _08013ADA: add sp, 0x8 @@ -7674,16 +7674,16 @@ _08013AF4: .4byte gChosenActionByBattler _08013AF8: .4byte gChosenMoveByBattler _08013AFC: .4byte gAbsentBattlerFlags _08013B00: .4byte gBattleMainFunc -_08013B04: .4byte sub_8014040 +_08013B04: .4byte HandleTurnActionSelectionState _08013B08: .4byte gBattleCommunication _08013B0C: .4byte gBattleScripting _08013B10: .4byte gMoveResultFlags _08013B14: .4byte gBattleMons -_08013B18: .4byte gUnknown_2023E80 - thumb_func_end sub_801385C +_08013B18: .4byte gRandomTurnNumber + thumb_func_end TryDoEventsBeforeFirstTurn - thumb_func_start sub_8013B1C -sub_8013B1C: @ 8013B1C + thumb_func_start HandleEndTurn_ContinueBattle +HandleEndTurn_ContinueBattle: @ 8013B1C push {r4-r6,lr} ldr r0, _08013BB4 @ =gBattleControllerExecFlags ldr r0, [r0] @@ -7772,7 +7772,7 @@ _08013BC4: .4byte gBattleCommunication _08013BC8: .4byte gBattleMons _08013BCC: .4byte gBattleStruct _08013BD0: .4byte gMoveResultFlags - thumb_func_end sub_8013B1C + thumb_func_end HandleEndTurn_ContinueBattle thumb_func_start BattleTurnPassed BattleTurnPassed: @ 8013BD4 @@ -7886,7 +7886,7 @@ _08013CBC: mov r10, r1 ldr r0, _08013D40 @ =gAbsentBattlerFlags mov r12, r0 - ldr r1, _08013D44 @ =sub_8014040 + ldr r1, _08013D44 @ =HandleTurnActionSelectionState mov r9, r1 ldrb r0, [r4] cmp r2, r0 @@ -7928,7 +7928,7 @@ _08013CF8: mov r1, r10 str r0, [r1] bl Random - ldr r1, _08013D50 @ =gUnknown_2023E80 + ldr r1, _08013D50 @ =gRandomTurnNumber strh r0, [r1] _08013D20: pop {r3-r5} @@ -7944,10 +7944,10 @@ _08013D34: .4byte gBattlersCount _08013D38: .4byte gBattleStruct _08013D3C: .4byte gBattleMainFunc _08013D40: .4byte gAbsentBattlerFlags -_08013D44: .4byte sub_8014040 +_08013D44: .4byte HandleTurnActionSelectionState _08013D48: .4byte gChosenActionByBattler _08013D4C: .4byte gChosenMoveByBattler -_08013D50: .4byte gUnknown_2023E80 +_08013D50: .4byte gRandomTurnNumber thumb_func_end BattleTurnPassed thumb_func_start IsRunningFromBattleImpossible @@ -8327,8 +8327,8 @@ _08014032: _0801403C: .4byte gUnknown_203B0DC thumb_func_end sub_8013F6C - thumb_func_start sub_8014040 -sub_8014040: @ 8014040 + thumb_func_start HandleTurnActionSelectionState +HandleTurnActionSelectionState: @ 8014040 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -8753,7 +8753,7 @@ _080143D4: ldrb r0, [r3] lsls r0, 2 adds r0, r1 - ldr r1, _0801441C @ =gUnknown_81D96A4 + ldr r1, _0801441C @ =BattleScript_ActionSelectionItemsCantBeUsed str r1, [r0] ldr r0, _08014420 @ =gBattleCommunication ldrb r1, [r3] @@ -8775,7 +8775,7 @@ _080143D4: _08014410: .4byte gBattleTypeFlags _08014414: .4byte 0x00000902 _08014418: .4byte gSelectionBattleScripts -_0801441C: .4byte gUnknown_81D96A4 +_0801441C: .4byte BattleScript_ActionSelectionItemsCantBeUsed _08014420: .4byte gBattleCommunication _08014424: .4byte gBattleStruct _08014428: @@ -9777,7 +9777,7 @@ _08014C68: cmp r0, r2 bne _08014C78 ldr r1, _08014C9C @ =gBattleMainFunc - ldr r0, _08014CA0 @ =sub_80150A8 + ldr r0, _08014CA0 @ =SetActionsAndBattlersTurnOrder str r0, [r1] _08014C78: add sp, 0x1C @@ -9795,8 +9795,8 @@ _08014C90: .4byte gActiveBattler _08014C94: .4byte gBattleCommunication _08014C98: .4byte gBattlersCount _08014C9C: .4byte gBattleMainFunc -_08014CA0: .4byte sub_80150A8 - thumb_func_end sub_8014040 +_08014CA0: .4byte SetActionsAndBattlersTurnOrder + thumb_func_end HandleTurnActionSelectionState thumb_func_start SwapTurnOrder SwapTurnOrder: @ 8014CA4 @@ -10029,7 +10029,7 @@ _08014E46: _08014E64: cmp r6, 0x1A bne _08014E80 - ldr r0, _08014ED0 @ =gUnknown_2023E80 + ldr r0, _08014ED0 @ =gRandomTurnNumber ldrh r4, [r0] lsls r0, r5, 16 subs r0, r5 @@ -10078,7 +10078,7 @@ _08014E80: _08014EC4: .4byte gBattleTypeFlags _08014EC8: .4byte 0x00000822 _08014ECC: .4byte gBattleMons -_08014ED0: .4byte gUnknown_2023E80 +_08014ED0: .4byte gRandomTurnNumber _08014ED4: .4byte gStatStageRatios _08014ED8: .4byte gEnigmaBerries _08014EDC: @@ -10134,7 +10134,7 @@ _08014F26: _08014F42: cmp r6, 0x1A bne _08014F5C - ldr r0, _08014F74 @ =gUnknown_2023E80 + ldr r0, _08014F74 @ =gRandomTurnNumber ldrh r4, [r0] lsls r0, r5, 16 subs r0, r5 @@ -10154,7 +10154,7 @@ _08014F5C: _08014F68: .4byte gBattleTypeFlags _08014F6C: .4byte 0x00000822 _08014F70: .4byte gBattleMons -_08014F74: .4byte gUnknown_2023E80 +_08014F74: .4byte gRandomTurnNumber _08014F78: ldr r0, _08014F98 @ =gChosenActionByBattler mov r3, r9 @@ -10316,8 +10316,8 @@ _08015096: bx r1 thumb_func_end GetWhoStrikesFirst - thumb_func_start sub_80150A8 -sub_80150A8: @ 80150A8 + thumb_func_start SetActionsAndBattlersTurnOrder +SetActionsAndBattlersTurnOrder: @ 80150A8 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -10640,7 +10640,7 @@ _08015320: .4byte gBattlersCount _08015324: .4byte gBattleMainFunc _08015328: .4byte CheckFocusPunch_ClearVarsBeforeTurnStarts _0801532C: .4byte gBattleStruct - thumb_func_end sub_80150A8 + thumb_func_end SetActionsAndBattlersTurnOrder thumb_func_start TurnValuesCleanUp TurnValuesCleanUp: @ 8015330 @@ -10985,7 +10985,7 @@ _080155D8: ldr r4, _08015628 @ =gCurrentTurnActionNumber ldrb r1, [r4] strb r1, [r0] - ldr r1, _0801562C @ =gUnknown_8250038 + ldr r1, _0801562C @ =sTurnActionsFuncsTable ldrb r0, [r2] lsls r0, 2 adds r0, r1 @@ -11002,7 +11002,7 @@ _080155D8: ands r0, r1 str r0, [r2] ldr r3, _0801563C @ =gBattleMainFunc - ldr r2, _08015640 @ =gUnknown_8250070 + ldr r2, _08015640 @ =sEndTurnFuncsTable ldrb r1, [r6] movs r0, 0x7F ands r0, r1 @@ -11016,12 +11016,12 @@ _0801561C: .4byte gBattleOutcome _08015620: .4byte gCurrentActionFuncId _08015624: .4byte gBattleStruct _08015628: .4byte gCurrentTurnActionNumber -_0801562C: .4byte gUnknown_8250038 +_0801562C: .4byte sTurnActionsFuncsTable _08015630: .4byte gBattlersCount _08015634: .4byte gHitMarker _08015638: .4byte 0xffefffff _0801563C: .4byte gBattleMainFunc -_08015640: .4byte gUnknown_8250070 +_08015640: .4byte sEndTurnFuncsTable _08015644: ldr r0, [r5] adds r0, 0x4B @@ -11045,8 +11045,8 @@ _08015668: .4byte 0xfffffdff _0801566C: .4byte 0xfff7ffff thumb_func_end RunTurnActionsFunctions - thumb_func_start sub_8015670 -sub_8015670: @ 8015670 + thumb_func_start HandleEndTurn_BattleWon +HandleEndTurn_BattleWon: @ 8015670 push {r4,lr} ldr r1, _080156A8 @ =gCurrentActionFuncId movs r0, 0 @@ -11155,7 +11155,7 @@ _0801576C: str r0, [r1] _0801576E: ldr r1, _08015784 @ =gBattleMainFunc - ldr r0, _08015788 @ =sub_8015910 + ldr r0, _08015788 @ =HandleEndTurn_FinishBattle str r0, [r1] pop {r4} pop {r0} @@ -11164,11 +11164,11 @@ _0801576E: _0801577C: .4byte gBattlescriptCurrInstr _08015780: .4byte gUnknown_81D8803 _08015784: .4byte gBattleMainFunc -_08015788: .4byte sub_8015910 - thumb_func_end sub_8015670 +_08015788: .4byte HandleEndTurn_FinishBattle + thumb_func_end HandleEndTurn_BattleWon - thumb_func_start sub_801578C -sub_801578C: @ 801578C + thumb_func_start HandleEndTurn_BattleLost +HandleEndTurn_BattleLost: @ 801578C push {r4,lr} ldr r1, _080157C4 @ =gCurrentActionFuncId movs r0, 0 @@ -11247,7 +11247,7 @@ _0801582A: str r0, [r1] _08015830: ldr r1, _08015848 @ =gBattleMainFunc - ldr r0, _0801584C @ =sub_8015910 + ldr r0, _0801584C @ =HandleEndTurn_FinishBattle str r0, [r1] pop {r4} pop {r0} @@ -11257,11 +11257,11 @@ _0801583C: .4byte gBattleCommunication _08015840: .4byte gBattlescriptCurrInstr _08015844: .4byte gUnknown_81D8806 _08015848: .4byte gBattleMainFunc -_0801584C: .4byte sub_8015910 - thumb_func_end sub_801578C +_0801584C: .4byte HandleEndTurn_FinishBattle + thumb_func_end HandleEndTurn_BattleLost - thumb_func_start sub_8015850 -sub_8015850: @ 8015850 + thumb_func_start HandleEndTurn_RanFromBattle +HandleEndTurn_RanFromBattle: @ 8015850 push {lr} ldr r1, _08015878 @ =gCurrentActionFuncId movs r0, 0 @@ -11300,7 +11300,7 @@ _0801589C: _080158A0: str r0, [r1] ldr r1, _080158B4 @ =gBattleMainFunc - ldr r0, _080158B8 @ =sub_8015910 + ldr r0, _080158B8 @ =HandleEndTurn_FinishBattle str r0, [r1] pop {r0} bx r0 @@ -11308,11 +11308,11 @@ _080158A0: _080158AC: .4byte gBattlescriptCurrInstr _080158B0: .4byte gUnknown_81D890F _080158B4: .4byte gBattleMainFunc -_080158B8: .4byte sub_8015910 - thumb_func_end sub_8015850 +_080158B8: .4byte HandleEndTurn_FinishBattle + thumb_func_end HandleEndTurn_RanFromBattle - thumb_func_start sub_80158BC -sub_80158BC: @ 80158BC + thumb_func_start HandleEndTurn_MonFled +HandleEndTurn_MonFled: @ 80158BC ldr r1, _080158F0 @ =gCurrentActionFuncId movs r0, 0 strb r0, [r1] @@ -11336,7 +11336,7 @@ sub_80158BC: @ 80158BC ldr r0, _08015904 @ =gUnknown_81D891D str r0, [r1] ldr r1, _08015908 @ =gBattleMainFunc - ldr r0, _0801590C @ =sub_8015910 + ldr r0, _0801590C @ =HandleEndTurn_FinishBattle str r0, [r1] bx lr .align 2, 0 @@ -11347,11 +11347,11 @@ _080158FC: .4byte gBattlerPartyIndexes _08015900: .4byte gBattlescriptCurrInstr _08015904: .4byte gUnknown_81D891D _08015908: .4byte gBattleMainFunc -_0801590C: .4byte sub_8015910 - thumb_func_end sub_80158BC +_0801590C: .4byte HandleEndTurn_FinishBattle + thumb_func_end HandleEndTurn_MonFled - thumb_func_start sub_8015910 -sub_8015910: @ 8015910 + thumb_func_start HandleEndTurn_FinishBattle +HandleEndTurn_FinishBattle: @ 8015910 push {r4-r7,lr} ldr r0, _08015974 @ =gCurrentActionFuncId ldrb r0, [r0] @@ -11446,7 +11446,7 @@ _080159D0: movs r0, 0x5 bl FadeOutMapMusic ldr r1, _080159F4 @ =gBattleMainFunc - ldr r0, _080159F8 @ =sub_8015A30 + ldr r0, _080159F8 @ =FreeResetData_ReturnToOvOrDoEvolutions str r0, [r1] ldr r1, _080159FC @ =gUnknown_300537C ldr r0, _08015A00 @ =BattleMainCB2 @@ -11456,7 +11456,7 @@ _080159D0: _080159EC: .4byte gBattlersCount _080159F0: .4byte gBattleTypeFlags _080159F4: .4byte gBattleMainFunc -_080159F8: .4byte sub_8015A30 +_080159F8: .4byte FreeResetData_ReturnToOvOrDoEvolutions _080159FC: .4byte gUnknown_300537C _08015A00: .4byte BattleMainCB2 _08015A04: @@ -11480,10 +11480,10 @@ _08015A1E: _08015A24: .4byte gBattleControllerExecFlags _08015A28: .4byte gBattleScriptingCommandsTable _08015A2C: .4byte gBattlescriptCurrInstr - thumb_func_end sub_8015910 + thumb_func_end HandleEndTurn_FinishBattle - thumb_func_start sub_8015A30 -sub_8015A30: @ 8015A30 + thumb_func_start FreeResetData_ReturnToOvOrDoEvolutions +FreeResetData_ReturnToOvOrDoEvolutions: @ 8015A30 push {lr} ldr r0, _08015A58 @ =gPaletteFade ldrb r1, [r0, 0x7] @@ -11512,7 +11512,7 @@ _08015A64: .4byte gBattleMainFunc _08015A68: .4byte ReturnFromBattleToOverworld _08015A6C: ldr r1, _08015A94 @ =gBattleMainFunc - ldr r0, _08015A98 @ =sub_8015AA0 + ldr r0, _08015A98 @ =TryEvolvePokemon _08015A70: str r0, [r1] bl FreeAllWindowBuffers @@ -11530,12 +11530,12 @@ _08015A8E: bx r0 .align 2, 0 _08015A94: .4byte gBattleMainFunc -_08015A98: .4byte sub_8015AA0 +_08015A98: .4byte TryEvolvePokemon _08015A9C: .4byte gBattleTypeFlags - thumb_func_end sub_8015A30 + thumb_func_end FreeResetData_ReturnToOvOrDoEvolutions - thumb_func_start sub_8015AA0 -sub_8015AA0: @ 8015AA0 + thumb_func_start TryEvolvePokemon +TryEvolvePokemon: @ 8015AA0 push {r4,r5,lr} ldr r0, _08015AF4 @ =gLeveledUpInBattle ldrb r1, [r0] @@ -11569,7 +11569,7 @@ _08015AAE: cmp r2, 0 beq _08015B08 ldr r0, _08015B00 @ =gBattleMainFunc - ldr r1, _08015B04 @ =sub_8015B30 + ldr r1, _08015B04 @ =WaitForEvoSceneToFinish str r1, [r0] lsls r3, r5, 24 lsrs r3, 24 @@ -11583,7 +11583,7 @@ _08015AF4: .4byte gLeveledUpInBattle _08015AF8: .4byte gBitTable _08015AFC: .4byte gPlayerParty _08015B00: .4byte gBattleMainFunc -_08015B04: .4byte sub_8015B30 +_08015B04: .4byte WaitForEvoSceneToFinish _08015B08: adds r5, 0x1 ldr r3, _08015B24 @ =gLeveledUpInBattle @@ -11604,10 +11604,10 @@ _08015B1C: _08015B24: .4byte gLeveledUpInBattle _08015B28: .4byte gBattleMainFunc _08015B2C: .4byte ReturnFromBattleToOverworld - thumb_func_end sub_8015AA0 + thumb_func_end TryEvolvePokemon - thumb_func_start sub_8015B30 -sub_8015B30: @ 8015B30 + thumb_func_start WaitForEvoSceneToFinish +WaitForEvoSceneToFinish: @ 8015B30 push {lr} ldr r0, _08015B48 @ =gMain ldr r1, [r0, 0x4] @@ -11615,7 +11615,7 @@ sub_8015B30: @ 8015B30 cmp r1, r0 bne _08015B42 ldr r1, _08015B50 @ =gBattleMainFunc - ldr r0, _08015B54 @ =sub_8015AA0 + ldr r0, _08015B54 @ =TryEvolvePokemon str r0, [r1] _08015B42: pop {r0} @@ -11624,8 +11624,8 @@ _08015B42: _08015B48: .4byte gMain _08015B4C: .4byte BattleMainCB2 _08015B50: .4byte gBattleMainFunc -_08015B54: .4byte sub_8015AA0 - thumb_func_end sub_8015B30 +_08015B54: .4byte TryEvolvePokemon + thumb_func_end WaitForEvoSceneToFinish thumb_func_start ReturnFromBattleToOverworld ReturnFromBattleToOverworld: @ 8015B58 @@ -11787,8 +11787,8 @@ _08015C98: .4byte gBattleScriptingCommandsTable _08015C9C: .4byte gBattlescriptCurrInstr thumb_func_end RunBattleScriptCommands - thumb_func_start sub_8015CA0 -sub_8015CA0: @ 8015CA0 + thumb_func_start HandleAction_UseMove +HandleAction_UseMove: @ 8015CA0 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -12598,10 +12598,10 @@ _08016364: .4byte gBattleScriptsForMoveEffects _08016368: .4byte gBattleMoves _0801636C: .4byte gCurrentMove _08016370: .4byte gCurrentActionFuncId - thumb_func_end sub_8015CA0 + thumb_func_end HandleAction_UseMove - thumb_func_start sub_8016374 -sub_8016374: @ 8016374 + thumb_func_start HandleAction_Switch +HandleAction_Switch: @ 8016374 push {r4,lr} ldr r3, _080163E0 @ =gBattlerAttacker ldr r1, _080163E4 @ =gBattlerByTurnOrder @@ -12672,10 +12672,10 @@ _08016408: .4byte gBattlescriptCurrInstr _0801640C: .4byte gUnknown_81D894D _08016410: .4byte gCurrentActionFuncId _08016414: .4byte gBattleResults - thumb_func_end sub_8016374 + thumb_func_end HandleAction_Switch - thumb_func_start sub_8016418 -sub_8016418: @ 8016418 + thumb_func_start HandleAction_UseItem +HandleAction_UseItem: @ 8016418 push {r4-r7,lr} mov r7, r10 mov r6, r9 @@ -12714,7 +12714,7 @@ sub_8016418: @ 8016418 cmp r1, 0xC bhi _0801649C ldr r2, _08016494 @ =gBattlescriptCurrInstr - ldr r1, _08016498 @ =gUnknown_81D99B0 + ldr r1, _08016498 @ =gBattlescriptsForBallThrow ldrh r0, [r5] lsls r0, 2 adds r0, r1 @@ -12731,7 +12731,7 @@ _08016488: .4byte gBattle_BG0_Y _0801648C: .4byte gLastUsedItem _08016490: .4byte gBattleBufferB _08016494: .4byte gBattlescriptCurrInstr -_08016498: .4byte gUnknown_81D99B0 +_08016498: .4byte gBattlescriptsForBallThrow _0801649C: adds r0, r3, 0 subs r0, 0x50 @@ -13053,7 +13053,7 @@ _08016738: .4byte gBattlerAttacker _0801673C: .4byte gBattlescriptCurrInstr _08016740: .4byte gUnknown_81D99E4 _08016744: .4byte gCurrentActionFuncId - thumb_func_end sub_8016418 + thumb_func_end HandleAction_UseItem thumb_func_start TryRunFromBattle TryRunFromBattle: @ 8016748 @@ -13227,8 +13227,8 @@ _0801689C: .4byte gBattlersCount _080168A0: .4byte gBattleOutcome thumb_func_end TryRunFromBattle - thumb_func_start sub_80168A4 -sub_80168A4: @ 80168A4 + thumb_func_start HandleAction_Run +HandleAction_Run: @ 80168A4 push {r4-r6,lr} ldr r4, _080168F4 @ =gBattlerAttacker ldr r1, _080168F8 @ =gBattlerByTurnOrder @@ -13379,10 +13379,10 @@ _080169D8: .align 2, 0 _080169E0: .4byte gBattlersCount _080169E4: .4byte gBattleOutcome - thumb_func_end sub_80168A4 + thumb_func_end HandleAction_Run - thumb_func_start sub_80169E8 -sub_80169E8: @ 80169E8 + thumb_func_start HandleAction_WatchesCarefully +HandleAction_WatchesCarefully: @ 80169E8 push {r4,r5,lr} ldr r2, _08016A44 @ =gBattlerAttacker ldr r1, _08016A48 @ =gBattlerByTurnOrder @@ -13467,7 +13467,7 @@ _08016A98: strb r5, [r0, 0x5] _08016A9C: ldr r1, _08016AB4 @ =gBattlescriptCurrInstr - ldr r0, _08016AB8 @ =gUnknown_81D9A04 + ldr r0, _08016AB8 @ =gBattlescriptsForSafariActions ldr r0, [r0] str r0, [r1] ldr r1, _08016ABC @ =gCurrentActionFuncId @@ -13479,12 +13479,12 @@ _08016A9C: .align 2, 0 _08016AB0: .4byte gBattleCommunication _08016AB4: .4byte gBattlescriptCurrInstr -_08016AB8: .4byte gUnknown_81D9A04 +_08016AB8: .4byte gBattlescriptsForSafariActions _08016ABC: .4byte gCurrentActionFuncId - thumb_func_end sub_80169E8 + thumb_func_end HandleAction_WatchesCarefully - thumb_func_start sub_8016AC0 -sub_8016AC0: @ 8016AC0 + thumb_func_start HandleAction_SafariZoneBallThrow +HandleAction_SafariZoneBallThrow: @ 8016AC0 ldr r2, _08016AF8 @ =gBattlerAttacker ldr r1, _08016AFC @ =gBattlerByTurnOrder ldr r0, _08016B00 @ =gCurrentTurnActionNumber @@ -13505,7 +13505,7 @@ sub_8016AC0: @ 8016AC0 movs r0, 0x5 strh r0, [r1] ldr r1, _08016B14 @ =gBattlescriptCurrInstr - ldr r0, _08016B18 @ =gUnknown_81D99B0 + ldr r0, _08016B18 @ =gBattlescriptsForBallThrow ldr r0, [r0, 0x14] str r0, [r1] ldr r1, _08016B1C @ =gCurrentActionFuncId @@ -13521,12 +13521,12 @@ _08016B08: .4byte gBattle_BG0_Y _08016B0C: .4byte gNumSafariBalls _08016B10: .4byte gLastUsedItem _08016B14: .4byte gBattlescriptCurrInstr -_08016B18: .4byte gUnknown_81D99B0 +_08016B18: .4byte gBattlescriptsForBallThrow _08016B1C: .4byte gCurrentActionFuncId - thumb_func_end sub_8016AC0 + thumb_func_end HandleAction_SafariZoneBallThrow - thumb_func_start sub_8016B20 -sub_8016B20: @ 8016B20 + thumb_func_start HandleAction_ThrowPokeblock +HandleAction_ThrowPokeblock: @ 8016B20 push {r4-r7,lr} ldr r2, _08016B9C @ =gBattlerAttacker ldr r1, _08016BA0 @ =gBattlerByTurnOrder @@ -13579,7 +13579,7 @@ _08016B66: strb r0, [r1] _08016B86: ldr r1, _08016BB4 @ =gBattlescriptCurrInstr - ldr r0, _08016BB8 @ =gUnknown_81D9A04 + ldr r0, _08016BB8 @ =gBattlescriptsForSafariActions ldr r0, [r0, 0x8] str r0, [r1] ldr r1, _08016BBC @ =gCurrentActionFuncId @@ -13596,12 +13596,12 @@ _08016BA8: .4byte gBattle_BG0_X _08016BAC: .4byte gBattle_BG0_Y _08016BB0: .4byte gBattleStruct _08016BB4: .4byte gBattlescriptCurrInstr -_08016BB8: .4byte gUnknown_81D9A04 +_08016BB8: .4byte gBattlescriptsForSafariActions _08016BBC: .4byte gCurrentActionFuncId - thumb_func_end sub_8016B20 + thumb_func_end HandleAction_ThrowPokeblock - thumb_func_start sub_8016BC0 -sub_8016BC0: @ 8016BC0 + thumb_func_start HandleAction_GoNear +HandleAction_GoNear: @ 8016BC0 push {r4-r7,lr} ldr r2, _08016C3C @ =gBattlerAttacker ldr r1, _08016C40 @ =gBattlerByTurnOrder @@ -13654,7 +13654,7 @@ _08016C06: strb r0, [r1] _08016C26: ldr r1, _08016C54 @ =gBattlescriptCurrInstr - ldr r0, _08016C58 @ =gUnknown_81D9A04 + ldr r0, _08016C58 @ =gBattlescriptsForSafariActions ldr r0, [r0, 0x4] str r0, [r1] ldr r1, _08016C5C @ =gCurrentActionFuncId @@ -13671,12 +13671,12 @@ _08016C48: .4byte gBattle_BG0_X _08016C4C: .4byte gBattle_BG0_Y _08016C50: .4byte gBattleStruct _08016C54: .4byte gBattlescriptCurrInstr -_08016C58: .4byte gUnknown_81D9A04 +_08016C58: .4byte gBattlescriptsForSafariActions _08016C5C: .4byte gCurrentActionFuncId - thumb_func_end sub_8016BC0 + thumb_func_end HandleAction_GoNear - thumb_func_start HandleAction_SafriZoneRun -HandleAction_SafriZoneRun: @ 8016C60 + thumb_func_start HandleAction_SafariZoneRun +HandleAction_SafariZoneRun: @ 8016C60 push {r4,lr} ldr r2, _08016C88 @ =gBattlerAttacker ldr r1, _08016C8C @ =gBattlerByTurnOrder @@ -13702,10 +13702,10 @@ _08016C8C: .4byte gBattlerByTurnOrder _08016C90: .4byte gCurrentTurnActionNumber _08016C94: .4byte gBattlersCount _08016C98: .4byte gBattleOutcome - thumb_func_end HandleAction_SafriZoneRun + thumb_func_end HandleAction_SafariZoneRun - thumb_func_start HandleAction_Action9 -HandleAction_Action9: @ 8016C9C + thumb_func_start HandleAction_OldManBallThrow +HandleAction_OldManBallThrow: @ 8016C9C ldr r3, _08016CE8 @ =gBattlerAttacker ldr r1, _08016CEC @ =gBattlerByTurnOrder ldr r0, _08016CF0 @ =gCurrentTurnActionNumber @@ -13733,7 +13733,7 @@ HandleAction_Action9: @ 8016C9C movs r0, 0xFF strb r0, [r1, 0x4] ldr r1, _08016D04 @ =gBattlescriptCurrInstr - ldr r0, _08016D08 @ =gUnknown_81D9A04 + ldr r0, _08016D08 @ =gBattlescriptsForSafariActions ldr r0, [r0, 0xC] str r0, [r1] ldr r1, _08016D0C @ =gCurrentActionFuncId @@ -13752,13 +13752,13 @@ _08016CF8: .4byte gBattle_BG0_Y _08016CFC: .4byte gBattleTextBuff1 _08016D00: .4byte gBattlerPartyIndexes _08016D04: .4byte gBattlescriptCurrInstr -_08016D08: .4byte gUnknown_81D9A04 +_08016D08: .4byte gBattlescriptsForSafariActions _08016D0C: .4byte gCurrentActionFuncId _08016D10: .4byte gActionsByTurnOrder - thumb_func_end HandleAction_Action9 + thumb_func_end HandleAction_OldManBallThrow - thumb_func_start HandleAction_Action11 -HandleAction_Action11: @ 8016D14 + thumb_func_start HandleAction_TryFinish +HandleAction_TryFinish: @ 8016D14 push {lr} bl HandleFaintedMonActions lsls r0, 24 @@ -13778,7 +13778,7 @@ _08016D30: .align 2, 0 _08016D34: .4byte gBattleStruct _08016D38: .4byte gCurrentActionFuncId - thumb_func_end HandleAction_Action11 + thumb_func_end HandleAction_TryFinish thumb_func_start HandleAction_NothingIsFainted HandleAction_NothingIsFainted: @ 8016D3C diff --git a/asm/battle_anim.s b/asm/battle_anim.s index d5e389807a..d9471c9dd1 100644 --- a/asm/battle_anim.s +++ b/asm/battle_anim.s @@ -281,9 +281,9 @@ _08072706: strh r1, [r0] ldr r0, _08072734 @ =gBattle_WIN0V strh r1, [r0] - ldr r0, _08072738 @ =gUnknown_2022988 + ldr r0, _08072738 @ =gBattle_WIN1H strh r1, [r0] - ldr r0, _0807273C @ =gUnknown_202298A + ldr r0, _0807273C @ =gBattle_WIN1V strh r1, [r0] add sp, 0x4 pop {r3-r5} @@ -298,8 +298,8 @@ _08072728: .4byte 0x0000ffff _0807272C: .4byte gMPlayInfo_BGM _08072730: .4byte gBattle_WIN0H _08072734: .4byte gBattle_WIN0V -_08072738: .4byte gUnknown_2022988 -_0807273C: .4byte gUnknown_202298A +_08072738: .4byte gBattle_WIN1H +_0807273C: .4byte gBattle_WIN1V thumb_func_end LaunchBattleAnimation thumb_func_start DestroyAnimSprite diff --git a/asm/battle_anim_effects_3.s b/asm/battle_anim_effects_3.s index 004ad8786f..9c98d7f36b 100644 --- a/asm/battle_anim_effects_3.s +++ b/asm/battle_anim_effects_3.s @@ -1481,11 +1481,11 @@ sub_80DEDD8: @ 80DEDD8 ldr r1, _080DEE14 @ =0x00001f3f movs r0, 0x48 bl SetGpuReg - ldr r1, _080DEE18 @ =gUnknown_2022988 + ldr r1, _080DEE18 @ =gBattle_WIN1H ldr r2, _080DEE1C @ =0x000098f0 adds r0, r2, 0 strh r0, [r1] - ldr r1, _080DEE20 @ =gUnknown_202298A + ldr r1, _080DEE20 @ =gBattle_WIN1V movs r0, 0xA0 strh r0, [r1] ldr r0, _080DEE24 @ =gBattle_WIN0H @@ -1499,19 +1499,19 @@ sub_80DEDD8: @ 80DEDD8 b _080DEE5C .align 2, 0 _080DEE14: .4byte 0x00001f3f -_080DEE18: .4byte gUnknown_2022988 +_080DEE18: .4byte gBattle_WIN1H _080DEE1C: .4byte 0x000098f0 -_080DEE20: .4byte gUnknown_202298A +_080DEE20: .4byte gBattle_WIN1V _080DEE24: .4byte gBattle_WIN0H _080DEE28: .4byte gBattle_WIN0V _080DEE2C: ldr r1, _080DEE68 @ =0x00001f3f movs r0, 0x48 bl SetGpuReg - ldr r1, _080DEE6C @ =gUnknown_2022988 + ldr r1, _080DEE6C @ =gBattle_WIN1H movs r0, 0xF0 strh r0, [r1] - ldr r4, _080DEE70 @ =gUnknown_202298A + ldr r4, _080DEE70 @ =gBattle_WIN1V ldr r1, _080DEE74 @ =0x000078a0 adds r0, r1, 0 strh r0, [r4] @@ -1533,8 +1533,8 @@ _080DEE5C: bx r0 .align 2, 0 _080DEE68: .4byte 0x00001f3f -_080DEE6C: .4byte gUnknown_2022988 -_080DEE70: .4byte gUnknown_202298A +_080DEE6C: .4byte gBattle_WIN1H +_080DEE70: .4byte gBattle_WIN1V _080DEE74: .4byte 0x000078a0 thumb_func_end sub_80DEDD8 @@ -1546,10 +1546,10 @@ sub_80DEE78: @ 80DEE78 ldr r1, _080DEEB0 @ =0x00003f3f movs r0, 0x48 bl SetGpuReg - ldr r0, _080DEEB4 @ =gUnknown_2022988 + ldr r0, _080DEEB4 @ =gBattle_WIN1H movs r1, 0 strh r1, [r0] - ldr r0, _080DEEB8 @ =gUnknown_202298A + ldr r0, _080DEEB8 @ =gBattle_WIN1V strh r1, [r0] bl IsContest lsls r0, 24 @@ -1567,8 +1567,8 @@ _080DEEA4: bx r0 .align 2, 0 _080DEEB0: .4byte 0x00003f3f -_080DEEB4: .4byte gUnknown_2022988 -_080DEEB8: .4byte gUnknown_202298A +_080DEEB4: .4byte gBattle_WIN1H +_080DEEB8: .4byte gBattle_WIN1V thumb_func_end sub_80DEE78 thumb_func_start sub_80DEEBC diff --git a/asm/battle_message.s b/asm/battle_message.s index bd1011f9ab..8c83d94960 100644 --- a/asm/battle_message.s +++ b/asm/battle_message.s @@ -744,7 +744,7 @@ _080D7834: ldr r5, [sp] ldr r4, [sp, 0x4] movs r3, 0 - ldr r2, _080D7850 @ =gUnknown_82500CC + ldr r2, _080D7850 @ =gStatusConditionStringsTable _080D783C: ldr r1, [r2] ldr r0, [r1] @@ -756,7 +756,7 @@ _080D783C: ldr r0, [r2, 0x4] b _080D785E .align 2, 0 -_080D7850: .4byte gUnknown_82500CC +_080D7850: .4byte gStatusConditionStringsTable _080D7854: adds r2, 0x8 adds r3, 0x1 @@ -1647,13 +1647,13 @@ _080D7FF0: ldrb r1, [r0] movs r0, 0xD muls r1, r0 - ldr r0, _080D8004 @ =gUnknown_824FC40 + ldr r0, _080D8004 @ =gAbilityNames adds r4, r1, r0 b _080D8382 .align 2, 0 _080D7FFC: .4byte gUnknown_2039A30 _080D8000: .4byte gEffectBattler -_080D8004: .4byte gUnknown_824FC40 +_080D8004: .4byte gAbilityNames _080D8008: ldr r3, _080D8020 @ =gTrainerBattleOpponent_A ldrh r1, [r3] @@ -2430,7 +2430,7 @@ _080D860C: ldrb r1, [r0, 0x1] movs r0, 0xD muls r1, r0 - ldr r0, _080D8624 @ =gUnknown_824FC40 + ldr r0, _080D8624 @ =gAbilityNames _080D8616: adds r1, r0 _080D8618: @@ -2439,7 +2439,7 @@ _080D8618: adds r5, 0x2 b _080D86B0 .align 2, 0 -_080D8624: .4byte gUnknown_824FC40 +_080D8624: .4byte gAbilityNames _080D8628: adds r0, r5, r7 ldrb r2, [r0, 0x1] diff --git a/asm/battle_setup.s b/asm/battle_setup.s index 5a97970568..64c45e06be 100644 --- a/asm/battle_setup.s +++ b/asm/battle_setup.s @@ -43,7 +43,7 @@ _0807F65E: bne _0807F686 bl HelpSystem_Enable bl CleanupOverworldWindowsAndTilemaps - ldr r0, _0807F68C @ =sub_800FD9C + ldr r0, _0807F68C @ =CB2_InitBattle bl SetMainCallback2 bl sub_806D7E8 bl ClearPoisonStepCounter @@ -54,7 +54,7 @@ _0807F686: pop {r0} bx r0 .align 2, 0 -_0807F68C: .4byte sub_800FD9C +_0807F68C: .4byte CB2_InitBattle thumb_func_end sub_807F620 thumb_func_start sub_807F690 diff --git a/asm/battle_tower.s b/asm/battle_tower.s index 08fefffbc1..837c59cfc1 100644 --- a/asm/battle_tower.s +++ b/asm/battle_tower.s @@ -2034,7 +2034,7 @@ sub_80E68C4: @ 80E68C4 ldr r1, _080E68F8 @ =sub_80E6854 str r1, [r0, 0x8] bl CleanupOverworldWindowsAndTilemaps - ldr r0, _080E68FC @ =sub_800FD9C + ldr r0, _080E68FC @ =CB2_InitBattle bl SetMainCallback2 adds r0, r4, 0 bl DestroyTask @@ -2045,7 +2045,7 @@ _080E68EC: .align 2, 0 _080E68F4: .4byte gMain _080E68F8: .4byte sub_80E6854 -_080E68FC: .4byte sub_800FD9C +_080E68FC: .4byte CB2_InitBattle thumb_func_end sub_80E68C4 thumb_func_start sub_80E6900 diff --git a/asm/cable_club.s b/asm/cable_club.s index 76346a28cc..bb430400bc 100644 --- a/asm/cable_club.s +++ b/asm/cable_club.s @@ -1637,7 +1637,7 @@ _0808141A: lsls r2, 4 adds r0, r2, 0 strh r0, [r1] - ldr r0, _08081448 @ =sub_800FD9C + ldr r0, _08081448 @ =CB2_InitBattle bl SetMainCallback2 ldr r1, _0808144C @ =gMain ldr r0, _08081450 @ =sub_8081668 @@ -1651,7 +1651,7 @@ _0808143A: .align 2, 0 _08081440: .4byte gBattleTypeFlags _08081444: .4byte gTrainerBattleOpponent_A -_08081448: .4byte sub_800FD9C +_08081448: .4byte CB2_InitBattle _0808144C: .4byte gMain _08081450: .4byte sub_8081668 thumb_func_end sub_8081318 @@ -1860,7 +1860,7 @@ _080815EA: lsls r3, 4 adds r0, r3, 0 strh r0, [r1] - ldr r0, _08081618 @ =sub_800FD9C + ldr r0, _08081618 @ =CB2_InitBattle bl SetMainCallback2 ldr r1, _0808161C @ =gMain ldr r0, _08081620 @ =sub_8081668 @@ -1874,7 +1874,7 @@ _0808160A: .align 2, 0 _08081610: .4byte gBattleTypeFlags _08081614: .4byte gTrainerBattleOpponent_A -_08081618: .4byte sub_800FD9C +_08081618: .4byte CB2_InitBattle _0808161C: .4byte gMain _08081620: .4byte sub_8081668 thumb_func_end sub_8081454 diff --git a/asm/evolution_scene.s b/asm/evolution_scene.s index d8651a24cc..e696f42d73 100644 --- a/asm/evolution_scene.s +++ b/asm/evolution_scene.s @@ -278,7 +278,7 @@ EvolutionScene: @ 80CDDF4 adds r6, r7, 0 adds r6, 0x1C adds r0, r1, r6 - ldr r2, _080CE0CC @ =nullsub_10 + ldr r2, _080CE0CC @ =SpriteCallbackDummy2 str r2, [r0] adds r1, r7 ldrb r2, [r1, 0x5] @@ -331,7 +331,7 @@ EvolutionScene: @ 80CDDF4 adds r1, r3 lsls r1, 2 adds r6, r1, r6 - ldr r2, _080CE0CC @ =nullsub_10 + ldr r2, _080CE0CC @ =SpriteCallbackDummy2 str r2, [r6] adds r1, r7 ldrb r0, [r1, 0x5] @@ -420,7 +420,7 @@ _080CE0BC: .4byte gMonSpritesGfxPtr _080CE0C0: .4byte gMultiuseSpriteTemplate _080CE0C4: .4byte gDummySpriteAffineAnimTable _080CE0C8: .4byte gSprites -_080CE0CC: .4byte nullsub_10 +_080CE0CC: .4byte SpriteCallbackDummy2 _080CE0D0: .4byte sub_80CE8DC _080CE0D4: .4byte gTasks _080CE0D8: .4byte gPlttBufferUnfaded + 0x40 @@ -562,7 +562,7 @@ CB2_EvolutionSceneLoadGraphics: @ 80CE0E8 adds r0, r3, 0 adds r0, 0x1C adds r0, r1, r0 - ldr r2, _080CE2CC @ =nullsub_10 + ldr r2, _080CE2CC @ =SpriteCallbackDummy2 str r2, [r0] adds r1, r3 ldrb r2, [r1, 0x5] @@ -623,7 +623,7 @@ _080CE2BC: .4byte gMonSpritesGfxPtr _080CE2C0: .4byte gMultiuseSpriteTemplate _080CE2C4: .4byte gDummySpriteAffineAnimTable _080CE2C8: .4byte gSprites -_080CE2CC: .4byte nullsub_10 +_080CE2CC: .4byte SpriteCallbackDummy2 _080CE2D0: .4byte nullsub_76 _080CE2D4: .4byte sub_80D0050 _080CE2D8: .4byte sub_80CE710 @@ -813,7 +813,7 @@ _080CE45C: adds r0, r3, 0 adds r0, 0x1C adds r0, r1, r0 - ldr r2, _080CE4C4 @ =nullsub_10 + ldr r2, _080CE4C4 @ =SpriteCallbackDummy2 str r2, [r0] adds r1, r3 ldrb r2, [r1, 0x5] @@ -836,7 +836,7 @@ _080CE4B4: .4byte gMultiuseSpriteTemplate _080CE4B8: .4byte gDummySpriteAffineAnimTable _080CE4BC: .4byte gUnknown_2039A20 _080CE4C0: .4byte gSprites -_080CE4C4: .4byte nullsub_10 +_080CE4C4: .4byte SpriteCallbackDummy2 _080CE4C8: .4byte gMain _080CE4CC: ldr r0, _080CE4FC @ =gWirelessCommType @@ -989,7 +989,7 @@ TradeEvolutionScene: @ 80CE540 adds r0, r3, 0 adds r0, 0x1C adds r0, r1, r0 - ldr r2, _080CE6D8 @ =nullsub_10 + ldr r2, _080CE6D8 @ =SpriteCallbackDummy2 str r2, [r0] adds r1, r3 ldrb r2, [r1, 0x5] @@ -1074,7 +1074,7 @@ _080CE6C8: .4byte gMonSpritesGfxPtr _080CE6CC: .4byte gMultiuseSpriteTemplate _080CE6D0: .4byte gDummySpriteAffineAnimTable _080CE6D4: .4byte gSprites -_080CE6D8: .4byte nullsub_10 +_080CE6D8: .4byte SpriteCallbackDummy2 _080CE6DC: .4byte sub_80CF53C _080CE6E0: .4byte gTasks _080CE6E4: .4byte gBattle_BG0_X diff --git a/asm/link_rfu_3.s b/asm/link_rfu_3.s index 94a07fdaf0..9fc1f72cc3 100644 --- a/asm/link_rfu_3.s +++ b/asm/link_rfu_3.s @@ -12709,7 +12709,7 @@ _0811C096: lsls r2, 4 adds r1, r2, 0 strh r1, [r0] - ldr r0, _0811C0DC @ =sub_800FD9C + ldr r0, _0811C0DC @ =CB2_InitBattle bl SetMainCallback2 pop {r4-r7} pop {r0} @@ -12719,7 +12719,7 @@ _0811C0CC: .4byte gPlayerParty _0811C0D0: .4byte gEnemyParty _0811C0D4: .4byte gUnknown_203B0D4 _0811C0D8: .4byte gTrainerBattleOpponent_A -_0811C0DC: .4byte sub_800FD9C +_0811C0DC: .4byte CB2_InitBattle thumb_func_end sub_811C04C thumb_func_start sub_811C0E0 diff --git a/asm/pokemon_summary_screen.s b/asm/pokemon_summary_screen.s index f6f746313f..f902160cd5 100644 --- a/asm/pokemon_summary_screen.s +++ b/asm/pokemon_summary_screen.s @@ -4033,13 +4033,13 @@ _081366B8: adds r0, r1 movs r1, 0xD muls r1, r4 - ldr r2, _081367A0 @ =gUnknown_824FC40 + ldr r2, _081367A0 @ =gAbilityNames adds r1, r2 bl StringCopy ldr r0, [r6] ldr r2, _081367A4 @ =0x000031cc adds r0, r2 - ldr r1, _081367A8 @ =gUnknown_824FB08 + ldr r1, _081367A8 @ =gAbilityDescriptionPointers lsls r4, 2 adds r4, r1 ldr r1, [r4] @@ -4088,9 +4088,9 @@ _08136790: .4byte gExperienceTables _08136794: .4byte gBaseStats _08136798: .4byte 0x000031b0 _0813679C: .4byte 0x000031bc -_081367A0: .4byte gUnknown_824FC40 +_081367A0: .4byte gAbilityNames _081367A4: .4byte 0x000031cc -_081367A8: .4byte gUnknown_824FB08 +_081367A8: .4byte gAbilityDescriptionPointers _081367AC: .4byte 0x0000326c thumb_func_end sub_8136350 diff --git a/common_syms/battle_main.txt b/common_syms/battle_main.txt new file mode 100644 index 0000000000..36f7596e29 --- /dev/null +++ b/common_syms/battle_main.txt @@ -0,0 +1,9 @@ +gPreBattleCallback1 +gBattleMainFunc +gBattleResults +gLeveledUpInBattle +gBattlerControllerFuncs +gHealthboxSpriteIds +gMultiUsePlayerCursor +gNumberOfMovesToChoose +gUnknown_3004FFC diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 0fd65d2e00..8d69b297d5 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -549,7 +549,7 @@ BattleScript_BerryStatRaiseEnd2:: @ 81D9679 BattleScript_BerryFocusEnergyEnd2:: @ 81D9694 .incbin "baserom.gba", 0x1D9694, 0x10 -gUnknown_81D96A4:: @ 81D96A4 +BattleScript_ActionSelectionItemsCantBeUsed:: @ 81D96A4 .incbin "baserom.gba", 0x1D96A4, 0x4 BattleScript_FlushMessageBox:: @ 81D96A8 diff --git a/data/battle_scripts_2.s b/data/battle_scripts_2.s index c3747cd8d6..3f8ed8f38f 100644 --- a/data/battle_scripts_2.s +++ b/data/battle_scripts_2.s @@ -1,6 +1,6 @@ .section script_data, "aw", %progbits -gUnknown_81D99B0:: @ 81D99B0 +gBattlescriptsForBallThrow:: @ 81D99B0 .incbin "baserom.gba", 0x1D99B0, 0x34 gUnknown_81D99E4:: @ 81D99E4 @@ -9,7 +9,7 @@ gUnknown_81D99E4:: @ 81D99E4 gUnknown_81D99FC:: @ 81D99FC .incbin "baserom.gba", 0x1D99FC, 0x8 -gUnknown_81D9A04:: @ 81D9A04 +gBattlescriptsForSafariActions:: @ 81D9A04 .incbin "baserom.gba", 0x1D9A04, 0x3E BattleScript_SuccessBallThrow:: @ 81D9A42 diff --git a/data/data.s b/data/data.s index 1010190f38..2bc219d7b2 100644 --- a/data/data.s +++ b/data/data.s @@ -316,7 +316,7 @@ gUnknown_8248300:: @ 8248300 gUnknown_8248318:: @ 8248318 .incbin "baserom.gba", 0x248318, 0x8 -gUnknown_8248320:: @ 8248320 +gBattleBgTemplates:: @ 8248320 .incbin "baserom.gba", 0x248320, 0x10 gUnknown_8248330:: @ 8248330 @@ -327,73 +327,7 @@ gUnknown_824EE34:: @ 824EE34 gUnknown_824EFC4:: @ 824EFC4 .incbin "baserom.gba", 0x24EFC4, 0x20 - -gUnknown_824EFE4:: @ 824EFE4 - .incbin "baserom.gba", 0x24EFE4, 0xC - -gUnknown_824EFF0:: @ 824EFF0 - .incbin "baserom.gba", 0x24EFF0, 0x18 - -gUnknown_824F008:: @ 824F008 - .incbin "baserom.gba", 0x24F008, 0x8 - -gUnknown_824F010:: @ 824F010 - .incbin "baserom.gba", 0x24F010, 0x8 - -gUnknown_824F018:: @ 824F018 - .incbin "baserom.gba", 0x24F018, 0x8 - -gUnknown_824F020:: @ 824F020 - .incbin "baserom.gba", 0x24F020, 0x28 - -gUnknown_824F048:: @ 824F048 - .incbin "baserom.gba", 0x24F048, 0x8 - -gTypeEffectiveness:: @ 824F050 - .incbin "baserom.gba", 0x24F050, 0x150 - -gTypeNames:: @ 824F1A0 - .incbin "baserom.gba", 0x24F1A0, 0x80 - -gTrainerMoneyTable:: @ 824F220 - .incbin "baserom.gba", 0x24F220, 0x8E8 - -gUnknown_824FB08:: @ 824FB08 - .incbin "baserom.gba", 0x24FB08, 0x138 - -gUnknown_824FC40:: @ 824FC40 - .incbin "baserom.gba", 0x24FC40, 0x3F8 - -gUnknown_8250038:: @ 8250038 - .incbin "baserom.gba", 0x250038, 0x38 - -gUnknown_8250070:: @ 8250070 - .incbin "baserom.gba", 0x250070, 0x24 - -gStatusConditionString_PoisonJpn:: @ 8250094 - .incbin "baserom.gba", 0x250094, 0x8 - -gStatusConditionString_SleepJpn:: @ 825009C - .incbin "baserom.gba", 0x25009C, 0x8 - -gStatusConditionString_ParalysisJpn:: @ 82500A4 - .incbin "baserom.gba", 0x2500A4, 0x8 - -gStatusConditionString_BurnJpn:: @ 82500AC - .incbin "baserom.gba", 0x2500AC, 0x8 - -gStatusConditionString_IceJpn:: @ 82500B4 - .incbin "baserom.gba", 0x2500B4, 0x8 - -gStatusConditionString_ConfusionJpn:: @ 82500BC - .incbin "baserom.gba", 0x2500BC, 0x8 - -gStatusConditionString_LoveJpn:: @ 82500C4 - .incbin "baserom.gba", 0x2500C4, 0x8 - -gUnknown_82500CC:: @ 82500CC - .incbin "baserom.gba", 0x2500CC, 0x38 - + .section .rodata.8260270 gUnknown_8260270:: @ 8260270 diff --git a/data/data_83F5738.s b/data/data_83F5738.s index 1dd6979564..48ed5d3a93 100644 --- a/data/data_83F5738.s +++ b/data/data_83F5738.s @@ -424,7 +424,28 @@ gUnknown_83FE80C:: @ 83FE80C .incbin "baserom.gba", 0x3FE80C, 0x10 gUnknown_83FE81C:: @ 83FE81C - .incbin "baserom.gba", 0x3FE81C, 0x3D + .incbin "baserom.gba", 0x3FE81C, 0xE + +gText_Sleep:: @ 83FE82A + .incbin "baserom.gba", 0x3FE82A, 0x6 + +gText_Poison:: @ 83FE830 + .incbin "baserom.gba", 0x3FE830, 0x7 + +gText_Burn:: @ 83FE837 + .incbin "baserom.gba", 0x3FE837, 0x5 + +gText_Paralysis:: @ 83FE83C + .incbin "baserom.gba", 0x3FE83C, 0xA + +gText_Ice:: @ 83FE846 + .incbin "baserom.gba", 0x3FE846, 0x4 + +gText_Confusion:: @ 83FE84A + .incbin "baserom.gba", 0x3FE84A, 0xA + +gText_Love:: @ 83FE854 + .incbin "baserom.gba", 0x3FE854, 0x5 gUnknown_83FE859:: @ 83FE859 .incbin "baserom.gba", 0x3FE859, 0x3 diff --git a/include/battle.h b/include/battle.h index 754e929973..3ec32e17f9 100644 --- a/include/battle.h +++ b/include/battle.h @@ -79,7 +79,7 @@ #define B_ACTION_SAFARI_POKEBLOCK 6 #define B_ACTION_SAFARI_GO_NEAR 7 #define B_ACTION_SAFARI_RUN 8 -#define B_ACTION_9 9 +#define B_ACTION_OLDMAN_THROW 9 #define B_ACTION_EXEC_SCRIPT 10 #define B_ACTION_TRY_FINISH 11 #define B_ACTION_FINISHED 12 diff --git a/include/battle_main.h b/include/battle_main.h index 757ee34680..06d658483e 100644 --- a/include/battle_main.h +++ b/include/battle_main.h @@ -45,7 +45,7 @@ struct UnknownPokemonStruct4 void CB2_InitBattle(void); void BattleMainCB2(void); -void CB2_QuitRecordedBattle(void); +void CB2_QuitPokeDudeBattle(void); void sub_8038528(struct Sprite* sprite); void sub_8038A04(void); // unused void VBlankCB_Battle(void); @@ -53,7 +53,7 @@ void sub_801182C(struct Sprite *sprite); void sub_8011A1C(void); u32 sub_80391E0(u8 arrayId, u8 caseId); u32 sub_80397C4(u32 setId, u32 tableId); -void oac_poke_opponent(struct Sprite *sprite); +void SpriteCB_WildMon(struct Sprite *sprite); void SpriteCallbackDummy_2(struct Sprite *sprite); void sub_8039934(struct Sprite *sprite); void sub_8012098(struct Sprite *sprite); @@ -81,7 +81,7 @@ u8 GetWhoStrikesFirst(u8 bank1, u8 bank2, bool8 ignoreChosenMoves); void RunBattleScriptCommands_PopCallbacksStack(void); void RunBattleScriptCommands(void); bool8 TryRunFromBattle(u8 bank); -void sub_800FD9C(void); +void CB2_InitBattle(void); void sub_80120C4(struct Sprite *); void sub_8012100(struct Sprite *); void nullsub_12(void); diff --git a/include/battle_message.h b/include/battle_message.h index ffc9d5bb71..130dc7ce99 100644 --- a/include/battle_message.h +++ b/include/battle_message.h @@ -238,4 +238,12 @@ extern const u8* const gStatNamesTable2[]; extern const u16 gMissStringIds[]; extern const u16 gTrappingMoves[]; +extern const u8 gText_Sleep[]; +extern const u8 gText_Poison[]; +extern const u8 gText_Burn[]; +extern const u8 gText_Paralysis[]; +extern const u8 gText_Ice[]; +extern const u8 gText_Confusion[]; +extern const u8 gText_Love[]; + #endif // GUARD_BATTLE_MESSAGE_H diff --git a/include/constants/abilities.h b/include/constants/abilities.h index 4e2c4056c7..4ad54c86fa 100644 --- a/include/constants/abilities.h +++ b/include/constants/abilities.h @@ -80,4 +80,6 @@ #define ABILITY_CACOPHONY 76 #define ABILITY_AIR_LOCK 77 +#define ABILITIES_COUNT 78 + #endif // GUARD_CONSTANTS_ABILITIES_H diff --git a/include/data.h b/include/data.h index 9dd3864820..005c798b34 100644 --- a/include/data.h +++ b/include/data.h @@ -45,8 +45,8 @@ extern const u8 *const gBattleAnims_Special[]; extern const union AnimCmd *const *const gTrainerBackAnimsPtrTable[]; extern const union AnimCmd *const *const gTrainerFrontAnimsPtrTable[]; -extern const struct OamData gUnknown_824F010; -extern const struct OamData gUnknown_824F018; +extern const struct OamData gOamData_824F010; +extern const struct OamData gOamData_824F018; extern const union AnimCmd *const gSpriteAnimTable_82349BC[]; extern const union AffineAnimCmd *const gSpriteAffineAnimTable_82348C8[]; extern const union AffineAnimCmd *const gSpriteAffineAnimTable_8234944[]; diff --git a/ld_script.txt b/ld_script.txt index ef17deaf6f..0eabfcb0d6 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -66,6 +66,7 @@ SECTIONS { src/battle_controllers.o(.text); src/decompress.o(.text); asm/battle_1.o(.text); + src/battle_main.o(.text); asm/battle_2.o(.text); src/battle_util.o(.text); src/battle_script_commands.o(.text); @@ -385,6 +386,7 @@ SECTIONS { data/data.o(.rodata); src/data.o(.rodata); data/data.o(.rodata.82350AC); + src/battle_main.o(.rodata); src/battle_util.o(.rodata); src/battle_script_commands.o(.rodata); src/battle_controller_player.o(.rodata); diff --git a/src/battle_main.c b/src/battle_main.c new file mode 100644 index 0000000000..a109afbbaf --- /dev/null +++ b/src/battle_main.c @@ -0,0 +1,467 @@ +#include "global.h" +#include "battle.h" +#include "battle_anim.h" +#include "battle_ai_script_commands.h" +#include "battle_controllers.h" +#include "battle_interface.h" +#include "battle_main.h" +#include "battle_message.h" +#include "battle_scripts.h" +#include "battle_setup.h" +#include "battle_tower.h" +#include "battle_string_ids.h" +#include "berry.h" +#include "bg.h" +#include "data.h" +#include "decompress.h" +#include "dma3.h" +#include "event_data.h" +#include "evolution_scene.h" +#include "graphics.h" +#include "gpu_regs.h" +#include "international_string_util.h" +#include "item.h" +#include "link.h" +#include "link_rfu.h" +#include "load_save.h" +#include "main.h" +#include "malloc.h" +#include "m4a.h" +#include "palette.h" +#include "party_menu.h" +#include "pokeball.h" +#include "pokedex.h" +#include "pokemon.h" +#include "random.h" +#include "roamer.h" +#include "safari_zone.h" +#include "scanline_effect.h" +#include "sound.h" +#include "sprite.h" +#include "string_util.h" +#include "strings.h" +#include "task.h" +#include "text.h" +#include "trig.h" +#include "util.h" +#include "window.h" +#include "cable_club.h" +#include "constants/abilities.h" +#include "constants/battle_move_effects.h" +#include "constants/hold_effects.h" +#include "constants/items.h" +#include "constants/moves.h" +#include "constants/songs.h" +#include "constants/species.h" +#include "constants/trainers.h" +#include "constants/trainer_classes.h" + +void sub_80111EC(struct Sprite *sprite); +void HandleAction_UseMove(void); +void HandleAction_Switch(void); +void HandleAction_UseItem(void); +void HandleAction_Run(void); +void HandleAction_WatchesCarefully(void); +void HandleAction_SafariZoneBallThrow(void); +void HandleAction_ThrowPokeblock(void); +void HandleAction_GoNear(void); +void HandleAction_SafariZoneRun(void); +void HandleAction_OldManBallThrow(void); +void HandleAction_TryFinish(void); +void HandleAction_NothingIsFainted(void); +void HandleAction_ActionFinished(void); +void HandleEndTurn_ContinueBattle(void); +void HandleEndTurn_BattleWon(void); +void HandleEndTurn_BattleLost(void); +void HandleEndTurn_RanFromBattle(void); +void HandleEndTurn_MonFled(void); +void HandleEndTurn_FinishBattle(void); + +// TODO: put ewram variables here after resolving symbol ref in between + +void (*gPreBattleCallback1)(void); +void (*gBattleMainFunc)(void); +struct BattleResults gBattleResults; +u8 gLeveledUpInBattle; +void (*gBattlerControllerFuncs[MAX_BATTLERS_COUNT])(void); +u8 gHealthboxSpriteIds[MAX_BATTLERS_COUNT]; +u8 gMultiUsePlayerCursor; +u8 gNumberOfMovesToChoose; +u8 gUnknown_3004FFC[MAX_BATTLERS_COUNT]; + +const struct ScanlineEffectParams sIntroScanlineParams16Bit = +{ + (void *)REG_ADDR_BG3HOFS, SCANLINE_EFFECT_DMACNT_16BIT, 1 +}; + +const struct SpriteTemplate gUnknown_824EFF0 = +{ + .tileTag = 0, + .paletteTag = 0, + .oam = &gDummyOamData, + .anims = gDummySpriteAnimTable, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = sub_80111EC, +}; + +const u8 sText_ShedinjaJpnName[] = _("ヌケニン"); // Nukenin + +const struct OamData gOamData_824F010 = +{ + .y = 0, + .affineMode = ST_OAM_AFFINE_NORMAL, + .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, + .shape = SPRITE_SHAPE(64x64), + .x = 0, + .size = SPRITE_SIZE(64x64), + .tileNum = 0, + .priority = 2, + .paletteNum = 0, + .affineParam = 0, +}; + +const struct OamData gOamData_824F018 = +{ + .y = 0, + .affineMode = ST_OAM_AFFINE_NORMAL, + .objMode = ST_OAM_OBJ_NORMAL, + .bpp = ST_OAM_4BPP, + .shape = SPRITE_SHAPE(64x64), + .x = 0, + .size = SPRITE_SIZE(64x64), + .tileNum = 0, + .priority = 2, + .paletteNum = 2, + .affineParam = 0, +}; + +// not used +const union AnimCmd gUnknown_824F020[] = +{ + ANIMCMD_FRAME(0, 5), + ANIMCMD_JUMP(0), +}; + +// not used +const union AnimCmd *const gUnknown_824F028 = gUnknown_824F020; + +// not used +const union AffineAnimCmd gUnknown_824F02C[] = +{ + AFFINEANIMCMD_FRAME(-0x10, 0x0, 0, 4), + AFFINEANIMCMD_FRAME(0x0, 0x0, 0, 0x3C), + AFFINEANIMCMD_JUMP(1), +}; + +// not used +const union AffineAnimCmd *const gUnknown_824F044 = gUnknown_824F02C; + +const s8 gUnknown_824F048[] ={ -32, -16, -16, -32, -32, 0, 0, 0 }; + +// format: attacking type, defending type, damage multiplier +// the multiplier is a (decimal) fixed-point number: +// 20 is ×2.0 TYPE_MUL_SUPER_EFFECTIVE +// 10 is ×1.0 TYPE_MUL_NORMAL +// 05 is ×0.5 TYPE_MUL_NOT_EFFECTIVE +// 00 is ×0.0 TYPE_MUL_NO_EFFECT +const u8 gTypeEffectiveness[336] = +{ + TYPE_NORMAL, TYPE_ROCK, TYPE_MUL_NOT_EFFECTIVE, + TYPE_NORMAL, TYPE_STEEL, TYPE_MUL_NOT_EFFECTIVE, + TYPE_FIRE, TYPE_FIRE, TYPE_MUL_NOT_EFFECTIVE, + TYPE_FIRE, TYPE_WATER, TYPE_MUL_NOT_EFFECTIVE, + TYPE_FIRE, TYPE_GRASS, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_FIRE, TYPE_ICE, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_FIRE, TYPE_BUG, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_FIRE, TYPE_ROCK, TYPE_MUL_NOT_EFFECTIVE, + TYPE_FIRE, TYPE_DRAGON, TYPE_MUL_NOT_EFFECTIVE, + TYPE_FIRE, TYPE_STEEL, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_WATER, TYPE_FIRE, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_WATER, TYPE_WATER, TYPE_MUL_NOT_EFFECTIVE, + TYPE_WATER, TYPE_GRASS, TYPE_MUL_NOT_EFFECTIVE, + TYPE_WATER, TYPE_GROUND, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_WATER, TYPE_ROCK, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_WATER, TYPE_DRAGON, TYPE_MUL_NOT_EFFECTIVE, + TYPE_ELECTRIC, TYPE_WATER, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_ELECTRIC, TYPE_ELECTRIC, TYPE_MUL_NOT_EFFECTIVE, + TYPE_ELECTRIC, TYPE_GRASS, TYPE_MUL_NOT_EFFECTIVE, + TYPE_ELECTRIC, TYPE_GROUND, TYPE_MUL_NO_EFFECT, + TYPE_ELECTRIC, TYPE_FLYING, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_ELECTRIC, TYPE_DRAGON, TYPE_MUL_NOT_EFFECTIVE, + TYPE_GRASS, TYPE_FIRE, TYPE_MUL_NOT_EFFECTIVE, + TYPE_GRASS, TYPE_WATER, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_GRASS, TYPE_GRASS, TYPE_MUL_NOT_EFFECTIVE, + TYPE_GRASS, TYPE_POISON, TYPE_MUL_NOT_EFFECTIVE, + TYPE_GRASS, TYPE_GROUND, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_GRASS, TYPE_FLYING, TYPE_MUL_NOT_EFFECTIVE, + TYPE_GRASS, TYPE_BUG, TYPE_MUL_NOT_EFFECTIVE, + TYPE_GRASS, TYPE_ROCK, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_GRASS, TYPE_DRAGON, TYPE_MUL_NOT_EFFECTIVE, + TYPE_GRASS, TYPE_STEEL, TYPE_MUL_NOT_EFFECTIVE, + TYPE_ICE, TYPE_WATER, TYPE_MUL_NOT_EFFECTIVE, + TYPE_ICE, TYPE_GRASS, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_ICE, TYPE_ICE, TYPE_MUL_NOT_EFFECTIVE, + TYPE_ICE, TYPE_GROUND, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_ICE, TYPE_FLYING, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_ICE, TYPE_DRAGON, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_ICE, TYPE_STEEL, TYPE_MUL_NOT_EFFECTIVE, + TYPE_ICE, TYPE_FIRE, TYPE_MUL_NOT_EFFECTIVE, + TYPE_FIGHTING, TYPE_NORMAL, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_FIGHTING, TYPE_ICE, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_FIGHTING, TYPE_POISON, TYPE_MUL_NOT_EFFECTIVE, + TYPE_FIGHTING, TYPE_FLYING, TYPE_MUL_NOT_EFFECTIVE, + TYPE_FIGHTING, TYPE_PSYCHIC, TYPE_MUL_NOT_EFFECTIVE, + TYPE_FIGHTING, TYPE_BUG, TYPE_MUL_NOT_EFFECTIVE, + TYPE_FIGHTING, TYPE_ROCK, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_FIGHTING, TYPE_DARK, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_FIGHTING, TYPE_STEEL, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_POISON, TYPE_GRASS, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_POISON, TYPE_POISON, TYPE_MUL_NOT_EFFECTIVE, + TYPE_POISON, TYPE_GROUND, TYPE_MUL_NOT_EFFECTIVE, + TYPE_POISON, TYPE_ROCK, TYPE_MUL_NOT_EFFECTIVE, + TYPE_POISON, TYPE_GHOST, TYPE_MUL_NOT_EFFECTIVE, + TYPE_POISON, TYPE_STEEL, TYPE_MUL_NO_EFFECT, + TYPE_GROUND, TYPE_FIRE, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_GROUND, TYPE_ELECTRIC, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_GROUND, TYPE_GRASS, TYPE_MUL_NOT_EFFECTIVE, + TYPE_GROUND, TYPE_POISON, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_GROUND, TYPE_FLYING, TYPE_MUL_NO_EFFECT, + TYPE_GROUND, TYPE_BUG, TYPE_MUL_NOT_EFFECTIVE, + TYPE_GROUND, TYPE_ROCK, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_GROUND, TYPE_STEEL, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_FLYING, TYPE_ELECTRIC, TYPE_MUL_NOT_EFFECTIVE, + TYPE_FLYING, TYPE_GRASS, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_FLYING, TYPE_FIGHTING, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_FLYING, TYPE_BUG, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_FLYING, TYPE_ROCK, TYPE_MUL_NOT_EFFECTIVE, + TYPE_FLYING, TYPE_STEEL, TYPE_MUL_NOT_EFFECTIVE, + TYPE_PSYCHIC, TYPE_FIGHTING, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_PSYCHIC, TYPE_POISON, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_PSYCHIC, TYPE_PSYCHIC, TYPE_MUL_NOT_EFFECTIVE, + TYPE_PSYCHIC, TYPE_DARK, TYPE_MUL_NO_EFFECT, + TYPE_PSYCHIC, TYPE_STEEL, TYPE_MUL_NOT_EFFECTIVE, + TYPE_BUG, TYPE_FIRE, TYPE_MUL_NOT_EFFECTIVE, + TYPE_BUG, TYPE_GRASS, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_BUG, TYPE_FIGHTING, TYPE_MUL_NOT_EFFECTIVE, + TYPE_BUG, TYPE_POISON, TYPE_MUL_NOT_EFFECTIVE, + TYPE_BUG, TYPE_FLYING, TYPE_MUL_NOT_EFFECTIVE, + TYPE_BUG, TYPE_PSYCHIC, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_BUG, TYPE_GHOST, TYPE_MUL_NOT_EFFECTIVE, + TYPE_BUG, TYPE_DARK, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_BUG, TYPE_STEEL, TYPE_MUL_NOT_EFFECTIVE, + TYPE_ROCK, TYPE_FIRE, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_ROCK, TYPE_ICE, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_ROCK, TYPE_FIGHTING, TYPE_MUL_NOT_EFFECTIVE, + TYPE_ROCK, TYPE_GROUND, TYPE_MUL_NOT_EFFECTIVE, + TYPE_ROCK, TYPE_FLYING, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_ROCK, TYPE_BUG, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_ROCK, TYPE_STEEL, TYPE_MUL_NOT_EFFECTIVE, + TYPE_GHOST, TYPE_NORMAL, TYPE_MUL_NO_EFFECT, + TYPE_GHOST, TYPE_PSYCHIC, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_GHOST, TYPE_DARK, TYPE_MUL_NOT_EFFECTIVE, + TYPE_GHOST, TYPE_STEEL, TYPE_MUL_NOT_EFFECTIVE, + TYPE_GHOST, TYPE_GHOST, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_DRAGON, TYPE_DRAGON, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_DRAGON, TYPE_STEEL, TYPE_MUL_NOT_EFFECTIVE, + TYPE_DARK, TYPE_FIGHTING, TYPE_MUL_NOT_EFFECTIVE, + TYPE_DARK, TYPE_PSYCHIC, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_DARK, TYPE_GHOST, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_DARK, TYPE_DARK, TYPE_MUL_NOT_EFFECTIVE, + TYPE_DARK, TYPE_STEEL, TYPE_MUL_NOT_EFFECTIVE, + TYPE_STEEL, TYPE_FIRE, TYPE_MUL_NOT_EFFECTIVE, + TYPE_STEEL, TYPE_WATER, TYPE_MUL_NOT_EFFECTIVE, + TYPE_STEEL, TYPE_ELECTRIC, TYPE_MUL_NOT_EFFECTIVE, + TYPE_STEEL, TYPE_ICE, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_STEEL, TYPE_ROCK, TYPE_MUL_SUPER_EFFECTIVE, + TYPE_STEEL, TYPE_STEEL, TYPE_MUL_NOT_EFFECTIVE, + TYPE_FORESIGHT, TYPE_FORESIGHT, TYPE_MUL_NO_EFFECT, + TYPE_NORMAL, TYPE_GHOST, TYPE_MUL_NO_EFFECT, + TYPE_FIGHTING, TYPE_GHOST, TYPE_MUL_NO_EFFECT, + TYPE_ENDTABLE, TYPE_ENDTABLE, TYPE_MUL_NO_EFFECT +}; + +const u8 gTypeNames[][TYPE_NAME_LENGTH + 1] = +{ + _("NORMAL"), + _("FIGHT"), + _("FLYING"), + _("POISON"), + _("GROUND"), + _("ROCK"), + _("BUG"), + _("GHOST"), + _("STEEL"), + _("???"), + _("FIRE"), + _("WATER"), + _("GRASS"), + _("ELECTR"), + _("PSYCHC"), + _("ICE"), + _("DRAGON"), + _("DARK"), +}; + +// This is a factor in how much money you get for beating a trainer. +const struct TrainerMoney gTrainerMoneyTable[] = +{ + { CLASS_LEADER_2, 25 }, + { CLASS_ELITE_FOUR_2, 25 }, + { CLASS_PKMN_PROF, 25 }, + { CLASS_RIVAL, 4 }, + { CLASS_RIVAL_2, 9 }, + { CLASS_CHAMPION_2, 25 }, + { CLASS_YOUNGSTER_2, 4 }, + { CLASS_BUG_CATCHER_2, 3 }, + { CLASS_HIKER_2, 9 }, + { CLASS_BIRD_KEEPER_2, 6 }, + { CLASS_PICNICKER_2, 5 }, + { CLASS_SUPER_NERD, 6 }, + { CLASS_FISHERMAN_2, 9 }, + { CLASS_TEAM_ROCKET, 8 }, + { CLASS_LASS_2, 4 }, + { CLASS_BEAUTY_2, 18 }, + { CLASS_BLACK_BELT_2, 6 }, + { CLASS_CUE_BALL, 6 }, + { CLASS_CHANNELER, 8 }, + { CLASS_ROCKER, 6 }, + { CLASS_GENTLEMAN_2, 18 }, + { CLASS_BURGLAR, 22 }, + { CLASS_SWIMMER_MALE_2, 1 }, + { CLASS_ENGINEER, 12 }, + { CLASS_JUGGLER, 10 }, + { CLASS_SAILOR_2, 8 }, + { CLASS_COOLTRAINER_2, 9 }, + { CLASS_POKEMANIAC_2, 12 }, + { CLASS_TAMER, 10 }, + { CLASS_CAMPER_2, 5 }, + { CLASS_PSYCHIC_2, 5 }, + { CLASS_BIKER, 5 }, + { CLASS_GAMER, 18 }, + { CLASS_SCIENTIST, 12 }, + { CLASS_CRUSH_GIRL, 6 }, + { CLASS_TUBER_3, 1 }, + { CLASS_PKMN_BREEDER_2, 7 }, + { CLASS_PKMN_RANGER_2, 9 }, + { CLASS_AROMA_LADY_2, 7 }, + { CLASS_RUIN_MANIAC_2, 12 }, + { CLASS_LADY_2, 50 }, + { CLASS_PAINTER, 4 }, + { CLASS_TWINS_2, 3 }, + { CLASS_YOUNG_COUPLE_2, 7 }, + { CLASS_SIS_AND_BRO_2, 1 }, + { CLASS_COOL_COUPLE, 6 }, + { CLASS_CRUSH_KIN, 6 }, + { CLASS_SWIMMER_FEMALE_2, 1 }, + { CLASS_PLAYER, 1 }, + { CLASS_LEADER, 25 }, + { CLASS_ELITE_FOUR, 25 }, + { CLASS_LASS, 4 }, + { CLASS_YOUNGSTER, 4 }, + { CLASS_PKMN_TRAINER_3, 15 }, + { CLASS_HIKER, 10 }, + { CLASS_BEAUTY, 20 }, + { CLASS_FISHERMAN, 10 }, + { CLASS_LADY, 50 }, + { CLASS_TRIATHLETE, 10 }, + { CLASS_TEAM_AQUA, 5 }, + { CLASS_TWINS, 3 }, + { CLASS_SWIMMER_FEMALE, 2 }, + { CLASS_BUG_CATCHER, 4 }, + { CLASS_SCHOOL_KID, 5 }, + { CLASS_RICH_BOY, 50 }, + { CLASS_SR_AND_JR, 4 }, + { CLASS_BLACK_BELT, 8 }, + { CLASS_TUBER, 1 }, + { CLASS_HEX_MANIAC, 6 }, + { CLASS_PKMN_BREEDER, 10 }, + { CLASS_TEAM_MAGMA, 5 }, + { CLASS_INTERVIEWER, 12 }, + { CLASS_TUBER_2, 1 }, + { CLASS_YOUNG_COUPLE, 8 }, + { CLASS_GUITARIST, 8 }, + { CLASS_GENTLEMAN, 20 }, + { CLASS_CHAMPION, 50 }, + { CLASS_MAGMA_LEADER, 20 }, + { CLASS_BATTLE_GIRL, 6 }, + { CLASS_SWIMMER_MALE, 2 }, + { CLASS_POKEFAN, 20 }, + { CLASS_EXPERT, 10 }, + { CLASS_DRAGON_TAMER, 12 }, + { CLASS_BIRD_KEEPER, 8 }, + { CLASS_NINJA_BOY, 3 }, + { CLASS_PARASOL_LADY, 10 }, + { CLASS_BUG_MANIAC, 15 }, + { CLASS_SAILOR, 8 }, + { CLASS_COLLECTOR, 15 }, + { CLASS_PKMN_RANGER, 12 }, + { CLASS_MAGMA_ADMIN, 10 }, + { CLASS_AROMA_LADY, 10 }, + { CLASS_RUIN_MANIAC, 15 }, + { CLASS_COOLTRAINER, 12 }, + { CLASS_POKEMANIAC, 15 }, + { CLASS_KINDLER, 8 }, + { CLASS_CAMPER, 4 }, + { CLASS_PICNICKER, 4 }, + { CLASS_PSYCHIC, 6 }, + { CLASS_SIS_AND_BRO, 3 }, + { CLASS_OLD_COUPLE, 10 }, + { CLASS_AQUA_ADMIN, 10 }, + { CLASS_AQUA_LEADER, 20 }, + { CLASS_BOSS, 25 }, + { 0xFF, 5 }, +}; + +#include "data/text/abilities.h" + +void (*const sTurnActionsFuncsTable[])(void) = +{ + [B_ACTION_USE_MOVE] = HandleAction_UseMove, + [B_ACTION_USE_ITEM] = HandleAction_UseItem, + [B_ACTION_SWITCH] = HandleAction_Switch, + [B_ACTION_RUN] = HandleAction_Run, + [B_ACTION_SAFARI_WATCH_CAREFULLY] = HandleAction_WatchesCarefully, + [B_ACTION_SAFARI_BALL] = HandleAction_SafariZoneBallThrow, + [B_ACTION_SAFARI_POKEBLOCK] = HandleAction_ThrowPokeblock, + [B_ACTION_SAFARI_GO_NEAR] = HandleAction_GoNear, + [B_ACTION_SAFARI_RUN] = HandleAction_SafariZoneRun, + [B_ACTION_OLDMAN_THROW] = HandleAction_OldManBallThrow, + [B_ACTION_EXEC_SCRIPT] = HandleAction_RunBattleScript, + [B_ACTION_TRY_FINISH] = HandleAction_TryFinish, + [B_ACTION_FINISHED] = HandleAction_ActionFinished, + [B_ACTION_NOTHING_FAINTED] = HandleAction_NothingIsFainted, +}; + +void (*const sEndTurnFuncsTable[])(void) = +{ + [0] = HandleEndTurn_ContinueBattle, //B_OUTCOME_NONE? + [B_OUTCOME_WON] = HandleEndTurn_BattleWon, + [B_OUTCOME_LOST] = HandleEndTurn_BattleLost, + [B_OUTCOME_DREW] = HandleEndTurn_BattleLost, + [B_OUTCOME_RAN] = HandleEndTurn_RanFromBattle, + [B_OUTCOME_PLAYER_TELEPORTED] = HandleEndTurn_FinishBattle, + [B_OUTCOME_MON_FLED] = HandleEndTurn_MonFled, + [B_OUTCOME_CAUGHT] = HandleEndTurn_FinishBattle, + [B_OUTCOME_NO_SAFARI_BALLS] = HandleEndTurn_FinishBattle, +}; + +const u8 gStatusConditionString_PoisonJpn[8] = _("どく$$$$$"); +const u8 gStatusConditionString_SleepJpn[8] = _("ねむり$$$$"); +const u8 gStatusConditionString_ParalysisJpn[8] = _("まひ$$$$$"); +const u8 gStatusConditionString_BurnJpn[8] = _("やけど$$$$"); +const u8 gStatusConditionString_IceJpn[8] = _("こおり$$$$"); +const u8 gStatusConditionString_ConfusionJpn[8] = _("こんらん$$$"); +const u8 gStatusConditionString_LoveJpn[8] = _("メロメロ$$$"); + +const u8 *const gStatusConditionStringsTable[7][2] = +{ + {gStatusConditionString_PoisonJpn, gText_Poison}, + {gStatusConditionString_SleepJpn, gText_Sleep}, + {gStatusConditionString_ParalysisJpn, gText_Paralysis}, + {gStatusConditionString_BurnJpn, gText_Burn}, + {gStatusConditionString_IceJpn, gText_Ice}, + {gStatusConditionString_ConfusionJpn, gText_Confusion}, + {gStatusConditionString_LoveJpn, gText_Love} +}; diff --git a/src/data/text/abilities.h b/src/data/text/abilities.h new file mode 100644 index 0000000000..c2002bed7c --- /dev/null +++ b/src/data/text/abilities.h @@ -0,0 +1,242 @@ +static const u8 sNoneDescription[] = _("No special ability."); +static const u8 sStenchDescription[] = _("Helps repel wild POKéMON."); +static const u8 sDrizzleDescription[] = _("Summons rain in battle."); +static const u8 sSpeedBoostDescription[] = _("Gradually boosts SPEED."); +static const u8 sBattleArmorDescription[] = _("Blocks critical hits."); +static const u8 sSturdyDescription[] = _("Negates 1-hit KO attacks."); +static const u8 sDampDescription[] = _("Prevents self-destruction."); +static const u8 sLimberDescription[] = _("Prevents paralysis."); +static const u8 sSandVeilDescription[] = _("Ups evasion in a sandstorm."); +static const u8 sStaticDescription[] = _("Paralyzes on contact."); +static const u8 sVoltAbsorbDescription[] = _("Turns electricity into HP."); +static const u8 sWaterAbsorbDescription[] = _("Changes water into HP."); +static const u8 sObliviousDescription[] = _("Prevents attraction."); +static const u8 sCloudNineDescription[] = _("Negates weather effects."); +static const u8 sCompoundEyesDescription[] = _("Raises accuracy."); +static const u8 sInsomniaDescription[] = _("Prevents sleep."); +static const u8 sColorChangeDescription[] = _("Changes type to foe's move."); +static const u8 sImmunityDescription[] = _("Prevents poisoning."); +static const u8 sFlashFireDescription[] = _("Powers up if hit by fire."); +static const u8 sShieldDustDescription[] = _("Prevents added effects."); +static const u8 sOwnTempoDescription[] = _("Prevents confusion."); +static const u8 sSuctionCupsDescription[] = _("Firmly anchors the body."); +static const u8 sIntimidateDescription[] = _("Lowers the foe's ATTACK."); +static const u8 sShadowTagDescription[] = _("Prevents the foe's escape."); +static const u8 sRoughSkinDescription[] = _("Hurts to touch."); +static const u8 sWonderGuardDescription[] = _("“Super effective” hits."); +static const u8 sLevitateDescription[] = _("Not hit by GROUND attacks."); +static const u8 sEffectSporeDescription[] = _("Leaves spores on contact."); +static const u8 sSynchronizeDescription[] = _("Passes on status problems."); +static const u8 sClearBodyDescription[] = _("Prevents ability reduction."); +static const u8 sNaturalCureDescription[] = _("Heals upon switching out."); +static const u8 sLightningRodDescription[] = _("Draws electrical moves."); +static const u8 sSereneGraceDescription[] = _("Promotes added effects."); +static const u8 sSwiftSwimDescription[] = _("Raises SPEED in rain."); +static const u8 sChlorophyllDescription[] = _("Raises SPEED in sunshine."); +static const u8 sIlluminateDescription[] = _("Encounter rate increases."); +static const u8 sTraceDescription[] = _("Copies special ability."); +static const u8 sHugePowerDescription[] = _("Raises ATTACK."); +static const u8 sPoisonPointDescription[] = _("Poisons foe on contact."); +static const u8 sInnerFocusDescription[] = _("Prevents flinching."); +static const u8 sMagmaArmorDescription[] = _("Prevents freezing."); +static const u8 sWaterVeilDescription[] = _("Prevents burns."); +static const u8 sMagnetPullDescription[] = _("Traps STEEL-type POKéMON."); +static const u8 sSoundproofDescription[] = _("Avoids sound-based moves."); +static const u8 sRainDishDescription[] = _("Slight HP recovery in rain."); +static const u8 sSandStreamDescription[] = _("Summons a sandstorm."); +static const u8 sPressureDescription[] = _("Raises foe's PP usage."); +static const u8 sThickFatDescription[] = _("Heat-and-cold protection."); +static const u8 sEarlyBirdDescription[] = _("Awakens quickly from sleep."); +static const u8 sFlameBodyDescription[] = _("Burns the foe on contact."); +static const u8 sRunAwayDescription[] = _("Makes escaping easier."); +static const u8 sKeenEyeDescription[] = _("Prevents loss of accuracy."); +static const u8 sHyperCutterDescription[] = _("Prevents ATTACK reduction."); +static const u8 sPickupDescription[] = _("May pick up items."); +static const u8 sTruantDescription[] = _("Moves only every two turns."); +static const u8 sHustleDescription[] = _("Trades accuracy for power."); +static const u8 sCuteCharmDescription[] = _("Infatuates on contact."); +static const u8 sPlusDescription[] = _("Powers up with MINUS."); +static const u8 sMinusDescription[] = _("Powers up with PLUS."); +static const u8 sForecastDescription[] = _("Changes with the weather."); +static const u8 sStickyHoldDescription[] = _("Prevents item theft."); +static const u8 sShedSkinDescription[] = _("Heals the body by shedding."); +static const u8 sGutsDescription[] = _("Ups ATTACK if suffering."); +static const u8 sMarvelScaleDescription[] = _("Ups DEFENSE if suffering."); +static const u8 sLiquidOozeDescription[] = _("Draining causes injury."); +static const u8 sOvergrowDescription[] = _("Ups GRASS moves in a pinch."); +static const u8 sBlazeDescription[] = _("Ups FIRE moves in a pinch."); +static const u8 sTorrentDescription[] = _("Ups WATER moves in a pinch."); +static const u8 sSwarmDescription[] = _("Ups BUG moves in a pinch."); +static const u8 sRockHeadDescription[] = _("Prevents recoil damage."); +static const u8 sDroughtDescription[] = _("Summons sunlight in battle."); +static const u8 sArenaTrapDescription[] = _("Prevents fleeing."); +static const u8 sVitalSpiritDescription[] = _("Prevents sleep."); +static const u8 sWhiteSmokeDescription[] = _("Prevents ability reduction."); +static const u8 sPurePowerDescription[] = _("Raises ATTACK."); +static const u8 sShellArmorDescription[] = _("Blocks critical hits."); +static const u8 sCacophonyDescription[] = _("Avoids sound-based moves."); +static const u8 sAirLockDescription[] = _("Negates weather effects."); + +const u8 *const gAbilityDescriptionPointers[ABILITIES_COUNT] = +{ + [ABILITY_NONE] = sNoneDescription, + [ABILITY_STENCH] = sStenchDescription, + [ABILITY_DRIZZLE] = sDrizzleDescription, + [ABILITY_SPEED_BOOST] = sSpeedBoostDescription, + [ABILITY_BATTLE_ARMOR] = sBattleArmorDescription, + [ABILITY_STURDY] = sSturdyDescription, + [ABILITY_DAMP] = sDampDescription, + [ABILITY_LIMBER] = sLimberDescription, + [ABILITY_SAND_VEIL] = sSandVeilDescription, + [ABILITY_STATIC] = sStaticDescription, + [ABILITY_VOLT_ABSORB] = sVoltAbsorbDescription, + [ABILITY_WATER_ABSORB] = sWaterAbsorbDescription, + [ABILITY_OBLIVIOUS] = sObliviousDescription, + [ABILITY_CLOUD_NINE] = sCloudNineDescription, + [ABILITY_COMPOUND_EYES] = sCompoundEyesDescription, + [ABILITY_INSOMNIA] = sInsomniaDescription, + [ABILITY_COLOR_CHANGE] = sColorChangeDescription, + [ABILITY_IMMUNITY] = sImmunityDescription, + [ABILITY_FLASH_FIRE] = sFlashFireDescription, + [ABILITY_SHIELD_DUST] = sShieldDustDescription, + [ABILITY_OWN_TEMPO] = sOwnTempoDescription, + [ABILITY_SUCTION_CUPS] = sSuctionCupsDescription, + [ABILITY_INTIMIDATE] = sIntimidateDescription, + [ABILITY_SHADOW_TAG] = sShadowTagDescription, + [ABILITY_ROUGH_SKIN] = sRoughSkinDescription, + [ABILITY_WONDER_GUARD] = sWonderGuardDescription, + [ABILITY_LEVITATE] = sLevitateDescription, + [ABILITY_EFFECT_SPORE] = sEffectSporeDescription, + [ABILITY_SYNCHRONIZE] = sSynchronizeDescription, + [ABILITY_CLEAR_BODY] = sClearBodyDescription, + [ABILITY_NATURAL_CURE] = sNaturalCureDescription, + [ABILITY_LIGHTNING_ROD] = sLightningRodDescription, + [ABILITY_SERENE_GRACE] = sSereneGraceDescription, + [ABILITY_SWIFT_SWIM] = sSwiftSwimDescription, + [ABILITY_CHLOROPHYLL] = sChlorophyllDescription, + [ABILITY_ILLUMINATE] = sIlluminateDescription, + [ABILITY_TRACE] = sTraceDescription, + [ABILITY_HUGE_POWER] = sHugePowerDescription, + [ABILITY_POISON_POINT] = sPoisonPointDescription, + [ABILITY_INNER_FOCUS] = sInnerFocusDescription, + [ABILITY_MAGMA_ARMOR] = sMagmaArmorDescription, + [ABILITY_WATER_VEIL] = sWaterVeilDescription, + [ABILITY_MAGNET_PULL] = sMagnetPullDescription, + [ABILITY_SOUNDPROOF] = sSoundproofDescription, + [ABILITY_RAIN_DISH] = sRainDishDescription, + [ABILITY_SAND_STREAM] = sSandStreamDescription, + [ABILITY_PRESSURE] = sPressureDescription, + [ABILITY_THICK_FAT] = sThickFatDescription, + [ABILITY_EARLY_BIRD] = sEarlyBirdDescription, + [ABILITY_FLAME_BODY] = sFlameBodyDescription, + [ABILITY_RUN_AWAY] = sRunAwayDescription, + [ABILITY_KEEN_EYE] = sKeenEyeDescription, + [ABILITY_HYPER_CUTTER] = sHyperCutterDescription, + [ABILITY_PICKUP] = sPickupDescription, + [ABILITY_TRUANT] = sTruantDescription, + [ABILITY_HUSTLE] = sHustleDescription, + [ABILITY_CUTE_CHARM] = sCuteCharmDescription, + [ABILITY_PLUS] = sPlusDescription, + [ABILITY_MINUS] = sMinusDescription, + [ABILITY_FORECAST] = sForecastDescription, + [ABILITY_STICKY_HOLD] = sStickyHoldDescription, + [ABILITY_SHED_SKIN] = sShedSkinDescription, + [ABILITY_GUTS] = sGutsDescription, + [ABILITY_MARVEL_SCALE] = sMarvelScaleDescription, + [ABILITY_LIQUID_OOZE] = sLiquidOozeDescription, + [ABILITY_OVERGROW] = sOvergrowDescription, + [ABILITY_BLAZE] = sBlazeDescription, + [ABILITY_TORRENT] = sTorrentDescription, + [ABILITY_SWARM] = sSwarmDescription, + [ABILITY_ROCK_HEAD] = sRockHeadDescription, + [ABILITY_DROUGHT] = sDroughtDescription, + [ABILITY_ARENA_TRAP] = sArenaTrapDescription, + [ABILITY_VITAL_SPIRIT] = sVitalSpiritDescription, + [ABILITY_WHITE_SMOKE] = sWhiteSmokeDescription, + [ABILITY_PURE_POWER] = sPurePowerDescription, + [ABILITY_SHELL_ARMOR] = sShellArmorDescription, + [ABILITY_CACOPHONY] = sCacophonyDescription, + [ABILITY_AIR_LOCK] = sAirLockDescription, +}; + +const u8 gAbilityNames[ABILITIES_COUNT][ABILITY_NAME_LENGTH + 1] = +{ + [ABILITY_NONE] = _("-------"), + [ABILITY_STENCH] = _("STENCH"), + [ABILITY_DRIZZLE] = _("DRIZZLE"), + [ABILITY_SPEED_BOOST] = _("SPEED BOOST"), + [ABILITY_BATTLE_ARMOR] = _("BATTLE ARMOR"), + [ABILITY_STURDY] = _("STURDY"), + [ABILITY_DAMP] = _("DAMP"), + [ABILITY_LIMBER] = _("LIMBER"), + [ABILITY_SAND_VEIL] = _("SAND VEIL"), + [ABILITY_STATIC] = _("STATIC"), + [ABILITY_VOLT_ABSORB] = _("VOLT ABSORB"), + [ABILITY_WATER_ABSORB] = _("WATER ABSORB"), + [ABILITY_OBLIVIOUS] = _("OBLIVIOUS"), + [ABILITY_CLOUD_NINE] = _("CLOUD NINE"), + [ABILITY_COMPOUND_EYES] = _("COMPOUNDEYES"), + [ABILITY_INSOMNIA] = _("INSOMNIA"), + [ABILITY_COLOR_CHANGE] = _("COLOR CHANGE"), + [ABILITY_IMMUNITY] = _("IMMUNITY"), + [ABILITY_FLASH_FIRE] = _("FLASH FIRE"), + [ABILITY_SHIELD_DUST] = _("SHIELD DUST"), + [ABILITY_OWN_TEMPO] = _("OWN TEMPO"), + [ABILITY_SUCTION_CUPS] = _("SUCTION CUPS"), + [ABILITY_INTIMIDATE] = _("INTIMIDATE"), + [ABILITY_SHADOW_TAG] = _("SHADOW TAG"), + [ABILITY_ROUGH_SKIN] = _("ROUGH SKIN"), + [ABILITY_WONDER_GUARD] = _("WONDER GUARD"), + [ABILITY_LEVITATE] = _("LEVITATE"), + [ABILITY_EFFECT_SPORE] = _("EFFECT SPORE"), + [ABILITY_SYNCHRONIZE] = _("SYNCHRONIZE"), + [ABILITY_CLEAR_BODY] = _("CLEAR BODY"), + [ABILITY_NATURAL_CURE] = _("NATURAL CURE"), + [ABILITY_LIGHTNING_ROD] = _("LIGHTNINGROD"), + [ABILITY_SERENE_GRACE] = _("SERENE GRACE"), + [ABILITY_SWIFT_SWIM] = _("SWIFT SWIM"), + [ABILITY_CHLOROPHYLL] = _("CHLOROPHYLL"), + [ABILITY_ILLUMINATE] = _("ILLUMINATE"), + [ABILITY_TRACE] = _("TRACE"), + [ABILITY_HUGE_POWER] = _("HUGE POWER"), + [ABILITY_POISON_POINT] = _("POISON POINT"), + [ABILITY_INNER_FOCUS] = _("INNER FOCUS"), + [ABILITY_MAGMA_ARMOR] = _("MAGMA ARMOR"), + [ABILITY_WATER_VEIL] = _("WATER VEIL"), + [ABILITY_MAGNET_PULL] = _("MAGNET PULL"), + [ABILITY_SOUNDPROOF] = _("SOUNDPROOF"), + [ABILITY_RAIN_DISH] = _("RAIN DISH"), + [ABILITY_SAND_STREAM] = _("SAND STREAM"), + [ABILITY_PRESSURE] = _("PRESSURE"), + [ABILITY_THICK_FAT] = _("THICK FAT"), + [ABILITY_EARLY_BIRD] = _("EARLY BIRD"), + [ABILITY_FLAME_BODY] = _("FLAME BODY"), + [ABILITY_RUN_AWAY] = _("RUN AWAY"), + [ABILITY_KEEN_EYE] = _("KEEN EYE"), + [ABILITY_HYPER_CUTTER] = _("HYPER CUTTER"), + [ABILITY_PICKUP] = _("PICKUP"), + [ABILITY_TRUANT] = _("TRUANT"), + [ABILITY_HUSTLE] = _("HUSTLE"), + [ABILITY_CUTE_CHARM] = _("CUTE CHARM"), + [ABILITY_PLUS] = _("PLUS"), + [ABILITY_MINUS] = _("MINUS"), + [ABILITY_FORECAST] = _("FORECAST"), + [ABILITY_STICKY_HOLD] = _("STICKY HOLD"), + [ABILITY_SHED_SKIN] = _("SHED SKIN"), + [ABILITY_GUTS] = _("GUTS"), + [ABILITY_MARVEL_SCALE] = _("MARVEL SCALE"), + [ABILITY_LIQUID_OOZE] = _("LIQUID OOZE"), + [ABILITY_OVERGROW] = _("OVERGROW"), + [ABILITY_BLAZE] = _("BLAZE"), + [ABILITY_TORRENT] = _("TORRENT"), + [ABILITY_SWARM] = _("SWARM"), + [ABILITY_ROCK_HEAD] = _("ROCK HEAD"), + [ABILITY_DROUGHT] = _("DROUGHT"), + [ABILITY_ARENA_TRAP] = _("ARENA TRAP"), + [ABILITY_VITAL_SPIRIT] = _("VITAL SPIRIT"), + [ABILITY_WHITE_SMOKE] = _("WHITE SMOKE"), + [ABILITY_PURE_POWER] = _("PURE POWER"), + [ABILITY_SHELL_ARMOR] = _("SHELL ARMOR"), + [ABILITY_CACOPHONY] = _("CACOPHONY"), + [ABILITY_AIR_LOCK] = _("AIR LOCK"), +}; diff --git a/src/pokemon.c b/src/pokemon.c index 9c3e98524e..12e6f032de 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -1467,7 +1467,7 @@ const struct SpriteTemplate gUnknown_825DEF0[] = { .tileTag = SPRITE_INVALID_TAG, .paletteTag = 0, - .oam = &gUnknown_824F018, + .oam = &gOamData_824F018, .anims = NULL, .images = gUnknown_8234698, .affineAnims = gSpriteAffineAnimTable_82348C8, @@ -1476,16 +1476,16 @@ const struct SpriteTemplate gUnknown_825DEF0[] = { .tileTag = SPRITE_INVALID_TAG, .paletteTag = 0, - .oam = &gUnknown_824F010, + .oam = &gOamData_824F010, .anims = NULL, .images = gUnknown_82346B8, .affineAnims = gSpriteAffineAnimTable_8234944, - .callback = oac_poke_opponent, + .callback = SpriteCB_WildMon, }, { .tileTag = SPRITE_INVALID_TAG, .paletteTag = 0, - .oam = &gUnknown_824F018, + .oam = &gOamData_824F018, .anims = NULL, .images = gUnknown_82346D8, .affineAnims = gSpriteAffineAnimTable_82348C8, @@ -1494,11 +1494,11 @@ const struct SpriteTemplate gUnknown_825DEF0[] = { .tileTag = SPRITE_INVALID_TAG, .paletteTag = 0, - .oam = &gUnknown_824F010, + .oam = &gOamData_824F010, .anims = NULL, .images = gUnknown_82346F8, .affineAnims = gSpriteAffineAnimTable_8234944, - .callback = oac_poke_opponent, + .callback = SpriteCB_WildMon, }, }; @@ -1507,7 +1507,7 @@ const struct SpriteTemplate gUnknown_825DF50[] = { .tileTag = SPRITE_INVALID_TAG, .paletteTag = 0, - .oam = &gUnknown_824F018, + .oam = &gOamData_824F018, .anims = NULL, .images = gUnknown_8234718, .affineAnims = gSpriteAffineAnimTable_82348C8, @@ -1516,7 +1516,7 @@ const struct SpriteTemplate gUnknown_825DF50[] = { .tileTag = SPRITE_INVALID_TAG, .paletteTag = 0, - .oam = &gUnknown_824F018, + .oam = &gOamData_824F018, .anims = NULL, .images = gUnknown_8234740, .affineAnims = gSpriteAffineAnimTable_82348C8, @@ -1525,7 +1525,7 @@ const struct SpriteTemplate gUnknown_825DF50[] = { .tileTag = SPRITE_INVALID_TAG, .paletteTag = 0, - .oam = &gUnknown_824F018, + .oam = &gOamData_824F018, .anims = NULL, .images = gUnknown_82347A8, .affineAnims = gSpriteAffineAnimTable_82348C8, @@ -1534,7 +1534,7 @@ const struct SpriteTemplate gUnknown_825DF50[] = { .tileTag = SPRITE_INVALID_TAG, .paletteTag = 0, - .oam = &gUnknown_824F018, + .oam = &gOamData_824F018, .anims = NULL, .images = gUnknown_82347C8, .affineAnims = gSpriteAffineAnimTable_82348C8, @@ -1543,7 +1543,7 @@ const struct SpriteTemplate gUnknown_825DF50[] = { .tileTag = SPRITE_INVALID_TAG, .paletteTag = 0, - .oam = &gUnknown_824F018, + .oam = &gOamData_824F018, .anims = NULL, .images = gUnknown_8234768, .affineAnims = gSpriteAffineAnimTable_82348C8, @@ -1552,7 +1552,7 @@ const struct SpriteTemplate gUnknown_825DF50[] = { .tileTag = SPRITE_INVALID_TAG, .paletteTag = 0, - .oam = &gUnknown_824F018, + .oam = &gOamData_824F018, .anims = NULL, .images = gUnknown_8234788, .affineAnims = gSpriteAffineAnimTable_82348C8, diff --git a/src/teachy_tv.c b/src/teachy_tv.c index aa273073bf..7369bf03aa 100644 --- a/src/teachy_tv.c +++ b/src/teachy_tv.c @@ -1214,7 +1214,7 @@ static void TeachyTvPreBattleAnimAndSetBattleCallback(u8 taskId) case 1: if (BT_IsDone()) { - SetMainCallback2(sub_800FD9C); + SetMainCallback2(CB2_InitBattle); DestroyTask(taskId); } break; diff --git a/src/trainer_tower.c b/src/trainer_tower.c index 9512e73d17..b0d2bcbb42 100644 --- a/src/trainer_tower.c +++ b/src/trainer_tower.c @@ -1115,7 +1115,7 @@ void sub_815E124(u8 taskId) { gMain.savedCallback = sub_815E114; CleanupOverworldWindowsAndTilemaps(); - SetMainCallback2(sub_800FD9C); + SetMainCallback2(CB2_InitBattle); DestroyTask(taskId); } } diff --git a/sym_common.txt b/sym_common.txt index 0619ea7281..c61907fe7c 100644 --- a/sym_common.txt +++ b/sym_common.txt @@ -5,35 +5,8 @@ .include "text.o" .include "sprite.o" .include "link.o" - .align 4 -gPreBattleCallback1: @ 3004F80 - .space 0x4 - -gBattleMainFunc: @ 3004F84 - .space 0xC - -gBattleResults: @ 3004F90 - .space 0x44 - -gLeveledUpInBattle: @ 3004FD4 - .space 0xC - -gBattlerControllerFuncs: @ 3004FE0 - .space 0x10 - -gHealthboxSpriteIds: @ 3004FF0 - .space 0x4 - -gMultiUsePlayerCursor: @ 3004FF4 - .space 0x4 - -gNumberOfMovesToChoose: @ 3004FF8 - .space 0x4 - -gUnknown_3004FFC: @ 3004FFC - .space 0x4 - + .include "battle_main.o" .include "random.o" .include "load_save.o" diff --git a/sym_ewram.txt b/sym_ewram.txt index f837f1ae04..c3134786df 100644 --- a/sym_ewram.txt +++ b/sym_ewram.txt @@ -50,10 +50,10 @@ gBattle_WIN0H: @ 2022984 gBattle_WIN0V: @ 2022986 .space 0x2 -gUnknown_2022988: @ 2022988 +gBattle_WIN1H: @ 2022988 .space 0x2 -gUnknown_202298A: @ 202298A +gBattle_WIN1V: @ 202298A .space 0x2 gDisplayedStringBattle: @ 202298C @@ -281,7 +281,7 @@ gPauseCounterBattle: @ 2023E7C gPaydayMoney: @ 2023E7E .space 0x2 -gUnknown_2023E80: @ 2023E80 +gRandomTurnNumber: @ 2023E80 .space 0x2 gBattleCommunication: @ 2023E82