From a07d69d7c2e65ed8ea71ec88cc3c4cadbb444510 Mon Sep 17 00:00:00 2001 From: Diegoisawesome Date: Tue, 14 Aug 2018 21:56:11 -0700 Subject: [PATCH] Finish pokemon_summary_screen --- ...emon_summary_screen.s => battle_pyramid.s} | 1533 +---------- data/pokemon_summary_screen.s | 507 ---- data/unk_pokedex_area_screen_helper.s | 110 + include/battle_controllers.h | 2 + include/battle_frontier_2.h | 1 + include/battle_tent.h | 6 + include/contest_effect.h | 1 + include/graphics.h | 20 + include/m4a.h | 1 + include/menu.h | 2 + include/menu_helpers.h | 1 + include/mon_markings.h | 2 + include/party_menu.h | 3 + include/pokeball.h | 2 + include/pokemon_storage_system.h | 1 + include/pokemon_summary_screen.h | 2 +- include/region_map.h | 1 + include/strings.h | 48 + ld_script.txt | 7 +- src/battle_pyramid.c | 248 ++ src/data/text/nature_names.h | 54 + src/pokemon_summary_screen.c | 2396 +++++++++-------- src/unk_pokedex_area_screen_helper.c | 75 + sym_ewram.txt | 27 +- 24 files changed, 1930 insertions(+), 3120 deletions(-) rename asm/{pokemon_summary_screen.s => battle_pyramid.s} (70%) delete mode 100644 data/pokemon_summary_screen.s create mode 100644 data/unk_pokedex_area_screen_helper.s create mode 100644 include/battle_tent.h create mode 100644 src/battle_pyramid.c create mode 100644 src/data/text/nature_names.h create mode 100644 src/unk_pokedex_area_screen_helper.c diff --git a/asm/pokemon_summary_screen.s b/asm/battle_pyramid.s similarity index 70% rename from asm/pokemon_summary_screen.s rename to asm/battle_pyramid.s index 91b1693fd..ea07fdd0a 100644 --- a/asm/pokemon_summary_screen.s +++ b/asm/battle_pyramid.s @@ -5,1523 +5,6 @@ .text - - - thumb_func_start sub_81C4568 -sub_81C4568: @ 81C4568 - push {r4-r6,lr} - lsls r0, 24 - lsrs r0, 24 - lsls r1, 24 - lsrs r1, 24 - ldr r2, =gUnknown_0203CF1C - ldr r2, [r2] - adds r0, 0x3 - ldr r3, =0x000040d3 - adds r2, r3 - adds r0, r2, r0 - ldrb r0, [r0] - lsls r4, r0, 4 - adds r4, r0 - lsls r4, 2 - ldr r5, =gSprites - adds r4, r5 - adds r1, 0x3 - adds r2, r1 - ldrb r0, [r2] - lsls r3, r0, 4 - adds r3, r0 - lsls r3, 2 - adds r3, r5 - adds r5, r4, 0 - adds r5, 0x2A - ldrb r1, [r5] - adds r2, r3, 0 - adds r2, 0x2A - ldrb r0, [r2] - strb r0, [r5] - strb r1, [r2] - ldrb r6, [r4, 0x5] - lsrs r5, r6, 4 - ldrb r2, [r3, 0x5] - lsrs r2, 4 - lsls r2, 4 - movs r1, 0xF - adds r0, r1, 0 - ands r0, r6 - orrs r0, r2 - strb r0, [r4, 0x5] - lsls r5, 4 - ldrb r0, [r3, 0x5] - ands r1, r0 - orrs r1, r5 - strb r1, [r3, 0x5] - adds r4, 0x3F - ldrb r0, [r4] - movs r2, 0x4 - orrs r0, r2 - movs r1, 0x11 - negs r1, r1 - ands r0, r1 - strb r0, [r4] - adds r3, 0x3F - ldrb r0, [r3] - orrs r0, r2 - ands r0, r1 - strb r0, [r3] - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4568 - - thumb_func_start sub_81C45F4 -sub_81C45F4: @ 81C45F4 - push {r4-r6,lr} - adds r3, r0, 0 - adds r6, r1, 0 - ldr r0, =gUnknown_0203CF1C - ldr r2, [r0] - adds r5, r2, 0 - adds r5, 0x70 - movs r1, 0 - ldrsh r0, [r6, r1] - cmp r0, 0 - beq _081C4620 - cmp r0, 0x1 - bne _081C4610 - b _081C4750 -_081C4610: - adds r0, r3, 0 - bl sub_81C47B4 - lsls r0, 24 - lsrs r0, 24 - b _081C4770 - .pool -_081C4620: - ldr r0, =gMain - ldr r1, =0x00000439 - adds r0, r1 - ldrb r1, [r0] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081C4680 - ldr r1, =0x000040be - adds r0, r2, r1 - ldrb r1, [r0] - movs r0, 0x3 - bl sub_80688F8 - lsls r0, 24 - cmp r0, 0 - beq _081C4668 - ldrh r2, [r5, 0x2] - lsls r0, r2, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - ldr r1, =gMonSpritesGfxPtr - ldr r1, [r1] - ldr r1, [r1, 0x8] - b _081C46D6 - .pool -_081C4668: - ldrh r2, [r5, 0x2] - lsls r0, r2, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - ldr r1, =gMonSpritesGfxPtr - ldr r1, [r1] - b _081C46B0 - .pool -_081C4680: - ldr r0, =gMonSpritesGfxPtr - ldr r3, [r0] - adds r4, r0, 0 - cmp r3, 0 - beq _081C46E4 - ldr r1, [r2] - ldr r0, =gPlayerParty - cmp r1, r0 - beq _081C46A6 - ldr r1, =0x000040bc - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0x2 - beq _081C46A6 - adds r1, 0x33 - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _081C46CC -_081C46A6: - ldrh r2, [r5, 0x2] - lsls r0, r2, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - ldr r1, [r4] -_081C46B0: - ldr r1, [r1, 0x8] - ldr r3, [r5, 0xC] - bl HandleLoadSpecialPokePic_2 - b _081C4768 - .pool -_081C46CC: - ldrh r2, [r5, 0x2] - lsls r0, r2, 3 - ldr r1, =gMonFrontPicTable - adds r0, r1 - ldr r1, [r3, 0x8] -_081C46D6: - ldr r3, [r5, 0xC] - bl HandleLoadSpecialPokePic_DontHandleDeoxys - b _081C4768 - .pool -_081C46E4: - ldr r1, [r2] - ldr r0, =gPlayerParty - cmp r1, r0 - beq _081C4700 - ldr r1, =0x000040bc - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0x2 - beq _081C4700 - adds r1, 0x33 - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bne _081C472C -_081C4700: - ldrh r4, [r5, 0x2] - lsls r4, 3 - ldr r0, =gMonFrontPicTable - adds r4, r0 - movs r0, 0 - movs r1, 0x1 - bl sub_806F4F8 - adds r1, r0, 0 - ldrh r2, [r5, 0x2] - ldr r3, [r5, 0xC] - adds r0, r4, 0 - bl HandleLoadSpecialPokePic_2 - b _081C4768 - .pool -_081C472C: - ldrh r4, [r5, 0x2] - lsls r4, 3 - ldr r0, =gMonFrontPicTable - adds r4, r0 - movs r0, 0 - movs r1, 0x1 - bl sub_806F4F8 - adds r1, r0, 0 - ldrh r2, [r5, 0x2] - ldr r3, [r5, 0xC] - adds r0, r4, 0 - bl HandleLoadSpecialPokePic_DontHandleDeoxys - b _081C4768 - .pool -_081C4750: - ldrh r0, [r5, 0x2] - ldr r1, [r5, 0x48] - ldr r2, [r5, 0xC] - bl GetMonSpritePalStructFromOtIdPersonality - adds r4, r0, 0 - bl LoadCompressedObjectPalette - ldrh r0, [r4, 0x4] - movs r1, 0x1 - bl SetMultiuseSpriteTemplateToPokemon -_081C4768: - ldrh r0, [r6] - adds r0, 0x1 - strh r0, [r6] - movs r0, 0xFF -_081C4770: - pop {r4-r6} - pop {r1} - bx r1 - thumb_func_end sub_81C45F4 - - thumb_func_start sub_81C4778 -sub_81C4778: @ 81C4778 - push {r4,lr} - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - adds r4, r1, 0 - adds r4, 0x70 - ldrb r0, [r4, 0x4] - cmp r0, 0 - bne _081C47AE - adds r0, r1, 0 - adds r0, 0xC - bl ShouldPlayNormalMonCry - cmp r0, 0x1 - bne _081C47A4 - ldrh r0, [r4, 0x2] - movs r1, 0 - movs r2, 0 - bl PlayCry3 - b _081C47AE - .pool -_081C47A4: - ldrh r0, [r4, 0x2] - movs r1, 0 - movs r2, 0xB - bl PlayCry3 -_081C47AE: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_81C4778 - - thumb_func_start sub_81C47B4 -sub_81C47B4: @ 81C47B4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - ldr r0, =gUnknown_0203CF1C - ldr r6, [r0] - adds r6, 0x70 - ldr r0, =gMultiuseSpriteTemplate - movs r1, 0x28 - movs r2, 0x40 - movs r3, 0x5 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - lsls r4, r0, 4 - add r4, r8 - lsls r4, 2 - ldr r5, =gSprites - adds r7, r4, r5 - adds r0, r7, 0 - bl FreeSpriteOamMatrix - ldrh r0, [r6, 0x2] - movs r1, 0 - strh r0, [r7, 0x2E] - strh r1, [r7, 0x32] - adds r5, 0x1C - adds r4, r5 - ldr r0, =sub_81C4844 - str r0, [r4] - ldrb r1, [r7, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r1 - strb r0, [r7, 0x5] - ldrh r0, [r6, 0x2] - bl IsMonSpriteNotFlipped - lsls r0, 24 - cmp r0, 0 - bne _081C4828 - adds r0, r7, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r2, 0x1 - orrs r1, r2 - strb r1, [r0] - b _081C4836 - .pool -_081C4828: - adds r2, r7, 0 - adds r2, 0x3F - ldrb r1, [r2] - movs r0, 0x2 - negs r0, r0 - ands r0, r1 - strb r0, [r2] -_081C4836: - mov r0, r8 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_81C47B4 - - thumb_func_start sub_81C4844 -sub_81C4844: @ 81C4844 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - adds r5, r0, 0 - adds r5, 0x70 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081C487E - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _081C487E - ldrh r0, [r4, 0x2E] - bl IsMonSpriteNotFlipped - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x30] - bl sub_81C4778 - ldrh r1, [r4, 0x2E] - ldrb r2, [r5, 0x4] - adds r0, r4, 0 - bl PokemonSummaryDoMonAnimation -_081C487E: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4844 - - thumb_func_start sub_81C488C -sub_81C488C: @ 81C488C - ldr r1, =gUnknown_0203CF24 - strb r0, [r1] - bx lr - .pool - thumb_func_end sub_81C488C - - thumb_func_start sub_81C4898 -sub_81C4898: @ 81C4898 - push {r4,lr} - ldr r4, =gUnknown_0203CF24 - ldrb r0, [r4] - cmp r0, 0xFF - beq _081C48AA - bl DestroyTask - movs r0, 0xFF - strb r0, [r4] -_081C48AA: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4898 - - thumb_func_start sub_81C48B4 -sub_81C48B4: @ 81C48B4 - push {lr} - ldr r2, =gSprites - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040d3 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r2, 0x1C - adds r0, r2 - ldr r1, [r0] - ldr r0, =SpriteCallbackDummy - cmp r1, r0 - beq _081C48E8 - movs r0, 0x1 - b _081C48EA - .pool -_081C48E8: - movs r0, 0 -_081C48EA: - pop {r1} - bx r1 - thumb_func_end sub_81C48B4 - - thumb_func_start sub_81C48F0 -sub_81C48F0: @ 81C48F0 - push {r4-r6,lr} - ldr r6, =gSprites - ldr r5, =gUnknown_0203CF1C - ldr r0, [r5] - ldr r4, =0x000040d3 - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - adds r0, 0x2C - ldrb r1, [r0] - movs r2, 0x40 - orrs r1, r2 - strb r1, [r0] - ldr r0, [r5] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r6, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =SpriteCallbackDummy - str r1, [r0] - bl sub_806EE98 - ldr r0, [r5] - adds r0, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - ldrb r0, [r0, 0x5] - lsrs r0, 4 - lsls r3, r0, 4 - movs r1, 0x80 - lsls r1, 1 - adds r0, r1, 0 - orrs r3, r0 - movs r2, 0 - ldr r5, =gPlttBufferUnfaded - ldr r4, =gPlttBufferFaded -_081C494C: - adds r0, r2, r3 - lsls r0, 16 - lsrs r0, 15 - adds r1, r0, r5 - adds r0, r4 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r2, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - cmp r2, 0xF - bls _081C494C - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C48F0 - - thumb_func_start sub_81C4984 -sub_81C4984: @ 81C4984 - push {r4-r6,lr} - adds r5, r0, 0 - ldr r1, =0x00007533 - ldr r2, =gUnknown_0861D120 - adds r0, r1, 0 - bl sub_811FF94 - adds r4, r0, 0 - ldr r6, =gUnknown_0203CF1C - ldr r0, [r6] - str r4, [r0, 0x8] - cmp r4, 0 - beq _081C49CE - adds r0, r5, 0 - movs r1, 0x8 - bl GetMonData - adds r1, r0, 0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl StartSpriteAnim - ldr r1, [r6] - ldr r2, [r1, 0x8] - movs r0, 0x3C - strh r0, [r2, 0x20] - ldr r2, [r1, 0x8] - movs r0, 0x1A - strh r0, [r2, 0x22] - ldr r2, [r1, 0x8] - ldrb r1, [r2, 0x5] - subs r0, 0x27 - ands r0, r1 - movs r1, 0x4 - orrs r0, r1 - strb r0, [r2, 0x5] -_081C49CE: - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4984 - - thumb_func_start sub_81C49E0 -sub_81C49E0: @ 81C49E0 - push {r4,lr} - adds r4, r0, 0 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r0, [r0, 0x8] - bl DestroySprite - ldr r0, =0x00007533 - bl FreeSpriteTilesByTag - adds r0, r4, 0 - bl sub_81C4984 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C49E0 - - thumb_func_start sub_81C4A08 -sub_81C4A08: @ 81C4A08 - push {r4,lr} - movs r1, 0x26 - bl GetMonData - lsls r0, 16 - lsrs r0, 16 - bl ItemIdToBallId - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl LoadBallGfx - lsls r0, r4, 1 - adds r0, r4 - lsls r0, 3 - ldr r1, =gBallSpriteTemplates - adds r0, r1 - movs r1, 0x10 - movs r2, 0x88 - movs r3, 0 - bl CreateSprite - ldr r2, =gUnknown_0203CF1C - ldr r1, [r2] - ldr r3, =0x000040d4 - adds r1, r3 - strb r0, [r1] - ldr r4, =gSprites - ldr r2, [r2] - adds r2, r3 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r4, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =SpriteCallbackDummy - str r1, [r0] - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - ldrb r1, [r0, 0x5] - movs r2, 0xC - orrs r1, r2 - strb r1, [r0, 0x5] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4A08 - - thumb_func_start sub_81C4A88 -sub_81C4A88: @ 81C4A88 - push {r4,r5,lr} - ldr r5, =gUnknown_0203CF1C - ldr r0, [r5] - ldr r1, =0x000040d5 - adds r4, r0, r1 - ldrb r0, [r4] - cmp r0, 0xFF - bne _081C4AA6 - ldr r0, =gUnknown_0861D108 - movs r1, 0x40 - movs r2, 0x98 - movs r3, 0 - bl CreateSprite - strb r0, [r4] -_081C4AA6: - ldr r0, [r5] - adds r0, 0xC - bl sub_81B205C - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0 - beq _081C4AE8 - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - ldr r1, =gSprites - adds r0, r1 - subs r1, r2, 0x1 - lsls r1, 24 - lsrs r1, 24 - bl StartSpriteAnim - movs r0, 0x2 - movs r1, 0 - bl sub_81C4204 - b _081C4AF0 - .pool -_081C4AE8: - movs r0, 0x2 - movs r1, 0x1 - bl sub_81C4204 -_081C4AF0: - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81C4A88 - - thumb_func_start sub_81C4AF8 -sub_81C4AF8: @ 81C4AF8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - lsls r0, 24 - lsrs r0, 24 - mov r8, r0 - ldr r0, =gUnknown_0203CF1C - ldr r1, =0x000040d3 - add r1, r8 - ldr r0, [r0] - adds r7, r0, r1 - ldr r1, =0x000040c0 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x1 - bls _081C4BD2 - movs r0, 0 - mov r9, r0 - mov r1, r8 - cmp r1, 0x8 - bne _081C4B2A - movs r0, 0x1 - mov r9, r0 -_081C4B2A: - movs r5, 0 - ldr r6, =gSprites - mov r10, r5 -_081C4B30: - lsls r1, r5, 20 - movs r0, 0xB2 - lsls r0, 15 - adds r1, r0 - asrs r1, 16 - ldr r0, =gUnknown_0861D084 - movs r2, 0x28 - mov r3, r9 - bl CreateSprite - adds r1, r7, r5 - strb r0, [r1] - adds r4, r1, 0 - cmp r5, 0 - bne _081C4B74 - ldrb r1, [r7] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x4 - bl StartSpriteAnim - b _081C4B9A - .pool -_081C4B74: - cmp r5, 0x9 - bne _081C4B8A - ldrb r1, [r7, 0x9] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x5 - bl StartSpriteAnim - b _081C4B9A -_081C4B8A: - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - movs r1, 0x6 - bl StartSpriteAnim -_081C4B9A: - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r1, r6, 0 - adds r1, 0x1C - adds r0, r1 - ldr r1, =sub_81C4BE4 - str r1, [r0] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - mov r1, r8 - strh r1, [r0, 0x2E] - ldrb r1, [r4] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r6 - mov r1, r10 - strh r1, [r0, 0x30] - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x9 - bls _081C4B30 -_081C4BD2: - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4AF8 - - thumb_func_start sub_81C4BE4 -sub_81C4BE4: @ 81C4BE4 - push {lr} - adds r3, r0, 0 - adds r0, 0x2A - ldrb r0, [r0] - subs r0, 0x4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x2 - bhi _081C4C1C - ldrh r0, [r3, 0x30] - adds r0, 0x1 - movs r1, 0x1F - ands r0, r1 - strh r0, [r3, 0x30] - cmp r0, 0x18 - ble _081C4C10 - adds r2, r3, 0 - adds r2, 0x3E - ldrb r0, [r2] - movs r1, 0x4 - orrs r0, r1 - b _081C4C2A -_081C4C10: - adds r2, r3, 0 - adds r2, 0x3E - ldrb r1, [r2] - movs r0, 0x5 - negs r0, r0 - b _081C4C28 -_081C4C1C: - movs r0, 0 - strh r0, [r3, 0x30] - adds r2, r3, 0 - adds r2, 0x3E - ldrb r1, [r2] - subs r0, 0x5 -_081C4C28: - ands r0, r1 -_081C4C2A: - strb r0, [r2] - movs r1, 0x2E - ldrsh r0, [r3, r1] - cmp r0, 0x8 - bne _081C4C44 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040c6 - b _081C4C4A - .pool -_081C4C44: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040c7 -_081C4C4A: - adds r0, r1 - ldrb r0, [r0] - lsls r0, 4 - strh r0, [r3, 0x26] - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4BE4 - - thumb_func_start sub_81C4C60 -sub_81C4C60: @ 81C4C60 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r4, 0 -_081C4C68: - adds r0, r5, r4 - lsls r0, 24 - lsrs r0, 24 - bl sub_81C41C0 - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x9 - bls _081C4C68 - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_81C4C60 - - thumb_func_start sub_81C4C84 -sub_81C4C84: @ 81C4C84 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - lsls r0, 24 - lsrs r6, r0, 24 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040db - adds r5, r0, r1 - lsls r0, r6, 1 - adds r0, r6 - lsls r0, 24 - movs r4, 0 - ldr r7, =gSprites - movs r2, 0x80 - lsls r2, 19 - adds r2, r0 - mov r9, r2 - lsrs r6, r0, 24 - movs r1, 0xA0 - lsls r1, 19 - adds r1, r0 - mov r8, r1 -_081C4CB4: - cmp r4, 0 - bne _081C4CD4 - ldrb r1, [r5] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - mov r2, r9 - b _081C4CE4 - .pool -_081C4CD4: - cmp r4, 0x9 - bne _081C4CEC - ldrb r1, [r5, 0x9] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - mov r2, r8 -_081C4CE4: - lsrs r1, r2, 24 - bl StartSpriteAnim - b _081C4D02 -_081C4CEC: - adds r0, r5, r4 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r7 - adds r1, r6, 0x6 - lsls r1, 24 - lsrs r1, 24 - bl StartSpriteAnim -_081C4D02: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x9 - bls _081C4CB4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81C4C84 - - thumb_func_start sub_81C4D18 -sub_81C4D18: @ 81C4D18 - push {r4-r7,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r1, =gUnknown_0203CF1C - ldr r2, =0x000040d3 - adds r0, r2 - ldr r1, [r1] - adds r5, r1, r0 - movs r3, 0 - ldr r4, =gSprites - movs r7, 0x5 - negs r7, r7 - movs r6, 0 -_081C4D32: - adds r2, r5, r3 - ldrb r1, [r2] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r4 - strh r6, [r0, 0x30] - ldrb r0, [r2] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r4 - adds r1, 0x3E - ldrb r2, [r1] - adds r0, r7, 0 - ands r0, r2 - strb r0, [r1] - adds r0, r3, 0x1 - lsls r0, 24 - lsrs r3, r0, 24 - cmp r3, 0x9 - bls _081C4D32 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4D18 - - thumb_func_start sub_81C4D70 -sub_81C4D70: @ 81C4D70 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - ldr r4, =gUnknown_0203CF28 - movs r0, 0x4 - bl Alloc - str r0, [r4] - ldr r1, [r5] - lsls r0, r1, 20 - lsrs r4, r0, 30 - cmp r4, 0 - bne _081C4DDC - lsls r0, r1, 30 - lsrs r0, 30 - movs r1, 0x8 - movs r2, 0 - bl SetBgAttribute - ldr r3, [r5] - lsls r0, r3, 30 - lsrs r0, 30 - ldr r1, =gUnknown_0861D1A0 - lsls r3, 22 - lsrs r3, 24 - str r4, [sp] - movs r2, 0 - bl decompress_and_copy_tile_data_to_vram - ldr r0, [r5] - lsls r0, 30 - lsrs r0, 30 - ldr r1, =gUnknown_0861DEF4 - movs r2, 0x1 - str r2, [sp] - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - ldr r1, [r5] - lsls r1, 22 - lsrs r1, 24 - str r4, [sp] - movs r2, 0x20 - movs r3, 0x20 - bl sub_8199D3C - b _081C4E2E - .pool -_081C4DDC: - lsls r0, r1, 30 - lsrs r0, 30 - movs r1, 0x8 - movs r2, 0x2 - bl SetBgAttribute - ldr r0, [r5] - lsls r0, 30 - lsrs r0, 30 - movs r1, 0x9 - movs r2, 0x1 - bl SetBgAttribute - ldr r3, [r5] - lsls r0, r3, 30 - lsrs r0, 30 - ldr r1, =gUnknown_0861E208 - lsls r3, 22 - lsrs r3, 24 - movs r2, 0 - str r2, [sp] - bl decompress_and_copy_tile_data_to_vram - ldr r0, [r5] - lsls r0, 30 - lsrs r0, 30 - ldr r1, =gUnknown_0861EF64 - movs r4, 0x1 - str r4, [sp] - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - ldr r1, [r5] - lsls r1, 22 - lsrs r1, 24 - str r4, [sp] - movs r2, 0x40 - movs r3, 0x40 - bl sub_8199D3C -_081C4E2E: - ldr r0, [r5] - lsls r0, 30 - lsrs r0, 30 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - ldr r0, [r5] - lsls r0, 30 - lsrs r0, 30 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - ldr r0, [r5] - lsls r0, 30 - lsrs r0, 30 - movs r1, 0x4 - movs r2, 0x1 - bl SetBgAttribute - ldr r0, =gUnknown_0861D140 - ldr r1, =gPlttBufferUnfaded + 0xE0 - ldr r2, =0x04000018 - bl CpuSet - ldr r0, =gUnknown_0203CF28 - ldr r1, [r0] - ldr r0, [r5] - lsls r0, 30 - lsrs r0, 30 - strb r0, [r1] - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4D70 - - thumb_func_start sub_81C4E90 -sub_81C4E90: @ 81C4E90 - push {lr} - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - beq _081C4EA0 - movs r0, 0x1 - b _081C4EAC -_081C4EA0: - ldr r0, =gUnknown_0203CF28 - ldr r0, [r0] - ldrb r0, [r0] - bl ShowBg - movs r0, 0 -_081C4EAC: - pop {r1} - bx r1 - .pool - thumb_func_end sub_81C4E90 - - thumb_func_start sub_81C4EB4 -sub_81C4EB4: @ 81C4EB4 - push {r4,lr} - ldr r4, =gUnknown_0203CF28 - ldr r0, [r4] - cmp r0, 0 - beq _081C4EC6 - bl Free - movs r0, 0 - str r0, [r4] -_081C4EC6: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4EB4 - - thumb_func_start sub_81C4ED0 -sub_81C4ED0: @ 81C4ED0 - push {lr} - adds r1, r0, 0 - ldr r0, =gUnknown_0203CF28 - ldr r0, [r0] - ldrb r0, [r0] - lsls r1, 8 - movs r2, 0 - bl ChangeBgY - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4ED0 - - thumb_func_start sub_81C4EEC -sub_81C4EEC: @ 81C4EEC - ldr r1, =gUnknown_0203CF30 - movs r0, 0 - strh r0, [r1, 0x6] - strh r0, [r1, 0x8] - bx lr - .pool - thumb_func_end sub_81C4EEC - - thumb_func_start sub_81C4EFC -sub_81C4EFC: @ 81C4EFC - push {lr} - ldr r1, =CB2_ReturnToFieldWithOpenMenu - movs r0, 0 - bl sub_81C4F98 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4EFC - - thumb_func_start sub_81C4F10 -sub_81C4F10: @ 81C4F10 - push {lr} - ldr r1, =SetCB2ToReshowScreenAfterMenu2 - movs r0, 0x1 - bl sub_81C4F98 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4F10 - - thumb_func_start sub_81C4F24 -sub_81C4F24: @ 81C4F24 - push {lr} - bl ScriptContext2_Enable - movs r0, 0x1 - movs r1, 0 - bl FadeScreen - ldr r0, =sub_81C4F44 - movs r1, 0xA - bl CreateTask - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4F24 - - thumb_func_start sub_81C4F44 -sub_81C4F44: @ 81C4F44 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gPaletteFade - ldrb r1, [r0, 0x7] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - bne _081C4F6E - bl overworld_free_bg_tilemaps - ldr r0, =gFieldCallback2 - ldr r1, =hm_add_c3_without_phase_2 - str r1, [r0] - ldr r1, =CB2_ReturnToField - movs r0, 0x3 - bl sub_81C4F98 - adds r0, r4, 0 - bl DestroyTask -_081C4F6E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4F44 - - thumb_func_start sub_81C4F84 -sub_81C4F84: @ 81C4F84 - push {lr} - ldr r0, =gUnknown_0203CF30 - ldr r1, [r0] - movs r0, 0x4 - bl sub_81C4F98 - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4F84 - - thumb_func_start sub_81C4F98 -sub_81C4F98: @ 81C4F98 - push {r4-r6,lr} - adds r5, r1, 0 - lsls r0, 24 - lsrs r4, r0, 24 - ldr r6, =gUnknown_0203CF2C - ldr r0, =0x0000098c - bl AllocZeroed - str r0, [r6] - cmp r4, 0x4 - beq _081C4FB2 - ldr r0, =gUnknown_0203CF30 - strb r4, [r0, 0x4] -_081C4FB2: - cmp r5, 0 - beq _081C4FBA - ldr r0, =gUnknown_0203CF30 - str r5, [r0] -_081C4FBA: - ldr r0, [r6] - movs r1, 0 - str r1, [r0] - ldr r1, =0x00000814 - adds r0, r1 - movs r1, 0xFF - strb r1, [r0] - ldr r0, [r6] - ldr r1, =0x00000816 - adds r0, r1 - movs r1, 0x1 - negs r1, r1 - strb r1, [r0] - ldr r0, [r6] - ldr r1, =0x00000804 - adds r0, r1 - movs r1, 0xFF - movs r2, 0xB - bl memset - ldr r0, [r6] - ldr r1, =0x0000080f - adds r0, r1 - movs r1, 0xFF - movs r2, 0x5 - bl memset - ldr r0, =sub_81C504C - bl SetMainCallback2 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C4F98 - - thumb_func_start sub_81C501C -sub_81C501C: @ 81C501C - push {lr} - bl RunTasks - bl AnimateSprites - bl BuildOamBuffer - bl do_scheduled_bg_tilemap_copies_to_vram - bl UpdatePaletteFade - pop {r0} - bx r0 - thumb_func_end sub_81C501C - - thumb_func_start sub_81C5038 -sub_81C5038: @ 81C5038 - push {lr} - bl LoadOam - bl ProcessSpriteCopyRequests - bl TransferPlttBuffer - pop {r0} - bx r0 - thumb_func_end sub_81C5038 - - thumb_func_start sub_81C504C -sub_81C504C: @ 81C504C - push {lr} -_081C504E: - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C5072 - bl sub_81C5078 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C5072 - bl sub_81221AC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _081C504E -_081C5072: - pop {r0} - bx r0 - thumb_func_end sub_81C504C - - thumb_func_start sub_81C5078 -sub_81C5078: @ 81C5078 - push {lr} - sub sp, 0x4 - ldr r0, =gMain - movs r1, 0x87 - lsls r1, 3 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x10 - bls _081C508C - b _081C51BC -_081C508C: - lsls r0, 2 - ldr r1, =_081C50A0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_081C50A0: - .4byte _081C50E4 - .4byte _081C50EE - .4byte _081C50F4 - .4byte _081C50FA - .4byte _081C510C - .4byte _081C5112 - .4byte _081C5122 - .4byte _081C513C - .4byte _081C5148 - .4byte _081C514E - .4byte _081C515C - .4byte _081C5162 - .4byte _081C5168 - .4byte _081C516E - .4byte _081C5174 - .4byte _081C517A - .4byte _081C5188 -_081C50E4: - bl SetVBlankHBlankCallbacksToNull - bl clear_scheduled_bg_copies_to_vram - b _081C51A2 -_081C50EE: - bl ScanlineEffect_Stop - b _081C51A2 -_081C50F4: - bl FreeAllSpritePalettes - b _081C51A2 -_081C50FA: - bl ResetPaletteFade - ldr r2, =gPaletteFade - ldrb r0, [r2, 0x8] - movs r1, 0x80 - orrs r0, r1 - b _081C51A0 - .pool -_081C510C: - bl ResetSpriteData - b _081C51A2 -_081C5112: - bl sub_81221AC - lsls r0, 24 - cmp r0, 0 - bne _081C51A2 - bl ResetTasks - b _081C51A2 -_081C5122: - bl sub_81C51DC - ldr r0, =gUnknown_0203CF2C - ldr r0, [r0] - ldr r1, =0x00000984 - adds r0, r1 - movs r1, 0 - strh r1, [r0] - b _081C51A2 - .pool -_081C513C: - bl sub_81C5238 - lsls r0, 24 - cmp r0, 0 - beq _081C51D4 - b _081C51A2 -_081C5148: - bl sub_81C6BD8 - b _081C51A2 -_081C514E: - bl sub_81C5924 - bl sub_81C59BC - bl sub_81C5A20 - b _081C51A2 -_081C515C: - bl sub_81C5314 - b _081C51A2 -_081C5162: - bl sub_81C56F8 - b _081C51A2 -_081C5168: - bl sub_81C6EF4 - b _081C51A2 -_081C516E: - bl sub_81C5674 - b _081C51A2 -_081C5174: - bl sub_81C700C - b _081C51A2 -_081C517A: - movs r0, 0x1 - negs r0, r0 - movs r1, 0x10 - movs r2, 0 - bl BlendPalettes - b _081C51A2 -_081C5188: - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - ldr r2, =gPaletteFade - ldrb r1, [r2, 0x8] - movs r0, 0x7F - ands r0, r1 -_081C51A0: - strb r0, [r2, 0x8] -_081C51A2: - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _081C51D4 - .pool -_081C51BC: - ldr r0, =sub_81C5038 - bl SetVBlankCallback - ldr r0, =sub_81C501C - bl SetMainCallback2 - movs r0, 0x1 - b _081C51D6 - .pool -_081C51D4: - movs r0, 0 -_081C51D6: - add sp, 0x4 - pop {r1} - bx r1 - thumb_func_end sub_81C5078 - - thumb_func_start sub_81C51DC -sub_81C51DC: @ 81C51DC - push {lr} - bl ResetVramOamAndBgCntRegs - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_0861F2B4 - movs r0, 0 - movs r2, 0x3 - bl InitBgsFromTemplates - ldr r0, =gUnknown_0203CF2C - ldr r1, [r0] - adds r1, 0x4 - movs r0, 0x2 - bl SetBgTilemapBuffer - bl ResetAllBgsCoordinates - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - movs r1, 0x82 - lsls r1, 5 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C51DC - thumb_func_start sub_81C5238 sub_81C5238: @ 81C5238 push {r4,lr} @@ -2001,7 +484,7 @@ sub_81C5674: @ 81C5674 ldr r0, =0x00000b5e str r0, [sp, 0x4] str r0, [sp, 0x8] - ldr r0, =gUnknown_0203CF38 + ldr r0, =gUnknown_0203CF30+8 str r0, [sp, 0xC] movs r0, 0x2 movs r1, 0xAC @@ -2604,7 +1087,7 @@ sub_81C5B4C: @ 81C5B4C cmp r0, 0 bne _081C5BBC ldrb r0, [r2] - ldr r4, =gUnknown_0203CF38 + ldr r4, =gUnknown_0203CF30+8 subs r2, r4, 0x2 adds r1, r4, 0 bl DestroyListMenuTask @@ -2706,7 +1189,7 @@ _081C5C5C: bl ListMenuHandleInputGetItemId adds r6, r0, 0 ldrb r0, [r7] - ldr r1, =gUnknown_0203CF38 + ldr r1, =gUnknown_0203CF30+8 mov r8, r1 mov r2, r8 subs r2, 0x2 @@ -3763,7 +2246,7 @@ sub_81C65CC: @ 81C65CC lsls r0, 3 ldr r1, =gTasks + 0x8 adds r4, r0, r1 - ldr r6, =gUnknown_0203CF38 + ldr r6, =gUnknown_0203CF30+8 subs r7, r6, 0x2 ldr r0, =gMain ldrh r1, [r0, 0x2E] @@ -4089,7 +2572,7 @@ sub_81C68B0: @ 81C68B0 movs r0, 0x5 bl PlaySE ldrb r0, [r4] - ldr r1, =gUnknown_0203CF38 + ldr r1, =gUnknown_0203CF30+8 subs r2, r1, 0x2 bl ListMenuGetScrollAndRow b _081C6940 @@ -4099,7 +2582,7 @@ _081C68F8: bl ListMenuHandleInputGetItemId adds r6, r0, 0 ldrb r0, [r4] - ldr r4, =gUnknown_0203CF38 + ldr r4, =gUnknown_0203CF30+8 subs r2, r4, 0x2 adds r1, r4, 0 bl ListMenuGetScrollAndRow @@ -4156,7 +2639,7 @@ sub_81C6964: @ 81C6964 lsls r0, 3 ldr r1, =gTasks + 0x8 adds r5, r0, r1 - ldr r7, =gUnknown_0203CF38 + ldr r7, =gUnknown_0203CF30+8 subs r0, r7, 0x2 mov r8, r0 ldrh r0, [r0] @@ -4234,7 +2717,7 @@ sub_81C6A14: @ 81C6A14 lsls r0, 3 ldr r1, =gTasks + 0x8 adds r4, r0, r1 - ldr r5, =gUnknown_0203CF38 + ldr r5, =gUnknown_0203CF30+8 subs r7, r5, 0x2 ldr r0, =gUnknown_0203CF2C ldr r0, [r0] diff --git a/data/pokemon_summary_screen.s b/data/pokemon_summary_screen.s deleted file mode 100644 index 0c22aa6cd..000000000 --- a/data/pokemon_summary_screen.s +++ /dev/null @@ -1,507 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - -@ 861CAAC - .include "data/text/nature_names.inc" - - .align 2 -gUnknown_0861CBB4:: @ 861CBB4 - .4byte 0x000001f0, 0x000013b9, 0x0000239a, 0x000033db - - .align 2 -gUnknown_0861CBC4:: @ 861CBC4 - .incbin "graphics/interface/unk_tilemap2.bin" - - .align 2 -gUnknown_0861CBEC:: @ 861CBEC - .4byte gUnknown_0861CBC4 - .byte 0x01, 0x00, 0x0a, 0x02, 0x00, 0x12 - - .align 2 -gUnknown_0861CBF8:: @ 861CBF8 - .4byte gUnknown_0861CBC4 - .byte 0x01, 0x00, 0x0a, 0x02, 0x00, 0x32 - - .align 2 -gUnknown_0861CC04:: @ 861CC04 - .4byte gSummaryScreenPowAcc_Tilemap - .byte 0x00 - .byte 0x00 - .byte 0x0A - .byte 0x07 - .byte 0x00 - .byte 0x2D - - .align 2 -gUnknown_0861CC10:: @ 861CC10 - .4byte gUnknown_08DC3C34 - .byte 0x00 - .byte 0x00 - .byte 0x0A - .byte 0x07 - .byte 0x00 - .byte 0x2D - - .align 2 -gUnknown_0861CC1C:: @ 861CC1C - .byte 0x00, 0x02, 0x03, 0x01, 0x04, 0x05, 0x00, 0x00 - - .align 2 -gUnknown_0861CC24:: @ 861CC24 - window_template 0x00, 0x00, 0x00, 0x0b, 0x02, 0x06, 0x0001 - window_template 0x00, 0x00, 0x00, 0x0b, 0x02, 0x06, 0x0017 - window_template 0x00, 0x00, 0x00, 0x0b, 0x02, 0x06, 0x002d - window_template 0x00, 0x00, 0x00, 0x0b, 0x02, 0x06, 0x0043 - window_template 0x00, 0x16, 0x00, 0x08, 0x02, 0x07, 0x0059 - window_template 0x00, 0x16, 0x00, 0x08, 0x02, 0x07, 0x0069 - window_template 0x00, 0x16, 0x00, 0x08, 0x02, 0x07, 0x0079 - window_template 0x00, 0x0b, 0x04, 0x00, 0x02, 0x06, 0x0089 - window_template 0x00, 0x0b, 0x04, 0x12, 0x02, 0x06, 0x0089 - window_template 0x00, 0x0b, 0x06, 0x12, 0x02, 0x06, 0x00ad - window_template 0x00, 0x0a, 0x07, 0x06, 0x06, 0x06, 0x00d1 - window_template 0x00, 0x16, 0x07, 0x05, 0x06, 0x06, 0x00f5 - window_template 0x00, 0x0a, 0x0e, 0x0b, 0x04, 0x06, 0x0113 - window_template 0x00, 0x00, 0x12, 0x06, 0x02, 0x06, 0x013f - window_template 0x00, 0x01, 0x0f, 0x09, 0x04, 0x06, 0x014b - window_template 0x00, 0x01, 0x0f, 0x05, 0x04, 0x06, 0x016f - window_template 0x00, 0x16, 0x04, 0x00, 0x02, 0x06, 0x0183 - window_template 0x00, 0x01, 0x02, 0x04, 0x02, 0x07, 0x0183 - window_template 0x00, 0x01, 0x0c, 0x09, 0x02, 0x06, 0x018b - window_template 0x00, 0x01, 0x0e, 0x09, 0x04, 0x06, 0x019d - null_window_template - - .align 2 -gUnknown_0861CCCC:: @ 861CCCC - window_template 0x00, 0x0b, 0x04, 0x0b, 0x02, 0x06, 0x01c1 - window_template 0x00, 0x16, 0x04, 0x07, 0x02, 0x06, 0x01d7 - window_template 0x00, 0x0b, 0x09, 0x12, 0x04, 0x06, 0x01e5 - window_template 0x00, 0x0b, 0x0e, 0x12, 0x06, 0x06, 0x022d - - .align 2 -gUnknown_0861CCEC:: @ 861CCEC - window_template 0x00, 0x0a, 0x04, 0x0a, 0x02, 0x06, 0x01c1 - window_template 0x00, 0x14, 0x04, 0x0a, 0x02, 0x06, 0x01d5 - window_template 0x00, 0x10, 0x07, 0x06, 0x06, 0x06, 0x01e9 - window_template 0x00, 0x1b, 0x07, 0x03, 0x06, 0x06, 0x020d - window_template 0x00, 0x18, 0x0e, 0x06, 0x04, 0x06, 0x021f - - .align 2 -gUnknown_0861CD14:: @ 861CD14 - window_template 0x00, 0x0f, 0x04, 0x09, 0x0a, 0x06, 0x01c1 - window_template 0x00, 0x18, 0x04, 0x06, 0x0a, 0x08, 0x021b - window_template 0x00, 0x0a, 0x0f, 0x14, 0x04, 0x06, 0x0257 - -gUnknown_0861CD2C:: @ 861CD2C - .byte 0x00, 0x01, 0x02, 0x00, 0x03, 0x04, 0x00, 0x05, 0x06, 0x00, 0x07, 0x08, 0x00, 0x09, 0x0a, 0x00, 0x0b, 0x0c, 0x00, 0x0d, 0x0e, 0x00, 0x07, 0x08, 0x0d, 0x0f, 0x0e, 0x00, 0x01, 0x02, 0x00, 0x03 - .byte 0x04, 0x00, 0x05, 0x06, 0x00, 0x07, 0x08 - -gUnknown_0861CD53:: @ 861CD53 - .incbin "graphics/interface/summary_a_button.4bpp" - -gUnknown_0861CDD3:: @ 861CDD3 - .incbin "graphics/interface/summary_b_button.4bpp" - - .align 2 -gUnknown_0861CE54:: @ 861CE54 - .4byte sub_81C2E00 - .4byte sub_81C3530 - .4byte sub_81C3984 - .4byte sub_81C3D08 - - .align 2 -gUnknown_0861CE64:: @ 861CE64 - .4byte sub_81C2E40 - .4byte sub_81C3554 - .4byte sub_81C39F0 - .4byte sub_81C3D54 - -gUnknown_0861CE74:: @ 861CE74 - .string "{COLOR LIGHT_RED}{SHADOW GREEN}$" - -gUnknown_0861CE7B:: @ 861CE7B - .string "{COLOR WHITE}{SHADOW DARK_GREY}$" - -gUnknown_0861CE82:: @ 861CE82 - .string "{SPECIAL_F7 0x00}/{SPECIAL_F7 0x01}\n" - .string "{SPECIAL_F7 0x02}\n" - .string "{SPECIAL_F7 0x03}$" - -gUnknown_0861CE8E:: @ 861CE8E - .string "{SPECIAL_F7 0x00}\n" - .string "{SPECIAL_F7 0x01}\n" - .string "{SPECIAL_F7 0x02}$" - -gUnknown_0861CE97:: @ 861CE97 - .string "{PP}{SPECIAL_F7 0x00}/{SPECIAL_F7 0x01}$" - - .align 2 -gOamData_861CEA0:: @ 861CEA0 - .2byte 0x4000, 0x8000, 0x0400, 0x0000 - - .align 2 -gSpriteAnim_861CEA8:: @ 861CEA8 - .2byte 0x0000, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_861CEB0:: @ 861CEB0 - .2byte 0x0008, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_861CEB8:: @ 861CEB8 - .2byte 0x0010, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_861CEC0:: @ 861CEC0 - .2byte 0x0018, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_861CEC8:: @ 861CEC8 - .2byte 0x0020, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_861CED0:: @ 861CED0 - .2byte 0x0028, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_861CED8:: @ 861CED8 - .2byte 0x0030, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_861CEE0:: @ 861CEE0 - .2byte 0x0038, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_861CEE8:: @ 861CEE8 - .2byte 0x0040, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_861CEF0:: @ 861CEF0 - .2byte 0x0048, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_861CEF8:: @ 861CEF8 - .2byte 0x0050, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_861CF00:: @ 861CF00 - .2byte 0x0058, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_861CF08:: @ 861CF08 - .2byte 0x0060, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_861CF10:: @ 861CF10 - .2byte 0x0068, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_861CF18:: @ 861CF18 - .2byte 0x0070, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_861CF20:: @ 861CF20 - .2byte 0x0078, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_861CF28:: @ 861CF28 - .2byte 0x0080, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_861CF30:: @ 861CF30 - .2byte 0x0088, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_861CF38:: @ 861CF38 - .2byte 0x0090, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_861CF40:: @ 861CF40 - .2byte 0x0098, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_861CF48:: @ 861CF48 - .2byte 0x00a0, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_861CF50:: @ 861CF50 - .2byte 0x00a8, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_861CF58:: @ 861CF58 - .2byte 0x00b0, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnimTable_861CF60:: @ 861CF60 - .4byte gSpriteAnim_861CEA8 - .4byte gSpriteAnim_861CEB0 - .4byte gSpriteAnim_861CEB8 - .4byte gSpriteAnim_861CEC0 - .4byte gSpriteAnim_861CEC8 - .4byte gSpriteAnim_861CED0 - .4byte gSpriteAnim_861CED8 - .4byte gSpriteAnim_861CEE0 - .4byte gSpriteAnim_861CEE8 - .4byte gSpriteAnim_861CEF0 - .4byte gSpriteAnim_861CEF8 - .4byte gSpriteAnim_861CF00 - .4byte gSpriteAnim_861CF08 - .4byte gSpriteAnim_861CF10 - .4byte gSpriteAnim_861CF18 - .4byte gSpriteAnim_861CF20 - .4byte gSpriteAnim_861CF28 - .4byte gSpriteAnim_861CF30 - .4byte gSpriteAnim_861CF38 - .4byte gSpriteAnim_861CF40 - .4byte gSpriteAnim_861CF48 - .4byte gSpriteAnim_861CF50 - .4byte gSpriteAnim_861CF58 - - .align 2 -gUnknown_0861CFBC:: @ 861CFBC - obj_tiles gMoveTypes_Gfx, 0x1700, 0x7532 - - .align 2 -gUnknown_0861CFC4:: @ 861CFC4 - spr_template 0x7532, 0x7532, gOamData_861CEA0, gSpriteAnimTable_861CF60, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy - -gUnknown_0861CFDC:: @ 861CFDC - .byte 0x0d, 0x0d, 0x0e, 0x0e, 0x0d, 0x0d, 0x0f, 0x0e, 0x0d, 0x0f, 0x0d, 0x0e, 0x0f, 0x0d, 0x0e, 0x0e, 0x0f, 0x0d, 0x0d, 0x0e, 0x0e, 0x0f, 0x0d, 0x00 - - .align 2 -gOamData_861CFF4:: @ 861CFF4 - .2byte 0x0000, 0x4000, 0x0400, 0x0000 - - .align 2 -gSpriteAnim_861CFFC:: @ 861CFFC - .2byte 0x0000, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_861D004:: @ 861D004 - .2byte 0x0004, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_861D00C:: @ 861D00C - .2byte 0x0008, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_861D014:: @ 861D014 - .2byte 0x000c, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_861D01C:: @ 861D01C - .2byte 0x0010, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_861D024:: @ 861D024 - .2byte 0x0010, 0x0040, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_861D02C:: @ 861D02C - .2byte 0x0014, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_861D034:: @ 861D034 - .2byte 0x0018, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_861D03C:: @ 861D03C - .2byte 0x0018, 0x0040, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_861D044:: @ 861D044 - .2byte 0x001c, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnimTable_861D04C:: @ 861D04C - .4byte gSpriteAnim_861CFFC - .4byte gSpriteAnim_861D004 - .4byte gSpriteAnim_861D00C - .4byte gSpriteAnim_861D014 - .4byte gSpriteAnim_861D01C - .4byte gSpriteAnim_861D024 - .4byte gSpriteAnim_861D02C - .4byte gSpriteAnim_861D034 - .4byte gSpriteAnim_861D03C - .4byte gSpriteAnim_861D044 - - .align 2 -gUnknown_0861D074:: @ 861D074 - obj_tiles gUnknown_08D97BEC, 0x0400, 0x7530 - - .align 2 -gUnknown_0861D07C:: @ 861D07C - obj_pal gUnknown_08D97CF4, 0x7530 - - .align 2 -gUnknown_0861D084:: @ 861D084 - spr_template 0x7530, 0x7530, gOamData_861CFF4, gSpriteAnimTable_861D04C, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy - - .align 2 -gOamData_861D09C:: @ 861D09C - .2byte 0x4000, 0x4000, 0x0c00, 0x0000 - - .align 2 -gSpriteAnim_861D0A4:: @ 861D0A4 - .2byte 0x0000, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_861D0AC:: @ 861D0AC - .2byte 0x0004, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_861D0B4:: @ 861D0B4 - .2byte 0x0008, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_861D0BC:: @ 861D0BC - .2byte 0x000c, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_861D0C4:: @ 861D0C4 - .2byte 0x0010, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_861D0CC:: @ 861D0CC - .2byte 0x0014, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_861D0D4:: @ 861D0D4 - .2byte 0x0018, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnimTable_861D0DC:: @ 861D0DC - .4byte gSpriteAnim_861D0A4 - .4byte gSpriteAnim_861D0AC - .4byte gSpriteAnim_861D0B4 - .4byte gSpriteAnim_861D0BC - .4byte gSpriteAnim_861D0C4 - .4byte gSpriteAnim_861D0CC - .4byte gSpriteAnim_861D0D4 - - .align 2 -gUnknown_0861D0F8:: @ 861D0F8 - obj_tiles gStatusGfx_Icons, 0x0380, 0x7531 - - .align 2 -gUnknown_0861D100:: @ 861D100 - obj_pal gStatusPal_Icons, 0x7531 - - .align 2 -gUnknown_0861D108:: @ 861D108 - spr_template 0x7531, 0x7531, gOamData_861D09C, gSpriteAnimTable_861D0DC, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy - - .align 2 -gUnknown_0861D120:: @ 861D120 - .incbin "graphics/interface/summary_markings.gbapal" - - .align 2 -gUnknown_0861D140:: @ 861D140 - .incbin "graphics/interface/region_map.gbapal" - - .align 2 -gUnknown_0861D1A0:: @ 861D1A0 - .incbin "graphics/interface/region_map.8bpp.lz" - - .align 2 -gUnknown_0861DEF4:: @ 861DEF4 - .incbin "graphics/interface/region_map.bin.lz" - - .align 2 -gUnknown_0861E208:: @ 861E208 - .incbin "graphics/interface/region_map_affine.8bpp.lz" - - .align 2 -gUnknown_0861EF64:: @ 861EF64 - .incbin "graphics/interface/region_map_affine.bin.lz" - - .align 2 -gUnknown_0861F2B4:: @ 861F2B4 - .4byte 0x000011f0, 0x000001e1, 0x000021de - - .align 2 -gUnknown_0861F2C0:: @ 861F2C0 - .4byte 0x00000000, sub_81C5460, sub_81C5518, 0x00000000, 0x00080000, 0x07003021 - - .align 2 -gUnknown_0861F2D8:: @ 861F2D8 - .4byte gMenuText_Use, sub_81C61E0 - .4byte gMenuText_Toss, sub_81C62C4 - .4byte gMenuText_Give, sub_81C6648 - .4byte gText_Cancel2, sub_81C6258 - .4byte gMenuText_Use, sub_81C679C - .4byte gText_EmptyString2, NULL - -gUnknown_0861F308:: @ 861F308 - .byte 0x00, 0x02, 0x01, 0x03 - -gUnknown_0861F30C:: @ 861F30C - .byte 0x01, 0x03 - -gUnknown_0861F30E:: @ 861F30E - .byte 0x04, 0x03 - -gUnknown_0861F310:: @ 861F310 - .byte 0x03, 0x00, 0x00, 0x00 - -gUnknown_0861F314:: @ 861F314 - .4byte sub_81C654C - .4byte sub_81C63D0 - -gUnknown_0861F31C:: @ 861F31C - .byte 0x00, 0x02, 0x03, 0x00, 0x03, 0x01, 0x01, 0x02, 0x03, 0x00, 0x00, 0x00 - - .align 2 -gUnknown_0861F328:: @ 861F328 - window_template 0x00, 0x0e, 0x02, 0x0f, 0x10, 0x0f, 0x001e - window_template 0x00, 0x00, 0x0d, 0x0e, 0x06, 0x0f, 0x010e - window_template 0x01, 0x02, 0x0f, 0x1b, 0x04, 0x0f, 0x0162 - window_template 0x01, 0x18, 0x11, 0x05, 0x02, 0x0f, 0x01ce - null_window_template - - .align 2 -gUnknown_0861F350:: @ 861F350 - window_template 0x01, 0x16, 0x11, 0x07, 0x02, 0x0f, 0x01d8 - window_template 0x01, 0x16, 0x0f, 0x07, 0x04, 0x0f, 0x01d8 - window_template 0x01, 0x0f, 0x0f, 0x0e, 0x04, 0x0f, 0x01d8 - window_template 0x01, 0x0f, 0x0d, 0x0e, 0x06, 0x0f, 0x01d8 - - .align 2 -gUnknown_0861F370:: @ 861F370 - window_template 0x01, 0x18, 0x0f, 0x05, 0x04, 0x0f, 0x01d8 - - .align 2 -gOamData_861F378:: @ 861F378 - .2byte 0x0100, 0xc000, 0x0400, 0x0000 - - .align 2 -gSpriteAnim_861F380:: @ 861F380 - .2byte 0x0000, 0x0004, 0xffff, 0x0000 - - .align 2 -gSpriteAnimTable_861F388:: @ 861F388 - .4byte gSpriteAnim_861F380 - - .align 2 -gSpriteAffineAnim_861F38C:: @ 861F38C - .2byte 0x0100, 0x0100, 0x0000, 0x0000, 0x7fff, 0x0000, 0x0000, 0x0000 - - .align 2 -gSpriteAffineAnim_861F39C:: @ 861F39C - .2byte 0x0000, 0x0000, 0x02fe, 0x0000, 0x0000, 0x0000, 0x0402, 0x0000, 0x0000, 0x0000, 0x04fe, 0x0000, 0x0000, 0x0000, 0x0202, 0x0000 - .2byte 0x7fff, 0x0000, 0x0000, 0x0000 - - .align 2 -gSpriteAffineAnimTable_861F3C4:: @ 861F3C4 - .4byte gSpriteAffineAnim_861F38C - .4byte gSpriteAffineAnim_861F39C - - .align 2 -gUnknown_0861F3CC:: @ 861F3CC - obj_tiles gBattleFrontierGfx_PyramidBag, 0x0800, 0x1024 - - .align 2 -gUnknown_0861F3D4:: @ 861F3D4 - spr_template 0x1024, 0x1024, gOamData_861F378, gSpriteAnimTable_861F388, NULL, gSpriteAffineAnimTable_861F3C4, SpriteCallbackDummy - diff --git a/data/unk_pokedex_area_screen_helper.s b/data/unk_pokedex_area_screen_helper.s new file mode 100644 index 000000000..2f3881446 --- /dev/null +++ b/data/unk_pokedex_area_screen_helper.s @@ -0,0 +1,110 @@ + .include "asm/macros.inc" + .include "constants/constants.inc" + + .section .rodata + + .align 2 +gUnknown_0861D1A0:: @ 861D1A0 + .incbin "graphics/interface/region_map.8bpp.lz" + + .align 2 +gUnknown_0861DEF4:: @ 861DEF4 + .incbin "graphics/interface/region_map.bin.lz" + + .align 2 +gUnknown_0861E208:: @ 861E208 + .incbin "graphics/interface/region_map_affine.8bpp.lz" + + .align 2 +gUnknown_0861EF64:: @ 861EF64 + .incbin "graphics/interface/region_map_affine.bin.lz" + + .align 2 +gUnknown_0861F2B4:: @ 861F2B4 + .4byte 0x000011f0, 0x000001e1, 0x000021de + + .align 2 +gUnknown_0861F2C0:: @ 861F2C0 + .4byte 0x00000000, sub_81C5460, sub_81C5518, 0x00000000, 0x00080000, 0x07003021 + + .align 2 +gUnknown_0861F2D8:: @ 861F2D8 + .4byte gMenuText_Use, sub_81C61E0 + .4byte gMenuText_Toss, sub_81C62C4 + .4byte gMenuText_Give, sub_81C6648 + .4byte gText_Cancel2, sub_81C6258 + .4byte gMenuText_Use, sub_81C679C + .4byte gText_EmptyString2, NULL + +gUnknown_0861F308:: @ 861F308 + .byte 0x00, 0x02, 0x01, 0x03 + +gUnknown_0861F30C:: @ 861F30C + .byte 0x01, 0x03 + +gUnknown_0861F30E:: @ 861F30E + .byte 0x04, 0x03 + +gUnknown_0861F310:: @ 861F310 + .byte 0x03, 0x00, 0x00, 0x00 + +gUnknown_0861F314:: @ 861F314 + .4byte sub_81C654C + .4byte sub_81C63D0 + +gUnknown_0861F31C:: @ 861F31C + .byte 0x00, 0x02, 0x03, 0x00, 0x03, 0x01, 0x01, 0x02, 0x03, 0x00, 0x00, 0x00 + + .align 2 +gUnknown_0861F328:: @ 861F328 + window_template 0x00, 0x0e, 0x02, 0x0f, 0x10, 0x0f, 0x001e + window_template 0x00, 0x00, 0x0d, 0x0e, 0x06, 0x0f, 0x010e + window_template 0x01, 0x02, 0x0f, 0x1b, 0x04, 0x0f, 0x0162 + window_template 0x01, 0x18, 0x11, 0x05, 0x02, 0x0f, 0x01ce + null_window_template + + .align 2 +gUnknown_0861F350:: @ 861F350 + window_template 0x01, 0x16, 0x11, 0x07, 0x02, 0x0f, 0x01d8 + window_template 0x01, 0x16, 0x0f, 0x07, 0x04, 0x0f, 0x01d8 + window_template 0x01, 0x0f, 0x0f, 0x0e, 0x04, 0x0f, 0x01d8 + window_template 0x01, 0x0f, 0x0d, 0x0e, 0x06, 0x0f, 0x01d8 + + .align 2 +gUnknown_0861F370:: @ 861F370 + window_template 0x01, 0x18, 0x0f, 0x05, 0x04, 0x0f, 0x01d8 + + .align 2 +gOamData_861F378:: @ 861F378 + .2byte 0x0100, 0xc000, 0x0400, 0x0000 + + .align 2 +gSpriteAnim_861F380:: @ 861F380 + .2byte 0x0000, 0x0004, 0xffff, 0x0000 + + .align 2 +gSpriteAnimTable_861F388:: @ 861F388 + .4byte gSpriteAnim_861F380 + + .align 2 +gSpriteAffineAnim_861F38C:: @ 861F38C + .2byte 0x0100, 0x0100, 0x0000, 0x0000, 0x7fff, 0x0000, 0x0000, 0x0000 + + .align 2 +gSpriteAffineAnim_861F39C:: @ 861F39C + .2byte 0x0000, 0x0000, 0x02fe, 0x0000, 0x0000, 0x0000, 0x0402, 0x0000, 0x0000, 0x0000, 0x04fe, 0x0000, 0x0000, 0x0000, 0x0202, 0x0000 + .2byte 0x7fff, 0x0000, 0x0000, 0x0000 + + .align 2 +gSpriteAffineAnimTable_861F3C4:: @ 861F3C4 + .4byte gSpriteAffineAnim_861F38C + .4byte gSpriteAffineAnim_861F39C + + .align 2 +gUnknown_0861F3CC:: @ 861F3CC + obj_tiles gBattleFrontierGfx_PyramidBag, 0x0800, 0x1024 + + .align 2 +gUnknown_0861F3D4:: @ 861F3D4 + spr_template 0x1024, 0x1024, gOamData_861F378, gSpriteAnimTable_861F388, NULL, gSpriteAffineAnimTable_861F3C4, SpriteCallbackDummy + diff --git a/include/battle_controllers.h b/include/battle_controllers.h index ff5a629af..b449bb501 100644 --- a/include/battle_controllers.h +++ b/include/battle_controllers.h @@ -1,6 +1,8 @@ #ifndef GUARD_BATTLE_CONTROLLERS_H #define GUARD_BATTLE_CONTROLLERS_H +#include "battle.h" + enum { REQUEST_ALL_BATTLE, diff --git a/include/battle_frontier_2.h b/include/battle_frontier_2.h index d410749b9..09e974068 100644 --- a/include/battle_frontier_2.h +++ b/include/battle_frontier_2.h @@ -11,5 +11,6 @@ void sub_81AA078(u16*, u8); void sub_81A4C30(void); void sub_819A4F8(void); void sub_819DC00(void); +bool8 sub_81A6BF4(void); #endif // GUARD_BATTLE_FRONTIER_2_H diff --git a/include/battle_tent.h b/include/battle_tent.h new file mode 100644 index 000000000..a894d4cfb --- /dev/null +++ b/include/battle_tent.h @@ -0,0 +1,6 @@ +#ifndef GUARD_BATTLE_TENT_H +#define GUARD_BATTLE_TENT_H + +bool8 sub_81B9E94(void); + +#endif //GUARD_BATTLE_TENT_H diff --git a/include/contest_effect.h b/include/contest_effect.h index 3484ca5df..c8f5e389a 100644 --- a/include/contest_effect.h +++ b/include/contest_effect.h @@ -18,5 +18,6 @@ struct ContestEffect extern const struct ContestMove gContestMoves[]; extern struct ContestEffect gContestEffects[]; +extern const u8 *const gContestEffectDescriptionPointers[]; #endif //GUARD_CONTEST_EFFECT_H diff --git a/include/graphics.h b/include/graphics.h index 2dc5e99bf..a5acca625 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -3382,4 +3382,24 @@ extern const u8 gCreditsCopyrightEnd_Gfx[]; extern const u8 gPokenavConditionMarker_Gfx[]; extern const u16 gPokenavConditionMarker_Pal[]; +extern const u8 gUnknown_08D9862C[]; +extern const u8 gUnknown_08D98CC8[]; +extern const u8 gUnknown_08D987FC[]; +extern const u8 gUnknown_08D9898C[]; +extern const u8 gUnknown_08D98B28[]; +extern const u8 gUnknown_08D9853C[]; +extern const u8 gUnknown_08D85620[]; +extern const u16 gSummaryScreenWindow_Tilemap[]; +extern const u16 gMoveTypes_Pal[]; +extern const u8 gUnknown_08D97D0C[]; + +extern const u16 gSummaryScreenPowAcc_Tilemap[]; +extern const u16 gUnknown_08DC3C34[]; + +extern const u8 gMoveTypes_Gfx[]; +extern const u8 gUnknown_08D97BEC[]; +extern const u8 gUnknown_08D97CF4[]; +extern const u8 gStatusGfx_Icons[]; +extern const u8 gStatusPal_Icons[]; + #endif //GUARD_GRAPHICS_H diff --git a/include/m4a.h b/include/m4a.h index a1f413cf5..595379495 100644 --- a/include/m4a.h +++ b/include/m4a.h @@ -17,6 +17,7 @@ void m4aMPlayFadeOutTemporarily(struct MusicPlayerInfo *mplayInfo, u16 speed); void m4aMPlayFadeIn(struct MusicPlayerInfo *mplayInfo, u16 speed); void m4aMPlayImmInit(struct MusicPlayerInfo *mplayInfo); +extern struct MusicPlayerInfo gMPlayInfo_BGM; extern struct MusicPlayerInfo gMPlayInfo_SE1; extern struct MusicPlayerInfo gMPlayInfo_SE2; extern struct MusicPlayerInfo gMPlayInfo_SE3; diff --git a/include/menu.h b/include/menu.h index 5dfd99c64..054d8cb34 100644 --- a/include/menu.h +++ b/include/menu.h @@ -85,5 +85,7 @@ void RemoveMapNamePopUpWindow(void); u8 GetMapNamePopUpWindowId(void); u8 AddMapNamePopUpWindow(void); void sub_8199F74(u8 windowId, u8 fontId, const u8 *str, u8 left, u8 top, u8 speed, void (*callback)(struct TextSubPrinter *, u16), u8 letterSpacing, u8 lineSpacing); +void sub_8199C30(u8 bgId, u8 left, u8 top, u8 width, u8 height, u8 palette); +void sub_8199D3C(void *ptr, int delta, int width, int height, bool32 is8BPP); #endif // GUARD_MENU_H diff --git a/include/menu_helpers.h b/include/menu_helpers.h index 387a89fdd..ee8501d18 100644 --- a/include/menu_helpers.h +++ b/include/menu_helpers.h @@ -2,6 +2,7 @@ #define GUARD_MENU_HELPERS_H #include "task.h" +#include "window.h" // Exported type declarations diff --git a/include/mon_markings.h b/include/mon_markings.h index 852e8b4eb..22c3f14a4 100644 --- a/include/mon_markings.h +++ b/include/mon_markings.h @@ -21,4 +21,6 @@ struct PokemonMarkMenu /*0x10B4*/ u8 tileLoadState; }; // 10b8 +struct Sprite *sub_811FF94(u16 tileTag, u16 paletteTag, const u16 *palette); + #endif //POKEEMERALD_MON_MARKINGS_H diff --git a/include/party_menu.h b/include/party_menu.h index cb2c38891..02e481200 100644 --- a/include/party_menu.h +++ b/include/party_menu.h @@ -57,5 +57,8 @@ u8 sub_81B1360(void); void sub_81B8904(u8 arg0, void (*callback)(void)); void OpenPartyMenuInBattle(u8 caseId); u16 ItemIdToBattleMoveId(u16 itemId); +u8 sub_81B205C(struct Pokemon* a); +u8 sub_81B6D14(u16 a); +bool8 hm_add_c3_without_phase_2(void); #endif // GUARD_PARTY_MENU_H diff --git a/include/pokeball.h b/include/pokeball.h index 84178b5b2..30a1d8b11 100644 --- a/include/pokeball.h +++ b/include/pokeball.h @@ -18,6 +18,8 @@ enum POKEBALL_COUNT }; +extern const struct SpriteTemplate gBallSpriteTemplates[]; + #define POKEBALL_PLAYER_SENDOUT 0xFF #define POKEBALL_OPPONENT_SENDOUT 0xFE diff --git a/include/pokemon_storage_system.h b/include/pokemon_storage_system.h index 03f4e0da6..a73958d90 100644 --- a/include/pokemon_storage_system.h +++ b/include/pokemon_storage_system.h @@ -83,5 +83,6 @@ void CompactPartySlots(void); u32 GetBoxMonDataFromAnyBox(u8 boxId, u8 monPosition, u32 request); bool8 CheckFreePokemonStorageSpace(void); u8 StorageGetCurrentBox(void); +u8 sub_80D214C(struct BoxPokemon* a, u8 b, u8 c, u8 d); #endif // GUARD_POKEMON_STORAGE_SYSTEM_H diff --git a/include/pokemon_summary_screen.h b/include/pokemon_summary_screen.h index 75caa9a3a..0580e793c 100755 --- a/include/pokemon_summary_screen.h +++ b/include/pokemon_summary_screen.h @@ -2,6 +2,6 @@ #define GUARD_POKEMON_SUMMARY_SCREEN_H void sub_81C4F98(u8, void(*)(void)); -void ShowSelectMovePokemonSummaryScreen(void *a, u8 b, u8 c, void *d, u16 e); +void ShowSelectMovePokemonSummaryScreen(struct Pokemon *a, u8 b, u8 c, void *d, u16 e); #endif // GUARD_POKEMON_SUMMARY_SCREEN_H diff --git a/include/region_map.h b/include/region_map.h index af331ad81..6339f7a88 100644 --- a/include/region_map.h +++ b/include/region_map.h @@ -94,5 +94,6 @@ void CreateRegionMapCursor(u16 tileTag, u16 paletteTag); u8 *GetMapName(u8 *, u16, u16); bool32 sub_8124668(u8 mapSecId); u8 *sub_81245DC(u8 *dest, u16 mapSecId); +u8 *sub_8124610(u8 *dest, u16 mapSecId); #endif //GUARD_REGION_MAP_H diff --git a/include/strings.h b/include/strings.h index f8b216a39..f88425b26 100644 --- a/include/strings.h +++ b/include/strings.h @@ -776,4 +776,52 @@ extern const u8 gText_TeachWhichMoveToPkmn[]; extern const u8 gText_GiveUpTeachingNewMove[]; extern const u8 gText_TeachX[]; +extern const u8 gText_LevelSymbol[]; +extern const u8 gText_PkmnInfo[]; +extern const u8 gText_PkmnSkills[]; +extern const u8 gText_BattleMoves[]; +extern const u8 gText_ContestMoves[]; +extern const u8 gText_HMMovesCantBeForgotten2[]; +extern const u8 gText_Info[]; +extern const u8 gText_Switch[]; +extern const u8 gText_RentalPkmn[]; +extern const u8 gText_TypeSlash[]; +extern const u8 gText_HP4[]; +extern const u8 gText_Attack3[]; +extern const u8 gText_Defense3[]; +extern const u8 gText_SpAtk4[]; +extern const u8 gText_SpDef4[]; +extern const u8 gText_Speed2[]; +extern const u8 gText_ExpPoints[]; +extern const u8 gText_NextLv[]; +extern const u8 gText_Status[]; +extern const u8 gText_Power[]; +extern const u8 gText_Accuracy2[]; +extern const u8 gText_Appeal[]; +extern const u8 gText_Jam[]; +extern const u8 gText_OTSlash[]; +extern const u8 gText_UnkCtrlF907F908[]; +extern const u8 gText_XNature[]; +extern const u8 gText_XNatureHatchedAtYZ[]; +extern const u8 gText_XNatureHatchedSomewhereAt[]; +extern const u8 gText_XNatureMetAtYZ[]; +extern const u8 gText_XNatureMetSomewhereAt[]; +extern const u8 gText_XNatureFatefulEncounter[]; +extern const u8 gText_XNatureProbablyMetAt[]; +extern const u8 gText_XNatureObtainedInTrade[]; +extern const u8 gText_EmptyString5[]; +extern const u8 gText_EggWillTakeALongTime[]; +extern const u8 gText_EggAboutToHatch[]; +extern const u8 gText_EggWillHatchSoon[]; +extern const u8 gText_EggWillTakeSomeTime[]; +extern const u8 gText_PeculiarEggNicePlace[]; +extern const u8 gText_PeculiarEggTrade[]; +extern const u8 gText_EggFromTraveler[]; +extern const u8 gText_EggFromHotSprings[]; +extern const u8 gText_OddEggFoundByCouple[]; +extern const u8 gText_None[]; +extern const u8 gText_RibbonsVar1[]; +extern const u8 gText_OneDash[]; +extern const u8 gText_TwoDashes[]; + #endif //GUARD_STRINGS_H diff --git a/ld_script.txt b/ld_script.txt index 5f9d35617..462af2946 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -262,7 +262,9 @@ SECTIONS { asm/fossil_specials.o(.text); src/berry_fix_program.o(.text); src/pokemon_summary_screen.o(.text); - asm/pokemon_summary_screen.o(.text); + src/unk_pokedex_area_screen_helper.o(.text); + src/battle_pyramid.o(.text); + asm/battle_pyramid.o(.text); asm/pokenav.o(.text); src/match_call.o(.text); asm/pokenav.o(.text.after.match.call); @@ -537,7 +539,8 @@ SECTIONS { src/fldeff_groundshake.o(.rodata); src/berry_fix_program.o(.rodata); src/pokemon_summary_screen.o(.rodata); - data/pokemon_summary_screen.o(.rodata); + src/unk_pokedex_area_screen_helper.o(.rodata); + data/unk_pokedex_area_screen_helper.o(.rodata); data/pokenav.o(.rodata); src/match_call.o(.rodata); data/pokenav.o(.rodata.after.match.call); diff --git a/src/battle_pyramid.c b/src/battle_pyramid.c new file mode 100644 index 000000000..f9cc48a9a --- /dev/null +++ b/src/battle_pyramid.c @@ -0,0 +1,248 @@ +#include "global.h" +#include "main.h" +#include "battle_controllers.h" +#include "bg.h" +#include "field_effect.h" +#include "field_weather.h" +#include "gpu_regs.h" +#include "malloc.h" +#include "menu.h" +#include "menu_helpers.h" +#include "overworld.h" +#include "palette.h" +#include "party_menu.h" +#include "scanline_effect.h" +#include "script.h" +#include "task.h" +#include "constants/rgb.h" + +EWRAM_DATA struct +{ + u32 unk0; + u8 filler4[0x804 - 0x4]; + u8 unk804[11]; + u8 unk80F[5]; + u8 unk814; + u8 filler815; + s8 unk816; + u8 filler817[0x984 - 0x817]; + u16 unk984; + u8 filler986[0x98C - 0x986]; +} *gUnknown_0203CF2C = NULL; +EWRAM_DATA struct +{ + void (*callback)(void); + u8 unk4; + u16 unk6; + u16 unk8; +} gUnknown_0203CF30 = {0}; + +extern const struct BgTemplate gUnknown_0861F2B4[3]; + +void sub_81C4F98(u8 a0, void (*callback)(void)); +void sub_81C4F44(u8 taskId); +void sub_81C504C(void); +bool8 sub_81C5078(void); +void sub_81C51DC(void); +bool8 sub_81C5238(void); +void sub_81C5314(void); +void sub_81C5674(void); +void sub_81C56F8(void); +void sub_81C5924(void); +void sub_81C59BC(void); +void sub_81C5A20(void); +void sub_81C6BD8(void); +void sub_81C6EF4(void); +void sub_81C700C(void); + +void sub_81C4EEC(void) +{ + gUnknown_0203CF30.unk6 = 0; + gUnknown_0203CF30.unk8 = 0; +} + +void sub_81C4EFC(void) +{ + sub_81C4F98(0, CB2_ReturnToFieldWithOpenMenu); +} + +void sub_81C4F10(void) +{ + sub_81C4F98(1, SetCB2ToReshowScreenAfterMenu2); +} + +void sub_81C4F24(void) +{ + ScriptContext2_Enable(); + FadeScreen(1, 0); + CreateTask(sub_81C4F44, 10); +} + +void sub_81C4F44(u8 taskId) +{ + if (!gPaletteFade.active) + { + overworld_free_bg_tilemaps(); + gFieldCallback2 = hm_add_c3_without_phase_2; + sub_81C4F98(3, CB2_ReturnToField); + DestroyTask(taskId); + } +} + +void sub_81C4F84(void) +{ + sub_81C4F98(4, gUnknown_0203CF30.callback); +} + +void sub_81C4F98(u8 a0, void (*callback)(void)) +{ + gUnknown_0203CF2C = AllocZeroed(sizeof(*gUnknown_0203CF2C)); + + if (a0 != 4) + { + gUnknown_0203CF30.unk4 = a0; + } + + if (callback != NULL) + { + gUnknown_0203CF30.callback = callback; + } + + gUnknown_0203CF2C->unk0 = 0; + gUnknown_0203CF2C->unk814 = -1; + gUnknown_0203CF2C->unk816 = -1; + + memset(gUnknown_0203CF2C->unk804, 0xFF, sizeof(gUnknown_0203CF2C->unk804)); + memset(gUnknown_0203CF2C->unk80F, 0xFF, sizeof(gUnknown_0203CF2C->unk80F)); + + SetMainCallback2(sub_81C504C); +} + +void sub_81C501C(void) +{ + RunTasks(); + AnimateSprites(); + BuildOamBuffer(); + do_scheduled_bg_tilemap_copies_to_vram(); + UpdatePaletteFade(); +} + +void sub_81C5038(void) +{ + LoadOam(); + ProcessSpriteCopyRequests(); + TransferPlttBuffer(); +} + +void sub_81C504C(void) +{ + while (sub_81221EC() != TRUE && sub_81C5078() != TRUE && sub_81221AC() != TRUE); +} + +bool8 sub_81C5078(void) +{ + switch (gMain.state) + { + case 0: + SetVBlankHBlankCallbacksToNull(); + clear_scheduled_bg_copies_to_vram(); + gMain.state++; + break; + case 1: + ScanlineEffect_Stop(); + gMain.state++; + break; + case 2: + FreeAllSpritePalettes(); + gMain.state++; + break; + case 3: + ResetPaletteFade(); + gPaletteFade.bufferTransferDisabled = TRUE; + gMain.state++; + break; + case 4: + ResetSpriteData(); + gMain.state++; + break; + case 5: + if (!sub_81221AC()) + { + ResetTasks(); + } + gMain.state++; + break; + case 6: + sub_81C51DC(); + gUnknown_0203CF2C->unk984 = 0; + gMain.state++; + break; + case 7: + if (sub_81C5238()) + { + gMain.state++; + } + break; + case 8: + sub_81C6BD8(); + gMain.state++; + break; + case 9: + sub_81C5924(); + sub_81C59BC(); + sub_81C5A20(); + gMain.state++; + break; + case 10: + sub_81C5314(); + gMain.state++; + break; + case 11: + sub_81C56F8(); + gMain.state++; + break; + case 12: + sub_81C6EF4(); + gMain.state++; + break; + case 13: + sub_81C5674(); + gMain.state++; + break; + case 14: + sub_81C700C(); + gMain.state++; + break; + case 15: + BlendPalettes(0xFFFFFFFF, 0x10, 0); + gMain.state++; + break; + case 16: + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); + gPaletteFade.bufferTransferDisabled = FALSE; + gMain.state++; + break; + default: + SetVBlankCallback(sub_81C5038); + SetMainCallback2(sub_81C501C); + return TRUE; + } + return FALSE; +} + +void sub_81C51DC(void) +{ + ResetVramOamAndBgCntRegs(); + ResetBgsAndClearDma3BusyFlags(0); + InitBgsFromTemplates(0, gUnknown_0861F2B4, ARRAY_COUNT(gUnknown_0861F2B4)); + SetBgTilemapBuffer(2, gUnknown_0203CF2C->filler4); + ResetAllBgsCoordinates(); + schedule_bg_copy_tilemap_to_vram(2); + SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0 | + DISPCNT_OBJ_1D_MAP | + DISPCNT_OBJ_ON); + ShowBg(0); + ShowBg(1); + ShowBg(2); + SetGpuReg(REG_OFFSET_BLDCNT, 0); +} diff --git a/src/data/text/nature_names.h b/src/data/text/nature_names.h new file mode 100644 index 000000000..d0d217d9b --- /dev/null +++ b/src/data/text/nature_names.h @@ -0,0 +1,54 @@ +static const u8 sHardyNatureName[] = _("HARDY"); +static const u8 sLonelyNatureName[] = _("LONELY"); +static const u8 sBraveNatureName[] = _("BRAVE"); +static const u8 sAdamantNatureName[] = _("ADAMANT"); +static const u8 sNaughtyNatureName[] = _("NAUGHTY"); +static const u8 sBoldNatureName[] = _("BOLD"); +static const u8 sDocileNatureName[] = _("DOCILE"); +static const u8 sRelaxedNatureName[] = _("RELAXED"); +static const u8 sImpishNatureName[] = _("IMPISH"); +static const u8 sLaxNatureName[] = _("LAX"); +static const u8 sTimidNatureName[] = _("TIMID"); +static const u8 sHastyNatureName[] = _("HASTY"); +static const u8 sSeriousNatureName[] = _("SERIOUS"); +static const u8 sJollyNatureName[] = _("JOLLY"); +static const u8 sNaiveNatureName[] = _("NAIVE"); +static const u8 sModestNatureName[] = _("MODEST"); +static const u8 sMildNatureName[] = _("MILD"); +static const u8 sQuietNatureName[] = _("QUIET"); +static const u8 sBashfulNatureName[] = _("BASHFUL"); +static const u8 sRashNatureName[] = _("RASH"); +static const u8 sCalmNatureName[] = _("CALM"); +static const u8 sGentleNatureName[] = _("GENTLE"); +static const u8 sSassyNatureName[] = _("SASSY"); +static const u8 sCarefulNatureName[] = _("CAREFUL"); +static const u8 sQuirkyNatureName[] = _("QUIRKY"); + +const u8 *const gNatureNamePointers[] = +{ + [NATURE_HARDY] = sHardyNatureName, + [NATURE_LONELY] = sLonelyNatureName, + [NATURE_BRAVE] = sBraveNatureName, + [NATURE_ADAMANT] = sAdamantNatureName, + [NATURE_NAUGHTY] = sNaughtyNatureName, + [NATURE_BOLD] = sBoldNatureName, + [NATURE_DOCILE] = sDocileNatureName, + [NATURE_RELAXED] = sRelaxedNatureName, + [NATURE_IMPISH] = sImpishNatureName, + [NATURE_LAX] = sLaxNatureName, + [NATURE_TIMID] = sTimidNatureName, + [NATURE_HASTY] = sHastyNatureName, + [NATURE_SERIOUS] = sSeriousNatureName, + [NATURE_JOLLY] = sJollyNatureName, + [NATURE_NAIVE] = sNaiveNatureName, + [NATURE_MODEST] = sModestNatureName, + [NATURE_MILD] = sMildNatureName, + [NATURE_QUIET] = sQuietNatureName, + [NATURE_BASHFUL] = sBashfulNatureName, + [NATURE_RASH] = sRashNatureName, + [NATURE_CALM] = sCalmNatureName, + [NATURE_GENTLE] = sGentleNatureName, + [NATURE_SASSY] = sSassyNatureName, + [NATURE_CAREFUL] = sCarefulNatureName, + [NATURE_QUIRKY] = sQuirkyNatureName, +}; diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index 7e20a2a92..b5117d45d 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -1,364 +1,731 @@ #include "global.h" -#include "battle.h" -#include "bg.h" -#include "decompress.h" -#include "item.h" -#include "constants/items.h" -#include "link.h" -#include "m4a.h" #include "main.h" -#include "malloc.h" -#include "constants/moves.h" -#include "palette.h" -#include "pokemon.h" -#include "constants/songs.h" -#include "sound.h" -#include "constants/species.h" -#include "sprite.h" -#include "dynamic_placeholder_text_util.h" -#include "string_util.h" -#include "task.h" -#include "text.h" -#include "window.h" -#include "event_data.h" -#include "gpu_regs.h" -#include "menu.h" -#include "international_string_util.h" -#include "scanline_effect.h" -#include "menu_helpers.h" -#include "daycare.h" -#include "data2.h" +#include "battle.h" +#include "battle_anim.h" +#include "battle_frontier_2.h" +#include "battle_message.h" +#include "battle_tent.h" +#include "bg.h" #include "contest.h" #include "contest_effect.h" +#include "data2.h" +#include "daycare.h" +#include "decompress.h" +#include "dynamic_placeholder_text_util.h" +#include "event_data.h" +#include "gpu_regs.h" +#include "graphics.h" +#include "international_string_util.h" +#include "item.h" +#include "link.h" +#include "m4a.h" +#include "malloc.h" +#include "menu.h" +#include "menu_helpers.h" +#include "mon_markings.h" +#include "party_menu.h" +#include "palette.h" +#include "pokeball.h" +#include "pokemon.h" +#include "pokemon_storage_system.h" +#include "region_map.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 "tv.h" +#include "window.h" +#include "constants/items.h" +#include "constants/moves.h" +#include "constants/songs.h" +#include "constants/species.h" -extern struct UnkSummaryStruct* gUnknown_0203CF1C; -extern struct BgTemplate gUnknown_0861CBB4; -extern u8 gUnknown_0203CF20; -extern struct MusicPlayerInfo gMPlayInfo_BGM; -extern s8 gUnknown_0861CC1C[]; -extern u8 gUnknown_0203CF21; -extern struct UnkStruct_61CC04 gUnknown_0861CC04; -extern struct UnkStruct_61CC04 gUnknown_0861CC10; -extern struct UnkStruct_61CC04 gUnknown_0861CBEC; -extern struct UnkStruct_61CC04 gUnknown_0861CBF8; -extern u16 gSummaryScreenWindow_Tilemap[]; -extern struct ContestEffect gContestEffects[]; -extern struct WindowTemplate gUnknown_0861CC24; -extern u8 gUnknown_0861CD2C[][3]; -extern const u8 gSpeciesNames[][POKEMON_NAME_LENGTH + 1]; -extern u8 gText_MaleSymbol[]; -extern u8 gText_FemaleSymbol[]; -extern u8 gUnknown_0861CDD3[]; -extern void (*const gUnknown_0861CE54[])(); -extern void (*const gUnknown_0861CE64[])(u8 taskId); -extern struct WindowTemplate gUnknown_0861CCCC; -extern u8 gUnknown_0861CE74[]; -extern u8 gUnknown_0861CE7B[]; -extern struct WindowTemplate gUnknown_0861CCEC; -extern struct WindowTemplate gUnknown_0861CD14; -extern const u8 *const gContestEffectDescriptionPointers[]; - -void sub_81C488C(u8 a); -extern u8 sub_81221EC(); -extern u8 sub_81221AC(); -extern u8 gUnknown_08D9862C; -extern u8 gUnknown_08D98CC8; -extern u8 gUnknown_08D987FC; -extern u8 gUnknown_08D9898C; -extern u8 gUnknown_08D98B28; -extern u8 gUnknown_08D9853C; -extern u8 gUnknown_08D85620; -extern struct CompressedSpriteSheet gUnknown_0861CFBC; -extern struct CompressedSpriteSheet gUnknown_0861D074; -extern struct CompressedSpriteSheet gUnknown_0861D0F8; -extern struct CompressedSpritePalette gUnknown_0861D100; -extern struct CompressedSpritePalette gUnknown_0861D07C; -extern u8 gMoveTypes_Pal; -extern u8 gUnknown_08D97D0C; -extern void sub_81C1E20(u8 taskId); -extern u8 *GetMonNickname(struct Pokemon *mon, u8 *dest); -extern u16 SpeciesToPokedexNum(u16 species); -extern u8 gText_UnkCtrlF908Clear01[]; -extern u8 gText_LevelSymbol[]; -extern u8 gText_PkmnInfo[]; -extern u8 gText_PkmnSkills[]; -extern u8 gText_BattleMoves[]; -extern u8 gText_ContestMoves[]; -extern u8 gText_HMMovesCantBeForgotten2[]; -extern u8 gText_Cancel2[]; -extern u8 gText_Info[]; -extern u8 gText_Switch[]; -extern u8 gText_RentalPkmn[]; -extern u8 gText_TypeSlash[]; -extern u8 gText_HP4[]; -extern u8 gText_Attack3[]; -extern u8 gText_Defense3[]; -extern u8 gText_SpAtk4[]; -extern u8 gText_SpDef4[]; -extern u8 gText_Speed2[]; -extern u8 gText_ExpPoints[]; -extern u8 gText_NextLv[]; -extern u8 gText_Status[]; -extern u8 gText_Power[]; -extern u8 gText_Accuracy2[]; -extern u8 gText_Appeal[]; -extern u8 gText_Jam[]; -extern u8 gText_OTSlash[]; -extern u8 gText_UnkCtrlF907F908[]; -extern u8 gText_XNature[]; -extern u8 gText_XNatureHatchedAtYZ[]; -extern u8 gText_XNatureHatchedSomewhereAt[]; -extern u8 gText_XNatureMetAtYZ[]; -extern u8 gText_XNatureMetSomewhereAt[]; -extern u8 gText_XNatureFatefulEncounter[]; -extern u8 gText_XNatureProbablyMetAt[]; -extern u8 gText_XNatureObtainedInTrade[]; -extern u8 *gNatureNamePointers[]; -extern u8 gText_EmptyString5[]; -extern u32 gBattleTypeFlags; -extern u8 gText_FiveMarks[]; -extern u8 gText_EggWillTakeALongTime[]; -extern u8 gText_EggAboutToHatch[]; -extern u8 gText_EggWillHatchSoon[]; -extern u8 gText_EggWillTakeSomeTime[]; -extern u8 gText_PeculiarEggNicePlace[]; -extern u8 gText_PeculiarEggTrade[]; -extern u8 gText_EggFromTraveler[]; -extern u8 gText_EggFromHotSprings[]; -extern u8 gText_OddEggFoundByCouple[]; -extern u8 gText_None[]; -extern u8 gText_RibbonsVar1[]; -extern u8 gUnknown_0861CE82[]; -extern u8 gUnknown_0861CE8E[]; -extern u8 gText_OneDash[]; -extern u8 gText_TwoDashes[]; -extern u8 gText_ThreeDashes[]; -extern u8 gText_Cancel[]; -extern u8 gUnknown_0861CE97[]; -extern const struct SpriteTemplate gUnknown_0861CFC4; - -extern void sub_8199C30(u8 a, u8 b, u8 c, u8 d, u8 e, u8 f); -extern bool8 sub_81A6BF4(); -extern bool8 sub_81B9E94(); -extern void DynamicPlaceholderTextUtil_Reset(); -extern void sub_8124610(u8 *a, u8 b); -extern int GetPlayerIDAsU32(); -extern u8 GetCurrentPpToMaxPpState(u8 a, u8 b); - -void sub_81BFAE4(void); -void sub_81BFE24(); -u8 sub_81BFEB0(); -void sub_81C2554(); -void sub_81C1BA0(); -void sub_81C0098(struct Pokemon* a); -bool8 sub_81C00F0(struct Pokemon* a); -void sub_81C25E8(); -void sub_81C286C(); -void sub_81C2D9C(u8 a); -void sub_81C0348(); -void sub_81C2AFC(u8 a); -void sub_81C4190(); -void sub_81C42C8(); -u8 sub_81C45F4(void* a, u16* b); -void sub_81C4984(); -void sub_81C4A08(); -void sub_81C4A88(); -void sub_81C4280(); -void sub_81C43A0(); -void sub_81C4484(); -void sub_81C4420(); -void sub_81C0510(u8 taskId); -void sub_81C171C(u8 taskId); -void ResetAllBgsCoordinates(); -u8 sub_81B205C(struct Pokemon* a); -void sub_81C1DA4(u16 a, s16 b); -void sub_81C1EFC(u16 a, s16 b, u16 c); -void sub_81C240C(u16 a); -void sub_81C2194(u16 *a, u16 b, u8 c); -void sub_81C2074(u16 a, s16 b); -void sub_81C2524(); -void sub_81C2228(struct Pokemon* mon); -void sub_81C0484(u8 taskId); -void sub_81C4898(); -void sub_806F47C(u8 a); -u8 GetLRKeysState(); -void sub_81C0604(u8 taskId, s8 a); -void sub_81C0A8C(u8 taskId, s8 a); -void sub_81C48F0(); -void sub_81C0E48(u8 taskId); -void sub_81C0704(u8 taskId); -s8 sub_81C09B4(s8 a); -s8 sub_81C08F8(s8 a); -void sub_81C4204(u8 a, u8 b); -void sub_81C20F0(u8 taskId); -bool8 sub_81C0A50(struct Pokemon* mon); -void sub_81C49E0(); -void sub_81C0E24(); -void sub_81C2C38(u8 a); -void sub_81C0B8C(u8 taskId); -void sub_81C0CC4(u8 taskId); -void sub_81C2DE4(u8 a); -void sub_81C424C(); -void sub_81C0C68(u8 taskId); -void sub_81C0D44(u8 taskId); -void sub_81C22CC(struct Pokemon* mon); -void sub_81C0F44(u8 taskId); -void sub_81C3E9C(u16 a); -void sub_81C3F44(); -void sub_81C44F0(); -void sub_81C4AF8(u8 a); -void sub_81C1070(s16* a, s8 b, u8* c); -void sub_81C11F4(u8 a); -void sub_81C129C(u8 a); -bool8 sub_81C1040(); -void sub_81C4064(); -void sub_81C4C60(u8 a); -void sub_81C12E4(u8 taskId); -void sub_81C4C84(u8 a); -void sub_81C13B0(u8 a, u8 b); -void sub_81C14BC(struct Pokemon *mon, u8 a, u8 b); -void sub_81C15EC(struct BoxPokemon *mon, u8 a, u8 b); -void sub_81C40A0(u8 a, u8 b); -void sub_81C4568(u8 a, u8 b); -void sub_81C174C(u8 taskId); -bool8 sub_81C18A8(); -void sub_81C18F4(u8 a); -u8 sub_81B6D14(u16 a); -void sub_81C1940(u8 taskId); -void sub_81C4154(); -void sub_81C1F80(u8 taskId); -void sub_81C2628(); -void sub_81C2794(); -void sub_81C27DC(struct Pokemon *mon, u16 a); -void sub_81C2D68(u8 a); -void sub_81C335C(); -void sub_81C33CC(); -void sub_81C3428(); -void sub_81C349C(); -void sub_81C2EC4(); -void sub_81C2F5C(); -void sub_81C2FD8(); -void sub_81C302C(); -void sub_81C307C(); -void sub_81C3194(); -void sub_81C31C0(); -bool8 sub_81C3304(); -void sub_81C31F0(u8 *a); -u8 sub_81C3220(); -bool8 sub_81C32BC(); -void sub_81C35E4(); -void sub_81C3690(); -void sub_81C3710(); -void sub_81C37D8(); -void sub_81C3808(); -void sub_81C3890(); -void sub_81C38C0(); -void sub_81C3B08(u8 a); -void sub_81C3E2C(u8 a); -void sub_81C4D18(); - -void SetBgAttribute(u8 bg, u8 attributeId, u8 value); - -bool8 sub_81BFB10(); -u8 sub_81B1250(); - -union UnkUnion +static EWRAM_DATA struct UnkSummaryStruct { - struct Pokemon mon[6]; - struct BoxPokemon boxMon[6]; -}; - - -u8 sub_80D214C(union UnkUnion* a, u8 b, u8 c, u8 d); - -struct PokeSummary -{ - u16 species; // 0x0 - u16 species2; // 0x2 - u8 isEgg; // 0x4 - u8 level; // 0x5 - u8 ribbons; // 0x6 - u8 unk7; // 0x7 - u8 altAbility; // 0x8 - u8 metLocation; // 0x9 - u8 metLevel; // 0xA - u8 metGame; // 0xB - u32 pid; // 0xC - u32 exp; // 0x10 - u16 moves[4]; // 0x14 - u8 pp[4]; // 0x1C - u16 currentHP; // 0x20 - u16 maxHP; // 0x22 - u16 atk; // 0x24 - u16 def; // 0x26 - u16 spatk; // 0x28 - u16 spdef; // 0x2A - u16 speed; // 0x2C - u16 item; // 0x2E - u16 friendship; // 0x30 - u8 OTGender; // 0x32 - u8 nature; // 0x33 - u8 ppBonuses; // 0x34 - u8 sanity; // 0x35 - u8 OTName[8]; // 0x36 - u8 unk3E[9]; // 0x3E - u32 OTID; // 0x48 -}; - -struct UnkSummaryStruct -{ - /*0x00*/ union UnkUnion *unk0; - /*0x04*/ void *unk4; - /*0x08*/ void *unk8; + /*0x00*/ union + { + struct Pokemon *mons; + struct BoxPokemon *boxMons; + } monList; + /*0x04*/ void (*callback)(void); + /*0x08*/ struct Sprite *markingsSpriteId; /*0x0C*/ struct Pokemon currentMon; - /*0x70*/ struct PokeSummary summary; - u16 unkTilemap0[0x400]; - u16 unkTilemap0_1[0x400]; - u16 unkTilemap1[0x400]; - u16 unkTilemap1_1[0x400]; - u16 unkTilemap2[0x400]; - u16 unkTilemap2_1[0x400]; - u16 unkTilemap3[0x400]; - u16 unkTilemap3_1[0x400]; - u8 unk40BC; - u8 unk40BD; - u8 unk40BE; - u8 unk40BF; + /*0x70*/ struct PokeSummary + { + u16 species; // 0x0 + u16 species2; // 0x2 + u8 isEgg; // 0x4 + u8 level; // 0x5 + u8 ribbons; // 0x6 + u8 unk7; // 0x7 + u8 altAbility; // 0x8 + u8 metLocation; // 0x9 + u8 metLevel; // 0xA + u8 metGame; // 0xB + u32 pid; // 0xC + u32 exp; // 0x10 + u16 moves[4]; // 0x14 + u8 pp[4]; // 0x1C + u16 currentHP; // 0x20 + u16 maxHP; // 0x22 + u16 atk; // 0x24 + u16 def; // 0x26 + u16 spatk; // 0x28 + u16 spdef; // 0x2A + u16 speed; // 0x2C + u16 item; // 0x2E + u16 friendship; // 0x30 + u8 OTGender; // 0x32 + u8 nature; // 0x33 + u8 ppBonuses; // 0x34 + u8 sanity; // 0x35 + u8 OTName[8]; // 0x36 + u8 unk3E[9]; // 0x3E + u32 OTID; // 0x48 + } summary; + u16 bgTilemapBuffer1[0x800]; + u16 bgTilemapBuffer2[0x800]; + u16 bgTilemapBuffer3[0x800]; + u16 bgTilemapBuffer4[0x800]; + u8 mode; + bool8 isBoxMon; + u8 curMonIndex; + u8 maxMonIndex; u8 unk40C0; u8 unk40C1; u8 unk40C2; - u8 unk40C3; - u16 unk40C4; - u8 unk40C6; - u8 unk40C7; - u8 unk40C8; + bool8 unk40C3; + u16 newMove; + u8 firstMoveIndex; + u8 secondMoveIndex; + bool8 unk40C8; u8 unk40C9; - u8 unk40CA; - u8 unk40CB[8]; - u8 unk40D3[0x1C]; - u8 unk40EF; + u8 filler40CA; + u8 windowIds[8]; + u8 spriteIds[28]; + bool8 unk40EF; s16 unk40F0; u8 unk_filler4[6]; +} *gUnknown_0203CF1C = NULL; +EWRAM_DATA u8 gUnknown_0203CF20 = 0; +static EWRAM_DATA u8 gUnknown_0203CF21 = 0; +static EWRAM_DATA u8 gFiller_0203CF22[2] = {0}; +static EWRAM_DATA u8 sUnusedTaskId = 0; +static EWRAM_DATA u8 gFiller_0203CF25[3] = {0}; + +extern const struct CompressedSpriteSheet gMonFrontPicTable[]; + +struct UnkStruct_61CC04 +{ + const u16 *ptr; + u16 field_4; + u8 field_6; + u8 field_7; + u8 field_8; + u8 field_9; }; +// forward declarations +bool8 sub_81B1250(void); +bool8 sub_81BFB10(void); +void sub_81BFAE4(void); +void sub_81BFE24(void); +u8 sub_81BFEB0(void); +void sub_81C0098(struct Pokemon* a); +bool8 sub_81C00F0(struct Pokemon* a); +void sub_81C0348(void); +void sub_81C0484(u8 taskId); +void sub_81C0510(u8 taskId); +void sub_81C0604(u8 taskId, s8 a); +void sub_81C0704(u8 taskId); +s8 sub_81C08F8(s8 a); +s8 sub_81C09B4(s8 a); +bool8 sub_81C0A50(struct Pokemon* mon); +void sub_81C0A8C(u8 taskId, s8 a); +void sub_81C0B8C(u8 taskId); +void sub_81C0C68(u8 taskId); +void sub_81C0CC4(u8 taskId); +void sub_81C0D44(u8 taskId); +void sub_81C0E24(void); +void sub_81C0E48(u8 taskId); +void sub_81C0F44(u8 taskId); +bool8 sub_81C1040(void); +void sub_81C1070(s16* a, s8 b, u8* c); +void sub_81C11F4(u8 a); +void sub_81C129C(u8 a); +void sub_81C12E4(u8 taskId); +void sub_81C13B0(u8 a, u8 b); +void sub_81C14BC(struct Pokemon *mon, u8 a, u8 b); +void sub_81C15EC(struct BoxPokemon *mon, u8 a, u8 b); +void sub_81C171C(u8 taskId); +void sub_81C174C(u8 taskId); +bool8 sub_81C18A8(void); +void sub_81C18F4(u8 a); +void sub_81C1940(u8 taskId); +void sub_81C1BA0(void); +void sub_81C1DA4(u16 a, s16 b); +void sub_81C1E20(u8 taskId); +void sub_81C1EFC(u16 a, s16 b, u16 c); +void sub_81C1F80(u8 taskId); +void sub_81C2074(u16 a, s16 b); +void sub_81C20F0(u8 taskId); +void sub_81C2194(u16 *a, u16 b, u8 c); +void sub_81C2228(struct Pokemon* mon); +void sub_81C22CC(struct Pokemon* mon); +void sub_81C240C(u16 a); +void sub_81C2524(void); +void sub_81C2554(void); +void sub_81C25E8(void); +void sub_81C2628(void); +void sub_81C2794(void); +void sub_81C27DC(struct Pokemon *mon, u16 a); +void sub_81C286C(void); +void sub_81C2AFC(u8 a); +void sub_81C2C38(u8 a); +void sub_81C2D68(u8 a); +void sub_81C2D9C(u8 a); +void sub_81C2DE4(u8 a); +void sub_81C2E00(void); +void sub_81C2E40(u8 taskId); +void sub_81C2EC4(void); +void sub_81C2F5C(void); +void sub_81C2FD8(void); +void sub_81C302C(void); +void sub_81C307C(void); +void sub_81C3194(void); +void sub_81C31C0(void); +void sub_81C31F0(u8 *a); +u8 sub_81C3220(void); +bool8 sub_81C32BC(void); +bool8 sub_81C3304(void); +void sub_81C335C(void); +void sub_81C33CC(void); +void sub_81C3428(void); +void sub_81C349C(void); +void sub_81C3554(u8 taskId); +void sub_81C35E4(void); +void sub_81C3530(void); +void sub_81C3690(void); +void sub_81C3710(void); +void sub_81C37D8(void); +void sub_81C3808(void); +void sub_81C3890(void); +void sub_81C38C0(void); +void sub_81C3984(void); +void sub_81C39F0(u8 taskId); +void sub_81C3B08(u8 a); +void sub_81C3D08(void); +void sub_81C3D54(u8 taskId); +void sub_81C3E2C(u8 a); +void sub_81C3E9C(u16 a); +void sub_81C3F44(void); +void sub_81C4064(void); +void sub_81C40A0(u8 a, u8 b); +void sub_81C4154(void); +void sub_81C4190(void); +void sub_81C4204(u8 a, u8 b); +void sub_81C424C(void); +void sub_81C4280(void); +void sub_81C42C8(void); +void sub_81C43A0(void); +void sub_81C4420(void); +void sub_81C4484(void); +void sub_81C44F0(void); +void sub_81C4568(u8 a, u8 b); +u8 sub_81C45F4(struct Pokemon *a, s16 *b); +u8 sub_81C47B4(struct Pokemon *unused); +void sub_81C4844(struct Sprite *); +void sub_81C488C(u8 a); +void sub_81C4898(void); +void sub_81C48F0(void); +void sub_81C4984(struct Pokemon *mon); +void sub_81C49E0(struct Pokemon *mon); +void sub_81C4A08(struct Pokemon *mon); +void sub_81C4A88(void); +void sub_81C4AF8(u8 a); +void sub_81C4BE4(struct Sprite *sprite); +void sub_81C4C60(u8 a); +void sub_81C4C84(u8 a); +void sub_81C4D18(u8 a); + // const rom data #include "data/text/move_descriptions.h" +#include "data/text/nature_names.h" + +static const struct BgTemplate gUnknown_0861CBB4[] = +{ + { + .bg = 0, + .charBaseIndex = 0, + .mapBaseIndex = 31, + .screenSize = 0, + .paletteMode = 0, + .priority = 0, + .baseTile = 0, + }, + { + .bg = 1, + .charBaseIndex = 2, + .mapBaseIndex = 27, + .screenSize = 1, + .paletteMode = 0, + .priority = 1, + .baseTile = 0, + }, + { + .bg = 2, + .charBaseIndex = 2, + .mapBaseIndex = 25, + .screenSize = 1, + .paletteMode = 0, + .priority = 2, + .baseTile = 0, + }, + { + .bg = 3, + .charBaseIndex = 2, + .mapBaseIndex = 29, + .screenSize = 1, + .paletteMode = 0, + .priority = 3, + .baseTile = 0, + }, +}; + +static const u16 gUnknown_0861CBC4[] = INCBIN_U16("graphics/interface/unk_tilemap2.bin"); +static const struct UnkStruct_61CC04 gUnknown_0861CBEC = +{ + gUnknown_0861CBC4, 1, 10, 2, 0, 18 +}; +static const struct UnkStruct_61CC04 gUnknown_0861CBF8 = +{ + gUnknown_0861CBC4, 1, 10, 2, 0, 50 +}; +static const struct UnkStruct_61CC04 gUnknown_0861CC04 = +{ + gSummaryScreenPowAcc_Tilemap, 0, 10, 7, 0, 45 +}; +static const struct UnkStruct_61CC04 gUnknown_0861CC10 = +{ + gUnknown_08DC3C34, 0, 10, 7, 0, 45 +}; +static const s8 gUnknown_0861CC1C[] = {0, 2, 3, 1, 4, 5}; +static const struct WindowTemplate gUnknown_0861CC24[] = +{ + { 0x00, 0x00, 0x00, 0x0b, 0x02, 0x06, 0x0001 }, + { 0x00, 0x00, 0x00, 0x0b, 0x02, 0x06, 0x0017 }, + { 0x00, 0x00, 0x00, 0x0b, 0x02, 0x06, 0x002d }, + { 0x00, 0x00, 0x00, 0x0b, 0x02, 0x06, 0x0043 }, + { 0x00, 0x16, 0x00, 0x08, 0x02, 0x07, 0x0059 }, + { 0x00, 0x16, 0x00, 0x08, 0x02, 0x07, 0x0069 }, + { 0x00, 0x16, 0x00, 0x08, 0x02, 0x07, 0x0079 }, + { 0x00, 0x0b, 0x04, 0x00, 0x02, 0x06, 0x0089 }, + { 0x00, 0x0b, 0x04, 0x12, 0x02, 0x06, 0x0089 }, + { 0x00, 0x0b, 0x06, 0x12, 0x02, 0x06, 0x00ad }, + { 0x00, 0x0a, 0x07, 0x06, 0x06, 0x06, 0x00d1 }, + { 0x00, 0x16, 0x07, 0x05, 0x06, 0x06, 0x00f5 }, + { 0x00, 0x0a, 0x0e, 0x0b, 0x04, 0x06, 0x0113 }, + { 0x00, 0x00, 0x12, 0x06, 0x02, 0x06, 0x013f }, + { 0x00, 0x01, 0x0f, 0x09, 0x04, 0x06, 0x014b }, + { 0x00, 0x01, 0x0f, 0x05, 0x04, 0x06, 0x016f }, + { 0x00, 0x16, 0x04, 0x00, 0x02, 0x06, 0x0183 }, + { 0x00, 0x01, 0x02, 0x04, 0x02, 0x07, 0x0183 }, + { 0x00, 0x01, 0x0c, 0x09, 0x02, 0x06, 0x018b }, + { 0x00, 0x01, 0x0e, 0x09, 0x04, 0x06, 0x019d }, + DUMMY_WIN_TEMPLATE +}; +static const struct WindowTemplate gUnknown_0861CCCC[] = +{ + { 0x00, 0x0b, 0x04, 0x0b, 0x02, 0x06, 0x01c1 }, + { 0x00, 0x16, 0x04, 0x07, 0x02, 0x06, 0x01d7 }, + { 0x00, 0x0b, 0x09, 0x12, 0x04, 0x06, 0x01e5 }, + { 0x00, 0x0b, 0x0e, 0x12, 0x06, 0x06, 0x022d }, +}; +static const struct WindowTemplate gUnknown_0861CCEC[] = +{ + { 0x00, 0x0a, 0x04, 0x0a, 0x02, 0x06, 0x01c1 }, + { 0x00, 0x14, 0x04, 0x0a, 0x02, 0x06, 0x01d5 }, + { 0x00, 0x10, 0x07, 0x06, 0x06, 0x06, 0x01e9 }, + { 0x00, 0x1b, 0x07, 0x03, 0x06, 0x06, 0x020d }, + { 0x00, 0x18, 0x0e, 0x06, 0x04, 0x06, 0x021f }, +}; +static const struct WindowTemplate gUnknown_0861CD14[] = +{ + { 0x00, 0x0f, 0x04, 0x09, 0x0a, 0x06, 0x01c1 }, + { 0x00, 0x18, 0x04, 0x06, 0x0a, 0x08, 0x021b }, + { 0x00, 0x0a, 0x0f, 0x14, 0x04, 0x06, 0x0257 }, +}; +static const u8 sTextColors_861CD2C[][3] = +{ + {0, 1, 2}, + {0, 3, 4}, + {0, 5, 6}, + {0, 7, 8}, + {0, 9, 10}, + {0, 11, 12}, + {0, 13, 14}, + {0, 7, 8}, + {13, 15, 14}, + {0, 1, 2}, + {0, 3, 4}, + {0, 5, 6}, + {0, 7, 8} +}; +static const u8 gUnknown_0861CD53[] = INCBIN_U8("graphics/interface/summary_a_button.4bpp"); +static const u8 gUnknown_0861CDD3[] = INCBIN_U8("graphics/interface/summary_b_button.4bpp"); +static void (*const gUnknown_0861CE54[])(void) = +{ + sub_81C2E00, + sub_81C3530, + sub_81C3984, + sub_81C3D08 +}; +static void (*const gUnknown_0861CE64[])(u8 taskId) = +{ + sub_81C2E40, + sub_81C3554, + sub_81C39F0, + sub_81C3D54 +}; +static const u8 gUnknown_0861CE74[] = _("{COLOR LIGHT_RED}{SHADOW GREEN}"); +static const u8 gUnknown_0861CE7B[] = _("{COLOR WHITE}{SHADOW DARK_GREY}"); +static const u8 gUnknown_0861CE82[] = _("{SPECIAL_F7 0x00}/{SPECIAL_F7 0x01}\n{SPECIAL_F7 0x02}\n{SPECIAL_F7 0x03}"); +static const u8 gUnknown_0861CE8E[] = _("{SPECIAL_F7 0x00}\n{SPECIAL_F7 0x01}\n{SPECIAL_F7 0x02}"); +static const u8 gUnknown_0861CE97[] = _("{PP}{SPECIAL_F7 0x00}/{SPECIAL_F7 0x01}"); +static const struct OamData gOamData_861CEA0 = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 1, + .x = 0, + .matrixNum = 0, + .size = 2, + .tileNum = 0, + .priority = 1, + .paletteNum = 0, + .affineParam = 0, +}; +static const union AnimCmd gSpriteAnim_861CEA8[] = { + ANIMCMD_FRAME(0, 0, FALSE, FALSE), + ANIMCMD_END +}; +static const union AnimCmd gSpriteAnim_861CEB0[] = { + ANIMCMD_FRAME(8, 0, FALSE, FALSE), + ANIMCMD_END +}; +static const union AnimCmd gSpriteAnim_861CEB8[] = { + ANIMCMD_FRAME(16, 0, FALSE, FALSE), + ANIMCMD_END +}; +static const union AnimCmd gSpriteAnim_861CEC0[] = { + ANIMCMD_FRAME(24, 0, FALSE, FALSE), + ANIMCMD_END +}; +static const union AnimCmd gSpriteAnim_861CEC8[] = { + ANIMCMD_FRAME(32, 0, FALSE, FALSE), + ANIMCMD_END +}; +static const union AnimCmd gSpriteAnim_861CED0[] = { + ANIMCMD_FRAME(40, 0, FALSE, FALSE), + ANIMCMD_END +}; +static const union AnimCmd gSpriteAnim_861CED8[] = { + ANIMCMD_FRAME(48, 0, FALSE, FALSE), + ANIMCMD_END +}; +static const union AnimCmd gSpriteAnim_861CEE0[] = { + ANIMCMD_FRAME(56, 0, FALSE, FALSE), + ANIMCMD_END +}; +static const union AnimCmd gSpriteAnim_861CEE8[] = { + ANIMCMD_FRAME(64, 0, FALSE, FALSE), + ANIMCMD_END +}; +static const union AnimCmd gSpriteAnim_861CEF0[] = { + ANIMCMD_FRAME(72, 0, FALSE, FALSE), + ANIMCMD_END +}; +static const union AnimCmd gSpriteAnim_861CEF8[] = { + ANIMCMD_FRAME(80, 0, FALSE, FALSE), + ANIMCMD_END +}; +static const union AnimCmd gSpriteAnim_861CF00[] = { + ANIMCMD_FRAME(88, 0, FALSE, FALSE), + ANIMCMD_END +}; +static const union AnimCmd gSpriteAnim_861CF08[] = { + ANIMCMD_FRAME(96, 0, FALSE, FALSE), + ANIMCMD_END +}; +static const union AnimCmd gSpriteAnim_861CF10[] = { + ANIMCMD_FRAME(104, 0, FALSE, FALSE), + ANIMCMD_END +}; +static const union AnimCmd gSpriteAnim_861CF18[] = { + ANIMCMD_FRAME(112, 0, FALSE, FALSE), + ANIMCMD_END +}; +static const union AnimCmd gSpriteAnim_861CF20[] = { + ANIMCMD_FRAME(120, 0, FALSE, FALSE), + ANIMCMD_END +}; +static const union AnimCmd gSpriteAnim_861CF28[] = { + ANIMCMD_FRAME(128, 0, FALSE, FALSE), + ANIMCMD_END +}; +static const union AnimCmd gSpriteAnim_861CF30[] = { + ANIMCMD_FRAME(136, 0, FALSE, FALSE), + ANIMCMD_END +}; +static const union AnimCmd gSpriteAnim_861CF38[] = { + ANIMCMD_FRAME(144, 0, FALSE, FALSE), + ANIMCMD_END +}; +static const union AnimCmd gSpriteAnim_861CF40[] = { + ANIMCMD_FRAME(152, 0, FALSE, FALSE), + ANIMCMD_END +}; +static const union AnimCmd gSpriteAnim_861CF48[] = { + ANIMCMD_FRAME(160, 0, FALSE, FALSE), + ANIMCMD_END +}; +static const union AnimCmd gSpriteAnim_861CF50[] = { + ANIMCMD_FRAME(168, 0, FALSE, FALSE), + ANIMCMD_END +}; +static const union AnimCmd gSpriteAnim_861CF58[] = { + ANIMCMD_FRAME(176, 0, FALSE, FALSE), + ANIMCMD_END +}; +static const union AnimCmd *const gSpriteAnimTable_861CF60[] = { + gSpriteAnim_861CEA8, + gSpriteAnim_861CEB0, + gSpriteAnim_861CEB8, + gSpriteAnim_861CEC0, + gSpriteAnim_861CEC8, + gSpriteAnim_861CED0, + gSpriteAnim_861CED8, + gSpriteAnim_861CEE0, + gSpriteAnim_861CEE8, + gSpriteAnim_861CEF0, + gSpriteAnim_861CEF8, + gSpriteAnim_861CF00, + gSpriteAnim_861CF08, + gSpriteAnim_861CF10, + gSpriteAnim_861CF18, + gSpriteAnim_861CF20, + gSpriteAnim_861CF28, + gSpriteAnim_861CF30, + gSpriteAnim_861CF38, + gSpriteAnim_861CF40, + gSpriteAnim_861CF48, + gSpriteAnim_861CF50, + gSpriteAnim_861CF58, +}; +static const struct CompressedSpriteSheet gUnknown_0861CFBC = +{ + .data = gMoveTypes_Gfx, + .size = 0x1700, + .tag = 30002 +}; +static const struct SpriteTemplate gUnknown_0861CFC4 = +{ + .tileTag = 30002, + .paletteTag = 30002, + .oam = &gOamData_861CEA0, + .anims = gSpriteAnimTable_861CF60, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy +}; +static const u8 gUnknown_0861CFDC[] = {13, 13, 14, 14, 13, 13, 15, 14, 13, 15, 13, 14, 15, 13, 14, 14, 15, 13, 13, 14, 14, 15, 13}; +static const struct OamData gOamData_861CFF4 = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 0, + .x = 0, + .matrixNum = 0, + .size = 1, + .tileNum = 0, + .priority = 1, + .paletteNum = 0, + .affineParam = 0, +}; +static const union AnimCmd gSpriteAnim_861CFFC[] = { + ANIMCMD_FRAME(0, 0, FALSE, FALSE), + ANIMCMD_END +}; +static const union AnimCmd gSpriteAnim_861D004[] = { + ANIMCMD_FRAME(4, 0, FALSE, FALSE), + ANIMCMD_END +}; +static const union AnimCmd gSpriteAnim_861D00C[] = { + ANIMCMD_FRAME(8, 0, FALSE, FALSE), + ANIMCMD_END +}; +static const union AnimCmd gSpriteAnim_861D014[] = { + ANIMCMD_FRAME(12, 0, FALSE, FALSE), + ANIMCMD_END +}; +static const union AnimCmd gSpriteAnim_861D01C[] = { + ANIMCMD_FRAME(16, 0, FALSE, FALSE), + ANIMCMD_END +}; +static const union AnimCmd gSpriteAnim_861D024[] = { + ANIMCMD_FRAME(16, 0, TRUE, FALSE), + ANIMCMD_END +}; +static const union AnimCmd gSpriteAnim_861D02C[] = { + ANIMCMD_FRAME(20, 0, FALSE, FALSE), + ANIMCMD_END +}; +static const union AnimCmd gSpriteAnim_861D034[] = { + ANIMCMD_FRAME(24, 0, FALSE, FALSE), + ANIMCMD_END +}; +static const union AnimCmd gSpriteAnim_861D03C[] = { + ANIMCMD_FRAME(24, 0, TRUE, FALSE), + ANIMCMD_END +}; +static const union AnimCmd gSpriteAnim_861D044[] = { + ANIMCMD_FRAME(28, 0, FALSE, FALSE), + ANIMCMD_END +}; +static const union AnimCmd *const gSpriteAnimTable_861D04C[] = { + gSpriteAnim_861CFFC, + gSpriteAnim_861D004, + gSpriteAnim_861D00C, + gSpriteAnim_861D014, + gSpriteAnim_861D01C, + gSpriteAnim_861D024, + gSpriteAnim_861D02C, + gSpriteAnim_861D034, + gSpriteAnim_861D03C, + gSpriteAnim_861D044, +}; +static const struct CompressedSpriteSheet gUnknown_0861D074 = +{ + .data = gUnknown_08D97BEC, + .size = 0x400, + .tag = 30000 +}; +static const struct CompressedSpritePalette gUnknown_0861D07C = +{ + .data = gUnknown_08D97CF4, + .tag = 30000 +}; +static const struct SpriteTemplate gUnknown_0861D084 = +{ + .tileTag = 30000, + .paletteTag = 30000, + .oam = &gOamData_861CFF4, + .anims = gSpriteAnimTable_861D04C, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy +}; + const struct OamData gOamData_861D09C = +{ + .y = 0, + .affineMode = 0, + .objMode = 0, + .mosaic = 0, + .bpp = 0, + .shape = 1, + .x = 0, + .matrixNum = 0, + .size = 1, + .tileNum = 0, + .priority = 3, + .paletteNum = 0, + .affineParam = 0, +}; +static const union AnimCmd gSpriteAnim_861D0A4[] = { + ANIMCMD_FRAME(0, 0, FALSE, FALSE), + ANIMCMD_END +}; +static const union AnimCmd gSpriteAnim_861D0AC[] = { + ANIMCMD_FRAME(4, 0, FALSE, FALSE), + ANIMCMD_END +}; +static const union AnimCmd gSpriteAnim_861D0B4[] = { + ANIMCMD_FRAME(8, 0, FALSE, FALSE), + ANIMCMD_END +}; +static const union AnimCmd gSpriteAnim_861D0BC[] = { + ANIMCMD_FRAME(12, 0, FALSE, FALSE), + ANIMCMD_END +}; +static const union AnimCmd gSpriteAnim_861D0C4[] = { + ANIMCMD_FRAME(16, 0, FALSE, FALSE), + ANIMCMD_END +}; +static const union AnimCmd gSpriteAnim_861D0CC[] = { + ANIMCMD_FRAME(20, 0, FALSE, FALSE), + ANIMCMD_END +}; +static const union AnimCmd gSpriteAnim_861D0D4[] = { + ANIMCMD_FRAME(24, 0, FALSE, FALSE), + ANIMCMD_END +}; + const union AnimCmd *const gSpriteAnimTable_861D0DC[] = { + gSpriteAnim_861D0A4, + gSpriteAnim_861D0AC, + gSpriteAnim_861D0B4, + gSpriteAnim_861D0BC, + gSpriteAnim_861D0C4, + gSpriteAnim_861D0CC, + gSpriteAnim_861D0D4, +}; +static const struct CompressedSpriteSheet gUnknown_0861D0F8 = +{ + .data = gStatusGfx_Icons, + .size = 0x380, + .tag = 30001 +}; +static const struct CompressedSpritePalette gUnknown_0861D100 = +{ + .data = gStatusPal_Icons, + .tag = 30001 +}; +static const struct SpriteTemplate gUnknown_0861D108 = +{ + .tileTag = 30001, + .paletteTag = 30001, + .oam = &gOamData_861D09C, + .anims = gSpriteAnimTable_861D0DC, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy +}; +static const u16 gUnknown_0861D120[] = INCBIN_U16("graphics/interface/summary_markings.gbapal"); // code -void sub_81BF8EC(u8 a, void *b, u8 c, u8 d, void *e) +void sub_81BF8EC(u8 mode, void *mons, u8 monIndex, u8 maxMonIndex, void (*callback)(void)) { - u8 byte; - gUnknown_0203CF1C = AllocZeroed(sizeof(struct UnkSummaryStruct)); - gUnknown_0203CF1C->unk40BC = a; - gUnknown_0203CF1C->unk0 = b; - gUnknown_0203CF1C->unk40BE = c; - gUnknown_0203CF1C->unk40BF = d; - gUnknown_0203CF1C->unk4 = e; - if (a == 2) - gUnknown_0203CF1C->unk40BD = 1; + gUnknown_0203CF1C = AllocZeroed(sizeof(*gUnknown_0203CF1C)); + gUnknown_0203CF1C->mode = mode; + gUnknown_0203CF1C->monList.mons = mons; + gUnknown_0203CF1C->curMonIndex = monIndex; + gUnknown_0203CF1C->maxMonIndex = maxMonIndex; + gUnknown_0203CF1C->callback = callback; + + if (mode == 2) + gUnknown_0203CF1C->isBoxMon = TRUE; else - gUnknown_0203CF1C->unk40BD = 0; - switch (a) + gUnknown_0203CF1C->isBoxMon = FALSE; + + switch (mode) { case 0: case 2: @@ -368,32 +735,34 @@ void sub_81BF8EC(u8 a, void *b, u8 c, u8 d, void *e) case 1: gUnknown_0203CF1C->unk40C1 = 0; gUnknown_0203CF1C->unk40C2 = 3; - gUnknown_0203CF1C->unk40C8 = 1; + gUnknown_0203CF1C->unk40C8 = TRUE; break; case 3: gUnknown_0203CF1C->unk40C1 = 2; gUnknown_0203CF1C->unk40C2 = 3; - gUnknown_0203CF1C->unk40C3 = 1; + gUnknown_0203CF1C->unk40C3 = TRUE; break; } - byte = gUnknown_0203CF1C->unk40C1; - gUnknown_0203CF1C->unk40C0 = byte; - sub_81C488C(0xFF); + + gUnknown_0203CF1C->unk40C0 = gUnknown_0203CF1C->unk40C1; + sub_81C488C(-1); + if (gMonSpritesGfxPtr == 0) sub_806F2AC(0, 0); + SetMainCallback2(sub_81BFAE4); } -void ShowSelectMovePokemonSummaryScreen(void *a, u8 b, u8 c, void *d, u16 e) +void ShowSelectMovePokemonSummaryScreen(struct Pokemon *mons, u8 monIndex, u8 maxMonIndex, void (*callback)(void), u16 newMove) { - sub_81BF8EC(3, a, b, c, d); - gUnknown_0203CF1C->unk40C4 = e; + sub_81BF8EC(3, mons, monIndex, maxMonIndex, callback); + gUnknown_0203CF1C->newMove = newMove; } -void sub_81BFA80(u8 a, void *b, u8 c, u8 d, void *e) +void sub_81BFA80(u8 a, struct BoxPokemon *mons, u8 monIndex, u8 maxMonIndex, void (*callback)(void)) { - sub_81BF8EC(a, b, c, d, e); - gUnknown_0203CF1C->unk40EF = 1; + sub_81BF8EC(a, mons, monIndex, maxMonIndex, callback); + gUnknown_0203CF1C->unk40EF = TRUE; } void sub_81BFAB4(void) @@ -412,13 +781,9 @@ void sub_81BFAD0(void) TransferPlttBuffer(); } -void sub_81BFAE4() +void sub_81BFAE4(void) { - while (1) - { - if (sub_81221EC() == 1 || sub_81BFB10() == TRUE || sub_81221AC() == 1) - break; - } + while (sub_81221EC() != TRUE && sub_81BFB10() != TRUE && sub_81221AC() != TRUE); } bool8 sub_81BFB10(void) @@ -454,7 +819,7 @@ bool8 sub_81BFB10(void) gMain.state++; break; case 6: - if (sub_81BFEB0() != 0) + if (sub_81BFEB0() != FALSE) gMain.state++; break; case 7: @@ -501,8 +866,8 @@ bool8 sub_81BFB10(void) gMain.state++; break; case 17: - gUnknown_0203CF1C->unk40D3[0] = sub_81C45F4(&gUnknown_0203CF1C->currentMon, &gUnknown_0203CF1C->unk40F0); - if (gUnknown_0203CF1C->unk40D3[0] != 0xFF) + gUnknown_0203CF1C->spriteIds[0] = sub_81C45F4(&gUnknown_0203CF1C->currentMon, &gUnknown_0203CF1C->unk40F0); + if (gUnknown_0203CF1C->spriteIds[0] != 0xFF) { gUnknown_0203CF1C->unk40F0 = 0; gMain.state++; @@ -525,7 +890,7 @@ bool8 sub_81BFB10(void) gMain.state++; break; case 22: - if (gUnknown_0203CF1C->unk40BC != 3) + if (gUnknown_0203CF1C->mode != 3) CreateTask(sub_81C0510, 0); else CreateTask(sub_81C171C, 0); @@ -548,13 +913,13 @@ bool8 sub_81BFB10(void) return FALSE; } -void sub_81BFE24() +void sub_81BFE24(void) { ResetBgsAndClearDma3BusyFlags(0); - InitBgsFromTemplates(0, &gUnknown_0861CBB4, 4); - SetBgTilemapBuffer(1, &gUnknown_0203CF1C->unkTilemap2); - SetBgTilemapBuffer(2, &gUnknown_0203CF1C->unkTilemap1); - SetBgTilemapBuffer(3, &gUnknown_0203CF1C->unkTilemap0); + InitBgsFromTemplates(0, gUnknown_0861CBB4, ARRAY_COUNT(gUnknown_0861CBB4)); + SetBgTilemapBuffer(1, &gUnknown_0203CF1C->bgTilemapBuffer3); + SetBgTilemapBuffer(2, &gUnknown_0203CF1C->bgTilemapBuffer2); + SetBgTilemapBuffer(3, &gUnknown_0203CF1C->bgTilemapBuffer1); ResetAllBgsCoordinates(); schedule_bg_copy_tilemap_to_vram(1); schedule_bg_copy_tilemap_to_vram(2); @@ -567,7 +932,7 @@ void sub_81BFE24() ShowBg(3); } -u8 sub_81BFEB0() +bool8 sub_81BFEB0(void) { switch (gUnknown_0203CF1C->unk40F0) { @@ -579,24 +944,24 @@ u8 sub_81BFEB0() case 1: if (free_temp_tile_data_buffers_if_possible() != 1) { - LZDecompressWram(&gUnknown_08D9862C, gUnknown_0203CF1C->unkTilemap0); + LZDecompressWram(&gUnknown_08D9862C, &gUnknown_0203CF1C->bgTilemapBuffer1[0]); gUnknown_0203CF1C->unk40F0++; } break; case 2: - LZDecompressWram(&gUnknown_08D98CC8, gUnknown_0203CF1C->unkTilemap0_1); + LZDecompressWram(&gUnknown_08D98CC8, &gUnknown_0203CF1C->bgTilemapBuffer1[0x400]); gUnknown_0203CF1C->unk40F0++; break; case 3: - LZDecompressWram(&gUnknown_08D987FC, gUnknown_0203CF1C->unkTilemap1_1); + LZDecompressWram(&gUnknown_08D987FC, &gUnknown_0203CF1C->bgTilemapBuffer2[0x400]); gUnknown_0203CF1C->unk40F0++; break; case 4: - LZDecompressWram(&gUnknown_08D9898C, gUnknown_0203CF1C->unkTilemap2_1); + LZDecompressWram(&gUnknown_08D9898C, &gUnknown_0203CF1C->bgTilemapBuffer3[0x400]); gUnknown_0203CF1C->unk40F0++; break; case 5: - LZDecompressWram(&gUnknown_08D98B28, gUnknown_0203CF1C->unkTilemap3_1); + LZDecompressWram(&gUnknown_08D98B28, &gUnknown_0203CF1C->bgTilemapBuffer4[0x400]); gUnknown_0203CF1C->unk40F0++; break; case 6: @@ -627,22 +992,22 @@ u8 sub_81BFEB0() case 12: LoadCompressedPalette(&gMoveTypes_Pal, 0x1D0, 0x60); gUnknown_0203CF1C->unk40F0 = 0; - return 1; + return TRUE; } - return 0; + return FALSE; } void sub_81C0098(struct Pokemon *mon) { - if (gUnknown_0203CF1C->unk40BD == 0) + if (!gUnknown_0203CF1C->isBoxMon) { - struct Pokemon *partyMon = gUnknown_0203CF1C->unk0->mon; - *mon = partyMon[gUnknown_0203CF1C->unk40BE]; + struct Pokemon *partyMon = gUnknown_0203CF1C->monList.mons; + *mon = partyMon[gUnknown_0203CF1C->curMonIndex]; } else { - struct BoxPokemon *boxMon = gUnknown_0203CF1C->unk0->boxMon; - BoxMonToMon(&boxMon[gUnknown_0203CF1C->unk40BE], mon); + struct BoxPokemon *boxMon = gUnknown_0203CF1C->monList.boxMons; + BoxMonToMon(&boxMon[gUnknown_0203CF1C->curMonIndex], mon); } } @@ -675,7 +1040,7 @@ bool8 sub_81C00F0(struct Pokemon *a) sum->ppBonuses = GetMonData(a, MON_DATA_PP_BONUSES); break; case 2: - if ((struct Pokemon*)gUnknown_0203CF1C->unk0 == gPlayerParty || gUnknown_0203CF1C->unk40BC == 2 || gUnknown_0203CF1C->unk40EF == 1) + if (gUnknown_0203CF1C->monList.mons == gPlayerParty || gUnknown_0203CF1C->mode == 2 || gUnknown_0203CF1C->unk40EF == TRUE) { sum->nature = GetNature(a); sum->currentHP = GetMonData(a, MON_DATA_HP); @@ -726,14 +1091,14 @@ void sub_81C0348(void) } else { - sub_81C240C(gUnknown_0203CF1C->summary.moves[gUnknown_0203CF1C->unk40C6]); - sub_81C2194(&gUnknown_0203CF1C->unkTilemap2[0], 3, 0); - sub_81C2194(&gUnknown_0203CF1C->unkTilemap3[0], 1, 0); - SetBgTilemapBuffer(1, &gUnknown_0203CF1C->unkTilemap3); - SetBgTilemapBuffer(2, &gUnknown_0203CF1C->unkTilemap2); + sub_81C240C(gUnknown_0203CF1C->summary.moves[gUnknown_0203CF1C->firstMoveIndex]); + sub_81C2194(&gUnknown_0203CF1C->bgTilemapBuffer3[0], 3, 0); + sub_81C2194(&gUnknown_0203CF1C->bgTilemapBuffer4[0], 1, 0); + SetBgTilemapBuffer(1, &gUnknown_0203CF1C->bgTilemapBuffer4); + SetBgTilemapBuffer(2, &gUnknown_0203CF1C->bgTilemapBuffer3); ChangeBgX(2, 0x10000, 1); - ClearWindowTilemap(0x13); - ClearWindowTilemap(0xD); + ClearWindowTilemap(19); + ClearWindowTilemap(13); } if (gUnknown_0203CF1C->summary.unk7 == 0) { @@ -742,13 +1107,13 @@ void sub_81C0348(void) else { if (gUnknown_0203CF1C->unk40C0 != 2 && gUnknown_0203CF1C->unk40C0 != 3) - PutWindowTilemap(0xD); + PutWindowTilemap(13); } sub_81C2524(); sub_81C2228(&gUnknown_0203CF1C->currentMon); } -void sub_81C0434() +void sub_81C0434(void) { FreeAllWindowBuffers(); Free(gUnknown_0203CF1C); @@ -764,8 +1129,8 @@ void sub_81C0484(u8 taskId) { if (sub_81221EC() != 1 && !gPaletteFade.active) { - SetMainCallback2(gUnknown_0203CF1C->unk4); - gUnknown_0203CF20 = gUnknown_0203CF1C->unk40BE; + SetMainCallback2(gUnknown_0203CF1C->callback); + gUnknown_0203CF20 = gUnknown_0203CF1C->curMonIndex; sub_81C4898(); ResetSpriteData(); FreeAllSpritePalettes(); @@ -828,9 +1193,9 @@ void sub_81C0604(u8 taskId, s8 a) { s8 r4_2; - if (gUnknown_0203CF1C->unk40C3 == 0) + if (!gUnknown_0203CF1C->unk40C3) { - if (gUnknown_0203CF1C->unk40BD == 1) + if (gUnknown_0203CF1C->isBoxMon == TRUE) { if (gUnknown_0203CF1C->unk40C0 != 0) { @@ -846,7 +1211,7 @@ void sub_81C0604(u8 taskId, s8 a) else a = 3; } - r4_2 = sub_80D214C(gUnknown_0203CF1C->unk0, gUnknown_0203CF1C->unk40BE, gUnknown_0203CF1C->unk40BF, a); + r4_2 = sub_80D214C(gUnknown_0203CF1C->monList.boxMons, gUnknown_0203CF1C->curMonIndex, gUnknown_0203CF1C->maxMonIndex, a); } else if (sub_81B1250() == 1) { @@ -867,7 +1232,7 @@ void sub_81C0604(u8 taskId, s8 a) schedule_bg_copy_tilemap_to_vram(0); sub_81C2074(0, 2); } - gUnknown_0203CF1C->unk40BE = r4_2; + gUnknown_0203CF1C->curMonIndex = r4_2; gTasks[taskId].data[0] = 0; gTasks[taskId].func = sub_81C0704; } @@ -885,10 +1250,10 @@ void sub_81C0704(u8 taskId) break; case 1: sub_81C4898(); - DestroySpriteAndFreeResources(&gSprites[gUnknown_0203CF1C->unk40D3[0]]); + DestroySpriteAndFreeResources(&gSprites[gUnknown_0203CF1C->spriteIds[0]]); break; case 2: - DestroySpriteAndFreeResources(&gSprites[gUnknown_0203CF1C->unk40D3[1]]); + DestroySpriteAndFreeResources(&gSprites[gUnknown_0203CF1C->spriteIds[1]]); break; case 3: sub_81C0098(&gUnknown_0203CF1C->currentMon); @@ -911,10 +1276,10 @@ void sub_81C0704(u8 taskId) data[1] = 0; break; case 8: - gUnknown_0203CF1C->unk40D3[0] = sub_81C45F4(&gUnknown_0203CF1C->currentMon, &data[1]); - if (gUnknown_0203CF1C->unk40D3[0] == 0xFF) + gUnknown_0203CF1C->spriteIds[0] = sub_81C45F4(&gUnknown_0203CF1C->currentMon, &data[1]); + if (gUnknown_0203CF1C->spriteIds[0] == 0xFF) return; - gSprites[gUnknown_0203CF1C->unk40D3[0]].data[2] = 1; + gSprites[gUnknown_0203CF1C->spriteIds[0]].data[2] = 1; sub_81C0E24(); data[1] = 0; break; @@ -929,7 +1294,7 @@ void sub_81C0704(u8 taskId) sub_81C2524(); break; case 12: - gSprites[gUnknown_0203CF1C->unk40D3[0]].data[2] = 0; + gSprites[gUnknown_0203CF1C->spriteIds[0]].data[2] = 0; break; default: if (sub_81221EC() == 0 && FuncIsActiveTask(sub_81C20F0) == 0) @@ -944,24 +1309,24 @@ void sub_81C0704(u8 taskId) s8 sub_81C08F8(s8 a) { - struct Pokemon *mon = gUnknown_0203CF1C->unk0->mon; + struct Pokemon *mon = gUnknown_0203CF1C->monList.mons; if (gUnknown_0203CF1C->unk40C0 == 0) { - if (a == -1 && gUnknown_0203CF1C->unk40BE == 0) + if (a == -1 && gUnknown_0203CF1C->curMonIndex == 0) return -1; - if (a == 1 && gUnknown_0203CF1C->unk40BE >= gUnknown_0203CF1C->unk40BF) + if (a == 1 && gUnknown_0203CF1C->curMonIndex >= gUnknown_0203CF1C->maxMonIndex) return -1; - return gUnknown_0203CF1C->unk40BE + a; + return gUnknown_0203CF1C->curMonIndex + a; } else { - s8 index = gUnknown_0203CF1C->unk40BE; + s8 index = gUnknown_0203CF1C->curMonIndex; do { index += a; - if (index < 0 || index > gUnknown_0203CF1C->unk40BF) + if (index < 0 || index > gUnknown_0203CF1C->maxMonIndex) return -1; } while (GetMonData(&mon[index], MON_DATA_IS_EGG) != 0); return index; @@ -970,23 +1335,23 @@ s8 sub_81C08F8(s8 a) s8 sub_81C09B4(s8 a) { - struct Pokemon *mon = gUnknown_0203CF1C->unk0->mon; + struct Pokemon *mon = gUnknown_0203CF1C->monList.mons; s8 r5 = 0; u8 i; for (i = 0; i < 6; i++) { - if (gUnknown_0861CC1C[i] == gUnknown_0203CF1C->unk40BE) + if (gUnknown_0861CC1C[i] == gUnknown_0203CF1C->curMonIndex) { r5 = i; break; } } - while (1) + while (TRUE) { int b; - s8* c = &gUnknown_0861CC1C[0]; + const s8* c = gUnknown_0861CC1C; r5 += a; if (r5 < 0 || r5 >= 6) @@ -1001,7 +1366,7 @@ bool8 sub_81C0A50(struct Pokemon* mon) { if (GetMonData(mon, MON_DATA_SPECIES) == 0) return FALSE; - else if (gUnknown_0203CF1C->unk40BE != 0 || GetMonData(mon, MON_DATA_IS_EGG) == 0) + else if (gUnknown_0203CF1C->curMonIndex != 0 || GetMonData(mon, MON_DATA_IS_EGG) == 0) return TRUE; else return FALSE; @@ -1014,10 +1379,11 @@ void sub_81C0A8C(u8 taskId, s8 b) if (summary->isEgg) return; - if (b == -1 && gUnknown_0203CF1C->unk40C0 == gUnknown_0203CF1C->unk40C1) + else if (b == -1 && gUnknown_0203CF1C->unk40C0 == gUnknown_0203CF1C->unk40C1) return; - if (b == 1 && gUnknown_0203CF1C->unk40C0 == gUnknown_0203CF1C->unk40C2) + else if (b == 1 && gUnknown_0203CF1C->unk40C0 == gUnknown_0203CF1C->unk40C2) return; + PlaySE(SE_SELECT); sub_81C2C38(gUnknown_0203CF1C->unk40C0); gUnknown_0203CF1C->unk40C0 += b; @@ -1122,7 +1488,7 @@ void sub_81C0D44(u8 taskId) SwitchTaskToFollowupFunc(taskId); } -void sub_81C0E24() +void sub_81C0E24(void) { if (gUnknown_0203CF1C->unk40C0 == 1) sub_81C22CC(&gUnknown_0203CF1C->currentMon); @@ -1131,20 +1497,20 @@ void sub_81C0E24() void sub_81C0E48(u8 taskId) { u16 move; - gUnknown_0203CF1C->unk40C6 = 0; - move = gUnknown_0203CF1C->summary.moves[gUnknown_0203CF1C->unk40C6]; + gUnknown_0203CF1C->firstMoveIndex = 0; + move = gUnknown_0203CF1C->summary.moves[gUnknown_0203CF1C->firstMoveIndex]; ClearWindowTilemap(0x13); - if (gSprites[gUnknown_0203CF1C->unk40D3[2]].invisible == 0) + if (gSprites[gUnknown_0203CF1C->spriteIds[2]].invisible == 0) ClearWindowTilemap(0xD); sub_81C1DA4(9, -3); sub_81C1EFC(9, -3, move); - if (gUnknown_0203CF1C->unk40C8 == 0) + if (!gUnknown_0203CF1C->unk40C8) { ClearWindowTilemap(5); PutWindowTilemap(6); } - sub_81C2194(&gUnknown_0203CF1C->unkTilemap2[0], 3, 0); - sub_81C2194(&gUnknown_0203CF1C->unkTilemap3[0], 1, 0); + sub_81C2194(&gUnknown_0203CF1C->bgTilemapBuffer3[0], 3, 0); + sub_81C2194(&gUnknown_0203CF1C->bgTilemapBuffer4[0], 1, 0); sub_81C3E9C(move); sub_81C3F44(); sub_81C44F0(); @@ -1165,17 +1531,17 @@ void sub_81C0F44(u8 taskId) if (gMain.newKeys & DPAD_UP) { data[0] = 4; - sub_81C1070(data, -1, &gUnknown_0203CF1C->unk40C6); + sub_81C1070(data, -1, &gUnknown_0203CF1C->firstMoveIndex); } else if (gMain.newKeys & DPAD_DOWN) { data[0] = 4; - sub_81C1070(data, 1, &gUnknown_0203CF1C->unk40C6); + sub_81C1070(data, 1, &gUnknown_0203CF1C->firstMoveIndex); } else if (gMain.newKeys & A_BUTTON) { - if (gUnknown_0203CF1C->unk40C8 == 1 - || (gUnknown_0203CF1C->unk40C4 == 0 && gUnknown_0203CF1C->unk40C6 == 4)) + if (gUnknown_0203CF1C->unk40C8 == TRUE + || (gUnknown_0203CF1C->newMove == MOVE_NONE && gUnknown_0203CF1C->firstMoveIndex == MAX_MON_MOVES)) { PlaySE(SE_SELECT); sub_81C11F4(taskId); @@ -1226,7 +1592,7 @@ void sub_81C1070(s16 *a, s8 b, u8 *c) moveIndex = a[0]; if (moveIndex == 4) { - move = gUnknown_0203CF1C->unk40C4; + move = gUnknown_0203CF1C->newMove; break; } move = gUnknown_0203CF1C->summary.moves[moveIndex]; @@ -1237,16 +1603,16 @@ void sub_81C1070(s16 *a, s8 b, u8 *c) schedule_bg_copy_tilemap_to_vram(1); schedule_bg_copy_tilemap_to_vram(2); sub_81C3E9C(move); - if ((*c == 4 && gUnknown_0203CF1C->unk40C4 == 0) || a[1] == 1) + if ((*c == 4 && gUnknown_0203CF1C->newMove == MOVE_NONE) || a[1] == 1) { ClearWindowTilemap(19); - if (!gSprites[gUnknown_0203CF1C->unk40D3[2]].invisible) + if (!gSprites[gUnknown_0203CF1C->spriteIds[2]].invisible) ClearWindowTilemap(13); schedule_bg_copy_tilemap_to_vram(0); sub_81C1DA4(9, -3); sub_81C1EFC(9, -3, move); } - if (*c != 4 && moveIndex == 4 && gUnknown_0203CF1C->unk40C4 == 0) + if (*c != 4 && moveIndex == 4 && gUnknown_0203CF1C->newMove == MOVE_NONE) { ClearWindowTilemap(14); ClearWindowTilemap(15); @@ -1255,7 +1621,7 @@ void sub_81C1070(s16 *a, s8 b, u8 *c) sub_81C1EFC(0, 3, 0); } *c = moveIndex; - if (c == &gUnknown_0203CF1C->unk40C6) + if (c == &gUnknown_0203CF1C->firstMoveIndex) sub_81C4D18(8); else sub_81C4D18(18); @@ -1267,10 +1633,10 @@ void sub_81C11F4(u8 taskId) ClearWindowTilemap(6); PutWindowTilemap(5); sub_81C3E9C(0); - sub_81C2194(&gUnknown_0203CF1C->unkTilemap2[0], 3, 1); - sub_81C2194(&gUnknown_0203CF1C->unkTilemap3[0], 1, 1); + sub_81C2194(&gUnknown_0203CF1C->bgTilemapBuffer3[0], 3, 1); + sub_81C2194(&gUnknown_0203CF1C->bgTilemapBuffer4[0], 1, 1); sub_81C4064(); - if (gUnknown_0203CF1C->unk40C6 != 4) + if (gUnknown_0203CF1C->firstMoveIndex != MAX_MON_MOVES) { ClearWindowTilemap(14); ClearWindowTilemap(15); @@ -1285,7 +1651,7 @@ void sub_81C11F4(u8 taskId) void sub_81C129C(u8 taskId) { - gUnknown_0203CF1C->unk40C7 = gUnknown_0203CF1C->unk40C6; + gUnknown_0203CF1C->secondMoveIndex = gUnknown_0203CF1C->firstMoveIndex; sub_81C4C84(1); sub_81C4AF8(18); gTasks[taskId].func = sub_81C12E4; @@ -1300,16 +1666,16 @@ void sub_81C12E4(u8 taskId) if (gMain.newKeys & DPAD_UP) { data[0] = 3; - sub_81C1070(&data[0], -1, &gUnknown_0203CF1C->unk40C7); + sub_81C1070(&data[0], -1, &gUnknown_0203CF1C->secondMoveIndex); } else if (gMain.newKeys & DPAD_DOWN) { data[0] = 3; - sub_81C1070(&data[0], 1, &gUnknown_0203CF1C->unk40C7); + sub_81C1070(&data[0], 1, &gUnknown_0203CF1C->secondMoveIndex); } else if (gMain.newKeys & A_BUTTON) { - if (gUnknown_0203CF1C->unk40C6 == gUnknown_0203CF1C->unk40C7) + if (gUnknown_0203CF1C->firstMoveIndex == gUnknown_0203CF1C->secondMoveIndex) { sub_81C13B0(taskId, 0); } @@ -1329,22 +1695,22 @@ void sub_81C13B0(u8 taskId, u8 b) sub_81C4C60(18); if (b == 1) { - if (gUnknown_0203CF1C->unk40BD == 0) + if (!gUnknown_0203CF1C->isBoxMon) { - struct Pokemon *why = gUnknown_0203CF1C->unk0->mon; - sub_81C14BC(&why[gUnknown_0203CF1C->unk40BE], gUnknown_0203CF1C->unk40C6, gUnknown_0203CF1C->unk40C7); + struct Pokemon *why = gUnknown_0203CF1C->monList.mons; + sub_81C14BC(&why[gUnknown_0203CF1C->curMonIndex], gUnknown_0203CF1C->firstMoveIndex, gUnknown_0203CF1C->secondMoveIndex); } else { - struct BoxPokemon *why = gUnknown_0203CF1C->unk0->boxMon; - sub_81C15EC(&why[gUnknown_0203CF1C->unk40BE], gUnknown_0203CF1C->unk40C6, gUnknown_0203CF1C->unk40C7); + struct BoxPokemon *why = gUnknown_0203CF1C->monList.boxMons; + sub_81C15EC(&why[gUnknown_0203CF1C->curMonIndex], gUnknown_0203CF1C->firstMoveIndex, gUnknown_0203CF1C->secondMoveIndex); } sub_81C0098(&gUnknown_0203CF1C->currentMon); - sub_81C40A0(gUnknown_0203CF1C->unk40C6, gUnknown_0203CF1C->unk40C7); - sub_81C4568(gUnknown_0203CF1C->unk40C6, gUnknown_0203CF1C->unk40C7); - gUnknown_0203CF1C->unk40C6 = gUnknown_0203CF1C->unk40C7; + sub_81C40A0(gUnknown_0203CF1C->firstMoveIndex, gUnknown_0203CF1C->secondMoveIndex); + sub_81C4568(gUnknown_0203CF1C->firstMoveIndex, gUnknown_0203CF1C->secondMoveIndex); + gUnknown_0203CF1C->firstMoveIndex = gUnknown_0203CF1C->secondMoveIndex; } - move = gUnknown_0203CF1C->summary.moves[gUnknown_0203CF1C->unk40C6]; + move = gUnknown_0203CF1C->summary.moves[gUnknown_0203CF1C->firstMoveIndex]; sub_81C3E9C(move); sub_81C240C(move); schedule_bg_copy_tilemap_to_vram(1); @@ -1793,12 +2159,12 @@ void sub_81C174C(u8 taskId) if (gMain.newKeys & DPAD_UP) { data[0] = 4; - sub_81C1070(data, -1, &gUnknown_0203CF1C->unk40C6); + sub_81C1070(data, -1, &gUnknown_0203CF1C->firstMoveIndex); } else if (gMain.newKeys & DPAD_DOWN) { data[0] = 4; - sub_81C1070(data, 1, &gUnknown_0203CF1C->unk40C6); + sub_81C1070(data, 1, &gUnknown_0203CF1C->firstMoveIndex); } else if (gMain.newKeys & DPAD_LEFT || GetLRKeysState() == 1) { @@ -1814,7 +2180,7 @@ void sub_81C174C(u8 taskId) { sub_81C48F0(); PlaySE(SE_SELECT); - gUnknown_0203CF21 = gUnknown_0203CF1C->unk40C6; + gUnknown_0203CF21 = gUnknown_0203CF1C->firstMoveIndex; gSpecialVar_0x8005 = gUnknown_0203CF21; sub_81C044C(taskId); } @@ -1837,9 +2203,9 @@ void sub_81C174C(u8 taskId) } } -bool8 sub_81C18A8() +bool8 sub_81C18A8(void) { - if (gUnknown_0203CF1C->unk40C6 == 4 || gUnknown_0203CF1C->unk40C4 == 0 || sub_81B6D14(gUnknown_0203CF1C->summary.moves[gUnknown_0203CF1C->unk40C6]) != 1) + if (gUnknown_0203CF1C->firstMoveIndex == MAX_MON_MOVES || gUnknown_0203CF1C->newMove == MOVE_NONE || sub_81B6D14(gUnknown_0203CF1C->summary.moves[gUnknown_0203CF1C->firstMoveIndex]) != 1) return TRUE; else return FALSE; @@ -1866,7 +2232,7 @@ void sub_81C1940(u8 taskId) { data[1] = 1; data[0] = 4; - sub_81C1070(&data[0], -1, &gUnknown_0203CF1C->unk40C6); + sub_81C1070(&data[0], -1, &gUnknown_0203CF1C->firstMoveIndex); data[1] = 0; gTasks[taskId].func = sub_81C174C; } @@ -1874,7 +2240,7 @@ void sub_81C1940(u8 taskId) { data[1] = 1; data[0] = 4; - sub_81C1070(&data[0], 1, &gUnknown_0203CF1C->unk40C6); + sub_81C1070(&data[0], 1, &gUnknown_0203CF1C->firstMoveIndex); data[1] = 0; gTasks[taskId].func = sub_81C174C; } @@ -1882,11 +2248,10 @@ void sub_81C1940(u8 taskId) { if (gUnknown_0203CF1C->unk40C0 != 2) { - ClearWindowTilemap(19); - if (!gSprites[gUnknown_0203CF1C->unk40D3[2]].invisible) + if (!gSprites[gUnknown_0203CF1C->spriteIds[2]].invisible) ClearWindowTilemap(13); - move = gUnknown_0203CF1C->summary.moves[gUnknown_0203CF1C->unk40C6]; + move = gUnknown_0203CF1C->summary.moves[gUnknown_0203CF1C->firstMoveIndex]; gTasks[taskId].func = sub_81C174C; sub_81C0A8C(taskId, -1); sub_81C1DA4(9, -2); @@ -1898,9 +2263,9 @@ void sub_81C1940(u8 taskId) if (gUnknown_0203CF1C->unk40C0 != 3) { ClearWindowTilemap(19); - if (!gSprites[gUnknown_0203CF1C->unk40D3[2]].invisible) + if (!gSprites[gUnknown_0203CF1C->spriteIds[2]].invisible) ClearWindowTilemap(13); - move = gUnknown_0203CF1C->summary.moves[gUnknown_0203CF1C->unk40C6]; + move = gUnknown_0203CF1C->summary.moves[gUnknown_0203CF1C->firstMoveIndex]; gTasks[taskId].func = sub_81C174C; sub_81C0A8C(taskId, 1); sub_81C1DA4(9, -2); @@ -1910,9 +2275,9 @@ void sub_81C1940(u8 taskId) else if (gMain.newKeys & (A_BUTTON | B_BUTTON)) { ClearWindowTilemap(19); - if (!gSprites[gUnknown_0203CF1C->unk40D3[2]].invisible) + if (!gSprites[gUnknown_0203CF1C->spriteIds[2]].invisible) ClearWindowTilemap(13); - move = gUnknown_0203CF1C->summary.moves[gUnknown_0203CF1C->unk40C6]; + move = gUnknown_0203CF1C->summary.moves[gUnknown_0203CF1C->firstMoveIndex]; sub_81C3E9C(move); schedule_bg_copy_tilemap_to_vram(0); sub_81C1DA4(9, -3); @@ -1922,12 +2287,12 @@ void sub_81C1940(u8 taskId) } } -u8 sub_81C1B94() +u8 sub_81C1B94(void) { return gUnknown_0203CF21; } -void sub_81C1BA0() +void sub_81C1BA0(void) { u16 *alloced = Alloc(32); u8 i; @@ -1992,173 +2357,34 @@ void sub_81C1BA0() Free(alloced); } -struct UnkStruct_61CC04 +void sub_81C1CB0(const struct UnkStruct_61CC04 *unkStruct, u16 *dest, u8 c, bool8 d) { - u8 *ptr; - u8 field_4; - u8 field_5; - u8 field_6; - u8 field_7; - u8 field_8; - u8 field_9; -}; - -#ifdef NONMATCHING -void sub_81C1CB0(struct UnkStruct_61CC04 *a, u16 *b, u8 c, u8 d) -{ - u8 *alloced = Alloc(a->field_6 * (a->field_7 << 1)); - CpuFill16(a->field_4, alloced, a->field_7*a->field_6); - if (a->field_6 != c) + u16 i; + u16 *alloced = Alloc(unkStruct->field_6 * 2 * unkStruct->field_7); + CpuFill16(unkStruct->field_4, alloced, unkStruct->field_6 * 2 * unkStruct->field_7); + if (unkStruct->field_6 != c) { if (!d) { - for (d;d < a->field_7; d++) + for (i = 0; i < unkStruct->field_7; i++) { - CpuCopy16(&a->ptr + ((c + a->field_6*d)), alloced + ((a->field_6*d) << 1), (a->field_6 - c) * 2); + CpuCopy16(&unkStruct->ptr[c + unkStruct->field_6 * i], &alloced[unkStruct->field_6 * i], (unkStruct->field_6 - c) * 2); } } else { - for (d = 0;d < a->field_7; d++) + for (i = 0; i < unkStruct->field_7; i++) { - CpuCopy16(&a->ptr + (a->field_6*d), alloced + ((c + a->field_6*d) << 1), (a->field_6 - c) * 2); + CpuCopy16(&unkStruct->ptr[unkStruct->field_6 * i], &alloced[c + unkStruct->field_6 * i], (unkStruct->field_6 - c) * 2); } } } - d = 0; - while (d < a->field_7) + for (i = 0; i < unkStruct->field_7; i++) { - CpuCopy16(alloced + ((a->field_6*d) << 1), b + ((((a->field_9 + d) << 5) + a->field_8) << 1), a->field_6 * 2); - d++; + CpuCopy16(&alloced[unkStruct->field_6 * i], &dest[(unkStruct->field_9 + i) * 32 + unkStruct->field_8], unkStruct->field_6 * 2); } Free(alloced); } -#else -NAKED -void sub_81C1CB0(struct UnkStruct_61CC04 *a, u16 *b, u8 c, u8 d) -{ - asm(".syntax unified\n\ - push {r4-r7,lr}\n\ - mov r7, r8\n\ - push {r7}\n\ - sub sp, 0x4\n\ - adds r4, r0, 0\n\ - mov r8, r1\n\ - lsls r2, 24\n\ - lsrs r6, r2, 24\n\ - lsls r3, 24\n\ - lsrs r5, r3, 24\n\ - ldrb r1, [r4, 0x6]\n\ - ldrb r0, [r4, 0x7]\n\ - lsls r0, 1\n\ - muls r0, r1\n\ - bl Alloc\n\ - adds r7, r0, 0\n\ - mov r1, sp\n\ - ldrh r0, [r4, 0x4]\n\ - strh r0, [r1]\n\ - ldrb r1, [r4, 0x7]\n\ - ldrb r0, [r4, 0x6]\n\ - adds r2, r1, 0\n\ - muls r2, r0\n\ - movs r0, 0x80\n\ - lsls r0, 17\n\ - orrs r2, r0\n\ - mov r0, sp\n\ - adds r1, r7, 0\n\ - bl CpuSet\n\ - ldrb r0, [r4, 0x6]\n\ - cmp r0, r6\n\ - beq _081C1D60\n\ - cmp r5, 0\n\ - bne _081C1D30\n\ - movs r5, 0\n\ - ldrb r0, [r4, 0x7]\n\ - cmp r5, r0\n\ - bcs _081C1D60\n\ -_081C1D00:\n\ - ldrb r2, [r4, 0x6]\n\ - adds r1, r2, 0\n\ - muls r1, r5\n\ - adds r3, r6, r1\n\ - lsls r3, 1\n\ - ldr r0, [r4]\n\ - adds r0, r3\n\ - lsls r1, 1\n\ - adds r1, r7, r1\n\ - subs r2, r6\n\ - ldr r3, =0x001fffff\n\ - ands r2, r3\n\ - bl CpuSet\n\ - adds r0, r5, 0x1\n\ - lsls r0, 16\n\ - lsrs r5, r0, 16\n\ - ldrb r3, [r4, 0x7]\n\ - cmp r5, r3\n\ - bcc _081C1D00\n\ - b _081C1D60\n\ - .pool\n\ -_081C1D30:\n\ - movs r5, 0\n\ - ldrb r0, [r4, 0x7]\n\ - cmp r5, r0\n\ - bcs _081C1D60\n\ -_081C1D38:\n\ - ldrb r2, [r4, 0x6]\n\ - adds r1, r2, 0\n\ - muls r1, r5\n\ - lsls r3, r1, 1\n\ - ldr r0, [r4]\n\ - adds r0, r3\n\ - adds r1, r6, r1\n\ - lsls r1, 1\n\ - adds r1, r7, r1\n\ - subs r2, r6\n\ - ldr r3, =0x001fffff\n\ - ands r2, r3\n\ - bl CpuSet\n\ - adds r0, r5, 0x1\n\ - lsls r0, 16\n\ - lsrs r5, r0, 16\n\ - ldrb r3, [r4, 0x7]\n\ - cmp r5, r3\n\ - bcc _081C1D38\n\ -_081C1D60:\n\ - movs r5, 0\n\ - b _081C1D8A\n\ - .pool\n\ -_081C1D68:\n\ - ldrb r2, [r4, 0x6]\n\ - adds r0, r2, 0\n\ - muls r0, r5\n\ - lsls r0, 1\n\ - adds r0, r7, r0\n\ - ldrb r1, [r4, 0x9]\n\ - adds r1, r5\n\ - lsls r1, 5\n\ - ldrb r3, [r4, 0x8]\n\ - adds r1, r3\n\ - lsls r1, 1\n\ - add r1, r8\n\ - bl CpuSet\n\ - adds r0, r5, 0x1\n\ - lsls r0, 16\n\ - lsrs r5, r0, 16\n\ -_081C1D8A:\n\ - ldrb r0, [r4, 0x7]\n\ - cmp r5, r0\n\ - bcc _081C1D68\n\ - adds r0, r7, 0\n\ - bl Free\n\ - add sp, 0x4\n\ - pop {r3}\n\ - mov r8, r3\n\ - pop {r4-r7}\n\ - pop {r0}\n\ - bx r0\n\ - .syntax divided\n"); -} -#endif void sub_81C1DA4(u16 a, s16 b) { @@ -2166,7 +2392,7 @@ void sub_81C1DA4(u16 a, s16 b) b = gUnknown_0861CC04.field_6; if (b == 0 || b == gUnknown_0861CC04.field_6) { - sub_81C1CB0(&gUnknown_0861CC04, &gUnknown_0203CF1C->unkTilemap2[0], b, 1); + sub_81C1CB0(&gUnknown_0861CC04, &gUnknown_0203CF1C->bgTilemapBuffer3[0], b, 1); } else { @@ -2192,18 +2418,17 @@ void sub_81C1E20(u8 taskId) { data[1] = gUnknown_0861CC04.field_6; } - sub_81C1CB0(&gUnknown_0861CC04, &gUnknown_0203CF1C->unkTilemap2[0], data[1], 1); + sub_81C1CB0(&gUnknown_0861CC04, &gUnknown_0203CF1C->bgTilemapBuffer3[0], data[1], 1); if (data[1] <= 0 || data[1] >= gUnknown_0861CC04.field_6) { if (data[0] < 0) { if (gUnknown_0203CF1C->unk40C0 == 2) PutWindowTilemap(14); - } else { - if (!gSprites[gUnknown_0203CF1C->unk40D3[2]].invisible) + if (!gSprites[gUnknown_0203CF1C->spriteIds[2]].invisible) PutWindowTilemap(13); PutWindowTilemap(19); } @@ -2219,7 +2444,7 @@ void sub_81C1EFC(u16 a, s16 b, u16 move) if (b > gUnknown_0861CC10.field_6) b = gUnknown_0861CC10.field_6; if (b == 0 || b == gUnknown_0861CC10.field_6) - sub_81C1CB0(&gUnknown_0861CC10, &gUnknown_0203CF1C->unkTilemap3[0], b, 1); + sub_81C1CB0(&gUnknown_0861CC10, &gUnknown_0203CF1C->bgTilemapBuffer4[0], b, 1); else { u8 taskId = FindTaskIdByFunc(sub_81C1F80); @@ -2243,7 +2468,7 @@ void sub_81C1F80(u8 taskId) { data[1] = gUnknown_0861CC10.field_6; } - sub_81C1CB0(&gUnknown_0861CC10, &gUnknown_0203CF1C->unkTilemap3[0], data[1], 1); + sub_81C1CB0(&gUnknown_0861CC10, &gUnknown_0203CF1C->bgTilemapBuffer4[0], data[1], 1); if (data[1] <= 0 || data[1] >= gUnknown_0861CC10.field_6) { if (data[0] < 0) @@ -2254,7 +2479,7 @@ void sub_81C1F80(u8 taskId) } else { - if (!gSprites[gUnknown_0203CF1C->unk40D3[2]].invisible) + if (!gSprites[gUnknown_0203CF1C->spriteIds[2]].invisible) { PutWindowTilemap(13); } @@ -2273,8 +2498,8 @@ void sub_81C2074(u16 a, s16 b) b = gUnknown_0861CBEC.field_6; if (b == 0 || b == gUnknown_0861CBEC.field_6) { - sub_81C1CB0(&gUnknown_0861CBEC, &gUnknown_0203CF1C->unkTilemap0[0], b, 0); - sub_81C1CB0(&gUnknown_0861CBF8, &gUnknown_0203CF1C->unkTilemap0[0], b, 0); + sub_81C1CB0(&gUnknown_0861CBEC, &gUnknown_0203CF1C->bgTilemapBuffer1[0], b, 0); + sub_81C1CB0(&gUnknown_0861CBF8, &gUnknown_0203CF1C->bgTilemapBuffer1[0], b, 0); } else { @@ -2292,8 +2517,8 @@ void sub_81C20F0(u8 taskId) data[1] = 0; else if (data[1] > gUnknown_0861CBEC.field_6) data[1] = gUnknown_0861CBEC.field_6; - sub_81C1CB0(&gUnknown_0861CBEC, &gUnknown_0203CF1C->unkTilemap0[0], data[1], 0); - sub_81C1CB0(&gUnknown_0861CBF8, &gUnknown_0203CF1C->unkTilemap0[0], data[1], 0); + sub_81C1CB0(&gUnknown_0861CBEC, &gUnknown_0203CF1C->bgTilemapBuffer1[0], data[1], 0); + sub_81C1CB0(&gUnknown_0861CBF8, &gUnknown_0203CF1C->bgTilemapBuffer1[0], data[1], 0); schedule_bg_copy_tilemap_to_vram(3); if (data[1] <= 0 || data[1] >= gUnknown_0861CBEC.field_6) { @@ -2307,126 +2532,44 @@ void sub_81C20F0(u8 taskId) } } -// somebody send help this is a complete fucking mess -#ifdef NONMATCHING -void sub_81C2194(u16 *a, u16 b, u8 c) +void sub_81C2194(u16 *output, u16 palette, bool8 c) { u16 i; - int var; - b *= 0x1000; + u32 var; + palette <<= 12; var = 0x56A; if (c == 0) { for (i = 0; i < 20; i++) { - a[(i + var) << 1] = gSummaryScreenWindow_Tilemap[i] + b; - a[((i + var) << 1) + 0x40] = gSummaryScreenWindow_Tilemap[i] + b; - a[((i + var) << 1) + 0x80] = gSummaryScreenWindow_Tilemap[i + 20] + b; + output[var + i] = gSummaryScreenWindow_Tilemap[i] + palette; + output[var + i + 0x20] = gSummaryScreenWindow_Tilemap[i] + palette; + output[var + i + 0x40] = gSummaryScreenWindow_Tilemap[i + 20] + palette; } } else { for (i = 0; i < 20; i++) { - a[(i + var)] = gSummaryScreenWindow_Tilemap[i + 20] + b; - a[((i + var)) + 0x40] = gSummaryScreenWindow_Tilemap[i + 40] + b; - a[((i + var)) + 0x80] = gSummaryScreenWindow_Tilemap[i + 40] + b; + output[var + i] = gSummaryScreenWindow_Tilemap[i + 20] + palette; + output[var + i + 0x20] = gSummaryScreenWindow_Tilemap[i + 40] + palette; + output[var + i + 0x40] = gSummaryScreenWindow_Tilemap[i + 40] + palette; } } } -#else -NAKED -void sub_81C2194(u16 *a, u16 b, u8 c) -{ - asm(".syntax unified\n\ - push {r4-r7,lr}\n\ - adds r6, r0, 0\n\ - lsls r2, 24\n\ - lsls r1, 28\n\ - lsrs r4, r1, 16\n\ - ldr r7, =0x0000056a\n\ - cmp r2, 0\n\ - bne _081C21E4\n\ - movs r3, 0\n\ - ldr r5, =gSummaryScreenWindow_Tilemap\n\ -_081C21A8:\n\ - adds r2, r7, r3\n\ - lsls r2, 1\n\ - adds r2, r6\n\ - lsls r0, r3, 1\n\ - adds r0, r5\n\ - ldrh r1, [r0]\n\ - adds r1, r4, r1\n\ - strh r1, [r2]\n\ - adds r0, r2, 0\n\ - adds r0, 0x40\n\ - strh r1, [r0]\n\ - adds r2, 0x80\n\ - adds r0, r3, 0\n\ - adds r0, 0x14\n\ - lsls r0, 1\n\ - adds r0, r5\n\ - ldrh r0, [r0]\n\ - adds r0, r4, r0\n\ - strh r0, [r2]\n\ - adds r0, r3, 0x1\n\ - lsls r0, 16\n\ - lsrs r3, r0, 16\n\ - cmp r3, 0x13\n\ - bls _081C21A8\n\ - b _081C221C\n\ - .pool\n\ -_081C21E4:\n\ - movs r3, 0\n\ - ldr r5, =gSummaryScreenWindow_Tilemap\n\ -_081C21E8:\n\ - adds r1, r7, r3\n\ - lsls r1, 1\n\ - adds r1, r6\n\ - adds r0, r3, 0\n\ - adds r0, 0x14\n\ - lsls r0, 1\n\ - adds r0, r5\n\ - ldrh r0, [r0]\n\ - adds r0, r4, r0\n\ - strh r0, [r1]\n\ - adds r2, r1, 0\n\ - adds r2, 0x40\n\ - adds r0, r3, 0\n\ - adds r0, 0x28\n\ - lsls r0, 1\n\ - adds r0, r5\n\ - ldrh r0, [r0]\n\ - adds r0, r4, r0\n\ - strh r0, [r2]\n\ - adds r1, 0x80\n\ - strh r0, [r1]\n\ - adds r0, r3, 0x1\n\ - lsls r0, 16\n\ - lsrs r3, r0, 16\n\ - cmp r3, 0x13\n\ - bls _081C21E8\n\ -_081C221C:\n\ - pop {r4-r7}\n\ - pop {r0}\n\ - bx r0\n\ - .pool\n\ - .syntax divided\n"); -} -#endif void sub_81C2228(struct Pokemon *mon) { if (!CheckPartyPokerus(mon, 0) && CheckPartyHasHadPokerus(mon, 0)) { - gUnknown_0203CF1C->unkTilemap0[0x223] = 0x2C; - gUnknown_0203CF1C->unkTilemap0_1[0x223] = 0x2C; + gUnknown_0203CF1C->bgTilemapBuffer1[0x223] = 0x2C; + gUnknown_0203CF1C->bgTilemapBuffer1[0x623] = 0x2C; } else { - gUnknown_0203CF1C->unkTilemap0[0x223] = 0x81A; - gUnknown_0203CF1C->unkTilemap0_1[0x223] = 0x81A; + gUnknown_0203CF1C->bgTilemapBuffer1[0x223] = 0x81A; + gUnknown_0203CF1C->bgTilemapBuffer1[0x623] = 0x81A; } schedule_bg_copy_tilemap_to_vram(3); } @@ -2461,7 +2604,7 @@ void sub_81C22CC(struct Pokemon *unused) r6r7 = 0; } - r9 = &gUnknown_0203CF1C->unkTilemap1_1[0x255]; + r9 = &gUnknown_0203CF1C->bgTilemapBuffer2[0x655]; for (i = 0; i < 8; i++) { if (r6r7 > 7) @@ -2473,7 +2616,7 @@ void sub_81C22CC(struct Pokemon *unused) r6r7 = 0; } - if (GetBgTilemapBuffer(1) == gUnknown_0203CF1C->unkTilemap1) + if (GetBgTilemapBuffer(1) == gUnknown_0203CF1C->bgTilemapBuffer2) schedule_bg_copy_tilemap_to_vram(1); else schedule_bg_copy_tilemap_to_vram(2); @@ -2481,7 +2624,7 @@ void sub_81C22CC(struct Pokemon *unused) void sub_81C240C(u16 move) { - u16* r5 = &gUnknown_0203CF1C->unkTilemap3_1[0]; + u16* r5 = &gUnknown_0203CF1C->bgTilemapBuffer4[0x400]; u8 i; u8 r4; if (move != MOVE_NONE) @@ -2513,7 +2656,7 @@ void sub_81C240C(u16 move) } } -void sub_81C2524() +void sub_81C2524(void) { if (gUnknown_0203CF1C->summary.isEgg != 0) ChangeBgX(3, 0x10000, 0); @@ -2521,23 +2664,23 @@ void sub_81C2524() ChangeBgX(3, 0, 0); } -void sub_81C2554() +void sub_81C2554(void) { u8 i; - InitWindows(&gUnknown_0861CC24); + InitWindows(gUnknown_0861CC24); DeactivateAllTextPrinters(); for (i = 0; i < 20; i++) FillWindowPixelBuffer(i, 0); for (i = 0; i < 8; i++) - gUnknown_0203CF1C->unk40CB[i] |= 0xFF; + gUnknown_0203CF1C->windowIds[i] |= 0xFF; } void sub_81C25A4(u8 a, const u8 *b, u8 c, u8 d, u8 e, u8 f) { - AddTextPrinterParameterized2(a, 1, c, d, 0, e, gUnknown_0861CD2C[f], 0, b); + AddTextPrinterParameterized2(a, 1, c, d, 0, e, sTextColors_861CD2C[f], 0, b); } -void sub_81C25E8() +void sub_81C25E8(void) { FillWindowPixelBuffer(17, 0); FillWindowPixelBuffer(18, 0); @@ -2549,7 +2692,7 @@ void sub_81C25E8() schedule_bg_copy_tilemap_to_vram(0); } -void sub_81C2628() +void sub_81C2628(void) { u8 strArray[16]; struct Pokemon *mon = &gUnknown_0203CF1C->currentMon; @@ -2594,7 +2737,7 @@ void sub_81C2628() PutWindowTilemap(19); } -void sub_81C2794() +void sub_81C2794(void) { GetMonNickname(&gUnknown_0203CF1C->currentMon, gStringVar1); sub_81C25A4(18, gStringVar1, 0, 1, 0, 1); @@ -2625,7 +2768,7 @@ void sub_81C2838(u8 a, bool8 b, u32 c) BlitBitmapToWindow(a, (b) ? &gUnknown_0861CDD3[0] : &gUnknown_0861CDD3[0] - 0x80, c, 0, 16, 16); } -void sub_81C286C() +void sub_81C286C(void) { int r4; int r2; @@ -2705,9 +2848,9 @@ void sub_81C2AFC(u8 a) break; case 2: PutWindowTilemap(2); - if (gUnknown_0203CF1C->unk40BC == 3) + if (gUnknown_0203CF1C->mode == 3) { - if(!(gUnknown_0203CF1C->unk40C4 == 0 && gUnknown_0203CF1C->unk40C6 == 4)) + if(!(gUnknown_0203CF1C->newMove == MOVE_NONE && gUnknown_0203CF1C->firstMoveIndex == MAX_MON_MOVES)) PutWindowTilemap(14); } else @@ -2715,9 +2858,9 @@ void sub_81C2AFC(u8 a) break; case 3: PutWindowTilemap(3); - if (gUnknown_0203CF1C->unk40BC == 3) + if (gUnknown_0203CF1C->mode == 3) { - if(!(gUnknown_0203CF1C->unk40C4 == 0 && gUnknown_0203CF1C->unk40C6 == 4)) + if(!(gUnknown_0203CF1C->newMove == MOVE_NONE && gUnknown_0203CF1C->firstMoveIndex == MAX_MON_MOVES)) PutWindowTilemap(15); } else @@ -2726,7 +2869,7 @@ void sub_81C2AFC(u8 a) } for (i = 0; i < 8; i++) { - PutWindowTilemap(gUnknown_0203CF1C->unk40CB[i]); + PutWindowTilemap(gUnknown_0203CF1C->windowIds[i]); } schedule_bg_copy_tilemap_to_vram(0); } @@ -2748,18 +2891,18 @@ void sub_81C2C38(u8 a) ClearWindowTilemap(12); break; case 2: - if (gUnknown_0203CF1C->unk40BC == 3) + if (gUnknown_0203CF1C->mode == 3) { - if(!(gUnknown_0203CF1C->unk40C4 == 0 && gUnknown_0203CF1C->unk40C6 == 4)) + if(!(gUnknown_0203CF1C->newMove == MOVE_NONE && gUnknown_0203CF1C->firstMoveIndex == MAX_MON_MOVES)) ClearWindowTilemap(14); } else ClearWindowTilemap(5); break; case 3: - if (gUnknown_0203CF1C->unk40BC == 3) + if (gUnknown_0203CF1C->mode == 3) { - if(!(gUnknown_0203CF1C->unk40C4 == 0 && gUnknown_0203CF1C->unk40C6 == 4)) + if(!(gUnknown_0203CF1C->newMove == MOVE_NONE && gUnknown_0203CF1C->firstMoveIndex == MAX_MON_MOVES)) ClearWindowTilemap(15); } else @@ -2771,9 +2914,9 @@ void sub_81C2C38(u8 a) schedule_bg_copy_tilemap_to_vram(0); } -u8 sub_81C2D2C(struct WindowTemplate *template, u8 a) +u8 sub_81C2D2C(const struct WindowTemplate *template, u8 a) { - u8 *windowIdPtr = &(gUnknown_0203CF1C->unk40CB[a]); + u8 *windowIdPtr = &(gUnknown_0203CF1C->windowIds[a]); if (*windowIdPtr == 0xFF) { *windowIdPtr = AddWindow(&template[a]); @@ -2784,7 +2927,7 @@ u8 sub_81C2D2C(struct WindowTemplate *template, u8 a) void sub_81C2D68(u8 a) { - u8 *windowIdPtr = &(gUnknown_0203CF1C->unk40CB[a]); + u8 *windowIdPtr = &(gUnknown_0203CF1C->windowIds[a]); if (*windowIdPtr != 0xFF) { ClearWindowTilemap(*windowIdPtr); @@ -2798,8 +2941,8 @@ void sub_81C2D9C(u8 a) u16 i; for (i = 0; i < 8; i++) { - if (gUnknown_0203CF1C->unk40CB[i] != 0xFF) - FillWindowPixelBuffer(gUnknown_0203CF1C->unk40CB[i], 0); + if (gUnknown_0203CF1C->windowIds[i] != 0xFF) + FillWindowPixelBuffer(gUnknown_0203CF1C->windowIds[i], 0); } gUnknown_0861CE54[a](); } @@ -2809,7 +2952,7 @@ void sub_81C2DE4(u8 a) CreateTask(gUnknown_0861CE64[a], 16); } -void sub_81C2E00() +void sub_81C2E00(void) { if (gUnknown_0203CF1C->summary.isEgg) { @@ -2860,13 +3003,13 @@ void sub_81C2E40(u8 taskId) data[0]++; } -void sub_81C2EC4() +void sub_81C2EC4(void) { u8 r5; int r2; if (sub_81A6BF4() != 1 && sub_81B9E94() != 1) { - r5 = sub_81C2D2C(&gUnknown_0861CCCC, 0); + r5 = sub_81C2D2C(gUnknown_0861CCCC, 0); sub_81C25A4(r5, gText_OTSlash, 0, 1, 0, 1); r2 = GetStringWidth(1, gText_OTSlash, 0); if (gUnknown_0203CF1C->summary.OTGender == 0) @@ -2876,33 +3019,33 @@ void sub_81C2EC4() } } -void sub_81C2F5C() +void sub_81C2F5C(void) { int r4; if (sub_81A6BF4() != TRUE && sub_81B9E94() != TRUE) { ConvertIntToDecimalStringN(StringCopy(gStringVar1, gText_UnkCtrlF907F908), (u16)gUnknown_0203CF1C->summary.OTID, 2, 5); r4 = GetStringRightAlignXOffset(1, gStringVar1, 0x38); - sub_81C25A4(sub_81C2D2C(&gUnknown_0861CCCC, 1), gStringVar1, r4, 1, 0, 1); + sub_81C25A4(sub_81C2D2C(gUnknown_0861CCCC, 1), gStringVar1, r4, 1, 0, 1); } } -void sub_81C2FD8() +void sub_81C2FD8(void) { u8 ability = GetAbilityBySpecies(gUnknown_0203CF1C->summary.species, gUnknown_0203CF1C->summary.altAbility); - sub_81C25A4(sub_81C2D2C(&gUnknown_0861CCCC, 2), gAbilityNames[ability], 0, 1, 0, 1); + sub_81C25A4(sub_81C2D2C(gUnknown_0861CCCC, 2), gAbilityNames[ability], 0, 1, 0, 1); } -void sub_81C302C() +void sub_81C302C(void) { u8 ability = GetAbilityBySpecies(gUnknown_0203CF1C->summary.species, gUnknown_0203CF1C->summary.altAbility); - sub_81C25A4(sub_81C2D2C(&gUnknown_0861CCCC, 2), gAbilityDescriptionPointers[ability], 0, 17, 0, 0); + sub_81C25A4(sub_81C2D2C(gUnknown_0861CCCC, 2), gAbilityDescriptionPointers[ability], 0, 17, 0, 0); } -void sub_81C307C() +void sub_81C307C(void) { struct PokeSummary *sum = &gUnknown_0203CF1C->summary; - u8 *text; + const u8 *text; DynamicPlaceholderTextUtil_Reset(); DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, gUnknown_0861CE74); DynamicPlaceholderTextUtil_SetPlaceholderPtr(1, gUnknown_0861CE7B); @@ -2938,12 +3081,12 @@ void sub_81C307C() } } -void sub_81C3194() +void sub_81C3194(void) { - sub_81C25A4(sub_81C2D2C(&gUnknown_0861CCCC, 3), gStringVar4, 0, 1, 0, 0); + sub_81C25A4(sub_81C2D2C(gUnknown_0861CCCC, 3), gStringVar4, 0, 1, 0, 0); } -void sub_81C31C0() +void sub_81C31C0(void) { struct UnkSummaryStruct *sumStruct = gUnknown_0203CF1C; DynamicPlaceholderTextUtil_SetPlaceholderPtr(2, gNatureNamePointers[sumStruct->summary.nature]); @@ -2959,14 +3102,15 @@ void sub_81C31F0(u8 *a) DynamicPlaceholderTextUtil_SetPlaceholderPtr(3, a); } -u8 sub_81C3220() +u8 sub_81C3220(void) { struct PokeSummary *sum = &gUnknown_0203CF1C->summary; u32 r4; u8 r5; - if (gUnknown_0203CF1C->unk0 == (union UnkUnion *)&gEnemyParty) + + if (gUnknown_0203CF1C->monList.mons == gEnemyParty) { - u8 multiID = GetMultiplayerId()^1; + u8 multiID = GetMultiplayerId() ^ 1; r4 = (u16)gLinkPlayers[multiID].trainerId; r5 = gLinkPlayers[multiID].gender; StringCopy(gStringVar1, gLinkPlayers[multiID].name); @@ -2984,7 +3128,7 @@ u8 sub_81C3220() return 1; } -bool8 sub_81C32BC() +bool8 sub_81C32BC(void) { struct PokeSummary *sum = &gUnknown_0203CF1C->summary; u8 r0 = sum->metGame - 1; @@ -2993,7 +3137,7 @@ bool8 sub_81C32BC() return FALSE; } -bool8 sub_81C32E0() +bool8 sub_81C32E0(void) { struct PokeSummary *sum = &gUnknown_0203CF1C->summary; u8 r0 = sum->metGame - 1; @@ -3002,91 +3146,36 @@ bool8 sub_81C32E0() return FALSE; } -bool8 sub_81C3304() +bool8 sub_81C3304(void) { if ((gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER) && gMain.inBattle) { - if (gUnknown_0203CF1C->unk40BE == 1 || gUnknown_0203CF1C->unk40BE == 4 || gUnknown_0203CF1C->unk40BE == 5) + if (gUnknown_0203CF1C->curMonIndex == 1 || gUnknown_0203CF1C->curMonIndex == 4 || gUnknown_0203CF1C->curMonIndex == 5) return TRUE; } return FALSE; } -#ifdef NONMATCHING -void sub_81C335C() +void sub_81C335C(void) { - u8 r4 = sub_81C2D2C(&gUnknown_0861CCCC, 0); - u32 r5 = GetStringWidth(1, gText_OTSlash, 0); - sub_81C25A4(r4, gText_OTSlash, 0, 1, 0, 1); - sub_81C25A4(r4, gText_FiveMarks, r5, 1, 0, 1); + u32 windowId = sub_81C2D2C(gUnknown_0861CCCC, 0); + u32 width = GetStringWidth(1, gText_OTSlash, 0); + sub_81C25A4(windowId, gText_OTSlash, 0, 1, 0, 1); + sub_81C25A4(windowId, gText_FiveMarks, width, 1, 0, 1); } -#else -NAKED -void sub_81C335C() -{ - asm(".syntax unified\n\ - push {r4-r6,lr}\n\ - mov r6, r9\n\ - mov r5, r8\n\ - push {r5,r6}\n\ - sub sp, 0x8\n\ - ldr r0, =gUnknown_0861CCCC\n\ - movs r1, 0\n\ - bl sub_81C2D2C\n\ - adds r4, r0, 0\n\ - lsls r4, 24\n\ - lsrs r4, 24\n\ - ldr r0, =gText_OTSlash\n\ - mov r8, r0\n\ - movs r0, 0x1\n\ - mov r1, r8\n\ - movs r2, 0\n\ - bl GetStringWidth\n\ - adds r5, r0, 0\n\ - movs r0, 0\n\ - mov r9, r0\n\ - str r0, [sp]\n\ - movs r6, 0x1\n\ - str r6, [sp, 0x4]\n\ - adds r0, r4, 0\n\ - mov r1, r8\n\ - movs r2, 0\n\ - movs r3, 0x1\n\ - bl sub_81C25A4\n\ - ldr r1, =gText_FiveMarks\n\ - lsls r5, 24\n\ - lsrs r5, 24\n\ - mov r0, r9\n\ - str r0, [sp]\n\ - str r6, [sp, 0x4]\n\ - adds r0, r4, 0\n\ - adds r2, r5, 0\n\ - movs r3, 0x1\n\ - bl sub_81C25A4\n\ - add sp, 0x8\n\ - pop {r3,r4}\n\ - mov r8, r3\n\ - mov r9, r4\n\ - pop {r4-r6}\n\ - pop {r0}\n\ - bx r0\n\ - .pool\n\ - .syntax divided\n"); -} -#endif -void sub_81C33CC() +void sub_81C33CC(void) { int r4; StringCopy(gStringVar1, gText_UnkCtrlF907F908); StringAppend(gStringVar1, gText_FiveMarks); r4 = GetStringRightAlignXOffset(1, gStringVar1, 0x38); - sub_81C25A4(sub_81C2D2C(&gUnknown_0861CCCC, 1), gStringVar1, r4, 1, 0, 1); + sub_81C25A4(sub_81C2D2C(gUnknown_0861CCCC, 1), gStringVar1, r4, 1, 0, 1); } -void sub_81C3428() +void sub_81C3428(void) { - u8 *text; + const u8 *text; struct PokeSummary *sum = &gUnknown_0203CF1C->summary; if (gUnknown_0203CF1C->summary.sanity == 1) text = gText_EggWillTakeALongTime; @@ -3098,12 +3187,12 @@ void sub_81C3428() text = gText_EggWillTakeSomeTime; else text = gText_EggWillTakeALongTime; - sub_81C25A4(sub_81C2D2C(&gUnknown_0861CCCC, 2), text, 0, 1, 0, 0); + sub_81C25A4(sub_81C2D2C(gUnknown_0861CCCC, 2), text, 0, 1, 0, 0); } -void sub_81C349C() +void sub_81C349C(void) { - u8 *text; + const u8 *text; struct PokeSummary *sum = &gUnknown_0203CF1C->summary; if (gUnknown_0203CF1C->summary.sanity != 1) { @@ -3118,10 +3207,10 @@ void sub_81C349C() } else text = gText_OddEggFoundByCouple; - sub_81C25A4(sub_81C2D2C(&gUnknown_0861CCCC, 3), text, 0, 1, 0, 0); + sub_81C25A4(sub_81C2D2C(gUnknown_0861CCCC, 3), text, 0, 1, 0, 0); } -void sub_81C3530() +void sub_81C3530(void) { sub_81C35E4(); sub_81C3690(); @@ -3166,11 +3255,11 @@ void sub_81C3554(u8 taskId) data[0]++; } -void sub_81C35E4() +void sub_81C35E4(void) { const u8 *text; int offset; - if (gUnknown_0203CF1C->summary.item == ITEM_ENIGMA_BERRY && sub_81B1250() == 1 && (gUnknown_0203CF1C->unk40BE == 1 || gUnknown_0203CF1C->unk40BE == 4 || gUnknown_0203CF1C->unk40BE == 5)) + if (gUnknown_0203CF1C->summary.item == ITEM_ENIGMA_BERRY && sub_81B1250() == 1 && (gUnknown_0203CF1C->curMonIndex == 1 || gUnknown_0203CF1C->curMonIndex == 4 || gUnknown_0203CF1C->curMonIndex == 5)) { text = ItemId_GetName(ITEM_ENIGMA_BERRY); } @@ -3182,12 +3271,12 @@ void sub_81C35E4() text = gStringVar1; } offset = GetStringCenterAlignXOffset(1, text, 0x48) + 6; - sub_81C25A4(sub_81C2D2C(&gUnknown_0861CCEC, 0), text, offset, 1, 0, 0); + sub_81C25A4(sub_81C2D2C(gUnknown_0861CCEC, 0), text, offset, 1, 0, 0); } -void sub_81C3690() +void sub_81C3690(void) { - u8 *text; + const u8 *text; int offset; if (gUnknown_0203CF1C->summary.ribbons == 0) text = gText_None; @@ -3198,10 +3287,10 @@ void sub_81C3690() text = gStringVar4; } offset = GetStringCenterAlignXOffset(1, text, 0x46) + 6; - sub_81C25A4(sub_81C2D2C(&gUnknown_0861CCEC, 1), text, offset, 1, 0, 0); + sub_81C25A4(sub_81C2D2C(gUnknown_0861CCEC, 1), text, offset, 1, 0, 0); } -void sub_81C3710() +void sub_81C3710(void) { u8 *alloced1 = Alloc(8); u8 *alloced2 = Alloc(8); @@ -3223,12 +3312,12 @@ void sub_81C3710() Free(alloced4); } -void sub_81C37D8() +void sub_81C37D8(void) { - sub_81C25A4(sub_81C2D2C(&gUnknown_0861CCEC, 2), gStringVar4, 4, 1, 0, 0); + sub_81C25A4(sub_81C2D2C(gUnknown_0861CCEC, 2), gStringVar4, 4, 1, 0, 0); } -void sub_81C3808() +void sub_81C3808(void) { ConvertIntToDecimalStringN(gStringVar1, gUnknown_0203CF1C->summary.spatk, 1, 3); ConvertIntToDecimalStringN(gStringVar2, gUnknown_0203CF1C->summary.spdef, 1, 3); @@ -3240,15 +3329,15 @@ void sub_81C3808() DynamicPlaceholderTextUtil_ExpandPlaceholders(gStringVar4, gUnknown_0861CE8E); } -void sub_81C3890() +void sub_81C3890(void) { - sub_81C25A4(sub_81C2D2C(&gUnknown_0861CCEC, 3), gStringVar4, 2, 1, 0, 0); + sub_81C25A4(sub_81C2D2C(gUnknown_0861CCEC, 3), gStringVar4, 2, 1, 0, 0); } -void sub_81C38C0() +void sub_81C38C0(void) { struct PokeSummary *sum = &gUnknown_0203CF1C->summary; - u8 r6 = sub_81C2D2C(&gUnknown_0861CCEC, 4); + u8 r6 = sub_81C2D2C(gUnknown_0861CCEC, 4); int offset; u32 expToNextLevel; ConvertIntToDecimalStringN(gStringVar1, sum->exp, 1, 7); @@ -3263,22 +3352,22 @@ void sub_81C38C0() sub_81C25A4(r6, gStringVar1, offset, 17, 0, 0); } -void sub_81C3984() +void sub_81C3984(void) { sub_81C3B08(0); sub_81C3B08(1); sub_81C3B08(2); sub_81C3B08(3); - if (gUnknown_0203CF1C->unk40BC == 3) + if (gUnknown_0203CF1C->mode == 3) { sub_81C3F44(); - if (gUnknown_0203CF1C->unk40C6 == 4) + if (gUnknown_0203CF1C->firstMoveIndex == MAX_MON_MOVES) { - if (gUnknown_0203CF1C->unk40C4 != 0) - sub_81C3E9C(gUnknown_0203CF1C->unk40C4); + if (gUnknown_0203CF1C->newMove != MOVE_NONE) + sub_81C3E9C(gUnknown_0203CF1C->newMove); } else - sub_81C3E9C(gUnknown_0203CF1C->summary.moves[gUnknown_0203CF1C->unk40C6]); + sub_81C3E9C(gUnknown_0203CF1C->summary.moves[gUnknown_0203CF1C->firstMoveIndex]); } } @@ -3302,22 +3391,22 @@ void sub_81C39F0(u8 taskId) sub_81C3B08(3); break; case 4: - if (gUnknown_0203CF1C->unk40BC == 3) + if (gUnknown_0203CF1C->mode == 3) sub_81C3F44(); break; case 5: - if (gUnknown_0203CF1C->unk40BC == 3) + if (gUnknown_0203CF1C->mode == 3) { - if (gUnknown_0203CF1C->unk40C6 == 4) - data[1] = gUnknown_0203CF1C->unk40C4; + if (gUnknown_0203CF1C->firstMoveIndex == MAX_MON_MOVES) + data[1] = gUnknown_0203CF1C->newMove; else - data[1] = gUnknown_0203CF1C->summary.moves[gUnknown_0203CF1C->unk40C6]; + data[1] = gUnknown_0203CF1C->summary.moves[gUnknown_0203CF1C->firstMoveIndex]; } break; case 6: - if (gUnknown_0203CF1C->unk40BC == 3) + if (gUnknown_0203CF1C->mode == 3) { - if (!(gUnknown_0203CF1C->unk40C4 == 0 && gUnknown_0203CF1C->unk40C6 == 4)) + if (!(gUnknown_0203CF1C->newMove == MOVE_NONE && gUnknown_0203CF1C->firstMoveIndex == MAX_MON_MOVES)) sub_81C3E9C(data[1]); } break; @@ -3328,193 +3417,44 @@ void sub_81C39F0(u8 taskId) data[0]++; } -#ifdef NONMATCHING void sub_81C3B08(u8 a) { - struct UnkSummaryStruct *r10 = gUnknown_0203CF1C; - u8 r8 = sub_81C2D2C(&gUnknown_0861CD14, 0); - u8 sp = sub_81C2D2C(&gUnknown_0861CD14, 1); - u8 r6; - u8 r5; - u8 *text; - int offset; - u16 move; - if (r10->summary.moves[a] != 0) + u8 pp; + u32 ppState; + const u8 *text; + u32 offset; + struct UnkSummaryStruct *summaryStruct = gUnknown_0203CF1C; + u8 r8 = sub_81C2D2C(gUnknown_0861CD14, 0); + u8 sp = sub_81C2D2C(gUnknown_0861CD14, 1); + u16 move = summaryStruct->summary.moves[a]; + + if (move != 0) { - move = r10->summary.moves[a]; - r6 = CalculatePPWithBonus(move, r10->summary.ppBonuses, a); - sub_81C25A4(r8, gMoveNames[move], 0, (a<<4) + 1, 0, 1); - ConvertIntToDecimalStringN(gStringVar1, r10->summary.pp[a], 1, 2); - ConvertIntToDecimalStringN(gStringVar2, r6, 1, 2); + pp = CalculatePPWithBonus(move, summaryStruct->summary.ppBonuses, a); + sub_81C25A4(r8, gMoveNames[move], 0, a * 16 + 1, 0, 1); + ConvertIntToDecimalStringN(gStringVar1, summaryStruct->summary.pp[a], 1, 2); + ConvertIntToDecimalStringN(gStringVar2, pp, 1, 2); DynamicPlaceholderTextUtil_Reset(); DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, gStringVar1); DynamicPlaceholderTextUtil_SetPlaceholderPtr(1, gStringVar2); DynamicPlaceholderTextUtil_ExpandPlaceholders(gStringVar4, gUnknown_0861CE97); text = gStringVar4; - r5 = GetCurrentPpToMaxPpState(r10->summary.pp[a], r6) + 9; + ppState = GetCurrentPpToMaxPpState(summaryStruct->summary.pp[a], pp) + 9; offset = GetStringRightAlignXOffset(1, text, 0x2C); } else { - sub_81C25A4(r8, gText_OneDash, 0, (a<<4) + 1, 0, 1); + sub_81C25A4(r8, gText_OneDash, 0, a * 16 + 1, 0, 1); text = gText_TwoDashes; - r5 = 12; + ppState = 12; offset = GetStringCenterAlignXOffset(1, text, 0x2C); } - sub_81C25A4(sp, text, offset, (a<<4), 0, r5); + sub_81C25A4(sp, text, offset, a * 16 + 1, 0, ppState); } -#else -NAKED -void sub_81C3B08(u8 a) -{ - asm(".syntax unified\n\ - push {r4-r7,lr}\n\ - mov r7, r10\n\ - mov r6, r9\n\ - mov r5, r8\n\ - push {r5-r7}\n\ - sub sp, 0xC\n\ - lsls r0, 24\n\ - lsrs r7, r0, 24\n\ - ldr r0, =gUnknown_0203CF1C\n\ - ldr r0, [r0]\n\ - mov r10, r0\n\ - ldr r4, =gUnknown_0861CD14\n\ - adds r0, r4, 0\n\ - movs r1, 0\n\ - bl sub_81C2D2C\n\ - lsls r0, 24\n\ - lsrs r0, 24\n\ - mov r8, r0\n\ - adds r0, r4, 0\n\ - movs r1, 0x1\n\ - bl sub_81C2D2C\n\ - lsls r0, 24\n\ - lsrs r0, 24\n\ - str r0, [sp, 0x8]\n\ - lsls r1, r7, 1\n\ - mov r0, r10\n\ - adds r0, 0x84\n\ - adds r0, r1\n\ - ldrh r5, [r0]\n\ - cmp r5, 0\n\ - beq _081C3C00\n\ - mov r0, r10\n\ - adds r0, 0xA4\n\ - ldrb r1, [r0]\n\ - adds r0, r5, 0\n\ - adds r2, r7, 0\n\ - bl CalculatePPWithBonus\n\ - adds r6, r0, 0\n\ - lsls r6, 24\n\ - lsrs r6, 24\n\ - movs r0, 0xD\n\ - adds r1, r5, 0\n\ - muls r1, r0\n\ - ldr r0, =gMoveNames\n\ - adds r1, r0\n\ - lsls r0, r7, 4\n\ - mov r9, r0\n\ - mov r3, r9\n\ - adds r3, 0x1\n\ - lsls r3, 24\n\ - lsrs r3, 24\n\ - movs r0, 0\n\ - str r0, [sp]\n\ - movs r0, 0x1\n\ - str r0, [sp, 0x4]\n\ - mov r0, r8\n\ - movs r2, 0\n\ - bl sub_81C25A4\n\ - ldr r0, =gStringVar1\n\ - mov r8, r0\n\ - mov r5, r10\n\ - adds r5, 0x8C\n\ - adds r5, r7\n\ - ldrb r1, [r5]\n\ - movs r2, 0x1\n\ - movs r3, 0x2\n\ - bl ConvertIntToDecimalStringN\n\ - ldr r4, =gStringVar2\n\ - adds r0, r4, 0\n\ - adds r1, r6, 0\n\ - movs r2, 0x1\n\ - movs r3, 0x2\n\ - bl ConvertIntToDecimalStringN\n\ - bl DynamicPlaceholderTextUtil_Reset\n\ - movs r0, 0\n\ - mov r1, r8\n\ - bl DynamicPlaceholderTextUtil_SetPlaceholderPtr\n\ - movs r0, 0x1\n\ - adds r1, r4, 0\n\ - bl DynamicPlaceholderTextUtil_SetPlaceholderPtr\n\ - ldr r4, =gStringVar4\n\ - ldr r1, =gUnknown_0861CE97\n\ - adds r0, r4, 0\n\ - bl DynamicPlaceholderTextUtil_ExpandPlaceholders\n\ - adds r7, r4, 0\n\ - ldrb r0, [r5]\n\ - adds r1, r6, 0\n\ - bl GetCurrentPpToMaxPpState\n\ - lsls r0, 24\n\ - lsrs r0, 24\n\ - adds r5, r0, 0\n\ - adds r5, 0x9\n\ - movs r0, 0x1\n\ - adds r1, r7, 0\n\ - movs r2, 0x2C\n\ - bl GetStringRightAlignXOffset\n\ - mov r4, r9\n\ - b _081C3C26\n\ - .pool\n\ -_081C3C00:\n\ - ldr r1, =gText_OneDash\n\ - lsls r4, r7, 4\n\ - adds r3, r4, 0x1\n\ - lsls r3, 24\n\ - lsrs r3, 24\n\ - str r5, [sp]\n\ - movs r0, 0x1\n\ - str r0, [sp, 0x4]\n\ - mov r0, r8\n\ - movs r2, 0\n\ - bl sub_81C25A4\n\ - ldr r7, =gText_TwoDashes\n\ - movs r5, 0xC\n\ - movs r0, 0x1\n\ - adds r1, r7, 0\n\ - movs r2, 0x2C\n\ - bl GetStringCenterAlignXOffset\n\ -_081C3C26:\n\ - lsls r2, r0, 24\n\ - lsrs r2, 24\n\ - adds r3, r4, 0x1\n\ - lsls r3, 24\n\ - lsrs r3, 24\n\ - movs r0, 0\n\ - str r0, [sp]\n\ - lsls r0, r5, 24\n\ - lsrs r0, 24\n\ - str r0, [sp, 0x4]\n\ - ldr r0, [sp, 0x8]\n\ - adds r1, r7, 0\n\ - bl sub_81C25A4\n\ - add sp, 0xC\n\ - pop {r3-r5}\n\ - mov r8, r3\n\ - mov r9, r4\n\ - mov r10, r5\n\ - pop {r4-r7}\n\ - pop {r0}\n\ - bx r0\n\ - .pool\n\ - .syntax divided\n"); -} -#endif void sub_81C3C5C(u16 move) { - u8 *text; + const u8 *text; if (move != 0) { FillWindowPixelRect(14, 0, 0x35, 0, 0x13, 0x20); @@ -3537,16 +3477,16 @@ void sub_81C3C5C(u16 move) } } -void sub_81C3D08() +void sub_81C3D08(void) { sub_81C3B08(0); sub_81C3B08(1); sub_81C3B08(2); sub_81C3B08(3); - if (gUnknown_0203CF1C->unk40BC == 3) + if (gUnknown_0203CF1C->mode == 3) { sub_81C3F44(); - sub_81C3E2C(gUnknown_0203CF1C->unk40C6); + sub_81C3E2C(gUnknown_0203CF1C->firstMoveIndex); } } @@ -3570,14 +3510,14 @@ void sub_81C3D54(u8 taskId) sub_81C3B08(3); break; case 4: - if (gUnknown_0203CF1C->unk40BC == 3) + if (gUnknown_0203CF1C->mode == 3) sub_81C3F44(); break; case 5: - if (gUnknown_0203CF1C->unk40BC == 3) + if (gUnknown_0203CF1C->mode == 3) { - if (!(gUnknown_0203CF1C->unk40C4 == 0 && gUnknown_0203CF1C->unk40C6 == 4)) - sub_81C3E2C(gUnknown_0203CF1C->unk40C6); + if (!(gUnknown_0203CF1C->newMove == MOVE_NONE && gUnknown_0203CF1C->firstMoveIndex == MAX_MON_MOVES)) + sub_81C3E2C(gUnknown_0203CF1C->firstMoveIndex); } break; case 6: @@ -3592,20 +3532,20 @@ void sub_81C3E2C(u8 moveSlot) u16 move; if (moveSlot == 4) - move = gUnknown_0203CF1C->unk40C4; + move = gUnknown_0203CF1C->newMove; else move = gUnknown_0203CF1C->summary.moves[moveSlot]; if (move != MOVE_NONE) { - u8 windowId = sub_81C2D2C(&gUnknown_0861CD14, 2); + u8 windowId = sub_81C2D2C(gUnknown_0861CD14, 2); sub_81C25A4(windowId, gContestEffectDescriptionPointers[gContestMoves[move].effect], 6, 1, 0, 0); } } void sub_81C3E9C(u16 move) { - u8 windowId = sub_81C2D2C(&gUnknown_0861CD14, 2); + u8 windowId = sub_81C2D2C(gUnknown_0861CD14, 2); FillWindowPixelBuffer(windowId, 0); if (move != MOVE_NONE) { @@ -3630,15 +3570,15 @@ void sub_81C3E9C(u16 move) void sub_81C3F44(void) { - u8 windowId1 = sub_81C2D2C(&gUnknown_0861CD14, 0); - u8 windowId2 = sub_81C2D2C(&gUnknown_0861CD14, 1); - if (gUnknown_0203CF1C->unk40C4 == MOVE_NONE) + u8 windowId1 = sub_81C2D2C(gUnknown_0861CD14, 0); + u8 windowId2 = sub_81C2D2C(gUnknown_0861CD14, 1); + if (gUnknown_0203CF1C->newMove == MOVE_NONE) { sub_81C25A4(windowId1, gText_Cancel, 0, 0x41, 0, 1); } else { - u16 move = gUnknown_0203CF1C->unk40C4; + u16 move = gUnknown_0203CF1C->newMove; if (gUnknown_0203CF1C->unk40C0 == 2) sub_81C25A4(windowId1, gMoveNames[move], 0, 0x41, 0, 6); else @@ -3655,15 +3595,15 @@ void sub_81C3F44(void) void sub_81C4064(void) { - u8 windowId = sub_81C2D2C(&gUnknown_0861CD14, 0); + u8 windowId = sub_81C2D2C(gUnknown_0861CD14, 0); FillWindowPixelRect(windowId, 0, 0, 0x42, 0x48, 0x10); CopyWindowToVram(windowId, 2); } void sub_81C40A0(u8 a, u8 b) { - u8 windowId1 = sub_81C2D2C(&gUnknown_0861CD14, 0); - u8 windowId2 = sub_81C2D2C(&gUnknown_0861CD14, 1); + u8 windowId1 = sub_81C2D2C(gUnknown_0861CD14, 0); + u8 windowId2 = sub_81C2D2C(gUnknown_0861CD14, 1); FillWindowPixelRect(windowId1, 0, 0, a * 16, 0x48, 0x10); FillWindowPixelRect(windowId1, 0, 0, b * 16, 0x48, 0x10); @@ -3677,7 +3617,7 @@ void sub_81C40A0(u8 a, u8 b) void sub_81C4154(void) { - u8 windowId = sub_81C2D2C(&gUnknown_0861CD14, 2); + u8 windowId = sub_81C2D2C(gUnknown_0861CD14, 2); FillWindowPixelBuffer(windowId, 0); sub_81C25A4(windowId, gText_HMMovesCantBeForgotten2, 6, 1, 0, 0); } @@ -3687,21 +3627,21 @@ void sub_81C4190(void) u8 i; for (i = 0; i < 28; i++) - gUnknown_0203CF1C->unk40D3[i] |= 0xFF; + gUnknown_0203CF1C->spriteIds[i] |= 0xFF; } void sub_81C41C0(u8 spriteArrayId) { - if (gUnknown_0203CF1C->unk40D3[spriteArrayId] != 0xFF) + if (gUnknown_0203CF1C->spriteIds[spriteArrayId] != 0xFF) { - DestroySprite(&gSprites[gUnknown_0203CF1C->unk40D3[spriteArrayId]]); - gUnknown_0203CF1C->unk40D3[spriteArrayId] = 0xFF; + DestroySprite(&gSprites[gUnknown_0203CF1C->spriteIds[spriteArrayId]]); + gUnknown_0203CF1C->spriteIds[spriteArrayId] = 0xFF; } } void sub_81C4204(u8 spriteArrayId, bool8 invisible) { - gSprites[gUnknown_0203CF1C->unk40D3[spriteArrayId]].invisible = invisible; + gSprites[gUnknown_0203CF1C->spriteIds[spriteArrayId]].invisible = invisible; } void sub_81C424C(void) @@ -3710,7 +3650,7 @@ void sub_81C424C(void) for (i = 3; i < 28; i++) { - if (gUnknown_0203CF1C->unk40D3[i] != 0xFF) + if (gUnknown_0203CF1C->spriteIds[i] != 0xFF) sub_81C4204(i, TRUE); } } @@ -3739,18 +3679,16 @@ void sub_81C42C8(void) for (i = 3; i < 8; i++) { - if (gUnknown_0203CF1C->unk40D3[i] == 0xFF) - gUnknown_0203CF1C->unk40D3[i] = CreateSprite(&gUnknown_0861CFC4, 0, 0, 2); + if (gUnknown_0203CF1C->spriteIds[i] == 0xFF) + gUnknown_0203CF1C->spriteIds[i] = CreateSprite(&gUnknown_0861CFC4, 0, 0, 2); sub_81C4204(i, TRUE); } } -extern const u8 gUnknown_0861CFDC[]; - void sub_81C4318(u8 typeId, u8 x, u8 y, u8 spriteArrayId) { - struct Sprite *sprite = &gSprites[gUnknown_0203CF1C->unk40D3[spriteArrayId]]; + struct Sprite *sprite = &gSprites[gUnknown_0203CF1C->spriteIds[spriteArrayId]]; StartSpriteAnim(sprite, typeId); sprite->oam.paletteNum = gUnknown_0861CFDC[typeId]; sprite->pos1.x = x + 16; @@ -3809,15 +3747,351 @@ void sub_81C4484(void) void sub_81C44F0(void) { - if (gUnknown_0203CF1C->unk40C4 == MOVE_NONE) + if (gUnknown_0203CF1C->newMove == MOVE_NONE) { sub_81C4204(7, TRUE); } else { if (gUnknown_0203CF1C->unk40C0 == 2) - sub_81C4318(gBattleMoves[gUnknown_0203CF1C->unk40C4].type, 0x55, 0x60, 7); + sub_81C4318(gBattleMoves[gUnknown_0203CF1C->newMove].type, 0x55, 0x60, 7); else - sub_81C4318(NUMBER_OF_MON_TYPES + gContestMoves[gUnknown_0203CF1C->unk40C4].contestCategory, 0x55, 0x60, 7); + sub_81C4318(NUMBER_OF_MON_TYPES + gContestMoves[gUnknown_0203CF1C->newMove].contestCategory, 0x55, 0x60, 7); + } +} + +void sub_81C4568(u8 a0, u8 a1) +{ + struct Sprite *sprite1 = &gSprites[gUnknown_0203CF1C->spriteIds[a0 + 3]]; + struct Sprite *sprite2 = &gSprites[gUnknown_0203CF1C->spriteIds[a1 + 3]]; + + u8 temp = sprite1->animNum; + sprite1->animNum = sprite2->animNum; + sprite2->animNum = temp; + + temp = sprite1->oam.paletteNum; + sprite1->oam.paletteNum = sprite2->oam.paletteNum; + sprite2->oam.paletteNum = temp; + + sprite1->animBeginning = TRUE; + sprite1->animEnded = FALSE; + sprite2->animBeginning = TRUE; + sprite2->animEnded = FALSE; +} + +u8 sub_81C45F4(struct Pokemon *mon, s16 *a1) +{ + const struct CompressedSpritePalette *pal; + struct PokeSummary *summary = &gUnknown_0203CF1C->summary; + + switch (*a1) + { + default: + return sub_81C47B4(mon); + case 0: + if (gMain.inBattle) + { + if (sub_80688F8(3, gUnknown_0203CF1C->curMonIndex)) + { + HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[summary->species2], gMonSpritesGfxPtr->sprites[1], summary->species2, summary->pid); + } + else + { + HandleLoadSpecialPokePic_2(&gMonFrontPicTable[summary->species2], gMonSpritesGfxPtr->sprites[1], summary->species2, summary->pid); + } + } + else + { + if (gMonSpritesGfxPtr != NULL) + { + if (gUnknown_0203CF1C->monList.mons == gPlayerParty || gUnknown_0203CF1C->mode == 2 || gUnknown_0203CF1C->unk40EF == TRUE) + { + HandleLoadSpecialPokePic_2(&gMonFrontPicTable[summary->species2], gMonSpritesGfxPtr->sprites[1], summary->species2, summary->pid); + } + else + { + HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[summary->species2], gMonSpritesGfxPtr->sprites[1], summary->species2, summary->pid); + } + } + else + { + if (gUnknown_0203CF1C->monList.mons == gPlayerParty || gUnknown_0203CF1C->mode == 2 || gUnknown_0203CF1C->unk40EF == TRUE) + { + HandleLoadSpecialPokePic_2(&gMonFrontPicTable[summary->species2], sub_806F4F8(0, 1), summary->species2, summary->pid); + } + else + { + HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[summary->species2], sub_806F4F8(0, 1), summary->species2, summary->pid); + } + } + } + (*a1)++; + return -1; + case 1: + pal = GetMonSpritePalStructFromOtIdPersonality(summary->species2, summary->OTID, summary->pid); + LoadCompressedObjectPalette(pal); + SetMultiuseSpriteTemplateToPokemon(pal->tag, 1); + (*a1)++; + return -1; + } +} + +void sub_81C4778(void) +{ + struct PokeSummary *summary = &gUnknown_0203CF1C->summary; + if (!summary->isEgg) + { + if (ShouldPlayNormalMonCry(&gUnknown_0203CF1C->currentMon) == TRUE) + { + PlayCry3(summary->species2, 0, 0); + } + else + { + PlayCry3(summary->species2, 0, 11); + } + } +} + +u8 sub_81C47B4(struct Pokemon *unused) +{ + struct PokeSummary *summary = &gUnknown_0203CF1C->summary; + u8 spriteId = CreateSprite(&gMultiuseSpriteTemplate, 40, 64, 5); + struct Sprite *sprite = &gSprites[spriteId]; + + FreeSpriteOamMatrix(sprite); + + sprite->data[0] = summary->species2; + sprite->data[2] = 0; + gSprites[spriteId].callback = sub_81C4844; + sprite->oam.priority = 0; + + if (!IsMonSpriteNotFlipped(summary->species2)) + { + sprite->hFlip = TRUE; + } + else + { + sprite->hFlip = FALSE; + } + + return spriteId; +} + +void sub_81C4844(struct Sprite *sprite) +{ + struct PokeSummary *summary = &gUnknown_0203CF1C->summary; + + if (!gPaletteFade.active && sprite->data[2] != 1) + { + sprite->data[1] = IsMonSpriteNotFlipped(sprite->data[0]); + sub_81C4778(); + PokemonSummaryDoMonAnimation(sprite, sprite->data[0], summary->isEgg); + } +} + +void sub_81C488C(u8 a0) +{ + sUnusedTaskId = a0; +} + +void sub_81C4898(void) +{ + if (sUnusedTaskId != 0xFF) + { + DestroyTask(sUnusedTaskId); + sUnusedTaskId = 0xFF; + } +} + +bool32 sub_81C48B4(void) +{ + if (gSprites[gUnknown_0203CF1C->spriteIds[0]].callback == SpriteCallbackDummy) + { + return FALSE; + } + else + { + return TRUE; + } +} + +void sub_81C48F0(void) +{ + u16 i; + u16 paletteIndex; + + gSprites[gUnknown_0203CF1C->spriteIds[0]].animPaused = TRUE; + gSprites[gUnknown_0203CF1C->spriteIds[0]].callback = SpriteCallbackDummy; + sub_806EE98(); + + paletteIndex = (gSprites[gUnknown_0203CF1C->spriteIds[0]].oam.paletteNum * 16) | 0x100; + + for (i = 0; i < 16; i++) + { + gPlttBufferUnfaded[(u16)(i + paletteIndex)] = gPlttBufferFaded[(u16)(i + paletteIndex)]; + } +} + +void sub_81C4984(struct Pokemon *mon) +{ + struct Sprite *sprite = sub_811FF94(30003, 30003, gUnknown_0861D120); + + gUnknown_0203CF1C->markingsSpriteId = sprite; + + if (sprite != NULL) + { + StartSpriteAnim(sprite, GetMonData(mon, MON_DATA_MARKINGS)); + gUnknown_0203CF1C->markingsSpriteId->pos1.x = 60; + gUnknown_0203CF1C->markingsSpriteId->pos1.y = 26; + gUnknown_0203CF1C->markingsSpriteId->oam.priority = 1; + } +} + +void sub_81C49E0(struct Pokemon *mon) +{ + DestroySprite(gUnknown_0203CF1C->markingsSpriteId); + FreeSpriteTilesByTag(30003); + sub_81C4984(mon); +} + +void sub_81C4A08(struct Pokemon *mon) +{ + u8 ball = ItemIdToBallId(GetMonData(mon, MON_DATA_POKEBALL)); + + LoadBallGfx(ball); + gUnknown_0203CF1C->spriteIds[1] = CreateSprite(&gBallSpriteTemplates[ball], 16, 136, 0); + gSprites[gUnknown_0203CF1C->spriteIds[1]].callback = SpriteCallbackDummy; + gSprites[gUnknown_0203CF1C->spriteIds[1]].oam.priority = 3; +} + +void sub_81C4A88(void) +{ + u8 *spriteId = &gUnknown_0203CF1C->spriteIds[2]; + u8 anim; + + if (*spriteId == 0xFF) + { + *spriteId = CreateSprite(&gUnknown_0861D108, 64, 152, 0); + } + + anim = sub_81B205C(&gUnknown_0203CF1C->currentMon); + + if (anim != 0) + { + StartSpriteAnim(&gSprites[*spriteId], anim - 1); + sub_81C4204(2, FALSE); + } + else + { + sub_81C4204(2, TRUE); + } +} + +void sub_81C4AF8(u8 a0) +{ + u8 i; + u8 *spriteIds = &gUnknown_0203CF1C->spriteIds[a0]; + + if (gUnknown_0203CF1C->unk40C0 > 1) + { + u8 subsprite = 0; + if (a0 == 8) + { + subsprite = 1; + } + + for (i = 0; i < 10; i++) + { + spriteIds[i] = CreateSprite(&gUnknown_0861D084, i * 16 + 89, 40, subsprite); + if (i == 0) + { + StartSpriteAnim(&gSprites[spriteIds[0]], 4); + } + else if (i == 9) + { + StartSpriteAnim(&gSprites[spriteIds[9]], 5); + } + else + { + StartSpriteAnim(&gSprites[spriteIds[i]], 6); + } + gSprites[spriteIds[i]].callback = sub_81C4BE4; + gSprites[spriteIds[i]].data[0] = a0; + gSprites[spriteIds[i]].data[1] = 0; + } + } +} + +void sub_81C4BE4(struct Sprite *sprite) +{ + if (sprite->animNum > 3 && sprite->animNum < 7) + { + sprite->data[1] = (sprite->data[1] + 1) & 0x1F; + if (sprite->data[1] > 24) + { + sprite->invisible = TRUE; + } + else + { + sprite->invisible = FALSE; + } + } + else + { + sprite->data[1] = 0; + sprite->invisible = FALSE; + } + + if (sprite->data[0] == 8) + { + sprite->pos2.y = gUnknown_0203CF1C->firstMoveIndex * 16; + } + else + { + sprite->pos2.y = gUnknown_0203CF1C->secondMoveIndex * 16; + } +} + +void sub_81C4C60(u8 a0) +{ + u8 i; + for (i = 0; i < 10; i++) + { + sub_81C41C0(a0 + i); + } +} + +void sub_81C4C84(u8 a0) +{ + u8 i; + u8 *spriteIds = &gUnknown_0203CF1C->spriteIds[8]; + a0 *= 3; + + for (i = 0; i < 10; i++) + { + if (i == 0) + { + StartSpriteAnim(&gSprites[spriteIds[0]], a0 + 4); + } + else if (i == 9) + { + StartSpriteAnim(&gSprites[spriteIds[9]], a0 + 5); + } + else + { + StartSpriteAnim(&gSprites[spriteIds[i]], a0 + 6); + } + } +} + +void sub_81C4D18(u8 a0) +{ + u8 i; + u8 *spriteIds = &gUnknown_0203CF1C->spriteIds[a0]; + + for (i = 0; i < 10; i++) + { + gSprites[spriteIds[i]].data[1] = 0; + gSprites[spriteIds[i]].invisible = FALSE; } } diff --git a/src/unk_pokedex_area_screen_helper.c b/src/unk_pokedex_area_screen_helper.c new file mode 100644 index 000000000..3bed79a65 --- /dev/null +++ b/src/unk_pokedex_area_screen_helper.c @@ -0,0 +1,75 @@ +#include "global.h" +#include "main.h" +#include "menu.h" +#include "bg.h" +#include "malloc.h" +#include "palette.h" + +EWRAM_DATA u8 *gUnknown_0203CF28 = NULL; + +static const u16 gUnknown_0861D140[] = INCBIN_U16("graphics/interface/region_map.gbapal"); +extern const u8 gUnknown_0861D1A0[]; +extern const u8 gUnknown_0861DEF4[]; +extern const u8 gUnknown_0861E208[]; +extern const u8 gUnknown_0861EF64[]; + +struct UnkStruct_1C4D70 +{ + u32 bg:2; + u32 unk2:8; + u32 unk10:2; + u32 unk12:20; +}; + +void sub_81C4D70(struct UnkStruct_1C4D70 *template) +{ + u8 unk; + gUnknown_0203CF28 = Alloc(4); + unk = template->unk10; + + if (unk == 0) + { + SetBgAttribute(template->bg, BG_CTRL_ATTR_WRAPAROUND, 0); + decompress_and_copy_tile_data_to_vram(template->bg, gUnknown_0861D1A0, 0, template->unk2, unk); + sub_8199D3C(decompress_and_copy_tile_data_to_vram(template->bg, gUnknown_0861DEF4, 0, 0, 1), template->unk2, 32, 32, unk); + } + else + { + SetBgAttribute(template->bg, BG_CTRL_ATTR_WRAPAROUND, 2); + SetBgAttribute(template->bg, 9, 1); + decompress_and_copy_tile_data_to_vram(template->bg, gUnknown_0861E208, 0, template->unk2, 0); + sub_8199D3C(decompress_and_copy_tile_data_to_vram(template->bg, gUnknown_0861EF64, 0, 0, 1), template->unk2, 64, 64, 1); + } + + ChangeBgX(template->bg, 0, 0); + ChangeBgY(template->bg, 0, 0); + SetBgAttribute(template->bg, BG_CTRL_ATTR_SCREENSIZE, 1); + CpuCopy32(gUnknown_0861D140, &gPlttBufferUnfaded[0x70], 0x60); + *gUnknown_0203CF28 = template->bg; +} + +bool32 sub_81C4E90(void) +{ + if (!free_temp_tile_data_buffers_if_possible()) + { + ShowBg(*gUnknown_0203CF28); + return FALSE; + } + else + { + return TRUE; + } +} + +void sub_81C4EB4(void) +{ + if (gUnknown_0203CF28 != NULL) + { + FREE_AND_SET_NULL(gUnknown_0203CF28); + } +} + +void sub_81C4ED0(u32 a0) +{ + ChangeBgY(*gUnknown_0203CF28, a0 * 0x100, 0); +} diff --git a/sym_ewram.txt b/sym_ewram.txt index cf1c8b8d7..b54d52f90 100644 --- a/sym_ewram.txt +++ b/sym_ewram.txt @@ -739,30 +739,9 @@ gUnknown_0203CF00: @ 203CF00 .include "src/fossil_specials.o" .include "src/fldeff_groundshake.o" - -gUnknown_0203CF1C: @ 203CF1C - .space 0x4 - -gUnknown_0203CF20: @ 203CF20 - .space 0x1 - -gUnknown_0203CF21: @ 203CF21 - .space 0x3 - -gUnknown_0203CF24: @ 203CF24 - .space 0x4 - -gUnknown_0203CF28: @ 203CF28 - .space 0x4 - -gUnknown_0203CF2C: @ 203CF2C - .space 0x4 - -gUnknown_0203CF30: @ 203CF30 - .space 0x8 - -gUnknown_0203CF38: @ 203CF38 - .space 0x4 + .include "src/pokemon_summary_screen.o" + .include "src/unk_pokedex_area_screen_helper.o" + .include "src/battle_pyramid.o" gUnknown_0203CF3C: @ 203CF3C .space 0x4