diff --git a/asm/pokemon_summary_screen.s b/asm/pokemon_summary_screen.s index 862fb3d5bf..7f1a1e48f9 100755 --- a/asm/pokemon_summary_screen.s +++ b/asm/pokemon_summary_screen.s @@ -5,481 +5,6 @@ .text - thumb_func_start sub_81C1070 -sub_81C1070: @ 81C1070 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r7, r0, 0 - adds r4, r1, 0 - mov r8, r2 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x5 - bl PlaySE - mov r0, r8 - ldrb r6, [r0] - movs r2, 0 - lsls r4, 24 - asrs r4, 24 - mov r12, r4 - movs r1, 0 - ldrsh r4, [r7, r1] - ldrb r0, [r7] - lsls r3, r0, 24 -_081C109C: - lsls r0, r6, 24 - asrs r0, 24 - add r0, r12 - lsls r0, 24 - lsrs r6, r0, 24 - asrs r0, 24 - cmp r0, r4 - ble _081C10B0 - movs r6, 0 - b _081C10B6 -_081C10B0: - cmp r0, 0 - bge _081C10B6 - lsrs r6, r3, 24 -_081C10B6: - lsls r0, r6, 24 - asrs r1, r0, 24 - mov r9, r0 - cmp r1, 0x4 - bne _081C10C2 - b _081C11CC -_081C10C2: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - lsls r1, 1 - adds r0, 0x84 - adds r0, r1 - ldrh r5, [r0] - cmp r5, 0 - bne _081C10E2 - lsls r0, r2, 24 - movs r1, 0x80 - lsls r1, 17 - adds r0, r1 - lsrs r2, r0, 24 - asrs r0, 24 - cmp r0, 0x3 - ble _081C109C -_081C10E2: - adds r0, r5, 0 - bl sub_81C240C - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - adds r0, r5, 0 - bl sub_81C3E9C - mov r1, r8 - ldrb r0, [r1] - cmp r0, 0x4 - bne _081C1110 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040c4 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0 - beq _081C1118 -_081C1110: - movs r1, 0x2 - ldrsh r0, [r7, r1] - cmp r0, 0x1 - bne _081C115E -_081C1118: - movs r0, 0x13 - bl ClearWindowTilemap - ldr r2, =gSprites - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040d5 - adds r0, r1 - ldrb r1, [r0] - lsls r0, r1, 4 - adds r0, r1 - lsls r0, 2 - adds r0, r2 - adds r0, 0x3E - ldrb r0, [r0] - lsls r0, 29 - cmp r0, 0 - blt _081C1142 - movs r0, 0xD - bl ClearWindowTilemap -_081C1142: - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r4, 0x3 - negs r4, r4 - movs r0, 0x9 - adds r1, r4, 0 - bl sub_81C1DA4 - movs r0, 0x9 - adds r1, r4, 0 - adds r2, r5, 0 - bl sub_81C1EFC -_081C115E: - mov r1, r8 - ldrb r0, [r1] - cmp r0, 0x4 - beq _081C11A0 - mov r1, r9 - asrs r0, r1, 24 - cmp r0, 0x4 - bne _081C11A0 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040c4 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0 - bne _081C11A0 - movs r0, 0xE - bl ClearWindowTilemap - movs r0, 0xF - bl ClearWindowTilemap - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0 - movs r1, 0x3 - bl sub_81C1DA4 - movs r0, 0 - movs r1, 0x3 - movs r2, 0 - bl sub_81C1EFC -_081C11A0: - mov r0, r8 - strb r6, [r0] - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040c6 - adds r0, r1 - cmp r8, r0 - bne _081C11E0 - movs r0, 0x8 - bl sub_81C4D18 - b _081C11E6 - .pool -_081C11CC: - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r1, =0x000040c4 - adds r0, r1 - ldrh r5, [r0] - b _081C10E2 - .pool -_081C11E0: - movs r0, 0x12 - bl sub_81C4D18 -_081C11E6: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_81C1070 - - thumb_func_start sub_81C11F4 -sub_81C11F4: @ 81C11F4 - push {r4,r5,lr} - lsls r0, 24 - lsrs r5, r0, 24 - movs r0, 0x8 - bl sub_81C4C60 - movs r0, 0x6 - bl ClearWindowTilemap - movs r0, 0x5 - bl PutWindowTilemap - movs r0, 0 - bl sub_81C3E9C - ldr r4, =gUnknown_0203CF1C - ldr r0, [r4] - ldr r1, =0x000020bc - adds r0, r1 - movs r1, 0x3 - movs r2, 0x1 - bl sub_81C2194 - ldr r0, [r4] - ldr r1, =0x000030bc - adds r0, r1 - movs r1, 0x1 - movs r2, 0x1 - bl sub_81C2194 - bl sub_81C4064 - ldr r0, [r4] - ldr r1, =0x000040c6 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0x4 - beq _081C125E - movs r0, 0xE - bl ClearWindowTilemap - movs r0, 0xF - bl ClearWindowTilemap - movs r0, 0 - movs r1, 0x3 - bl sub_81C1DA4 - movs r0, 0 - movs r1, 0x3 - movs r2, 0 - bl sub_81C1EFC -_081C125E: - movs r0, 0 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r0, =gTasks - lsls r1, r5, 2 - adds r1, r5 - lsls r1, 3 - adds r1, r0 - ldr r0, =sub_81C0510 - str r0, [r1] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C11F4 - - thumb_func_start sub_81C129C -sub_81C129C: @ 81C129C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r2, =0x000040c6 - adds r1, r0, r2 - ldrb r1, [r1] - adds r2, 0x1 - adds r0, r2 - strb r1, [r0] - movs r0, 0x1 - bl sub_81C4C84 - movs r0, 0x12 - bl sub_81C4AF8 - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81C12E4 - str r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C129C - - thumb_func_start sub_81C12E4 -sub_81C12E4: @ 81C12E4 - push {r4-r6,lr} - lsls r0, 24 - lsrs r5, r0, 24 - adds r6, r5, 0 - lsls r0, r5, 2 - adds r0, r5 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - bl sub_81221EC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _081C13AA - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _081C1338 - movs r0, 0x3 - strh r0, [r4] - movs r1, 0x1 - negs r1, r1 - ldr r0, =gUnknown_0203CF1C - ldr r2, [r0] - ldr r0, =0x000040c7 - adds r2, r0 - adds r0, r4, 0 - bl sub_81C1070 - b _081C13AA - .pool -_081C1338: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _081C1360 - movs r0, 0x3 - strh r0, [r4] - ldr r0, =gUnknown_0203CF1C - ldr r2, [r0] - ldr r0, =0x000040c7 - adds r2, r0 - adds r0, r4, 0 - movs r1, 0x1 - bl sub_81C1070 - b _081C13AA - .pool -_081C1360: - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _081C139A - ldr r0, =gUnknown_0203CF1C - ldr r0, [r0] - ldr r2, =0x000040c6 - adds r1, r0, r2 - adds r2, 0x1 - adds r0, r2 - ldrb r1, [r1] - ldrb r0, [r0] - cmp r1, r0 - bne _081C1390 - adds r0, r5, 0 - movs r1, 0 - bl sub_81C13B0 - b _081C13AA - .pool -_081C1390: - adds r0, r5, 0 - movs r1, 0x1 - bl sub_81C13B0 - b _081C13AA -_081C139A: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _081C13AA - adds r0, r6, 0 - movs r1, 0 - bl sub_81C13B0 -_081C13AA: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_81C12E4 - - thumb_func_start sub_81C13B0 -sub_81C13B0: @ 81C13B0 - push {r4-r7,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r7, r0, 24 - lsls r4, 24 - lsrs r4, 24 - movs r0, 0x5 - bl PlaySE - movs r0, 0 - bl sub_81C4C84 - movs r0, 0x12 - bl sub_81C4C60 - cmp r4, 0x1 - bne _081C1464 - ldr r0, =gUnknown_0203CF1C - ldr r3, [r0] - ldr r1, =0x000040bd - adds r0, r3, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _081C1410 - ldr r0, [r3] - ldr r2, =0x000040be - adds r1, r3, r2 - ldrb r2, [r1] - movs r1, 0x64 - muls r1, r2 - adds r0, r1 - ldr r4, =0x000040c6 - adds r1, r3, r4 - ldrb r1, [r1] - adds r4, 0x1 - adds r2, r3, r4 - ldrb r2, [r2] - bl sub_81C14BC - b _081C1430 - .pool -_081C1410: - ldr r0, [r3] - ldr r2, =0x000040be - adds r1, r3, r2 - ldrb r2, [r1] - lsls r1, r2, 2 - adds r1, r2 - lsls r1, 4 - adds r0, r1 - ldr r4, =0x000040c6 - adds r1, r3, r4 - ldrb r1, [r1] - adds r4, 0x1 - adds r2, r3, r4 - ldrb r2, [r2] - bl sub_81C15EC -_081C1430: - ldr r5, =gUnknown_0203CF1C - ldr r0, [r5] - adds r0, 0xC - bl sub_81C0098 - ldr r1, [r5] - ldr r6, =0x000040c6 - adds r0, r1, r6 - ldrb r0, [r0] - ldr r4, =0x000040c7 - adds r1, r4 - ldrb r1, [r1] - bl sub_81C40A0 - ldr r1, [r5] - adds r0, r1, r6 - ldrb r0, [r0] - adds r1, r4 - ldrb r1, [r1] - bl sub_81C4568 - ldr r0, [r5] - adds r4, r0, r4 - ldrb r1, [r4] - adds r0, r6 - strb r1, [r0] -_081C1464: - ldr r0, =gUnknown_0203CF1C - ldr r1, [r0] - ldr r2, =0x000040c6 - adds r0, r1, r2 - ldrb r0, [r0] - lsls r0, 1 - adds r1, 0x84 - adds r1, r0 - ldrh r4, [r1] - adds r0, r4, 0 - bl sub_81C3E9C - adds r0, r4, 0 - bl sub_81C240C - movs r0, 0x1 - bl schedule_bg_copy_tilemap_to_vram - movs r0, 0x2 - bl schedule_bg_copy_tilemap_to_vram - ldr r1, =gTasks - lsls r0, r7, 2 - adds r0, r7 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_81C0F44 - str r1, [r0] - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_81C13B0 - thumb_func_start sub_81C14BC sub_81C14BC: @ 81C14BC push {r4-r7,lr} diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index 9c4647cf05..5499706249 100755 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -18,6 +18,7 @@ extern struct BgTemplate gUnknown_0861CBB4; extern u8 gUnknown_0203CF20; extern struct MusicPlayerInfo gMPlay_BGM; extern s8 gUnknown_0861CC1C[]; +extern u8 gUnknown_08329D22[]; extern void sub_806F2AC(u8 a, u8 b); void sub_81C488C(u8 a); @@ -61,7 +62,7 @@ u8 sub_81BFEB0(); void sub_81C2554(); void sub_81C1BA0(); void sub_81C0098(struct Pokemon* a); -u8 sub_81C00F0(struct Pokemon* a); +bool8 sub_81C00F0(struct Pokemon* a); void sub_81C25E8(); void sub_81C286C(); void sub_81C2D9C(u8 a); @@ -98,7 +99,7 @@ s8 sub_81C09B4(s8 a); s8 sub_81C08F8(s8 a); void sub_81C4204(u8 a, u8 b); void sub_81C20F0(u8 taskId); -u8 sub_81C0A50(struct Pokemon* mon); +bool8 sub_81C0A50(struct Pokemon* mon); void sub_81C49E0(); void sub_81C0E24(); void sub_81C2C38(); @@ -117,24 +118,33 @@ void sub_81C4AF8(u8 a); void sub_81C1070(s16* a, s8 b, u8* c); void sub_81C11F4(u8 a); void sub_81C129C(u8 a); -u8 sub_81C1040(); - +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 SetBgAttribute(u8 bg, u8 attributeId, u8 value); -u8 sub_81BFB10(); +bool8 sub_81BFB10(); u8 sub_81B1250(); -union unkUnion{ +union unkUnion +{ struct Pokemon mons[6]; struct BoxPokemon boxMons[6]; }; - u8 sub_80D214C(union unkUnion* a, u8 b, u8 c, u8 d); -struct pokeSummary{ +struct pokeSummary +{ u16 species; // 0x0 u16 species2; // 0x2 u8 isEgg; // 0x4 @@ -167,12 +177,13 @@ struct pokeSummary{ u32 OTID; // 0x48 }; -struct unkSummaryStruct{ - union unkUnion* unk0; - void* unk4; - void* unk8; - struct Pokemon currentPoke; - struct pokeSummary summary; +struct unkSummaryStruct +{ + /*0x00*/ union unkUnion *unk0; + /*0x04*/ void *unk4; + /*0x08*/ void *unk8; + /*0x0C*/ struct Pokemon currentPoke; + /*0x70*/ struct pokeSummary summary; u8 unkTilemap0[0x800]; u8 unkTilemap0_1[0x800]; u8 unkTilemap1[0x800]; @@ -189,16 +200,9 @@ struct unkSummaryStruct{ u8 unk40C1; u8 unk40C2; u8 unk40C3; - union -{ - struct - { - u16 unk40C4; - u8 unk40C6; - u8 unkfiller3; - } fooFiller; - u32 loadThis; -} unionThing; + u16 unk40C4; + u8 unk40C6; + u8 unk40C7; u8 unk40C8; u8 unk40C9; u8 unk_filler2[0x9]; @@ -211,7 +215,7 @@ struct unkSummaryStruct{ u8 unk_filler4[6]; }; -void sub_81BF8EC(u8 a, void* b, u8 c, u8 d, void* e) +void sub_81BF8EC(u8 a, void *b, u8 c, u8 d, void *e) { u8 byte; gUnknown_0203CF1C = AllocZeroed(0x40F8); @@ -226,21 +230,21 @@ void sub_81BF8EC(u8 a, void* b, u8 c, u8 d, void* e) gUnknown_0203CF1C->unk40BD = 0; switch (a) { - case 0: - case 2: - gUnknown_0203CF1C->unk40C1 = 0; - gUnknown_0203CF1C->unk40C2 = 3; - break; - case 1: - gUnknown_0203CF1C->unk40C1 = 0; - gUnknown_0203CF1C->unk40C2 = 3; - gUnknown_0203CF1C->unk40C8 = 1; - break; - case 3: - gUnknown_0203CF1C->unk40C1 = 2; - gUnknown_0203CF1C->unk40C2 = 3; - gUnknown_0203CF1C->unk40C3 = 1; - break; + case 0: + case 2: + gUnknown_0203CF1C->unk40C1 = 0; + gUnknown_0203CF1C->unk40C2 = 3; + break; + case 1: + gUnknown_0203CF1C->unk40C1 = 0; + gUnknown_0203CF1C->unk40C2 = 3; + gUnknown_0203CF1C->unk40C8 = 1; + break; + case 3: + gUnknown_0203CF1C->unk40C1 = 2; + gUnknown_0203CF1C->unk40C2 = 3; + gUnknown_0203CF1C->unk40C3 = 1; + break; } byte = gUnknown_0203CF1C->unk40C1; gUnknown_0203CF1C->unk40C0 = byte; @@ -250,13 +254,13 @@ void sub_81BF8EC(u8 a, void* b, u8 c, u8 d, void* e) SetMainCallback2(sub_81BFAE4); } -void sub_81BFA38(void* a, u8 b, u8 c, void* d, u16 e) +void sub_81BFA38(void *a, u8 b, u8 c, void *d, u16 e) { sub_81BF8EC(3, a, b, c, d); - gUnknown_0203CF1C->unionThing.fooFiller.unk40C4 = e; + gUnknown_0203CF1C->unk40C4 = e; } -void sub_81BFA80(u8 a, void* b, u8 c, u8 d, void* e) +void sub_81BFA80(u8 a, void *b, u8 c, u8 d, void *e) { sub_81BF8EC(a, b, c, d, e); gUnknown_0203CF1C->unk40EF = 1; @@ -280,138 +284,138 @@ void sub_81BFAD0(void) void sub_81BFAE4() { - while(1) + while (1) { - if (sub_81221EC() == 1 || sub_81BFB10() == 1 || sub_81221AC() == 1) + if (sub_81221EC() == 1 || sub_81BFB10() == TRUE || sub_81221AC() == 1) break; } } -u8 sub_81BFB10() +bool8 sub_81BFB10(void) { - switch (gMain.state) + switch (gMain.state) + { + case 0: + SetVBlankHBlankCallbacksToNull(); + sub_8121DA0(); + clear_scheduled_bg_copies_to_vram(); + gMain.state++; + break; + case 1: + remove_some_task(); + gMain.state++; + break; + case 2: + ResetPaletteFade(); + gPaletteFade.bufferTransferDisabled = 1; + gMain.state++; + break; + case 3: + ResetSpriteData(); + gMain.state++; + break; + case 4: + FreeAllSpritePalettes(); + gMain.state++; + break; + case 5: + sub_81BFE24(); + gUnknown_0203CF1C->unk40F0 = 0; + gMain.state++; + break; + case 6: + if (sub_81BFEB0() != 0) + gMain.state++; + break; + case 7: + sub_81C2554(); + gMain.state++; + break; + case 8: + sub_81C1BA0(); + gMain.state++; + break; + case 9: + sub_81C0098(&gUnknown_0203CF1C->currentPoke); + gUnknown_0203CF1C->unk40F0 = 0; + gMain.state++; + break; + case 10: + if (sub_81C00F0(&gUnknown_0203CF1C->currentPoke) != 0) + gMain.state++; + break; + case 11: + sub_81C25E8(); + gMain.state++; + break; + case 12: + sub_81C286C(); + gMain.state++; + break; + case 13: + sub_81C2D9C(gUnknown_0203CF1C->unk40C0); + gMain.state++; + break; + case 14: + sub_81C0348(); + gMain.state++; + break; + case 15: + sub_81C2AFC(gUnknown_0203CF1C->unk40C0); + gMain.state++; + break; + case 16: + sub_81C4190(); + sub_81C42C8(); + gUnknown_0203CF1C->unk40F0 = 0; + gMain.state++; + break; + case 17: + gUnknown_0203CF1C->unk40D3 = sub_81C45F4(&gUnknown_0203CF1C->currentPoke, &gUnknown_0203CF1C->unk40F0); + if (gUnknown_0203CF1C->unk40D3 != 0xFF) { - case 0: - SetVBlankHBlankCallbacksToNull(); - sub_8121DA0(); - clear_scheduled_bg_copies_to_vram(); - gMain.state++; - break; - case 1: - remove_some_task(); - gMain.state++; - break; - case 2: - ResetPaletteFade(); - gPaletteFade.bufferTransferDisabled = 1; - gMain.state++; - break; - case 3: - ResetSpriteData(); - gMain.state++; - break; - case 4: - FreeAllSpritePalettes(); - gMain.state++; - break; - case 5: - sub_81BFE24(); - gUnknown_0203CF1C->unk40F0 = 0; - gMain.state++; - break; - case 6: - if (sub_81BFEB0() != 0) - gMain.state++; - break; - case 7: - sub_81C2554(); - gMain.state++; - break; - case 8: - sub_81C1BA0(); - gMain.state++; - break; - case 9: - sub_81C0098(&gUnknown_0203CF1C->currentPoke); - gUnknown_0203CF1C->unk40F0 = 0; - gMain.state++; - break; - case 10: - if(sub_81C00F0(&gUnknown_0203CF1C->currentPoke) != 0) - gMain.state++; - break; - case 11: - sub_81C25E8(); - gMain.state++; - break; - case 12: - sub_81C286C(); - gMain.state++; - break; - case 13: - sub_81C2D9C(gUnknown_0203CF1C->unk40C0); - gMain.state++; - break; - case 14: - sub_81C0348(); - gMain.state++; - break; - case 15: - sub_81C2AFC(gUnknown_0203CF1C->unk40C0); - gMain.state++; - break; - case 16: - sub_81C4190(); - sub_81C42C8(); - gUnknown_0203CF1C->unk40F0 = 0; - gMain.state++; - break; - case 17: - gUnknown_0203CF1C->unk40D3 = sub_81C45F4(&gUnknown_0203CF1C->currentPoke, &gUnknown_0203CF1C->unk40F0); - if (gUnknown_0203CF1C->unk40D3 != 0xFF) - { - gUnknown_0203CF1C->unk40F0 = 0; - gMain.state++; - } - break; - case 18: - sub_81C4984(&gUnknown_0203CF1C->currentPoke); - gMain.state++; - break; - case 19: - sub_81C4A08(&gUnknown_0203CF1C->currentPoke); - gMain.state++; - break; - case 20: - sub_81C4A88(); - gMain.state++; - break; - case 21: - sub_81C4280(); - gMain.state++; - break; - case 22: - if (gUnknown_0203CF1C->unk40BC != 3) - CreateTask(sub_81C0510, 0); - else - CreateTask(sub_81C171C, 0); - gMain.state++; - break; - case 23: - BlendPalettes(-1, 16, 0); - gMain.state++; - break; - case 24: - BeginNormalPaletteFade(-1, 0, 16, 0, 0); - gPaletteFade.bufferTransferDisabled = 0; - gMain.state++; - break; - default: - SetVBlankCallback(sub_81BFAD0); - SetMainCallback2(sub_81BFAB4); - return 1; + gUnknown_0203CF1C->unk40F0 = 0; + gMain.state++; } - return 0; + break; + case 18: + sub_81C4984(&gUnknown_0203CF1C->currentPoke); + gMain.state++; + break; + case 19: + sub_81C4A08(&gUnknown_0203CF1C->currentPoke); + gMain.state++; + break; + case 20: + sub_81C4A88(); + gMain.state++; + break; + case 21: + sub_81C4280(); + gMain.state++; + break; + case 22: + if (gUnknown_0203CF1C->unk40BC != 3) + CreateTask(sub_81C0510, 0); + else + CreateTask(sub_81C171C, 0); + gMain.state++; + break; + case 23: + BlendPalettes(-1, 16, 0); + gMain.state++; + break; + case 24: + BeginNormalPaletteFade(-1, 0, 16, 0, 0); + gPaletteFade.bufferTransferDisabled = 0; + gMain.state++; + break; + default: + SetVBlankCallback(sub_81BFAD0); + SetMainCallback2(sub_81BFAB4); + return TRUE; + } + return FALSE; } void sub_81BFE24() @@ -437,68 +441,68 @@ u8 sub_81BFEB0() { switch (gUnknown_0203CF1C->unk40F0) { - case 0: - reset_temp_tile_data_buffers(); - decompress_and_copy_tile_data_to_vram(1, &gUnknown_08D97D0C, 0, 0, 0); + case 0: + reset_temp_tile_data_buffers(); + decompress_and_copy_tile_data_to_vram(1, &gUnknown_08D97D0C, 0, 0, 0); + gUnknown_0203CF1C->unk40F0++; + break; + case 1: + if (free_temp_tile_data_buffers_if_possible() != 1) + { + LZDecompressWram(&gUnknown_08D9862C, gUnknown_0203CF1C->unkTilemap0); gUnknown_0203CF1C->unk40F0++; - break; - case 1: - if (free_temp_tile_data_buffers_if_possible() != 1) - { - LZDecompressWram(&gUnknown_08D9862C, gUnknown_0203CF1C->unkTilemap0); - gUnknown_0203CF1C->unk40F0++; - } - break; - case 2: - LZDecompressWram(&gUnknown_08D98CC8, gUnknown_0203CF1C->unkTilemap0_1); - gUnknown_0203CF1C->unk40F0++; - break; - case 3: - LZDecompressWram(&gUnknown_08D987FC, gUnknown_0203CF1C->unkTilemap1_1); - gUnknown_0203CF1C->unk40F0++; - break; - case 4: - LZDecompressWram(&gUnknown_08D9898C, gUnknown_0203CF1C->unkTilemap2_1); - gUnknown_0203CF1C->unk40F0++; - break; - case 5: - LZDecompressWram(&gUnknown_08D98B28, gUnknown_0203CF1C->unkTilemap3_1); - gUnknown_0203CF1C->unk40F0++; - break; - case 6: - LoadCompressedPalette(&gUnknown_08D9853C, 0, 0x100); - LoadPalette(&gUnknown_08D85620, 0x81, 0x1E); - gUnknown_0203CF1C->unk40F0++; - break; - case 7: - LoadCompressedObjectPic(&gUnknown_0861CFBC); - gUnknown_0203CF1C->unk40F0++; - break; - case 8: - LoadCompressedObjectPic(&gUnknown_0861D074); - gUnknown_0203CF1C->unk40F0++; - break; - case 9: - LoadCompressedObjectPic(&gUnknown_0861D0F8); - gUnknown_0203CF1C->unk40F0++; - break; - case 10: - LoadCompressedObjectPalette(&gUnknown_0861D100); - gUnknown_0203CF1C->unk40F0++; - break; - case 11: - LoadCompressedObjectPalette(&gUnknown_0861D07C); - gUnknown_0203CF1C->unk40F0++; - break; - case 12: - LoadCompressedPalette(&gUnknown_08D97B84, 0x1D0, 0x60); - gUnknown_0203CF1C->unk40F0 = 0; - return 1; + } + break; + case 2: + LZDecompressWram(&gUnknown_08D98CC8, gUnknown_0203CF1C->unkTilemap0_1); + gUnknown_0203CF1C->unk40F0++; + break; + case 3: + LZDecompressWram(&gUnknown_08D987FC, gUnknown_0203CF1C->unkTilemap1_1); + gUnknown_0203CF1C->unk40F0++; + break; + case 4: + LZDecompressWram(&gUnknown_08D9898C, gUnknown_0203CF1C->unkTilemap2_1); + gUnknown_0203CF1C->unk40F0++; + break; + case 5: + LZDecompressWram(&gUnknown_08D98B28, gUnknown_0203CF1C->unkTilemap3_1); + gUnknown_0203CF1C->unk40F0++; + break; + case 6: + LoadCompressedPalette(&gUnknown_08D9853C, 0, 0x100); + LoadPalette(&gUnknown_08D85620, 0x81, 0x1E); + gUnknown_0203CF1C->unk40F0++; + break; + case 7: + LoadCompressedObjectPic(&gUnknown_0861CFBC); + gUnknown_0203CF1C->unk40F0++; + break; + case 8: + LoadCompressedObjectPic(&gUnknown_0861D074); + gUnknown_0203CF1C->unk40F0++; + break; + case 9: + LoadCompressedObjectPic(&gUnknown_0861D0F8); + gUnknown_0203CF1C->unk40F0++; + break; + case 10: + LoadCompressedObjectPalette(&gUnknown_0861D100); + gUnknown_0203CF1C->unk40F0++; + break; + case 11: + LoadCompressedObjectPalette(&gUnknown_0861D07C); + gUnknown_0203CF1C->unk40F0++; + break; + case 12: + LoadCompressedPalette(&gUnknown_08D97B84, 0x1D0, 0x60); + gUnknown_0203CF1C->unk40F0 = 0; + return 1; } return 0; } -void sub_81C0098(struct Pokemon* poke) +void sub_81C0098(struct Pokemon *poke) { if (gUnknown_0203CF1C->unk40BD == 0) { @@ -512,89 +516,87 @@ void sub_81C0098(struct Pokemon* poke) } } -u8 sub_81C00F0(struct Pokemon* a) +bool8 sub_81C00F0(struct Pokemon *a) { u32 i; - struct pokeSummary* sum = &gUnknown_0203CF1C->summary; + struct pokeSummary *sum = &gUnknown_0203CF1C->summary; switch (gUnknown_0203CF1C->unk40F0) { - - case 0: - sum->species = GetMonData(a, MON_DATA_SPECIES); - sum->species2 = GetMonData(a, MON_DATA_SPECIES2); - sum->exp = GetMonData(a, MON_DATA_EXP); - sum->level = GetMonData(a, MON_DATA_LEVEL); - sum->altability = GetMonData(a, MON_DATA_ALT_ABILITY); - sum->item = GetMonData(a, MON_DATA_HELD_ITEM); - sum->pid = GetMonData(a, MON_DATA_PERSONALITY); - sum->sanity = GetMonData(a, MON_DATA_SANITY_BIT1); - if (sum->sanity != 0) - sum->isEgg = 1; - else - sum->isEgg = GetMonData(a, MON_DATA_IS_EGG); - break; - case 1: - for (i = 0; i < 4; i++) - { - sum->moves[i] = GetMonData(a, MON_DATA_MOVE1+i); - sum->pp[i] = GetMonData(a, MON_DATA_PP1+i); - } - 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) - { - sum->nature = GetNature(a); - sum->currentHP = GetMonData(a, MON_DATA_HP); - sum->maxHP = GetMonData(a, MON_DATA_MAX_HP); - sum->atk = GetMonData(a, MON_DATA_ATK); - sum->def = GetMonData(a, MON_DATA_DEF); - sum->spatk = GetMonData(a, MON_DATA_SPATK); - sum->spdef = GetMonData(a, MON_DATA_SPDEF); - sum->speed = GetMonData(a, MON_DATA_SPD); - } - else - { - sum->nature = GetNature(a); - sum->currentHP = GetMonData(a, MON_DATA_HP); - sum->maxHP = GetMonData(a, MON_DATA_MAX_HP); - sum->atk = GetMonData(a, MON_DATA_ATK2); - sum->def = GetMonData(a, MON_DATA_DEF2); - sum->spatk = GetMonData(a, MON_DATA_SPATK2); - sum->spdef = GetMonData(a, MON_DATA_SPDEF2); - sum->speed = GetMonData(a, MON_DATA_SPD2); - } - break; - case 3: - GetMonData(a, MON_DATA_OT_NAME, &sum->OTName); - ConvertInternationalString((u8*)&sum->OTName, GetMonData(a, MON_DATA_LANGUAGE)); - sum->unk7 = sub_81B205C(a); - sum->OTGender = GetMonData(a, MON_DATA_OT_GENDER); - sum->OTID = GetMonData(a, MON_DATA_OT_ID); - sum->metLocation = GetMonData(a, MON_DATA_MET_LOCATION); - sum->metLevel = GetMonData(a, MON_DATA_MET_LEVEL); - sum->metGame = GetMonData(a, MON_DATA_MET_GAME); - sum->friendship = GetMonData(a, MON_DATA_FRIENDSHIP); - break; - default: - sum->ribbons = GetMonData(a, MON_DATA_RIBBON_COUNT); - return 1; + case 0: + sum->species = GetMonData(a, MON_DATA_SPECIES); + sum->species2 = GetMonData(a, MON_DATA_SPECIES2); + sum->exp = GetMonData(a, MON_DATA_EXP); + sum->level = GetMonData(a, MON_DATA_LEVEL); + sum->altability = GetMonData(a, MON_DATA_ALT_ABILITY); + sum->item = GetMonData(a, MON_DATA_HELD_ITEM); + sum->pid = GetMonData(a, MON_DATA_PERSONALITY); + sum->sanity = GetMonData(a, MON_DATA_SANITY_BIT1); + if (sum->sanity != 0) + sum->isEgg = 1; + else + sum->isEgg = GetMonData(a, MON_DATA_IS_EGG); + break; + case 1: + for (i = 0; i < 4; i++) + { + sum->moves[i] = GetMonData(a, MON_DATA_MOVE1+i); + sum->pp[i] = GetMonData(a, MON_DATA_PP1+i); + } + 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) + { + sum->nature = GetNature(a); + sum->currentHP = GetMonData(a, MON_DATA_HP); + sum->maxHP = GetMonData(a, MON_DATA_MAX_HP); + sum->atk = GetMonData(a, MON_DATA_ATK); + sum->def = GetMonData(a, MON_DATA_DEF); + sum->spatk = GetMonData(a, MON_DATA_SPATK); + sum->spdef = GetMonData(a, MON_DATA_SPDEF); + sum->speed = GetMonData(a, MON_DATA_SPD); + } + else + { + sum->nature = GetNature(a); + sum->currentHP = GetMonData(a, MON_DATA_HP); + sum->maxHP = GetMonData(a, MON_DATA_MAX_HP); + sum->atk = GetMonData(a, MON_DATA_ATK2); + sum->def = GetMonData(a, MON_DATA_DEF2); + sum->spatk = GetMonData(a, MON_DATA_SPATK2); + sum->spdef = GetMonData(a, MON_DATA_SPDEF2); + sum->speed = GetMonData(a, MON_DATA_SPD2); + } + break; + case 3: + GetMonData(a, MON_DATA_OT_NAME, &sum->OTName); + ConvertInternationalString((u8*)&sum->OTName, GetMonData(a, MON_DATA_LANGUAGE)); + sum->unk7 = sub_81B205C(a); + sum->OTGender = GetMonData(a, MON_DATA_OT_GENDER); + sum->OTID = GetMonData(a, MON_DATA_OT_ID); + sum->metLocation = GetMonData(a, MON_DATA_MET_LOCATION); + sum->metLevel = GetMonData(a, MON_DATA_MET_LEVEL); + sum->metGame = GetMonData(a, MON_DATA_MET_GAME); + sum->friendship = GetMonData(a, MON_DATA_FRIENDSHIP); + break; + default: + sum->ribbons = GetMonData(a, MON_DATA_RIBBON_COUNT); + return TRUE; } gUnknown_0203CF1C->unk40F0++; - return 0; + return FALSE; } -void sub_81C0348() +void sub_81C0348(void) { - u8 a = gUnknown_0203CF1C->unk40C0 - 2; - if (a > 1) + if (gUnknown_0203CF1C->unk40C0 != 2 && gUnknown_0203CF1C->unk40C0 != 3) { sub_81C1DA4(0, 255); sub_81C1EFC(0, 255, 0); } else { - sub_81C240C(gUnknown_0203CF1C->summary.moves[gUnknown_0203CF1C->unionThing.fooFiller.unk40C6]); + sub_81C240C(gUnknown_0203CF1C->summary.moves[gUnknown_0203CF1C->unk40C6]); sub_81C2194(&gUnknown_0203CF1C->unkTilemap2, 3, 0); sub_81C2194(&gUnknown_0203CF1C->unkTilemap3, 1, 0); SetBgTilemapBuffer(1, &gUnknown_0203CF1C->unkTilemap3); @@ -604,11 +606,12 @@ void sub_81C0348() ClearWindowTilemap(0xD); } if (gUnknown_0203CF1C->summary.unk7 == 0) + { sub_81C2074(0, 0xFF); + } else { - u8 b = gUnknown_0203CF1C->unk40C0 - 2; - if (b > 1) + if (gUnknown_0203CF1C->unk40C0 != 2 && gUnknown_0203CF1C->unk40C0 != 3) PutWindowTilemap(0xD); } sub_81C2524(); @@ -629,7 +632,7 @@ void sub_81C044C(u8 taskId) void sub_81C0484(u8 taskId) { - if (sub_81221EC() != 1 && gPaletteFade.active == 0) + if (sub_81221EC() != 1 && !gPaletteFade.active) { SetMainCallback2(gUnknown_0203CF1C->unk4); gUnknown_0203CF20 = gUnknown_0203CF1C->unk40BE; @@ -647,18 +650,24 @@ void sub_81C0484(u8 taskId) void sub_81C0510(u8 taskId) { - if (sub_81221EC() != 1 && gPaletteFade.active == 0) + if (sub_81221EC() != 1 && !gPaletteFade.active) { if (gMain.newKeys & DPAD_UP) + { sub_81C0604(taskId, -1); + } else if (gMain.newKeys & DPAD_DOWN) { sub_81C0604(taskId, 1); } else if ((gMain.newKeys & DPAD_LEFT) || GetLRKeysState() == 1) + { sub_81C0A8C(taskId, -1); + } else if ((gMain.newKeys & DPAD_RIGHT) || GetLRKeysState() == 2) + { sub_81C0A8C(taskId, 1); + } else if (gMain.newKeys & A_BUTTON) { if (gUnknown_0203CF1C->unk40C0 != 1) @@ -666,12 +675,12 @@ void sub_81C0510(u8 taskId) if (gUnknown_0203CF1C->unk40C0 == 0) { sub_81C48F0(); - PlaySE(5); + PlaySE(SE_SELECT); sub_81C044C(taskId); } else { - PlaySE(5); + PlaySE(SE_SELECT); sub_81C0E48(taskId); } } @@ -679,7 +688,7 @@ void sub_81C0510(u8 taskId) else if (gMain.newKeys & B_BUTTON) { sub_81C48F0(); - PlaySE(5); + PlaySE(SE_SELECT); sub_81C044C(taskId); } } @@ -756,7 +765,7 @@ void sub_81C0704(u8 taskId) gUnknown_0203CF1C->unk40F0 = 0; break; case 4: - if (sub_81C00F0(&gUnknown_0203CF1C->currentPoke) == 0) + if (sub_81C00F0(&gUnknown_0203CF1C->currentPoke) == FALSE) return; break; case 5: @@ -853,21 +862,19 @@ s8 sub_81C09B4(s8 a) if (r5 < 0 || r5 >= 6) return -1; b = c[r5]; - if (sub_81C0A50(&mons[b]) == 1) + if (sub_81C0A50(&mons[b]) == TRUE) return b; } } -u8 sub_81C0A50(struct Pokemon* mon) +bool8 sub_81C0A50(struct Pokemon* mon) { if (GetMonData(mon, MON_DATA_SPECIES) == 0) - { - return 0; - } + return FALSE; else if (gUnknown_0203CF1C->unk40BE != 0 || GetMonData(mon, MON_DATA_IS_EGG) == 0) - return 1; + return TRUE; else - return 0; + return FALSE; } void sub_81C0A8C(u8 taskId, s8 b) @@ -920,9 +927,7 @@ void sub_81C0B8C(u8 taskId) ChangeBgX(data[1], 0x2000, 1); data[0] += 32; if (data[0] > 0xFF) - { gTasks[taskId].func = sub_81C0C68; - } } void sub_81C0C68(u8 taskId) @@ -996,8 +1001,8 @@ void sub_81C0E24() void sub_81C0E48(u8 taskId) { u16 move; - gUnknown_0203CF1C->unionThing.fooFiller.unk40C6 = 0; - move = gUnknown_0203CF1C->summary.moves[gUnknown_0203CF1C->unionThing.fooFiller.unk40C6]; + gUnknown_0203CF1C->unk40C6 = 0; + move = gUnknown_0203CF1C->summary.moves[gUnknown_0203CF1C->unk40C6]; ClearWindowTilemap(0x13); if (gSprites[gUnknown_0203CF1C->unk40D5].invisible == 0) ClearWindowTilemap(0xD); @@ -1024,32 +1029,36 @@ void sub_81C0F44(u8 taskId) { u8 id = taskId; s16 *data = gTasks[taskId].data; + if (sub_81221EC() != 1) { if (gMain.newKeys & DPAD_UP) { data[0] = 4; - sub_81C1070(data, -1, &gUnknown_0203CF1C->unionThing.fooFiller.unk40C6); + sub_81C1070(data, -1, &gUnknown_0203CF1C->unk40C6); } else if (gMain.newKeys & DPAD_DOWN) { data[0] = 4; - sub_81C1070(data, 1, &gUnknown_0203CF1C->unionThing.fooFiller.unk40C6); + sub_81C1070(data, 1, &gUnknown_0203CF1C->unk40C6); } else if (gMain.newKeys & A_BUTTON) { - if (gUnknown_0203CF1C->unk40C8 == 1 || ((int)(gUnknown_0203CF1C->unionThing.loadThis & 0xFFFFFF) == 0x40000)) + if (gUnknown_0203CF1C->unk40C8 == 1 + || (gUnknown_0203CF1C->unk40C4 == 0 && gUnknown_0203CF1C->unk40C6 == 4)) { PlaySE(SE_SELECT); sub_81C11F4(taskId); } - else if (sub_81C1040() == 1) + else if (sub_81C1040() == TRUE) { PlaySE(SE_SELECT); sub_81C129C(taskId); } else - PlaySE(0x20); + { + PlaySE(SE_HAZURE); + } } else if (gMain.newKeys & B_BUTTON) { @@ -1059,32 +1068,194 @@ void sub_81C0F44(u8 taskId) } } -u8 sub_81C1040() +bool8 sub_81C1040(void) { u8 i; - for (i = 1; i <= 3; i++) + for (i = 1; i < 4; i++) { if (gUnknown_0203CF1C->summary.moves[i] != 0) - return 1; + return TRUE; } - return 0; + return FALSE; } -/* void sub_81C1070(s16* a, s8 b, u8* c) +void sub_81C4D18(); + +void sub_81C1070(s16 *a, s8 b, u8 *c) { s8 i; - s8 d = c*; + s8 moveIndex; + u16 move; + PlaySE(SE_SELECT); - i = 0; - while (i <= 3) + moveIndex = *c; + for (i = 0; i < 4; i++) { - d += b - if (d > a[0]) - d = 0; - else if (d < 0) - d = data[0]; - if (d == 4) + moveIndex += b; + if (moveIndex > a[0]) + moveIndex = 0; + else if (moveIndex < 0) + moveIndex = a[0]; + if (moveIndex == 4) + { + move = gUnknown_0203CF1C->unk40C4; + break; + } + move = gUnknown_0203CF1C->summary.moves[moveIndex]; + if (move != 0) break; - } + sub_81C240C(move); + 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) + { + ClearWindowTilemap(19); + if (!gSprites[gUnknown_0203CF1C->unk40D5].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) + { + ClearWindowTilemap(14); + ClearWindowTilemap(15); + schedule_bg_copy_tilemap_to_vram(0); + sub_81C1DA4(0, 3); + sub_81C1EFC(0, 3, 0); + } + *c = moveIndex; + if (c == &gUnknown_0203CF1C->unk40C6) + sub_81C4D18(8); + else + sub_81C4D18(18); +} + +void sub_81C11F4(u8 taskId) +{ + sub_81C4C60(8); + ClearWindowTilemap(6); + PutWindowTilemap(5); + sub_81C3E9C(0); + sub_81C2194(&gUnknown_0203CF1C->unkTilemap2, 3, 1); + sub_81C2194(&gUnknown_0203CF1C->unkTilemap3, 1, 1); + sub_81C4064(); + if (gUnknown_0203CF1C->unk40C6 != 4) + { + ClearWindowTilemap(14); + ClearWindowTilemap(15); + sub_81C1DA4(0, 3); + sub_81C1EFC(0, 3, 0); + } + schedule_bg_copy_tilemap_to_vram(0); + schedule_bg_copy_tilemap_to_vram(1); + schedule_bg_copy_tilemap_to_vram(2); + gTasks[taskId].func = sub_81C0510; +} + +void sub_81C129C(u8 taskId) +{ + gUnknown_0203CF1C->unk40C7 = gUnknown_0203CF1C->unk40C6; + sub_81C4C84(1); + sub_81C4AF8(18); + gTasks[taskId].func = sub_81C12E4; +} + +void sub_81C12E4(u8 taskId) +{ + u8 a = taskId; + s16* data = gTasks[taskId].data; + if (sub_81221EC() != 1) + { + if (gMain.newKeys & DPAD_UP) + { + data[0] = 3; + sub_81C1070(&data[0], -1, &gUnknown_0203CF1C->unk40C7); + } + else if (gMain.newKeys & DPAD_DOWN) + { + data[0] = 3; + sub_81C1070(&data[0], 1, &gUnknown_0203CF1C->unk40C7); + } + else if (gMain.newKeys & A_BUTTON) + { + if (gUnknown_0203CF1C->unk40C6 == gUnknown_0203CF1C->unk40C7) + { + sub_81C13B0(taskId, 0); + } + else + sub_81C13B0(taskId, 1); + } + else if (gMain.newKeys & B_BUTTON) + sub_81C13B0(a, 0); + } +} + +void sub_81C13B0(u8 taskId, u8 b) +{ + u16 move; + PlaySE(SE_SELECT); + sub_81C4C84(0); + sub_81C4C60(18); + if (b == 1) + { + if (gUnknown_0203CF1C->unk40BD == 0) + { + struct Pokemon *why = gUnknown_0203CF1C->unk0->mons; + sub_81C14BC(&why[gUnknown_0203CF1C->unk40BE], gUnknown_0203CF1C->unk40C6, gUnknown_0203CF1C->unk40C7); + } + else + { + struct BoxPokemon *why = gUnknown_0203CF1C->unk0->boxMons; + sub_81C15EC(&why[gUnknown_0203CF1C->unk40BE], gUnknown_0203CF1C->unk40C6, gUnknown_0203CF1C->unk40C7); + } + sub_81C0098(&gUnknown_0203CF1C->currentPoke); + sub_81C40A0(gUnknown_0203CF1C->unk40C6, gUnknown_0203CF1C->unk40C7); + sub_81C4568(gUnknown_0203CF1C->unk40C6, gUnknown_0203CF1C->unk40C7); + gUnknown_0203CF1C->unk40C6 = gUnknown_0203CF1C->unk40C7; + } + move = gUnknown_0203CF1C->summary.moves[gUnknown_0203CF1C->unk40C6]; + sub_81C3E9C(move); + sub_81C240C(move); + schedule_bg_copy_tilemap_to_vram(1); + schedule_bg_copy_tilemap_to_vram(2); + gTasks[taskId].func = sub_81C0F44; +} + +struct struct_moveSwap +{ + u16 field_0; + u16 field_2; + u8 field_4; + u8 field_5; + u8 field_6; + u16* ptr_8; + u16* ptr_C; + u8* ptr_10; + u8* ptr_14; + u8* ptr_18; + u16* ptr_1C; + u8* ptr_20; + u8* ptr_24; +}; + +/* void sub_81C14BC(struct Pokemon *mon, u8 a, u8 b) +{ + struct struct_moveSwap sp; + u8 r2; + sp.ptr_8 = &gUnknown_0203CF1C->summary.moves[a]; + sp.ptr_1C = &sp.field_2; + sp.field_2 = gUnknown_0203CF1C->summary.moves[a]; + sp.ptr_C = &gUnknown_0203CF1C->summary.moves[b]; + sp.field_0 = gUnknown_0203CF1C->summary.moves[b]; + sp.ptr_10 = &gUnknown_0203CF1C->summary.pp[a]; + sp.ptr_24 = &sp.field_5; + sp.field_5 = gUnknown_0203CF1C->summary.pp[a]; + sp.ptr_14 = &gUnknown_0203CF1C->summary.pp[b]; + sp.ptr_20 = &sp.field_4; + sp.field_4 = gUnknown_0203CF1C->summary.pp[b]; + sp.ptr_18 = &gUnknown_0203CF1C->summary.ppBonuses; + sp.field_6 = gUnknown_0203CF1C->summary.ppBonuses; } */ \ No newline at end of file