From 8a5fce7837b7314adb9bf6996ef06c009e853c29 Mon Sep 17 00:00:00 2001 From: shinny456 Date: Tue, 8 Jan 2019 21:51:19 -0500 Subject: [PATCH 01/16] start decompiling trainer_card.s --- asm/trainer_card.s | 639 +-------------------------------------------- ld_script.txt | 1 + src/trainer_card.c | 311 ++++++++++++++++++++++ 3 files changed, 313 insertions(+), 638 deletions(-) create mode 100755 src/trainer_card.c diff --git a/asm/trainer_card.s b/asm/trainer_card.s index d0f26e0e1..090b396ce 100644 --- a/asm/trainer_card.s +++ b/asm/trainer_card.s @@ -5,644 +5,7 @@ .text - thumb_func_start sub_80C2690 -sub_80C2690: @ 80C2690 - push {lr} - bl LoadOam - bl ProcessSpriteCopyRequests - bl TransferPlttBuffer - bl sub_80C48C8 - ldr r0, =gUnknown_02039CE8 - ldr r0, [r0] - ldrb r0, [r0, 0x9] - cmp r0, 0 - beq _080C26C0 - ldr r1, =0x040000d4 - ldr r0, =gScanlineEffectRegBuffers - str r0, [r1] - movs r2, 0xF0 - lsls r2, 3 - adds r0, r2 - str r0, [r1, 0x4] - ldr r0, =0x800000a0 - str r0, [r1, 0x8] - ldr r0, [r1, 0x8] -_080C26C0: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C2690 - - thumb_func_start sub_80C26D4 -sub_80C26D4: @ 80C26D4 - push {r4,lr} - ldr r4, =0x04000208 - ldrh r3, [r4] - movs r0, 0 - strh r0, [r4] - ldr r1, =gScanlineEffectRegBuffers - ldr r0, =0x04000006 - ldrh r2, [r0] - movs r0, 0xFF - ands r0, r2 - lsls r0, 1 - movs r2, 0xF0 - lsls r2, 3 - adds r1, r2 - adds r0, r1 - ldrh r1, [r0] - ldr r0, =0x04000012 - strh r1, [r0] - strh r3, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C26D4 - - thumb_func_start sub_80C2710 -sub_80C2710: @ 80C2710 - push {lr} - bl RunTasks - bl AnimateSprites - bl BuildOamBuffer - bl UpdatePaletteFade - pop {r0} - bx r0 - thumb_func_end sub_80C2710 - - thumb_func_start sub_80C2728 -sub_80C2728: @ 80C2728 - push {r4,r5,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =gUnknown_02039CE8 - ldr r0, [r5] - movs r1, 0xA6 - lsls r1, 3 - adds r0, r1 - ldr r0, [r0] - bl SetMainCallback2 - bl FreeAllWindowBuffers - ldr r0, [r5] - bl Free - movs r0, 0 - str r0, [r5] - adds r0, r4, 0 - bl DestroyTask - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C2728 - - thumb_func_start sub_80C2760 -sub_80C2760: @ 80C2760 - push {r4-r6,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r5, r0, 24 - ldr r1, =gUnknown_02039CE8 - ldr r0, [r1] - ldrb r0, [r0] - adds r4, r1, 0 - cmp r0, 0x10 - bls _080C2776 - b _080C2ACA -_080C2776: - lsls r0, 2 - ldr r1, =_080C2788 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C2788: - .4byte _080C27CC - .4byte _080C27E2 - .4byte _080C27F0 - .4byte _080C27F8 - .4byte _080C280C - .4byte _080C2820 - .4byte _080C2830 - .4byte _080C2836 - .4byte _080C289C - .4byte _080C28C8 - .4byte _080C28E4 - .4byte _080C299C - .4byte _080C2970 - .4byte _080C2AAA - .4byte _080C2A98 - .4byte _080C2A2C - .4byte _080C2A68 -_080C27CC: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - beq _080C27D8 - b _080C2ACA -_080C27D8: - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - b _080C28D4 -_080C27E2: - bl sub_80C3438 - lsls r0, 24 - cmp r0, 0 - bne _080C27EE - b _080C2ACA -_080C27EE: - b _080C28D4 -_080C27F0: - movs r0, 0x1 - bl sub_80C438C - b _080C28D4 -_080C27F8: - movs r0, 0x2 - movs r1, 0 - bl FillWindowPixelBuffer - bl sub_80C4FF0 - movs r0, 0x2 - bl sub_80C438C - b _080C28D4 -_080C280C: - ldr r0, [r4] - ldr r1, =0x00000ef8 - adds r0, r1 - bl sub_80C4550 - ldr r1, [r4] - b _080C28D8 - .pool -_080C2820: - ldr r0, [r4] - movs r2, 0xB3 - lsls r2, 3 - adds r0, r2 - bl sub_80C45C0 - ldr r1, [r4] - b _080C28D8 -_080C2830: - bl sub_80C4630 - b _080C28D4 -_080C2836: - ldr r0, =gWirelessCommType - ldrb r0, [r0] - cmp r0, 0x1 - bne _080C2852 - ldr r0, =gReceivedRemoteLinkPlayers - ldrb r0, [r0] - cmp r0, 0x1 - bne _080C2852 - bl sub_800E0E8 - movs r0, 0xE6 - movs r1, 0x96 - bl CreateWirelessStatusIndicatorSprite -_080C2852: - movs r6, 0x1 - negs r6, r6 - ldr r4, =gUnknown_02039CE8 - ldr r0, [r4] - ldr r5, =0x0000052c - adds r0, r5 - ldrh r2, [r0] - adds r0, r6, 0 - movs r1, 0x10 - bl BlendPalettes - ldr r0, [r4] - adds r0, r5 - ldrh r0, [r0] - str r0, [sp] - adds r0, r6, 0 - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - ldr r0, =sub_80C2690 - bl SetVBlankCallback - ldr r1, [r4] - b _080C28D8 - .pool -_080C289C: - bl UpdatePaletteFade - lsls r0, 24 - cmp r0, 0 - beq _080C28A8 - b _080C2ACA -_080C28A8: - bl IsDma3ManagerBusyWithBgCopy - lsls r0, 24 - cmp r0, 0 - beq _080C28B4 - b _080C2ACA -_080C28B4: - movs r0, 0xFB - bl PlaySE - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - movs r0, 0xA - strb r0, [r1] - b _080C2ACA - .pool -_080C28C8: - bl IsSEPlaying - lsls r0, 24 - cmp r0, 0 - beq _080C28D4 - b _080C2ACA -_080C28D4: - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] -_080C28D8: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080C2ACA - .pool -_080C28E4: - ldr r0, =gReceivedRemoteLinkPlayers - ldrb r5, [r0] - cmp r5, 0 - bne _080C290A - ldr r0, [r4] - ldr r1, =0x00000529 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _080C290A - bl sub_80C3880 - movs r0, 0x1 - bl sub_80C438C - ldr r0, [r4] - ldr r2, =0x00000529 - adds r0, r2 - strb r5, [r0] -_080C290A: - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080C293C - bl sub_80C4918 - movs r0, 0xF9 - bl PlaySE - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - movs r0, 0xC - strb r0, [r1] - b _080C2ACA - .pool -_080C293C: - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - bne _080C2946 - b _080C2ACA -_080C2946: - ldr r0, =gReceivedRemoteLinkPlayers - ldrb r0, [r0] - cmp r0, 0 - beq _080C2960 - ldr r4, =gUnknown_02039CE8 - ldr r0, [r4] - ldrb r0, [r0, 0x5] - cmp r0, 0 - beq _080C2960 - bl InUnionRoom - cmp r0, 0x1 - beq _080C2A14 -_080C2960: - movs r0, 0x1 - negs r0, r0 - ldr r4, =gUnknown_02039CE8 - b _080C2A74 - .pool -_080C2970: - bl sub_80C4940 - lsls r0, 24 - cmp r0, 0 - bne _080C297C - b _080C2ACA -_080C297C: - bl sub_8087598 - cmp r0, 0x1 - bne _080C2986 - b _080C2ACA -_080C2986: - movs r0, 0xFB - bl PlaySE - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - movs r0, 0xB - strb r0, [r1] - b _080C2ACA - .pool -_080C299C: - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080C29F4 - ldr r0, =gReceivedRemoteLinkPlayers - ldrb r0, [r0] - cmp r0, 0 - beq _080C29DC - ldr r0, [r4] - ldrb r0, [r0, 0x5] - cmp r0, 0 - beq _080C29C0 - bl InUnionRoom - cmp r0, 0x1 - beq _080C2A14 -_080C29C0: - ldr r0, =gReceivedRemoteLinkPlayers - ldrb r0, [r0] - cmp r0, 0 - beq _080C29DC - movs r0, 0x1 - negs r0, r0 - ldr r4, =gUnknown_02039CE8 - b _080C2A74 - .pool -_080C29DC: - bl sub_80C4918 - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - movs r0, 0xD - strb r0, [r1] - movs r0, 0xF9 - bl PlaySE - b _080C2ACA - .pool -_080C29F4: - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080C2ACA - ldr r0, =gReceivedRemoteLinkPlayers - ldrb r0, [r0] - cmp r0, 0 - beq _080C2A20 - ldr r0, [r4] - ldrb r0, [r0, 0x5] - cmp r0, 0 - beq _080C2A20 - bl InUnionRoom - cmp r0, 0x1 - bne _080C2A20 -_080C2A14: - ldr r1, [r4] - movs r0, 0xF - strb r0, [r1] - b _080C2ACA - .pool -_080C2A20: - movs r0, 0x1 - negs r0, r0 - ldr r4, =gUnknown_02039CE8 - b _080C2A74 - .pool -_080C2A2C: - bl sub_800AC34 - movs r0, 0 - movs r1, 0x1 - bl NewMenuHelpers_DrawDialogueFrame - ldr r2, =gText_WaitingTrainerFinishReading - movs r0, 0x1 - str r0, [sp] - movs r0, 0xFF - str r0, [sp, 0x4] - movs r0, 0 - str r0, [sp, 0x8] - movs r1, 0x1 - movs r3, 0 - bl AddTextPrinterParameterized - movs r0, 0 - movs r1, 0x3 - bl CopyWindowToVram - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - movs r0, 0x10 - strb r0, [r1] - b _080C2ACA - .pool -_080C2A68: - ldr r0, =gReceivedRemoteLinkPlayers - ldrb r0, [r0] - cmp r0, 0 - bne _080C2ACA - movs r0, 0x1 - negs r0, r0 -_080C2A74: - ldr r1, [r4] - ldr r2, =0x0000052c - adds r1, r2 - ldrh r1, [r1] - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - ldr r1, [r4] - movs r0, 0xE - strb r0, [r1] - b _080C2ACA - .pool -_080C2A98: - bl UpdatePaletteFade - lsls r0, 24 - cmp r0, 0 - bne _080C2ACA - adds r0, r5, 0 - bl sub_80C2728 - b _080C2ACA -_080C2AAA: - bl sub_80C4940 - lsls r0, 24 - cmp r0, 0 - beq _080C2ACA - bl sub_8087598 - cmp r0, 0x1 - beq _080C2ACA - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - movs r0, 0xA - strb r0, [r1] - movs r0, 0xFB - bl PlaySE -_080C2ACA: - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C2760 - - thumb_func_start sub_80C2AD8 -sub_80C2AD8: @ 80C2AD8 - push {lr} - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - ldrb r0, [r1, 0x2] - cmp r0, 0x5 - bls _080C2AE6 - b _080C2C64 -_080C2AE6: - lsls r0, 2 - ldr r1, =_080C2AF8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C2AF8: - .4byte _080C2B10 - .4byte _080C2B44 - .4byte _080C2B78 - .4byte _080C2BD0 - .4byte _080C2C04 - .4byte _080C2C38 -_080C2B10: - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - ldr r2, =0x0000052a - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080C2B34 - ldr r0, =gUnknown_08DD1F78 - ldr r2, =0x00000ef8 - b _080C2C4A - .pool -_080C2B34: - ldr r0, =gUnknown_08DD2AE0 - ldr r2, =0x00000ef8 - b _080C2C4A - .pool -_080C2B44: - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - ldr r2, =0x0000052a - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080C2B68 - ldr r0, =gUnknown_08DD21B0 - ldr r2, =0x00000a48 - b _080C2C4A - .pool -_080C2B68: - ldr r0, =gUnknown_08DD2D30 - ldr r2, =0x00000a48 - b _080C2C4A - .pool -_080C2B78: - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - ldrb r0, [r1, 0x5] - cmp r0, 0 - bne _080C2BAC - ldr r2, =0x0000052a - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080C2BA0 - ldr r0, =gUnknown_08DD2010 - adds r2, 0x6E - b _080C2C4A - .pool -_080C2BA0: - ldr r0, =gUnknown_08DD2B78 - movs r2, 0xB3 - lsls r2, 3 - b _080C2C4A - .pool -_080C2BAC: - ldr r2, =0x0000052a - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080C2BC4 - ldr r0, =gUnknown_08DD228C - adds r2, 0x6E - b _080C2C4A - .pool -_080C2BC4: - ldr r0, =gUnknown_08DD2E5C - movs r2, 0xB3 - lsls r2, 3 - b _080C2C4A - .pool -_080C2BD0: - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - ldr r2, =0x0000052a - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080C2BF4 - ldr r0, =gUnknown_0856F5CC - ldr r2, =0x000013a8 - b _080C2C4A - .pool -_080C2BF4: - ldr r0, =gUnknown_0856F814 - ldr r2, =0x000013a8 - b _080C2C4A - .pool -_080C2C04: - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - ldr r2, =0x0000052a - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080C2C28 - ldr r0, =gEmeraldTrainerCard_Gfx - ldr r2, =0x000019a8 - b _080C2C4A - .pool -_080C2C28: - ldr r0, =gFireRedTrainerCard_Gfx - ldr r2, =0x000019a8 - b _080C2C4A - .pool -_080C2C38: - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - ldr r2, =0x0000052a - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _080C2C6C - ldr r0, =gUnknown_0856F018 - ldr r2, =0x000017a8 -_080C2C4A: - adds r1, r2 - bl LZ77UnCompWram - b _080C2C6C - .pool -_080C2C64: - movs r0, 0 - strb r0, [r1, 0x2] - movs r0, 0x1 - b _080C2C78 -_080C2C6C: - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - ldrb r0, [r1, 0x2] - adds r0, 0x1 - strb r0, [r1, 0x2] - movs r0, 0 -_080C2C78: - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C2AD8 - + thumb_func_start sub_80C2C80 sub_80C2C80: @ 80C2C80 push {lr} diff --git a/ld_script.txt b/ld_script.txt index be59145a3..5e273d616 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -124,6 +124,7 @@ SECTIONS { src/scanline_effect.o(.text); src/option_menu.o(.text); src/pokedex.o(.text); + src/trainer_card.o(.text); asm/trainer_card.o(.text); src/pokemon_storage_system.o(.text); src/pokemon_icon.o(.text); diff --git a/src/trainer_card.c b/src/trainer_card.c new file mode 100755 index 000000000..d23413a26 --- /dev/null +++ b/src/trainer_card.c @@ -0,0 +1,311 @@ +#include "global.h" +#include "scanline_effect.h" +#include "palette.h" +#include "task.h" +#include "main.h" +#include "window.h" +#include "alloc.h" +#include "link.h" +#include "bg.h" +#include "sound.h" +#include "constants/songs.h" +#include "overworld.h" +#include "menu.h" +#include "text.h" + +extern const u8 gText_WaitingTrainerFinishReading[]; +extern const u32 gUnknown_08DD2AE0[]; +extern const u32 gUnknown_08DD21B0[]; +extern const u32 gUnknown_08DD2D30[]; +extern const u32 gUnknown_08DD2010[]; +extern const u32 gUnknown_08DD2B78[]; +extern const u32 gUnknown_08DD228C[]; +extern const u32 gUnknown_08DD2E5C[]; +extern const u32 gUnknown_0856F5CC[]; +extern const u32 gUnknown_0856F814[]; +extern const u32 gEmeraldTrainerCard_Gfx[]; +extern const u32 gFireRedTrainerCard_Gfx[]; +extern const u32 gUnknown_0856F018[]; +extern const u32 gUnknown_08DD1F78[]; + +/*static*/ void sub_80C2690(void); +/*static*/ void sub_80C26D4(void); +/*static*/ void sub_80C48C8(void); +/*static*/ void sub_80C2710(void); +/*static*/ void sub_80C2728(u8 task); +/*static*/ bool8 sub_80C3438(void); +/*static*/ void sub_80C438C(u8); +/*static*/ void sub_80C4FF0(void); +/*static*/ void sub_80C4550(u8*); +/*static*/ void sub_80C45C0(u8*); +/*static*/ void sub_80C4630(void); +/*static*/ void sub_80C3880(void); +/*static*/ void sub_80C4918(void); +/*static*/ bool8 sub_80C4940(void); +/*static*/ bool8 sub_80C2AD8(void); +/*static*/ void sub_80C2C80(void); + +extern struct UnknownStruct{ + u8 var_0; + u8 var_1; + u8 var_2; + u8 filler3[2]; + u8 var_5; + u8 filler6[3]; + u8 var_9; + u8 fillerA[0x51F]; + u8 var_529; + u8 var_52A; + u8 var_52B; + u16 var_52C; + void (*callback2)(void); + u8 filler531[0x64]; + u8 var_598[0x4B0]; + u8 var_A48[0x4B0]; + u8 var_EF8[0x4B0]; + u8 var_13A8[0x400]; + u8 var_17A8[0x200]; + u8 var_19A8[0x200]; +}* gUnknown_02039CE8; + +void sub_80C2690(void) +{ + LoadOam(); + ProcessSpriteCopyRequests(); + TransferPlttBuffer(); + sub_80C48C8(); + if(gUnknown_02039CE8->var_9) + DmaCopy16(3, &gScanlineEffectRegBuffers[0], &gScanlineEffectRegBuffers[1], 0x140); +} + +void sub_80C26D4(void) +{ + u16 backup; + u16 bgVOffset; + + backup = REG_IME; + REG_IME = 0; + bgVOffset = gScanlineEffectRegBuffers[1][REG_VCOUNT & 0xFF]; + REG_BG0VOFS = bgVOffset; + REG_IME = backup; +} + +void sub_80C2710(void) +{ + RunTasks(); + AnimateSprites(); + BuildOamBuffer(); + UpdatePaletteFade(); +} + +void sub_80C2728(u8 taskId) +{ + SetMainCallback2(gUnknown_02039CE8->callback2); + FreeAllWindowBuffers(); + Free(gUnknown_02039CE8); + gUnknown_02039CE8 = NULL; + DestroyTask(taskId); +} + +void sub_80C2760(u8 taskId) +{ + switch(gUnknown_02039CE8->var_0) + { + case 0: + if(!IsDma3ManagerBusyWithBgCopy()) + { + FillWindowPixelBuffer(1, 0); + gUnknown_02039CE8->var_0++; + } + break; + case 1: + if(sub_80C3438()) + gUnknown_02039CE8->var_0++; + break; + case 2: + sub_80C438C(1); + gUnknown_02039CE8->var_0++; + break; + case 3: + FillWindowPixelBuffer(2, 0); + sub_80C4FF0(); + sub_80C438C(2); + gUnknown_02039CE8->var_0++; + break; + case 4: + sub_80C4550(gUnknown_02039CE8->var_EF8); + gUnknown_02039CE8->var_0++; + break; + case 5: + sub_80C45C0(gUnknown_02039CE8->var_598); + gUnknown_02039CE8->var_0++; + break; + case 6: + sub_80C4630(); + gUnknown_02039CE8->var_0++; + break; + case 7: + if(gWirelessCommType == TRUE && gReceivedRemoteLinkPlayers == TRUE) + { + sub_800E0E8(); + CreateWirelessStatusIndicatorSprite(230, 150); + } + BlendPalettes(-1, 16, gUnknown_02039CE8->var_52C); + BeginNormalPaletteFade(- 1, 0, 16, 0, gUnknown_02039CE8->var_52C); + SetVBlankCallback(sub_80C2690); + gUnknown_02039CE8->var_0++; + break; + case 8: + if(!UpdatePaletteFade() && !IsDma3ManagerBusyWithBgCopy()) + { + PlaySE(SE_RG_CARD3); + gUnknown_02039CE8->var_0 = 10; + } + break; + case 9: + if(!IsSEPlaying()) + gUnknown_02039CE8->var_0++; + break; + case 10: + if(!gReceivedRemoteLinkPlayers && gUnknown_02039CE8->var_529) + { + sub_80C3880(); + sub_80C438C(1); + gUnknown_02039CE8->var_529 = 0; + } + if(gMain.newKeys & A_BUTTON) + { + sub_80C4918(); + PlaySE(SE_RG_CARD1); + gUnknown_02039CE8->var_0 = 12; + } + else if(gMain.newKeys & B_BUTTON) + { + if(gReceivedRemoteLinkPlayers && gUnknown_02039CE8->var_5 && InUnionRoom() == TRUE) + gUnknown_02039CE8->var_0 = 15; + else + { + BeginNormalPaletteFade(-1, 0, 0, 16, gUnknown_02039CE8->var_52C); + gUnknown_02039CE8->var_0 = 14; + } + } + break; + case 12: + if(sub_80C4940() && sub_8087598() != TRUE) + { + PlaySE(SE_RG_CARD3); + gUnknown_02039CE8->var_0 = 11; + } + break; + case 11: + if(gMain.newKeys & B_BUTTON) + { + if(gReceivedRemoteLinkPlayers && gUnknown_02039CE8->var_5 && InUnionRoom() == TRUE) + gUnknown_02039CE8->var_0 = 15; + else if(gReceivedRemoteLinkPlayers) + { + BeginNormalPaletteFade(-1, 0, 0, 16, gUnknown_02039CE8->var_52C); + gUnknown_02039CE8->var_0 = 14; + } + else + { + sub_80C4918(); + gUnknown_02039CE8->var_0 = 13; + PlaySE(SE_RG_CARD1); + } + } + else if(gMain.newKeys & A_BUTTON) + { + if(gReceivedRemoteLinkPlayers && gUnknown_02039CE8->var_5 && InUnionRoom() == TRUE) + gUnknown_02039CE8->var_0 = 15; + else + { + BeginNormalPaletteFade(-1, 0, 0, 16, gUnknown_02039CE8->var_52C); + gUnknown_02039CE8->var_0 = 14; + } + } + break; + case 15: + sub_800AC34(); + NewMenuHelpers_DrawDialogueFrame(0, 1); + AddTextPrinterParameterized(0, 1, gText_WaitingTrainerFinishReading, 0, 1, 255, 0); + CopyWindowToVram(0, 3); + gUnknown_02039CE8->var_0 = 16; + break; + case 16: + if(!gReceivedRemoteLinkPlayers) + { + BeginNormalPaletteFade(-1, 0, 0, 16, gUnknown_02039CE8->var_52C); + gUnknown_02039CE8->var_0 = 14; + } + break; + case 14: + if(!UpdatePaletteFade()) + sub_80C2728(taskId); + break; + case 13: + if(sub_80C4940() && sub_8087598() != TRUE) + { + gUnknown_02039CE8->var_0 = 10; + PlaySE(SE_RG_CARD3); + } + break; + } +} + +bool8 sub_80C2AD8(void) +{ + switch(gUnknown_02039CE8->var_2) + { + case 0: + if(gUnknown_02039CE8->var_52A) + LZ77UnCompWram(gUnknown_08DD1F78, gUnknown_02039CE8->var_EF8); + else + LZ77UnCompWram(gUnknown_08DD2AE0, gUnknown_02039CE8->var_EF8); + break; + case 1: + if(gUnknown_02039CE8->var_52A) + LZ77UnCompWram(gUnknown_08DD21B0, gUnknown_02039CE8->var_A48); + else + LZ77UnCompWram(gUnknown_08DD2D30, gUnknown_02039CE8->var_A48); + break; + case 2: + if(!gUnknown_02039CE8->var_5) + { + if(gUnknown_02039CE8->var_52A) + LZ77UnCompWram(gUnknown_08DD2010, gUnknown_02039CE8->var_598); + else + LZ77UnCompWram(gUnknown_08DD2B78, gUnknown_02039CE8->var_598); + } + else + { + if(gUnknown_02039CE8->var_52A) + LZ77UnCompWram(gUnknown_08DD228C, gUnknown_02039CE8->var_598); + else + LZ77UnCompWram(gUnknown_08DD2E5C, gUnknown_02039CE8->var_598); + } + break; + case 3: + if(gUnknown_02039CE8->var_52A) + LZ77UnCompWram(gUnknown_0856F5CC, gUnknown_02039CE8->var_13A8); + else + LZ77UnCompWram(gUnknown_0856F814, gUnknown_02039CE8->var_13A8); + break; + case 4: + if(gUnknown_02039CE8->var_52A) + LZ77UnCompWram(gEmeraldTrainerCard_Gfx, gUnknown_02039CE8->var_19A8); + else + LZ77UnCompWram(gFireRedTrainerCard_Gfx, gUnknown_02039CE8->var_19A8); + break; + case 5: + if(!gUnknown_02039CE8->var_52A) + LZ77UnCompWram(gUnknown_0856F018, gUnknown_02039CE8->var_17A8); + break; + default: + gUnknown_02039CE8->var_2 = 0; + return 1; + } + gUnknown_02039CE8->var_2++; + return 0; +} + From f84b22fca4a10af909e5212dec2a6029afd0548e Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sat, 19 Jan 2019 12:57:18 +0100 Subject: [PATCH 02/16] Dump trainer hill trainers --- data/pokenav/unk_struct_1.bin | Bin 3816 -> 0 bytes data/pokenav/unk_struct_2.bin | Bin 3816 -> 0 bytes data/pokenav/unk_struct_3.bin | Bin 3816 -> 0 bytes data/pokenav/unk_struct_4.bin | Bin 3816 -> 0 bytes data/rom_81D1C44.s | 12 - src/data/battle_frontier/trainer_hill.h | 4857 +++++++++++++++++++++++ src/trainer_hill.c | 16 +- 7 files changed, 4864 insertions(+), 21 deletions(-) delete mode 100644 data/pokenav/unk_struct_1.bin delete mode 100644 data/pokenav/unk_struct_2.bin delete mode 100644 data/pokenav/unk_struct_3.bin delete mode 100644 data/pokenav/unk_struct_4.bin create mode 100644 src/data/battle_frontier/trainer_hill.h diff --git a/data/pokenav/unk_struct_1.bin b/data/pokenav/unk_struct_1.bin deleted file mode 100644 index 18a696cf437bebef727416441b3ddc21fb603200..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3816 zcmZ`+eQXrR6@PPgK92SISnR{+_~Xuo_^|5*{K1vjmk6I7ltLnksRD|c(i9v;RT3nF z)HYQcpmCE3lJp;>N+m_A)T(Nts!~gnw##|3*S@>;eVKxjrv8IJqEfXeY8xS0ZIGtF zH+#0R17qLLyqVwo&70YIZ{7wxKB|gV(Z*ULGh^C0QxZy$A0Dk-;}@6fl_x9aOQ z_k^Q+^`NJr>NdXd#HkR0V&Z#ecw4>z)Q zaiU0bQ#FM(iBFH=kVa4;ysPVRm-|==O)!6pH?;u+}DOoIcJufoCUDl zFa87@M#QJE8D-VlUO~r|%(Y1;r)Z^_x#HxC4h!2EEVO9tW7xqB4N`V$>qFgfL+{Ww zHS&*w>$F&Fr{1bV*84*n8Yp;3T&E;$6CaZYd&4w}SN~UfF{<{)GBcKIGW`)FIcy~VyEgm~ zjafTavz zhOvGkp~jP_SicMQsWHQVsgRkUCujAFJ}koIPzN5Jn7LAnz}j-g`?uY~_er{aJbk0h zbL!>P`tP6GxPI}JNd5OEZ$QeXZEbCJVWQHM4f;yy3vfPiW!3yk5rIrL2=HIkUhH!EXa1;+~&1HY}e_08wy;?vFhU zz};u)d1ddtc~@*mPnkI>rx8Xh*M~hk(LT)=^=O;)27Oo9qxt>Y;ic>0!;fg&>iz!e zuov+!t_y8LxK$5oeOf!cNmb%S+Db{R;|~7ZeO&U}xpHRK{1oH{D652 zzXo?!y~}Tix9HzMhQ#5|VXM$Hn<*DFjKrS*2E1e7)x@{fVlVDOPsy3IW^EUHb$)*S zqmSUXGnvx-!hGOretLRgVS0MHP$=XV@{ku6B9X`fmx??O8CvrsNrrwt ze`9`rMPA6~!MRGlOP{G%>qB0x4|dq(+LOPa$^uM)eLO9f3((0!W;0jISP#ktCYWC9 zwt+L=&rVhkRuA49IrkNFgt;|}pA*XUc~ zzGzcai#7%{-J=cQ=B=*v!f#2B)_b(-K%W*v|HHK#LwxpL#o0cAx0e#n;Jp2h@P7Ff z>$h=F@H?3^XAu?LApInn!2XPCgjb!-%7J6-#k0UpI1>fiy;JBMV)O}mh*Dx6Bdd84 zZpg`+#geIlw0wbH1@qguRm!WdeC7k_$=K-`yHw^IR~|sTHx-g2{R%Iz7tf=om~pON zF1SXt;mqHQm)GX<<{bBGCOKynoSdCz2k?M~I<=Zmt3T+AgtTa<*6MEwwMRKu>D0au zu4#6q_NWMSYLVKF0SYGJi?=C`tl{sht{fLN-jv*(N27=pl&-mF`&scmu&>ht$Ql6k z1I ze>AZeWo*u#aPnnKg{L^MNpX}eA=0Q2qu?&@hYE}97AXS9V86nCh8us|=dgT_!`6a* z-7HK1%lBD4UKifVwrzdii?Ql%c^T9Baj&MkeB2BI0f2HY3eJ&N*!Z_;+%Q;YK= z`}OUp>zb?ersxC6itCzt;kn+RM~moDy{>tOUe%bQcd13JqX6QmDpGOjzc_zTOQ8dK z_>6g7ogw)te5OUbgq(VZ3#AJxPX_iZ$NtM1yI8c;;grva4}d*_?E7tu9EWC(brdh( zDU*eAcGgz8uRJT>0ro6?ohtYKiVcc)5=X+Cb2t@~J;>`@#G~TNxP?&A!8jU$C z=VYDI6uRX!?!XrDFr6We9Vjcj8ry3XXDbnjq~=*bbxNr zf9MH}pj7PQIHmR`<2cG`G4d4F`yBOx`NzvZG?sa@W%XU6SjNO9#d(vSfZyV~MB?kD zf_(*zQo)(E@xg$F?U6I{9wJ!n<#&$6< z64)6rTp1P1>ZuY{S62M72ozj-nJ3iU)64MQjFZ@|Q+W2Q zXXgFhn>TOXo3~b&7dj8N!pJB<*(w&zeA?mw{eaZkF`$Ch=IPfi?r2wr)gIqhyEXPjS#TlIDg92-? zqwsIS)M7)|<3!rAW=*>|PuL!T-33GNSW|4lK5M446jPk!EKOi#0nd}vojfIzEGK+<@_^&EyB0Z&S;(5z3sq>vYWBWc3Rkg+q__=ta6sa zW>VaRp4#T?P@lc2#oreg(ndl|RkdKy8|v14z1MHqt8qS}ZVGG-b_N2$t-ZtO#S%OP zV?bUb50DnnKKas@jhu$Rz=eefuY!O^R*L7Yju#gglo0{a~5y$tuUb4_d@y=lkH6|5q8 zoxg~B2ibRU9Qx3YG=qTZ-UwSNo5h?h?Y(t!axxs=+|ju=Jb_&$q7xZWBJ3-XA-pkmKL5QuQsB?BFW`RGTyGrpTHhBOw?fwe@D~spfKQ;A4TLpQ7;aKAZ$}$O z*ukbY5Vl~?WGuH_b}>u;jCvp00EguF_SC>ci`Y4AdF|)(LVRa{FbQa!+|3VK7!!sz22Q3eU z>TT#9oSAc7yml#sfZqilKo}-q91b^P&$Qr7!FB98Q{MgK@FAkYSQif<=Q6wo^c8hH zB(SCVnM(RBDdtaOoqY%{VVCHNjG!u(a0amnH?0SBXy`&ehS+^*`PYNvQ zB&x%nc@<~Um6V$ouA^GyIF=>kM7^czI-!kes&}u(Fjw0`s<$-+{w+#pple`Q9opjc zGj%*TrZHb{ptbh_I1hh>S(t+dX)Uo0?5z1QXJ+zN&MxC}{AGbX1e@S6)~|Z3jzX4W zrORfja^V8!Uskb)8R@-@joc{pQfJmN&DmLc#Q}ad*3ggP1)4^x+pq9V3NI>GK+#WF zL)WqOJ{RX>=dCo|GDt`2u=RRhMgDmg^%heCEc13-Z(p_EPGcS<5+_fd{JZEV-Jkzs zl|IA1(rtFH67{a;cUKV-*Mu(^t6G}yQR_OSIiD;*41SyPSCu!l&s?W&)5Lmvyycfy z7;MyfLWB2=-2!md&ZY2mhE8LYd`vMm(KU`0;t}tNI-uO{Zh3EZfTXweSh zU59UeJGBng#kafvkf0!O{M6G{mY4Q>JOGuvJ6BB^?qXCn#lEt%pWY4Xv6ZISOUIV> zc`#aQvA45#VU&Fc53`?e>Ayi9=qqEh?exm2Qo+v8$fCj@quR_4;oCQ1k+=vKksob1 zEI5^tBXg0z#@<8hJ?x--udl_PAuPsQ$}-Dh)3fw%!!A*%j*wcW4s6jv-rg|24{z7{ z0&M}0daIA~KE;c9ysK+J`jshOyan6Ey?CuXoQ6|B)$ZZ(YwUsU%AB3AtorP+LP?_@SxKSB~LXVlvkH+{HVs<}8I1QJwZ9U)tAl)wwU!Vi6{N&X4i^ ztU+&Mz5PpMN{{J}>PL+OL`pPvBt}h-$?+4Bm@#EgljFZ4=SVCfni10#As?BF#-akH z5J$?Bjw8wwB&)|F$knkaQr^+{*Xl0S3oUF&M<(H|u^mAKg8;=U4hX>2m-8 diff --git a/data/pokenav/unk_struct_3.bin b/data/pokenav/unk_struct_3.bin deleted file mode 100644 index 93273aae2861c64f79485dbf193537cc13c4edba..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3816 zcmai1e{36f6@Ox=7RX zBz@n-iUlrq1WZmdCiFBz$@Y>#PtX^sAh6M|M=822_tOAe(v5sp%Udk>ZRjvVUy}Oh zDrP`7i*R%(!yv60xx8fvxd)|psfVhmX+8ElV>6neCvsLQVUvBGF3=(RH$Au>8)mGf zrKZfh_?A7UTZU#OnW@A@l2W1W^p}OHyx!lgg7bNl&0%k#0Y3FBHR?m5R;5I#uCEE! z_`>DBz@T)I{sSADB(@>WPGniak2^51^mHl#JFrpq9(s==w2!t3EGF03J7K1i`NWj4 zx0L2+FRZLE`JVxs(Iyg_HDN-q{W;R;IDKAv zPGDE*ApB@))2XDE<+!qc3O}BvC!`10V}&0xW;$o-S)uQ>h2p}MEBBUH{CDwYu~?L^ z6^e!V`T4~wA1*Knz8H^-m-F)l!N=$3;`2q!79D2ui_ZkowCr2TuyUa+)>k)`%A5mzWjcRak|6lhMr? zQHkO6O6dYMu97R3vRuW@+smmbor{|NJpGmHu1m0&jdpdo8-qlC%rtl>fh|KlXyB0` z)0Nr$0pfn!k8B(3YiT*uq@0M6o$c-Ik^Aqhs;-N)VJL6M zt+lCkTWwP-M(y&M;rMWD_!O?#@aS+{9yuMyFXrAyWKx>MPzwyB>{{8fHG=k~_neN{ov zzVZ_K3q3^#k&ADMJz0vk$Un~Q!f{TCNzKaWY27sJsEku_FMSu4{~gTS#7L0JSRT!2 zR?f6?oa9jtWpUmX=(BVMGYASN!IrV9OSA5AOVQT^c8*@4t-#)dSRq+pS%)!gHm&R9 z9B|QJK!@K$*S+)=mMel21A+Bokg&{zX=pP5N6*2w=U~}yXb3YL#UePx8OSmJr+g}{ zT@w94R5MbuVgy;3q9#QNl`ETrL67WdfbW$0-Kd8Ys17JWU!X2r7xv)XRm#1APpRAe z6!?(drZ!ZcKT-r)cKchlZ9mL5WHY9jn9Os5Z9a^iAwoOg$9BxD#u|8|UCz5HL(L!I zT)YcigN%B)7K;~zt(i)RHi4Rdi+XSmG}uAkX6&t{Tx1;>n@H>9pBZ-8B`uhZj9jLixtHH*BBY%Z_Z>*Vc` zt`#)UB_HWJ*5BWM6xSdw=KEIw1mFKs{{Sw=F~5S2IrF@DKwy^V2V9gq(uJ(*LWSUG zyzBq+*PMkfF0H@T<(#I+#A85q=iTX|JWzb8c&vD|c%e90JYF2UL*5oocsuM~Z-;mu zf8+rF?Bi0$C*r*Q`Kz^?_U<7{qAzq@Mm~13gm~k8ZBkn*cPbsB9coo&MX=tlpugjD zBj};PcC`toZcC-4Nd7<2kLh)KQhJ8?T#T|PF4-cszk@+GpEPGoGl}NP&S3u{h|PB5 zNW=@=L5w{g!yubBXQood1m4>>5XY_bwDc6ZR6({t3%R`4x{=dUjsW{>sOKd#g(!NA zPnIRY0?WBLnaX8M0~N%u?Z4q%iy(&nj1J*8)X@PE#eH%v<+#KiL4Vgnorw4^V+OQB zhb>?)YtuL9=8YUoiO zMsAmsH)8Zv*l-X1n!ZIpT>cOSYivOIfp!0cA2aac@8C(i(+V3Ho6V;ZdDq_ek+-ele?bZRaV1vtzLRF&NSY?s4*Os5V;|+|25l2a zcQcpu&EiiFDzNw;^AoxZZ6B9*yFSNqUbDQHDA%ln=)bv-TwKI?`#w5j^vNHf>nw7s z%iS{g8{z>_K_tdfD!A@T+cp-QNza-B=_P>|Pa477y4n1?=WBdaY@RYjCau~d-< z+qH3=s;(51R#s~iXPn0>YWnENRXecb^_tlom|eUM;GlhqTB$F6aU;{FV{7`II}6@j zlHS$ax#ynmo;mm2^K(}fjWoPpp~NvF%en2@>44B0xEs7=8tVLf-Wp z>pp)Vcu09V1nfH91F1Zw5G=9$@m$s^TKOf3-Gtmj^e@OgDTr9C0z@eHA_l8o!Sb^C z48Xx@ahZmt4mZGoTrAkezKub_v6ez81vAir^<9^c-8w8;`HWRqx?|;o;Jk3?Wx;!U z2~ujYEO!l9*DctrgPqRuo7;ZwhBRTk2z#|e_A5QGU81AU=!%iPPu-_B>alpt=ro=; z`r8zv+h~a>ojK?=NeMbe`>@|UoyLR4wy|3=C^&AZvWeg>y$9@J`hl1M2X+aqF74QZ z8N0A-yLqWiaF)taZVHm?u%Xf-vgGnhjMSDoC#}2a&85_3oLb>mXk0Ccjr^KDF z##&z5zUO8E4@RZjY5G2_UZ;bUYvFvXH7f_nL4PutOeCI-wI59!!%$^9nLM13l%!Q| z$*@nV(=+M>T8TR*Mv`g@t;C($KdMfTs!N-jn;+nD)X^DrI;pOe&6$}Qv+Sw;k}iN8 z!^C=puH}!arEGb?*68@;H&_rfn~~$iX7xRv>N_ zwOtg}Jy7kN4-JeFpUV(l2UtcpD#Pe|K!@ zaKV3o{Sf)!R0S)uK}BE27C-f@d=}0Of4c_kL3rCX7VMq9F*fa485dv#Y+yOr#jM4u zQyX_e+iSGO*ovgLsH7*1m)c%5BHF?D0i#|2!=bJ?>C)CllNOD{I)6~gbai8TXD!QNx*EXrc_6lB)UCg% zUfq~C&H0UT_%hWBS*}c|A(x|Ea(40S*H_0Zk1sVmxhO`0*TqQH8xb4+g5aZnh=HLK z@Kf9K?EE4dtr>Qs0lhWeskES0M6>}ti9XR5i#O;4daw3^(V`;%2QBb5L+e%=^dMM9 ze0@P<$m)N?>i-hXmycM+?e8%txeE)cw{P1;oZnlhi$}y5-9Y5jWBL5-`^%2I8W#UQ z!Z+98Z70PKcVRI>i=Mk+K`2@<0H6OU{OvPZ09jKP?QdWvy_zX{Sy%eS8}uh?5MLlh zehv=%ri@&vZxd#0$6hRQG6Q;&?m~k#TCVtU1uU^KV5{rTqUAYmvB;6z0T%2iG(rXp z?KmVe-GNTyIksbq+Gjl57SY&_&02dS+wqsUUvRa}QXf{=+K~Gk#OmzRHY4Wy*kS5{X1D_5@Y1o%u!nkPUr8PZpn zmh2UO4hsNKOU(5=Kb!#Vq4|&SV*umP{D0zCp&9?^k?%jM&>l~$_>w&beC2x~n`sHC zu$h(#k*SZw z!0-t2qU(iKg6LJ4kTk??i}8Zd+D*D9W3{PGXnT}!9L4wu#sp6jN*pz#fHS!+E0T@X zr}=WnkMs*J;J01mg`#H{3PJD&PWd__=8}vV!ud-VkmsiZTNN|G6f(hedL6NI5}X?B z@I}Vnw=qK1Kg3s|?UEVNvbod=+>gxn!xmL&)?C2oxY_)abrj(na*8pYQ zQ|vsb>N=6J?nx%5$MDbz+)CPwuIFMJ>BptLdbPdX?Tx+KL8HBK(D;@?dY|5f>btkQ zMCU^K#KtI)M4rFycc?a?JBQcCyHQNSq zLoIjCC-bT0S!q|+&`EhdYp9LVHoLJ^_hhy?=hY_skEpk~jPa`4oJam+Y!;FUb@~$` zHlNgi^K~v;NPD(*Zxucg-jh*p!<(@>?{7WX+VaQ!ExdhG^-X`v_d)x3o4(4OKh8zd zXO_yK@xeiJaBv*t6YzazmKlO2pvS=}Z Date: Sat, 19 Jan 2019 12:14:59 -0500 Subject: [PATCH 03/16] trainer_card up to sub_80C4998 --- asm/trainer_card.s | 3356 ---------------------------------------- include/trainer_card.h | 22 +- src/pokedex.c | 2 +- src/trainer_card.c | 1626 ++++++++++++++++++- 4 files changed, 1626 insertions(+), 3380 deletions(-) diff --git a/asm/trainer_card.s b/asm/trainer_card.s index 090b396ce..e78b2fec2 100644 --- a/asm/trainer_card.s +++ b/asm/trainer_card.s @@ -6,3362 +6,6 @@ .text - thumb_func_start sub_80C2C80 -sub_80C2C80: @ 80C2C80 - push {lr} - sub sp, 0x8 - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r0, r1, r2 - ldrb r0, [r0] - adds r3, r1, 0 - cmp r0, 0xA - bls _080C2C96 - b _080C2DD8 -_080C2C96: - lsls r0, 2 - ldr r1, =_080C2CA8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C2CA8: - .4byte _080C2CD4 - .4byte _080C2CEC - .4byte _080C2D14 - .4byte _080C2D50 - .4byte _080C2D6A - .4byte _080C2D74 - .4byte _080C2D88 - .4byte _080C2D8E - .4byte _080C2DA0 - .4byte _080C2DA6 - .4byte _080C2DB8 -_080C2CD4: - bl sub_80C334C - bl sub_80C3414 - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _080C2DCC - .pool -_080C2CEC: - movs r1, 0xE0 - lsls r1, 19 - movs r0, 0 - str r0, [sp] - ldr r0, =0x040000d4 - mov r2, sp - str r2, [r0] - str r1, [r0, 0x4] - ldr r1, =0x85000100 - str r1, [r0, 0x8] - ldr r0, [r0, 0x8] - movs r0, 0x87 - lsls r0, 3 - adds r1, r3, r0 - b _080C2DCC - .pool -_080C2D14: - ldr r0, =gUnknown_02039CE8 - ldr r0, [r0] - ldr r1, =0x0000052c - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0 - bne _080C2D36 - movs r2, 0xA0 - lsls r2, 19 - add r1, sp, 0x4 - strh r0, [r1] - ldr r0, =0x040000d4 - str r1, [r0] - str r2, [r0, 0x4] - ldr r1, =0x81000200 - str r1, [r0, 0x8] - ldr r0, [r0, 0x8] -_080C2D36: - movs r2, 0x87 - lsls r2, 3 - adds r1, r3, r2 - b _080C2DCC - .pool -_080C2D50: - bl ResetSpriteData - bl FreeAllSpritePalettes - bl ResetPaletteFade - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_080C2D6A: - bl sub_80C3388 - b _080C2DC4 - .pool -_080C2D74: - bl sub_80C41D8 - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _080C2DCC - .pool -_080C2D88: - bl sub_80C2AD8 - b _080C2DBC -_080C2D8E: - bl sub_80C4330 - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _080C2DCC - .pool -_080C2DA0: - bl sub_80C3278 - b _080C2DC4 -_080C2DA6: - bl sub_80C3548 - ldr r1, =gMain - movs r0, 0x87 - lsls r0, 3 - adds r1, r0 - b _080C2DCC - .pool -_080C2DB8: - bl sub_80C43A8 -_080C2DBC: - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bne _080C2DDC -_080C2DC4: - ldr r1, =gMain - movs r2, 0x87 - lsls r2, 3 - adds r1, r2 -_080C2DCC: - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - b _080C2DDC - .pool -_080C2DD8: - bl sub_80C3404 -_080C2DDC: - add sp, 0x8 - pop {r0} - bx r0 - thumb_func_end sub_80C2C80 - - thumb_func_start sav12_xor_get_clamped_above -sav12_xor_get_clamped_above: @ 80C2DE4 - push {r4,lr} - adds r4, r1, 0 - lsls r0, 24 - lsrs r0, 24 - bl GetGameStat - cmp r0, r4 - bls _080C2DF6 - adds r0, r4, 0 -_080C2DF6: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sav12_xor_get_clamped_above - - thumb_func_start sub_80C2DFC -sub_80C2DFC: @ 80C2DFC - push {r4,r5,lr} - movs r5, 0 -_080C2E00: - lsls r4, r5, 1 - ldr r1, =0x000008c4 - adds r0, r4, r1 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _080C2E1E - ldr r1, =0x000008c5 - adds r0, r4, r1 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - bne _080C2E2C -_080C2E1E: - movs r0, 0 - b _080C2E38 - .pool -_080C2E2C: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x6 - bls _080C2E00 - movs r0, 0x1 -_080C2E38: - pop {r4,r5} - pop {r1} - bx r1 - thumb_func_end sub_80C2DFC - - thumb_func_start sub_80C2E40 -sub_80C2E40: @ 80C2E40 - push {r4,lr} - movs r0, 0xA - bl GetGameStat - negs r1, r0 - orrs r1, r0 - lsrs r4, r1, 31 - bl sub_80C08E4 - lsls r0, 16 - cmp r0, 0 - beq _080C2E5A - adds r4, 0x1 -_080C2E5A: - bl sub_80F8940 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bls _080C2E6C - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_080C2E6C: - bl sub_80C2DFC - lsls r0, 24 - cmp r0, 0 - beq _080C2E7C - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 -_080C2E7C: - adds r0, r4, 0 - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80C2E40 - - thumb_func_start sub_80C2E84 -sub_80C2E84: @ 80C2E84 - push {lr} - adds r1, r0, 0 - movs r2, 0 - ldrh r0, [r1, 0x6] - cmp r0, 0 - bne _080C2E96 - ldr r0, [r1, 0x8] - cmp r0, 0 - beq _080C2E98 -_080C2E96: - movs r2, 0x1 -_080C2E98: - ldrb r0, [r1, 0x3] - cmp r0, 0 - beq _080C2EA4 - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 -_080C2EA4: - ldrh r0, [r1, 0x1A] - cmp r0, 0x31 - bls _080C2EB0 - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 -_080C2EB0: - ldrb r0, [r1, 0x4] - cmp r0, 0 - beq _080C2EBC - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 -_080C2EBC: - adds r0, r2, 0 - pop {r1} - bx r1 - thumb_func_end sub_80C2E84 - - thumb_func_start sub_80C2EC4 -sub_80C2EC4: @ 80C2EC4 - push {r4-r7,lr} - mov r7, r8 - push {r7} - adds r5, r0, 0 - lsls r1, 24 - lsrs r1, 24 - mov r8, r1 - ldr r6, =gSaveBlock2Ptr - ldr r1, [r6] - ldrb r0, [r1, 0x8] - strb r0, [r5] - ldrh r0, [r1, 0xE] - strh r0, [r5, 0x10] - ldrb r0, [r1, 0x10] - strh r0, [r5, 0x12] - movs r0, 0x1 - bl GetGameStat - adds r4, r0, 0 - movs r0, 0xA - bl GetGameStat - cmp r0, 0 - bne _080C2EF6 - movs r4, 0 -_080C2EF6: - lsrs r0, r4, 16 - strh r0, [r5, 0x6] - lsrs r1, r4, 8 - movs r2, 0xFF - ands r1, r2 - strh r1, [r5, 0x8] - ands r4, r2 - strh r4, [r5, 0xA] - ldr r1, =0x000003e7 - cmp r0, r1 - bls _080C2F14 - strh r1, [r5, 0x6] - movs r0, 0x3B - strh r0, [r5, 0x8] - strh r0, [r5, 0xA] -_080C2F14: - ldr r0, =0x00000861 - bl FlagGet - strb r0, [r5, 0x2] - bl sub_80C08E4 - strb r0, [r5, 0x3] - bl sub_80C376C - strh r0, [r5, 0xC] - ldr r0, [r6] - ldrb r1, [r0, 0xB] - lsls r1, 8 - ldrb r0, [r0, 0xA] - orrs r0, r1 - strh r0, [r5, 0xE] - ldr r4, =0x0000270f - movs r0, 0x17 - adds r1, r4, 0 - bl sav12_xor_get_clamped_above - strh r0, [r5, 0x14] - movs r0, 0x18 - adds r1, r4, 0 - bl sav12_xor_get_clamped_above - strh r0, [r5, 0x16] - ldr r1, =0x0000ffff - movs r0, 0x15 - bl sav12_xor_get_clamped_above - strh r0, [r5, 0x20] - ldr r4, =gSaveBlock1Ptr - ldr r0, [r4] - movs r1, 0x92 - lsls r1, 3 - adds r0, r1 - bl GetMoney - str r0, [r5, 0x24] - movs r2, 0 - adds r7, r5, 0 - adds r7, 0x30 - adds r6, r5, 0 - adds r6, 0x28 - ldr r0, [r4] - ldr r1, =0x00002bb0 - adds r3, r0, r1 -_080C2F74: - lsls r0, r2, 1 - adds r1, r6, r0 - adds r0, r3, r0 - ldrh r0, [r0] - strh r0, [r1] - adds r0, r2, 0x1 - lsls r0, 24 - lsrs r2, r0, 24 - cmp r2, 0x3 - bls _080C2F74 - ldr r0, =gSaveBlock2Ptr - ldr r1, [r0] - adds r0, r7, 0 - bl StringCopy - mov r0, r8 - cmp r0, 0x1 - beq _080C3004 - cmp r0, 0x1 - bgt _080C2FC0 - cmp r0, 0 - beq _080C2FCC - b _080C3014 - .pool -_080C2FC0: - mov r1, r8 - cmp r1, 0x2 - bne _080C3014 - movs r0, 0 - strh r0, [r5, 0x18] - strh r0, [r5, 0x1A] -_080C2FCC: - ldr r1, =0x000003e7 - movs r0, 0x23 - bl sav12_xor_get_clamped_above - strh r0, [r5, 0x1C] - ldr r1, =0x0000ffff - movs r0, 0x22 - bl sav12_xor_get_clamped_above - strh r0, [r5, 0x1E] - bl sub_80F8940 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x4 - bls _080C2FF0 - movs r0, 0x1 - strb r0, [r5, 0x4] -_080C2FF0: - adds r0, r5, 0 - bl sub_80C2E84 - strb r0, [r5, 0x1] - b _080C3014 - .pool -_080C3004: - movs r1, 0 - movs r0, 0 - strh r0, [r5, 0x18] - strh r0, [r5, 0x1A] - strh r0, [r5, 0x1C] - strh r0, [r5, 0x1E] - strb r1, [r5, 0x4] - strb r1, [r5, 0x1] -_080C3014: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80C2EC4 - - thumb_func_start sub_80C3020 -sub_80C3020: @ 80C3020 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0 - movs r2, 0x64 - bl memset - adds r1, r4, 0 - adds r1, 0x38 - movs r0, 0x3 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x2 - bl sub_80C2EC4 - bl sub_80C2DFC - lsls r0, 24 - lsrs r0, 24 - adds r1, r4, 0 - adds r1, 0x60 - strh r0, [r1] - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000eba - adds r0, r2 - ldrh r0, [r0] - adds r2, r4, 0 - adds r2, 0x62 - strh r0, [r2] - ldrh r0, [r1] - cmp r0, 0 - beq _080C3066 - ldrb r0, [r4, 0x1] - adds r0, 0x1 - strb r0, [r4, 0x1] -_080C3066: - ldrb r0, [r4] - cmp r0, 0x1 - bne _080C3084 - ldr r2, =gUnknown_08329D54 - ldrh r0, [r4, 0xE] - movs r1, 0x7 - ands r0, r1 - adds r0, 0x8 - b _080C308C - .pool -_080C3084: - ldr r2, =gUnknown_08329D54 - ldrh r0, [r4, 0xE] - movs r1, 0x7 - ands r0, r1 -_080C308C: - lsls r0, 1 - adds r0, r2 - ldrh r1, [r0] - adds r0, r4, 0 - adds r0, 0x4F - strb r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3020 - - thumb_func_start TrainerCard_GenerateCardForPlayer -TrainerCard_GenerateCardForPlayer: @ 80C30A4 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0 - movs r2, 0x60 - bl memset - adds r1, r4, 0 - adds r1, 0x38 - movs r0, 0x3 - strb r0, [r1] - adds r0, r4, 0 - movs r1, 0x2 - bl sub_80C2EC4 - bl sub_80C2DFC - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x3A] - ldr r1, =gSaveBlock2Ptr - ldr r1, [r1] - ldr r2, =0x00000eba - adds r1, r2 - ldrh r1, [r1] - strh r1, [r4, 0x3C] - cmp r0, 0 - beq _080C30E0 - ldrb r0, [r4, 0x1] - adds r0, 0x1 - strb r0, [r4, 0x1] -_080C30E0: - ldrb r0, [r4] - cmp r0, 0x1 - bne _080C3100 - ldr r2, =gUnknown_08329D54 - ldrh r0, [r4, 0xE] - movs r1, 0x7 - ands r0, r1 - adds r0, 0x8 - b _080C3108 - .pool -_080C3100: - ldr r2, =gUnknown_08329D54 - ldrh r0, [r4, 0xE] - movs r1, 0x7 - ands r0, r1 -_080C3108: - lsls r0, 1 - adds r0, r2 - ldrh r1, [r0] - adds r0, r4, 0 - adds r0, 0x4F - strb r1, [r0] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end TrainerCard_GenerateCardForPlayer - - thumb_func_start sub_80C3120 -sub_80C3120: @ 80C3120 - push {r4-r6,lr} - adds r5, r0, 0 - adds r6, r1, 0 - lsls r4, r2, 24 - lsrs r4, 24 - movs r1, 0 - movs r2, 0x64 - bl memset - adds r0, r5, 0 - adds r0, 0x38 - strb r4, [r0] - adds r0, r4, 0 - bl sub_80C4FCC - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080C3162 - cmp r0, 0x1 - bgt _080C3150 - cmp r0, 0 - beq _080C3156 - b _080C318A -_080C3150: - cmp r0, 0x2 - beq _080C316E - b _080C318A -_080C3156: - adds r0, r5, 0 - adds r1, r6, 0 - movs r2, 0x60 - bl memcpy - b _080C318A -_080C3162: - adds r0, r5, 0 - adds r1, r6, 0 - movs r2, 0x38 - bl memcpy - b _080C318A -_080C316E: - adds r0, r5, 0 - adds r1, r6, 0 - movs r2, 0x60 - bl memcpy - movs r0, 0 - str r0, [r5, 0x3C] - ldrh r1, [r6, 0x3A] - adds r0, r5, 0 - adds r0, 0x60 - strh r1, [r0] - ldrh r1, [r6, 0x3C] - adds r0, 0x2 - strh r1, [r0] -_080C318A: - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80C3120 - - thumb_func_start sub_80C3190 -sub_80C3190: @ 80C3190 - push {r4,r5,lr} - ldr r4, =gUnknown_02039CE8 - ldr r0, [r4] - movs r1, 0 - strb r1, [r0, 0xA] - ldr r0, [r4] - strb r1, [r0, 0xB] - ldr r0, [r4] - strb r1, [r0, 0xC] - ldr r0, [r4] - strb r1, [r0, 0xD] - ldr r0, [r4] - strb r1, [r0, 0xE] - ldr r0, [r4] - strb r1, [r0, 0xF] - ldr r0, [r4] - strb r1, [r0, 0x10] - ldr r0, [r4] - adds r0, 0x11 - movs r2, 0x8 - bl memset - ldr r1, [r4] - ldr r2, =0x00000536 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080C31CE - ldrb r0, [r1, 0xA] - adds r0, 0x1 - strb r0, [r1, 0xA] -_080C31CE: - ldr r1, [r4] - ldr r3, =0x0000053a - adds r0, r1, r3 - ldrh r0, [r0] - cmp r0, 0 - bne _080C31E4 - ldr r2, =0x0000053c - adds r0, r1, r2 - ldr r0, [r0] - cmp r0, 0 - beq _080C31EA -_080C31E4: - ldrb r0, [r1, 0xB] - adds r0, 0x1 - strb r0, [r1, 0xB] -_080C31EA: - ldr r2, =gUnknown_02039CE8 - ldr r1, [r2] - movs r3, 0xA9 - lsls r3, 3 - adds r0, r1, r3 - ldr r0, [r0] - cmp r0, 0 - beq _080C3200 - ldrb r0, [r1, 0xC] - adds r0, 0x1 - strb r0, [r1, 0xC] -_080C3200: - ldr r1, [r2] - ldr r3, =0x00000554 - adds r0, r1, r3 - ldrh r0, [r0] - cmp r0, 0 - beq _080C3212 - ldrb r0, [r1, 0x10] - adds r0, 0x1 - strb r0, [r1, 0x10] -_080C3212: - ldr r1, [r2] - ldr r2, =0x0000054c - adds r0, r1, r2 - ldr r0, [r0] - cmp r0, 0 - beq _080C3224 - ldrb r0, [r1, 0xD] - adds r0, 0x1 - strb r0, [r1, 0xD] -_080C3224: - movs r5, 0 - ldr r4, =0x00000867 -_080C3228: - lsls r0, r4, 16 - lsrs r0, 16 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _080C3244 - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - adds r1, 0x11 - adds r1, r5 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_080C3244: - adds r4, 0x1 - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - ldr r0, =0x0000086e - cmp r4, r0 - bls _080C3228 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3190 - - thumb_func_start sub_80C3278 -sub_80C3278: @ 80C3278 - push {lr} - movs r1, 0xC1 - lsls r1, 6 - movs r0, 0 - bl SetGpuReg - movs r0, 0 - bl ShowBg - movs r0, 0x1 - bl ShowBg - movs r0, 0x2 - bl ShowBg - movs r0, 0x3 - bl ShowBg - movs r0, 0x50 - movs r1, 0xC1 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0x3F - bl SetGpuReg - movs r0, 0x4A - movs r1, 0x1E - bl SetGpuReg - movs r0, 0x44 - movs r1, 0xA0 - bl SetGpuReg - movs r0, 0x40 - movs r1, 0xF0 - bl SetGpuReg - ldr r0, =gReceivedRemoteLinkPlayers - ldrb r0, [r0] - cmp r0, 0 - beq _080C32E0 - movs r0, 0xC7 - bl EnableInterrupts - b _080C32E6 - .pool -_080C32E0: - movs r0, 0x3 - bl EnableInterrupts -_080C32E6: - pop {r0} - bx r0 - thumb_func_end sub_80C3278 - - thumb_func_start sub_80C32EC -sub_80C32EC: @ 80C32EC - push {r4,lr} - lsls r0, 16 - lsrs r0, 16 - adds r0, 0x28 - movs r1, 0xA - bl __divsi3 - lsls r0, 24 - lsrs r2, r0, 24 - asrs r0, 24 - cmp r0, 0x4 - bgt _080C3306 - movs r2, 0 -_080C3306: - ldr r4, =gUnknown_02039CE8 - ldr r0, [r4] - movs r1, 0xA5 - lsls r1, 3 - adds r0, r1 - strb r2, [r0] - ldr r0, [r4] - adds r0, r1 - movs r1, 0 - ldrsb r1, [r0, r1] - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x54 - bl SetGpuReg - ldr r0, [r4] - ldr r1, =0x00007ca8 - adds r0, r1 - ldrh r2, [r0] - lsls r1, r2, 8 - movs r0, 0xA0 - subs r0, r2 - orrs r1, r0 - lsls r1, 16 - lsrs r1, 16 - movs r0, 0x44 - bl SetGpuReg - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C32EC - - thumb_func_start sub_80C334C -sub_80C334C: @ 80C334C - push {lr} - movs r0, 0 - bl SetVBlankCallback - movs r0, 0 - bl SetHBlankCallback - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0x8 - movs r1, 0 - bl SetGpuReg - movs r0, 0xA - movs r1, 0 - bl SetGpuReg - movs r0, 0xC - movs r1, 0 - bl SetGpuReg - movs r0, 0xE - movs r1, 0 - bl SetGpuReg - pop {r0} - bx r0 - thumb_func_end sub_80C334C - - thumb_func_start sub_80C3388 -sub_80C3388: @ 80C3388 - push {lr} - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_0856FAB4 - movs r0, 0 - movs r2, 0x4 - bl InitBgsFromTemplates - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - ldr r0, =gUnknown_0856FAC4 - bl InitWindows - bl DeactivateAllTextPrinters - bl sub_81973A4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3388 - - thumb_func_start sub_80C3404 -sub_80C3404: @ 80C3404 - push {lr} - ldr r0, =sub_80C2710 - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3404 - - thumb_func_start sub_80C3414 -sub_80C3414: @ 80C3414 - push {lr} - bl ResetTasks - bl ScanlineEffect_Stop - ldr r0, =sub_80C2760 - movs r1, 0 - bl CreateTask - bl sub_80C4EE4 - bl sub_80C3190 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3414 - - thumb_func_start sub_80C3438 -sub_80C3438: @ 80C3438 - push {lr} - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - ldrb r0, [r1, 0x1] - cmp r0, 0x5 - bhi _080C3494 - lsls r0, 2 - ldr r1, =_080C3458 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C3458: - .4byte _080C3470 - .4byte _080C3476 - .4byte _080C347C - .4byte _080C3482 - .4byte _080C3488 - .4byte _080C348E -_080C3470: - bl sub_80C3574 - b _080C349C -_080C3476: - bl sub_80C3608 - b _080C349C -_080C347C: - bl sub_80C3684 - b _080C349C -_080C3482: - bl sub_80C378C - b _080C349C -_080C3488: - bl sub_80C3880 - b _080C349C -_080C348E: - bl sub_80C3A18 - b _080C349C -_080C3494: - movs r0, 0 - strb r0, [r1, 0x1] - movs r0, 0x1 - b _080C34A8 -_080C349C: - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - ldrb r0, [r1, 0x1] - adds r0, 0x1 - strb r0, [r1, 0x1] - movs r0, 0 -_080C34A8: - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C3438 - - thumb_func_start sub_80C34B0 -sub_80C34B0: @ 80C34B0 - push {lr} - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - ldrb r0, [r1, 0x1] - cmp r0, 0x7 - bhi _080C352C - lsls r0, 2 - ldr r1, =_080C34D0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C34D0: - .4byte _080C34F0 - .4byte _080C34F6 - .4byte _080C34FC - .4byte _080C3502 - .4byte _080C3508 - .4byte _080C3512 - .4byte _080C351C - .4byte _080C3526 -_080C34F0: - bl sub_80C3B50 - b _080C3534 -_080C34F6: - bl sub_80C3CCC - b _080C3534 -_080C34FC: - bl sub_80C3D60 - b _080C3534 -_080C3502: - bl sub_80C3DF0 - b _080C3534 -_080C3508: - bl sub_80C3E58 - bl sub_80C3F64 - b _080C3534 -_080C3512: - bl sub_80C3ED4 - bl sub_80C3FE0 - b _080C3534 -_080C351C: - bl sub_80C4140 - bl sub_80C40CC - b _080C3534 -_080C3526: - bl sub_80C42A4 - b _080C3534 -_080C352C: - movs r0, 0 - strb r0, [r1, 0x1] - movs r0, 0x1 - b _080C3540 -_080C3534: - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - ldrb r0, [r1, 0x1] - adds r0, 0x1 - strb r0, [r1, 0x1] - movs r0, 0 -_080C3540: - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C34B0 - - thumb_func_start sub_80C3548 -sub_80C3548: @ 80C3548 - push {lr} - bl sub_80C3AF0 - bl sub_80C3BC4 - bl sub_80C3CF4 - bl sub_80C3DC0 - bl sub_80C3E20 - bl sub_80C3E98 - bl sub_80C3F14 - bl sub_80C3FA4 - bl sub_80C4020 - pop {r0} - bx r0 - thumb_func_end sub_80C3548 - - thumb_func_start sub_80C3574 -sub_80C3574: @ 80C3574 - push {r4,r5,lr} - sub sp, 0x2C - ldr r1, =gText_TrainerCardName - add r0, sp, 0xC - bl StringCopy - adds r5, r0, 0 - ldr r4, =gUnknown_02039CE8 - ldr r1, [r4] - ldr r0, =0x00000564 - adds r1, r0 - adds r0, r5, 0 - bl StringCopy - ldr r0, [r4] - ldr r1, =0x00007caa - adds r0, r1 - ldrb r1, [r0] - adds r0, r5, 0 - bl ConvertInternationalString - ldr r0, [r4] - ldr r1, =0x0000052a - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080C35E0 - ldr r0, =gUnknown_0856FB0C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - add r0, sp, 0xC - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x14 - movs r3, 0x1C - bl AddTextPrinterParameterized3 - b _080C35FA - .pool -_080C35E0: - ldr r0, =gUnknown_0856FB0C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - add r1, sp, 0xC - str r1, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x10 - movs r3, 0x21 - bl AddTextPrinterParameterized3 -_080C35FA: - add sp, 0x2C - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3574 - - thumb_func_start sub_80C3608 -sub_80C3608: @ 80C3608 - push {r4,lr} - sub sp, 0x2C - ldr r1, =gText_TrainerCardIDNo - add r0, sp, 0xC - bl StringCopy - ldr r4, =gUnknown_02039CE8 - ldr r1, [r4] - ldr r2, =0x00000542 - adds r1, r2 - ldrh r1, [r1] - movs r2, 0x2 - movs r3, 0x5 - bl ConvertIntToDecimalStringN - ldr r0, [r4] - ldr r1, =0x0000052a - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080C3650 - movs r0, 0x1 - add r1, sp, 0xC - movs r2, 0x50 - bl GetStringCenterAlignXOffset - adds r0, 0x84 - b _080C365C - .pool -_080C3650: - movs r0, 0x1 - add r1, sp, 0xC - movs r2, 0x60 - bl GetStringCenterAlignXOffset - adds r0, 0x78 -_080C365C: - movs r3, 0x9 - lsls r2, r0, 24 - lsrs r2, 24 - ldr r0, =gUnknown_0856FB0C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - add r0, sp, 0xC - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - bl AddTextPrinterParameterized3 - add sp, 0x2C - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3608 - - thumb_func_start sub_80C3684 -sub_80C3684: @ 80C3684 - push {r4,r5,lr} - sub sp, 0xC - ldr r0, =gUnknown_02039CE8 - ldr r0, [r0] - ldr r1, =0x0000052b - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080C36C4 - ldr r0, =gUnknown_0856FB0C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - ldr r0, =gText_TrainerCardMoney - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x14 - movs r3, 0x38 - bl AddTextPrinterParameterized3 - b _080C36DE - .pool -_080C36C4: - ldr r0, =gUnknown_0856FB0C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - ldr r0, =gText_TrainerCardMoney - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x10 - movs r3, 0x39 - bl AddTextPrinterParameterized3 -_080C36DE: - ldr r0, =gStringVar1 - ldr r4, =gUnknown_02039CE8 - ldr r1, [r4] - movs r2, 0xAB - lsls r2, 3 - adds r1, r2 - ldr r1, [r1] - movs r2, 0 - movs r3, 0x6 - bl ConvertIntToDecimalStringN - ldr r5, =gStringVar4 - ldr r1, =gText_PokedollarVar1 - adds r0, r5, 0 - bl StringExpandPlaceholders - ldr r0, [r4] - ldr r1, =0x0000052b - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080C3734 - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x90 - bl GetStringRightAlignXOffset - movs r3, 0x38 - b _080C3740 - .pool -_080C3734: - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x80 - bl GetStringRightAlignXOffset - movs r3, 0x39 -_080C3740: - lsls r2, r0, 24 - lsrs r2, 24 - ldr r0, =gUnknown_0856FB0C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - ldr r0, =gStringVar4 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - bl AddTextPrinterParameterized3 - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3684 - - thumb_func_start sub_80C376C -sub_80C376C: @ 80C376C - push {lr} - bl IsNationalPokedexEnabled - cmp r0, 0 - bne _080C377E - movs r0, 0x1 - bl GetHoennPokedexCount - b _080C3784 -_080C377E: - movs r0, 0x1 - bl GetNationalPokedexCount -_080C3784: - lsls r0, 16 - lsrs r0, 16 - pop {r1} - bx r1 - thumb_func_end sub_80C376C - - thumb_func_start sub_80C378C -sub_80C378C: @ 80C378C - push {r4,r5,lr} - sub sp, 0xC - ldr r0, =0x00000861 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _080C386E - ldr r0, =gUnknown_02039CE8 - ldr r0, [r0] - ldr r1, =0x0000052b - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080C37DC - ldr r0, =gUnknown_0856FB0C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - ldr r0, =gText_TrainerCardPokedex - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x14 - movs r3, 0x48 - bl AddTextPrinterParameterized3 - b _080C37F6 - .pool -_080C37DC: - ldr r0, =gUnknown_0856FB0C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - ldr r0, =gText_TrainerCardPokedex - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x10 - movs r3, 0x49 - bl AddTextPrinterParameterized3 -_080C37F6: - ldr r5, =gStringVar4 - ldr r4, =gUnknown_02039CE8 - ldr r0, [r4] - movs r1, 0xA8 - lsls r1, 3 - adds r0, r1 - ldrh r1, [r0] - adds r0, r5, 0 - movs r2, 0 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r1, =gText_EmptyString6 - bl StringCopy - ldr r0, [r4] - ldr r1, =0x0000052b - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080C3848 - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x90 - bl GetStringRightAlignXOffset - movs r3, 0x48 - b _080C3854 - .pool -_080C3848: - movs r0, 0x1 - adds r1, r5, 0 - movs r2, 0x80 - bl GetStringRightAlignXOffset - movs r3, 0x49 -_080C3854: - lsls r2, r0, 24 - lsrs r2, 24 - ldr r0, =gUnknown_0856FB0C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - ldr r0, =gStringVar4 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - bl AddTextPrinterParameterized3 -_080C386E: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C378C - - thumb_func_start sub_80C3880 -sub_80C3880: @ 80C3880 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - ldr r0, =gUnknown_02039CE8 - ldr r0, [r0] - ldr r1, =0x0000052b - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080C38C8 - ldr r0, =gUnknown_0856FB0C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - ldr r0, =gText_TrainerCardTime - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x14 - movs r3, 0x58 - bl AddTextPrinterParameterized3 - b _080C38E2 - .pool -_080C38C8: - ldr r0, =gUnknown_0856FB0C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - ldr r0, =gText_TrainerCardTime - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x10 - movs r3, 0x59 - bl AddTextPrinterParameterized3 -_080C38E2: - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - ldrb r0, [r1, 0x5] - cmp r0, 0 - beq _080C390C - ldr r2, =0x00000544 - adds r0, r1, r2 - ldrh r5, [r0] - adds r2, 0x2 - adds r0, r1, r2 - ldrh r6, [r0] - b _080C3914 - .pool -_080C390C: - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldrh r5, [r0, 0xE] - ldrb r6, [r0, 0x10] -_080C3914: - ldr r0, =0x000003e7 - cmp r5, r0 - bls _080C391C - adds r5, r0, 0 -_080C391C: - cmp r6, 0x3B - bls _080C3922 - movs r6, 0x3B -_080C3922: - ldr r1, =gText_Colon2 - movs r0, 0x1 - movs r2, 0 - bl GetStringWidth - mov r10, r0 - ldr r0, =gUnknown_02039CE8 - ldr r0, [r0] - ldr r1, =0x0000052b - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080C3958 - movs r7, 0x90 - movs r4, 0x58 - b _080C395C - .pool -_080C3958: - movs r7, 0x80 - movs r4, 0x59 -_080C395C: - mov r0, r10 - adds r0, 0x1E - subs r7, r0 - lsls r2, r7, 16 - lsrs r2, 16 - lsls r0, 16 - lsrs r0, 16 - str r0, [sp] - movs r0, 0xF - str r0, [sp, 0x4] - movs r0, 0x1 - movs r1, 0 - adds r3, r4, 0 - bl FillWindowPixelRect - ldr r2, =gStringVar4 - mov r9, r2 - mov r0, r9 - adds r1, r5, 0 - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - lsls r2, r7, 24 - lsrs r2, 24 - ldr r0, =gUnknown_0856FB0C - mov r8, r0 - str r0, [sp] - movs r5, 0x1 - negs r5, r5 - str r5, [sp, 0x4] - mov r1, r9 - str r1, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - adds r3, r4, 0 - bl AddTextPrinterParameterized3 - adds r7, 0x12 - lsls r2, r7, 24 - lsrs r2, 24 - ldr r1, =gUnknown_0856FB40 - ldr r0, =gUnknown_02039CE8 - ldr r0, [r0] - ldrb r0, [r0, 0x7] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - str r0, [sp] - str r5, [sp, 0x4] - ldr r0, =gText_Colon2 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - adds r3, r4, 0 - bl AddTextPrinterParameterized3 - add r7, r10 - mov r0, r9 - adds r1, r6, 0 - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalStringN - lsls r2, r7, 24 - lsrs r2, 24 - mov r0, r8 - str r0, [sp] - str r5, [sp, 0x4] - mov r1, r9 - str r1, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - adds r3, r4, 0 - bl AddTextPrinterParameterized3 - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3880 - - thumb_func_start sub_80C3A18 -sub_80C3A18: @ 80C3A18 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0xC - ldr r7, =gUnknown_02039CE8 - ldr r1, [r7] - ldrb r0, [r1, 0x5] - cmp r0, 0 - beq _080C3ACE - ldr r0, =gUnknown_0856FB48 - mov r8, r0 - ldr r4, =0x0000052b - adds r0, r1, r4 - ldrb r0, [r0] - add r0, r8 - ldrb r3, [r0] - ldr r6, =gUnknown_0856FB0C - str r6, [sp] - movs r5, 0x1 - negs r5, r5 - str r5, [sp, 0x4] - adds r0, r1, 0 - adds r0, 0x19 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x8 - bl AddTextPrinterParameterized3 - ldr r1, [r7] - adds r1, 0x19 - movs r0, 0x1 - movs r2, 0 - bl GetStringWidth - adds r2, r0, 0 - adds r2, 0xE - lsls r2, 24 - lsrs r2, 24 - ldr r1, [r7] - adds r0, r1, r4 - ldrb r0, [r0] - add r0, r8 - ldrb r3, [r0] - str r6, [sp] - str r5, [sp, 0x4] - adds r1, 0x26 - str r1, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - bl AddTextPrinterParameterized3 - ldr r0, =gUnknown_0856FB4A - mov r8, r0 - ldr r1, [r7] - adds r0, r1, r4 - ldrb r0, [r0] - add r0, r8 - ldrb r3, [r0] - str r6, [sp] - str r5, [sp, 0x4] - adds r1, 0x33 - str r1, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x8 - bl AddTextPrinterParameterized3 - ldr r1, [r7] - adds r1, 0x33 - movs r0, 0x1 - movs r2, 0 - bl GetStringWidth - adds r2, r0, 0 - adds r2, 0xE - lsls r2, 24 - lsrs r2, 24 - ldr r1, [r7] - adds r4, r1, r4 - ldrb r0, [r4] - add r0, r8 - ldrb r3, [r0] - str r6, [sp] - str r5, [sp, 0x4] - adds r1, 0x40 - str r1, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - bl AddTextPrinterParameterized3 -_080C3ACE: - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3A18 - - thumb_func_start sub_80C3AF0 -sub_80C3AF0: @ 80C3AF0 - push {r4,lr} - ldr r4, =gUnknown_02039CE8 - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0x4D - ldr r2, =0x00000564 - adds r1, r2 - bl StringCopy - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0x4D - ldr r2, =0x00007caa - adds r1, r2 - ldrb r1, [r1] - bl ConvertInternationalString - ldr r1, [r4] - ldr r2, =0x0000052a - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080C3B30 - ldr r0, =gStringVar1 - adds r1, 0x4D - bl StringCopy - ldr r0, [r4] - adds r0, 0x4D - ldr r1, =gText_Var1sTrainerCard - bl StringExpandPlaceholders -_080C3B30: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3AF0 - - thumb_func_start sub_80C3B50 -sub_80C3B50: @ 80C3B50 - push {r4,lr} - sub sp, 0xC - ldr r4, =gUnknown_02039CE8 - ldr r1, [r4] - ldr r2, =0x0000052b - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _080C3B8C - ldr r0, =gUnknown_0856FB0C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - adds r0, r1, 0 - adds r0, 0x4D - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r2, 0x88 - movs r3, 0x9 - bl AddTextPrinterParameterized3 - b _080C3BB6 - .pool -_080C3B8C: - adds r1, 0x4D - movs r0, 0x1 - movs r2, 0xD8 - bl GetStringRightAlignXOffset - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - ldr r0, =gUnknown_0856FB0C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0x4] - ldr r0, [r4] - adds r0, 0x4D - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r3, 0x9 - bl AddTextPrinterParameterized3 -_080C3BB6: - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3B50 - - thumb_func_start sub_80C3BC4 -sub_80C3BC4: @ 80C3BC4 - push {r4,lr} - ldr r4, =gUnknown_02039CE8 - ldr r1, [r4] - ldrb r0, [r1, 0xB] - cmp r0, 0 - beq _080C3C0E - ldr r0, =gStringVar1 - ldr r2, =0x0000053a - adds r1, r2 - ldrh r1, [r1] - movs r2, 0x1 - movs r3, 0x3 - bl ConvertIntToDecimalStringN - ldr r0, =gStringVar2 - ldr r1, [r4] - ldr r2, =0x0000053c - adds r1, r2 - ldrh r1, [r1] - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalStringN - ldr r0, =gStringVar3 - ldr r1, [r4] - ldr r2, =0x0000053e - adds r1, r2 - ldrh r1, [r1] - movs r2, 0x2 - movs r3, 0x2 - bl ConvertIntToDecimalStringN - ldr r0, [r4] - adds r0, 0x93 - ldr r1, =gUnknown_0856FB4C - bl StringExpandPlaceholders -_080C3C0E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3BC4 - - thumb_func_start sub_80C3C34 -sub_80C3C34: @ 80C3C34 - push {r4-r6,lr} - mov r6, r10 - mov r5, r9 - mov r4, r8 - push {r4-r6} - sub sp, 0xC - adds r4, r0, 0 - mov r9, r2 - mov r10, r3 - ldr r2, =gUnknown_0856FB55 - ldr r6, =gUnknown_02039CE8 - ldr r0, [r6] - ldr r5, =0x0000052b - adds r0, r5 - ldrb r0, [r0] - adds r0, r2 - ldrb r2, [r0] - lsls r4, 28 - movs r0, 0x84 - lsls r0, 22 - adds r4, r0 - lsrs r4, 24 - ldr r0, =gUnknown_0856FB0C - str r0, [sp] - movs r0, 0x1 - negs r0, r0 - mov r8, r0 - str r0, [sp, 0x4] - str r1, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - adds r3, r4, 0 - bl AddTextPrinterParameterized3 - ldr r1, =gUnknown_0856FB57 - ldr r0, [r6] - adds r0, r5 - ldrb r0, [r0] - adds r0, r1 - ldrb r2, [r0] - movs r0, 0x1 - mov r1, r9 - bl GetStringRightAlignXOffset - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - mov r0, r10 - str r0, [sp] - mov r0, r8 - str r0, [sp, 0x4] - mov r0, r9 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - adds r3, r4, 0 - bl AddTextPrinterParameterized3 - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3C34 - - thumb_func_start sub_80C3CCC -sub_80C3CCC: @ 80C3CCC - push {lr} - ldr r0, =gUnknown_02039CE8 - ldr r2, [r0] - ldrb r0, [r2, 0xB] - cmp r0, 0 - beq _080C3CE4 - ldr r1, =gText_HallOfFameDebut - adds r2, 0x93 - ldr r3, =gUnknown_0856FB0F - movs r0, 0 - bl sub_80C3C34 -_080C3CE4: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3CCC - - thumb_func_start sub_80C3CF4 -sub_80C3CF4: @ 80C3CF4 - push {r4,lr} - ldr r4, =gUnknown_02039CE8 - ldr r1, [r4] - ldrb r0, [r1, 0xC] - cmp r0, 0 - beq _080C3D40 - adds r0, r1, 0 - adds r0, 0xD9 - ldr r2, =gUnknown_0856FB5C - ldr r3, =0x0000052a - adds r1, r3 - ldrb r1, [r1] - lsls r1, 2 - adds r1, r2 - ldr r1, [r1] - bl StringCopy - ldr r1, [r4] - ldr r2, =0x00000165 - adds r0, r1, r2 - movs r3, 0xA9 - lsls r3, 3 - adds r1, r3 - ldrh r1, [r1] - movs r2, 0 - movs r3, 0x4 - bl ConvertIntToDecimalStringN - ldr r1, [r4] - ldr r2, =0x000001ab - adds r0, r1, r2 - ldr r3, =0x0000054a - adds r1, r3 - ldrh r1, [r1] - movs r2, 0 - movs r3, 0x4 - bl ConvertIntToDecimalStringN -_080C3D40: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3CF4 - - thumb_func_start sub_80C3D60 -sub_80C3D60: @ 80C3D60 - push {r4,r5,lr} - ldr r5, =gUnknown_02039CE8 - ldr r1, [r5] - ldrb r0, [r1, 0xC] - cmp r0, 0 - beq _080C3D9A - ldr r0, =gStringVar1 - ldr r2, =0x00000165 - adds r1, r2 - bl StringCopy - ldr r0, =gStringVar2 - ldr r1, [r5] - ldr r2, =0x000001ab - adds r1, r2 - bl StringCopy - ldr r4, =gStringVar4 - ldr r1, =gText_WinsLosses - adds r0, r4, 0 - bl StringExpandPlaceholders - ldr r1, [r5] - adds r1, 0xD9 - ldr r3, =gUnknown_0856FB0C - movs r0, 0x1 - adds r2, r4, 0 - bl sub_80C3C34 -_080C3D9A: - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3D60 - - thumb_func_start sub_80C3DC0 -sub_80C3DC0: @ 80C3DC0 - push {lr} - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - ldrb r0, [r1, 0x10] - cmp r0, 0 - beq _080C3DDE - ldr r2, =0x00000237 - adds r0, r1, r2 - ldr r2, =0x00000554 - adds r1, r2 - ldrh r1, [r1] - movs r2, 0x1 - movs r3, 0x5 - bl ConvertIntToDecimalStringN -_080C3DDE: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3DC0 - - thumb_func_start sub_80C3DF0 -sub_80C3DF0: @ 80C3DF0 - push {lr} - ldr r0, =gUnknown_02039CE8 - ldr r2, [r0] - ldrb r0, [r2, 0x10] - cmp r0, 0 - beq _080C3E0A - ldr r1, =gText_PokemonTrades - ldr r0, =0x00000237 - adds r2, r0 - ldr r3, =gUnknown_0856FB0F - movs r0, 0x2 - bl sub_80C3C34 -_080C3E0A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3DF0 - - thumb_func_start sub_80C3E20 -sub_80C3E20: @ 80C3E20 - push {lr} - ldr r0, =gUnknown_02039CE8 - ldr r2, [r0] - ldr r1, =0x0000052a - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080C3E48 - movs r3, 0xAE - lsls r3, 3 - adds r0, r2, r3 - ldr r1, [r0] - cmp r1, 0 - beq _080C3E48 - ldr r3, =0x000002c3 - adds r0, r2, r3 - movs r2, 0x1 - movs r3, 0x5 - bl ConvertIntToDecimalStringN -_080C3E48: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3E20 - - thumb_func_start sub_80C3E58 -sub_80C3E58: @ 80C3E58 - push {lr} - ldr r0, =gUnknown_02039CE8 - ldr r2, [r0] - ldr r1, =0x0000052a - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080C3E80 - adds r1, 0x46 - adds r0, r2, r1 - ldr r0, [r0] - cmp r0, 0 - beq _080C3E80 - ldr r1, =gText_BerryCrush - ldr r0, =0x000002c3 - adds r2, r0 - ldr r3, =gUnknown_0856FB0F - movs r0, 0x4 - bl sub_80C3C34 -_080C3E80: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3E58 - - thumb_func_start sub_80C3E98 -sub_80C3E98: @ 80C3E98 - push {lr} - ldr r0, =gUnknown_02039CE8 - ldr r2, [r0] - ldr r1, =0x0000052a - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080C3EBE - ldr r3, =0x00000574 - adds r0, r2, r3 - ldr r1, [r0] - cmp r1, 0 - beq _080C3EBE - ldr r3, =0x0000034f - adds r0, r2, r3 - movs r2, 0x1 - movs r3, 0x5 - bl ConvertIntToDecimalStringN -_080C3EBE: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3E98 - - thumb_func_start sub_80C3ED4 -sub_80C3ED4: @ 80C3ED4 - push {lr} - ldr r0, =gUnknown_02039CE8 - ldr r2, [r0] - ldr r1, =0x0000052a - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0 - bne _080C3EFC - adds r1, 0x4A - adds r0, r2, r1 - ldr r0, [r0] - cmp r0, 0 - beq _080C3EFC - ldr r1, =gText_UnionTradesAndBattles - ldr r0, =0x0000034f - adds r2, r0 - ldr r3, =gUnknown_0856FB0F - movs r0, 0x3 - bl sub_80C3C34 -_080C3EFC: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3ED4 - - thumb_func_start sub_80C3F14 -sub_80C3F14: @ 80C3F14 - push {r4,lr} - ldr r4, =gUnknown_02039CE8 - ldr r1, [r4] - ldr r2, =0x0000052a - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080C3F46 - ldr r0, =0x00000552 - adds r1, r0 - ldrh r0, [r1] - cmp r0, 0 - beq _080C3F46 - ldr r0, =gStringVar1 - ldrh r1, [r1] - movs r2, 0x1 - movs r3, 0x5 - bl ConvertIntToDecimalStringN - ldr r0, [r4] - ldr r1, =0x00000395 - adds r0, r1 - ldr r1, =gText_Var1DarkGreyShadowLightGrey - bl StringExpandPlaceholders -_080C3F46: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3F14 - - thumb_func_start sub_80C3F64 -sub_80C3F64: @ 80C3F64 - push {lr} - ldr r0, =gUnknown_02039CE8 - ldr r2, [r0] - ldr r1, =0x0000052a - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _080C3F8C - adds r1, 0x28 - adds r0, r2, r1 - ldrh r0, [r0] - cmp r0, 0 - beq _080C3F8C - ldr r1, =gText_PokeblocksWithFriends - ldr r0, =0x00000395 - adds r2, r0 - ldr r3, =gUnknown_0856FB0F - movs r0, 0x3 - bl sub_80C3C34 -_080C3F8C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3F64 - - thumb_func_start sub_80C3FA4 -sub_80C3FA4: @ 80C3FA4 - push {lr} - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - ldr r2, =0x0000052a - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - beq _080C3FCE - movs r3, 0xAA - lsls r3, 3 - adds r2, r1, r3 - ldrh r0, [r2] - cmp r0, 0 - beq _080C3FCE - ldr r3, =0x000003db - adds r0, r1, r3 - ldrh r1, [r2] - movs r2, 0x1 - movs r3, 0x5 - bl ConvertIntToDecimalStringN -_080C3FCE: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3FA4 - - thumb_func_start sub_80C3FE0 -sub_80C3FE0: @ 80C3FE0 - push {lr} - ldr r0, =gUnknown_02039CE8 - ldr r2, [r0] - ldr r1, =0x0000052a - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _080C4008 - adds r1, 0x26 - adds r0, r2, r1 - ldrh r0, [r0] - cmp r0, 0 - beq _080C4008 - ldr r1, =gText_WonContestsWFriends - ldr r0, =0x000003db - adds r2, r0 - ldr r3, =gUnknown_0856FB0F - movs r0, 0x4 - bl sub_80C3C34 -_080C4008: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C3FE0 - - thumb_func_start sub_80C4020 -sub_80C4020: @ 80C4020 - push {r4,lr} - ldr r4, =gUnknown_02039CE8 - ldr r1, [r4] - ldr r2, =0x0000052a - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x1 - beq _080C4044 - cmp r0, 0x1 - ble _080C40B6 - cmp r0, 0x2 - beq _080C4094 - b _080C40B6 - .pool -_080C4044: - ldrb r0, [r1, 0xD] - cmp r0, 0 - beq _080C40B6 - ldr r0, =gStringVar1 - ldr r2, =0x0000054c - adds r1, r2 - ldrh r1, [r1] - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalStringN - ldr r0, =gStringVar2 - ldr r1, [r4] - ldr r2, =0x0000054e - adds r1, r2 - ldrh r1, [r1] - movs r2, 0x1 - movs r3, 0x4 - bl ConvertIntToDecimalStringN - ldr r0, [r4] - ldr r1, =0x00000421 - adds r0, r1 - ldr r1, =gText_WSlashStraightSlash - bl StringExpandPlaceholders - b _080C40B6 - .pool -_080C4094: - ldr r2, =0x00000596 - adds r1, r2 - ldrh r0, [r1] - cmp r0, 0 - beq _080C40B6 - ldr r0, =gStringVar1 - ldrh r1, [r1] - movs r2, 0x1 - movs r3, 0x5 - bl ConvertIntToDecimalStringN - ldr r0, [r4] - ldr r1, =0x00000421 - adds r0, r1 - ldr r1, =gText_Var1DarkLightGreyBP - bl StringExpandPlaceholders -_080C40B6: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C4020 - - thumb_func_start sub_80C40CC -sub_80C40CC: @ 80C40CC - push {lr} - ldr r0, =gUnknown_02039CE8 - ldr r2, [r0] - ldr r1, =0x0000052a - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _080C40F0 - cmp r0, 0x1 - ble _080C412C - cmp r0, 0x2 - beq _080C4114 - b _080C412C - .pool -_080C40F0: - ldrb r0, [r2, 0xD] - cmp r0, 0 - beq _080C412C - ldr r1, =gText_BattleTower - ldr r0, =0x00000421 - adds r2, r0 - ldr r3, =gUnknown_0856FB0C - movs r0, 0x5 - bl sub_80C3C34 - b _080C412C - .pool -_080C4114: - ldr r1, =0x00000596 - adds r0, r2, r1 - ldrh r0, [r0] - cmp r0, 0 - beq _080C412C - ldr r1, =gText_BattlePtsWon - ldr r0, =0x00000421 - adds r2, r0 - ldr r3, =gUnknown_0856FB0F - movs r0, 0x5 - bl sub_80C3C34 -_080C412C: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C40CC - - thumb_func_start sub_80C4140 -sub_80C4140: @ 80C4140 - push {r4,r5,lr} - sub sp, 0x20 - ldr r1, =gUnknown_0856FB68 - add r0, sp, 0x10 - movs r2, 0x6 - bl memcpy - add r4, sp, 0x18 - ldr r1, =gUnknown_0856FB6E - adds r0, r4, 0 - movs r2, 0x6 - bl memcpy - ldr r0, =gUnknown_02039CE8 - ldr r0, [r0] - ldr r1, =0x0000052a - adds r0, r1 - ldrb r0, [r0] - adds r5, r4, 0 - cmp r0, 0 - bne _080C41C0 - movs r4, 0 -_080C416C: - ldr r0, =gUnknown_02039CE8 - ldr r0, [r0] - lsls r1, r4, 1 - movs r2, 0xB1 - lsls r2, 3 - adds r0, r2 - adds r1, r0, r1 - ldrh r0, [r1] - cmp r0, 0 - beq _080C41B6 - bl sub_80D30A0 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r4, 20 - movs r2, 0xE0 - lsls r2, 16 - adds r1, r2 - lsrs r1, 16 - adds r2, r5, r4 - ldrb r2, [r2] - adds r2, 0x3 - lsls r2, 24 - lsrs r2, 24 - movs r3, 0x4 - str r3, [sp] - str r3, [sp, 0x4] - add r0, sp - adds r0, 0x10 - ldrb r0, [r0] - str r0, [sp, 0x8] - movs r0, 0x1 - str r0, [sp, 0xC] - movs r0, 0x3 - movs r3, 0xF - bl WriteSequenceToBgTilemapBuffer -_080C41B6: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x5 - bls _080C416C -_080C41C0: - add sp, 0x20 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C4140 - - thumb_func_start sub_80C41D8 -sub_80C41D8: @ 80C41D8 - push {r4,r5,lr} - sub sp, 0x4 - ldr r0, =gMonIconPalettes - ldr r4, =gUnknown_02039CE8 - ldr r1, [r4] - movs r5, 0x8D - lsls r5, 3 - adds r1, r5 - movs r2, 0x60 - bl CpuSet - ldr r4, [r4] - ldr r1, =0x00000582 - adds r0, r4, r1 - ldrb r0, [r0] - cmp r0, 0x1 - beq _080C4214 - cmp r0, 0x1 - ble _080C424A - cmp r0, 0x2 - beq _080C422A - cmp r0, 0x3 - beq _080C4242 - b _080C424A - .pool -_080C4214: - movs r2, 0x8D - lsls r2, 3 - adds r0, r4, r2 - movs r1, 0 - str r1, [sp] - movs r1, 0x60 - movs r2, 0 - movs r3, 0 - bl TintPalette_CustomTone - b _080C424A -_080C422A: - adds r0, r4, r5 - movs r2, 0xFA - lsls r2, 1 - movs r3, 0xA5 - lsls r3, 1 - movs r1, 0x9B - lsls r1, 1 - str r1, [sp] - movs r1, 0x60 - bl TintPalette_CustomTone - b _080C424A -_080C4242: - adds r0, r4, r5 - movs r1, 0x60 - bl TintPalette_SepiaTone -_080C424A: - ldr r0, =gUnknown_02039CE8 - ldr r0, [r0] - movs r1, 0x8D - lsls r1, 3 - adds r0, r1 - movs r1, 0x50 - movs r2, 0xC0 - bl LoadPalette - movs r4, 0 -_080C425E: - ldr r0, =gUnknown_02039CE8 - ldr r0, [r0] - lsls r1, r4, 1 - movs r2, 0xB1 - lsls r2, 3 - adds r0, r2 - adds r1, r0, r1 - ldrh r0, [r1] - cmp r0, 0 - beq _080C428E - movs r1, 0 - bl GetMonIconTiles - adds r1, r0, 0 - lsls r3, r4, 20 - movs r0, 0x80 - lsls r0, 14 - adds r3, r0 - lsrs r3, 16 - movs r0, 0x3 - movs r2, 0x80 - lsls r2, 2 - bl LoadBgTiles -_080C428E: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x5 - bls _080C425E - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C41D8 - - thumb_func_start sub_80C42A4 -sub_80C42A4: @ 80C42A4 - push {r4,lr} - sub sp, 0x14 - ldr r1, =gUnknown_0856FB74 - add r0, sp, 0x10 - movs r2, 0x4 - bl memcpy - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - ldr r2, =0x0000052a - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _080C4316 - adds r2, 0x56 - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0x1 - bne _080C4316 - movs r4, 0 -_080C42CC: - ldr r0, =gUnknown_02039CE8 - ldr r0, [r0] - ldr r1, =0x00000584 - adds r0, r1 - adds r0, r4 - ldrb r3, [r0] - cmp r3, 0 - beq _080C430C - lsls r1, r4, 18 - movs r2, 0xA0 - lsls r2, 17 - adds r1, r2 - lsrs r1, 16 - lsls r2, r4, 1 - adds r2, r4 - adds r2, 0x2 - lsls r2, 24 - lsrs r2, 24 - movs r0, 0x2 - str r0, [sp] - str r0, [sp, 0x4] - subs r0, r3, 0x1 - add r0, sp - adds r0, 0x10 - ldrb r0, [r0] - str r0, [sp, 0x8] - movs r0, 0x1 - str r0, [sp, 0xC] - movs r0, 0x3 - movs r3, 0x2 - bl WriteSequenceToBgTilemapBuffer -_080C430C: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _080C42CC -_080C4316: - add sp, 0x14 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C42A4 - - thumb_func_start sub_80C4330 -sub_80C4330: @ 80C4330 - push {lr} - ldr r0, =gUnknown_0856F54C - movs r1, 0xB0 - movs r2, 0x20 - bl LoadPalette - ldr r0, =gUnknown_0856F56C - movs r1, 0xC0 - movs r2, 0x20 - bl LoadPalette - ldr r0, =gUnknown_0856F58C - movs r1, 0xD0 - movs r2, 0x20 - bl LoadPalette - ldr r0, =gUnknown_0856F5AC - movs r1, 0xE0 - movs r2, 0x20 - bl LoadPalette - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - ldr r0, =0x000017a8 - adds r1, r0 - movs r2, 0x80 - lsls r2, 3 - movs r0, 0x3 - movs r3, 0x80 - bl LoadBgTiles - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C4330 - - thumb_func_start sub_80C438C -sub_80C438C: @ 80C438C - push {r4,lr} - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80C438C - - thumb_func_start sub_80C43A8 -sub_80C43A8: @ 80C43A8 - push {r4,lr} - sub sp, 0x8 - ldr r0, =gUnknown_02039CE8 - ldr r0, [r0] - ldrb r0, [r0, 0x3] - cmp r0, 0x4 - bls _080C43B8 - b _080C4532 -_080C43B8: - lsls r0, 2 - ldr r1, =_080C43CC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C43CC: - .4byte _080C43E0 - .4byte _080C43F8 - .4byte _080C4418 - .4byte _080C44D8 - .4byte _080C4500 -_080C43E0: - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - ldr r0, =0x000013a8 - adds r1, r0 - movs r2, 0x80 - lsls r2, 3 - movs r0, 0x3 - b _080C4406 - .pool -_080C43F8: - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - ldr r3, =0x000019a8 - adds r1, r3 - movs r2, 0xC0 - lsls r2, 5 - movs r0, 0 -_080C4406: - movs r3, 0 - bl LoadBgTiles - b _080C4536 - .pool -_080C4418: - ldr r4, =gUnknown_02039CE8 - ldr r2, [r4] - ldr r1, =0x0000052a - adds r0, r2, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _080C447C - ldr r1, =gEmeraldTrainerCardStarPals - ldr r3, =0x00000535 - adds r0, r2, r3 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0 - movs r2, 0x60 - bl LoadPalette - ldr r0, =gUnknown_0856F4EC - movs r1, 0x30 - movs r2, 0x20 - bl LoadPalette - ldr r0, [r4] - ldr r1, =0x00000534 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _080C44B2 - ldr r0, =gUnknown_0856F4AC - movs r1, 0x10 - movs r2, 0x20 - bl LoadPalette - b _080C44B2 - .pool -_080C447C: - ldr r1, =gFireRedTrainerCardStarPals - ldr r3, =0x00000535 - adds r0, r2, r3 - ldrb r0, [r0] - lsls r0, 2 - adds r0, r1 - ldr r0, [r0] - movs r1, 0 - movs r2, 0x60 - bl LoadPalette - ldr r0, =gUnknown_0856F50C - movs r1, 0x30 - movs r2, 0x20 - bl LoadPalette - ldr r0, [r4] - ldr r1, =0x00000534 - adds r0, r1 - ldrb r0, [r0] - cmp r0, 0 - beq _080C44B2 - ldr r0, =gUnknown_0856F4CC - movs r1, 0x10 - movs r2, 0x20 - bl LoadPalette -_080C44B2: - ldr r0, =gUnknown_0856F52C - movs r1, 0x40 - movs r2, 0x20 - bl LoadPalette - b _080C4536 - .pool -_080C44D8: - ldr r4, =gUnknown_02039CE8 - ldr r1, [r4] - ldr r3, =0x00003ca8 - adds r1, r3 - movs r0, 0 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00005ca8 - adds r1, r0 - movs r0, 0x2 - bl SetBgTilemapBuffer - b _080C4536 - .pool -_080C4500: - movs r4, 0x20 - str r4, [sp] - str r4, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - str r4, [sp] - str r4, [sp, 0x4] - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - str r4, [sp] - str r4, [sp, 0x4] - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 -_080C4532: - movs r0, 0x1 - b _080C4542 -_080C4536: - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - ldrb r0, [r1, 0x3] - adds r0, 0x1 - strb r0, [r1, 0x3] - movs r0, 0 -_080C4542: - add sp, 0x8 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C43A8 - - thumb_func_start sub_80C4550 -sub_80C4550: @ 80C4550 - push {r4-r7,lr} - adds r7, r0, 0 - ldr r0, =gUnknown_02039CE8 - ldr r0, [r0] - ldr r1, =0x00005ca8 - adds r6, r0, r1 - movs r1, 0 -_080C455E: - movs r2, 0 - lsls r5, r1, 16 - asrs r1, r5, 16 - lsls r3, r1, 5 - lsls r0, r1, 4 - subs r0, r1 - lsls r4, r0, 1 -_080C456C: - lsls r0, r2, 16 - asrs r1, r0, 16 - adds r2, r0, 0 - cmp r1, 0x1D - bgt _080C4590 - adds r0, r3, r1 - lsls r0, 1 - adds r0, r6 - adds r1, r4, r1 - lsls r1, 1 - adds r1, r7 - ldrh r1, [r1] - b _080C4598 - .pool -_080C4590: - adds r0, r3, r1 - lsls r0, 1 - adds r0, r6 - ldrh r1, [r7] -_080C4598: - strh r1, [r0] - movs r1, 0x80 - lsls r1, 9 - adds r0, r2, r1 - lsrs r2, r0, 16 - asrs r0, 16 - cmp r0, 0x1F - ble _080C456C - adds r0, r5, r1 - lsrs r1, r0, 16 - asrs r0, 16 - cmp r0, 0x13 - ble _080C455E - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80C4550 - - thumb_func_start sub_80C45C0 -sub_80C45C0: @ 80C45C0 - push {r4-r7,lr} - adds r7, r0, 0 - ldr r0, =gUnknown_02039CE8 - ldr r0, [r0] - ldr r1, =0x00003ca8 - adds r6, r0, r1 - movs r1, 0 -_080C45CE: - movs r2, 0 - lsls r5, r1, 16 - asrs r1, r5, 16 - lsls r3, r1, 5 - lsls r0, r1, 4 - subs r0, r1 - lsls r4, r0, 1 -_080C45DC: - lsls r0, r2, 16 - asrs r1, r0, 16 - adds r2, r0, 0 - cmp r1, 0x1D - bgt _080C4600 - adds r0, r3, r1 - lsls r0, 1 - adds r0, r6 - adds r1, r4, r1 - lsls r1, 1 - adds r1, r7 - ldrh r1, [r1] - b _080C4608 - .pool -_080C4600: - adds r0, r3, r1 - lsls r0, 1 - adds r0, r6 - ldrh r1, [r7] -_080C4608: - strh r1, [r0] - movs r1, 0x80 - lsls r1, 9 - adds r0, r2, r1 - lsrs r2, r0, 16 - asrs r0, 16 - cmp r0, 0x1F - ble _080C45DC - adds r0, r5, r1 - lsrs r1, r0, 16 - asrs r0, 16 - cmp r0, 0x13 - ble _080C45CE - movs r0, 0 - bl CopyBgTilemapBufferToVram - pop {r4-r7} - pop {r0} - bx r0 - thumb_func_end sub_80C45C0 - - thumb_func_start sub_80C4630 -sub_80C4630: @ 80C4630 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0xC - movs r0, 0xC0 - mov r8, r0 - movs r2, 0x3 - mov r10, r2 - ldr r2, =gUnknown_0856FB78 - ldr r4, =gUnknown_02039CE8 - ldr r1, [r4] - ldr r3, =0x0000052b - adds r0, r1, r3 - ldrb r0, [r0] - adds r0, r2 - ldrb r3, [r0] - ldr r0, =0x00000535 - adds r1, r0 - ldrb r0, [r1] - str r0, [sp] - movs r0, 0x1 - str r0, [sp, 0x4] - movs r0, 0x4 - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x8F - movs r2, 0xF - bl FillBgTilemapBufferRect - ldr r0, [r4] - ldrb r0, [r0, 0x5] - cmp r0, 0 - bne _080C4724 - movs r2, 0x4 - mov r9, r2 - movs r2, 0 - movs r6, 0x1 -_080C467E: - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - lsls r0, r2, 16 - asrs r7, r0, 16 - adds r1, 0x11 - adds r1, r7 - ldrb r0, [r1] - cmp r0, 0 - beq _080C4700 - mov r3, r9 - lsls r5, r3, 24 - lsrs r5, 24 - str r6, [sp] - str r6, [sp, 0x4] - mov r0, r10 - str r0, [sp, 0x8] - movs r0, 0x3 - mov r1, r8 - adds r2, r5, 0 - movs r3, 0xF - bl FillBgTilemapBufferRect - mov r1, r8 - adds r1, 0x1 - lsls r1, 16 - lsrs r1, 16 - mov r4, r9 - adds r4, 0x1 - lsls r4, 24 - lsrs r4, 24 - str r6, [sp] - str r6, [sp, 0x4] - mov r2, r10 - str r2, [sp, 0x8] - movs r0, 0x3 - adds r2, r4, 0 - movs r3, 0xF - bl FillBgTilemapBufferRect - mov r1, r8 - adds r1, 0x10 - lsls r1, 16 - lsrs r1, 16 - str r6, [sp] - str r6, [sp, 0x4] - mov r3, r10 - str r3, [sp, 0x8] - movs r0, 0x3 - adds r2, r5, 0 - movs r3, 0x10 - bl FillBgTilemapBufferRect - mov r1, r8 - adds r1, 0x11 - lsls r1, 16 - lsrs r1, 16 - str r6, [sp] - str r6, [sp, 0x4] - mov r0, r10 - str r0, [sp, 0x8] - movs r0, 0x3 - adds r2, r4, 0 - movs r3, 0x10 - bl FillBgTilemapBufferRect -_080C4700: - adds r0, r7, 0x1 - lsls r0, 16 - mov r1, r8 - adds r1, 0x2 - lsls r1, 16 - lsrs r1, 16 - mov r8, r1 - mov r2, r9 - lsls r1, r2, 16 - movs r3, 0xC0 - lsls r3, 10 - adds r1, r3 - lsrs r1, 16 - mov r9, r1 - lsrs r2, r0, 16 - asrs r0, 16 - cmp r0, 0x7 - ble _080C467E -_080C4724: - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - add sp, 0xC - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C4630 - - thumb_func_start sub_80C474C -sub_80C474C: @ 80C474C - push {r4-r6,lr} - sub sp, 0xC - ldr r6, =gUnknown_02039CE8 - ldr r1, [r6] - ldr r2, =0x0000052a - adds r0, r1, r2 - ldrb r0, [r0] - cmp r0, 0 - bne _080C4800 - ldrb r0, [r1, 0x10] - cmp r0, 0 - beq _080C478A - movs r4, 0x1 - str r4, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x8D - movs r2, 0x1B - movs r3, 0x9 - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x9D - movs r2, 0x1B - movs r3, 0xA - bl FillBgTilemapBufferRect -_080C478A: - ldr r0, [r6] - movs r1, 0xAE - lsls r1, 3 - adds r0, r1 - ldr r0, [r0] - cmp r0, 0 - beq _080C47BE - movs r4, 0x1 - str r4, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x8D - movs r2, 0x15 - movs r3, 0xD - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x9D - movs r2, 0x15 - movs r3, 0xE - bl FillBgTilemapBufferRect -_080C47BE: - ldr r0, [r6] - ldr r2, =0x00000574 - adds r0, r2 - ldr r0, [r0] - cmp r0, 0 - beq _080C48B8 - movs r4, 0x1 - str r4, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x8D - movs r2, 0x1B - movs r3, 0xB - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x9D - movs r2, 0x1B - movs r3, 0xC - bl FillBgTilemapBufferRect - b _080C48B8 - .pool -_080C4800: - ldrb r0, [r1, 0x10] - cmp r0, 0 - beq _080C482E - movs r4, 0x1 - str r4, [sp] - str r4, [sp, 0x4] - movs r5, 0 - str r5, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x8D - movs r2, 0x1B - movs r3, 0x9 - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x9D - movs r2, 0x1B - movs r3, 0xA - bl FillBgTilemapBufferRect -_080C482E: - ldr r0, [r6] - movs r1, 0xAA - lsls r1, 3 - adds r0, r1 - ldrh r0, [r0] - cmp r0, 0 - beq _080C4864 - movs r4, 0x1 - str r4, [sp] - str r4, [sp, 0x4] - movs r5, 0 - str r5, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x8D - movs r2, 0x1B - movs r3, 0xD - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x9D - movs r2, 0x1B - movs r3, 0xE - bl FillBgTilemapBufferRect -_080C4864: - ldr r0, [r6] - ldrb r0, [r0, 0xD] - cmp r0, 0 - beq _080C48B8 - movs r4, 0x1 - str r4, [sp] - str r4, [sp, 0x4] - movs r5, 0 - str r5, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x8D - movs r2, 0x11 - movs r3, 0xF - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x9D - movs r2, 0x11 - movs r3, 0x10 - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x8C - movs r2, 0x1B - movs r3, 0xF - bl FillBgTilemapBufferRect - str r4, [sp] - str r4, [sp, 0x4] - str r5, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x9C - movs r2, 0x1B - movs r3, 0x10 - bl FillBgTilemapBufferRect -_080C48B8: - movs r0, 0x3 - bl CopyBgTilemapBufferToVram - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - thumb_func_end sub_80C474C - - thumb_func_start sub_80C48C8 -sub_80C48C8: @ 80C48C8 - push {lr} - ldr r3, =gUnknown_02039CE8 - ldr r1, [r3] - ldrb r0, [r1, 0x6] - adds r0, 0x1 - strb r0, [r1, 0x6] - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3C - bls _080C48F6 - ldr r1, [r3] - movs r0, 0 - strb r0, [r1, 0x6] - ldr r2, [r3] - ldrb r0, [r2, 0x7] - movs r1, 0x1 - eors r0, r1 - strb r0, [r2, 0x7] - ldr r0, [r3] - ldr r1, =0x00000529 - adds r0, r1 - movs r1, 0x1 - strb r1, [r0] -_080C48F6: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C48C8 - - thumb_func_start sub_80C4904 -sub_80C4904: @ 80C4904 - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTrainerCards - movs r1, 0x64 - muls r0, r1 - adds r0, r2 - ldrb r0, [r0, 0x1] - bx lr - .pool - thumb_func_end sub_80C4904 - - thumb_func_start sub_80C4918 -sub_80C4918: @ 80C4918 - push {r4,lr} - ldr r4, =sub_80C4960 - adds r0, r4, 0 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - bl _call_via_r4 - ldr r0, =sub_80C26D4 - bl SetHBlankCallback - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C4918 - - thumb_func_start sub_80C4940 -sub_80C4940: @ 80C4940 - push {lr} - ldr r0, =sub_80C4960 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0xFF - beq _080C4958 - movs r0, 0 - b _080C495A - .pool -_080C4958: - movs r0, 0x1 -_080C495A: - pop {r1} - bx r1 - thumb_func_end sub_80C4940 - - thumb_func_start sub_80C4960 -sub_80C4960: @ 80C4960 - push {r4,r5,lr} - lsls r0, 24 - lsrs r0, 24 - ldr r5, =gUnknown_0856FB28 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r4, r1, r2 -_080C4972: - movs r1, 0x8 - ldrsh r0, [r4, r1] - lsls r0, 2 - adds r0, r5 - ldr r1, [r0] - adds r0, r4, 0 - bl _call_via_r1 - lsls r0, 24 - cmp r0, 0 - bne _080C4972 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C4960 - - thumb_func_start sub_80C4998 -sub_80C4998: @ 80C4998 - push {r4,lr} - adds r4, r0, 0 - movs r0, 0x1 - bl HideBg - movs r0, 0x3 - bl HideBg - bl ScanlineEffect_Stop - bl ScanlineEffect_Clear - movs r1, 0 - ldr r0, =gScanlineEffectRegBuffers - movs r2, 0 - movs r3, 0xF0 - lsls r3, 3 - adds r0, r3 -_080C49BC: - strh r2, [r0] - adds r0, 0x2 - adds r1, 0x1 - cmp r1, 0x9F - bls _080C49BC - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] - movs r0, 0 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C4998 thumb_func_start sub_80C49D8 sub_80C49D8: @ 80C49D8 diff --git a/include/trainer_card.h b/include/trainer_card.h index 1af247d8a..a3d9160e0 100644 --- a/include/trainer_card.h +++ b/include/trainer_card.h @@ -12,7 +12,7 @@ struct TrainerCard /*0x06*/ u16 firstHallOfFameA; /*0x08*/ u16 firstHallOfFameB; /*0x0A*/ u16 firstHallOfFameC; - /*0x0C*/ u16 pokedexSeen; + /*0x0C*/ u16 pokedexCaught; /*0x0E*/ u16 trainerId; /*0x10*/ u16 playTimeHours; /*0x12*/ u16 playTimeMinutes; @@ -27,14 +27,26 @@ struct TrainerCard /*0x24*/ u32 money; /*0x28*/ u16 var_28[4]; /*0x30*/ u8 playerName[8]; - /*0x38*/ u8 emeraldAddedUnknownFields[0x54-0x38]; - /*0x54*/ u16 monSpecies[2]; - /*0x58*/ u8 emeraldAddedUnknownFields2[0x64-0x58]; + /*0x38*/ u8 var_38; + /*0x39*/ u8 var_39; + /*0x3A*/ u16 var_3A; + /*0x3C*/ u32 var_3C; + /*0x40*/ u32 var_40; + /*0x44*/ u8 filler44[0x8]; + /*0x4C*/ u8 var_4C; + /*0x4D*/ u8 var_4D; + /*0x4E*/ u8 var_4E; + /*0x4F*/ u8 var_4F; + /*0x50*/ u8 var_50[0x4]; + /*0x54*/ u16 monSpecies[6]; + /*0x60*/ u16 var_60; + /*0x62*/ u16 var_62; }; + extern struct TrainerCard gTrainerCards[4]; -void sub_80C3120(struct TrainerCard *arg0, u16 *arg1, u8 gameVersion); +void sub_80C3120(struct TrainerCard *arg0, u16 *src, u8 gameVersion); void TrainerCard_ShowLinkCard(u8 arg0, void (*callback)(void)); void TrainerCard_GenerateCardForPlayer(struct TrainerCard *); u8 sub_80C4904(u8); diff --git a/src/pokedex.c b/src/pokedex.c index 8c6ed3159..3d294e9e9 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -4381,7 +4381,7 @@ u16 sub_80C089C(u8 caseID) return count; } -bool8 sub_80C08E4(void) +bool16 sub_80C08E4(void) { u16 i; diff --git a/src/trainer_card.c b/src/trainer_card.c index d23413a26..51ef20ddc 100755 --- a/src/trainer_card.c +++ b/src/trainer_card.c @@ -12,8 +12,26 @@ #include "overworld.h" #include "menu.h" #include "text.h" +#include "constants/flags.h" +#include "event_data.h" +#include "constants/game_stat.h" +#include "money.h" +#include "string_util.h" +#include "trainer_card.h" +#include "gpu_regs.h" +#include "international_string_util.h" +#include "pokedex.h" +#include "graphics.h" +#include "pokemon_icon.h" -extern const u8 gText_WaitingTrainerFinishReading[]; +//external functions +extern u8 sub_80F8940(void); +extern bool16 sub_80C08E4(void); +extern u8 sub_80D30A0(u16); +extern void TintPalette_CustomTone(u16 *palette, u16 count, u16 rTone, u16 gTone, u16 bTone); +extern void TintPalette_SepiaTone(u16 *palette, u16 count); + +//gfx extern const u32 gUnknown_08DD2AE0[]; extern const u32 gUnknown_08DD21B0[]; extern const u32 gUnknown_08DD2D30[]; @@ -28,6 +46,60 @@ extern const u32 gFireRedTrainerCard_Gfx[]; extern const u32 gUnknown_0856F018[]; extern const u32 gUnknown_08DD1F78[]; +//strings +extern const u8 gText_WaitingTrainerFinishReading[]; +extern const u8 gText_TrainerCardName[]; +extern const u8 gText_TrainerCardIDNo[]; +extern const u8 gText_TrainerCardMoney[]; +extern const u8 gText_PokedollarVar1[]; +extern const u8 gText_EmptyString6[]; +extern const u8 gText_TrainerCardPokedex[]; +extern const u8 gText_TrainerCardTime[]; +extern const u8 gText_Colon2[]; +extern const u8 gText_Var1sTrainerCard[]; +extern const u8 gText_HallOfFameDebut[]; +extern const u8 gText_WinsLosses[]; +extern const u8 gText_PokemonTrades[]; +extern const u8 gText_BerryCrush[]; +extern const u8 gText_UnionTradesAndBattles[]; +extern const u8 gText_Var1DarkGreyShadowLightGrey[]; +extern const u8 gText_PokeblocksWithFriends[]; +extern const u8 gText_WonContestsWFriends[]; +extern const u8 gText_WSlashStraightSlash[]; +extern const u8 gText_Var1DarkLightGreyBP[]; +extern const u8 gText_BattleTower[]; +extern const u8 gText_BattlePtsWon[]; + +//const rom data to be moved from data/trainer_card.s to this file +extern const struct BgTemplate gUnknown_0856FAB4[4]; +extern const struct WindowTemplate gUnknown_0856FAC4[]; +extern const u8 gUnknown_0856FB0C[]; +extern const u8* gUnknown_0856FB40[]; +extern const u8 gUnknown_0856FB48[]; +extern const u8 gUnknown_0856FB4A[]; +extern const u8 gUnknown_0856FB4C[]; +extern const u8 gUnknown_0856FB55[]; +extern const u8 gUnknown_0856FB57[]; +extern const u8 gUnknown_0856FB0F[]; +extern const u8* gUnknown_0856FB5C[]; +extern const u8 gUnknown_0856FB68[6]; +extern const u8 gUnknown_0856FB6E[6]; +extern const u8 gUnknown_0856FB74[4]; +extern const u8 gUnknown_0856F54C[]; +extern const u8 gUnknown_0856F56C[]; +extern const u8 gUnknown_0856F58C[]; +extern const u8 gUnknown_0856F5AC[]; +extern const u8 gUnknown_0856F4EC[]; +extern const u8 gUnknown_0856F4AC[]; +extern const u8 gUnknown_0856F50C[]; +extern const u8 gUnknown_0856F4CC[]; +extern const u8 gUnknown_0856F52C[]; +extern const u8* gEmeraldTrainerCardStarPals[]; +extern const u8* gFireRedTrainerCardStarPals[]; +extern const u8 gUnknown_0856FB78[]; +extern bool8 (*const gUnknown_0856FB28[])(struct Task *); + +//this file's functions /*static*/ void sub_80C2690(void); /*static*/ void sub_80C26D4(void); /*static*/ void sub_80C48C8(void); @@ -44,28 +116,109 @@ extern const u32 gUnknown_08DD1F78[]; /*static*/ bool8 sub_80C4940(void); /*static*/ bool8 sub_80C2AD8(void); /*static*/ void sub_80C2C80(void); +/*static*/ u32 sav12_xor_get_clamped_above(u8 stat, u32 max); +/*static*/ bool8 sub_80C2DFC(void); +/*static*/ u32 sub_80C2E40(void); +/*static*/ u8 TrainerCard_GetStarCount(struct TrainerCard*); +/*static*/ u16 sub_80C376C(void); +/*static*/ void sub_80C2EC4(struct TrainerCard*, u8); +/*static*/ void sub_80C3020(struct TrainerCard*); +/*static*/ u8 sub_80C4FCC(u8); +/*static*/ void sub_80C3190(void); +/*static*/ void sub_80C3278(void); +/*static*/ void sub_80C334C(void); +/*static*/ void sub_80C3388(void); +/*static*/ void sub_80C3404(void); +/*static*/ void sub_80C3414(void); +/*static*/ void sub_80C4EE4(void); +/*static*/ void sub_80C3574(void); +/*static*/ void sub_80C3608(void); +/*static*/ void sub_80C3684(void); +/*static*/ void sub_80C378C(void); +/*static*/ void sub_80C3A18(void); +/*static*/ bool8 sub_80C34B0(void); +/*static*/ void sub_80C3B50(void); +/*static*/ void sub_80C3CCC(void); +/*static*/ void sub_80C3D60(void); +/*static*/ void sub_80C3DF0(void); +/*static*/ void sub_80C3E58(void); +/*static*/ void sub_80C3F64(void); +/*static*/ void sub_80C3ED4(void); +/*static*/ void sub_80C3FE0(void); +/*static*/ void sub_80C4140(void); +/*static*/ void sub_80C40CC(void); +/*static*/ void sub_80C42A4(void); +/*static*/ void sub_80C3548(void); +/*static*/ void sub_80C3AF0(void); +/*static*/ void sub_80C3BC4(void); +/*static*/ void sub_80C3CF4(void); +/*static*/ void sub_80C3DC0(void); +/*static*/ void sub_80C3E20(void); +/*static*/ void sub_80C3E98(void); +/*static*/ void sub_80C3F14(void); +/*static*/ void sub_80C3FA4(void); +/*static*/ void sub_80C4020(void); +/*static*/ void sub_80C3C34(u8 top, const u8* str1, u8* str2, const u8* color); +/*static*/ void sub_80C4330(void); +/*static*/ u8 sub_80C43A8(void); +/*static*/ void sub_80C474C(void); +/*static*/ void sub_80C4960(u8); +/*static*/ bool8 sub_80C4998(struct Task* task); +/*static*/ bool8 sub_80C49D8(struct Task* task); +/*static*/ void sub_80C32EC(u16); extern struct UnknownStruct{ u8 var_0; u8 var_1; u8 var_2; - u8 filler3[2]; + u8 var_3; + u8 var_4; u8 var_5; - u8 filler6[3]; + u8 var_6; + u8 var_7; + u8 var_8; u8 var_9; - u8 fillerA[0x51F]; + u8 var_A; + u8 var_B; + u8 var_C; + u8 var_D; + u8 var_E; + u8 var_F; + u8 var_10; + u8 badgeCount[8]; + u8 var_19[0xD]; + u8 var_26[0xD]; + u8 var_33[0xD]; + u8 var_40[0xD]; + u8 var_4D[0x46]; + u8 var_93[0x46]; + u8 var_D9[0x8C]; + u8 var_165[0x46]; + u8 var_1AB[0x8C]; + u8 var_237[0x8C]; + u8 var_2C3[0x8C]; + u8 var_34F[0x46]; + u8 var_395[0x46]; + u8 var_3DB[0x46]; + u8 var_421[0x47]; + u16 var_468[0x60]; + s8 var_528; u8 var_529; u8 var_52A; u8 var_52B; u16 var_52C; void (*callback2)(void); - u8 filler531[0x64]; + struct TrainerCard var_534; u8 var_598[0x4B0]; u8 var_A48[0x4B0]; u8 var_EF8[0x4B0]; u8 var_13A8[0x400]; u8 var_17A8[0x200]; - u8 var_19A8[0x200]; + u8 var_19A8[0x2300]; + u8 var_3CA8[0x2000]; + u8 var_5CA8[0x2000]; + u16 var_7CA8; + u8 var_7CAA; }* gUnknown_02039CE8; void sub_80C2690(void) @@ -93,9 +246,9 @@ void sub_80C26D4(void) void sub_80C2710(void) { RunTasks(); - AnimateSprites(); - BuildOamBuffer(); - UpdatePaletteFade(); + AnimateSprites(); + BuildOamBuffer(); + UpdatePaletteFade(); } void sub_80C2728(u8 taskId) @@ -145,13 +298,13 @@ void sub_80C2760(u8 taskId) gUnknown_02039CE8->var_0++; break; case 7: - if(gWirelessCommType == TRUE && gReceivedRemoteLinkPlayers == TRUE) + if(gWirelessCommType == 1 && gReceivedRemoteLinkPlayers == TRUE) { sub_800E0E8(); CreateWirelessStatusIndicatorSprite(230, 150); } - BlendPalettes(-1, 16, gUnknown_02039CE8->var_52C); - BeginNormalPaletteFade(- 1, 0, 16, 0, gUnknown_02039CE8->var_52C); + BlendPalettes(0xFFFFFFFF, 16, gUnknown_02039CE8->var_52C); + BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, gUnknown_02039CE8->var_52C); SetVBlankCallback(sub_80C2690); gUnknown_02039CE8->var_0++; break; @@ -185,7 +338,7 @@ void sub_80C2760(u8 taskId) gUnknown_02039CE8->var_0 = 15; else { - BeginNormalPaletteFade(-1, 0, 0, 16, gUnknown_02039CE8->var_52C); + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, gUnknown_02039CE8->var_52C); gUnknown_02039CE8->var_0 = 14; } } @@ -204,7 +357,7 @@ void sub_80C2760(u8 taskId) gUnknown_02039CE8->var_0 = 15; else if(gReceivedRemoteLinkPlayers) { - BeginNormalPaletteFade(-1, 0, 0, 16, gUnknown_02039CE8->var_52C); + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, gUnknown_02039CE8->var_52C); gUnknown_02039CE8->var_0 = 14; } else @@ -220,7 +373,7 @@ void sub_80C2760(u8 taskId) gUnknown_02039CE8->var_0 = 15; else { - BeginNormalPaletteFade(-1, 0, 0, 16, gUnknown_02039CE8->var_52C); + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, gUnknown_02039CE8->var_52C); gUnknown_02039CE8->var_0 = 14; } } @@ -235,7 +388,7 @@ void sub_80C2760(u8 taskId) case 16: if(!gReceivedRemoteLinkPlayers) { - BeginNormalPaletteFade(-1, 0, 0, 16, gUnknown_02039CE8->var_52C); + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, gUnknown_02039CE8->var_52C); gUnknown_02039CE8->var_0 = 14; } break; @@ -249,7 +402,6 @@ void sub_80C2760(u8 taskId) gUnknown_02039CE8->var_0 = 10; PlaySE(SE_RG_CARD3); } - break; } } @@ -303,9 +455,1447 @@ bool8 sub_80C2AD8(void) break; default: gUnknown_02039CE8->var_2 = 0; - return 1; + return TRUE; } gUnknown_02039CE8->var_2++; + return FALSE; +} + +NAKED +void sub_80C2C80(void) //not really a nonmatching, skipped it because of DMA macros +{ + asm("\n\ + .syntax unified\n\ + push {lr}\n\ + sub sp, 0x8\n\ + ldr r1, =gMain\n\ + movs r2, 0x87\n\ + lsls r2, 3\n\ + adds r0, r1, r2\n\ + ldrb r0, [r0]\n\ + adds r3, r1, 0\n\ + cmp r0, 0xA\n\ + bls _080C2C96\n\ + b _080C2DD8\n\ +_080C2C96:\n\ + lsls r0, 2\n\ + ldr r1, =_080C2CA8\n\ + adds r0, r1\n\ + ldr r0, [r0]\n\ + mov pc, r0\n\ + .pool\n\ + .align 2, 0\n\ +_080C2CA8:\n\ + .4byte _080C2CD4\n\ + .4byte _080C2CEC\n\ + .4byte _080C2D14\n\ + .4byte _080C2D50\n\ + .4byte _080C2D6A\n\ + .4byte _080C2D74\n\ + .4byte _080C2D88\n\ + .4byte _080C2D8E\n\ + .4byte _080C2DA0\n\ + .4byte _080C2DA6\n\ + .4byte _080C2DB8\n\ +_080C2CD4:\n\ + bl sub_80C334C\n\ + bl sub_80C3414\n\ + ldr r1, =gMain\n\ + movs r0, 0x87\n\ + lsls r0, 3\n\ + adds r1, r0\n\ + b _080C2DCC\n\ + .pool\n\ +_080C2CEC:\n\ + movs r1, 0xE0\n\ + lsls r1, 19\n\ + movs r0, 0\n\ + str r0, [sp]\n\ + ldr r0, =0x040000d4\n\ + mov r2, sp\n\ + str r2, [r0]\n\ + str r1, [r0, 0x4]\n\ + ldr r1, =0x85000100\n\ + str r1, [r0, 0x8]\n\ + ldr r0, [r0, 0x8]\n\ + movs r0, 0x87\n\ + lsls r0, 3\n\ + adds r1, r3, r0\n\ + b _080C2DCC\n\ + .pool\n\ +_080C2D14:\n\ + ldr r0, =gUnknown_02039CE8\n\ + ldr r0, [r0]\n\ + ldr r1, =0x0000052c\n\ + adds r0, r1\n\ + ldrh r0, [r0]\n\ + cmp r0, 0\n\ + bne _080C2D36\n\ + movs r2, 0xA0\n\ + lsls r2, 19\n\ + add r1, sp, 0x4\n\ + strh r0, [r1]\n\ + ldr r0, =0x040000d4\n\ + str r1, [r0]\n\ + str r2, [r0, 0x4]\n\ + ldr r1, =0x81000200\n\ + str r1, [r0, 0x8]\n\ + ldr r0, [r0, 0x8]\n\ +_080C2D36:\n\ + movs r2, 0x87\n\ + lsls r2, 3\n\ + adds r1, r3, r2\n\ + b _080C2DCC\n\ + .pool\n\ +_080C2D50:\n\ + bl ResetSpriteData\n\ + bl FreeAllSpritePalettes\n\ + bl ResetPaletteFade\n\ + ldr r1, =gMain\n\ + movs r0, 0x87\n\ + lsls r0, 3\n\ + adds r1, r0\n\ + ldrb r0, [r1]\n\ + adds r0, 0x1\n\ + strb r0, [r1]\n\ +_080C2D6A:\n\ + bl sub_80C3388\n\ + b _080C2DC4\n\ + .pool\n\ +_080C2D74:\n\ + bl sub_80C41D8\n\ + ldr r1, =gMain\n\ + movs r0, 0x87\n\ + lsls r0, 3\n\ + adds r1, r0\n\ + b _080C2DCC\n\ + .pool\n\ +_080C2D88:\n\ + bl sub_80C2AD8\n\ + b _080C2DBC\n\ +_080C2D8E:\n\ + bl sub_80C4330\n\ + ldr r1, =gMain\n\ + movs r0, 0x87\n\ + lsls r0, 3\n\ + adds r1, r0\n\ + b _080C2DCC\n\ + .pool\n\ +_080C2DA0:\n\ + bl sub_80C3278\n\ + b _080C2DC4\n\ +_080C2DA6:\n\ + bl sub_80C3548\n\ + ldr r1, =gMain\n\ + movs r0, 0x87\n\ + lsls r0, 3\n\ + adds r1, r0\n\ + b _080C2DCC\n\ + .pool\n\ +_080C2DB8:\n\ + bl sub_80C43A8\n\ +_080C2DBC:\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + cmp r0, 0x1\n\ + bne _080C2DDC\n\ +_080C2DC4:\n\ + ldr r1, =gMain\n\ + movs r2, 0x87\n\ + lsls r2, 3\n\ + adds r1, r2\n\ +_080C2DCC:\n\ + ldrb r0, [r1]\n\ + adds r0, 0x1\n\ + strb r0, [r1]\n\ + b _080C2DDC\n\ + .pool\n\ +_080C2DD8:\n\ + bl sub_80C3404\n\ +_080C2DDC:\n\ + add sp, 0x8\n\ + pop {r0}\n\ + bx r0\n\ + .syntax divided"); +} + +u32 sav12_xor_get_clamped_above(u8 stat, u32 max) +{ + u32 retStat = GetGameStat(stat); + return (retStat > max) ? max : retStat; +} + +bool8 sub_80C2DFC(void) +{ + u8 i; + for(i = 0; i <= 6; i++) + { + if(!FlagGet(FLAG_SYS_TOWER_SILVER + 2 * i) || !FlagGet(FLAG_SYS_TOWER_GOLD + 2 * i)) + return FALSE; + } + return TRUE; +} + +u32 sub_80C2E40(void) +{ + u32 stat = GetGameStat(GAME_STAT_ENTERED_HOF); + u8 r4 = (stat | -stat) >> 31; + + if(sub_80C08E4()) + r4++; + if(sub_80F8940() > 4) + r4++; + if(sub_80C2DFC()) + r4++; + return r4; +} + +u8 TrainerCard_GetStarCount(struct TrainerCard *trainerCard) +{ + u8 value = 0; + + if (trainerCard->firstHallOfFameA || trainerCard->firstHallOfFameB || trainerCard->firstHallOfFameC) + value++; + if (trainerCard->var_3) + value++; + if (trainerCard->battleTowerLosses > 49) + value++; + if (trainerCard->var_4) + value++; + + return value; +} + +void sub_80C2EC4(struct TrainerCard *trainerCard, u8 arg1) +{ + u32 playTime; + bool32 enteredHallOfFame; + u8 i; + + trainerCard->gender = gSaveBlock2Ptr->playerGender; + trainerCard->playTimeHours = gSaveBlock2Ptr->playTimeHours; + trainerCard->playTimeMinutes = gSaveBlock2Ptr->playTimeMinutes; + + playTime = GetGameStat(GAME_STAT_FIRST_HOF_PLAY_TIME); + enteredHallOfFame = GetGameStat(GAME_STAT_ENTERED_HOF); + if (!enteredHallOfFame) + playTime = 0; + + trainerCard->firstHallOfFameA = playTime >> 16; + trainerCard->firstHallOfFameB = (playTime >> 8) & 0xFF; + trainerCard->firstHallOfFameC = playTime & 0xFF; + if((playTime >> 16) > 999) + { + trainerCard->firstHallOfFameA = 999; + trainerCard->firstHallOfFameB = 59; + trainerCard->firstHallOfFameC = 59; + } + + trainerCard->hasPokedex = FlagGet(FLAG_SYS_POKEDEX_GET); + trainerCard->var_3 = sub_80C08E4(); + trainerCard->pokedexCaught = sub_80C376C(); + + trainerCard->trainerId = (gSaveBlock2Ptr->playerTrainerId[1] << 8) | gSaveBlock2Ptr->playerTrainerId[0]; + + trainerCard->linkBattleWins = sav12_xor_get_clamped_above(GAME_STAT_LINK_BATTLE_WINS, 9999); + trainerCard->linkBattleLosses = sav12_xor_get_clamped_above(GAME_STAT_LINK_BATTLE_LOSSES, 9999); + + trainerCard->pokemonTrades = sav12_xor_get_clamped_above(GAME_STAT_POKEMON_TRADES, 0xFFFF); + + trainerCard->money = GetMoney(&gSaveBlock1Ptr->money); + + for (i = 0; i < 4; i++) + trainerCard->var_28[i] = gSaveBlock1Ptr->unk2BB0[i]; + + StringCopy(trainerCard->playerName, gSaveBlock2Ptr->playerName); + + switch(arg1) + { + case 2: + trainerCard->battleTowerWins = 0; + trainerCard->battleTowerLosses = 0; + case 0: + trainerCard->contestsWithFriends = sav12_xor_get_clamped_above(GAME_STAT_WON_LINK_CONTEST, 999); + trainerCard->pokeblocksWithFriends = sav12_xor_get_clamped_above(GAME_STAT_POKEBLOCKS_WITH_FRIENDS, 0xFFFF); + if(sub_80F8940() > 4) + trainerCard->var_4 = TRUE; + trainerCard->stars = TrainerCard_GetStarCount(trainerCard); + break; + case 1: + trainerCard->battleTowerWins = 0; + trainerCard->battleTowerLosses = 0; + trainerCard->contestsWithFriends = 0; + trainerCard->pokeblocksWithFriends = 0; + trainerCard->var_4 = 0; + trainerCard->stars = 0; + } +} + +#ifdef NONMATCHING //r0 and r1 swapped +void sub_80C3020(struct TrainerCard *trainerCard) +{ + memset(trainerCard, 0, sizeof(struct TrainerCard)); + trainerCard->var_38 = 3; + sub_80C2EC4(trainerCard, 2); + trainerCard->var_60 = sub_80C2DFC(); + trainerCard->var_62 = gSaveBlock2Ptr->frontier.field_EBA; + if(trainerCard->var_60) + trainerCard->stars++; + if(trainerCard->gender == FEMALE) + trainerCard->var_4F = gUnknown_08329D54[(trainerCard->trainerId & 7) + 8]; + else + trainerCard->var_4F = gUnknown_08329D54[trainerCard->trainerId & 7]; +} +#else +NAKED +void sub_80C3020(struct TrainerCard *trainerCard) +{ + asm("\n\ + .syntax unified\n\ + push {r4,lr}\n\ + adds r4, r0, 0\n\ + movs r1, 0\n\ + movs r2, 0x64\n\ + bl memset\n\ + adds r1, r4, 0\n\ + adds r1, 0x38\n\ + movs r0, 0x3\n\ + strb r0, [r1]\n\ + adds r0, r4, 0\n\ + movs r1, 0x2\n\ + bl sub_80C2EC4\n\ + bl sub_80C2DFC\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + adds r1, r4, 0\n\ + adds r1, 0x60\n\ + strh r0, [r1]\n\ + ldr r0, =gSaveBlock2Ptr\n\ + ldr r0, [r0]\n\ + ldr r2, =0x00000eba\n\ + adds r0, r2\n\ + ldrh r0, [r0]\n\ + adds r2, r4, 0\n\ + adds r2, 0x62\n\ + strh r0, [r2]\n\ + ldrh r0, [r1]\n\ + cmp r0, 0\n\ + beq _080C3066\n\ + ldrb r0, [r4, 0x1]\n\ + adds r0, 0x1\n\ + strb r0, [r4, 0x1]\n\ +_080C3066:\n\ + ldrb r0, [r4]\n\ + cmp r0, 0x1\n\ + bne _080C3084\n\ + ldr r2, =gUnknown_08329D54\n\ + ldrh r0, [r4, 0xE]\n\ + movs r1, 0x7\n\ + ands r0, r1\n\ + adds r0, 0x8\n\ + b _080C308C\n\ + .pool\n\ +_080C3084:\n\ + ldr r2, =gUnknown_08329D54\n\ + ldrh r0, [r4, 0xE]\n\ + movs r1, 0x7\n\ + ands r0, r1\n\ +_080C308C:\n\ + lsls r0, 1\n\ + adds r0, r2\n\ + ldrh r1, [r0]\n\ + adds r0, r4, 0\n\ + adds r0, 0x4F\n\ + strb r1, [r0]\n\ + pop {r4}\n\ + pop {r0}\n\ + bx r0\n\ + .pool\n\ + .syntax divided"); +} +#endif // NONMATCHING + +#ifdef NONMATCHING //r0 and r1 swapped +void TrainerCard_GenerateCardForPlayer(struct TrainerCard *trainerCard) +{ + u8 temp; + memset(trainerCard, 0, 0x60); + trainerCard->var_38 = 3; + sub_80C2EC4(trainerCard, 2); + temp = sub_80C2DFC(); + trainerCard->var_3A = temp; + *((u16*)&trainerCard->var_3C) = gSaveBlock2Ptr->frontier.field_EBA; + if(temp) + trainerCard->stars++; + if(trainerCard->gender == FEMALE) + trainerCard->var_4F = gUnknown_08329D54[(trainerCard->trainerId & 7) + 8]; + else + trainerCard->var_4F = gUnknown_08329D54[trainerCard->trainerId & 7]; +} +#else +NAKED +void TrainerCard_GenerateCardForPlayer(struct TrainerCard *trainerCard) +{ + asm("\n\ + .syntax unified\n\ + push {r4,lr}\n\ + adds r4, r0, 0\n\ + movs r1, 0\n\ + movs r2, 0x60\n\ + bl memset\n\ + adds r1, r4, 0\n\ + adds r1, 0x38\n\ + movs r0, 0x3\n\ + strb r0, [r1]\n\ + adds r0, r4, 0\n\ + movs r1, 0x2\n\ + bl sub_80C2EC4\n\ + bl sub_80C2DFC\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + strh r0, [r4, 0x3A]\n\ + ldr r1, =gSaveBlock2Ptr\n\ + ldr r1, [r1]\n\ + ldr r2, =0x00000eba\n\ + adds r1, r2\n\ + ldrh r1, [r1]\n\ + strh r1, [r4, 0x3C]\n\ + cmp r0, 0\n\ + beq _080C30E0\n\ + ldrb r0, [r4, 0x1]\n\ + adds r0, 0x1\n\ + strb r0, [r4, 0x1]\n\ +_080C30E0:\n\ + ldrb r0, [r4]\n\ + cmp r0, 0x1\n\ + bne _080C3100\n\ + ldr r2, =gUnknown_08329D54\n\ + ldrh r0, [r4, 0xE]\n\ + movs r1, 0x7\n\ + ands r0, r1\n\ + adds r0, 0x8\n\ + b _080C3108\n\ + .pool\n\ +_080C3100:\n\ + ldr r2, =gUnknown_08329D54\n\ + ldrh r0, [r4, 0xE]\n\ + movs r1, 0x7\n\ + ands r0, r1\n\ +_080C3108:\n\ + lsls r0, 1\n\ + adds r0, r2\n\ + ldrh r1, [r0]\n\ + adds r0, r4, 0\n\ + adds r0, 0x4F\n\ + strb r1, [r0]\n\ + pop {r4}\n\ + pop {r0}\n\ + bx r0\n\ + .pool\n\ + .syntax divided"); +} +#endif // NONMATCHING + +void sub_80C3120(struct TrainerCard *trainerCard, u16 *src, u8 gameVersion) +{ + memset(trainerCard, 0, sizeof(struct TrainerCard)); + trainerCard->var_38 = gameVersion; + switch(sub_80C4FCC(gameVersion)) + { + case 0: + memcpy(trainerCard, src, 0x60); + break; + case 1: + memcpy(trainerCard, src, 0x38); + break; + case 2: + memcpy(trainerCard, src, 0x60); + trainerCard->var_3C = 0; + trainerCard->var_60 = src[29]; + trainerCard->var_62 = src[30]; + } +} + +void sub_80C3190(void) +{ + u8 i; + u32 badgeFlag; + + gUnknown_02039CE8->var_A = 0; + gUnknown_02039CE8->var_B = 0; + gUnknown_02039CE8->var_C = 0; + gUnknown_02039CE8->var_D = 0; + gUnknown_02039CE8->var_E = 0; + gUnknown_02039CE8->var_F = 0; + gUnknown_02039CE8->var_10 = 0; + memset(gUnknown_02039CE8->badgeCount, 0, 8); + if(gUnknown_02039CE8->var_534.hasPokedex) + gUnknown_02039CE8->var_A++; + + if(gUnknown_02039CE8->var_534.firstHallOfFameA + ||gUnknown_02039CE8->var_534.firstHallOfFameB + ||gUnknown_02039CE8->var_534.firstHallOfFameC) + gUnknown_02039CE8->var_B++; + + if(gUnknown_02039CE8->var_534.linkBattleWins || gUnknown_02039CE8->var_534.linkBattleLosses) + gUnknown_02039CE8->var_C++; + if(gUnknown_02039CE8->var_534.pokemonTrades) + gUnknown_02039CE8->var_10++; + if(gUnknown_02039CE8->var_534.battleTowerWins || gUnknown_02039CE8->var_534.battleTowerLosses) + gUnknown_02039CE8->var_D++; + + i = 0; + badgeFlag = FLAG_BADGE01_GET; + while (1) + { + if(FlagGet(badgeFlag)) + gUnknown_02039CE8->badgeCount[i]++; + badgeFlag++; + i++; + if (badgeFlag > FLAG_BADGE08_GET) + break; + } +} + +void sub_80C3278(void) +{ + SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_WIN0_ON | DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP); + ShowBg(0); + ShowBg(1); + ShowBg(2); + ShowBg(3); + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG0 | BLDCNT_EFFECT_DARKEN); + SetGpuReg(REG_OFFSET_BLDY, 0); + SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN0_CLR); + SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_BG1 | WINOUT_WIN01_BG2 | WINOUT_WIN01_BG3 | WINOUT_WIN01_OBJ); + SetGpuReg(REG_OFFSET_WIN0V, 160); + SetGpuReg(REG_OFFSET_WIN0H, 240); + if(gReceivedRemoteLinkPlayers) + EnableInterrupts(INTR_FLAG_VBLANK | INTR_FLAG_HBLANK | INTR_FLAG_VCOUNT | INTR_FLAG_TIMER3 | INTR_FLAG_SERIAL); + else + EnableInterrupts(INTR_FLAG_VBLANK | INTR_FLAG_HBLANK); +} + +void sub_80C32EC(u16 arg0) +{ + u8 quotient = (arg0 + 40) / 10; + + if((s8)quotient <= 4) + quotient = 0; + gUnknown_02039CE8->var_528 = quotient; + SetGpuReg(REG_OFFSET_BLDY, gUnknown_02039CE8->var_528); + SetGpuReg(REG_OFFSET_WIN0V, (gUnknown_02039CE8->var_7CA8 * 256) | (160 - gUnknown_02039CE8->var_7CA8)); +} + +void sub_80C334C(void) +{ + SetVBlankCallback(NULL); + SetHBlankCallback(NULL); + SetGpuReg(REG_OFFSET_DISPCNT, 0); + SetGpuReg(REG_OFFSET_BG0CNT, 0); + SetGpuReg(REG_OFFSET_BG1CNT, 0); + SetGpuReg(REG_OFFSET_BG2CNT, 0); + SetGpuReg(REG_OFFSET_BG3CNT, 0); +} + +void sub_80C3388(void) +{ + ResetBgsAndClearDma3BusyFlags(0); + InitBgsFromTemplates(0, gUnknown_0856FAB4, ARRAY_COUNT(gUnknown_0856FAB4)); + ChangeBgX(0, 0, 0); + ChangeBgY(0, 0, 0); + ChangeBgX(1, 0, 0); + ChangeBgY(1, 0, 0); + ChangeBgX(2, 0, 0); + ChangeBgY(2, 0, 0); + ChangeBgX(3, 0, 0); + ChangeBgY(3, 0, 0); + InitWindows(gUnknown_0856FAC4); + DeactivateAllTextPrinters(); + sub_81973A4(); +} + +void sub_80C3404(void) +{ + SetMainCallback2(sub_80C2710); +} + +void sub_80C3414(void) +{ + ResetTasks(); + ScanlineEffect_Stop(); + CreateTask(sub_80C2760, 0); + sub_80C4EE4(); + sub_80C3190(); +} + +bool8 sub_80C3438(void) +{ + switch(gUnknown_02039CE8->var_1) + { + case 0: + sub_80C3574(); + break; + case 1: + sub_80C3608(); + break; + case 2: + sub_80C3684(); + break; + case 3: + sub_80C378C(); + break; + case 4: + sub_80C3880(); + break; + case 5: + sub_80C3A18(); + break; + default: + gUnknown_02039CE8->var_1 = 0; + return TRUE; + } + gUnknown_02039CE8->var_1++; + return FALSE; +} + +bool8 sub_80C34B0(void) +{ + switch(gUnknown_02039CE8->var_1) + { + case 0: + sub_80C3B50(); + break; + case 1: + sub_80C3CCC(); + break; + case 2: + sub_80C3D60(); + break; + case 3: + sub_80C3DF0(); + break; + case 4: + sub_80C3E58(); + sub_80C3F64(); + break; + case 5: + sub_80C3ED4(); + sub_80C3FE0(); + break; + case 6: + sub_80C4140(); + sub_80C40CC(); + break; + case 7: + sub_80C42A4(); + break; + default: + gUnknown_02039CE8->var_1 = 0; + return TRUE; + } + gUnknown_02039CE8->var_1++; + return FALSE; +} + +void sub_80C3548(void) +{ + sub_80C3AF0(); + sub_80C3BC4(); + sub_80C3CF4(); + sub_80C3DC0(); + sub_80C3E20(); + sub_80C3E98(); + sub_80C3F14(); + sub_80C3FA4(); + sub_80C4020(); +} + +void sub_80C3574(void) +{ + u8 buffer[32]; + u8* txtPtr; + txtPtr = StringCopy(buffer, gText_TrainerCardName); + StringCopy(txtPtr, gUnknown_02039CE8->var_534.playerName); + ConvertInternationalString(txtPtr, gUnknown_02039CE8->var_7CAA); + if(!gUnknown_02039CE8->var_52A) + AddTextPrinterParameterized3(1, 1, 20, 28, gUnknown_0856FB0C, -1, buffer); + else + AddTextPrinterParameterized3(1, 1, 16, 33, gUnknown_0856FB0C, -1, buffer); +} + +void sub_80C3608(void) +{ + u8 buffer[32]; + u8* txtPtr; + s32 xPos; + u32 top; + txtPtr = StringCopy(buffer, gText_TrainerCardIDNo); + ConvertIntToDecimalStringN(txtPtr, gUnknown_02039CE8->var_534.trainerId, STR_CONV_MODE_LEADING_ZEROS, 5); + if(!gUnknown_02039CE8->var_52A) + { + xPos = GetStringCenterAlignXOffset(1, buffer, 80) + 132; + top = 9; + } + else + { + xPos = GetStringCenterAlignXOffset(1, buffer, 96) + 120; + top = 9; + } + + AddTextPrinterParameterized3(1, 1, xPos, top, gUnknown_0856FB0C, -1, buffer); +} + +void sub_80C3684(void) +{ + s32 xOffset; + u8 top; + if(!gUnknown_02039CE8->var_52B) + AddTextPrinterParameterized3(1, 1, 20, 56, gUnknown_0856FB0C, -1, gText_TrainerCardMoney); + else + AddTextPrinterParameterized3(1, 1, 16, 57, gUnknown_0856FB0C, -1, gText_TrainerCardMoney); + ConvertIntToDecimalStringN(gStringVar1, gUnknown_02039CE8->var_534.money, 0, 6); + StringExpandPlaceholders(gStringVar4, gText_PokedollarVar1); + if(!gUnknown_02039CE8->var_52B) + { + xOffset = GetStringRightAlignXOffset(1, gStringVar4, 144); + top = 56; + } + else + { + xOffset = GetStringRightAlignXOffset(1, gStringVar4, 128); + top = 57; + } + AddTextPrinterParameterized3(1, 1, xOffset, top, gUnknown_0856FB0C, -1, gStringVar4); +} + +u16 sub_80C376C(void) +{ + if(IsNationalPokedexEnabled()) + return GetNationalPokedexCount(FLAG_GET_CAUGHT); + + return GetHoennPokedexCount(FLAG_GET_CAUGHT); +} + +void sub_80C378C(void) +{ + s32 xOffset; + u8 top; + if(FlagGet(FLAG_SYS_POKEDEX_GET)) + { + if(!gUnknown_02039CE8->var_52B) + AddTextPrinterParameterized3(1, 1, 20, 72, gUnknown_0856FB0C, -1, gText_TrainerCardPokedex); + else + AddTextPrinterParameterized3(1, 1, 16, 73, gUnknown_0856FB0C, -1,gText_TrainerCardPokedex); + StringCopy(ConvertIntToDecimalStringN(gStringVar4, gUnknown_02039CE8->var_534.pokedexCaught, 0, 3), gText_EmptyString6); + if(!gUnknown_02039CE8->var_52B) + { + xOffset = GetStringRightAlignXOffset(1, gStringVar4, 144); + top = 72; + } + else + { + xOffset = GetStringRightAlignXOffset(1, gStringVar4, 128); + top = 73; + } + AddTextPrinterParameterized3(1, 1, xOffset, top, gUnknown_0856FB0C, -1, gStringVar4); + } +} + +void sub_80C3880(void) +{ + u16 hours; + u16 minutes; + s32 width; + u32 r7, r4, r10; + if(!gUnknown_02039CE8->var_52B) + AddTextPrinterParameterized3(1, 1, 20, 88, gUnknown_0856FB0C, -1, gText_TrainerCardTime); + else + AddTextPrinterParameterized3(1, 1, 16, 89, gUnknown_0856FB0C, -1, gText_TrainerCardTime); + if(gUnknown_02039CE8->var_5) + { + hours = gUnknown_02039CE8->var_534.playTimeHours; + minutes = gUnknown_02039CE8->var_534.playTimeMinutes; + } + else + { + hours = gSaveBlock2Ptr->playTimeHours; + minutes = gSaveBlock2Ptr->playTimeMinutes; + } + if(hours > 999) + hours = 999; + if(minutes > 59) + minutes = 59; + width = GetStringWidth(1, gText_Colon2, 0); + + if(!gUnknown_02039CE8->var_52B) + { + r7 = 144; + r4 = 88; + } + else + { + r7 = 128; + r4 = 89; + } + r10 = width + 30; + r7 -= r10; + + FillWindowPixelRect(1, 0, r7, r4, r10, 15); + ConvertIntToDecimalStringN(gStringVar4, hours, 1, 3); + AddTextPrinterParameterized3(1, 1, r7, r4, gUnknown_0856FB0C, -1, gStringVar4); + r7 += 18; + AddTextPrinterParameterized3(1, 1, r7, r4, gUnknown_0856FB40[gUnknown_02039CE8->var_7], -1, gText_Colon2); + r7 += width; + ConvertIntToDecimalStringN(gStringVar4, minutes, 2, 2); + AddTextPrinterParameterized3(1, 1, r7, r4, gUnknown_0856FB0C, -1, gStringVar4); +} + +void sub_80C3A18(void) +{ + if(gUnknown_02039CE8->var_5) + { + AddTextPrinterParameterized3(1, 1, 8, gUnknown_0856FB48[gUnknown_02039CE8->var_52B], gUnknown_0856FB0C, -1, gUnknown_02039CE8->var_19); + AddTextPrinterParameterized3(1, 1, GetStringWidth(1, gUnknown_02039CE8->var_19, 0) + 14, gUnknown_0856FB48[gUnknown_02039CE8->var_52B], gUnknown_0856FB0C, -1, gUnknown_02039CE8->var_26); + AddTextPrinterParameterized3(1, 1, 8, gUnknown_0856FB4A[gUnknown_02039CE8->var_52B], gUnknown_0856FB0C, -1, gUnknown_02039CE8->var_33); + AddTextPrinterParameterized3(1, 1, GetStringWidth(1, gUnknown_02039CE8->var_33, 0) + 14, gUnknown_0856FB4A[gUnknown_02039CE8->var_52B], gUnknown_0856FB0C, -1, gUnknown_02039CE8->var_40); + } +} + +void sub_80C3AF0(void) +{ + StringCopy(gUnknown_02039CE8->var_4D, gUnknown_02039CE8->var_534.playerName); + ConvertInternationalString(gUnknown_02039CE8->var_4D, gUnknown_02039CE8->var_7CAA); + if(gUnknown_02039CE8->var_52A) + { + StringCopy(gStringVar1, gUnknown_02039CE8->var_4D); + StringExpandPlaceholders(gUnknown_02039CE8->var_4D, gText_Var1sTrainerCard); + } +} + +void sub_80C3B50(void) +{ + if(!gUnknown_02039CE8->var_52B) + AddTextPrinterParameterized3(1, 1, 136, 9, gUnknown_0856FB0C, -1, gUnknown_02039CE8->var_4D); + else + AddTextPrinterParameterized3(1, 1, GetStringRightAlignXOffset(1, gUnknown_02039CE8->var_4D, 216), 9, gUnknown_0856FB0C, -1, gUnknown_02039CE8->var_4D); +} + +void sub_80C3BC4(void) +{ + if(gUnknown_02039CE8->var_B) + { + ConvertIntToDecimalStringN(gStringVar1, gUnknown_02039CE8->var_534.firstHallOfFameA, 1, 3); + ConvertIntToDecimalStringN(gStringVar2, gUnknown_02039CE8->var_534.firstHallOfFameB, 2, 2); + ConvertIntToDecimalStringN(gStringVar3, gUnknown_02039CE8->var_534.firstHallOfFameC, 2, 2); + StringExpandPlaceholders(gUnknown_02039CE8->var_93, gUnknown_0856FB4C); + } +} + +void sub_80C3C34(u8 top, const u8* str1, u8* str2, const u8* color) +{ + AddTextPrinterParameterized3(1, 1, gUnknown_0856FB55[gUnknown_02039CE8->var_52B], top * 16 + 33, gUnknown_0856FB0C, -1, str1); + AddTextPrinterParameterized3(1, 1, GetStringRightAlignXOffset(1, str2, gUnknown_0856FB57[gUnknown_02039CE8->var_52B]), top * 16 + 33, color, -1, str2); +} + +void sub_80C3CCC(void) +{ + if(gUnknown_02039CE8->var_B) + sub_80C3C34(0, gText_HallOfFameDebut, gUnknown_02039CE8->var_93, gUnknown_0856FB0F); +} + +void sub_80C3CF4(void) +{ + if(gUnknown_02039CE8->var_C) + { + StringCopy(gUnknown_02039CE8->var_D9, gUnknown_0856FB5C[gUnknown_02039CE8->var_52A]); + ConvertIntToDecimalStringN(gUnknown_02039CE8->var_165, gUnknown_02039CE8->var_534.linkBattleWins, 0, 4); + ConvertIntToDecimalStringN(gUnknown_02039CE8->var_1AB, gUnknown_02039CE8->var_534.linkBattleLosses, 0, 4); + } +} + +void sub_80C3D60(void) +{ + if(gUnknown_02039CE8->var_C) + { + StringCopy(gStringVar1, gUnknown_02039CE8->var_165); + StringCopy(gStringVar2, gUnknown_02039CE8->var_1AB); + StringExpandPlaceholders(gStringVar4, gText_WinsLosses); + sub_80C3C34(1, gUnknown_02039CE8->var_D9, gStringVar4, gUnknown_0856FB0C); + } +} + +void sub_80C3DC0(void) +{ + if(gUnknown_02039CE8->var_10) + ConvertIntToDecimalStringN(gUnknown_02039CE8->var_237, gUnknown_02039CE8->var_534.pokemonTrades, 1, 5); +} + +void sub_80C3DF0(void) +{ + if(gUnknown_02039CE8->var_10) + sub_80C3C34(2, gText_PokemonTrades, gUnknown_02039CE8->var_237, gUnknown_0856FB0F); +} + +void sub_80C3E20(void) +{ + if(!gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.var_3C) + ConvertIntToDecimalStringN(gUnknown_02039CE8->var_2C3, gUnknown_02039CE8->var_534.var_3C, 1, 5); +} + +void sub_80C3E58(void) +{ + if(!gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.var_3C) + sub_80C3C34(4, gText_BerryCrush, gUnknown_02039CE8->var_2C3, gUnknown_0856FB0F); +} + +void sub_80C3E98(void) +{ + if(!gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.var_40) + ConvertIntToDecimalStringN(gUnknown_02039CE8->var_34F, gUnknown_02039CE8->var_534.var_40, 1, 5); +} + +void sub_80C3ED4(void) +{ + if(!gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.var_40) + sub_80C3C34(3, gText_UnionTradesAndBattles, gUnknown_02039CE8->var_34F, gUnknown_0856FB0F); +} + +void sub_80C3F14(void) +{ + if(gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.pokeblocksWithFriends) + { + ConvertIntToDecimalStringN(gStringVar1, gUnknown_02039CE8->var_534.pokeblocksWithFriends, 1, 5); + StringExpandPlaceholders(gUnknown_02039CE8->var_395, gText_Var1DarkGreyShadowLightGrey); + } +} + +void sub_80C3F64(void) +{ + if(gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.pokeblocksWithFriends) + sub_80C3C34(3, gText_PokeblocksWithFriends, gUnknown_02039CE8->var_395, gUnknown_0856FB0F); +} + +void sub_80C3FA4(void) +{ + if(gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.contestsWithFriends) + ConvertIntToDecimalStringN(gUnknown_02039CE8->var_3DB, gUnknown_02039CE8->var_534.contestsWithFriends, 1, 5); +} + +void sub_80C3FE0(void) +{ + if(gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.contestsWithFriends) + sub_80C3C34(4, gText_WonContestsWFriends, gUnknown_02039CE8->var_3DB, gUnknown_0856FB0F); +} + +void sub_80C4020(void) +{ + switch(gUnknown_02039CE8->var_52A) + { + case 1: + if(gUnknown_02039CE8->var_D) + { + ConvertIntToDecimalStringN(gStringVar1, gUnknown_02039CE8->var_534.battleTowerWins, 1, 4); + ConvertIntToDecimalStringN(gStringVar2, gUnknown_02039CE8->var_534.battleTowerLosses, 1, 4); + StringExpandPlaceholders(gUnknown_02039CE8->var_421, gText_WSlashStraightSlash); + } + break; + + case 2: + if(gUnknown_02039CE8->var_534.var_62) + { + ConvertIntToDecimalStringN(gStringVar1, gUnknown_02039CE8->var_534.var_62, 1, 5); + StringExpandPlaceholders(gUnknown_02039CE8->var_421, gText_Var1DarkLightGreyBP); + } + case 0: + } +} + +void sub_80C40CC(void) +{ + switch(gUnknown_02039CE8->var_52A) + { + case 1: + if(gUnknown_02039CE8->var_D) + sub_80C3C34(5, gText_BattleTower, gUnknown_02039CE8->var_421, gUnknown_0856FB0C); + break; + case 2: + if(gUnknown_02039CE8->var_534.var_62) + sub_80C3C34(5, gText_BattlePtsWon, gUnknown_02039CE8->var_421, gUnknown_0856FB0F); + case 0: + } +} + +void sub_80C4140(void) +{ + u8 i; + u8 buffer[8]; + u8 buffer2[8]; + memcpy(buffer, gUnknown_0856FB68, sizeof(gUnknown_0856FB68)); + memcpy(buffer2, gUnknown_0856FB6E, sizeof(gUnknown_0856FB6E)); + + if(!gUnknown_02039CE8->var_52A) + { + for(i = 0; i < 6; i++) + { + if(gUnknown_02039CE8->var_534.monSpecies[i]) + { + u8 monSpecies = sub_80D30A0(gUnknown_02039CE8->var_534.monSpecies[i]); + WriteSequenceToBgTilemapBuffer(3, 16 * i + 224, buffer2[i] + 3, 15, 4, 4, buffer[monSpecies], 1); + } + } + } +} + +void sub_80C41D8(void) +{ + u8 i; + CpuSet(gMonIconPalettes, gUnknown_02039CE8->var_468, 0x60); + switch(gUnknown_02039CE8->var_534.var_4E) + { + case 1: + TintPalette_CustomTone(gUnknown_02039CE8->var_468, 96, 0, 0, 0); + break; + case 2: + TintPalette_CustomTone(gUnknown_02039CE8->var_468, 96, 500, 330, 310); + break; + case 3: + TintPalette_SepiaTone(gUnknown_02039CE8->var_468, 96); + case 0: + } + LoadPalette(gUnknown_02039CE8->var_468, 80, 192); + + for(i = 0; i < 6; i++) + { + if(gUnknown_02039CE8->var_534.monSpecies[i]) + LoadBgTiles(3, GetMonIconTiles(gUnknown_02039CE8->var_534.monSpecies[i], 0), 512, 16 * i + 32); + } +} + +void sub_80C42A4(void) +{ + u8 i; + u8 buffer[4]; + memcpy(buffer, gUnknown_0856FB74, sizeof(gUnknown_0856FB74)); + if(!gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.var_4C == 1) + { + for(i = 0; i < 3; i++) + { + u8 var_50 = gUnknown_02039CE8->var_534.var_50[i]; + if(gUnknown_02039CE8->var_534.var_50[i]) + WriteSequenceToBgTilemapBuffer(3, i * 4 + 320, i * 3 + 2, 2, 2, 2, buffer[var_50 - 1], 1); + } + } +} + +void sub_80C4330(void) +{ + LoadPalette(gUnknown_0856F54C, 176, 32); + LoadPalette(gUnknown_0856F56C, 192, 32); + LoadPalette(gUnknown_0856F58C, 208, 32); + LoadPalette(gUnknown_0856F5AC, 224, 32); + LoadBgTiles(3, gUnknown_02039CE8->var_17A8, 1024, 128); +} + +void sub_80C438C(u8 windowId) +{ + PutWindowTilemap(windowId); + CopyWindowToVram(windowId, 3); +} + +u8 sub_80C43A8(void) +{ + switch(gUnknown_02039CE8->var_3) + { + case 0: + LoadBgTiles(3, gUnknown_02039CE8->var_13A8, 1024, 0); + break; + case 1: + LoadBgTiles(0, gUnknown_02039CE8->var_19A8, 6144, 0); + break; + case 2: + if(gUnknown_02039CE8->var_52A) + { + LoadPalette(gEmeraldTrainerCardStarPals[gUnknown_02039CE8->var_534.stars], 0, 96); + LoadPalette(gUnknown_0856F4EC, 48, 32); + if(gUnknown_02039CE8->var_534.gender) + LoadPalette(gUnknown_0856F4AC, 16, 32); + } + else + { + LoadPalette(gFireRedTrainerCardStarPals[gUnknown_02039CE8->var_534.stars], 0, 96); + LoadPalette(gUnknown_0856F50C, 48, 32); + if(gUnknown_02039CE8->var_534.gender) + LoadPalette(gUnknown_0856F4CC, 16, 32); + } + LoadPalette(gUnknown_0856F52C, 64, 32); + break; + case 3: + SetBgTilemapBuffer(0, gUnknown_02039CE8->var_3CA8); + SetBgTilemapBuffer(2, gUnknown_02039CE8->var_5CA8); + break; + case 4: + FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 32, 32); + FillBgTilemapBufferRect_Palette0(2, 0, 0, 0, 32, 32); + FillBgTilemapBufferRect_Palette0(3, 0, 0, 0, 32, 32); + default: + return 1; + } + gUnknown_02039CE8->var_3++; return 0; } +NAKED +void sub_80C4550(u8* ptr) //nested loop +{ + asm("\n\ + .syntax unified\n\ + push {r4-r7,lr}\n\ + adds r7, r0, 0\n\ + ldr r0, =gUnknown_02039CE8\n\ + ldr r0, [r0]\n\ + ldr r1, =0x00005ca8\n\ + adds r6, r0, r1\n\ + movs r1, 0\n\ +_080C455E:\n\ + movs r2, 0\n\ + lsls r5, r1, 16\n\ + asrs r1, r5, 16\n\ + lsls r3, r1, 5\n\ + lsls r0, r1, 4\n\ + subs r0, r1\n\ + lsls r4, r0, 1\n\ +_080C456C:\n\ + lsls r0, r2, 16\n\ + asrs r1, r0, 16\n\ + adds r2, r0, 0\n\ + cmp r1, 0x1D\n\ + bgt _080C4590\n\ + adds r0, r3, r1\n\ + lsls r0, 1\n\ + adds r0, r6\n\ + adds r1, r4, r1\n\ + lsls r1, 1\n\ + adds r1, r7\n\ + ldrh r1, [r1]\n\ + b _080C4598\n\ + .pool\n\ +_080C4590:\n\ + adds r0, r3, r1\n\ + lsls r0, 1\n\ + adds r0, r6\n\ + ldrh r1, [r7]\n\ +_080C4598:\n\ + strh r1, [r0]\n\ + movs r1, 0x80\n\ + lsls r1, 9\n\ + adds r0, r2, r1\n\ + lsrs r2, r0, 16\n\ + asrs r0, 16\n\ + cmp r0, 0x1F\n\ + ble _080C456C\n\ + adds r0, r5, r1\n\ + lsrs r1, r0, 16\n\ + asrs r0, 16\n\ + cmp r0, 0x13\n\ + ble _080C455E\n\ + movs r0, 0x2\n\ + bl CopyBgTilemapBufferToVram\n\ + pop {r4-r7}\n\ + pop {r0}\n\ + bx r0\n\ + .syntax divided"); +} + +NAKED +void sub_80C45C0(u8* ptr) //nested loop +{ + asm("\n\ + .syntax unified\n\ + push {r4-r7,lr}\n\ + adds r7, r0, 0\n\ + ldr r0, =gUnknown_02039CE8\n\ + ldr r0, [r0]\n\ + ldr r1, =0x00003ca8\n\ + adds r6, r0, r1\n\ + movs r1, 0\n\ +_080C45CE:\n\ + movs r2, 0\n\ + lsls r5, r1, 16\n\ + asrs r1, r5, 16\n\ + lsls r3, r1, 5\n\ + lsls r0, r1, 4\n\ + subs r0, r1\n\ + lsls r4, r0, 1\n\ +_080C45DC:\n\ + lsls r0, r2, 16\n\ + asrs r1, r0, 16\n\ + adds r2, r0, 0\n\ + cmp r1, 0x1D\n\ + bgt _080C4600\n\ + adds r0, r3, r1\n\ + lsls r0, 1\n\ + adds r0, r6\n\ + adds r1, r4, r1\n\ + lsls r1, 1\n\ + adds r1, r7\n\ + ldrh r1, [r1]\n\ + b _080C4608\n\ + .pool\n\ +_080C4600:\n\ + adds r0, r3, r1\n\ + lsls r0, 1\n\ + adds r0, r6\n\ + ldrh r1, [r7]\n\ +_080C4608:\n\ + strh r1, [r0]\n\ + movs r1, 0x80\n\ + lsls r1, 9\n\ + adds r0, r2, r1\n\ + lsrs r2, r0, 16\n\ + asrs r0, 16\n\ + cmp r0, 0x1F\n\ + ble _080C45DC\n\ + adds r0, r5, r1\n\ + lsrs r1, r0, 16\n\ + asrs r0, 16\n\ + cmp r0, 0x13\n\ + ble _080C45CE\n\ + movs r0, 0\n\ + bl CopyBgTilemapBufferToVram\n\ + pop {r4-r7}\n\ + pop {r0}\n\ + bx r0\n\ + .syntax divided"); +} + +NAKED +void sub_80C4630(void) +{ + asm("\n\ + .syntax unified\n\ + push {r4-r7,lr}\n\ + mov r7, r10\n\ + mov r6, r9\n\ + mov r5, r8\n\ + push {r5-r7}\n\ + sub sp, 0xC\n\ + movs r0, 0xC0\n\ + mov r8, r0\n\ + movs r2, 0x3\n\ + mov r10, r2\n\ + ldr r2, =gUnknown_0856FB78\n\ + ldr r4, =gUnknown_02039CE8\n\ + ldr r1, [r4]\n\ + ldr r3, =0x0000052b\n\ + adds r0, r1, r3\n\ + ldrb r0, [r0]\n\ + adds r0, r2\n\ + ldrb r3, [r0]\n\ + ldr r0, =0x00000535\n\ + adds r1, r0\n\ + ldrb r0, [r1]\n\ + str r0, [sp]\n\ + movs r0, 0x1\n\ + str r0, [sp, 0x4]\n\ + movs r0, 0x4\n\ + str r0, [sp, 0x8]\n\ + movs r0, 0x3\n\ + movs r1, 0x8F\n\ + movs r2, 0xF\n\ + bl FillBgTilemapBufferRect\n\ + ldr r0, [r4]\n\ + ldrb r0, [r0, 0x5]\n\ + cmp r0, 0\n\ + bne _080C4724\n\ + movs r2, 0x4\n\ + mov r9, r2\n\ + movs r2, 0\n\ + movs r6, 0x1\n\ +_080C467E:\n\ + ldr r0, =gUnknown_02039CE8\n\ + ldr r1, [r0]\n\ + lsls r0, r2, 16\n\ + asrs r7, r0, 16\n\ + adds r1, 0x11\n\ + adds r1, r7\n\ + ldrb r0, [r1]\n\ + cmp r0, 0\n\ + beq _080C4700\n\ + mov r3, r9\n\ + lsls r5, r3, 24\n\ + lsrs r5, 24\n\ + str r6, [sp]\n\ + str r6, [sp, 0x4]\n\ + mov r0, r10\n\ + str r0, [sp, 0x8]\n\ + movs r0, 0x3\n\ + mov r1, r8\n\ + adds r2, r5, 0\n\ + movs r3, 0xF\n\ + bl FillBgTilemapBufferRect\n\ + mov r1, r8\n\ + adds r1, 0x1\n\ + lsls r1, 16\n\ + lsrs r1, 16\n\ + mov r4, r9\n\ + adds r4, 0x1\n\ + lsls r4, 24\n\ + lsrs r4, 24\n\ + str r6, [sp]\n\ + str r6, [sp, 0x4]\n\ + mov r2, r10\n\ + str r2, [sp, 0x8]\n\ + movs r0, 0x3\n\ + adds r2, r4, 0\n\ + movs r3, 0xF\n\ + bl FillBgTilemapBufferRect\n\ + mov r1, r8\n\ + adds r1, 0x10\n\ + lsls r1, 16\n\ + lsrs r1, 16\n\ + str r6, [sp]\n\ + str r6, [sp, 0x4]\n\ + mov r3, r10\n\ + str r3, [sp, 0x8]\n\ + movs r0, 0x3\n\ + adds r2, r5, 0\n\ + movs r3, 0x10\n\ + bl FillBgTilemapBufferRect\n\ + mov r1, r8\n\ + adds r1, 0x11\n\ + lsls r1, 16\n\ + lsrs r1, 16\n\ + str r6, [sp]\n\ + str r6, [sp, 0x4]\n\ + mov r0, r10\n\ + str r0, [sp, 0x8]\n\ + movs r0, 0x3\n\ + adds r2, r4, 0\n\ + movs r3, 0x10\n\ + bl FillBgTilemapBufferRect\n\ +_080C4700:\n\ + adds r0, r7, 0x1\n\ + lsls r0, 16\n\ + mov r1, r8\n\ + adds r1, 0x2\n\ + lsls r1, 16\n\ + lsrs r1, 16\n\ + mov r8, r1\n\ + mov r2, r9\n\ + lsls r1, r2, 16\n\ + movs r3, 0xC0\n\ + lsls r3, 10\n\ + adds r1, r3\n\ + lsrs r1, 16\n\ + mov r9, r1\n\ + lsrs r2, r0, 16\n\ + asrs r0, 16\n\ + cmp r0, 0x7\n\ + ble _080C467E\n\ +_080C4724:\n\ + movs r0, 0x3\n\ + bl CopyBgTilemapBufferToVram\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"); +} + +void sub_80C474C(void) +{ + if(!gUnknown_02039CE8->var_52A) + { + if(gUnknown_02039CE8->var_10) + { + FillBgTilemapBufferRect(3, 141, 27, 9, 1, 1, 1); + FillBgTilemapBufferRect(3, 157, 27, 10, 1, 1, 1); + } + if(gUnknown_02039CE8->var_534.var_3C) + { + FillBgTilemapBufferRect(3, 141, 21, 13, 1, 1, 1); + FillBgTilemapBufferRect(3, 157, 21, 14, 1, 1, 1); + } + if(gUnknown_02039CE8->var_534.var_40) + { + FillBgTilemapBufferRect(3, 141, 27, 11, 1, 1, 1); + FillBgTilemapBufferRect(3, 157, 27, 12, 1, 1, 1); + } + } + else + { + if(gUnknown_02039CE8->var_10) + { + FillBgTilemapBufferRect(3, 141, 27, 9, 1, 1, 0); + FillBgTilemapBufferRect(3, 157, 27, 10, 1, 1, 0); + } + if(gUnknown_02039CE8->var_534.contestsWithFriends) + { + FillBgTilemapBufferRect(3, 141, 27, 13, 1, 1, 0); + FillBgTilemapBufferRect(3, 157, 27, 14, 1, 1, 0); + } + if(gUnknown_02039CE8->var_D) + { + FillBgTilemapBufferRect(3, 141, 17, 15, 1, 1, 0); + FillBgTilemapBufferRect(3, 157, 17, 16, 1, 1, 0); + FillBgTilemapBufferRect(3, 140, 27, 15, 1, 1, 0); + FillBgTilemapBufferRect(3, 156, 27, 16, 1, 1, 0); + } + } + CopyBgTilemapBufferToVram(3); +} + +void sub_80C48C8(void) +{ + if(++gUnknown_02039CE8->var_6 > 60) + { + gUnknown_02039CE8->var_6 = 0; + gUnknown_02039CE8->var_7 ^= 1; + gUnknown_02039CE8->var_529 = 1; + } +} + +u8 sub_80C4904(u8 cardId) +{ + struct TrainerCard* trainerCards = gTrainerCards; + return trainerCards[cardId].stars; +} + +void sub_80C4918(void) +{ + u8 taskId = CreateTask(sub_80C4960, 0); + sub_80C4960(taskId); + SetHBlankCallback(sub_80C26D4); +} + +bool8 sub_80C4940(void) +{ + if(FindTaskIdByFunc(sub_80C4960) == 0xFF) + return TRUE; + return FALSE; +} + +void sub_80C4960(u8 taskId) +{ + while(gUnknown_0856FB28[gTasks[taskId].data[0]](&gTasks[taskId])) + ; +} + +bool8 sub_80C4998(struct Task* task) +{ + u32 i; + HideBg(1); + HideBg(3); + ScanlineEffect_Stop(); + ScanlineEffect_Clear(); + for(i = 0; i < 160; i++) + gScanlineEffectRegBuffers[1][i] = 0; + task->data[0]++; + return FALSE; +} From 576d1b3474e9ebec6a16d3ca68378d0f92fb4026 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sat, 19 Jan 2019 23:04:33 +0100 Subject: [PATCH 04/16] Document and match somne trainer card --- asm/trainer_card.s | 4 +- data/maps/LilycoveCity/scripts.inc | 2 +- .../LilycoveCity_ContestLobby/scripts.inc | 2 +- .../LilycoveCity_CoveLilyMotel_2F/scripts.inc | 2 +- .../scripts.inc | 2 +- .../scripts.inc | 2 +- data/specials.inc | 4 +- include/pokedex.h | 1 + include/script_pokemon_util_80F87D8.h | 1 + include/trainer_card.h | 17 +- src/pokedex.c | 106 +- src/script_pokemon_util_80F87D8.c | 8 +- src/start_menu.c | 9 +- src/trainer_card.c | 1285 ++++++----------- 14 files changed, 519 insertions(+), 926 deletions(-) diff --git a/asm/trainer_card.s b/asm/trainer_card.s index e78b2fec2..b1fd740ec 100644 --- a/asm/trainer_card.s +++ b/asm/trainer_card.s @@ -209,13 +209,13 @@ _080C4B6C: ldrb r0, [r0, 0x8] cmp r0, 0 bne _080C4B80 - bl sub_80C34B0 + bl PrintStringsOnCardPage2 lsls r0, 24 cmp r0, 0 bne _080C4BF6 b _080C4C08 _080C4B80: - bl sub_80C3438 + bl PrintAllOnCardPage1 lsls r0, 24 cmp r0, 0 bne _080C4BF6 diff --git a/data/maps/LilycoveCity/scripts.inc b/data/maps/LilycoveCity/scripts.inc index 02319e8cf..c1cec509f 100644 --- a/data/maps/LilycoveCity/scripts.inc +++ b/data/maps/LilycoveCity/scripts.inc @@ -157,7 +157,7 @@ LilycoveCity_EventScript_1E2D11:: @ 81E2D11 LilycoveCity_EventScript_1E2D1A:: @ 81E2D1A lockall - specialvar VAR_0x8004, sub_80F8940 + specialvar VAR_0x8004, CountPlayerContestPaintings switch VAR_0x8004 case 0, LilycoveCity_EventScript_1E2D3A msgbox LilycoveCity_Text_1E4571, MSGBOX_DEFAULT diff --git a/data/maps/LilycoveCity_ContestLobby/scripts.inc b/data/maps/LilycoveCity_ContestLobby/scripts.inc index 74bee15d3..42ce7beeb 100644 --- a/data/maps/LilycoveCity_ContestLobby/scripts.inc +++ b/data/maps/LilycoveCity_ContestLobby/scripts.inc @@ -100,7 +100,7 @@ LilycoveCity_ContestLobby_EventScript_21A314:: @ 821A314 return LilycoveCity_ContestLobby_EventScript_21A360:: @ 821A360 - specialvar VAR_0x8004, sub_80F8940 + specialvar VAR_0x8004, CountPlayerContestPaintings switch VAR_0x8004 case 1, LilycoveCity_ContestLobby_EventScript_21A3A2 case 2, LilycoveCity_ContestLobby_EventScript_21A3A6 diff --git a/data/maps/LilycoveCity_CoveLilyMotel_2F/scripts.inc b/data/maps/LilycoveCity_CoveLilyMotel_2F/scripts.inc index f7fd5f453..03ac733f9 100644 --- a/data/maps/LilycoveCity_CoveLilyMotel_2F/scripts.inc +++ b/data/maps/LilycoveCity_CoveLilyMotel_2F/scripts.inc @@ -6,7 +6,7 @@ LilycoveCity_CoveLilyMotel_2F_EventScript_2186D3:: @ 82186D3 faceplayer call_if_unset FLAG_TEMP_2, LilycoveCity_CoveLilyMotel_2F_EventScript_2186F9 call_if_set FLAG_TEMP_2, LilycoveCity_CoveLilyMotel_2F_EventScript_21870F - specialvar VAR_RESULT, sub_80C08E4 + specialvar VAR_RESULT, HasAllHoennMons compare VAR_RESULT, 1 goto_if_eq LilycoveCity_CoveLilyMotel_2F_EventScript_218702 release diff --git a/data/maps/LilycoveCity_LilycoveMuseum_2F/scripts.inc b/data/maps/LilycoveCity_LilycoveMuseum_2F/scripts.inc index da39ee655..f73fbf092 100644 --- a/data/maps/LilycoveCity_LilycoveMuseum_2F/scripts.inc +++ b/data/maps/LilycoveCity_LilycoveMuseum_2F/scripts.inc @@ -92,7 +92,7 @@ LilycoveCity_LilycoveMuseum_2F_Movement_219863: @ 8219863 LilycoveCity_LilycoveMuseum_2F_EventScript_219866:: @ 8219866 lockall goto_if_set FLAG_RECEIVED_GLASS_ORNAMENT, LilycoveCity_LilycoveMuseum_2F_EventScript_219921 - specialvar VAR_0x8004, sub_80F8940 + specialvar VAR_0x8004, CountPlayerContestPaintings switch VAR_0x8004 case 1, LilycoveCity_LilycoveMuseum_2F_EventScript_2198BA case 2, LilycoveCity_LilycoveMuseum_2F_EventScript_2198BA diff --git a/data/maps/LittlerootTown_ProfessorBirchsLab/scripts.inc b/data/maps/LittlerootTown_ProfessorBirchsLab/scripts.inc index 8568a72ef..1f65beda3 100644 --- a/data/maps/LittlerootTown_ProfessorBirchsLab/scripts.inc +++ b/data/maps/LittlerootTown_ProfessorBirchsLab/scripts.inc @@ -16,7 +16,7 @@ LittlerootTown_ProfessorBirchsLab_MapScript1_1F9CA1: @ 81F9CA1 end LittlerootTown_ProfessorBirchsLab_EventScript_1F9CCD:: @ 81F9CCD - specialvar VAR_RESULT, sub_80C08E4 + specialvar VAR_RESULT, HasAllHoennMons compare VAR_RESULT, 1 goto_if_eq LittlerootTown_ProfessorBirchsLab_EventScript_1F9CE9 setobjectmovementtype 3, 3 diff --git a/data/specials.inc b/data/specials.inc index a5f272dc9..83e56106f 100644 --- a/data/specials.inc +++ b/data/specials.inc @@ -148,7 +148,7 @@ gSpecials:: @ 81DBA64 def_special sub_80F88E8 def_special sub_80F88DC def_special sub_80F8864 - def_special sub_80F8940 + def_special CountPlayerContestPaintings def_special ShowContestWinner def_special MauvilleGymSpecial2 def_special MauvilleGymSpecial1 @@ -345,7 +345,7 @@ gSpecials:: @ 81DBA64 def_special sub_80B05B4 def_special SetPacifidlogTMReceivedDay def_special GetDaysUntilPacifidlogTMAvailable - def_special sub_80C08E4 + def_special HasAllHoennMons def_special MonOTNameMatchesPlayer def_special BufferLottoTicketNumber def_special sub_81653CC diff --git a/include/pokedex.h b/include/pokedex.h index b6d323fd3..91e9e37d4 100644 --- a/include/pokedex.h +++ b/include/pokedex.h @@ -41,5 +41,6 @@ u16 GetHoennPokedexCount(u8); u8 CreateDexDisplayMonDataTask(u16 dexNum, u32 trainerId, u32 personality); s8 GetSetPokedexFlag(u16 nationalNum, u8 caseId); u16 CreateMonSpriteFromNationalDexNumber(u16, s16, s16, u16); +bool16 HasAllHoennMons(void); #endif // GUARD_POKEDEX_H diff --git a/include/script_pokemon_util_80F87D8.h b/include/script_pokemon_util_80F87D8.h index 02a35ecba..7d8d99628 100644 --- a/include/script_pokemon_util_80F87D8.h +++ b/include/script_pokemon_util_80F87D8.h @@ -4,5 +4,6 @@ u16 sub_80F903C(void); void ReducePlayerPartyToSelectedMons(void); void HealPlayerParty(void); +u8 CountPlayerContestPaintings(void); #endif // GUARD_SCRIPT_POKEMON_UTIL_80F87D8_H diff --git a/include/trainer_card.h b/include/trainer_card.h index a3d9160e0..df516510e 100644 --- a/include/trainer_card.h +++ b/include/trainer_card.h @@ -6,27 +6,27 @@ struct TrainerCard /*0x00*/ u8 gender; /*0x01*/ u8 stars; /*0x02*/ bool8 hasPokedex; - /*0x03*/ bool8 var_3; - /*0x04*/ bool8 var_4; + /*0x03*/ bool8 caughtAllHoenn; + /*0x04*/ bool8 hasAllPaintings; /*0x05*/ u8 var_5; - /*0x06*/ u16 firstHallOfFameA; - /*0x08*/ u16 firstHallOfFameB; - /*0x0A*/ u16 firstHallOfFameC; - /*0x0C*/ u16 pokedexCaught; + /*0x06*/ u16 hofDebutHours; + /*0x08*/ u16 hofDebutMinutes; + /*0x0A*/ u16 hofDebutSeconds; + /*0x0C*/ u16 caughtMonsCount; /*0x0E*/ u16 trainerId; /*0x10*/ u16 playTimeHours; /*0x12*/ u16 playTimeMinutes; /*0x14*/ u16 linkBattleWins; /*0x16*/ u16 linkBattleLosses; /*0x18*/ u16 battleTowerWins; - /*0x1A*/ u16 battleTowerLosses; + /*0x1A*/ u16 battleTowerLosses; // wrong name /*0x1C*/ u16 contestsWithFriends; /*0x1E*/ u16 pokeblocksWithFriends; /*0x20*/ u16 pokemonTrades; /*0x22*/ u16 var_22; /*0x24*/ u32 money; /*0x28*/ u16 var_28[4]; - /*0x30*/ u8 playerName[8]; + /*0x30*/ u8 playerName[PLAYER_NAME_LENGTH + 1]; /*0x38*/ u8 var_38; /*0x39*/ u8 var_39; /*0x3A*/ u16 var_3A; @@ -43,7 +43,6 @@ struct TrainerCard /*0x62*/ u16 var_62; }; - extern struct TrainerCard gTrainerCards[4]; void sub_80C3120(struct TrainerCard *arg0, u16 *src, u8 gameVersion); diff --git a/src/pokedex.c b/src/pokedex.c index 3d294e9e9..f99a8226a 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -4271,46 +4271,46 @@ s8 GetSetPokedexFlag(u16 nationalDexNo, u8 caseID) retVal = 0; switch (caseID) { - case FLAG_GET_SEEN: - if (gSaveBlock2Ptr->pokedex.seen[index] & mask) + case FLAG_GET_SEEN: + if (gSaveBlock2Ptr->pokedex.seen[index] & mask) + { + if ((gSaveBlock2Ptr->pokedex.seen[index] & mask) == (gSaveBlock1Ptr->seen1[index] & mask) + && (gSaveBlock2Ptr->pokedex.seen[index] & mask) == (gSaveBlock1Ptr->seen2[index] & mask)) + retVal = 1; + else { - if ((gSaveBlock2Ptr->pokedex.seen[index] & mask) == (gSaveBlock1Ptr->seen1[index] & mask) - && (gSaveBlock2Ptr->pokedex.seen[index] & mask) == (gSaveBlock1Ptr->seen2[index] & mask)) - retVal = 1; - else - { - gSaveBlock2Ptr->pokedex.seen[index] &= ~mask; - gSaveBlock1Ptr->seen1[index] &= ~mask; - gSaveBlock1Ptr->seen2[index] &= ~mask; - retVal = 0; - } + gSaveBlock2Ptr->pokedex.seen[index] &= ~mask; + gSaveBlock1Ptr->seen1[index] &= ~mask; + gSaveBlock1Ptr->seen2[index] &= ~mask; + retVal = 0; } - break; - case FLAG_GET_CAUGHT: - if (gSaveBlock2Ptr->pokedex.owned[index] & mask) + } + break; + case FLAG_GET_CAUGHT: + if (gSaveBlock2Ptr->pokedex.owned[index] & mask) + { + if ((gSaveBlock2Ptr->pokedex.owned[index] & mask) == (gSaveBlock2Ptr->pokedex.seen[index] & mask) + && (gSaveBlock2Ptr->pokedex.owned[index] & mask) == (gSaveBlock1Ptr->seen1[index] & mask) + && (gSaveBlock2Ptr->pokedex.owned[index] & mask) == (gSaveBlock1Ptr->seen2[index] & mask)) + retVal = 1; + else { - if ((gSaveBlock2Ptr->pokedex.owned[index] & mask) == (gSaveBlock2Ptr->pokedex.seen[index] & mask) - && (gSaveBlock2Ptr->pokedex.owned[index] & mask) == (gSaveBlock1Ptr->seen1[index] & mask) - && (gSaveBlock2Ptr->pokedex.owned[index] & mask) == (gSaveBlock1Ptr->seen2[index] & mask)) - retVal = 1; - else - { - gSaveBlock2Ptr->pokedex.owned[index] &= ~mask; - gSaveBlock2Ptr->pokedex.seen[index] &= ~mask; - gSaveBlock1Ptr->seen1[index] &= ~mask; - gSaveBlock1Ptr->seen2[index] &= ~mask; - retVal = 0; - } + gSaveBlock2Ptr->pokedex.owned[index] &= ~mask; + gSaveBlock2Ptr->pokedex.seen[index] &= ~mask; + gSaveBlock1Ptr->seen1[index] &= ~mask; + gSaveBlock1Ptr->seen2[index] &= ~mask; + retVal = 0; } - break; - case FLAG_SET_SEEN: - gSaveBlock2Ptr->pokedex.seen[index] |= mask; - gSaveBlock1Ptr->seen1[index] |= mask; - gSaveBlock1Ptr->seen2[index] |= mask; - break; - case FLAG_SET_CAUGHT: - gSaveBlock2Ptr->pokedex.owned[index] |= mask; - break; + } + break; + case FLAG_SET_SEEN: + gSaveBlock2Ptr->pokedex.seen[index] |= mask; + gSaveBlock1Ptr->seen1[index] |= mask; + gSaveBlock1Ptr->seen2[index] |= mask; + break; + case FLAG_SET_CAUGHT: + gSaveBlock2Ptr->pokedex.owned[index] |= mask; + break; } return retVal; } @@ -4324,14 +4324,14 @@ u16 GetNationalPokedexCount(u8 caseID) { switch (caseID) { - case FLAG_GET_SEEN: - if (GetSetPokedexFlag(i + 1, FLAG_GET_SEEN)) - count++; - break; - case FLAG_GET_CAUGHT: - if (GetSetPokedexFlag(i + 1, FLAG_GET_CAUGHT)) - count++; - break; + case FLAG_GET_SEEN: + if (GetSetPokedexFlag(i + 1, FLAG_GET_SEEN)) + count++; + break; + case FLAG_GET_CAUGHT: + if (GetSetPokedexFlag(i + 1, FLAG_GET_CAUGHT)) + count++; + break; } } return count; @@ -4346,14 +4346,14 @@ u16 GetHoennPokedexCount(u8 caseID) { switch (caseID) { - case FLAG_GET_SEEN: - if (GetSetPokedexFlag(HoennToNationalOrder(i + 1), FLAG_GET_SEEN)) - count++; - break; - case FLAG_GET_CAUGHT: - if (GetSetPokedexFlag(HoennToNationalOrder(i + 1), FLAG_GET_CAUGHT)) - count++; - break; + case FLAG_GET_SEEN: + if (GetSetPokedexFlag(HoennToNationalOrder(i + 1), FLAG_GET_SEEN)) + count++; + break; + case FLAG_GET_CAUGHT: + if (GetSetPokedexFlag(HoennToNationalOrder(i + 1), FLAG_GET_CAUGHT)) + count++; + break; } } return count; @@ -4381,7 +4381,7 @@ u16 sub_80C089C(u8 caseID) return count; } -bool16 sub_80C08E4(void) +bool16 HasAllHoennMons(void) { u16 i; diff --git a/src/script_pokemon_util_80F87D8.c b/src/script_pokemon_util_80F87D8.c index f3eaa7161..cade00b50 100755 --- a/src/script_pokemon_util_80F87D8.c +++ b/src/script_pokemon_util_80F87D8.c @@ -128,18 +128,18 @@ void sub_80F88E8(void) } } -u8 sub_80F8940(void) +u8 CountPlayerContestPaintings(void) { int i; - u8 var0 = 0; + u8 count = 0; for (i = 0; i < 5; i++) { if (gSaveBlock1Ptr->contestWinners[8 + i].species) - var0++; + count++; } - return var0; + return count; } void sub_80F8970(void) diff --git a/src/start_menu.c b/src/start_menu.c index 0f608b1d2..34d37e995 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -422,16 +422,19 @@ static bool32 PrintStartMenuActions(s8 *pIndex, u32 count) do { - if (sStartMenuItems[sCurrentStartMenuActions[index]].func.u8_void == StartMenuPlayerNameCallback) { + if (sStartMenuItems[sCurrentStartMenuActions[index]].func.u8_void == StartMenuPlayerNameCallback) + { PrintPlayerNameOnWindow(GetStartMenuWindowId(), sStartMenuItems[sCurrentStartMenuActions[index]].text, 8, (index << 4) + 9); } - else { + else + { StringExpandPlaceholders(gStringVar4, sStartMenuItems[sCurrentStartMenuActions[index]].text); AddTextPrinterParameterized(GetStartMenuWindowId(), 1, gStringVar4, 8, (index << 4) + 9, 0xFF, NULL); } index++; - if (index >= sNumStartMenuActions) { + if (index >= sNumStartMenuActions) + { *pIndex = index; return TRUE; } diff --git a/src/trainer_card.c b/src/trainer_card.c index 51ef20ddc..26a78ca08 100755 --- a/src/trainer_card.c +++ b/src/trainer_card.c @@ -15,6 +15,7 @@ #include "constants/flags.h" #include "event_data.h" #include "constants/game_stat.h" +#include "constants/battle_frontier.h" #include "money.h" #include "string_util.h" #include "trainer_card.h" @@ -23,10 +24,9 @@ #include "pokedex.h" #include "graphics.h" #include "pokemon_icon.h" +#include "script_pokemon_util_80F87D8.h" //external functions -extern u8 sub_80F8940(void); -extern bool16 sub_80C08E4(void); extern u8 sub_80D30A0(u16); extern void TintPalette_CustomTone(u16 *palette, u16 count, u16 rTone, u16 gTone, u16 bTone); extern void TintPalette_SepiaTone(u16 *palette, u16 count); @@ -105,23 +105,23 @@ extern bool8 (*const gUnknown_0856FB28[])(struct Task *); /*static*/ void sub_80C48C8(void); /*static*/ void sub_80C2710(void); /*static*/ void sub_80C2728(u8 task); -/*static*/ bool8 sub_80C3438(void); +/*static*/ bool8 PrintAllOnCardPage1(void); /*static*/ void sub_80C438C(u8); /*static*/ void sub_80C4FF0(void); -/*static*/ void sub_80C4550(u8*); -/*static*/ void sub_80C45C0(u8*); +/*static*/ void sub_80C4550(u16*); +/*static*/ void sub_80C45C0(u16*); /*static*/ void sub_80C4630(void); -/*static*/ void sub_80C3880(void); +/*static*/ void PrintTimeOnCard(void); /*static*/ void sub_80C4918(void); /*static*/ bool8 sub_80C4940(void); /*static*/ bool8 sub_80C2AD8(void); /*static*/ void sub_80C2C80(void); -/*static*/ u32 sav12_xor_get_clamped_above(u8 stat, u32 max); -/*static*/ bool8 sub_80C2DFC(void); +/*static*/ u32 GetCappedGameStat(u8 statId, u32 maxValue); +/*static*/ bool8 HasAllFrontierSymbols(void); /*static*/ u32 sub_80C2E40(void); -/*static*/ u8 TrainerCard_GetStarCount(struct TrainerCard*); -/*static*/ u16 sub_80C376C(void); -/*static*/ void sub_80C2EC4(struct TrainerCard*, u8); +/*static*/ u8 sub_80C2E84(struct TrainerCard*); +/*static*/ u16 GetCaughtMonsCount(void); +/*static*/ void SetPlayerCardData(struct TrainerCard*, u8); /*static*/ void sub_80C3020(struct TrainerCard*); /*static*/ u8 sub_80C4FCC(u8); /*static*/ void sub_80C3190(void); @@ -131,33 +131,33 @@ extern bool8 (*const gUnknown_0856FB28[])(struct Task *); /*static*/ void sub_80C3404(void); /*static*/ void sub_80C3414(void); /*static*/ void sub_80C4EE4(void); -/*static*/ void sub_80C3574(void); -/*static*/ void sub_80C3608(void); -/*static*/ void sub_80C3684(void); -/*static*/ void sub_80C378C(void); -/*static*/ void sub_80C3A18(void); -/*static*/ bool8 sub_80C34B0(void); +/*static*/ void PrintNameOnCard(void); +/*static*/ void PrintIdOnCard(void); +/*static*/ void PrintMoneyOnCard(void); +/*static*/ void PrintPokedexOnCard(void); +/*static*/ void PrintProfilePhraseOnCard(void); +/*static*/ bool8 PrintStringsOnCardPage2(void); /*static*/ void sub_80C3B50(void); -/*static*/ void sub_80C3CCC(void); -/*static*/ void sub_80C3D60(void); -/*static*/ void sub_80C3DF0(void); -/*static*/ void sub_80C3E58(void); -/*static*/ void sub_80C3F64(void); -/*static*/ void sub_80C3ED4(void); -/*static*/ void sub_80C3FE0(void); +/*static*/ void PrintHofDebutStringOnCard(void); +/*static*/ void PrintWinsLossesStringOnCard(void); +/*static*/ void PrintTradesStringOnCard(void); +/*static*/ void PrintBerryCrushStringOnCard(void); +/*static*/ void PrintPokeblockStringOnCard(void); +/*static*/ void PrintUnionStringOnCard(void); +/*static*/ void PrintContestStringOnCard(void); /*static*/ void sub_80C4140(void); -/*static*/ void sub_80C40CC(void); +/*static*/ void PrintBattleFacilityStringOnCard(void); /*static*/ void sub_80C42A4(void); -/*static*/ void sub_80C3548(void); -/*static*/ void sub_80C3AF0(void); -/*static*/ void sub_80C3BC4(void); -/*static*/ void sub_80C3CF4(void); -/*static*/ void sub_80C3DC0(void); -/*static*/ void sub_80C3E20(void); -/*static*/ void sub_80C3E98(void); -/*static*/ void sub_80C3F14(void); -/*static*/ void sub_80C3FA4(void); -/*static*/ void sub_80C4020(void); +/*static*/ void PrintAllVariableNumsOnCardPage2(void); +/*static*/ void PrintNameOnCard2(void); +/*static*/ void PrintHofTimeOnCard(void); +/*static*/ void PrintLinkResultsNumsOnCard(void); +/*static*/ void PrintTradesNumOnCard(void); +/*static*/ void PrintBerryCrushNumOnCard(void); +/*static*/ void PrintUnionNumOnCard(void); +/*static*/ void PrintPokeblocksNumOnCard(void); +/*static*/ void PrintContestNumOnCard(void); +/*static*/ void PrintBattleFacilityNumsOnCard(void); /*static*/ void sub_80C3C34(u8 top, const u8* str1, u8* str2, const u8* color); /*static*/ void sub_80C4330(void); /*static*/ u8 sub_80C43A8(void); @@ -166,8 +166,10 @@ extern bool8 (*const gUnknown_0856FB28[])(struct Task *); /*static*/ bool8 sub_80C4998(struct Task* task); /*static*/ bool8 sub_80C49D8(struct Task* task); /*static*/ void sub_80C32EC(u16); +void sub_80C41D8(void); -extern struct UnknownStruct{ +extern struct UnknownStruct +{ u8 var_0; u8 var_1; u8 var_2; @@ -209,14 +211,14 @@ extern struct UnknownStruct{ u16 var_52C; void (*callback2)(void); struct TrainerCard var_534; - u8 var_598[0x4B0]; + u16 var_598[0x4B0 / 2]; u8 var_A48[0x4B0]; - u8 var_EF8[0x4B0]; + u16 var_EF8[0x4B0 / 2]; u8 var_13A8[0x400]; u8 var_17A8[0x200]; u8 var_19A8[0x2300]; - u8 var_3CA8[0x2000]; - u8 var_5CA8[0x2000]; + u16 var_3CA8[0x2000 / 2]; + u16 var_5CA8[0x2000 / 2]; u16 var_7CA8; u8 var_7CAA; }* gUnknown_02039CE8; @@ -227,7 +229,7 @@ void sub_80C2690(void) ProcessSpriteCopyRequests(); TransferPlttBuffer(); sub_80C48C8(); - if(gUnknown_02039CE8->var_9) + if (gUnknown_02039CE8->var_9) DmaCopy16(3, &gScanlineEffectRegBuffers[0], &gScanlineEffectRegBuffers[1], 0x140); } @@ -235,7 +237,7 @@ void sub_80C26D4(void) { u16 backup; u16 bgVOffset; - + backup = REG_IME; REG_IME = 0; bgVOffset = gScanlineEffectRegBuffers[1][REG_VCOUNT & 0xFF]; @@ -258,21 +260,21 @@ void sub_80C2728(u8 taskId) Free(gUnknown_02039CE8); gUnknown_02039CE8 = NULL; DestroyTask(taskId); -} +} void sub_80C2760(u8 taskId) { - switch(gUnknown_02039CE8->var_0) + switch (gUnknown_02039CE8->var_0) { - case 0: - if(!IsDma3ManagerBusyWithBgCopy()) + case 0: + if (!IsDma3ManagerBusyWithBgCopy()) { FillWindowPixelBuffer(1, 0); gUnknown_02039CE8->var_0++; } break; case 1: - if(sub_80C3438()) + if (PrintAllOnCardPage1()) gUnknown_02039CE8->var_0++; break; case 2: @@ -298,7 +300,7 @@ void sub_80C2760(u8 taskId) gUnknown_02039CE8->var_0++; break; case 7: - if(gWirelessCommType == 1 && gReceivedRemoteLinkPlayers == TRUE) + if (gWirelessCommType == 1 && gReceivedRemoteLinkPlayers == TRUE) { sub_800E0E8(); CreateWirelessStatusIndicatorSprite(230, 150); @@ -309,53 +311,57 @@ void sub_80C2760(u8 taskId) gUnknown_02039CE8->var_0++; break; case 8: - if(!UpdatePaletteFade() && !IsDma3ManagerBusyWithBgCopy()) + if (!UpdatePaletteFade() && !IsDma3ManagerBusyWithBgCopy()) { PlaySE(SE_RG_CARD3); gUnknown_02039CE8->var_0 = 10; } break; case 9: - if(!IsSEPlaying()) + if (!IsSEPlaying()) gUnknown_02039CE8->var_0++; break; case 10: - if(!gReceivedRemoteLinkPlayers && gUnknown_02039CE8->var_529) + if (!gReceivedRemoteLinkPlayers && gUnknown_02039CE8->var_529) { - sub_80C3880(); + PrintTimeOnCard(); sub_80C438C(1); gUnknown_02039CE8->var_529 = 0; - } - if(gMain.newKeys & A_BUTTON) + } + if (gMain.newKeys & A_BUTTON) { sub_80C4918(); PlaySE(SE_RG_CARD1); gUnknown_02039CE8->var_0 = 12; } - else if(gMain.newKeys & B_BUTTON) + else if (gMain.newKeys & B_BUTTON) { - if(gReceivedRemoteLinkPlayers && gUnknown_02039CE8->var_5 && InUnionRoom() == TRUE) + if (gReceivedRemoteLinkPlayers && gUnknown_02039CE8->var_5 && InUnionRoom() == TRUE) + { gUnknown_02039CE8->var_0 = 15; + } else { BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, gUnknown_02039CE8->var_52C); gUnknown_02039CE8->var_0 = 14; } - } + } break; case 12: - if(sub_80C4940() && sub_8087598() != TRUE) + if (sub_80C4940() && sub_8087598() != TRUE) { PlaySE(SE_RG_CARD3); gUnknown_02039CE8->var_0 = 11; - } - break; + } + break; case 11: - if(gMain.newKeys & B_BUTTON) + if (gMain.newKeys & B_BUTTON) { - if(gReceivedRemoteLinkPlayers && gUnknown_02039CE8->var_5 && InUnionRoom() == TRUE) + if (gReceivedRemoteLinkPlayers && gUnknown_02039CE8->var_5 && InUnionRoom() == TRUE) + { gUnknown_02039CE8->var_0 = 15; - else if(gReceivedRemoteLinkPlayers) + } + else if (gReceivedRemoteLinkPlayers) { BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, gUnknown_02039CE8->var_52C); gUnknown_02039CE8->var_0 = 14; @@ -364,20 +370,22 @@ void sub_80C2760(u8 taskId) { sub_80C4918(); gUnknown_02039CE8->var_0 = 13; - PlaySE(SE_RG_CARD1); + PlaySE(SE_RG_CARD1); } - } - else if(gMain.newKeys & A_BUTTON) + } + else if (gMain.newKeys & A_BUTTON) { - if(gReceivedRemoteLinkPlayers && gUnknown_02039CE8->var_5 && InUnionRoom() == TRUE) + if (gReceivedRemoteLinkPlayers && gUnknown_02039CE8->var_5 && InUnionRoom() == TRUE) + { gUnknown_02039CE8->var_0 = 15; + } else { BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, gUnknown_02039CE8->var_52C); gUnknown_02039CE8->var_0 = 14; } } - break; + break; case 15: sub_800AC34(); NewMenuHelpers_DrawDialogueFrame(0, 1); @@ -386,71 +394,72 @@ void sub_80C2760(u8 taskId) gUnknown_02039CE8->var_0 = 16; break; case 16: - if(!gReceivedRemoteLinkPlayers) + if (!gReceivedRemoteLinkPlayers) { BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, gUnknown_02039CE8->var_52C); gUnknown_02039CE8->var_0 = 14; } break; - case 14: - if(!UpdatePaletteFade()) + case 14: + if (!UpdatePaletteFade()) sub_80C2728(taskId); break; case 13: - if(sub_80C4940() && sub_8087598() != TRUE) + if (sub_80C4940() && sub_8087598() != TRUE) { gUnknown_02039CE8->var_0 = 10; PlaySE(SE_RG_CARD3); } + break; } } bool8 sub_80C2AD8(void) { - switch(gUnknown_02039CE8->var_2) + switch (gUnknown_02039CE8->var_2) { case 0: - if(gUnknown_02039CE8->var_52A) + if (gUnknown_02039CE8->var_52A) LZ77UnCompWram(gUnknown_08DD1F78, gUnknown_02039CE8->var_EF8); else LZ77UnCompWram(gUnknown_08DD2AE0, gUnknown_02039CE8->var_EF8); break; case 1: - if(gUnknown_02039CE8->var_52A) + if (gUnknown_02039CE8->var_52A) LZ77UnCompWram(gUnknown_08DD21B0, gUnknown_02039CE8->var_A48); else LZ77UnCompWram(gUnknown_08DD2D30, gUnknown_02039CE8->var_A48); break; case 2: - if(!gUnknown_02039CE8->var_5) + if (!gUnknown_02039CE8->var_5) { - if(gUnknown_02039CE8->var_52A) + if (gUnknown_02039CE8->var_52A) LZ77UnCompWram(gUnknown_08DD2010, gUnknown_02039CE8->var_598); else LZ77UnCompWram(gUnknown_08DD2B78, gUnknown_02039CE8->var_598); } else { - if(gUnknown_02039CE8->var_52A) + if (gUnknown_02039CE8->var_52A) LZ77UnCompWram(gUnknown_08DD228C, gUnknown_02039CE8->var_598); else LZ77UnCompWram(gUnknown_08DD2E5C, gUnknown_02039CE8->var_598); } break; case 3: - if(gUnknown_02039CE8->var_52A) + if (gUnknown_02039CE8->var_52A) LZ77UnCompWram(gUnknown_0856F5CC, gUnknown_02039CE8->var_13A8); else LZ77UnCompWram(gUnknown_0856F814, gUnknown_02039CE8->var_13A8); break; case 4: - if(gUnknown_02039CE8->var_52A) + if (gUnknown_02039CE8->var_52A) LZ77UnCompWram(gEmeraldTrainerCard_Gfx, gUnknown_02039CE8->var_19A8); else LZ77UnCompWram(gFireRedTrainerCard_Gfx, gUnknown_02039CE8->var_19A8); break; case 5: - if(!gUnknown_02039CE8->var_52A) + if (!gUnknown_02039CE8->var_52A) LZ77UnCompWram(gUnknown_0856F018, gUnknown_02039CE8->var_17A8); break; default: @@ -461,215 +470,116 @@ bool8 sub_80C2AD8(void) return FALSE; } -NAKED -void sub_80C2C80(void) //not really a nonmatching, skipped it because of DMA macros +void sub_80C2C80(void) { - asm("\n\ - .syntax unified\n\ - push {lr}\n\ - sub sp, 0x8\n\ - ldr r1, =gMain\n\ - movs r2, 0x87\n\ - lsls r2, 3\n\ - adds r0, r1, r2\n\ - ldrb r0, [r0]\n\ - adds r3, r1, 0\n\ - cmp r0, 0xA\n\ - bls _080C2C96\n\ - b _080C2DD8\n\ -_080C2C96:\n\ - lsls r0, 2\n\ - ldr r1, =_080C2CA8\n\ - adds r0, r1\n\ - ldr r0, [r0]\n\ - mov pc, r0\n\ - .pool\n\ - .align 2, 0\n\ -_080C2CA8:\n\ - .4byte _080C2CD4\n\ - .4byte _080C2CEC\n\ - .4byte _080C2D14\n\ - .4byte _080C2D50\n\ - .4byte _080C2D6A\n\ - .4byte _080C2D74\n\ - .4byte _080C2D88\n\ - .4byte _080C2D8E\n\ - .4byte _080C2DA0\n\ - .4byte _080C2DA6\n\ - .4byte _080C2DB8\n\ -_080C2CD4:\n\ - bl sub_80C334C\n\ - bl sub_80C3414\n\ - ldr r1, =gMain\n\ - movs r0, 0x87\n\ - lsls r0, 3\n\ - adds r1, r0\n\ - b _080C2DCC\n\ - .pool\n\ -_080C2CEC:\n\ - movs r1, 0xE0\n\ - lsls r1, 19\n\ - movs r0, 0\n\ - str r0, [sp]\n\ - ldr r0, =0x040000d4\n\ - mov r2, sp\n\ - str r2, [r0]\n\ - str r1, [r0, 0x4]\n\ - ldr r1, =0x85000100\n\ - str r1, [r0, 0x8]\n\ - ldr r0, [r0, 0x8]\n\ - movs r0, 0x87\n\ - lsls r0, 3\n\ - adds r1, r3, r0\n\ - b _080C2DCC\n\ - .pool\n\ -_080C2D14:\n\ - ldr r0, =gUnknown_02039CE8\n\ - ldr r0, [r0]\n\ - ldr r1, =0x0000052c\n\ - adds r0, r1\n\ - ldrh r0, [r0]\n\ - cmp r0, 0\n\ - bne _080C2D36\n\ - movs r2, 0xA0\n\ - lsls r2, 19\n\ - add r1, sp, 0x4\n\ - strh r0, [r1]\n\ - ldr r0, =0x040000d4\n\ - str r1, [r0]\n\ - str r2, [r0, 0x4]\n\ - ldr r1, =0x81000200\n\ - str r1, [r0, 0x8]\n\ - ldr r0, [r0, 0x8]\n\ -_080C2D36:\n\ - movs r2, 0x87\n\ - lsls r2, 3\n\ - adds r1, r3, r2\n\ - b _080C2DCC\n\ - .pool\n\ -_080C2D50:\n\ - bl ResetSpriteData\n\ - bl FreeAllSpritePalettes\n\ - bl ResetPaletteFade\n\ - ldr r1, =gMain\n\ - movs r0, 0x87\n\ - lsls r0, 3\n\ - adds r1, r0\n\ - ldrb r0, [r1]\n\ - adds r0, 0x1\n\ - strb r0, [r1]\n\ -_080C2D6A:\n\ - bl sub_80C3388\n\ - b _080C2DC4\n\ - .pool\n\ -_080C2D74:\n\ - bl sub_80C41D8\n\ - ldr r1, =gMain\n\ - movs r0, 0x87\n\ - lsls r0, 3\n\ - adds r1, r0\n\ - b _080C2DCC\n\ - .pool\n\ -_080C2D88:\n\ - bl sub_80C2AD8\n\ - b _080C2DBC\n\ -_080C2D8E:\n\ - bl sub_80C4330\n\ - ldr r1, =gMain\n\ - movs r0, 0x87\n\ - lsls r0, 3\n\ - adds r1, r0\n\ - b _080C2DCC\n\ - .pool\n\ -_080C2DA0:\n\ - bl sub_80C3278\n\ - b _080C2DC4\n\ -_080C2DA6:\n\ - bl sub_80C3548\n\ - ldr r1, =gMain\n\ - movs r0, 0x87\n\ - lsls r0, 3\n\ - adds r1, r0\n\ - b _080C2DCC\n\ - .pool\n\ -_080C2DB8:\n\ - bl sub_80C43A8\n\ -_080C2DBC:\n\ - lsls r0, 24\n\ - lsrs r0, 24\n\ - cmp r0, 0x1\n\ - bne _080C2DDC\n\ -_080C2DC4:\n\ - ldr r1, =gMain\n\ - movs r2, 0x87\n\ - lsls r2, 3\n\ - adds r1, r2\n\ -_080C2DCC:\n\ - ldrb r0, [r1]\n\ - adds r0, 0x1\n\ - strb r0, [r1]\n\ - b _080C2DDC\n\ - .pool\n\ -_080C2DD8:\n\ - bl sub_80C3404\n\ -_080C2DDC:\n\ - add sp, 0x8\n\ - pop {r0}\n\ - bx r0\n\ - .syntax divided"); + switch (gMain.state) + { + case 0: + sub_80C334C(); + sub_80C3414(); + gMain.state++; + break; + case 1: + DmaClear32(3, (void *)OAM, OAM_SIZE); + gMain.state++; + break; + case 2: + if (!gUnknown_02039CE8->var_52C) + DmaClear16(3, (void *)PLTT, PLTT_SIZE); + gMain.state++; + break; + case 3: + ResetSpriteData(); + FreeAllSpritePalettes(); + ResetPaletteFade(); + gMain.state++; + case 4: + sub_80C3388(); + gMain.state++; + break; + case 5: + sub_80C41D8(); + gMain.state++; + break; + case 6: + if (sub_80C2AD8() == TRUE) + gMain.state++; + break; + case 7: + sub_80C4330(); + gMain.state++; + break; + case 8: + sub_80C3278(); + gMain.state++; + break; + case 9: + PrintAllVariableNumsOnCardPage2(); + gMain.state++; + break; + case 10: + if (sub_80C43A8() == TRUE) + gMain.state++; + break; + default: + sub_80C3404(); + break; + } } -u32 sav12_xor_get_clamped_above(u8 stat, u32 max) +u32 GetCappedGameStat(u8 statId, u32 maxValue) { - u32 retStat = GetGameStat(stat); - return (retStat > max) ? max : retStat; + u32 statValue = GetGameStat(statId); + + return min(maxValue, statValue); } -bool8 sub_80C2DFC(void) +bool8 HasAllFrontierSymbols(void) { u8 i; - for(i = 0; i <= 6; i++) + for (i = 0; i < NUM_FRONTIER_FACILITIES; i++) { - if(!FlagGet(FLAG_SYS_TOWER_SILVER + 2 * i) || !FlagGet(FLAG_SYS_TOWER_GOLD + 2 * i)) + if (!FlagGet(FLAG_SYS_TOWER_SILVER + 2 * i) || !FlagGet(FLAG_SYS_TOWER_GOLD + 2 * i)) return FALSE; } - return TRUE; + return TRUE; } u32 sub_80C2E40(void) { - u32 stat = GetGameStat(GAME_STAT_ENTERED_HOF); - u8 r4 = (stat | -stat) >> 31; - - if(sub_80C08E4()) - r4++; - if(sub_80F8940() > 4) - r4++; - if(sub_80C2DFC()) - r4++; - return r4; + u8 stars = 0; + + if (GetGameStat(GAME_STAT_ENTERED_HOF)) + stars++; + if (HasAllHoennMons()) + stars++; + if (CountPlayerContestPaintings() > 4) + stars++; + if (HasAllFrontierSymbols()) + stars++; + + return stars; } -u8 TrainerCard_GetStarCount(struct TrainerCard *trainerCard) +u8 sub_80C2E84(struct TrainerCard *trainerCard) { - u8 value = 0; + u8 stars = 0; - if (trainerCard->firstHallOfFameA || trainerCard->firstHallOfFameB || trainerCard->firstHallOfFameC) - value++; - if (trainerCard->var_3) - value++; + if (trainerCard->hofDebutHours || trainerCard->hofDebutMinutes || trainerCard->hofDebutSeconds) + stars++; + if (trainerCard->caughtAllHoenn) + stars++; if (trainerCard->battleTowerLosses > 49) - value++; - if (trainerCard->var_4) - value++; - - return value; + stars++; + if (trainerCard->hasAllPaintings) + stars++; + + return stars; } -void sub_80C2EC4(struct TrainerCard *trainerCard, u8 arg1) +void SetPlayerCardData(struct TrainerCard *trainerCard, u8 arg1) { u32 playTime; - bool32 enteredHallOfFame; u8 i; trainerCard->gender = gSaveBlock2Ptr->playerGender; @@ -677,233 +587,101 @@ void sub_80C2EC4(struct TrainerCard *trainerCard, u8 arg1) trainerCard->playTimeMinutes = gSaveBlock2Ptr->playTimeMinutes; playTime = GetGameStat(GAME_STAT_FIRST_HOF_PLAY_TIME); - enteredHallOfFame = GetGameStat(GAME_STAT_ENTERED_HOF); - if (!enteredHallOfFame) + if (!GetGameStat(GAME_STAT_ENTERED_HOF)) playTime = 0; - - trainerCard->firstHallOfFameA = playTime >> 16; - trainerCard->firstHallOfFameB = (playTime >> 8) & 0xFF; - trainerCard->firstHallOfFameC = playTime & 0xFF; - if((playTime >> 16) > 999) + + trainerCard->hofDebutHours = playTime >> 16; + trainerCard->hofDebutMinutes = (playTime >> 8) & 0xFF; + trainerCard->hofDebutSeconds = playTime & 0xFF; + if ((playTime >> 16) > 999) { - trainerCard->firstHallOfFameA = 999; - trainerCard->firstHallOfFameB = 59; - trainerCard->firstHallOfFameC = 59; + trainerCard->hofDebutHours = 999; + trainerCard->hofDebutMinutes = 59; + trainerCard->hofDebutSeconds = 59; } - + trainerCard->hasPokedex = FlagGet(FLAG_SYS_POKEDEX_GET); - trainerCard->var_3 = sub_80C08E4(); - trainerCard->pokedexCaught = sub_80C376C(); + trainerCard->caughtAllHoenn = HasAllHoennMons(); + trainerCard->caughtMonsCount = GetCaughtMonsCount(); trainerCard->trainerId = (gSaveBlock2Ptr->playerTrainerId[1] << 8) | gSaveBlock2Ptr->playerTrainerId[0]; - trainerCard->linkBattleWins = sav12_xor_get_clamped_above(GAME_STAT_LINK_BATTLE_WINS, 9999); - trainerCard->linkBattleLosses = sav12_xor_get_clamped_above(GAME_STAT_LINK_BATTLE_LOSSES, 9999); - - trainerCard->pokemonTrades = sav12_xor_get_clamped_above(GAME_STAT_POKEMON_TRADES, 0xFFFF); - + trainerCard->linkBattleWins = GetCappedGameStat(GAME_STAT_LINK_BATTLE_WINS, 9999); + trainerCard->linkBattleLosses = GetCappedGameStat(GAME_STAT_LINK_BATTLE_LOSSES, 9999); + + trainerCard->pokemonTrades = GetCappedGameStat(GAME_STAT_POKEMON_TRADES, 0xFFFF); + trainerCard->money = GetMoney(&gSaveBlock1Ptr->money); for (i = 0; i < 4; i++) trainerCard->var_28[i] = gSaveBlock1Ptr->unk2BB0[i]; - + StringCopy(trainerCard->playerName, gSaveBlock2Ptr->playerName); - - switch(arg1) + + switch (arg1) { case 2: trainerCard->battleTowerWins = 0; trainerCard->battleTowerLosses = 0; case 0: - trainerCard->contestsWithFriends = sav12_xor_get_clamped_above(GAME_STAT_WON_LINK_CONTEST, 999); - trainerCard->pokeblocksWithFriends = sav12_xor_get_clamped_above(GAME_STAT_POKEBLOCKS_WITH_FRIENDS, 0xFFFF); - if(sub_80F8940() > 4) - trainerCard->var_4 = TRUE; - trainerCard->stars = TrainerCard_GetStarCount(trainerCard); + trainerCard->contestsWithFriends = GetCappedGameStat(GAME_STAT_WON_LINK_CONTEST, 999); + trainerCard->pokeblocksWithFriends = GetCappedGameStat(GAME_STAT_POKEBLOCKS_WITH_FRIENDS, 0xFFFF); + if (CountPlayerContestPaintings() > 4) + trainerCard->hasAllPaintings = TRUE; + trainerCard->stars = sub_80C2E84(trainerCard); break; case 1: trainerCard->battleTowerWins = 0; trainerCard->battleTowerLosses = 0; trainerCard->contestsWithFriends = 0; trainerCard->pokeblocksWithFriends = 0; - trainerCard->var_4 = 0; + trainerCard->hasAllPaintings = 0; trainerCard->stars = 0; + break; } } -#ifdef NONMATCHING //r0 and r1 swapped void sub_80C3020(struct TrainerCard *trainerCard) { memset(trainerCard, 0, sizeof(struct TrainerCard)); trainerCard->var_38 = 3; - sub_80C2EC4(trainerCard, 2); - trainerCard->var_60 = sub_80C2DFC(); + SetPlayerCardData(trainerCard, 2); + trainerCard->var_60 = HasAllFrontierSymbols(); trainerCard->var_62 = gSaveBlock2Ptr->frontier.field_EBA; - if(trainerCard->var_60) + if (trainerCard->var_60) trainerCard->stars++; - if(trainerCard->gender == FEMALE) - trainerCard->var_4F = gUnknown_08329D54[(trainerCard->trainerId & 7) + 8]; - else - trainerCard->var_4F = gUnknown_08329D54[trainerCard->trainerId & 7]; -} -#else -NAKED -void sub_80C3020(struct TrainerCard *trainerCard) -{ - asm("\n\ - .syntax unified\n\ - push {r4,lr}\n\ - adds r4, r0, 0\n\ - movs r1, 0\n\ - movs r2, 0x64\n\ - bl memset\n\ - adds r1, r4, 0\n\ - adds r1, 0x38\n\ - movs r0, 0x3\n\ - strb r0, [r1]\n\ - adds r0, r4, 0\n\ - movs r1, 0x2\n\ - bl sub_80C2EC4\n\ - bl sub_80C2DFC\n\ - lsls r0, 24\n\ - lsrs r0, 24\n\ - adds r1, r4, 0\n\ - adds r1, 0x60\n\ - strh r0, [r1]\n\ - ldr r0, =gSaveBlock2Ptr\n\ - ldr r0, [r0]\n\ - ldr r2, =0x00000eba\n\ - adds r0, r2\n\ - ldrh r0, [r0]\n\ - adds r2, r4, 0\n\ - adds r2, 0x62\n\ - strh r0, [r2]\n\ - ldrh r0, [r1]\n\ - cmp r0, 0\n\ - beq _080C3066\n\ - ldrb r0, [r4, 0x1]\n\ - adds r0, 0x1\n\ - strb r0, [r4, 0x1]\n\ -_080C3066:\n\ - ldrb r0, [r4]\n\ - cmp r0, 0x1\n\ - bne _080C3084\n\ - ldr r2, =gUnknown_08329D54\n\ - ldrh r0, [r4, 0xE]\n\ - movs r1, 0x7\n\ - ands r0, r1\n\ - adds r0, 0x8\n\ - b _080C308C\n\ - .pool\n\ -_080C3084:\n\ - ldr r2, =gUnknown_08329D54\n\ - ldrh r0, [r4, 0xE]\n\ - movs r1, 0x7\n\ - ands r0, r1\n\ -_080C308C:\n\ - lsls r0, 1\n\ - adds r0, r2\n\ - ldrh r1, [r0]\n\ - adds r0, r4, 0\n\ - adds r0, 0x4F\n\ - strb r1, [r0]\n\ - pop {r4}\n\ - pop {r0}\n\ - bx r0\n\ - .pool\n\ - .syntax divided"); -} -#endif // NONMATCHING -#ifdef NONMATCHING //r0 and r1 swapped + if (trainerCard->gender == FEMALE) + trainerCard->var_4F = gUnknown_08329D54[(trainerCard->trainerId % 8) + 8]; + else + trainerCard->var_4F = gUnknown_08329D54[trainerCard->trainerId % 8]; +} + void TrainerCard_GenerateCardForPlayer(struct TrainerCard *trainerCard) { - u8 temp; memset(trainerCard, 0, 0x60); trainerCard->var_38 = 3; - sub_80C2EC4(trainerCard, 2); - temp = sub_80C2DFC(); - trainerCard->var_3A = temp; + SetPlayerCardData(trainerCard, 2); + trainerCard->var_3A = HasAllFrontierSymbols(); *((u16*)&trainerCard->var_3C) = gSaveBlock2Ptr->frontier.field_EBA; - if(temp) + if (trainerCard->var_3A) trainerCard->stars++; - if(trainerCard->gender == FEMALE) - trainerCard->var_4F = gUnknown_08329D54[(trainerCard->trainerId & 7) + 8]; + + if (trainerCard->gender == FEMALE) + trainerCard->var_4F = gUnknown_08329D54[(trainerCard->trainerId % 8) + 8]; else - trainerCard->var_4F = gUnknown_08329D54[trainerCard->trainerId & 7]; + trainerCard->var_4F = gUnknown_08329D54[trainerCard->trainerId % 8]; } -#else -NAKED -void TrainerCard_GenerateCardForPlayer(struct TrainerCard *trainerCard) -{ - asm("\n\ - .syntax unified\n\ - push {r4,lr}\n\ - adds r4, r0, 0\n\ - movs r1, 0\n\ - movs r2, 0x60\n\ - bl memset\n\ - adds r1, r4, 0\n\ - adds r1, 0x38\n\ - movs r0, 0x3\n\ - strb r0, [r1]\n\ - adds r0, r4, 0\n\ - movs r1, 0x2\n\ - bl sub_80C2EC4\n\ - bl sub_80C2DFC\n\ - lsls r0, 24\n\ - lsrs r0, 24\n\ - strh r0, [r4, 0x3A]\n\ - ldr r1, =gSaveBlock2Ptr\n\ - ldr r1, [r1]\n\ - ldr r2, =0x00000eba\n\ - adds r1, r2\n\ - ldrh r1, [r1]\n\ - strh r1, [r4, 0x3C]\n\ - cmp r0, 0\n\ - beq _080C30E0\n\ - ldrb r0, [r4, 0x1]\n\ - adds r0, 0x1\n\ - strb r0, [r4, 0x1]\n\ -_080C30E0:\n\ - ldrb r0, [r4]\n\ - cmp r0, 0x1\n\ - bne _080C3100\n\ - ldr r2, =gUnknown_08329D54\n\ - ldrh r0, [r4, 0xE]\n\ - movs r1, 0x7\n\ - ands r0, r1\n\ - adds r0, 0x8\n\ - b _080C3108\n\ - .pool\n\ -_080C3100:\n\ - ldr r2, =gUnknown_08329D54\n\ - ldrh r0, [r4, 0xE]\n\ - movs r1, 0x7\n\ - ands r0, r1\n\ -_080C3108:\n\ - lsls r0, 1\n\ - adds r0, r2\n\ - ldrh r1, [r0]\n\ - adds r0, r4, 0\n\ - adds r0, 0x4F\n\ - strb r1, [r0]\n\ - pop {r4}\n\ - pop {r0}\n\ - bx r0\n\ - .pool\n\ - .syntax divided"); -} -#endif // NONMATCHING void sub_80C3120(struct TrainerCard *trainerCard, u16 *src, u8 gameVersion) { memset(trainerCard, 0, sizeof(struct TrainerCard)); trainerCard->var_38 = gameVersion; - switch(sub_80C4FCC(gameVersion)) + + switch (sub_80C4FCC(gameVersion)) { case 0: - memcpy(trainerCard, src, 0x60); + memcpy(trainerCard, src, 0x60); break; case 1: memcpy(trainerCard, src, 0x38); @@ -913,6 +691,7 @@ void sub_80C3120(struct TrainerCard *trainerCard, u16 *src, u8 gameVersion) trainerCard->var_3C = 0; trainerCard->var_60 = src[29]; trainerCard->var_62 = src[30]; + break; } } @@ -920,7 +699,7 @@ void sub_80C3190(void) { u8 i; u32 badgeFlag; - + gUnknown_02039CE8->var_A = 0; gUnknown_02039CE8->var_B = 0; gUnknown_02039CE8->var_C = 0; @@ -928,27 +707,27 @@ void sub_80C3190(void) gUnknown_02039CE8->var_E = 0; gUnknown_02039CE8->var_F = 0; gUnknown_02039CE8->var_10 = 0; - memset(gUnknown_02039CE8->badgeCount, 0, 8); - if(gUnknown_02039CE8->var_534.hasPokedex) + memset(gUnknown_02039CE8->badgeCount, 0, sizeof(gUnknown_02039CE8->badgeCount)); + if (gUnknown_02039CE8->var_534.hasPokedex) gUnknown_02039CE8->var_A++; - - if(gUnknown_02039CE8->var_534.firstHallOfFameA - ||gUnknown_02039CE8->var_534.firstHallOfFameB - ||gUnknown_02039CE8->var_534.firstHallOfFameC) + + if (gUnknown_02039CE8->var_534.hofDebutHours + || gUnknown_02039CE8->var_534.hofDebutMinutes + || gUnknown_02039CE8->var_534.hofDebutSeconds) gUnknown_02039CE8->var_B++; - - if(gUnknown_02039CE8->var_534.linkBattleWins || gUnknown_02039CE8->var_534.linkBattleLosses) + + if (gUnknown_02039CE8->var_534.linkBattleWins || gUnknown_02039CE8->var_534.linkBattleLosses) gUnknown_02039CE8->var_C++; - if(gUnknown_02039CE8->var_534.pokemonTrades) + if (gUnknown_02039CE8->var_534.pokemonTrades) gUnknown_02039CE8->var_10++; - if(gUnknown_02039CE8->var_534.battleTowerWins || gUnknown_02039CE8->var_534.battleTowerLosses) + if (gUnknown_02039CE8->var_534.battleTowerWins || gUnknown_02039CE8->var_534.battleTowerLosses) gUnknown_02039CE8->var_D++; - + i = 0; badgeFlag = FLAG_BADGE01_GET; while (1) { - if(FlagGet(badgeFlag)) + if (FlagGet(badgeFlag)) gUnknown_02039CE8->badgeCount[i]++; badgeFlag++; i++; @@ -970,7 +749,7 @@ void sub_80C3278(void) SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_BG1 | WINOUT_WIN01_BG2 | WINOUT_WIN01_BG3 | WINOUT_WIN01_OBJ); SetGpuReg(REG_OFFSET_WIN0V, 160); SetGpuReg(REG_OFFSET_WIN0H, 240); - if(gReceivedRemoteLinkPlayers) + if (gReceivedRemoteLinkPlayers) EnableInterrupts(INTR_FLAG_VBLANK | INTR_FLAG_HBLANK | INTR_FLAG_VCOUNT | INTR_FLAG_TIMER3 | INTR_FLAG_SERIAL); else EnableInterrupts(INTR_FLAG_VBLANK | INTR_FLAG_HBLANK); @@ -978,9 +757,9 @@ void sub_80C3278(void) void sub_80C32EC(u16 arg0) { - u8 quotient = (arg0 + 40) / 10; - - if((s8)quotient <= 4) + s8 quotient = (arg0 + 40) / 10; + + if (quotient <= 4) quotient = 0; gUnknown_02039CE8->var_528 = quotient; SetGpuReg(REG_OFFSET_BLDY, gUnknown_02039CE8->var_528); @@ -1029,27 +808,27 @@ void sub_80C3414(void) sub_80C3190(); } -bool8 sub_80C3438(void) +bool8 PrintAllOnCardPage1(void) { - switch(gUnknown_02039CE8->var_1) + switch (gUnknown_02039CE8->var_1) { case 0: - sub_80C3574(); + PrintNameOnCard(); break; case 1: - sub_80C3608(); + PrintIdOnCard(); break; case 2: - sub_80C3684(); + PrintMoneyOnCard(); break; case 3: - sub_80C378C(); + PrintPokedexOnCard(); break; case 4: - sub_80C3880(); + PrintTimeOnCard(); break; case 5: - sub_80C3A18(); + PrintProfilePhraseOnCard(); break; default: gUnknown_02039CE8->var_1 = 0; @@ -1059,33 +838,33 @@ bool8 sub_80C3438(void) return FALSE; } -bool8 sub_80C34B0(void) +bool8 PrintStringsOnCardPage2(void) { - switch(gUnknown_02039CE8->var_1) + switch (gUnknown_02039CE8->var_1) { case 0: sub_80C3B50(); break; case 1: - sub_80C3CCC(); + PrintHofDebutStringOnCard(); break; case 2: - sub_80C3D60(); + PrintWinsLossesStringOnCard(); break; case 3: - sub_80C3DF0(); + PrintTradesStringOnCard(); break; case 4: - sub_80C3E58(); - sub_80C3F64(); + PrintBerryCrushStringOnCard(); + PrintPokeblockStringOnCard(); break; case 5: - sub_80C3ED4(); - sub_80C3FE0(); + PrintUnionStringOnCard(); + PrintContestStringOnCard(); break; case 6: sub_80C4140(); - sub_80C40CC(); + PrintBattleFacilityStringOnCard(); break; case 7: sub_80C42A4(); @@ -1098,33 +877,33 @@ bool8 sub_80C34B0(void) return FALSE; } -void sub_80C3548(void) +void PrintAllVariableNumsOnCardPage2(void) { - sub_80C3AF0(); - sub_80C3BC4(); - sub_80C3CF4(); - sub_80C3DC0(); - sub_80C3E20(); - sub_80C3E98(); - sub_80C3F14(); - sub_80C3FA4(); - sub_80C4020(); + PrintNameOnCard2(); + PrintHofTimeOnCard(); + PrintLinkResultsNumsOnCard(); + PrintTradesNumOnCard(); + PrintBerryCrushNumOnCard(); + PrintUnionNumOnCard(); + PrintPokeblocksNumOnCard(); + PrintContestNumOnCard(); + PrintBattleFacilityNumsOnCard(); } -void sub_80C3574(void) +void PrintNameOnCard(void) { u8 buffer[32]; u8* txtPtr; txtPtr = StringCopy(buffer, gText_TrainerCardName); StringCopy(txtPtr, gUnknown_02039CE8->var_534.playerName); ConvertInternationalString(txtPtr, gUnknown_02039CE8->var_7CAA); - if(!gUnknown_02039CE8->var_52A) + if (!gUnknown_02039CE8->var_52A) AddTextPrinterParameterized3(1, 1, 20, 28, gUnknown_0856FB0C, -1, buffer); else AddTextPrinterParameterized3(1, 1, 16, 33, gUnknown_0856FB0C, -1, buffer); } -void sub_80C3608(void) +void PrintIdOnCard(void) { u8 buffer[32]; u8* txtPtr; @@ -1132,9 +911,9 @@ void sub_80C3608(void) u32 top; txtPtr = StringCopy(buffer, gText_TrainerCardIDNo); ConvertIntToDecimalStringN(txtPtr, gUnknown_02039CE8->var_534.trainerId, STR_CONV_MODE_LEADING_ZEROS, 5); - if(!gUnknown_02039CE8->var_52A) + if (!gUnknown_02039CE8->var_52A) { - xPos = GetStringCenterAlignXOffset(1, buffer, 80) + 132; + xPos = GetStringCenterAlignXOffset(1, buffer, 80) + 132; top = 9; } else @@ -1142,21 +921,23 @@ void sub_80C3608(void) xPos = GetStringCenterAlignXOffset(1, buffer, 96) + 120; top = 9; } - + AddTextPrinterParameterized3(1, 1, xPos, top, gUnknown_0856FB0C, -1, buffer); } -void sub_80C3684(void) +void PrintMoneyOnCard(void) { s32 xOffset; u8 top; - if(!gUnknown_02039CE8->var_52B) + + if (!gUnknown_02039CE8->var_52B) AddTextPrinterParameterized3(1, 1, 20, 56, gUnknown_0856FB0C, -1, gText_TrainerCardMoney); else AddTextPrinterParameterized3(1, 1, 16, 57, gUnknown_0856FB0C, -1, gText_TrainerCardMoney); + ConvertIntToDecimalStringN(gStringVar1, gUnknown_02039CE8->var_534.money, 0, 6); StringExpandPlaceholders(gStringVar4, gText_PokedollarVar1); - if(!gUnknown_02039CE8->var_52B) + if (!gUnknown_02039CE8->var_52B) { xOffset = GetStringRightAlignXOffset(1, gStringVar4, 144); top = 56; @@ -1165,30 +946,30 @@ void sub_80C3684(void) { xOffset = GetStringRightAlignXOffset(1, gStringVar4, 128); top = 57; - } + } AddTextPrinterParameterized3(1, 1, xOffset, top, gUnknown_0856FB0C, -1, gStringVar4); } -u16 sub_80C376C(void) +u16 GetCaughtMonsCount(void) { - if(IsNationalPokedexEnabled()) + if (IsNationalPokedexEnabled()) return GetNationalPokedexCount(FLAG_GET_CAUGHT); - - return GetHoennPokedexCount(FLAG_GET_CAUGHT); + else + return GetHoennPokedexCount(FLAG_GET_CAUGHT); } -void sub_80C378C(void) +void PrintPokedexOnCard(void) { s32 xOffset; u8 top; - if(FlagGet(FLAG_SYS_POKEDEX_GET)) + if (FlagGet(FLAG_SYS_POKEDEX_GET)) { - if(!gUnknown_02039CE8->var_52B) + if (!gUnknown_02039CE8->var_52B) AddTextPrinterParameterized3(1, 1, 20, 72, gUnknown_0856FB0C, -1, gText_TrainerCardPokedex); else AddTextPrinterParameterized3(1, 1, 16, 73, gUnknown_0856FB0C, -1,gText_TrainerCardPokedex); - StringCopy(ConvertIntToDecimalStringN(gStringVar4, gUnknown_02039CE8->var_534.pokedexCaught, 0, 3), gText_EmptyString6); - if(!gUnknown_02039CE8->var_52B) + StringCopy(ConvertIntToDecimalStringN(gStringVar4, gUnknown_02039CE8->var_534.caughtMonsCount, 0, 3), gText_EmptyString6); + if (!gUnknown_02039CE8->var_52B) { xOffset = GetStringRightAlignXOffset(1, gStringVar4, 144); top = 72; @@ -1197,42 +978,45 @@ void sub_80C378C(void) { xOffset = GetStringRightAlignXOffset(1, gStringVar4, 128); top = 73; - } + } AddTextPrinterParameterized3(1, 1, xOffset, top, gUnknown_0856FB0C, -1, gStringVar4); } } -void sub_80C3880(void) +void PrintTimeOnCard(void) { u16 hours; u16 minutes; s32 width; u32 r7, r4, r10; - if(!gUnknown_02039CE8->var_52B) + + if (!gUnknown_02039CE8->var_52B) AddTextPrinterParameterized3(1, 1, 20, 88, gUnknown_0856FB0C, -1, gText_TrainerCardTime); else AddTextPrinterParameterized3(1, 1, 16, 89, gUnknown_0856FB0C, -1, gText_TrainerCardTime); - if(gUnknown_02039CE8->var_5) + + if (gUnknown_02039CE8->var_5) { hours = gUnknown_02039CE8->var_534.playTimeHours; - minutes = gUnknown_02039CE8->var_534.playTimeMinutes; + minutes = gUnknown_02039CE8->var_534.playTimeMinutes; } else { hours = gSaveBlock2Ptr->playTimeHours; minutes = gSaveBlock2Ptr->playTimeMinutes; } - if(hours > 999) + + if (hours > 999) hours = 999; - if(minutes > 59) + if (minutes > 59) minutes = 59; width = GetStringWidth(1, gText_Colon2, 0); - - if(!gUnknown_02039CE8->var_52B) + + if (!gUnknown_02039CE8->var_52B) { r7 = 144; r4 = 88; - } + } else { r7 = 128; @@ -1240,7 +1024,7 @@ void sub_80C3880(void) } r10 = width + 30; r7 -= r10; - + FillWindowPixelRect(1, 0, r7, r4, r10, 15); ConvertIntToDecimalStringN(gStringVar4, hours, 1, 3); AddTextPrinterParameterized3(1, 1, r7, r4, gUnknown_0856FB0C, -1, gStringVar4); @@ -1251,9 +1035,9 @@ void sub_80C3880(void) AddTextPrinterParameterized3(1, 1, r7, r4, gUnknown_0856FB0C, -1, gStringVar4); } -void sub_80C3A18(void) +void PrintProfilePhraseOnCard(void) { - if(gUnknown_02039CE8->var_5) + if (gUnknown_02039CE8->var_5) { AddTextPrinterParameterized3(1, 1, 8, gUnknown_0856FB48[gUnknown_02039CE8->var_52B], gUnknown_0856FB0C, -1, gUnknown_02039CE8->var_19); AddTextPrinterParameterized3(1, 1, GetStringWidth(1, gUnknown_02039CE8->var_19, 0) + 14, gUnknown_0856FB48[gUnknown_02039CE8->var_52B], gUnknown_0856FB0C, -1, gUnknown_02039CE8->var_26); @@ -1262,11 +1046,11 @@ void sub_80C3A18(void) } } -void sub_80C3AF0(void) +void PrintNameOnCard2(void) { StringCopy(gUnknown_02039CE8->var_4D, gUnknown_02039CE8->var_534.playerName); ConvertInternationalString(gUnknown_02039CE8->var_4D, gUnknown_02039CE8->var_7CAA); - if(gUnknown_02039CE8->var_52A) + if (gUnknown_02039CE8->var_52A) { StringCopy(gStringVar1, gUnknown_02039CE8->var_4D); StringExpandPlaceholders(gUnknown_02039CE8->var_4D, gText_Var1sTrainerCard); @@ -1275,19 +1059,19 @@ void sub_80C3AF0(void) void sub_80C3B50(void) { - if(!gUnknown_02039CE8->var_52B) + if (!gUnknown_02039CE8->var_52B) AddTextPrinterParameterized3(1, 1, 136, 9, gUnknown_0856FB0C, -1, gUnknown_02039CE8->var_4D); else AddTextPrinterParameterized3(1, 1, GetStringRightAlignXOffset(1, gUnknown_02039CE8->var_4D, 216), 9, gUnknown_0856FB0C, -1, gUnknown_02039CE8->var_4D); } -void sub_80C3BC4(void) +void PrintHofTimeOnCard(void) { - if(gUnknown_02039CE8->var_B) + if (gUnknown_02039CE8->var_B) { - ConvertIntToDecimalStringN(gStringVar1, gUnknown_02039CE8->var_534.firstHallOfFameA, 1, 3); - ConvertIntToDecimalStringN(gStringVar2, gUnknown_02039CE8->var_534.firstHallOfFameB, 2, 2); - ConvertIntToDecimalStringN(gStringVar3, gUnknown_02039CE8->var_534.firstHallOfFameC, 2, 2); + ConvertIntToDecimalStringN(gStringVar1, gUnknown_02039CE8->var_534.hofDebutHours, 1, 3); + ConvertIntToDecimalStringN(gStringVar2, gUnknown_02039CE8->var_534.hofDebutMinutes, 2, 2); + ConvertIntToDecimalStringN(gStringVar3, gUnknown_02039CE8->var_534.hofDebutSeconds, 2, 2); StringExpandPlaceholders(gUnknown_02039CE8->var_93, gUnknown_0856FB4C); } } @@ -1298,15 +1082,15 @@ void sub_80C3C34(u8 top, const u8* str1, u8* str2, const u8* color) AddTextPrinterParameterized3(1, 1, GetStringRightAlignXOffset(1, str2, gUnknown_0856FB57[gUnknown_02039CE8->var_52B]), top * 16 + 33, color, -1, str2); } -void sub_80C3CCC(void) +void PrintHofDebutStringOnCard(void) { - if(gUnknown_02039CE8->var_B) - sub_80C3C34(0, gText_HallOfFameDebut, gUnknown_02039CE8->var_93, gUnknown_0856FB0F); + if (gUnknown_02039CE8->var_B) + sub_80C3C34(0, gText_HallOfFameDebut, gUnknown_02039CE8->var_93, gUnknown_0856FB0F); } -void sub_80C3CF4(void) +void PrintLinkResultsNumsOnCard(void) { - if(gUnknown_02039CE8->var_C) + if (gUnknown_02039CE8->var_C) { StringCopy(gUnknown_02039CE8->var_D9, gUnknown_0856FB5C[gUnknown_02039CE8->var_52A]); ConvertIntToDecimalStringN(gUnknown_02039CE8->var_165, gUnknown_02039CE8->var_534.linkBattleWins, 0, 4); @@ -1314,9 +1098,9 @@ void sub_80C3CF4(void) } } -void sub_80C3D60(void) +void PrintWinsLossesStringOnCard(void) { - if(gUnknown_02039CE8->var_C) + if (gUnknown_02039CE8->var_C) { StringCopy(gStringVar1, gUnknown_02039CE8->var_165); StringCopy(gStringVar2, gUnknown_02039CE8->var_1AB); @@ -1325,105 +1109,108 @@ void sub_80C3D60(void) } } -void sub_80C3DC0(void) +void PrintTradesNumOnCard(void) { - if(gUnknown_02039CE8->var_10) + if (gUnknown_02039CE8->var_10) ConvertIntToDecimalStringN(gUnknown_02039CE8->var_237, gUnknown_02039CE8->var_534.pokemonTrades, 1, 5); } -void sub_80C3DF0(void) +void PrintTradesStringOnCard(void) { - if(gUnknown_02039CE8->var_10) + if (gUnknown_02039CE8->var_10) sub_80C3C34(2, gText_PokemonTrades, gUnknown_02039CE8->var_237, gUnknown_0856FB0F); } -void sub_80C3E20(void) +void PrintBerryCrushNumOnCard(void) { - if(!gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.var_3C) + if (!gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.var_3C) ConvertIntToDecimalStringN(gUnknown_02039CE8->var_2C3, gUnknown_02039CE8->var_534.var_3C, 1, 5); } -void sub_80C3E58(void) +void PrintBerryCrushStringOnCard(void) { - if(!gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.var_3C) + if (!gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.var_3C) sub_80C3C34(4, gText_BerryCrush, gUnknown_02039CE8->var_2C3, gUnknown_0856FB0F); } -void sub_80C3E98(void) +void PrintUnionNumOnCard(void) { - if(!gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.var_40) + if (!gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.var_40) ConvertIntToDecimalStringN(gUnknown_02039CE8->var_34F, gUnknown_02039CE8->var_534.var_40, 1, 5); } -void sub_80C3ED4(void) +void PrintUnionStringOnCard(void) { - if(!gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.var_40) + if (!gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.var_40) sub_80C3C34(3, gText_UnionTradesAndBattles, gUnknown_02039CE8->var_34F, gUnknown_0856FB0F); } -void sub_80C3F14(void) +void PrintPokeblocksNumOnCard(void) { - if(gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.pokeblocksWithFriends) + if (gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.pokeblocksWithFriends) { ConvertIntToDecimalStringN(gStringVar1, gUnknown_02039CE8->var_534.pokeblocksWithFriends, 1, 5); StringExpandPlaceholders(gUnknown_02039CE8->var_395, gText_Var1DarkGreyShadowLightGrey); } } -void sub_80C3F64(void) +void PrintPokeblockStringOnCard(void) { - if(gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.pokeblocksWithFriends) + if (gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.pokeblocksWithFriends) sub_80C3C34(3, gText_PokeblocksWithFriends, gUnknown_02039CE8->var_395, gUnknown_0856FB0F); } -void sub_80C3FA4(void) +void PrintContestNumOnCard(void) { - if(gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.contestsWithFriends) + if (gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.contestsWithFriends) ConvertIntToDecimalStringN(gUnknown_02039CE8->var_3DB, gUnknown_02039CE8->var_534.contestsWithFriends, 1, 5); } -void sub_80C3FE0(void) +void PrintContestStringOnCard(void) { - if(gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.contestsWithFriends) + if (gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.contestsWithFriends) sub_80C3C34(4, gText_WonContestsWFriends, gUnknown_02039CE8->var_3DB, gUnknown_0856FB0F); } -void sub_80C4020(void) +void PrintBattleFacilityNumsOnCard(void) { - switch(gUnknown_02039CE8->var_52A) + switch (gUnknown_02039CE8->var_52A) { case 1: - if(gUnknown_02039CE8->var_D) + if (gUnknown_02039CE8->var_D) { ConvertIntToDecimalStringN(gStringVar1, gUnknown_02039CE8->var_534.battleTowerWins, 1, 4); ConvertIntToDecimalStringN(gStringVar2, gUnknown_02039CE8->var_534.battleTowerLosses, 1, 4); StringExpandPlaceholders(gUnknown_02039CE8->var_421, gText_WSlashStraightSlash); } break; - case 2: - if(gUnknown_02039CE8->var_534.var_62) + if (gUnknown_02039CE8->var_534.var_62) { ConvertIntToDecimalStringN(gStringVar1, gUnknown_02039CE8->var_534.var_62, 1, 5); StringExpandPlaceholders(gUnknown_02039CE8->var_421, gText_Var1DarkLightGreyBP); } + break; case 0: + break; } } -void sub_80C40CC(void) +void PrintBattleFacilityStringOnCard(void) { - switch(gUnknown_02039CE8->var_52A) + switch (gUnknown_02039CE8->var_52A) { case 1: - if(gUnknown_02039CE8->var_D) + if (gUnknown_02039CE8->var_D) sub_80C3C34(5, gText_BattleTower, gUnknown_02039CE8->var_421, gUnknown_0856FB0C); break; case 2: - if(gUnknown_02039CE8->var_534.var_62) + if (gUnknown_02039CE8->var_534.var_62) sub_80C3C34(5, gText_BattlePtsWon, gUnknown_02039CE8->var_421, gUnknown_0856FB0F); + break; case 0: - } + break; + } } void sub_80C4140(void) @@ -1433,26 +1220,29 @@ void sub_80C4140(void) u8 buffer2[8]; memcpy(buffer, gUnknown_0856FB68, sizeof(gUnknown_0856FB68)); memcpy(buffer2, gUnknown_0856FB6E, sizeof(gUnknown_0856FB6E)); - - if(!gUnknown_02039CE8->var_52A) + + if (!gUnknown_02039CE8->var_52A) { - for(i = 0; i < 6; i++) + for (i = 0; i < 6; i++) { - if(gUnknown_02039CE8->var_534.monSpecies[i]) + if (gUnknown_02039CE8->var_534.monSpecies[i]) { u8 monSpecies = sub_80D30A0(gUnknown_02039CE8->var_534.monSpecies[i]); WriteSequenceToBgTilemapBuffer(3, 16 * i + 224, buffer2[i] + 3, 15, 4, 4, buffer[monSpecies], 1); } } - } + } } void sub_80C41D8(void) { u8 i; + CpuSet(gMonIconPalettes, gUnknown_02039CE8->var_468, 0x60); - switch(gUnknown_02039CE8->var_534.var_4E) + switch (gUnknown_02039CE8->var_534.var_4E) { + case 0: + break; case 1: TintPalette_CustomTone(gUnknown_02039CE8->var_468, 96, 0, 0, 0); break; @@ -1461,15 +1251,15 @@ void sub_80C41D8(void) break; case 3: TintPalette_SepiaTone(gUnknown_02039CE8->var_468, 96); - case 0: + break; } LoadPalette(gUnknown_02039CE8->var_468, 80, 192); - - for(i = 0; i < 6; i++) + + for (i = 0; i < 6; i++) { - if(gUnknown_02039CE8->var_534.monSpecies[i]) + if (gUnknown_02039CE8->var_534.monSpecies[i]) LoadBgTiles(3, GetMonIconTiles(gUnknown_02039CE8->var_534.monSpecies[i], 0), 512, 16 * i + 32); - } + } } void sub_80C42A4(void) @@ -1477,12 +1267,12 @@ void sub_80C42A4(void) u8 i; u8 buffer[4]; memcpy(buffer, gUnknown_0856FB74, sizeof(gUnknown_0856FB74)); - if(!gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.var_4C == 1) + if (!gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.var_4C == 1) { - for(i = 0; i < 3; i++) + for (i = 0; i < 3; i++) { u8 var_50 = gUnknown_02039CE8->var_534.var_50[i]; - if(gUnknown_02039CE8->var_534.var_50[i]) + if (gUnknown_02039CE8->var_534.var_50[i]) WriteSequenceToBgTilemapBuffer(3, i * 4 + 320, i * 3 + 2, 2, 2, 2, buffer[var_50 - 1], 1); } } @@ -1505,7 +1295,7 @@ void sub_80C438C(u8 windowId) u8 sub_80C43A8(void) { - switch(gUnknown_02039CE8->var_3) + switch (gUnknown_02039CE8->var_3) { case 0: LoadBgTiles(3, gUnknown_02039CE8->var_13A8, 1024, 0); @@ -1514,18 +1304,18 @@ u8 sub_80C43A8(void) LoadBgTiles(0, gUnknown_02039CE8->var_19A8, 6144, 0); break; case 2: - if(gUnknown_02039CE8->var_52A) + if (gUnknown_02039CE8->var_52A) { LoadPalette(gEmeraldTrainerCardStarPals[gUnknown_02039CE8->var_534.stars], 0, 96); LoadPalette(gUnknown_0856F4EC, 48, 32); - if(gUnknown_02039CE8->var_534.gender) + if (gUnknown_02039CE8->var_534.gender) LoadPalette(gUnknown_0856F4AC, 16, 32); } else { LoadPalette(gFireRedTrainerCardStarPals[gUnknown_02039CE8->var_534.stars], 0, 96); LoadPalette(gUnknown_0856F50C, 48, 32); - if(gUnknown_02039CE8->var_534.gender) + if (gUnknown_02039CE8->var_534.gender) LoadPalette(gUnknown_0856F4CC, 16, 32); } LoadPalette(gUnknown_0856F52C, 64, 32); @@ -1545,284 +1335,81 @@ u8 sub_80C43A8(void) return 0; } -NAKED -void sub_80C4550(u8* ptr) //nested loop +void sub_80C4550(u16 *ptr) { - asm("\n\ - .syntax unified\n\ - push {r4-r7,lr}\n\ - adds r7, r0, 0\n\ - ldr r0, =gUnknown_02039CE8\n\ - ldr r0, [r0]\n\ - ldr r1, =0x00005ca8\n\ - adds r6, r0, r1\n\ - movs r1, 0\n\ -_080C455E:\n\ - movs r2, 0\n\ - lsls r5, r1, 16\n\ - asrs r1, r5, 16\n\ - lsls r3, r1, 5\n\ - lsls r0, r1, 4\n\ - subs r0, r1\n\ - lsls r4, r0, 1\n\ -_080C456C:\n\ - lsls r0, r2, 16\n\ - asrs r1, r0, 16\n\ - adds r2, r0, 0\n\ - cmp r1, 0x1D\n\ - bgt _080C4590\n\ - adds r0, r3, r1\n\ - lsls r0, 1\n\ - adds r0, r6\n\ - adds r1, r4, r1\n\ - lsls r1, 1\n\ - adds r1, r7\n\ - ldrh r1, [r1]\n\ - b _080C4598\n\ - .pool\n\ -_080C4590:\n\ - adds r0, r3, r1\n\ - lsls r0, 1\n\ - adds r0, r6\n\ - ldrh r1, [r7]\n\ -_080C4598:\n\ - strh r1, [r0]\n\ - movs r1, 0x80\n\ - lsls r1, 9\n\ - adds r0, r2, r1\n\ - lsrs r2, r0, 16\n\ - asrs r0, 16\n\ - cmp r0, 0x1F\n\ - ble _080C456C\n\ - adds r0, r5, r1\n\ - lsrs r1, r0, 16\n\ - asrs r0, 16\n\ - cmp r0, 0x13\n\ - ble _080C455E\n\ - movs r0, 0x2\n\ - bl CopyBgTilemapBufferToVram\n\ - pop {r4-r7}\n\ - pop {r0}\n\ - bx r0\n\ - .syntax divided"); + s16 i, j; + u16 *dst = gUnknown_02039CE8->var_5CA8; + + for (i = 0; i < 20; i++) + { + for (j = 0; j < 32; j++) + { + if (j < 30) + dst[32 * i + j] = ptr[30 * i + j]; + else + dst[32 * i + j] = ptr[0]; + } + } + CopyBgTilemapBufferToVram(2); } -NAKED -void sub_80C45C0(u8* ptr) //nested loop +void sub_80C45C0(u16* ptr) { - asm("\n\ - .syntax unified\n\ - push {r4-r7,lr}\n\ - adds r7, r0, 0\n\ - ldr r0, =gUnknown_02039CE8\n\ - ldr r0, [r0]\n\ - ldr r1, =0x00003ca8\n\ - adds r6, r0, r1\n\ - movs r1, 0\n\ -_080C45CE:\n\ - movs r2, 0\n\ - lsls r5, r1, 16\n\ - asrs r1, r5, 16\n\ - lsls r3, r1, 5\n\ - lsls r0, r1, 4\n\ - subs r0, r1\n\ - lsls r4, r0, 1\n\ -_080C45DC:\n\ - lsls r0, r2, 16\n\ - asrs r1, r0, 16\n\ - adds r2, r0, 0\n\ - cmp r1, 0x1D\n\ - bgt _080C4600\n\ - adds r0, r3, r1\n\ - lsls r0, 1\n\ - adds r0, r6\n\ - adds r1, r4, r1\n\ - lsls r1, 1\n\ - adds r1, r7\n\ - ldrh r1, [r1]\n\ - b _080C4608\n\ - .pool\n\ -_080C4600:\n\ - adds r0, r3, r1\n\ - lsls r0, 1\n\ - adds r0, r6\n\ - ldrh r1, [r7]\n\ -_080C4608:\n\ - strh r1, [r0]\n\ - movs r1, 0x80\n\ - lsls r1, 9\n\ - adds r0, r2, r1\n\ - lsrs r2, r0, 16\n\ - asrs r0, 16\n\ - cmp r0, 0x1F\n\ - ble _080C45DC\n\ - adds r0, r5, r1\n\ - lsrs r1, r0, 16\n\ - asrs r0, 16\n\ - cmp r0, 0x13\n\ - ble _080C45CE\n\ - movs r0, 0\n\ - bl CopyBgTilemapBufferToVram\n\ - pop {r4-r7}\n\ - pop {r0}\n\ - bx r0\n\ - .syntax divided"); + s16 i, j; + u16 *dst = gUnknown_02039CE8->var_3CA8; + + for (i = 0; i < 20; i++) + { + for (j = 0; j < 32; j++) + { + if (j < 30) + dst[32 * i + j] = ptr[30 * i + j]; + else + dst[32 * i + j] = ptr[0]; + } + } + CopyBgTilemapBufferToVram(0); } -NAKED void sub_80C4630(void) { - asm("\n\ - .syntax unified\n\ - push {r4-r7,lr}\n\ - mov r7, r10\n\ - mov r6, r9\n\ - mov r5, r8\n\ - push {r5-r7}\n\ - sub sp, 0xC\n\ - movs r0, 0xC0\n\ - mov r8, r0\n\ - movs r2, 0x3\n\ - mov r10, r2\n\ - ldr r2, =gUnknown_0856FB78\n\ - ldr r4, =gUnknown_02039CE8\n\ - ldr r1, [r4]\n\ - ldr r3, =0x0000052b\n\ - adds r0, r1, r3\n\ - ldrb r0, [r0]\n\ - adds r0, r2\n\ - ldrb r3, [r0]\n\ - ldr r0, =0x00000535\n\ - adds r1, r0\n\ - ldrb r0, [r1]\n\ - str r0, [sp]\n\ - movs r0, 0x1\n\ - str r0, [sp, 0x4]\n\ - movs r0, 0x4\n\ - str r0, [sp, 0x8]\n\ - movs r0, 0x3\n\ - movs r1, 0x8F\n\ - movs r2, 0xF\n\ - bl FillBgTilemapBufferRect\n\ - ldr r0, [r4]\n\ - ldrb r0, [r0, 0x5]\n\ - cmp r0, 0\n\ - bne _080C4724\n\ - movs r2, 0x4\n\ - mov r9, r2\n\ - movs r2, 0\n\ - movs r6, 0x1\n\ -_080C467E:\n\ - ldr r0, =gUnknown_02039CE8\n\ - ldr r1, [r0]\n\ - lsls r0, r2, 16\n\ - asrs r7, r0, 16\n\ - adds r1, 0x11\n\ - adds r1, r7\n\ - ldrb r0, [r1]\n\ - cmp r0, 0\n\ - beq _080C4700\n\ - mov r3, r9\n\ - lsls r5, r3, 24\n\ - lsrs r5, 24\n\ - str r6, [sp]\n\ - str r6, [sp, 0x4]\n\ - mov r0, r10\n\ - str r0, [sp, 0x8]\n\ - movs r0, 0x3\n\ - mov r1, r8\n\ - adds r2, r5, 0\n\ - movs r3, 0xF\n\ - bl FillBgTilemapBufferRect\n\ - mov r1, r8\n\ - adds r1, 0x1\n\ - lsls r1, 16\n\ - lsrs r1, 16\n\ - mov r4, r9\n\ - adds r4, 0x1\n\ - lsls r4, 24\n\ - lsrs r4, 24\n\ - str r6, [sp]\n\ - str r6, [sp, 0x4]\n\ - mov r2, r10\n\ - str r2, [sp, 0x8]\n\ - movs r0, 0x3\n\ - adds r2, r4, 0\n\ - movs r3, 0xF\n\ - bl FillBgTilemapBufferRect\n\ - mov r1, r8\n\ - adds r1, 0x10\n\ - lsls r1, 16\n\ - lsrs r1, 16\n\ - str r6, [sp]\n\ - str r6, [sp, 0x4]\n\ - mov r3, r10\n\ - str r3, [sp, 0x8]\n\ - movs r0, 0x3\n\ - adds r2, r5, 0\n\ - movs r3, 0x10\n\ - bl FillBgTilemapBufferRect\n\ - mov r1, r8\n\ - adds r1, 0x11\n\ - lsls r1, 16\n\ - lsrs r1, 16\n\ - str r6, [sp]\n\ - str r6, [sp, 0x4]\n\ - mov r0, r10\n\ - str r0, [sp, 0x8]\n\ - movs r0, 0x3\n\ - adds r2, r4, 0\n\ - movs r3, 0x10\n\ - bl FillBgTilemapBufferRect\n\ -_080C4700:\n\ - adds r0, r7, 0x1\n\ - lsls r0, 16\n\ - mov r1, r8\n\ - adds r1, 0x2\n\ - lsls r1, 16\n\ - lsrs r1, 16\n\ - mov r8, r1\n\ - mov r2, r9\n\ - lsls r1, r2, 16\n\ - movs r3, 0xC0\n\ - lsls r3, 10\n\ - adds r1, r3\n\ - lsrs r1, 16\n\ - mov r9, r1\n\ - lsrs r2, r0, 16\n\ - asrs r0, 16\n\ - cmp r0, 0x7\n\ - ble _080C467E\n\ -_080C4724:\n\ - movs r0, 0x3\n\ - bl CopyBgTilemapBufferToVram\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"); + s16 i, x; + u16 tileNum = 192; + u8 palNum = 3; + + FillBgTilemapBufferRect(3, 143, 15, gUnknown_0856FB78[gUnknown_02039CE8->var_52B], gUnknown_02039CE8->var_534.stars, 1, 4); + if (!gUnknown_02039CE8->var_5) + { + x = 4; + for (i = 0; i < 8; i++, tileNum += 2, x += 3) + { + if (gUnknown_02039CE8->badgeCount[i]) + { + FillBgTilemapBufferRect(3, tileNum, x, 15, 1, 1, palNum); + FillBgTilemapBufferRect(3, tileNum + 1, x + 1, 15, 1, 1, palNum); + FillBgTilemapBufferRect(3, tileNum + 16, x, 16, 1, 1, palNum); + FillBgTilemapBufferRect(3, tileNum + 17, x + 1, 16, 1, 1, palNum); + } + } + } + CopyBgTilemapBufferToVram(3); } void sub_80C474C(void) { - if(!gUnknown_02039CE8->var_52A) + if (!gUnknown_02039CE8->var_52A) { - if(gUnknown_02039CE8->var_10) + if (gUnknown_02039CE8->var_10) { FillBgTilemapBufferRect(3, 141, 27, 9, 1, 1, 1); FillBgTilemapBufferRect(3, 157, 27, 10, 1, 1, 1); } - if(gUnknown_02039CE8->var_534.var_3C) + if (gUnknown_02039CE8->var_534.var_3C) { FillBgTilemapBufferRect(3, 141, 21, 13, 1, 1, 1); FillBgTilemapBufferRect(3, 157, 21, 14, 1, 1, 1); } - if(gUnknown_02039CE8->var_534.var_40) + if (gUnknown_02039CE8->var_534.var_40) { FillBgTilemapBufferRect(3, 141, 27, 11, 1, 1, 1); FillBgTilemapBufferRect(3, 157, 27, 12, 1, 1, 1); @@ -1830,17 +1417,17 @@ void sub_80C474C(void) } else { - if(gUnknown_02039CE8->var_10) + if (gUnknown_02039CE8->var_10) { FillBgTilemapBufferRect(3, 141, 27, 9, 1, 1, 0); FillBgTilemapBufferRect(3, 157, 27, 10, 1, 1, 0); } - if(gUnknown_02039CE8->var_534.contestsWithFriends) + if (gUnknown_02039CE8->var_534.contestsWithFriends) { FillBgTilemapBufferRect(3, 141, 27, 13, 1, 1, 0); FillBgTilemapBufferRect(3, 157, 27, 14, 1, 1, 0); } - if(gUnknown_02039CE8->var_D) + if (gUnknown_02039CE8->var_D) { FillBgTilemapBufferRect(3, 141, 17, 15, 1, 1, 0); FillBgTilemapBufferRect(3, 157, 17, 16, 1, 1, 0); @@ -1853,7 +1440,7 @@ void sub_80C474C(void) void sub_80C48C8(void) { - if(++gUnknown_02039CE8->var_6 > 60) + if (++gUnknown_02039CE8->var_6 > 60) { gUnknown_02039CE8->var_6 = 0; gUnknown_02039CE8->var_7 ^= 1; @@ -1876,9 +1463,10 @@ void sub_80C4918(void) bool8 sub_80C4940(void) { - if(FindTaskIdByFunc(sub_80C4960) == 0xFF) + if (FindTaskIdByFunc(sub_80C4960) == 0xFF) return TRUE; - return FALSE; + else + return FALSE; } void sub_80C4960(u8 taskId) @@ -1890,11 +1478,12 @@ void sub_80C4960(u8 taskId) bool8 sub_80C4998(struct Task* task) { u32 i; + HideBg(1); HideBg(3); ScanlineEffect_Stop(); ScanlineEffect_Clear(); - for(i = 0; i < 160; i++) + for (i = 0; i < 160; i++) gScanlineEffectRegBuffers[1][i] = 0; task->data[0]++; return FALSE; From 4e396207d3f09772f0f073b5a945bb1fafe1fcdd Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sun, 20 Jan 2019 18:24:35 +0100 Subject: [PATCH 05/16] document more of trainer card --- asm/{trainer_card.s => frontier_pass.s} | 929 +-------------- data/event_scripts.s | 2 +- data/{trainer_card.s => frontier_pass.s} | 173 --- data/specials.inc | 2 +- include/graphics.h | 14 + include/palette.h | 4 + include/strings.h | 26 + include/trainer_card.h | 26 +- ld_script.txt | 6 +- src/cable_club.c | 4 +- src/frontier_pass.c | 31 + src/rom_8011DC0.c | 4 +- src/start_menu.c | 43 +- src/trainer_card.c | 1383 ++++++++++++++-------- sym_ewram.txt | 3 +- 15 files changed, 986 insertions(+), 1664 deletions(-) rename asm/{trainer_card.s => frontier_pass.s} (79%) rename data/{trainer_card.s => frontier_pass.s} (61%) create mode 100644 src/frontier_pass.c diff --git a/asm/trainer_card.s b/asm/frontier_pass.s similarity index 79% rename from asm/trainer_card.s rename to asm/frontier_pass.s index b1fd740ec..c9746b91f 100644 --- a/asm/trainer_card.s +++ b/asm/frontier_pass.s @@ -7,931 +7,6 @@ - thumb_func_start sub_80C49D8 -sub_80C49D8: @ 80C49D8 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - mov r8, r0 - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - movs r0, 0 - strb r0, [r1, 0x9] - mov r0, r8 - ldrh r1, [r0, 0xA] - movs r2, 0xA - ldrsh r0, [r0, r2] - cmp r0, 0x4C - ble _080C4A08 - movs r0, 0x4D - mov r3, r8 - strh r0, [r3, 0xA] - b _080C4A0E - .pool -_080C4A08: - adds r0, r1, 0x7 - mov r4, r8 - strh r0, [r4, 0xA] -_080C4A0E: - ldr r0, =gUnknown_02039CE8 - ldr r0, [r0] - mov r2, r8 - ldrh r1, [r2, 0xA] - ldr r3, =0x00007ca8 - adds r0, r3 - strh r1, [r0] - ldrh r0, [r2, 0xA] - bl sub_80C32EC - mov r4, r8 - movs r0, 0xA - ldrsh r7, [r4, r0] - movs r0, 0xA0 - subs r0, r7 - mov r9, r0 - subs r4, r0, r7 - negs r0, r7 - lsls r6, r0, 16 - movs r0, 0xA0 - lsls r0, 16 - adds r1, r4, 0 - bl __udivsi3 - adds r5, r0, 0 - ldr r1, =0xffff0000 - adds r5, r1 - adds r0, r5, 0 - muls r0, r4 - adds r0, r6, r0 - str r0, [sp] - adds r0, r5, 0 - adds r1, r4, 0 - bl __udivsi3 - mov r10, r0 - lsls r5, 1 - movs r2, 0 - cmp r2, r7 - bcs _080C4A78 - ldr r3, =gScanlineEffectRegBuffers -_080C4A60: - lsls r0, r2, 16 - asrs r0, 16 - lsls r1, r0, 1 - adds r1, r3 - negs r2, r0 - strh r2, [r1] - adds r0, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - asrs r0, 16 - cmp r0, r7 - bcc _080C4A60 -_080C4A78: - lsls r1, r2, 16 - mov r3, r9 - lsls r0, r3, 16 - asrs r3, r0, 16 - ldr r4, =gUnknown_02039CE8 - mov r9, r4 - ldr r4, [sp] - lsrs r7, r4, 16 - cmp r1, r0 - bge _080C4AB0 - ldr r0, =gScanlineEffectRegBuffers - mov r12, r0 - adds r4, r3, 0 -_080C4A92: - lsrs r3, r6, 16 - adds r6, r5 - mov r2, r10 - subs r5, r2 - asrs r0, r1, 16 - lsls r1, r0, 1 - add r1, r12 - strh r3, [r1] - adds r0, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - lsls r1, r2, 16 - asrs r0, r1, 16 - cmp r0, r4 - blt _080C4A92 -_080C4AB0: - adds r3, r7, 0 - lsls r1, r2, 16 - asrs r0, r1, 16 - cmp r0, 0x9F - bgt _080C4ACE - ldr r2, =gScanlineEffectRegBuffers -_080C4ABC: - asrs r0, r1, 16 - lsls r1, r0, 1 - adds r1, r2 - strh r3, [r1] - adds r0, 0x1 - lsls r1, r0, 16 - asrs r0, r1, 16 - cmp r0, 0x9F - ble _080C4ABC -_080C4ACE: - mov r3, r9 - ldr r0, [r3] - movs r1, 0x1 - strb r1, [r0, 0x9] - mov r4, r8 - movs r1, 0xA - ldrsh r0, [r4, r1] - cmp r0, 0x4C - ble _080C4AE6 - ldrh r0, [r4, 0x8] - adds r0, 0x1 - strh r0, [r4, 0x8] -_080C4AE6: - movs r0, 0 - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C49D8 - - thumb_func_start sub_80C4B08 -sub_80C4B08: @ 80C4B08 - push {r4,r5,lr} - sub sp, 0x8 - adds r5, r0, 0 - ldr r4, =gUnknown_02039CE8 - ldr r1, [r4] - movs r0, 0 - strb r0, [r1, 0x9] - bl sub_8087598 - adds r2, r4, 0 - cmp r0, 0x1 - beq _080C4C08 -_080C4B20: - ldr r3, [r2] - ldrb r0, [r3, 0x4] - cmp r0, 0x4 - bhi _080C4BE4 - lsls r0, 2 - ldr r1, =_080C4B3C - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C4B3C: - .4byte _080C4B50 - .4byte _080C4B6C - .4byte _080C4B8C - .4byte _080C4BB0 - .4byte _080C4BCE -_080C4B50: - movs r0, 0x1 - movs r1, 0 - bl FillWindowPixelBuffer - movs r0, 0x20 - str r0, [sp] - str r0, [sp, 0x4] - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - b _080C4BF6 -_080C4B6C: - ldr r0, [r2] - ldrb r0, [r0, 0x8] - cmp r0, 0 - bne _080C4B80 - bl PrintStringsOnCardPage2 - lsls r0, 24 - cmp r0, 0 - bne _080C4BF6 - b _080C4C08 -_080C4B80: - bl PrintAllOnCardPage1 - lsls r0, 24 - cmp r0, 0 - bne _080C4BF6 - b _080C4C08 -_080C4B8C: - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - ldrb r0, [r1, 0x8] - cmp r0, 0 - bne _080C4BA8 - ldr r2, =0x00000a48 - adds r0, r1, r2 - bl sub_80C45C0 - b _080C4BF6 - .pool -_080C4BA8: - movs r0, 0x1 - bl sub_80C438C - b _080C4BF6 -_080C4BB0: - ldr r0, =gUnknown_02039CE8 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - cmp r0, 0 - bne _080C4BC4 - bl sub_80C474C - b _080C4BF6 - .pool -_080C4BC4: - movs r0, 0x2 - movs r1, 0 - bl FillWindowPixelBuffer - b _080C4BF6 -_080C4BCE: - ldr r0, =gUnknown_02039CE8 - ldr r0, [r0] - ldrb r0, [r0, 0x8] - cmp r0, 0 - beq _080C4BF6 - bl sub_80C4FF0 - b _080C4BF6 - .pool -_080C4BE4: - ldrh r0, [r5, 0x8] - adds r0, 0x1 - movs r1, 0 - strh r0, [r5, 0x8] - movs r0, 0x1 - strb r0, [r3, 0x9] - ldr r0, [r2] - strb r1, [r0, 0x4] - b _080C4C08 -_080C4BF6: - ldr r2, =gUnknown_02039CE8 - ldr r1, [r2] - ldrb r0, [r1, 0x4] - adds r0, 0x1 - strb r0, [r1, 0x4] - ldr r0, =gReceivedRemoteLinkPlayers - ldrb r0, [r0] - cmp r0, 0 - beq _080C4B20 -_080C4C08: - movs r0, 0 - add sp, 0x8 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C4B08 - - thumb_func_start sub_80C4C1C -sub_80C4C1C: @ 80C4C1C - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =gUnknown_02039CE8 - ldr r1, [r4] - movs r0, 0 - strb r0, [r1, 0x9] - ldr r0, [r4] - ldrb r0, [r0, 0x8] - cmp r0, 0 - beq _080C4C50 - movs r0, 0x2 - bl sub_80C438C - ldr r0, [r4] - ldr r1, =0x00000ef8 - adds r0, r1 - bl sub_80C4550 - ldr r0, [r4] - movs r1, 0xB3 - lsls r1, 3 - adds r0, r1 - bl sub_80C45C0 - bl sub_80C4630 -_080C4C50: - movs r0, 0x1 - bl sub_80C438C - ldr r2, [r4] - ldrb r0, [r2, 0x8] - movs r1, 0x1 - eors r0, r1 - strb r0, [r2, 0x8] - ldrh r0, [r5, 0x8] - adds r0, 0x1 - strh r0, [r5, 0x8] - ldr r1, [r4] - movs r0, 0x1 - strb r0, [r1, 0x9] - movs r0, 0xFA - bl PlaySE - movs r0, 0 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C4C1C - - thumb_func_start sub_80C4C84 -sub_80C4C84: @ 80C4C84 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x4 - mov r8, r0 - ldr r0, =gUnknown_02039CE8 - ldr r0, [r0] - movs r2, 0 - strb r2, [r0, 0x9] - mov r0, r8 - ldrh r1, [r0, 0xA] - movs r3, 0xA - ldrsh r0, [r0, r3] - cmp r0, 0x5 - bgt _080C4CB0 - mov r4, r8 - strh r2, [r4, 0xA] - b _080C4CB6 - .pool -_080C4CB0: - subs r0, r1, 0x5 - mov r1, r8 - strh r0, [r1, 0xA] -_080C4CB6: - ldr r0, =gUnknown_02039CE8 - ldr r0, [r0] - mov r2, r8 - ldrh r1, [r2, 0xA] - ldr r3, =0x00007ca8 - adds r0, r3 - strh r1, [r0] - ldrh r0, [r2, 0xA] - bl sub_80C32EC - mov r4, r8 - movs r0, 0xA - ldrsh r7, [r4, r0] - movs r0, 0xA0 - subs r0, r7 - mov r9, r0 - subs r4, r0, r7 - negs r0, r7 - lsls r6, r0, 16 - movs r0, 0xA0 - lsls r0, 16 - adds r1, r4, 0 - bl __udivsi3 - adds r5, r0, 0 - ldr r1, =0xffff0000 - adds r5, r1 - adds r0, r5, 0 - muls r0, r4 - adds r0, r6, r0 - str r0, [sp] - adds r0, r5, 0 - adds r1, r4, 0 - bl __udivsi3 - mov r10, r0 - lsrs r5, 1 - movs r2, 0 - cmp r2, r7 - bcs _080C4D20 - ldr r3, =gScanlineEffectRegBuffers -_080C4D08: - lsls r0, r2, 16 - asrs r0, 16 - lsls r1, r0, 1 - adds r1, r3 - negs r2, r0 - strh r2, [r1] - adds r0, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - asrs r0, 16 - cmp r0, r7 - bcc _080C4D08 -_080C4D20: - lsls r1, r2, 16 - mov r3, r9 - lsls r0, r3, 16 - asrs r3, r0, 16 - ldr r4, =gUnknown_02039CE8 - mov r9, r4 - ldr r4, [sp] - lsrs r7, r4, 16 - cmp r1, r0 - bge _080C4D56 - ldr r0, =gScanlineEffectRegBuffers - mov r12, r0 - adds r4, r3, 0 -_080C4D3A: - lsrs r3, r6, 16 - adds r6, r5 - add r5, r10 - asrs r0, r1, 16 - lsls r1, r0, 1 - add r1, r12 - strh r3, [r1] - adds r0, 0x1 - lsls r0, 16 - lsrs r2, r0, 16 - lsls r1, r2, 16 - asrs r0, r1, 16 - cmp r0, r4 - blt _080C4D3A -_080C4D56: - adds r3, r7, 0 - lsls r1, r2, 16 - asrs r0, r1, 16 - cmp r0, 0x9F - bgt _080C4D74 - ldr r2, =gScanlineEffectRegBuffers -_080C4D62: - asrs r0, r1, 16 - lsls r1, r0, 1 - adds r1, r2 - strh r3, [r1] - adds r0, 0x1 - lsls r1, r0, 16 - asrs r0, r1, 16 - cmp r0, 0x9F - ble _080C4D62 -_080C4D74: - mov r1, r9 - ldr r0, [r1] - movs r1, 0x1 - strb r1, [r0, 0x9] - mov r2, r8 - movs r3, 0xA - ldrsh r0, [r2, r3] - cmp r0, 0 - bgt _080C4D8C - ldrh r0, [r2, 0x8] - adds r0, 0x1 - strh r0, [r2, 0x8] -_080C4D8C: - movs r0, 0 - add sp, 0x4 - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C4C84 - - thumb_func_start sub_80C4DB0 -sub_80C4DB0: @ 80C4DB0 - push {lr} - movs r0, 0x1 - bl ShowBg - movs r0, 0x3 - bl ShowBg - movs r0, 0 - bl SetHBlankCallback - ldr r0, =sub_80C4960 - bl FindTaskIdByFunc - lsls r0, 24 - lsrs r0, 24 - bl DestroyTask - movs r0, 0 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C4DB0 - - thumb_func_start sub_80C4DDC -sub_80C4DDC: @ 80C4DDC - push {r4,r5,lr} - adds r5, r0, 0 - ldr r4, =gUnknown_02039CE8 - ldr r0, =0x00007cac - bl AllocZeroed - adds r1, r0, 0 - str r1, [r4] - movs r2, 0xA6 - lsls r2, 3 - adds r0, r1, r2 - str r5, [r0] - ldr r0, =sub_80C5868 - cmp r5, r0 - bne _080C4E18 - ldr r0, =0x0000052c - adds r1, r0 - ldr r0, =0x00007fff - b _080C4E1E - .pool -_080C4E18: - ldr r2, =0x0000052c - adds r1, r2 - movs r0, 0 -_080C4E1E: - strh r0, [r1] - bl InUnionRoom - adds r3, r0, 0 - cmp r3, 0x1 - bne _080C4E3C - ldr r1, =gUnknown_02039CE8 - ldr r0, [r1] - strb r3, [r0, 0x5] - adds r2, r1, 0 - b _080C4E44 - .pool -_080C4E3C: - ldr r2, =gUnknown_02039CE8 - ldr r1, [r2] - movs r0, 0 - strb r0, [r1, 0x5] -_080C4E44: - ldr r0, [r2] - ldr r1, =0x00007caa - adds r0, r1 - movs r1, 0x2 - strb r1, [r0] - ldr r0, [r2] - ldr r2, =0x00000534 - adds r0, r2 - bl sub_80C3020 - ldr r0, =sub_80C2C80 - bl SetMainCallback2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C4DDC - - thumb_func_start TrainerCard_ShowLinkCard -TrainerCard_ShowLinkCard: @ 80C4E74 - push {r4-r6,lr} - adds r4, r0, 0 - adds r6, r1, 0 - lsls r4, 24 - lsrs r4, 24 - ldr r5, =gUnknown_02039CE8 - ldr r0, =0x00007cac - bl AllocZeroed - str r0, [r5] - movs r2, 0xA6 - lsls r2, 3 - adds r1, r0, r2 - str r6, [r1] - movs r1, 0x1 - strb r1, [r0, 0x5] - ldr r0, [r5] - ldr r1, =0x00000534 - adds r0, r1 - ldr r2, =gTrainerCards - movs r1, 0x64 - muls r1, r4 - adds r1, r2 - movs r2, 0x64 - bl memcpy - ldr r1, [r5] - ldr r2, =gLinkPlayers - lsls r0, r4, 3 - subs r0, r4 - lsls r0, 2 - adds r0, r2 - ldrh r0, [r0, 0x1A] - ldr r2, =0x00007caa - adds r1, r2 - strb r0, [r1] - ldr r0, =sub_80C2C80 - bl SetMainCallback2 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end TrainerCard_ShowLinkCard - - thumb_func_start sub_80C4EE4 -sub_80C4EE4: @ 80C4EE4 - push {r4,r5,lr} - ldr r4, =gUnknown_02039CE8 - ldr r0, [r4] - movs r1, 0 - strb r1, [r0] - ldr r2, [r4] - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldrb r0, [r0, 0x12] - strb r0, [r2, 0x6] - ldr r0, [r4] - strb r1, [r0, 0x7] - ldr r0, [r4] - strb r1, [r0, 0x8] - ldr r0, [r4] - movs r2, 0xA5 - lsls r2, 3 - adds r0, r2 - strb r1, [r0] - bl sub_80C4F50 - ldr r1, [r4] - ldr r3, =0x0000052a - adds r1, r3 - strb r0, [r1] - movs r5, 0 -_080C4F18: - movs r0, 0xD - muls r0, r5 - adds r0, 0x19 - ldr r1, [r4] - adds r0, r1, r0 - lsls r2, r5, 1 - ldr r3, =0x0000055c - adds r1, r3 - adds r1, r2 - ldrh r1, [r1] - bl CopyEasyChatWord - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3 - bls _080C4F18 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C4EE4 - - thumb_func_start sub_80C4F50 -sub_80C4F50: @ 80C4F50 - push {lr} - ldr r0, =gUnknown_02039CE8 - ldr r1, [r0] - cmp r1, 0 - bne _080C4F7C - ldr r0, =gGameVersion - ldrb r1, [r0] - subs r0, r1, 0x4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _080C4F74 - movs r0, 0 - b _080C4FC2 - .pool -_080C4F74: - cmp r1, 0x3 - beq _080C4FC0 - movs r0, 0x1 - b _080C4FC2 -_080C4F7C: - ldr r2, =0x0000056c - adds r0, r1, r2 - ldrb r2, [r0] - subs r0, r2, 0x4 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - bhi _080C4FA0 - ldr r0, =0x0000052b - adds r1, r0 - movs r0, 0 - strb r0, [r1] - b _080C4FC2 - .pool -_080C4FA0: - lsls r0, r2, 24 - lsrs r0, 24 - cmp r0, 0x3 - beq _080C4FB8 - ldr r2, =0x0000052b - adds r1, r2 - movs r0, 0x1 - strb r0, [r1] - b _080C4FC2 - .pool -_080C4FB8: - ldr r0, =0x0000052b - adds r1, r0 - movs r0, 0x1 - strb r0, [r1] -_080C4FC0: - movs r0, 0x2 -_080C4FC2: - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C4F50 - - thumb_func_start sub_80C4FCC -sub_80C4FCC: @ 80C4FCC - push {lr} - lsls r0, 24 - lsrs r1, r0, 24 - movs r2, 0xFC - lsls r2, 24 - adds r0, r2 - lsrs r0, 24 - cmp r0, 0x1 - bhi _080C4FE2 - movs r0, 0 - b _080C4FEC -_080C4FE2: - cmp r1, 0x3 - beq _080C4FEA - movs r0, 0x1 - b _080C4FEC -_080C4FEA: - movs r0, 0x2 -_080C4FEC: - pop {r1} - bx r1 - thumb_func_end sub_80C4FCC - - thumb_func_start sub_80C4FF0 -sub_80C4FF0: @ 80C4FF0 - push {r4-r6,lr} - sub sp, 0x8 - bl InUnionRoom - cmp r0, 0x1 - bne _080C5060 - ldr r0, =gReceivedRemoteLinkPlayers - ldrb r0, [r0] - cmp r0, 0x1 - bne _080C5060 - ldr r5, =gUnknown_02039CE8 - ldr r0, [r5] - ldr r1, =0x00000583 - adds r0, r1 - ldrb r0, [r0] - bl FacilityClassToPicIndex - lsls r0, 16 - lsrs r0, 16 - ldr r4, =gUnknown_0856FB18 - ldr r1, [r5] - ldr r3, =0x00000534 - adds r2, r1, r3 - ldrb r3, [r2] - lsls r3, 1 - ldr r2, =0x0000052b - adds r1, r2 - ldrb r1, [r1] - lsls r1, 2 - adds r3, r1 - adds r1, r3, r4 - ldrb r2, [r1] - adds r4, 0x1 - adds r3, r4 - ldrb r3, [r3] - movs r1, 0x8 - str r1, [sp] - movs r1, 0x2 - str r1, [sp, 0x4] - movs r1, 0x1 - bl sub_818D938 - b _080C50AE - .pool -_080C5060: - ldr r2, =gUnknown_0856FB20 - ldr r6, =gUnknown_02039CE8 - ldr r0, [r6] - ldr r5, =0x00000534 - adds r1, r0, r5 - ldr r3, =0x0000052a - adds r0, r3 - ldrb r0, [r0] - lsls r0, 1 - ldrb r1, [r1] - adds r0, r1 - adds r0, r2 - ldrb r0, [r0] - bl FacilityClassToPicIndex - lsls r0, 16 - lsrs r0, 16 - ldr r4, =gUnknown_0856FB18 - ldr r1, [r6] - adds r5, r1, r5 - ldrb r3, [r5] - lsls r3, 1 - ldr r2, =0x0000052b - adds r1, r2 - ldrb r1, [r1] - lsls r1, 2 - adds r3, r1 - adds r1, r3, r4 - ldrb r2, [r1] - adds r4, 0x1 - adds r3, r4 - ldrb r3, [r3] - movs r1, 0x8 - str r1, [sp] - movs r1, 0x2 - str r1, [sp, 0x4] - movs r1, 0x1 - bl sub_818D938 -_080C50AE: - add sp, 0x8 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C4FF0 - - thumb_func_start sub_80C50D0 -sub_80C50D0: @ 80C50D0 - push {lr} - sub sp, 0x8 - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0xE - movs r1, 0 - bl SetGpuReg - movs r0, 0xC - movs r1, 0 - bl SetGpuReg - movs r0, 0xA - movs r1, 0 - bl SetGpuReg - movs r0, 0x8 - movs r1, 0 - bl SetGpuReg - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgX - movs r0, 0x3 - movs r1, 0 - movs r2, 0 - bl ChangeBgY - movs r0, 0x50 - movs r1, 0 - bl SetGpuReg - movs r0, 0x54 - movs r1, 0 - bl SetGpuReg - movs r0, 0x52 - movs r1, 0 - bl SetGpuReg - movs r0, 0x40 - movs r1, 0 - bl SetGpuReg - movs r0, 0x44 - movs r1, 0 - bl SetGpuReg - movs r0, 0x42 - movs r1, 0 - bl SetGpuReg - movs r0, 0x46 - movs r1, 0 - bl SetGpuReg - movs r0, 0x48 - movs r1, 0 - bl SetGpuReg - movs r0, 0x4A - movs r1, 0 - bl SetGpuReg - mov r1, sp - movs r0, 0 - strh r0, [r1] - movs r1, 0xC0 - lsls r1, 19 - ldr r2, =0x0100c000 - mov r0, sp - bl CpuSet - movs r0, 0 - str r0, [sp, 0x4] - add r0, sp, 0x4 - movs r1, 0xE0 - lsls r1, 19 - ldr r2, =0x05000100 - bl CpuSet - add sp, 0x8 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C50D0 thumb_func_start sub_80C51C4 sub_80C51C4: @ 80C51C4 @@ -1023,7 +98,7 @@ _080C5240: negs r0, r0 ands r0, r1 strb r0, [r2, 0xE] - bl sub_80C2E40 + bl CountPlayerTrainerStars ldr r3, [r5] lsls r0, 4 ldrb r2, [r3, 0xE] @@ -1837,7 +912,7 @@ _080C5970: .pool _080C5994: ldr r0, =sub_80C5868 - bl sub_80C4DDC + bl ShowPlayerTrainerCard _080C599A: pop {r0} bx r0 diff --git a/data/event_scripts.s b/data/event_scripts.s index d52f4f1ba..031e82c00 100644 --- a/data/event_scripts.s +++ b/data/event_scripts.s @@ -1262,7 +1262,7 @@ VerdanturfTown_PokemonCenter_1F_EventScript_27191E:: @ 827191E lock faceplayer setvar VAR_0x8004, 0 - specialvar VAR_RESULT, sub_80C2E40 + specialvar VAR_RESULT, CountPlayerTrainerStars compare VAR_RESULT, 4 goto_if_eq OldaleTown_PokemonCenter_1F_EventScript_271A68 msgbox gUnknown_082726EB, MSGBOX_YESNO diff --git a/data/trainer_card.s b/data/frontier_pass.s similarity index 61% rename from data/trainer_card.s rename to data/frontier_pass.s index f57973200..411c5c69d 100644 --- a/data/trainer_card.s +++ b/data/frontier_pass.s @@ -12,179 +12,6 @@ .2byte \short4 .endm - .align 2 -gUnknown_0856F018:: @ 856F018 - .incbin "graphics/trainer_card/stickers_fr.4bpp.lz" - - .align 2 -gUnknown_0856F18C:: @ 856F18C - .incbin "graphics/trainer_card/unknown_56F18C.gbapal" - - .align 2 -gEmeraldTrainerCard1Star_Pal:: @ 856F1AC - .incbin "graphics/trainer_card/one_star.gbapal" - - .align 2 -gFireRedTrainerCard1Star_Pal:: @ 856F20C - .incbin "graphics/trainer_card/one_star_fr.gbapal" - - .align 2 -gEmeraldTrainerCard2Star_Pal:: @ 856F26C - .incbin "graphics/trainer_card/two_stars.gbapal" - - .align 2 -gFireRedTrainerCard2Star_Pal:: @ 856F2CC - .incbin "graphics/trainer_card/two_stars_fr.gbapal" - - .align 2 -gEmeraldTrainerCard3Star_Pal:: @ 856F32C - .incbin "graphics/trainer_card/three_stars.gbapal" - - .align 2 -gFireRedTrainerCard3Star_Pal:: @ 856F38C - .incbin "graphics/trainer_card/three_stars_fr.gbapal" - - .align 2 -gEmeraldTrainerCard4Star_Pal:: @ 856F3EC - .incbin "graphics/trainer_card/four_stars.gbapal" - - .align 2 -gFireRedTrainerCard4Star_Pal:: @ 856F44C - .incbin "graphics/trainer_card/four_stars_fr.gbapal" - - .align 2 -gUnknown_0856F4AC:: @ 856F4AC - .incbin "graphics/trainer_card/female_bg.gbapal" - - .align 2 -gUnknown_0856F4CC:: @ 856F4CC - .incbin "graphics/trainer_card/female_bg_fr.gbapal" - - .align 2 -gUnknown_0856F4EC:: @ 856F4EC - .incbin "graphics/trainer_card/badges.gbapal" - - .align 2 -gUnknown_0856F50C:: @ 856F50C - .incbin "graphics/trainer_card/badges_fr.gbapal" - - .align 2 -gUnknown_0856F52C:: @ 856F52C - .incbin "graphics/trainer_card/gold.gbapal" - - .align 2 -gUnknown_0856F54C:: @ 856F54C - .incbin "graphics/trainer_card/stickers_fr1.gbapal" - - .align 2 -gUnknown_0856F56C:: @ 856F56C - .incbin "graphics/trainer_card/stickers_fr2.gbapal" - - .align 2 -gUnknown_0856F58C:: @ 856F58C - .incbin "graphics/trainer_card/stickers_fr3.gbapal" - - .align 2 -gUnknown_0856F5AC:: @ 856F5AC - .incbin "graphics/trainer_card/stickers_fr4.gbapal" - - .align 2 -gUnknown_0856F5CC:: @ 856F5CC - .incbin "graphics/trainer_card/badges.4bpp.lz" - - .align 2 -gUnknown_0856F814:: @ 856F814 - .incbin "graphics/trainer_card/badges_fr.4bpp.lz" - - .align 2 -gUnknown_0856FAB4:: @ 856FAB4 - .4byte 0x000025b0, 0x000001d9, 0x000031e2, 0x003011f3 - - .align 2 -gUnknown_0856FAC4:: @ 856FAC4 - window_template 0x01, 0x02, 0x0f, 0x1b, 0x04, 0x0f, 0x0253 - window_template 0x01, 0x01, 0x01, 0x1c, 0x12, 0x0f, 0x0001 - window_template 0x03, 0x13, 0x05, 0x09, 0x0a, 0x08, 0x0150 - null_window_template - - .align 2 -gEmeraldTrainerCardStarPals:: @ 856FAE4 - .4byte gEmeraldTrainerCard0Star_Pal - .4byte gEmeraldTrainerCard1Star_Pal - .4byte gEmeraldTrainerCard2Star_Pal - .4byte gEmeraldTrainerCard3Star_Pal - .4byte gEmeraldTrainerCard4Star_Pal - - .align 2 -gFireRedTrainerCardStarPals:: @ 856FAF8 - .4byte gFireRedTrainerCard0Star_Pal - .4byte gFireRedTrainerCard1Star_Pal - .4byte gFireRedTrainerCard2Star_Pal - .4byte gFireRedTrainerCard3Star_Pal - .4byte gFireRedTrainerCard4Star_Pal - -gUnknown_0856FB0C:: @ 856FB0C - .byte 0x00, 0x02, 0x03 - -gUnknown_0856FB0F:: @ 856FB0F - .byte 0x00, 0x04, 0x05 - -gUnknown_0856FB12:: @ 856FB12 - .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - -gUnknown_0856FB18:: @ 856FB18 - .byte 0x0d, 0x04, 0x0d, 0x04, 0x01, 0x00, 0x01, 0x00 - -gUnknown_0856FB20:: @ 856FB20 - .byte 0x4e, 0x4f, 0x50, 0x51, 0x3c, 0x3f - - .align 2 -gUnknown_0856FB28:: @ 856FB28 - .4byte sub_80C4998 - .4byte sub_80C49D8 - .4byte sub_80C4B08 - .4byte sub_80C4C1C - .4byte sub_80C4C84 - .4byte sub_80C4DB0 - - .align 2 -gUnknown_0856FB40:: @ 856FB40 - .4byte gUnknown_0856FB0C - .4byte gUnknown_0856FB12 - -gUnknown_0856FB48:: @ 856FB48 - .byte 0x71, 0x68 - -gUnknown_0856FB4A:: @ 856FB4A - .byte 0x81, 0x78 - -gUnknown_0856FB4C:: @ 856FB4C - .byte 0xfd, 0x02, 0xf0, 0xfd, 0x03, 0xf0, 0xfd, 0x04, 0xff - -gUnknown_0856FB55:: @ 856FB55 - .byte 0x08, 0x10 - -gUnknown_0856FB57:: @ 856FB57 - .byte 0xd8, 0xd8 - - .align 2 -gUnknown_0856FB5C:: @ 856FB5C - .4byte gText_LinkBattles - .4byte gText_LinkCableBattles - .4byte gText_LinkBattles - -gUnknown_0856FB68:: @ 856FB68 - .byte 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a - -gUnknown_0856FB6E:: @ 856FB6E - .byte 0x00, 0x04, 0x08, 0x0c, 0x10, 0x14 - -gUnknown_0856FB74:: @ 856FB74 - .byte 0x0b, 0x0c, 0x0d, 0x0e - -gUnknown_0856FB78:: @ 856FB78 - .byte 0x07, 0x07 - .align 2 gUnknown_0856FB7C:: @ 856FB7C .incbin "graphics/frontier_pass/map_heads.gbapal" diff --git a/data/specials.inc b/data/specials.inc index 83e56106f..b3ca15ed1 100644 --- a/data/specials.inc +++ b/data/specials.inc @@ -481,7 +481,7 @@ gSpecials:: @ 81DBA64 def_special sub_813B7D8 def_special sub_81C72A4 def_special sp106_CreateStartMenu - def_special sub_80C2E40 + def_special CountPlayerTrainerStars def_special sub_813AC7C def_special sub_813ADB8 def_special sub_813ADD4 diff --git a/include/graphics.h b/include/graphics.h index 29719d1a0..77390db90 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -4846,4 +4846,18 @@ extern const u16 gUnknown_08DC64E8[]; extern const u16 gUnknown_08DC64FC[]; extern const u16 gUnknown_08DC6510[]; +// Trainer Card. +extern const u16 gEmeraldTrainerCard0Star_Pal[]; +extern const u32 gEmeraldTrainerCard_Gfx[]; +extern const u16 gFireRedTrainerCard0Star_Pal[]; +extern const u32 gFireRedTrainerCard_Gfx[]; +extern const u32 gUnknown_08DD2AE0[]; +extern const u32 gUnknown_08DD21B0[]; +extern const u32 gUnknown_08DD2D30[]; +extern const u32 gUnknown_08DD2010[]; +extern const u32 gUnknown_08DD2B78[]; +extern const u32 gUnknown_08DD228C[]; +extern const u32 gUnknown_08DD2E5C[]; +extern const u32 gUnknown_08DD1F78[]; + #endif //GUARD_GRAPHICS_H diff --git a/include/palette.h b/include/palette.h index 540452f3d..f51dc4b88 100644 --- a/include/palette.h +++ b/include/palette.h @@ -66,5 +66,9 @@ void BeginHardwarePaletteFade(u8, u8, u8, u8, u8); void BlendPalettes(u32, u8, u16); void BlendPalettesUnfaded(u32, u8, u16); void sub_80A2C44(u32 a1, s8 a2, u8 a3, u8 a4, u16 a5, u8 a6, u8 a7); +void TintPalette_GrayScale(u16 *palette, u16 count); +void TintPalette_GrayScale2(u16 *palette, u16 count); +void TintPalette_SepiaTone(u16 *palette, u16 count); +void TintPalette_CustomTone(u16 *palette, u16 count, u16 rTone, u16 gTone, u16 bTone); #endif // GUARD_PALETTE_H diff --git a/include/strings.h b/include/strings.h index ff0d08195..4e9c91ff5 100644 --- a/include/strings.h +++ b/include/strings.h @@ -2222,4 +2222,30 @@ extern const u8 gText_PreliminaryResults[]; extern const u8 gText_Round2Results[]; extern const u8 gText_Var1sVar2Won[]; +// Trainer Card +extern const u8 gText_LinkCableBattles[]; +extern const u8 gText_LinkBattles[]; +extern const u8 gText_WaitingTrainerFinishReading[]; +extern const u8 gText_TrainerCardName[]; +extern const u8 gText_TrainerCardIDNo[]; +extern const u8 gText_TrainerCardMoney[]; +extern const u8 gText_PokedollarVar1[]; +extern const u8 gText_EmptyString6[]; +extern const u8 gText_TrainerCardPokedex[]; +extern const u8 gText_TrainerCardTime[]; +extern const u8 gText_Colon2[]; +extern const u8 gText_Var1sTrainerCard[]; +extern const u8 gText_HallOfFameDebut[]; +extern const u8 gText_WinsLosses[]; +extern const u8 gText_PokemonTrades[]; +extern const u8 gText_BerryCrush[]; +extern const u8 gText_UnionTradesAndBattles[]; +extern const u8 gText_Var1DarkGreyShadowLightGrey[]; +extern const u8 gText_PokeblocksWithFriends[]; +extern const u8 gText_WonContestsWFriends[]; +extern const u8 gText_WSlashStraightSlash[]; +extern const u8 gText_Var1DarkLightGreyBP[]; +extern const u8 gText_BattleTower[]; +extern const u8 gText_BattlePtsWon[]; + #endif //GUARD_STRINGS_H diff --git a/include/trainer_card.h b/include/trainer_card.h index df516510e..a5b217413 100644 --- a/include/trainer_card.h +++ b/include/trainer_card.h @@ -8,7 +8,6 @@ struct TrainerCard /*0x02*/ bool8 hasPokedex; /*0x03*/ bool8 caughtAllHoenn; /*0x04*/ bool8 hasAllPaintings; - /*0x05*/ u8 var_5; /*0x06*/ u16 hofDebutHours; /*0x08*/ u16 hofDebutMinutes; /*0x0A*/ u16 hofDebutSeconds; @@ -19,36 +18,35 @@ struct TrainerCard /*0x14*/ u16 linkBattleWins; /*0x16*/ u16 linkBattleLosses; /*0x18*/ u16 battleTowerWins; - /*0x1A*/ u16 battleTowerLosses; // wrong name + /*0x1A*/ u16 battleTowerStraightWins; /*0x1C*/ u16 contestsWithFriends; /*0x1E*/ u16 pokeblocksWithFriends; /*0x20*/ u16 pokemonTrades; - /*0x22*/ u16 var_22; /*0x24*/ u32 money; /*0x28*/ u16 var_28[4]; /*0x30*/ u8 playerName[PLAYER_NAME_LENGTH + 1]; - /*0x38*/ u8 var_38; - /*0x39*/ u8 var_39; + /*0x38*/ u8 version; /*0x3A*/ u16 var_3A; - /*0x3C*/ u32 var_3C; - /*0x40*/ u32 var_40; + /*0x3C*/ u32 berruCrushPoints; + /*0x40*/ u32 unionRoomNum; /*0x44*/ u8 filler44[0x8]; /*0x4C*/ u8 var_4C; /*0x4D*/ u8 var_4D; /*0x4E*/ u8 var_4E; /*0x4F*/ u8 var_4F; /*0x50*/ u8 var_50[0x4]; - /*0x54*/ u16 monSpecies[6]; - /*0x60*/ u16 var_60; - /*0x62*/ u16 var_62; + /*0x54*/ u16 monSpecies[PARTY_SIZE]; + /*0x60*/ bool16 hasAllSymbols; + /*0x62*/ u16 frontierBP; }; extern struct TrainerCard gTrainerCards[4]; -void sub_80C3120(struct TrainerCard *arg0, u16 *src, u8 gameVersion); -void TrainerCard_ShowLinkCard(u8 arg0, void (*callback)(void)); +u32 CountPlayerTrainerStars(void); +u8 sub_80C4904(u8 cardId); +void CopyTrainerCardData(struct TrainerCard *dst, u16 *src, u8 gameVersion); +void ShowPlayerTrainerCard(void (*callback)(void)); +void ShowTrainerCardInLink(u8 arg0, void (*callback)(void)); void TrainerCard_GenerateCardForPlayer(struct TrainerCard *); -u8 sub_80C4904(u8); -void sub_80C6D80(const u8 *, u8 *, u8, u8, u8); #endif // GUARD_TRAINER_CARD_H diff --git a/ld_script.txt b/ld_script.txt index 29ee5e192..e199c8fe5 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -125,7 +125,8 @@ SECTIONS { src/option_menu.o(.text); src/pokedex.o(.text); src/trainer_card.o(.text); - asm/trainer_card.o(.text); + src/frontier_pass.o(.text); + asm/frontier_pass.o(.text); src/pokemon_storage_system.o(.text); src/pokemon_icon.o(.text); src/script_movement.o(.text); @@ -458,7 +459,8 @@ SECTIONS { src/field_effect.o(.rodata); src/option_menu.o(.rodata); src/pokedex.o(.rodata); - data/trainer_card.o(.rodata); + src/trainer_card.o(.rodata); + data/frontier_pass.o(.rodata); src/pokemon_storage_system.o(.rodata); src/pokemon_icon.o(.rodata); src/fldeff_cut.o(.rodata); diff --git a/src/cable_club.c b/src/cable_club.c index 784426d53..ce9b9db05 100644 --- a/src/cable_club.c +++ b/src/cable_club.c @@ -498,7 +498,7 @@ static void sub_80B2C30(u8 taskId) for (index = 0; index < GetLinkPlayerCount(); index++) { - sub_80C3120(&gTrainerCards[index], gBlockRecvBuffer[index], gLinkPlayers[index].version); + CopyTrainerCardData(&gTrainerCards[index], gBlockRecvBuffer[index], gLinkPlayers[index].version); } SetSuppressLinkErrorMessage(FALSE); @@ -1176,7 +1176,7 @@ static void sub_80B39A4(void) void sp02A_crash_sound(void) { - TrainerCard_ShowLinkCard(gSpecialVar_0x8006, CB2_ReturnToFieldContinueScriptPlayMapMusic); + ShowTrainerCardInLink(gSpecialVar_0x8006, CB2_ReturnToFieldContinueScriptPlayMapMusic); } bool32 sub_80B39D4(u8 linkPlayerIndex) diff --git a/src/frontier_pass.c b/src/frontier_pass.c new file mode 100644 index 000000000..4473dfae0 --- /dev/null +++ b/src/frontier_pass.c @@ -0,0 +1,31 @@ +#include "global.h" +#include "gpu_regs.h" +#include "bg.h" + +void sub_80C50D0(void) +{ + SetGpuReg(REG_OFFSET_DISPCNT, 0); + SetGpuReg(REG_OFFSET_BG3CNT, 0); + SetGpuReg(REG_OFFSET_BG2CNT, 0); + SetGpuReg(REG_OFFSET_BG1CNT, 0); + SetGpuReg(REG_OFFSET_BG0CNT, 0); + ChangeBgX(0, 0, 0); + ChangeBgY(0, 0, 0); + ChangeBgX(1, 0, 0); + ChangeBgY(1, 0, 0); + ChangeBgX(2, 0, 0); + ChangeBgY(2, 0, 0); + ChangeBgX(3, 0, 0); + ChangeBgY(3, 0, 0); + SetGpuReg(REG_OFFSET_BLDCNT, 0); + SetGpuReg(REG_OFFSET_BLDY, 0); + SetGpuReg(REG_OFFSET_BLDALPHA, 0); + SetGpuReg(REG_OFFSET_WIN0H, 0); + SetGpuReg(REG_OFFSET_WIN0V, 0); + SetGpuReg(REG_OFFSET_WIN1H, 0); + SetGpuReg(REG_OFFSET_WIN1V, 0); + SetGpuReg(REG_OFFSET_WININ, 0); + SetGpuReg(REG_OFFSET_WINOUT, 0); + CpuFill16(0, (void *)VRAM, VRAM_SIZE); + CpuFill32(0, (void *)OAM, OAM_SIZE); +} diff --git a/src/rom_8011DC0.c b/src/rom_8011DC0.c index 813d143d2..41f7eeee7 100644 --- a/src/rom_8011DC0.c +++ b/src/rom_8011DC0.c @@ -1577,7 +1577,7 @@ void sub_80140E0(u8 taskId) for (i = 0; i < GetLinkPlayerCount(); i++) { recvBuff = gBlockRecvBuffer[i]; - sub_80C3120(&gTrainerCards[i], recvBuff, gLinkPlayers[i].version); + CopyTrainerCardData(&gTrainerCards[i], recvBuff, gLinkPlayers[i].version); } if (GetLinkPlayerCount() == 2) @@ -1607,7 +1607,7 @@ void sub_80141A4(void) break; case 1: if (!FuncIsActiveTask(sub_80140E0)) - TrainerCard_ShowLinkCard(GetMultiplayerId() ^ 1, CB2_ReturnToField); + ShowTrainerCardInLink(GetMultiplayerId() ^ 1, CB2_ReturnToField); break; } diff --git a/src/start_menu.c b/src/start_menu.c index 34d37e995..6b4b0e775 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -9,6 +9,7 @@ #include "strings.h" #include "bg.h" #include "field_effect.h" +#include "party_menu.h" #include "task.h" #include "overworld.h" #include "link.h" @@ -30,6 +31,7 @@ #include "scanline_effect.h" #include "text_window.h" #include "load_save.h" +#include "trainer_card.h" #include "international_string_util.h" #include "constants/songs.h" #include "field_player_avatar.h" @@ -89,11 +91,9 @@ extern void var_800D_set_xB(void); extern void sub_808B864(void); extern void CB2_Pokedex(void); extern void PlayRainSoundEffect(void); -extern void CB2_PartyMenuFromStartMenu(void); extern void CB2_PokeNav(void); -extern void sub_80C4DDC(void (*)(void)); +extern void ShowPlayerTrainerCard(void (*)(void)); extern void sub_80C51C4(void (*)(void)); -extern void TrainerCard_ShowLinkCard(u8, void (*)(void)); extern void ScriptUnfreezeEventObjects(void); extern void sub_81A9EC8(void); extern void save_serialize_map(void); @@ -468,21 +468,14 @@ static bool32 InitStartMenuStep(void) break; case 3: if (GetSafariZoneFlag()) - { ShowSafariBallsWindow(); - } if (InBattlePyramid()) - { ShowPyramidFloorWindow(); - } sUnknown_02037619[0]++; break; case 4: - if (!PrintStartMenuActions(&sUnknown_02037619[1], 2)) - { - break; - } - sUnknown_02037619[0]++; + if (PrintStartMenuActions(&sUnknown_02037619[1], 2)) + sUnknown_02037619[0]++; break; case 5: sStartMenuCursorPos = sub_81983AC(GetStartMenuWindowId(), 1, 0, 9, 16, sNumStartMenuActions, sStartMenuCursorPos); @@ -497,15 +490,14 @@ static void InitStartMenu(void) { sUnknown_02037619[0] = 0; sUnknown_02037619[1] = 0; - while (!InitStartMenuStep()); + while (!InitStartMenuStep()) + ; } static void StartMenuTask(u8 taskId) { if (InitStartMenuStep() == TRUE) - { SwitchTaskToFollowupFunc(taskId); - } } static void CreateStartMenuTask(TaskFunc followupFunc) @@ -544,18 +536,14 @@ void sub_809FA34(u8 taskId) // Referenced in field_screen.s and rom_8011DC0.s { case 0: if (InUnionRoom() == TRUE) - { var_800D_set_xB(); - } gMenuCallback = HandleStartMenuInput; task->data[0]++; break; case 1: if (gMenuCallback() == TRUE) - { DestroyTask(taskId); - } break; } } @@ -591,9 +579,8 @@ static bool8 HandleStartMenuInput(void) PlaySE(SE_SELECT); if (sStartMenuItems[sCurrentStartMenuActions[sStartMenuCursorPos]].func.u8_void == StartMenuPokedexCallback) { - if (GetNationalPokedexCount(0) == 0) { + if (GetNationalPokedexCount(0) == 0) return FALSE; - } } gMenuCallback = sStartMenuItems[sCurrentStartMenuActions[sStartMenuCursorPos]].func.u8_void; @@ -689,17 +676,11 @@ static bool8 StartMenuPlayerNameCallback(void) CleanupOverworldWindowsAndTilemaps(); if (is_c1_link_related_active() || InUnionRoom()) - { - sub_80C4DDC(CB2_ReturnToFieldWithOpenMenu); // Display trainer card - } + ShowPlayerTrainerCard(CB2_ReturnToFieldWithOpenMenu); // Display trainer card else if (FlagGet(FLAG_SYS_FRONTIER_PASS)) - { sub_80C51C4(CB2_ReturnToFieldWithOpenMenu); // Display frontier pass - } else - { - sub_80C4DDC(CB2_ReturnToFieldWithOpenMenu); // Display trainer card - } + ShowPlayerTrainerCard(CB2_ReturnToFieldWithOpenMenu); // Display trainer card return TRUE; } @@ -710,9 +691,7 @@ static bool8 StartMenuPlayerNameCallback(void) static bool8 StartMenuSaveCallback(void) { if (InBattlePyramid()) - { RemoveExtraStartMenuWindows(); - } gMenuCallback = SaveStartCallback; // Display save menu @@ -758,7 +737,7 @@ static bool8 StartMenuLinkModePlayerNameCallback(void) { PlayRainSoundEffect(); CleanupOverworldWindowsAndTilemaps(); - TrainerCard_ShowLinkCard(gUnknown_03005DB4, CB2_ReturnToFieldWithOpenMenu); + ShowTrainerCardInLink(gUnknown_03005DB4, CB2_ReturnToFieldWithOpenMenu); return TRUE; } diff --git a/src/trainer_card.c b/src/trainer_card.c index 26a78ca08..816d3bf25 100755 --- a/src/trainer_card.c +++ b/src/trainer_card.c @@ -8,15 +8,13 @@ #include "link.h" #include "bg.h" #include "sound.h" -#include "constants/songs.h" #include "overworld.h" #include "menu.h" #include "text.h" -#include "constants/flags.h" #include "event_data.h" -#include "constants/game_stat.h" -#include "constants/battle_frontier.h" +#include "easy_chat.h" #include "money.h" +#include "strings.h" #include "string_util.h" #include "trainer_card.h" #include "gpu_regs.h" @@ -24,174 +22,41 @@ #include "pokedex.h" #include "graphics.h" #include "pokemon_icon.h" +#include "trainer_pokemon_sprites.h" #include "script_pokemon_util_80F87D8.h" +#include "constants/songs.h" +#include "constants/flags.h" +#include "constants/game_stat.h" +#include "constants/battle_frontier.h" -//external functions -extern u8 sub_80D30A0(u16); -extern void TintPalette_CustomTone(u16 *palette, u16 count, u16 rTone, u16 gTone, u16 bTone); -extern void TintPalette_SepiaTone(u16 *palette, u16 count); +enum +{ + CARD_TYPE_FR, + CARD_TYPE_RUBY, + CARD_TYPE_EMERALD, +}; -//gfx -extern const u32 gUnknown_08DD2AE0[]; -extern const u32 gUnknown_08DD21B0[]; -extern const u32 gUnknown_08DD2D30[]; -extern const u32 gUnknown_08DD2010[]; -extern const u32 gUnknown_08DD2B78[]; -extern const u32 gUnknown_08DD228C[]; -extern const u32 gUnknown_08DD2E5C[]; -extern const u32 gUnknown_0856F5CC[]; -extern const u32 gUnknown_0856F814[]; -extern const u32 gEmeraldTrainerCard_Gfx[]; -extern const u32 gFireRedTrainerCard_Gfx[]; -extern const u32 gUnknown_0856F018[]; -extern const u32 gUnknown_08DD1F78[]; - -//strings -extern const u8 gText_WaitingTrainerFinishReading[]; -extern const u8 gText_TrainerCardName[]; -extern const u8 gText_TrainerCardIDNo[]; -extern const u8 gText_TrainerCardMoney[]; -extern const u8 gText_PokedollarVar1[]; -extern const u8 gText_EmptyString6[]; -extern const u8 gText_TrainerCardPokedex[]; -extern const u8 gText_TrainerCardTime[]; -extern const u8 gText_Colon2[]; -extern const u8 gText_Var1sTrainerCard[]; -extern const u8 gText_HallOfFameDebut[]; -extern const u8 gText_WinsLosses[]; -extern const u8 gText_PokemonTrades[]; -extern const u8 gText_BerryCrush[]; -extern const u8 gText_UnionTradesAndBattles[]; -extern const u8 gText_Var1DarkGreyShadowLightGrey[]; -extern const u8 gText_PokeblocksWithFriends[]; -extern const u8 gText_WonContestsWFriends[]; -extern const u8 gText_WSlashStraightSlash[]; -extern const u8 gText_Var1DarkLightGreyBP[]; -extern const u8 gText_BattleTower[]; -extern const u8 gText_BattlePtsWon[]; - -//const rom data to be moved from data/trainer_card.s to this file -extern const struct BgTemplate gUnknown_0856FAB4[4]; -extern const struct WindowTemplate gUnknown_0856FAC4[]; -extern const u8 gUnknown_0856FB0C[]; -extern const u8* gUnknown_0856FB40[]; -extern const u8 gUnknown_0856FB48[]; -extern const u8 gUnknown_0856FB4A[]; -extern const u8 gUnknown_0856FB4C[]; -extern const u8 gUnknown_0856FB55[]; -extern const u8 gUnknown_0856FB57[]; -extern const u8 gUnknown_0856FB0F[]; -extern const u8* gUnknown_0856FB5C[]; -extern const u8 gUnknown_0856FB68[6]; -extern const u8 gUnknown_0856FB6E[6]; -extern const u8 gUnknown_0856FB74[4]; -extern const u8 gUnknown_0856F54C[]; -extern const u8 gUnknown_0856F56C[]; -extern const u8 gUnknown_0856F58C[]; -extern const u8 gUnknown_0856F5AC[]; -extern const u8 gUnknown_0856F4EC[]; -extern const u8 gUnknown_0856F4AC[]; -extern const u8 gUnknown_0856F50C[]; -extern const u8 gUnknown_0856F4CC[]; -extern const u8 gUnknown_0856F52C[]; -extern const u8* gEmeraldTrainerCardStarPals[]; -extern const u8* gFireRedTrainerCardStarPals[]; -extern const u8 gUnknown_0856FB78[]; -extern bool8 (*const gUnknown_0856FB28[])(struct Task *); - -//this file's functions -/*static*/ void sub_80C2690(void); -/*static*/ void sub_80C26D4(void); -/*static*/ void sub_80C48C8(void); -/*static*/ void sub_80C2710(void); -/*static*/ void sub_80C2728(u8 task); -/*static*/ bool8 PrintAllOnCardPage1(void); -/*static*/ void sub_80C438C(u8); -/*static*/ void sub_80C4FF0(void); -/*static*/ void sub_80C4550(u16*); -/*static*/ void sub_80C45C0(u16*); -/*static*/ void sub_80C4630(void); -/*static*/ void PrintTimeOnCard(void); -/*static*/ void sub_80C4918(void); -/*static*/ bool8 sub_80C4940(void); -/*static*/ bool8 sub_80C2AD8(void); -/*static*/ void sub_80C2C80(void); -/*static*/ u32 GetCappedGameStat(u8 statId, u32 maxValue); -/*static*/ bool8 HasAllFrontierSymbols(void); -/*static*/ u32 sub_80C2E40(void); -/*static*/ u8 sub_80C2E84(struct TrainerCard*); -/*static*/ u16 GetCaughtMonsCount(void); -/*static*/ void SetPlayerCardData(struct TrainerCard*, u8); -/*static*/ void sub_80C3020(struct TrainerCard*); -/*static*/ u8 sub_80C4FCC(u8); -/*static*/ void sub_80C3190(void); -/*static*/ void sub_80C3278(void); -/*static*/ void sub_80C334C(void); -/*static*/ void sub_80C3388(void); -/*static*/ void sub_80C3404(void); -/*static*/ void sub_80C3414(void); -/*static*/ void sub_80C4EE4(void); -/*static*/ void PrintNameOnCard(void); -/*static*/ void PrintIdOnCard(void); -/*static*/ void PrintMoneyOnCard(void); -/*static*/ void PrintPokedexOnCard(void); -/*static*/ void PrintProfilePhraseOnCard(void); -/*static*/ bool8 PrintStringsOnCardPage2(void); -/*static*/ void sub_80C3B50(void); -/*static*/ void PrintHofDebutStringOnCard(void); -/*static*/ void PrintWinsLossesStringOnCard(void); -/*static*/ void PrintTradesStringOnCard(void); -/*static*/ void PrintBerryCrushStringOnCard(void); -/*static*/ void PrintPokeblockStringOnCard(void); -/*static*/ void PrintUnionStringOnCard(void); -/*static*/ void PrintContestStringOnCard(void); -/*static*/ void sub_80C4140(void); -/*static*/ void PrintBattleFacilityStringOnCard(void); -/*static*/ void sub_80C42A4(void); -/*static*/ void PrintAllVariableNumsOnCardPage2(void); -/*static*/ void PrintNameOnCard2(void); -/*static*/ void PrintHofTimeOnCard(void); -/*static*/ void PrintLinkResultsNumsOnCard(void); -/*static*/ void PrintTradesNumOnCard(void); -/*static*/ void PrintBerryCrushNumOnCard(void); -/*static*/ void PrintUnionNumOnCard(void); -/*static*/ void PrintPokeblocksNumOnCard(void); -/*static*/ void PrintContestNumOnCard(void); -/*static*/ void PrintBattleFacilityNumsOnCard(void); -/*static*/ void sub_80C3C34(u8 top, const u8* str1, u8* str2, const u8* color); -/*static*/ void sub_80C4330(void); -/*static*/ u8 sub_80C43A8(void); -/*static*/ void sub_80C474C(void); -/*static*/ void sub_80C4960(u8); -/*static*/ bool8 sub_80C4998(struct Task* task); -/*static*/ bool8 sub_80C49D8(struct Task* task); -/*static*/ void sub_80C32EC(u16); -void sub_80C41D8(void); - -extern struct UnknownStruct +struct TrainerCardData { u8 var_0; - u8 var_1; - u8 var_2; - u8 var_3; + u8 printState; + u8 gfxLoadState; + u8 bgPalLoadState; u8 var_4; - u8 var_5; + bool8 isLink; u8 var_6; u8 var_7; u8 var_8; - u8 var_9; - u8 var_A; - u8 var_B; - u8 var_C; - u8 var_D; + bool8 allowDMACopy; + bool8 hasPokedex; + bool8 hasHofResult; + bool8 hasLinkResults; + bool8 hasBattleTowerWins; u8 var_E; u8 var_F; - u8 var_10; + bool8 hasTrades; u8 badgeCount[8]; - u8 var_19[0xD]; - u8 var_26[0xD]; - u8 var_33[0xD]; - u8 var_40[0xD]; + u8 var_19[4][0xD]; u8 var_4D[0x46]; u8 var_93[0x46]; u8 var_D9[0x8C]; @@ -202,17 +67,17 @@ extern struct UnknownStruct u8 var_34F[0x46]; u8 var_395[0x46]; u8 var_3DB[0x46]; - u8 var_421[0x47]; + u8 var_421[0x46]; u16 var_468[0x60]; s8 var_528; u8 var_529; - u8 var_52A; - u8 var_52B; + u8 cardType; + bool8 isHoenn; u16 var_52C; void (*callback2)(void); - struct TrainerCard var_534; + struct TrainerCard trainerCard; u16 var_598[0x4B0 / 2]; - u8 var_A48[0x4B0]; + u16 var_A48[0x4B0 / 2]; u16 var_EF8[0x4B0 / 2]; u8 var_13A8[0x400]; u8 var_17A8[0x200]; @@ -220,20 +85,237 @@ extern struct UnknownStruct u16 var_3CA8[0x2000 / 2]; u16 var_5CA8[0x2000 / 2]; u16 var_7CA8; - u8 var_7CAA; -}* gUnknown_02039CE8; + u8 language; +}; -void sub_80C2690(void) +//external functions +extern u8 sub_80D30A0(u16); +extern void sub_80C5868(void); + +// EWRAM +EWRAM_DATA static struct TrainerCardData *sData = NULL; + +//this file's functions +static void VblankCb_TrainerCard(void); +static void HblankCb_TrainerCard(void); +static void sub_80C48C8(void); +static void CB2_TrainerCard(void); +static void CloseTrainerCard(u8 task); +static bool8 PrintAllOnCardPage1(void); +static void sub_80C438C(u8); +static void sub_80C4FF0(void); +static void sub_80C4550(u16*); +static void sub_80C45C0(u16*); +static void sub_80C4630(void); +static void PrintTimeOnCard(void); +static void sub_80C4918(void); +static bool8 sub_80C4940(void); +static bool8 LoadCardGfx(void); +static void CB2_InitTrainerCard(void); +static u32 GetCappedGameStat(u8 statId, u32 maxValue); +static bool8 HasAllFrontierSymbols(void); +static u8 GetRubyTrainerStars(struct TrainerCard*); +static u16 GetCaughtMonsCount(void); +static void SetPlayerCardData(struct TrainerCard*, u8); +static void sub_80C3020(struct TrainerCard*); +static u8 VersionToCardType(u8); +static void SetDataFromTrainerCard(void); +static void HandleGpuRegs(void); +static void ResetGpuRegs(void); +static void InitBgsAndWindows(void); +static void SetTrainerCardCb2(void); +static void sub_80C3414(void); +static void sub_80C4EE4(void); +static u8 GetSetCardType(void); +static void PrintNameOnCard(void); +static void PrintIdOnCard(void); +static void PrintMoneyOnCard(void); +static void PrintPokedexOnCard(void); +static void PrintProfilePhraseOnCard(void); +static bool8 PrintStringsOnCardPage2(void); +static void sub_80C3B50(void); +static void PrintHofDebutStringOnCard(void); +static void PrintWinsLossesStringOnCard(void); +static void PrintTradesStringOnCard(void); +static void PrintBerryCrushStringOnCard(void); +static void PrintPokeblockStringOnCard(void); +static void PrintUnionStringOnCard(void); +static void PrintContestStringOnCard(void); +static void sub_80C4140(void); +static void PrintBattleFacilityStringOnCard(void); +static void sub_80C42A4(void); +static void PrintAllVariableNumsOnCardPage2(void); +static void PrintNameOnCard2(void); +static void PrintHofTimeOnCard(void); +static void PrintLinkResultsNumsOnCard(void); +static void PrintTradesNumOnCard(void); +static void PrintBerryCrushNumOnCard(void); +static void PrintUnionNumOnCard(void); +static void PrintPokeblocksNumOnCard(void); +static void PrintContestNumOnCard(void); +static void PrintBattleFacilityNumsOnCard(void); +static void PrintString(u8 top, const u8* str1, u8* str2, const u8* color); +static void sub_80C4330(void); +static u8 SetCardBgsAndPals(void); +static void sub_80C474C(void); +static void sub_80C4960(u8); +static bool8 sub_80C4998(struct Task* task); +static bool8 sub_80C49D8(struct Task* task); +static bool8 sub_80C4B08(struct Task* task); +static bool8 sub_80C4C1C(struct Task* task); +static bool8 sub_80C4C84(struct Task* task); +static bool8 sub_80C4DB0(struct Task* task); +static void sub_80C32EC(u16); +static void sub_80C41D8(void); +static void sub_80C6D80(const u8 *, u8 *, u8, u8, u8); + +// const rom data +static const u32 gUnknown_0856F018[] = INCBIN_U32("graphics/trainer_card/stickers_fr.4bpp.lz"); +static const u16 gUnknown_0856F18C[] = INCBIN_U16("graphics/trainer_card/unknown_56F18C.gbapal"); +static const u16 gEmeraldTrainerCard1Star_Pal[] = INCBIN_U16("graphics/trainer_card/one_star.gbapal"); +static const u16 gFireRedTrainerCard1Star_Pal[] = INCBIN_U16("graphics/trainer_card/one_star_fr.gbapal"); +static const u16 gEmeraldTrainerCard2Star_Pal[] = INCBIN_U16("graphics/trainer_card/two_stars.gbapal"); +static const u16 gFireRedTrainerCard2Star_Pal[] = INCBIN_U16("graphics/trainer_card/two_stars_fr.gbapal"); +static const u16 gEmeraldTrainerCard3Star_Pal[] = INCBIN_U16("graphics/trainer_card/three_stars.gbapal"); +static const u16 gFireRedTrainerCard3Star_Pal[] = INCBIN_U16("graphics/trainer_card/three_stars_fr.gbapal"); +static const u16 gEmeraldTrainerCard4Star_Pal[] = INCBIN_U16("graphics/trainer_card/four_stars.gbapal"); +static const u16 gFireRedTrainerCard4Star_Pal[] = INCBIN_U16("graphics/trainer_card/four_stars_fr.gbapal"); +static const u16 gUnknown_0856F4AC[] = INCBIN_U16("graphics/trainer_card/female_bg.gbapal"); +static const u16 gUnknown_0856F4CC[] = INCBIN_U16("graphics/trainer_card/female_bg_fr.gbapal"); +static const u16 gUnknown_0856F4EC[] = INCBIN_U16("graphics/trainer_card/badges.gbapal"); +static const u16 gUnknown_0856F50C[] = INCBIN_U16("graphics/trainer_card/badges_fr.gbapal"); +static const u16 gUnknown_0856F52C[] = INCBIN_U16("graphics/trainer_card/gold.gbapal"); +static const u16 gUnknown_0856F54C[] = INCBIN_U16("graphics/trainer_card/stickers_fr1.gbapal"); +static const u16 gUnknown_0856F56C[] = INCBIN_U16("graphics/trainer_card/stickers_fr2.gbapal"); +static const u16 gUnknown_0856F58C[] = INCBIN_U16("graphics/trainer_card/stickers_fr3.gbapal"); +static const u16 gUnknown_0856F5AC[] = INCBIN_U16("graphics/trainer_card/stickers_fr4.gbapal"); +static const u32 gUnknown_0856F5CC[] = INCBIN_U32("graphics/trainer_card/badges.4bpp.lz"); +static const u32 gUnknown_0856F814[] = INCBIN_U32("graphics/trainer_card/badges_fr.4bpp.lz"); + +static const struct BgTemplate gUnknown_0856FAB4[4] = +{ + { + .bg = 0, + .charBaseIndex = 0, + .mapBaseIndex = 27, + .screenSize = 2, + .paletteMode = 0, + .priority = 2, + .baseTile = 0 + }, + { + .bg = 1, + .charBaseIndex = 2, + .mapBaseIndex = 29, + .screenSize = 0, + .paletteMode = 0, + .priority = 0, + .baseTile = 0 + }, + { + .bg = 2, + .charBaseIndex = 0, + .mapBaseIndex = 30, + .screenSize = 0, + .paletteMode = 0, + .priority = 3, + .baseTile = 0 + }, + { + .bg = 3, + .charBaseIndex = 0, + .mapBaseIndex = 31, + .screenSize = 0, + .paletteMode = 0, + .priority = 1, + .baseTile = 192 + }, +}; + +static const struct WindowTemplate gUnknown_0856FAC4[] = +{ + { + .bg = 1, + .tilemapLeft = 2, + .tilemapTop = 15, + .width = 27, + .height = 4, + .paletteNum = 15, + .baseBlock = 0x253, + }, + { + .bg = 1, + .tilemapLeft = 1, + .tilemapTop = 1, + .width = 28, + .height = 18, + .paletteNum = 15, + .baseBlock = 0x1, + }, + { + .bg = 3, + .tilemapLeft = 19, + .tilemapTop = 5, + .width = 9, + .height = 10, + .paletteNum = 8, + .baseBlock = 0x150, + }, + DUMMY_WIN_TEMPLATE +}; + +static const u16 *const gEmeraldTrainerCardStarPals[] = +{ + gEmeraldTrainerCard0Star_Pal, + gEmeraldTrainerCard1Star_Pal, + gEmeraldTrainerCard2Star_Pal, + gEmeraldTrainerCard3Star_Pal, + gEmeraldTrainerCard4Star_Pal, +}; + +static const u16 *const gFireRedTrainerCardStarPals[] = +{ + gFireRedTrainerCard0Star_Pal, + gFireRedTrainerCard1Star_Pal, + gFireRedTrainerCard2Star_Pal, + gFireRedTrainerCard3Star_Pal, + gFireRedTrainerCard4Star_Pal, +}; + +static const u8 gUnknown_0856FB0C[] = {0, 2, 3}; +static const u8 gUnknown_0856FB0F[] = {0, 4, 5}; +static const u8 gUnknown_0856FB12[6] = {0}; + +static const u8 gUnknown_0856FB18[][2][2] = +{ + {{0xD, 4}, {0xD, 4}}, + {{1, 0}, {1, 0}}, +}; + +static const u8 gUnknown_0856FB20[][2] = {{0x4E, 0x4F}, {0x50, 0x51}, {0x3C, 0x3F}}; + +static bool8 (*const gUnknown_0856FB28[])(struct Task *) = +{ + sub_80C4998, + sub_80C49D8, + sub_80C4B08, + sub_80C4C1C, + sub_80C4C84, + sub_80C4DB0, +}; + +// code +static void VblankCb_TrainerCard(void) { LoadOam(); ProcessSpriteCopyRequests(); TransferPlttBuffer(); sub_80C48C8(); - if (gUnknown_02039CE8->var_9) + if (sData->allowDMACopy) DmaCopy16(3, &gScanlineEffectRegBuffers[0], &gScanlineEffectRegBuffers[1], 0x140); } -void sub_80C26D4(void) +static void HblankCb_TrainerCard(void) { u16 backup; u16 bgVOffset; @@ -245,7 +327,7 @@ void sub_80C26D4(void) REG_IME = backup; } -void sub_80C2710(void) +static void CB2_TrainerCard(void) { RunTasks(); AnimateSprites(); @@ -253,51 +335,50 @@ void sub_80C2710(void) UpdatePaletteFade(); } -void sub_80C2728(u8 taskId) +static void CloseTrainerCard(u8 taskId) { - SetMainCallback2(gUnknown_02039CE8->callback2); + SetMainCallback2(sData->callback2); FreeAllWindowBuffers(); - Free(gUnknown_02039CE8); - gUnknown_02039CE8 = NULL; + FREE_AND_SET_NULL(sData); DestroyTask(taskId); } -void sub_80C2760(u8 taskId) +static void sub_80C2760(u8 taskId) { - switch (gUnknown_02039CE8->var_0) + switch (sData->var_0) { case 0: if (!IsDma3ManagerBusyWithBgCopy()) { FillWindowPixelBuffer(1, 0); - gUnknown_02039CE8->var_0++; + sData->var_0++; } break; case 1: if (PrintAllOnCardPage1()) - gUnknown_02039CE8->var_0++; + sData->var_0++; break; case 2: sub_80C438C(1); - gUnknown_02039CE8->var_0++; + sData->var_0++; break; case 3: FillWindowPixelBuffer(2, 0); sub_80C4FF0(); sub_80C438C(2); - gUnknown_02039CE8->var_0++; + sData->var_0++; break; case 4: - sub_80C4550(gUnknown_02039CE8->var_EF8); - gUnknown_02039CE8->var_0++; + sub_80C4550(sData->var_EF8); + sData->var_0++; break; case 5: - sub_80C45C0(gUnknown_02039CE8->var_598); - gUnknown_02039CE8->var_0++; + sub_80C45C0(sData->var_598); + sData->var_0++; break; case 6: sub_80C4630(); - gUnknown_02039CE8->var_0++; + sData->var_0++; break; case 7: if (gWirelessCommType == 1 && gReceivedRemoteLinkPlayers == TRUE) @@ -305,45 +386,45 @@ void sub_80C2760(u8 taskId) sub_800E0E8(); CreateWirelessStatusIndicatorSprite(230, 150); } - BlendPalettes(0xFFFFFFFF, 16, gUnknown_02039CE8->var_52C); - BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, gUnknown_02039CE8->var_52C); - SetVBlankCallback(sub_80C2690); - gUnknown_02039CE8->var_0++; + BlendPalettes(0xFFFFFFFF, 16, sData->var_52C); + BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, sData->var_52C); + SetVBlankCallback(VblankCb_TrainerCard); + sData->var_0++; break; case 8: if (!UpdatePaletteFade() && !IsDma3ManagerBusyWithBgCopy()) { PlaySE(SE_RG_CARD3); - gUnknown_02039CE8->var_0 = 10; + sData->var_0 = 10; } break; case 9: if (!IsSEPlaying()) - gUnknown_02039CE8->var_0++; + sData->var_0++; break; case 10: - if (!gReceivedRemoteLinkPlayers && gUnknown_02039CE8->var_529) + if (!gReceivedRemoteLinkPlayers && sData->var_529) { PrintTimeOnCard(); sub_80C438C(1); - gUnknown_02039CE8->var_529 = 0; + sData->var_529 = 0; } if (gMain.newKeys & A_BUTTON) { sub_80C4918(); PlaySE(SE_RG_CARD1); - gUnknown_02039CE8->var_0 = 12; + sData->var_0 = 12; } else if (gMain.newKeys & B_BUTTON) { - if (gReceivedRemoteLinkPlayers && gUnknown_02039CE8->var_5 && InUnionRoom() == TRUE) + if (gReceivedRemoteLinkPlayers && sData->isLink && InUnionRoom() == TRUE) { - gUnknown_02039CE8->var_0 = 15; + sData->var_0 = 15; } else { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, gUnknown_02039CE8->var_52C); - gUnknown_02039CE8->var_0 = 14; + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, sData->var_52C); + sData->var_0 = 14; } } break; @@ -351,38 +432,38 @@ void sub_80C2760(u8 taskId) if (sub_80C4940() && sub_8087598() != TRUE) { PlaySE(SE_RG_CARD3); - gUnknown_02039CE8->var_0 = 11; + sData->var_0 = 11; } break; case 11: if (gMain.newKeys & B_BUTTON) { - if (gReceivedRemoteLinkPlayers && gUnknown_02039CE8->var_5 && InUnionRoom() == TRUE) + if (gReceivedRemoteLinkPlayers && sData->isLink && InUnionRoom() == TRUE) { - gUnknown_02039CE8->var_0 = 15; + sData->var_0 = 15; } else if (gReceivedRemoteLinkPlayers) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, gUnknown_02039CE8->var_52C); - gUnknown_02039CE8->var_0 = 14; + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, sData->var_52C); + sData->var_0 = 14; } else { sub_80C4918(); - gUnknown_02039CE8->var_0 = 13; + sData->var_0 = 13; PlaySE(SE_RG_CARD1); } } else if (gMain.newKeys & A_BUTTON) { - if (gReceivedRemoteLinkPlayers && gUnknown_02039CE8->var_5 && InUnionRoom() == TRUE) + if (gReceivedRemoteLinkPlayers && sData->isLink && InUnionRoom() == TRUE) { - gUnknown_02039CE8->var_0 = 15; + sData->var_0 = 15; } else { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, gUnknown_02039CE8->var_52C); - gUnknown_02039CE8->var_0 = 14; + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, sData->var_52C); + sData->var_0 = 14; } } break; @@ -391,91 +472,91 @@ void sub_80C2760(u8 taskId) NewMenuHelpers_DrawDialogueFrame(0, 1); AddTextPrinterParameterized(0, 1, gText_WaitingTrainerFinishReading, 0, 1, 255, 0); CopyWindowToVram(0, 3); - gUnknown_02039CE8->var_0 = 16; + sData->var_0 = 16; break; case 16: if (!gReceivedRemoteLinkPlayers) { - BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, gUnknown_02039CE8->var_52C); - gUnknown_02039CE8->var_0 = 14; + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, sData->var_52C); + sData->var_0 = 14; } break; case 14: if (!UpdatePaletteFade()) - sub_80C2728(taskId); + CloseTrainerCard(taskId); break; case 13: if (sub_80C4940() && sub_8087598() != TRUE) { - gUnknown_02039CE8->var_0 = 10; + sData->var_0 = 10; PlaySE(SE_RG_CARD3); } break; } } -bool8 sub_80C2AD8(void) +static bool8 LoadCardGfx(void) { - switch (gUnknown_02039CE8->var_2) + switch (sData->gfxLoadState) { case 0: - if (gUnknown_02039CE8->var_52A) - LZ77UnCompWram(gUnknown_08DD1F78, gUnknown_02039CE8->var_EF8); + if (sData->cardType != CARD_TYPE_FR) + LZ77UnCompWram(gUnknown_08DD1F78, sData->var_EF8); else - LZ77UnCompWram(gUnknown_08DD2AE0, gUnknown_02039CE8->var_EF8); + LZ77UnCompWram(gUnknown_08DD2AE0, sData->var_EF8); break; case 1: - if (gUnknown_02039CE8->var_52A) - LZ77UnCompWram(gUnknown_08DD21B0, gUnknown_02039CE8->var_A48); + if (sData->cardType != CARD_TYPE_FR) + LZ77UnCompWram(gUnknown_08DD21B0, sData->var_A48); else - LZ77UnCompWram(gUnknown_08DD2D30, gUnknown_02039CE8->var_A48); + LZ77UnCompWram(gUnknown_08DD2D30, sData->var_A48); break; case 2: - if (!gUnknown_02039CE8->var_5) + if (!sData->isLink) { - if (gUnknown_02039CE8->var_52A) - LZ77UnCompWram(gUnknown_08DD2010, gUnknown_02039CE8->var_598); + if (sData->cardType != CARD_TYPE_FR) + LZ77UnCompWram(gUnknown_08DD2010, sData->var_598); else - LZ77UnCompWram(gUnknown_08DD2B78, gUnknown_02039CE8->var_598); + LZ77UnCompWram(gUnknown_08DD2B78, sData->var_598); } else { - if (gUnknown_02039CE8->var_52A) - LZ77UnCompWram(gUnknown_08DD228C, gUnknown_02039CE8->var_598); + if (sData->cardType != CARD_TYPE_FR) + LZ77UnCompWram(gUnknown_08DD228C, sData->var_598); else - LZ77UnCompWram(gUnknown_08DD2E5C, gUnknown_02039CE8->var_598); + LZ77UnCompWram(gUnknown_08DD2E5C, sData->var_598); } break; case 3: - if (gUnknown_02039CE8->var_52A) - LZ77UnCompWram(gUnknown_0856F5CC, gUnknown_02039CE8->var_13A8); + if (sData->cardType != CARD_TYPE_FR) + LZ77UnCompWram(gUnknown_0856F5CC, sData->var_13A8); else - LZ77UnCompWram(gUnknown_0856F814, gUnknown_02039CE8->var_13A8); + LZ77UnCompWram(gUnknown_0856F814, sData->var_13A8); break; case 4: - if (gUnknown_02039CE8->var_52A) - LZ77UnCompWram(gEmeraldTrainerCard_Gfx, gUnknown_02039CE8->var_19A8); + if (sData->cardType != CARD_TYPE_FR) + LZ77UnCompWram(gEmeraldTrainerCard_Gfx, sData->var_19A8); else - LZ77UnCompWram(gFireRedTrainerCard_Gfx, gUnknown_02039CE8->var_19A8); + LZ77UnCompWram(gFireRedTrainerCard_Gfx, sData->var_19A8); break; case 5: - if (!gUnknown_02039CE8->var_52A) - LZ77UnCompWram(gUnknown_0856F018, gUnknown_02039CE8->var_17A8); + if (sData->cardType == CARD_TYPE_FR) + LZ77UnCompWram(gUnknown_0856F018, sData->var_17A8); break; default: - gUnknown_02039CE8->var_2 = 0; + sData->gfxLoadState = 0; return TRUE; } - gUnknown_02039CE8->var_2++; + sData->gfxLoadState++; return FALSE; } -void sub_80C2C80(void) +static void CB2_InitTrainerCard(void) { switch (gMain.state) { case 0: - sub_80C334C(); + ResetGpuRegs(); sub_80C3414(); gMain.state++; break; @@ -484,7 +565,7 @@ void sub_80C2C80(void) gMain.state++; break; case 2: - if (!gUnknown_02039CE8->var_52C) + if (!sData->var_52C) DmaClear16(3, (void *)PLTT, PLTT_SIZE); gMain.state++; break; @@ -494,7 +575,7 @@ void sub_80C2C80(void) ResetPaletteFade(); gMain.state++; case 4: - sub_80C3388(); + InitBgsAndWindows(); gMain.state++; break; case 5: @@ -502,7 +583,7 @@ void sub_80C2C80(void) gMain.state++; break; case 6: - if (sub_80C2AD8() == TRUE) + if (LoadCardGfx() == TRUE) gMain.state++; break; case 7: @@ -510,7 +591,7 @@ void sub_80C2C80(void) gMain.state++; break; case 8: - sub_80C3278(); + HandleGpuRegs(); gMain.state++; break; case 9: @@ -518,23 +599,23 @@ void sub_80C2C80(void) gMain.state++; break; case 10: - if (sub_80C43A8() == TRUE) + if (SetCardBgsAndPals() == TRUE) gMain.state++; break; default: - sub_80C3404(); + SetTrainerCardCb2(); break; } } -u32 GetCappedGameStat(u8 statId, u32 maxValue) +static u32 GetCappedGameStat(u8 statId, u32 maxValue) { u32 statValue = GetGameStat(statId); return min(maxValue, statValue); } -bool8 HasAllFrontierSymbols(void) +static bool8 HasAllFrontierSymbols(void) { u8 i; for (i = 0; i < NUM_FRONTIER_FACILITIES; i++) @@ -545,7 +626,7 @@ bool8 HasAllFrontierSymbols(void) return TRUE; } -u32 sub_80C2E40(void) +u32 CountPlayerTrainerStars(void) { u8 stars = 0; @@ -561,7 +642,7 @@ u32 sub_80C2E40(void) return stars; } -u8 sub_80C2E84(struct TrainerCard *trainerCard) +static u8 GetRubyTrainerStars(struct TrainerCard *trainerCard) { u8 stars = 0; @@ -569,7 +650,7 @@ u8 sub_80C2E84(struct TrainerCard *trainerCard) stars++; if (trainerCard->caughtAllHoenn) stars++; - if (trainerCard->battleTowerLosses > 49) + if (trainerCard->battleTowerStraightWins > 49) stars++; if (trainerCard->hasAllPaintings) stars++; @@ -577,7 +658,7 @@ u8 sub_80C2E84(struct TrainerCard *trainerCard) return stars; } -void SetPlayerCardData(struct TrainerCard *trainerCard, u8 arg1) +static void SetPlayerCardData(struct TrainerCard *trainerCard, u8 cardType) { u32 playTime; u8 i; @@ -618,21 +699,22 @@ void SetPlayerCardData(struct TrainerCard *trainerCard, u8 arg1) StringCopy(trainerCard->playerName, gSaveBlock2Ptr->playerName); - switch (arg1) + switch (cardType) { - case 2: + case CARD_TYPE_EMERALD: trainerCard->battleTowerWins = 0; - trainerCard->battleTowerLosses = 0; - case 0: + trainerCard->battleTowerStraightWins = 0; + // Seems like GF got CARD_TYPE_FR and CARD_TYPE_RUBY wrong. + case CARD_TYPE_FR: trainerCard->contestsWithFriends = GetCappedGameStat(GAME_STAT_WON_LINK_CONTEST, 999); trainerCard->pokeblocksWithFriends = GetCappedGameStat(GAME_STAT_POKEBLOCKS_WITH_FRIENDS, 0xFFFF); if (CountPlayerContestPaintings() > 4) trainerCard->hasAllPaintings = TRUE; - trainerCard->stars = sub_80C2E84(trainerCard); + trainerCard->stars = GetRubyTrainerStars(trainerCard); break; - case 1: + case CARD_TYPE_RUBY: trainerCard->battleTowerWins = 0; - trainerCard->battleTowerLosses = 0; + trainerCard->battleTowerStraightWins = 0; trainerCard->contestsWithFriends = 0; trainerCard->pokeblocksWithFriends = 0; trainerCard->hasAllPaintings = 0; @@ -641,14 +723,14 @@ void SetPlayerCardData(struct TrainerCard *trainerCard, u8 arg1) } } -void sub_80C3020(struct TrainerCard *trainerCard) +static void sub_80C3020(struct TrainerCard *trainerCard) { memset(trainerCard, 0, sizeof(struct TrainerCard)); - trainerCard->var_38 = 3; - SetPlayerCardData(trainerCard, 2); - trainerCard->var_60 = HasAllFrontierSymbols(); - trainerCard->var_62 = gSaveBlock2Ptr->frontier.field_EBA; - if (trainerCard->var_60) + trainerCard->version = VERSION_EMERALD; + SetPlayerCardData(trainerCard, CARD_TYPE_EMERALD); + trainerCard->hasAllSymbols = HasAllFrontierSymbols(); + trainerCard->frontierBP = gSaveBlock2Ptr->frontier.field_EBA; + if (trainerCard->hasAllSymbols) trainerCard->stars++; if (trainerCard->gender == FEMALE) @@ -660,10 +742,10 @@ void sub_80C3020(struct TrainerCard *trainerCard) void TrainerCard_GenerateCardForPlayer(struct TrainerCard *trainerCard) { memset(trainerCard, 0, 0x60); - trainerCard->var_38 = 3; - SetPlayerCardData(trainerCard, 2); + trainerCard->version = VERSION_EMERALD; + SetPlayerCardData(trainerCard, CARD_TYPE_EMERALD); trainerCard->var_3A = HasAllFrontierSymbols(); - *((u16*)&trainerCard->var_3C) = gSaveBlock2Ptr->frontier.field_EBA; + *((u16*)&trainerCard->berruCrushPoints) = gSaveBlock2Ptr->frontier.field_EBA; if (trainerCard->var_3A) trainerCard->stars++; @@ -673,70 +755,64 @@ void TrainerCard_GenerateCardForPlayer(struct TrainerCard *trainerCard) trainerCard->var_4F = gUnknown_08329D54[trainerCard->trainerId % 8]; } -void sub_80C3120(struct TrainerCard *trainerCard, u16 *src, u8 gameVersion) +void CopyTrainerCardData(struct TrainerCard *dst, u16 *src, u8 gameVersion) { - memset(trainerCard, 0, sizeof(struct TrainerCard)); - trainerCard->var_38 = gameVersion; + memset(dst, 0, sizeof(struct TrainerCard)); + dst->version = gameVersion; - switch (sub_80C4FCC(gameVersion)) + switch (VersionToCardType(gameVersion)) { - case 0: - memcpy(trainerCard, src, 0x60); + case CARD_TYPE_FR: + memcpy(dst, src, 0x60); break; - case 1: - memcpy(trainerCard, src, 0x38); + case CARD_TYPE_RUBY: + memcpy(dst, src, 0x38); break; - case 2: - memcpy(trainerCard, src, 0x60); - trainerCard->var_3C = 0; - trainerCard->var_60 = src[29]; - trainerCard->var_62 = src[30]; + case CARD_TYPE_EMERALD: + memcpy(dst, src, 0x60); + dst->berruCrushPoints = 0; + dst->hasAllSymbols = src[29]; + dst->frontierBP = src[30]; break; } } -void sub_80C3190(void) +static void SetDataFromTrainerCard(void) { u8 i; u32 badgeFlag; - gUnknown_02039CE8->var_A = 0; - gUnknown_02039CE8->var_B = 0; - gUnknown_02039CE8->var_C = 0; - gUnknown_02039CE8->var_D = 0; - gUnknown_02039CE8->var_E = 0; - gUnknown_02039CE8->var_F = 0; - gUnknown_02039CE8->var_10 = 0; - memset(gUnknown_02039CE8->badgeCount, 0, sizeof(gUnknown_02039CE8->badgeCount)); - if (gUnknown_02039CE8->var_534.hasPokedex) - gUnknown_02039CE8->var_A++; + sData->hasPokedex = FALSE; + sData->hasHofResult = FALSE; + sData->hasLinkResults = FALSE; + sData->hasBattleTowerWins = FALSE; + sData->var_E = 0; + sData->var_F = 0; + sData->hasTrades = FALSE; + memset(sData->badgeCount, 0, sizeof(sData->badgeCount)); + if (sData->trainerCard.hasPokedex) + sData->hasPokedex++; - if (gUnknown_02039CE8->var_534.hofDebutHours - || gUnknown_02039CE8->var_534.hofDebutMinutes - || gUnknown_02039CE8->var_534.hofDebutSeconds) - gUnknown_02039CE8->var_B++; + if (sData->trainerCard.hofDebutHours + || sData->trainerCard.hofDebutMinutes + || sData->trainerCard.hofDebutSeconds) + sData->hasHofResult++; - if (gUnknown_02039CE8->var_534.linkBattleWins || gUnknown_02039CE8->var_534.linkBattleLosses) - gUnknown_02039CE8->var_C++; - if (gUnknown_02039CE8->var_534.pokemonTrades) - gUnknown_02039CE8->var_10++; - if (gUnknown_02039CE8->var_534.battleTowerWins || gUnknown_02039CE8->var_534.battleTowerLosses) - gUnknown_02039CE8->var_D++; + if (sData->trainerCard.linkBattleWins || sData->trainerCard.linkBattleLosses) + sData->hasLinkResults++; + if (sData->trainerCard.pokemonTrades) + sData->hasTrades++; + if (sData->trainerCard.battleTowerWins || sData->trainerCard.battleTowerStraightWins) + sData->hasBattleTowerWins++; - i = 0; - badgeFlag = FLAG_BADGE01_GET; - while (1) + for (i = 0, badgeFlag = FLAG_BADGE01_GET; badgeFlag <= FLAG_BADGE08_GET; badgeFlag++, i++) { if (FlagGet(badgeFlag)) - gUnknown_02039CE8->badgeCount[i]++; - badgeFlag++; - i++; - if (badgeFlag > FLAG_BADGE08_GET) - break; + sData->badgeCount[i]++; } } -void sub_80C3278(void) +static void HandleGpuRegs(void) { SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_WIN0_ON | DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP); ShowBg(0); @@ -755,18 +831,18 @@ void sub_80C3278(void) EnableInterrupts(INTR_FLAG_VBLANK | INTR_FLAG_HBLANK); } -void sub_80C32EC(u16 arg0) +static void sub_80C32EC(u16 arg0) { s8 quotient = (arg0 + 40) / 10; if (quotient <= 4) quotient = 0; - gUnknown_02039CE8->var_528 = quotient; - SetGpuReg(REG_OFFSET_BLDY, gUnknown_02039CE8->var_528); - SetGpuReg(REG_OFFSET_WIN0V, (gUnknown_02039CE8->var_7CA8 * 256) | (160 - gUnknown_02039CE8->var_7CA8)); + sData->var_528 = quotient; + SetGpuReg(REG_OFFSET_BLDY, sData->var_528); + SetGpuReg(REG_OFFSET_WIN0V, (sData->var_7CA8 * 256) | (160 - sData->var_7CA8)); } -void sub_80C334C(void) +static void ResetGpuRegs(void) { SetVBlankCallback(NULL); SetHBlankCallback(NULL); @@ -777,7 +853,7 @@ void sub_80C334C(void) SetGpuReg(REG_OFFSET_BG3CNT, 0); } -void sub_80C3388(void) +static void InitBgsAndWindows(void) { ResetBgsAndClearDma3BusyFlags(0); InitBgsFromTemplates(0, gUnknown_0856FAB4, ARRAY_COUNT(gUnknown_0856FAB4)); @@ -794,23 +870,23 @@ void sub_80C3388(void) sub_81973A4(); } -void sub_80C3404(void) +static void SetTrainerCardCb2(void) { - SetMainCallback2(sub_80C2710); + SetMainCallback2(CB2_TrainerCard); } -void sub_80C3414(void) +static void sub_80C3414(void) { ResetTasks(); ScanlineEffect_Stop(); CreateTask(sub_80C2760, 0); sub_80C4EE4(); - sub_80C3190(); + SetDataFromTrainerCard(); } -bool8 PrintAllOnCardPage1(void) +static bool8 PrintAllOnCardPage1(void) { - switch (gUnknown_02039CE8->var_1) + switch (sData->printState) { case 0: PrintNameOnCard(); @@ -831,16 +907,16 @@ bool8 PrintAllOnCardPage1(void) PrintProfilePhraseOnCard(); break; default: - gUnknown_02039CE8->var_1 = 0; + sData->printState = 0; return TRUE; } - gUnknown_02039CE8->var_1++; + sData->printState++; return FALSE; } -bool8 PrintStringsOnCardPage2(void) +static bool8 PrintStringsOnCardPage2(void) { - switch (gUnknown_02039CE8->var_1) + switch (sData->printState) { case 0: sub_80C3B50(); @@ -870,14 +946,14 @@ bool8 PrintStringsOnCardPage2(void) sub_80C42A4(); break; default: - gUnknown_02039CE8->var_1 = 0; + sData->printState = 0; return TRUE; } - gUnknown_02039CE8->var_1++; + sData->printState++; return FALSE; } -void PrintAllVariableNumsOnCardPage2(void) +static void PrintAllVariableNumsOnCardPage2(void) { PrintNameOnCard2(); PrintHofTimeOnCard(); @@ -890,28 +966,28 @@ void PrintAllVariableNumsOnCardPage2(void) PrintBattleFacilityNumsOnCard(); } -void PrintNameOnCard(void) +static void PrintNameOnCard(void) { u8 buffer[32]; u8* txtPtr; txtPtr = StringCopy(buffer, gText_TrainerCardName); - StringCopy(txtPtr, gUnknown_02039CE8->var_534.playerName); - ConvertInternationalString(txtPtr, gUnknown_02039CE8->var_7CAA); - if (!gUnknown_02039CE8->var_52A) + StringCopy(txtPtr, sData->trainerCard.playerName); + ConvertInternationalString(txtPtr, sData->language); + if (sData->cardType == CARD_TYPE_FR) AddTextPrinterParameterized3(1, 1, 20, 28, gUnknown_0856FB0C, -1, buffer); else AddTextPrinterParameterized3(1, 1, 16, 33, gUnknown_0856FB0C, -1, buffer); } -void PrintIdOnCard(void) +static void PrintIdOnCard(void) { u8 buffer[32]; u8* txtPtr; s32 xPos; u32 top; txtPtr = StringCopy(buffer, gText_TrainerCardIDNo); - ConvertIntToDecimalStringN(txtPtr, gUnknown_02039CE8->var_534.trainerId, STR_CONV_MODE_LEADING_ZEROS, 5); - if (!gUnknown_02039CE8->var_52A) + ConvertIntToDecimalStringN(txtPtr, sData->trainerCard.trainerId, STR_CONV_MODE_LEADING_ZEROS, 5); + if (sData->cardType == CARD_TYPE_FR) { xPos = GetStringCenterAlignXOffset(1, buffer, 80) + 132; top = 9; @@ -925,19 +1001,19 @@ void PrintIdOnCard(void) AddTextPrinterParameterized3(1, 1, xPos, top, gUnknown_0856FB0C, -1, buffer); } -void PrintMoneyOnCard(void) +static void PrintMoneyOnCard(void) { s32 xOffset; u8 top; - if (!gUnknown_02039CE8->var_52B) + if (!sData->isHoenn) AddTextPrinterParameterized3(1, 1, 20, 56, gUnknown_0856FB0C, -1, gText_TrainerCardMoney); else AddTextPrinterParameterized3(1, 1, 16, 57, gUnknown_0856FB0C, -1, gText_TrainerCardMoney); - ConvertIntToDecimalStringN(gStringVar1, gUnknown_02039CE8->var_534.money, 0, 6); + ConvertIntToDecimalStringN(gStringVar1, sData->trainerCard.money, 0, 6); StringExpandPlaceholders(gStringVar4, gText_PokedollarVar1); - if (!gUnknown_02039CE8->var_52B) + if (!sData->isHoenn) { xOffset = GetStringRightAlignXOffset(1, gStringVar4, 144); top = 56; @@ -950,7 +1026,7 @@ void PrintMoneyOnCard(void) AddTextPrinterParameterized3(1, 1, xOffset, top, gUnknown_0856FB0C, -1, gStringVar4); } -u16 GetCaughtMonsCount(void) +static u16 GetCaughtMonsCount(void) { if (IsNationalPokedexEnabled()) return GetNationalPokedexCount(FLAG_GET_CAUGHT); @@ -958,18 +1034,18 @@ u16 GetCaughtMonsCount(void) return GetHoennPokedexCount(FLAG_GET_CAUGHT); } -void PrintPokedexOnCard(void) +static void PrintPokedexOnCard(void) { s32 xOffset; u8 top; if (FlagGet(FLAG_SYS_POKEDEX_GET)) { - if (!gUnknown_02039CE8->var_52B) + if (!sData->isHoenn) AddTextPrinterParameterized3(1, 1, 20, 72, gUnknown_0856FB0C, -1, gText_TrainerCardPokedex); else AddTextPrinterParameterized3(1, 1, 16, 73, gUnknown_0856FB0C, -1,gText_TrainerCardPokedex); - StringCopy(ConvertIntToDecimalStringN(gStringVar4, gUnknown_02039CE8->var_534.caughtMonsCount, 0, 3), gText_EmptyString6); - if (!gUnknown_02039CE8->var_52B) + StringCopy(ConvertIntToDecimalStringN(gStringVar4, sData->trainerCard.caughtMonsCount, 0, 3), gText_EmptyString6); + if (!sData->isHoenn) { xOffset = GetStringRightAlignXOffset(1, gStringVar4, 144); top = 72; @@ -983,22 +1059,24 @@ void PrintPokedexOnCard(void) } } -void PrintTimeOnCard(void) +static const u8 *const gUnknown_0856FB40[] = {gUnknown_0856FB0C, gUnknown_0856FB12}; + +static void PrintTimeOnCard(void) { u16 hours; u16 minutes; s32 width; u32 r7, r4, r10; - if (!gUnknown_02039CE8->var_52B) + if (!sData->isHoenn) AddTextPrinterParameterized3(1, 1, 20, 88, gUnknown_0856FB0C, -1, gText_TrainerCardTime); else AddTextPrinterParameterized3(1, 1, 16, 89, gUnknown_0856FB0C, -1, gText_TrainerCardTime); - if (gUnknown_02039CE8->var_5) + if (sData->isLink) { - hours = gUnknown_02039CE8->var_534.playTimeHours; - minutes = gUnknown_02039CE8->var_534.playTimeMinutes; + hours = sData->trainerCard.playTimeHours; + minutes = sData->trainerCard.playTimeMinutes; } else { @@ -1012,7 +1090,7 @@ void PrintTimeOnCard(void) minutes = 59; width = GetStringWidth(1, gText_Colon2, 0); - if (!gUnknown_02039CE8->var_52B) + if (!sData->isHoenn) { r7 = 144; r4 = 88; @@ -1029,300 +1107,308 @@ void PrintTimeOnCard(void) ConvertIntToDecimalStringN(gStringVar4, hours, 1, 3); AddTextPrinterParameterized3(1, 1, r7, r4, gUnknown_0856FB0C, -1, gStringVar4); r7 += 18; - AddTextPrinterParameterized3(1, 1, r7, r4, gUnknown_0856FB40[gUnknown_02039CE8->var_7], -1, gText_Colon2); + AddTextPrinterParameterized3(1, 1, r7, r4, gUnknown_0856FB40[sData->var_7], -1, gText_Colon2); r7 += width; ConvertIntToDecimalStringN(gStringVar4, minutes, 2, 2); AddTextPrinterParameterized3(1, 1, r7, r4, gUnknown_0856FB0C, -1, gStringVar4); } -void PrintProfilePhraseOnCard(void) +static const u8 gUnknown_0856FB48[] = {0x71, 0x68}; +static const u8 gUnknown_0856FB4A[] = {0x81, 0x78}; + +static void PrintProfilePhraseOnCard(void) { - if (gUnknown_02039CE8->var_5) + if (sData->isLink) { - AddTextPrinterParameterized3(1, 1, 8, gUnknown_0856FB48[gUnknown_02039CE8->var_52B], gUnknown_0856FB0C, -1, gUnknown_02039CE8->var_19); - AddTextPrinterParameterized3(1, 1, GetStringWidth(1, gUnknown_02039CE8->var_19, 0) + 14, gUnknown_0856FB48[gUnknown_02039CE8->var_52B], gUnknown_0856FB0C, -1, gUnknown_02039CE8->var_26); - AddTextPrinterParameterized3(1, 1, 8, gUnknown_0856FB4A[gUnknown_02039CE8->var_52B], gUnknown_0856FB0C, -1, gUnknown_02039CE8->var_33); - AddTextPrinterParameterized3(1, 1, GetStringWidth(1, gUnknown_02039CE8->var_33, 0) + 14, gUnknown_0856FB4A[gUnknown_02039CE8->var_52B], gUnknown_0856FB0C, -1, gUnknown_02039CE8->var_40); + AddTextPrinterParameterized3(1, 1, 8, gUnknown_0856FB48[sData->isHoenn], gUnknown_0856FB0C, -1, sData->var_19[0]); + AddTextPrinterParameterized3(1, 1, GetStringWidth(1, sData->var_19[0], 0) + 14, gUnknown_0856FB48[sData->isHoenn], gUnknown_0856FB0C, -1, sData->var_19[1]); + AddTextPrinterParameterized3(1, 1, 8, gUnknown_0856FB4A[sData->isHoenn], gUnknown_0856FB0C, -1, sData->var_19[2]); + AddTextPrinterParameterized3(1, 1, GetStringWidth(1, sData->var_19[2], 0) + 14, gUnknown_0856FB4A[sData->isHoenn], gUnknown_0856FB0C, -1, sData->var_19[3]); } } -void PrintNameOnCard2(void) +static void PrintNameOnCard2(void) { - StringCopy(gUnknown_02039CE8->var_4D, gUnknown_02039CE8->var_534.playerName); - ConvertInternationalString(gUnknown_02039CE8->var_4D, gUnknown_02039CE8->var_7CAA); - if (gUnknown_02039CE8->var_52A) + StringCopy(sData->var_4D, sData->trainerCard.playerName); + ConvertInternationalString(sData->var_4D, sData->language); + if (sData->cardType != CARD_TYPE_FR) { - StringCopy(gStringVar1, gUnknown_02039CE8->var_4D); - StringExpandPlaceholders(gUnknown_02039CE8->var_4D, gText_Var1sTrainerCard); + StringCopy(gStringVar1, sData->var_4D); + StringExpandPlaceholders(sData->var_4D, gText_Var1sTrainerCard); } } -void sub_80C3B50(void) +static void sub_80C3B50(void) { - if (!gUnknown_02039CE8->var_52B) - AddTextPrinterParameterized3(1, 1, 136, 9, gUnknown_0856FB0C, -1, gUnknown_02039CE8->var_4D); + if (!sData->isHoenn) + AddTextPrinterParameterized3(1, 1, 136, 9, gUnknown_0856FB0C, -1, sData->var_4D); else - AddTextPrinterParameterized3(1, 1, GetStringRightAlignXOffset(1, gUnknown_02039CE8->var_4D, 216), 9, gUnknown_0856FB0C, -1, gUnknown_02039CE8->var_4D); + AddTextPrinterParameterized3(1, 1, GetStringRightAlignXOffset(1, sData->var_4D, 216), 9, gUnknown_0856FB0C, -1, sData->var_4D); } -void PrintHofTimeOnCard(void) +static const u8 gUnknown_0856FB4C[] = {0xfd, 0x02, 0xf0, 0xfd, 0x03, 0xf0, 0xfd, 0x04, 0xff}; + +static void PrintHofTimeOnCard(void) { - if (gUnknown_02039CE8->var_B) + if (sData->hasHofResult) { - ConvertIntToDecimalStringN(gStringVar1, gUnknown_02039CE8->var_534.hofDebutHours, 1, 3); - ConvertIntToDecimalStringN(gStringVar2, gUnknown_02039CE8->var_534.hofDebutMinutes, 2, 2); - ConvertIntToDecimalStringN(gStringVar3, gUnknown_02039CE8->var_534.hofDebutSeconds, 2, 2); - StringExpandPlaceholders(gUnknown_02039CE8->var_93, gUnknown_0856FB4C); + ConvertIntToDecimalStringN(gStringVar1, sData->trainerCard.hofDebutHours, 1, 3); + ConvertIntToDecimalStringN(gStringVar2, sData->trainerCard.hofDebutMinutes, 2, 2); + ConvertIntToDecimalStringN(gStringVar3, sData->trainerCard.hofDebutSeconds, 2, 2); + StringExpandPlaceholders(sData->var_93, gUnknown_0856FB4C); } } -void sub_80C3C34(u8 top, const u8* str1, u8* str2, const u8* color) +static const u8 gUnknown_0856FB55[] = {0x08, 0x10}; +static const u8 gUnknown_0856FB57[] = {0xd8, 0xd8}; + +static void PrintString(u8 top, const u8* str1, u8* str2, const u8* color) { - AddTextPrinterParameterized3(1, 1, gUnknown_0856FB55[gUnknown_02039CE8->var_52B], top * 16 + 33, gUnknown_0856FB0C, -1, str1); - AddTextPrinterParameterized3(1, 1, GetStringRightAlignXOffset(1, str2, gUnknown_0856FB57[gUnknown_02039CE8->var_52B]), top * 16 + 33, color, -1, str2); + AddTextPrinterParameterized3(1, 1, gUnknown_0856FB55[sData->isHoenn], top * 16 + 33, gUnknown_0856FB0C, -1, str1); + AddTextPrinterParameterized3(1, 1, GetStringRightAlignXOffset(1, str2, gUnknown_0856FB57[sData->isHoenn]), top * 16 + 33, color, -1, str2); } -void PrintHofDebutStringOnCard(void) +static void PrintHofDebutStringOnCard(void) { - if (gUnknown_02039CE8->var_B) - sub_80C3C34(0, gText_HallOfFameDebut, gUnknown_02039CE8->var_93, gUnknown_0856FB0F); + if (sData->hasHofResult) + PrintString(0, gText_HallOfFameDebut, sData->var_93, gUnknown_0856FB0F); } -void PrintLinkResultsNumsOnCard(void) +static const u8 *const gUnknown_0856FB5C[] = {gText_LinkBattles, gText_LinkCableBattles, gText_LinkBattles}; + +static void PrintLinkResultsNumsOnCard(void) { - if (gUnknown_02039CE8->var_C) + if (sData->hasLinkResults) { - StringCopy(gUnknown_02039CE8->var_D9, gUnknown_0856FB5C[gUnknown_02039CE8->var_52A]); - ConvertIntToDecimalStringN(gUnknown_02039CE8->var_165, gUnknown_02039CE8->var_534.linkBattleWins, 0, 4); - ConvertIntToDecimalStringN(gUnknown_02039CE8->var_1AB, gUnknown_02039CE8->var_534.linkBattleLosses, 0, 4); + StringCopy(sData->var_D9, gUnknown_0856FB5C[sData->cardType]); + ConvertIntToDecimalStringN(sData->var_165, sData->trainerCard.linkBattleWins, 0, 4); + ConvertIntToDecimalStringN(sData->var_1AB, sData->trainerCard.linkBattleLosses, 0, 4); } } -void PrintWinsLossesStringOnCard(void) +static void PrintWinsLossesStringOnCard(void) { - if (gUnknown_02039CE8->var_C) + if (sData->hasLinkResults) { - StringCopy(gStringVar1, gUnknown_02039CE8->var_165); - StringCopy(gStringVar2, gUnknown_02039CE8->var_1AB); + StringCopy(gStringVar1, sData->var_165); + StringCopy(gStringVar2, sData->var_1AB); StringExpandPlaceholders(gStringVar4, gText_WinsLosses); - sub_80C3C34(1, gUnknown_02039CE8->var_D9, gStringVar4, gUnknown_0856FB0C); + PrintString(1, sData->var_D9, gStringVar4, gUnknown_0856FB0C); } } -void PrintTradesNumOnCard(void) +static void PrintTradesNumOnCard(void) { - if (gUnknown_02039CE8->var_10) - ConvertIntToDecimalStringN(gUnknown_02039CE8->var_237, gUnknown_02039CE8->var_534.pokemonTrades, 1, 5); + if (sData->hasTrades) + ConvertIntToDecimalStringN(sData->var_237, sData->trainerCard.pokemonTrades, 1, 5); } -void PrintTradesStringOnCard(void) +static void PrintTradesStringOnCard(void) { - if (gUnknown_02039CE8->var_10) - sub_80C3C34(2, gText_PokemonTrades, gUnknown_02039CE8->var_237, gUnknown_0856FB0F); + if (sData->hasTrades) + PrintString(2, gText_PokemonTrades, sData->var_237, gUnknown_0856FB0F); } -void PrintBerryCrushNumOnCard(void) +static void PrintBerryCrushNumOnCard(void) { - if (!gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.var_3C) - ConvertIntToDecimalStringN(gUnknown_02039CE8->var_2C3, gUnknown_02039CE8->var_534.var_3C, 1, 5); + if (sData->cardType == CARD_TYPE_FR && sData->trainerCard.berruCrushPoints) + ConvertIntToDecimalStringN(sData->var_2C3, sData->trainerCard.berruCrushPoints, 1, 5); } -void PrintBerryCrushStringOnCard(void) +static void PrintBerryCrushStringOnCard(void) { - if (!gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.var_3C) - sub_80C3C34(4, gText_BerryCrush, gUnknown_02039CE8->var_2C3, gUnknown_0856FB0F); + if (sData->cardType == CARD_TYPE_FR && sData->trainerCard.berruCrushPoints) + PrintString(4, gText_BerryCrush, sData->var_2C3, gUnknown_0856FB0F); } -void PrintUnionNumOnCard(void) +static void PrintUnionNumOnCard(void) { - if (!gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.var_40) - ConvertIntToDecimalStringN(gUnknown_02039CE8->var_34F, gUnknown_02039CE8->var_534.var_40, 1, 5); + if (sData->cardType == CARD_TYPE_FR && sData->trainerCard.unionRoomNum) + ConvertIntToDecimalStringN(sData->var_34F, sData->trainerCard.unionRoomNum, 1, 5); } -void PrintUnionStringOnCard(void) +static void PrintUnionStringOnCard(void) { - if (!gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.var_40) - sub_80C3C34(3, gText_UnionTradesAndBattles, gUnknown_02039CE8->var_34F, gUnknown_0856FB0F); + if (sData->cardType == CARD_TYPE_FR && sData->trainerCard.unionRoomNum) + PrintString(3, gText_UnionTradesAndBattles, sData->var_34F, gUnknown_0856FB0F); } -void PrintPokeblocksNumOnCard(void) +static void PrintPokeblocksNumOnCard(void) { - if (gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.pokeblocksWithFriends) + if (sData->cardType != CARD_TYPE_FR && sData->trainerCard.pokeblocksWithFriends) { - ConvertIntToDecimalStringN(gStringVar1, gUnknown_02039CE8->var_534.pokeblocksWithFriends, 1, 5); - StringExpandPlaceholders(gUnknown_02039CE8->var_395, gText_Var1DarkGreyShadowLightGrey); + ConvertIntToDecimalStringN(gStringVar1, sData->trainerCard.pokeblocksWithFriends, 1, 5); + StringExpandPlaceholders(sData->var_395, gText_Var1DarkGreyShadowLightGrey); } } -void PrintPokeblockStringOnCard(void) +static void PrintPokeblockStringOnCard(void) { - if (gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.pokeblocksWithFriends) - sub_80C3C34(3, gText_PokeblocksWithFriends, gUnknown_02039CE8->var_395, gUnknown_0856FB0F); + if (sData->cardType != CARD_TYPE_FR && sData->trainerCard.pokeblocksWithFriends) + PrintString(3, gText_PokeblocksWithFriends, sData->var_395, gUnknown_0856FB0F); } -void PrintContestNumOnCard(void) +static void PrintContestNumOnCard(void) { - if (gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.contestsWithFriends) - ConvertIntToDecimalStringN(gUnknown_02039CE8->var_3DB, gUnknown_02039CE8->var_534.contestsWithFriends, 1, 5); + if (sData->cardType != CARD_TYPE_FR && sData->trainerCard.contestsWithFriends) + ConvertIntToDecimalStringN(sData->var_3DB, sData->trainerCard.contestsWithFriends, 1, 5); } -void PrintContestStringOnCard(void) +static void PrintContestStringOnCard(void) { - if (gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.contestsWithFriends) - sub_80C3C34(4, gText_WonContestsWFriends, gUnknown_02039CE8->var_3DB, gUnknown_0856FB0F); + if (sData->cardType != CARD_TYPE_FR && sData->trainerCard.contestsWithFriends) + PrintString(4, gText_WonContestsWFriends, sData->var_3DB, gUnknown_0856FB0F); } -void PrintBattleFacilityNumsOnCard(void) +static void PrintBattleFacilityNumsOnCard(void) { - switch (gUnknown_02039CE8->var_52A) + switch (sData->cardType) { - case 1: - if (gUnknown_02039CE8->var_D) + case CARD_TYPE_RUBY: + if (sData->hasBattleTowerWins) { - ConvertIntToDecimalStringN(gStringVar1, gUnknown_02039CE8->var_534.battleTowerWins, 1, 4); - ConvertIntToDecimalStringN(gStringVar2, gUnknown_02039CE8->var_534.battleTowerLosses, 1, 4); - StringExpandPlaceholders(gUnknown_02039CE8->var_421, gText_WSlashStraightSlash); + ConvertIntToDecimalStringN(gStringVar1, sData->trainerCard.battleTowerWins, 1, 4); + ConvertIntToDecimalStringN(gStringVar2, sData->trainerCard.battleTowerStraightWins, 1, 4); + StringExpandPlaceholders(sData->var_421, gText_WSlashStraightSlash); } break; - case 2: - if (gUnknown_02039CE8->var_534.var_62) + case CARD_TYPE_EMERALD: + if (sData->trainerCard.frontierBP) { - ConvertIntToDecimalStringN(gStringVar1, gUnknown_02039CE8->var_534.var_62, 1, 5); - StringExpandPlaceholders(gUnknown_02039CE8->var_421, gText_Var1DarkLightGreyBP); + ConvertIntToDecimalStringN(gStringVar1, sData->trainerCard.frontierBP, 1, 5); + StringExpandPlaceholders(sData->var_421, gText_Var1DarkLightGreyBP); } break; - case 0: + case CARD_TYPE_FR: break; } } -void PrintBattleFacilityStringOnCard(void) +static void PrintBattleFacilityStringOnCard(void) { - switch (gUnknown_02039CE8->var_52A) + switch (sData->cardType) { - case 1: - if (gUnknown_02039CE8->var_D) - sub_80C3C34(5, gText_BattleTower, gUnknown_02039CE8->var_421, gUnknown_0856FB0C); + case CARD_TYPE_RUBY: + if (sData->hasBattleTowerWins) + PrintString(5, gText_BattleTower, sData->var_421, gUnknown_0856FB0C); break; - case 2: - if (gUnknown_02039CE8->var_534.var_62) - sub_80C3C34(5, gText_BattlePtsWon, gUnknown_02039CE8->var_421, gUnknown_0856FB0F); + case CARD_TYPE_EMERALD: + if (sData->trainerCard.frontierBP) + PrintString(5, gText_BattlePtsWon, sData->var_421, gUnknown_0856FB0F); break; - case 0: + case CARD_TYPE_FR: break; } } -void sub_80C4140(void) +static void sub_80C4140(void) { u8 i; - u8 buffer[8]; - u8 buffer2[8]; - memcpy(buffer, gUnknown_0856FB68, sizeof(gUnknown_0856FB68)); - memcpy(buffer2, gUnknown_0856FB6E, sizeof(gUnknown_0856FB6E)); + u8 buffer[] = {0x05, 0x06, 0x07, 0x08, 0x09, 0x0a}; + u8 buffer2[] = {0x00, 0x04, 0x08, 0x0c, 0x10, 0x14}; - if (!gUnknown_02039CE8->var_52A) + if (sData->cardType == CARD_TYPE_FR) { for (i = 0; i < 6; i++) { - if (gUnknown_02039CE8->var_534.monSpecies[i]) + if (sData->trainerCard.monSpecies[i]) { - u8 monSpecies = sub_80D30A0(gUnknown_02039CE8->var_534.monSpecies[i]); + u8 monSpecies = sub_80D30A0(sData->trainerCard.monSpecies[i]); WriteSequenceToBgTilemapBuffer(3, 16 * i + 224, buffer2[i] + 3, 15, 4, 4, buffer[monSpecies], 1); } } } } -void sub_80C41D8(void) +static void sub_80C41D8(void) { u8 i; - CpuSet(gMonIconPalettes, gUnknown_02039CE8->var_468, 0x60); - switch (gUnknown_02039CE8->var_534.var_4E) + CpuSet(gMonIconPalettes, sData->var_468, 0x60); + switch (sData->trainerCard.var_4E) { case 0: break; case 1: - TintPalette_CustomTone(gUnknown_02039CE8->var_468, 96, 0, 0, 0); + TintPalette_CustomTone(sData->var_468, 96, 0, 0, 0); break; case 2: - TintPalette_CustomTone(gUnknown_02039CE8->var_468, 96, 500, 330, 310); + TintPalette_CustomTone(sData->var_468, 96, 500, 330, 310); break; case 3: - TintPalette_SepiaTone(gUnknown_02039CE8->var_468, 96); + TintPalette_SepiaTone(sData->var_468, 96); break; } - LoadPalette(gUnknown_02039CE8->var_468, 80, 192); + LoadPalette(sData->var_468, 80, 192); for (i = 0; i < 6; i++) { - if (gUnknown_02039CE8->var_534.monSpecies[i]) - LoadBgTiles(3, GetMonIconTiles(gUnknown_02039CE8->var_534.monSpecies[i], 0), 512, 16 * i + 32); + if (sData->trainerCard.monSpecies[i]) + LoadBgTiles(3, GetMonIconTiles(sData->trainerCard.monSpecies[i], 0), 512, 16 * i + 32); } } -void sub_80C42A4(void) +static void sub_80C42A4(void) { u8 i; - u8 buffer[4]; - memcpy(buffer, gUnknown_0856FB74, sizeof(gUnknown_0856FB74)); - if (!gUnknown_02039CE8->var_52A && gUnknown_02039CE8->var_534.var_4C == 1) + u8 buffer[4] = {0x0b, 0x0c, 0x0d, 0x0e}; + + if (sData->cardType == CARD_TYPE_FR && sData->trainerCard.var_4C == 1) { for (i = 0; i < 3; i++) { - u8 var_50 = gUnknown_02039CE8->var_534.var_50[i]; - if (gUnknown_02039CE8->var_534.var_50[i]) + u8 var_50 = sData->trainerCard.var_50[i]; + if (sData->trainerCard.var_50[i]) WriteSequenceToBgTilemapBuffer(3, i * 4 + 320, i * 3 + 2, 2, 2, 2, buffer[var_50 - 1], 1); } } } -void sub_80C4330(void) +static void sub_80C4330(void) { LoadPalette(gUnknown_0856F54C, 176, 32); LoadPalette(gUnknown_0856F56C, 192, 32); LoadPalette(gUnknown_0856F58C, 208, 32); LoadPalette(gUnknown_0856F5AC, 224, 32); - LoadBgTiles(3, gUnknown_02039CE8->var_17A8, 1024, 128); + LoadBgTiles(3, sData->var_17A8, 1024, 128); } -void sub_80C438C(u8 windowId) +static void sub_80C438C(u8 windowId) { PutWindowTilemap(windowId); CopyWindowToVram(windowId, 3); } -u8 sub_80C43A8(void) +static u8 SetCardBgsAndPals(void) { - switch (gUnknown_02039CE8->var_3) + switch (sData->bgPalLoadState) { case 0: - LoadBgTiles(3, gUnknown_02039CE8->var_13A8, 1024, 0); + LoadBgTiles(3, sData->var_13A8, 1024, 0); break; case 1: - LoadBgTiles(0, gUnknown_02039CE8->var_19A8, 6144, 0); + LoadBgTiles(0, sData->var_19A8, 6144, 0); break; case 2: - if (gUnknown_02039CE8->var_52A) + if (sData->cardType != CARD_TYPE_FR) { - LoadPalette(gEmeraldTrainerCardStarPals[gUnknown_02039CE8->var_534.stars], 0, 96); + LoadPalette(gEmeraldTrainerCardStarPals[sData->trainerCard.stars], 0, 96); LoadPalette(gUnknown_0856F4EC, 48, 32); - if (gUnknown_02039CE8->var_534.gender) + if (sData->trainerCard.gender) LoadPalette(gUnknown_0856F4AC, 16, 32); } else { - LoadPalette(gFireRedTrainerCardStarPals[gUnknown_02039CE8->var_534.stars], 0, 96); + LoadPalette(gFireRedTrainerCardStarPals[sData->trainerCard.stars], 0, 96); LoadPalette(gUnknown_0856F50C, 48, 32); - if (gUnknown_02039CE8->var_534.gender) + if (sData->trainerCard.gender) LoadPalette(gUnknown_0856F4CC, 16, 32); } LoadPalette(gUnknown_0856F52C, 64, 32); break; case 3: - SetBgTilemapBuffer(0, gUnknown_02039CE8->var_3CA8); - SetBgTilemapBuffer(2, gUnknown_02039CE8->var_5CA8); + SetBgTilemapBuffer(0, sData->var_3CA8); + SetBgTilemapBuffer(2, sData->var_5CA8); break; case 4: FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 32, 32); @@ -1331,14 +1417,14 @@ u8 sub_80C43A8(void) default: return 1; } - gUnknown_02039CE8->var_3++; + sData->bgPalLoadState++; return 0; } -void sub_80C4550(u16 *ptr) +static void sub_80C4550(u16 *ptr) { s16 i, j; - u16 *dst = gUnknown_02039CE8->var_5CA8; + u16 *dst = sData->var_5CA8; for (i = 0; i < 20; i++) { @@ -1353,10 +1439,10 @@ void sub_80C4550(u16 *ptr) CopyBgTilemapBufferToVram(2); } -void sub_80C45C0(u16* ptr) +static void sub_80C45C0(u16* ptr) { s16 i, j; - u16 *dst = gUnknown_02039CE8->var_3CA8; + u16 *dst = sData->var_3CA8; for (i = 0; i < 20; i++) { @@ -1371,19 +1457,21 @@ void sub_80C45C0(u16* ptr) CopyBgTilemapBufferToVram(0); } -void sub_80C4630(void) +static const u8 gUnknown_0856FB78[] = {7, 7}; + +static void sub_80C4630(void) { s16 i, x; u16 tileNum = 192; u8 palNum = 3; - FillBgTilemapBufferRect(3, 143, 15, gUnknown_0856FB78[gUnknown_02039CE8->var_52B], gUnknown_02039CE8->var_534.stars, 1, 4); - if (!gUnknown_02039CE8->var_5) + FillBgTilemapBufferRect(3, 143, 15, gUnknown_0856FB78[sData->isHoenn], sData->trainerCard.stars, 1, 4); + if (!sData->isLink) { x = 4; for (i = 0; i < 8; i++, tileNum += 2, x += 3) { - if (gUnknown_02039CE8->badgeCount[i]) + if (sData->badgeCount[i]) { FillBgTilemapBufferRect(3, tileNum, x, 15, 1, 1, palNum); FillBgTilemapBufferRect(3, tileNum + 1, x + 1, 15, 1, 1, palNum); @@ -1395,21 +1483,21 @@ void sub_80C4630(void) CopyBgTilemapBufferToVram(3); } -void sub_80C474C(void) +static void sub_80C474C(void) { - if (!gUnknown_02039CE8->var_52A) + if (sData->cardType == CARD_TYPE_FR) { - if (gUnknown_02039CE8->var_10) + if (sData->hasTrades) { FillBgTilemapBufferRect(3, 141, 27, 9, 1, 1, 1); FillBgTilemapBufferRect(3, 157, 27, 10, 1, 1, 1); } - if (gUnknown_02039CE8->var_534.var_3C) + if (sData->trainerCard.berruCrushPoints) { FillBgTilemapBufferRect(3, 141, 21, 13, 1, 1, 1); FillBgTilemapBufferRect(3, 157, 21, 14, 1, 1, 1); } - if (gUnknown_02039CE8->var_534.var_40) + if (sData->trainerCard.unionRoomNum) { FillBgTilemapBufferRect(3, 141, 27, 11, 1, 1, 1); FillBgTilemapBufferRect(3, 157, 27, 12, 1, 1, 1); @@ -1417,17 +1505,17 @@ void sub_80C474C(void) } else { - if (gUnknown_02039CE8->var_10) + if (sData->hasTrades) { FillBgTilemapBufferRect(3, 141, 27, 9, 1, 1, 0); FillBgTilemapBufferRect(3, 157, 27, 10, 1, 1, 0); } - if (gUnknown_02039CE8->var_534.contestsWithFriends) + if (sData->trainerCard.contestsWithFriends) { FillBgTilemapBufferRect(3, 141, 27, 13, 1, 1, 0); FillBgTilemapBufferRect(3, 157, 27, 14, 1, 1, 0); } - if (gUnknown_02039CE8->var_D) + if (sData->hasBattleTowerWins) { FillBgTilemapBufferRect(3, 141, 17, 15, 1, 1, 0); FillBgTilemapBufferRect(3, 157, 17, 16, 1, 1, 0); @@ -1438,13 +1526,13 @@ void sub_80C474C(void) CopyBgTilemapBufferToVram(3); } -void sub_80C48C8(void) +static void sub_80C48C8(void) { - if (++gUnknown_02039CE8->var_6 > 60) + if (++sData->var_6 > 60) { - gUnknown_02039CE8->var_6 = 0; - gUnknown_02039CE8->var_7 ^= 1; - gUnknown_02039CE8->var_529 = 1; + sData->var_6 = 0; + sData->var_7 ^= 1; + sData->var_529 = 1; } } @@ -1454,14 +1542,14 @@ u8 sub_80C4904(u8 cardId) return trainerCards[cardId].stars; } -void sub_80C4918(void) +static void sub_80C4918(void) { u8 taskId = CreateTask(sub_80C4960, 0); sub_80C4960(taskId); - SetHBlankCallback(sub_80C26D4); + SetHBlankCallback(HblankCb_TrainerCard); } -bool8 sub_80C4940(void) +static bool8 sub_80C4940(void) { if (FindTaskIdByFunc(sub_80C4960) == 0xFF) return TRUE; @@ -1469,13 +1557,13 @@ bool8 sub_80C4940(void) return FALSE; } -void sub_80C4960(u8 taskId) +static void sub_80C4960(u8 taskId) { while(gUnknown_0856FB28[gTasks[taskId].data[0]](&gTasks[taskId])) ; } -bool8 sub_80C4998(struct Task* task) +static bool8 sub_80C4998(struct Task* task) { u32 i; @@ -1488,3 +1576,282 @@ bool8 sub_80C4998(struct Task* task) task->data[0]++; return FALSE; } + +static bool8 sub_80C49D8(struct Task* task) +{ + u32 r4, r5, r10, r7, r6, var_24, r9, var; + s16 i; + + sData->allowDMACopy = FALSE; + if (task->data[1] >= 77) + task->data[1] = 77; + else + task->data[1] += 7; + + sData->var_7CA8 = task->data[1]; + sub_80C32EC(task->data[1]); + + // ??? + r7 = task->data[1]; + r9 = 160 - r7; + r4 = r9 - r7; + r6 = -r7 << 16; + r5 = 0xA00000 / r4; + r5 += 0xFFFF0000; + var_24 = r6; + var_24 += r5 * r4; + r10 = r5 / r4; + r5 *= 2; + + for (i = 0; i < r7; i++) + gScanlineEffectRegBuffers[0][i] = -i; + for (; i < (s16)(r9); i++) + { + var = r6 >> 16; + r6 += r5; + r5 -= r10; + gScanlineEffectRegBuffers[0][i] = var; + } + var = var_24 >> 16; + for (; i < 160; i++) + gScanlineEffectRegBuffers[0][i] = var; + + sData->allowDMACopy = TRUE; + if (task->data[1] >= 77) + task->data[0]++; + + return FALSE; +} + +static bool8 sub_80C4B08(struct Task* task) +{ + sData->allowDMACopy = FALSE; + if (sub_8087598() == TRUE) + return FALSE; + + do + { + switch (sData->var_4) + { + case 0: + FillWindowPixelBuffer(1, 0); + FillBgTilemapBufferRect_Palette0(3, 0, 0, 0, 0x20, 0x20); + break; + case 1: + if (!sData->var_8) + { + if (!PrintStringsOnCardPage2()) + return FALSE; + } + else + { + if (!PrintAllOnCardPage1()) + return FALSE; + } + break; + case 2: + if (!sData->var_8) + sub_80C45C0(sData->var_A48); + else + sub_80C438C(1); + break; + case 3: + if (!sData->var_8) + sub_80C474C(); + else + FillWindowPixelBuffer(2, 0); + break; + case 4: + if (sData->var_8) + sub_80C4FF0(); + break; + default: + task->data[0]++; + sData->allowDMACopy = TRUE; + sData->var_4 = 0; + return FALSE; + } + sData->var_4++; + } while (gReceivedRemoteLinkPlayers == 0); + + return FALSE; +} + +static bool8 sub_80C4C1C(struct Task* task) +{ + sData->allowDMACopy = FALSE; + if (sData->var_8) + { + sub_80C438C(2); + sub_80C4550(sData->var_EF8); + sub_80C45C0(sData->var_598); + sub_80C4630(); + } + sub_80C438C(1); + sData->var_8 ^= 1; + task->data[0]++; + sData->allowDMACopy = TRUE; + PlaySE(SE_RG_CARD2); + return FALSE; +} + +static bool8 sub_80C4C84(struct Task* task) +{ + u32 r4, r5, r10, r7, r6, var_24, r9, var; + s16 i; + + sData->allowDMACopy = FALSE; + if (task->data[1] <= 5) + task->data[1] = 0; + else + task->data[1] -= 5; + + sData->var_7CA8 = task->data[1]; + sub_80C32EC(task->data[1]); + + // ??? + r7 = task->data[1]; + r9 = 160 - r7; + r4 = r9 - r7; + r6 = -r7 << 16; + r5 = 0xA00000 / r4; + r5 += 0xFFFF0000; + var_24 = r6; + var_24 += r5 * r4; + r10 = r5 / r4; + r5 /= 2; + + for (i = 0; i < r7; i++) + gScanlineEffectRegBuffers[0][i] = -i; + for (; i < (s16)(r9); i++) + { + var = r6 >> 16; + r6 += r5; + r5 += r10; + gScanlineEffectRegBuffers[0][i] = var; + } + var = var_24 >> 16; + for (; i < 160; i++) + gScanlineEffectRegBuffers[0][i] = var; + + sData->allowDMACopy = TRUE; + if (task->data[1] <= 0) + task->data[0]++; + + return FALSE; +} + +static bool8 sub_80C4DB0(struct Task *task) +{ + ShowBg(1); + ShowBg(3); + SetHBlankCallback(NULL); + DestroyTask(FindTaskIdByFunc(sub_80C4960)); + return FALSE; +} + +void ShowPlayerTrainerCard(void (*callback)(void)) +{ + sData = AllocZeroed(sizeof(*sData)); + sData->callback2 = callback; + if (callback == sub_80C5868) + sData->var_52C = 0x7FFF; + else + sData->var_52C = 0; + + if (InUnionRoom() == TRUE) + sData->isLink = TRUE; + else + sData->isLink = FALSE; + + sData->language = LANGUAGE_ENGLISH; + sub_80C3020(&sData->trainerCard); + SetMainCallback2(CB2_InitTrainerCard); +} + +void ShowTrainerCardInLink(u8 cardId, void (*callback)(void)) +{ + sData = AllocZeroed(sizeof(*sData)); + sData->callback2 = callback; + sData->isLink = TRUE; + sData->trainerCard = gTrainerCards[cardId]; + sData->language = gLinkPlayers[cardId].language; + SetMainCallback2(CB2_InitTrainerCard); +} + +static void sub_80C4EE4(void) +{ + u8 i; + + sData->var_0 = 0; + sData->var_6 = gSaveBlock2Ptr->playTimeVBlanks; + sData->var_7 = 0; + sData->var_8 = 0; + sData->var_528 = 0; + sData->cardType = GetSetCardType(); + for (i = 0; i < 4; i++) + CopyEasyChatWord(sData->var_19[i], sData->trainerCard.var_28[i]); +} + +static u8 GetSetCardType(void) +{ + if (sData == NULL) + { + if (gGameVersion == VERSION_FIRE_RED || gGameVersion == VERSION_LEAF_GREEN) + return CARD_TYPE_FR; + else if (gGameVersion == VERSION_EMERALD) + return CARD_TYPE_EMERALD; + else + return CARD_TYPE_RUBY; + } + else + { + if (sData->trainerCard.version == VERSION_FIRE_RED || sData->trainerCard.version == VERSION_LEAF_GREEN) + { + sData->isHoenn = FALSE; + return CARD_TYPE_FR; + } + else if (sData->trainerCard.version == VERSION_EMERALD) + { + sData->isHoenn = TRUE; + return CARD_TYPE_EMERALD; + } + else + { + sData->isHoenn = TRUE; + return CARD_TYPE_RUBY; + } + } +} + +static u8 VersionToCardType(u8 version) +{ + if (version == VERSION_FIRE_RED || version == VERSION_LEAF_GREEN) + return CARD_TYPE_FR; + else if (version == VERSION_EMERALD) + return CARD_TYPE_EMERALD; + else + return CARD_TYPE_RUBY; +} + +static void sub_80C4FF0(void) +{ + if (InUnionRoom() == TRUE && gReceivedRemoteLinkPlayers == 1) + { + sub_818D938(FacilityClassToPicIndex(sData->trainerCard.var_4F), + TRUE, + gUnknown_0856FB18[sData->isHoenn][sData->trainerCard.gender][0], + gUnknown_0856FB18[sData->isHoenn][sData->trainerCard.gender][1], + 8, + 2); + } + else + { + sub_818D938(FacilityClassToPicIndex(gUnknown_0856FB20[sData->cardType][sData->trainerCard.gender]), + TRUE, + gUnknown_0856FB18[sData->isHoenn][sData->trainerCard.gender][0], + gUnknown_0856FB18[sData->isHoenn][sData->trainerCard.gender][1], + 8, + 2); + } +} diff --git a/sym_ewram.txt b/sym_ewram.txt index 7b5b6663e..75a44bb97 100644 --- a/sym_ewram.txt +++ b/sym_ewram.txt @@ -153,8 +153,7 @@ gUnknown_02039B6E: @ 2039B6E gUnknown_02039B88: @ 2039B88 .space 0x160 -gUnknown_02039CE8: @ 2039CE8 - .space 0x4 + .include "src/trainer_card.o" gUnknown_02039CEC: @ 2039CEC .space 0x4 From 75a1c022dd2b1d76559d2ae3141713e9045bb5dc Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sun, 20 Jan 2019 18:48:29 +0100 Subject: [PATCH 06/16] Make trainer card compile --- src/trade.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/trade.c b/src/trade.c index 7af1e19c9..99c9f6088 100644 --- a/src/trade.c +++ b/src/trade.c @@ -49,6 +49,8 @@ #define Trade_SendData(ptr) (SendBlock(bitmask_all_link_players_but_self(), ptr->linkData, 20)) +extern void sub_80C6D80(const u8 *, u8 *, u8, u8, u8); + struct InGameTrade { /*0x00*/ u8 name[11]; /*0x0C*/ u16 species; From 261955b6ed39fd40f9f70d8e2055db60415054e4 Mon Sep 17 00:00:00 2001 From: garak Date: Mon, 21 Jan 2019 11:55:27 -0500 Subject: [PATCH 07/16] trainer hill easy chat constants --- src/data/battle_frontier/trainer_hill.h | 9686 +++++++++++------------ src/trainer_hill.c | 1 + 2 files changed, 4844 insertions(+), 4843 deletions(-) diff --git a/src/data/battle_frontier/trainer_hill.h b/src/data/battle_frontier/trainer_hill.h index eb988b721..ca0d623e9 100644 --- a/src/data/battle_frontier/trainer_hill.h +++ b/src/data/battle_frontier/trainer_hill.h @@ -2,4856 +2,4856 @@ static const struct TrHillTag sDataTagNormal = { - .unkField_0 = 8, - .unused1 = 2, - .unkField_2 = 4, - .unused3 = 0, - .unused4 = 5, - .unused5 = 30, - .unused6 = 5, - .floors = - { - [0] = - { - .unk0 = 0x11, - .unk1 = 0x12, - .trainers = - { - [0] = - { - .name = _("ALAINA"), - .facilityClass = FACILITY_CLASS_HEX_MANIAC, - .unused = 0, - .speechBefore = {0xA02, 0x1016, 0x161A, 0x1022, 0x102F, 0x1627}, - .speechWin = {0x1020, 0x2207, 0x1431, 0x61E, 0x1404, 0x161B}, - .speechLose = {0x1E0F, 0xE20, 0x1020, 0x24AB, 0xC00, 0xFFFF}, - .speechAfter = {0xA01, 0x1000, 0x162F, 0x1037, 0xE0D, 0x400}, - .mons = - { - [0] = - { - .species = SPECIES_MISDREAVUS, - .heldItem = ITEM_BRIGHT_POWDER, - .moves = {MOVE_SHADOW_BALL, MOVE_PSYCHIC, MOVE_THUNDERBOLT, MOVE_CONFUSE_RAY}, - .level = 0, - .ppBonuses = 0, - .attackEV = 155, - .speedEV = 255, - .spAttackEV = 100, - .otId = TRAINER_HILL_OTID, - .hpIV = 24, - .attackIV = 24, - .defenseIV = 24, - .speedIV = 24, - .spAttackIV = 24, - .spDefenseIV = 24, - .altAbility = 0, - .personality = 0x0, - .nickname = _("MISDREAVUS"), - .friendship = 255, - }, - [1] = - { - .species = SPECIES_SOLROCK, - .heldItem = ITEM_FOCUS_BAND, - .moves = {MOVE_PSYCHIC, MOVE_FLAMETHROWER, MOVE_ROCK_SLIDE, MOVE_CALM_MIND}, - .level = 0, - .ppBonuses = 0, - .hpEV = 200, - .defenseEV = 100, - .spAttackEV = 110, - .spDefenseEV = 100, - .otId = TRAINER_HILL_OTID, - .hpIV = 24, - .attackIV = 24, - .defenseIV = 24, - .speedIV = 24, - .spAttackIV = 24, - .spDefenseIV = 24, - .altAbility = 0, - .personality = 0xF, - .nickname = _("SOLROCK"), - .friendship = 255, - }, - [2] = - { - .species = SPECIES_CLAYDOL, - .heldItem = ITEM_SHELL_BELL, - .moves = {MOVE_EARTHQUAKE, MOVE_PSYCHIC, MOVE_SHADOW_BALL, MOVE_ICE_BEAM}, - .level = 0, - .ppBonuses = 0, - .hpEV = 255, - .defenseEV = 135, - .spDefenseEV = 120, - .otId = TRAINER_HILL_OTID, - .hpIV = 24, - .attackIV = 24, - .defenseIV = 24, - .speedIV = 24, - .spAttackIV = 24, - .spDefenseIV = 24, - .altAbility = 0, - .personality = 0xC, - .nickname = _("CLAYDOL"), - .friendship = 255, - }, - [3] = - { - .species = SPECIES_WEEZING, - .heldItem = ITEM_SALAC_BERRY, - .moves = {MOVE_SLUDGE_BOMB, MOVE_SHADOW_BALL, MOVE_FRUSTRATION, MOVE_DESTINY_BOND}, - .level = 0, - .ppBonuses = 0, - .hpEV = 110, - .attackEV = 200, - .spDefenseEV = 200, - .otId = TRAINER_HILL_OTID, - .hpIV = 24, - .attackIV = 24, - .defenseIV = 24, - .speedIV = 24, - .spAttackIV = 24, - .spDefenseIV = 24, - .altAbility = 0, - .personality = 0x80, - .nickname = _("WEEZING"), - .friendship = 0, - }, - [4] = - { - .species = SPECIES_LUNATONE, - .heldItem = ITEM_FOCUS_BAND, - .moves = {MOVE_PSYCHIC, MOVE_ICE_BEAM, MOVE_ROCK_SLIDE, MOVE_CALM_MIND}, - .level = 0, - .ppBonuses = 0, - .hpEV = 200, - .defenseEV = 100, - .spAttackEV = 110, - .spDefenseEV = 100, - .otId = TRAINER_HILL_OTID, - .hpIV = 24, - .attackIV = 24, - .defenseIV = 24, - .speedIV = 24, - .spAttackIV = 24, - .spDefenseIV = 24, - .altAbility = 0, - .personality = 0xF, - .nickname = _("LUNATONE"), - .friendship = 255, - }, - [5] = - { - .species = SPECIES_FLYGON, - .heldItem = ITEM_CHOICE_BAND, - .moves = {MOVE_EARTHQUAKE, MOVE_DRAGON_CLAW, MOVE_CRUNCH, MOVE_FLAMETHROWER}, - .level = 0, - .ppBonuses = 0, - .attackEV = 155, - .speedEV = 255, - .spAttackEV = 100, - .otId = TRAINER_HILL_OTID, - .hpIV = 24, - .attackIV = 24, - .defenseIV = 24, - .speedIV = 24, - .spAttackIV = 24, - .spDefenseIV = 24, - .altAbility = 0, - .personality = 0x83, - .nickname = _("FLYGON"), - .friendship = 255, - }, - }, - }, - [1] = - { - .name = _("ALFONSO"), - .facilityClass = FACILITY_CLASS_CYCLING_TRIATHLETE_M, - .unused = 0, - .speechBefore = {0xA01, 0x121E, 0x1647, 0x1020, 0x180F, 0xFFFF}, - .speechWin = {0xA29, 0xE09, 0x2630, 0x102C, 0xA28, 0x1A15}, - .speechLose = {0xA28, 0x1A15, 0xC00, 0xA07, 0x201F, 0x1029}, - .speechAfter = {0x1020, 0x1A15, 0x1028, 0xE39, 0x180F, 0xC00}, - .mons = - { - [0] = - { - .species = SPECIES_SEALEO, - .heldItem = ITEM_NEVER_MELT_ICE, - .moves = {MOVE_BLIZZARD, MOVE_ICE_BALL, MOVE_ENCORE, MOVE_HAIL}, - .level = 0, - .ppBonuses = 0, - .hpEV = 255, - .spAttackEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0xF, - .nickname = _("SEALEO"), - .friendship = 255, - }, - [1] = - { - .species = SPECIES_AMPHAROS, - .heldItem = ITEM_MAGNET, - .moves = {MOVE_THUNDER, MOVE_THUNDER_WAVE, MOVE_COTTON_SPORE, MOVE_LIGHT_SCREEN}, - .level = 0, - .ppBonuses = 0, - .speedEV = 255, - .spAttackEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0xF, - .nickname = _("AMPHAROS"), - .friendship = 255, - }, - [2] = - { - .species = SPECIES_MACHOKE, - .heldItem = ITEM_BLACK_BELT, - .moves = {MOVE_DYNAMIC_PUNCH, MOVE_MUD_SLAP, MOVE_COUNTER, MOVE_SCARY_FACE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 255, - .attackEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x4E, - .nickname = _("MACHOKE"), - .friendship = 255, - }, - [3] = - { - .species = SPECIES_FLAREON, - .heldItem = ITEM_CHARCOAL, - .moves = {MOVE_FIRE_BLAST, MOVE_BITE, MOVE_QUICK_ATTACK, MOVE_SAND_ATTACK}, - .level = 0, - .ppBonuses = 0, - .speedEV = 255, - .spAttackEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x28, - .nickname = _("FLAREON"), - .friendship = 255, - }, - [4] = - { - .species = SPECIES_MAGNETON, - .heldItem = ITEM_MAGNET, - .moves = {MOVE_ZAP_CANNON, MOVE_THUNDER_WAVE, MOVE_SCREECH, MOVE_METAL_SOUND}, - .level = 0, - .ppBonuses = 0, - .speedEV = 255, - .spAttackEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x0, - .nickname = _("MAGNETON"), - .friendship = 255, - }, - [5] = - { - .species = SPECIES_PINSIR, - .heldItem = ITEM_QUICK_CLAW, - .moves = {MOVE_GUILLOTINE, MOVE_BRICK_BREAK, MOVE_SWAGGER, MOVE_FAINT_ATTACK}, - .level = 0, - .ppBonuses = 0, - .hpEV = 200, - .defenseEV = 155, - .spDefenseEV = 155, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x85, - .nickname = _("PINSIR"), - .friendship = 255, - }, - }, - }, - }, - .data = {0x31, 0x3B, 0x35, 0x35, 0x26, 0x26, 0x1B, 0x1C, 0x1D, 0x25, 0x26, 0x3A, 0x3B, 0x35, 0x3B, 0x8, 0x31, 0x3B, 0x2C, 0x2C, 0x2C, 0x2B, 0x24, 0x24, 0x24, 0x24, 0x2C, 0x3B, 0x3B, 0x2C, 0x3B, 0x8, 0x2D, 0x3B, 0x3B, 0x3B, 0x3B, 0x2B, 0x3B, 0x3B, 0x3B, 0x3B, 0x35, 0x3B, 0x35, 0x35, 0x3B, 0x8, 0x33, 0x3B, 0x32, 0x21, 0x30, 0x2B, 0x3B, 0x32, 0x21, 0x30, 0x2B, 0x3B, 0x2C, 0x2B, 0x3B, 0x8, 0x33, 0x35, 0x3B, 0x3B, 0x3B, 0x2C, 0x35, 0x3B, 0x3B, 0x3B, 0x2B, 0x3B, 0x3B, 0x2B, 0x3B, 0x8, 0x34, 0x2C, 0x3B, 0x32, 0x21, 0x30, 0x2B, 0x32, 0x30, 0x3B, 0x2B, 0x32, 0x30, 0x2C, 0x3B, 0x8, 0x31, 0x35, 0x3B, 0x3B, 0x35, 0x3B, 0x2C, 0x3B, 0x3B, 0x35, 0x2C, 0x3B, 0x3B, 0x35, 0x35, 0x8, 0x31, 0x2C, 0x32, 0x30, 0x2B, 0x32, 0x30, 0x35, 0x3B, 0x2B, 0x32, 0x21, 0x30, 0x2C, 0x2C, 0x8, 0x31, 0x35, 0x3B, 0x3B, 0x2B, 0x3B, 0x3B, 0x2B, 0x3B, 0x2C, 0x3B, 0x35, 0x3B, 0x3B, 0x3B, 0x8, 0x31, 0x2C, 0x32, 0x30, 0x2B, 0x32, 0x30, 0x2B, 0x3B, 0x32, 0x30, 0x2B, 0x32, 0x30, 0x3B, 0x8, 0x31, 0x35, 0x35, 0x35, 0x2B, 0x3B, 0x3B, 0x2B, 0x3B, 0x3B, 0x35, 0x2B, 0x3B, 0x35, 0x35, 0x8, 0x31, 0x2B, 0x2C, 0x2C, 0x2C, 0x32, 0x30, 0x2B, 0x32, 0x30, 0x2C, 0x2C, 0x3B, 0x2C, 0x2C, 0x8, 0x31, 0x2B, 0x3B, 0x3B, 0x35, 0x3B, 0x3B, 0x2B, 0x3B, 0x3B, 0x35, 0x3B, 0x3B, 0x3B, 0x3B, 0x8, 0x31, 0x2C, 0x32, 0x30, 0x2B, 0x3B, 0x3B, 0x2C, 0x32, 0x30, 0x2C, 0x32, 0x30, 0x3B, 0x35, 0x8, 0x31, 0x3B, 0x3B, 0x3B, 0x2C, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x2C, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8}, - .unk3A0 = {0x381, 0x3FE5, 0x401, 0xBDED, 0x8425, 0xDFBD, 0x221, 0x7E7F, 0x941, 0x7F7D, 0x911, 0x7FF7, 0x4101, 0x79F9, 0x803, 0xFFFF}, - .coords = {27, 45}, - .direction = 0x21, - .range = 0x21, - }, - [1] = - { - .unk0 = 0x13, - .unk1 = 0x14, - .trainers = - { - [0] = - { - .name = _("THEODORE"), - .facilityClass = FACILITY_CLASS_BLACK_BELT, - .unused = 0, - .speechBefore = {0xA28, 0x61E, 0x1000, 0x2617, 0xA02, 0xC00}, - .speechWin = {0xC0A, 0xC28, 0xC00, 0xC0A, 0xC28, 0xC01}, - .speechLose = {0xA01, 0x160A, 0x1036, 0x1029, 0x1039, 0x122F}, - .speechAfter = {0x2801, 0xA02, 0x1A35, 0x1232, 0xE15, 0x614}, - .mons = - { - [0] = - { - .species = SPECIES_MEDITITE, - .heldItem = ITEM_FOCUS_BAND, - .moves = {MOVE_FOCUS_PUNCH, MOVE_PROTECT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .attackEV = 252, - .spDefenseEV = 6, - .otId = TRAINER_HILL_OTID, - .hpIV = 20, - .attackIV = 20, - .defenseIV = 20, - .speedIV = 20, - .spAttackIV = 20, - .spDefenseIV = 20, - .altAbility = 0, - .personality = 0x80, - .nickname = _("MEDITITE"), - .friendship = 255, - }, - [1] = - { - .species = SPECIES_HERACROSS, - .heldItem = ITEM_FOCUS_BAND, - .moves = {MOVE_FOCUS_PUNCH, MOVE_PROTECT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .attackEV = 252, - .spDefenseEV = 6, - .otId = TRAINER_HILL_OTID, - .hpIV = 20, - .attackIV = 20, - .defenseIV = 20, - .speedIV = 20, - .spAttackIV = 20, - .spDefenseIV = 20, - .altAbility = 1, - .personality = 0x80, - .nickname = _("HERACROSS"), - .friendship = 255, - }, - [2] = - { - .species = SPECIES_HITMONTOP, - .heldItem = ITEM_SHELL_BELL, - .moves = {MOVE_FOCUS_PUNCH, MOVE_PROTECT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .attackEV = 252, - .spDefenseEV = 6, - .otId = TRAINER_HILL_OTID, - .hpIV = 20, - .attackIV = 20, - .defenseIV = 20, - .speedIV = 20, - .spAttackIV = 20, - .spDefenseIV = 20, - .altAbility = 0, - .personality = 0x3, - .nickname = _("HITMONTOP"), - .friendship = 255, - }, - [3] = - { - .species = SPECIES_MACHOP, - .heldItem = ITEM_SALAC_BERRY, - .moves = {MOVE_FOCUS_PUNCH, MOVE_REVENGE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .attackEV = 252, - .spDefenseEV = 6, - .otId = TRAINER_HILL_OTID, - .hpIV = 20, - .attackIV = 20, - .defenseIV = 20, - .speedIV = 20, - .spAttackIV = 20, - .spDefenseIV = 20, - .altAbility = 0, - .personality = 0x4E, - .nickname = _("MACHOP"), - .friendship = 255, - }, - [4] = - { - .species = SPECIES_PINSIR, - .heldItem = ITEM_SALAC_BERRY, - .moves = {MOVE_FOCUS_PUNCH, MOVE_REVENGE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .attackEV = 252, - .spDefenseEV = 6, - .otId = TRAINER_HILL_OTID, - .hpIV = 20, - .attackIV = 20, - .defenseIV = 20, - .speedIV = 20, - .spAttackIV = 20, - .spDefenseIV = 20, - .altAbility = 0, - .personality = 0x80, - .nickname = _("PINSIR"), - .friendship = 255, - }, - [5] = - { - .species = SPECIES_HITMONCHAN, - .heldItem = ITEM_FOCUS_BAND, - .moves = {MOVE_FOCUS_PUNCH, MOVE_REVENGE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .attackEV = 252, - .spDefenseEV = 6, - .otId = TRAINER_HILL_OTID, - .hpIV = 20, - .attackIV = 20, - .defenseIV = 20, - .speedIV = 20, - .spAttackIV = 20, - .spDefenseIV = 20, - .altAbility = 0, - .personality = 0x3, - .nickname = _("HITMONCHAN"), - .friendship = 255, - }, - }, - }, - [1] = - { - .name = _("JAYDEN"), - .facilityClass = FACILITY_CLASS_POKEMON_BREEDER_F, - .unused = 0, - .speechBefore = {0xA4A, 0x1E04, 0xA02, 0x1015, 0x1018, 0x1437}, - .speechWin = {0xA02, 0x606, 0x102E, 0x1020, 0x1809, 0xFFFF}, - .speechLose = {0xA3D, 0x162D, 0x606, 0x140B, 0xC03, 0xFFFF}, - .speechAfter = {0x1026, 0xA01, 0x140F, 0x1020, 0xA0C, 0xA33}, - .mons = - { - [0] = - { - .species = SPECIES_VULPIX, - .heldItem = ITEM_LUM_BERRY, - .moves = {MOVE_WILL_O_WISP, MOVE_CONFUSE_RAY, MOVE_TAIL_WHIP, MOVE_OVERHEAT}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .defenseEV = 252, - .spDefenseEV = 6, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0xF, - .nickname = _("VULPIX"), - .friendship = 255, - }, - [1] = - { - .species = SPECIES_MINUN, - .heldItem = ITEM_FOCUS_BAND, - .moves = {MOVE_THUNDER_WAVE, MOVE_CHARM, MOVE_ENCORE, MOVE_SPARK}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .defenseEV = 252, - .spAttackEV = 6, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x8C, - .nickname = _("MINUN"), - .friendship = 255, - }, - [2] = - { - .species = SPECIES_ROSELIA, - .heldItem = ITEM_LUM_BERRY, - .moves = {MOVE_TOXIC, MOVE_LEECH_SEED, MOVE_SWEET_SCENT, MOVE_GIGA_DRAIN}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .defenseEV = 252, - .spAttackEV = 6, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 1, - .personality = 0xF, - .nickname = _("ROSELIA"), - .friendship = 255, - }, - [3] = - { - .species = SPECIES_MR_MIME, - .heldItem = ITEM_SITRUS_BERRY, - .moves = {MOVE_SAFEGUARD, MOVE_REFLECT, MOVE_LIGHT_SCREEN, MOVE_PSYCHIC}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .defenseEV = 252, - .spDefenseEV = 6, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x82, - .nickname = _("MR. MIME"), - .friendship = 255, - }, - [4] = - { - .species = SPECIES_PLUSLE, - .heldItem = ITEM_SITRUS_BERRY, - .moves = {MOVE_RAIN_DANCE, MOVE_LIGHT_SCREEN, MOVE_HELPING_HAND, MOVE_THUNDER}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .defenseEV = 252, - .spDefenseEV = 6, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x5, - .nickname = _("PLUSLE"), - .friendship = 255, - }, - [5] = - { - .species = SPECIES_TOGEPI, - .heldItem = ITEM_SITRUS_BERRY, - .moves = {MOVE_LIGHT_SCREEN, MOVE_REFLECT, MOVE_FOLLOW_ME, MOVE_METRONOME}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .defenseEV = 252, - .spDefenseEV = 6, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 1, - .personality = 0x37, - .nickname = _("TOGEPI"), - .friendship = 255, - }, - }, - }, - }, - .data = {0xD1, 0xD5, 0xD5, 0xD5, 0xD9, 0xD9, 0x1B, 0x1C, 0x1D, 0xC5, 0xC6, 0xCE, 0xD5, 0xDB, 0xD5, 0x8, 0xD1, 0xCB, 0xC4, 0xC4, 0xDB, 0xDB, 0xC4, 0xC4, 0xC4, 0xCC, 0xCC, 0xCC, 0xCB, 0xDB, 0xCB, 0x8, 0xD1, 0xCB, 0xDB, 0xDB, 0x17, 0x17, 0x17, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xCB, 0xDB, 0xCB, 0x8, 0xD1, 0xCB, 0xDB, 0xD5, 0x17, 0x17, 0x17, 0xD5, 0xD5, 0xD5, 0xD5, 0xDF, 0xCB, 0xDB, 0xCB, 0x8, 0xD1, 0xCB, 0xDB, 0xCB, 0x17, 0x17, 0x1F, 0xCB, 0xCB, 0xC4, 0xC4, 0xDB, 0xCB, 0xDB, 0xCB, 0x8, 0xD1, 0xCB, 0xDB, 0xCB, 0xDB, 0xDB, 0xC4, 0xCB, 0xCB, 0xDF, 0xD5, 0xD5, 0xCB, 0xDB, 0xCB, 0x8, 0xD1, 0xCB, 0xDB, 0xCB, 0xDB, 0xDB, 0xDB, 0xCB, 0xCB, 0xDB, 0xC4, 0xC4, 0xCB, 0xDB, 0xCB, 0x8, 0xD1, 0xCB, 0xDB, 0xCB, 0xDB, 0xDB, 0xDB, 0xCB, 0xCB, 0xD5, 0xD5, 0xDF, 0xCB, 0xDB, 0xCB, 0x8, 0xD1, 0xCB, 0xDB, 0xCB, 0xDB, 0xDB, 0xDB, 0xCB, 0xCB, 0xC4, 0xC4, 0xDB, 0xCB, 0xDB, 0xCB, 0x8, 0xD1, 0xCB, 0xDB, 0xCB, 0xDB, 0xDB, 0xDB, 0xCB, 0xCB, 0xDF, 0xD5, 0xD5, 0xCB, 0xDB, 0xCB, 0x8, 0xD1, 0xCB, 0xDB, 0xCB, 0xDB, 0xDB, 0xDB, 0xC4, 0xC4, 0xDB, 0xC4, 0xC4, 0xC4, 0xDB, 0xCB, 0x8, 0xD1, 0xCB, 0xDB, 0xCB, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0xDB, 0xD5, 0xD5, 0xD5, 0xCB, 0x8, 0xD1, 0xC4, 0xDB, 0xCB, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0x9B, 0xDB, 0xCB, 0xCB, 0xCB, 0xCB, 0x8, 0xD1, 0xDB, 0xDB, 0xCB, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0x9B, 0xDB, 0xCB, 0xCB, 0xCB, 0xCB, 0x8, 0xD1, 0xDB, 0xDB, 0xC4, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0x9B, 0xDB, 0xC4, 0xC4, 0xC4, 0xC4, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8}, - .unk3A0 = {0x381, 0x73FB, 0x400B, 0x400B, 0x51EB, 0x538B, 0x51BB, 0x518B, 0x51EB, 0x518B, 0x51BB, 0x5003, 0x501F, 0x101F, 0x101F, 0xFFFF}, - .coords = {180, 233}, - .direction = 0x3, - .range = 0x35, - }, - [2] = - { - .unk0 = 0x15, - .unk1 = 0x16, - .trainers = - { - [0] = - { - .name = _("SALVADORE"), - .facilityClass = FACILITY_CLASS_PKMN_BREEDER_M, - .unused = 0, - .speechBefore = {0x100D, 0x2623, 0x1E04, 0x1E1B, 0x1E0A, 0x81A}, - .speechWin = {0x100A, 0xA02, 0x103A, 0x102F, 0x120B, 0xC03}, - .speechLose = {0xA01, 0x1000, 0x161E, 0xA02, 0x80B, 0xA33}, - .speechAfter = {0x101F, 0xA02, 0x123C, 0xE11, 0xC03, 0xFFFF}, - .mons = - { - [0] = - { - .species = SPECIES_VAPOREON, - .heldItem = ITEM_FOCUS_BAND, - .moves = {MOVE_HAZE, MOVE_HELPING_HAND, MOVE_TICKLE, MOVE_WATER_PULSE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 250, - .defenseEV = 130, - .spDefenseEV = 130, - .otId = TRAINER_HILL_OTID, - .hpIV = 20, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x37, - .nickname = _("VAPOREON"), - .friendship = 0, - }, - [1] = - { - .species = SPECIES_DODRIO, - .heldItem = ITEM_KINGS_ROCK, - .moves = {MOVE_HAZE, MOVE_TRI_ATTACK, MOVE_TAUNT, MOVE_TORMENT}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .speedEV = 252, - .spDefenseEV = 6, - .otId = TRAINER_HILL_OTID, - .hpIV = 20, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 1, - .personality = 0x8A, - .nickname = _("DODRIO"), - .friendship = 0, - }, - [2] = - { - .species = SPECIES_OMASTAR, - .heldItem = ITEM_QUICK_CLAW, - .moves = {MOVE_HAZE, MOVE_HYDRO_PUMP, MOVE_TICKLE, MOVE_ATTRACT}, - .level = 0, - .ppBonuses = 0, - .hpEV = 250, - .defenseEV = 130, - .spDefenseEV = 130, - .otId = TRAINER_HILL_OTID, - .hpIV = 20, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x14, - .nickname = _("OMASTAR"), - .friendship = 255, - }, - [3] = - { - .species = SPECIES_LICKITUNG, - .heldItem = ITEM_CHESTO_BERRY, - .moves = {MOVE_BELLY_DRUM, MOVE_REST, MOVE_MUD_SLAP, MOVE_SWAGGER}, - .level = 0, - .ppBonuses = 0, - .hpEV = 250, - .defenseEV = 130, - .spDefenseEV = 130, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x8, - .nickname = _("LICKITUNG"), - .friendship = 255, - }, - [4] = - { - .species = SPECIES_SLOWBRO, - .heldItem = ITEM_LEFTOVERS, - .moves = {MOVE_BELLY_DRUM, MOVE_MUD_SLAP, MOVE_SWAGGER, MOVE_AMNESIA}, - .level = 0, - .ppBonuses = 0, - .hpEV = 250, - .defenseEV = 130, - .spDefenseEV = 130, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 1, - .personality = 0x94, - .nickname = _("SLOWBRO"), - .friendship = 0, - }, - [5] = - { - .species = SPECIES_LINOONE, - .heldItem = ITEM_LUM_BERRY, - .moves = {MOVE_BELLY_DRUM, MOVE_REST, MOVE_MUD_SLAP, MOVE_SWAGGER}, - .level = 0, - .ppBonuses = 0, - .hpEV = 250, - .defenseEV = 130, - .spDefenseEV = 130, - .otId = TRAINER_HILL_OTID, - .hpIV = 20, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x8, - .nickname = _("LINOONE"), - .friendship = 255, - }, - }, - }, - [1] = - { - .name = _("VERONICA"), - .facilityClass = FACILITY_CLASS_POKEMON_BREEDER_F, - .unused = 0, - .speechBefore = {0xA29, 0xE0D, 0x620, 0x40C, 0xE17, 0x1E0A}, - .speechWin = {0xA29, 0x620, 0xE1D, 0x1E25, 0xC00, 0xFFFF}, - .speechLose = {0xA29, 0x142A, 0x1C0D, 0xE1D, 0x1E25, 0xC00}, - .speechAfter = {0x1E25, 0x801, 0xA29, 0x1217, 0x811, 0xC00}, - .mons = - { - [0] = - { - .species = SPECIES_SKITTY, - .heldItem = ITEM_FOCUS_BAND, - .moves = {MOVE_PSYCH_UP, MOVE_DOUBLE_EDGE, MOVE_SHADOW_BALL, MOVE_IRON_TAIL}, - .level = 0, - .ppBonuses = 0, - .attackEV = 252, - .speedEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0xCB, - .nickname = _("SKITTY"), - .friendship = 255, - }, - [1] = - { - .species = SPECIES_MEDICHAM, - .heldItem = ITEM_QUICK_CLAW, - .moves = {MOVE_PSYCH_UP, MOVE_HI_JUMP_KICK, MOVE_MEGA_KICK, MOVE_ROCK_SLIDE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .attackEV = 6, - .speedEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0xD, - .nickname = _("MEDICHAM"), - .friendship = 0, - }, - [2] = - { - .species = SPECIES_STANTLER, - .heldItem = ITEM_SHELL_BELL, - .moves = {MOVE_PSYCH_UP, MOVE_RETURN, MOVE_EARTHQUAKE, MOVE_SHADOW_BALL}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .attackEV = 252, - .speedEV = 6, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x3, - .nickname = _("STANTLER"), - .friendship = 0, - }, - [3] = - { - .species = SPECIES_NIDOQUEEN, - .heldItem = ITEM_SALAC_BERRY, - .moves = {MOVE_SUPERPOWER, MOVE_BITE, MOVE_CHARM, MOVE_FLATTER}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .attackEV = 252, - .spDefenseEV = 6, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 20, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x3, - .nickname = _("NIDOQUEEN"), - .friendship = 0, - }, - [4] = - { - .species = SPECIES_NINETALES, - .heldItem = ITEM_SALAC_BERRY, - .moves = {MOVE_OVERHEAT, MOVE_QUICK_ATTACK, MOVE_SPITE, MOVE_TAIL_WHIP}, - .level = 0, - .ppBonuses = 0, - .hpEV = 6, - .speedEV = 252, - .spAttackEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0xD7, - .nickname = _("NINETALES"), - .friendship = 255, - }, - [5] = - { - .species = SPECIES_CHARIZARD, - .heldItem = ITEM_SALAC_BERRY, - .moves = {MOVE_OVERHEAT, MOVE_BEAT_UP, MOVE_SCARY_FACE, MOVE_GROWL}, - .level = 0, - .ppBonuses = 0, - .hpEV = 6, - .speedEV = 252, - .spAttackEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x28, - .nickname = _("CHARIZARD"), - .friendship = 255, - }, - }, - }, - }, - .data = {0x31, 0x35, 0x35, 0x35, 0x26, 0x26, 0x13, 0x14, 0x15, 0x38, 0x26, 0x2E, 0x35, 0x35, 0x3B, 0x8, 0x69, 0x63, 0x64, 0x64, 0x64, 0x64, 0x71, 0x71, 0x71, 0x72, 0x64, 0x64, 0x64, 0x63, 0x73, 0x8, 0x69, 0x63, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x63, 0x73, 0x8, 0x69, 0x63, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x63, 0x73, 0x8, 0x69, 0x63, 0x43, 0x41, 0x40, 0x41, 0x42, 0x41, 0x41, 0x4A, 0x42, 0x41, 0x41, 0x63, 0x73, 0x8, 0x69, 0x63, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x64, 0x73, 0x73, 0x73, 0x63, 0x73, 0x8, 0x69, 0x63, 0x41, 0x43, 0x4B, 0x43, 0x43, 0x41, 0x42, 0x42, 0x40, 0x41, 0x40, 0x63, 0x73, 0x8, 0x69, 0x63, 0x73, 0x73, 0x64, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x63, 0x73, 0x8, 0x69, 0x63, 0x41, 0x40, 0x42, 0x42, 0x41, 0x41, 0x42, 0x4A, 0x42, 0x41, 0x42, 0x63, 0x73, 0x8, 0x69, 0x63, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x64, 0x73, 0x73, 0x73, 0x63, 0x73, 0x8, 0x69, 0x63, 0x41, 0x42, 0x41, 0x43, 0x4B, 0x41, 0x41, 0x41, 0x40, 0x43, 0x41, 0x63, 0x73, 0x8, 0x69, 0x63, 0x73, 0x73, 0x73, 0x73, 0x64, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x63, 0x73, 0x8, 0x69, 0x63, 0x41, 0x40, 0x43, 0x41, 0x42, 0x42, 0x41, 0x4A, 0x42, 0x41, 0x42, 0x63, 0x73, 0x8, 0x69, 0x64, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x64, 0x73, 0x73, 0x73, 0x64, 0x73, 0x8, 0x69, 0x43, 0x43, 0x41, 0x42, 0x42, 0x41, 0x43, 0x41, 0x41, 0x40, 0x42, 0x41, 0x42, 0x73, 0x8, 0x69, 0x42, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x42, 0x73, 0x8}, - .unk3A0 = {0x381, 0x7C3D, 0x4005, 0x4005, 0x4005, 0x4045, 0x4005, 0x4805, 0x4005, 0x4045, 0x4005, 0x4205, 0x4005, 0x4045, 0x1, 0x1}, - .coords = {37, 41}, - .direction = 0x23, - .range = 0x33, - }, - [3] = - { - .unk0 = 0x17, - .unk1 = 0x18, - .trainers = - { - [0] = - { - .name = _("KEENAN"), - .facilityClass = FACILITY_CLASS_PSYCHIC_M, - .unused = 0, - .speechBefore = {0xA02, 0x1A35, 0x1025, 0x1202, 0xFFFF, 0xFFFF}, - .speechWin = {0x1039, 0x122E, 0xFFFF, 0x1C13, 0x100B, 0x1E1B}, - .speechLose = {0x1019, 0xE0D, 0x1C13, 0x1632, 0xA02, 0xC03}, - .speechAfter = {0xA02, 0x1017, 0x101E, 0x1C13, 0x102F, 0x1A05}, - .mons = - { - [0] = - { - .species = SPECIES_ALAKAZAM, - .heldItem = ITEM_PETAYA_BERRY, - .moves = {MOVE_SKILL_SWAP, MOVE_FIRE_PUNCH, MOVE_ICE_PUNCH, MOVE_REFLECT}, - .level = 0, - .ppBonuses = 0, - .speedEV = 255, - .spAttackEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 5, - .attackIV = 5, - .defenseIV = 5, - .speedIV = 5, - .spAttackIV = 5, - .spDefenseIV = 5, - .altAbility = 0, - .personality = 0x41, - .nickname = _("ALAKAZAM"), - .friendship = 255, - }, - [1] = - { - .species = SPECIES_BLISSEY, - .heldItem = ITEM_LEFTOVERS, - .moves = {MOVE_SKILL_SWAP, MOVE_EGG_BOMB, MOVE_THUNDERBOLT, MOVE_SING}, - .level = 0, - .ppBonuses = 0, - .defenseEV = 255, - .spAttackEV = 155, - .spDefenseEV = 100, - .otId = TRAINER_HILL_OTID, - .hpIV = 5, - .attackIV = 5, - .defenseIV = 5, - .speedIV = 5, - .spAttackIV = 5, - .spDefenseIV = 5, - .altAbility = 1, - .personality = 0xF, - .nickname = _("BLISSEY"), - .friendship = 255, - }, - [2] = - { - .species = SPECIES_GRUMPIG, - .heldItem = ITEM_TWISTED_SPOON, - .moves = {MOVE_SKILL_SWAP, MOVE_PSYCHIC, MOVE_CONFUSE_RAY, MOVE_REST}, - .level = 0, - .ppBonuses = 0, - .hpEV = 110, - .defenseEV = 200, - .spAttackEV = 200, - .otId = TRAINER_HILL_OTID, - .hpIV = 5, - .attackIV = 5, - .defenseIV = 5, - .speedIV = 5, - .spAttackIV = 5, - .spDefenseIV = 5, - .altAbility = 0, - .personality = 0x8C, - .nickname = _("GRUMPIG"), - .friendship = 255, - }, - [3] = - { - .species = SPECIES_GARDEVOIR, - .heldItem = ITEM_SALAC_BERRY, - .moves = {MOVE_SKILL_SWAP, MOVE_DREAM_EATER, MOVE_HYPNOSIS, MOVE_PROTECT}, - .level = 0, - .ppBonuses = 0, - .speedEV = 255, - .spAttackEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 5, - .attackIV = 5, - .defenseIV = 5, - .speedIV = 5, - .spAttackIV = 5, - .spDefenseIV = 5, - .altAbility = 1, - .personality = 0xF, - .nickname = _("GARDEVOIR"), - .friendship = 255, - }, - [4] = - { - .species = SPECIES_VENOMOTH, - .heldItem = ITEM_BRIGHT_POWDER, - .moves = {MOVE_SKILL_SWAP, MOVE_SIGNAL_BEAM, MOVE_SLEEP_POWDER, MOVE_TOXIC}, - .level = 0, - .ppBonuses = 0, - .attackEV = 255, - .speedEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 5, - .attackIV = 5, - .defenseIV = 5, - .speedIV = 5, - .spAttackIV = 5, - .spDefenseIV = 5, - .altAbility = 0, - .personality = 0x80, - .nickname = _("VENOMOTH"), - .friendship = 255, - }, - [5] = - { - .species = SPECIES_ESPEON, - .heldItem = ITEM_LUM_BERRY, - .moves = {MOVE_SKILL_SWAP, MOVE_PSYBEAM, MOVE_SWIFT, MOVE_ATTRACT}, - .level = 0, - .ppBonuses = 0, - .speedEV = 255, - .spAttackEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 5, - .attackIV = 5, - .defenseIV = 5, - .speedIV = 5, - .spAttackIV = 5, - .spDefenseIV = 5, - .altAbility = 0, - .personality = 0xF, - .nickname = _("ESPEON"), - .friendship = 255, - }, - }, - }, - [1] = - { - .name = _("KRISTINA"), - .facilityClass = FACILITY_CLASS_AROMA_LADY, - .unused = 0, - .speechBefore = {0xA31, 0x1400, 0xC04, 0x1E22, 0x1020, 0x401}, - .speechWin = {0xA01, 0xE2C, 0x103A, 0x1021, 0x61A, 0x401}, - .speechLose = {0xA01, 0x2757, 0xE39, 0x620, 0x401, 0xFFFF}, - .speechAfter = {0xA28, 0x61B, 0x1034, 0x823, 0x1013, 0x445}, - .mons = - { - [0] = - { - .species = SPECIES_WEEZING, - .heldItem = ITEM_POISON_BARB, - .moves = {MOVE_TOXIC, MOVE_SLUDGE_BOMB, MOVE_SMOKESCREEN, MOVE_HAZE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 255, - .attackEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x3, - .nickname = _("WEEZING"), - .friendship = 255, - }, - [1] = - { - .species = SPECIES_GLOOM, - .heldItem = ITEM_MIRACLE_SEED, - .moves = {MOVE_PETAL_DANCE, MOVE_SYNTHESIS, MOVE_SUNNY_DAY, MOVE_SOLAR_BEAM}, - .level = 0, - .ppBonuses = 0, - .speedEV = 255, - .spAttackEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x8C, - .nickname = _("GLOOM"), - .friendship = 255, - }, - [2] = - { - .species = SPECIES_MUK, - .heldItem = ITEM_BRIGHT_POWDER, - .moves = {MOVE_SCREECH, MOVE_DISABLE, MOVE_SLUDGE_BOMB, MOVE_ACID_ARMOR}, - .level = 0, - .ppBonuses = 0, - .hpEV = 255, - .attackEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x3, - .nickname = _("MUK"), - .friendship = 255, - }, - [3] = - { - .species = SPECIES_TROPIUS, - .heldItem = ITEM_WHITE_HERB, - .moves = {MOVE_SUNNY_DAY, MOVE_SOLAR_BEAM, MOVE_SWEET_SCENT, MOVE_AERIAL_ACE}, - .level = 0, - .ppBonuses = 0, - .attackEV = 120, - .speedEV = 255, - .spAttackEV = 135, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x83, - .nickname = _("TROPIUS"), - .friendship = 255, - }, - [4] = - { - .species = SPECIES_BELLOSSOM, - .heldItem = ITEM_MENTAL_HERB, - .moves = {MOVE_SWEET_SCENT, MOVE_PETAL_DANCE, MOVE_STUN_SPORE, MOVE_SLUDGE_BOMB}, - .level = 0, - .ppBonuses = 0, - .hpEV = 255, - .speedEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x6, - .nickname = _("BELLOSSOM"), - .friendship = 255, - }, - [5] = - { - .species = SPECIES_MEGANIUM, - .heldItem = ITEM_MIRACLE_SEED, - .moves = {MOVE_RAZOR_LEAF, MOVE_BODY_SLAM, MOVE_LEECH_SEED, MOVE_SYNTHESIS}, - .level = 0, - .ppBonuses = 0, - .attackEV = 200, - .speedEV = 110, - .spAttackEV = 200, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x1F, - .nickname = _("MEGANIUM"), - .friendship = 255, - }, - }, - }, - }, - .data = {0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x26, 0x1B, 0x1C, 0x1D, 0x25, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x8, 0x1F, 0x17, 0x17, 0x17, 0x17, 0x2B, 0x24, 0x24, 0x24, 0x2B, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x8, 0x33, 0x17, 0x17, 0x17, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x2B, 0x35, 0x35, 0x3B, 0x35, 0x35, 0x8, 0x33, 0x17, 0x17, 0x17, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x2B, 0x2C, 0x2C, 0x3B, 0x2C, 0x2C, 0x8, 0x33, 0x17, 0x1F, 0x17, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x2B, 0x17, 0x17, 0x17, 0x17, 0x17, 0x8, 0x34, 0x17, 0x2C, 0x17, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x2C, 0x17, 0x17, 0x17, 0x17, 0x17, 0x8, 0x17, 0x17, 0x17, 0x17, 0x17, 0x2C, 0x3B, 0x3B, 0x3B, 0x3B, 0x17, 0x17, 0x17, 0x17, 0x17, 0x8, 0x1F, 0x17, 0x17, 0x17, 0x17, 0x1F, 0x17, 0x3B, 0x3B, 0x3B, 0x17, 0x17, 0x17, 0x17, 0x17, 0x8, 0x33, 0x17, 0x17, 0x17, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x35, 0x1F, 0x17, 0x17, 0x1F, 0x17, 0x8, 0x34, 0x17, 0x17, 0x17, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x2B, 0x2C, 0x3B, 0x3B, 0x2B, 0x17, 0x8, 0x17, 0x17, 0x17, 0x1F, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x2B, 0x17, 0x17, 0x17, 0x2C, 0x17, 0x8, 0x1F, 0x17, 0x17, 0x2C, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x2B, 0x17, 0x3B, 0x1F, 0x3B, 0x17, 0x8, 0x33, 0x17, 0x17, 0x17, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x2B, 0x17, 0x3B, 0x2B, 0x3B, 0x17, 0x8, 0x33, 0x17, 0x17, 0x17, 0x17, 0x2B, 0x35, 0x35, 0x35, 0x2B, 0x17, 0x3B, 0x2C, 0x3B, 0x17, 0x8, 0x34, 0x17, 0x17, 0x17, 0x17, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x17, 0x17, 0x17, 0x17, 0x17, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8}, - .unk3A0 = {0x381, 0x7C1, 0x8441, 0x8477, 0x8441, 0xA441, 0x401, 0x1, 0x8401, 0x8465, 0x445, 0x1441, 0x8449, 0x8449, 0x87C1, 0xFFFF}, - .coords = {71, 167}, - .direction = 0x1, - .range = 0x33, - }, - }, + .unkField_0 = 8, + .unused1 = 2, + .unkField_2 = 4, + .unused3 = 0, + .unused4 = 5, + .unused5 = 30, + .unused6 = 5, + .floors = + { + [0] = + { + .unk0 = 0x11, + .unk1 = 0x12, + .trainers = + { + [0] = + { + .name = _("ALAINA"), + .facilityClass = FACILITY_CLASS_HEX_MANIAC, + .unused = 0, + .speechBefore = {EC_WORD_YOU, EC_WORD_CAN, EC_WORD_CHOOSE, EC_WORD_NOT, EC_WORD_TO, EC_WORD_BELIEVE}, + .speechWin = {EC_WORD_A, EC_WORD_SUPER, EC_WORD_NATURAL, EC_WORD_POWER, EC_WORD_HAS, EC_WORD_COME}, + .speechLose = {EC_WORD_THIS, EC_WORD_MUST_BE, EC_WORD_A, EC_MOVE(NIGHTMARE), EC_WORD_EXCL, 0xFFFF}, + .speechAfter = {EC_WORD_I, EC_WORD_WILL, EC_WORD_DISAPPEAR, EC_WORD_IN, EC_WORD_THE, EC_WORD_DARK}, + .mons = + { + [0] = + { + .species = SPECIES_MISDREAVUS, + .heldItem = ITEM_BRIGHT_POWDER, + .moves = {MOVE_SHADOW_BALL, MOVE_PSYCHIC, MOVE_THUNDERBOLT, MOVE_CONFUSE_RAY}, + .level = 0, + .ppBonuses = 0, + .attackEV = 155, + .speedEV = 255, + .spAttackEV = 100, + .otId = TRAINER_HILL_OTID, + .hpIV = 24, + .attackIV = 24, + .defenseIV = 24, + .speedIV = 24, + .spAttackIV = 24, + .spDefenseIV = 24, + .altAbility = 0, + .personality = 0x0, + .nickname = _("MISDREAVUS"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_SOLROCK, + .heldItem = ITEM_FOCUS_BAND, + .moves = {MOVE_PSYCHIC, MOVE_FLAMETHROWER, MOVE_ROCK_SLIDE, MOVE_CALM_MIND}, + .level = 0, + .ppBonuses = 0, + .hpEV = 200, + .defenseEV = 100, + .spAttackEV = 110, + .spDefenseEV = 100, + .otId = TRAINER_HILL_OTID, + .hpIV = 24, + .attackIV = 24, + .defenseIV = 24, + .speedIV = 24, + .spAttackIV = 24, + .spDefenseIV = 24, + .altAbility = 0, + .personality = 0xF, + .nickname = _("SOLROCK"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_CLAYDOL, + .heldItem = ITEM_SHELL_BELL, + .moves = {MOVE_EARTHQUAKE, MOVE_PSYCHIC, MOVE_SHADOW_BALL, MOVE_ICE_BEAM}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .defenseEV = 135, + .spDefenseEV = 120, + .otId = TRAINER_HILL_OTID, + .hpIV = 24, + .attackIV = 24, + .defenseIV = 24, + .speedIV = 24, + .spAttackIV = 24, + .spDefenseIV = 24, + .altAbility = 0, + .personality = 0xC, + .nickname = _("CLAYDOL"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_WEEZING, + .heldItem = ITEM_SALAC_BERRY, + .moves = {MOVE_SLUDGE_BOMB, MOVE_SHADOW_BALL, MOVE_FRUSTRATION, MOVE_DESTINY_BOND}, + .level = 0, + .ppBonuses = 0, + .hpEV = 110, + .attackEV = 200, + .spDefenseEV = 200, + .otId = TRAINER_HILL_OTID, + .hpIV = 24, + .attackIV = 24, + .defenseIV = 24, + .speedIV = 24, + .spAttackIV = 24, + .spDefenseIV = 24, + .altAbility = 0, + .personality = 0x80, + .nickname = _("WEEZING"), + .friendship = 0, + }, + [4] = + { + .species = SPECIES_LUNATONE, + .heldItem = ITEM_FOCUS_BAND, + .moves = {MOVE_PSYCHIC, MOVE_ICE_BEAM, MOVE_ROCK_SLIDE, MOVE_CALM_MIND}, + .level = 0, + .ppBonuses = 0, + .hpEV = 200, + .defenseEV = 100, + .spAttackEV = 110, + .spDefenseEV = 100, + .otId = TRAINER_HILL_OTID, + .hpIV = 24, + .attackIV = 24, + .defenseIV = 24, + .speedIV = 24, + .spAttackIV = 24, + .spDefenseIV = 24, + .altAbility = 0, + .personality = 0xF, + .nickname = _("LUNATONE"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_FLYGON, + .heldItem = ITEM_CHOICE_BAND, + .moves = {MOVE_EARTHQUAKE, MOVE_DRAGON_CLAW, MOVE_CRUNCH, MOVE_FLAMETHROWER}, + .level = 0, + .ppBonuses = 0, + .attackEV = 155, + .speedEV = 255, + .spAttackEV = 100, + .otId = TRAINER_HILL_OTID, + .hpIV = 24, + .attackIV = 24, + .defenseIV = 24, + .speedIV = 24, + .spAttackIV = 24, + .spDefenseIV = 24, + .altAbility = 0, + .personality = 0x83, + .nickname = _("FLYGON"), + .friendship = 255, + }, + }, + }, + [1] = + { + .name = _("ALFONSO"), + .facilityClass = FACILITY_CLASS_CYCLING_TRIATHLETE_M, + .unused = 0, + .speechBefore = {EC_WORD_I, EC_WORD_NEVER, EC_WORD_TAKE, EC_WORD_A, EC_WORD_TRAIN, 0xFFFF}, + .speechWin = {EC_WORD_I_AM, EC_WORD_FEELING, EC_MOVE2(SUPERSONIC), EC_WORD_ON, EC_WORD_MY, EC_WORD_BIKE}, + .speechLose = {EC_WORD_MY, EC_WORD_BIKE, EC_WORD_EXCL, EC_WORD_YOU_VE, EC_WORD_DESTROYED, EC_WORD_IT}, + .speechAfter = {EC_WORD_A, EC_WORD_BIKE, EC_WORD_OVER, EC_WORD_ANY, EC_WORD_TRAIN, EC_WORD_EXCL}, + .mons = + { + [0] = + { + .species = SPECIES_SEALEO, + .heldItem = ITEM_NEVER_MELT_ICE, + .moves = {MOVE_BLIZZARD, MOVE_ICE_BALL, MOVE_ENCORE, MOVE_HAIL}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0xF, + .nickname = _("SEALEO"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_AMPHAROS, + .heldItem = ITEM_MAGNET, + .moves = {MOVE_THUNDER, MOVE_THUNDER_WAVE, MOVE_COTTON_SPORE, MOVE_LIGHT_SCREEN}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0xF, + .nickname = _("AMPHAROS"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_MACHOKE, + .heldItem = ITEM_BLACK_BELT, + .moves = {MOVE_DYNAMIC_PUNCH, MOVE_MUD_SLAP, MOVE_COUNTER, MOVE_SCARY_FACE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .attackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x4E, + .nickname = _("MACHOKE"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_FLAREON, + .heldItem = ITEM_CHARCOAL, + .moves = {MOVE_FIRE_BLAST, MOVE_BITE, MOVE_QUICK_ATTACK, MOVE_SAND_ATTACK}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x28, + .nickname = _("FLAREON"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_MAGNETON, + .heldItem = ITEM_MAGNET, + .moves = {MOVE_ZAP_CANNON, MOVE_THUNDER_WAVE, MOVE_SCREECH, MOVE_METAL_SOUND}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x0, + .nickname = _("MAGNETON"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_PINSIR, + .heldItem = ITEM_QUICK_CLAW, + .moves = {MOVE_GUILLOTINE, MOVE_BRICK_BREAK, MOVE_SWAGGER, MOVE_FAINT_ATTACK}, + .level = 0, + .ppBonuses = 0, + .hpEV = 200, + .defenseEV = 155, + .spDefenseEV = 155, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x85, + .nickname = _("PINSIR"), + .friendship = 255, + }, + }, + }, + }, + .data = {0x31, 0x3B, 0x35, 0x35, 0x26, 0x26, 0x1B, 0x1C, 0x1D, 0x25, 0x26, 0x3A, 0x3B, 0x35, 0x3B, 0x8, 0x31, 0x3B, 0x2C, 0x2C, 0x2C, 0x2B, 0x24, 0x24, 0x24, 0x24, 0x2C, 0x3B, 0x3B, 0x2C, 0x3B, 0x8, 0x2D, 0x3B, 0x3B, 0x3B, 0x3B, 0x2B, 0x3B, 0x3B, 0x3B, 0x3B, 0x35, 0x3B, 0x35, 0x35, 0x3B, 0x8, 0x33, 0x3B, 0x32, 0x21, 0x30, 0x2B, 0x3B, 0x32, 0x21, 0x30, 0x2B, 0x3B, 0x2C, 0x2B, 0x3B, 0x8, 0x33, 0x35, 0x3B, 0x3B, 0x3B, 0x2C, 0x35, 0x3B, 0x3B, 0x3B, 0x2B, 0x3B, 0x3B, 0x2B, 0x3B, 0x8, 0x34, 0x2C, 0x3B, 0x32, 0x21, 0x30, 0x2B, 0x32, 0x30, 0x3B, 0x2B, 0x32, 0x30, 0x2C, 0x3B, 0x8, 0x31, 0x35, 0x3B, 0x3B, 0x35, 0x3B, 0x2C, 0x3B, 0x3B, 0x35, 0x2C, 0x3B, 0x3B, 0x35, 0x35, 0x8, 0x31, 0x2C, 0x32, 0x30, 0x2B, 0x32, 0x30, 0x35, 0x3B, 0x2B, 0x32, 0x21, 0x30, 0x2C, 0x2C, 0x8, 0x31, 0x35, 0x3B, 0x3B, 0x2B, 0x3B, 0x3B, 0x2B, 0x3B, 0x2C, 0x3B, 0x35, 0x3B, 0x3B, 0x3B, 0x8, 0x31, 0x2C, 0x32, 0x30, 0x2B, 0x32, 0x30, 0x2B, 0x3B, 0x32, 0x30, 0x2B, 0x32, 0x30, 0x3B, 0x8, 0x31, 0x35, 0x35, 0x35, 0x2B, 0x3B, 0x3B, 0x2B, 0x3B, 0x3B, 0x35, 0x2B, 0x3B, 0x35, 0x35, 0x8, 0x31, 0x2B, 0x2C, 0x2C, 0x2C, 0x32, 0x30, 0x2B, 0x32, 0x30, 0x2C, 0x2C, 0x3B, 0x2C, 0x2C, 0x8, 0x31, 0x2B, 0x3B, 0x3B, 0x35, 0x3B, 0x3B, 0x2B, 0x3B, 0x3B, 0x35, 0x3B, 0x3B, 0x3B, 0x3B, 0x8, 0x31, 0x2C, 0x32, 0x30, 0x2B, 0x3B, 0x3B, 0x2C, 0x32, 0x30, 0x2C, 0x32, 0x30, 0x3B, 0x35, 0x8, 0x31, 0x3B, 0x3B, 0x3B, 0x2C, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x2C, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8}, + .unk3A0 = {0x381, 0x3FE5, 0x401, 0xBDED, 0x8425, 0xDFBD, 0x221, 0x7E7F, 0x941, 0x7F7D, 0x911, 0x7FF7, 0x4101, 0x79F9, 0x803, 0xFFFF}, + .coords = {27, 45}, + .direction = 0x21, + .range = 0x21, + }, + [1] = + { + .unk0 = 0x13, + .unk1 = 0x14, + .trainers = + { + [0] = + { + .name = _("THEODORE"), + .facilityClass = FACILITY_CLASS_BLACK_BELT, + .unused = 0, + .speechBefore = {EC_WORD_MY, EC_WORD_POWER, EC_WORD_WILL, EC_MOVE2(STOMP), EC_WORD_YOU, EC_WORD_EXCL}, + .speechWin = {EC_WORD_WAAAH, EC_WORD_HAHAHA, EC_WORD_EXCL, EC_WORD_WAAAH, EC_WORD_HAHAHA, EC_WORD_EXCL_EXCL}, + .speechLose = {EC_WORD_I, EC_WORD_WENT, EC_WORD_AT, EC_WORD_IT, EC_WORD_TOO, EC_WORD_HARD}, + .speechAfter = {EC_WORD_YES_SIR_EXCL, EC_WORD_YOU, EC_WORD_LOOK, EC_WORD_NICE, EC_WORD_AND, EC_WORD_GUTSY}, + .mons = + { + [0] = + { + .species = SPECIES_MEDITITE, + .heldItem = ITEM_FOCUS_BAND, + .moves = {MOVE_FOCUS_PUNCH, MOVE_PROTECT, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .attackEV = 252, + .spDefenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 20, + .attackIV = 20, + .defenseIV = 20, + .speedIV = 20, + .spAttackIV = 20, + .spDefenseIV = 20, + .altAbility = 0, + .personality = 0x80, + .nickname = _("MEDITITE"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_HERACROSS, + .heldItem = ITEM_FOCUS_BAND, + .moves = {MOVE_FOCUS_PUNCH, MOVE_PROTECT, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .attackEV = 252, + .spDefenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 20, + .attackIV = 20, + .defenseIV = 20, + .speedIV = 20, + .spAttackIV = 20, + .spDefenseIV = 20, + .altAbility = 1, + .personality = 0x80, + .nickname = _("HERACROSS"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_HITMONTOP, + .heldItem = ITEM_SHELL_BELL, + .moves = {MOVE_FOCUS_PUNCH, MOVE_PROTECT, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .attackEV = 252, + .spDefenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 20, + .attackIV = 20, + .defenseIV = 20, + .speedIV = 20, + .spAttackIV = 20, + .spDefenseIV = 20, + .altAbility = 0, + .personality = 0x3, + .nickname = _("HITMONTOP"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_MACHOP, + .heldItem = ITEM_SALAC_BERRY, + .moves = {MOVE_FOCUS_PUNCH, MOVE_REVENGE, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .attackEV = 252, + .spDefenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 20, + .attackIV = 20, + .defenseIV = 20, + .speedIV = 20, + .spAttackIV = 20, + .spDefenseIV = 20, + .altAbility = 0, + .personality = 0x4E, + .nickname = _("MACHOP"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_PINSIR, + .heldItem = ITEM_SALAC_BERRY, + .moves = {MOVE_FOCUS_PUNCH, MOVE_REVENGE, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .attackEV = 252, + .spDefenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 20, + .attackIV = 20, + .defenseIV = 20, + .speedIV = 20, + .spAttackIV = 20, + .spDefenseIV = 20, + .altAbility = 0, + .personality = 0x80, + .nickname = _("PINSIR"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_HITMONCHAN, + .heldItem = ITEM_FOCUS_BAND, + .moves = {MOVE_FOCUS_PUNCH, MOVE_REVENGE, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .attackEV = 252, + .spDefenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 20, + .attackIV = 20, + .defenseIV = 20, + .speedIV = 20, + .spAttackIV = 20, + .spDefenseIV = 20, + .altAbility = 0, + .personality = 0x3, + .nickname = _("HITMONCHAN"), + .friendship = 255, + }, + }, + }, + [1] = + { + .name = _("JAYDEN"), + .facilityClass = FACILITY_CLASS_POKEMON_BREEDER_F, + .unused = 0, + .speechBefore = {EC_WORD_SOME, EC_WORD_THINGS, EC_WORD_YOU, EC_WORD_CAN_T, EC_WORD_DO, EC_WORD_ALONE}, + .speechWin = {EC_WORD_YOU, EC_WORD_WIN, EC_WORD_AS, EC_WORD_A, EC_WORD_GROUP, 0xFFFF}, + .speechLose = {EC_WORD_WE, EC_WORD_COULDN_T, EC_WORD_WIN, EC_WORD_TOGETHER, EC_WORD_QUES, 0xFFFF}, + .speechAfter = {EC_WORD_MAYBE, EC_WORD_I, EC_WORD_NEED, EC_WORD_A, EC_WORD_BOY, EC_WORD_FRIEND}, + .mons = + { + [0] = + { + .species = SPECIES_VULPIX, + .heldItem = ITEM_LUM_BERRY, + .moves = {MOVE_WILL_O_WISP, MOVE_CONFUSE_RAY, MOVE_TAIL_WHIP, MOVE_OVERHEAT}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .defenseEV = 252, + .spDefenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0xF, + .nickname = _("VULPIX"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_MINUN, + .heldItem = ITEM_FOCUS_BAND, + .moves = {MOVE_THUNDER_WAVE, MOVE_CHARM, MOVE_ENCORE, MOVE_SPARK}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .defenseEV = 252, + .spAttackEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x8C, + .nickname = _("MINUN"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_ROSELIA, + .heldItem = ITEM_LUM_BERRY, + .moves = {MOVE_TOXIC, MOVE_LEECH_SEED, MOVE_SWEET_SCENT, MOVE_GIGA_DRAIN}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .defenseEV = 252, + .spAttackEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 1, + .personality = 0xF, + .nickname = _("ROSELIA"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_MR_MIME, + .heldItem = ITEM_SITRUS_BERRY, + .moves = {MOVE_SAFEGUARD, MOVE_REFLECT, MOVE_LIGHT_SCREEN, MOVE_PSYCHIC}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .defenseEV = 252, + .spDefenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x82, + .nickname = _("MR. MIME"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_PLUSLE, + .heldItem = ITEM_SITRUS_BERRY, + .moves = {MOVE_RAIN_DANCE, MOVE_LIGHT_SCREEN, MOVE_HELPING_HAND, MOVE_THUNDER}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .defenseEV = 252, + .spDefenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x5, + .nickname = _("PLUSLE"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_TOGEPI, + .heldItem = ITEM_SITRUS_BERRY, + .moves = {MOVE_LIGHT_SCREEN, MOVE_REFLECT, MOVE_FOLLOW_ME, MOVE_METRONOME}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .defenseEV = 252, + .spDefenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 1, + .personality = 0x37, + .nickname = _("TOGEPI"), + .friendship = 255, + }, + }, + }, + }, + .data = {0xD1, 0xD5, 0xD5, 0xD5, 0xD9, 0xD9, 0x1B, 0x1C, 0x1D, 0xC5, 0xC6, 0xCE, 0xD5, 0xDB, 0xD5, 0x8, 0xD1, 0xCB, 0xC4, 0xC4, 0xDB, 0xDB, 0xC4, 0xC4, 0xC4, 0xCC, 0xCC, 0xCC, 0xCB, 0xDB, 0xCB, 0x8, 0xD1, 0xCB, 0xDB, 0xDB, 0x17, 0x17, 0x17, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xCB, 0xDB, 0xCB, 0x8, 0xD1, 0xCB, 0xDB, 0xD5, 0x17, 0x17, 0x17, 0xD5, 0xD5, 0xD5, 0xD5, 0xDF, 0xCB, 0xDB, 0xCB, 0x8, 0xD1, 0xCB, 0xDB, 0xCB, 0x17, 0x17, 0x1F, 0xCB, 0xCB, 0xC4, 0xC4, 0xDB, 0xCB, 0xDB, 0xCB, 0x8, 0xD1, 0xCB, 0xDB, 0xCB, 0xDB, 0xDB, 0xC4, 0xCB, 0xCB, 0xDF, 0xD5, 0xD5, 0xCB, 0xDB, 0xCB, 0x8, 0xD1, 0xCB, 0xDB, 0xCB, 0xDB, 0xDB, 0xDB, 0xCB, 0xCB, 0xDB, 0xC4, 0xC4, 0xCB, 0xDB, 0xCB, 0x8, 0xD1, 0xCB, 0xDB, 0xCB, 0xDB, 0xDB, 0xDB, 0xCB, 0xCB, 0xD5, 0xD5, 0xDF, 0xCB, 0xDB, 0xCB, 0x8, 0xD1, 0xCB, 0xDB, 0xCB, 0xDB, 0xDB, 0xDB, 0xCB, 0xCB, 0xC4, 0xC4, 0xDB, 0xCB, 0xDB, 0xCB, 0x8, 0xD1, 0xCB, 0xDB, 0xCB, 0xDB, 0xDB, 0xDB, 0xCB, 0xCB, 0xDF, 0xD5, 0xD5, 0xCB, 0xDB, 0xCB, 0x8, 0xD1, 0xCB, 0xDB, 0xCB, 0xDB, 0xDB, 0xDB, 0xC4, 0xC4, 0xDB, 0xC4, 0xC4, 0xC4, 0xDB, 0xCB, 0x8, 0xD1, 0xCB, 0xDB, 0xCB, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0xDB, 0xD5, 0xD5, 0xD5, 0xCB, 0x8, 0xD1, 0xC4, 0xDB, 0xCB, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0x9B, 0xDB, 0xCB, 0xCB, 0xCB, 0xCB, 0x8, 0xD1, 0xDB, 0xDB, 0xCB, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0x9B, 0xDB, 0xCB, 0xCB, 0xCB, 0xCB, 0x8, 0xD1, 0xDB, 0xDB, 0xC4, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0x9B, 0xDB, 0xC4, 0xC4, 0xC4, 0xC4, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8}, + .unk3A0 = {0x381, 0x73FB, 0x400B, 0x400B, 0x51EB, 0x538B, 0x51BB, 0x518B, 0x51EB, 0x518B, 0x51BB, 0x5003, 0x501F, 0x101F, 0x101F, 0xFFFF}, + .coords = {180, 233}, + .direction = 0x3, + .range = 0x35, + }, + [2] = + { + .unk0 = 0x15, + .unk1 = 0x16, + .trainers = + { + [0] = + { + .name = _("SALVADORE"), + .facilityClass = FACILITY_CLASS_PKMN_BREEDER_M, + .unused = 0, + .speechBefore = {EC_WORD_LET_S, EC_MOVE2(WRAP), EC_WORD_THINGS, EC_WORD_UP, EC_WORD_HERE, EC_WORD_HEY_QUES}, + .speechWin = {EC_WORD_WOULD, EC_WORD_YOU, EC_WORD_LIKE, EC_WORD_TO, EC_WORD_GO_HOME, EC_WORD_QUES}, + .speechLose = {EC_WORD_I, EC_WORD_WILL, EC_WORD_MAKE, EC_WORD_YOU, EC_WORD_SORRY, EC_WORD_FRIEND}, + .speechAfter = {EC_WORD_HAVEN_T, EC_WORD_YOU, EC_WORD_DONE, EC_WORD_ENOUGH, EC_WORD_QUES, 0xFFFF}, + .mons = + { + [0] = + { + .species = SPECIES_VAPOREON, + .heldItem = ITEM_FOCUS_BAND, + .moves = {MOVE_HAZE, MOVE_HELPING_HAND, MOVE_TICKLE, MOVE_WATER_PULSE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 250, + .defenseEV = 130, + .spDefenseEV = 130, + .otId = TRAINER_HILL_OTID, + .hpIV = 20, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x37, + .nickname = _("VAPOREON"), + .friendship = 0, + }, + [1] = + { + .species = SPECIES_DODRIO, + .heldItem = ITEM_KINGS_ROCK, + .moves = {MOVE_HAZE, MOVE_TRI_ATTACK, MOVE_TAUNT, MOVE_TORMENT}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .speedEV = 252, + .spDefenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 20, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 1, + .personality = 0x8A, + .nickname = _("DODRIO"), + .friendship = 0, + }, + [2] = + { + .species = SPECIES_OMASTAR, + .heldItem = ITEM_QUICK_CLAW, + .moves = {MOVE_HAZE, MOVE_HYDRO_PUMP, MOVE_TICKLE, MOVE_ATTRACT}, + .level = 0, + .ppBonuses = 0, + .hpEV = 250, + .defenseEV = 130, + .spDefenseEV = 130, + .otId = TRAINER_HILL_OTID, + .hpIV = 20, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x14, + .nickname = _("OMASTAR"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_LICKITUNG, + .heldItem = ITEM_CHESTO_BERRY, + .moves = {MOVE_BELLY_DRUM, MOVE_REST, MOVE_MUD_SLAP, MOVE_SWAGGER}, + .level = 0, + .ppBonuses = 0, + .hpEV = 250, + .defenseEV = 130, + .spDefenseEV = 130, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x8, + .nickname = _("LICKITUNG"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_SLOWBRO, + .heldItem = ITEM_LEFTOVERS, + .moves = {MOVE_BELLY_DRUM, MOVE_MUD_SLAP, MOVE_SWAGGER, MOVE_AMNESIA}, + .level = 0, + .ppBonuses = 0, + .hpEV = 250, + .defenseEV = 130, + .spDefenseEV = 130, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 1, + .personality = 0x94, + .nickname = _("SLOWBRO"), + .friendship = 0, + }, + [5] = + { + .species = SPECIES_LINOONE, + .heldItem = ITEM_LUM_BERRY, + .moves = {MOVE_BELLY_DRUM, MOVE_REST, MOVE_MUD_SLAP, MOVE_SWAGGER}, + .level = 0, + .ppBonuses = 0, + .hpEV = 250, + .defenseEV = 130, + .spDefenseEV = 130, + .otId = TRAINER_HILL_OTID, + .hpIV = 20, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x8, + .nickname = _("LINOONE"), + .friendship = 255, + }, + }, + }, + [1] = + { + .name = _("VERONICA"), + .facilityClass = FACILITY_CLASS_POKEMON_BREEDER_F, + .unused = 0, + .speechBefore = {EC_WORD_I_AM, EC_WORD_THE, EC_WORD_STRONG, EC_WORD_BEAUTY, EC_WORD_AROUND, EC_WORD_HERE}, + .speechWin = {EC_WORD_I_AM, EC_WORD_STRONG, EC_WORD_THAT_S, EC_WORD_WHY, EC_WORD_EXCL, 0xFFFF}, + .speechLose = {EC_WORD_I_AM, EC_WORD_TIRED, EC_WORD_TODAY, EC_WORD_THAT_S, EC_WORD_WHY, EC_WORD_EXCL}, + .speechAfter = {EC_WORD_WHY, EC_WORD_YES, EC_WORD_I_AM, EC_WORD_ANGRY, EC_WORD_THANK_YOU, EC_WORD_EXCL}, + .mons = + { + [0] = + { + .species = SPECIES_SKITTY, + .heldItem = ITEM_FOCUS_BAND, + .moves = {MOVE_PSYCH_UP, MOVE_DOUBLE_EDGE, MOVE_SHADOW_BALL, MOVE_IRON_TAIL}, + .level = 0, + .ppBonuses = 0, + .attackEV = 252, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0xCB, + .nickname = _("SKITTY"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_MEDICHAM, + .heldItem = ITEM_QUICK_CLAW, + .moves = {MOVE_PSYCH_UP, MOVE_HI_JUMP_KICK, MOVE_MEGA_KICK, MOVE_ROCK_SLIDE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .attackEV = 6, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0xD, + .nickname = _("MEDICHAM"), + .friendship = 0, + }, + [2] = + { + .species = SPECIES_STANTLER, + .heldItem = ITEM_SHELL_BELL, + .moves = {MOVE_PSYCH_UP, MOVE_RETURN, MOVE_EARTHQUAKE, MOVE_SHADOW_BALL}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .attackEV = 252, + .speedEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x3, + .nickname = _("STANTLER"), + .friendship = 0, + }, + [3] = + { + .species = SPECIES_NIDOQUEEN, + .heldItem = ITEM_SALAC_BERRY, + .moves = {MOVE_SUPERPOWER, MOVE_BITE, MOVE_CHARM, MOVE_FLATTER}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .attackEV = 252, + .spDefenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 20, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x3, + .nickname = _("NIDOQUEEN"), + .friendship = 0, + }, + [4] = + { + .species = SPECIES_NINETALES, + .heldItem = ITEM_SALAC_BERRY, + .moves = {MOVE_OVERHEAT, MOVE_QUICK_ATTACK, MOVE_SPITE, MOVE_TAIL_WHIP}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .speedEV = 252, + .spAttackEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0xD7, + .nickname = _("NINETALES"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_CHARIZARD, + .heldItem = ITEM_SALAC_BERRY, + .moves = {MOVE_OVERHEAT, MOVE_BEAT_UP, MOVE_SCARY_FACE, MOVE_GROWL}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .speedEV = 252, + .spAttackEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x28, + .nickname = _("CHARIZARD"), + .friendship = 255, + }, + }, + }, + }, + .data = {0x31, 0x35, 0x35, 0x35, 0x26, 0x26, 0x13, 0x14, 0x15, 0x38, 0x26, 0x2E, 0x35, 0x35, 0x3B, 0x8, 0x69, 0x63, 0x64, 0x64, 0x64, 0x64, 0x71, 0x71, 0x71, 0x72, 0x64, 0x64, 0x64, 0x63, 0x73, 0x8, 0x69, 0x63, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x63, 0x73, 0x8, 0x69, 0x63, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x63, 0x73, 0x8, 0x69, 0x63, 0x43, 0x41, 0x40, 0x41, 0x42, 0x41, 0x41, 0x4A, 0x42, 0x41, 0x41, 0x63, 0x73, 0x8, 0x69, 0x63, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x64, 0x73, 0x73, 0x73, 0x63, 0x73, 0x8, 0x69, 0x63, 0x41, 0x43, 0x4B, 0x43, 0x43, 0x41, 0x42, 0x42, 0x40, 0x41, 0x40, 0x63, 0x73, 0x8, 0x69, 0x63, 0x73, 0x73, 0x64, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x63, 0x73, 0x8, 0x69, 0x63, 0x41, 0x40, 0x42, 0x42, 0x41, 0x41, 0x42, 0x4A, 0x42, 0x41, 0x42, 0x63, 0x73, 0x8, 0x69, 0x63, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x64, 0x73, 0x73, 0x73, 0x63, 0x73, 0x8, 0x69, 0x63, 0x41, 0x42, 0x41, 0x43, 0x4B, 0x41, 0x41, 0x41, 0x40, 0x43, 0x41, 0x63, 0x73, 0x8, 0x69, 0x63, 0x73, 0x73, 0x73, 0x73, 0x64, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x63, 0x73, 0x8, 0x69, 0x63, 0x41, 0x40, 0x43, 0x41, 0x42, 0x42, 0x41, 0x4A, 0x42, 0x41, 0x42, 0x63, 0x73, 0x8, 0x69, 0x64, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x64, 0x73, 0x73, 0x73, 0x64, 0x73, 0x8, 0x69, 0x43, 0x43, 0x41, 0x42, 0x42, 0x41, 0x43, 0x41, 0x41, 0x40, 0x42, 0x41, 0x42, 0x73, 0x8, 0x69, 0x42, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x42, 0x73, 0x8}, + .unk3A0 = {0x381, 0x7C3D, 0x4005, 0x4005, 0x4005, 0x4045, 0x4005, 0x4805, 0x4005, 0x4045, 0x4005, 0x4205, 0x4005, 0x4045, 0x1, 0x1}, + .coords = {37, 41}, + .direction = 0x23, + .range = 0x33, + }, + [3] = + { + .unk0 = 0x17, + .unk1 = 0x18, + .trainers = + { + [0] = + { + .name = _("KEENAN"), + .facilityClass = FACILITY_CLASS_PSYCHIC_M, + .unused = 0, + .speechBefore = {EC_WORD_YOU, EC_WORD_LOOK, EC_WORD_SO, EC_WORD_HURRIED, 0xFFFF, 0xFFFF}, + .speechWin = {EC_WORD_TOO, EC_WORD_BAD, 0xFFFF, EC_WORD_TIME, EC_WORD_IS, EC_WORD_UP}, + .speechLose = {EC_WORD_DOES, EC_WORD_THE, EC_WORD_TIME, EC_WORD_WORRY, EC_WORD_YOU, EC_WORD_QUES}, + .speechAfter = {EC_WORD_YOU, EC_WORD_DON_T, EC_WORD_HAVE, EC_WORD_TIME, EC_WORD_TO, EC_WORD_CHAT}, + .mons = + { + [0] = + { + .species = SPECIES_ALAKAZAM, + .heldItem = ITEM_PETAYA_BERRY, + .moves = {MOVE_SKILL_SWAP, MOVE_FIRE_PUNCH, MOVE_ICE_PUNCH, MOVE_REFLECT}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0x41, + .nickname = _("ALAKAZAM"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_BLISSEY, + .heldItem = ITEM_LEFTOVERS, + .moves = {MOVE_SKILL_SWAP, MOVE_EGG_BOMB, MOVE_THUNDERBOLT, MOVE_SING}, + .level = 0, + .ppBonuses = 0, + .defenseEV = 255, + .spAttackEV = 155, + .spDefenseEV = 100, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 1, + .personality = 0xF, + .nickname = _("BLISSEY"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_GRUMPIG, + .heldItem = ITEM_TWISTED_SPOON, + .moves = {MOVE_SKILL_SWAP, MOVE_PSYCHIC, MOVE_CONFUSE_RAY, MOVE_REST}, + .level = 0, + .ppBonuses = 0, + .hpEV = 110, + .defenseEV = 200, + .spAttackEV = 200, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0x8C, + .nickname = _("GRUMPIG"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_GARDEVOIR, + .heldItem = ITEM_SALAC_BERRY, + .moves = {MOVE_SKILL_SWAP, MOVE_DREAM_EATER, MOVE_HYPNOSIS, MOVE_PROTECT}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 1, + .personality = 0xF, + .nickname = _("GARDEVOIR"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_VENOMOTH, + .heldItem = ITEM_BRIGHT_POWDER, + .moves = {MOVE_SKILL_SWAP, MOVE_SIGNAL_BEAM, MOVE_SLEEP_POWDER, MOVE_TOXIC}, + .level = 0, + .ppBonuses = 0, + .attackEV = 255, + .speedEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0x80, + .nickname = _("VENOMOTH"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_ESPEON, + .heldItem = ITEM_LUM_BERRY, + .moves = {MOVE_SKILL_SWAP, MOVE_PSYBEAM, MOVE_SWIFT, MOVE_ATTRACT}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0xF, + .nickname = _("ESPEON"), + .friendship = 255, + }, + }, + }, + [1] = + { + .name = _("KRISTINA"), + .facilityClass = FACILITY_CLASS_AROMA_LADY, + .unused = 0, + .speechBefore = {EC_WORD_IT_S, EC_WORD_HOT, EC_WORD_ELLIPSIS, EC_WORD_WHAT, EC_WORD_A, EC_WORD_STENCH}, + .speechWin = {EC_WORD_I, EC_WORD_REALLY, EC_WORD_LIKE, EC_WORD_AN, EC_WORD_OFFENSIVE, EC_WORD_STENCH}, + .speechLose = {EC_WORD_I, EC_MOVE2(COVET), EC_WORD_ANY, EC_WORD_STRONG, EC_WORD_STENCH, 0xFFFF}, + .speechAfter = {EC_WORD_MY, EC_WORD_SENSE, EC_WORD_OF, EC_WORD_SMELL, EC_WORD_ISN_T, EC_WORD_NORMAL}, + .mons = + { + [0] = + { + .species = SPECIES_WEEZING, + .heldItem = ITEM_POISON_BARB, + .moves = {MOVE_TOXIC, MOVE_SLUDGE_BOMB, MOVE_SMOKESCREEN, MOVE_HAZE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .attackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x3, + .nickname = _("WEEZING"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_GLOOM, + .heldItem = ITEM_MIRACLE_SEED, + .moves = {MOVE_PETAL_DANCE, MOVE_SYNTHESIS, MOVE_SUNNY_DAY, MOVE_SOLAR_BEAM}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x8C, + .nickname = _("GLOOM"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_MUK, + .heldItem = ITEM_BRIGHT_POWDER, + .moves = {MOVE_SCREECH, MOVE_DISABLE, MOVE_SLUDGE_BOMB, MOVE_ACID_ARMOR}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .attackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x3, + .nickname = _("MUK"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_TROPIUS, + .heldItem = ITEM_WHITE_HERB, + .moves = {MOVE_SUNNY_DAY, MOVE_SOLAR_BEAM, MOVE_SWEET_SCENT, MOVE_AERIAL_ACE}, + .level = 0, + .ppBonuses = 0, + .attackEV = 120, + .speedEV = 255, + .spAttackEV = 135, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x83, + .nickname = _("TROPIUS"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_BELLOSSOM, + .heldItem = ITEM_MENTAL_HERB, + .moves = {MOVE_SWEET_SCENT, MOVE_PETAL_DANCE, MOVE_STUN_SPORE, MOVE_SLUDGE_BOMB}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .speedEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x6, + .nickname = _("BELLOSSOM"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_MEGANIUM, + .heldItem = ITEM_MIRACLE_SEED, + .moves = {MOVE_RAZOR_LEAF, MOVE_BODY_SLAM, MOVE_LEECH_SEED, MOVE_SYNTHESIS}, + .level = 0, + .ppBonuses = 0, + .attackEV = 200, + .speedEV = 110, + .spAttackEV = 200, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x1F, + .nickname = _("MEGANIUM"), + .friendship = 255, + }, + }, + }, + }, + .data = {0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x26, 0x1B, 0x1C, 0x1D, 0x25, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x8, 0x1F, 0x17, 0x17, 0x17, 0x17, 0x2B, 0x24, 0x24, 0x24, 0x2B, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x8, 0x33, 0x17, 0x17, 0x17, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x2B, 0x35, 0x35, 0x3B, 0x35, 0x35, 0x8, 0x33, 0x17, 0x17, 0x17, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x2B, 0x2C, 0x2C, 0x3B, 0x2C, 0x2C, 0x8, 0x33, 0x17, 0x1F, 0x17, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x2B, 0x17, 0x17, 0x17, 0x17, 0x17, 0x8, 0x34, 0x17, 0x2C, 0x17, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x2C, 0x17, 0x17, 0x17, 0x17, 0x17, 0x8, 0x17, 0x17, 0x17, 0x17, 0x17, 0x2C, 0x3B, 0x3B, 0x3B, 0x3B, 0x17, 0x17, 0x17, 0x17, 0x17, 0x8, 0x1F, 0x17, 0x17, 0x17, 0x17, 0x1F, 0x17, 0x3B, 0x3B, 0x3B, 0x17, 0x17, 0x17, 0x17, 0x17, 0x8, 0x33, 0x17, 0x17, 0x17, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x35, 0x1F, 0x17, 0x17, 0x1F, 0x17, 0x8, 0x34, 0x17, 0x17, 0x17, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x2B, 0x2C, 0x3B, 0x3B, 0x2B, 0x17, 0x8, 0x17, 0x17, 0x17, 0x1F, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x2B, 0x17, 0x17, 0x17, 0x2C, 0x17, 0x8, 0x1F, 0x17, 0x17, 0x2C, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x2B, 0x17, 0x3B, 0x1F, 0x3B, 0x17, 0x8, 0x33, 0x17, 0x17, 0x17, 0x17, 0x2B, 0x3B, 0x3B, 0x3B, 0x2B, 0x17, 0x3B, 0x2B, 0x3B, 0x17, 0x8, 0x33, 0x17, 0x17, 0x17, 0x17, 0x2B, 0x35, 0x35, 0x35, 0x2B, 0x17, 0x3B, 0x2C, 0x3B, 0x17, 0x8, 0x34, 0x17, 0x17, 0x17, 0x17, 0x2C, 0x2C, 0x2C, 0x2C, 0x2C, 0x17, 0x17, 0x17, 0x17, 0x17, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8}, + .unk3A0 = {0x381, 0x7C1, 0x8441, 0x8477, 0x8441, 0xA441, 0x401, 0x1, 0x8401, 0x8465, 0x445, 0x1441, 0x8449, 0x8449, 0x87C1, 0xFFFF}, + .coords = {71, 167}, + .direction = 0x1, + .range = 0x33, + }, + }, }; static const struct TrHillTag sDataTagVariety = { - .unkField_0 = 8, - .unused1 = 1, - .unkField_2 = 4, - .unused3 = 0, - .unused4 = 21, - .unused5 = 76, - .unused6 = 5, - .floors = - { - [0] = - { - .unk0 = 0x29, - .unk1 = 0x2A, - .trainers = - { - [0] = - { - .name = _("TERRANCE"), - .facilityClass = FACILITY_CLASS_GENTLEMAN, - .unused = 0, - .speechBefore = {0x1405, 0xA22, 0x1000, 0x20F, 0x1020, 0x26D9}, - .speechWin = {0x811, 0xA28, 0x619, 0x100B, 0xA05, 0x26D9}, - .speechLose = {0x1E19, 0xA28, 0x26D9, 0x102F, 0xA02, 0xFFFF}, - .speechAfter = {0x817, 0x809, 0xA28, 0xA33, 0xFFFF, 0xFFFF}, - .mons = - { - [0] = - { - .species = SPECIES_DELIBIRD, - .heldItem = ITEM_SITRUS_BERRY, - .moves = {MOVE_PRESENT, MOVE_SPLASH, MOVE_HAIL, MOVE_PROTECT}, - .level = 0, - .ppBonuses = 0, - .attackEV = 255, - .speedEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 1, - .personality = 0x8A, - .nickname = _("DELIBIRD"), - .friendship = 255, - }, - [1] = - { - .species = SPECIES_CLEFAIRY, - .heldItem = ITEM_SITRUS_BERRY, - .moves = {MOVE_PRESENT, MOVE_COSMIC_POWER, MOVE_LIGHT_SCREEN, MOVE_MOONLIGHT}, - .level = 0, - .ppBonuses = 0, - .attackEV = 255, - .speedEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0xD, - .nickname = _("CLEFAIRY"), - .friendship = 255, - }, - [2] = - { - .species = SPECIES_PIKACHU, - .heldItem = ITEM_SITRUS_BERRY, - .moves = {MOVE_PRESENT, MOVE_GROWL, MOVE_TAIL_WHIP, MOVE_AGILITY}, - .level = 0, - .ppBonuses = 0, - .attackEV = 255, - .speedEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0xD, - .nickname = _("PIKACHU"), - .friendship = 255, - }, - [3] = - { - .species = SPECIES_MARILL, - .heldItem = ITEM_SITRUS_BERRY, - .moves = {MOVE_PRESENT, MOVE_DEFENSE_CURL, MOVE_TAIL_WHIP, MOVE_ENDURE}, - .level = 0, - .ppBonuses = 0, - .attackEV = 255, - .speedEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 1, - .personality = 0x8A, - .nickname = _("MARILL"), - .friendship = 255, - }, - [4] = - { - .species = SPECIES_JIGGLYPUFF, - .heldItem = ITEM_SITRUS_BERRY, - .moves = {MOVE_PRESENT, MOVE_SING, MOVE_DISABLE, MOVE_REST}, - .level = 0, - .ppBonuses = 0, - .attackEV = 255, - .speedEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0xD, - .nickname = _("JIGGLYPUFF"), - .friendship = 255, - }, - [5] = - { - .species = SPECIES_TOGETIC, - .heldItem = ITEM_SITRUS_BERRY, - .moves = {MOVE_PRESENT, MOVE_CHARM, MOVE_SWEET_KISS, MOVE_WISH}, - .level = 0, - .ppBonuses = 0, - .attackEV = 255, - .speedEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 1, - .personality = 0x26, - .nickname = _("TOGETIC"), - .friendship = 255, - }, - }, - }, - [1] = - { - .name = _("ELIZABETH"), - .facilityClass = FACILITY_CLASS_LADY, - .unused = 0, - .speechBefore = {0x1016, 0xA02, 0x61B, 0xA14, 0x2474, 0xC03}, - .speechWin = {0xE1D, 0x1027, 0x1E29, 0xA01, 0x100A, 0x1212}, - .speechLose = {0x1E04, 0x1017, 0x1C06, 0x180D, 0x1038, 0xFFFF}, - .speechAfter = {0xA29, 0xE09, 0x121A, 0xE15, 0x120E, 0x1C1A}, - .mons = - { - [0] = - { - .species = SPECIES_WIGGLYTUFF, - .heldItem = ITEM_SILK_SCARF, - .moves = {MOVE_ROLLOUT, MOVE_DEFENSE_CURL, MOVE_SING, MOVE_DREAM_EATER}, - .level = 0, - .ppBonuses = 0, - .hpEV = 255, - .speedEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 5, - .attackIV = 5, - .defenseIV = 5, - .speedIV = 5, - .spAttackIV = 5, - .spDefenseIV = 5, - .altAbility = 0, - .personality = 0xC1, - .nickname = _("WIGGLYTUFF"), - .friendship = 255, - }, - [1] = - { - .species = SPECIES_SABLEYE, - .heldItem = ITEM_SILK_SCARF, - .moves = {MOVE_ASTONISH, MOVE_FAINT_ATTACK, MOVE_DETECT, MOVE_CONFUSE_RAY}, - .level = 0, - .ppBonuses = 0, - .hpEV = 255, - .speedEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 5, - .attackIV = 5, - .defenseIV = 5, - .speedIV = 5, - .spAttackIV = 5, - .spDefenseIV = 5, - .altAbility = 0, - .personality = 0x87, - .nickname = _("SABLEYE"), - .friendship = 255, - }, - [2] = - { - .species = SPECIES_GRUMPIG, - .heldItem = ITEM_SILK_SCARF, - .moves = {MOVE_PSYBEAM, MOVE_MAGIC_COAT, MOVE_BOUNCE, MOVE_FUTURE_SIGHT}, - .level = 0, - .ppBonuses = 0, - .hpEV = 255, - .speedEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 5, - .attackIV = 5, - .defenseIV = 5, - .speedIV = 5, - .spAttackIV = 5, - .spDefenseIV = 5, - .altAbility = 0, - .personality = 0xA, - .nickname = _("GRUMPIG"), - .friendship = 255, - }, - [3] = - { - .species = SPECIES_CORSOLA, - .heldItem = ITEM_SILK_SCARF, - .moves = {MOVE_BUBBLE_BEAM, MOVE_ROCK_BLAST, MOVE_REFLECT, MOVE_LIGHT_SCREEN}, - .level = 0, - .ppBonuses = 0, - .hpEV = 255, - .speedEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 5, - .attackIV = 5, - .defenseIV = 5, - .speedIV = 5, - .spAttackIV = 5, - .spDefenseIV = 5, - .altAbility = 0, - .personality = 0x12, - .nickname = _("CORSOLA"), - .friendship = 255, - }, - [4] = - { - .species = SPECIES_CLAMPERL, - .heldItem = ITEM_SILK_SCARF, - .moves = {MOVE_WHIRLPOOL, MOVE_IRON_DEFENSE, MOVE_ENDURE, MOVE_CONFUSE_RAY}, - .level = 0, - .ppBonuses = 0, - .hpEV = 255, - .speedEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 5, - .attackIV = 5, - .defenseIV = 5, - .speedIV = 5, - .spAttackIV = 5, - .spDefenseIV = 5, - .altAbility = 0, - .personality = 0xA, - .nickname = _("CLAMPERL"), - .friendship = 255, - }, - [5] = - { - .species = SPECIES_STARMIE, - .heldItem = ITEM_SILK_SCARF, - .moves = {MOVE_DIVE, MOVE_ICY_WIND, MOVE_SWIFT, MOVE_SKILL_SWAP}, - .level = 0, - .ppBonuses = 0, - .hpEV = 255, - .speedEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 5, - .attackIV = 5, - .defenseIV = 5, - .speedIV = 5, - .spAttackIV = 5, - .spDefenseIV = 5, - .altAbility = 0, - .personality = 0xA, - .nickname = _("STARMIE"), - .friendship = 255, - }, - }, - }, - }, - .data = {0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x8, 0x40, 0x41, 0x41, 0x41, 0x41, 0x41, 0x42, 0x43, 0x43, 0x43, 0x43, 0x43, 0x40, 0x41, 0x41, 0x8, 0x40, 0xFB, 0x43, 0x41, 0x41, 0x41, 0x42, 0x40, 0x43, 0x41, 0x42, 0x42, 0x42, 0xFB, 0x41, 0x8, 0x40, 0x41, 0xFB, 0x41, 0x41, 0x41, 0x42, 0x40, 0x43, 0x41, 0x43, 0x43, 0xFB, 0x40, 0x41, 0x8, 0x40, 0x41, 0x41, 0xFB, 0x43, 0x41, 0x42, 0x40, 0x43, 0x43, 0x43, 0xFB, 0x41, 0x40, 0x41, 0x8, 0x40, 0x41, 0x41, 0x41, 0x42, 0x42, 0x42, 0x40, 0x43, 0x43, 0x43, 0x41, 0x41, 0x40, 0x41, 0x8, 0x40, 0x41, 0x41, 0x41, 0xFE, 0xFE, 0xFE, 0xFB, 0xFE, 0xFE, 0xFE, 0x41, 0x41, 0x40, 0x41, 0x8, 0x40, 0x41, 0x41, 0x41, 0xFE, 0xFE, 0xFE, 0xFB, 0xFE, 0xFE, 0xFE, 0x41, 0x41, 0x40, 0x41, 0x8, 0x40, 0x41, 0x42, 0x41, 0xFE, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFE, 0x41, 0x41, 0x40, 0x41, 0x8, 0x40, 0x41, 0x41, 0x41, 0xFE, 0xFE, 0xFE, 0xFB, 0xFE, 0xFE, 0xFE, 0x41, 0x41, 0x40, 0x41, 0x8, 0x40, 0x41, 0x41, 0x41, 0xFE, 0xFE, 0xFE, 0xFB, 0xFE, 0xFE, 0xFE, 0x41, 0x41, 0x40, 0x41, 0x8, 0x40, 0x42, 0x41, 0x43, 0x43, 0x43, 0x41, 0x40, 0x42, 0x42, 0x42, 0x42, 0x41, 0x40, 0x41, 0x8, 0x40, 0x40, 0x41, 0xFB, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0xFB, 0x41, 0x40, 0x41, 0x8, 0x40, 0x40, 0xFB, 0x43, 0x43, 0x41, 0x41, 0x41, 0x42, 0x42, 0x42, 0x42, 0xFB, 0x40, 0x41, 0x8, 0x40, 0xFB, 0x43, 0x43, 0x41, 0x41, 0x43, 0x43, 0x43, 0x43, 0x43, 0x43, 0x43, 0xFB, 0x41, 0x8, 0x40, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x8}, - .unk3A0 = {0x381, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1}, - .coords = {133, 137}, - .direction = 0x23, - .range = 0x33, - }, - [1] = - { - .unk0 = 0x2B, - .unk1 = 0x2C, - .trainers = - { - [0] = - { - .name = _("ANNABELL"), - .facilityClass = FACILITY_CLASS_PARASOL_LADY, - .unused = 0, - .speechBefore = {0x81E, 0x100F, 0xA02, 0xE09, 0x2813, 0xC03}, - .speechWin = {0xA1F, 0xA02, 0xE09, 0x1440, 0xC03, 0xFFFF}, - .speechLose = {0xA01, 0x1016, 0x1239, 0xA06, 0xE09, 0x1240}, - .speechAfter = {0xA05, 0x20E, 0x1A35, 0xE25, 0x102F, 0x449}, - .mons = - { - [0] = - { - .species = SPECIES_JIGGLYPUFF, - .heldItem = ITEM_BRIGHT_POWDER, - .moves = {MOVE_SING, MOVE_HYPER_VOICE, MOVE_ATTRACT, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 85, - .attackEV = 85, - .defenseEV = 85, - .speedEV = 85, - .spAttackEV = 85, - .spDefenseEV = 85, - .otId = TRAINER_HILL_OTID, - .hpIV = 5, - .attackIV = 5, - .defenseIV = 5, - .speedIV = 5, - .spAttackIV = 5, - .spDefenseIV = 5, - .altAbility = 0, - .personality = 0x0, - .nickname = _("JIGGLYPUFF"), - .friendship = 255, - }, - [1] = - { - .species = SPECIES_JYNX, - .heldItem = ITEM_BRIGHT_POWDER, - .moves = {MOVE_PERISH_SONG, MOVE_FAKE_TEARS, MOVE_ATTRACT, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 85, - .attackEV = 85, - .defenseEV = 85, - .speedEV = 85, - .spAttackEV = 85, - .spDefenseEV = 85, - .otId = TRAINER_HILL_OTID, - .hpIV = 5, - .attackIV = 5, - .defenseIV = 5, - .speedIV = 5, - .spAttackIV = 5, - .spDefenseIV = 5, - .altAbility = 0, - .personality = 0x0, - .nickname = _("JYNX"), - .friendship = 255, - }, - [2] = - { - .species = SPECIES_EXPLOUD, - .heldItem = ITEM_BRIGHT_POWDER, - .moves = {MOVE_HOWL, MOVE_HYPER_VOICE, MOVE_ATTRACT, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 85, - .attackEV = 85, - .defenseEV = 85, - .speedEV = 85, - .spAttackEV = 85, - .spDefenseEV = 85, - .otId = TRAINER_HILL_OTID, - .hpIV = 5, - .attackIV = 5, - .defenseIV = 5, - .speedIV = 5, - .spAttackIV = 5, - .spDefenseIV = 5, - .altAbility = 0, - .personality = 0x96, - .nickname = _("EXPLOUD"), - .friendship = 255, - }, - [3] = - { - .species = SPECIES_ABSOL, - .heldItem = ITEM_BRIGHT_POWDER, - .moves = {MOVE_SWORDS_DANCE, MOVE_SLASH, MOVE_ATTRACT, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 85, - .attackEV = 85, - .defenseEV = 85, - .speedEV = 85, - .spAttackEV = 85, - .spDefenseEV = 85, - .otId = TRAINER_HILL_OTID, - .hpIV = 5, - .attackIV = 5, - .defenseIV = 5, - .speedIV = 5, - .spAttackIV = 5, - .spDefenseIV = 5, - .altAbility = 0, - .personality = 0x96, - .nickname = _("ABSOL"), - .friendship = 255, - }, - [4] = - { - .species = SPECIES_PIDGEOTTO, - .heldItem = ITEM_BRIGHT_POWDER, - .moves = {MOVE_FEATHER_DANCE, MOVE_AERIAL_ACE, MOVE_ATTRACT, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 85, - .attackEV = 85, - .defenseEV = 85, - .speedEV = 85, - .spAttackEV = 85, - .spDefenseEV = 85, - .otId = TRAINER_HILL_OTID, - .hpIV = 5, - .attackIV = 5, - .defenseIV = 5, - .speedIV = 5, - .spAttackIV = 5, - .spDefenseIV = 5, - .altAbility = 0, - .personality = 0x96, - .nickname = _("PIDGEOTTO"), - .friendship = 255, - }, - [5] = - { - .species = SPECIES_ALTARIA, - .heldItem = ITEM_BRIGHT_POWDER, - .moves = {MOVE_DRAGON_DANCE, MOVE_AERIAL_ACE, MOVE_ATTRACT, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 85, - .attackEV = 85, - .defenseEV = 85, - .speedEV = 85, - .spAttackEV = 85, - .spDefenseEV = 85, - .otId = TRAINER_HILL_OTID, - .hpIV = 5, - .attackIV = 5, - .defenseIV = 5, - .speedIV = 5, - .spAttackIV = 5, - .spDefenseIV = 5, - .altAbility = 0, - .personality = 0x0, - .nickname = _("ALTARIA"), - .friendship = 255, - }, - }, - }, - [1] = - { - .name = _("COLEMAN"), - .facilityClass = FACILITY_CLASS_COLLECTOR, - .unused = 0, - .speechBefore = {0xA01, 0x1645, 0xA2C, 0x102E, 0xA28, 0x1A00}, - .speechWin = {0x103B, 0xA28, 0x1A00, 0x1239, 0x1E14, 0xC03}, - .speechLose = {0xA06, 0x103A, 0x1020, 0x24D7, 0xA27, 0xC00}, - .speechAfter = {0xA2A, 0x60E, 0x200, 0x102E, 0xA28, 0x1A00}, - .mons = - { - [0] = - { - .species = SPECIES_CHIMECHO, - .heldItem = ITEM_FOCUS_BAND, - .moves = {MOVE_UPROAR, MOVE_ATTRACT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 6, - .attackEV = 252, - .speedEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 5, - .attackIV = 5, - .defenseIV = 5, - .speedIV = 5, - .spAttackIV = 5, - .spDefenseIV = 5, - .altAbility = 0, - .personality = 0xD, - .nickname = _("CHIMECHO"), - .friendship = 255, - }, - [1] = - { - .species = SPECIES_WHISMUR, - .heldItem = ITEM_FOCUS_BAND, - .moves = {MOVE_UPROAR, MOVE_ATTRACT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 6, - .attackEV = 252, - .speedEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 5, - .attackIV = 5, - .defenseIV = 5, - .speedIV = 5, - .spAttackIV = 5, - .spDefenseIV = 5, - .altAbility = 0, - .personality = 0xD, - .nickname = _("WHISMUR"), - .friendship = 255, - }, - [2] = - { - .species = SPECIES_YANMA, - .heldItem = ITEM_FOCUS_BAND, - .moves = {MOVE_UPROAR, MOVE_ATTRACT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 6, - .attackEV = 252, - .speedEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 5, - .attackIV = 5, - .defenseIV = 5, - .speedIV = 5, - .spAttackIV = 5, - .spDefenseIV = 5, - .altAbility = 0, - .personality = 0x8A, - .nickname = _("YANMA"), - .friendship = 255, - }, - [3] = - { - .species = SPECIES_ILLUMISE, - .heldItem = ITEM_BRIGHT_POWDER, - .moves = {MOVE_ENCORE, MOVE_ATTRACT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .defenseEV = 6, - .speedEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 5, - .attackIV = 5, - .defenseIV = 5, - .speedIV = 5, - .spAttackIV = 5, - .spDefenseIV = 5, - .altAbility = 0, - .personality = 0xA, - .nickname = _("ILLUMISE"), - .friendship = 255, - }, - [4] = - { - .species = SPECIES_SPHEAL, - .heldItem = ITEM_FOCUS_BAND, - .moves = {MOVE_ENCORE, MOVE_ATTRACT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .speedEV = 252, - .spDefenseEV = 6, - .otId = TRAINER_HILL_OTID, - .hpIV = 5, - .attackIV = 5, - .defenseIV = 5, - .speedIV = 5, - .spAttackIV = 5, - .spDefenseIV = 5, - .altAbility = 0, - .personality = 0xA, - .nickname = _("SPHEAL"), - .friendship = 255, - }, - [5] = - { - .species = SPECIES_VIGOROTH, - .heldItem = ITEM_FOCUS_BAND, - .moves = {MOVE_ENCORE, MOVE_ATTRACT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .defenseEV = 6, - .speedEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 5, - .attackIV = 5, - .defenseIV = 5, - .speedIV = 5, - .spAttackIV = 5, - .spDefenseIV = 5, - .altAbility = 0, - .personality = 0x87, - .nickname = _("VIGOROTH"), - .friendship = 255, - }, - }, - }, - }, - .data = {0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x8, 0x91, 0x9B, 0x9C, 0x96, 0x40, 0x40, 0x96, 0x9B, 0x96, 0x40, 0x40, 0x96, 0x9B, 0x9C, 0x9B, 0x8, 0x9C, 0x9B, 0x96, 0x40, 0xDB, 0xDB, 0x40, 0x96, 0x40, 0xDB, 0xDB, 0x42, 0x96, 0x9B, 0x9B, 0x8, 0x91, 0x96, 0x40, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0x42, 0x96, 0x9C, 0x8, 0x91, 0x42, 0xDB, 0xDB, 0xD6, 0xD6, 0xD6, 0xDB, 0xD6, 0xD6, 0xD6, 0xDB, 0xDB, 0x42, 0x9B, 0x8, 0x96, 0x42, 0xDB, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xDB, 0x42, 0x96, 0x8, 0x96, 0x42, 0xDB, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xDB, 0x42, 0x96, 0x8, 0x96, 0x42, 0xDB, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xDB, 0x42, 0x96, 0x8, 0x96, 0x42, 0xDB, 0xDB, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xDB, 0xDB, 0x42, 0x96, 0x8, 0x91, 0x96, 0x42, 0xDB, 0xDB, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xDB, 0xDB, 0x42, 0x96, 0x9B, 0x8, 0x91, 0x9B, 0x96, 0x42, 0xDB, 0xDB, 0xD6, 0xD6, 0xD6, 0xDB, 0xDB, 0x42, 0x96, 0x9B, 0x9C, 0x8, 0x9C, 0x9B, 0x9B, 0x96, 0x42, 0xDB, 0xDB, 0xD6, 0xDB, 0xDB, 0x42, 0x96, 0x9B, 0x9B, 0x9B, 0x8, 0x96, 0x9B, 0x9B, 0x9B, 0x96, 0x41, 0xDB, 0xDB, 0xDB, 0x42, 0x96, 0x9B, 0x9B, 0x9C, 0x96, 0x8, 0xD6, 0x96, 0x9C, 0x9B, 0x9B, 0x96, 0x41, 0xDB, 0x42, 0x96, 0x9B, 0x9B, 0x9B, 0x96, 0xD6, 0x8, 0x9C, 0xD6, 0x96, 0x9B, 0x9C, 0x9B, 0x96, 0x40, 0x96, 0x9B, 0x9C, 0x9B, 0x96, 0xD6, 0x9C, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8}, - .unk3A0 = {0x381, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0xFFFF}, - .coords = {131, 139}, - .direction = 0x23, - .range = 0x77, - }, - [2] = - { - .unk0 = 0x2D, - .unk1 = 0x2E, - .trainers = - { - [0] = - { - .name = _("ENRIQUE"), - .facilityClass = FACILITY_CLASS_RICH_BOY, - .unused = 0, - .speechBefore = {0x20F, 0xE25, 0x102B, 0x1021, 0x2017, 0x1C13}, - .speechWin = {0x822, 0x822, 0xC00, 0x81B, 0xFFFF, 0xFFFF}, - .speechLose = {0xC3B, 0x162D, 0xA02, 0x604, 0xC03, 0xFFFF}, - .speechAfter = {0x103B, 0xA02, 0x1239, 0xA28, 0x142B, 0xC03}, - .mons = - { - [0] = - { - .species = SPECIES_WOOPER, - .heldItem = ITEM_FIGY_BERRY, - .moves = {MOVE_RAIN_DANCE, MOVE_YAWN, MOVE_SURF, MOVE_HAZE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .speedEV = 6, - .spAttackEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x8C, - .nickname = _("WOOPER"), - .friendship = 255, - }, - [1] = - { - .species = SPECIES_POLIWAG, - .heldItem = ITEM_WIKI_BERRY, - .moves = {MOVE_SURF, MOVE_ICE_BEAM, MOVE_MIST, MOVE_HYPNOSIS}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .speedEV = 6, - .spAttackEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 1, - .personality = 0x3, - .nickname = _("POLIWAG"), - .friendship = 255, - }, - [2] = - { - .species = SPECIES_PSYDUCK, - .heldItem = ITEM_AGUAV_BERRY, - .moves = {MOVE_HYPNOSIS, MOVE_SURF, MOVE_DISABLE, MOVE_SEISMIC_TOSS}, - .level = 0, - .ppBonuses = 0, - .hpEV = 250, - .defenseEV = 130, - .spDefenseEV = 130, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x3, - .nickname = _("PSYDUCK"), - .friendship = 255, - }, - [3] = - { - .species = SPECIES_RHYDON, - .heldItem = ITEM_SOFT_SAND, - .moves = {MOVE_EARTHQUAKE, MOVE_MAGNITUDE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .attackEV = 252, - .speedEV = 6, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x96, - .nickname = _("RHYDON"), - .friendship = 0, - }, - [4] = - { - .species = SPECIES_RHYHORN, - .heldItem = ITEM_SOFT_SAND, - .moves = {MOVE_EARTHQUAKE, MOVE_MAGNITUDE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 6, - .attackEV = 252, - .speedEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x3, - .nickname = _("RHYHORN"), - .friendship = 0, - }, - [5] = - { - .species = SPECIES_CUBONE, - .heldItem = ITEM_SOFT_SAND, - .moves = {MOVE_EARTHQUAKE, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 6, - .attackEV = 252, - .speedEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 1, - .personality = 0x80, - .nickname = _("CUBONE"), - .friendship = 0, - }, - }, - }, - [1] = - { - .name = _("COLLEEN"), - .facilityClass = FACILITY_CLASS_LADY, - .unused = 0, - .speechBefore = {0xA01, 0x100A, 0x103A, 0x102F, 0x40A, 0x1038}, - .speechWin = {0xA01, 0x103A, 0x1E0F, 0x40A, 0x1E05, 0xC00}, - .speechLose = {0x818, 0xE15, 0x2216, 0xA28, 0x1827, 0xC04}, - .speechAfter = {0xA01, 0x1236, 0x102F, 0x601, 0xE1C, 0x1C05}, - .mons = - { - [0] = - { - .species = SPECIES_MAGNEMITE, - .heldItem = ITEM_MAGNET, - .moves = {MOVE_THUNDER, MOVE_ZAP_CANNON, MOVE_SPARK, MOVE_THUNDER_SHOCK}, - .level = 0, - .ppBonuses = 0, - .hpEV = 6, - .speedEV = 252, - .spAttackEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x8C, - .nickname = _("MAGNEMITE"), - .friendship = 255, - }, - [1] = - { - .species = SPECIES_ELECTABUZZ, - .heldItem = ITEM_MAGNET, - .moves = {MOVE_THUNDER, MOVE_THUNDERBOLT, MOVE_THUNDER_PUNCH, MOVE_SHOCK_WAVE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 6, - .speedEV = 252, - .spAttackEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x41, - .nickname = _("ELECTABUZZ"), - .friendship = 255, - }, - [2] = - { - .species = SPECIES_FLAAFFY, - .heldItem = ITEM_MAGNET, - .moves = {MOVE_THUNDER, MOVE_THUNDERBOLT, MOVE_SHOCK_WAVE, MOVE_THUNDER_SHOCK}, - .level = 0, - .ppBonuses = 0, - .hpEV = 250, - .spAttackEV = 130, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x0, - .nickname = _("FLAAFFY"), - .friendship = 255, - }, - [3] = - { - .species = SPECIES_BALTOY, - .heldItem = ITEM_SILK_SCARF, - .moves = {MOVE_EXPLOSION, MOVE_SELF_DESTRUCT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 6, - .attackEV = 252, - .speedEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x3, - .nickname = _("BALTOY"), - .friendship = 0, - }, - [4] = - { - .species = SPECIES_PINECO, - .heldItem = ITEM_SILK_SCARF, - .moves = {MOVE_EXPLOSION, MOVE_SELF_DESTRUCT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .attackEV = 252, - .speedEV = 6, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x3, - .nickname = _("PINECO"), - .friendship = 0, - }, - [5] = - { - .species = SPECIES_VOLTORB, - .heldItem = ITEM_SILK_SCARF, - .moves = {MOVE_EXPLOSION, MOVE_SELF_DESTRUCT, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 6, - .attackEV = 252, - .speedEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x80, - .nickname = _("VOLTORB"), - .friendship = 0, - }, - }, - }, - }, - .data = {0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x1B, 0x1C, 0x1D, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x8, 0x91, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x84, 0x84, 0x84, 0x9A, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x8, 0x17, 0xB2, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xB0, 0x17, 0xB2, 0xA1, 0x8, 0x17, 0xBB, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0xBB, 0x17, 0x17, 0x17, 0x8, 0x17, 0xB2, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xB0, 0x17, 0xB2, 0xA1, 0x8, 0x17, 0x17, 0x17, 0xBB, 0x17, 0x17, 0x17, 0x17, 0x17, 0xBB, 0x17, 0x17, 0x17, 0x17, 0x17, 0x8, 0x17, 0xB2, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xB0, 0x17, 0xB2, 0xA1, 0x8, 0x17, 0x17, 0xBB, 0x17, 0x17, 0x17, 0x17, 0xBB, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x8, 0x17, 0xB2, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xB0, 0x17, 0xB2, 0xA1, 0x8, 0x17, 0x17, 0x17, 0x17, 0x17, 0xBB, 0x17, 0x17, 0x17, 0x17, 0xBB, 0x17, 0x17, 0x17, 0x17, 0x8, 0x17, 0xB2, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xB0, 0x17, 0xB2, 0xA1, 0x8, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0xBB, 0x17, 0x17, 0xBB, 0x17, 0x17, 0x8, 0x17, 0xB2, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xB0, 0x17, 0xB2, 0xA1, 0x8, 0x17, 0x17, 0x17, 0x17, 0xBB, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x8, 0x17, 0xB2, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xB0, 0x17, 0xB2, 0xA1, 0x8, 0x17, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0x17, 0xBB, 0xBB, 0x8}, - .unk3A0 = {0x381, 0x381, 0x7FF7, 0x1, 0x7FF7, 0x1, 0x7FF7, 0x1, 0x7FF7, 0x1, 0x7FF7, 0x1, 0x7FF7, 0x1, 0x7FF7, 0x1}, - .coords = {25, 30}, - .direction = 0x23, - .range = 0x44, - }, - [3] = - { - .unk0 = 0x2F, - .unk1 = 0x30, - .trainers = - { - [0] = - { - .name = _("KIMBERLY"), - .facilityClass = FACILITY_CLASS_POKEFAN_F, - .unused = 0, - .speechBefore = {0xA01, 0x103A, 0x163A, 0x1036, 0xA28, 0x45D}, - .speechWin = {0xA29, 0x1022, 0x122E, 0xA02, 0x1212, 0xC03}, - .speechLose = {0xA06, 0x1020, 0xE02, 0xA21, 0x1029, 0x1443}, - .speechAfter = {0xA28, 0x45D, 0x100B, 0x1E29, 0x102B, 0xA14}, - .mons = - { - [0] = - { - .species = SPECIES_UNOWN, - .heldItem = ITEM_MIRACLE_SEED, - .moves = {MOVE_HIDDEN_POWER, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 255, - .spAttackEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 30, - .attackIV = 31, - .defenseIV = 30, - .speedIV = 31, - .spAttackIV = 30, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0x202, - .nickname = _("UNOWN"), - .friendship = 255, - }, - [1] = - { - .species = SPECIES_UNOWN, - .heldItem = ITEM_MYSTIC_WATER, - .moves = {MOVE_HIDDEN_POWER, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 255, - .spAttackEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 30, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 30, - .spAttackIV = 30, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0x10001, - .nickname = _("UNOWN"), - .friendship = 255, - }, - [2] = - { - .species = SPECIES_UNOWN, - .heldItem = ITEM_BLACK_BELT, - .moves = {MOVE_HIDDEN_POWER, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 255, - .spAttackEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 30, - .attackIV = 30, - .defenseIV = 30, - .speedIV = 30, - .spAttackIV = 30, - .spDefenseIV = 30, - .altAbility = 0, - .personality = 0x102, - .nickname = _("UNOWN"), - .friendship = 255, - }, - [3] = - { - .species = SPECIES_SPINDA, - .heldItem = ITEM_LUM_BERRY, - .moves = {MOVE_TEETER_DANCE, MOVE_DIZZY_PUNCH, MOVE_CALM_MIND, MOVE_BATON_PASS}, - .level = 0, - .ppBonuses = 0, - .hpEV = 110, - .defenseEV = 200, - .spDefenseEV = 200, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x88FE980F, - .nickname = _("SPINDA"), - .friendship = 255, - }, - [4] = - { - .species = SPECIES_PLUSLE, - .heldItem = ITEM_BRIGHT_POWDER, - .moves = {MOVE_HELPING_HAND, MOVE_THUNDERBOLT, MOVE_AGILITY, MOVE_BATON_PASS}, - .level = 0, - .ppBonuses = 0, - .speedEV = 255, - .spAttackEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0xF, - .nickname = _("PLUSLE"), - .friendship = 255, - }, - [5] = - { - .species = SPECIES_VOLBEAT, - .heldItem = ITEM_SITRUS_BERRY, - .moves = {MOVE_HELPING_HAND, MOVE_SIGNAL_BEAM, MOVE_SOLAR_BEAM, MOVE_MOONLIGHT}, - .level = 0, - .ppBonuses = 0, - .speedEV = 255, - .spAttackEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 1, - .personality = 0xF, - .nickname = _("VOLBEAT"), - .friendship = 255, - }, - }, - }, - [1] = - { - .name = _("FRANCISCO"), - .facilityClass = FACILITY_CLASS_POKEFAN_M, - .unused = 0, - .speechBefore = {0xA01, 0x1822, 0x1E10, 0x1C04, 0x1039, 0xFFFF}, - .speechWin = {0x1025, 0xE1D, 0xE0F, 0xA02, 0x631, 0xFFFF}, - .speechLose = {0x81D, 0x1004, 0xA01, 0x162D, 0x123F, 0xA02}, - .speechAfter = {0x801, 0xC04, 0xFFFF, 0x811, 0xFFFF, 0xFFFF}, - .mons = - { - [0] = - { - .species = SPECIES_SPINDA, - .heldItem = ITEM_LUM_BERRY, - .moves = {MOVE_TEETER_DANCE, MOVE_DIZZY_PUNCH, MOVE_CALM_MIND, MOVE_BATON_PASS}, - .level = 0, - .ppBonuses = 0, - .hpEV = 110, - .defenseEV = 200, - .spDefenseEV = 200, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0xE2880098, - .nickname = _("SPINDA"), - .friendship = 255, - }, - [1] = - { - .species = SPECIES_MINUN, - .heldItem = ITEM_BRIGHT_POWDER, - .moves = {MOVE_HELPING_HAND, MOVE_THUNDERBOLT, MOVE_AGILITY, MOVE_BATON_PASS}, - .level = 0, - .ppBonuses = 0, - .speedEV = 255, - .spAttackEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x8C, - .nickname = _("MINUN"), - .friendship = 255, - }, - [2] = - { - .species = SPECIES_ILLUMISE, - .heldItem = ITEM_SITRUS_BERRY, - .moves = {MOVE_HELPING_HAND, MOVE_WISH, MOVE_THUNDERBOLT, MOVE_MOONLIGHT}, - .level = 0, - .ppBonuses = 0, - .speedEV = 255, - .spAttackEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0xF, - .nickname = _("ILLUMISE"), - .friendship = 255, - }, - [3] = - { - .species = SPECIES_UNOWN, - .heldItem = ITEM_CHARCOAL, - .moves = {MOVE_HIDDEN_POWER, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 255, - .spAttackEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 30, - .attackIV = 31, - .defenseIV = 30, - .speedIV = 30, - .spAttackIV = 30, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0x302, - .nickname = _("UNOWN"), - .friendship = 255, - }, - [4] = - { - .species = SPECIES_UNOWN, - .heldItem = ITEM_SOFT_SAND, - .moves = {MOVE_HIDDEN_POWER, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 255, - .attackEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 30, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 30, - .spDefenseIV = 30, - .altAbility = 0, - .personality = 0x203, - .nickname = _("UNOWN"), - .friendship = 255, - }, - [5] = - { - .species = SPECIES_UNOWN, - .heldItem = ITEM_TWISTED_SPOON, - .moves = {MOVE_HIDDEN_POWER, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 255, - .spAttackEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 30, - .speedIV = 30, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0x301, - .nickname = _("UNOWN"), - .friendship = 255, - }, - }, - }, - }, - .data = {0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x8, 0x69, 0x40, 0x6D, 0x41, 0x73, 0x41, 0x5E, 0x41, 0x71, 0x42, 0x45, 0x45, 0x45, 0x45, 0x45, 0x8, 0x43, 0x73, 0x64, 0x73, 0x43, 0x73, 0x64, 0x73, 0x41, 0x73, 0x45, 0x45, 0x45, 0x45, 0x45, 0x8, 0x65, 0x40, 0x73, 0x42, 0x6D, 0x42, 0x73, 0x42, 0x6D, 0x42, 0x45, 0x45, 0x45, 0x45, 0x45, 0x8, 0x6C, 0x73, 0x41, 0x73, 0x64, 0x73, 0x40, 0x73, 0x64, 0x73, 0x40, 0x73, 0x42, 0x73, 0x41, 0x8, 0x69, 0x40, 0x6D, 0x41, 0x73, 0x40, 0x6D, 0x43, 0x73, 0x43, 0x6D, 0x42, 0x73, 0x42, 0x6D, 0x8, 0x40, 0x73, 0x64, 0x73, 0x43, 0x73, 0x64, 0x73, 0x41, 0x73, 0x64, 0x73, 0x41, 0x73, 0x64, 0x8, 0x65, 0x42, 0x73, 0x42, 0x6D, 0x41, 0x73, 0x40, 0x6D, 0x42, 0x73, 0x41, 0x6D, 0x42, 0x73, 0x8, 0x6C, 0x73, 0x41, 0x73, 0x64, 0x73, 0x42, 0x73, 0x64, 0x73, 0x42, 0x73, 0x64, 0x73, 0x42, 0x8, 0x69, 0x40, 0x6D, 0x41, 0x73, 0x41, 0x6D, 0x42, 0x73, 0x43, 0x6D, 0x41, 0x73, 0x43, 0x6D, 0x8, 0x40, 0x73, 0x64, 0x73, 0x43, 0x73, 0x64, 0x73, 0x43, 0x73, 0x64, 0x73, 0x42, 0x73, 0x64, 0x8, 0x65, 0x42, 0x73, 0x42, 0x6D, 0x43, 0x73, 0x42, 0x6D, 0x42, 0x73, 0x41, 0x6D, 0x40, 0x73, 0x8, 0x6C, 0x73, 0x40, 0x73, 0x64, 0x73, 0x41, 0x73, 0x64, 0x73, 0x42, 0x73, 0x64, 0x73, 0x42, 0x8, 0x69, 0x40, 0x6D, 0x42, 0x73, 0x42, 0x6D, 0x43, 0x73, 0x40, 0x6D, 0x41, 0x73, 0x40, 0x6D, 0x8, 0x40, 0x73, 0x64, 0x73, 0x40, 0x73, 0x64, 0x73, 0x40, 0x73, 0x64, 0x73, 0x43, 0x73, 0x64, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8}, - .unk3A0 = {0x381, 0x1, 0x2201, 0x1, 0x8881, 0x1, 0x2223, 0x1, 0x8889, 0x1, 0x2223, 0x1, 0x8889, 0x1, 0x2223, 0xFFFF}, - .coords = {42, 46}, - .direction = 0x23, - .range = 0x33, - }, - }, + .unkField_0 = 8, + .unused1 = 1, + .unkField_2 = 4, + .unused3 = 0, + .unused4 = 21, + .unused5 = 76, + .unused6 = 5, + .floors = + { + [0] = + { + .unk0 = 0x29, + .unk1 = 0x2A, + .trainers = + { + [0] = + { + .name = _("TERRANCE"), + .facilityClass = FACILITY_CLASS_GENTLEMAN, + .unused = 0, + .speechBefore = {EC_WORD_GOOD, EC_WORD_CHILDREN, EC_WORD_WILL, EC_WORD_GET, EC_WORD_A, EC_MOVE2(PRESENT)}, + .speechWin = {EC_WORD_THANK_YOU, EC_WORD_MY, EC_WORD_VICTORY, EC_WORD_IS, EC_WORD_YOUR, EC_MOVE2(PRESENT)}, + .speechLose = {EC_WORD_THAT_WAS, EC_WORD_MY, EC_MOVE2(PRESENT), EC_WORD_TO, EC_WORD_YOU, 0xFFFF}, + .speechAfter = {EC_WORD_WELL_THEN, EC_WORD_CONGRATS, EC_WORD_MY, EC_WORD_FRIEND, 0xFFFF, 0xFFFF}, + .mons = + { + [0] = + { + .species = SPECIES_DELIBIRD, + .heldItem = ITEM_SITRUS_BERRY, + .moves = {MOVE_PRESENT, MOVE_SPLASH, MOVE_HAIL, MOVE_PROTECT}, + .level = 0, + .ppBonuses = 0, + .attackEV = 255, + .speedEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 1, + .personality = 0x8A, + .nickname = _("DELIBIRD"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_CLEFAIRY, + .heldItem = ITEM_SITRUS_BERRY, + .moves = {MOVE_PRESENT, MOVE_COSMIC_POWER, MOVE_LIGHT_SCREEN, MOVE_MOONLIGHT}, + .level = 0, + .ppBonuses = 0, + .attackEV = 255, + .speedEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0xD, + .nickname = _("CLEFAIRY"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_PIKACHU, + .heldItem = ITEM_SITRUS_BERRY, + .moves = {MOVE_PRESENT, MOVE_GROWL, MOVE_TAIL_WHIP, MOVE_AGILITY}, + .level = 0, + .ppBonuses = 0, + .attackEV = 255, + .speedEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0xD, + .nickname = _("PIKACHU"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_MARILL, + .heldItem = ITEM_SITRUS_BERRY, + .moves = {MOVE_PRESENT, MOVE_DEFENSE_CURL, MOVE_TAIL_WHIP, MOVE_ENDURE}, + .level = 0, + .ppBonuses = 0, + .attackEV = 255, + .speedEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 1, + .personality = 0x8A, + .nickname = _("MARILL"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_JIGGLYPUFF, + .heldItem = ITEM_SITRUS_BERRY, + .moves = {MOVE_PRESENT, MOVE_SING, MOVE_DISABLE, MOVE_REST}, + .level = 0, + .ppBonuses = 0, + .attackEV = 255, + .speedEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0xD, + .nickname = _("JIGGLYPUFF"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_TOGETIC, + .heldItem = ITEM_SITRUS_BERRY, + .moves = {MOVE_PRESENT, MOVE_CHARM, MOVE_SWEET_KISS, MOVE_WISH}, + .level = 0, + .ppBonuses = 0, + .attackEV = 255, + .speedEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 1, + .personality = 0x26, + .nickname = _("TOGETIC"), + .friendship = 255, + }, + }, + }, + [1] = + { + .name = _("ELIZABETH"), + .facilityClass = FACILITY_CLASS_LADY, + .unused = 0, + .speechBefore = {EC_WORD_CAN, EC_WORD_YOU, EC_WORD_SENSE, EC_WORD_ME, EC_MOVE(FOCUS_ENERGY), EC_WORD_QUES}, + .speechWin = {EC_WORD_THAT_S, EC_WORD_ABOUT, EC_WORD_RIGHT, EC_WORD_I, EC_WORD_WOULD, EC_WORD_THINK}, + .speechLose = {EC_WORD_THINGS, EC_WORD_DON_T, EC_WORD_ALWAYS, EC_WORD_WORK, EC_WORD_OUT, 0xFFFF}, + .speechAfter = {EC_WORD_I_AM, EC_WORD_FEELING, EC_WORD_LONESOME, EC_WORD_AND, EC_WORD_SAD, EC_WORD_NOW}, + .mons = + { + [0] = + { + .species = SPECIES_WIGGLYTUFF, + .heldItem = ITEM_SILK_SCARF, + .moves = {MOVE_ROLLOUT, MOVE_DEFENSE_CURL, MOVE_SING, MOVE_DREAM_EATER}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .speedEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0xC1, + .nickname = _("WIGGLYTUFF"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_SABLEYE, + .heldItem = ITEM_SILK_SCARF, + .moves = {MOVE_ASTONISH, MOVE_FAINT_ATTACK, MOVE_DETECT, MOVE_CONFUSE_RAY}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .speedEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0x87, + .nickname = _("SABLEYE"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_GRUMPIG, + .heldItem = ITEM_SILK_SCARF, + .moves = {MOVE_PSYBEAM, MOVE_MAGIC_COAT, MOVE_BOUNCE, MOVE_FUTURE_SIGHT}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .speedEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0xA, + .nickname = _("GRUMPIG"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_CORSOLA, + .heldItem = ITEM_SILK_SCARF, + .moves = {MOVE_BUBBLE_BEAM, MOVE_ROCK_BLAST, MOVE_REFLECT, MOVE_LIGHT_SCREEN}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .speedEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0x12, + .nickname = _("CORSOLA"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_CLAMPERL, + .heldItem = ITEM_SILK_SCARF, + .moves = {MOVE_WHIRLPOOL, MOVE_IRON_DEFENSE, MOVE_ENDURE, MOVE_CONFUSE_RAY}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .speedEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0xA, + .nickname = _("CLAMPERL"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_STARMIE, + .heldItem = ITEM_SILK_SCARF, + .moves = {MOVE_DIVE, MOVE_ICY_WIND, MOVE_SWIFT, MOVE_SKILL_SWAP}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .speedEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0xA, + .nickname = _("STARMIE"), + .friendship = 255, + }, + }, + }, + }, + .data = {0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x8, 0x40, 0x41, 0x41, 0x41, 0x41, 0x41, 0x42, 0x43, 0x43, 0x43, 0x43, 0x43, 0x40, 0x41, 0x41, 0x8, 0x40, 0xFB, 0x43, 0x41, 0x41, 0x41, 0x42, 0x40, 0x43, 0x41, 0x42, 0x42, 0x42, 0xFB, 0x41, 0x8, 0x40, 0x41, 0xFB, 0x41, 0x41, 0x41, 0x42, 0x40, 0x43, 0x41, 0x43, 0x43, 0xFB, 0x40, 0x41, 0x8, 0x40, 0x41, 0x41, 0xFB, 0x43, 0x41, 0x42, 0x40, 0x43, 0x43, 0x43, 0xFB, 0x41, 0x40, 0x41, 0x8, 0x40, 0x41, 0x41, 0x41, 0x42, 0x42, 0x42, 0x40, 0x43, 0x43, 0x43, 0x41, 0x41, 0x40, 0x41, 0x8, 0x40, 0x41, 0x41, 0x41, 0xFE, 0xFE, 0xFE, 0xFB, 0xFE, 0xFE, 0xFE, 0x41, 0x41, 0x40, 0x41, 0x8, 0x40, 0x41, 0x41, 0x41, 0xFE, 0xFE, 0xFE, 0xFB, 0xFE, 0xFE, 0xFE, 0x41, 0x41, 0x40, 0x41, 0x8, 0x40, 0x41, 0x42, 0x41, 0xFE, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFE, 0x41, 0x41, 0x40, 0x41, 0x8, 0x40, 0x41, 0x41, 0x41, 0xFE, 0xFE, 0xFE, 0xFB, 0xFE, 0xFE, 0xFE, 0x41, 0x41, 0x40, 0x41, 0x8, 0x40, 0x41, 0x41, 0x41, 0xFE, 0xFE, 0xFE, 0xFB, 0xFE, 0xFE, 0xFE, 0x41, 0x41, 0x40, 0x41, 0x8, 0x40, 0x42, 0x41, 0x43, 0x43, 0x43, 0x41, 0x40, 0x42, 0x42, 0x42, 0x42, 0x41, 0x40, 0x41, 0x8, 0x40, 0x40, 0x41, 0xFB, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0xFB, 0x41, 0x40, 0x41, 0x8, 0x40, 0x40, 0xFB, 0x43, 0x43, 0x41, 0x41, 0x41, 0x42, 0x42, 0x42, 0x42, 0xFB, 0x40, 0x41, 0x8, 0x40, 0xFB, 0x43, 0x43, 0x41, 0x41, 0x43, 0x43, 0x43, 0x43, 0x43, 0x43, 0x43, 0xFB, 0x41, 0x8, 0x40, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x8}, + .unk3A0 = {0x381, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1}, + .coords = {133, 137}, + .direction = 0x23, + .range = 0x33, + }, + [1] = + { + .unk0 = 0x2B, + .unk1 = 0x2C, + .trainers = + { + [0] = + { + .name = _("ANNABELL"), + .facilityClass = FACILITY_CLASS_PARASOL_LADY, + .unused = 0, + .speechBefore = {EC_WORD_HI, EC_WORD_ARE, EC_WORD_YOU, EC_WORD_FEELING, EC_WORD_UPBEAT, EC_WORD_QUES}, + .speechWin = {EC_WORD_AREN_T, EC_WORD_YOU, EC_WORD_FEELING, EC_WORD_WELL, EC_WORD_QUES, 0xFFFF}, + .speechLose = {EC_WORD_I, EC_WORD_CAN, EC_WORD_SEE, EC_WORD_YOU_RE, EC_WORD_FEELING, EC_WORD_GREAT}, + .speechAfter = {EC_WORD_YOUR, EC_WORD_POKEMON, EC_WORD_LOOK, EC_WORD_READY, EC_WORD_TO, EC_WORD_HUSTLE}, + .mons = + { + [0] = + { + .species = SPECIES_JIGGLYPUFF, + .heldItem = ITEM_BRIGHT_POWDER, + .moves = {MOVE_SING, MOVE_HYPER_VOICE, MOVE_ATTRACT, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 85, + .attackEV = 85, + .defenseEV = 85, + .speedEV = 85, + .spAttackEV = 85, + .spDefenseEV = 85, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0x0, + .nickname = _("JIGGLYPUFF"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_JYNX, + .heldItem = ITEM_BRIGHT_POWDER, + .moves = {MOVE_PERISH_SONG, MOVE_FAKE_TEARS, MOVE_ATTRACT, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 85, + .attackEV = 85, + .defenseEV = 85, + .speedEV = 85, + .spAttackEV = 85, + .spDefenseEV = 85, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0x0, + .nickname = _("JYNX"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_EXPLOUD, + .heldItem = ITEM_BRIGHT_POWDER, + .moves = {MOVE_HOWL, MOVE_HYPER_VOICE, MOVE_ATTRACT, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 85, + .attackEV = 85, + .defenseEV = 85, + .speedEV = 85, + .spAttackEV = 85, + .spDefenseEV = 85, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0x96, + .nickname = _("EXPLOUD"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_ABSOL, + .heldItem = ITEM_BRIGHT_POWDER, + .moves = {MOVE_SWORDS_DANCE, MOVE_SLASH, MOVE_ATTRACT, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 85, + .attackEV = 85, + .defenseEV = 85, + .speedEV = 85, + .spAttackEV = 85, + .spDefenseEV = 85, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0x96, + .nickname = _("ABSOL"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_PIDGEOTTO, + .heldItem = ITEM_BRIGHT_POWDER, + .moves = {MOVE_FEATHER_DANCE, MOVE_AERIAL_ACE, MOVE_ATTRACT, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 85, + .attackEV = 85, + .defenseEV = 85, + .speedEV = 85, + .spAttackEV = 85, + .spDefenseEV = 85, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0x96, + .nickname = _("PIDGEOTTO"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_ALTARIA, + .heldItem = ITEM_BRIGHT_POWDER, + .moves = {MOVE_DRAGON_DANCE, MOVE_AERIAL_ACE, MOVE_ATTRACT, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 85, + .attackEV = 85, + .defenseEV = 85, + .speedEV = 85, + .spAttackEV = 85, + .spDefenseEV = 85, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0x0, + .nickname = _("ALTARIA"), + .friendship = 255, + }, + }, + }, + [1] = + { + .name = _("COLEMAN"), + .facilityClass = FACILITY_CLASS_COLLECTOR, + .unused = 0, + .speechBefore = {EC_WORD_I, EC_WORD_SEEK, EC_WORD_SOMEONE, EC_WORD_AS, EC_WORD_MY, EC_WORD_IDOL}, + .speechWin = {EC_WORD_DID, EC_WORD_MY, EC_WORD_IDOL, EC_WORD_SEE, EC_WORD_THAT, EC_WORD_QUES}, + .speechLose = {EC_WORD_YOU_RE, EC_WORD_LIKE, EC_WORD_A, EC_MOVE(HEAL_BELL), EC_WORD_TO_ME, EC_WORD_EXCL}, + .speechAfter = {EC_WORD_I_VE, EC_WORD_DECIDED, EC_WORD_I_CHOOSE_YOU, EC_WORD_AS, EC_WORD_MY, EC_WORD_IDOL}, + .mons = + { + [0] = + { + .species = SPECIES_CHIMECHO, + .heldItem = ITEM_FOCUS_BAND, + .moves = {MOVE_UPROAR, MOVE_ATTRACT, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .attackEV = 252, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0xD, + .nickname = _("CHIMECHO"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_WHISMUR, + .heldItem = ITEM_FOCUS_BAND, + .moves = {MOVE_UPROAR, MOVE_ATTRACT, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .attackEV = 252, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0xD, + .nickname = _("WHISMUR"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_YANMA, + .heldItem = ITEM_FOCUS_BAND, + .moves = {MOVE_UPROAR, MOVE_ATTRACT, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .attackEV = 252, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0x8A, + .nickname = _("YANMA"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_ILLUMISE, + .heldItem = ITEM_BRIGHT_POWDER, + .moves = {MOVE_ENCORE, MOVE_ATTRACT, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .defenseEV = 6, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0xA, + .nickname = _("ILLUMISE"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_SPHEAL, + .heldItem = ITEM_FOCUS_BAND, + .moves = {MOVE_ENCORE, MOVE_ATTRACT, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .speedEV = 252, + .spDefenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0xA, + .nickname = _("SPHEAL"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_VIGOROTH, + .heldItem = ITEM_FOCUS_BAND, + .moves = {MOVE_ENCORE, MOVE_ATTRACT, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .defenseEV = 6, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0x87, + .nickname = _("VIGOROTH"), + .friendship = 255, + }, + }, + }, + }, + .data = {0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x8, 0x91, 0x9B, 0x9C, 0x96, 0x40, 0x40, 0x96, 0x9B, 0x96, 0x40, 0x40, 0x96, 0x9B, 0x9C, 0x9B, 0x8, 0x9C, 0x9B, 0x96, 0x40, 0xDB, 0xDB, 0x40, 0x96, 0x40, 0xDB, 0xDB, 0x42, 0x96, 0x9B, 0x9B, 0x8, 0x91, 0x96, 0x40, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0x42, 0x96, 0x9C, 0x8, 0x91, 0x42, 0xDB, 0xDB, 0xD6, 0xD6, 0xD6, 0xDB, 0xD6, 0xD6, 0xD6, 0xDB, 0xDB, 0x42, 0x9B, 0x8, 0x96, 0x42, 0xDB, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xDB, 0x42, 0x96, 0x8, 0x96, 0x42, 0xDB, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xDB, 0x42, 0x96, 0x8, 0x96, 0x42, 0xDB, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xDB, 0x42, 0x96, 0x8, 0x96, 0x42, 0xDB, 0xDB, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xDB, 0xDB, 0x42, 0x96, 0x8, 0x91, 0x96, 0x42, 0xDB, 0xDB, 0xD6, 0xD6, 0xD6, 0xD6, 0xD6, 0xDB, 0xDB, 0x42, 0x96, 0x9B, 0x8, 0x91, 0x9B, 0x96, 0x42, 0xDB, 0xDB, 0xD6, 0xD6, 0xD6, 0xDB, 0xDB, 0x42, 0x96, 0x9B, 0x9C, 0x8, 0x9C, 0x9B, 0x9B, 0x96, 0x42, 0xDB, 0xDB, 0xD6, 0xDB, 0xDB, 0x42, 0x96, 0x9B, 0x9B, 0x9B, 0x8, 0x96, 0x9B, 0x9B, 0x9B, 0x96, 0x41, 0xDB, 0xDB, 0xDB, 0x42, 0x96, 0x9B, 0x9B, 0x9C, 0x96, 0x8, 0xD6, 0x96, 0x9C, 0x9B, 0x9B, 0x96, 0x41, 0xDB, 0x42, 0x96, 0x9B, 0x9B, 0x9B, 0x96, 0xD6, 0x8, 0x9C, 0xD6, 0x96, 0x9B, 0x9C, 0x9B, 0x96, 0x40, 0x96, 0x9B, 0x9C, 0x9B, 0x96, 0xD6, 0x9C, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8}, + .unk3A0 = {0x381, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0xFFFF}, + .coords = {131, 139}, + .direction = 0x23, + .range = 0x77, + }, + [2] = + { + .unk0 = 0x2D, + .unk1 = 0x2E, + .trainers = + { + [0] = + { + .name = _("ENRIQUE"), + .facilityClass = FACILITY_CLASS_RICH_BOY, + .unused = 0, + .speechBefore = {EC_WORD_GET, EC_WORD_READY, EC_WORD_FOR, EC_WORD_AN, EC_WORD_AWESOME, EC_WORD_TIME}, + .speechWin = {EC_WORD_HEY, EC_WORD_HEY, EC_WORD_EXCL, EC_WORD_WHAT_S_UP_QUES, 0xFFFF, 0xFFFF}, + .speechLose = {EC_WORD_AWW, EC_WORD_COULDN_T, EC_WORD_YOU, EC_WORD_LET_ME_WIN, EC_WORD_QUES, 0xFFFF}, + .speechAfter = {EC_WORD_DID, EC_WORD_YOU, EC_WORD_SEE, EC_WORD_MY, EC_WORD_SKILL, EC_WORD_QUES}, + .mons = + { + [0] = + { + .species = SPECIES_WOOPER, + .heldItem = ITEM_FIGY_BERRY, + .moves = {MOVE_RAIN_DANCE, MOVE_YAWN, MOVE_SURF, MOVE_HAZE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .speedEV = 6, + .spAttackEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x8C, + .nickname = _("WOOPER"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_POLIWAG, + .heldItem = ITEM_WIKI_BERRY, + .moves = {MOVE_SURF, MOVE_ICE_BEAM, MOVE_MIST, MOVE_HYPNOSIS}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .speedEV = 6, + .spAttackEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 1, + .personality = 0x3, + .nickname = _("POLIWAG"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_PSYDUCK, + .heldItem = ITEM_AGUAV_BERRY, + .moves = {MOVE_HYPNOSIS, MOVE_SURF, MOVE_DISABLE, MOVE_SEISMIC_TOSS}, + .level = 0, + .ppBonuses = 0, + .hpEV = 250, + .defenseEV = 130, + .spDefenseEV = 130, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x3, + .nickname = _("PSYDUCK"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_RHYDON, + .heldItem = ITEM_SOFT_SAND, + .moves = {MOVE_EARTHQUAKE, MOVE_MAGNITUDE, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .attackEV = 252, + .speedEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x96, + .nickname = _("RHYDON"), + .friendship = 0, + }, + [4] = + { + .species = SPECIES_RHYHORN, + .heldItem = ITEM_SOFT_SAND, + .moves = {MOVE_EARTHQUAKE, MOVE_MAGNITUDE, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .attackEV = 252, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x3, + .nickname = _("RHYHORN"), + .friendship = 0, + }, + [5] = + { + .species = SPECIES_CUBONE, + .heldItem = ITEM_SOFT_SAND, + .moves = {MOVE_EARTHQUAKE, MOVE_NONE, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .attackEV = 252, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 1, + .personality = 0x80, + .nickname = _("CUBONE"), + .friendship = 0, + }, + }, + }, + [1] = + { + .name = _("COLLEEN"), + .facilityClass = FACILITY_CLASS_LADY, + .unused = 0, + .speechBefore = {EC_WORD_I, EC_WORD_WOULD, EC_WORD_LIKE, EC_WORD_TO, EC_WORD_ROCK, EC_WORD_OUT}, + .speechWin = {EC_WORD_I, EC_WORD_LIKE, EC_WORD_THIS, EC_WORD_ROCK, EC_WORD_THING, EC_WORD_EXCL}, + .speechLose = {EC_WORD_GO_AHEAD, EC_WORD_AND, EC_WORD_CRUSH, EC_WORD_MY, EC_WORD_DREAM, EC_WORD_ELLIPSIS}, + .speechAfter = {EC_WORD_I, EC_WORD_WANT, EC_WORD_TO, EC_WORD_GO, EC_WORD_WILD, EC_WORD_SOMETIME}, + .mons = + { + [0] = + { + .species = SPECIES_MAGNEMITE, + .heldItem = ITEM_MAGNET, + .moves = {MOVE_THUNDER, MOVE_ZAP_CANNON, MOVE_SPARK, MOVE_THUNDER_SHOCK}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .speedEV = 252, + .spAttackEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x8C, + .nickname = _("MAGNEMITE"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_ELECTABUZZ, + .heldItem = ITEM_MAGNET, + .moves = {MOVE_THUNDER, MOVE_THUNDERBOLT, MOVE_THUNDER_PUNCH, MOVE_SHOCK_WAVE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .speedEV = 252, + .spAttackEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x41, + .nickname = _("ELECTABUZZ"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_FLAAFFY, + .heldItem = ITEM_MAGNET, + .moves = {MOVE_THUNDER, MOVE_THUNDERBOLT, MOVE_SHOCK_WAVE, MOVE_THUNDER_SHOCK}, + .level = 0, + .ppBonuses = 0, + .hpEV = 250, + .spAttackEV = 130, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x0, + .nickname = _("FLAAFFY"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_BALTOY, + .heldItem = ITEM_SILK_SCARF, + .moves = {MOVE_EXPLOSION, MOVE_SELF_DESTRUCT, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .attackEV = 252, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x3, + .nickname = _("BALTOY"), + .friendship = 0, + }, + [4] = + { + .species = SPECIES_PINECO, + .heldItem = ITEM_SILK_SCARF, + .moves = {MOVE_EXPLOSION, MOVE_SELF_DESTRUCT, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .attackEV = 252, + .speedEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x3, + .nickname = _("PINECO"), + .friendship = 0, + }, + [5] = + { + .species = SPECIES_VOLTORB, + .heldItem = ITEM_SILK_SCARF, + .moves = {MOVE_EXPLOSION, MOVE_SELF_DESTRUCT, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .attackEV = 252, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x80, + .nickname = _("VOLTORB"), + .friendship = 0, + }, + }, + }, + }, + .data = {0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x1B, 0x1C, 0x1D, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x8, 0x91, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x84, 0x84, 0x84, 0x9A, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x8, 0x17, 0xB2, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xB0, 0x17, 0xB2, 0xA1, 0x8, 0x17, 0xBB, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0xBB, 0x17, 0x17, 0x17, 0x8, 0x17, 0xB2, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xB0, 0x17, 0xB2, 0xA1, 0x8, 0x17, 0x17, 0x17, 0xBB, 0x17, 0x17, 0x17, 0x17, 0x17, 0xBB, 0x17, 0x17, 0x17, 0x17, 0x17, 0x8, 0x17, 0xB2, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xB0, 0x17, 0xB2, 0xA1, 0x8, 0x17, 0x17, 0xBB, 0x17, 0x17, 0x17, 0x17, 0xBB, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x8, 0x17, 0xB2, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xB0, 0x17, 0xB2, 0xA1, 0x8, 0x17, 0x17, 0x17, 0x17, 0x17, 0xBB, 0x17, 0x17, 0x17, 0x17, 0xBB, 0x17, 0x17, 0x17, 0x17, 0x8, 0x17, 0xB2, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xB0, 0x17, 0xB2, 0xA1, 0x8, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0xBB, 0x17, 0x17, 0xBB, 0x17, 0x17, 0x8, 0x17, 0xB2, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xB0, 0x17, 0xB2, 0xA1, 0x8, 0x17, 0x17, 0x17, 0x17, 0xBB, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x8, 0x17, 0xB2, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xB0, 0x17, 0xB2, 0xA1, 0x8, 0x17, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0x17, 0xBB, 0xBB, 0x8}, + .unk3A0 = {0x381, 0x381, 0x7FF7, 0x1, 0x7FF7, 0x1, 0x7FF7, 0x1, 0x7FF7, 0x1, 0x7FF7, 0x1, 0x7FF7, 0x1, 0x7FF7, 0x1}, + .coords = {25, 30}, + .direction = 0x23, + .range = 0x44, + }, + [3] = + { + .unk0 = 0x2F, + .unk1 = 0x30, + .trainers = + { + [0] = + { + .name = _("KIMBERLY"), + .facilityClass = FACILITY_CLASS_POKEFAN_F, + .unused = 0, + .speechBefore = {EC_WORD_I, EC_WORD_LIKE, EC_WORD_WORKING, EC_WORD_AT, EC_WORD_MY, EC_WORD_OWN_TEMPO}, + .speechWin = {EC_WORD_I_AM, EC_WORD_NOT, EC_WORD_BAD, EC_WORD_YOU, EC_WORD_THINK, EC_WORD_QUES}, + .speechLose = {EC_WORD_YOU_RE, EC_WORD_A, EC_WORD_MEAN, EC_WORD_KID, EC_WORD_IT, EC_WORD_SEEMS}, + .speechAfter = {EC_WORD_MY, EC_WORD_OWN_TEMPO, EC_WORD_IS, EC_WORD_RIGHT, EC_WORD_FOR, EC_WORD_ME}, + .mons = + { + [0] = + { + .species = SPECIES_UNOWN, + .heldItem = ITEM_MIRACLE_SEED, + .moves = {MOVE_HIDDEN_POWER, MOVE_NONE, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 30, + .attackIV = 31, + .defenseIV = 30, + .speedIV = 31, + .spAttackIV = 30, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x202, + .nickname = _("UNOWN"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_UNOWN, + .heldItem = ITEM_MYSTIC_WATER, + .moves = {MOVE_HIDDEN_POWER, MOVE_NONE, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 30, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 30, + .spAttackIV = 30, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x10001, + .nickname = _("UNOWN"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_UNOWN, + .heldItem = ITEM_BLACK_BELT, + .moves = {MOVE_HIDDEN_POWER, MOVE_NONE, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 30, + .attackIV = 30, + .defenseIV = 30, + .speedIV = 30, + .spAttackIV = 30, + .spDefenseIV = 30, + .altAbility = 0, + .personality = 0x102, + .nickname = _("UNOWN"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_SPINDA, + .heldItem = ITEM_LUM_BERRY, + .moves = {MOVE_TEETER_DANCE, MOVE_DIZZY_PUNCH, MOVE_CALM_MIND, MOVE_BATON_PASS}, + .level = 0, + .ppBonuses = 0, + .hpEV = 110, + .defenseEV = 200, + .spDefenseEV = 200, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x88FE980F, + .nickname = _("SPINDA"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_PLUSLE, + .heldItem = ITEM_BRIGHT_POWDER, + .moves = {MOVE_HELPING_HAND, MOVE_THUNDERBOLT, MOVE_AGILITY, MOVE_BATON_PASS}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0xF, + .nickname = _("PLUSLE"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_VOLBEAT, + .heldItem = ITEM_SITRUS_BERRY, + .moves = {MOVE_HELPING_HAND, MOVE_SIGNAL_BEAM, MOVE_SOLAR_BEAM, MOVE_MOONLIGHT}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 1, + .personality = 0xF, + .nickname = _("VOLBEAT"), + .friendship = 255, + }, + }, + }, + [1] = + { + .name = _("FRANCISCO"), + .facilityClass = FACILITY_CLASS_POKEFAN_M, + .unused = 0, + .speechBefore = {EC_WORD_I, EC_WORD_STUDY, EC_WORD_EVERY, EC_WORD_DAY, EC_WORD_TOO, 0xFFFF}, + .speechWin = {EC_WORD_SO, EC_WORD_THAT_S, EC_WORD_HOW, EC_WORD_YOU, EC_WORD_LOSE, 0xFFFF}, + .speechLose = {EC_WORD_NO, EC_WORD_WONDER, EC_WORD_I, EC_WORD_COULDN_T, EC_WORD_BEAT, EC_WORD_YOU}, + .speechAfter = {EC_WORD_YES, EC_WORD_ELLIPSIS, 0xFFFF, EC_WORD_THANK_YOU, 0xFFFF, 0xFFFF}, + .mons = + { + [0] = + { + .species = SPECIES_SPINDA, + .heldItem = ITEM_LUM_BERRY, + .moves = {MOVE_TEETER_DANCE, MOVE_DIZZY_PUNCH, MOVE_CALM_MIND, MOVE_BATON_PASS}, + .level = 0, + .ppBonuses = 0, + .hpEV = 110, + .defenseEV = 200, + .spDefenseEV = 200, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0xE2880098, + .nickname = _("SPINDA"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_MINUN, + .heldItem = ITEM_BRIGHT_POWDER, + .moves = {MOVE_HELPING_HAND, MOVE_THUNDERBOLT, MOVE_AGILITY, MOVE_BATON_PASS}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x8C, + .nickname = _("MINUN"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_ILLUMISE, + .heldItem = ITEM_SITRUS_BERRY, + .moves = {MOVE_HELPING_HAND, MOVE_WISH, MOVE_THUNDERBOLT, MOVE_MOONLIGHT}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0xF, + .nickname = _("ILLUMISE"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_UNOWN, + .heldItem = ITEM_CHARCOAL, + .moves = {MOVE_HIDDEN_POWER, MOVE_NONE, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 30, + .attackIV = 31, + .defenseIV = 30, + .speedIV = 30, + .spAttackIV = 30, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x302, + .nickname = _("UNOWN"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_UNOWN, + .heldItem = ITEM_SOFT_SAND, + .moves = {MOVE_HIDDEN_POWER, MOVE_NONE, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .attackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 30, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 30, + .spDefenseIV = 30, + .altAbility = 0, + .personality = 0x203, + .nickname = _("UNOWN"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_UNOWN, + .heldItem = ITEM_TWISTED_SPOON, + .moves = {MOVE_HIDDEN_POWER, MOVE_NONE, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 30, + .speedIV = 30, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x301, + .nickname = _("UNOWN"), + .friendship = 255, + }, + }, + }, + }, + .data = {0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x8, 0x69, 0x40, 0x6D, 0x41, 0x73, 0x41, 0x5E, 0x41, 0x71, 0x42, 0x45, 0x45, 0x45, 0x45, 0x45, 0x8, 0x43, 0x73, 0x64, 0x73, 0x43, 0x73, 0x64, 0x73, 0x41, 0x73, 0x45, 0x45, 0x45, 0x45, 0x45, 0x8, 0x65, 0x40, 0x73, 0x42, 0x6D, 0x42, 0x73, 0x42, 0x6D, 0x42, 0x45, 0x45, 0x45, 0x45, 0x45, 0x8, 0x6C, 0x73, 0x41, 0x73, 0x64, 0x73, 0x40, 0x73, 0x64, 0x73, 0x40, 0x73, 0x42, 0x73, 0x41, 0x8, 0x69, 0x40, 0x6D, 0x41, 0x73, 0x40, 0x6D, 0x43, 0x73, 0x43, 0x6D, 0x42, 0x73, 0x42, 0x6D, 0x8, 0x40, 0x73, 0x64, 0x73, 0x43, 0x73, 0x64, 0x73, 0x41, 0x73, 0x64, 0x73, 0x41, 0x73, 0x64, 0x8, 0x65, 0x42, 0x73, 0x42, 0x6D, 0x41, 0x73, 0x40, 0x6D, 0x42, 0x73, 0x41, 0x6D, 0x42, 0x73, 0x8, 0x6C, 0x73, 0x41, 0x73, 0x64, 0x73, 0x42, 0x73, 0x64, 0x73, 0x42, 0x73, 0x64, 0x73, 0x42, 0x8, 0x69, 0x40, 0x6D, 0x41, 0x73, 0x41, 0x6D, 0x42, 0x73, 0x43, 0x6D, 0x41, 0x73, 0x43, 0x6D, 0x8, 0x40, 0x73, 0x64, 0x73, 0x43, 0x73, 0x64, 0x73, 0x43, 0x73, 0x64, 0x73, 0x42, 0x73, 0x64, 0x8, 0x65, 0x42, 0x73, 0x42, 0x6D, 0x43, 0x73, 0x42, 0x6D, 0x42, 0x73, 0x41, 0x6D, 0x40, 0x73, 0x8, 0x6C, 0x73, 0x40, 0x73, 0x64, 0x73, 0x41, 0x73, 0x64, 0x73, 0x42, 0x73, 0x64, 0x73, 0x42, 0x8, 0x69, 0x40, 0x6D, 0x42, 0x73, 0x42, 0x6D, 0x43, 0x73, 0x40, 0x6D, 0x41, 0x73, 0x40, 0x6D, 0x8, 0x40, 0x73, 0x64, 0x73, 0x40, 0x73, 0x64, 0x73, 0x40, 0x73, 0x64, 0x73, 0x43, 0x73, 0x64, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8}, + .unk3A0 = {0x381, 0x1, 0x2201, 0x1, 0x8881, 0x1, 0x2223, 0x1, 0x8889, 0x1, 0x2223, 0x1, 0x8889, 0x1, 0x2223, 0xFFFF}, + .coords = {42, 46}, + .direction = 0x23, + .range = 0x33, + }, + }, }; static const struct TrHillTag sDataTagUnique = { - .unkField_0 = 8, - .unused1 = 3, - .unkField_2 = 4, - .unused3 = 0, - .unused4 = 243, - .unused5 = 82, - .unused6 = 6, - .floors = - { - [0] = - { - .unk0 = 0x31, - .unk1 = 0x32, - .trainers = - { - [0] = - { - .name = _("MEREDITH"), - .facilityClass = FACILITY_CLASS_PKMN_RANGER_F, - .unused = 0, - .speechBefore = {0x1E02, 0xC04, 0xFFFF, 0xA01, 0xC04, 0xFFFF}, - .speechWin = {0xC1D, 0xC00, 0xFFFF, 0x1E02, 0xC04, 0xC3A}, - .speechLose = {0x1E02, 0xC04, 0xFFFF, 0xC0A, 0xC04, 0xFFFF}, - .speechAfter = {0x1E02, 0xC04, 0xFFFF, 0xA29, 0x120E, 0xC04}, - .mons = - { - [0] = - { - .species = SPECIES_SUNFLORA, - .heldItem = ITEM_PERSIM_BERRY, - .moves = {MOVE_PETAL_DANCE, MOVE_GRASS_WHISTLE, MOVE_LIGHT_SCREEN, MOVE_SUNNY_DAY}, - .level = 0, - .ppBonuses = 0, - .hpEV = 255, - .defenseEV = 155, - .spDefenseEV = 100, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x0, - .nickname = _("SUNFLORA"), - .friendship = 255, - }, - [1] = - { - .species = SPECIES_TANGELA, - .heldItem = ITEM_QUICK_CLAW, - .moves = {MOVE_GIGA_DRAIN, MOVE_SLEEP_POWDER, MOVE_AMNESIA, MOVE_SUNNY_DAY}, - .level = 0, - .ppBonuses = 0, - .hpEV = 255, - .spDefenseEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x91, - .nickname = _("TANGELA"), - .friendship = 255, - }, - [2] = - { - .species = SPECIES_VENUSAUR, - .heldItem = ITEM_LEFTOVERS, - .moves = {MOVE_SOLAR_BEAM, MOVE_EARTHQUAKE, MOVE_SYNTHESIS, MOVE_SUNNY_DAY}, - .level = 0, - .ppBonuses = 0, - .hpEV = 100, - .attackEV = 110, - .defenseEV = 100, - .spAttackEV = 100, - .spDefenseEV = 100, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x1F, - .nickname = _("VENUSAUR"), - .friendship = 255, - }, - [3] = - { - .species = SPECIES_LANTURN, - .heldItem = ITEM_PERSIM_BERRY, - .moves = {MOVE_SPARK, MOVE_WATER_PULSE, MOVE_CONFUSE_RAY, MOVE_RAIN_DANCE}, - .level = 0, - .ppBonuses = 0, - .speedEV = 255, - .spAttackEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0xF, - .nickname = _("LANTURN"), - .friendship = 255, - }, - [4] = - { - .species = SPECIES_MANECTRIC, - .heldItem = ITEM_FOCUS_BAND, - .moves = {MOVE_THUNDERBOLT, MOVE_HEADBUTT, MOVE_BITE, MOVE_RAIN_DANCE}, - .level = 0, - .ppBonuses = 0, - .speedEV = 255, - .spAttackEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 1, - .personality = 0xF, - .nickname = _("MANECTRIC"), - .friendship = 255, - }, - [5] = - { - .species = SPECIES_RAIKOU, - .heldItem = ITEM_BRIGHT_POWDER, - .moves = {MOVE_THUNDER, MOVE_CRUNCH, MOVE_ROAR, MOVE_RAIN_DANCE}, - .level = 0, - .ppBonuses = 0, - .speedEV = 255, - .spAttackEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0xF, - .nickname = _("RAIKOU"), - .friendship = 255, - }, - }, - }, - [1] = - { - .name = _("BERNARD"), - .facilityClass = FACILITY_CLASS_KINDLER, - .unused = 0, - .speechBefore = {0xA01, 0x1015, 0x631, 0x1E0F, 0x1400, 0x628}, - .speechWin = {0x103B, 0xA01, 0x415, 0xA02, 0x1E13, 0xC03}, - .speechLose = {0xC29, 0xC00, 0xA06, 0x1020, 0x1230, 0xA35}, - .speechAfter = {0xA05, 0x281D, 0xE20, 0x420, 0x141E, 0xC04}, - .mons = - { - [0] = - { - .species = SPECIES_RELICANTH, - .heldItem = ITEM_QUICK_CLAW, - .moves = {MOVE_ANCIENT_POWER, MOVE_WATER_PULSE, MOVE_MUD_SPORT, MOVE_RAIN_DANCE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 155, - .defenseEV = 100, - .spDefenseEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x2F, - .nickname = _("RELICANTH"), - .friendship = 255, - }, - [1] = - { - .species = SPECIES_GOLDUCK, - .heldItem = ITEM_LAX_INCENSE, - .moves = {MOVE_SURF, MOVE_PSYBEAM, MOVE_BRICK_BREAK, MOVE_RAIN_DANCE}, - .level = 0, - .ppBonuses = 0, - .speedEV = 255, - .spAttackEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0xF, - .nickname = _("GOLDUCK"), - .friendship = 255, - }, - [2] = - { - .species = SPECIES_BLASTOISE, - .heldItem = ITEM_SHELL_BELL, - .moves = {MOVE_HYDRO_PUMP, MOVE_BITE, MOVE_MIRROR_COAT, MOVE_RAIN_DANCE}, - .level = 0, - .ppBonuses = 0, - .speedEV = 255, - .spAttackEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x28, - .nickname = _("BLASTOISE"), - .friendship = 255, - }, - [3] = - { - .species = SPECIES_MAGCARGO, - .heldItem = ITEM_QUICK_CLAW, - .moves = {MOVE_HEAT_WAVE, MOVE_ROCK_SLIDE, MOVE_PROTECT, MOVE_SUNNY_DAY}, - .level = 0, - .ppBonuses = 0, - .hpEV = 255, - .spDefenseEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 1, - .personality = 0x93, - .nickname = _("MAGCARGO"), - .friendship = 255, - }, - [4] = - { - .species = SPECIES_RAPIDASH, - .heldItem = ITEM_KINGS_ROCK, - .moves = {MOVE_FIRE_BLAST, MOVE_BOUNCE, MOVE_QUICK_ATTACK, MOVE_SUNNY_DAY}, - .level = 0, - .ppBonuses = 0, - .speedEV = 255, - .spAttackEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 1, - .personality = 0xF, - .nickname = _("RAPIDASH"), - .friendship = 255, - }, - [5] = - { - .species = SPECIES_MOLTRES, - .heldItem = ITEM_BRIGHT_POWDER, - .moves = {MOVE_SKY_ATTACK, MOVE_AERIAL_ACE, MOVE_ROAR, MOVE_SUNNY_DAY}, - .level = 0, - .ppBonuses = 0, - .speedEV = 255, - .spAttackEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0xF, - .nickname = _("MOLTRES"), - .friendship = 255, - }, - }, - }, - }, - .data = {0xF1, 0xF5, 0xFB, 0xF5, 0xE6, 0xE6, 0x1B, 0x14, 0x15, 0xF8, 0xF9, 0xFA, 0xFB, 0xFB, 0xFB, 0x8, 0xF1, 0xEB, 0xFB, 0xEB, 0xEC, 0xEC, 0xEC, 0xF9, 0xE6, 0xEE, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0x8, 0xF1, 0xEB, 0xFB, 0xEB, 0xFB, 0x9B, 0x9B, 0xFB, 0xEB, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEB, 0x8, 0xF1, 0xEB, 0xFB, 0xEB, 0x9B, 0xDB, 0xDB, 0x9B, 0xEC, 0xFB, 0xF5, 0xF5, 0xF5, 0xFB, 0xEB, 0x8, 0xF1, 0xEB, 0xFB, 0xEB, 0xF5, 0x95, 0x95, 0xF5, 0xF5, 0xF5, 0xEB, 0xEC, 0xEB, 0xFB, 0xEB, 0x8, 0xED, 0xEB, 0xFB, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0x8, 0xF4, 0xEB, 0xFB, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0x8, 0xF1, 0xEB, 0xFB, 0xEB, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xFB, 0xEB, 0xFB, 0xEC, 0x8, 0xF1, 0xEB, 0xFB, 0xEB, 0xFB, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xEB, 0xF5, 0xFB, 0x8, 0xF1, 0xEC, 0xFB, 0xEB, 0xFB, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEB, 0xFB, 0x8, 0xF1, 0xF5, 0xF5, 0xEB, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xFB, 0xEB, 0xFB, 0x8, 0xF1, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEB, 0xFB, 0xEB, 0xFB, 0x8, 0xF1, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xEB, 0xFB, 0xEB, 0xFB, 0x8, 0xF1, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xFB, 0xEC, 0xFB, 0x8, 0xF1, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8}, - .unk3A0 = {0x381, 0x5E01, 0x50FF, 0x5083, 0x503B, 0x5FEB, 0xC02B, 0x5FEB, 0x5009, 0x57FD, 0x1005, 0x7FF5, 0x15, 0x7FF5, 0x1, 0xFFFF}, - .coords = {52, 55}, - .direction = 0x23, - .range = 0x22, - }, - [1] = - { - .unk0 = 0x33, - .unk1 = 0x34, - .trainers = - { - [0] = - { - .name = _("ABRAHAM"), - .facilityClass = FACILITY_CLASS_RUIN_MANIAC, - .unused = 0, - .speechBefore = {0xA01, 0x103A, 0x1E0F, 0x20E, 0xE0D, 0x143C}, - .speechWin = {0x1E22, 0x1020, 0x1240, 0x20E, 0x1029, 0x100B}, - .speechLose = {0xA01, 0x1E26, 0x1020, 0x63E, 0x1030, 0x1C12}, - .speechAfter = {0xA01, 0x1236, 0x1020, 0x24A6, 0x1034, 0xA02}, - .mons = - { - [0] = - { - .species = SPECIES_SMEARGLE, - .heldItem = ITEM_SCOPE_LENS, - .moves = {MOVE_EARTHQUAKE, MOVE_SHADOW_BALL, MOVE_AERIAL_ACE, MOVE_IMPRISON}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .attackEV = 6, - .speedEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x8A, - .nickname = _("SMEARGLE"), - .friendship = 255, - }, - [1] = - { - .species = SPECIES_SMEARGLE, - .heldItem = ITEM_CHESTO_BERRY, - .moves = {MOVE_REST, MOVE_THUNDER_WAVE, MOVE_FLAMETHROWER, MOVE_IMPRISON}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .speedEV = 252, - .spAttackEV = 6, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x87, - .nickname = _("SMEARGLE"), - .friendship = 255, - }, - [2] = - { - .species = SPECIES_SMEARGLE, - .heldItem = ITEM_QUICK_CLAW, - .moves = {MOVE_TEETER_DANCE, MOVE_LOCK_ON, MOVE_SHEER_COLD, MOVE_EXPLOSION}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .attackEV = 6, - .speedEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0xD, - .nickname = _("SMEARGLE"), - .friendship = 255, - }, - [3] = - { - .species = SPECIES_SMEARGLE, - .heldItem = ITEM_SCOPE_LENS, - .moves = {MOVE_PSYCHIC, MOVE_SURF, MOVE_THUNDERBOLT, MOVE_IMPRISON}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .speedEV = 252, - .spAttackEV = 6, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0xA, - .nickname = _("SMEARGLE"), - .friendship = 255, - }, - [4] = - { - .species = SPECIES_SMEARGLE, - .heldItem = ITEM_LEFTOVERS, - .moves = {MOVE_TOXIC, MOVE_PROTECT, MOVE_WILL_O_WISP, MOVE_IMPRISON}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .defenseEV = 6, - .speedEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0xA, - .nickname = _("SMEARGLE"), - .friendship = 255, - }, - [5] = - { - .species = SPECIES_SMEARGLE, - .heldItem = ITEM_QUICK_CLAW, - .moves = {MOVE_TEETER_DANCE, MOVE_LOCK_ON, MOVE_SHEER_COLD, MOVE_DESTINY_BOND}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .defenseEV = 6, - .speedEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x8A, - .nickname = _("SMEARGLE"), - .friendship = 255, - }, - }, - }, - [1] = - { - .name = _("LUC"), - .facilityClass = FACILITY_CLASS_TUBER_M, - .unused = 0, - .speechBefore = {0xA01, 0x101E, 0x1020, 0x415, 0x123A, 0x63E}, - .speechWin = {0xA28, 0x123A, 0x63E, 0x100B, 0x415, 0x100C}, - .speechLose = {0x103C, 0xA02, 0x1239, 0xA28, 0x63E, 0xC03}, - .speechAfter = {0xA29, 0x412, 0xE0A, 0xE29, 0x639, 0xC04}, - .mons = - { - [0] = - { - .species = SPECIES_STARYU, - .heldItem = ITEM_LEFTOVERS, - .moves = {MOVE_CAMOUFLAGE, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .speedEV = 252, - .spAttackEV = 6, - .otId = TRAINER_HILL_OTID, - .hpIV = 5, - .attackIV = 5, - .defenseIV = 5, - .speedIV = 5, - .spAttackIV = 5, - .spDefenseIV = 5, - .altAbility = 1, - .personality = 0xA, - .nickname = _("STARYU"), - .friendship = 255, - }, - [1] = - { - .species = SPECIES_MEOWTH, - .heldItem = ITEM_QUICK_CLAW, - .moves = {MOVE_PAY_DAY, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .speedEV = 252, - .spAttackEV = 6, - .otId = TRAINER_HILL_OTID, - .hpIV = 5, - .attackIV = 5, - .defenseIV = 5, - .speedIV = 5, - .spAttackIV = 5, - .spDefenseIV = 5, - .altAbility = 0, - .personality = 0xD, - .nickname = _("MEOWTH"), - .friendship = 255, - }, - [2] = - { - .species = SPECIES_BLAZIKEN, - .heldItem = ITEM_BRIGHT_POWDER, - .moves = {MOVE_BLAZE_KICK, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .speedEV = 252, - .spDefenseEV = 6, - .otId = TRAINER_HILL_OTID, - .hpIV = 5, - .attackIV = 5, - .defenseIV = 5, - .speedIV = 5, - .spAttackIV = 5, - .spDefenseIV = 5, - .altAbility = 0, - .personality = 0x28, - .nickname = _("BLAZIKEN"), - .friendship = 255, - }, - [3] = - { - .species = SPECIES_CUBONE, - .heldItem = ITEM_THICK_CLUB, - .moves = {MOVE_BONEMERANG, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .defenseEV = 6, - .spDefenseEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 5, - .attackIV = 5, - .defenseIV = 5, - .speedIV = 5, - .spAttackIV = 5, - .spDefenseIV = 5, - .altAbility = 1, - .personality = 0x16, - .nickname = _("CUBONE"), - .friendship = 255, - }, - [4] = - { - .species = SPECIES_BEEDRILL, - .heldItem = ITEM_SHELL_BELL, - .moves = {MOVE_TWINEEDLE, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .speedEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 5, - .attackIV = 5, - .defenseIV = 5, - .speedIV = 5, - .spAttackIV = 5, - .spDefenseIV = 5, - .altAbility = 0, - .personality = 0x8A, - .nickname = _("BEEDRILL"), - .friendship = 255, - }, - [5] = - { - .species = SPECIES_RATICATE, - .heldItem = ITEM_FOCUS_BAND, - .moves = {MOVE_SUPER_FANG, MOVE_NONE, MOVE_NONE, MOVE_NONE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .defenseEV = 6, - .speedEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 5, - .attackIV = 5, - .defenseIV = 5, - .speedIV = 5, - .spAttackIV = 5, - .spDefenseIV = 5, - .altAbility = 1, - .personality = 0xD, - .nickname = _("RATICATE"), - .friendship = 255, - }, - }, - }, - }, - .data = {0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x26, 0x1B, 0x1C, 0x1D, 0x25, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x8, 0x2D, 0x3B, 0x3B, 0x3B, 0x35, 0x2C, 0x23, 0x24, 0x23, 0x2C, 0x35, 0x3B, 0x3B, 0x3B, 0x3B, 0x8, 0x94, 0x87, 0x9B, 0x87, 0x8C, 0x87, 0x8B, 0x87, 0x8C, 0x87, 0x8C, 0x87, 0x95, 0x87, 0x9B, 0x8, 0x91, 0x8F, 0x9B, 0x8F, 0x9B, 0x8F, 0x8C, 0x8F, 0x9B, 0x8F, 0x9B, 0x8F, 0x8C, 0x8F, 0x95, 0x8, 0x8D, 0x97, 0x95, 0x97, 0x9B, 0x97, 0x95, 0x97, 0x95, 0x97, 0x9B, 0x97, 0x9B, 0x97, 0x8C, 0x8, 0x94, 0x87, 0x8C, 0x87, 0x9B, 0x87, 0x8C, 0x87, 0x8B, 0x87, 0x9B, 0x9B, 0x9B, 0x87, 0x9B, 0x8, 0x91, 0x8F, 0x9B, 0x8F, 0x95, 0x8F, 0x9B, 0x8F, 0x8C, 0x8F, 0x95, 0x9B, 0x95, 0x8F, 0x9B, 0x8, 0x91, 0x97, 0x95, 0x97, 0x8C, 0x97, 0x95, 0x97, 0x95, 0x97, 0x8C, 0x9B, 0x8C, 0x97, 0x95, 0x8, 0x91, 0x87, 0x8C, 0x87, 0x9B, 0x87, 0x8C, 0x87, 0x8B, 0x87, 0x9B, 0x87, 0x95, 0x87, 0x8C, 0x8, 0x8D, 0x8F, 0x9B, 0x8F, 0x95, 0x8F, 0x9B, 0x8F, 0x8C, 0x8F, 0x9B, 0x8F, 0x8C, 0x8F, 0x9B, 0x8, 0x94, 0x97, 0x95, 0x97, 0x8C, 0x97, 0x9B, 0x97, 0x95, 0x97, 0x95, 0x97, 0x9B, 0x97, 0x9B, 0x8, 0x91, 0x87, 0x8C, 0x87, 0x95, 0x87, 0x95, 0x87, 0x8B, 0x87, 0x8C, 0x87, 0x9B, 0x87, 0x9B, 0x8, 0x91, 0x8F, 0x95, 0x8F, 0x8B, 0x8F, 0x8C, 0x8F, 0x8C, 0x8F, 0x9B, 0x8F, 0x95, 0x8F, 0x9B, 0x8, 0x91, 0x97, 0x8C, 0x97, 0x8C, 0x97, 0x9B, 0x97, 0x9B, 0x97, 0x9B, 0x97, 0x8B, 0x97, 0x9B, 0x8, 0x91, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x8C, 0x9B, 0x9B, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8}, - .unk3A0 = {0x381, 0x7C1, 0x8AA1, 0x209, 0x5557, 0xA281, 0x81, 0x5D6D, 0x2283, 0x89, 0xDD55, 0x20A1, 0xA81, 0x7D5D, 0x9, 0xFFFF}, - .coords = {105, 109}, - .direction = 0x23, - .range = 0x33, - }, - [2] = - { - .unk0 = 0x35, - .unk1 = 0x36, - .trainers = - { - [0] = - { - .name = _("BREYDEN"), - .facilityClass = FACILITY_CLASS_YOUNGSTER, - .unused = 0, - .speechBefore = {0xA01, 0x1225, 0x102B, 0xA28, 0x20E, 0xE12}, - .speechWin = {0xA28, 0x20E, 0x1016, 0x1018, 0x1029, 0x102A}, - .speechLose = {0xA31, 0x1022, 0x103A, 0xA3D, 0x1C06, 0x606}, - .speechAfter = {0xA01, 0x103A, 0xE0D, 0x1C21, 0x20E, 0x143C}, - .mons = - { - [0] = - { - .species = SPECIES_CHARMELEON, - .heldItem = ITEM_CHARCOAL, - .moves = {MOVE_FIRE_SPIN, MOVE_DRAGON_RAGE, MOVE_FLAMETHROWER, MOVE_SLASH}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .speedEV = 252, - .spAttackEV = 6, - .otId = TRAINER_HILL_OTID, - .hpIV = 25, - .attackIV = 25, - .defenseIV = 25, - .speedIV = 25, - .spAttackIV = 25, - .spDefenseIV = 25, - .altAbility = 0, - .personality = 0x32, - .nickname = _("CHARMELEON"), - .friendship = 100, - }, - [1] = - { - .species = SPECIES_WARTORTLE, - .heldItem = ITEM_MYSTIC_WATER, - .moves = {MOVE_HYDRO_PUMP, MOVE_SKULL_BASH, MOVE_RAIN_DANCE, MOVE_PROTECT}, - .level = 0, - .ppBonuses = 0, - .hpEV = 250, - .defenseEV = 130, - .otId = TRAINER_HILL_OTID, - .hpIV = 25, - .attackIV = 25, - .defenseIV = 25, - .speedIV = 25, - .spAttackIV = 25, - .spDefenseIV = 25, - .altAbility = 0, - .personality = 0x0, - .nickname = _("WARTORTLE"), - .friendship = 100, - }, - [2] = - { - .species = SPECIES_IVYSAUR, - .heldItem = ITEM_MIRACLE_SEED, - .moves = {MOVE_SOLAR_BEAM, MOVE_SYNTHESIS, MOVE_GROWTH, MOVE_SWEET_SCENT}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .speedEV = 6, - .spAttackEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 25, - .attackIV = 25, - .defenseIV = 25, - .speedIV = 25, - .spAttackIV = 25, - .spDefenseIV = 25, - .altAbility = 0, - .personality = 0x0, - .nickname = _("IVYSAUR"), - .friendship = 100, - }, - [3] = - { - .species = SPECIES_BAYLEEF, - .heldItem = ITEM_MIRACLE_SEED, - .moves = {MOVE_SOLAR_BEAM, MOVE_SAFEGUARD, MOVE_LIGHT_SCREEN, MOVE_BODY_SLAM}, - .level = 0, - .ppBonuses = 0, - .hpEV = 250, - .attackEV = 130, - .spAttackEV = 130, - .otId = TRAINER_HILL_OTID, - .hpIV = 25, - .attackIV = 25, - .defenseIV = 25, - .speedIV = 25, - .spAttackIV = 25, - .spDefenseIV = 25, - .altAbility = 0, - .personality = 0x32, - .nickname = _("BAYLEEF"), - .friendship = 100, - }, - [4] = - { - .species = SPECIES_CROCONAW, - .heldItem = ITEM_MYSTIC_WATER, - .moves = {MOVE_SCARY_FACE, MOVE_SLASH, MOVE_HYDRO_PUMP, MOVE_SCREECH}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .attackEV = 252, - .speedEV = 6, - .otId = TRAINER_HILL_OTID, - .hpIV = 25, - .attackIV = 25, - .defenseIV = 25, - .speedIV = 25, - .spAttackIV = 25, - .spDefenseIV = 25, - .altAbility = 0, - .personality = 0x3, - .nickname = _("CROCONAW"), - .friendship = 100, - }, - [5] = - { - .species = SPECIES_QUILAVA, - .heldItem = ITEM_CHARCOAL, - .moves = {MOVE_QUICK_ATTACK, MOVE_FLAMETHROWER, MOVE_FLAME_WHEEL, MOVE_SWIFT}, - .level = 0, - .ppBonuses = 0, - .hpEV = 6, - .speedEV = 252, - .spAttackEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x28, - .nickname = _("QUILAVA"), - .friendship = 100, - }, - }, - }, - [1] = - { - .name = _("ANIYA"), - .facilityClass = FACILITY_CLASS_TUBER_F, - .unused = 0, - .speechBefore = {0xA2C, 0x120A, 0xA14, 0xE13, 0x20E, 0x208}, - .speechWin = {0xA29, 0x1022, 0x280A, 0x1036, 0x1E0F, 0xC00}, - .speechLose = {0xC1D, 0xE0A, 0xC04, 0x1E25, 0x1E25, 0xC02}, - .speechAfter = {0xA06, 0x140A, 0xC03, 0x1017, 0x62D, 0xC00}, - .mons = - { - [0] = - { - .species = SPECIES_SMOOCHUM, - .heldItem = ITEM_PETAYA_BERRY, - .moves = {MOVE_ICE_BEAM, MOVE_PSYCHIC, MOVE_SWEET_KISS, MOVE_FAKE_TEARS}, - .level = 0, - .ppBonuses = 0, - .hpEV = 6, - .speedEV = 252, - .spAttackEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0x32, - .nickname = _("SMOOCHUM"), - .friendship = 50, - }, - [1] = - { - .species = SPECIES_AZURILL, - .heldItem = ITEM_FOCUS_BAND, - .moves = {MOVE_SURF, MOVE_SING, MOVE_RAIN_DANCE, MOVE_BLIZZARD}, - .level = 0, - .ppBonuses = 0, - .hpEV = 6, - .speedEV = 252, - .spAttackEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0xC8, - .nickname = _("AZURILL"), - .friendship = 50, - }, - [2] = - { - .species = SPECIES_ELEKID, - .heldItem = ITEM_KINGS_ROCK, - .moves = {MOVE_FIRE_PUNCH, MOVE_THUNDER, MOVE_ICE_PUNCH, MOVE_THUNDER_WAVE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 6, - .speedEV = 252, - .spAttackEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0x0, - .nickname = _("ELEKID"), - .friendship = 50, - }, - [3] = - { - .species = SPECIES_CLEFFA, - .heldItem = ITEM_QUICK_CLAW, - .moves = {MOVE_MEGA_KICK, MOVE_SWEET_KISS, MOVE_SING, MOVE_METRONOME}, - .level = 0, - .ppBonuses = 0, - .hpEV = 6, - .attackEV = 252, - .speedEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0x0, - .nickname = _("CLEFFA"), - .friendship = 50, - }, - [4] = - { - .species = SPECIES_WYNAUT, - .heldItem = ITEM_LEFTOVERS, - .moves = {MOVE_ENCORE, MOVE_COUNTER, MOVE_MIRROR_COAT, MOVE_DESTINY_BOND}, - .level = 0, - .ppBonuses = 0, - .hpEV = 250, - .defenseEV = 130, - .spDefenseEV = 130, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0x84, - .nickname = _("WYNAUT"), - .friendship = 50, - }, - [5] = - { - .species = SPECIES_MAGBY, - .heldItem = ITEM_SCOPE_LENS, - .moves = {MOVE_FIRE_BLAST, MOVE_CONFUSE_RAY, MOVE_THUNDER_PUNCH, MOVE_BARRIER}, - .level = 0, - .ppBonuses = 0, - .hpEV = 6, - .speedEV = 252, - .spAttackEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0xF, - .nickname = _("MAGBY"), - .friendship = 50, - }, - }, - }, - }, - .data = {0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x8, 0x69, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x7C, 0x46, 0x8, 0x69, 0x46, 0x7A, 0x73, 0x73, 0x73, 0x79, 0x73, 0x73, 0x73, 0x7D, 0x73, 0x73, 0x73, 0x46, 0x8, 0x69, 0x46, 0x73, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x8, 0x69, 0x46, 0x73, 0x73, 0x7B, 0x73, 0x7C, 0x73, 0x7B, 0x73, 0x7A, 0x73, 0x73, 0x73, 0x46, 0x8, 0x69, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x7A, 0x46, 0x8, 0x69, 0x46, 0x73, 0x73, 0x73, 0x73, 0x73, 0x7D, 0x7C, 0x73, 0x7C, 0x73, 0x7B, 0x73, 0x46, 0x8, 0x69, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x7C, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x8, 0x91, 0x46, 0x9B, 0x9B, 0x9B, 0x46, 0x3B, 0x3B, 0x3B, 0x46, 0x9B, 0x9B, 0x9B, 0x9B, 0x46, 0x8, 0x91, 0x46, 0x9B, 0x9B, 0x9B, 0x46, 0x3B, 0x3B, 0x3B, 0x46, 0x9B, 0x9B, 0x9B, 0x9B, 0x46, 0x8, 0x91, 0x46, 0x9B, 0x9B, 0x9B, 0x46, 0x3B, 0x3B, 0x3B, 0x46, 0x9B, 0x9B, 0x9B, 0x9B, 0x46, 0x8, 0xF1, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x8, 0xF1, 0x46, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0x7A, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0x7C, 0x8, 0xF1, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0xFB, 0x8, 0x7C, 0xFB, 0x7B, 0xFB, 0x7A, 0xFB, 0x79, 0xFB, 0xB3, 0xFB, 0x7D, 0xFB, 0x7E, 0xFB, 0x7D, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8}, - .unk3A0 = {0x381, 0x7FFB, 0x4003, 0x5FFF, 0x4003, 0x7FFB, 0x4003, 0x7EFF, 0x4443, 0x4443, 0x4443, 0x7EFF, 0x4001, 0x7FFD, 0x1, 0xFFFF}, - .coords = {150, 152}, - .direction = 0x23, - .range = 0x11, - }, - [3] = - { - .unk0 = 0x38, - .unk1 = 0x37, - .trainers = - { - [0] = - { - .name = _("DANE"), - .facilityClass = FACILITY_CLASS_BIRD_KEEPER, - .unused = 0, - .speechBefore = {0xA01, 0x120A, 0xA28, 0x20E, 0x102C, 0x1A34}, - .speechWin = {0xA31, 0x1240, 0x102F, 0x1A1C, 0xE15, 0x628}, - .speechLose = {0xC0A, 0xC00, 0xA28, 0x123A, 0x20E, 0xC00}, - .speechAfter = {0x102D, 0x102C, 0x1C12, 0x1A34, 0xA01, 0x601}, - .mons = - { - [0] = - { - .species = SPECIES_SUDOWOODO, - .heldItem = ITEM_SITRUS_BERRY, - .moves = {MOVE_ROCK_SLIDE, MOVE_BLOCK, MOVE_TOXIC, MOVE_EXPLOSION}, - .level = 0, - .ppBonuses = 0, - .hpEV = 100, - .attackEV = 255, - .spDefenseEV = 155, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x80, - .nickname = _("SUDOWOODO"), - .friendship = 255, - }, - [1] = - { - .species = SPECIES_SLOWKING, - .heldItem = ITEM_SCOPE_LENS, - .moves = {MOVE_SURF, MOVE_PSYCHIC, MOVE_BLIZZARD, MOVE_DISABLE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 255, - .defenseEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 1, - .personality = 0x8C, - .nickname = _("SLOWKING"), - .friendship = 255, - }, - [2] = - { - .species = SPECIES_ENTEI, - .heldItem = ITEM_PETAYA_BERRY, - .moves = {MOVE_FLAMETHROWER, MOVE_CALM_MIND, MOVE_FIRE_SPIN, MOVE_ROAR}, - .level = 0, - .ppBonuses = 0, - .speedEV = 255, - .spAttackEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0xF, - .nickname = _("ENTEI"), - .friendship = 255, - }, - [3] = - { - .species = SPECIES_HITMONCHAN, - .heldItem = ITEM_FOCUS_BAND, - .moves = {MOVE_MEGA_PUNCH, MOVE_DETECT, MOVE_COUNTER, MOVE_SKY_UPPERCUT}, - .level = 0, - .ppBonuses = 0, - .attackEV = 255, - .speedEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x3, - .nickname = _("HITMONCHAN"), - .friendship = 255, - }, - [4] = - { - .species = SPECIES_MANTINE, - .heldItem = ITEM_LEFTOVERS, - .moves = {MOVE_SURF, MOVE_CONFUSE_RAY, MOVE_ATTRACT, MOVE_AERIAL_ACE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 255, - .defenseEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 1, - .personality = 0x6, - .nickname = _("MANTINE"), - .friendship = 255, - }, - [5] = - { - .species = SPECIES_ZAPDOS, - .heldItem = ITEM_BRIGHT_POWDER, - .moves = {MOVE_THUNDERBOLT, MOVE_DRILL_PECK, MOVE_THUNDER_WAVE, MOVE_AGILITY}, - .level = 0, - .ppBonuses = 0, - .speedEV = 255, - .spAttackEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x18, - .nickname = _("ZAPDOS"), - .friendship = 255, - }, - }, - }, - [1] = - { - .name = _("STEPHANIE"), - .facilityClass = FACILITY_CLASS_SWIMMING_TRIATHLETE_F, - .unused = 0, - .speechBefore = {0x1E0F, 0x100B, 0xE0F, 0xA02, 0x606, 0xC00}, - .speechWin = {0x1018, 0xA02, 0x1243, 0xE0F, 0x1C1A, 0xC03}, - .speechLose = {0x801, 0xE1D, 0xE0F, 0xA02, 0x1018, 0x1029}, - .speechAfter = {0xA02, 0x123F, 0xA14, 0x1405, 0x102B, 0xA02}, - .mons = - { - [0] = - { - .species = SPECIES_HITMONLEE, - .heldItem = ITEM_FOCUS_BAND, - .moves = {MOVE_MEGA_KICK, MOVE_MIND_READER, MOVE_FOCUS_ENERGY, MOVE_HI_JUMP_KICK}, - .level = 0, - .ppBonuses = 0, - .hpEV = 255, - .attackEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x3, - .nickname = _("HITMONLEE"), - .friendship = 255, - }, - [1] = - { - .species = SPECIES_PORYGON2, - .heldItem = ITEM_SCOPE_LENS, - .moves = {MOVE_LOCK_ON, MOVE_BLIZZARD, MOVE_CONVERSION_2, MOVE_PSYCHIC}, - .level = 0, - .ppBonuses = 0, - .hpEV = 255, - .spAttackEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0xF, - .nickname = _("PORYGON2"), - .friendship = 255, - }, - [2] = - { - .species = SPECIES_SUICUNE, - .heldItem = ITEM_PETAYA_BERRY, - .moves = {MOVE_SURF, MOVE_CALM_MIND, MOVE_MIRROR_COAT, MOVE_MIST}, - .level = 0, - .ppBonuses = 0, - .speedEV = 255, - .spAttackEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0xF, - .nickname = _("SUICUNE"), - .friendship = 255, - }, - [3] = - { - .species = SPECIES_HOUNDOOM, - .heldItem = ITEM_QUICK_CLAW, - .moves = {MOVE_FLAMETHROWER, MOVE_CRUNCH, MOVE_ROAR, MOVE_WILL_O_WISP}, - .level = 0, - .ppBonuses = 0, - .speedEV = 255, - .spAttackEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 1, - .personality = 0xF, - .nickname = _("HOUNDOOM"), - .friendship = 255, - }, - [4] = - { - .species = SPECIES_STANTLER, - .heldItem = ITEM_LEFTOVERS, - .moves = {MOVE_CONFUSE_RAY, MOVE_SWAGGER, MOVE_PSYCH_UP, MOVE_TAKE_DOWN}, - .level = 0, - .ppBonuses = 0, - .attackEV = 255, - .speedEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0x3, - .nickname = _("STANTLER"), - .friendship = 255, - }, - [5] = - { - .species = SPECIES_ARTICUNO, - .heldItem = ITEM_NEVER_MELT_ICE, - .moves = {MOVE_BLIZZARD, MOVE_SHEER_COLD, MOVE_MIST, MOVE_AERIAL_ACE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 255, - .spAttackEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 15, - .attackIV = 15, - .defenseIV = 15, - .speedIV = 15, - .spAttackIV = 15, - .spDefenseIV = 15, - .altAbility = 0, - .personality = 0xF, - .nickname = _("ARTICUNO"), - .friendship = 255, - }, - }, - }, - }, - .data = {0xF1, 0xFB, 0xFB, 0xFB, 0xF9, 0xF9, 0x1B, 0x1C, 0x1D, 0xE5, 0xE6, 0xEE, 0xF5, 0xFB, 0xFB, 0x8, 0xED, 0xF5, 0xF5, 0xF5, 0xFB, 0xFB, 0xEC, 0xEC, 0xEC, 0xEB, 0xEC, 0xEC, 0xEC, 0xFB, 0xFB, 0x8, 0xF4, 0xEC, 0xEC, 0xEC, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xEB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0x8, 0xF1, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xFB, 0xEB, 0xFB, 0xF5, 0xF5, 0xF5, 0xF5, 0x8, 0xF1, 0xEB, 0xEC, 0xEC, 0xEC, 0xEB, 0xEC, 0xEC, 0xFB, 0xEC, 0xFB, 0xEC, 0xEC, 0xEC, 0xEC, 0x8, 0xF1, 0xEB, 0xFB, 0xFB, 0xFB, 0xEB, 0xFB, 0xF5, 0xFB, 0xF5, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0x8, 0xF1, 0xEB, 0xFB, 0xF5, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xF5, 0xF5, 0xF5, 0xFB, 0xFB, 0x8, 0xF1, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xEC, 0xEC, 0xEC, 0xFB, 0xFB, 0x8, 0xF1, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xF5, 0xF5, 0xF5, 0xF5, 0x8, 0xF1, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEC, 0xEC, 0xEC, 0xEC, 0x8, 0xF1, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0x8, 0xF1, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xF5, 0xF5, 0xF5, 0xF5, 0xFB, 0x8, 0xF1, 0xEC, 0xFB, 0xEB, 0xFB, 0xEC, 0xFB, 0xEB, 0xFB, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xFB, 0x8, 0xF1, 0xFB, 0xFB, 0xEB, 0xFB, 0xFB, 0xFB, 0xEB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0x8, 0xF1, 0xFB, 0xFB, 0xEC, 0xFB, 0xFB, 0xFB, 0xEC, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8}, - .unk3A0 = {0x381, 0x3F9, 0xF041, 0x41, 0x7F5F, 0x4401, 0x4541, 0x5579, 0x5541, 0x555F, 0x5541, 0x5541, 0x557D, 0x1101, 0x1101, 0xFFFF}, - .coords = {40, 91}, - .direction = 0x21, - .range = 0x33, - }, - }, + .unkField_0 = 8, + .unused1 = 3, + .unkField_2 = 4, + .unused3 = 0, + .unused4 = 243, + .unused5 = 82, + .unused6 = 6, + .floors = + { + [0] = + { + .unk0 = 0x31, + .unk1 = 0x32, + .trainers = + { + [0] = + { + .name = _("MEREDITH"), + .facilityClass = FACILITY_CLASS_PKMN_RANGER_F, + .unused = 0, + .speechBefore = {EC_WORD_UM, EC_WORD_ELLIPSIS, 0xFFFF, EC_WORD_I, EC_WORD_ELLIPSIS, 0xFFFF}, + .speechWin = {EC_WORD_OH, EC_WORD_EXCL, 0xFFFF, EC_WORD_UM, EC_WORD_ELLIPSIS, EC_WORD_YAY}, + .speechLose = {EC_WORD_UM, EC_WORD_ELLIPSIS, 0xFFFF, EC_WORD_WAAAH, EC_WORD_ELLIPSIS, 0xFFFF}, + .speechAfter = {EC_WORD_UM, EC_WORD_ELLIPSIS, 0xFFFF, EC_WORD_I_AM, EC_WORD_SAD, EC_WORD_ELLIPSIS}, + .mons = + { + [0] = + { + .species = SPECIES_SUNFLORA, + .heldItem = ITEM_PERSIM_BERRY, + .moves = {MOVE_PETAL_DANCE, MOVE_GRASS_WHISTLE, MOVE_LIGHT_SCREEN, MOVE_SUNNY_DAY}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .defenseEV = 155, + .spDefenseEV = 100, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x0, + .nickname = _("SUNFLORA"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_TANGELA, + .heldItem = ITEM_QUICK_CLAW, + .moves = {MOVE_GIGA_DRAIN, MOVE_SLEEP_POWDER, MOVE_AMNESIA, MOVE_SUNNY_DAY}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .spDefenseEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x91, + .nickname = _("TANGELA"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_VENUSAUR, + .heldItem = ITEM_LEFTOVERS, + .moves = {MOVE_SOLAR_BEAM, MOVE_EARTHQUAKE, MOVE_SYNTHESIS, MOVE_SUNNY_DAY}, + .level = 0, + .ppBonuses = 0, + .hpEV = 100, + .attackEV = 110, + .defenseEV = 100, + .spAttackEV = 100, + .spDefenseEV = 100, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x1F, + .nickname = _("VENUSAUR"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_LANTURN, + .heldItem = ITEM_PERSIM_BERRY, + .moves = {MOVE_SPARK, MOVE_WATER_PULSE, MOVE_CONFUSE_RAY, MOVE_RAIN_DANCE}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0xF, + .nickname = _("LANTURN"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_MANECTRIC, + .heldItem = ITEM_FOCUS_BAND, + .moves = {MOVE_THUNDERBOLT, MOVE_HEADBUTT, MOVE_BITE, MOVE_RAIN_DANCE}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 1, + .personality = 0xF, + .nickname = _("MANECTRIC"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_RAIKOU, + .heldItem = ITEM_BRIGHT_POWDER, + .moves = {MOVE_THUNDER, MOVE_CRUNCH, MOVE_ROAR, MOVE_RAIN_DANCE}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0xF, + .nickname = _("RAIKOU"), + .friendship = 255, + }, + }, + }, + [1] = + { + .name = _("BERNARD"), + .facilityClass = FACILITY_CLASS_KINDLER, + .unused = 0, + .speechBefore = {EC_WORD_I, EC_WORD_CAN_T, EC_WORD_LOSE, EC_WORD_THIS, EC_WORD_HOT, EC_WORD_BATTLE}, + .speechWin = {EC_WORD_DID, EC_WORD_I, EC_WORD_COOL, EC_WORD_YOU, EC_WORD_DOWN, EC_WORD_QUES}, + .speechLose = {EC_WORD_AIYEEH, EC_WORD_EXCL, EC_WORD_YOU_RE, EC_WORD_A, EC_WORD_TERRIBLE, EC_WORD_PERSON}, + .speechAfter = {EC_WORD_YOUR, EC_WORD_HEART, EC_WORD_MUST_BE, EC_WORD_ICE, EC_WORD_COLD, EC_WORD_ELLIPSIS}, + .mons = + { + [0] = + { + .species = SPECIES_RELICANTH, + .heldItem = ITEM_QUICK_CLAW, + .moves = {MOVE_ANCIENT_POWER, MOVE_WATER_PULSE, MOVE_MUD_SPORT, MOVE_RAIN_DANCE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 155, + .defenseEV = 100, + .spDefenseEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x2F, + .nickname = _("RELICANTH"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_GOLDUCK, + .heldItem = ITEM_LAX_INCENSE, + .moves = {MOVE_SURF, MOVE_PSYBEAM, MOVE_BRICK_BREAK, MOVE_RAIN_DANCE}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0xF, + .nickname = _("GOLDUCK"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_BLASTOISE, + .heldItem = ITEM_SHELL_BELL, + .moves = {MOVE_HYDRO_PUMP, MOVE_BITE, MOVE_MIRROR_COAT, MOVE_RAIN_DANCE}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x28, + .nickname = _("BLASTOISE"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_MAGCARGO, + .heldItem = ITEM_QUICK_CLAW, + .moves = {MOVE_HEAT_WAVE, MOVE_ROCK_SLIDE, MOVE_PROTECT, MOVE_SUNNY_DAY}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .spDefenseEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 1, + .personality = 0x93, + .nickname = _("MAGCARGO"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_RAPIDASH, + .heldItem = ITEM_KINGS_ROCK, + .moves = {MOVE_FIRE_BLAST, MOVE_BOUNCE, MOVE_QUICK_ATTACK, MOVE_SUNNY_DAY}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 1, + .personality = 0xF, + .nickname = _("RAPIDASH"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_MOLTRES, + .heldItem = ITEM_BRIGHT_POWDER, + .moves = {MOVE_SKY_ATTACK, MOVE_AERIAL_ACE, MOVE_ROAR, MOVE_SUNNY_DAY}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0xF, + .nickname = _("MOLTRES"), + .friendship = 255, + }, + }, + }, + }, + .data = {0xF1, 0xF5, 0xFB, 0xF5, 0xE6, 0xE6, 0x1B, 0x14, 0x15, 0xF8, 0xF9, 0xFA, 0xFB, 0xFB, 0xFB, 0x8, 0xF1, 0xEB, 0xFB, 0xEB, 0xEC, 0xEC, 0xEC, 0xF9, 0xE6, 0xEE, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0x8, 0xF1, 0xEB, 0xFB, 0xEB, 0xFB, 0x9B, 0x9B, 0xFB, 0xEB, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEB, 0x8, 0xF1, 0xEB, 0xFB, 0xEB, 0x9B, 0xDB, 0xDB, 0x9B, 0xEC, 0xFB, 0xF5, 0xF5, 0xF5, 0xFB, 0xEB, 0x8, 0xF1, 0xEB, 0xFB, 0xEB, 0xF5, 0x95, 0x95, 0xF5, 0xF5, 0xF5, 0xEB, 0xEC, 0xEB, 0xFB, 0xEB, 0x8, 0xED, 0xEB, 0xFB, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0x8, 0xF4, 0xEB, 0xFB, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0x8, 0xF1, 0xEB, 0xFB, 0xEB, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xFB, 0xEB, 0xFB, 0xEC, 0x8, 0xF1, 0xEB, 0xFB, 0xEB, 0xFB, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xEB, 0xF5, 0xFB, 0x8, 0xF1, 0xEC, 0xFB, 0xEB, 0xFB, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEB, 0xFB, 0x8, 0xF1, 0xF5, 0xF5, 0xEB, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xFB, 0xEB, 0xFB, 0x8, 0xF1, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEB, 0xFB, 0xEB, 0xFB, 0x8, 0xF1, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xEB, 0xFB, 0xEB, 0xFB, 0x8, 0xF1, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xFB, 0xEC, 0xFB, 0x8, 0xF1, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8}, + .unk3A0 = {0x381, 0x5E01, 0x50FF, 0x5083, 0x503B, 0x5FEB, 0xC02B, 0x5FEB, 0x5009, 0x57FD, 0x1005, 0x7FF5, 0x15, 0x7FF5, 0x1, 0xFFFF}, + .coords = {52, 55}, + .direction = 0x23, + .range = 0x22, + }, + [1] = + { + .unk0 = 0x33, + .unk1 = 0x34, + .trainers = + { + [0] = + { + .name = _("ABRAHAM"), + .facilityClass = FACILITY_CLASS_RUIN_MANIAC, + .unused = 0, + .speechBefore = {EC_WORD_I, EC_WORD_LIKE, EC_WORD_THIS, EC_WORD_POKEMON, EC_WORD_THE, EC_WORD_BEST}, + .speechWin = {EC_WORD_WHAT, EC_WORD_A, EC_WORD_GREAT, EC_WORD_POKEMON, EC_WORD_IT, EC_WORD_IS}, + .speechLose = {EC_WORD_I, EC_WORD_CONFUSED, EC_WORD_A, EC_WORD_MOVE, EC_WORD_WITH, EC_WORD_ANOTHER}, + .speechAfter = {EC_WORD_I, EC_WORD_WANT, EC_WORD_A, EC_MOVE(SKETCH), EC_WORD_OF, EC_WORD_YOU}, + .mons = + { + [0] = + { + .species = SPECIES_SMEARGLE, + .heldItem = ITEM_SCOPE_LENS, + .moves = {MOVE_EARTHQUAKE, MOVE_SHADOW_BALL, MOVE_AERIAL_ACE, MOVE_IMPRISON}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .attackEV = 6, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x8A, + .nickname = _("SMEARGLE"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_SMEARGLE, + .heldItem = ITEM_CHESTO_BERRY, + .moves = {MOVE_REST, MOVE_THUNDER_WAVE, MOVE_FLAMETHROWER, MOVE_IMPRISON}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .speedEV = 252, + .spAttackEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x87, + .nickname = _("SMEARGLE"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_SMEARGLE, + .heldItem = ITEM_QUICK_CLAW, + .moves = {MOVE_TEETER_DANCE, MOVE_LOCK_ON, MOVE_SHEER_COLD, MOVE_EXPLOSION}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .attackEV = 6, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0xD, + .nickname = _("SMEARGLE"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_SMEARGLE, + .heldItem = ITEM_SCOPE_LENS, + .moves = {MOVE_PSYCHIC, MOVE_SURF, MOVE_THUNDERBOLT, MOVE_IMPRISON}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .speedEV = 252, + .spAttackEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0xA, + .nickname = _("SMEARGLE"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_SMEARGLE, + .heldItem = ITEM_LEFTOVERS, + .moves = {MOVE_TOXIC, MOVE_PROTECT, MOVE_WILL_O_WISP, MOVE_IMPRISON}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .defenseEV = 6, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0xA, + .nickname = _("SMEARGLE"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_SMEARGLE, + .heldItem = ITEM_QUICK_CLAW, + .moves = {MOVE_TEETER_DANCE, MOVE_LOCK_ON, MOVE_SHEER_COLD, MOVE_DESTINY_BOND}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .defenseEV = 6, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x8A, + .nickname = _("SMEARGLE"), + .friendship = 255, + }, + }, + }, + [1] = + { + .name = _("LUC"), + .facilityClass = FACILITY_CLASS_TUBER_M, + .unused = 0, + .speechBefore = {EC_WORD_I, EC_WORD_HAVE, EC_WORD_A, EC_WORD_COOL, EC_WORD_RARE, EC_WORD_MOVE}, + .speechWin = {EC_WORD_MY, EC_WORD_RARE, EC_WORD_MOVE, EC_WORD_IS, EC_WORD_COOL, EC_WORD_ISN_T_IT_QUES}, + .speechLose = {EC_WORD_DIDN_T, EC_WORD_YOU, EC_WORD_SEE, EC_WORD_MY, EC_WORD_MOVE, EC_WORD_QUES}, + .speechAfter = {EC_WORD_I_AM, EC_WORD_SMART, EC_WORD_BUT, EC_WORD_ALSO, EC_WORD_WEAK, EC_WORD_ELLIPSIS}, + .mons = + { + [0] = + { + .species = SPECIES_STARYU, + .heldItem = ITEM_LEFTOVERS, + .moves = {MOVE_CAMOUFLAGE, MOVE_NONE, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .speedEV = 252, + .spAttackEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 1, + .personality = 0xA, + .nickname = _("STARYU"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_MEOWTH, + .heldItem = ITEM_QUICK_CLAW, + .moves = {MOVE_PAY_DAY, MOVE_NONE, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .speedEV = 252, + .spAttackEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0xD, + .nickname = _("MEOWTH"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_BLAZIKEN, + .heldItem = ITEM_BRIGHT_POWDER, + .moves = {MOVE_BLAZE_KICK, MOVE_NONE, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .speedEV = 252, + .spDefenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0x28, + .nickname = _("BLAZIKEN"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_CUBONE, + .heldItem = ITEM_THICK_CLUB, + .moves = {MOVE_BONEMERANG, MOVE_NONE, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .defenseEV = 6, + .spDefenseEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 1, + .personality = 0x16, + .nickname = _("CUBONE"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_BEEDRILL, + .heldItem = ITEM_SHELL_BELL, + .moves = {MOVE_TWINEEDLE, MOVE_NONE, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 0, + .personality = 0x8A, + .nickname = _("BEEDRILL"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_RATICATE, + .heldItem = ITEM_FOCUS_BAND, + .moves = {MOVE_SUPER_FANG, MOVE_NONE, MOVE_NONE, MOVE_NONE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .defenseEV = 6, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 5, + .attackIV = 5, + .defenseIV = 5, + .speedIV = 5, + .spAttackIV = 5, + .spDefenseIV = 5, + .altAbility = 1, + .personality = 0xD, + .nickname = _("RATICATE"), + .friendship = 255, + }, + }, + }, + }, + .data = {0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x26, 0x1B, 0x1C, 0x1D, 0x25, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x8, 0x2D, 0x3B, 0x3B, 0x3B, 0x35, 0x2C, 0x23, 0x24, 0x23, 0x2C, 0x35, 0x3B, 0x3B, 0x3B, 0x3B, 0x8, 0x94, 0x87, 0x9B, 0x87, 0x8C, 0x87, 0x8B, 0x87, 0x8C, 0x87, 0x8C, 0x87, 0x95, 0x87, 0x9B, 0x8, 0x91, 0x8F, 0x9B, 0x8F, 0x9B, 0x8F, 0x8C, 0x8F, 0x9B, 0x8F, 0x9B, 0x8F, 0x8C, 0x8F, 0x95, 0x8, 0x8D, 0x97, 0x95, 0x97, 0x9B, 0x97, 0x95, 0x97, 0x95, 0x97, 0x9B, 0x97, 0x9B, 0x97, 0x8C, 0x8, 0x94, 0x87, 0x8C, 0x87, 0x9B, 0x87, 0x8C, 0x87, 0x8B, 0x87, 0x9B, 0x9B, 0x9B, 0x87, 0x9B, 0x8, 0x91, 0x8F, 0x9B, 0x8F, 0x95, 0x8F, 0x9B, 0x8F, 0x8C, 0x8F, 0x95, 0x9B, 0x95, 0x8F, 0x9B, 0x8, 0x91, 0x97, 0x95, 0x97, 0x8C, 0x97, 0x95, 0x97, 0x95, 0x97, 0x8C, 0x9B, 0x8C, 0x97, 0x95, 0x8, 0x91, 0x87, 0x8C, 0x87, 0x9B, 0x87, 0x8C, 0x87, 0x8B, 0x87, 0x9B, 0x87, 0x95, 0x87, 0x8C, 0x8, 0x8D, 0x8F, 0x9B, 0x8F, 0x95, 0x8F, 0x9B, 0x8F, 0x8C, 0x8F, 0x9B, 0x8F, 0x8C, 0x8F, 0x9B, 0x8, 0x94, 0x97, 0x95, 0x97, 0x8C, 0x97, 0x9B, 0x97, 0x95, 0x97, 0x95, 0x97, 0x9B, 0x97, 0x9B, 0x8, 0x91, 0x87, 0x8C, 0x87, 0x95, 0x87, 0x95, 0x87, 0x8B, 0x87, 0x8C, 0x87, 0x9B, 0x87, 0x9B, 0x8, 0x91, 0x8F, 0x95, 0x8F, 0x8B, 0x8F, 0x8C, 0x8F, 0x8C, 0x8F, 0x9B, 0x8F, 0x95, 0x8F, 0x9B, 0x8, 0x91, 0x97, 0x8C, 0x97, 0x8C, 0x97, 0x9B, 0x97, 0x9B, 0x97, 0x9B, 0x97, 0x8B, 0x97, 0x9B, 0x8, 0x91, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x8C, 0x9B, 0x9B, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8}, + .unk3A0 = {0x381, 0x7C1, 0x8AA1, 0x209, 0x5557, 0xA281, 0x81, 0x5D6D, 0x2283, 0x89, 0xDD55, 0x20A1, 0xA81, 0x7D5D, 0x9, 0xFFFF}, + .coords = {105, 109}, + .direction = 0x23, + .range = 0x33, + }, + [2] = + { + .unk0 = 0x35, + .unk1 = 0x36, + .trainers = + { + [0] = + { + .name = _("BREYDEN"), + .facilityClass = FACILITY_CLASS_YOUNGSTER, + .unused = 0, + .speechBefore = {EC_WORD_I, EC_WORD_CARE, EC_WORD_FOR, EC_WORD_MY, EC_WORD_POKEMON, EC_WORD_A_LOT}, + .speechWin = {EC_WORD_MY, EC_WORD_POKEMON, EC_WORD_CAN, EC_WORD_DO, EC_WORD_IT, EC_WORD_ALL}, + .speechLose = {EC_WORD_IT_S, EC_WORD_NOT, EC_WORD_LIKE, EC_WORD_WE, EC_WORD_ALWAYS, EC_WORD_WIN}, + .speechAfter = {EC_WORD_I, EC_WORD_LIKE, EC_WORD_THE, EC_WORD_BEGINNING, EC_WORD_POKEMON, EC_WORD_BEST}, + .mons = + { + [0] = + { + .species = SPECIES_CHARMELEON, + .heldItem = ITEM_CHARCOAL, + .moves = {MOVE_FIRE_SPIN, MOVE_DRAGON_RAGE, MOVE_FLAMETHROWER, MOVE_SLASH}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .speedEV = 252, + .spAttackEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 25, + .attackIV = 25, + .defenseIV = 25, + .speedIV = 25, + .spAttackIV = 25, + .spDefenseIV = 25, + .altAbility = 0, + .personality = 0x32, + .nickname = _("CHARMELEON"), + .friendship = 100, + }, + [1] = + { + .species = SPECIES_WARTORTLE, + .heldItem = ITEM_MYSTIC_WATER, + .moves = {MOVE_HYDRO_PUMP, MOVE_SKULL_BASH, MOVE_RAIN_DANCE, MOVE_PROTECT}, + .level = 0, + .ppBonuses = 0, + .hpEV = 250, + .defenseEV = 130, + .otId = TRAINER_HILL_OTID, + .hpIV = 25, + .attackIV = 25, + .defenseIV = 25, + .speedIV = 25, + .spAttackIV = 25, + .spDefenseIV = 25, + .altAbility = 0, + .personality = 0x0, + .nickname = _("WARTORTLE"), + .friendship = 100, + }, + [2] = + { + .species = SPECIES_IVYSAUR, + .heldItem = ITEM_MIRACLE_SEED, + .moves = {MOVE_SOLAR_BEAM, MOVE_SYNTHESIS, MOVE_GROWTH, MOVE_SWEET_SCENT}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .speedEV = 6, + .spAttackEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 25, + .attackIV = 25, + .defenseIV = 25, + .speedIV = 25, + .spAttackIV = 25, + .spDefenseIV = 25, + .altAbility = 0, + .personality = 0x0, + .nickname = _("IVYSAUR"), + .friendship = 100, + }, + [3] = + { + .species = SPECIES_BAYLEEF, + .heldItem = ITEM_MIRACLE_SEED, + .moves = {MOVE_SOLAR_BEAM, MOVE_SAFEGUARD, MOVE_LIGHT_SCREEN, MOVE_BODY_SLAM}, + .level = 0, + .ppBonuses = 0, + .hpEV = 250, + .attackEV = 130, + .spAttackEV = 130, + .otId = TRAINER_HILL_OTID, + .hpIV = 25, + .attackIV = 25, + .defenseIV = 25, + .speedIV = 25, + .spAttackIV = 25, + .spDefenseIV = 25, + .altAbility = 0, + .personality = 0x32, + .nickname = _("BAYLEEF"), + .friendship = 100, + }, + [4] = + { + .species = SPECIES_CROCONAW, + .heldItem = ITEM_MYSTIC_WATER, + .moves = {MOVE_SCARY_FACE, MOVE_SLASH, MOVE_HYDRO_PUMP, MOVE_SCREECH}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .attackEV = 252, + .speedEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 25, + .attackIV = 25, + .defenseIV = 25, + .speedIV = 25, + .spAttackIV = 25, + .spDefenseIV = 25, + .altAbility = 0, + .personality = 0x3, + .nickname = _("CROCONAW"), + .friendship = 100, + }, + [5] = + { + .species = SPECIES_QUILAVA, + .heldItem = ITEM_CHARCOAL, + .moves = {MOVE_QUICK_ATTACK, MOVE_FLAMETHROWER, MOVE_FLAME_WHEEL, MOVE_SWIFT}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .speedEV = 252, + .spAttackEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x28, + .nickname = _("QUILAVA"), + .friendship = 100, + }, + }, + }, + [1] = + { + .name = _("ANIYA"), + .facilityClass = FACILITY_CLASS_TUBER_F, + .unused = 0, + .speechBefore = {EC_WORD_SOMEONE, EC_WORD_GOT, EC_WORD_ME, EC_WORD_A_LITTLE, EC_WORD_POKEMON, EC_WORD_EGG}, + .speechWin = {EC_WORD_I_AM, EC_WORD_NOT, EC_WORD_NEW, EC_WORD_AT, EC_WORD_THIS, EC_WORD_EXCL}, + .speechLose = {EC_WORD_OH, EC_WORD_BUT, EC_WORD_ELLIPSIS, EC_WORD_WHY, EC_WORD_WHY, EC_WORD_QUES_EXCL}, + .speechAfter = {EC_WORD_YOU_RE, EC_WORD_BUSY, EC_WORD_QUES, EC_WORD_DON_T, EC_WORD_GIVE_UP, EC_WORD_EXCL}, + .mons = + { + [0] = + { + .species = SPECIES_SMOOCHUM, + .heldItem = ITEM_PETAYA_BERRY, + .moves = {MOVE_ICE_BEAM, MOVE_PSYCHIC, MOVE_SWEET_KISS, MOVE_FAKE_TEARS}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .speedEV = 252, + .spAttackEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x32, + .nickname = _("SMOOCHUM"), + .friendship = 50, + }, + [1] = + { + .species = SPECIES_AZURILL, + .heldItem = ITEM_FOCUS_BAND, + .moves = {MOVE_SURF, MOVE_SING, MOVE_RAIN_DANCE, MOVE_BLIZZARD}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .speedEV = 252, + .spAttackEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0xC8, + .nickname = _("AZURILL"), + .friendship = 50, + }, + [2] = + { + .species = SPECIES_ELEKID, + .heldItem = ITEM_KINGS_ROCK, + .moves = {MOVE_FIRE_PUNCH, MOVE_THUNDER, MOVE_ICE_PUNCH, MOVE_THUNDER_WAVE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .speedEV = 252, + .spAttackEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x0, + .nickname = _("ELEKID"), + .friendship = 50, + }, + [3] = + { + .species = SPECIES_CLEFFA, + .heldItem = ITEM_QUICK_CLAW, + .moves = {MOVE_MEGA_KICK, MOVE_SWEET_KISS, MOVE_SING, MOVE_METRONOME}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .attackEV = 252, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x0, + .nickname = _("CLEFFA"), + .friendship = 50, + }, + [4] = + { + .species = SPECIES_WYNAUT, + .heldItem = ITEM_LEFTOVERS, + .moves = {MOVE_ENCORE, MOVE_COUNTER, MOVE_MIRROR_COAT, MOVE_DESTINY_BOND}, + .level = 0, + .ppBonuses = 0, + .hpEV = 250, + .defenseEV = 130, + .spDefenseEV = 130, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x84, + .nickname = _("WYNAUT"), + .friendship = 50, + }, + [5] = + { + .species = SPECIES_MAGBY, + .heldItem = ITEM_SCOPE_LENS, + .moves = {MOVE_FIRE_BLAST, MOVE_CONFUSE_RAY, MOVE_THUNDER_PUNCH, MOVE_BARRIER}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .speedEV = 252, + .spAttackEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0xF, + .nickname = _("MAGBY"), + .friendship = 50, + }, + }, + }, + }, + .data = {0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x8, 0x69, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x7C, 0x46, 0x8, 0x69, 0x46, 0x7A, 0x73, 0x73, 0x73, 0x79, 0x73, 0x73, 0x73, 0x7D, 0x73, 0x73, 0x73, 0x46, 0x8, 0x69, 0x46, 0x73, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x8, 0x69, 0x46, 0x73, 0x73, 0x7B, 0x73, 0x7C, 0x73, 0x7B, 0x73, 0x7A, 0x73, 0x73, 0x73, 0x46, 0x8, 0x69, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x7A, 0x46, 0x8, 0x69, 0x46, 0x73, 0x73, 0x73, 0x73, 0x73, 0x7D, 0x7C, 0x73, 0x7C, 0x73, 0x7B, 0x73, 0x46, 0x8, 0x69, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x7C, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x8, 0x91, 0x46, 0x9B, 0x9B, 0x9B, 0x46, 0x3B, 0x3B, 0x3B, 0x46, 0x9B, 0x9B, 0x9B, 0x9B, 0x46, 0x8, 0x91, 0x46, 0x9B, 0x9B, 0x9B, 0x46, 0x3B, 0x3B, 0x3B, 0x46, 0x9B, 0x9B, 0x9B, 0x9B, 0x46, 0x8, 0x91, 0x46, 0x9B, 0x9B, 0x9B, 0x46, 0x3B, 0x3B, 0x3B, 0x46, 0x9B, 0x9B, 0x9B, 0x9B, 0x46, 0x8, 0xF1, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x78, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x8, 0xF1, 0x46, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0x7A, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0x7C, 0x8, 0xF1, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0xFB, 0x8, 0x7C, 0xFB, 0x7B, 0xFB, 0x7A, 0xFB, 0x79, 0xFB, 0xB3, 0xFB, 0x7D, 0xFB, 0x7E, 0xFB, 0x7D, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8}, + .unk3A0 = {0x381, 0x7FFB, 0x4003, 0x5FFF, 0x4003, 0x7FFB, 0x4003, 0x7EFF, 0x4443, 0x4443, 0x4443, 0x7EFF, 0x4001, 0x7FFD, 0x1, 0xFFFF}, + .coords = {150, 152}, + .direction = 0x23, + .range = 0x11, + }, + [3] = + { + .unk0 = 0x38, + .unk1 = 0x37, + .trainers = + { + [0] = + { + .name = _("DANE"), + .facilityClass = FACILITY_CLASS_BIRD_KEEPER, + .unused = 0, + .speechBefore = {EC_WORD_I, EC_WORD_GOT, EC_WORD_MY, EC_WORD_POKEMON, EC_WORD_ON, EC_WORD_VACATION}, + .speechWin = {EC_WORD_IT_S, EC_WORD_GREAT, EC_WORD_TO, EC_WORD_TRAVEL, EC_WORD_AND, EC_WORD_BATTLE}, + .speechLose = {EC_WORD_WAAAH, EC_WORD_EXCL, EC_WORD_MY, EC_WORD_RARE, EC_WORD_POKEMON, EC_WORD_EXCL}, + .speechAfter = {EC_WORD_OFF, EC_WORD_ON, EC_WORD_ANOTHER, EC_WORD_VACATION, EC_WORD_I, EC_WORD_GO}, + .mons = + { + [0] = + { + .species = SPECIES_SUDOWOODO, + .heldItem = ITEM_SITRUS_BERRY, + .moves = {MOVE_ROCK_SLIDE, MOVE_BLOCK, MOVE_TOXIC, MOVE_EXPLOSION}, + .level = 0, + .ppBonuses = 0, + .hpEV = 100, + .attackEV = 255, + .spDefenseEV = 155, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x80, + .nickname = _("SUDOWOODO"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_SLOWKING, + .heldItem = ITEM_SCOPE_LENS, + .moves = {MOVE_SURF, MOVE_PSYCHIC, MOVE_BLIZZARD, MOVE_DISABLE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .defenseEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 1, + .personality = 0x8C, + .nickname = _("SLOWKING"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_ENTEI, + .heldItem = ITEM_PETAYA_BERRY, + .moves = {MOVE_FLAMETHROWER, MOVE_CALM_MIND, MOVE_FIRE_SPIN, MOVE_ROAR}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0xF, + .nickname = _("ENTEI"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_HITMONCHAN, + .heldItem = ITEM_FOCUS_BAND, + .moves = {MOVE_MEGA_PUNCH, MOVE_DETECT, MOVE_COUNTER, MOVE_SKY_UPPERCUT}, + .level = 0, + .ppBonuses = 0, + .attackEV = 255, + .speedEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x3, + .nickname = _("HITMONCHAN"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_MANTINE, + .heldItem = ITEM_LEFTOVERS, + .moves = {MOVE_SURF, MOVE_CONFUSE_RAY, MOVE_ATTRACT, MOVE_AERIAL_ACE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .defenseEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 1, + .personality = 0x6, + .nickname = _("MANTINE"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_ZAPDOS, + .heldItem = ITEM_BRIGHT_POWDER, + .moves = {MOVE_THUNDERBOLT, MOVE_DRILL_PECK, MOVE_THUNDER_WAVE, MOVE_AGILITY}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x18, + .nickname = _("ZAPDOS"), + .friendship = 255, + }, + }, + }, + [1] = + { + .name = _("STEPHANIE"), + .facilityClass = FACILITY_CLASS_SWIMMING_TRIATHLETE_F, + .unused = 0, + .speechBefore = {EC_WORD_THIS, EC_WORD_IS, EC_WORD_HOW, EC_WORD_YOU, EC_WORD_WIN, EC_WORD_EXCL}, + .speechWin = {EC_WORD_DO, EC_WORD_YOU, EC_WORD_UNDERSTAND, EC_WORD_HOW, EC_WORD_NOW, EC_WORD_QUES}, + .speechLose = {EC_WORD_YES, EC_WORD_THAT_S, EC_WORD_HOW, EC_WORD_YOU, EC_WORD_DO, EC_WORD_IT}, + .speechAfter = {EC_WORD_YOU, EC_WORD_BEAT, EC_WORD_ME, EC_WORD_GOOD, EC_WORD_FOR, EC_WORD_YOU}, + .mons = + { + [0] = + { + .species = SPECIES_HITMONLEE, + .heldItem = ITEM_FOCUS_BAND, + .moves = {MOVE_MEGA_KICK, MOVE_MIND_READER, MOVE_FOCUS_ENERGY, MOVE_HI_JUMP_KICK}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .attackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x3, + .nickname = _("HITMONLEE"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_PORYGON2, + .heldItem = ITEM_SCOPE_LENS, + .moves = {MOVE_LOCK_ON, MOVE_BLIZZARD, MOVE_CONVERSION_2, MOVE_PSYCHIC}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0xF, + .nickname = _("PORYGON2"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_SUICUNE, + .heldItem = ITEM_PETAYA_BERRY, + .moves = {MOVE_SURF, MOVE_CALM_MIND, MOVE_MIRROR_COAT, MOVE_MIST}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0xF, + .nickname = _("SUICUNE"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_HOUNDOOM, + .heldItem = ITEM_QUICK_CLAW, + .moves = {MOVE_FLAMETHROWER, MOVE_CRUNCH, MOVE_ROAR, MOVE_WILL_O_WISP}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 1, + .personality = 0xF, + .nickname = _("HOUNDOOM"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_STANTLER, + .heldItem = ITEM_LEFTOVERS, + .moves = {MOVE_CONFUSE_RAY, MOVE_SWAGGER, MOVE_PSYCH_UP, MOVE_TAKE_DOWN}, + .level = 0, + .ppBonuses = 0, + .attackEV = 255, + .speedEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0x3, + .nickname = _("STANTLER"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_ARTICUNO, + .heldItem = ITEM_NEVER_MELT_ICE, + .moves = {MOVE_BLIZZARD, MOVE_SHEER_COLD, MOVE_MIST, MOVE_AERIAL_ACE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 15, + .attackIV = 15, + .defenseIV = 15, + .speedIV = 15, + .spAttackIV = 15, + .spDefenseIV = 15, + .altAbility = 0, + .personality = 0xF, + .nickname = _("ARTICUNO"), + .friendship = 255, + }, + }, + }, + }, + .data = {0xF1, 0xFB, 0xFB, 0xFB, 0xF9, 0xF9, 0x1B, 0x1C, 0x1D, 0xE5, 0xE6, 0xEE, 0xF5, 0xFB, 0xFB, 0x8, 0xED, 0xF5, 0xF5, 0xF5, 0xFB, 0xFB, 0xEC, 0xEC, 0xEC, 0xEB, 0xEC, 0xEC, 0xEC, 0xFB, 0xFB, 0x8, 0xF4, 0xEC, 0xEC, 0xEC, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xEB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0x8, 0xF1, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xF5, 0xFB, 0xEB, 0xFB, 0xF5, 0xF5, 0xF5, 0xF5, 0x8, 0xF1, 0xEB, 0xEC, 0xEC, 0xEC, 0xEB, 0xEC, 0xEC, 0xFB, 0xEC, 0xFB, 0xEC, 0xEC, 0xEC, 0xEC, 0x8, 0xF1, 0xEB, 0xFB, 0xFB, 0xFB, 0xEB, 0xFB, 0xF5, 0xFB, 0xF5, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0x8, 0xF1, 0xEB, 0xFB, 0xF5, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xF5, 0xF5, 0xF5, 0xFB, 0xFB, 0x8, 0xF1, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xEC, 0xEC, 0xEC, 0xFB, 0xFB, 0x8, 0xF1, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xF5, 0xF5, 0xF5, 0xF5, 0x8, 0xF1, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEC, 0xEC, 0xEC, 0xEC, 0x8, 0xF1, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0x8, 0xF1, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xFB, 0xEB, 0xF5, 0xF5, 0xF5, 0xF5, 0xFB, 0x8, 0xF1, 0xEC, 0xFB, 0xEB, 0xFB, 0xEC, 0xFB, 0xEB, 0xFB, 0xEC, 0xEC, 0xEC, 0xEC, 0xEC, 0xFB, 0x8, 0xF1, 0xFB, 0xFB, 0xEB, 0xFB, 0xFB, 0xFB, 0xEB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0x8, 0xF1, 0xFB, 0xFB, 0xEC, 0xFB, 0xFB, 0xFB, 0xEC, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0xFB, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8}, + .unk3A0 = {0x381, 0x3F9, 0xF041, 0x41, 0x7F5F, 0x4401, 0x4541, 0x5579, 0x5541, 0x555F, 0x5541, 0x5541, 0x557D, 0x1101, 0x1101, 0xFFFF}, + .coords = {40, 91}, + .direction = 0x21, + .range = 0x33, + }, + }, }; static const struct TrHillTag sDataTagExpert = { - .unkField_0 = 8, - .unused1 = 1, - .unkField_2 = 4, - .unused3 = 0, - .unused4 = 63, - .unused5 = 31, - .unused6 = 6, - .floors = - { - [0] = - { - .unk0 = 0x39, - .unk1 = 0x3A, - .trainers = - { - [0] = - { - .name = _("ALFRED"), - .facilityClass = FACILITY_CLASS_COOLTRAINER_M, - .unused = 0, - .speechBefore = {0xA3D, 0x1016, 0x1647, 0x102C, 0xE39, 0x432}, - .speechWin = {0xA3D, 0x103B, 0x1031, 0x1042, 0xC38, 0xC00}, - .speechLose = {0xA40, 0x616, 0x1013, 0xE39, 0x1405, 0xC04}, - .speechAfter = {0xA3D, 0x140F, 0x102F, 0x180F, 0xE12, 0xE36}, - .mons = - { - [0] = - { - .species = SPECIES_SNORLAX, - .heldItem = ITEM_QUICK_CLAW, - .moves = {MOVE_MEGA_KICK, MOVE_SHADOW_BALL, MOVE_BRICK_BREAK, MOVE_EARTHQUAKE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 6, - .attackEV = 252, - .defenseEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0x35, - .nickname = _("SNORLAX"), - .friendship = 255, - }, - [1] = - { - .species = SPECIES_MILTANK, - .heldItem = ITEM_LEFTOVERS, - .moves = {MOVE_DOUBLE_EDGE, MOVE_SHADOW_BALL, MOVE_ATTRACT, MOVE_MILK_DRINK}, - .level = 0, - .ppBonuses = 0, - .hpEV = 6, - .attackEV = 252, - .speedEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0x3, - .nickname = _("MILTANK"), - .friendship = 255, - }, - [2] = - { - .species = SPECIES_URSARING, - .heldItem = ITEM_QUICK_CLAW, - .moves = {MOVE_DOUBLE_EDGE, MOVE_CRUNCH, MOVE_BRICK_BREAK, MOVE_AERIAL_ACE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .attackEV = 252, - .spAttackEV = 6, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0x7F, - .nickname = _("URSARING"), - .friendship = 255, - }, - [3] = - { - .species = SPECIES_SLAKING, - .heldItem = ITEM_CHESTO_BERRY, - .moves = {MOVE_HYPER_BEAM, MOVE_SHADOW_BALL, MOVE_BRICK_BREAK, MOVE_REST}, - .level = 0, - .ppBonuses = 0, - .hpEV = 6, - .attackEV = 252, - .spDefenseEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0x80, - .nickname = _("SLAKING"), - .friendship = 255, - }, - [4] = - { - .species = SPECIES_KANGASKHAN, - .heldItem = ITEM_LEFTOVERS, - .moves = {MOVE_MEGA_KICK, MOVE_SHADOW_BALL, MOVE_ATTRACT, MOVE_FAKE_OUT}, - .level = 0, - .ppBonuses = 0, - .hpEV = 6, - .attackEV = 252, - .speedEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0x3, - .nickname = _("KANGASKHAN"), - .friendship = 255, - }, - [5] = - { - .species = SPECIES_ZANGOOSE, - .heldItem = ITEM_SCOPE_LENS, - .moves = {MOVE_CRUSH_CLAW, MOVE_SHADOW_BALL, MOVE_BRICK_BREAK, MOVE_ROAR}, - .level = 0, - .ppBonuses = 0, - .hpEV = 6, - .attackEV = 252, - .speedEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0x80, - .nickname = _("ZANGOOSE"), - .friendship = 255, - }, - }, - }, - [1] = - { - .name = _("EDIE"), - .facilityClass = FACILITY_CLASS_PSYCHIC_F, - .unused = 0, - .speechBefore = {0xA3D, 0x1001, 0x102B, 0xE39, 0x20B, 0x61F}, - .speechWin = {0xA28, 0x616, 0x1639, 0x102F, 0x1419, 0xC00}, - .speechLose = {0x81D, 0x81D, 0xC04, 0x1E14, 0x1014, 0x1018}, - .speechAfter = {0x1023, 0x1231, 0x1006, 0x1020, 0x20B, 0x1806}, - .mons = - { - [0] = - { - .species = SPECIES_SLOWKING, - .heldItem = ITEM_LEFTOVERS, - .moves = {MOVE_PSYCHIC, MOVE_SURF, MOVE_ICE_BEAM, MOVE_SKILL_SWAP}, - .level = 0, - .ppBonuses = 0, - .hpEV = 200, - .defenseEV = 110, - .spAttackEV = 200, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 1, - .personality = 0xF, - .nickname = _("SLOWKING"), - .friendship = 255, - }, - [1] = - { - .species = SPECIES_ESPEON, - .heldItem = ITEM_LUM_BERRY, - .moves = {MOVE_PSYCHIC, MOVE_BITE, MOVE_CALM_MIND, MOVE_REFLECT}, - .level = 0, - .ppBonuses = 0, - .hpEV = 6, - .speedEV = 252, - .spAttackEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0x28, - .nickname = _("ESPEON"), - .friendship = 255, - }, - [2] = - { - .species = SPECIES_STARMIE, - .heldItem = ITEM_SHELL_BELL, - .moves = {MOVE_PSYCHIC, MOVE_SURF, MOVE_THUNDERBOLT, MOVE_ICE_BEAM}, - .level = 0, - .ppBonuses = 0, - .hpEV = 6, - .speedEV = 252, - .spAttackEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 1, - .personality = 0xF, - .nickname = _("STARMIE"), - .friendship = 255, - }, - [3] = - { - .species = SPECIES_GENGAR, - .heldItem = ITEM_LUM_BERRY, - .moves = {MOVE_PSYCHIC, MOVE_THUNDERBOLT, MOVE_FIRE_PUNCH, MOVE_ICE_PUNCH}, - .level = 0, - .ppBonuses = 0, - .hpEV = 6, - .speedEV = 252, - .spAttackEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0xF, - .nickname = _("GENGAR"), - .friendship = 255, - }, - [4] = - { - .species = SPECIES_GARDEVOIR, - .heldItem = ITEM_SALAC_BERRY, - .moves = {MOVE_PSYCHIC, MOVE_THUNDERBOLT, MOVE_MAGICAL_LEAF, MOVE_DESTINY_BOND}, - .level = 0, - .ppBonuses = 0, - .hpEV = 6, - .speedEV = 252, - .spAttackEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0xF, - .nickname = _("GARDEVOIR"), - .friendship = 255, - }, - [5] = - { - .species = SPECIES_ALAKAZAM, - .heldItem = ITEM_LUM_BERRY, - .moves = {MOVE_PSYCHIC, MOVE_RECOVER, MOVE_THUNDER_WAVE, MOVE_ATTRACT}, - .level = 0, - .ppBonuses = 0, - .hpEV = 6, - .speedEV = 252, - .spAttackEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0xF, - .nickname = _("ALAKAZAM"), - .friendship = 255, - }, - }, - }, - }, - .data = {0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x1B, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x8, 0x31, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x2C, 0x39, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x8, 0x31, 0x3B, 0x8, 0x8, 0x8, 0x8, 0x8, 0x3B, 0x8, 0x8, 0x8, 0x8, 0x8, 0x3B, 0x3B, 0x8, 0x69, 0x73, 0x8, 0x4D, 0x4D, 0x4D, 0x4D, 0xD1, 0x4D, 0x4D, 0x4D, 0x4D, 0x8, 0x69, 0x73, 0x8, 0x40, 0x3B, 0x8, 0x55, 0x55, 0x55, 0x55, 0xD1, 0x55, 0x55, 0x55, 0x55, 0x8, 0x31, 0x41, 0x8, 0x69, 0x41, 0x8, 0xC5, 0xD9, 0xD9, 0xD9, 0x9A, 0xD9, 0xD9, 0xD9, 0xC6, 0x8, 0x41, 0x73, 0x8, 0x69, 0x3B, 0x8, 0xD4, 0xDB, 0x9B, 0x73, 0x73, 0x73, 0x9B, 0xDB, 0xCC, 0x8, 0x31, 0x73, 0x8, 0x69, 0x3B, 0x8, 0xCD, 0x9B, 0x73, 0x73, 0x44, 0x73, 0x73, 0x9B, 0xD5, 0x8, 0x31, 0x73, 0x8, 0x69, 0x3B, 0x8, 0xD4, 0xDB, 0x9B, 0x73, 0x73, 0x73, 0x9B, 0xDB, 0xCC, 0x8, 0x31, 0x73, 0x8, 0x69, 0x41, 0x8, 0xD1, 0xDB, 0xDB, 0xDB, 0x9B, 0xDB, 0xDB, 0xDB, 0xDB, 0x8, 0x41, 0x73, 0x8, 0x40, 0x3B, 0x8, 0x8, 0xC7, 0xC7, 0xDB, 0xDB, 0xDB, 0xC7, 0xC7, 0x8, 0x8, 0x31, 0x41, 0x8, 0x69, 0x3B, 0x4D, 0x4D, 0x67, 0x67, 0xDB, 0xDB, 0xDB, 0x67, 0x67, 0x4D, 0x4D, 0x31, 0x73, 0x8, 0x69, 0x3B, 0x55, 0x55, 0xD7, 0xD7, 0xD1, 0xDB, 0xDB, 0xD7, 0xD7, 0x55, 0x55, 0x31, 0x73, 0x8, 0x69, 0x3B, 0x39, 0x39, 0x39, 0x39, 0x3A, 0x3B, 0x3B, 0x39, 0x39, 0x39, 0x39, 0x3A, 0x73, 0x8, 0x69, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8}, - .unk3A0 = {0x381, 0x201, 0x3EF9, 0x3EF9, 0x3EF9, 0x2009, 0x3019, 0x2009, 0x3019, 0x2009, 0x3019, 0x3019, 0x3C79, 0x1, 0x1, 0xFFFF}, - .coords = {116, 122}, - .direction = 0x23, - .range = 0x55, - }, - [1] = - { - .unk0 = 0x3B, - .unk1 = 0x3C, - .trainers = - { - [0] = - { - .name = _("RODERICK"), - .facilityClass = FACILITY_CLASS_COOLTRAINER_M, - .unused = 0, - .speechBefore = {0xA01, 0x1016, 0x606, 0x103E, 0x1020, 0x270E}, - .speechWin = {0xA31, 0xE16, 0x1431, 0x1E14, 0xA01, 0x606}, - .speechLose = {0x280E, 0x1404, 0xA14, 0xE09, 0x1428, 0xC04}, - .speechAfter = {0xA02, 0x101E, 0x1020, 0x1405, 0x1814, 0xC03}, - .mons = - { - [0] = - { - .species = SPECIES_SWELLOW, - .heldItem = ITEM_LEFTOVERS, - .moves = {MOVE_AERIAL_ACE, MOVE_AGILITY, MOVE_FACADE, MOVE_ATTRACT}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .attackEV = 252, - .spDefenseEV = 6, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0x3, - .nickname = _("SWELLOW"), - .friendship = 255, - }, - [1] = - { - .species = SPECIES_MACHAMP, - .heldItem = ITEM_LEFTOVERS, - .moves = {MOVE_LOW_KICK, MOVE_ROCK_SLIDE, MOVE_FACADE, MOVE_ATTRACT}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .attackEV = 252, - .spDefenseEV = 6, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0x3, - .nickname = _("MACHAMP"), - .friendship = 255, - }, - [2] = - { - .species = SPECIES_URSARING, - .heldItem = ITEM_LEFTOVERS, - .moves = {MOVE_PROTECT, MOVE_ROCK_SLIDE, MOVE_FACADE, MOVE_ATTRACT}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .attackEV = 252, - .spDefenseEV = 6, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0x3, - .nickname = _("URSARING"), - .friendship = 255, - }, - [3] = - { - .species = SPECIES_KINGLER, - .heldItem = ITEM_PERSIM_BERRY, - .moves = {MOVE_RETURN, MOVE_PROTECT, MOVE_CRABHAMMER, MOVE_ATTRACT}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .attackEV = 252, - .spDefenseEV = 6, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0x80, - .nickname = _("KINGLER"), - .friendship = 255, - }, - [4] = - { - .species = SPECIES_TYRANITAR, - .heldItem = ITEM_PERSIM_BERRY, - .moves = {MOVE_ROCK_SLIDE, MOVE_CRUNCH, MOVE_EARTHQUAKE, MOVE_ATTRACT}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .attackEV = 252, - .defenseEV = 6, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0x80, - .nickname = _("TYRANITAR"), - .friendship = 255, - }, - [5] = - { - .species = SPECIES_DRAGONITE, - .heldItem = ITEM_PERSIM_BERRY, - .moves = {MOVE_BODY_SLAM, MOVE_THUNDER_WAVE, MOVE_EARTHQUAKE, MOVE_ATTRACT}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .attackEV = 252, - .spDefenseEV = 6, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0x80, - .nickname = _("DRAGONITE"), - .friendship = 255, - }, - }, - }, - [1] = - { - .name = _("ALICIA"), - .facilityClass = FACILITY_CLASS_COOLTRAINER_F, - .unused = 0, - .speechBefore = {0xA01, 0x1017, 0x140F, 0x1020, 0x270E, 0xC00}, - .speechWin = {0x80B, 0xC00, 0x1039, 0x122E, 0x102B, 0xA02}, - .speechLose = {0x1E22, 0x1021, 0xC15, 0x26A5, 0x1E19, 0xC00}, - .speechAfter = {0xA01, 0x1016, 0x1006, 0xA05, 0x20E, 0x1814}, - .mons = - { - [0] = - { - .species = SPECIES_JOLTEON, - .heldItem = ITEM_BRIGHT_POWDER, - .moves = {MOVE_THUNDERBOLT, MOVE_THUNDER_WAVE, MOVE_ATTRACT, MOVE_SWAGGER}, - .level = 0, - .ppBonuses = 0, - .hpEV = 6, - .speedEV = 252, - .spAttackEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0xA, - .nickname = _("JOLTEON"), - .friendship = 255, - }, - [1] = - { - .species = SPECIES_ALAKAZAM, - .heldItem = ITEM_KINGS_ROCK, - .moves = {MOVE_PSYCHIC, MOVE_ICE_PUNCH, MOVE_ATTRACT, MOVE_SWAGGER}, - .level = 0, - .ppBonuses = 0, - .hpEV = 6, - .speedEV = 252, - .spAttackEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0xA, - .nickname = _("ALAKAZAM"), - .friendship = 255, - }, - [2] = - { - .species = SPECIES_STARMIE, - .heldItem = ITEM_SCOPE_LENS, - .moves = {MOVE_SURF, MOVE_PSYCHIC, MOVE_CONFUSE_RAY, MOVE_SWAGGER}, - .level = 0, - .ppBonuses = 0, - .hpEV = 6, - .speedEV = 252, - .spAttackEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 1, - .personality = 0xA, - .nickname = _("STARMIE"), - .friendship = 255, - }, - [3] = - { - .species = SPECIES_DUSCLOPS, - .heldItem = ITEM_LEFTOVERS, - .moves = {MOVE_PURSUIT, MOVE_PROTECT, MOVE_ATTRACT, MOVE_WILL_O_WISP}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .defenseEV = 252, - .spDefenseEV = 6, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0x82, - .nickname = _("DUSCLOPS"), - .friendship = 255, - }, - [4] = - { - .species = SPECIES_NINETALES, - .heldItem = ITEM_WHITE_HERB, - .moves = {MOVE_OVERHEAT, MOVE_CONFUSE_RAY, MOVE_WILL_O_WISP, MOVE_ATTRACT}, - .level = 0, - .ppBonuses = 0, - .hpEV = 6, - .speedEV = 252, - .spAttackEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0xD2, - .nickname = _("NINETALES"), - .friendship = 255, - }, - [5] = - { - .species = SPECIES_BANETTE, - .heldItem = ITEM_FOCUS_BAND, - .moves = {MOVE_SHADOW_BALL, MOVE_FAINT_ATTACK, MOVE_ATTRACT, MOVE_WILL_O_WISP}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .defenseEV = 252, - .spDefenseEV = 6, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0x85, - .nickname = _("BANETTE"), - .friendship = 255, - }, - }, - }, - }, - .data = {0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x8, 0x91, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x78, 0x8, 0x91, 0x46, 0x9B, 0x7C, 0x9B, 0x9B, 0x9B, 0x7D, 0x9B, 0x7C, 0x9B, 0x7B, 0x9B, 0x7A, 0x9B, 0x8, 0x91, 0x46, 0x7D, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x8, 0x91, 0x46, 0x9B, 0x7E, 0x9B, 0x9B, 0x9B, 0x7D, 0x9B, 0x7E, 0x9B, 0xB3, 0x9B, 0x9B, 0x9B, 0x8, 0x91, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x9B, 0x8, 0x91, 0x46, 0x9B, 0x7D, 0x9B, 0x7C, 0x9B, 0x7B, 0x9B, 0x7A, 0x9B, 0x7C, 0x9B, 0x9B, 0x9B, 0x8, 0x91, 0x46, 0x9B, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x8, 0x91, 0x46, 0x9B, 0x7C, 0x9B, 0x7D, 0x9B, 0x7E, 0x9B, 0x9B, 0x9B, 0x7D, 0x9B, 0x7E, 0x9B, 0x8, 0x91, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0xB3, 0x8, 0x91, 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0xDB, 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0x9B, 0x8, 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0xDB, 0xDB, 0xDB, 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0x8, 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0x8, 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0xDB, 0xDB, 0xDB, 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0x8, 0x91, 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0xDB, 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0x9B, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8}, - .unk3A0 = {0x381, 0x7FFD, 0x4001, 0x5FFF, 0x4001, 0x7FFD, 0x4001, 0x5FFF, 0x4001, 0x7FFD, 0x1, 0x1, 0x1, 0x1, 0x1, 0xFFFF}, - .coords = {167, 231}, - .direction = 0x1, - .range = 0x33, - }, - [2] = - { - .unk0 = 0x3D, - .unk1 = 0x3E, - .trainers = - { - [0] = - { - .name = _("TERRENCE"), - .facilityClass = FACILITY_CLASS_EXPERT_M, - .unused = 0, - .speechBefore = {0xC33, 0x1E0F, 0x618, 0x100B, 0x102B, 0xA02}, - .speechWin = {0xC33, 0x103B, 0xA02, 0x1239, 0x1E14, 0xC03}, - .speechLose = {0xC33, 0xA29, 0x1025, 0x80B, 0xFFFF, 0xFFFF}, - .speechAfter = {0x100B, 0xA05, 0xA10, 0x620, 0xC03, 0xFFFF}, - .mons = - { - [0] = - { - .species = SPECIES_WOBBUFFET, - .heldItem = ITEM_LEFTOVERS, - .moves = {MOVE_MIRROR_COAT, MOVE_COUNTER, MOVE_SAFEGUARD, MOVE_ENCORE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 250, - .defenseEV = 130, - .spDefenseEV = 130, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0x94, - .nickname = _("WOBBUFFET"), - .friendship = 255, - }, - [1] = - { - .species = SPECIES_EXPLOUD, - .heldItem = ITEM_CHESTO_BERRY, - .moves = {MOVE_HYPER_VOICE, MOVE_COUNTER, MOVE_REST, MOVE_ROCK_SLIDE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 250, - .defenseEV = 130, - .spDefenseEV = 130, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0x85, - .nickname = _("EXPLOUD"), - .friendship = 0, - }, - [2] = - { - .species = SPECIES_CROBAT, - .heldItem = ITEM_KINGS_ROCK, - .moves = {MOVE_MEAN_LOOK, MOVE_CONFUSE_RAY, MOVE_AERIAL_ACE, MOVE_TOXIC}, - .level = 0, - .ppBonuses = 0, - .hpEV = 250, - .defenseEV = 130, - .spDefenseEV = 130, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0x0, - .nickname = _("CROBAT"), - .friendship = 255, - }, - [3] = - { - .species = SPECIES_DUGTRIO, - .heldItem = ITEM_BRIGHT_POWDER, - .moves = {MOVE_DOUBLE_TEAM, MOVE_PROTECT, MOVE_RETURN, MOVE_SLUDGE_BOMB}, - .level = 0, - .ppBonuses = 0, - .hpEV = 6, - .attackEV = 252, - .speedEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 1, - .personality = 0xD, - .nickname = _("DUGTRIO"), - .friendship = 255, - }, - [4] = - { - .species = SPECIES_ELECTRODE, - .heldItem = ITEM_PETAYA_BERRY, - .moves = {MOVE_TORMENT, MOVE_MIRROR_COAT, MOVE_THUNDERBOLT, MOVE_LIGHT_SCREEN}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .defenseEV = 252, - .spAttackEV = 6, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0x5, - .nickname = _("ELECTRODE"), - .friendship = 0, - }, - [5] = - { - .species = SPECIES_GENGAR, - .heldItem = ITEM_FOCUS_BAND, - .moves = {MOVE_CONFUSE_RAY, MOVE_MEAN_LOOK, MOVE_GIGA_DRAIN, MOVE_WILL_O_WISP}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .speedEV = 252, - .spDefenseEV = 6, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0x14, - .nickname = _("GENGAR"), - .friendship = 255, - }, - }, - }, - [1] = - { - .name = _("CARLOTTA"), - .facilityClass = FACILITY_CLASS_EXPERT_F, - .unused = 0, - .speechBefore = {0xC33, 0xA01, 0x1000, 0x606, 0x102B, 0xA02}, - .speechWin = {0xC33, 0xA3D, 0x101E, 0x1020, 0x1821, 0x1C10}, - .speechLose = {0xC33, 0xA29, 0x80B, 0x102F, 0x121B, 0xA02}, - .speechAfter = {0x100B, 0xA05, 0xA09, 0x415, 0xC03, 0xFFFF}, - .mons = - { - [0] = - { - .species = SPECIES_LAPRAS, - .heldItem = ITEM_QUICK_CLAW, - .moves = {MOVE_SURF, MOVE_ICE_BEAM, MOVE_PERISH_SONG, MOVE_SING}, - .level = 0, - .ppBonuses = 0, - .hpEV = 250, - .defenseEV = 130, - .spDefenseEV = 130, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0x82, - .nickname = _("LAPRAS"), - .friendship = 0, - }, - [1] = - { - .species = SPECIES_ABSOL, - .heldItem = ITEM_FOCUS_BAND, - .moves = {MOVE_PERISH_SONG, MOVE_DOUBLE_EDGE, MOVE_PROTECT, MOVE_TORMENT}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .defenseEV = 6, - .speedEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0x8A, - .nickname = _("ABSOL"), - .friendship = 0, - }, - [2] = - { - .species = SPECIES_ALTARIA, - .heldItem = ITEM_KINGS_ROCK, - .moves = {MOVE_PERISH_SONG, MOVE_PROTECT, MOVE_DRAGON_CLAW, MOVE_FIRE_BLAST}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .spAttackEV = 6, - .spDefenseEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0x0, - .nickname = _("ALTARIA"), - .friendship = 0, - }, - [3] = - { - .species = SPECIES_DEWGONG, - .heldItem = ITEM_CHESTO_BERRY, - .moves = {MOVE_ICE_BEAM, MOVE_SIGNAL_BEAM, MOVE_REST, MOVE_PERISH_SONG}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .speedEV = 252, - .spAttackEV = 6, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0x14, - .nickname = _("DEWGONG"), - .friendship = 0, - }, - [4] = - { - .species = SPECIES_POLITOED, - .heldItem = ITEM_BRIGHT_POWDER, - .moves = {MOVE_HYDRO_PUMP, MOVE_BLIZZARD, MOVE_MIND_READER, MOVE_PERISH_SONG}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .spAttackEV = 6, - .spDefenseEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 1, - .personality = 0x14, - .nickname = _("POLITOED"), - .friendship = 0, - }, - [5] = - { - .species = SPECIES_MAROWAK, - .heldItem = ITEM_QUICK_CLAW, - .moves = {MOVE_PERISH_SONG, MOVE_EARTHQUAKE, MOVE_COUNTER, MOVE_PROTECT}, - .level = 0, - .ppBonuses = 0, - .hpEV = 252, - .speedEV = 6, - .spDefenseEV = 252, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 1, - .personality = 0x17, - .nickname = _("MAROWAK"), - .friendship = 0, - }, - }, - }, - }, - .data = {0xD1, 0xDB, 0xDB, 0xDB, 0xD9, 0xD9, 0x1B, 0x14, 0x15, 0x98, 0x99, 0x9A, 0x9B, 0x9B, 0x9B, 0x8, 0xD1, 0xDB, 0xDB, 0xDB, 0xD5, 0xD5, 0xC3, 0xF9, 0x86, 0x8E, 0x95, 0x9B, 0x9B, 0x9B, 0x9B, 0x8, 0xD1, 0xDB, 0xDB, 0xD5, 0xCB, 0xCB, 0xCB, 0xFB, 0x8B, 0x8B, 0x8B, 0x95, 0x9B, 0x9B, 0x9B, 0x8, 0xD1, 0xDB, 0xD5, 0xCB, 0xCB, 0xCB, 0xCB, 0xFB, 0x8B, 0x8B, 0x8B, 0x8B, 0x95, 0x9B, 0x9B, 0x8, 0xD1, 0xDB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xFB, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x9B, 0x9B, 0x8, 0xD1, 0xD5, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xFB, 0x8C, 0x8B, 0x8B, 0x8B, 0x8B, 0x95, 0x9B, 0x8, 0xD1, 0xCB, 0xCB, 0xCB, 0xCB, 0xCC, 0xCC, 0xFB, 0xFB, 0x8C, 0x8B, 0x8B, 0x8B, 0x8B, 0x9B, 0x8, 0xD1, 0xCC, 0xCC, 0xCC, 0xCC, 0xFB, 0xF5, 0xFB, 0xF5, 0xFB, 0x8B, 0x8B, 0x8B, 0x8B, 0x9B, 0x8, 0xD1, 0xD5, 0xD5, 0xD5, 0xD5, 0xFB, 0xEC, 0xFB, 0xEC, 0xFB, 0x8B, 0x8B, 0x8B, 0x8B, 0x9B, 0x8, 0xD1, 0xCB, 0xCB, 0xCB, 0xCB, 0xF5, 0xF5, 0xFB, 0xFB, 0xF5, 0x8B, 0x8B, 0x8B, 0x8B, 0x9B, 0x8, 0xD1, 0xCC, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xFB, 0xFB, 0x8B, 0x8B, 0x8B, 0x8B, 0x8C, 0x9B, 0x8, 0xD1, 0xDB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xFB, 0xF5, 0x8B, 0x8B, 0x8B, 0x8B, 0x9B, 0x9B, 0x8, 0xD1, 0xDB, 0xCC, 0xCB, 0xCB, 0xCB, 0xCB, 0xFB, 0x8B, 0x8B, 0x8B, 0x8B, 0x8C, 0x9B, 0x9B, 0x8, 0xD1, 0xDB, 0xDB, 0xCC, 0xCB, 0xCB, 0xCB, 0xFB, 0x8B, 0x8B, 0x8B, 0x8C, 0x9B, 0x9B, 0x9B, 0x8, 0xD1, 0xDB, 0xDB, 0xDB, 0xCC, 0xCC, 0xCB, 0xFB, 0x8C, 0x8C, 0x8C, 0x9B, 0x9B, 0x9B, 0x9B, 0x8, 0xD1, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xCC, 0xFB, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x8}, - .unk3A0 = {0x381, 0x201, 0xEE1, 0x1EF1, 0x3EF9, 0x3EF9, 0x7E7D, 0x783D, 0x2BD, 0x783D, 0x7E7D, 0x3E79, 0x3EF9, 0x1EF1, 0xEE1, 0x201}, - .coords = {103, 167}, - .direction = 0x1, - .range = 0x33, - }, - [3] = - { - .unk0 = 0x3F, - .unk1 = 0x40, - .trainers = - { - [0] = - { - .name = _("NORA"), - .facilityClass = FACILITY_CLASS_PKMN_RANGER_F, - .unused = 0, - .speechBefore = {0xC0A, 0x1E0F, 0x100B, 0x1025, 0x200F, 0xC00}, - .speechWin = {0xC0A, 0xA29, 0x1025, 0x1205, 0xA01, 0x607}, - .speechLose = {0xC0A, 0xA29, 0x1025, 0x120E, 0xA01, 0x630}, - .speechAfter = {0xC0A, 0xC00, 0xFFFF, 0x601, 0x1E1E, 0xC00}, - .mons = - { - [0] = - { - .species = SPECIES_FORRETRESS, - .heldItem = ITEM_QUICK_CLAW, - .moves = {MOVE_EXPLOSION, MOVE_EARTHQUAKE, MOVE_ATTRACT, MOVE_SPIKES}, - .level = 0, - .ppBonuses = 0, - .hpEV = 110, - .attackEV = 200, - .spDefenseEV = 200, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0x3, - .nickname = _("FORRETRESS"), - .friendship = 255, - }, - [1] = - { - .species = SPECIES_ELECTRODE, - .heldItem = ITEM_SALAC_BERRY, - .moves = {MOVE_EXPLOSION, MOVE_THUNDERBOLT, MOVE_SWIFT, MOVE_LIGHT_SCREEN}, - .level = 0, - .ppBonuses = 0, - .attackEV = 255, - .spAttackEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 1, - .personality = 0xC, - .nickname = _("ELECTRODE"), - .friendship = 255, - }, - [2] = - { - .species = SPECIES_EXEGGUTOR, - .heldItem = ITEM_SHELL_BELL, - .moves = {MOVE_EXPLOSION, MOVE_HYPNOSIS, MOVE_PSYCHIC, MOVE_SOLAR_BEAM}, - .level = 0, - .ppBonuses = 0, - .attackEV = 255, - .spAttackEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0x7F, - .nickname = _("EXEGGUTOR"), - .friendship = 255, - }, - [3] = - { - .species = SPECIES_DUSCLOPS, - .heldItem = ITEM_LEFTOVERS, - .moves = {MOVE_IMPRISON, MOVE_PROTECT, MOVE_ICE_BEAM, MOVE_EARTHQUAKE}, - .level = 0, - .ppBonuses = 0, - .hpEV = 110, - .defenseEV = 200, - .spDefenseEV = 200, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0x93, - .nickname = _("DUSCLOPS"), - .friendship = 255, - }, - [4] = - { - .species = SPECIES_NINETALES, - .heldItem = ITEM_WHITE_HERB, - .moves = {MOVE_IMPRISON, MOVE_PROTECT, MOVE_OVERHEAT, MOVE_CONFUSE_RAY}, - .level = 0, - .ppBonuses = 0, - .speedEV = 255, - .spAttackEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0xF, - .nickname = _("NINETALES"), - .friendship = 255, - }, - [5] = - { - .species = SPECIES_BANETTE, - .heldItem = ITEM_BRIGHT_POWDER, - .moves = {MOVE_IMPRISON, MOVE_PROTECT, MOVE_THUNDERBOLT, MOVE_THUNDER}, - .level = 0, - .ppBonuses = 0, - .hpEV = 255, - .spAttackEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0x96, - .nickname = _("BANETTE"), - .friendship = 255, - }, - }, - }, - [1] = - { - .name = _("GAV"), - .facilityClass = FACILITY_CLASS_PKMN_RANGER_M, - .unused = 0, - .speechBefore = {0xC3E, 0xA02, 0x1015, 0x1C19, 0xA14, 0xC00}, - .speechWin = {0xC3C, 0xC00, 0xFFFF, 0xA29, 0x2017, 0x415}, - .speechLose = {0xA29, 0x1022, 0x415, 0x1036, 0x102A, 0xC00}, - .speechAfter = {0xC2F, 0x1E19, 0x1021, 0x2017, 0x628, 0xC00}, - .mons = - { - [0] = - { - .species = SPECIES_SALAMENCE, - .heldItem = ITEM_SHELL_BELL, - .moves = {MOVE_ROCK_SLIDE, MOVE_FLAMETHROWER, MOVE_DRAGON_CLAW, MOVE_AERIAL_ACE}, - .level = 0, - .ppBonuses = 0, - .attackEV = 255, - .spAttackEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0x95, - .nickname = _("SALAMENCE"), - .friendship = 255, - }, - [1] = - { - .species = SPECIES_GENGAR, - .heldItem = ITEM_LUM_BERRY, - .moves = {MOVE_PSYCHIC, MOVE_GIGA_DRAIN, MOVE_WILL_O_WISP, MOVE_DESTINY_BOND}, - .level = 0, - .ppBonuses = 0, - .speedEV = 255, - .spAttackEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0x8C, - .nickname = _("GENGAR"), - .friendship = 255, - }, - [2] = - { - .species = SPECIES_GYARADOS, - .heldItem = ITEM_BRIGHT_POWDER, - .moves = {MOVE_DRAGON_DANCE, MOVE_HYPER_BEAM, MOVE_BITE, MOVE_EARTHQUAKE}, - .level = 0, - .ppBonuses = 0, - .attackEV = 255, - .speedEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0x3, - .nickname = _("GYARADOS"), - .friendship = 255, - }, - [3] = - { - .species = SPECIES_GENGAR, - .heldItem = ITEM_SALAC_BERRY, - .moves = {MOVE_EXPLOSION, MOVE_MEAN_LOOK, MOVE_SHADOW_BALL, MOVE_CONFUSE_RAY}, - .level = 0, - .ppBonuses = 0, - .attackEV = 255, - .speedEV = 255, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0x3, - .nickname = _("GENGAR"), - .friendship = 255, - }, - [4] = - { - .species = SPECIES_DUSCLOPS, - .heldItem = ITEM_LEFTOVERS, - .moves = {MOVE_MEAN_LOOK, MOVE_CONFUSE_RAY, MOVE_WILL_O_WISP, MOVE_SHADOW_BALL}, - .level = 0, - .ppBonuses = 0, - .hpEV = 110, - .defenseEV = 200, - .spDefenseEV = 200, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0x14, - .nickname = _("DUSCLOPS"), - .friendship = 255, - }, - [5] = - { - .species = SPECIES_MISDREAVUS, - .heldItem = ITEM_FOCUS_BAND, - .moves = {MOVE_MEAN_LOOK, MOVE_CONFUSE_RAY, MOVE_PERISH_SONG, MOVE_SHADOW_BALL}, - .level = 0, - .ppBonuses = 0, - .hpEV = 180, - .defenseEV = 180, - .spDefenseEV = 150, - .otId = TRAINER_HILL_OTID, - .hpIV = 31, - .attackIV = 31, - .defenseIV = 31, - .speedIV = 31, - .spAttackIV = 31, - .spDefenseIV = 31, - .altAbility = 0, - .personality = 0x85, - .nickname = _("MISDREAVUS"), - .friendship = 255, - }, - }, - }, - }, - .data = {0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x39, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x8, 0x96, 0xFB, 0xF6, 0xFD, 0xF6, 0xF6, 0xFB, 0x46, 0xFB, 0xF6, 0xF6, 0xFD, 0xF6, 0xFB, 0x9B, 0x8, 0xFB, 0x9B, 0xFB, 0xF6, 0xFB, 0xFB, 0xFB, 0x46, 0xFB, 0xFB, 0xFB, 0xF6, 0xFB, 0x9B, 0xFB, 0x8, 0xF6, 0xFB, 0x9B, 0xFB, 0xFB, 0x46, 0x46, 0x9B, 0x46, 0x46, 0xFB, 0xFB, 0x9B, 0xFB, 0xF6, 0x8, 0xFD, 0xF6, 0xFB, 0x9B, 0x46, 0x36, 0x36, 0x9B, 0x36, 0x36, 0x46, 0x9B, 0xFB, 0xF6, 0xFD, 0x8, 0xF6, 0xFB, 0xFB, 0x46, 0x9B, 0x46, 0x46, 0xDB, 0x46, 0x46, 0x9B, 0x46, 0xFB, 0xFB, 0xF6, 0x8, 0xF6, 0xFB, 0x46, 0x36, 0x46, 0x9B, 0xDB, 0xD6, 0xDB, 0x9B, 0x46, 0x36, 0x46, 0xFB, 0xF6, 0x8, 0xFB, 0xFB, 0x46, 0x36, 0x9B, 0xDB, 0xD6, 0xD6, 0xD6, 0xDB, 0x9B, 0x36, 0x46, 0xFB, 0xFB, 0x8, 0x96, 0x9B, 0x9B, 0x9B, 0x9B, 0xD6, 0xD6, 0x96, 0xD6, 0xD6, 0xDB, 0x9B, 0x9B, 0x9B, 0x96, 0x8, 0xFB, 0xFB, 0x46, 0x36, 0x9B, 0xDB, 0xD6, 0xD6, 0xD6, 0xDB, 0x9B, 0x36, 0x46, 0xFB, 0xFB, 0x8, 0xF6, 0xFB, 0x46, 0x36, 0x46, 0x9B, 0xDB, 0xD6, 0xDB, 0x9B, 0x46, 0x36, 0x46, 0xFB, 0xF6, 0x8, 0xF6, 0xFB, 0xFB, 0x46, 0x9B, 0x46, 0x46, 0xDB, 0x46, 0x46, 0x9B, 0x46, 0xFB, 0xFB, 0xF6, 0x8, 0xFD, 0xF6, 0xFB, 0x9B, 0x46, 0x36, 0x36, 0x9B, 0x36, 0x36, 0x46, 0x9B, 0xFB, 0xF6, 0xFD, 0x8, 0xF6, 0xFB, 0x9B, 0xFB, 0xFB, 0x46, 0x46, 0x9B, 0x46, 0x46, 0xFB, 0xFB, 0x9B, 0xFB, 0xF6, 0x8, 0xFB, 0x9B, 0xFB, 0xF6, 0xFB, 0xFB, 0xFB, 0x46, 0xFB, 0xFB, 0xFB, 0xF6, 0xFB, 0x9B, 0xFB, 0x8, 0x96, 0xFB, 0xF6, 0xFD, 0xF6, 0xF6, 0xFB, 0x46, 0xFB, 0xF6, 0xF6, 0xFD, 0xF6, 0xFB, 0x9B, 0x8}, - .unk3A0 = {0x381, 0x101, 0x101, 0x6C1, 0x821, 0x16D1, 0x2829, 0x2009, 0x1, 0x2009, 0x2829, 0x16D1, 0x821, 0x6C1, 0x101, 0x101}, - .coords = {103, 167}, - .direction = 0x1, - .range = 0x33, - }, - }, + .unkField_0 = 8, + .unused1 = 1, + .unkField_2 = 4, + .unused3 = 0, + .unused4 = 63, + .unused5 = 31, + .unused6 = 6, + .floors = + { + [0] = + { + .unk0 = 0x39, + .unk1 = 0x3A, + .trainers = + { + [0] = + { + .name = _("ALFRED"), + .facilityClass = FACILITY_CLASS_COOLTRAINER_M, + .unused = 0, + .speechBefore = {EC_WORD_WE, EC_WORD_CAN, EC_WORD_TAKE, EC_WORD_ON, EC_WORD_ANY, EC_WORD_TYPE}, + .speechWin = {EC_WORD_WE, EC_WORD_DID, EC_WORD_BETTER, EC_WORD_THAN, EC_WORD_OKAY, EC_WORD_EXCL}, + .speechLose = {EC_WORD_OUR, EC_WORD_STRATEGY, EC_WORD_ISN_T, EC_WORD_ANY, EC_WORD_GOOD, EC_WORD_ELLIPSIS}, + .speechAfter = {EC_WORD_WE, EC_WORD_NEED, EC_WORD_TO, EC_WORD_TRAIN, EC_WORD_A_LOT, EC_WORD_MORE}, + .mons = + { + [0] = + { + .species = SPECIES_SNORLAX, + .heldItem = ITEM_QUICK_CLAW, + .moves = {MOVE_MEGA_KICK, MOVE_SHADOW_BALL, MOVE_BRICK_BREAK, MOVE_EARTHQUAKE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .attackEV = 252, + .defenseEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x35, + .nickname = _("SNORLAX"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_MILTANK, + .heldItem = ITEM_LEFTOVERS, + .moves = {MOVE_DOUBLE_EDGE, MOVE_SHADOW_BALL, MOVE_ATTRACT, MOVE_MILK_DRINK}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .attackEV = 252, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x3, + .nickname = _("MILTANK"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_URSARING, + .heldItem = ITEM_QUICK_CLAW, + .moves = {MOVE_DOUBLE_EDGE, MOVE_CRUNCH, MOVE_BRICK_BREAK, MOVE_AERIAL_ACE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .attackEV = 252, + .spAttackEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x7F, + .nickname = _("URSARING"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_SLAKING, + .heldItem = ITEM_CHESTO_BERRY, + .moves = {MOVE_HYPER_BEAM, MOVE_SHADOW_BALL, MOVE_BRICK_BREAK, MOVE_REST}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .attackEV = 252, + .spDefenseEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x80, + .nickname = _("SLAKING"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_KANGASKHAN, + .heldItem = ITEM_LEFTOVERS, + .moves = {MOVE_MEGA_KICK, MOVE_SHADOW_BALL, MOVE_ATTRACT, MOVE_FAKE_OUT}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .attackEV = 252, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x3, + .nickname = _("KANGASKHAN"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_ZANGOOSE, + .heldItem = ITEM_SCOPE_LENS, + .moves = {MOVE_CRUSH_CLAW, MOVE_SHADOW_BALL, MOVE_BRICK_BREAK, MOVE_ROAR}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .attackEV = 252, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x80, + .nickname = _("ZANGOOSE"), + .friendship = 255, + }, + }, + }, + [1] = + { + .name = _("EDIE"), + .facilityClass = FACILITY_CLASS_PSYCHIC_F, + .unused = 0, + .speechBefore = {EC_WORD_WE, EC_WORD_WILL_BE_HERE, EC_WORD_FOR, EC_WORD_ANY, EC_WORD_TRAINER, EC_WORD_CHALLENGE}, + .speechWin = {EC_WORD_MY, EC_WORD_STRATEGY, EC_WORD_WORKS, EC_WORD_TO, EC_WORD_PERFECTION, EC_WORD_EXCL}, + .speechLose = {EC_WORD_NO, EC_WORD_NO, EC_WORD_ELLIPSIS, EC_WORD_THAT, EC_WORD_WON_T, EC_WORD_DO}, + .speechAfter = {EC_WORD_THERE, EC_WORD_SHOULD, EC_WORD_BE, EC_WORD_A, EC_WORD_TRAINER, EC_WORD_SCHOOL}, + .mons = + { + [0] = + { + .species = SPECIES_SLOWKING, + .heldItem = ITEM_LEFTOVERS, + .moves = {MOVE_PSYCHIC, MOVE_SURF, MOVE_ICE_BEAM, MOVE_SKILL_SWAP}, + .level = 0, + .ppBonuses = 0, + .hpEV = 200, + .defenseEV = 110, + .spAttackEV = 200, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 1, + .personality = 0xF, + .nickname = _("SLOWKING"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_ESPEON, + .heldItem = ITEM_LUM_BERRY, + .moves = {MOVE_PSYCHIC, MOVE_BITE, MOVE_CALM_MIND, MOVE_REFLECT}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .speedEV = 252, + .spAttackEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x28, + .nickname = _("ESPEON"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_STARMIE, + .heldItem = ITEM_SHELL_BELL, + .moves = {MOVE_PSYCHIC, MOVE_SURF, MOVE_THUNDERBOLT, MOVE_ICE_BEAM}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .speedEV = 252, + .spAttackEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 1, + .personality = 0xF, + .nickname = _("STARMIE"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_GENGAR, + .heldItem = ITEM_LUM_BERRY, + .moves = {MOVE_PSYCHIC, MOVE_THUNDERBOLT, MOVE_FIRE_PUNCH, MOVE_ICE_PUNCH}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .speedEV = 252, + .spAttackEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0xF, + .nickname = _("GENGAR"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_GARDEVOIR, + .heldItem = ITEM_SALAC_BERRY, + .moves = {MOVE_PSYCHIC, MOVE_THUNDERBOLT, MOVE_MAGICAL_LEAF, MOVE_DESTINY_BOND}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .speedEV = 252, + .spAttackEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0xF, + .nickname = _("GARDEVOIR"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_ALAKAZAM, + .heldItem = ITEM_LUM_BERRY, + .moves = {MOVE_PSYCHIC, MOVE_RECOVER, MOVE_THUNDER_WAVE, MOVE_ATTRACT}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .speedEV = 252, + .spAttackEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0xF, + .nickname = _("ALAKAZAM"), + .friendship = 255, + }, + }, + }, + }, + .data = {0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x1B, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x8, 0x31, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x2C, 0x39, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x3B, 0x3B, 0x8, 0x31, 0x3B, 0x8, 0x8, 0x8, 0x8, 0x8, 0x3B, 0x8, 0x8, 0x8, 0x8, 0x8, 0x3B, 0x3B, 0x8, 0x69, 0x73, 0x8, 0x4D, 0x4D, 0x4D, 0x4D, 0xD1, 0x4D, 0x4D, 0x4D, 0x4D, 0x8, 0x69, 0x73, 0x8, 0x40, 0x3B, 0x8, 0x55, 0x55, 0x55, 0x55, 0xD1, 0x55, 0x55, 0x55, 0x55, 0x8, 0x31, 0x41, 0x8, 0x69, 0x41, 0x8, 0xC5, 0xD9, 0xD9, 0xD9, 0x9A, 0xD9, 0xD9, 0xD9, 0xC6, 0x8, 0x41, 0x73, 0x8, 0x69, 0x3B, 0x8, 0xD4, 0xDB, 0x9B, 0x73, 0x73, 0x73, 0x9B, 0xDB, 0xCC, 0x8, 0x31, 0x73, 0x8, 0x69, 0x3B, 0x8, 0xCD, 0x9B, 0x73, 0x73, 0x44, 0x73, 0x73, 0x9B, 0xD5, 0x8, 0x31, 0x73, 0x8, 0x69, 0x3B, 0x8, 0xD4, 0xDB, 0x9B, 0x73, 0x73, 0x73, 0x9B, 0xDB, 0xCC, 0x8, 0x31, 0x73, 0x8, 0x69, 0x41, 0x8, 0xD1, 0xDB, 0xDB, 0xDB, 0x9B, 0xDB, 0xDB, 0xDB, 0xDB, 0x8, 0x41, 0x73, 0x8, 0x40, 0x3B, 0x8, 0x8, 0xC7, 0xC7, 0xDB, 0xDB, 0xDB, 0xC7, 0xC7, 0x8, 0x8, 0x31, 0x41, 0x8, 0x69, 0x3B, 0x4D, 0x4D, 0x67, 0x67, 0xDB, 0xDB, 0xDB, 0x67, 0x67, 0x4D, 0x4D, 0x31, 0x73, 0x8, 0x69, 0x3B, 0x55, 0x55, 0xD7, 0xD7, 0xD1, 0xDB, 0xDB, 0xD7, 0xD7, 0x55, 0x55, 0x31, 0x73, 0x8, 0x69, 0x3B, 0x39, 0x39, 0x39, 0x39, 0x3A, 0x3B, 0x3B, 0x39, 0x39, 0x39, 0x39, 0x3A, 0x73, 0x8, 0x69, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x73, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8}, + .unk3A0 = {0x381, 0x201, 0x3EF9, 0x3EF9, 0x3EF9, 0x2009, 0x3019, 0x2009, 0x3019, 0x2009, 0x3019, 0x3019, 0x3C79, 0x1, 0x1, 0xFFFF}, + .coords = {116, 122}, + .direction = 0x23, + .range = 0x55, + }, + [1] = + { + .unk0 = 0x3B, + .unk1 = 0x3C, + .trainers = + { + [0] = + { + .name = _("RODERICK"), + .facilityClass = FACILITY_CLASS_COOLTRAINER_M, + .unused = 0, + .speechBefore = {EC_WORD_I, EC_WORD_CAN, EC_WORD_WIN, EC_WORD_WITHOUT, EC_WORD_A, EC_MOVE2(HELPING_HAND)}, + .speechWin = {EC_WORD_IT_S, EC_WORD_ONLY, EC_WORD_NATURAL, EC_WORD_THAT, EC_WORD_I, EC_WORD_WIN}, + .speechLose = {EC_WORD_LOSING, EC_WORD_HAS, EC_WORD_ME, EC_WORD_FEELING, EC_WORD_SMALL, EC_WORD_ELLIPSIS}, + .speechAfter = {EC_WORD_YOU, EC_WORD_HAVE, EC_WORD_A, EC_WORD_GOOD, EC_WORD_TEACHER, EC_WORD_QUES}, + .mons = + { + [0] = + { + .species = SPECIES_SWELLOW, + .heldItem = ITEM_LEFTOVERS, + .moves = {MOVE_AERIAL_ACE, MOVE_AGILITY, MOVE_FACADE, MOVE_ATTRACT}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .attackEV = 252, + .spDefenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x3, + .nickname = _("SWELLOW"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_MACHAMP, + .heldItem = ITEM_LEFTOVERS, + .moves = {MOVE_LOW_KICK, MOVE_ROCK_SLIDE, MOVE_FACADE, MOVE_ATTRACT}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .attackEV = 252, + .spDefenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x3, + .nickname = _("MACHAMP"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_URSARING, + .heldItem = ITEM_LEFTOVERS, + .moves = {MOVE_PROTECT, MOVE_ROCK_SLIDE, MOVE_FACADE, MOVE_ATTRACT}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .attackEV = 252, + .spDefenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x3, + .nickname = _("URSARING"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_KINGLER, + .heldItem = ITEM_PERSIM_BERRY, + .moves = {MOVE_RETURN, MOVE_PROTECT, MOVE_CRABHAMMER, MOVE_ATTRACT}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .attackEV = 252, + .spDefenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x80, + .nickname = _("KINGLER"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_TYRANITAR, + .heldItem = ITEM_PERSIM_BERRY, + .moves = {MOVE_ROCK_SLIDE, MOVE_CRUNCH, MOVE_EARTHQUAKE, MOVE_ATTRACT}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .attackEV = 252, + .defenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x80, + .nickname = _("TYRANITAR"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_DRAGONITE, + .heldItem = ITEM_PERSIM_BERRY, + .moves = {MOVE_BODY_SLAM, MOVE_THUNDER_WAVE, MOVE_EARTHQUAKE, MOVE_ATTRACT}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .attackEV = 252, + .spDefenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x80, + .nickname = _("DRAGONITE"), + .friendship = 255, + }, + }, + }, + [1] = + { + .name = _("ALICIA"), + .facilityClass = FACILITY_CLASS_COOLTRAINER_F, + .unused = 0, + .speechBefore = {EC_WORD_I, EC_WORD_DON_T, EC_WORD_NEED, EC_WORD_A, EC_MOVE2(HELPING_HAND), EC_WORD_EXCL}, + .speechWin = {EC_WORD_SORRY, EC_WORD_EXCL, EC_WORD_TOO, EC_WORD_BAD, EC_WORD_FOR, EC_WORD_YOU}, + .speechLose = {EC_WORD_WHAT, EC_WORD_AN, EC_WORD_UNBELIEVABLE, EC_MOVE2(STRUGGLE), EC_WORD_THAT_WAS, EC_WORD_EXCL}, + .speechAfter = {EC_WORD_I, EC_WORD_CAN, EC_WORD_BE, EC_WORD_YOUR, EC_WORD_POKEMON, EC_WORD_TEACHER}, + .mons = + { + [0] = + { + .species = SPECIES_JOLTEON, + .heldItem = ITEM_BRIGHT_POWDER, + .moves = {MOVE_THUNDERBOLT, MOVE_THUNDER_WAVE, MOVE_ATTRACT, MOVE_SWAGGER}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .speedEV = 252, + .spAttackEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0xA, + .nickname = _("JOLTEON"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_ALAKAZAM, + .heldItem = ITEM_KINGS_ROCK, + .moves = {MOVE_PSYCHIC, MOVE_ICE_PUNCH, MOVE_ATTRACT, MOVE_SWAGGER}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .speedEV = 252, + .spAttackEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0xA, + .nickname = _("ALAKAZAM"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_STARMIE, + .heldItem = ITEM_SCOPE_LENS, + .moves = {MOVE_SURF, MOVE_PSYCHIC, MOVE_CONFUSE_RAY, MOVE_SWAGGER}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .speedEV = 252, + .spAttackEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 1, + .personality = 0xA, + .nickname = _("STARMIE"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_DUSCLOPS, + .heldItem = ITEM_LEFTOVERS, + .moves = {MOVE_PURSUIT, MOVE_PROTECT, MOVE_ATTRACT, MOVE_WILL_O_WISP}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .defenseEV = 252, + .spDefenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x82, + .nickname = _("DUSCLOPS"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_NINETALES, + .heldItem = ITEM_WHITE_HERB, + .moves = {MOVE_OVERHEAT, MOVE_CONFUSE_RAY, MOVE_WILL_O_WISP, MOVE_ATTRACT}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .speedEV = 252, + .spAttackEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0xD2, + .nickname = _("NINETALES"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_BANETTE, + .heldItem = ITEM_FOCUS_BAND, + .moves = {MOVE_SHADOW_BALL, MOVE_FAINT_ATTACK, MOVE_ATTRACT, MOVE_WILL_O_WISP}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .defenseEV = 252, + .spDefenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x85, + .nickname = _("BANETTE"), + .friendship = 255, + }, + }, + }, + }, + .data = {0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x38, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x8, 0x91, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x78, 0x8, 0x91, 0x46, 0x9B, 0x7C, 0x9B, 0x9B, 0x9B, 0x7D, 0x9B, 0x7C, 0x9B, 0x7B, 0x9B, 0x7A, 0x9B, 0x8, 0x91, 0x46, 0x7D, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x8, 0x91, 0x46, 0x9B, 0x7E, 0x9B, 0x9B, 0x9B, 0x7D, 0x9B, 0x7E, 0x9B, 0xB3, 0x9B, 0x9B, 0x9B, 0x8, 0x91, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x9B, 0x8, 0x91, 0x46, 0x9B, 0x7D, 0x9B, 0x7C, 0x9B, 0x7B, 0x9B, 0x7A, 0x9B, 0x7C, 0x9B, 0x9B, 0x9B, 0x8, 0x91, 0x46, 0x9B, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x8, 0x91, 0x46, 0x9B, 0x7C, 0x9B, 0x7D, 0x9B, 0x7E, 0x9B, 0x9B, 0x9B, 0x7D, 0x9B, 0x7E, 0x9B, 0x8, 0x91, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0x46, 0xB3, 0x8, 0x91, 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0xDB, 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0x9B, 0x8, 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0xDB, 0xDB, 0xDB, 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0x8, 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0x8, 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0xDB, 0xDB, 0xDB, 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0x8, 0x91, 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0xDB, 0xD6, 0x96, 0x9B, 0x9B, 0x96, 0xD6, 0x9B, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8}, + .unk3A0 = {0x381, 0x7FFD, 0x4001, 0x5FFF, 0x4001, 0x7FFD, 0x4001, 0x5FFF, 0x4001, 0x7FFD, 0x1, 0x1, 0x1, 0x1, 0x1, 0xFFFF}, + .coords = {167, 231}, + .direction = 0x1, + .range = 0x33, + }, + [2] = + { + .unk0 = 0x3D, + .unk1 = 0x3E, + .trainers = + { + [0] = + { + .name = _("TERRENCE"), + .facilityClass = FACILITY_CLASS_EXPERT_M, + .unused = 0, + .speechBefore = {EC_WORD_OH_DEAR, EC_WORD_THIS, EC_WORD_MATCH, EC_WORD_IS, EC_WORD_FOR, EC_WORD_YOU}, + .speechWin = {EC_WORD_OH_DEAR, EC_WORD_DID, EC_WORD_YOU, EC_WORD_SEE, EC_WORD_THAT, EC_WORD_QUES}, + .speechLose = {EC_WORD_OH_DEAR, EC_WORD_I_AM, EC_WORD_SO, EC_WORD_SORRY, 0xFFFF, 0xFFFF}, + .speechAfter = {EC_WORD_IS, EC_WORD_YOUR, EC_WORD_GRANDMOTHER, EC_WORD_STRONG, EC_WORD_QUES, 0xFFFF}, + .mons = + { + [0] = + { + .species = SPECIES_WOBBUFFET, + .heldItem = ITEM_LEFTOVERS, + .moves = {MOVE_MIRROR_COAT, MOVE_COUNTER, MOVE_SAFEGUARD, MOVE_ENCORE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 250, + .defenseEV = 130, + .spDefenseEV = 130, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x94, + .nickname = _("WOBBUFFET"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_EXPLOUD, + .heldItem = ITEM_CHESTO_BERRY, + .moves = {MOVE_HYPER_VOICE, MOVE_COUNTER, MOVE_REST, MOVE_ROCK_SLIDE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 250, + .defenseEV = 130, + .spDefenseEV = 130, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x85, + .nickname = _("EXPLOUD"), + .friendship = 0, + }, + [2] = + { + .species = SPECIES_CROBAT, + .heldItem = ITEM_KINGS_ROCK, + .moves = {MOVE_MEAN_LOOK, MOVE_CONFUSE_RAY, MOVE_AERIAL_ACE, MOVE_TOXIC}, + .level = 0, + .ppBonuses = 0, + .hpEV = 250, + .defenseEV = 130, + .spDefenseEV = 130, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x0, + .nickname = _("CROBAT"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_DUGTRIO, + .heldItem = ITEM_BRIGHT_POWDER, + .moves = {MOVE_DOUBLE_TEAM, MOVE_PROTECT, MOVE_RETURN, MOVE_SLUDGE_BOMB}, + .level = 0, + .ppBonuses = 0, + .hpEV = 6, + .attackEV = 252, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 1, + .personality = 0xD, + .nickname = _("DUGTRIO"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_ELECTRODE, + .heldItem = ITEM_PETAYA_BERRY, + .moves = {MOVE_TORMENT, MOVE_MIRROR_COAT, MOVE_THUNDERBOLT, MOVE_LIGHT_SCREEN}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .defenseEV = 252, + .spAttackEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x5, + .nickname = _("ELECTRODE"), + .friendship = 0, + }, + [5] = + { + .species = SPECIES_GENGAR, + .heldItem = ITEM_FOCUS_BAND, + .moves = {MOVE_CONFUSE_RAY, MOVE_MEAN_LOOK, MOVE_GIGA_DRAIN, MOVE_WILL_O_WISP}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .speedEV = 252, + .spDefenseEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x14, + .nickname = _("GENGAR"), + .friendship = 255, + }, + }, + }, + [1] = + { + .name = _("CARLOTTA"), + .facilityClass = FACILITY_CLASS_EXPERT_F, + .unused = 0, + .speechBefore = {EC_WORD_OH_DEAR, EC_WORD_I, EC_WORD_WILL, EC_WORD_WIN, EC_WORD_FOR, EC_WORD_YOU}, + .speechWin = {EC_WORD_OH_DEAR, EC_WORD_WE, EC_WORD_HAVE, EC_WORD_A, EC_WORD_PARTY, EC_WORD_LATER}, + .speechLose = {EC_WORD_OH_DEAR, EC_WORD_I_AM, EC_WORD_SORRY, EC_WORD_TO, EC_WORD_DISAPPOINT, EC_WORD_YOU}, + .speechAfter = {EC_WORD_IS, EC_WORD_YOUR, EC_WORD_GRANDFATHER, EC_WORD_COOL, EC_WORD_QUES, 0xFFFF}, + .mons = + { + [0] = + { + .species = SPECIES_LAPRAS, + .heldItem = ITEM_QUICK_CLAW, + .moves = {MOVE_SURF, MOVE_ICE_BEAM, MOVE_PERISH_SONG, MOVE_SING}, + .level = 0, + .ppBonuses = 0, + .hpEV = 250, + .defenseEV = 130, + .spDefenseEV = 130, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x82, + .nickname = _("LAPRAS"), + .friendship = 0, + }, + [1] = + { + .species = SPECIES_ABSOL, + .heldItem = ITEM_FOCUS_BAND, + .moves = {MOVE_PERISH_SONG, MOVE_DOUBLE_EDGE, MOVE_PROTECT, MOVE_TORMENT}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .defenseEV = 6, + .speedEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x8A, + .nickname = _("ABSOL"), + .friendship = 0, + }, + [2] = + { + .species = SPECIES_ALTARIA, + .heldItem = ITEM_KINGS_ROCK, + .moves = {MOVE_PERISH_SONG, MOVE_PROTECT, MOVE_DRAGON_CLAW, MOVE_FIRE_BLAST}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .spAttackEV = 6, + .spDefenseEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x0, + .nickname = _("ALTARIA"), + .friendship = 0, + }, + [3] = + { + .species = SPECIES_DEWGONG, + .heldItem = ITEM_CHESTO_BERRY, + .moves = {MOVE_ICE_BEAM, MOVE_SIGNAL_BEAM, MOVE_REST, MOVE_PERISH_SONG}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .speedEV = 252, + .spAttackEV = 6, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x14, + .nickname = _("DEWGONG"), + .friendship = 0, + }, + [4] = + { + .species = SPECIES_POLITOED, + .heldItem = ITEM_BRIGHT_POWDER, + .moves = {MOVE_HYDRO_PUMP, MOVE_BLIZZARD, MOVE_MIND_READER, MOVE_PERISH_SONG}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .spAttackEV = 6, + .spDefenseEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 1, + .personality = 0x14, + .nickname = _("POLITOED"), + .friendship = 0, + }, + [5] = + { + .species = SPECIES_MAROWAK, + .heldItem = ITEM_QUICK_CLAW, + .moves = {MOVE_PERISH_SONG, MOVE_EARTHQUAKE, MOVE_COUNTER, MOVE_PROTECT}, + .level = 0, + .ppBonuses = 0, + .hpEV = 252, + .speedEV = 6, + .spDefenseEV = 252, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 1, + .personality = 0x17, + .nickname = _("MAROWAK"), + .friendship = 0, + }, + }, + }, + }, + .data = {0xD1, 0xDB, 0xDB, 0xDB, 0xD9, 0xD9, 0x1B, 0x14, 0x15, 0x98, 0x99, 0x9A, 0x9B, 0x9B, 0x9B, 0x8, 0xD1, 0xDB, 0xDB, 0xDB, 0xD5, 0xD5, 0xC3, 0xF9, 0x86, 0x8E, 0x95, 0x9B, 0x9B, 0x9B, 0x9B, 0x8, 0xD1, 0xDB, 0xDB, 0xD5, 0xCB, 0xCB, 0xCB, 0xFB, 0x8B, 0x8B, 0x8B, 0x95, 0x9B, 0x9B, 0x9B, 0x8, 0xD1, 0xDB, 0xD5, 0xCB, 0xCB, 0xCB, 0xCB, 0xFB, 0x8B, 0x8B, 0x8B, 0x8B, 0x95, 0x9B, 0x9B, 0x8, 0xD1, 0xDB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xFB, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x9B, 0x9B, 0x8, 0xD1, 0xD5, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xFB, 0x8C, 0x8B, 0x8B, 0x8B, 0x8B, 0x95, 0x9B, 0x8, 0xD1, 0xCB, 0xCB, 0xCB, 0xCB, 0xCC, 0xCC, 0xFB, 0xFB, 0x8C, 0x8B, 0x8B, 0x8B, 0x8B, 0x9B, 0x8, 0xD1, 0xCC, 0xCC, 0xCC, 0xCC, 0xFB, 0xF5, 0xFB, 0xF5, 0xFB, 0x8B, 0x8B, 0x8B, 0x8B, 0x9B, 0x8, 0xD1, 0xD5, 0xD5, 0xD5, 0xD5, 0xFB, 0xEC, 0xFB, 0xEC, 0xFB, 0x8B, 0x8B, 0x8B, 0x8B, 0x9B, 0x8, 0xD1, 0xCB, 0xCB, 0xCB, 0xCB, 0xF5, 0xF5, 0xFB, 0xFB, 0xF5, 0x8B, 0x8B, 0x8B, 0x8B, 0x9B, 0x8, 0xD1, 0xCC, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xFB, 0xFB, 0x8B, 0x8B, 0x8B, 0x8B, 0x8C, 0x9B, 0x8, 0xD1, 0xDB, 0xCB, 0xCB, 0xCB, 0xCB, 0xCB, 0xFB, 0xF5, 0x8B, 0x8B, 0x8B, 0x8B, 0x9B, 0x9B, 0x8, 0xD1, 0xDB, 0xCC, 0xCB, 0xCB, 0xCB, 0xCB, 0xFB, 0x8B, 0x8B, 0x8B, 0x8B, 0x8C, 0x9B, 0x9B, 0x8, 0xD1, 0xDB, 0xDB, 0xCC, 0xCB, 0xCB, 0xCB, 0xFB, 0x8B, 0x8B, 0x8B, 0x8C, 0x9B, 0x9B, 0x9B, 0x8, 0xD1, 0xDB, 0xDB, 0xDB, 0xCC, 0xCC, 0xCB, 0xFB, 0x8C, 0x8C, 0x8C, 0x9B, 0x9B, 0x9B, 0x9B, 0x8, 0xD1, 0xDB, 0xDB, 0xDB, 0xDB, 0xDB, 0xCC, 0xFB, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x8}, + .unk3A0 = {0x381, 0x201, 0xEE1, 0x1EF1, 0x3EF9, 0x3EF9, 0x7E7D, 0x783D, 0x2BD, 0x783D, 0x7E7D, 0x3E79, 0x3EF9, 0x1EF1, 0xEE1, 0x201}, + .coords = {103, 167}, + .direction = 0x1, + .range = 0x33, + }, + [3] = + { + .unk0 = 0x3F, + .unk1 = 0x40, + .trainers = + { + [0] = + { + .name = _("NORA"), + .facilityClass = FACILITY_CLASS_PKMN_RANGER_F, + .unused = 0, + .speechBefore = {EC_WORD_WAAAH, EC_WORD_THIS, EC_WORD_IS, EC_WORD_SO, EC_WORD_EXCITING, EC_WORD_EXCL}, + .speechWin = {EC_WORD_WAAAH, EC_WORD_I_AM, EC_WORD_SO, EC_WORD_HAPPY, EC_WORD_I, EC_WORD_WON}, + .speechLose = {EC_WORD_WAAAH, EC_WORD_I_AM, EC_WORD_SO, EC_WORD_SAD, EC_WORD_I, EC_WORD_LOST}, + .speechAfter = {EC_WORD_WAAAH, EC_WORD_EXCL, 0xFFFF, EC_WORD_GO, EC_WORD_AWAY, EC_WORD_EXCL}, + .mons = + { + [0] = + { + .species = SPECIES_FORRETRESS, + .heldItem = ITEM_QUICK_CLAW, + .moves = {MOVE_EXPLOSION, MOVE_EARTHQUAKE, MOVE_ATTRACT, MOVE_SPIKES}, + .level = 0, + .ppBonuses = 0, + .hpEV = 110, + .attackEV = 200, + .spDefenseEV = 200, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x3, + .nickname = _("FORRETRESS"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_ELECTRODE, + .heldItem = ITEM_SALAC_BERRY, + .moves = {MOVE_EXPLOSION, MOVE_THUNDERBOLT, MOVE_SWIFT, MOVE_LIGHT_SCREEN}, + .level = 0, + .ppBonuses = 0, + .attackEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 1, + .personality = 0xC, + .nickname = _("ELECTRODE"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_EXEGGUTOR, + .heldItem = ITEM_SHELL_BELL, + .moves = {MOVE_EXPLOSION, MOVE_HYPNOSIS, MOVE_PSYCHIC, MOVE_SOLAR_BEAM}, + .level = 0, + .ppBonuses = 0, + .attackEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x7F, + .nickname = _("EXEGGUTOR"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_DUSCLOPS, + .heldItem = ITEM_LEFTOVERS, + .moves = {MOVE_IMPRISON, MOVE_PROTECT, MOVE_ICE_BEAM, MOVE_EARTHQUAKE}, + .level = 0, + .ppBonuses = 0, + .hpEV = 110, + .defenseEV = 200, + .spDefenseEV = 200, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x93, + .nickname = _("DUSCLOPS"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_NINETALES, + .heldItem = ITEM_WHITE_HERB, + .moves = {MOVE_IMPRISON, MOVE_PROTECT, MOVE_OVERHEAT, MOVE_CONFUSE_RAY}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0xF, + .nickname = _("NINETALES"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_BANETTE, + .heldItem = ITEM_BRIGHT_POWDER, + .moves = {MOVE_IMPRISON, MOVE_PROTECT, MOVE_THUNDERBOLT, MOVE_THUNDER}, + .level = 0, + .ppBonuses = 0, + .hpEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x96, + .nickname = _("BANETTE"), + .friendship = 255, + }, + }, + }, + [1] = + { + .name = _("GAV"), + .facilityClass = FACILITY_CLASS_PKMN_RANGER_M, + .unused = 0, + .speechBefore = {EC_WORD_WAHAHAHA, EC_WORD_YOU, EC_WORD_CAN_T, EC_WORD_STOP, EC_WORD_ME, EC_WORD_EXCL}, + .speechWin = {EC_WORD_WOWEE, EC_WORD_EXCL, 0xFFFF, EC_WORD_I_AM, EC_WORD_AWESOME, EC_WORD_COOL}, + .speechLose = {EC_WORD_I_AM, EC_WORD_NOT, EC_WORD_COOL, EC_WORD_AT, EC_WORD_ALL, EC_WORD_EXCL}, + .speechAfter = {EC_WORD_HEHEHE, EC_WORD_THAT_WAS, EC_WORD_AN, EC_WORD_AWESOME, EC_WORD_BATTLE, EC_WORD_EXCL}, + .mons = + { + [0] = + { + .species = SPECIES_SALAMENCE, + .heldItem = ITEM_SHELL_BELL, + .moves = {MOVE_ROCK_SLIDE, MOVE_FLAMETHROWER, MOVE_DRAGON_CLAW, MOVE_AERIAL_ACE}, + .level = 0, + .ppBonuses = 0, + .attackEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x95, + .nickname = _("SALAMENCE"), + .friendship = 255, + }, + [1] = + { + .species = SPECIES_GENGAR, + .heldItem = ITEM_LUM_BERRY, + .moves = {MOVE_PSYCHIC, MOVE_GIGA_DRAIN, MOVE_WILL_O_WISP, MOVE_DESTINY_BOND}, + .level = 0, + .ppBonuses = 0, + .speedEV = 255, + .spAttackEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x8C, + .nickname = _("GENGAR"), + .friendship = 255, + }, + [2] = + { + .species = SPECIES_GYARADOS, + .heldItem = ITEM_BRIGHT_POWDER, + .moves = {MOVE_DRAGON_DANCE, MOVE_HYPER_BEAM, MOVE_BITE, MOVE_EARTHQUAKE}, + .level = 0, + .ppBonuses = 0, + .attackEV = 255, + .speedEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x3, + .nickname = _("GYARADOS"), + .friendship = 255, + }, + [3] = + { + .species = SPECIES_GENGAR, + .heldItem = ITEM_SALAC_BERRY, + .moves = {MOVE_EXPLOSION, MOVE_MEAN_LOOK, MOVE_SHADOW_BALL, MOVE_CONFUSE_RAY}, + .level = 0, + .ppBonuses = 0, + .attackEV = 255, + .speedEV = 255, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x3, + .nickname = _("GENGAR"), + .friendship = 255, + }, + [4] = + { + .species = SPECIES_DUSCLOPS, + .heldItem = ITEM_LEFTOVERS, + .moves = {MOVE_MEAN_LOOK, MOVE_CONFUSE_RAY, MOVE_WILL_O_WISP, MOVE_SHADOW_BALL}, + .level = 0, + .ppBonuses = 0, + .hpEV = 110, + .defenseEV = 200, + .spDefenseEV = 200, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x14, + .nickname = _("DUSCLOPS"), + .friendship = 255, + }, + [5] = + { + .species = SPECIES_MISDREAVUS, + .heldItem = ITEM_FOCUS_BAND, + .moves = {MOVE_MEAN_LOOK, MOVE_CONFUSE_RAY, MOVE_PERISH_SONG, MOVE_SHADOW_BALL}, + .level = 0, + .ppBonuses = 0, + .hpEV = 180, + .defenseEV = 180, + .spDefenseEV = 150, + .otId = TRAINER_HILL_OTID, + .hpIV = 31, + .attackIV = 31, + .defenseIV = 31, + .speedIV = 31, + .spAttackIV = 31, + .spDefenseIV = 31, + .altAbility = 0, + .personality = 0x85, + .nickname = _("MISDREAVUS"), + .friendship = 255, + }, + }, + }, + }, + .data = {0x31, 0x3B, 0x3B, 0x3B, 0x39, 0x39, 0x13, 0x14, 0x15, 0x39, 0x39, 0x3A, 0x3B, 0x3B, 0x3B, 0x8, 0x96, 0xFB, 0xF6, 0xFD, 0xF6, 0xF6, 0xFB, 0x46, 0xFB, 0xF6, 0xF6, 0xFD, 0xF6, 0xFB, 0x9B, 0x8, 0xFB, 0x9B, 0xFB, 0xF6, 0xFB, 0xFB, 0xFB, 0x46, 0xFB, 0xFB, 0xFB, 0xF6, 0xFB, 0x9B, 0xFB, 0x8, 0xF6, 0xFB, 0x9B, 0xFB, 0xFB, 0x46, 0x46, 0x9B, 0x46, 0x46, 0xFB, 0xFB, 0x9B, 0xFB, 0xF6, 0x8, 0xFD, 0xF6, 0xFB, 0x9B, 0x46, 0x36, 0x36, 0x9B, 0x36, 0x36, 0x46, 0x9B, 0xFB, 0xF6, 0xFD, 0x8, 0xF6, 0xFB, 0xFB, 0x46, 0x9B, 0x46, 0x46, 0xDB, 0x46, 0x46, 0x9B, 0x46, 0xFB, 0xFB, 0xF6, 0x8, 0xF6, 0xFB, 0x46, 0x36, 0x46, 0x9B, 0xDB, 0xD6, 0xDB, 0x9B, 0x46, 0x36, 0x46, 0xFB, 0xF6, 0x8, 0xFB, 0xFB, 0x46, 0x36, 0x9B, 0xDB, 0xD6, 0xD6, 0xD6, 0xDB, 0x9B, 0x36, 0x46, 0xFB, 0xFB, 0x8, 0x96, 0x9B, 0x9B, 0x9B, 0x9B, 0xD6, 0xD6, 0x96, 0xD6, 0xD6, 0xDB, 0x9B, 0x9B, 0x9B, 0x96, 0x8, 0xFB, 0xFB, 0x46, 0x36, 0x9B, 0xDB, 0xD6, 0xD6, 0xD6, 0xDB, 0x9B, 0x36, 0x46, 0xFB, 0xFB, 0x8, 0xF6, 0xFB, 0x46, 0x36, 0x46, 0x9B, 0xDB, 0xD6, 0xDB, 0x9B, 0x46, 0x36, 0x46, 0xFB, 0xF6, 0x8, 0xF6, 0xFB, 0xFB, 0x46, 0x9B, 0x46, 0x46, 0xDB, 0x46, 0x46, 0x9B, 0x46, 0xFB, 0xFB, 0xF6, 0x8, 0xFD, 0xF6, 0xFB, 0x9B, 0x46, 0x36, 0x36, 0x9B, 0x36, 0x36, 0x46, 0x9B, 0xFB, 0xF6, 0xFD, 0x8, 0xF6, 0xFB, 0x9B, 0xFB, 0xFB, 0x46, 0x46, 0x9B, 0x46, 0x46, 0xFB, 0xFB, 0x9B, 0xFB, 0xF6, 0x8, 0xFB, 0x9B, 0xFB, 0xF6, 0xFB, 0xFB, 0xFB, 0x46, 0xFB, 0xFB, 0xFB, 0xF6, 0xFB, 0x9B, 0xFB, 0x8, 0x96, 0xFB, 0xF6, 0xFD, 0xF6, 0xF6, 0xFB, 0x46, 0xFB, 0xF6, 0xF6, 0xFD, 0xF6, 0xFB, 0x9B, 0x8}, + .unk3A0 = {0x381, 0x101, 0x101, 0x6C1, 0x821, 0x16D1, 0x2829, 0x2009, 0x1, 0x2009, 0x2829, 0x16D1, 0x821, 0x6C1, 0x101, 0x101}, + .coords = {103, 167}, + .direction = 0x1, + .range = 0x33, + }, + }, }; diff --git a/src/trainer_hill.c b/src/trainer_hill.c index a5b5486be..e0a236286 100644 --- a/src/trainer_hill.c +++ b/src/trainer_hill.c @@ -28,6 +28,7 @@ #include "constants/maps.h" #include "constants/species.h" #include "constants/trainers.h" +#include "constants/easy_chat.h" extern bool32 sub_81D3B34(void); From b6e5b4ee1ae8b2bac2cbf143b7bc7cd65afd08ab Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Tue, 22 Jan 2019 21:56:57 +0100 Subject: [PATCH 08/16] trainer card diego pls --- include/trainer_card.h | 2 +- src/trainer_card.c | 136 ++++++++++++++++++++--------------------- 2 files changed, 69 insertions(+), 69 deletions(-) diff --git a/include/trainer_card.h b/include/trainer_card.h index a5b217413..1cadbd8fc 100644 --- a/include/trainer_card.h +++ b/include/trainer_card.h @@ -27,7 +27,7 @@ struct TrainerCard /*0x30*/ u8 playerName[PLAYER_NAME_LENGTH + 1]; /*0x38*/ u8 version; /*0x3A*/ u16 var_3A; - /*0x3C*/ u32 berruCrushPoints; + /*0x3C*/ u32 berryCrushPoints; /*0x40*/ u32 unionRoomNum; /*0x44*/ u8 filler44[0x8]; /*0x4C*/ u8 var_4C; diff --git a/src/trainer_card.c b/src/trainer_card.c index 816d3bf25..cde15ae34 100755 --- a/src/trainer_card.c +++ b/src/trainer_card.c @@ -31,8 +31,8 @@ enum { - CARD_TYPE_FR, - CARD_TYPE_RUBY, + CARD_TYPE_FRLG, + CARD_TYPE_RS, CARD_TYPE_EMERALD, }; @@ -500,13 +500,13 @@ static bool8 LoadCardGfx(void) switch (sData->gfxLoadState) { case 0: - if (sData->cardType != CARD_TYPE_FR) + if (sData->cardType != CARD_TYPE_FRLG) LZ77UnCompWram(gUnknown_08DD1F78, sData->var_EF8); else LZ77UnCompWram(gUnknown_08DD2AE0, sData->var_EF8); break; case 1: - if (sData->cardType != CARD_TYPE_FR) + if (sData->cardType != CARD_TYPE_FRLG) LZ77UnCompWram(gUnknown_08DD21B0, sData->var_A48); else LZ77UnCompWram(gUnknown_08DD2D30, sData->var_A48); @@ -514,33 +514,33 @@ static bool8 LoadCardGfx(void) case 2: if (!sData->isLink) { - if (sData->cardType != CARD_TYPE_FR) + if (sData->cardType != CARD_TYPE_FRLG) LZ77UnCompWram(gUnknown_08DD2010, sData->var_598); else LZ77UnCompWram(gUnknown_08DD2B78, sData->var_598); } else { - if (sData->cardType != CARD_TYPE_FR) + if (sData->cardType != CARD_TYPE_FRLG) LZ77UnCompWram(gUnknown_08DD228C, sData->var_598); else LZ77UnCompWram(gUnknown_08DD2E5C, sData->var_598); } break; case 3: - if (sData->cardType != CARD_TYPE_FR) + if (sData->cardType != CARD_TYPE_FRLG) LZ77UnCompWram(gUnknown_0856F5CC, sData->var_13A8); else LZ77UnCompWram(gUnknown_0856F814, sData->var_13A8); break; case 4: - if (sData->cardType != CARD_TYPE_FR) + if (sData->cardType != CARD_TYPE_FRLG) LZ77UnCompWram(gEmeraldTrainerCard_Gfx, sData->var_19A8); else LZ77UnCompWram(gFireRedTrainerCard_Gfx, sData->var_19A8); break; case 5: - if (sData->cardType == CARD_TYPE_FR) + if (sData->cardType == CARD_TYPE_FRLG) LZ77UnCompWram(gUnknown_0856F018, sData->var_17A8); break; default: @@ -704,15 +704,15 @@ static void SetPlayerCardData(struct TrainerCard *trainerCard, u8 cardType) case CARD_TYPE_EMERALD: trainerCard->battleTowerWins = 0; trainerCard->battleTowerStraightWins = 0; - // Seems like GF got CARD_TYPE_FR and CARD_TYPE_RUBY wrong. - case CARD_TYPE_FR: + // Seems like GF got CARD_TYPE_FRLG and CARD_TYPE_RS wrong. + case CARD_TYPE_FRLG: trainerCard->contestsWithFriends = GetCappedGameStat(GAME_STAT_WON_LINK_CONTEST, 999); trainerCard->pokeblocksWithFriends = GetCappedGameStat(GAME_STAT_POKEBLOCKS_WITH_FRIENDS, 0xFFFF); if (CountPlayerContestPaintings() > 4) trainerCard->hasAllPaintings = TRUE; trainerCard->stars = GetRubyTrainerStars(trainerCard); break; - case CARD_TYPE_RUBY: + case CARD_TYPE_RS: trainerCard->battleTowerWins = 0; trainerCard->battleTowerStraightWins = 0; trainerCard->contestsWithFriends = 0; @@ -726,7 +726,7 @@ static void SetPlayerCardData(struct TrainerCard *trainerCard, u8 cardType) static void sub_80C3020(struct TrainerCard *trainerCard) { memset(trainerCard, 0, sizeof(struct TrainerCard)); - trainerCard->version = VERSION_EMERALD; + trainerCard->version = GAME_VERSION; SetPlayerCardData(trainerCard, CARD_TYPE_EMERALD); trainerCard->hasAllSymbols = HasAllFrontierSymbols(); trainerCard->frontierBP = gSaveBlock2Ptr->frontier.field_EBA; @@ -742,10 +742,10 @@ static void sub_80C3020(struct TrainerCard *trainerCard) void TrainerCard_GenerateCardForPlayer(struct TrainerCard *trainerCard) { memset(trainerCard, 0, 0x60); - trainerCard->version = VERSION_EMERALD; + trainerCard->version = GAME_VERSION; SetPlayerCardData(trainerCard, CARD_TYPE_EMERALD); trainerCard->var_3A = HasAllFrontierSymbols(); - *((u16*)&trainerCard->berruCrushPoints) = gSaveBlock2Ptr->frontier.field_EBA; + *((u16*)&trainerCard->berryCrushPoints) = gSaveBlock2Ptr->frontier.field_EBA; if (trainerCard->var_3A) trainerCard->stars++; @@ -762,15 +762,15 @@ void CopyTrainerCardData(struct TrainerCard *dst, u16 *src, u8 gameVersion) switch (VersionToCardType(gameVersion)) { - case CARD_TYPE_FR: + case CARD_TYPE_FRLG: memcpy(dst, src, 0x60); break; - case CARD_TYPE_RUBY: + case CARD_TYPE_RS: memcpy(dst, src, 0x38); break; case CARD_TYPE_EMERALD: memcpy(dst, src, 0x60); - dst->berruCrushPoints = 0; + dst->berryCrushPoints = 0; dst->hasAllSymbols = src[29]; dst->frontierBP = src[30]; break; @@ -973,10 +973,10 @@ static void PrintNameOnCard(void) txtPtr = StringCopy(buffer, gText_TrainerCardName); StringCopy(txtPtr, sData->trainerCard.playerName); ConvertInternationalString(txtPtr, sData->language); - if (sData->cardType == CARD_TYPE_FR) - AddTextPrinterParameterized3(1, 1, 20, 28, gUnknown_0856FB0C, -1, buffer); + if (sData->cardType == CARD_TYPE_FRLG) + AddTextPrinterParameterized3(1, 1, 20, 28, gUnknown_0856FB0C, TEXT_SPEED_FF, buffer); else - AddTextPrinterParameterized3(1, 1, 16, 33, gUnknown_0856FB0C, -1, buffer); + AddTextPrinterParameterized3(1, 1, 16, 33, gUnknown_0856FB0C, TEXT_SPEED_FF, buffer); } static void PrintIdOnCard(void) @@ -987,7 +987,7 @@ static void PrintIdOnCard(void) u32 top; txtPtr = StringCopy(buffer, gText_TrainerCardIDNo); ConvertIntToDecimalStringN(txtPtr, sData->trainerCard.trainerId, STR_CONV_MODE_LEADING_ZEROS, 5); - if (sData->cardType == CARD_TYPE_FR) + if (sData->cardType == CARD_TYPE_FRLG) { xPos = GetStringCenterAlignXOffset(1, buffer, 80) + 132; top = 9; @@ -998,7 +998,7 @@ static void PrintIdOnCard(void) top = 9; } - AddTextPrinterParameterized3(1, 1, xPos, top, gUnknown_0856FB0C, -1, buffer); + AddTextPrinterParameterized3(1, 1, xPos, top, gUnknown_0856FB0C, TEXT_SPEED_FF, buffer); } static void PrintMoneyOnCard(void) @@ -1007,9 +1007,9 @@ static void PrintMoneyOnCard(void) u8 top; if (!sData->isHoenn) - AddTextPrinterParameterized3(1, 1, 20, 56, gUnknown_0856FB0C, -1, gText_TrainerCardMoney); + AddTextPrinterParameterized3(1, 1, 20, 56, gUnknown_0856FB0C, TEXT_SPEED_FF, gText_TrainerCardMoney); else - AddTextPrinterParameterized3(1, 1, 16, 57, gUnknown_0856FB0C, -1, gText_TrainerCardMoney); + AddTextPrinterParameterized3(1, 1, 16, 57, gUnknown_0856FB0C, TEXT_SPEED_FF, gText_TrainerCardMoney); ConvertIntToDecimalStringN(gStringVar1, sData->trainerCard.money, 0, 6); StringExpandPlaceholders(gStringVar4, gText_PokedollarVar1); @@ -1023,7 +1023,7 @@ static void PrintMoneyOnCard(void) xOffset = GetStringRightAlignXOffset(1, gStringVar4, 128); top = 57; } - AddTextPrinterParameterized3(1, 1, xOffset, top, gUnknown_0856FB0C, -1, gStringVar4); + AddTextPrinterParameterized3(1, 1, xOffset, top, gUnknown_0856FB0C, TEXT_SPEED_FF, gStringVar4); } static u16 GetCaughtMonsCount(void) @@ -1041,9 +1041,9 @@ static void PrintPokedexOnCard(void) if (FlagGet(FLAG_SYS_POKEDEX_GET)) { if (!sData->isHoenn) - AddTextPrinterParameterized3(1, 1, 20, 72, gUnknown_0856FB0C, -1, gText_TrainerCardPokedex); + AddTextPrinterParameterized3(1, 1, 20, 72, gUnknown_0856FB0C, TEXT_SPEED_FF, gText_TrainerCardPokedex); else - AddTextPrinterParameterized3(1, 1, 16, 73, gUnknown_0856FB0C, -1,gText_TrainerCardPokedex); + AddTextPrinterParameterized3(1, 1, 16, 73, gUnknown_0856FB0C, TEXT_SPEED_FF, gText_TrainerCardPokedex); StringCopy(ConvertIntToDecimalStringN(gStringVar4, sData->trainerCard.caughtMonsCount, 0, 3), gText_EmptyString6); if (!sData->isHoenn) { @@ -1055,7 +1055,7 @@ static void PrintPokedexOnCard(void) xOffset = GetStringRightAlignXOffset(1, gStringVar4, 128); top = 73; } - AddTextPrinterParameterized3(1, 1, xOffset, top, gUnknown_0856FB0C, -1, gStringVar4); + AddTextPrinterParameterized3(1, 1, xOffset, top, gUnknown_0856FB0C, TEXT_SPEED_FF, gStringVar4); } } @@ -1069,9 +1069,9 @@ static void PrintTimeOnCard(void) u32 r7, r4, r10; if (!sData->isHoenn) - AddTextPrinterParameterized3(1, 1, 20, 88, gUnknown_0856FB0C, -1, gText_TrainerCardTime); + AddTextPrinterParameterized3(1, 1, 20, 88, gUnknown_0856FB0C, TEXT_SPEED_FF, gText_TrainerCardTime); else - AddTextPrinterParameterized3(1, 1, 16, 89, gUnknown_0856FB0C, -1, gText_TrainerCardTime); + AddTextPrinterParameterized3(1, 1, 16, 89, gUnknown_0856FB0C, TEXT_SPEED_FF, gText_TrainerCardTime); if (sData->isLink) { @@ -1105,12 +1105,12 @@ static void PrintTimeOnCard(void) FillWindowPixelRect(1, 0, r7, r4, r10, 15); ConvertIntToDecimalStringN(gStringVar4, hours, 1, 3); - AddTextPrinterParameterized3(1, 1, r7, r4, gUnknown_0856FB0C, -1, gStringVar4); + AddTextPrinterParameterized3(1, 1, r7, r4, gUnknown_0856FB0C, TEXT_SPEED_FF, gStringVar4); r7 += 18; - AddTextPrinterParameterized3(1, 1, r7, r4, gUnknown_0856FB40[sData->var_7], -1, gText_Colon2); + AddTextPrinterParameterized3(1, 1, r7, r4, gUnknown_0856FB40[sData->var_7], TEXT_SPEED_FF, gText_Colon2); r7 += width; ConvertIntToDecimalStringN(gStringVar4, minutes, 2, 2); - AddTextPrinterParameterized3(1, 1, r7, r4, gUnknown_0856FB0C, -1, gStringVar4); + AddTextPrinterParameterized3(1, 1, r7, r4, gUnknown_0856FB0C, TEXT_SPEED_FF, gStringVar4); } static const u8 gUnknown_0856FB48[] = {0x71, 0x68}; @@ -1120,10 +1120,10 @@ static void PrintProfilePhraseOnCard(void) { if (sData->isLink) { - AddTextPrinterParameterized3(1, 1, 8, gUnknown_0856FB48[sData->isHoenn], gUnknown_0856FB0C, -1, sData->var_19[0]); - AddTextPrinterParameterized3(1, 1, GetStringWidth(1, sData->var_19[0], 0) + 14, gUnknown_0856FB48[sData->isHoenn], gUnknown_0856FB0C, -1, sData->var_19[1]); - AddTextPrinterParameterized3(1, 1, 8, gUnknown_0856FB4A[sData->isHoenn], gUnknown_0856FB0C, -1, sData->var_19[2]); - AddTextPrinterParameterized3(1, 1, GetStringWidth(1, sData->var_19[2], 0) + 14, gUnknown_0856FB4A[sData->isHoenn], gUnknown_0856FB0C, -1, sData->var_19[3]); + AddTextPrinterParameterized3(1, 1, 8, gUnknown_0856FB48[sData->isHoenn], gUnknown_0856FB0C, TEXT_SPEED_FF, sData->var_19[0]); + AddTextPrinterParameterized3(1, 1, GetStringWidth(1, sData->var_19[0], 0) + 14, gUnknown_0856FB48[sData->isHoenn], gUnknown_0856FB0C, TEXT_SPEED_FF, sData->var_19[1]); + AddTextPrinterParameterized3(1, 1, 8, gUnknown_0856FB4A[sData->isHoenn], gUnknown_0856FB0C, TEXT_SPEED_FF, sData->var_19[2]); + AddTextPrinterParameterized3(1, 1, GetStringWidth(1, sData->var_19[2], 0) + 14, gUnknown_0856FB4A[sData->isHoenn], gUnknown_0856FB0C, TEXT_SPEED_FF, sData->var_19[3]); } } @@ -1131,7 +1131,7 @@ static void PrintNameOnCard2(void) { StringCopy(sData->var_4D, sData->trainerCard.playerName); ConvertInternationalString(sData->var_4D, sData->language); - if (sData->cardType != CARD_TYPE_FR) + if (sData->cardType != CARD_TYPE_FRLG) { StringCopy(gStringVar1, sData->var_4D); StringExpandPlaceholders(sData->var_4D, gText_Var1sTrainerCard); @@ -1141,9 +1141,9 @@ static void PrintNameOnCard2(void) static void sub_80C3B50(void) { if (!sData->isHoenn) - AddTextPrinterParameterized3(1, 1, 136, 9, gUnknown_0856FB0C, -1, sData->var_4D); + AddTextPrinterParameterized3(1, 1, 136, 9, gUnknown_0856FB0C, TEXT_SPEED_FF, sData->var_4D); else - AddTextPrinterParameterized3(1, 1, GetStringRightAlignXOffset(1, sData->var_4D, 216), 9, gUnknown_0856FB0C, -1, sData->var_4D); + AddTextPrinterParameterized3(1, 1, GetStringRightAlignXOffset(1, sData->var_4D, 216), 9, gUnknown_0856FB0C, TEXT_SPEED_FF, sData->var_4D); } static const u8 gUnknown_0856FB4C[] = {0xfd, 0x02, 0xf0, 0xfd, 0x03, 0xf0, 0xfd, 0x04, 0xff}; @@ -1164,8 +1164,8 @@ static const u8 gUnknown_0856FB57[] = {0xd8, 0xd8}; static void PrintString(u8 top, const u8* str1, u8* str2, const u8* color) { - AddTextPrinterParameterized3(1, 1, gUnknown_0856FB55[sData->isHoenn], top * 16 + 33, gUnknown_0856FB0C, -1, str1); - AddTextPrinterParameterized3(1, 1, GetStringRightAlignXOffset(1, str2, gUnknown_0856FB57[sData->isHoenn]), top * 16 + 33, color, -1, str2); + AddTextPrinterParameterized3(1, 1, gUnknown_0856FB55[sData->isHoenn], top * 16 + 33, gUnknown_0856FB0C, TEXT_SPEED_FF, str1); + AddTextPrinterParameterized3(1, 1, GetStringRightAlignXOffset(1, str2, gUnknown_0856FB57[sData->isHoenn]), top * 16 + 33, color, TEXT_SPEED_FF, str2); } static void PrintHofDebutStringOnCard(void) @@ -1211,31 +1211,31 @@ static void PrintTradesStringOnCard(void) static void PrintBerryCrushNumOnCard(void) { - if (sData->cardType == CARD_TYPE_FR && sData->trainerCard.berruCrushPoints) - ConvertIntToDecimalStringN(sData->var_2C3, sData->trainerCard.berruCrushPoints, 1, 5); + if (sData->cardType == CARD_TYPE_FRLG && sData->trainerCard.berryCrushPoints) + ConvertIntToDecimalStringN(sData->var_2C3, sData->trainerCard.berryCrushPoints, 1, 5); } static void PrintBerryCrushStringOnCard(void) { - if (sData->cardType == CARD_TYPE_FR && sData->trainerCard.berruCrushPoints) + if (sData->cardType == CARD_TYPE_FRLG && sData->trainerCard.berryCrushPoints) PrintString(4, gText_BerryCrush, sData->var_2C3, gUnknown_0856FB0F); } static void PrintUnionNumOnCard(void) { - if (sData->cardType == CARD_TYPE_FR && sData->trainerCard.unionRoomNum) + if (sData->cardType == CARD_TYPE_FRLG && sData->trainerCard.unionRoomNum) ConvertIntToDecimalStringN(sData->var_34F, sData->trainerCard.unionRoomNum, 1, 5); } static void PrintUnionStringOnCard(void) { - if (sData->cardType == CARD_TYPE_FR && sData->trainerCard.unionRoomNum) + if (sData->cardType == CARD_TYPE_FRLG && sData->trainerCard.unionRoomNum) PrintString(3, gText_UnionTradesAndBattles, sData->var_34F, gUnknown_0856FB0F); } static void PrintPokeblocksNumOnCard(void) { - if (sData->cardType != CARD_TYPE_FR && sData->trainerCard.pokeblocksWithFriends) + if (sData->cardType != CARD_TYPE_FRLG && sData->trainerCard.pokeblocksWithFriends) { ConvertIntToDecimalStringN(gStringVar1, sData->trainerCard.pokeblocksWithFriends, 1, 5); StringExpandPlaceholders(sData->var_395, gText_Var1DarkGreyShadowLightGrey); @@ -1244,19 +1244,19 @@ static void PrintPokeblocksNumOnCard(void) static void PrintPokeblockStringOnCard(void) { - if (sData->cardType != CARD_TYPE_FR && sData->trainerCard.pokeblocksWithFriends) + if (sData->cardType != CARD_TYPE_FRLG && sData->trainerCard.pokeblocksWithFriends) PrintString(3, gText_PokeblocksWithFriends, sData->var_395, gUnknown_0856FB0F); } static void PrintContestNumOnCard(void) { - if (sData->cardType != CARD_TYPE_FR && sData->trainerCard.contestsWithFriends) + if (sData->cardType != CARD_TYPE_FRLG && sData->trainerCard.contestsWithFriends) ConvertIntToDecimalStringN(sData->var_3DB, sData->trainerCard.contestsWithFriends, 1, 5); } static void PrintContestStringOnCard(void) { - if (sData->cardType != CARD_TYPE_FR && sData->trainerCard.contestsWithFriends) + if (sData->cardType != CARD_TYPE_FRLG && sData->trainerCard.contestsWithFriends) PrintString(4, gText_WonContestsWFriends, sData->var_3DB, gUnknown_0856FB0F); } @@ -1264,7 +1264,7 @@ static void PrintBattleFacilityNumsOnCard(void) { switch (sData->cardType) { - case CARD_TYPE_RUBY: + case CARD_TYPE_RS: if (sData->hasBattleTowerWins) { ConvertIntToDecimalStringN(gStringVar1, sData->trainerCard.battleTowerWins, 1, 4); @@ -1279,7 +1279,7 @@ static void PrintBattleFacilityNumsOnCard(void) StringExpandPlaceholders(sData->var_421, gText_Var1DarkLightGreyBP); } break; - case CARD_TYPE_FR: + case CARD_TYPE_FRLG: break; } } @@ -1288,7 +1288,7 @@ static void PrintBattleFacilityStringOnCard(void) { switch (sData->cardType) { - case CARD_TYPE_RUBY: + case CARD_TYPE_RS: if (sData->hasBattleTowerWins) PrintString(5, gText_BattleTower, sData->var_421, gUnknown_0856FB0C); break; @@ -1296,7 +1296,7 @@ static void PrintBattleFacilityStringOnCard(void) if (sData->trainerCard.frontierBP) PrintString(5, gText_BattlePtsWon, sData->var_421, gUnknown_0856FB0F); break; - case CARD_TYPE_FR: + case CARD_TYPE_FRLG: break; } } @@ -1307,7 +1307,7 @@ static void sub_80C4140(void) u8 buffer[] = {0x05, 0x06, 0x07, 0x08, 0x09, 0x0a}; u8 buffer2[] = {0x00, 0x04, 0x08, 0x0c, 0x10, 0x14}; - if (sData->cardType == CARD_TYPE_FR) + if (sData->cardType == CARD_TYPE_FRLG) { for (i = 0; i < 6; i++) { @@ -1353,7 +1353,7 @@ static void sub_80C42A4(void) u8 i; u8 buffer[4] = {0x0b, 0x0c, 0x0d, 0x0e}; - if (sData->cardType == CARD_TYPE_FR && sData->trainerCard.var_4C == 1) + if (sData->cardType == CARD_TYPE_FRLG && sData->trainerCard.var_4C == 1) { for (i = 0; i < 3; i++) { @@ -1390,7 +1390,7 @@ static u8 SetCardBgsAndPals(void) LoadBgTiles(0, sData->var_19A8, 6144, 0); break; case 2: - if (sData->cardType != CARD_TYPE_FR) + if (sData->cardType != CARD_TYPE_FRLG) { LoadPalette(gEmeraldTrainerCardStarPals[sData->trainerCard.stars], 0, 96); LoadPalette(gUnknown_0856F4EC, 48, 32); @@ -1485,14 +1485,14 @@ static void sub_80C4630(void) static void sub_80C474C(void) { - if (sData->cardType == CARD_TYPE_FR) + if (sData->cardType == CARD_TYPE_FRLG) { if (sData->hasTrades) { FillBgTilemapBufferRect(3, 141, 27, 9, 1, 1, 1); FillBgTilemapBufferRect(3, 157, 27, 10, 1, 1, 1); } - if (sData->trainerCard.berruCrushPoints) + if (sData->trainerCard.berryCrushPoints) { FillBgTilemapBufferRect(3, 141, 21, 13, 1, 1, 1); FillBgTilemapBufferRect(3, 157, 21, 14, 1, 1, 1); @@ -1764,7 +1764,7 @@ void ShowPlayerTrainerCard(void (*callback)(void)) else sData->isLink = FALSE; - sData->language = LANGUAGE_ENGLISH; + sData->language = GAME_LANGUAGE; sub_80C3020(&sData->trainerCard); SetMainCallback2(CB2_InitTrainerCard); } @@ -1798,18 +1798,18 @@ static u8 GetSetCardType(void) if (sData == NULL) { if (gGameVersion == VERSION_FIRE_RED || gGameVersion == VERSION_LEAF_GREEN) - return CARD_TYPE_FR; + return CARD_TYPE_FRLG; else if (gGameVersion == VERSION_EMERALD) return CARD_TYPE_EMERALD; else - return CARD_TYPE_RUBY; + return CARD_TYPE_RS; } else { if (sData->trainerCard.version == VERSION_FIRE_RED || sData->trainerCard.version == VERSION_LEAF_GREEN) { sData->isHoenn = FALSE; - return CARD_TYPE_FR; + return CARD_TYPE_FRLG; } else if (sData->trainerCard.version == VERSION_EMERALD) { @@ -1819,7 +1819,7 @@ static u8 GetSetCardType(void) else { sData->isHoenn = TRUE; - return CARD_TYPE_RUBY; + return CARD_TYPE_RS; } } } @@ -1827,11 +1827,11 @@ static u8 GetSetCardType(void) static u8 VersionToCardType(u8 version) { if (version == VERSION_FIRE_RED || version == VERSION_LEAF_GREEN) - return CARD_TYPE_FR; + return CARD_TYPE_FRLG; else if (version == VERSION_EMERALD) return CARD_TYPE_EMERALD; else - return CARD_TYPE_RUBY; + return CARD_TYPE_RS; } static void sub_80C4FF0(void) From 10fca92833f294e20cebe345cf6cc7d0651f939c Mon Sep 17 00:00:00 2001 From: nullableVoidPtr <30564701+nullableVoidPtr@users.noreply.github.com> Date: Fri, 25 Jan 2019 03:02:25 +0800 Subject: [PATCH 09/16] Obsolete common_syms and rewrite sym files, to keep up with pokeruby --- Makefile | 10 +- common_syms/agb_flash.txt | 10 - common_syms/apprentice.txt | 3 - common_syms/battle_anim_8170478.txt | 3 - common_syms/battle_factory_screen.txt | 1 - common_syms/battle_main.txt | 9 - common_syms/battle_tower.txt | 1 - common_syms/berry_blender.txt | 1 - common_syms/bg.txt | 1 - common_syms/contest.txt | 1 - common_syms/field_camera.txt | 3 - common_syms/field_control_avatar.txt | 1 - common_syms/field_specials.txt | 1 - common_syms/fieldmap.txt | 1 - common_syms/intro.txt | 2 - common_syms/link.txt | 37 -- common_syms/link_rfu.txt | 2 - common_syms/list_menu.txt | 2 - common_syms/load_save.txt | 4 - common_syms/m4a_2.txt | 12 - common_syms/main.txt | 9 - common_syms/mauville_old_man.txt | 1 - common_syms/overworld.txt | 8 - common_syms/pokedex.txt | 2 - common_syms/random.txt | 2 - common_syms/rtc.txt | 1 - common_syms/save.txt | 13 - common_syms/sound.txt | 1 - common_syms/sprite.txt | 2 - common_syms/start_menu.txt | 1 - common_syms/task.txt | 1 - common_syms/text.txt | 4 - common_syms/trainer_see.txt | 5 - common_syms/tv.txt | 4 - common_syms/window.txt | 5 - sym_bss.txt | 193 ++++++----- sym_common.txt | 318 +++++++++++++----- sym_ewram.txt | 466 +++++++++++++------------- 38 files changed, 557 insertions(+), 584 deletions(-) delete mode 100644 common_syms/agb_flash.txt delete mode 100644 common_syms/apprentice.txt delete mode 100755 common_syms/battle_anim_8170478.txt delete mode 100644 common_syms/battle_factory_screen.txt delete mode 100644 common_syms/battle_main.txt delete mode 100644 common_syms/battle_tower.txt delete mode 100644 common_syms/berry_blender.txt delete mode 100644 common_syms/bg.txt delete mode 100644 common_syms/contest.txt delete mode 100644 common_syms/field_camera.txt delete mode 100644 common_syms/field_control_avatar.txt delete mode 100644 common_syms/field_specials.txt delete mode 100644 common_syms/fieldmap.txt delete mode 100644 common_syms/intro.txt delete mode 100644 common_syms/link.txt delete mode 100644 common_syms/link_rfu.txt delete mode 100644 common_syms/list_menu.txt delete mode 100644 common_syms/load_save.txt delete mode 100644 common_syms/m4a_2.txt delete mode 100644 common_syms/main.txt delete mode 100644 common_syms/mauville_old_man.txt delete mode 100644 common_syms/overworld.txt delete mode 100644 common_syms/pokedex.txt delete mode 100644 common_syms/random.txt delete mode 100644 common_syms/rtc.txt delete mode 100644 common_syms/save.txt delete mode 100644 common_syms/sound.txt delete mode 100644 common_syms/sprite.txt delete mode 100644 common_syms/start_menu.txt delete mode 100644 common_syms/task.txt delete mode 100644 common_syms/text.txt delete mode 100644 common_syms/trainer_see.txt delete mode 100644 common_syms/tv.txt delete mode 100644 common_syms/window.txt diff --git a/Makefile b/Makefile index 32cc9df73..b046c90d7 100644 --- a/Makefile +++ b/Makefile @@ -172,14 +172,8 @@ $(DATA_ASM_BUILDDIR)/%.o: $(DATA_ASM_SUBDIR)/%.s $$(data_dep) $(SONG_BUILDDIR)/%.o: $(SONG_SUBDIR)/%.s $(AS) $(ASFLAGS) -I sound -o $@ $< -$(OBJ_DIR)/sym_bss.ld: sym_bss.txt - $(RAMSCRGEN) .bss $< ENGLISH > $@ - -$(OBJ_DIR)/sym_common.ld: sym_common.txt $(C_OBJS) $(wildcard common_syms/*.txt) - $(RAMSCRGEN) COMMON $< ENGLISH -c $(C_BUILDDIR),common_syms > $@ - -$(OBJ_DIR)/sym_ewram.ld: sym_ewram.txt - $(RAMSCRGEN) ewram_data $< ENGLISH > $@ +$(OBJ_DIR)/sym_%.ld: sym_%.txt + $(CPP) -P $(CPPFLAGS) $< | sed -e "s#tools/#../../tools/#g" > $@ $(OBJ_DIR)/ld_script.ld: ld_script.txt $(OBJ_DIR)/sym_bss.ld $(OBJ_DIR)/sym_common.ld $(OBJ_DIR)/sym_ewram.ld cd $(OBJ_DIR) && sed "s#tools/#../../tools/#g" ../../ld_script.txt > ld_script.ld diff --git a/common_syms/agb_flash.txt b/common_syms/agb_flash.txt deleted file mode 100644 index cb421ec80..000000000 --- a/common_syms/agb_flash.txt +++ /dev/null @@ -1,10 +0,0 @@ -gFlashTimeoutFlag -PollFlashStatus -WaitForFlashWrite -ProgramFlashSector -gFlash -ProgramFlashByte -gFlashNumRemainingBytes -EraseFlashChip -EraseFlashSector -gFlashMaxTime diff --git a/common_syms/apprentice.txt b/common_syms/apprentice.txt deleted file mode 100644 index e35133ecc..000000000 --- a/common_syms/apprentice.txt +++ /dev/null @@ -1,3 +0,0 @@ -gUnknown_030062EC -gUnknown_030062F0 -gUnknown_030062F4 diff --git a/common_syms/battle_anim_8170478.txt b/common_syms/battle_anim_8170478.txt deleted file mode 100755 index 2fc194df7..000000000 --- a/common_syms/battle_anim_8170478.txt +++ /dev/null @@ -1,3 +0,0 @@ -gUnknown_030062DC -gUnknown_030062E0 -gUnknown_030062E4 diff --git a/common_syms/battle_factory_screen.txt b/common_syms/battle_factory_screen.txt deleted file mode 100644 index 9f6868139..000000000 --- a/common_syms/battle_factory_screen.txt +++ /dev/null @@ -1 +0,0 @@ -gUnknown_030062E8 diff --git a/common_syms/battle_main.txt b/common_syms/battle_main.txt deleted file mode 100644 index 35a925946..000000000 --- a/common_syms/battle_main.txt +++ /dev/null @@ -1,9 +0,0 @@ -gPreBattleCallback1 -gBattleMainFunc -gBattleResults -gLeveledUpInBattle -gBattlerControllerFuncs -gHealthboxSpriteIds -gMultiUsePlayerCursor -gNumberOfMovesToChoose -gUnknown_03005D7C diff --git a/common_syms/battle_tower.txt b/common_syms/battle_tower.txt deleted file mode 100644 index dd198e229..000000000 --- a/common_syms/battle_tower.txt +++ /dev/null @@ -1 +0,0 @@ -gUnknown_03006298 diff --git a/common_syms/berry_blender.txt b/common_syms/berry_blender.txt deleted file mode 100644 index 1b15a33d6..000000000 --- a/common_syms/berry_blender.txt +++ /dev/null @@ -1 +0,0 @@ -gInGameOpponentsNo diff --git a/common_syms/bg.txt b/common_syms/bg.txt deleted file mode 100644 index 2495d1646..000000000 --- a/common_syms/bg.txt +++ /dev/null @@ -1 +0,0 @@ -gUnneededFireRedVariable diff --git a/common_syms/contest.txt b/common_syms/contest.txt deleted file mode 100644 index 6a519fb46..000000000 --- a/common_syms/contest.txt +++ /dev/null @@ -1 +0,0 @@ -gContestRngValue diff --git a/common_syms/field_camera.txt b/common_syms/field_camera.txt deleted file mode 100644 index 02301ce23..000000000 --- a/common_syms/field_camera.txt +++ /dev/null @@ -1,3 +0,0 @@ -gFieldCamera -gTotalCameraPixelOffsetY -gTotalCameraPixelOffsetX diff --git a/common_syms/field_control_avatar.txt b/common_syms/field_control_avatar.txt deleted file mode 100644 index 0f336a407..000000000 --- a/common_syms/field_control_avatar.txt +++ /dev/null @@ -1 +0,0 @@ -gSelectedEventObject diff --git a/common_syms/field_specials.txt b/common_syms/field_specials.txt deleted file mode 100644 index 25d874a65..000000000 --- a/common_syms/field_specials.txt +++ /dev/null @@ -1 +0,0 @@ -gUnknown_030061D0 diff --git a/common_syms/fieldmap.txt b/common_syms/fieldmap.txt deleted file mode 100644 index 0ead75846..000000000 --- a/common_syms/fieldmap.txt +++ /dev/null @@ -1 +0,0 @@ -gBackupMapLayout diff --git a/common_syms/intro.txt b/common_syms/intro.txt deleted file mode 100644 index d069b1014..000000000 --- a/common_syms/intro.txt +++ /dev/null @@ -1,2 +0,0 @@ -gIntroFrameCounter -gMultibootProgramStruct diff --git a/common_syms/link.txt b/common_syms/link.txt deleted file mode 100644 index a6d096116..000000000 --- a/common_syms/link.txt +++ /dev/null @@ -1,37 +0,0 @@ -gLinkPartnersHeldKeys -gLinkDebugSeed -gLocalLinkPlayerBlock -gLinkErrorOccurred -gLinkDebugFlags -gFiller_03003074 -gRemoteLinkPlayersNotReceived -gBlockReceivedStatus -gFiller_03003080 -gLinkHeldKeys -gRecvCmds -gLinkStatus -gUnknown_030030E4 -gUnknown_030030E8 -gUnknown_030030EC -gUnknown_030030F0 -gUnknown_030030F4 -gSuppressLinkErrorMessage -gWirelessCommType -gSavedLinkPlayerCount -gSendCmd -gSavedMultiplayerId -gReceivedRemoteLinkPlayers -gLinkTestBGInfo -gLinkCallback -gShouldAdvanceLinkState -gLinkTestBlockChecksums -gBlockRequestType -gFiller_03003154 -gFiller_03003158 -gFiller_0300315c -gLastSendQueueCount -gLink -gLastRecvQueueCount -gLinkSavedIme -gFiller_03004138 -gFiller_0300413C diff --git a/common_syms/link_rfu.txt b/common_syms/link_rfu.txt deleted file mode 100644 index 67dd00ca7..000000000 --- a/common_syms/link_rfu.txt +++ /dev/null @@ -1,2 +0,0 @@ -gUnknown_03004140 -gUnknown_03005000 diff --git a/common_syms/list_menu.txt b/common_syms/list_menu.txt deleted file mode 100644 index ed5343618..000000000 --- a/common_syms/list_menu.txt +++ /dev/null @@ -1,2 +0,0 @@ -gListMenuOverride -gMultiuseListMenuTemplate diff --git a/common_syms/load_save.txt b/common_syms/load_save.txt deleted file mode 100644 index 2d3d9b802..000000000 --- a/common_syms/load_save.txt +++ /dev/null @@ -1,4 +0,0 @@ -gFlashMemoryPresent -gSaveBlock1Ptr -gSaveBlock2Ptr -gPokemonStoragePtr diff --git a/common_syms/m4a_2.txt b/common_syms/m4a_2.txt deleted file mode 100644 index 0d6b13a79..000000000 --- a/common_syms/m4a_2.txt +++ /dev/null @@ -1,12 +0,0 @@ -gSoundInfo -gPokemonCrySongs -gPokemonCryMusicPlayers -gMPlayInfo_BGM -gMPlayJumpTable -gCgbChans -gMPlayInfo_SE1 -gMPlayInfo_SE2 -gPokemonCryTracks -gPokemonCrySong -gMPlayMemAccArea -gMPlayInfo_SE3 diff --git a/common_syms/main.txt b/common_syms/main.txt deleted file mode 100644 index a620083d1..000000000 --- a/common_syms/main.txt +++ /dev/null @@ -1,9 +0,0 @@ -gKeyRepeatStartDelay -gLinkTransferringData -gMain -gKeyRepeatContinueDelay -gSoftResetDisabled -gIntrTable -gLinkVSyncDisabled -IntrMain_Buffer -gPcmDmaCounter diff --git a/common_syms/mauville_old_man.txt b/common_syms/mauville_old_man.txt deleted file mode 100644 index 9d77b8692..000000000 --- a/common_syms/mauville_old_man.txt +++ /dev/null @@ -1 +0,0 @@ -gBardSong diff --git a/common_syms/overworld.txt b/common_syms/overworld.txt deleted file mode 100644 index b92da84ec..000000000 --- a/common_syms/overworld.txt +++ /dev/null @@ -1,8 +0,0 @@ -gBGTilemapBuffers1 -gBGTilemapBuffers2 -gBGTilemapBuffers3 -gUnknown_03005DA8 -gFieldCallback -gFieldCallback2 -gUnknown_03005DB4 -gFieldLinkPlayerCount diff --git a/common_syms/pokedex.txt b/common_syms/pokedex.txt deleted file mode 100644 index c982c9d3a..000000000 --- a/common_syms/pokedex.txt +++ /dev/null @@ -1,2 +0,0 @@ -gUnknown_030060B0 -gUnknown_030060B4 diff --git a/common_syms/random.txt b/common_syms/random.txt deleted file mode 100644 index 8037c6958..000000000 --- a/common_syms/random.txt +++ /dev/null @@ -1,2 +0,0 @@ -gRngValue -gRng2Value diff --git a/common_syms/rtc.txt b/common_syms/rtc.txt deleted file mode 100644 index fa00a34d5..000000000 --- a/common_syms/rtc.txt +++ /dev/null @@ -1 +0,0 @@ -gLocalTime diff --git a/common_syms/save.txt b/common_syms/save.txt deleted file mode 100644 index d7668c332..000000000 --- a/common_syms/save.txt +++ /dev/null @@ -1,13 +0,0 @@ -gLastWrittenSector -gLastSaveCounter -gLastKnownGoodSector -gDamagedSaveSectors -gSaveCounter -gFastSaveSection -gUnknown_03006208 -gSaveUnusedVar -gSaveFileStatus -gGameContinueCallback -gRamSaveSectionLocations -gSaveUnusedVar2 -gUnknown_03006294 diff --git a/common_syms/sound.txt b/common_syms/sound.txt deleted file mode 100644 index 0f6f2fc75..000000000 --- a/common_syms/sound.txt +++ /dev/null @@ -1 +0,0 @@ -gDisableMusic diff --git a/common_syms/sprite.txt b/common_syms/sprite.txt deleted file mode 100644 index 627c01c0d..000000000 --- a/common_syms/sprite.txt +++ /dev/null @@ -1,2 +0,0 @@ -gOamMatrixAllocBitmap -gReservedSpritePaletteCount diff --git a/common_syms/start_menu.txt b/common_syms/start_menu.txt deleted file mode 100644 index 05beaf57c..000000000 --- a/common_syms/start_menu.txt +++ /dev/null @@ -1 +0,0 @@ -gMenuCallback diff --git a/common_syms/task.txt b/common_syms/task.txt deleted file mode 100644 index 6601bd11b..000000000 --- a/common_syms/task.txt +++ /dev/null @@ -1 +0,0 @@ -gTasks diff --git a/common_syms/text.txt b/common_syms/text.txt deleted file mode 100644 index 4406c8bf9..000000000 --- a/common_syms/text.txt +++ /dev/null @@ -1,4 +0,0 @@ -gFonts -gUnknown_03002F84 -gUnknown_03002F90 -gTextFlags diff --git a/common_syms/trainer_see.txt b/common_syms/trainer_see.txt deleted file mode 100644 index 2d0514325..000000000 --- a/common_syms/trainer_see.txt +++ /dev/null @@ -1,5 +0,0 @@ -gUnknown_03006080 -gUnknown_03006084 -gApproachingTrainers -gNoOfApproachingTrainers -gUnknown_030060AC diff --git a/common_syms/tv.txt b/common_syms/tv.txt deleted file mode 100644 index 0370f65e1..000000000 --- a/common_syms/tv.txt +++ /dev/null @@ -1,4 +0,0 @@ -sCurTVShowSlot -sTV_SecretBaseVisitMovesTemp -sTV_DecorationsBuffer -sTV_SecretBaseVisitMonsTemp diff --git a/common_syms/window.txt b/common_syms/window.txt deleted file mode 100644 index e1b52a24f..000000000 --- a/common_syms/window.txt +++ /dev/null @@ -1,5 +0,0 @@ -filler_03002F58 -filler_03002F5C -gUnknown_03002F60 -filler_03002F64 -gUnknown_03002F70 diff --git a/sym_bss.txt b/sym_bss.txt index ae4e5dadf..e2b3ff674 100644 --- a/sym_bss.txt +++ b/sym_bss.txt @@ -1,119 +1,118 @@ - .include "src/main.o" - .include "src/alloc.o" - .include "src/dma3_manager.o" - .include "src/gpu_regs.o" - .include "src/bg.o" - .include "src/text.o" - .include "src/sprite.o" - .include "src/link.o" - .include "src/link_rfu.o" - .include "src/rom_8011DC0.o" - .include "src/rtc.o" - .include "src/main_menu.o" - .include "src/rom_8034C54.o" - .include "src/egg_hatch.o" - .include "src/berry_blender.o" - .include "src/play_time.o" - .include "src/overworld.o" - .include "src/field_camera.o" - .include "src/script.o" - .include "src/scrcmd.o" - .include "src/tileset_anims.o" - .include "src/palette.o" - .include "src/sound.o" - .include "src/field_weather.o" - .include "src/field_effect.o" - .include "src/pokemon_storage_system.o" - .include "src/fldeff_cut.o" - .include "src/script_menu.o" - .include "src/record_mixing.o" - .include "src/tv.o" - .include "src/mauville_old_man.o" - .include "src/menu_helpers.o" - .include "src/region_map.o" - .include "src/slot_machine.o" - .include "src/contest_painting.o" - .include "src/starter_choose.o" - .include "src/pokedex_area_screen.o" - .include "src/battle_transition.o" - .include "src/pokemon_animation.o" - .include "src/recorded_battle.o" - .include "src/battle_factory_screen.o" - .include "src/battle_factory.o" - .include "src/battle_pike.o" - .include "src/battle_tent.o" - .include "src/multiboot.o" - .include "src/mirage_tower.o" - .include "src/berry_fix_program.o" +. = ALIGN(4); src/main.o(.bss); +. = ALIGN(4); src/alloc.o(.bss); +. = ALIGN(4); src/dma3_manager.o(.bss); +. = ALIGN(4); src/gpu_regs.o(.bss); +. = ALIGN(4); src/bg.o(.bss); +. = ALIGN(4); src/text.o(.bss); +. = ALIGN(4); src/sprite.o(.bss); +. = ALIGN(4); src/link.o(.bss); +. = ALIGN(4); src/link_rfu.o(.bss); +. = ALIGN(4); src/rom_8011DC0.o(.bss); +. = ALIGN(4); src/rtc.o(.bss); +. = ALIGN(4); src/main_menu.o(.bss); +. = ALIGN(4); src/rom_8034C54.o(.bss); +. = ALIGN(4); src/egg_hatch.o(.bss); +. = ALIGN(4); src/berry_blender.o(.bss); +. = ALIGN(4); src/play_time.o(.bss); +. = ALIGN(4); src/overworld.o(.bss); +. = ALIGN(4); src/field_camera.o(.bss); +. = ALIGN(4); src/script.o(.bss); +. = ALIGN(4); src/scrcmd.o(.bss); +. = ALIGN(4); src/tileset_anims.o(.bss); +. = ALIGN(4); src/palette.o(.bss); +. = ALIGN(4); src/sound.o(.bss); +. = ALIGN(4); src/field_weather.o(.bss); +. = ALIGN(4); src/field_effect.o(.bss); +. = ALIGN(4); src/pokemon_storage_system.o(.bss); +. = ALIGN(4); src/fldeff_cut.o(.bss); +. = ALIGN(4); src/script_menu.o(.bss); +. = ALIGN(4); src/record_mixing.o(.bss); +. = ALIGN(4); src/tv.o(.bss); +. = ALIGN(4); src/mauville_old_man.o(.bss); +. = ALIGN(4); src/menu_helpers.o(.bss); +. = ALIGN(4); src/region_map.o(.bss); +. = ALIGN(4); src/slot_machine.o(.bss); +. = ALIGN(4); src/contest_painting.o(.bss); +. = ALIGN(4); src/starter_choose.o(.bss); +. = ALIGN(4); src/pokedex_area_screen.o(.bss); +. = ALIGN(4); src/battle_transition.o(.bss); +. = ALIGN(4); src/pokemon_animation.o(.bss); +. = ALIGN(4); src/recorded_battle.o(.bss); +. = ALIGN(4); src/battle_factory_screen.o(.bss); +. = ALIGN(4); src/battle_factory.o(.bss); +. = ALIGN(4); src/battle_pike.o(.bss); +. = ALIGN(4); src/battle_tent.o(.bss); +. = ALIGN(4); src/multiboot.o(.bss); +. = ALIGN(4); src/mirage_tower.o(.bss); +. = ALIGN(4); src/berry_fix_program.o(.bss); +gUnknown_030012BC = .; + . += 0x4; -gUnknown_030012BC: @ 30012BC - .space 0x4 +gUnknown_030012C0 = .; + . += 0x4; -gUnknown_030012C0: @ 30012C0 - .space 0x4 +gUnknown_030012C4 = .; + . += 0x4; -gUnknown_030012C4: @ 30012C4 - .space 0x4 +gUnknown_030012C8 = .; + . += 0x18; -gUnknown_030012C8: @ 30012C8 - .space 0x18 +gUnknown_030012E0 = .; + . += 0x2; -gUnknown_030012E0: @ 30012E0 - .space 0x2 +gUnknown_030012E2 = .; + . += 0x2; -gUnknown_030012E2: @ 30012E2 - .space 0x2 +gUnknown_030012E4 = .; + . += 0x2; -gUnknown_030012E4: @ 30012E4 - .space 0x2 +gUnknown_030012E6 = .; + . += 0x2; -gUnknown_030012E6: @ 30012E6 - .space 0x2 +gUnknown_030012E8 = .; + . += 0x4; -gUnknown_030012E8: @ 30012E8 - .space 0x4 +gUnknown_030012EC = .; + . += 0x2; -gUnknown_030012EC: @ 30012EC - .space 0x2 +gUnknown_030012EE = .; + . += 0x2; -gUnknown_030012EE: @ 30012EE - .space 0x2 +gUnknown_030012F0 = .; + . += 0x2; -gUnknown_030012F0: @ 30012F0 - .space 0x2 +gUnknown_030012F2 = .; + . += 0x2; -gUnknown_030012F2: @ 30012F2 - .space 0x2 +gUnknown_030012F4 = .; + . += 0x4; -gUnknown_030012F4: @ 30012F4 - .space 0x4 +gUnknown_030012F8 = .; + . += 0x2; -gUnknown_030012F8: @ 30012F8 - .space 0x2 +gUnknown_030012FA = .; + . += 0x2; -gUnknown_030012FA: @ 30012FA - .space 0x2 +gUnknown_030012FC = .; + . += 0x4; -gUnknown_030012FC: @ 30012FC - .space 0x4 +gUnknown_03001300 = .; + . += 0x40; -gUnknown_03001300: @ 3001300 - .space 0x40 +gMPlayTrack_BGM = .; + . += 0x320; -gMPlayTrack_BGM: @ 3001340 - .space 0x320 +gMPlayTrack_SE1 = .; + . += 0xF0; -gMPlayTrack_SE1: @ 3001660 - .space 0xF0 +gMPlayTrack_SE2 = .; + . += 0x2D0; -gMPlayTrack_SE2: @ 3001750 - .space 0x2D0 +gMPlayTrack_SE3 = .; + . += 0x50; -gMPlayTrack_SE3: @ 3001A20 - .space 0x50 - - .include "src/agb_flash.o" - .include "src/siirtc.o" - .include "*libgcc.a:dp-bit.o" - .include "*libgcc.a:fp-bit.o" - .include "*libc.a:syscalls.o" +. = ALIGN(4); src/agb_flash.o(.bss); +. = ALIGN(4); src/siirtc.o(.bss); +. = ALIGN(4); *libgcc.a:dp-bit.o(.bss); +. = ALIGN(4); *libgcc.a:fp-bit.o(.bss); +. = ALIGN(4); *libc.a:syscalls.o(.bss); diff --git a/sym_common.txt b/sym_common.txt index 3a7d698fd..b13989de3 100644 --- a/sym_common.txt +++ b/sym_common.txt @@ -1,116 +1,260 @@ - .space 0x8 - .include "main.o" - .include "bg.o" - .include "window.o" - .include "text.o" - .include "sprite.o" - .include "link.o" - .include "link_rfu.o" - .include "rtc.o" - .include "battle_main.o" - .include "random.o" - .include "load_save.o" - .include "berry_blender.o" - .include "overworld.o" - .include "fieldmap.o" - .include "field_camera.o" - .include "field_control_avatar.o" - .include "start_menu.o" - .include "sound.o" - .include "task.o" - .include "trainer_see.o" - .include "pokedex.o" - .include "contest.o" - .include "tv.o" - .include "mauville_old_man.o" +#define SYMBOL(name, size) \ + . = ALIGN (((size) > 16) ? 16 : (size)); \ + . = ALIGN(4); \ + name = .; \ + . += size; -gUnknown_03006164: @ 3006164 - .space 0x4 -gUnknown_03006168: @ 3006168 - .space 0x4 -gUnknown_0300616C: @ 300616C - .space 0x4 +. += 0x8; +// main.c +SYMBOL(gKeyRepeatStartDelay, 4) +SYMBOL(gLinkTransferringData, 4) +SYMBOL(gMain, 1084) +SYMBOL(gKeyRepeatContinueDelay, 4) +SYMBOL(gSoftResetDisabled, 4) +SYMBOL(gIntrTable, 56) +SYMBOL(gLinkVSyncDisabled, 4) +SYMBOL(IntrMain_Buffer, 2048) +SYMBOL(gPcmDmaCounter, 4) -gUnknown_03006170: @ 3006170 - .space 0x4 +// bg.c +SYMBOL(gUnneededFireRedVariable, 4) -gUnknown_03006174: @ 3006174 - .space 0x4 +// window.c +SYMBOL(filler_03002F58, 4) +SYMBOL(filler_03002F5C, 4) +SYMBOL(gUnknown_03002F60, 4) +SYMBOL(filler_03002F64, 4) +SYMBOL(gUnknown_03002F70, 16) -gUnknown_03006178: @ 3006178 - .space 0x4 +// text.c +SYMBOL(gFonts, 4) +SYMBOL(gUnknown_03002F84, 4) +SYMBOL(gUnknown_03002F90, 132) +SYMBOL(gTextFlags, 4) -gUnknown_0300617C: @ 300617C - .space 0x4 +// sprite.c +SYMBOL(gOamMatrixAllocBitmap, 4) +SYMBOL(gReservedSpritePaletteCount, 4) -gUnknown_03006180: @ 3006180 - .space 0x4 +// link.c +. = ALIGN(16); +gLinkPartnersHeldKeys = .; + . += 0xC; +SYMBOL(gLinkDebugSeed, 4) +SYMBOL(gLocalLinkPlayerBlock, 60) +SYMBOL(gLinkErrorOccurred, 4) +SYMBOL(gLinkDebugFlags, 4) +SYMBOL(gFiller_03003074, 4) +SYMBOL(gRemoteLinkPlayersNotReceived, 4) +SYMBOL(gBlockReceivedStatus, 4) +SYMBOL(gFiller_03003080, 4) +SYMBOL(gLinkHeldKeys, 4) +SYMBOL(gRecvCmds, 80) +SYMBOL(gLinkStatus, 4) +SYMBOL(gUnknown_030030E4, 4) +SYMBOL(gUnknown_030030E8, 4) +SYMBOL(gUnknown_030030EC, 4) +SYMBOL(gUnknown_030030F0, 4) +SYMBOL(gUnknown_030030F4, 4) +SYMBOL(gSuppressLinkErrorMessage, 4) +SYMBOL(gWirelessCommType, 4) +SYMBOL(gSavedLinkPlayerCount, 4) +SYMBOL(gSendCmd, 16) +SYMBOL(gSavedMultiplayerId, 4) +SYMBOL(gReceivedRemoteLinkPlayers, 4) +SYMBOL(gLinkTestBGInfo, 16) +SYMBOL(gLinkCallback, 4) +SYMBOL(gShouldAdvanceLinkState, 4) +SYMBOL(gLinkTestBlockChecksums, 8) +SYMBOL(gBlockRequestType, 4) +SYMBOL(gFiller_03003154, 4) +SYMBOL(gFiller_03003158, 4) +SYMBOL(gFiller_0300315c, 4) +SYMBOL(gLastSendQueueCount, 4) +SYMBOL(gLink, 4032) +SYMBOL(gLastRecvQueueCount, 4) +SYMBOL(gLinkSavedIme, 4) +SYMBOL(gFiller_03004138, 4) +SYMBOL(gFiller_0300413C, 4) -gUnknown_03006184: @ 3006184 - .space 0x4 +// link_rfu.c +SYMBOL(gUnknown_03004140, 3776) +SYMBOL(gUnknown_03005000, 3316) -gUnknown_03006188: @ 3006188 - .space 0x8 +// rtc.c +SYMBOL(gLocalTime, 8) -gUnknown_03006190: @ 3006190 - .space 0x10 +// battle_main.c +SYMBOL(gPreBattleCallback1, 4) +SYMBOL(gBattleMainFunc, 4) +SYMBOL(gBattleResults, 68) +SYMBOL(gLeveledUpInBattle, 4) +SYMBOL(gBattlerControllerFuncs, 16); +SYMBOL(gHealthboxSpriteIds, 4) +SYMBOL(gMultiUsePlayerCursor, 4) +SYMBOL(gNumberOfMovesToChoose, 4) +SYMBOL(gUnknown_03005D7C, 4) -gUnknown_030061A0: @ 30061A0 - .space 0x20 +// random.c +SYMBOL(gRngValue, 4) +SYMBOL(gRng2Value, 4) -gUnknown_030061C0: @ 30061C0 - .space 0x4 +// load_save.c +SYMBOL(gFlashMemoryPresent, 4) +SYMBOL(gSaveBlock1Ptr, 4) +SYMBOL(gSaveBlock2Ptr, 4) +SYMBOL(gPokemonStoragePtr, 4) -gContestPaintingMonPalette: @ 30061C4 - .space 0xC +// berry_blender.c +SYMBOL(gInGameOpponentsNo, 4) - .include "field_specials.o" +// overworld.c +SYMBOL(gBGTilemapBuffers1, 4) +SYMBOL(gBGTilemapBuffers2, 4) +SYMBOL(gBGTilemapBuffers3, 4) +SYMBOL(gUnknown_03005DA8, 4) +SYMBOL(gFieldCallback, 4) +SYMBOL(gFieldCallback2, 4) +SYMBOL(gUnknown_03005DB4, 4) +SYMBOL(gFieldLinkPlayerCount, 4) -gCB2_AfterEvolution: @ 30061E8 - .space 0x4 +// fieldmap.c +SYMBOL(gBackupMapLayout, 12) -gDexCryScreenState: @ 30061EC - .space 0x4 +// field_camera.c +SYMBOL(gFieldCamera, 24) +SYMBOL(gTotalCameraPixelOffsetY, 4) +SYMBOL(gTotalCameraPixelOffsetX, 4) - .include "save.o" - .include "battle_tower.o" - .include "intro.o" - .include "battle_anim_8170478.o" - .include "battle_factory_screen.o" - .include "apprentice.o" +// field_control_avatar.c +SYMBOL(gSelectedEventObject, 4) + +// start_menu.c +SYMBOL(gMenuCallback, 4) + +// sound.c +SYMBOL(gDisableMusic, 4) + +// task.c +SYMBOL(gTasks, 640) + +// trainer_see.c +SYMBOL(gUnknown_03006080, 4) +SYMBOL(gUnknown_03006084, 4) +SYMBOL(gApproachingTrainers, 24) +SYMBOL(gNoOfApproachingTrainers, 4) +SYMBOL(gUnknown_030060AC, 4) + +// pokedex.c +SYMBOL(gUnknown_030060B0, 4) +SYMBOL(gUnknown_030060B4, 4) + +// contest.c +SYMBOL(gContestRngValue, 4) + +// tv.c +SYMBOL(sCurTVShowSlot, 4) +SYMBOL(sTV_SecretBaseVisitMovesTemp, 16) +SYMBOL(sTV_DecorationsBuffer, 16) +SYMBOL(sTV_SecretBaseVisitMonsTemp, 80) + +// mauville_old_man.c +SYMBOL(gBardSong, 52) + +SYMBOL(gUnknown_03006164, 4) +SYMBOL(gUnknown_03006168, 4) +SYMBOL(gUnknown_0300616C, 4) +SYMBOL(gUnknown_03006170, 4) +SYMBOL(gUnknown_03006174, 4) +SYMBOL(gUnknown_03006178, 4) +SYMBOL(gUnknown_0300617C, 4) +SYMBOL(gUnknown_03006180, 4) +SYMBOL(gUnknown_03006184, 4) +SYMBOL(gUnknown_03006188, 8) +SYMBOL(gUnknown_03006190, 16) +SYMBOL(gUnknown_030061A0, 32) +SYMBOL(gUnknown_030061C0, 4) +gContestPaintingMonPalette = .; + . += 0xC; - .space 0x8 - - .include "list_menu.o" +// field_specials.c +SYMBOL(gUnknown_030061D0, 24) +SYMBOL(gCB2_AfterEvolution, 4) +SYMBOL(gDexCryScreenState, 4) -gUnknown_03006328: @ 3006328 - .space 0x48 +// save.c +SYMBOL(gLastWrittenSector, 4) +SYMBOL(gLastSaveCounter, 4) +SYMBOL(gLastKnownGoodSector, 4) +SYMBOL(gDamagedSaveSectors, 4) +SYMBOL(gSaveCounter, 4) +SYMBOL(gFastSaveSection, 4) +SYMBOL(gUnknown_03006208, 4) +SYMBOL(gSaveUnusedVar, 4) +SYMBOL(gSaveFileStatus, 4) +SYMBOL(gGameContinueCallback, 4) +SYMBOL(gRamSaveSectionLocations, 112) +SYMBOL(gSaveUnusedVar2, 4) +SYMBOL(gUnknown_03006294, 4) -gUnknown_03006370: @ 3006370 - .space 0x10 +// battle_tower.c +SYMBOL(gUnknown_03006298,8) - .include "m4a_2.o" - .include "agb_flash.o" +// intro.c +SYMBOL(gIntroFrameCounter, 4) +SYMBOL(gMultibootProgramStruct, 44) -gRfuState: @ 3007868 - .space 0x8 +// battle_anim_81470478 +SYMBOL(gUnknown_030062DC, 4) +SYMBOL(gUnknown_030062E0, 4) +SYMBOL(gUnknown_030062E4, 4) -gUnknown_03007870: @ 3007870 - .space 0x10 +// battle_factory_screen.c +SYMBOL(gUnknown_030062E8, 4) -gUnknown_03007880: @ 3007880 - .space 0x10 +// apprentice.c +SYMBOL(gUnknown_030062EC, 4) +SYMBOL(gUnknown_030062F0, 4) +SYMBOL(gUnknown_030062F4, 12) -gUnknown_03007890: @ 3007890 - .space 0x4 +SYMBOL(gListMenuOverride, 4) +SYMBOL(gMultiuseListMenuTemplate, 24) +gUnknown_03006328 = .; + . += 0x48; +SYMBOL(gUnknown_03006370, 16) -gUnknown_03007894: @ 3007894 - .space 0x4 +// m4a_2 +SYMBOL(gSoundInfo, 4016) +SYMBOL(gPokemonCrySongs, 104) +SYMBOL(gPokemonCryMusicPlayers, 128) +SYMBOL(gMPlayInfo_BGM, 64) +SYMBOL(gMPlayJumpTable, 144) +SYMBOL(gCgbChans, 256) +SYMBOL(gMPlayInfo_SE1, 64) +SYMBOL(gMPlayInfo_SE2, 64) +SYMBOL(gPokemonCryTracks, 320) +SYMBOL(gPokemonCrySong, 52) +SYMBOL(gMPlayMemAccArea, 16) +SYMBOL(gMPlayInfo_SE3, 64) -gUnknown_03007898: @ 3007898 - .space 0x8 +// agb_flash.c +SYMBOL(gFlashTimeoutFlag, 4); +SYMBOL(PollFlashStatus, 4) +SYMBOL(WaitForFlashWrite, 4) +SYMBOL(ProgramFlashSector, 4) +SYMBOL(gFlash, 4) +SYMBOL(ProgramFlashByte, 4) +SYMBOL(gFlashNumRemainingBytes, 4) +SYMBOL(EraseFlashChip, 4) +SYMBOL(EraseFlashSector, 4) +SYMBOL(gFlashMaxTime, 4) -gUnknown_030078A0: @ 30078A0 - .space 0xC +SYMBOL(gRfuState, 8) +SYMBOL(gUnknown_03007870, 16) +SYMBOL(gUnknown_03007880, 16) +SYMBOL(gUnknown_03007890, 4) +SYMBOL(gUnknown_03007894, 4) +SYMBOL(gUnknown_03007898, 8) +SYMBOL(gUnknown_030078A0, 16) diff --git a/sym_ewram.txt b/sym_ewram.txt index 75a44bb97..0a1fe13e6 100644 --- a/sym_ewram.txt +++ b/sym_ewram.txt @@ -1,292 +1,282 @@ - .include "src/decompress.o" - .include "src/main.o" - .include "src/window.o" - .include "src/text.o" - .include "src/sprite.o" - .include "src/string_util.o" - .include "src/link.o" - .include "src/link_rfu.o" +. = ALIGN(4); src/decompress.o(ewram_data); +. = ALIGN(4); src/main.o(ewram_data); +. = ALIGN(4); src/window.o(ewram_data); +. = ALIGN(4); src/text.o(ewram_data); +. = ALIGN(4); src/sprite.o(ewram_data); +. = ALIGN(4); src/string_util.o(ewram_data); +. = ALIGN(4); src/link.o(ewram_data); +. = ALIGN(4); src/link_rfu.o(ewram_data); +gUnknown_02022C20 = .; + . += 0xC; -gUnknown_02022C20: @ 2022C20 - .space 0xC +gUnknown_02022C2C = .; + . += 0x1; -gUnknown_02022C2C: @ 2022C2C - .space 0x1 +gUnknown_02022C2D = .; + . += 0x3; -gUnknown_02022C2D: @ 2022C2D - .space 0x3 +gUnknown_02022C30 = .; + . += 0x8; -gUnknown_02022C30: @ 2022C30 - .space 0x8 +gUnknown_02022C38 = .; + . += 0x4; -gUnknown_02022C38: @ 2022C38 - .space 0x4 +gUnknown_02022C3C = .; + . += 0x2; -gUnknown_02022C3C: @ 2022C3C - .space 0x2 +gUnknown_02022C3E = .; + . += 0x2; -gUnknown_02022C3E: @ 2022C3E - .space 0x2 +gUnknown_02022C40 = .; + . += 0x18; -gUnknown_02022C40: @ 2022C40 - .space 0x18 +gUnknown_02022C58 = .; + . += 0x8; -gUnknown_02022C58: @ 2022C58 - .space 0x8 +gUnknown_02022C60 = .; + . += 0x4; -gUnknown_02022C60: @ 2022C60 - .space 0x4 +gUnknown_02022C64 = .; + . += 0x4; -gUnknown_02022C64: @ 2022C64 - .space 0x4 +gUnknown_02022C68 = .; + . += 0x4; -gUnknown_02022C68: @ 2022C68 - .space 0x4 +gUnknown_02022C6C = .; + . += 0x4; -gUnknown_02022C6C: @ 2022C6C - .space 0x4 +gUnknown_02022C70 = .; + . += 0x4; -gUnknown_02022C70: @ 2022C70 - .space 0x4 +gUnknown_02022C74 = .; + . += 0x4; -gUnknown_02022C74: @ 2022C74 - .space 0x4 +gUnknown_02022C78 = .; + . += 0x4; -gUnknown_02022C78: @ 2022C78 - .space 0x4 +gUnknown_02022C7C = .; + . += 0x4; -gUnknown_02022C7C: @ 2022C7C - .space 0x4 +gUnknown_02022C80 = .; + . += 0x4; -gUnknown_02022C80: @ 2022C80 - .space 0x4 +gUnknown_02022C84 = .; + . += 0x4; -gUnknown_02022C84: @ 2022C84 - .space 0x4 +gUnknown_02022C88 = .; + . += 0x4; -gUnknown_02022C88: @ 2022C88 - .space 0x4 +gUnknown_02022C8C = .; + . += 0x4; -gUnknown_02022C8C: @ 2022C8C - .space 0x4 +gUnknown_02022C90 = .; + . += 0x4; -gUnknown_02022C90: @ 2022C90 - .space 0x4 +gUnknown_02022C94 = .; + . += 0x4; -gUnknown_02022C94: @ 2022C94 - .space 0x4 +gUnknown_02022C98 = .; + . += 0x4; -gUnknown_02022C98: @ 2022C98 - .space 0x4 +gUnknown_02022C9C = .; + . += 0x14; -gUnknown_02022C9C: @ 2022C9C - .space 0x14 +gUnknown_02022CB0 = .; + . += 0x8; -gUnknown_02022CB0: @ 2022CB0 - .space 0x8 +gUnknown_02022CB8 = .; + . += 0x2C; -gUnknown_02022CB8: @ 2022CB8 - .space 0x2C +gUnknown_02022CE4 = .; + . += 0x10; -gUnknown_02022CE4: @ 2022CE4 - .space 0x10 +gUnknown_02022CF4 = .; + . += 0x4; -gUnknown_02022CF4: @ 2022CF4 - .space 0x4 +gUnknown_02022CF8 = .; + . += 0x4; -gUnknown_02022CF8: @ 2022CF8 - .space 0x4 +gUnknown_02022CFC = .; + . += 0x4; -gUnknown_02022CFC: @ 2022CFC - .space 0x4 +gUnknown_02022D00 = .; + . += 0x4; -gUnknown_02022D00: @ 2022D00 - .space 0x4 +. = ALIGN(4); src/main_menu.o(ewram_data); +. = ALIGN(4); src/battle_controllers.o(ewram_data); +. = ALIGN(4); src/rom_8034C54.o(ewram_data); +. = ALIGN(4); src/battle_main.o(ewram_data); +. = ALIGN(4); src/pokemon.o(ewram_data); +. = ALIGN(4); src/random.o(ewram_data); +. = ALIGN(4); src/daycare.o(ewram_data); +. = ALIGN(4); src/load_save.o(ewram_data); +. = ALIGN(4); src/trade.o(ewram_data); +. = ALIGN(4); src/berry_blender.o(ewram_data); +. = ALIGN(4); src/new_game.o(ewram_data); +. = ALIGN(4); src/overworld.o(ewram_data); +. = ALIGN(4); src/fieldmap.o(ewram_data); +. = ALIGN(4); src/field_camera.o(ewram_data); +. = ALIGN(4); src/field_player_avatar.o(ewram_data); +. = ALIGN(4); src/event_object_movement.o(ewram_data); +. = ALIGN(4); src/field_message_box.o(ewram_data); +. = ALIGN(4); src/scrcmd.o(ewram_data); +. = ALIGN(4); src/field_control_avatar.o(ewram_data); +. = ALIGN(4); src/event_data.o(ewram_data); +. = ALIGN(4); src/start_menu.o(ewram_data); +. = ALIGN(4); src/tileset_anims.o(ewram_data); +. = ALIGN(4); src/palette.o(ewram_data); +. = ALIGN(4); src/sound.o(ewram_data); +. = ALIGN(4); src/battle_anim.o(ewram_data); +. = ALIGN(4); src/battle_anim_80A5C6C.o(ewram_data); + . += 0xC; - .include "src/main_menu.o" - .include "src/battle_controllers.o" - .include "src/rom_8034C54.o" - .include "src/battle_main.o" - .include "src/pokemon.o" - .include "src/random.o" - .include "src/daycare.o" - .include "src/load_save.o" - .include "src/trade.o" - .include "src/berry_blender.o" - .include "src/new_game.o" - .include "src/overworld.o" - .include "src/fieldmap.o" - .include "src/field_camera.o" - .include "src/field_player_avatar.o" - .include "src/event_object_movement.o" - .include "src/field_message_box.o" - .include "src/scrcmd.o" - .include "src/field_control_avatar.o" - .include "src/event_data.o" - .include "src/start_menu.o" - .include "src/tileset_anims.o" - .include "src/palette.o" - .include "src/sound.o" - .include "src/battle_anim.o" - .include "src/battle_anim_80A5C6C.o" +. = ALIGN(4); src/field_weather.o(ewram_data); +. = ALIGN(4); src/field_weather_effect.o(ewram_data); +. = ALIGN(4); src/battle_setup.o(ewram_data); +. = ALIGN(4); src/trainer_see.o(ewram_data); +. = ALIGN(4); src/wild_encounter.o(ewram_data); +. = ALIGN(4); src/field_effect.o(ewram_data); +. = ALIGN(4); src/scanline_effect.o(ewram_data); +. = ALIGN(4); src/option_menu.o(ewram_data); +. = ALIGN(4); src/pokedex.o(ewram_data); +gTrainerCards = .; + . += 0x14; - .space 0xC - .include "src/field_weather.o" - .include "src/field_weather_effect.o" - .include "src/battle_setup.o" - .include "src/trainer_see.o" - .include "src/wild_encounter.o" - .include "src/field_effect.o" - .include "src/scanline_effect.o" - .include "src/option_menu.o" - .include "src/pokedex.o" +gUnknown_02039B6C = .; + . += 0x2; -gTrainerCards: @ 2039B58 - .space 0x14 +gUnknown_02039B6E = .; + . += 0x1A; -gUnknown_02039B6C: @ 2039B6C - .space 0x2 +gUnknown_02039B88 = .; + . += 0x160; -gUnknown_02039B6E: @ 2039B6E - .space 0x1A +. = ALIGN(4); src/trainer_card.o(ewram_data); -gUnknown_02039B88: @ 2039B88 - .space 0x160 +gUnknown_02039CEC = .; + . += 0x4; - .include "src/trainer_card.o" +gUnknown_02039CF0 = .; + . += 0x4; -gUnknown_02039CEC: @ 2039CEC - .space 0x4 +gUnknown_02039CF4 = .; + . += 0x4; -gUnknown_02039CF0: @ 2039CF0 - .space 0x4 +gUnknown_02039CF8 = .; + . += 0x8; -gUnknown_02039CF4: @ 2039CF4 - .space 0x4 +. = ALIGN(4); src/pokemon_storage_system.o(ewram_data); +. = ALIGN(4); src/script_movement.o(ewram_data); +. = ALIGN(4); src/fldeff_cut.o(ewram_data); +. = ALIGN(4); src/map_name_popup.o(ewram_data); +. = ALIGN(4); src/item.o(ewram_data); +. = ALIGN(4); src/contest.o(ewram_data); +. = ALIGN(4); gUnknown_02039F5C = .; + . += 0x1; -gUnknown_02039CF8: @ 2039CF8 - .space 0x8 +gUnknown_02039F5D = .; + . += 0x3; - .include "src/pokemon_storage_system.o" - .include "src/script_movement.o" - .include "src/fldeff_cut.o" - .include "src/map_name_popup.o" - .include "src/item.o" - .include "src/contest.o" +. = ALIGN(4); src/shop.o(ewram_data); +. = ALIGN(4); src/fldeff_escalator.o(ewram_data); +. = ALIGN(4); src/script_menu.o(ewram_data); +. = ALIGN(4); src/naming_screen.o(ewram_data); +. = ALIGN(4); src/money.o(ewram_data); +. = ALIGN(4); src/record_mixing.o(ewram_data); +. = ALIGN(4); src/secret_base.o(ewram_data); +. = ALIGN(4); src/tv.o(ewram_data); +gUnknown_0203A034 = .; + . += 0x4; - .align 2 -gUnknown_02039F5C: @ 2039F5C - .space 0x1 +. = ALIGN(4); src/rotating_gate.o(ewram_data); +. = ALIGN(4); src/safari_zone.o(ewram_data); +gUnknown_0203A0F4 = .; + . += 0x4; -gUnknown_02039F5D: @ 2039F5D - .space 0x3 +. = ALIGN(4); src/battle_anim_effects_1.o(ewram_data); +gUnknown_0203A100 = .; + . += 0x10; - .include "src/shop.o" - .include "src/fldeff_escalator.o" - .include "src/script_menu.o" - .include "src/naming_screen.o" - .include "src/money.o" - .include "src/record_mixing.o" - .include "src/secret_base.o" - .include "src/tv.o" +. = ALIGN(4); src/battle_anim_utility_funcs.o(ewram_data); +. = ALIGN(4); src/battle_intro.o(ewram_data); +. = ALIGN(4); src/easy_chat.o(ewram_data); +. = ALIGN(4); src/mon_markings.o(ewram_data); +. = ALIGN(4); src/mauville_old_man.o(ewram_data); +. = ALIGN(4); src/mail.o(ewram_data); +. = ALIGN(4); src/menu_helpers.o(ewram_data); +. = ALIGN(4); src/region_map.o(ewram_data); +. = ALIGN(4); src/decoration.o(ewram_data); +. = ALIGN(4); src/slot_machine.o(ewram_data); +. = ALIGN(4); src/battle_ai_script_commands.o(ewram_data); +. = ALIGN(4); gPlayerFacingPosition = .; + . += 0x8; -gUnknown_0203A034: @ 203A034 - .space 0x4 +. = ALIGN(4); src/pokeblock.o(ewram_data); +. = ALIGN(4); src/field_specials.o(ewram_data); +. = ALIGN(4); src/battle_records.o(ewram_data); +. = ALIGN(4); src/pokedex_area_screen.o(ewram_data); +. = ALIGN(4); src/evolution_scene.o(ewram_data); +. = ALIGN(4); src/roulette.o(ewram_data); +. = ALIGN(4); src/pokedex_cry_screen.o(ewram_data); +. = ALIGN(4); src/coins.o(ewram_data); +. = ALIGN(4); src/battle_transition.o(ewram_data); +. = ALIGN(4); src/battle_message.o(ewram_data); +. = ALIGN(4); src/cable_car.o(ewram_data); +. = ALIGN(4); src/rom_81520A8.o(ewram_data); +. = ALIGN(4); src/save.o(ewram_data); +. = ALIGN(4); src/mystery_event_script.o(ewram_data); +. = ALIGN(4); src/learn_move.o(ewram_data); +. = ALIGN(4); src/decoration_inventory.o(ewram_data); +. = ALIGN(4); src/roamer.o(ewram_data); +. = ALIGN(4); src/battle_tower.o(ewram_data); +. = ALIGN(4); src/use_pokeblock.o(ewram_data); +. = ALIGN(4); src/player_pc.o(ewram_data); +. = ALIGN(4); src/intro.o(ewram_data); +. = ALIGN(4); src/field_region_map.o(ewram_data); +. = ALIGN(4); src/hall_of_fame.o(ewram_data); +. = ALIGN(4); src/credits.o(ewram_data); +. = ALIGN(4); src/lottery_corner.o(ewram_data); +. = ALIGN(4); src/diploma.o(ewram_data); +. = ALIGN(4); src/berry_tag_screen.o(ewram_data); +. = ALIGN(4); src/mystery_event_menu.o(ewram_data); +. = ALIGN(4); src/save_failed_screen.o(ewram_data); +. = ALIGN(4); src/braille_puzzles.o(ewram_data); +. = ALIGN(4); src/pokeblock_feed.o(ewram_data); +. = ALIGN(4); src/intro_credits_graphics.o(ewram_data); +. = ALIGN(4); src/recorded_battle.o(ewram_data); +. = ALIGN(4); src/trainer_pokemon_sprites.o(ewram_data); +. = ALIGN(4); src/lilycove_lady.o(ewram_data); +. = ALIGN(4); src/battle_dome.o(ewram_data); +. = ALIGN(4); src/match_call.o(ewram_data); +. = ALIGN(4); src/menu.o(ewram_data); +. = ALIGN(4); src/battle_factory_screen.o(ewram_data); +. = ALIGN(4); src/mossdeep_gym.o(ewram_data); +. = ALIGN(4); src/item_menu.o(ewram_data); +. = ALIGN(4); src/list_menu.o(ewram_data); +. = ALIGN(4); src/dynamic_placeholder_text_util.o(ewram_data); +. = ALIGN(4); src/item_icon.o(ewram_data); +. = ALIGN(4); src/party_menu.o(ewram_data); +. = ALIGN(4); src/mirage_tower.o(ewram_data); +. = ALIGN(4); src/pokemon_summary_screen.o(ewram_data); +. = ALIGN(4); src/unk_pokedex_area_screen_helper.o(ewram_data); +. = ALIGN(4); src/battle_pyramid_bag.o(ewram_data); +gUnknown_0203CF3C = .; + . += 0x4; - .include "src/rotating_gate.o" - .include "src/safari_zone.o" +gUnknown_0203CF40 = .; + . += 0x4; -gUnknown_0203A0F4: @ 203A0F4 - .space 0x4 +gUnknown_0203CF44 = .; + . += 0x4; - .include "src/battle_anim_effects_1.o" +gUnknown_0203CF48 = .; + . += 0x4; -gUnknown_0203A100: @ 203A100 - .space 0x10 +gUnknown_0203CF4C = .; + . += 0x4; - .include "src/battle_anim_utility_funcs.o" - .include "src/battle_intro.o" - .include "src/easy_chat.o" - .include "src/mon_markings.o" - .include "src/mauville_old_man.o" - .include "src/mail.o" - .include "src/menu_helpers.o" - .include "src/region_map.o" - .include "src/decoration.o" - .include "src/slot_machine.o" - .include "src/battle_ai_script_commands.o" - -.align 2 -gPlayerFacingPosition: @ 203AB40 - .space 0x8 - - .include "src/pokeblock.o" - .include "src/field_specials.o" - .include "src/battle_records.o" - .include "src/pokedex_area_screen.o" - .include "src/evolution_scene.o" - .include "src/roulette.o" - .include "src/pokedex_cry_screen.o" - .include "src/coins.o" - .include "src/battle_transition.o" - .include "src/battle_message.o" - .include "src/cable_car.o" - .include "src/rom_81520A8.o" - .include "src/save.o" - .include "src/mystery_event_script.o" - .include "src/learn_move.o" - .include "src/decoration_inventory.o" - .include "src/roamer.o" - .include "src/battle_tower.o" - .include "src/use_pokeblock.o" - .include "src/player_pc.o" - .include "src/intro.o" - .include "src/field_region_map.o" - .include "src/hall_of_fame.o" - .include "src/credits.o" - .include "src/lottery_corner.o" - .include "src/diploma.o" - .include "src/berry_tag_screen.o" - .include "src/mystery_event_menu.o" - .include "src/save_failed_screen.o" - .include "src/braille_puzzles.o" - .include "src/pokeblock_feed.o" - .include "src/intro_credits_graphics.o" - .include "src/recorded_battle.o" - .include "src/trainer_pokemon_sprites.o" - .include "src/lilycove_lady.o" - .include "src/battle_dome.o" - .include "src/match_call.o" - .include "src/menu.o" - .include "src/battle_factory_screen.o" - .include "src/mossdeep_gym.o" - .include "src/item_menu.o" - .include "src/list_menu.o" - .include "src/dynamic_placeholder_text_util.o" - .include "src/item_icon.o" - .include "src/party_menu.o" - .include "src/mirage_tower.o" - .include "src/pokemon_summary_screen.o" - .include "src/unk_pokedex_area_screen_helper.o" - .include "src/battle_pyramid_bag.o" +gUnknown_0203CF50 = .; + . += 0x4; -gUnknown_0203CF3C: @ 203CF3C - .space 0x4 - -gUnknown_0203CF40: @ 203CF40 - .space 0x4 - -gUnknown_0203CF44: @ 203CF44 - .space 0x4 - -gUnknown_0203CF48: @ 203CF48 - .space 0x4 - -gUnknown_0203CF4C: @ 203CF4C - .space 0x4 - -gUnknown_0203CF50: @ 203CF50 - .space 0x4 - - .include "src/trainer_hill.o" - .include "src/rayquaza_scene.o" +. = ALIGN(4); src/trainer_hill.o(ewram_data); +. = ALIGN(4); src/rayquaza_scene.o(ewram_data); From dedc289914fc158ed4c064f763c7f0c72a759043 Mon Sep 17 00:00:00 2001 From: Diegoisawesome Date: Thu, 24 Jan 2019 14:18:01 -0600 Subject: [PATCH 10/16] Revert "Obsolete common_syms and rewrite sym files, to keep up with pokeruby" --- Makefile | 10 +- common_syms/agb_flash.txt | 10 + common_syms/apprentice.txt | 3 + common_syms/battle_anim_8170478.txt | 3 + common_syms/battle_factory_screen.txt | 1 + common_syms/battle_main.txt | 9 + common_syms/battle_tower.txt | 1 + common_syms/berry_blender.txt | 1 + common_syms/bg.txt | 1 + common_syms/contest.txt | 1 + common_syms/field_camera.txt | 3 + common_syms/field_control_avatar.txt | 1 + common_syms/field_specials.txt | 1 + common_syms/fieldmap.txt | 1 + common_syms/intro.txt | 2 + common_syms/link.txt | 37 ++ common_syms/link_rfu.txt | 2 + common_syms/list_menu.txt | 2 + common_syms/load_save.txt | 4 + common_syms/m4a_2.txt | 12 + common_syms/main.txt | 9 + common_syms/mauville_old_man.txt | 1 + common_syms/overworld.txt | 8 + common_syms/pokedex.txt | 2 + common_syms/random.txt | 2 + common_syms/rtc.txt | 1 + common_syms/save.txt | 13 + common_syms/sound.txt | 1 + common_syms/sprite.txt | 2 + common_syms/start_menu.txt | 1 + common_syms/task.txt | 1 + common_syms/text.txt | 4 + common_syms/trainer_see.txt | 5 + common_syms/tv.txt | 4 + common_syms/window.txt | 5 + sym_bss.txt | 193 +++++------ sym_common.txt | 318 +++++------------- sym_ewram.txt | 466 +++++++++++++------------- 38 files changed, 584 insertions(+), 557 deletions(-) create mode 100644 common_syms/agb_flash.txt create mode 100644 common_syms/apprentice.txt create mode 100755 common_syms/battle_anim_8170478.txt create mode 100644 common_syms/battle_factory_screen.txt create mode 100644 common_syms/battle_main.txt create mode 100644 common_syms/battle_tower.txt create mode 100644 common_syms/berry_blender.txt create mode 100644 common_syms/bg.txt create mode 100644 common_syms/contest.txt create mode 100644 common_syms/field_camera.txt create mode 100644 common_syms/field_control_avatar.txt create mode 100644 common_syms/field_specials.txt create mode 100644 common_syms/fieldmap.txt create mode 100644 common_syms/intro.txt create mode 100644 common_syms/link.txt create mode 100644 common_syms/link_rfu.txt create mode 100644 common_syms/list_menu.txt create mode 100644 common_syms/load_save.txt create mode 100644 common_syms/m4a_2.txt create mode 100644 common_syms/main.txt create mode 100644 common_syms/mauville_old_man.txt create mode 100644 common_syms/overworld.txt create mode 100644 common_syms/pokedex.txt create mode 100644 common_syms/random.txt create mode 100644 common_syms/rtc.txt create mode 100644 common_syms/save.txt create mode 100644 common_syms/sound.txt create mode 100644 common_syms/sprite.txt create mode 100644 common_syms/start_menu.txt create mode 100644 common_syms/task.txt create mode 100644 common_syms/text.txt create mode 100644 common_syms/trainer_see.txt create mode 100644 common_syms/tv.txt create mode 100644 common_syms/window.txt diff --git a/Makefile b/Makefile index b046c90d7..32cc9df73 100644 --- a/Makefile +++ b/Makefile @@ -172,8 +172,14 @@ $(DATA_ASM_BUILDDIR)/%.o: $(DATA_ASM_SUBDIR)/%.s $$(data_dep) $(SONG_BUILDDIR)/%.o: $(SONG_SUBDIR)/%.s $(AS) $(ASFLAGS) -I sound -o $@ $< -$(OBJ_DIR)/sym_%.ld: sym_%.txt - $(CPP) -P $(CPPFLAGS) $< | sed -e "s#tools/#../../tools/#g" > $@ +$(OBJ_DIR)/sym_bss.ld: sym_bss.txt + $(RAMSCRGEN) .bss $< ENGLISH > $@ + +$(OBJ_DIR)/sym_common.ld: sym_common.txt $(C_OBJS) $(wildcard common_syms/*.txt) + $(RAMSCRGEN) COMMON $< ENGLISH -c $(C_BUILDDIR),common_syms > $@ + +$(OBJ_DIR)/sym_ewram.ld: sym_ewram.txt + $(RAMSCRGEN) ewram_data $< ENGLISH > $@ $(OBJ_DIR)/ld_script.ld: ld_script.txt $(OBJ_DIR)/sym_bss.ld $(OBJ_DIR)/sym_common.ld $(OBJ_DIR)/sym_ewram.ld cd $(OBJ_DIR) && sed "s#tools/#../../tools/#g" ../../ld_script.txt > ld_script.ld diff --git a/common_syms/agb_flash.txt b/common_syms/agb_flash.txt new file mode 100644 index 000000000..cb421ec80 --- /dev/null +++ b/common_syms/agb_flash.txt @@ -0,0 +1,10 @@ +gFlashTimeoutFlag +PollFlashStatus +WaitForFlashWrite +ProgramFlashSector +gFlash +ProgramFlashByte +gFlashNumRemainingBytes +EraseFlashChip +EraseFlashSector +gFlashMaxTime diff --git a/common_syms/apprentice.txt b/common_syms/apprentice.txt new file mode 100644 index 000000000..e35133ecc --- /dev/null +++ b/common_syms/apprentice.txt @@ -0,0 +1,3 @@ +gUnknown_030062EC +gUnknown_030062F0 +gUnknown_030062F4 diff --git a/common_syms/battle_anim_8170478.txt b/common_syms/battle_anim_8170478.txt new file mode 100755 index 000000000..2fc194df7 --- /dev/null +++ b/common_syms/battle_anim_8170478.txt @@ -0,0 +1,3 @@ +gUnknown_030062DC +gUnknown_030062E0 +gUnknown_030062E4 diff --git a/common_syms/battle_factory_screen.txt b/common_syms/battle_factory_screen.txt new file mode 100644 index 000000000..9f6868139 --- /dev/null +++ b/common_syms/battle_factory_screen.txt @@ -0,0 +1 @@ +gUnknown_030062E8 diff --git a/common_syms/battle_main.txt b/common_syms/battle_main.txt new file mode 100644 index 000000000..35a925946 --- /dev/null +++ b/common_syms/battle_main.txt @@ -0,0 +1,9 @@ +gPreBattleCallback1 +gBattleMainFunc +gBattleResults +gLeveledUpInBattle +gBattlerControllerFuncs +gHealthboxSpriteIds +gMultiUsePlayerCursor +gNumberOfMovesToChoose +gUnknown_03005D7C diff --git a/common_syms/battle_tower.txt b/common_syms/battle_tower.txt new file mode 100644 index 000000000..dd198e229 --- /dev/null +++ b/common_syms/battle_tower.txt @@ -0,0 +1 @@ +gUnknown_03006298 diff --git a/common_syms/berry_blender.txt b/common_syms/berry_blender.txt new file mode 100644 index 000000000..1b15a33d6 --- /dev/null +++ b/common_syms/berry_blender.txt @@ -0,0 +1 @@ +gInGameOpponentsNo diff --git a/common_syms/bg.txt b/common_syms/bg.txt new file mode 100644 index 000000000..2495d1646 --- /dev/null +++ b/common_syms/bg.txt @@ -0,0 +1 @@ +gUnneededFireRedVariable diff --git a/common_syms/contest.txt b/common_syms/contest.txt new file mode 100644 index 000000000..6a519fb46 --- /dev/null +++ b/common_syms/contest.txt @@ -0,0 +1 @@ +gContestRngValue diff --git a/common_syms/field_camera.txt b/common_syms/field_camera.txt new file mode 100644 index 000000000..02301ce23 --- /dev/null +++ b/common_syms/field_camera.txt @@ -0,0 +1,3 @@ +gFieldCamera +gTotalCameraPixelOffsetY +gTotalCameraPixelOffsetX diff --git a/common_syms/field_control_avatar.txt b/common_syms/field_control_avatar.txt new file mode 100644 index 000000000..0f336a407 --- /dev/null +++ b/common_syms/field_control_avatar.txt @@ -0,0 +1 @@ +gSelectedEventObject diff --git a/common_syms/field_specials.txt b/common_syms/field_specials.txt new file mode 100644 index 000000000..25d874a65 --- /dev/null +++ b/common_syms/field_specials.txt @@ -0,0 +1 @@ +gUnknown_030061D0 diff --git a/common_syms/fieldmap.txt b/common_syms/fieldmap.txt new file mode 100644 index 000000000..0ead75846 --- /dev/null +++ b/common_syms/fieldmap.txt @@ -0,0 +1 @@ +gBackupMapLayout diff --git a/common_syms/intro.txt b/common_syms/intro.txt new file mode 100644 index 000000000..d069b1014 --- /dev/null +++ b/common_syms/intro.txt @@ -0,0 +1,2 @@ +gIntroFrameCounter +gMultibootProgramStruct diff --git a/common_syms/link.txt b/common_syms/link.txt new file mode 100644 index 000000000..a6d096116 --- /dev/null +++ b/common_syms/link.txt @@ -0,0 +1,37 @@ +gLinkPartnersHeldKeys +gLinkDebugSeed +gLocalLinkPlayerBlock +gLinkErrorOccurred +gLinkDebugFlags +gFiller_03003074 +gRemoteLinkPlayersNotReceived +gBlockReceivedStatus +gFiller_03003080 +gLinkHeldKeys +gRecvCmds +gLinkStatus +gUnknown_030030E4 +gUnknown_030030E8 +gUnknown_030030EC +gUnknown_030030F0 +gUnknown_030030F4 +gSuppressLinkErrorMessage +gWirelessCommType +gSavedLinkPlayerCount +gSendCmd +gSavedMultiplayerId +gReceivedRemoteLinkPlayers +gLinkTestBGInfo +gLinkCallback +gShouldAdvanceLinkState +gLinkTestBlockChecksums +gBlockRequestType +gFiller_03003154 +gFiller_03003158 +gFiller_0300315c +gLastSendQueueCount +gLink +gLastRecvQueueCount +gLinkSavedIme +gFiller_03004138 +gFiller_0300413C diff --git a/common_syms/link_rfu.txt b/common_syms/link_rfu.txt new file mode 100644 index 000000000..67dd00ca7 --- /dev/null +++ b/common_syms/link_rfu.txt @@ -0,0 +1,2 @@ +gUnknown_03004140 +gUnknown_03005000 diff --git a/common_syms/list_menu.txt b/common_syms/list_menu.txt new file mode 100644 index 000000000..ed5343618 --- /dev/null +++ b/common_syms/list_menu.txt @@ -0,0 +1,2 @@ +gListMenuOverride +gMultiuseListMenuTemplate diff --git a/common_syms/load_save.txt b/common_syms/load_save.txt new file mode 100644 index 000000000..2d3d9b802 --- /dev/null +++ b/common_syms/load_save.txt @@ -0,0 +1,4 @@ +gFlashMemoryPresent +gSaveBlock1Ptr +gSaveBlock2Ptr +gPokemonStoragePtr diff --git a/common_syms/m4a_2.txt b/common_syms/m4a_2.txt new file mode 100644 index 000000000..0d6b13a79 --- /dev/null +++ b/common_syms/m4a_2.txt @@ -0,0 +1,12 @@ +gSoundInfo +gPokemonCrySongs +gPokemonCryMusicPlayers +gMPlayInfo_BGM +gMPlayJumpTable +gCgbChans +gMPlayInfo_SE1 +gMPlayInfo_SE2 +gPokemonCryTracks +gPokemonCrySong +gMPlayMemAccArea +gMPlayInfo_SE3 diff --git a/common_syms/main.txt b/common_syms/main.txt new file mode 100644 index 000000000..a620083d1 --- /dev/null +++ b/common_syms/main.txt @@ -0,0 +1,9 @@ +gKeyRepeatStartDelay +gLinkTransferringData +gMain +gKeyRepeatContinueDelay +gSoftResetDisabled +gIntrTable +gLinkVSyncDisabled +IntrMain_Buffer +gPcmDmaCounter diff --git a/common_syms/mauville_old_man.txt b/common_syms/mauville_old_man.txt new file mode 100644 index 000000000..9d77b8692 --- /dev/null +++ b/common_syms/mauville_old_man.txt @@ -0,0 +1 @@ +gBardSong diff --git a/common_syms/overworld.txt b/common_syms/overworld.txt new file mode 100644 index 000000000..b92da84ec --- /dev/null +++ b/common_syms/overworld.txt @@ -0,0 +1,8 @@ +gBGTilemapBuffers1 +gBGTilemapBuffers2 +gBGTilemapBuffers3 +gUnknown_03005DA8 +gFieldCallback +gFieldCallback2 +gUnknown_03005DB4 +gFieldLinkPlayerCount diff --git a/common_syms/pokedex.txt b/common_syms/pokedex.txt new file mode 100644 index 000000000..c982c9d3a --- /dev/null +++ b/common_syms/pokedex.txt @@ -0,0 +1,2 @@ +gUnknown_030060B0 +gUnknown_030060B4 diff --git a/common_syms/random.txt b/common_syms/random.txt new file mode 100644 index 000000000..8037c6958 --- /dev/null +++ b/common_syms/random.txt @@ -0,0 +1,2 @@ +gRngValue +gRng2Value diff --git a/common_syms/rtc.txt b/common_syms/rtc.txt new file mode 100644 index 000000000..fa00a34d5 --- /dev/null +++ b/common_syms/rtc.txt @@ -0,0 +1 @@ +gLocalTime diff --git a/common_syms/save.txt b/common_syms/save.txt new file mode 100644 index 000000000..d7668c332 --- /dev/null +++ b/common_syms/save.txt @@ -0,0 +1,13 @@ +gLastWrittenSector +gLastSaveCounter +gLastKnownGoodSector +gDamagedSaveSectors +gSaveCounter +gFastSaveSection +gUnknown_03006208 +gSaveUnusedVar +gSaveFileStatus +gGameContinueCallback +gRamSaveSectionLocations +gSaveUnusedVar2 +gUnknown_03006294 diff --git a/common_syms/sound.txt b/common_syms/sound.txt new file mode 100644 index 000000000..0f6f2fc75 --- /dev/null +++ b/common_syms/sound.txt @@ -0,0 +1 @@ +gDisableMusic diff --git a/common_syms/sprite.txt b/common_syms/sprite.txt new file mode 100644 index 000000000..627c01c0d --- /dev/null +++ b/common_syms/sprite.txt @@ -0,0 +1,2 @@ +gOamMatrixAllocBitmap +gReservedSpritePaletteCount diff --git a/common_syms/start_menu.txt b/common_syms/start_menu.txt new file mode 100644 index 000000000..05beaf57c --- /dev/null +++ b/common_syms/start_menu.txt @@ -0,0 +1 @@ +gMenuCallback diff --git a/common_syms/task.txt b/common_syms/task.txt new file mode 100644 index 000000000..6601bd11b --- /dev/null +++ b/common_syms/task.txt @@ -0,0 +1 @@ +gTasks diff --git a/common_syms/text.txt b/common_syms/text.txt new file mode 100644 index 000000000..4406c8bf9 --- /dev/null +++ b/common_syms/text.txt @@ -0,0 +1,4 @@ +gFonts +gUnknown_03002F84 +gUnknown_03002F90 +gTextFlags diff --git a/common_syms/trainer_see.txt b/common_syms/trainer_see.txt new file mode 100644 index 000000000..2d0514325 --- /dev/null +++ b/common_syms/trainer_see.txt @@ -0,0 +1,5 @@ +gUnknown_03006080 +gUnknown_03006084 +gApproachingTrainers +gNoOfApproachingTrainers +gUnknown_030060AC diff --git a/common_syms/tv.txt b/common_syms/tv.txt new file mode 100644 index 000000000..0370f65e1 --- /dev/null +++ b/common_syms/tv.txt @@ -0,0 +1,4 @@ +sCurTVShowSlot +sTV_SecretBaseVisitMovesTemp +sTV_DecorationsBuffer +sTV_SecretBaseVisitMonsTemp diff --git a/common_syms/window.txt b/common_syms/window.txt new file mode 100644 index 000000000..e1b52a24f --- /dev/null +++ b/common_syms/window.txt @@ -0,0 +1,5 @@ +filler_03002F58 +filler_03002F5C +gUnknown_03002F60 +filler_03002F64 +gUnknown_03002F70 diff --git a/sym_bss.txt b/sym_bss.txt index e2b3ff674..ae4e5dadf 100644 --- a/sym_bss.txt +++ b/sym_bss.txt @@ -1,118 +1,119 @@ -. = ALIGN(4); src/main.o(.bss); -. = ALIGN(4); src/alloc.o(.bss); -. = ALIGN(4); src/dma3_manager.o(.bss); -. = ALIGN(4); src/gpu_regs.o(.bss); -. = ALIGN(4); src/bg.o(.bss); -. = ALIGN(4); src/text.o(.bss); -. = ALIGN(4); src/sprite.o(.bss); -. = ALIGN(4); src/link.o(.bss); -. = ALIGN(4); src/link_rfu.o(.bss); -. = ALIGN(4); src/rom_8011DC0.o(.bss); -. = ALIGN(4); src/rtc.o(.bss); -. = ALIGN(4); src/main_menu.o(.bss); -. = ALIGN(4); src/rom_8034C54.o(.bss); -. = ALIGN(4); src/egg_hatch.o(.bss); -. = ALIGN(4); src/berry_blender.o(.bss); -. = ALIGN(4); src/play_time.o(.bss); -. = ALIGN(4); src/overworld.o(.bss); -. = ALIGN(4); src/field_camera.o(.bss); -. = ALIGN(4); src/script.o(.bss); -. = ALIGN(4); src/scrcmd.o(.bss); -. = ALIGN(4); src/tileset_anims.o(.bss); -. = ALIGN(4); src/palette.o(.bss); -. = ALIGN(4); src/sound.o(.bss); -. = ALIGN(4); src/field_weather.o(.bss); -. = ALIGN(4); src/field_effect.o(.bss); -. = ALIGN(4); src/pokemon_storage_system.o(.bss); -. = ALIGN(4); src/fldeff_cut.o(.bss); -. = ALIGN(4); src/script_menu.o(.bss); -. = ALIGN(4); src/record_mixing.o(.bss); -. = ALIGN(4); src/tv.o(.bss); -. = ALIGN(4); src/mauville_old_man.o(.bss); -. = ALIGN(4); src/menu_helpers.o(.bss); -. = ALIGN(4); src/region_map.o(.bss); -. = ALIGN(4); src/slot_machine.o(.bss); -. = ALIGN(4); src/contest_painting.o(.bss); -. = ALIGN(4); src/starter_choose.o(.bss); -. = ALIGN(4); src/pokedex_area_screen.o(.bss); -. = ALIGN(4); src/battle_transition.o(.bss); -. = ALIGN(4); src/pokemon_animation.o(.bss); -. = ALIGN(4); src/recorded_battle.o(.bss); -. = ALIGN(4); src/battle_factory_screen.o(.bss); -. = ALIGN(4); src/battle_factory.o(.bss); -. = ALIGN(4); src/battle_pike.o(.bss); -. = ALIGN(4); src/battle_tent.o(.bss); -. = ALIGN(4); src/multiboot.o(.bss); -. = ALIGN(4); src/mirage_tower.o(.bss); -. = ALIGN(4); src/berry_fix_program.o(.bss); -gUnknown_030012BC = .; - . += 0x4; + .include "src/main.o" + .include "src/alloc.o" + .include "src/dma3_manager.o" + .include "src/gpu_regs.o" + .include "src/bg.o" + .include "src/text.o" + .include "src/sprite.o" + .include "src/link.o" + .include "src/link_rfu.o" + .include "src/rom_8011DC0.o" + .include "src/rtc.o" + .include "src/main_menu.o" + .include "src/rom_8034C54.o" + .include "src/egg_hatch.o" + .include "src/berry_blender.o" + .include "src/play_time.o" + .include "src/overworld.o" + .include "src/field_camera.o" + .include "src/script.o" + .include "src/scrcmd.o" + .include "src/tileset_anims.o" + .include "src/palette.o" + .include "src/sound.o" + .include "src/field_weather.o" + .include "src/field_effect.o" + .include "src/pokemon_storage_system.o" + .include "src/fldeff_cut.o" + .include "src/script_menu.o" + .include "src/record_mixing.o" + .include "src/tv.o" + .include "src/mauville_old_man.o" + .include "src/menu_helpers.o" + .include "src/region_map.o" + .include "src/slot_machine.o" + .include "src/contest_painting.o" + .include "src/starter_choose.o" + .include "src/pokedex_area_screen.o" + .include "src/battle_transition.o" + .include "src/pokemon_animation.o" + .include "src/recorded_battle.o" + .include "src/battle_factory_screen.o" + .include "src/battle_factory.o" + .include "src/battle_pike.o" + .include "src/battle_tent.o" + .include "src/multiboot.o" + .include "src/mirage_tower.o" + .include "src/berry_fix_program.o" -gUnknown_030012C0 = .; - . += 0x4; +gUnknown_030012BC: @ 30012BC + .space 0x4 -gUnknown_030012C4 = .; - . += 0x4; +gUnknown_030012C0: @ 30012C0 + .space 0x4 -gUnknown_030012C8 = .; - . += 0x18; +gUnknown_030012C4: @ 30012C4 + .space 0x4 -gUnknown_030012E0 = .; - . += 0x2; +gUnknown_030012C8: @ 30012C8 + .space 0x18 -gUnknown_030012E2 = .; - . += 0x2; +gUnknown_030012E0: @ 30012E0 + .space 0x2 -gUnknown_030012E4 = .; - . += 0x2; +gUnknown_030012E2: @ 30012E2 + .space 0x2 -gUnknown_030012E6 = .; - . += 0x2; +gUnknown_030012E4: @ 30012E4 + .space 0x2 -gUnknown_030012E8 = .; - . += 0x4; +gUnknown_030012E6: @ 30012E6 + .space 0x2 -gUnknown_030012EC = .; - . += 0x2; +gUnknown_030012E8: @ 30012E8 + .space 0x4 -gUnknown_030012EE = .; - . += 0x2; +gUnknown_030012EC: @ 30012EC + .space 0x2 -gUnknown_030012F0 = .; - . += 0x2; +gUnknown_030012EE: @ 30012EE + .space 0x2 -gUnknown_030012F2 = .; - . += 0x2; +gUnknown_030012F0: @ 30012F0 + .space 0x2 -gUnknown_030012F4 = .; - . += 0x4; +gUnknown_030012F2: @ 30012F2 + .space 0x2 -gUnknown_030012F8 = .; - . += 0x2; +gUnknown_030012F4: @ 30012F4 + .space 0x4 -gUnknown_030012FA = .; - . += 0x2; +gUnknown_030012F8: @ 30012F8 + .space 0x2 -gUnknown_030012FC = .; - . += 0x4; +gUnknown_030012FA: @ 30012FA + .space 0x2 -gUnknown_03001300 = .; - . += 0x40; +gUnknown_030012FC: @ 30012FC + .space 0x4 -gMPlayTrack_BGM = .; - . += 0x320; +gUnknown_03001300: @ 3001300 + .space 0x40 -gMPlayTrack_SE1 = .; - . += 0xF0; +gMPlayTrack_BGM: @ 3001340 + .space 0x320 -gMPlayTrack_SE2 = .; - . += 0x2D0; +gMPlayTrack_SE1: @ 3001660 + .space 0xF0 -gMPlayTrack_SE3 = .; - . += 0x50; +gMPlayTrack_SE2: @ 3001750 + .space 0x2D0 -. = ALIGN(4); src/agb_flash.o(.bss); -. = ALIGN(4); src/siirtc.o(.bss); -. = ALIGN(4); *libgcc.a:dp-bit.o(.bss); -. = ALIGN(4); *libgcc.a:fp-bit.o(.bss); -. = ALIGN(4); *libc.a:syscalls.o(.bss); +gMPlayTrack_SE3: @ 3001A20 + .space 0x50 + + .include "src/agb_flash.o" + .include "src/siirtc.o" + .include "*libgcc.a:dp-bit.o" + .include "*libgcc.a:fp-bit.o" + .include "*libc.a:syscalls.o" diff --git a/sym_common.txt b/sym_common.txt index b13989de3..3a7d698fd 100644 --- a/sym_common.txt +++ b/sym_common.txt @@ -1,260 +1,116 @@ -#define SYMBOL(name, size) \ - . = ALIGN (((size) > 16) ? 16 : (size)); \ - . = ALIGN(4); \ - name = .; \ - . += size; + .space 0x8 + .include "main.o" + .include "bg.o" + .include "window.o" + .include "text.o" + .include "sprite.o" + .include "link.o" + .include "link_rfu.o" + .include "rtc.o" + .include "battle_main.o" + .include "random.o" + .include "load_save.o" + .include "berry_blender.o" + .include "overworld.o" + .include "fieldmap.o" + .include "field_camera.o" + .include "field_control_avatar.o" + .include "start_menu.o" + .include "sound.o" + .include "task.o" + .include "trainer_see.o" + .include "pokedex.o" + .include "contest.o" + .include "tv.o" + .include "mauville_old_man.o" +gUnknown_03006164: @ 3006164 + .space 0x4 +gUnknown_03006168: @ 3006168 + .space 0x4 -. += 0x8; -// main.c -SYMBOL(gKeyRepeatStartDelay, 4) -SYMBOL(gLinkTransferringData, 4) -SYMBOL(gMain, 1084) -SYMBOL(gKeyRepeatContinueDelay, 4) -SYMBOL(gSoftResetDisabled, 4) -SYMBOL(gIntrTable, 56) -SYMBOL(gLinkVSyncDisabled, 4) -SYMBOL(IntrMain_Buffer, 2048) -SYMBOL(gPcmDmaCounter, 4) +gUnknown_0300616C: @ 300616C + .space 0x4 -// bg.c -SYMBOL(gUnneededFireRedVariable, 4) +gUnknown_03006170: @ 3006170 + .space 0x4 -// window.c -SYMBOL(filler_03002F58, 4) -SYMBOL(filler_03002F5C, 4) -SYMBOL(gUnknown_03002F60, 4) -SYMBOL(filler_03002F64, 4) -SYMBOL(gUnknown_03002F70, 16) +gUnknown_03006174: @ 3006174 + .space 0x4 -// text.c -SYMBOL(gFonts, 4) -SYMBOL(gUnknown_03002F84, 4) -SYMBOL(gUnknown_03002F90, 132) -SYMBOL(gTextFlags, 4) +gUnknown_03006178: @ 3006178 + .space 0x4 -// sprite.c -SYMBOL(gOamMatrixAllocBitmap, 4) -SYMBOL(gReservedSpritePaletteCount, 4) +gUnknown_0300617C: @ 300617C + .space 0x4 -// link.c -. = ALIGN(16); -gLinkPartnersHeldKeys = .; - . += 0xC; -SYMBOL(gLinkDebugSeed, 4) -SYMBOL(gLocalLinkPlayerBlock, 60) -SYMBOL(gLinkErrorOccurred, 4) -SYMBOL(gLinkDebugFlags, 4) -SYMBOL(gFiller_03003074, 4) -SYMBOL(gRemoteLinkPlayersNotReceived, 4) -SYMBOL(gBlockReceivedStatus, 4) -SYMBOL(gFiller_03003080, 4) -SYMBOL(gLinkHeldKeys, 4) -SYMBOL(gRecvCmds, 80) -SYMBOL(gLinkStatus, 4) -SYMBOL(gUnknown_030030E4, 4) -SYMBOL(gUnknown_030030E8, 4) -SYMBOL(gUnknown_030030EC, 4) -SYMBOL(gUnknown_030030F0, 4) -SYMBOL(gUnknown_030030F4, 4) -SYMBOL(gSuppressLinkErrorMessage, 4) -SYMBOL(gWirelessCommType, 4) -SYMBOL(gSavedLinkPlayerCount, 4) -SYMBOL(gSendCmd, 16) -SYMBOL(gSavedMultiplayerId, 4) -SYMBOL(gReceivedRemoteLinkPlayers, 4) -SYMBOL(gLinkTestBGInfo, 16) -SYMBOL(gLinkCallback, 4) -SYMBOL(gShouldAdvanceLinkState, 4) -SYMBOL(gLinkTestBlockChecksums, 8) -SYMBOL(gBlockRequestType, 4) -SYMBOL(gFiller_03003154, 4) -SYMBOL(gFiller_03003158, 4) -SYMBOL(gFiller_0300315c, 4) -SYMBOL(gLastSendQueueCount, 4) -SYMBOL(gLink, 4032) -SYMBOL(gLastRecvQueueCount, 4) -SYMBOL(gLinkSavedIme, 4) -SYMBOL(gFiller_03004138, 4) -SYMBOL(gFiller_0300413C, 4) +gUnknown_03006180: @ 3006180 + .space 0x4 -// link_rfu.c -SYMBOL(gUnknown_03004140, 3776) -SYMBOL(gUnknown_03005000, 3316) +gUnknown_03006184: @ 3006184 + .space 0x4 -// rtc.c -SYMBOL(gLocalTime, 8) +gUnknown_03006188: @ 3006188 + .space 0x8 -// battle_main.c -SYMBOL(gPreBattleCallback1, 4) -SYMBOL(gBattleMainFunc, 4) -SYMBOL(gBattleResults, 68) -SYMBOL(gLeveledUpInBattle, 4) -SYMBOL(gBattlerControllerFuncs, 16); -SYMBOL(gHealthboxSpriteIds, 4) -SYMBOL(gMultiUsePlayerCursor, 4) -SYMBOL(gNumberOfMovesToChoose, 4) -SYMBOL(gUnknown_03005D7C, 4) +gUnknown_03006190: @ 3006190 + .space 0x10 -// random.c -SYMBOL(gRngValue, 4) -SYMBOL(gRng2Value, 4) +gUnknown_030061A0: @ 30061A0 + .space 0x20 -// load_save.c -SYMBOL(gFlashMemoryPresent, 4) -SYMBOL(gSaveBlock1Ptr, 4) -SYMBOL(gSaveBlock2Ptr, 4) -SYMBOL(gPokemonStoragePtr, 4) +gUnknown_030061C0: @ 30061C0 + .space 0x4 -// berry_blender.c -SYMBOL(gInGameOpponentsNo, 4) +gContestPaintingMonPalette: @ 30061C4 + .space 0xC -// overworld.c -SYMBOL(gBGTilemapBuffers1, 4) -SYMBOL(gBGTilemapBuffers2, 4) -SYMBOL(gBGTilemapBuffers3, 4) -SYMBOL(gUnknown_03005DA8, 4) -SYMBOL(gFieldCallback, 4) -SYMBOL(gFieldCallback2, 4) -SYMBOL(gUnknown_03005DB4, 4) -SYMBOL(gFieldLinkPlayerCount, 4) + .include "field_specials.o" -// fieldmap.c -SYMBOL(gBackupMapLayout, 12) +gCB2_AfterEvolution: @ 30061E8 + .space 0x4 -// field_camera.c -SYMBOL(gFieldCamera, 24) -SYMBOL(gTotalCameraPixelOffsetY, 4) -SYMBOL(gTotalCameraPixelOffsetX, 4) +gDexCryScreenState: @ 30061EC + .space 0x4 -// field_control_avatar.c -SYMBOL(gSelectedEventObject, 4) - -// start_menu.c -SYMBOL(gMenuCallback, 4) - -// sound.c -SYMBOL(gDisableMusic, 4) - -// task.c -SYMBOL(gTasks, 640) - -// trainer_see.c -SYMBOL(gUnknown_03006080, 4) -SYMBOL(gUnknown_03006084, 4) -SYMBOL(gApproachingTrainers, 24) -SYMBOL(gNoOfApproachingTrainers, 4) -SYMBOL(gUnknown_030060AC, 4) - -// pokedex.c -SYMBOL(gUnknown_030060B0, 4) -SYMBOL(gUnknown_030060B4, 4) - -// contest.c -SYMBOL(gContestRngValue, 4) - -// tv.c -SYMBOL(sCurTVShowSlot, 4) -SYMBOL(sTV_SecretBaseVisitMovesTemp, 16) -SYMBOL(sTV_DecorationsBuffer, 16) -SYMBOL(sTV_SecretBaseVisitMonsTemp, 80) - -// mauville_old_man.c -SYMBOL(gBardSong, 52) - -SYMBOL(gUnknown_03006164, 4) -SYMBOL(gUnknown_03006168, 4) -SYMBOL(gUnknown_0300616C, 4) -SYMBOL(gUnknown_03006170, 4) -SYMBOL(gUnknown_03006174, 4) -SYMBOL(gUnknown_03006178, 4) -SYMBOL(gUnknown_0300617C, 4) -SYMBOL(gUnknown_03006180, 4) -SYMBOL(gUnknown_03006184, 4) -SYMBOL(gUnknown_03006188, 8) -SYMBOL(gUnknown_03006190, 16) -SYMBOL(gUnknown_030061A0, 32) -SYMBOL(gUnknown_030061C0, 4) -gContestPaintingMonPalette = .; - . += 0xC; + .include "save.o" + .include "battle_tower.o" + .include "intro.o" + .include "battle_anim_8170478.o" + .include "battle_factory_screen.o" + .include "apprentice.o" -// field_specials.c -SYMBOL(gUnknown_030061D0, 24) -SYMBOL(gCB2_AfterEvolution, 4) -SYMBOL(gDexCryScreenState, 4) + .space 0x8 + + .include "list_menu.o" -// save.c -SYMBOL(gLastWrittenSector, 4) -SYMBOL(gLastSaveCounter, 4) -SYMBOL(gLastKnownGoodSector, 4) -SYMBOL(gDamagedSaveSectors, 4) -SYMBOL(gSaveCounter, 4) -SYMBOL(gFastSaveSection, 4) -SYMBOL(gUnknown_03006208, 4) -SYMBOL(gSaveUnusedVar, 4) -SYMBOL(gSaveFileStatus, 4) -SYMBOL(gGameContinueCallback, 4) -SYMBOL(gRamSaveSectionLocations, 112) -SYMBOL(gSaveUnusedVar2, 4) -SYMBOL(gUnknown_03006294, 4) +gUnknown_03006328: @ 3006328 + .space 0x48 -// battle_tower.c -SYMBOL(gUnknown_03006298,8) +gUnknown_03006370: @ 3006370 + .space 0x10 -// intro.c -SYMBOL(gIntroFrameCounter, 4) -SYMBOL(gMultibootProgramStruct, 44) + .include "m4a_2.o" + .include "agb_flash.o" -// battle_anim_81470478 -SYMBOL(gUnknown_030062DC, 4) -SYMBOL(gUnknown_030062E0, 4) -SYMBOL(gUnknown_030062E4, 4) +gRfuState: @ 3007868 + .space 0x8 -// battle_factory_screen.c -SYMBOL(gUnknown_030062E8, 4) +gUnknown_03007870: @ 3007870 + .space 0x10 -// apprentice.c -SYMBOL(gUnknown_030062EC, 4) -SYMBOL(gUnknown_030062F0, 4) -SYMBOL(gUnknown_030062F4, 12) +gUnknown_03007880: @ 3007880 + .space 0x10 -SYMBOL(gListMenuOverride, 4) -SYMBOL(gMultiuseListMenuTemplate, 24) -gUnknown_03006328 = .; - . += 0x48; -SYMBOL(gUnknown_03006370, 16) +gUnknown_03007890: @ 3007890 + .space 0x4 -// m4a_2 -SYMBOL(gSoundInfo, 4016) -SYMBOL(gPokemonCrySongs, 104) -SYMBOL(gPokemonCryMusicPlayers, 128) -SYMBOL(gMPlayInfo_BGM, 64) -SYMBOL(gMPlayJumpTable, 144) -SYMBOL(gCgbChans, 256) -SYMBOL(gMPlayInfo_SE1, 64) -SYMBOL(gMPlayInfo_SE2, 64) -SYMBOL(gPokemonCryTracks, 320) -SYMBOL(gPokemonCrySong, 52) -SYMBOL(gMPlayMemAccArea, 16) -SYMBOL(gMPlayInfo_SE3, 64) +gUnknown_03007894: @ 3007894 + .space 0x4 -// agb_flash.c -SYMBOL(gFlashTimeoutFlag, 4); -SYMBOL(PollFlashStatus, 4) -SYMBOL(WaitForFlashWrite, 4) -SYMBOL(ProgramFlashSector, 4) -SYMBOL(gFlash, 4) -SYMBOL(ProgramFlashByte, 4) -SYMBOL(gFlashNumRemainingBytes, 4) -SYMBOL(EraseFlashChip, 4) -SYMBOL(EraseFlashSector, 4) -SYMBOL(gFlashMaxTime, 4) +gUnknown_03007898: @ 3007898 + .space 0x8 -SYMBOL(gRfuState, 8) -SYMBOL(gUnknown_03007870, 16) -SYMBOL(gUnknown_03007880, 16) -SYMBOL(gUnknown_03007890, 4) -SYMBOL(gUnknown_03007894, 4) -SYMBOL(gUnknown_03007898, 8) -SYMBOL(gUnknown_030078A0, 16) +gUnknown_030078A0: @ 30078A0 + .space 0xC diff --git a/sym_ewram.txt b/sym_ewram.txt index 0a1fe13e6..75a44bb97 100644 --- a/sym_ewram.txt +++ b/sym_ewram.txt @@ -1,282 +1,292 @@ -. = ALIGN(4); src/decompress.o(ewram_data); -. = ALIGN(4); src/main.o(ewram_data); -. = ALIGN(4); src/window.o(ewram_data); -. = ALIGN(4); src/text.o(ewram_data); -. = ALIGN(4); src/sprite.o(ewram_data); -. = ALIGN(4); src/string_util.o(ewram_data); -. = ALIGN(4); src/link.o(ewram_data); -. = ALIGN(4); src/link_rfu.o(ewram_data); -gUnknown_02022C20 = .; - . += 0xC; + .include "src/decompress.o" + .include "src/main.o" + .include "src/window.o" + .include "src/text.o" + .include "src/sprite.o" + .include "src/string_util.o" + .include "src/link.o" + .include "src/link_rfu.o" -gUnknown_02022C2C = .; - . += 0x1; +gUnknown_02022C20: @ 2022C20 + .space 0xC -gUnknown_02022C2D = .; - . += 0x3; +gUnknown_02022C2C: @ 2022C2C + .space 0x1 -gUnknown_02022C30 = .; - . += 0x8; +gUnknown_02022C2D: @ 2022C2D + .space 0x3 -gUnknown_02022C38 = .; - . += 0x4; +gUnknown_02022C30: @ 2022C30 + .space 0x8 -gUnknown_02022C3C = .; - . += 0x2; +gUnknown_02022C38: @ 2022C38 + .space 0x4 -gUnknown_02022C3E = .; - . += 0x2; +gUnknown_02022C3C: @ 2022C3C + .space 0x2 -gUnknown_02022C40 = .; - . += 0x18; +gUnknown_02022C3E: @ 2022C3E + .space 0x2 -gUnknown_02022C58 = .; - . += 0x8; +gUnknown_02022C40: @ 2022C40 + .space 0x18 -gUnknown_02022C60 = .; - . += 0x4; +gUnknown_02022C58: @ 2022C58 + .space 0x8 -gUnknown_02022C64 = .; - . += 0x4; +gUnknown_02022C60: @ 2022C60 + .space 0x4 -gUnknown_02022C68 = .; - . += 0x4; +gUnknown_02022C64: @ 2022C64 + .space 0x4 -gUnknown_02022C6C = .; - . += 0x4; +gUnknown_02022C68: @ 2022C68 + .space 0x4 -gUnknown_02022C70 = .; - . += 0x4; +gUnknown_02022C6C: @ 2022C6C + .space 0x4 -gUnknown_02022C74 = .; - . += 0x4; +gUnknown_02022C70: @ 2022C70 + .space 0x4 -gUnknown_02022C78 = .; - . += 0x4; +gUnknown_02022C74: @ 2022C74 + .space 0x4 -gUnknown_02022C7C = .; - . += 0x4; +gUnknown_02022C78: @ 2022C78 + .space 0x4 -gUnknown_02022C80 = .; - . += 0x4; +gUnknown_02022C7C: @ 2022C7C + .space 0x4 -gUnknown_02022C84 = .; - . += 0x4; +gUnknown_02022C80: @ 2022C80 + .space 0x4 -gUnknown_02022C88 = .; - . += 0x4; +gUnknown_02022C84: @ 2022C84 + .space 0x4 -gUnknown_02022C8C = .; - . += 0x4; +gUnknown_02022C88: @ 2022C88 + .space 0x4 -gUnknown_02022C90 = .; - . += 0x4; +gUnknown_02022C8C: @ 2022C8C + .space 0x4 -gUnknown_02022C94 = .; - . += 0x4; +gUnknown_02022C90: @ 2022C90 + .space 0x4 -gUnknown_02022C98 = .; - . += 0x4; +gUnknown_02022C94: @ 2022C94 + .space 0x4 -gUnknown_02022C9C = .; - . += 0x14; +gUnknown_02022C98: @ 2022C98 + .space 0x4 -gUnknown_02022CB0 = .; - . += 0x8; +gUnknown_02022C9C: @ 2022C9C + .space 0x14 -gUnknown_02022CB8 = .; - . += 0x2C; +gUnknown_02022CB0: @ 2022CB0 + .space 0x8 -gUnknown_02022CE4 = .; - . += 0x10; +gUnknown_02022CB8: @ 2022CB8 + .space 0x2C -gUnknown_02022CF4 = .; - . += 0x4; +gUnknown_02022CE4: @ 2022CE4 + .space 0x10 -gUnknown_02022CF8 = .; - . += 0x4; +gUnknown_02022CF4: @ 2022CF4 + .space 0x4 -gUnknown_02022CFC = .; - . += 0x4; +gUnknown_02022CF8: @ 2022CF8 + .space 0x4 -gUnknown_02022D00 = .; - . += 0x4; +gUnknown_02022CFC: @ 2022CFC + .space 0x4 -. = ALIGN(4); src/main_menu.o(ewram_data); -. = ALIGN(4); src/battle_controllers.o(ewram_data); -. = ALIGN(4); src/rom_8034C54.o(ewram_data); -. = ALIGN(4); src/battle_main.o(ewram_data); -. = ALIGN(4); src/pokemon.o(ewram_data); -. = ALIGN(4); src/random.o(ewram_data); -. = ALIGN(4); src/daycare.o(ewram_data); -. = ALIGN(4); src/load_save.o(ewram_data); -. = ALIGN(4); src/trade.o(ewram_data); -. = ALIGN(4); src/berry_blender.o(ewram_data); -. = ALIGN(4); src/new_game.o(ewram_data); -. = ALIGN(4); src/overworld.o(ewram_data); -. = ALIGN(4); src/fieldmap.o(ewram_data); -. = ALIGN(4); src/field_camera.o(ewram_data); -. = ALIGN(4); src/field_player_avatar.o(ewram_data); -. = ALIGN(4); src/event_object_movement.o(ewram_data); -. = ALIGN(4); src/field_message_box.o(ewram_data); -. = ALIGN(4); src/scrcmd.o(ewram_data); -. = ALIGN(4); src/field_control_avatar.o(ewram_data); -. = ALIGN(4); src/event_data.o(ewram_data); -. = ALIGN(4); src/start_menu.o(ewram_data); -. = ALIGN(4); src/tileset_anims.o(ewram_data); -. = ALIGN(4); src/palette.o(ewram_data); -. = ALIGN(4); src/sound.o(ewram_data); -. = ALIGN(4); src/battle_anim.o(ewram_data); -. = ALIGN(4); src/battle_anim_80A5C6C.o(ewram_data); - . += 0xC; +gUnknown_02022D00: @ 2022D00 + .space 0x4 -. = ALIGN(4); src/field_weather.o(ewram_data); -. = ALIGN(4); src/field_weather_effect.o(ewram_data); -. = ALIGN(4); src/battle_setup.o(ewram_data); -. = ALIGN(4); src/trainer_see.o(ewram_data); -. = ALIGN(4); src/wild_encounter.o(ewram_data); -. = ALIGN(4); src/field_effect.o(ewram_data); -. = ALIGN(4); src/scanline_effect.o(ewram_data); -. = ALIGN(4); src/option_menu.o(ewram_data); -. = ALIGN(4); src/pokedex.o(ewram_data); -gTrainerCards = .; - . += 0x14; + .include "src/main_menu.o" + .include "src/battle_controllers.o" + .include "src/rom_8034C54.o" + .include "src/battle_main.o" + .include "src/pokemon.o" + .include "src/random.o" + .include "src/daycare.o" + .include "src/load_save.o" + .include "src/trade.o" + .include "src/berry_blender.o" + .include "src/new_game.o" + .include "src/overworld.o" + .include "src/fieldmap.o" + .include "src/field_camera.o" + .include "src/field_player_avatar.o" + .include "src/event_object_movement.o" + .include "src/field_message_box.o" + .include "src/scrcmd.o" + .include "src/field_control_avatar.o" + .include "src/event_data.o" + .include "src/start_menu.o" + .include "src/tileset_anims.o" + .include "src/palette.o" + .include "src/sound.o" + .include "src/battle_anim.o" + .include "src/battle_anim_80A5C6C.o" -gUnknown_02039B6C = .; - . += 0x2; + .space 0xC + .include "src/field_weather.o" + .include "src/field_weather_effect.o" + .include "src/battle_setup.o" + .include "src/trainer_see.o" + .include "src/wild_encounter.o" + .include "src/field_effect.o" + .include "src/scanline_effect.o" + .include "src/option_menu.o" + .include "src/pokedex.o" -gUnknown_02039B6E = .; - . += 0x1A; +gTrainerCards: @ 2039B58 + .space 0x14 -gUnknown_02039B88 = .; - . += 0x160; +gUnknown_02039B6C: @ 2039B6C + .space 0x2 -. = ALIGN(4); src/trainer_card.o(ewram_data); +gUnknown_02039B6E: @ 2039B6E + .space 0x1A -gUnknown_02039CEC = .; - . += 0x4; +gUnknown_02039B88: @ 2039B88 + .space 0x160 -gUnknown_02039CF0 = .; - . += 0x4; + .include "src/trainer_card.o" -gUnknown_02039CF4 = .; - . += 0x4; +gUnknown_02039CEC: @ 2039CEC + .space 0x4 -gUnknown_02039CF8 = .; - . += 0x8; +gUnknown_02039CF0: @ 2039CF0 + .space 0x4 -. = ALIGN(4); src/pokemon_storage_system.o(ewram_data); -. = ALIGN(4); src/script_movement.o(ewram_data); -. = ALIGN(4); src/fldeff_cut.o(ewram_data); -. = ALIGN(4); src/map_name_popup.o(ewram_data); -. = ALIGN(4); src/item.o(ewram_data); -. = ALIGN(4); src/contest.o(ewram_data); -. = ALIGN(4); gUnknown_02039F5C = .; - . += 0x1; +gUnknown_02039CF4: @ 2039CF4 + .space 0x4 -gUnknown_02039F5D = .; - . += 0x3; +gUnknown_02039CF8: @ 2039CF8 + .space 0x8 -. = ALIGN(4); src/shop.o(ewram_data); -. = ALIGN(4); src/fldeff_escalator.o(ewram_data); -. = ALIGN(4); src/script_menu.o(ewram_data); -. = ALIGN(4); src/naming_screen.o(ewram_data); -. = ALIGN(4); src/money.o(ewram_data); -. = ALIGN(4); src/record_mixing.o(ewram_data); -. = ALIGN(4); src/secret_base.o(ewram_data); -. = ALIGN(4); src/tv.o(ewram_data); -gUnknown_0203A034 = .; - . += 0x4; + .include "src/pokemon_storage_system.o" + .include "src/script_movement.o" + .include "src/fldeff_cut.o" + .include "src/map_name_popup.o" + .include "src/item.o" + .include "src/contest.o" -. = ALIGN(4); src/rotating_gate.o(ewram_data); -. = ALIGN(4); src/safari_zone.o(ewram_data); -gUnknown_0203A0F4 = .; - . += 0x4; + .align 2 +gUnknown_02039F5C: @ 2039F5C + .space 0x1 -. = ALIGN(4); src/battle_anim_effects_1.o(ewram_data); -gUnknown_0203A100 = .; - . += 0x10; +gUnknown_02039F5D: @ 2039F5D + .space 0x3 -. = ALIGN(4); src/battle_anim_utility_funcs.o(ewram_data); -. = ALIGN(4); src/battle_intro.o(ewram_data); -. = ALIGN(4); src/easy_chat.o(ewram_data); -. = ALIGN(4); src/mon_markings.o(ewram_data); -. = ALIGN(4); src/mauville_old_man.o(ewram_data); -. = ALIGN(4); src/mail.o(ewram_data); -. = ALIGN(4); src/menu_helpers.o(ewram_data); -. = ALIGN(4); src/region_map.o(ewram_data); -. = ALIGN(4); src/decoration.o(ewram_data); -. = ALIGN(4); src/slot_machine.o(ewram_data); -. = ALIGN(4); src/battle_ai_script_commands.o(ewram_data); -. = ALIGN(4); gPlayerFacingPosition = .; - . += 0x8; + .include "src/shop.o" + .include "src/fldeff_escalator.o" + .include "src/script_menu.o" + .include "src/naming_screen.o" + .include "src/money.o" + .include "src/record_mixing.o" + .include "src/secret_base.o" + .include "src/tv.o" -. = ALIGN(4); src/pokeblock.o(ewram_data); -. = ALIGN(4); src/field_specials.o(ewram_data); -. = ALIGN(4); src/battle_records.o(ewram_data); -. = ALIGN(4); src/pokedex_area_screen.o(ewram_data); -. = ALIGN(4); src/evolution_scene.o(ewram_data); -. = ALIGN(4); src/roulette.o(ewram_data); -. = ALIGN(4); src/pokedex_cry_screen.o(ewram_data); -. = ALIGN(4); src/coins.o(ewram_data); -. = ALIGN(4); src/battle_transition.o(ewram_data); -. = ALIGN(4); src/battle_message.o(ewram_data); -. = ALIGN(4); src/cable_car.o(ewram_data); -. = ALIGN(4); src/rom_81520A8.o(ewram_data); -. = ALIGN(4); src/save.o(ewram_data); -. = ALIGN(4); src/mystery_event_script.o(ewram_data); -. = ALIGN(4); src/learn_move.o(ewram_data); -. = ALIGN(4); src/decoration_inventory.o(ewram_data); -. = ALIGN(4); src/roamer.o(ewram_data); -. = ALIGN(4); src/battle_tower.o(ewram_data); -. = ALIGN(4); src/use_pokeblock.o(ewram_data); -. = ALIGN(4); src/player_pc.o(ewram_data); -. = ALIGN(4); src/intro.o(ewram_data); -. = ALIGN(4); src/field_region_map.o(ewram_data); -. = ALIGN(4); src/hall_of_fame.o(ewram_data); -. = ALIGN(4); src/credits.o(ewram_data); -. = ALIGN(4); src/lottery_corner.o(ewram_data); -. = ALIGN(4); src/diploma.o(ewram_data); -. = ALIGN(4); src/berry_tag_screen.o(ewram_data); -. = ALIGN(4); src/mystery_event_menu.o(ewram_data); -. = ALIGN(4); src/save_failed_screen.o(ewram_data); -. = ALIGN(4); src/braille_puzzles.o(ewram_data); -. = ALIGN(4); src/pokeblock_feed.o(ewram_data); -. = ALIGN(4); src/intro_credits_graphics.o(ewram_data); -. = ALIGN(4); src/recorded_battle.o(ewram_data); -. = ALIGN(4); src/trainer_pokemon_sprites.o(ewram_data); -. = ALIGN(4); src/lilycove_lady.o(ewram_data); -. = ALIGN(4); src/battle_dome.o(ewram_data); -. = ALIGN(4); src/match_call.o(ewram_data); -. = ALIGN(4); src/menu.o(ewram_data); -. = ALIGN(4); src/battle_factory_screen.o(ewram_data); -. = ALIGN(4); src/mossdeep_gym.o(ewram_data); -. = ALIGN(4); src/item_menu.o(ewram_data); -. = ALIGN(4); src/list_menu.o(ewram_data); -. = ALIGN(4); src/dynamic_placeholder_text_util.o(ewram_data); -. = ALIGN(4); src/item_icon.o(ewram_data); -. = ALIGN(4); src/party_menu.o(ewram_data); -. = ALIGN(4); src/mirage_tower.o(ewram_data); -. = ALIGN(4); src/pokemon_summary_screen.o(ewram_data); -. = ALIGN(4); src/unk_pokedex_area_screen_helper.o(ewram_data); -. = ALIGN(4); src/battle_pyramid_bag.o(ewram_data); -gUnknown_0203CF3C = .; - . += 0x4; +gUnknown_0203A034: @ 203A034 + .space 0x4 -gUnknown_0203CF40 = .; - . += 0x4; + .include "src/rotating_gate.o" + .include "src/safari_zone.o" -gUnknown_0203CF44 = .; - . += 0x4; +gUnknown_0203A0F4: @ 203A0F4 + .space 0x4 -gUnknown_0203CF48 = .; - . += 0x4; + .include "src/battle_anim_effects_1.o" -gUnknown_0203CF4C = .; - . += 0x4; +gUnknown_0203A100: @ 203A100 + .space 0x10 -gUnknown_0203CF50 = .; - . += 0x4; + .include "src/battle_anim_utility_funcs.o" + .include "src/battle_intro.o" + .include "src/easy_chat.o" + .include "src/mon_markings.o" + .include "src/mauville_old_man.o" + .include "src/mail.o" + .include "src/menu_helpers.o" + .include "src/region_map.o" + .include "src/decoration.o" + .include "src/slot_machine.o" + .include "src/battle_ai_script_commands.o" + +.align 2 +gPlayerFacingPosition: @ 203AB40 + .space 0x8 + + .include "src/pokeblock.o" + .include "src/field_specials.o" + .include "src/battle_records.o" + .include "src/pokedex_area_screen.o" + .include "src/evolution_scene.o" + .include "src/roulette.o" + .include "src/pokedex_cry_screen.o" + .include "src/coins.o" + .include "src/battle_transition.o" + .include "src/battle_message.o" + .include "src/cable_car.o" + .include "src/rom_81520A8.o" + .include "src/save.o" + .include "src/mystery_event_script.o" + .include "src/learn_move.o" + .include "src/decoration_inventory.o" + .include "src/roamer.o" + .include "src/battle_tower.o" + .include "src/use_pokeblock.o" + .include "src/player_pc.o" + .include "src/intro.o" + .include "src/field_region_map.o" + .include "src/hall_of_fame.o" + .include "src/credits.o" + .include "src/lottery_corner.o" + .include "src/diploma.o" + .include "src/berry_tag_screen.o" + .include "src/mystery_event_menu.o" + .include "src/save_failed_screen.o" + .include "src/braille_puzzles.o" + .include "src/pokeblock_feed.o" + .include "src/intro_credits_graphics.o" + .include "src/recorded_battle.o" + .include "src/trainer_pokemon_sprites.o" + .include "src/lilycove_lady.o" + .include "src/battle_dome.o" + .include "src/match_call.o" + .include "src/menu.o" + .include "src/battle_factory_screen.o" + .include "src/mossdeep_gym.o" + .include "src/item_menu.o" + .include "src/list_menu.o" + .include "src/dynamic_placeholder_text_util.o" + .include "src/item_icon.o" + .include "src/party_menu.o" + .include "src/mirage_tower.o" + .include "src/pokemon_summary_screen.o" + .include "src/unk_pokedex_area_screen_helper.o" + .include "src/battle_pyramid_bag.o" -. = ALIGN(4); src/trainer_hill.o(ewram_data); -. = ALIGN(4); src/rayquaza_scene.o(ewram_data); +gUnknown_0203CF3C: @ 203CF3C + .space 0x4 + +gUnknown_0203CF40: @ 203CF40 + .space 0x4 + +gUnknown_0203CF44: @ 203CF44 + .space 0x4 + +gUnknown_0203CF48: @ 203CF48 + .space 0x4 + +gUnknown_0203CF4C: @ 203CF4C + .space 0x4 + +gUnknown_0203CF50: @ 203CF50 + .space 0x4 + + .include "src/trainer_hill.o" + .include "src/rayquaza_scene.o" From 08a3533682706283fa7e563f26bd06984010628e Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Fri, 25 Jan 2019 23:32:45 +0100 Subject: [PATCH 11/16] Start frontier pass --- asm/frontier_pass.s | 865 +------------------------------------------- include/bg.h | 2 +- include/graphics.h | 5 + src/frontier_pass.c | 444 +++++++++++++++++++++++ src/graphics.c | 2 +- 5 files changed, 453 insertions(+), 865 deletions(-) diff --git a/asm/frontier_pass.s b/asm/frontier_pass.s index c9746b91f..c9a2ddc84 100644 --- a/asm/frontier_pass.s +++ b/asm/frontier_pass.s @@ -5,869 +5,8 @@ .text - - thumb_func_start sub_80C51C4 -sub_80C51C4: @ 80C51C4 - push {lr} - bl sub_80C51F0 - ldr r0, =sub_80C544C - bl SetMainCallback2 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C51C4 - - thumb_func_start sub_80C51D8 -sub_80C51D8: @ 80C51D8 - push {lr} - ldr r0, =gUnknown_02039CEC - ldr r0, [r0] - ldr r0, [r0] - bl SetMainCallback2 - bl sub_80C52E4 - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C51D8 - - thumb_func_start sub_80C51F0 -sub_80C51F0: @ 80C51F0 - push {r4-r6,lr} - adds r4, r0, 0 - ldr r5, =gUnknown_02039CEC - ldr r0, [r5] - cmp r0, 0 - beq _080C5204 - movs r0, 0x1 - b _080C52C8 - .pool -_080C5204: - movs r0, 0x18 - bl AllocZeroed - str r0, [r5] - cmp r0, 0 - bne _080C5214 - movs r0, 0x2 - b _080C52C8 -_080C5214: - str r4, [r0] - bl GetCurrentRegionMapSectionId - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x3A - beq _080C5232 - cmp r4, 0xCA - beq _080C5232 - ldr r0, [r5] - movs r1, 0xB0 - strh r1, [r0, 0x8] - movs r1, 0x68 - strh r1, [r0, 0xA] - b _080C5240 -_080C5232: - ldr r2, =gUnknown_02039CEC - ldr r1, [r2] - movs r0, 0xB0 - strh r0, [r1, 0x8] - movs r0, 0x30 - strh r0, [r1, 0xA] - adds r5, r2, 0 -_080C5240: - ldr r1, [r5] - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldr r2, =0x00000eb8 - adds r0, r2 - ldrh r0, [r0] - strh r0, [r1, 0x6] - bl CanCopyRecordedBattleSaveData - ldr r3, [r5] - movs r1, 0x1 - ands r0, r1 - ldrb r2, [r3, 0xE] - movs r1, 0x2 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xE] - ldr r2, [r5] - ldrb r1, [r2, 0xE] - movs r0, 0xF - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0xE] - bl CountPlayerTrainerStars - ldr r3, [r5] - lsls r0, 4 - ldrb r2, [r3, 0xE] - movs r1, 0xF - ands r1, r2 - orrs r1, r0 - strb r1, [r3, 0xE] - movs r4, 0 - adds r6, r5, 0 -_080C5286: - lsls r5, r4, 1 - ldr r1, =0x000008c4 - adds r0, r5, r1 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _080C52A2 - ldr r1, [r6] - adds r1, 0xF - adds r1, r4 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_080C52A2: - ldr r2, =0x000008c5 - adds r0, r5, r2 - bl FlagGet - lsls r0, 24 - cmp r0, 0 - beq _080C52BC - ldr r1, [r6] - adds r1, 0xF - adds r1, r4 - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] -_080C52BC: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x6 - bls _080C5286 - movs r0, 0 -_080C52C8: - pop {r4-r6} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C51F0 - - thumb_func_start sub_80C52E4 -sub_80C52E4: @ 80C52E4 - push {r4,lr} - ldr r4, =gUnknown_02039CEC - ldr r0, [r4] - cmp r0, 0 - beq _080C5308 - movs r1, 0 - movs r2, 0x18 - bl memset - ldr r0, [r4] - bl Free - movs r0, 0 - str r0, [r4] - b _080C530A - .pool -_080C5308: - movs r0, 0x1 -_080C530A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80C52E4 - - thumb_func_start sub_80C5310 -sub_80C5310: @ 80C5310 - push {r4,lr} - ldr r4, =gUnknown_02039CF0 - ldr r0, [r4] - cmp r0, 0 - beq _080C5324 - movs r0, 0x1 - b _080C533A - .pool -_080C5324: - ldr r0, =0x00002434 - bl AllocZeroed - str r0, [r4] - cmp r0, 0 - beq _080C5338 - movs r0, 0 - b _080C533A - .pool -_080C5338: - movs r0, 0x2 -_080C533A: - pop {r4} - pop {r1} - bx r1 - thumb_func_end sub_80C5310 - - thumb_func_start sub_80C5340 -sub_80C5340: @ 80C5340 - push {r4,lr} - bl FreeAllWindowBuffers - ldr r4, =gUnknown_02039CF0 - ldr r0, [r4] - cmp r0, 0 - bne _080C5358 - movs r0, 0x1 - b _080C53A0 - .pool -_080C5358: - ldr r0, [r0, 0x28] - cmp r0, 0 - beq _080C5368 - bl Free - ldr r1, [r4] - movs r0, 0 - str r0, [r1, 0x28] -_080C5368: - ldr r0, [r4] - ldr r0, [r0, 0x24] - cmp r0, 0 - beq _080C537A - bl Free - ldr r1, [r4] - movs r0, 0 - str r0, [r1, 0x24] -_080C537A: - ldr r0, [r4] - ldr r0, [r0, 0x20] - cmp r0, 0 - beq _080C538C - bl Free - ldr r1, [r4] - movs r0, 0 - str r0, [r1, 0x20] -_080C538C: - ldr r0, [r4] - ldr r2, =0x00002434 - movs r1, 0 - bl memset - ldr r0, [r4] - bl Free - movs r0, 0 - str r0, [r4] -_080C53A0: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C5340 - - thumb_func_start pokemon_details -pokemon_details: @ 80C53AC - push {r4-r7,lr} - sub sp, 0x10 - ldr r0, =gUnknown_02039CF0 - ldr r6, [r0] - adds r0, r6, 0 - adds r0, 0x2C - ldrb r0, [r0] - cmp r0, 0 - beq _080C5416 - ldr r3, =gUnknown_085713E0 - ldr r0, =gUnknown_02039CEC - ldr r0, [r0] - ldrb r4, [r0, 0xE] - lsls r4, 28 - lsrs r0, r4, 29 - subs r0, 0x1 - lsls r0, 2 - adds r0, r3 - movs r2, 0 - ldrsh r1, [r0, r2] - lsls r1, 8 - lsrs r0, r4, 29 - subs r0, 0x1 - lsls r0, 2 - adds r5, r3, 0x2 - adds r0, r5 - movs r7, 0 - ldrsh r2, [r0, r7] - lsls r2, 8 - lsrs r0, r4, 29 - subs r0, 0x1 - lsls r0, 2 - adds r0, r3 - movs r7, 0 - ldrsh r3, [r0, r7] - lsrs r4, 29 - subs r4, 0x1 - lsls r4, 2 - adds r4, r5 - movs r5, 0 - ldrsh r0, [r4, r5] - str r0, [sp] - movs r7, 0x2E - ldrsh r0, [r6, r7] - str r0, [sp, 0x4] - movs r4, 0x30 - ldrsh r0, [r6, r4] - str r0, [sp, 0x8] - movs r0, 0 - str r0, [sp, 0xC] - movs r0, 0x2 - bl SetBgAffine -_080C5416: - bl LoadOam - bl ProcessSpriteCopyRequests - bl TransferPlttBuffer - add sp, 0x10 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end pokemon_details - - thumb_func_start sub_80C5438 -sub_80C5438: @ 80C5438 - push {lr} - bl RunTasks - bl AnimateSprites - bl BuildOamBuffer - pop {r0} - bx r0 - thumb_func_end sub_80C5438 - - thumb_func_start sub_80C544C -sub_80C544C: @ 80C544C - push {lr} - bl sub_80C5484 - cmp r0, 0 - beq _080C5464 - ldr r0, =sub_80C5A48 - movs r1, 0 - bl CreateTask - ldr r0, =sub_80C5438 - bl SetMainCallback2 -_080C5464: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C544C - - thumb_func_start sub_80C5470 -sub_80C5470: @ 80C5470 - push {lr} - bl sub_80C570C - cmp r0, 0 - beq _080C547E - bl sub_80C51D8 -_080C547E: - pop {r0} - bx r0 - thumb_func_end sub_80C5470 - - thumb_func_start sub_80C5484 -sub_80C5484: @ 80C5484 - push {r4,r5,lr} - sub sp, 0xC - movs r0, 0 - str r0, [sp, 0x8] - ldr r0, =gUnknown_02039CEC - ldr r0, [r0] - ldrh r0, [r0, 0x4] - cmp r0, 0xA - bls _080C5498 - b _080C56F4 -_080C5498: - lsls r0, 2 - ldr r1, =_080C54AC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C54AC: - .4byte _080C54D8 - .4byte _080C54EE - .4byte _080C54F4 - .4byte _080C550A - .4byte _080C5510 - .4byte _080C5560 - .4byte _080C5570 - .4byte _080C55D0 - .4byte _080C5624 - .4byte _080C5684 - .4byte _080C56D0 -_080C54D8: - movs r0, 0 - bl SetVBlankCallback - bl ScanlineEffect_Stop - bl SetVBlankHBlankCallbacksToNull - movs r0, 0x2 - bl DisableInterrupts - b _080C56F4 -_080C54EE: - bl sub_80C50D0 - b _080C56F4 -_080C54F4: - bl ResetTasks - bl ResetSpriteData - bl FreeAllSpritePalettes - bl ResetPaletteFade - bl reset_temp_tile_data_buffers - b _080C56F4 -_080C550A: - bl sub_80C5310 - b _080C56F4 -_080C5510: - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_085713E8 - movs r0, 0x1 - movs r2, 0x3 - bl InitBgsFromTemplates - ldr r4, =gUnknown_02039CF0 - ldr r1, [r4] - adds r1, 0x32 - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00001032 - adds r1, r0 - movs r0, 0x2 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00002032 - adds r1, r0 - movs r0, 0x3 - bl SetBgTilemapBuffer - movs r0, 0x2 - movs r1, 0x6 - movs r2, 0x1 - bl SetBgAttribute - b _080C56F4 - .pool -_080C5560: - ldr r0, =gUnknown_08571400 - bl InitWindows - bl DeactivateAllTextPrinters - b _080C56F4 - .pool -_080C5570: - ldr r0, =gUnknown_085712F8 - add r1, sp, 0x8 - bl malloc_and_decompress - ldr r4, =gUnknown_02039CF0 - ldr r1, [r4] - str r0, [r1, 0x20] - ldr r0, =gUnknown_08571060 - add r1, sp, 0x8 - bl malloc_and_decompress - ldr r1, [r4] - str r0, [r1, 0x24] - ldr r0, =gUnknown_085712C0 - add r1, sp, 0x8 - bl malloc_and_decompress - ldr r1, [r4] - str r0, [r1, 0x28] - ldr r1, =gUnknown_08DE08C8 - movs r4, 0 - str r4, [sp] - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - ldr r1, =gUnknown_08DE2084 - str r4, [sp] - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - b _080C56F4 - .pool -_080C55D0: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - beq _080C55DC - b _080C56FE -_080C55DC: - movs r5, 0x1E - str r5, [sp] - movs r4, 0x14 - str r4, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - str r5, [sp] - str r4, [sp, 0x4] - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - str r5, [sp] - str r4, [sp, 0x4] - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0 - bl CopyBgTilemapBufferToVram - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - b _080C56F4 -_080C5624: - ldr r4, =gUnknown_08DE07C8 - movs r2, 0xD0 - lsls r2, 1 - adds r0, r4, 0 - movs r1, 0 - bl LoadPalette - ldr r5, =gUnknown_02039CEC - ldr r0, [r5] - ldrb r0, [r0, 0xE] - lsrs r0, 4 - lsls r0, 5 - adds r4, 0x20 - adds r0, r4 - movs r1, 0x10 - movs r2, 0x20 - bl LoadPalette - movs r0, 0 - bl stdpal_get - movs r1, 0xF0 - movs r2, 0x20 - bl LoadPalette - bl sub_80C629C - ldr r1, [r5] - ldrb r0, [r1, 0xC] - ldrb r1, [r1, 0xD] - bl sub_80C6104 - ldr r5, [r5] - ldrb r0, [r5, 0xE] - movs r1, 0xE - ands r1, r0 - cmp r1, 0x2 - beq _080C5674 - cmp r1, 0x4 - bne _080C56F4 -_080C5674: - movs r0, 0 - strh r0, [r5, 0x4] - movs r0, 0x1 - b _080C5700 - .pool -_080C5684: - 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 - bl sub_80C62DC - ldr r0, =pokemon_details - bl SetVBlankCallback - movs r4, 0x1 - negs r4, r4 - adds r0, r4, 0 - movs r1, 0x10 - movs r2, 0 - bl BlendPalettes - movs r0, 0 - str r0, [sp] - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - b _080C56F4 - .pool -_080C56D0: - bl AnimateSprites - bl BuildOamBuffer - bl UpdatePaletteFade - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _080C56FE - ldr r0, =gUnknown_02039CEC - ldr r0, [r0] - strh r1, [r0, 0x4] - movs r0, 0x1 - b _080C5700 - .pool -_080C56F4: - ldr r0, =gUnknown_02039CEC - ldr r1, [r0] - ldrh r0, [r1, 0x4] - adds r0, 0x1 - strh r0, [r1, 0x4] -_080C56FE: - movs r0, 0 -_080C5700: - add sp, 0xC - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C5484 - - thumb_func_start sub_80C570C -sub_80C570C: @ 80C570C - push {lr} - sub sp, 0x4 - ldr r1, =gUnknown_02039CEC - ldr r0, [r1] - ldrh r0, [r0, 0x4] - adds r2, r1, 0 - cmp r0, 0x5 - bhi _080C57E4 - lsls r0, 2 - ldr r1, =_080C5730 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C5730: - .4byte _080C5748 - .4byte _080C5770 - .4byte _080C577C - .4byte _080C57A6 - .4byte _080C57AC - .4byte _080C57BE -_080C5748: - ldr r0, [r2] - ldrb r0, [r0, 0xE] - movs r1, 0xE - ands r1, r0 - cmp r1, 0x2 - beq _080C576A - cmp r1, 0x4 - beq _080C576A - movs r0, 0x1 - negs r0, r0 - movs r1, 0 - str r1, [sp] - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - b _080C57E4 -_080C576A: - ldr r1, [r2] - movs r0, 0x2 - b _080C57EC -_080C5770: - bl UpdatePaletteFade - lsls r0, 24 - cmp r0, 0 - beq _080C57E4 - b _080C57EE -_080C577C: - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0 - bl HideBg - movs r0, 0x1 - bl HideBg - movs r0, 0x2 - bl HideBg - movs r0, 0 - bl SetVBlankCallback - bl ScanlineEffect_Stop - bl SetVBlankHBlankCallbacksToNull - b _080C57E4 -_080C57A6: - bl sub_80C63FC - b _080C57E4 -_080C57AC: - bl sub_80C50D0 - bl ResetTasks - bl ResetSpriteData - bl FreeAllSpritePalettes - b _080C57E4 -_080C57BE: - movs r0, 0 - bl UnsetBgTilemapBuffer - movs r0, 0x1 - bl UnsetBgTilemapBuffer - movs r0, 0x2 - bl UnsetBgTilemapBuffer - bl sub_80C5340 - ldr r0, =gUnknown_02039CEC - ldr r1, [r0] - movs r0, 0 - strh r0, [r1, 0x4] - movs r0, 0x1 - b _080C57F0 - .pool -_080C57E4: - ldr r0, =gUnknown_02039CEC - ldr r1, [r0] - ldrh r0, [r1, 0x4] - adds r0, 0x1 -_080C57EC: - strh r0, [r1, 0x4] -_080C57EE: - movs r0, 0 -_080C57F0: - add sp, 0x4 - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C570C - - thumb_func_start sub_80C57FC -sub_80C57FC: @ 80C57FC - push {r4-r7,lr} - lsls r0, 16 - lsrs r6, r0, 16 - movs r4, 0 - ldr r7, =gUnknown_08571454 - lsls r1, 16 - asrs r5, r1, 16 -_080C580A: - lsls r0, r4, 3 - adds r3, r0, r7 - movs r1, 0 - ldrsh r0, [r3, r1] - cmp r0, r5 - bgt _080C5854 - movs r1, 0x2 - ldrsh r0, [r3, r1] - cmp r0, r5 - blt _080C5854 - movs r0, 0x4 - ldrsh r1, [r3, r0] - lsls r0, r6, 16 - asrs r2, r0, 16 - cmp r1, r2 - bgt _080C5854 - movs r1, 0x6 - ldrsh r0, [r3, r1] - cmp r0, r2 - blt _080C5854 - cmp r4, 0x5 - bls _080C5842 - ldr r0, =gUnknown_02039CEC - ldr r0, [r0] - adds r0, r4 - ldrb r0, [r0, 0x9] - cmp r0, 0 - beq _080C585E -_080C5842: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r0, 24 - b _080C5860 - .pool -_080C5854: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0xC - bls _080C580A -_080C585E: - movs r0, 0 -_080C5860: - pop {r4-r7} - pop {r1} - bx r1 - thumb_func_end sub_80C57FC - - thumb_func_start sub_80C5868 -sub_80C5868: @ 80C5868 - push {lr} - bl sub_80C5484 - cmp r0, 0 - beq _080C58C6 - ldr r1, =gUnknown_02039CEC - ldr r0, [r1] - ldrb r0, [r0, 0xE] - lsls r0, 28 - lsrs r0, 29 - cmp r0, 0x1 - blt _080C58AC - cmp r0, 0x2 - bgt _080C58AC - ldr r0, =sub_80C5BD8 - movs r1, 0 - bl CreateTask - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gTasks - lsls r1, r0, 2 - adds r1, r0 - lsls r1, 3 - adds r1, r2 - movs r0, 0x1 - strh r0, [r1, 0x8] - b _080C58C0 - .pool -_080C58AC: - ldr r2, [r1] - ldrb r1, [r2, 0xE] - movs r0, 0xF - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0xE] - ldr r0, =sub_80C5A48 - movs r1, 0 - bl CreateTask -_080C58C0: - ldr r0, =sub_80C5438 - bl SetMainCallback2 -_080C58C6: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C5868 - - thumb_func_start sub_80C58D4 -sub_80C58D4: @ 80C58D4 - push {r4,lr} - ldr r4, =gUnknown_02039CF8 - ldr r0, [r4] - bl sub_80C51F0 - ldr r0, =gUnknown_02039CEC - ldr r1, [r0] - ldrh r0, [r4, 0x4] - strh r0, [r1, 0x8] - ldrh r0, [r4, 0x6] - strh r0, [r1, 0xA] - adds r0, r4, 0 - movs r1, 0 - movs r2, 0x8 - bl memset - bl InBattlePyramid - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x1 - beq _080C5914 - cmp r0, 0x2 - beq _080C591C - bl Overworld_PlaySpecialMapMusic - b _080C5924 - .pool -_080C5914: - ldr r0, =0x000001cd - b _080C5920 - .pool -_080C591C: - movs r0, 0xE7 - lsls r0, 1 -_080C5920: - bl PlayBGM -_080C5924: - ldr r0, =sub_80C5868 - bl SetMainCallback2 - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C58D4 thumb_func_start sub_80C5934 sub_80C5934: @ 80C5934 @@ -1269,7 +408,7 @@ _080C5C4C: movs r0, 0x2 bl ShowBg bl sub_80C62DC - ldr r0, =pokemon_details + ldr r0, =sub_80C53AC bl SetVBlankCallback movs r5, 0x1 negs r5, r5 @@ -2385,7 +1524,7 @@ _080C6628: movs r0, 0x2 bl ShowBg bl sub_80C6974 - ldr r0, =pokemon_details + ldr r0, =sub_80C53AC bl SetVBlankCallback movs r5, 0x1 negs r5, r5 diff --git a/include/bg.h b/include/bg.h index 1366923f1..ad5acd0ae 100644 --- a/include/bg.h +++ b/include/bg.h @@ -61,7 +61,7 @@ s32 GetBgX(u8 bg); s32 ChangeBgY(u8 bg, s32 value, u8 op); s32 ChangeBgY_ScreenOff(u8 bg, u32 value, u8 op); s32 GetBgY(u8 bg); -void SetBgAffine(u8 bg, u32 srcCenterX, u32 srcCenterY, s16 dispCenterX, s16 dispCenterY, s16 scaleX, s16 scaleY, u16 rotationAngle); +void SetBgAffine(u8 bg, s32 srcCenterX, s32 srcCenterY, s16 dispCenterX, s16 dispCenterY, s16 scaleX, s16 scaleY, u16 rotationAngle); u8 Unused_AdjustBgMosaic(u8 a1, u8 a2); void SetBgTilemapBuffer(u8 bg, void *tilemap); void UnsetBgTilemapBuffer(u8 bg); diff --git a/include/graphics.h b/include/graphics.h index 77390db90..d6a32cab2 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -4860,4 +4860,9 @@ extern const u32 gUnknown_08DD228C[]; extern const u32 gUnknown_08DD2E5C[]; extern const u32 gUnknown_08DD1F78[]; +// Frontier Pass +extern const u32 gUnknown_08DE08C8[]; +extern const u32 gUnknown_08DE2084[]; +extern const u16 gUnknown_08DE07C8[][16]; + #endif //GUARD_GRAPHICS_H diff --git a/src/frontier_pass.c b/src/frontier_pass.c index 4473dfae0..7b25ca9b8 100644 --- a/src/frontier_pass.c +++ b/src/frontier_pass.c @@ -1,7 +1,103 @@ #include "global.h" #include "gpu_regs.h" +#include "main.h" +#include "trainer_card.h" +#include "event_data.h" +#include "recorded_battle.h" +#include "alloc.h" +#include "sprite.h" +#include "scanline_effect.h" +#include "text_window.h" +#include "task.h" +#include "graphics.h" +#include "palette.h" +#include "window.h" +#include "menu_helpers.h" +#include "menu.h" #include "bg.h" +#include "sound.h" +#include "battle_pyramid.h" +#include "overworld.h" +#include "constants/battle_frontier.h" +#include "constants/rgb.h" +#include "constants/region_map_sections.h" +#include "constants/songs.h" +enum +{ + CURSOR_AREA_NOTHING, + CURSOR_AREA_MAP, + CURSOR_AREA_CARD, + CURSOR_AREA_RECORD, + CURSOR_AREA_CANCEL, + CURSOR_AREA_POINTS, + CURSOR_AREA_EARNED_SYMBOLS, // The window. + CURSOR_AREA_SYMBOL, // All 7 symbols. + CURSOR_AREA_COUNT = CURSOR_AREA_SYMBOL + NUM_FRONTIER_FACILITIES, +}; + +struct FrontierPassData +{ + void (*callback)(void); + u16 state; + u16 battlePoints; + s16 x; + s16 y; + u8 cursorArea; + u8 previousCursorArea; + u8 hasBattleRecord:1; + u8 unkE:3; + u8 trainerStars:4; + u8 facilitySymbols[NUM_FRONTIER_FACILITIES]; +}; + +struct FrontierPassUnk +{ + u32 unk0[8]; + u8 *unk20; + u8 *unk24; + u8 *unk28; + bool8 unk2C; + s16 unk2E; + s16 unk30; + u8 tilemapBuff1[0x1000]; + u8 tilemapBuff2[0x1000]; + u8 tilemapBuff3[0x400]; +}; + +struct FrontierPassSaved +{ + void (*callback)(void); + s16 x; + s16 y; +}; + +extern struct FrontierPassData *gUnknown_02039CEC; +extern struct FrontierPassUnk *gUnknown_02039CF0; +extern struct FrontierPassSaved gUnknown_02039CF8; + +// This file's functions. +u32 sub_80C51F0(void (*callback)(void)); +void sub_80C544C(void); +void sub_80C629C(void); +void sub_80C63FC(void); +void sub_80C62DC(void); +u32 sub_80C52E4(void); +bool32 sub_80C5484(void); +bool32 sub_80C570C(void); +void sub_80C5A48(u8 taskId); +void sub_80C5BD8(u8 taskId); +void sub_80C6104(u8 cursorArea, u8 previousCursorArea); + +// Const rom data. +extern const s16 gUnknown_085713E0[][2]; +extern const struct BgTemplate gUnknown_085713E8[3]; +extern const struct WindowTemplate gUnknown_08571400[]; +extern const u32 gUnknown_085712F8[]; +extern const u32 gUnknown_085712C0[]; +extern const u32 gUnknown_08571060[]; + +// code void sub_80C50D0(void) { SetGpuReg(REG_OFFSET_DISPCNT, 0); @@ -29,3 +125,351 @@ void sub_80C50D0(void) CpuFill16(0, (void *)VRAM, VRAM_SIZE); CpuFill32(0, (void *)OAM, OAM_SIZE); } + +void sub_80C51C4(void (*callback)(void)) +{ + sub_80C51F0(callback); + SetMainCallback2(sub_80C544C); +} + +void sub_80C51D8(void) +{ + SetMainCallback2(gUnknown_02039CEC->callback); + sub_80C52E4(); +} + +u32 sub_80C51F0(void (*callback)(void)) +{ + u8 i; + + if (gUnknown_02039CEC != NULL) + return 1; + + gUnknown_02039CEC = AllocZeroed(sizeof(*gUnknown_02039CEC)); + if (gUnknown_02039CEC == NULL) + return 2; + + gUnknown_02039CEC->callback = callback; + i = GetCurrentRegionMapSectionId(); + if (i != MAPSEC_BATTLE_FRONTIER && i != MAPSEC_ARTISAN_CAVE) + { + gUnknown_02039CEC->x = 176; + gUnknown_02039CEC->y = 104; + } + else + { + gUnknown_02039CEC->x = 176; + gUnknown_02039CEC->y = 48; + } + + gUnknown_02039CEC->battlePoints = gSaveBlock2Ptr->frontier.battlePoints; + gUnknown_02039CEC->hasBattleRecord = CanCopyRecordedBattleSaveData(); + gUnknown_02039CEC->unkE = 0; + gUnknown_02039CEC->trainerStars = CountPlayerTrainerStars(); + for (i = 0; i < 7; i++) + { + if (FlagGet(FLAG_SYS_TOWER_SILVER + i * 2)) + gUnknown_02039CEC->facilitySymbols[i]++; + if (FlagGet(FLAG_SYS_TOWER_GOLD + i * 2)) + gUnknown_02039CEC->facilitySymbols[i]++; + } + + return 0; +} + +u32 sub_80C52E4(void) +{ + if (gUnknown_02039CEC == NULL) + return 1; + + memset(gUnknown_02039CEC, 0, sizeof(*gUnknown_02039CEC)); // Why clear data, if it's going to be freed anyway? + FREE_AND_SET_NULL(gUnknown_02039CEC); + return 0; +} + +u32 sub_80C5310(void) +{ + if (gUnknown_02039CF0 != NULL) + return 1; + + gUnknown_02039CF0 = AllocZeroed(sizeof(*gUnknown_02039CF0)); + if (gUnknown_02039CF0 == NULL) + return 2; + + return 0; +} + +u32 sub_80C5340(void) +{ + FreeAllWindowBuffers(); + if (gUnknown_02039CF0 == NULL) + return 1; + + if (gUnknown_02039CF0->unk28 != NULL) + FREE_AND_SET_NULL(gUnknown_02039CF0->unk28); + if (gUnknown_02039CF0->unk24 != NULL) + FREE_AND_SET_NULL(gUnknown_02039CF0->unk24); + if (gUnknown_02039CF0->unk20 != NULL) + FREE_AND_SET_NULL(gUnknown_02039CF0->unk20); + + memset(gUnknown_02039CF0, 0, sizeof(*gUnknown_02039CF0)); // Why clear data, if it's going to be freed anyway? + FREE_AND_SET_NULL(gUnknown_02039CF0); + return 0; +} + +void sub_80C53AC(void) +{ + if (gUnknown_02039CF0->unk2C) + { + SetBgAffine(2, + gUnknown_085713E0[gUnknown_02039CEC->unkE - 1][0] << 8, + gUnknown_085713E0[gUnknown_02039CEC->unkE - 1][1] << 8, + gUnknown_085713E0[gUnknown_02039CEC->unkE - 1][0], + gUnknown_085713E0[gUnknown_02039CEC->unkE - 1][1], + gUnknown_02039CF0->unk2E, + gUnknown_02039CF0->unk30, + 0); + } + LoadOam(); + ProcessSpriteCopyRequests(); + TransferPlttBuffer(); +} + +void sub_80C5438(void) +{ + RunTasks(); + AnimateSprites(); + BuildOamBuffer(); +} + +void sub_80C544C(void) +{ + if (sub_80C5484()) + { + CreateTask(sub_80C5A48, 0); + SetMainCallback2(sub_80C5438); + } +} + +void sub_80C5470(void) +{ + if (sub_80C570C()) + { + sub_80C51D8(); + } +} + +bool32 sub_80C5484(void) +{ + u32 sizeOut = 0; + + switch (gUnknown_02039CEC->state) + { + case 0: + SetVBlankCallback(NULL); + ScanlineEffect_Stop(); + SetVBlankHBlankCallbacksToNull(); + DisableInterrupts(INTR_FLAG_HBLANK); + break; + case 1: + sub_80C50D0(); + break; + case 2: + ResetTasks(); + ResetSpriteData(); + FreeAllSpritePalettes(); + ResetPaletteFade(); + reset_temp_tile_data_buffers(); + break; + case 3: + sub_80C5310(); + break; + case 4: + ResetBgsAndClearDma3BusyFlags(0); + InitBgsFromTemplates(1, gUnknown_085713E8, ARRAY_COUNT(gUnknown_085713E8)); + SetBgTilemapBuffer(1, gUnknown_02039CF0->tilemapBuff1); + SetBgTilemapBuffer(2, gUnknown_02039CF0->tilemapBuff2); + SetBgTilemapBuffer(3, gUnknown_02039CF0->tilemapBuff3); + SetBgAttribute(2, BG_ATTR_WRAPAROUND, 1); + break; + case 5: + InitWindows(gUnknown_08571400); + DeactivateAllTextPrinters(); + break; + case 6: + gUnknown_02039CF0->unk20 = malloc_and_decompress(gUnknown_085712F8, &sizeOut); + gUnknown_02039CF0->unk24 = malloc_and_decompress(gUnknown_08571060, &sizeOut); + gUnknown_02039CF0->unk28 = malloc_and_decompress(gUnknown_085712C0, &sizeOut); + decompress_and_copy_tile_data_to_vram(1, gUnknown_08DE08C8, 0, 0, 0); + decompress_and_copy_tile_data_to_vram(2, gUnknown_08DE2084, 0, 0, 0); + break; + case 7: + if (free_temp_tile_data_buffers_if_possible()) + return FALSE; + FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 30, 20); + FillBgTilemapBufferRect_Palette0(1, 0, 0, 0, 30, 20); + FillBgTilemapBufferRect_Palette0(2, 0, 0, 0, 30, 20); + CopyBgTilemapBufferToVram(0); + CopyBgTilemapBufferToVram(1); + CopyBgTilemapBufferToVram(2); + break; + case 8: + LoadPalette(gUnknown_08DE07C8[0], 0, 0x1A0); + LoadPalette(gUnknown_08DE07C8[1 + gUnknown_02039CEC->trainerStars], 0x10, 0x20); + LoadPalette(stdpal_get(0), 0xF0, 0x20); + sub_80C629C(); + sub_80C6104(gUnknown_02039CEC->cursorArea, gUnknown_02039CEC->previousCursorArea); + if (gUnknown_02039CEC->unkE == 1 || gUnknown_02039CEC->unkE == 2) + { + gUnknown_02039CEC->state = 0; + return TRUE; + } + break; + case 9: + SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP); + ShowBg(0); + ShowBg(1); + ShowBg(2); + sub_80C62DC(); + SetVBlankCallback(sub_80C53AC); + BlendPalettes(0xFFFFFFFF, 0x10, 0); + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); + break; + case 10: + AnimateSprites(); + BuildOamBuffer(); + if (UpdatePaletteFade()) + return FALSE; + + gUnknown_02039CEC->state = 0; + return TRUE; + } + + gUnknown_02039CEC->state++; + return FALSE; +} + +bool32 sub_80C570C(void) +{ + switch (gUnknown_02039CEC->state) + { + case 0: + if (gUnknown_02039CEC->unkE != 1 && gUnknown_02039CEC->unkE != 2) + { + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); + } + else + { + gUnknown_02039CEC->state = 2; + return FALSE; + } + break; + case 1: + if (UpdatePaletteFade()) + return FALSE; + break; + case 2: + SetGpuReg(REG_OFFSET_DISPCNT, 0); + HideBg(0); + HideBg(1); + HideBg(2); + SetVBlankCallback(NULL); + ScanlineEffect_Stop(); + SetVBlankHBlankCallbacksToNull(); + break; + case 3: + sub_80C63FC(); + break; + case 4: + sub_80C50D0(); + ResetTasks(); + ResetSpriteData(); + FreeAllSpritePalettes(); + break; + case 5: + UnsetBgTilemapBuffer(0); + UnsetBgTilemapBuffer(1); + UnsetBgTilemapBuffer(2); + sub_80C5340(); + gUnknown_02039CEC->state = 0; + return TRUE; + } + + gUnknown_02039CEC->state++; + return FALSE; +} + +struct +{ + s16 yStart; + s16 yEnd; + s16 xStart; + s16 xEnd; +} +extern const gUnknown_08571454[]; + +u8 sub_80C57FC(s16 x, s16 y) +{ + u8 i; + + // Minus/Plus 1, because the table doesn't take into account the nothing field. + for (i = 0; i < CURSOR_AREA_COUNT - 1; i++) + { + if (gUnknown_08571454[i].yStart <= y && gUnknown_08571454[i].yEnd >= y + && gUnknown_08571454[i].xStart <= x && gUnknown_08571454[i].xEnd >= x) + { + if (i >= CURSOR_AREA_SYMBOL - 1 && gUnknown_02039CEC->facilitySymbols[i - CURSOR_AREA_SYMBOL + 1] == 0) + break; + + return i + 1; + } + } + + return 0; +} + +void sub_80C5868(void) +{ + u8 taskId; + + if (!sub_80C5484()) + return; + + switch (gUnknown_02039CEC->unkE) + { + case 1: + case 2: + taskId = CreateTask(sub_80C5BD8, 0); + gTasks[taskId].data[0] = 1; + break; + case 3: + default: + gUnknown_02039CEC->unkE = 0; + taskId = CreateTask(sub_80C5A48, 0); + break; + } + + SetMainCallback2(sub_80C5438); +} + +void sub_80C58D4(void) +{ + sub_80C51F0(gUnknown_02039CF8.callback); + gUnknown_02039CEC->x = gUnknown_02039CF8.x; + gUnknown_02039CEC->y = gUnknown_02039CF8.y; + memset(&gUnknown_02039CF8, 0, sizeof(gUnknown_02039CF8)); + switch (InBattlePyramid()) + { + case 1: + PlayBGM(MUS_PYRAMID); + break; + case 2: + PlayBGM(MUS_PYRAMID_TOP); + break; + default: + Overworld_PlaySpecialMapMusic(); + break; + } + + SetMainCallback2(sub_80C5868); +} diff --git a/src/graphics.c b/src/graphics.c index 10efd5043..287a1f5d6 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1590,7 +1590,7 @@ const u32 gUnknown_08DE0644[] = INCBIN_U32("graphics/title_screen/title_screen2. // more trainer card stuff -const u16 gUnknown_08DE07C8[] = INCBIN_U16("graphics/frontier_pass/tiles.gbapal");// size in LoadPalette calls is reported as 0xD0 << 1, which is 0x1A0, but palette is only 0x100 bytes long so it loads garbage as well +const u16 gUnknown_08DE07C8[][16] = INCBIN_U16("graphics/frontier_pass/tiles.gbapal");// size in LoadPalette calls is reported as 0xD0 << 1, which is 0x1A0, but palette is only 0x100 bytes long so it loads garbage as well const u32 gUnknown_08DE08C8[] = INCBIN_U32("graphics/frontier_pass/tiles.4bpp.lz"); const u32 gUnknown_08DE2084[] = INCBIN_U32("graphics/frontier_pass/tiles2.8bpp.lz"); const u32 gUnknown_08DE3060[] = INCBIN_U32("graphics/frontier_pass/tiles.bin.lz"); From 0688725afb36ae02c4f4904dfe02aa6b8e8e29fa Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sat, 26 Jan 2019 14:50:24 +0100 Subject: [PATCH 12/16] Document and decompile more of frontier pass. --- asm/frontier_pass.s | 1334 +-------------------------------------- include/frontier_pass.h | 7 + include/graphics.h | 3 + include/palette.h | 2 +- include/strings.h | 7 +- src/frontier_pass.c | 579 +++++++++++++++-- src/start_menu.c | 5 +- src/trainer_card.c | 4 +- 8 files changed, 546 insertions(+), 1395 deletions(-) create mode 100644 include/frontier_pass.h diff --git a/asm/frontier_pass.s b/asm/frontier_pass.s index c9a2ddc84..7f9cf934b 100644 --- a/asm/frontier_pass.s +++ b/asm/frontier_pass.s @@ -7,1332 +7,8 @@ - - thumb_func_start sub_80C5934 -sub_80C5934: @ 80C5934 - push {lr} - bl sub_80C570C - cmp r0, 0 - beq _080C599A - ldr r0, =gUnknown_02039CEC - ldr r2, [r0] - ldrb r0, [r2, 0xE] - lsls r0, 28 - lsrs r0, 29 - cmp r0, 0x2 - beq _080C5994 - cmp r0, 0x2 - bgt _080C595C - cmp r0, 0x1 - beq _080C5962 - b _080C599A - .pool -_080C595C: - cmp r0, 0x3 - beq _080C5970 - b _080C599A -_080C5962: - ldr r0, =sub_80C5868 - bl sub_80C6454 - b _080C599A - .pool -_080C5970: - ldr r1, =gUnknown_02039CF8 - ldr r0, [r2] - str r0, [r1] - ldrh r0, [r2, 0x8] - strh r0, [r1, 0x4] - ldrh r0, [r2, 0xA] - strh r0, [r1, 0x6] - bl sub_80C52E4 - ldr r0, =sub_80C58D4 - bl PlayRecordedBattle - b _080C599A - .pool -_080C5994: - ldr r0, =sub_80C5868 - bl ShowPlayerTrainerCard -_080C599A: - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C5934 - - thumb_func_start sub_80C59A4 -sub_80C59A4: @ 80C59A4 - push {r4,lr} - lsls r0, 24 - lsrs r3, r0, 24 - adds r4, r3, 0 - lsls r1, 24 - lsrs r1, 24 - adds r2, r1, 0 - cmp r1, 0x1 - blt _080C59CC - cmp r1, 0x2 - ble _080C59F4 - cmp r1, 0x3 - bne _080C59CC - ldr r0, =gUnknown_02039CEC - ldr r2, [r0] - ldrb r1, [r2, 0xE] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - bne _080C59D4 -_080C59CC: - movs r0, 0 - b _080C5A30 - .pool -_080C59D4: - movs r0, 0xF - negs r0, r0 - ands r0, r1 - movs r1, 0x6 - orrs r0, r1 - strb r0, [r2, 0xE] - adds r0, r3, 0 - bl DestroyTask - ldr r0, =sub_80C5934 - bl SetMainCallback2 - b _080C5A1A - .pool -_080C59F4: - ldr r0, =gUnknown_02039CEC - ldr r3, [r0] - movs r0, 0x7 - ands r2, r0 - lsls r2, 1 - ldrb r1, [r3, 0xE] - subs r0, 0x16 - ands r0, r1 - orrs r0, r2 - strb r0, [r3, 0xE] - ldr r1, =gTasks - lsls r0, r4, 2 - adds r0, r4 - lsls r0, 3 - adds r0, r1 - ldr r1, =sub_80C5BD8 - str r1, [r0] - movs r1, 0 - strh r1, [r0, 0x8] -_080C5A1A: - ldr r0, =gUnknown_02039CEC - ldr r2, [r0] - ldr r0, =gUnknown_02039CF0 - ldr r1, [r0] - ldr r0, [r1] - ldrh r0, [r0, 0x20] - strh r0, [r2, 0x8] - ldr r0, [r1] - ldrh r0, [r0, 0x22] - strh r0, [r2, 0xA] - movs r0, 0x1 -_080C5A30: - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C59A4 - - thumb_func_start sub_80C5A48 -sub_80C5A48: @ 80C5A48 - push {r4-r7,lr} - lsls r0, 24 - lsrs r6, r0, 24 - movs r5, 0 - ldr r2, =gMain - ldrh r1, [r2, 0x2C] - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _080C5A80 - ldr r0, =gUnknown_02039CF0 - ldr r4, [r0] - ldr r1, [r4] - ldrh r3, [r1, 0x22] - movs r7, 0x22 - ldrsh r0, [r1, r7] - cmp r0, 0x8 - ble _080C5A80 - subs r0, r3, 0x2 - strh r0, [r1, 0x22] - ldr r1, [r4] - movs r3, 0x22 - ldrsh r0, [r1, r3] - cmp r0, 0x7 - bgt _080C5A7E - movs r0, 0x2 - strh r0, [r1, 0x22] -_080C5A7E: - movs r5, 0x1 -_080C5A80: - ldrh r1, [r2, 0x2C] - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080C5AAE - ldr r0, =gUnknown_02039CF0 - ldr r4, [r0] - ldr r1, [r4] - ldrh r3, [r1, 0x22] - movs r7, 0x22 - ldrsh r0, [r1, r7] - cmp r0, 0x87 - bgt _080C5AAE - adds r0, r3, 0x2 - strh r0, [r1, 0x22] - ldr r1, [r4] - movs r3, 0x22 - ldrsh r0, [r1, r3] - cmp r0, 0x88 - ble _080C5AAC - movs r0, 0x88 - strh r0, [r1, 0x22] -_080C5AAC: - movs r5, 0x1 -_080C5AAE: - ldrh r1, [r2, 0x2C] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _080C5ADC - ldr r0, =gUnknown_02039CF0 - ldr r4, [r0] - ldr r1, [r4] - ldrh r3, [r1, 0x20] - movs r7, 0x20 - ldrsh r0, [r1, r7] - cmp r0, 0x5 - ble _080C5ADC - subs r0, r3, 0x2 - strh r0, [r1, 0x20] - ldr r1, [r4] - movs r3, 0x20 - ldrsh r0, [r1, r3] - cmp r0, 0x4 - bgt _080C5ADA - movs r0, 0x5 - strh r0, [r1, 0x20] -_080C5ADA: - movs r5, 0x1 -_080C5ADC: - ldrh r1, [r2, 0x2C] - movs r0, 0x10 - ands r0, r1 - cmp r0, 0 - beq _080C5B0A - ldr r0, =gUnknown_02039CF0 - ldr r4, [r0] - ldr r1, [r4] - ldrh r3, [r1, 0x20] - movs r7, 0x20 - ldrsh r0, [r1, r7] - cmp r0, 0xE7 - bgt _080C5B0A - adds r0, r3, 0x2 - strh r0, [r1, 0x20] - ldr r1, [r4] - movs r3, 0x20 - ldrsh r0, [r1, r3] - cmp r0, 0xE8 - ble _080C5B08 - movs r0, 0xE8 - strh r0, [r1, 0x20] -_080C5B08: - movs r5, 0x1 -_080C5B0A: - cmp r5, 0 - bne _080C5B88 - ldr r4, =gUnknown_02039CEC - ldr r0, [r4] - ldrb r3, [r0, 0xC] - cmp r3, 0 - beq _080C5B5E - ldrh r1, [r2, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080C5B5E - cmp r3, 0x3 - bhi _080C5B48 - movs r0, 0x5 - bl PlaySE - ldr r0, [r4] - ldrb r1, [r0, 0xC] - adds r0, r6, 0 - bl sub_80C59A4 - cmp r0, 0 - bne _080C5BCA - b _080C5B5E - .pool -_080C5B48: - cmp r3, 0x4 - bne _080C5B5E - movs r0, 0x3 - bl PlaySE - ldr r0, =sub_80C5470 - bl SetMainCallback2 - adds r0, r6, 0 - bl DestroyTask -_080C5B5E: - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r0, 0x2 - ands r0, r1 - cmp r0, 0 - beq _080C5BCA - movs r0, 0x3 - bl PlaySE - ldr r0, =sub_80C5470 - bl SetMainCallback2 - adds r0, r6, 0 - bl DestroyTask - b _080C5BCA - .pool -_080C5B88: - ldr r0, =gUnknown_02039CF0 - ldr r0, [r0] - ldr r1, [r0] - ldrh r0, [r1, 0x20] - subs r0, 0x5 - lsls r0, 16 - asrs r0, 16 - ldrh r1, [r1, 0x22] - adds r1, 0x5 - lsls r1, 16 - asrs r1, 16 - bl sub_80C57FC - lsls r0, 24 - lsrs r5, r0, 24 - ldr r4, =gUnknown_02039CEC - ldr r0, [r4] - ldrb r0, [r0, 0xC] - cmp r0, r5 - beq _080C5BCA - adds r0, r5, 0 - bl sub_80C5ED0 - ldr r1, [r4] - ldrb r0, [r1, 0xC] - strb r0, [r1, 0xD] - ldr r0, [r4] - strb r5, [r0, 0xC] - ldr r1, [r4] - ldrb r0, [r1, 0xC] - ldrb r1, [r1, 0xD] - bl sub_80C6104 -_080C5BCA: - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C5A48 - - thumb_func_start sub_80C5BD8 -sub_80C5BD8: @ 80C5BD8 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x4 - lsls r0, 24 - lsrs r4, r0, 24 - lsls r0, r4, 2 - adds r0, r4 - lsls r5, r0, 3 - ldr r0, =gTasks + 0x8 - mov r8, r0 - adds r6, r5, r0 - ldr r7, =gUnknown_02039CEC - ldr r0, [r7] - ldrh r0, [r0, 0x4] - cmp r0, 0x1 - beq _080C5CD4 - cmp r0, 0x1 - bgt _080C5C0C - cmp r0, 0 - beq _080C5C14 - b _080C5D9C - .pool -_080C5C0C: - cmp r0, 0x2 - bne _080C5C12 - b _080C5D2A -_080C5C12: - b _080C5D9C -_080C5C14: - movs r1, 0 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _080C5C4C - movs r0, 0x1 - movs r1, 0 - bl sub_80C5F58 - movs r1, 0x80 - lsls r1, 1 - adds r0, r1, 0 - strh r0, [r6, 0x2] - strh r0, [r6, 0x4] - movs r0, 0x15 - strh r0, [r6, 0x6] - strh r0, [r6, 0x8] - movs r0, 0x1 - negs r0, r0 - ldr r1, =0x00007fff - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - b _080C5CA4 - .pool -_080C5C4C: - movs r1, 0xFE - lsls r1, 1 - adds r0, r1, 0 - strh r0, [r6, 0x2] - strh r0, [r6, 0x4] - movs r1, 0x15 - negs r1, r1 - adds r0, r1, 0 - strh r0, [r6, 0x6] - strh r0, [r6, 0x8] - 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 - bl sub_80C62DC - ldr r0, =sub_80C53AC - bl SetVBlankCallback - movs r5, 0x1 - negs r5, r5 - ldr r4, =0x00007fff - adds r0, r5, 0 - movs r1, 0x10 - adds r2, r4, 0 - bl BlendPalettes - str r4, [sp] - adds r0, r5, 0 - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade -_080C5CA4: - ldr r4, =gUnknown_02039CF0 - ldr r0, [r4] - adds r0, 0x2C - movs r1, 0x1 - strb r1, [r0] - movs r1, 0x2 - ldrsh r0, [r6, r1] - bl sub_8151624 - ldr r1, [r4] - strh r0, [r1, 0x2E] - movs r1, 0x4 - ldrsh r0, [r6, r1] - bl sub_8151624 - ldr r1, [r4] - strh r0, [r1, 0x30] - b _080C5D9C - .pool -_080C5CD4: - bl UpdatePaletteFade - ldrh r0, [r6, 0x6] - ldrh r1, [r6, 0x2] - adds r0, r1 - strh r0, [r6, 0x2] - ldrh r0, [r6, 0x8] - ldrh r1, [r6, 0x4] - adds r0, r1 - strh r0, [r6, 0x4] - movs r1, 0x2 - ldrsh r0, [r6, r1] - bl sub_8151624 - ldr r4, =gUnknown_02039CF0 - ldr r1, [r4] - strh r0, [r1, 0x2E] - movs r1, 0x4 - ldrsh r0, [r6, r1] - bl sub_8151624 - ldr r1, [r4] - strh r0, [r1, 0x30] - movs r1, 0 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _080C5D1C - movs r0, 0x2 - ldrsh r1, [r6, r0] - movs r0, 0xFE - lsls r0, 1 - cmp r1, r0 - ble _080C5DA6 - b _080C5D9C - .pool -_080C5D1C: - movs r0, 0x2 - ldrsh r1, [r6, r0] - movs r0, 0x80 - lsls r0, 1 - cmp r1, r0 - bne _080C5DA6 - b _080C5D9C -_080C5D2A: - ldr r0, =gUnknown_02039CF0 - ldr r0, [r0] - adds r1, r0, 0 - adds r1, 0x2C - ldrb r0, [r1] - cmp r0, 0 - beq _080C5D3C - movs r0, 0 - strb r0, [r1] -_080C5D3C: - bl UpdatePaletteFade - lsls r0, 24 - cmp r0, 0 - bne _080C5DA6 - movs r1, 0 - ldrsh r0, [r6, r1] - cmp r0, 0 - bne _080C5D64 - adds r0, r4, 0 - bl DestroyTask - ldr r0, =sub_80C5934 - bl SetMainCallback2 - b _080C5D82 - .pool -_080C5D64: - movs r0, 0 - movs r1, 0 - bl sub_80C5F58 - ldr r2, [r7] - ldrb r1, [r2, 0xE] - movs r0, 0xF - negs r0, r0 - ands r0, r1 - strb r0, [r2, 0xE] - mov r0, r8 - subs r0, 0x8 - adds r0, r5, r0 - ldr r1, =sub_80C5A48 - str r1, [r0] -_080C5D82: - movs r0, 0x2 - movs r1, 0x6 - movs r2, 0 - bl SetBgAttribute - ldr r0, =gUnknown_02039CEC - ldr r1, [r0] - movs r0, 0 - b _080C5DA4 - .pool -_080C5D9C: - ldr r0, =gUnknown_02039CEC - ldr r1, [r0] - ldrh r0, [r1, 0x4] - adds r0, 0x1 -_080C5DA4: - strh r0, [r1, 0x4] -_080C5DA6: - add sp, 0x4 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C5BD8 - - thumb_func_start sub_80C5DB8 -sub_80C5DB8: @ 80C5DB8 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0xC - movs r4, 0 -_080C5DC2: - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0 - bl FillWindowPixelBuffer - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x4 - bls _080C5DC2 - ldr r4, =gText_SymbolsEarned - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x60 - bl GetStringCenterAlignXOffset - lsls r2, r0, 24 - lsrs r2, 24 - ldr r6, =gUnknown_08571448 - str r6, [sp] - movs r0, 0 - mov r8, r0 - str r0, [sp, 0x4] - str r4, [sp, 0x8] - movs r1, 0x1 - movs r3, 0x5 - bl AddTextPrinterParameterized3 - ldr r4, =gText_BattleRecord - movs r0, 0x1 - adds r1, r4, 0 - movs r2, 0x60 - bl GetStringCenterAlignXOffset - lsls r2, r0, 24 - lsrs r2, 24 - str r6, [sp] - mov r1, r8 - str r1, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x1 - movs r3, 0x5 - bl AddTextPrinterParameterized3 - str r6, [sp] - mov r0, r8 - str r0, [sp, 0x4] - ldr r0, =gText_BattlePoints - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0x8 - movs r2, 0x5 - movs r3, 0x4 - bl AddTextPrinterParameterized3 - ldr r4, =gStringVar4 - ldr r5, =gUnknown_02039CEC - ldr r0, [r5] - ldrh r1, [r0, 0x6] - adds r0, r4, 0 - movs r2, 0 - movs r3, 0x5 - bl ConvertIntToDecimalStringN - movs r0, 0x8 - adds r1, r4, 0 - movs r2, 0x5B - bl GetStringRightAlignXOffset - lsls r2, r0, 24 - lsrs r2, 24 - str r6, [sp] - mov r1, r8 - str r1, [sp, 0x4] - str r4, [sp, 0x8] - movs r0, 0x2 - movs r1, 0x8 - movs r3, 0x10 - bl AddTextPrinterParameterized3 - ldr r1, [r5] - ldrh r0, [r1, 0x8] - subs r0, 0x5 - lsls r0, 16 - asrs r0, 16 - ldrh r1, [r1, 0xA] - adds r1, 0x5 - lsls r1, 16 - asrs r1, 16 - bl sub_80C57FC - ldr r1, [r5] - strb r0, [r1, 0xC] - ldr r0, [r5] - mov r1, r8 - strb r1, [r0, 0xD] - ldr r0, [r5] - ldrb r0, [r0, 0xC] - bl sub_80C5ED0 - movs r4, 0 -_080C5E92: - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x4 - bls _080C5E92 - movs r0, 0 - bl CopyBgTilemapBufferToVram - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C5DB8 - - thumb_func_start sub_80C5ED0 -sub_80C5ED0: @ 80C5ED0 - push {r4,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r4, r0, 24 - movs r0, 0x3 - movs r1, 0 - bl FillWindowPixelBuffer - cmp r4, 0x3 - bne _080C5F18 - ldr r0, =gUnknown_02039CEC - ldr r0, [r0] - ldrb r0, [r0, 0xE] - movs r1, 0x1 - ands r1, r0 - cmp r1, 0 - bne _080C5F18 - ldr r0, =gUnknown_0857144B - str r0, [sp] - str r1, [sp, 0x4] - ldr r0, =gUnknown_08571614 - ldr r0, [r0] - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0x2 - movs r3, 0 - bl AddTextPrinterParameterized3 - b _080C5F3A - .pool -_080C5F18: - cmp r4, 0 - beq _080C5F3A - ldr r0, =gUnknown_0857144B - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - ldr r1, =gUnknown_08571614 - lsls r0, r4, 2 - adds r0, r1 - ldr r0, [r0] - str r0, [sp, 0x8] - movs r0, 0x3 - movs r1, 0x1 - movs r2, 0x2 - movs r3, 0 - bl AddTextPrinterParameterized3 -_080C5F3A: - movs r0, 0x3 - movs r1, 0x3 - bl CopyWindowToVram - movs r0, 0 - bl CopyBgTilemapBufferToVram - add sp, 0xC - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C5ED0 - - thumb_func_start sub_80C5F58 -sub_80C5F58: @ 80C5F58 - push {r4-r7,lr} - mov r7, r8 - push {r7} - sub sp, 0x10 - lsls r0, 24 - lsrs r2, r0, 24 - lsls r1, 24 - lsrs r7, r1, 24 - ldr r0, =gUnknown_02039CEC - ldr r0, [r0] - ldrb r0, [r0, 0xE] - lsls r0, 28 - lsrs r0, 29 - cmp r0, 0x1 - beq _080C5F80 - cmp r0, 0x2 - beq _080C5FC2 - b _080C60EE - .pool -_080C5F80: - cmp r2, 0 - beq _080C5FA8 - ldr r0, =gUnknown_02039CF0 - ldr r0, [r0] - ldr r1, [r0, 0x20] - movs r0, 0xC - str r0, [sp] - movs r0, 0x7 - str r0, [sp, 0x4] - movs r0, 0x10 - str r0, [sp, 0x8] - movs r0, 0x2 - movs r2, 0x10 - movs r3, 0x3 - bl CopyToBgTilemapBufferRect_ChangePalette - b _080C6004 - .pool -_080C5FA8: - movs r0, 0xC - str r0, [sp] - movs r0, 0x7 - str r0, [sp, 0x4] - movs r0, 0x10 - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0 - movs r2, 0x10 - movs r3, 0x3 - bl FillBgTilemapBufferRect - b _080C6004 -_080C5FC2: - cmp r2, 0 - beq _080C5FEC - ldr r0, =gUnknown_02039CF0 - ldr r0, [r0] - ldr r1, [r0, 0x20] - adds r1, 0x54 - movs r0, 0xC - str r0, [sp] - movs r0, 0x7 - str r0, [sp, 0x4] - movs r0, 0x10 - str r0, [sp, 0x8] - movs r0, 0x2 - movs r2, 0x10 - movs r3, 0xA - bl CopyToBgTilemapBufferRect_ChangePalette - b _080C6004 - .pool -_080C5FEC: - movs r0, 0xC - str r0, [sp] - movs r0, 0x7 - str r0, [sp, 0x4] - movs r0, 0x10 - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0 - movs r2, 0x10 - movs r3, 0xA - bl FillBgTilemapBufferRect -_080C6004: - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - cmp r7, 0 - beq _080C6084 - movs r4, 0xFE - lsls r4, 1 - adds r0, r4, 0 - bl sub_8151624 - adds r6, r0, 0 - lsls r6, 16 - asrs r6, 16 - adds r0, r4, 0 - bl sub_8151624 - lsls r0, 16 - asrs r0, 16 - ldr r5, =gUnknown_085713E0 - ldr r1, =gUnknown_02039CEC - ldr r1, [r1] - ldrb r4, [r1, 0xE] - lsls r4, 28 - lsrs r1, r4, 29 - subs r1, 0x1 - lsls r1, 2 - adds r1, r5 - movs r2, 0 - ldrsh r1, [r1, r2] - lsls r1, 8 - lsrs r2, r4, 29 - subs r2, 0x1 - lsls r2, 2 - adds r3, r5, 0x2 - mov r8, r3 - add r2, r8 - movs r3, 0 - ldrsh r2, [r2, r3] - lsls r2, 8 - lsrs r3, r4, 29 - subs r3, 0x1 - lsls r3, 2 - adds r3, r5 - movs r5, 0 - ldrsh r3, [r3, r5] - lsrs r4, 29 - subs r4, 0x1 - lsls r4, 2 - add r4, r8 - movs r5, 0 - ldrsh r4, [r4, r5] - str r4, [sp] - str r6, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0 - str r0, [sp, 0xC] - movs r0, 0x2 - bl SetBgAffine - b _080C60EE - .pool -_080C6084: - movs r4, 0x80 - lsls r4, 1 - adds r0, r4, 0 - bl sub_8151624 - adds r6, r0, 0 - lsls r6, 16 - asrs r6, 16 - adds r0, r4, 0 - bl sub_8151624 - lsls r0, 16 - asrs r0, 16 - ldr r5, =gUnknown_085713E0 - ldr r1, =gUnknown_02039CEC - ldr r1, [r1] - ldrb r4, [r1, 0xE] - lsls r4, 28 - lsrs r1, r4, 29 - subs r1, 0x1 - lsls r1, 2 - adds r1, r5 - movs r2, 0 - ldrsh r1, [r1, r2] - lsls r1, 8 - lsrs r2, r4, 29 - subs r2, 0x1 - lsls r2, 2 - adds r3, r5, 0x2 - mov r8, r3 - add r2, r8 - movs r3, 0 - ldrsh r2, [r2, r3] - lsls r2, 8 - lsrs r3, r4, 29 - subs r3, 0x1 - lsls r3, 2 - adds r3, r5 - movs r5, 0 - ldrsh r3, [r3, r5] - lsrs r4, 29 - subs r4, 0x1 - lsls r4, 2 - add r4, r8 - movs r5, 0 - ldrsh r4, [r4, r5] - str r4, [sp] - str r6, [sp, 0x4] - str r0, [sp, 0x8] - str r7, [sp, 0xC] - movs r0, 0x2 - bl SetBgAffine -_080C60EE: - add sp, 0x10 - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C5F58 - - thumb_func_start sub_80C6104 -sub_80C6104: @ 80C6104 - push {r4,r5,lr} - sub sp, 0xC - lsls r0, 24 - lsrs r4, r0, 24 - lsls r1, 24 - lsrs r5, r1, 24 - cmp r5, 0x2 - beq _080C614C - cmp r5, 0x2 - bgt _080C611E - cmp r5, 0x1 - beq _080C6128 - b _080C61C4 -_080C611E: - cmp r5, 0x3 - beq _080C6170 - cmp r5, 0x4 - beq _080C61A4 - b _080C61C4 -_080C6128: - ldr r0, =gUnknown_02039CF0 - ldr r0, [r0] - ldr r1, [r0, 0x24] - movs r0, 0xC - str r0, [sp] - movs r0, 0x7 - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r2, 0x10 - movs r3, 0x3 - bl CopyToBgTilemapBufferRect_ChangePalette - b _080C61CE - .pool -_080C614C: - ldr r0, =gUnknown_02039CF0 - ldr r0, [r0] - ldr r1, [r0, 0x24] - movs r0, 0xA8 - lsls r0, 1 - adds r1, r0 - movs r0, 0xC - str r0, [sp] - movs r0, 0x7 - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r2, 0x10 - b _080C6192 - .pool -_080C6170: - ldr r0, =gUnknown_02039CEC - ldr r0, [r0] - ldrb r1, [r0, 0xE] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080C61C4 - ldr r0, =gUnknown_02039CF0 - ldr r0, [r0] - ldr r1, [r0, 0x28] - movs r0, 0xC - str r0, [sp] - str r5, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r2, 0x2 -_080C6192: - movs r3, 0xA - bl CopyToBgTilemapBufferRect_ChangePalette - b _080C61CE - .pool -_080C61A4: - ldr r1, =gUnknown_08DE3350 - movs r0, 0x9 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r2, 0x15 - movs r3, 0 - bl CopyToBgTilemapBufferRect_ChangePalette - b _080C61CE - .pool -_080C61C4: - subs r0, r4, 0x1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bhi _080C6294 -_080C61CE: - cmp r4, 0x2 - beq _080C620C - cmp r4, 0x2 - bgt _080C61DC - cmp r4, 0x1 - beq _080C61E6 - b _080C6284 -_080C61DC: - cmp r4, 0x3 - beq _080C6230 - cmp r4, 0x4 - beq _080C6264 - b _080C6284 -_080C61E6: - ldr r0, =gUnknown_02039CF0 - ldr r0, [r0] - ldr r1, [r0, 0x24] - adds r1, 0xA8 - movs r0, 0xC - str r0, [sp] - movs r0, 0x7 - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r2, 0x10 - movs r3, 0x3 - bl CopyToBgTilemapBufferRect_ChangePalette - b _080C628E - .pool -_080C620C: - ldr r0, =gUnknown_02039CF0 - ldr r0, [r0] - ldr r1, [r0, 0x24] - movs r0, 0xFC - lsls r0, 1 - adds r1, r0 - movs r0, 0xC - str r0, [sp] - movs r0, 0x7 - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r2, 0x10 - b _080C6254 - .pool -_080C6230: - ldr r0, =gUnknown_02039CEC - ldr r0, [r0] - ldrb r1, [r0, 0xE] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _080C6294 - ldr r0, =gUnknown_02039CF0 - ldr r0, [r0] - ldr r1, [r0, 0x28] - adds r1, 0x48 - movs r0, 0xC - str r0, [sp] - str r4, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r2, 0x2 -_080C6254: - movs r3, 0xA - bl CopyToBgTilemapBufferRect_ChangePalette - b _080C628E - .pool -_080C6264: - ldr r1, =gUnknown_08DE3374 - movs r0, 0x9 - str r0, [sp] - movs r0, 0x2 - str r0, [sp, 0x4] - movs r0, 0x11 - str r0, [sp, 0x8] - movs r0, 0x1 - movs r2, 0x15 - movs r3, 0 - bl CopyToBgTilemapBufferRect_ChangePalette - b _080C628E - .pool -_080C6284: - subs r0, r5, 0x1 - lsls r0, 24 - lsrs r0, 24 - cmp r0, 0x3 - bhi _080C6294 -_080C628E: - movs r0, 0x1 - bl CopyBgTilemapBufferToVram -_080C6294: - add sp, 0xC - pop {r4,r5} - pop {r0} - bx r0 - thumb_func_end sub_80C6104 - - thumb_func_start sub_80C629C -sub_80C629C: @ 80C629C - push {r4,lr} - ldr r1, =gUnknown_08DE3060 - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer - ldr r4, =gUnknown_02039CEC - ldr r1, [r4] - ldrb r0, [r1, 0xC] - ldrb r1, [r1, 0xD] - bl sub_80C6104 - ldr r0, [r4] - ldrb r1, [r0, 0xE] - lsls r1, 28 - lsrs r1, 29 - movs r0, 0x1 - bl sub_80C5F58 - bl sub_80C5DB8 - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C629C - - thumb_func_start sub_80C62DC -sub_80C62DC: @ 80C62DC - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x18 - movs r5, 0 - bl FreeAllSpritePalettes - bl ResetAffineAnimData - ldr r0, =gUnknown_085714E4 - bl LoadSpritePalettes - ldr r4, =gUnknown_085714BC - adds r0, r4, 0 - bl LoadCompressedSpriteSheet - adds r4, 0x10 - adds r0, r4, 0 - bl LoadCompressedSpriteSheet - ldr r0, =gUnknown_085715B4 - ldr r1, =gUnknown_02039CEC - ldr r2, [r1] - movs r3, 0x8 - ldrsh r1, [r2, r3] - movs r6, 0xA - ldrsh r2, [r2, r6] - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - ldr r3, =gUnknown_02039CF0 - ldr r2, [r3] - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =gSprites - adds r1, r0 - str r1, [r2] - ldrb r2, [r1, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x5] - mov r8, sp - mov r9, r3 -_080C633C: - ldr r0, =gUnknown_02039CEC - ldr r0, [r0] - adds r0, 0xF - adds r2, r0, r5 - ldrb r0, [r2] - adds r4, r5, 0x1 - cmp r0, 0 - beq _080C63C2 - mov r1, sp - ldr r0, =gUnknown_085715E4 - ldm r0!, {r3,r6,r7} - stm r1!, {r3,r6,r7} - ldm r0!, {r3,r6,r7} - stm r1!, {r3,r6,r7} - mov r7, r8 - ldrh r0, [r7, 0x2] - ldr r1, =0x0000ffff - adds r0, r1 - ldrb r2, [r2] - adds r0, r2 - strh r0, [r7, 0x2] - ldr r1, =gUnknown_08571454 - adds r0, r5, 0x6 - lsls r0, 3 - adds r0, r1 - ldrh r1, [r0, 0x4] - adds r1, 0x8 - lsls r1, 16 - asrs r1, 16 - ldrh r2, [r0] - adds r2, 0x6 - lsls r2, 16 - asrs r2, 16 - lsls r3, r4, 24 - lsrs r3, 24 - mov r0, sp - bl CreateSprite - lsls r0, 24 - lsrs r0, 24 - mov r3, r9 - ldr r2, [r3] - lsls r3, r5, 2 - adds r2, 0x4 - adds r2, r3 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - ldr r0, =gSprites - adds r1, r0 - str r1, [r2] - ldrb r2, [r1, 0x5] - movs r6, 0xD - negs r6, r6 - adds r0, r6, 0 - ands r2, r0 - movs r0, 0x8 - orrs r2, r0 - strb r2, [r1, 0x5] - mov r7, r9 - ldr r0, [r7] - adds r0, 0x4 - adds r0, r3 - ldr r0, [r0] - adds r1, r5, 0 - bl StartSpriteAnim -_080C63C2: - lsls r0, r4, 24 - lsrs r5, r0, 24 - cmp r5, 0x6 - bls _080C633C - add sp, 0x18 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C62DC - - thumb_func_start sub_80C63FC -sub_80C63FC: @ 80C63FC - push {r4-r6,lr} - movs r5, 0 - ldr r4, =gUnknown_02039CF0 - ldr r0, [r4] - ldr r0, [r0] - bl DestroySprite - ldr r0, [r4] - str r5, [r0] - adds r6, r4, 0 -_080C6410: - ldr r0, [r6] - lsls r4, r5, 2 - adds r0, 0x4 - adds r0, r4 - ldr r0, [r0] - cmp r0, 0 - beq _080C642C - bl DestroySprite - ldr r0, [r6] - adds r0, 0x4 - adds r0, r4 - movs r1, 0 - str r1, [r0] -_080C642C: - adds r0, r5, 0x1 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x6 - bls _080C6410 - bl FreeAllSpritePalettes - movs r0, 0x2 - bl FreeSpriteTilesByTag - movs r0, 0 - bl FreeSpriteTilesByTag - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C63FC - - thumb_func_start nullsub_39 -nullsub_39: @ 80C6450 - bx lr - thumb_func_end nullsub_39 - - thumb_func_start sub_80C6454 -sub_80C6454: @ 80C6454 + thumb_func_start ShowFrontierMap +ShowFrontierMap: @ 80C6454 push {r4,r5,lr} adds r4, r0, 0 ldr r5, =gUnknown_02039CF4 @@ -1350,13 +26,13 @@ _080C6466: ldr r0, =sub_80C67BC movs r1, 0 bl CreateTask - ldr r0, =sub_80C5438 + ldr r0, =CB2_FrontierPass bl SetMainCallback2 pop {r4,r5} pop {r0} bx r0 .pool - thumb_func_end sub_80C6454 + thumb_func_end ShowFrontierMap thumb_func_start sub_80C6498 sub_80C6498: @ 80C6498 @@ -1524,7 +200,7 @@ _080C6628: movs r0, 0x2 bl ShowBg bl sub_80C6974 - ldr r0, =sub_80C53AC + ldr r0, =VblankCb_FrontierPass bl SetVBlankCallback movs r5, 0x1 negs r5, r5 diff --git a/include/frontier_pass.h b/include/frontier_pass.h new file mode 100644 index 000000000..bdfc1996f --- /dev/null +++ b/include/frontier_pass.h @@ -0,0 +1,7 @@ +#ifndef GUARD_FRONTIER_PASS_H +#define GUARD_FRONTIER_PASS_H + +void ShowFrontierPass(void (*callback)(void)); +void CB2_ReshowFrontierPass(void); + +#endif // GUARD_FRONTIER_PASS_H diff --git a/include/graphics.h b/include/graphics.h index d6a32cab2..ed91b06c1 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -4863,6 +4863,9 @@ extern const u32 gUnknown_08DD1F78[]; // Frontier Pass extern const u32 gUnknown_08DE08C8[]; extern const u32 gUnknown_08DE2084[]; +extern const u32 gUnknown_08DE3350[]; +extern const u32 gUnknown_08DE3374[]; +extern const u32 gUnknown_08DE3060[]; extern const u16 gUnknown_08DE07C8[][16]; #endif //GUARD_GRAPHICS_H diff --git a/include/palette.h b/include/palette.h index f51dc4b88..e24da3e00 100644 --- a/include/palette.h +++ b/include/palette.h @@ -63,7 +63,7 @@ void TintPlttBuffer(u32, s8, s8, s8); void UnfadePlttBuffer(u32); void BeginFastPaletteFade(u8); void BeginHardwarePaletteFade(u8, u8, u8, u8, u8); -void BlendPalettes(u32, u8, u16); +void BlendPalettes(u32 selectedPalettes, u8 coeff, u16 color); void BlendPalettesUnfaded(u32, u8, u16); void sub_80A2C44(u32 a1, s8 a2, u8 a3, u8 a4, u16 a5, u8 a6, u8 a7); void TintPalette_GrayScale(u16 *palette, u16 count); diff --git a/include/strings.h b/include/strings.h index 4e9c91ff5..2c07eb68e 100644 --- a/include/strings.h +++ b/include/strings.h @@ -2248,4 +2248,9 @@ extern const u8 gText_Var1DarkLightGreyBP[]; extern const u8 gText_BattleTower[]; extern const u8 gText_BattlePtsWon[]; -#endif //GUARD_STRINGS_H +// Frontier Pass +extern const u8 gText_SymbolsEarned[]; +extern const u8 gText_BattleRecord[]; +extern const u8 gText_BattlePoints[]; + +#endif // GUARD_STRINGS_H diff --git a/src/frontier_pass.c b/src/frontier_pass.c index 7b25ca9b8..078baaff1 100644 --- a/src/frontier_pass.c +++ b/src/frontier_pass.c @@ -10,19 +10,36 @@ #include "text_window.h" #include "task.h" #include "graphics.h" +#include "strings.h" +#include "frontier_pass.h" +#include "international_string_util.h" #include "palette.h" #include "window.h" +#include "decompress.h" #include "menu_helpers.h" #include "menu.h" #include "bg.h" #include "sound.h" +#include "string_util.h" #include "battle_pyramid.h" #include "overworld.h" +#include "math_util.h" #include "constants/battle_frontier.h" #include "constants/rgb.h" #include "constants/region_map_sections.h" #include "constants/songs.h" +// All windows displayed in the frontier pass. +enum +{ + WINDOW_EARNED_SYMBOLS, + WINDOW_BATTLE_RECORD, + WINDOW_BATTLE_POINTS, + WINDOW_DESCRIPTION, + WINDOW_4, + WINDOW_COUNT +}; + enum { CURSOR_AREA_NOTHING, @@ -41,8 +58,8 @@ struct FrontierPassData void (*callback)(void); u16 state; u16 battlePoints; - s16 x; - s16 y; + s16 cursorX; + s16 cursorY; u8 cursorArea; u8 previousCursorArea; u8 hasBattleRecord:1; @@ -51,13 +68,14 @@ struct FrontierPassData u8 facilitySymbols[NUM_FRONTIER_FACILITIES]; }; -struct FrontierPassUnk +struct FrontierPassGfx { - u32 unk0[8]; + struct Sprite *cursorSprite; + struct Sprite *symbolSprites[NUM_FRONTIER_FACILITIES]; u8 *unk20; u8 *unk24; u8 *unk28; - bool8 unk2C; + bool8 setAffine; s16 unk2E; s16 unk30; u8 tilemapBuff1[0x1000]; @@ -68,26 +86,29 @@ struct FrontierPassUnk struct FrontierPassSaved { void (*callback)(void); - s16 x; - s16 y; + s16 cursorX; + s16 cursorY; }; extern struct FrontierPassData *gUnknown_02039CEC; -extern struct FrontierPassUnk *gUnknown_02039CF0; +extern struct FrontierPassGfx *gUnknown_02039CF0; extern struct FrontierPassSaved gUnknown_02039CF8; // This file's functions. -u32 sub_80C51F0(void (*callback)(void)); -void sub_80C544C(void); +u32 AllocateFrontierPassData(void (*callback)(void)); +void ShowFrontierMap(void (*callback)(void)); +void CB2_InitFrontierPass(void); void sub_80C629C(void); -void sub_80C63FC(void); -void sub_80C62DC(void); -u32 sub_80C52E4(void); -bool32 sub_80C5484(void); -bool32 sub_80C570C(void); -void sub_80C5A48(u8 taskId); -void sub_80C5BD8(u8 taskId); +void FreeCursorAndSymbolSprites(void); +void LoadCursorAndSymbolSprites(void); +u32 FreeFrontierPassData(void); +bool32 InitFrontierPass(void); +bool32 HideFrontierPass(void); +void Task_HandleFrontierPassInput(u8 taskId); +void Task_DoFadeEffect(u8 taskId); void sub_80C6104(u8 cursorArea, u8 previousCursorArea); +void PrintAreaDescription(u8 cursorArea); +void sub_80C5F58(bool8 arg0, bool8 arg1); // Const rom data. extern const s16 gUnknown_085713E0[][2]; @@ -96,6 +117,13 @@ extern const struct WindowTemplate gUnknown_08571400[]; extern const u32 gUnknown_085712F8[]; extern const u32 gUnknown_085712C0[]; extern const u32 gUnknown_08571060[]; +extern const u8 gUnknown_08571448[]; +extern const u8 gUnknown_0857144B[]; +extern const u8 *const gUnknown_08571614[]; +extern const struct SpritePalette gUnknown_085714E4[]; +extern const struct CompressedSpriteSheet gUnknown_085714BC[]; +extern const struct SpriteTemplate gUnknown_085715B4; +extern const struct SpriteTemplate gUnknown_085715E4; // code void sub_80C50D0(void) @@ -126,19 +154,19 @@ void sub_80C50D0(void) CpuFill32(0, (void *)OAM, OAM_SIZE); } -void sub_80C51C4(void (*callback)(void)) +void ShowFrontierPass(void (*callback)(void)) { - sub_80C51F0(callback); - SetMainCallback2(sub_80C544C); + AllocateFrontierPassData(callback); + SetMainCallback2(CB2_InitFrontierPass); } -void sub_80C51D8(void) +void LeaveFrontierPass(void) { SetMainCallback2(gUnknown_02039CEC->callback); - sub_80C52E4(); + FreeFrontierPassData(); } -u32 sub_80C51F0(void (*callback)(void)) +u32 AllocateFrontierPassData(void (*callback)(void)) { u8 i; @@ -153,13 +181,13 @@ u32 sub_80C51F0(void (*callback)(void)) i = GetCurrentRegionMapSectionId(); if (i != MAPSEC_BATTLE_FRONTIER && i != MAPSEC_ARTISAN_CAVE) { - gUnknown_02039CEC->x = 176; - gUnknown_02039CEC->y = 104; + gUnknown_02039CEC->cursorX = 176; + gUnknown_02039CEC->cursorY = 104; } else { - gUnknown_02039CEC->x = 176; - gUnknown_02039CEC->y = 48; + gUnknown_02039CEC->cursorX = 176; + gUnknown_02039CEC->cursorY = 48; } gUnknown_02039CEC->battlePoints = gSaveBlock2Ptr->frontier.battlePoints; @@ -177,7 +205,7 @@ u32 sub_80C51F0(void (*callback)(void)) return 0; } -u32 sub_80C52E4(void) +u32 FreeFrontierPassData(void) { if (gUnknown_02039CEC == NULL) return 1; @@ -187,7 +215,7 @@ u32 sub_80C52E4(void) return 0; } -u32 sub_80C5310(void) +u32 AllocateFrontierPassGfx(void) { if (gUnknown_02039CF0 != NULL) return 1; @@ -199,7 +227,7 @@ u32 sub_80C5310(void) return 0; } -u32 sub_80C5340(void) +u32 FreeFrontierPassGfx(void) { FreeAllWindowBuffers(); if (gUnknown_02039CF0 == NULL) @@ -217,9 +245,9 @@ u32 sub_80C5340(void) return 0; } -void sub_80C53AC(void) +void VblankCb_FrontierPass(void) { - if (gUnknown_02039CF0->unk2C) + if (gUnknown_02039CF0->setAffine) { SetBgAffine(2, gUnknown_085713E0[gUnknown_02039CEC->unkE - 1][0] << 8, @@ -235,31 +263,31 @@ void sub_80C53AC(void) TransferPlttBuffer(); } -void sub_80C5438(void) +void CB2_FrontierPass(void) { RunTasks(); AnimateSprites(); BuildOamBuffer(); } -void sub_80C544C(void) +void CB2_InitFrontierPass(void) { - if (sub_80C5484()) + if (InitFrontierPass()) { - CreateTask(sub_80C5A48, 0); - SetMainCallback2(sub_80C5438); + CreateTask(Task_HandleFrontierPassInput, 0); + SetMainCallback2(CB2_FrontierPass); } } -void sub_80C5470(void) +void CB2_HideFrontierPass(void) { - if (sub_80C570C()) + if (HideFrontierPass()) { - sub_80C51D8(); + LeaveFrontierPass(); } } -bool32 sub_80C5484(void) +bool32 InitFrontierPass(void) { u32 sizeOut = 0; @@ -282,7 +310,7 @@ bool32 sub_80C5484(void) reset_temp_tile_data_buffers(); break; case 3: - sub_80C5310(); + AllocateFrontierPassGfx(); break; case 4: ResetBgsAndClearDma3BusyFlags(0); @@ -330,8 +358,8 @@ bool32 sub_80C5484(void) ShowBg(0); ShowBg(1); ShowBg(2); - sub_80C62DC(); - SetVBlankCallback(sub_80C53AC); + LoadCursorAndSymbolSprites(); + SetVBlankCallback(VblankCb_FrontierPass); BlendPalettes(0xFFFFFFFF, 0x10, 0); BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); break; @@ -349,7 +377,7 @@ bool32 sub_80C5484(void) return FALSE; } -bool32 sub_80C570C(void) +bool32 HideFrontierPass(void) { switch (gUnknown_02039CEC->state) { @@ -378,7 +406,7 @@ bool32 sub_80C570C(void) SetVBlankHBlankCallbacksToNull(); break; case 3: - sub_80C63FC(); + FreeCursorAndSymbolSprites(); break; case 4: sub_80C50D0(); @@ -390,7 +418,7 @@ bool32 sub_80C570C(void) UnsetBgTilemapBuffer(0); UnsetBgTilemapBuffer(1); UnsetBgTilemapBuffer(2); - sub_80C5340(); + FreeFrontierPassGfx(); gUnknown_02039CEC->state = 0; return TRUE; } @@ -408,7 +436,7 @@ struct } extern const gUnknown_08571454[]; -u8 sub_80C57FC(s16 x, s16 y) +u8 GetCursorAreaFromCoords(s16 x, s16 y) { u8 i; @@ -428,35 +456,35 @@ u8 sub_80C57FC(s16 x, s16 y) return 0; } -void sub_80C5868(void) +void CB2_ReshowFrontierPass(void) { u8 taskId; - if (!sub_80C5484()) + if (!InitFrontierPass()) return; switch (gUnknown_02039CEC->unkE) { case 1: case 2: - taskId = CreateTask(sub_80C5BD8, 0); - gTasks[taskId].data[0] = 1; + taskId = CreateTask(Task_DoFadeEffect, 0); + gTasks[taskId].data[0] = TRUE; break; case 3: default: gUnknown_02039CEC->unkE = 0; - taskId = CreateTask(sub_80C5A48, 0); + taskId = CreateTask(Task_HandleFrontierPassInput, 0); break; } - SetMainCallback2(sub_80C5438); + SetMainCallback2(CB2_FrontierPass); } -void sub_80C58D4(void) +void CB2_ReturnFromRecord(void) { - sub_80C51F0(gUnknown_02039CF8.callback); - gUnknown_02039CEC->x = gUnknown_02039CF8.x; - gUnknown_02039CEC->y = gUnknown_02039CF8.y; + AllocateFrontierPassData(gUnknown_02039CF8.callback); + gUnknown_02039CEC->cursorX = gUnknown_02039CF8.cursorX; + gUnknown_02039CEC->cursorY = gUnknown_02039CF8.cursorY; memset(&gUnknown_02039CF8, 0, sizeof(gUnknown_02039CF8)); switch (InBattlePyramid()) { @@ -471,5 +499,438 @@ void sub_80C58D4(void) break; } - SetMainCallback2(sub_80C5868); + SetMainCallback2(CB2_ReshowFrontierPass); } + +void CB2_ShowFrontierPassFeature(void) +{ + if (!HideFrontierPass()) + return; + + switch (gUnknown_02039CEC->unkE) + { + case 1: + ShowFrontierMap(CB2_ReshowFrontierPass); + break; + case 3: + gUnknown_02039CF8.callback = gUnknown_02039CEC->callback; + gUnknown_02039CF8.cursorX = gUnknown_02039CEC->cursorX; + gUnknown_02039CF8.cursorY = gUnknown_02039CEC->cursorY; + FreeFrontierPassData(); + PlayRecordedBattle(CB2_ReturnFromRecord); + break; + case 2: + ShowPlayerTrainerCard(CB2_ReshowFrontierPass); + break; + } +} + +bool32 TryCallPassAreaFunction(u8 taskId, u8 cursorArea) +{ + switch (cursorArea) + { + case CURSOR_AREA_RECORD: + if (!gUnknown_02039CEC->hasBattleRecord) + return FALSE; + gUnknown_02039CEC->unkE = 3; + DestroyTask(taskId); + SetMainCallback2(CB2_ShowFrontierPassFeature); + break; + case CURSOR_AREA_MAP: + case CURSOR_AREA_CARD: + gUnknown_02039CEC->unkE = cursorArea; + gTasks[taskId].func = Task_DoFadeEffect; + gTasks[taskId].data[0] = FALSE; + break; + default: + return FALSE; + } + + gUnknown_02039CEC->cursorX = gUnknown_02039CF0->cursorSprite->pos1.x; + gUnknown_02039CEC->cursorY = gUnknown_02039CF0->cursorSprite->pos1.y; + return TRUE; +} + +void Task_HandleFrontierPassInput(u8 taskId) +{ + u8 var = FALSE; // Reused, first informs whether the cursor moves, then used as the new cursor area. + + if (gMain.heldKeys & DPAD_UP && gUnknown_02039CF0->cursorSprite->pos1.y >= 9) + { + gUnknown_02039CF0->cursorSprite->pos1.y -= 2; + if (gUnknown_02039CF0->cursorSprite->pos1.y <= 7) + gUnknown_02039CF0->cursorSprite->pos1.y = 2; + var = TRUE; + } + if (gMain.heldKeys & DPAD_DOWN && gUnknown_02039CF0->cursorSprite->pos1.y <= 135) + { + gUnknown_02039CF0->cursorSprite->pos1.y += 2; + if (gUnknown_02039CF0->cursorSprite->pos1.y >= 137) + gUnknown_02039CF0->cursorSprite->pos1.y = 136; + var = TRUE; + } + + if (gMain.heldKeys & DPAD_LEFT && gUnknown_02039CF0->cursorSprite->pos1.x >= 6) + { + gUnknown_02039CF0->cursorSprite->pos1.x -= 2; + if (gUnknown_02039CF0->cursorSprite->pos1.x <= 4) + gUnknown_02039CF0->cursorSprite->pos1.x = 5; + var = TRUE; + } + if (gMain.heldKeys & DPAD_RIGHT && gUnknown_02039CF0->cursorSprite->pos1.x <= 231) + { + gUnknown_02039CF0->cursorSprite->pos1.x += 2; + if (gUnknown_02039CF0->cursorSprite->pos1.x >= 233) + gUnknown_02039CF0->cursorSprite->pos1.x = 232; + var = TRUE; + } + + if (!var) // Cursor did not change. + { + if (gUnknown_02039CEC->cursorArea != CURSOR_AREA_NOTHING && gMain.newKeys & A_BUTTON) + { + if (gUnknown_02039CEC->cursorArea <= CURSOR_AREA_RECORD) // Map, Card, Record + { + PlaySE(SE_SELECT); + if (TryCallPassAreaFunction(taskId, gUnknown_02039CEC->cursorArea)) + return; + } + else if (gUnknown_02039CEC->cursorArea == CURSOR_AREA_CANCEL) + { + PlaySE(SE_PC_OFF); + SetMainCallback2(CB2_HideFrontierPass); + DestroyTask(taskId); + // BUG. The function should return here. Otherwise, it can play the same sound twice and destroy the same task twice. + } + } + + if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_PC_OFF); + SetMainCallback2(CB2_HideFrontierPass); + DestroyTask(taskId); + } + } + else + { + var = GetCursorAreaFromCoords(gUnknown_02039CF0->cursorSprite->pos1.x - 5, gUnknown_02039CF0->cursorSprite->pos1.y + 5); + if (gUnknown_02039CEC->cursorArea != var) + { + PrintAreaDescription(var); + gUnknown_02039CEC->previousCursorArea = gUnknown_02039CEC->cursorArea; + gUnknown_02039CEC->cursorArea = var; + sub_80C6104(gUnknown_02039CEC->cursorArea, gUnknown_02039CEC->previousCursorArea); + } + } +} + +void Task_DoFadeEffect(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + + switch (gUnknown_02039CEC->state) + { + case 0: + if (!data[0]) + { + sub_80C5F58(TRUE, FALSE); + data[1] = 0x100; + data[2] = 0x100; + data[3] = 0x15; + data[4] = 0x15; + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_WHITE); + } + else + { + data[1] = 0x1FC; + data[2] = 0x1FC; + data[3] = -0x15; + data[4] = -0x15; + SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP); + ShowBg(0); + ShowBg(1); + ShowBg(2); + LoadCursorAndSymbolSprites(); + SetVBlankCallback(VblankCb_FrontierPass); + BlendPalettes(0xFFFFFFFF, 0x10, RGB_WHITE); + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_WHITE); + } + gUnknown_02039CF0->setAffine = TRUE; + gUnknown_02039CF0->unk2E = sub_8151624(data[1]); + gUnknown_02039CF0->unk30 = sub_8151624(data[2]); + break; + case 1: + UpdatePaletteFade(); + data[1] += data[3]; + data[2] += data[4]; + gUnknown_02039CF0->unk2E = sub_8151624(data[1]); + gUnknown_02039CF0->unk30 = sub_8151624(data[2]); + if (!data[0]) + { + if (data[1] <= 0x1FC) + return; + } + else + { + if (data[1] != 0x100) + return; + } + break; + case 2: + if (gUnknown_02039CF0->setAffine) // Nonsensical check. + gUnknown_02039CF0->setAffine = FALSE; + if (UpdatePaletteFade()) + return; + if (!data[0]) + { + DestroyTask(taskId); + SetMainCallback2(CB2_ShowFrontierPassFeature); + } + else + { + sub_80C5F58(FALSE, FALSE); + gUnknown_02039CEC->unkE = 0; + gTasks[taskId].func = Task_HandleFrontierPassInput; + } + SetBgAttribute(2, BG_ATTR_WRAPAROUND, 0); + gUnknown_02039CEC->state = 0; + return; + } + + gUnknown_02039CEC->state++; +} + +void ShowAndPrintWindows(void) +{ + s32 x; + u8 i; + + for (i = 0; i < WINDOW_COUNT; i++) + { + PutWindowTilemap(i); + FillWindowPixelBuffer(i, 0); + } + + x = GetStringCenterAlignXOffset(1, gText_SymbolsEarned, 0x60); + AddTextPrinterParameterized3(WINDOW_EARNED_SYMBOLS, 1, x, 5, gUnknown_08571448, 0, gText_SymbolsEarned); + + x = GetStringCenterAlignXOffset(1, gText_BattleRecord, 0x60); + AddTextPrinterParameterized3(WINDOW_BATTLE_RECORD, 1, x, 5, gUnknown_08571448, 0, gText_BattleRecord); + + AddTextPrinterParameterized3(WINDOW_BATTLE_POINTS, 8, 5, 4, gUnknown_08571448, 0, gText_BattlePoints); + ConvertIntToDecimalStringN(gStringVar4, gUnknown_02039CEC->battlePoints, STR_CONV_MODE_LEFT_ALIGN, 5); + x = GetStringRightAlignXOffset(8, gStringVar4, 0x5B); + AddTextPrinterParameterized3(WINDOW_BATTLE_POINTS, 8, x, 16, gUnknown_08571448, 0, gStringVar4); + + gUnknown_02039CEC->cursorArea = GetCursorAreaFromCoords(gUnknown_02039CEC->cursorX - 5, gUnknown_02039CEC->cursorY + 5); + gUnknown_02039CEC->previousCursorArea = CURSOR_AREA_NOTHING; + PrintAreaDescription(gUnknown_02039CEC->cursorArea); + + for (i = 0; i < WINDOW_COUNT; i++) + CopyWindowToVram(i, 3); + + CopyBgTilemapBufferToVram(0); +} + +void PrintAreaDescription(u8 cursorArea) +{ + FillWindowPixelBuffer(WINDOW_DESCRIPTION, 0); + if (cursorArea == CURSOR_AREA_RECORD && !gUnknown_02039CEC->hasBattleRecord) + AddTextPrinterParameterized3(WINDOW_DESCRIPTION, 1, 2, 0, gUnknown_0857144B, 0, gUnknown_08571614[0]); + else if (cursorArea != CURSOR_AREA_NOTHING) + AddTextPrinterParameterized3(WINDOW_DESCRIPTION, 1, 2, 0, gUnknown_0857144B, 0, gUnknown_08571614[cursorArea]); + + CopyWindowToVram(WINDOW_DESCRIPTION, 3); + CopyBgTilemapBufferToVram(0); +} + +void sub_80C5F58(bool8 arg0, bool8 arg1) +{ + switch (gUnknown_02039CEC->unkE) + { + case 1: + if (arg0) + CopyToBgTilemapBufferRect_ChangePalette(2, gUnknown_02039CF0->unk20, 16, 3, 12, 7, 16); + else + FillBgTilemapBufferRect(2, 0, 16, 3, 12, 7, 16); + break; + case 2: + if (arg0) + CopyToBgTilemapBufferRect_ChangePalette(2, gUnknown_02039CF0->unk20 + 84, 16, 10, 12, 7, 16); + else + FillBgTilemapBufferRect(2, 0, 16, 10, 12, 7, 16); + break; + default: + return; + } + + CopyBgTilemapBufferToVram(2); + if (arg1) + { + SetBgAffine(2, + gUnknown_085713E0[gUnknown_02039CEC->unkE - 1][0] << 8, + gUnknown_085713E0[gUnknown_02039CEC->unkE - 1][1] << 8, + gUnknown_085713E0[gUnknown_02039CEC->unkE - 1][0], + gUnknown_085713E0[gUnknown_02039CEC->unkE - 1][1], + sub_8151624(0x1FC), + sub_8151624(0x1FC), + 0); + } + else + { + SetBgAffine(2, + gUnknown_085713E0[gUnknown_02039CEC->unkE - 1][0] << 8, + gUnknown_085713E0[gUnknown_02039CEC->unkE - 1][1] << 8, + gUnknown_085713E0[gUnknown_02039CEC->unkE - 1][0], + gUnknown_085713E0[gUnknown_02039CEC->unkE - 1][1], + sub_8151624(0x100), + sub_8151624(0x100), + 0); + } +} + +void sub_80C6104(u8 cursorArea, u8 previousCursorArea) +{ + bool32 var; + + switch (previousCursorArea) + { + case CURSOR_AREA_MAP: + CopyToBgTilemapBufferRect_ChangePalette(1, gUnknown_02039CF0->unk24, 16, 3, 12, 7, 17); + var = TRUE; + break; + case CURSOR_AREA_CARD: + CopyToBgTilemapBufferRect_ChangePalette(1, gUnknown_02039CF0->unk24 + 336, 16, 10, 12, 7, 17); + var = TRUE; + break; + case CURSOR_AREA_RECORD: + if (!gUnknown_02039CEC->hasBattleRecord) + { + var = FALSE; + } + else + { + CopyToBgTilemapBufferRect_ChangePalette(1, gUnknown_02039CF0->unk28, 2, 10, 12, 3, 17); + var = TRUE; + } + break; + case CURSOR_AREA_CANCEL: + CopyToBgTilemapBufferRect_ChangePalette(1, gUnknown_08DE3350, 21, 0, 9, 2, 17); + var = TRUE; + break; + default: + var = FALSE; + break; + } + + if (!var) + { + if (cursorArea == CURSOR_AREA_NOTHING || cursorArea > CURSOR_AREA_CANCEL) + return; + } + + switch (cursorArea) + { + case CURSOR_AREA_MAP: + CopyToBgTilemapBufferRect_ChangePalette(1, gUnknown_02039CF0->unk24 + 168, 16, 3, 12, 7, 17); + var = TRUE; + break; + case CURSOR_AREA_CARD: + CopyToBgTilemapBufferRect_ChangePalette(1, gUnknown_02039CF0->unk24 + 504, 16, 10, 12, 7, 17); + var = TRUE; + break; + case CURSOR_AREA_RECORD: + if (!gUnknown_02039CEC->hasBattleRecord) + return; + + CopyToBgTilemapBufferRect_ChangePalette(1, gUnknown_02039CF0->unk28 + 72, 2, 10, 12, 3, 17); + var = TRUE; + break; + case CURSOR_AREA_CANCEL: + CopyToBgTilemapBufferRect_ChangePalette(1, gUnknown_08DE3374, 21, 0, 9, 2, 17); + var = TRUE; + break; + default: + var = FALSE; + break; + } + + if (!var) + { + asm("":::"r4"); + if (previousCursorArea == CURSOR_AREA_NOTHING || previousCursorArea > CURSOR_AREA_CANCEL) + return; + } + + CopyBgTilemapBufferToVram(1); +} + +void sub_80C629C(void) +{ + CopyToBgTilemapBuffer(1, gUnknown_08DE3060, 0, 0); + sub_80C6104(gUnknown_02039CEC->cursorArea, gUnknown_02039CEC->previousCursorArea); + sub_80C5F58(TRUE, gUnknown_02039CEC->unkE); + ShowAndPrintWindows(); + CopyBgTilemapBufferToVram(1); +} + +void LoadCursorAndSymbolSprites(void) +{ + u8 spriteId; + u8 i = 0; + + FreeAllSpritePalettes(); + ResetAffineAnimData(); + LoadSpritePalettes(gUnknown_085714E4); + LoadCompressedSpriteSheet(&gUnknown_085714BC[0]); + LoadCompressedSpriteSheet(&gUnknown_085714BC[2]); + spriteId = CreateSprite(&gUnknown_085715B4, gUnknown_02039CEC->cursorX, gUnknown_02039CEC->cursorY, 0); + gUnknown_02039CF0->cursorSprite = &gSprites[spriteId]; + gUnknown_02039CF0->cursorSprite->oam.priority = 0; + + for (i = 0; i < NUM_FRONTIER_FACILITIES; i++) + { + if (gUnknown_02039CEC->facilitySymbols[i] != 0) + { + struct SpriteTemplate sprite = gUnknown_085715E4; + + sprite.paletteTag += gUnknown_02039CEC->facilitySymbols[i] - 1; + spriteId = CreateSprite(&sprite, gUnknown_08571454[i + CURSOR_AREA_SYMBOL - 1].xStart + 8, gUnknown_08571454[i + CURSOR_AREA_SYMBOL - 1].yStart + 6, i + 1); + gUnknown_02039CF0->symbolSprites[i] = &gSprites[spriteId]; + gUnknown_02039CF0->symbolSprites[i]->oam.priority = 2; + StartSpriteAnim(gUnknown_02039CF0->symbolSprites[i], i); + } + } +} + +void FreeCursorAndSymbolSprites(void) +{ + u8 i = 0; + + DestroySprite(gUnknown_02039CF0->cursorSprite); + gUnknown_02039CF0->cursorSprite = NULL; + for (i = 0; i < NUM_FRONTIER_FACILITIES; i++) + { + if (gUnknown_02039CF0->symbolSprites[i] != NULL) + { + DestroySprite(gUnknown_02039CF0->symbolSprites[i]); + gUnknown_02039CF0->symbolSprites[i] = NULL; + } + } + FreeAllSpritePalettes(); + FreeSpriteTilesByTag(2); + FreeSpriteTilesByTag(0); +} + +void nullsub_39(void) +{ + +} + +// Frontier Map code. +/* +void ShowFrontierMap(void (*callback)(void)); +{ + +} +*/ diff --git a/src/start_menu.c b/src/start_menu.c index 6b4b0e775..5c7e5365d 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -10,6 +10,7 @@ #include "bg.h" #include "field_effect.h" #include "party_menu.h" +#include "frontier_pass.h" #include "task.h" #include "overworld.h" #include "link.h" @@ -92,8 +93,6 @@ extern void sub_808B864(void); extern void CB2_Pokedex(void); extern void PlayRainSoundEffect(void); extern void CB2_PokeNav(void); -extern void ShowPlayerTrainerCard(void (*)(void)); -extern void sub_80C51C4(void (*)(void)); extern void ScriptUnfreezeEventObjects(void); extern void sub_81A9EC8(void); extern void save_serialize_map(void); @@ -678,7 +677,7 @@ static bool8 StartMenuPlayerNameCallback(void) if (is_c1_link_related_active() || InUnionRoom()) ShowPlayerTrainerCard(CB2_ReturnToFieldWithOpenMenu); // Display trainer card else if (FlagGet(FLAG_SYS_FRONTIER_PASS)) - sub_80C51C4(CB2_ReturnToFieldWithOpenMenu); // Display frontier pass + ShowFrontierPass(CB2_ReturnToFieldWithOpenMenu); // Display frontier pass else ShowPlayerTrainerCard(CB2_ReturnToFieldWithOpenMenu); // Display trainer card diff --git a/src/trainer_card.c b/src/trainer_card.c index cde15ae34..e4b9c5edf 100755 --- a/src/trainer_card.c +++ b/src/trainer_card.c @@ -8,6 +8,7 @@ #include "link.h" #include "bg.h" #include "sound.h" +#include "frontier_pass.h" #include "overworld.h" #include "menu.h" #include "text.h" @@ -90,7 +91,6 @@ struct TrainerCardData //external functions extern u8 sub_80D30A0(u16); -extern void sub_80C5868(void); // EWRAM EWRAM_DATA static struct TrainerCardData *sData = NULL; @@ -1754,7 +1754,7 @@ void ShowPlayerTrainerCard(void (*callback)(void)) { sData = AllocZeroed(sizeof(*sData)); sData->callback2 = callback; - if (callback == sub_80C5868) + if (callback == CB2_ReshowFrontierPass) sData->var_52C = 0x7FFF; else sData->var_52C = 0; From 03549349f89ba464b1f4b4f7c87b204f3045741b Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sat, 26 Jan 2019 19:20:14 +0100 Subject: [PATCH 13/16] Decompile all frontier pass --- src/frontier_pass.c | 459 +++++++++++++++++++++++++++++++++-- src/pokemon_storage_system.c | 164 ++++++++++++- src/trainer_card.c | 1 - 3 files changed, 607 insertions(+), 17 deletions(-) diff --git a/src/frontier_pass.c b/src/frontier_pass.c index 078baaff1..f9d56a272 100644 --- a/src/frontier_pass.c +++ b/src/frontier_pass.c @@ -25,6 +25,7 @@ #include "overworld.h" #include "math_util.h" #include "constants/battle_frontier.h" +#include "constants/maps.h" #include "constants/rgb.h" #include "constants/region_map_sections.h" #include "constants/songs.h" @@ -117,12 +118,11 @@ extern const struct WindowTemplate gUnknown_08571400[]; extern const u32 gUnknown_085712F8[]; extern const u32 gUnknown_085712C0[]; extern const u32 gUnknown_08571060[]; -extern const u8 gUnknown_08571448[]; -extern const u8 gUnknown_0857144B[]; +extern const u8 gUnknown_08571448[][3]; extern const u8 *const gUnknown_08571614[]; extern const struct SpritePalette gUnknown_085714E4[]; extern const struct CompressedSpriteSheet gUnknown_085714BC[]; -extern const struct SpriteTemplate gUnknown_085715B4; +extern const struct SpriteTemplate gUnknown_085715B4[2]; extern const struct SpriteTemplate gUnknown_085715E4; // code @@ -712,15 +712,15 @@ void ShowAndPrintWindows(void) } x = GetStringCenterAlignXOffset(1, gText_SymbolsEarned, 0x60); - AddTextPrinterParameterized3(WINDOW_EARNED_SYMBOLS, 1, x, 5, gUnknown_08571448, 0, gText_SymbolsEarned); + AddTextPrinterParameterized3(WINDOW_EARNED_SYMBOLS, 1, x, 5, gUnknown_08571448[0], 0, gText_SymbolsEarned); x = GetStringCenterAlignXOffset(1, gText_BattleRecord, 0x60); - AddTextPrinterParameterized3(WINDOW_BATTLE_RECORD, 1, x, 5, gUnknown_08571448, 0, gText_BattleRecord); + AddTextPrinterParameterized3(WINDOW_BATTLE_RECORD, 1, x, 5, gUnknown_08571448[0], 0, gText_BattleRecord); - AddTextPrinterParameterized3(WINDOW_BATTLE_POINTS, 8, 5, 4, gUnknown_08571448, 0, gText_BattlePoints); + AddTextPrinterParameterized3(WINDOW_BATTLE_POINTS, 8, 5, 4, gUnknown_08571448[0], 0, gText_BattlePoints); ConvertIntToDecimalStringN(gStringVar4, gUnknown_02039CEC->battlePoints, STR_CONV_MODE_LEFT_ALIGN, 5); x = GetStringRightAlignXOffset(8, gStringVar4, 0x5B); - AddTextPrinterParameterized3(WINDOW_BATTLE_POINTS, 8, x, 16, gUnknown_08571448, 0, gStringVar4); + AddTextPrinterParameterized3(WINDOW_BATTLE_POINTS, 8, x, 16, gUnknown_08571448[0], 0, gStringVar4); gUnknown_02039CEC->cursorArea = GetCursorAreaFromCoords(gUnknown_02039CEC->cursorX - 5, gUnknown_02039CEC->cursorY + 5); gUnknown_02039CEC->previousCursorArea = CURSOR_AREA_NOTHING; @@ -736,9 +736,9 @@ void PrintAreaDescription(u8 cursorArea) { FillWindowPixelBuffer(WINDOW_DESCRIPTION, 0); if (cursorArea == CURSOR_AREA_RECORD && !gUnknown_02039CEC->hasBattleRecord) - AddTextPrinterParameterized3(WINDOW_DESCRIPTION, 1, 2, 0, gUnknown_0857144B, 0, gUnknown_08571614[0]); + AddTextPrinterParameterized3(WINDOW_DESCRIPTION, 1, 2, 0, gUnknown_08571448[1], 0, gUnknown_08571614[0]); else if (cursorArea != CURSOR_AREA_NOTHING) - AddTextPrinterParameterized3(WINDOW_DESCRIPTION, 1, 2, 0, gUnknown_0857144B, 0, gUnknown_08571614[cursorArea]); + AddTextPrinterParameterized3(WINDOW_DESCRIPTION, 1, 2, 0, gUnknown_08571448[1], 0, gUnknown_08571614[cursorArea]); CopyWindowToVram(WINDOW_DESCRIPTION, 3); CopyBgTilemapBufferToVram(0); @@ -884,7 +884,7 @@ void LoadCursorAndSymbolSprites(void) LoadSpritePalettes(gUnknown_085714E4); LoadCompressedSpriteSheet(&gUnknown_085714BC[0]); LoadCompressedSpriteSheet(&gUnknown_085714BC[2]); - spriteId = CreateSprite(&gUnknown_085715B4, gUnknown_02039CEC->cursorX, gUnknown_02039CEC->cursorY, 0); + spriteId = CreateSprite(&gUnknown_085715B4[0], gUnknown_02039CEC->cursorX, gUnknown_02039CEC->cursorY, 0); gUnknown_02039CF0->cursorSprite = &gSprites[spriteId]; gUnknown_02039CF0->cursorSprite->oam.priority = 0; @@ -928,9 +928,440 @@ void nullsub_39(void) } // Frontier Map code. -/* -void ShowFrontierMap(void (*callback)(void)); -{ +struct FrontierMapData +{ + void (*callback)(void); + struct Sprite *cursorSprite; + struct Sprite *playerHeadSprite; + struct Sprite *mapIndicatorSprite; + u8 cursorPos; + u8 unk11; + u8 tilemapBuff0[0x1000]; + u8 tilemapBuff1[0x1000]; + u8 tilemapBuff2[0x1000]; +}; + +extern struct FrontierMapData *gUnknown_02039CF4; + +// Forward declarations. +void sub_80C67BC(u8 taskId); +void sub_80C6B94(void); +void sub_80C6974(void); +void sub_80C6C70(u8 direction); + +extern const struct BgTemplate gUnknown_085713F4[3]; +extern const struct WindowTemplate gUnknown_08571428[]; +extern const u32 gUnknown_0856FBBC[]; +extern const u32 gUnknown_08570E00[]; + +void ShowFrontierMap(void (*callback)(void)) +{ + if (gUnknown_02039CF4 != NULL) + SetMainCallback2(callback); // This line doesn't make sense at all, since it gets overwritten later anyway. + + gUnknown_02039CF4 = AllocZeroed(sizeof(*gUnknown_02039CF4)); + gUnknown_02039CF4->callback = callback; + ResetTasks(); + CreateTask(sub_80C67BC, 0); + SetMainCallback2(CB2_FrontierPass); +} + +void sub_80C6498(void) +{ + ResetTasks(); + SetMainCallback2(gUnknown_02039CF4->callback); + memset(gUnknown_02039CF4, 0, sizeof(*gUnknown_02039CF4)); // Pointless memory clear. + FREE_AND_SET_NULL(gUnknown_02039CF4); +} + +bool32 sub_80C64CC(void) +{ + switch (gUnknown_02039CEC->state) + { + case 0: + SetVBlankCallback(NULL); + ScanlineEffect_Stop(); + SetVBlankHBlankCallbacksToNull(); + break; + case 1: + sub_80C50D0(); + break; + case 2: + ResetSpriteData(); + FreeAllSpritePalettes(); + ResetPaletteFade(); + reset_temp_tile_data_buffers(); + break; + case 3: + ResetBgsAndClearDma3BusyFlags(0); + InitBgsFromTemplates(0, gUnknown_085713F4, ARRAY_COUNT(gUnknown_085713F4)); + SetBgTilemapBuffer(0, gUnknown_02039CF4->tilemapBuff0); + SetBgTilemapBuffer(1, gUnknown_02039CF4->tilemapBuff1); + SetBgTilemapBuffer(2, gUnknown_02039CF4->tilemapBuff2); + FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 30, 20); + FillBgTilemapBufferRect_Palette0(1, 0, 0, 0, 30, 20); + FillBgTilemapBufferRect_Palette0(2, 0, 0, 0, 30, 20); + CopyBgTilemapBufferToVram(0); + CopyBgTilemapBufferToVram(1); + CopyBgTilemapBufferToVram(2); + break; + case 4: + InitWindows(gUnknown_08571428); + DeactivateAllTextPrinters(); + sub_80C6B94(); + decompress_and_copy_tile_data_to_vram(1, gUnknown_0856FBBC, 0, 0, 0); + break; + case 5: + if (free_temp_tile_data_buffers_if_possible()) + return FALSE; + LoadPalette(gUnknown_08DE07C8[0], 0, 0x1A0); + LoadPalette(stdpal_get(0), 0xF0, 0x20); + CopyToBgTilemapBuffer(2, gUnknown_08570E00, 0, 0); + CopyBgTilemapBufferToVram(2); + break; + case 6: + SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP); + ShowBg(0); + ShowBg(1); + ShowBg(2); + sub_80C6974(); + SetVBlankCallback(VblankCb_FrontierPass); + BlendPalettes(0xFFFFFFFF, 0x10, RGB_WHITE); + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_WHITE); + break; + case 7: + if (UpdatePaletteFade()) + return FALSE; + gUnknown_02039CEC->state = 0; + return TRUE; + } + + gUnknown_02039CEC->state++; + return FALSE; +} + +bool32 sub_80C66AC(void) +{ + switch (gUnknown_02039CEC->state) + { + case 0: + BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_WHITE); + break; + case 1: + if (UpdatePaletteFade()) + return FALSE; + SetGpuReg(REG_OFFSET_DISPCNT, 0); + HideBg(0); + HideBg(1); + HideBg(2); + break; + case 2: + SetVBlankCallback(NULL); + ScanlineEffect_Stop(); + SetVBlankHBlankCallbacksToNull(); + break; + case 3: + if (gUnknown_02039CF4->cursorSprite != NULL) + { + DestroySprite(gUnknown_02039CF4->cursorSprite); + FreeSpriteTilesByTag(0); + } + if (gUnknown_02039CF4->mapIndicatorSprite != NULL) + { + DestroySprite(gUnknown_02039CF4->mapIndicatorSprite); + FreeSpriteTilesByTag(1); + } + if (gUnknown_02039CF4->playerHeadSprite != NULL) + { + DestroySprite(gUnknown_02039CF4->playerHeadSprite); + FreeSpriteTilesByTag(4); + } + FreeAllWindowBuffers(); + break; + case 4: + sub_80C50D0(); + ResetSpriteData(); + FreeAllSpritePalettes(); + break; + case 5: + UnsetBgTilemapBuffer(0); + UnsetBgTilemapBuffer(1); + UnsetBgTilemapBuffer(2); + gUnknown_02039CEC->state = 0; + return TRUE; + } + + gUnknown_02039CEC->state++; + return FALSE; +} + +void sub_80C67BC(u8 taskId) +{ + s16 *data = gTasks[taskId].data; + + switch (data[0]) + { + case 0: + if (sub_80C64CC()) + break; + return; + case 1: + if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_PC_OFF); + data[0] = 4; + } + else if (gMain.newKeys & DPAD_DOWN) + { + if (gUnknown_02039CF4->cursorPos >= NUM_FRONTIER_FACILITIES - 1) + sub_80C6C70(0); + else + data[0] = 2; + } + else if (gMain.newKeys & DPAD_UP) + { + if (gUnknown_02039CF4->cursorPos == 0) + sub_80C6C70(1); + else + data[0] = 3; + } + return; + case 2: + if (data[1] > 3) + { + sub_80C6C70(0); + data[1] = 0; + data[0] = 1; + } + else + { + gUnknown_02039CF4->cursorSprite->pos1.y += 4; + data[1]++; + } + return; + case 3: + if (data[1] > 3) + { + sub_80C6C70(1); + data[1] = 0; + data[0] = 1; + } + else + { + gUnknown_02039CF4->cursorSprite->pos1.y -= 4; + data[1]++; + } + return; + case 4: + if (sub_80C66AC()) + break; + return; + case 5: + DestroyTask(taskId); + sub_80C6498(); + return; + } + + data[0]++; +} + +u8 sub_80C68E8(u16 mapNum) // id + 1, zero means not a frontier map number +{ + if ((mapNum >= MAP_NUM(BATTLE_FRONTIER_BATTLE_TOWER_LOBBY) && mapNum <= MAP_NUM(BATTLE_FRONTIER_BATTLE_TOWER_BATTLE_ROOM)) + || (mapNum >= MAP_NUM(BATTLE_FRONTIER_BATTLE_TOWER_MULTI_BATTLE_ROOM) && mapNum <= MAP_NUM(BATTLE_FRONTIER_BATTLE_TOWER_BATTLE_ROOM2))) + return FRONTIER_FACILITY_TOWER + 1; + else if (mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_DOME_LOBBY) + || mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_DOME_CORRIDOR) + || mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_DOME_PRE_BATTLE_ROOM) + || mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_DOME_BATTLE_ROOM)) + return FRONTIER_FACILITY_DOME + 1; + else if (mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_PALACE_LOBBY) + || mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_PALACE_CORRIDOR) + || mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_PALACE_BATTLE_ROOM)) + return FRONTIER_FACILITY_PALACE + 1; + else if (mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_ARENA_LOBBY) + || mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_ARENA_CORRIDOR) + || mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_ARENA_BATTLE_ROOM)) + return FRONTIER_FACILITY_ARENA + 1; + else if (mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_FACTORY_LOBBY) + || mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_FACTORY_PRE_BATTLE_ROOM) + || mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_FACTORY_BATTLE_ROOM)) + return FRONTIER_FACILITY_FACTORY + 1; + else if (mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_PIKE_LOBBY) + || mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_PIKE_CORRIDOR) + || mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_PIKE_THREE_PATH_ROOM) + || mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_PIKE_RANDOM_ROOM1) + || mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_PIKE_RANDOM_ROOM2) + || mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_PIKE_RANDOM_ROOM3)) + return FRONTIER_FACILITY_PIKE + 1; + else if (mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_PYRAMID_LOBBY) + || mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_PYRAMID_EMPTY_SQUARE) + || mapNum == MAP_NUM(BATTLE_FRONTIER_BATTLE_PYRAMID_TOP)) + return FRONTIER_FACILITY_PYRAMID + 1; + else + return 0; +} + +struct +{ + const u8 *name; + const u8 *description; + s16 x; + s16 y; + u8 animNum; +} extern const gUnknown_08571650[]; + +extern const struct CompressedSpriteSheet gUnknown_085714D4[]; +extern const struct SpriteTemplate gUnknown_085715FC; + +void sub_80C6974(void) +{ + struct SpriteTemplate sprite; + u8 spriteId; + u8 id; + s16 x = 0, y; + + FreeAllSpritePalettes(); + LoadSpritePalettes(gUnknown_085714E4); + + LoadCompressedSpriteSheet(&gUnknown_085714BC[0]); + spriteId = CreateSprite(&gUnknown_085715B4[0], 155, (gUnknown_02039CF4->cursorPos * 16) + 8, 2); + gUnknown_02039CF4->cursorSprite = &gSprites[spriteId]; + gUnknown_02039CF4->cursorSprite->oam.priority = 0; + gUnknown_02039CF4->cursorSprite->hFlip = TRUE; + StartSpriteAnim(gUnknown_02039CF4->cursorSprite, 1); + + LoadCompressedSpriteSheet(&gUnknown_085714BC[1]); + spriteId = CreateSprite(&gUnknown_085715B4[1], gUnknown_08571650[gUnknown_02039CF4->cursorPos].x, gUnknown_08571650[gUnknown_02039CF4->cursorPos].y, 1); + gUnknown_02039CF4->mapIndicatorSprite = &gSprites[spriteId]; + gUnknown_02039CF4->mapIndicatorSprite->oam.priority = 0; + StartSpriteAnim(gUnknown_02039CF4->mapIndicatorSprite, gUnknown_08571650[gUnknown_02039CF4->cursorPos].animNum); + + // Create player indicator head sprite only if it's in vicinity of battle frontier. + id = GetCurrentRegionMapSectionId(); + if (id == MAPSEC_BATTLE_FRONTIER || id == MAPSEC_ARTISAN_CAVE) + { + s8 mapNum = gSaveBlock1Ptr->location.mapNum; + + if (mapNum == MAP_NUM(BATTLE_FRONTIER_OUTSIDE_WEST) + || (mapNum == MAP_NUM(BATTLE_FRONTIER_OUTSIDE_EAST) && (x = 55))) + { + x += gSaveBlock1Ptr->pos.x; + y = gSaveBlock1Ptr->pos.y; + + x /= 8; + y /= 8; + + id = 0; + } + else + { + id = sub_80C68E8(mapNum); + if (id != 0) + { + x = gUnknown_08571650[id - 1].x; + y = gUnknown_08571650[id - 1].y; + } + else + { + // Handle Artisan Cave. + if (gSaveBlock1Ptr->escapeWarp.mapNum == MAP_NUM(BATTLE_FRONTIER_OUTSIDE_EAST)) + x = gSaveBlock1Ptr->escapeWarp.x + 55; + else + x = gSaveBlock1Ptr->escapeWarp.x; + + y = gSaveBlock1Ptr->escapeWarp.y; + + x /= 8; + y /= 8; + } + } + + LoadCompressedSpriteSheet(gUnknown_085714D4); + sprite = gUnknown_085715FC; + sprite.paletteTag = gSaveBlock2Ptr->playerGender + 4; + if (id != 0) + { + spriteId = CreateSprite(&sprite, x, y, 0); + } + else + { + x *= 8; + y *= 8; + spriteId = CreateSprite(&sprite, x + 20, y + 36, 0); + } + + gUnknown_02039CF4->playerHeadSprite = &gSprites[spriteId]; + gUnknown_02039CF4->playerHeadSprite->oam.priority = 0; + if (gSaveBlock2Ptr->playerGender != MALE) + StartSpriteAnim(gUnknown_02039CF4->playerHeadSprite, 1); + } +} + +enum +{ + MAP_WINDOW_0, + MAP_WINDOW_NAME, + MAP_WINDOW_DESCRIPTION, + MAP_WINDOW_COUNT +}; + +void sub_80C6B94(void) +{ + u8 i; + + for (i = 0; i < MAP_WINDOW_COUNT; i++) + { + PutWindowTilemap(i); + FillWindowPixelBuffer(i, 0); + } + + for (i = 0; i < NUM_FRONTIER_FACILITIES; i++) + { + if (i == gUnknown_02039CF4->cursorPos) + AddTextPrinterParameterized3(MAP_WINDOW_NAME, 7, 4, (i * 16) + 1, gUnknown_08571448[2], 0, gUnknown_08571650[i].name); + else + AddTextPrinterParameterized3(MAP_WINDOW_NAME, 7, 4, (i * 16) + 1, gUnknown_08571448[1], 0, gUnknown_08571650[i].name); + } + + AddTextPrinterParameterized3(MAP_WINDOW_DESCRIPTION, 1, 4, 0, gUnknown_08571448[0], 0, gUnknown_08571650[gUnknown_02039CF4->cursorPos].description); + + for (i = 0; i < MAP_WINDOW_COUNT; i++) + CopyWindowToVram(i, 3); + + CopyBgTilemapBufferToVram(0); +} + +void sub_80C6C70(u8 direction) +{ + u8 oldCursorPos, i; + + if (direction) + { + oldCursorPos = gUnknown_02039CF4->cursorPos; + gUnknown_02039CF4->cursorPos = (oldCursorPos + 6) % NUM_FRONTIER_FACILITIES; + } + else + { + oldCursorPos = gUnknown_02039CF4->cursorPos; + gUnknown_02039CF4->cursorPos = (oldCursorPos + 1) % NUM_FRONTIER_FACILITIES; + } + + AddTextPrinterParameterized3(MAP_WINDOW_NAME, 7, 4, (oldCursorPos * 16) + 1, gUnknown_08571448[1], 0, gUnknown_08571650[oldCursorPos].name); + AddTextPrinterParameterized3(MAP_WINDOW_NAME, 7, 4, (gUnknown_02039CF4->cursorPos * 16) + 1, gUnknown_08571448[2], 0, gUnknown_08571650[gUnknown_02039CF4->cursorPos].name); + + gUnknown_02039CF4->cursorSprite->pos1.y = (gUnknown_02039CF4->cursorPos * 16) + 8; + + StartSpriteAnim(gUnknown_02039CF4->mapIndicatorSprite, gUnknown_08571650[gUnknown_02039CF4->cursorPos].animNum); + gUnknown_02039CF4->mapIndicatorSprite->pos1.x = gUnknown_08571650[gUnknown_02039CF4->cursorPos].x; + gUnknown_02039CF4->mapIndicatorSprite->pos1.y = gUnknown_08571650[gUnknown_02039CF4->cursorPos].y; + FillWindowPixelBuffer(MAP_WINDOW_DESCRIPTION, 0); + AddTextPrinterParameterized3(MAP_WINDOW_DESCRIPTION, 1, 4, 0, gUnknown_08571448[0], 0, gUnknown_08571650[gUnknown_02039CF4->cursorPos].description); + + for (i = 0; i < 3; i++) + CopyWindowToVram(i, 3); + + CopyBgTilemapBufferToVram(0); + PlaySE(SE_Z_SCROLL); } -*/ diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index 36ed78a54..dc2e80a61 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -463,8 +463,6 @@ EWRAM_DATA static u8 sMovingMonOrigBoxId = 0; EWRAM_DATA static u8 sMovingMonOrigBoxPos = 0; EWRAM_DATA static bool8 sCanOnlyMove = 0; -extern void sub_80C6D80(u8 *arg0, void *arg1, u8 arg2, u8 arg3, s32 arg4); - extern const struct CompressedSpriteSheet gMonFrontPicTable[]; // This file's functions. @@ -1543,6 +1541,168 @@ static const u8 gHandCursorTiles[] = INCBIN_U8("graphics/pokemon_storage/hand_cu static const u8 gHandCursorShadowTiles[] = INCBIN_U8("graphics/pokemon_storage/hand_cursor_shadow.4bpp"); // code +void sub_80C6D80(u8 *string, void *dst, u8 arg2, u8 arg3, s32 arg4) +{ + s32 i, val, val2; + u16 windowId; + u8 txtColor[3]; + u8 *tileData1, *tileData2; + struct WindowTemplate winTemplate = {0}; + + winTemplate.width = 24; + winTemplate.height = 2; + windowId = AddWindow(&winTemplate); + FillWindowPixelBuffer(windowId, (arg3 << 4) | arg3); + tileData1 = (u8*) GetWindowAttribute(windowId, WINDOW_TILE_DATA); + tileData2 = (winTemplate.width * 32) + tileData1; + + if (!arg2) + txtColor[0] = 0; + else + txtColor[0] = arg3; + txtColor[1] = 0xF; + txtColor[2] = 0xE; + AddTextPrinterParameterized4(windowId, 1, 0, 1, 0, 0, txtColor, -1, string); + + val = arg4; + if (val > 6u) + val = 6; + val2 = arg4 - 6; + if (val > 0) + { + for (i = val; i != 0; i--) + { + CpuCopy16(tileData1, dst, 0x80); + CpuCopy16(tileData2, dst + 0x80, 0x80); + tileData1 += 0x80; + tileData2 += 0x80; + dst += 0x100; + } + } + + if (val2 > 0) + CpuFill16((arg3 << 4) | arg3, dst, (u32)(val2) * 0x100); + + RemoveWindow(windowId); +} + +NAKED +void sub_80C6EAC() +{ + asm_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, 0x2C\n\ + str r0, [sp, 0x20]\n\ + str r1, [sp, 0x24]\n\ + adds r6, r3, 0\n\ + ldr r0, [sp, 0x4C]\n\ + mov r9, r0\n\ + ldr r1, [sp, 0x50]\n\ + mov r10, r1\n\ + lsls r2, 16\n\ + lsrs r2, 16\n\ + str r2, [sp, 0x28]\n\ + lsls r6, 24\n\ + lsrs r6, 24\n\ + mov r2, r9\n\ + lsls r2, 24\n\ + lsrs r2, 24\n\ + mov r9, r2\n\ + mov r0, r10\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + mov r10, r0\n\ + movs r0, 0\n\ + movs r1, 0\n\ + str r0, [sp, 0x18]\n\ + str r1, [sp, 0x1C]\n\ + ldr r0, [sp, 0x20]\n\ + bl StringLength_Multibyte\n\ + lsls r0, 24\n\ + ldr r2, =0x00ffffff\n\ + ldr r1, [sp, 0x18]\n\ + ands r1, r2\n\ + orrs r1, r0\n\ + str r1, [sp, 0x18]\n\ + ldr r1, =0xffffff00\n\ + add r2, sp, 0x18\n\ + mov r8, r2\n\ + ldr r0, [r2, 0x4]\n\ + ands r0, r1\n\ + movs r1, 0x2\n\ + orrs r0, r1\n\ + str r0, [r2, 0x4]\n\ + ldr r5, [sp, 0x18]\n\ + lsrs r5, 24\n\ + lsls r5, 5\n\ + mov r0, r8\n\ + bl AddWindow\n\ + adds r4, r0, 0\n\ + lsls r4, 24\n\ + lsrs r4, 24\n\ + lsls r1, r6, 4\n\ + orrs r1, r6\n\ + lsls r1, 24\n\ + lsrs r1, 24\n\ + adds r0, r4, 0\n\ + bl FillWindowPixelBuffer\n\ + adds r0, r4, 0\n\ + movs r1, 0x7\n\ + bl GetWindowAttribute\n\ + adds r7, r0, 0\n\ + mov r0, r8\n\ + ldrb r0, [r0, 0x3]\n\ + lsls r0, 5\n\ + mov r8, r0\n\ + add r8, r7\n\ + add r0, sp, 0x14\n\ + movs r1, 0\n\ + strb r6, [r0]\n\ + mov r2, r9\n\ + strb r2, [r0, 0x1]\n\ + mov r2, r10\n\ + strb r2, [r0, 0x2]\n\ + str r1, [sp]\n\ + str r1, [sp, 0x4]\n\ + str r0, [sp, 0x8]\n\ + movs r0, 0x1\n\ + negs r0, r0\n\ + str r0, [sp, 0xC]\n\ + ldr r0, [sp, 0x20]\n\ + str r0, [sp, 0x10]\n\ + adds r0, r4, 0\n\ + movs r1, 0x1\n\ + movs r2, 0\n\ + movs r3, 0x2\n\ + bl AddTextPrinterParameterized4\n\ + lsrs r5, 1\n\ + adds r0, r7, 0\n\ + ldr r1, [sp, 0x24]\n\ + adds r2, r5, 0\n\ + bl CpuSet\n\ + ldr r2, [sp, 0x24]\n\ + ldr r0, [sp, 0x28]\n\ + adds r1, r2, r0\n\ + mov r0, r8\n\ + adds r2, r5, 0\n\ + bl CpuSet\n\ + adds r0, r4, 0\n\ + bl RemoveWindow\n\ + add sp, 0x2C\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"); +} + u8 CountMonsInBox(u8 boxId) { u16 i, count; diff --git a/src/trainer_card.c b/src/trainer_card.c index e4b9c5edf..b7bd5cc1d 100755 --- a/src/trainer_card.c +++ b/src/trainer_card.c @@ -167,7 +167,6 @@ static bool8 sub_80C4C84(struct Task* task); static bool8 sub_80C4DB0(struct Task* task); static void sub_80C32EC(u16); static void sub_80C41D8(void); -static void sub_80C6D80(const u8 *, u8 *, u8, u8, u8); // const rom data static const u32 gUnknown_0856F018[] = INCBIN_U32("graphics/trainer_card/stickers_fr.4bpp.lz"); From 01c3f3fc059b01b17ae7ceb0168be76617e1714d Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sat, 26 Jan 2019 20:56:06 +0100 Subject: [PATCH 14/16] Document all of frontier pass --- asm/frontier_pass.s | 1335 ------------------------------ data/frontier_pass.s | 229 ----- include/graphics.h | 6 + include/pokemon_storage_system.h | 1 + include/string_util.h | 2 +- include/strings.h | 30 + ld_script.txt | 3 +- src/frontier_pass.c | 1052 +++++++++++++++-------- src/pokemon_storage_system.c | 138 +-- src/string_util.c | 2 +- src/trade.c | 3 +- sym_ewram.txt | 14 +- 12 files changed, 763 insertions(+), 2052 deletions(-) delete mode 100644 asm/frontier_pass.s delete mode 100644 data/frontier_pass.s diff --git a/asm/frontier_pass.s b/asm/frontier_pass.s deleted file mode 100644 index 7f9cf934b..000000000 --- a/asm/frontier_pass.s +++ /dev/null @@ -1,1335 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - - - thumb_func_start ShowFrontierMap -ShowFrontierMap: @ 80C6454 - push {r4,r5,lr} - adds r4, r0, 0 - ldr r5, =gUnknown_02039CF4 - ldr r0, [r5] - cmp r0, 0 - beq _080C6466 - adds r0, r4, 0 - bl SetMainCallback2 -_080C6466: - ldr r0, =0x00003014 - bl AllocZeroed - str r0, [r5] - str r4, [r0] - bl ResetTasks - ldr r0, =sub_80C67BC - movs r1, 0 - bl CreateTask - ldr r0, =CB2_FrontierPass - bl SetMainCallback2 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end ShowFrontierMap - - thumb_func_start sub_80C6498 -sub_80C6498: @ 80C6498 - push {r4,lr} - bl ResetTasks - ldr r4, =gUnknown_02039CF4 - ldr r0, [r4] - ldr r0, [r0] - bl SetMainCallback2 - ldr r0, [r4] - ldr r2, =0x00003014 - movs r1, 0 - bl memset - ldr r0, [r4] - bl Free - movs r0, 0 - str r0, [r4] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C6498 - - thumb_func_start sub_80C64CC -sub_80C64CC: @ 80C64CC - push {r4,r5,lr} - sub sp, 0x8 - ldr r0, =gUnknown_02039CEC - ldr r0, [r0] - ldrh r0, [r0, 0x4] - cmp r0, 0x7 - bls _080C64DC - b _080C6694 -_080C64DC: - lsls r0, 2 - ldr r1, =_080C64F0 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C64F0: - .4byte _080C6510 - .4byte _080C6520 - .4byte _080C6526 - .4byte _080C6538 - .4byte _080C65C0 - .4byte _080C65E8 - .4byte _080C6628 - .4byte _080C6678 -_080C6510: - movs r0, 0 - bl SetVBlankCallback - bl ScanlineEffect_Stop - bl SetVBlankHBlankCallbacksToNull - b _080C6694 -_080C6520: - bl sub_80C50D0 - b _080C6694 -_080C6526: - bl ResetSpriteData - bl FreeAllSpritePalettes - bl ResetPaletteFade - bl reset_temp_tile_data_buffers - b _080C6694 -_080C6538: - movs r0, 0 - bl ResetBgsAndClearDma3BusyFlags - ldr r1, =gUnknown_085713F4 - movs r0, 0 - movs r2, 0x3 - bl InitBgsFromTemplates - ldr r4, =gUnknown_02039CF4 - ldr r1, [r4] - adds r1, 0x12 - movs r0, 0 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00001012 - adds r1, r0 - movs r0, 0x1 - bl SetBgTilemapBuffer - ldr r1, [r4] - ldr r0, =0x00002012 - adds r1, r0 - movs r0, 0x2 - bl SetBgTilemapBuffer - movs r5, 0x1E - str r5, [sp] - movs r4, 0x14 - str r4, [sp, 0x4] - movs r0, 0 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - str r5, [sp] - str r4, [sp, 0x4] - movs r0, 0x1 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - str r5, [sp] - str r4, [sp, 0x4] - movs r0, 0x2 - movs r1, 0 - movs r2, 0 - movs r3, 0 - bl FillBgTilemapBufferRect_Palette0 - movs r0, 0 - bl CopyBgTilemapBufferToVram - movs r0, 0x1 - bl CopyBgTilemapBufferToVram - b _080C6618 - .pool -_080C65C0: - ldr r0, =gUnknown_08571428 - bl InitWindows - bl DeactivateAllTextPrinters - bl sub_80C6B94 - ldr r1, =gUnknown_0856FBBC - movs r0, 0 - str r0, [sp] - movs r0, 0x1 - movs r2, 0 - movs r3, 0 - bl decompress_and_copy_tile_data_to_vram - b _080C6694 - .pool -_080C65E8: - bl free_temp_tile_data_buffers_if_possible - lsls r0, 24 - cmp r0, 0 - bne _080C669E - ldr r0, =gUnknown_08DE07C8 - movs r2, 0xD0 - lsls r2, 1 - movs r1, 0 - bl LoadPalette - movs r0, 0 - bl stdpal_get - movs r1, 0xF0 - movs r2, 0x20 - bl LoadPalette - ldr r1, =gUnknown_08570E00 - movs r0, 0x2 - movs r2, 0 - movs r3, 0 - bl CopyToBgTilemapBuffer -_080C6618: - movs r0, 0x2 - bl CopyBgTilemapBufferToVram - b _080C6694 - .pool -_080C6628: - 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 - bl sub_80C6974 - ldr r0, =VblankCb_FrontierPass - bl SetVBlankCallback - movs r5, 0x1 - negs r5, r5 - ldr r4, =0x00007fff - adds r0, r5, 0 - movs r1, 0x10 - adds r2, r4, 0 - bl BlendPalettes - str r4, [sp] - adds r0, r5, 0 - movs r1, 0 - movs r2, 0x10 - movs r3, 0 - bl BeginNormalPaletteFade - b _080C6694 - .pool -_080C6678: - bl UpdatePaletteFade - lsls r0, 24 - lsrs r1, r0, 24 - cmp r1, 0 - bne _080C669E - ldr r0, =gUnknown_02039CEC - ldr r0, [r0] - strh r1, [r0, 0x4] - movs r0, 0x1 - b _080C66A0 - .pool -_080C6694: - ldr r0, =gUnknown_02039CEC - ldr r1, [r0] - ldrh r0, [r1, 0x4] - adds r0, 0x1 - strh r0, [r1, 0x4] -_080C669E: - movs r0, 0 -_080C66A0: - add sp, 0x8 - pop {r4,r5} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C64CC - - thumb_func_start sub_80C66AC -sub_80C66AC: @ 80C66AC - push {r4,lr} - sub sp, 0x4 - ldr r0, =gUnknown_02039CEC - ldr r0, [r0] - ldrh r0, [r0, 0x4] - cmp r0, 0x5 - bhi _080C67A4 - lsls r0, 2 - ldr r1, =_080C66CC - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C66CC: - .4byte _080C66E4 - .4byte _080C66FC - .4byte _080C6722 - .4byte _080C6732 - .4byte _080C6774 - .4byte _080C6782 -_080C66E4: - movs r0, 0x1 - negs r0, r0 - ldr r1, =0x00007fff - str r1, [sp] - movs r1, 0 - movs r2, 0 - movs r3, 0x10 - bl BeginNormalPaletteFade - b _080C67A4 - .pool -_080C66FC: - bl UpdatePaletteFade - lsls r0, 24 - cmp r0, 0 - bne _080C67AE - movs r0, 0 - movs r1, 0 - bl SetGpuReg - movs r0, 0 - bl HideBg - movs r0, 0x1 - bl HideBg - movs r0, 0x2 - bl HideBg - b _080C67A4 -_080C6722: - movs r0, 0 - bl SetVBlankCallback - bl ScanlineEffect_Stop - bl SetVBlankHBlankCallbacksToNull - b _080C67A4 -_080C6732: - ldr r4, =gUnknown_02039CF4 - ldr r0, [r4] - ldr r0, [r0, 0x4] - cmp r0, 0 - beq _080C6746 - bl DestroySprite - movs r0, 0 - bl FreeSpriteTilesByTag -_080C6746: - ldr r0, [r4] - ldr r0, [r0, 0xC] - cmp r0, 0 - beq _080C6758 - bl DestroySprite - movs r0, 0x1 - bl FreeSpriteTilesByTag -_080C6758: - ldr r0, [r4] - ldr r0, [r0, 0x8] - cmp r0, 0 - beq _080C676A - bl DestroySprite - movs r0, 0x4 - bl FreeSpriteTilesByTag -_080C676A: - bl FreeAllWindowBuffers - b _080C67A4 - .pool -_080C6774: - bl sub_80C50D0 - bl ResetSpriteData - bl FreeAllSpritePalettes - b _080C67A4 -_080C6782: - movs r0, 0 - bl UnsetBgTilemapBuffer - movs r0, 0x1 - bl UnsetBgTilemapBuffer - movs r0, 0x2 - bl UnsetBgTilemapBuffer - ldr r0, =gUnknown_02039CEC - ldr r1, [r0] - movs r0, 0 - strh r0, [r1, 0x4] - movs r0, 0x1 - b _080C67B0 - .pool -_080C67A4: - ldr r0, =gUnknown_02039CEC - ldr r1, [r0] - ldrh r0, [r1, 0x4] - adds r0, 0x1 - strh r0, [r1, 0x4] -_080C67AE: - movs r0, 0 -_080C67B0: - add sp, 0x4 - pop {r4} - pop {r1} - bx r1 - .pool - thumb_func_end sub_80C66AC - - thumb_func_start sub_80C67BC -sub_80C67BC: @ 80C67BC - push {r4,lr} - lsls r0, 24 - lsrs r2, r0, 24 - lsls r0, r2, 2 - adds r0, r2 - lsls r0, 3 - ldr r1, =gTasks + 0x8 - adds r4, r0, r1 - movs r1, 0 - ldrsh r0, [r4, r1] - cmp r0, 0x5 - bls _080C67D6 - b _080C68DA -_080C67D6: - lsls r0, 2 - ldr r1, =_080C67E8 - adds r0, r1 - ldr r0, [r0] - mov pc, r0 - .pool - .align 2, 0 -_080C67E8: - .4byte _080C6800 - .4byte _080C6806 - .4byte _080C686C - .4byte _080C6894 - .4byte _080C68C4 - .4byte _080C68CE -_080C6800: - bl sub_80C64CC - b _080C68C8 -_080C6806: - ldr r0, =gMain - ldrh r1, [r0, 0x2E] - movs r2, 0x2 - adds r0, r2, 0 - ands r0, r1 - cmp r0, 0 - beq _080C6824 - movs r0, 0x3 - bl PlaySE - movs r0, 0x4 - b _080C68DE - .pool -_080C6824: - movs r0, 0x80 - ands r0, r1 - cmp r0, 0 - beq _080C6848 - ldr r0, =gUnknown_02039CF4 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - cmp r0, 0x5 - bls _080C6844 - movs r0, 0 - bl sub_80C6C70 - b _080C68E0 - .pool -_080C6844: - strh r2, [r4] - b _080C68E0 -_080C6848: - movs r0, 0x40 - ands r0, r1 - cmp r0, 0 - beq _080C68E0 - ldr r0, =gUnknown_02039CF4 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - cmp r0, 0 - bne _080C6868 - movs r0, 0x1 - bl sub_80C6C70 - b _080C68E0 - .pool -_080C6868: - movs r0, 0x3 - b _080C68DE -_080C686C: - movs r1, 0x2 - ldrsh r0, [r4, r1] - cmp r0, 0x3 - ble _080C6882 - movs r0, 0 - bl sub_80C6C70 - movs r0, 0 - strh r0, [r4, 0x2] - movs r0, 0x1 - b _080C68DE -_080C6882: - ldr r0, =gUnknown_02039CF4 - ldr r0, [r0] - ldr r1, [r0, 0x4] - ldrh r0, [r1, 0x22] - adds r0, 0x4 - b _080C68B4 - .pool -_080C6894: - movs r1, 0x2 - ldrsh r0, [r4, r1] - cmp r0, 0x3 - ble _080C68AA - movs r0, 0x1 - bl sub_80C6C70 - movs r0, 0 - strh r0, [r4, 0x2] - movs r0, 0x1 - b _080C68DE -_080C68AA: - ldr r0, =gUnknown_02039CF4 - ldr r0, [r0] - ldr r1, [r0, 0x4] - ldrh r0, [r1, 0x22] - subs r0, 0x4 -_080C68B4: - strh r0, [r1, 0x22] - ldrh r0, [r4, 0x2] - adds r0, 0x1 - strh r0, [r4, 0x2] - b _080C68E0 - .pool -_080C68C4: - bl sub_80C66AC -_080C68C8: - cmp r0, 0 - bne _080C68DA - b _080C68E0 -_080C68CE: - adds r0, r2, 0 - bl DestroyTask - bl sub_80C6498 - b _080C68E0 -_080C68DA: - ldrh r0, [r4] - adds r0, 0x1 -_080C68DE: - strh r0, [r4] -_080C68E0: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_80C67BC - - thumb_func_start sub_80C68E8 -sub_80C68E8: @ 80C68E8 - push {lr} - lsls r0, 16 - lsrs r1, r0, 16 - ldr r2, =0xfffb0000 - adds r0, r2 - lsrs r0, 16 - cmp r0, 0x3 - bls _080C6904 - adds r0, r1, 0 - subs r0, 0xF - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - bhi _080C690C -_080C6904: - movs r0, 0x1 - b _080C696E - .pool -_080C690C: - adds r0, r1, 0 - subs r0, 0x12 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x3 - bhi _080C691C - movs r0, 0x2 - b _080C696E -_080C691C: - adds r0, r1, 0 - subs r0, 0x16 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - bhi _080C692C - movs r0, 0x3 - b _080C696E -_080C692C: - adds r0, r1, 0 - subs r0, 0x1C - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - bhi _080C693C - movs r0, 0x4 - b _080C696E -_080C693C: - adds r0, r1, 0 - subs r0, 0x1F - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - bhi _080C694C - movs r0, 0x5 - b _080C696E -_080C694C: - adds r0, r1, 0 - subs r0, 0x22 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x5 - bhi _080C695C - movs r0, 0x6 - b _080C696E -_080C695C: - adds r0, r1, 0 - subs r0, 0x19 - lsls r0, 16 - lsrs r0, 16 - cmp r0, 0x2 - bls _080C696C - movs r0, 0 - b _080C696E -_080C696C: - movs r0, 0x7 -_080C696E: - pop {r1} - bx r1 - thumb_func_end sub_80C68E8 - - thumb_func_start sub_80C6974 -sub_80C6974: @ 80C6974 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - sub sp, 0x18 - movs r7, 0 - bl FreeAllSpritePalettes - ldr r0, =gUnknown_085714E4 - bl LoadSpritePalettes - ldr r6, =gUnknown_085714BC - adds r0, r6, 0 - bl LoadCompressedSpriteSheet - ldr r0, =gUnknown_085715B4 - mov r8, r0 - ldr r4, =gUnknown_02039CF4 - ldr r0, [r4] - ldrb r2, [r0, 0x10] - lsls r2, 4 - adds r2, 0x8 - mov r0, r8 - movs r1, 0x9B - movs r3, 0x2 - bl CreateSprite - lsls r0, 24 - lsrs r3, r0, 24 - ldr r0, [r4] - lsls r1, r3, 4 - adds r1, r3 - lsls r1, 2 - ldr r2, =gSprites - mov r9, r2 - add r1, r9 - str r1, [r0, 0x4] - ldrb r2, [r1, 0x5] - movs r5, 0xD - negs r5, r5 - adds r0, r5, 0 - ands r0, r2 - strb r0, [r1, 0x5] - ldr r0, [r4] - ldr r1, [r0, 0x4] - adds r1, 0x3F - ldrb r0, [r1] - movs r2, 0x1 - orrs r0, r2 - strb r0, [r1] - ldr r0, [r4] - ldr r0, [r0, 0x4] - movs r1, 0x1 - bl StartSpriteAnim - adds r6, 0x8 - adds r0, r6, 0 - bl LoadCompressedSpriteSheet - movs r3, 0x18 - add r8, r3 - ldr r6, =gUnknown_08571650 - ldr r0, [r4] - ldrb r0, [r0, 0x10] - lsls r0, 4 - adds r0, r6 - movs r2, 0x8 - ldrsh r1, [r0, r2] - movs r3, 0xA - ldrsh r2, [r0, r3] - mov r0, r8 - movs r3, 0x1 - bl CreateSprite - lsls r0, 24 - lsrs r3, r0, 24 - ldr r1, [r4] - lsls r0, r3, 4 - adds r0, r3 - lsls r0, 2 - add r0, r9 - str r0, [r1, 0xC] - ldrb r1, [r0, 0x5] - ands r5, r1 - strb r5, [r0, 0x5] - ldr r1, [r4] - ldr r0, [r1, 0xC] - ldrb r1, [r1, 0x10] - lsls r1, 4 - adds r1, r6 - ldrb r1, [r1, 0xC] - bl StartSpriteAnim - bl GetCurrentRegionMapSectionId - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0x3A - beq _080C6A40 - cmp r5, 0xCA - beq _080C6A40 - b _080C6B7A -_080C6A40: - ldr r4, =gSaveBlock1Ptr - ldr r2, [r4] - movs r0, 0x5 - ldrsb r0, [r2, r0] - cmp r0, 0x4 - beq _080C6A52 - cmp r0, 0xE - bne _080C6A98 - movs r7, 0x37 -_080C6A52: - lsls r0, r7, 16 - asrs r0, 16 - ldrh r6, [r2] - adds r0, r6 - ldrh r4, [r2, 0x2] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0 - bge _080C6A66 - adds r0, 0x7 -_080C6A66: - lsls r0, 13 - lsrs r7, r0, 16 - lsls r0, r4, 16 - asrs r0, 16 - cmp r0, 0 - bge _080C6A74 - adds r0, 0x7 -_080C6A74: - lsls r0, 13 - lsrs r4, r0, 16 - movs r5, 0 - b _080C6AF2 - .pool -_080C6A98: - lsls r0, 16 - lsrs r0, 16 - bl sub_80C68E8 - lsls r0, 24 - lsrs r5, r0, 24 - cmp r5, 0 - beq _080C6AB4 - subs r0, r5, 0x1 - lsls r0, 4 - adds r0, r6 - ldrh r7, [r0, 0x8] - ldrh r4, [r0, 0xA] - b _080C6AF2 -_080C6AB4: - ldr r1, [r4] - adds r0, r1, 0 - adds r0, 0x25 - ldrb r0, [r0] - lsls r0, 24 - asrs r0, 24 - cmp r0, 0xE - bne _080C6ACE - ldrh r0, [r1, 0x28] - adds r0, 0x37 - lsls r0, 16 - lsrs r7, r0, 16 - b _080C6AD0 -_080C6ACE: - ldrh r7, [r1, 0x28] -_080C6AD0: - ldr r0, =gSaveBlock1Ptr - ldr r0, [r0] - ldrh r4, [r0, 0x2A] - lsls r0, r7, 16 - asrs r0, 16 - cmp r0, 0 - bge _080C6AE0 - adds r0, 0x7 -_080C6AE0: - lsls r0, 13 - lsrs r7, r0, 16 - lsls r0, r4, 16 - asrs r0, 16 - cmp r0, 0 - bge _080C6AEE - adds r0, 0x7 -_080C6AEE: - lsls r0, 13 - lsrs r4, r0, 16 -_080C6AF2: - ldr r0, =gUnknown_085714D4 - bl LoadCompressedSpriteSheet - mov r1, sp - ldr r0, =gUnknown_085715FC - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - ldm r0!, {r2,r3,r6} - stm r1!, {r2,r3,r6} - mov r1, sp - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldrb r0, [r0, 0x8] - adds r0, 0x4 - strh r0, [r1, 0x2] - cmp r5, 0 - beq _080C6B2C - lsls r1, r7, 16 - asrs r1, 16 - lsls r2, r4, 16 - b _080C6B3E - .pool -_080C6B2C: - lsls r1, r7, 19 - lsls r2, r4, 19 - movs r0, 0xA0 - lsls r0, 13 - adds r1, r0 - asrs r1, 16 - movs r3, 0x90 - lsls r3, 14 - adds r2, r3 -_080C6B3E: - asrs r2, 16 - mov r0, sp - movs r3, 0 - bl CreateSprite - lsls r0, 24 - lsrs r3, r0, 24 - ldr r4, =gUnknown_02039CF4 - ldr r2, [r4] - lsls r1, r3, 4 - adds r1, r3 - lsls r1, 2 - ldr r0, =gSprites - adds r1, r0 - str r1, [r2, 0x8] - ldrb r2, [r1, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - strb r0, [r1, 0x5] - ldr r0, =gSaveBlock2Ptr - ldr r0, [r0] - ldrb r0, [r0, 0x8] - cmp r0, 0 - beq _080C6B7A - ldr r0, [r4] - ldr r0, [r0, 0x8] - movs r1, 0x1 - bl StartSpriteAnim -_080C6B7A: - add sp, 0x18 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C6974 - - thumb_func_start sub_80C6B94 -sub_80C6B94: @ 80C6B94 - push {r4-r6,lr} - sub sp, 0xC - movs r4, 0 -_080C6B9A: - adds r0, r4, 0 - bl PutWindowTilemap - adds r0, r4, 0 - movs r1, 0 - bl FillWindowPixelBuffer - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _080C6B9A - movs r4, 0 - movs r6, 0 - ldr r5, =gUnknown_08571650 -_080C6BB8: - ldr r0, =gUnknown_02039CF4 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - cmp r4, r0 - bne _080C6BF0 - lsls r1, r4, 4 - adds r3, r1, 0x1 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =gUnknown_0857144E - str r0, [sp] - str r6, [sp, 0x4] - adds r1, r5 - ldr r0, [r1] - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x7 - movs r2, 0x4 - bl AddTextPrinterParameterized3 - b _080C6C0E - .pool -_080C6BF0: - lsls r1, r4, 4 - adds r3, r1, 0x1 - lsls r3, 24 - lsrs r3, 24 - ldr r0, =gUnknown_0857144B - str r0, [sp] - str r6, [sp, 0x4] - adds r1, r5 - ldr r0, [r1] - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x7 - movs r2, 0x4 - bl AddTextPrinterParameterized3 -_080C6C0E: - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x6 - bls _080C6BB8 - ldr r0, =gUnknown_08571448 - str r0, [sp] - movs r0, 0 - str r0, [sp, 0x4] - ldr r1, =gUnknown_08571650 - ldr r0, =gUnknown_02039CF4 - ldr r0, [r0] - ldrb r0, [r0, 0x10] - lsls r0, 4 - adds r1, 0x4 - adds r0, r1 - ldr r0, [r0] - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0x1 - movs r2, 0x4 - movs r3, 0 - bl AddTextPrinterParameterized3 - movs r4, 0 -_080C6C40: - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _080C6C40 - movs r0, 0 - bl CopyBgTilemapBufferToVram - add sp, 0xC - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C6B94 - - thumb_func_start sub_80C6C70 -sub_80C6C70: @ 80C6C70 - push {r4-r6,lr} - mov r6, r8 - push {r6} - sub sp, 0xC - lsls r0, 24 - cmp r0, 0 - beq _080C6C8C - ldr r0, =gUnknown_02039CF4 - ldr r4, [r0] - ldrb r5, [r4, 0x10] - adds r0, r5, 0x6 - b _080C6C94 - .pool -_080C6C8C: - ldr r0, =gUnknown_02039CF4 - ldr r4, [r0] - ldrb r5, [r4, 0x10] - adds r0, r5, 0x1 -_080C6C94: - movs r1, 0x7 - bl __modsi3 - strb r0, [r4, 0x10] - lsls r0, r5, 4 - adds r3, r0, 0x1 - lsls r3, 24 - lsrs r3, 24 - ldr r6, =gUnknown_0857144B - str r6, [sp] - movs r1, 0 - mov r8, r1 - str r1, [sp, 0x4] - ldr r4, =gUnknown_08571650 - adds r0, r4 - ldr r0, [r0] - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x7 - movs r2, 0x4 - bl AddTextPrinterParameterized3 - ldr r5, =gUnknown_02039CF4 - ldr r1, [r5] - ldrb r3, [r1, 0x10] - lsls r3, 4 - adds r3, 0x1 - lsls r3, 24 - lsrs r3, 24 - adds r0, r6, 0x3 - str r0, [sp] - mov r0, r8 - str r0, [sp, 0x4] - ldrb r0, [r1, 0x10] - lsls r0, 4 - adds r0, r4 - ldr r0, [r0] - str r0, [sp, 0x8] - movs r0, 0x1 - movs r1, 0x7 - movs r2, 0x4 - bl AddTextPrinterParameterized3 - ldr r1, [r5] - ldr r2, [r1, 0x4] - ldrb r0, [r1, 0x10] - lsls r0, 4 - adds r0, 0x8 - strh r0, [r2, 0x22] - ldr r0, [r1, 0xC] - ldrb r1, [r1, 0x10] - lsls r1, 4 - adds r1, r4 - ldrb r1, [r1, 0xC] - bl StartSpriteAnim - ldr r1, [r5] - ldr r2, [r1, 0xC] - ldrb r0, [r1, 0x10] - lsls r0, 4 - adds r0, r4 - ldrh r0, [r0, 0x8] - strh r0, [r2, 0x20] - ldr r2, [r1, 0xC] - ldrb r0, [r1, 0x10] - lsls r0, 4 - adds r0, r4 - ldrh r0, [r0, 0xA] - strh r0, [r2, 0x22] - movs r0, 0x2 - movs r1, 0 - bl FillWindowPixelBuffer - subs r6, 0x3 - str r6, [sp] - mov r1, r8 - str r1, [sp, 0x4] - ldr r0, [r5] - ldrb r0, [r0, 0x10] - lsls r0, 4 - adds r4, 0x4 - adds r0, r4 - ldr r0, [r0] - str r0, [sp, 0x8] - movs r0, 0x2 - movs r1, 0x1 - movs r2, 0x4 - movs r3, 0 - bl AddTextPrinterParameterized3 - movs r4, 0 -_080C6D4A: - adds r0, r4, 0 - movs r1, 0x3 - bl CopyWindowToVram - adds r0, r4, 0x1 - lsls r0, 24 - lsrs r4, r0, 24 - cmp r4, 0x2 - bls _080C6D4A - movs r0, 0 - bl CopyBgTilemapBufferToVram - movs r0, 0x6C - bl PlaySE - add sp, 0xC - pop {r3} - mov r8, r3 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C6C70 - - thumb_func_start sub_80C6D80 -sub_80C6D80: @ 80C6D80 - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x2C - str r0, [sp, 0x24] - adds r7, r1, 0 - lsls r2, 24 - lsrs r2, 24 - str r2, [sp, 0x28] - lsls r3, 24 - lsrs r3, 24 - mov r9, r3 - movs r0, 0 - movs r1, 0 - str r0, [sp, 0x1C] - str r1, [sp, 0x20] - ldr r1, =0x00ffffff - ldr r0, [sp, 0x1C] - ands r0, r1 - movs r1, 0xC0 - lsls r1, 21 - orrs r0, r1 - str r0, [sp, 0x1C] - ldr r1, =0xffffff00 - add r5, sp, 0x1C - ldr r0, [r5, 0x4] - ands r0, r1 - movs r1, 0x2 - orrs r0, r1 - str r0, [r5, 0x4] - adds r0, r5, 0 - bl AddWindow - lsls r0, 16 - lsrs r0, 16 - mov r10, r0 - lsls r4, r0, 24 - lsrs r4, 24 - mov r0, r9 - lsls r1, r0, 4 - orrs r1, r0 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FillWindowPixelBuffer - adds r0, r4, 0 - movs r1, 0x7 - bl GetWindowAttribute - adds r6, r0, 0 - ldrb r0, [r5, 0x3] - lsls r0, 5 - adds r0, r6 - mov r8, r0 - ldr r1, [sp, 0x28] - cmp r1, 0 - bne _080C6E04 - add r0, sp, 0x14 - b _080C6E08 - .pool -_080C6E04: - add r0, sp, 0x14 - mov r1, r9 -_080C6E08: - strb r1, [r0] - add r1, sp, 0x14 - movs r2, 0 - movs r0, 0xF - strb r0, [r1, 0x1] - movs r0, 0xE - strb r0, [r1, 0x2] - mov r0, r10 - lsls r4, r0, 24 - lsrs r0, r4, 24 - str r2, [sp] - str r2, [sp, 0x4] - str r1, [sp, 0x8] - movs r1, 0x1 - negs r1, r1 - str r1, [sp, 0xC] - ldr r1, [sp, 0x24] - str r1, [sp, 0x10] - movs r1, 0x1 - movs r3, 0x1 - bl AddTextPrinterParameterized4 - ldr r0, [sp, 0x4C] - mov r10, r4 - cmp r0, 0x6 - bls _080C6E3E - movs r0, 0x6 -_080C6E3E: - ldr r4, [sp, 0x4C] - subs r4, 0x6 - cmp r0, 0 - ble _080C6E70 - adds r5, r0, 0 -_080C6E48: - adds r0, r6, 0 - adds r1, r7, 0 - movs r2, 0x40 - bl CpuSet - adds r1, r7, 0 - adds r1, 0x80 - mov r0, r8 - movs r2, 0x40 - bl CpuSet - adds r6, 0x80 - movs r2, 0x80 - add r8, r2 - movs r0, 0x80 - lsls r0, 1 - adds r7, r0 - subs r5, 0x1 - cmp r5, 0 - bne _080C6E48 -_080C6E70: - cmp r4, 0 - ble _080C6E90 - add r0, sp, 0x18 - mov r2, r9 - lsls r1, r2, 4 - orrs r1, r2 - strh r1, [r0] - lsls r2, r4, 7 - ldr r1, =0x001fffff - ands r2, r1 - movs r1, 0x80 - lsls r1, 17 - orrs r2, r1 - adds r1, r7, 0 - bl CpuSet -_080C6E90: - mov r1, r10 - lsrs r0, r1, 24 - bl RemoveWindow - add sp, 0x2C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C6D80 - - thumb_func_start sub_80C6EAC -sub_80C6EAC: @ 80C6EAC - push {r4-r7,lr} - mov r7, r10 - mov r6, r9 - mov r5, r8 - push {r5-r7} - sub sp, 0x2C - str r0, [sp, 0x20] - str r1, [sp, 0x24] - adds r6, r3, 0 - ldr r0, [sp, 0x4C] - mov r9, r0 - ldr r1, [sp, 0x50] - mov r10, r1 - lsls r2, 16 - lsrs r2, 16 - str r2, [sp, 0x28] - lsls r6, 24 - lsrs r6, 24 - mov r2, r9 - lsls r2, 24 - lsrs r2, 24 - mov r9, r2 - mov r0, r10 - lsls r0, 24 - lsrs r0, 24 - mov r10, r0 - movs r0, 0 - movs r1, 0 - str r0, [sp, 0x18] - str r1, [sp, 0x1C] - ldr r0, [sp, 0x20] - bl StringLength_Multibyte - lsls r0, 24 - ldr r2, =0x00ffffff - ldr r1, [sp, 0x18] - ands r1, r2 - orrs r1, r0 - str r1, [sp, 0x18] - ldr r1, =0xffffff00 - add r2, sp, 0x18 - mov r8, r2 - ldr r0, [r2, 0x4] - ands r0, r1 - movs r1, 0x2 - orrs r0, r1 - str r0, [r2, 0x4] - ldr r5, [sp, 0x18] - lsrs r5, 24 - lsls r5, 5 - mov r0, r8 - bl AddWindow - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - lsls r1, r6, 4 - orrs r1, r6 - lsls r1, 24 - lsrs r1, 24 - adds r0, r4, 0 - bl FillWindowPixelBuffer - adds r0, r4, 0 - movs r1, 0x7 - bl GetWindowAttribute - adds r7, r0, 0 - mov r0, r8 - ldrb r0, [r0, 0x3] - lsls r0, 5 - mov r8, r0 - add r8, r7 - add r0, sp, 0x14 - movs r1, 0 - strb r6, [r0] - mov r2, r9 - strb r2, [r0, 0x1] - mov r2, r10 - strb r2, [r0, 0x2] - str r1, [sp] - str r1, [sp, 0x4] - str r0, [sp, 0x8] - movs r0, 0x1 - negs r0, r0 - str r0, [sp, 0xC] - ldr r0, [sp, 0x20] - str r0, [sp, 0x10] - adds r0, r4, 0 - movs r1, 0x1 - movs r2, 0 - movs r3, 0x2 - bl AddTextPrinterParameterized4 - lsrs r5, 1 - adds r0, r7, 0 - ldr r1, [sp, 0x24] - adds r2, r5, 0 - bl CpuSet - ldr r2, [sp, 0x24] - ldr r0, [sp, 0x28] - adds r1, r2, r0 - mov r0, r8 - adds r2, r5, 0 - bl CpuSet - adds r0, r4, 0 - bl RemoveWindow - add sp, 0x2C - pop {r3-r5} - mov r8, r3 - mov r9, r4 - mov r10, r5 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_80C6EAC - - .align 2, 0 @ Don't pad with nop. diff --git a/data/frontier_pass.s b/data/frontier_pass.s deleted file mode 100644 index 411c5c69d..000000000 --- a/data/frontier_pass.s +++ /dev/null @@ -1,229 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .section .rodata - -.macro unk_trainer_card_struct text1, text2, short1, short2, short3, short4 - .4byte \text1 - .4byte \text2 - .2byte \short1 - .2byte \short2 - .2byte \short3 - .2byte \short4 -.endm - - .align 2 -gUnknown_0856FB7C:: @ 856FB7C - .incbin "graphics/frontier_pass/map_heads.gbapal" - - .align 2 -gUnknown_0856FB9C:: @ 856FB9C - .incbin "graphics/frontier_pass/map_heads_female.gbapal" - - .align 2 -gUnknown_0856FBBC:: @ 856FBBC - .incbin "graphics/frontier_pass/map_screen.4bpp.lz" - - .align 2 -gFrontierPassCursor_Gfx:: @ 8570BA8 - .incbin "graphics/frontier_pass/cursor.4bpp.lz" - - .align 2 -gUnknown_08570C44:: @ 8570C44 - .incbin "graphics/frontier_pass/map_heads.4bpp.lz" - - .align 2 -gFrontierPassMapCursor_Gfx:: @ 8570D00 - .incbin "graphics/frontier_pass/map_cursor.4bpp.lz" - - .align 2 -gUnknown_08570E00:: @ 8570E00 - .incbin "graphics/frontier_pass/map_screen.bin.lz" - - .align 2 -gUnknown_08571060:: @ 8571060 - .incbin "graphics/frontier_pass/small_map_and_card.bin.lz" - - .align 2 -gUnknown_08571298:: @ 8571298 - .incbin "graphics/frontier_pass/unknown_571298.bin" - - .align 2 -gUnknown_085712C0:: @ 85712C0 - .incbin "graphics/frontier_pass/record_frame.bin.lz" - - .align 2 -gUnknown_085712F8:: @ 85712F8 - .incbin "graphics/frontier_pass/small_map_and_card_affine.bin.lz" - -gUnknown_085713E0:: @ 85713E0 - .2byte 0x00d8, 0x0020, 0x00d8, 0x0080 - - .align 2 -gUnknown_085713E8:: @ 85713E8 - .4byte 0x000011f8, 0x000021e1, 0x00000bd6 - - .align 2 -gUnknown_085713F4:: @ 85713F4 - .4byte 0x000001f8, 0x000011e1, 0x000021d2 - - .align 2 -gUnknown_08571400:: @ 8571400 - window_template 0x00, 0x02, 0x03, 0x0c, 0x03, 0x0f, 0x0001 - window_template 0x00, 0x02, 0x0a, 0x0c, 0x03, 0x0f, 0x0026 - window_template 0x00, 0x02, 0x0d, 0x0c, 0x04, 0x0f, 0x004b - window_template 0x00, 0x00, 0x12, 0x1e, 0x03, 0x0f, 0x007c - window_template 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 - - .align 2 -gUnknown_08571428:: @ 8571428 - window_template 0x00, 0x00, 0x01, 0x0f, 0x05, 0x0f, 0x0001 - window_template 0x00, 0x14, 0x01, 0x0a, 0x0e, 0x0f, 0x004d - window_template 0x00, 0x02, 0x10, 0x1a, 0x04, 0x0f, 0x00da - window_template 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0000 - -gUnknown_08571448:: @ 8571448 - .byte 0x00, 0x02, 0x03 - -gUnknown_0857144B:: @ 857144B - .byte 0x00, 0x01, 0x09 - -gUnknown_0857144E:: @ 857144E - .byte 0x00, 0x04, 0x05 - - .align 2 -gUnknown_08571454:: @ 8571454 - .2byte 0x001c, 0x004c, 0x0084, 0x00dc, 0x0054, 0x0084, 0x0084, 0x00dc, 0x0050, 0x0066, 0x0014, 0x006c, 0x0000, 0x0010, 0x0098, 0x00f0 - .2byte 0x006c, 0x0086, 0x0014, 0x006c, 0x0018, 0x0030, 0x0014, 0x006c, 0x0032, 0x0042, 0x0014, 0x0024, 0x0042, 0x0052, 0x0020, 0x0030 - .2byte 0x0032, 0x0042, 0x002c, 0x003c, 0x0042, 0x0052, 0x0038, 0x0048, 0x0032, 0x0042, 0x0044, 0x0054, 0x0042, 0x0052, 0x0050, 0x0060 - .2byte 0x0032, 0x0042, 0x005c, 0x006c - - .align 2 -gUnknown_085714BC:: @ 85714BC - obj_tiles gFrontierPassCursor_Gfx, 0x100, 0 - obj_tiles gFrontierPassMapCursor_Gfx, 0x400, 1 - obj_tiles gFrontierPassMedals_Gfx, 0x380, 2 - - .align 2 -gUnknown_085714D4:: @ 85714D4 - obj_tiles gUnknown_08570C44, 0x100, 4 - null_obj_tiles - - .align 2 -gUnknown_085714E4:: @ 85714E4 - obj_pal gFrontierPassCursor_Pal, 0 - obj_pal gFrontierPassMapCursor_Pal, 1 - obj_pal gFrontierPassMedalsSilver_Pal, 2 - obj_pal gFrontierPassMedalsGold_Pal, 3 - obj_pal gUnknown_0856FB7C, 4 - obj_pal gUnknown_0856FB9C, 5 - null_obj_pal - - .align 2 -gSpriteAnim_857151C:: @ 857151C - .2byte 0x0000, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_8571524:: @ 8571524 - .2byte 0x0000, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_857152C:: @ 857152C - .2byte 0x0004, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_8571534:: @ 8571534 - .2byte 0x0008, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_857153C:: @ 857153C - .2byte 0x000c, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_8571544:: @ 8571544 - .2byte 0x0010, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_857154C:: @ 857154C - .2byte 0x0014, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_8571554:: @ 8571554 - .2byte 0x0018, 0x0000, 0xffff, 0x0000 - - .align 2 -gSpriteAnim_857155C:: @ 857155C - .2byte 0x0000, 0x002d, 0x0008, 0x002d, 0xfffe, 0x0000 - - .align 2 -gSpriteAnim_8571568:: @ 8571568 - .2byte 0x0010, 0x002d, 0x0018, 0x002d, 0xfffe, 0x0000 - - .align 2 -gSpriteAnimTable_08571574:: @ 8571574 - .4byte gSpriteAnim_8571524 - .4byte gSpriteAnim_857152C - - .align 2 -gSpriteAnimTable_0857157C:: @ 857157C - .4byte gSpriteAnim_8571524 - .4byte gSpriteAnim_857152C - .4byte gSpriteAnim_8571534 - .4byte gSpriteAnim_857153C - .4byte gSpriteAnim_8571544 - .4byte gSpriteAnim_857154C - .4byte gSpriteAnim_8571554 - - .align 2 -gSpriteAnimTable_08571598:: @ 8571598 - .4byte gSpriteAnim_857155C - .4byte gSpriteAnim_8571568 - - .align 2 -gSpriteAffineAnim_085715A0:: @ 85715A0 - .2byte 0x0100, 0x0100, 0x0000, 0x0000, 0x7fff, 0x0000, 0x0000, 0x0000 - - .align 2 -gSpriteAffineAnimTable_085715B0:: @ 85715B0 - .4byte gSpriteAffineAnim_085715A0 - - .align 2 -gUnknown_085715B4:: @ 85715B4 - spr_template 0, 0, gUnknown_0852490C, gSpriteAnimTable_08571574, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy - spr_template 1, 1, gUnknown_08524934, gSpriteAnimTable_08571598, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy - - .align 2 -gUnknown_085715E4:: @ 85715E4 - spr_template 2, 2, gUnknown_0852490C, gSpriteAnimTable_0857157C, NULL, gDummySpriteAffineAnimTable, SpriteCallbackDummy - - .align 2 -gUnknown_085715FC:: @ 85715FC - spr_template 4, 4, gUnknown_0852490C, gSpriteAnimTable_08571574, NULL, gDummySpriteAffineAnimTable, nullsub_39 - - .align 2 -gUnknown_08571614:: @ 8571614 - .4byte gUnknown_085EDA96 - .4byte gUnknown_085ED932 - .4byte gUnknown_085ED94D - .4byte gUnknown_085ED961 - .4byte gUnknown_085ED977 - .4byte gUnknown_085ED993 - .4byte gUnknown_085ED9AF - .4byte gUnknown_085ED9C7 - .4byte gUnknown_085ED9E5 - .4byte gUnknown_085EDA02 - .4byte gUnknown_085EDA21 - .4byte gUnknown_085EDA3C - .4byte gUnknown_085EDA5E - .4byte gUnknown_085EDA78 - .4byte gUnknown_085ED931 - - .align 2 -gUnknown_08571650:: @ 8571650 - unk_trainer_card_struct gUnknown_085EDAB1, gUnknown_085EDB0F, 0x59, 0x28, 1, 0 - unk_trainer_card_struct gUnknown_085EDABE, gUnknown_085EDB4E, 0x21, 0x2A, 1, 0 - unk_trainer_card_struct gUnknown_085EDACA, gUnknown_085EDB8B, 0x78, 0x56, 0, 0 - unk_trainer_card_struct gUnknown_085EDAD8, gUnknown_085EDBC2, 0x72, 0x3B, 0, 0 - unk_trainer_card_struct gUnknown_085EDAE5, gUnknown_085EDC00, 0x19, 0x43, 0, 0 - unk_trainer_card_struct gUnknown_085EDAF4, gUnknown_085EDC45, 0x39, 0x39, 1, 0 - unk_trainer_card_struct gUnknown_085EDB00, gUnknown_085EDC84, 0x86, 0x29, 1, 0 diff --git a/include/graphics.h b/include/graphics.h index ed91b06c1..cfe73c6c3 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -4866,6 +4866,12 @@ extern const u32 gUnknown_08DE2084[]; extern const u32 gUnknown_08DE3350[]; extern const u32 gUnknown_08DE3374[]; extern const u32 gUnknown_08DE3060[]; +extern const u32 gFrontierPassMedals_Gfx[]; extern const u16 gUnknown_08DE07C8[][16]; +extern const u16 gFrontierPassCursor_Pal[]; +extern const u16 gFrontierPassMedalsGold_Pal[]; +extern const u16 gFrontierPassMedalsSilver_Pal[]; +extern const u16 gFrontierPassMapCursor_Pal[]; + #endif //GUARD_GRAPHICS_H diff --git a/include/pokemon_storage_system.h b/include/pokemon_storage_system.h index a85ee5ff4..4c319e59d 100644 --- a/include/pokemon_storage_system.h +++ b/include/pokemon_storage_system.h @@ -25,6 +25,7 @@ struct PokemonStorage extern struct PokemonStorage *gPokemonStoragePtr; +void sub_80C6D80(const u8 *string, void *dst, u8 arg2, u8 arg3, s32 arg4); u8 CountMonsInBox(u8 boxId); s16 GetFirstFreeBoxSpot(u8 boxId); u8 CountPartyAliveNonEggMonsExcept(u8 slotToIgnore); diff --git a/include/string_util.h b/include/string_util.h index d7a005ec5..b921d2391 100644 --- a/include/string_util.h +++ b/include/string_util.h @@ -34,7 +34,7 @@ u8 *StringFill(u8 *dest, u8 c, u16 n); u8 *StringCopyPadded(u8 *dest, const u8 *src, u8 c, u16 n); u8 *StringFillWithTerminator(u8 *dest, u16 n); u8 *StringCopyN_Multibyte(u8 *dest, u8 *src, u32 n); -u32 StringLength_Multibyte(u8 *str); +u32 StringLength_Multibyte(const u8 *str); u8 *WriteColorChangeControlCode(u8 *dest, u32 colorType, u8 color); bool32 IsStringJapanese(u8 *str); bool32 sub_800924C(u8 *str, s32 n); diff --git a/include/strings.h b/include/strings.h index 2c07eb68e..74f3ca727 100644 --- a/include/strings.h +++ b/include/strings.h @@ -2252,5 +2252,35 @@ extern const u8 gText_BattlePtsWon[]; extern const u8 gText_SymbolsEarned[]; extern const u8 gText_BattleRecord[]; extern const u8 gText_BattlePoints[]; +extern const u8 gUnknown_085EDA96[]; +extern const u8 gUnknown_085ED932[]; +extern const u8 gUnknown_085ED94D[]; +extern const u8 gUnknown_085ED961[]; +extern const u8 gUnknown_085ED977[]; +extern const u8 gUnknown_085ED993[]; +extern const u8 gUnknown_085ED9AF[]; +extern const u8 gUnknown_085ED9C7[]; +extern const u8 gUnknown_085ED9E5[]; +extern const u8 gUnknown_085EDA02[]; +extern const u8 gUnknown_085EDA21[]; +extern const u8 gUnknown_085EDA3C[]; +extern const u8 gUnknown_085EDA5E[]; +extern const u8 gUnknown_085EDA78[]; +extern const u8 gUnknown_085ED931[]; +extern const u8 gUnknown_085EDAB1[]; +extern const u8 gUnknown_085EDB0F[]; +extern const u8 gUnknown_085EDABE[]; +extern const u8 gUnknown_085EDB4E[]; +extern const u8 gUnknown_085EDACA[]; +extern const u8 gUnknown_085EDB8B[]; +extern const u8 gUnknown_085EDAD8[]; +extern const u8 gUnknown_085EDBC2[]; +extern const u8 gUnknown_085EDAE5[]; +extern const u8 gUnknown_085EDC00[]; +extern const u8 gUnknown_085EDAF4[]; +extern const u8 gUnknown_085EDC45[]; +extern const u8 gUnknown_085EDB00[]; +extern const u8 gUnknown_085EDC84[]; + #endif // GUARD_STRINGS_H diff --git a/ld_script.txt b/ld_script.txt index e199c8fe5..844c64fb5 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -126,7 +126,6 @@ SECTIONS { src/pokedex.o(.text); src/trainer_card.o(.text); src/frontier_pass.o(.text); - asm/frontier_pass.o(.text); src/pokemon_storage_system.o(.text); src/pokemon_icon.o(.text); src/script_movement.o(.text); @@ -460,7 +459,7 @@ SECTIONS { src/option_menu.o(.rodata); src/pokedex.o(.rodata); src/trainer_card.o(.rodata); - data/frontier_pass.o(.rodata); + src/frontier_pass.o(.rodata); src/pokemon_storage_system.o(.rodata); src/pokemon_icon.o(.rodata); src/fldeff_cut.o(.rodata); diff --git a/src/frontier_pass.c b/src/frontier_pass.c index f9d56a272..a0f6af73c 100644 --- a/src/frontier_pass.c +++ b/src/frontier_pass.c @@ -2,6 +2,7 @@ #include "gpu_regs.h" #include "main.h" #include "trainer_card.h" +#include "battle_anim.h" #include "event_data.h" #include "recorded_battle.h" #include "alloc.h" @@ -41,6 +42,15 @@ enum WINDOW_COUNT }; +// Windows displayed in the facilities map view. +enum +{ + MAP_WINDOW_0, + MAP_WINDOW_NAME, + MAP_WINDOW_DESCRIPTION, + MAP_WINDOW_COUNT +}; + enum { CURSOR_AREA_NOTHING, @@ -91,42 +101,425 @@ struct FrontierPassSaved s16 cursorY; }; -extern struct FrontierPassData *gUnknown_02039CEC; -extern struct FrontierPassGfx *gUnknown_02039CF0; -extern struct FrontierPassSaved gUnknown_02039CF8; +struct FrontierMapData +{ + void (*callback)(void); + struct Sprite *cursorSprite; + struct Sprite *playerHeadSprite; + struct Sprite *mapIndicatorSprite; + u8 cursorPos; + u8 unused; + u8 tilemapBuff0[0x1000]; + u8 tilemapBuff1[0x1000]; + u8 tilemapBuff2[0x1000]; +}; + +static EWRAM_DATA struct FrontierPassData *sPassData = NULL; +static EWRAM_DATA struct FrontierPassGfx *sPassGfx = NULL; +static EWRAM_DATA struct FrontierMapData *sMapData = NULL; +static EWRAM_DATA struct FrontierPassSaved sSavedPassData = {0}; // This file's functions. -u32 AllocateFrontierPassData(void (*callback)(void)); -void ShowFrontierMap(void (*callback)(void)); -void CB2_InitFrontierPass(void); -void sub_80C629C(void); -void FreeCursorAndSymbolSprites(void); -void LoadCursorAndSymbolSprites(void); -u32 FreeFrontierPassData(void); -bool32 InitFrontierPass(void); -bool32 HideFrontierPass(void); -void Task_HandleFrontierPassInput(u8 taskId); -void Task_DoFadeEffect(u8 taskId); -void sub_80C6104(u8 cursorArea, u8 previousCursorArea); -void PrintAreaDescription(u8 cursorArea); -void sub_80C5F58(bool8 arg0, bool8 arg1); +static u32 AllocateFrontierPassData(void (*callback)(void)); +static void ShowFrontierMap(void (*callback)(void)); +static void CB2_InitFrontierPass(void); +static void sub_80C629C(void); +static void FreeCursorAndSymbolSprites(void); +static void LoadCursorAndSymbolSprites(void); +static u32 FreeFrontierPassData(void); +static bool32 InitFrontierPass(void); +static bool32 HideFrontierPass(void); +static void Task_HandleFrontierPassInput(u8 taskId); +static void Task_DoFadeEffect(u8 taskId); +static void sub_80C6104(u8 cursorArea, u8 previousCursorArea); +static void PrintAreaDescription(u8 cursorArea); +static void sub_80C5F58(bool8 arg0, bool8 arg1); +static void SpriteCb_Dummy(struct Sprite *sprite); // Const rom data. -extern const s16 gUnknown_085713E0[][2]; -extern const struct BgTemplate gUnknown_085713E8[3]; -extern const struct WindowTemplate gUnknown_08571400[]; -extern const u32 gUnknown_085712F8[]; -extern const u32 gUnknown_085712C0[]; -extern const u32 gUnknown_08571060[]; -extern const u8 gUnknown_08571448[][3]; -extern const u8 *const gUnknown_08571614[]; -extern const struct SpritePalette gUnknown_085714E4[]; -extern const struct CompressedSpriteSheet gUnknown_085714BC[]; -extern const struct SpriteTemplate gUnknown_085715B4[2]; -extern const struct SpriteTemplate gUnknown_085715E4; +static const u16 sMaleHeadPalette[] = INCBIN_U16("graphics/frontier_pass/map_heads.gbapal"); +static const u16 sFemaleHeadPalette[] = INCBIN_U16("graphics/frontier_pass/map_heads_female.gbapal"); +static const u32 gUnknown_0856FBBC[] = INCBIN_U32("graphics/frontier_pass/map_screen.4bpp.lz"); +static const u32 sCursorGfx[] = INCBIN_U32("graphics/frontier_pass/cursor.4bpp.lz"); +static const u32 sHeadsGfx[] = INCBIN_U32("graphics/frontier_pass/map_heads.4bpp.lz"); +static const u32 sMapCursorGfx[] = INCBIN_U32("graphics/frontier_pass/map_cursor.4bpp.lz"); +static const u32 gUnknown_08570E00[] = INCBIN_U32("graphics/frontier_pass/map_screen.bin.lz"); +static const u32 gUnknown_08571060[] = INCBIN_U32("graphics/frontier_pass/small_map_and_card.bin.lz"); +static const u32 gUnknown_08571298[] = INCBIN_U32("graphics/frontier_pass/unknown_571298.bin"); +static const u32 gUnknown_085712C0[] = INCBIN_U32("graphics/frontier_pass/record_frame.bin.lz"); +static const u32 gUnknown_085712F8[] = INCBIN_U32("graphics/frontier_pass/small_map_and_card_affine.bin.lz"); + +static const s16 gUnknown_085713E0[][2] = {{216, 32}, {216, 128}}; + +static const struct BgTemplate sPassBgTemplates[] = +{ + { + .bg = 0, + .charBaseIndex = 2, + .mapBaseIndex = 31, + .screenSize = 0, + .paletteMode = 0, + .priority = 1, + .baseTile = 0 + }, + { + .bg = 1, + .charBaseIndex = 0, + .mapBaseIndex = 30, + .screenSize = 0, + .paletteMode = 0, + .priority = 2, + .baseTile = 0 + }, + { + .bg = 2, + .charBaseIndex = 1, + .mapBaseIndex = 29, + .screenSize = 1, + .paletteMode = 1, + .priority = 0, + .baseTile = 0 + }, +}; + +static const struct BgTemplate sMapBgTemplates[] = +{ + { + .bg = 0, + .charBaseIndex = 2, + .mapBaseIndex = 31, + .screenSize = 0, + .paletteMode = 0, + .priority = 0, + .baseTile = 0 + }, + { + .bg = 1, + .charBaseIndex = 0, + .mapBaseIndex = 30, + .screenSize = 0, + .paletteMode = 0, + .priority = 1, + .baseTile = 0 + }, + { + .bg = 2, + .charBaseIndex = 0, + .mapBaseIndex = 29, + .screenSize = 0, + .paletteMode = 0, + .priority = 2, + .baseTile = 0 + }, +}; + +static const struct WindowTemplate sPassWindowTemplates[] = +{ + { + .bg = 0, + .tilemapLeft = 2, + .tilemapTop = 3, + .width = 12, + .height = 3, + .paletteNum = 15, + .baseBlock = 0x1, + }, + { + .bg = 0, + .tilemapLeft = 2, + .tilemapTop = 10, + .width = 12, + .height = 3, + .paletteNum = 15, + .baseBlock = 0x26, + }, + { + .bg = 0, + .tilemapLeft = 2, + .tilemapTop = 13, + .width = 12, + .height = 4, + .paletteNum = 15, + .baseBlock = 0x4B, + }, + { + .bg = 0, + .tilemapLeft = 0, + .tilemapTop = 18, + .width = 30, + .height = 3, + .paletteNum = 15, + .baseBlock = 0x7C, + }, + DUMMY_WIN_TEMPLATE +}; + +static const struct WindowTemplate sMapWindowTemplates[] = +{ + { + .bg = 0, + .tilemapLeft = 0, + .tilemapTop = 1, + .width = 15, + .height = 5, + .paletteNum = 15, + .baseBlock = 0x1, + }, + { + .bg = 0, + .tilemapLeft = 20, + .tilemapTop = 1, + .width = 10, + .height = 14, + .paletteNum = 15, + .baseBlock = 0x4D, + }, + { + .bg = 0, + .tilemapLeft = 2, + .tilemapTop = 16, + .width = 26, + .height = 4, + .paletteNum = 15, + .baseBlock = 0xDA, + }, + DUMMY_WIN_TEMPLATE +}; + +static const u8 sTextColors[][3] = +{ + {0, 2, 3}, + {0, 1, 9}, + {0, 4, 5}, +}; + +struct +{ + s16 yStart; + s16 yEnd; + s16 xStart; + s16 xEnd; +} +static const sPassAreasLayout[] = +{ + {28, 76, 132, 220}, + {84, 132, 132, 220}, + {80, 102, 20, 108}, + {0, 16, 152, 240}, + {108, 134, 20, 108}, + {24, 48, 20, 108}, + {50, 66, 20, 36}, + {66, 82, 32, 48}, + {50, 66, 44, 60}, + {66, 82, 56, 72}, + {50, 66, 68, 84}, + {66, 82, 80, 96}, + {50, 66, 92, 108}, +}; + +static const struct CompressedSpriteSheet sCursorSpriteSheets[] = +{ + {sCursorGfx, 0x100, 0}, + {sMapCursorGfx, 0x400, 1}, + {gFrontierPassMedals_Gfx, 0x380, 2}, +}; + +static const struct CompressedSpriteSheet sHeadsSpriteSheet[] = +{ + {sHeadsGfx, 0x100, 4}, + {} +}; + +static const struct SpritePalette sSpritePalettes[] = +{ + {gFrontierPassCursor_Pal, 0}, + {gFrontierPassMapCursor_Pal, 1}, + {gFrontierPassMedalsSilver_Pal, 2}, + {gFrontierPassMedalsGold_Pal, 3}, + {sMaleHeadPalette, 4}, + {sFemaleHeadPalette, 5}, + {} +}; + +static const union AnimCmd sSpriteAnim_857151C[] = +{ + ANIMCMD_FRAME(0, 0), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_8571524[] = +{ + ANIMCMD_FRAME(0, 0), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_857152C[] = +{ + ANIMCMD_FRAME(4, 0), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_8571534[] = +{ + ANIMCMD_FRAME(8, 0), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_857153C[] = +{ + ANIMCMD_FRAME(12, 0), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_8571544[] = +{ + ANIMCMD_FRAME(16, 0), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_857154C[] = +{ + ANIMCMD_FRAME(20, 0), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_8571554[] = +{ + ANIMCMD_FRAME(24, 0), + ANIMCMD_END +}; + +static const union AnimCmd sSpriteAnim_857155C[] = +{ + ANIMCMD_FRAME(0, 45), + ANIMCMD_FRAME(8, 45), + ANIMCMD_JUMP(0) +}; + +static const union AnimCmd sSpriteAnim_8571568[] = +{ + ANIMCMD_FRAME(16, 45), + ANIMCMD_FRAME(24, 45), + ANIMCMD_JUMP(0) +}; + +static const union AnimCmd *const sSpriteAnimTable_8571574[] = +{ + sSpriteAnim_8571524, + sSpriteAnim_857152C +}; + +static const union AnimCmd *const sSpriteAnimTable_857157C[] = +{ + sSpriteAnim_8571524, + sSpriteAnim_857152C, + sSpriteAnim_8571534, + sSpriteAnim_857153C, + sSpriteAnim_8571544, + sSpriteAnim_857154C, + sSpriteAnim_8571554 +}; + +static const union AnimCmd *const sSpriteAnimTable_8571598[] = +{ + sSpriteAnim_857155C, + sSpriteAnim_8571568 +}; + +static const union AffineAnimCmd sSpriteAffineAnim_85715A0[] = +{ + AFFINEANIMCMD_FRAME(256, 256, 0, 0), + AFFINEANIMCMD_END +}; + +static const union AffineAnimCmd *const sSpriteAffineAnimTable_85715B0[] = +{ + sSpriteAffineAnim_85715A0 +}; + +static const struct SpriteTemplate sSpriteTemplates_Cursors[] = +{ + { + .tileTag = 0, + .paletteTag = 0, + .oam = &gUnknown_0852490C, + .anims = sSpriteAnimTable_8571574, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy, + }, + { + .tileTag = 1, + .paletteTag = 1, + .oam = &gUnknown_08524934, + .anims = sSpriteAnimTable_8571598, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy, + }, +}; + +static const struct SpriteTemplate sSpriteTemplate_Medal = +{ + .tileTag = 2, + .paletteTag = 2, + .oam = &gUnknown_0852490C, + .anims = sSpriteAnimTable_857157C, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCallbackDummy, +}; + +static const struct SpriteTemplate sSpriteTemplate_Head = +{ + .tileTag = 4, + .paletteTag = 4, + .oam = &gUnknown_0852490C, + .anims = sSpriteAnimTable_8571574, + .images = NULL, + .affineAnims = gDummySpriteAffineAnimTable, + .callback = SpriteCb_Dummy, +}; + +static const u8 *const sPassAreaDescriptions[] = +{ + gUnknown_085EDA96, + gUnknown_085ED932, + gUnknown_085ED94D, + gUnknown_085ED961, + gUnknown_085ED977, + gUnknown_085ED993, + gUnknown_085ED9AF, + gUnknown_085ED9C7, + gUnknown_085ED9E5, + gUnknown_085EDA02, + gUnknown_085EDA21, + gUnknown_085EDA3C, + gUnknown_085EDA5E, + gUnknown_085EDA78, + gUnknown_085ED931, +}; + +struct +{ + const u8 *name; + const u8 *description; + s16 x; + s16 y; + u8 animNum; +} static const sMapLandmarks[] = +{ + {gUnknown_085EDAB1, gUnknown_085EDB0F, 0x59, 0x28, 1}, + {gUnknown_085EDABE, gUnknown_085EDB4E, 0x21, 0x2A, 1}, + {gUnknown_085EDACA, gUnknown_085EDB8B, 0x78, 0x56, 0}, + {gUnknown_085EDAD8, gUnknown_085EDBC2, 0x72, 0x3B, 0}, + {gUnknown_085EDAE5, gUnknown_085EDC00, 0x19, 0x43, 0}, + {gUnknown_085EDAF4, gUnknown_085EDC45, 0x39, 0x39, 1}, + {gUnknown_085EDB00, gUnknown_085EDC84, 0x86, 0x29, 1}, +}; // code -void sub_80C50D0(void) +static void ResetGpuRegsAndBgs(void) { SetGpuReg(REG_OFFSET_DISPCNT, 0); SetGpuReg(REG_OFFSET_BG3CNT, 0); @@ -160,102 +553,102 @@ void ShowFrontierPass(void (*callback)(void)) SetMainCallback2(CB2_InitFrontierPass); } -void LeaveFrontierPass(void) +static void LeaveFrontierPass(void) { - SetMainCallback2(gUnknown_02039CEC->callback); + SetMainCallback2(sPassData->callback); FreeFrontierPassData(); } -u32 AllocateFrontierPassData(void (*callback)(void)) +static u32 AllocateFrontierPassData(void (*callback)(void)) { u8 i; - if (gUnknown_02039CEC != NULL) + if (sPassData != NULL) return 1; - gUnknown_02039CEC = AllocZeroed(sizeof(*gUnknown_02039CEC)); - if (gUnknown_02039CEC == NULL) + sPassData = AllocZeroed(sizeof(*sPassData)); + if (sPassData == NULL) return 2; - gUnknown_02039CEC->callback = callback; + sPassData->callback = callback; i = GetCurrentRegionMapSectionId(); if (i != MAPSEC_BATTLE_FRONTIER && i != MAPSEC_ARTISAN_CAVE) { - gUnknown_02039CEC->cursorX = 176; - gUnknown_02039CEC->cursorY = 104; + sPassData->cursorX = 176; + sPassData->cursorY = 104; } else { - gUnknown_02039CEC->cursorX = 176; - gUnknown_02039CEC->cursorY = 48; + sPassData->cursorX = 176; + sPassData->cursorY = 48; } - gUnknown_02039CEC->battlePoints = gSaveBlock2Ptr->frontier.battlePoints; - gUnknown_02039CEC->hasBattleRecord = CanCopyRecordedBattleSaveData(); - gUnknown_02039CEC->unkE = 0; - gUnknown_02039CEC->trainerStars = CountPlayerTrainerStars(); + sPassData->battlePoints = gSaveBlock2Ptr->frontier.battlePoints; + sPassData->hasBattleRecord = CanCopyRecordedBattleSaveData(); + sPassData->unkE = 0; + sPassData->trainerStars = CountPlayerTrainerStars(); for (i = 0; i < 7; i++) { if (FlagGet(FLAG_SYS_TOWER_SILVER + i * 2)) - gUnknown_02039CEC->facilitySymbols[i]++; + sPassData->facilitySymbols[i]++; if (FlagGet(FLAG_SYS_TOWER_GOLD + i * 2)) - gUnknown_02039CEC->facilitySymbols[i]++; + sPassData->facilitySymbols[i]++; } return 0; } -u32 FreeFrontierPassData(void) +static u32 FreeFrontierPassData(void) { - if (gUnknown_02039CEC == NULL) + if (sPassData == NULL) return 1; - memset(gUnknown_02039CEC, 0, sizeof(*gUnknown_02039CEC)); // Why clear data, if it's going to be freed anyway? - FREE_AND_SET_NULL(gUnknown_02039CEC); + memset(sPassData, 0, sizeof(*sPassData)); // Why clear data, if it's going to be freed anyway? + FREE_AND_SET_NULL(sPassData); return 0; } -u32 AllocateFrontierPassGfx(void) +static u32 AllocateFrontierPassGfx(void) { - if (gUnknown_02039CF0 != NULL) + if (sPassGfx != NULL) return 1; - gUnknown_02039CF0 = AllocZeroed(sizeof(*gUnknown_02039CF0)); - if (gUnknown_02039CF0 == NULL) + sPassGfx = AllocZeroed(sizeof(*sPassGfx)); + if (sPassGfx == NULL) return 2; return 0; } -u32 FreeFrontierPassGfx(void) +static u32 FreeFrontierPassGfx(void) { FreeAllWindowBuffers(); - if (gUnknown_02039CF0 == NULL) + if (sPassGfx == NULL) return 1; - if (gUnknown_02039CF0->unk28 != NULL) - FREE_AND_SET_NULL(gUnknown_02039CF0->unk28); - if (gUnknown_02039CF0->unk24 != NULL) - FREE_AND_SET_NULL(gUnknown_02039CF0->unk24); - if (gUnknown_02039CF0->unk20 != NULL) - FREE_AND_SET_NULL(gUnknown_02039CF0->unk20); + if (sPassGfx->unk28 != NULL) + FREE_AND_SET_NULL(sPassGfx->unk28); + if (sPassGfx->unk24 != NULL) + FREE_AND_SET_NULL(sPassGfx->unk24); + if (sPassGfx->unk20 != NULL) + FREE_AND_SET_NULL(sPassGfx->unk20); - memset(gUnknown_02039CF0, 0, sizeof(*gUnknown_02039CF0)); // Why clear data, if it's going to be freed anyway? - FREE_AND_SET_NULL(gUnknown_02039CF0); + memset(sPassGfx, 0, sizeof(*sPassGfx)); // Why clear data, if it's going to be freed anyway? + FREE_AND_SET_NULL(sPassGfx); return 0; } -void VblankCb_FrontierPass(void) +static void VblankCb_FrontierPass(void) { - if (gUnknown_02039CF0->setAffine) + if (sPassGfx->setAffine) { SetBgAffine(2, - gUnknown_085713E0[gUnknown_02039CEC->unkE - 1][0] << 8, - gUnknown_085713E0[gUnknown_02039CEC->unkE - 1][1] << 8, - gUnknown_085713E0[gUnknown_02039CEC->unkE - 1][0], - gUnknown_085713E0[gUnknown_02039CEC->unkE - 1][1], - gUnknown_02039CF0->unk2E, - gUnknown_02039CF0->unk30, + gUnknown_085713E0[sPassData->unkE - 1][0] << 8, + gUnknown_085713E0[sPassData->unkE - 1][1] << 8, + gUnknown_085713E0[sPassData->unkE - 1][0], + gUnknown_085713E0[sPassData->unkE - 1][1], + sPassGfx->unk2E, + sPassGfx->unk30, 0); } LoadOam(); @@ -263,14 +656,14 @@ void VblankCb_FrontierPass(void) TransferPlttBuffer(); } -void CB2_FrontierPass(void) +static void CB2_FrontierPass(void) { RunTasks(); AnimateSprites(); BuildOamBuffer(); } -void CB2_InitFrontierPass(void) +static void CB2_InitFrontierPass(void) { if (InitFrontierPass()) { @@ -279,7 +672,7 @@ void CB2_InitFrontierPass(void) } } -void CB2_HideFrontierPass(void) +static void CB2_HideFrontierPass(void) { if (HideFrontierPass()) { @@ -287,11 +680,11 @@ void CB2_HideFrontierPass(void) } } -bool32 InitFrontierPass(void) +static bool32 InitFrontierPass(void) { u32 sizeOut = 0; - switch (gUnknown_02039CEC->state) + switch (sPassData->state) { case 0: SetVBlankCallback(NULL); @@ -300,7 +693,7 @@ bool32 InitFrontierPass(void) DisableInterrupts(INTR_FLAG_HBLANK); break; case 1: - sub_80C50D0(); + ResetGpuRegsAndBgs(); break; case 2: ResetTasks(); @@ -314,20 +707,20 @@ bool32 InitFrontierPass(void) break; case 4: ResetBgsAndClearDma3BusyFlags(0); - InitBgsFromTemplates(1, gUnknown_085713E8, ARRAY_COUNT(gUnknown_085713E8)); - SetBgTilemapBuffer(1, gUnknown_02039CF0->tilemapBuff1); - SetBgTilemapBuffer(2, gUnknown_02039CF0->tilemapBuff2); - SetBgTilemapBuffer(3, gUnknown_02039CF0->tilemapBuff3); + InitBgsFromTemplates(1, sPassBgTemplates, ARRAY_COUNT(sPassBgTemplates)); + SetBgTilemapBuffer(1, sPassGfx->tilemapBuff1); + SetBgTilemapBuffer(2, sPassGfx->tilemapBuff2); + SetBgTilemapBuffer(3, sPassGfx->tilemapBuff3); SetBgAttribute(2, BG_ATTR_WRAPAROUND, 1); break; case 5: - InitWindows(gUnknown_08571400); + InitWindows(sPassWindowTemplates); DeactivateAllTextPrinters(); break; case 6: - gUnknown_02039CF0->unk20 = malloc_and_decompress(gUnknown_085712F8, &sizeOut); - gUnknown_02039CF0->unk24 = malloc_and_decompress(gUnknown_08571060, &sizeOut); - gUnknown_02039CF0->unk28 = malloc_and_decompress(gUnknown_085712C0, &sizeOut); + sPassGfx->unk20 = malloc_and_decompress(gUnknown_085712F8, &sizeOut); + sPassGfx->unk24 = malloc_and_decompress(gUnknown_08571060, &sizeOut); + sPassGfx->unk28 = malloc_and_decompress(gUnknown_085712C0, &sizeOut); decompress_and_copy_tile_data_to_vram(1, gUnknown_08DE08C8, 0, 0, 0); decompress_and_copy_tile_data_to_vram(2, gUnknown_08DE2084, 0, 0, 0); break; @@ -343,13 +736,13 @@ bool32 InitFrontierPass(void) break; case 8: LoadPalette(gUnknown_08DE07C8[0], 0, 0x1A0); - LoadPalette(gUnknown_08DE07C8[1 + gUnknown_02039CEC->trainerStars], 0x10, 0x20); + LoadPalette(gUnknown_08DE07C8[1 + sPassData->trainerStars], 0x10, 0x20); LoadPalette(stdpal_get(0), 0xF0, 0x20); sub_80C629C(); - sub_80C6104(gUnknown_02039CEC->cursorArea, gUnknown_02039CEC->previousCursorArea); - if (gUnknown_02039CEC->unkE == 1 || gUnknown_02039CEC->unkE == 2) + sub_80C6104(sPassData->cursorArea, sPassData->previousCursorArea); + if (sPassData->unkE == 1 || sPassData->unkE == 2) { - gUnknown_02039CEC->state = 0; + sPassData->state = 0; return TRUE; } break; @@ -369,26 +762,26 @@ bool32 InitFrontierPass(void) if (UpdatePaletteFade()) return FALSE; - gUnknown_02039CEC->state = 0; + sPassData->state = 0; return TRUE; } - gUnknown_02039CEC->state++; + sPassData->state++; return FALSE; } -bool32 HideFrontierPass(void) +static bool32 HideFrontierPass(void) { - switch (gUnknown_02039CEC->state) + switch (sPassData->state) { case 0: - if (gUnknown_02039CEC->unkE != 1 && gUnknown_02039CEC->unkE != 2) + if (sPassData->unkE != 1 && sPassData->unkE != 2) { BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); } else { - gUnknown_02039CEC->state = 2; + sPassData->state = 2; return FALSE; } break; @@ -409,7 +802,7 @@ bool32 HideFrontierPass(void) FreeCursorAndSymbolSprites(); break; case 4: - sub_80C50D0(); + ResetGpuRegsAndBgs(); ResetTasks(); ResetSpriteData(); FreeAllSpritePalettes(); @@ -419,34 +812,25 @@ bool32 HideFrontierPass(void) UnsetBgTilemapBuffer(1); UnsetBgTilemapBuffer(2); FreeFrontierPassGfx(); - gUnknown_02039CEC->state = 0; + sPassData->state = 0; return TRUE; } - gUnknown_02039CEC->state++; + sPassData->state++; return FALSE; } -struct -{ - s16 yStart; - s16 yEnd; - s16 xStart; - s16 xEnd; -} -extern const gUnknown_08571454[]; - -u8 GetCursorAreaFromCoords(s16 x, s16 y) +static u8 GetCursorAreaFromCoords(s16 x, s16 y) { u8 i; // Minus/Plus 1, because the table doesn't take into account the nothing field. for (i = 0; i < CURSOR_AREA_COUNT - 1; i++) { - if (gUnknown_08571454[i].yStart <= y && gUnknown_08571454[i].yEnd >= y - && gUnknown_08571454[i].xStart <= x && gUnknown_08571454[i].xEnd >= x) + if (sPassAreasLayout[i].yStart <= y && sPassAreasLayout[i].yEnd >= y + && sPassAreasLayout[i].xStart <= x && sPassAreasLayout[i].xEnd >= x) { - if (i >= CURSOR_AREA_SYMBOL - 1 && gUnknown_02039CEC->facilitySymbols[i - CURSOR_AREA_SYMBOL + 1] == 0) + if (i >= CURSOR_AREA_SYMBOL - 1 && sPassData->facilitySymbols[i - CURSOR_AREA_SYMBOL + 1] == 0) break; return i + 1; @@ -463,7 +847,7 @@ void CB2_ReshowFrontierPass(void) if (!InitFrontierPass()) return; - switch (gUnknown_02039CEC->unkE) + switch (sPassData->unkE) { case 1: case 2: @@ -472,7 +856,7 @@ void CB2_ReshowFrontierPass(void) break; case 3: default: - gUnknown_02039CEC->unkE = 0; + sPassData->unkE = 0; taskId = CreateTask(Task_HandleFrontierPassInput, 0); break; } @@ -480,12 +864,12 @@ void CB2_ReshowFrontierPass(void) SetMainCallback2(CB2_FrontierPass); } -void CB2_ReturnFromRecord(void) +static void CB2_ReturnFromRecord(void) { - AllocateFrontierPassData(gUnknown_02039CF8.callback); - gUnknown_02039CEC->cursorX = gUnknown_02039CF8.cursorX; - gUnknown_02039CEC->cursorY = gUnknown_02039CF8.cursorY; - memset(&gUnknown_02039CF8, 0, sizeof(gUnknown_02039CF8)); + AllocateFrontierPassData(sSavedPassData.callback); + sPassData->cursorX = sSavedPassData.cursorX; + sPassData->cursorY = sSavedPassData.cursorY; + memset(&sSavedPassData, 0, sizeof(sSavedPassData)); switch (InBattlePyramid()) { case 1: @@ -502,20 +886,20 @@ void CB2_ReturnFromRecord(void) SetMainCallback2(CB2_ReshowFrontierPass); } -void CB2_ShowFrontierPassFeature(void) +static void CB2_ShowFrontierPassFeature(void) { if (!HideFrontierPass()) return; - switch (gUnknown_02039CEC->unkE) + switch (sPassData->unkE) { case 1: ShowFrontierMap(CB2_ReshowFrontierPass); break; case 3: - gUnknown_02039CF8.callback = gUnknown_02039CEC->callback; - gUnknown_02039CF8.cursorX = gUnknown_02039CEC->cursorX; - gUnknown_02039CF8.cursorY = gUnknown_02039CEC->cursorY; + sSavedPassData.callback = sPassData->callback; + sSavedPassData.cursorX = sPassData->cursorX; + sSavedPassData.cursorY = sPassData->cursorY; FreeFrontierPassData(); PlayRecordedBattle(CB2_ReturnFromRecord); break; @@ -525,20 +909,20 @@ void CB2_ShowFrontierPassFeature(void) } } -bool32 TryCallPassAreaFunction(u8 taskId, u8 cursorArea) +static bool32 TryCallPassAreaFunction(u8 taskId, u8 cursorArea) { switch (cursorArea) { case CURSOR_AREA_RECORD: - if (!gUnknown_02039CEC->hasBattleRecord) + if (!sPassData->hasBattleRecord) return FALSE; - gUnknown_02039CEC->unkE = 3; + sPassData->unkE = 3; DestroyTask(taskId); SetMainCallback2(CB2_ShowFrontierPassFeature); break; case CURSOR_AREA_MAP: case CURSOR_AREA_CARD: - gUnknown_02039CEC->unkE = cursorArea; + sPassData->unkE = cursorArea; gTasks[taskId].func = Task_DoFadeEffect; gTasks[taskId].data[0] = FALSE; break; @@ -546,56 +930,56 @@ bool32 TryCallPassAreaFunction(u8 taskId, u8 cursorArea) return FALSE; } - gUnknown_02039CEC->cursorX = gUnknown_02039CF0->cursorSprite->pos1.x; - gUnknown_02039CEC->cursorY = gUnknown_02039CF0->cursorSprite->pos1.y; + sPassData->cursorX = sPassGfx->cursorSprite->pos1.x; + sPassData->cursorY = sPassGfx->cursorSprite->pos1.y; return TRUE; } -void Task_HandleFrontierPassInput(u8 taskId) +static void Task_HandleFrontierPassInput(u8 taskId) { u8 var = FALSE; // Reused, first informs whether the cursor moves, then used as the new cursor area. - if (gMain.heldKeys & DPAD_UP && gUnknown_02039CF0->cursorSprite->pos1.y >= 9) + if (gMain.heldKeys & DPAD_UP && sPassGfx->cursorSprite->pos1.y >= 9) { - gUnknown_02039CF0->cursorSprite->pos1.y -= 2; - if (gUnknown_02039CF0->cursorSprite->pos1.y <= 7) - gUnknown_02039CF0->cursorSprite->pos1.y = 2; + sPassGfx->cursorSprite->pos1.y -= 2; + if (sPassGfx->cursorSprite->pos1.y <= 7) + sPassGfx->cursorSprite->pos1.y = 2; var = TRUE; } - if (gMain.heldKeys & DPAD_DOWN && gUnknown_02039CF0->cursorSprite->pos1.y <= 135) + if (gMain.heldKeys & DPAD_DOWN && sPassGfx->cursorSprite->pos1.y <= 135) { - gUnknown_02039CF0->cursorSprite->pos1.y += 2; - if (gUnknown_02039CF0->cursorSprite->pos1.y >= 137) - gUnknown_02039CF0->cursorSprite->pos1.y = 136; + sPassGfx->cursorSprite->pos1.y += 2; + if (sPassGfx->cursorSprite->pos1.y >= 137) + sPassGfx->cursorSprite->pos1.y = 136; var = TRUE; } - if (gMain.heldKeys & DPAD_LEFT && gUnknown_02039CF0->cursorSprite->pos1.x >= 6) + if (gMain.heldKeys & DPAD_LEFT && sPassGfx->cursorSprite->pos1.x >= 6) { - gUnknown_02039CF0->cursorSprite->pos1.x -= 2; - if (gUnknown_02039CF0->cursorSprite->pos1.x <= 4) - gUnknown_02039CF0->cursorSprite->pos1.x = 5; + sPassGfx->cursorSprite->pos1.x -= 2; + if (sPassGfx->cursorSprite->pos1.x <= 4) + sPassGfx->cursorSprite->pos1.x = 5; var = TRUE; } - if (gMain.heldKeys & DPAD_RIGHT && gUnknown_02039CF0->cursorSprite->pos1.x <= 231) + if (gMain.heldKeys & DPAD_RIGHT && sPassGfx->cursorSprite->pos1.x <= 231) { - gUnknown_02039CF0->cursorSprite->pos1.x += 2; - if (gUnknown_02039CF0->cursorSprite->pos1.x >= 233) - gUnknown_02039CF0->cursorSprite->pos1.x = 232; + sPassGfx->cursorSprite->pos1.x += 2; + if (sPassGfx->cursorSprite->pos1.x >= 233) + sPassGfx->cursorSprite->pos1.x = 232; var = TRUE; } if (!var) // Cursor did not change. { - if (gUnknown_02039CEC->cursorArea != CURSOR_AREA_NOTHING && gMain.newKeys & A_BUTTON) + if (sPassData->cursorArea != CURSOR_AREA_NOTHING && gMain.newKeys & A_BUTTON) { - if (gUnknown_02039CEC->cursorArea <= CURSOR_AREA_RECORD) // Map, Card, Record + if (sPassData->cursorArea <= CURSOR_AREA_RECORD) // Map, Card, Record { PlaySE(SE_SELECT); - if (TryCallPassAreaFunction(taskId, gUnknown_02039CEC->cursorArea)) + if (TryCallPassAreaFunction(taskId, sPassData->cursorArea)) return; } - else if (gUnknown_02039CEC->cursorArea == CURSOR_AREA_CANCEL) + else if (sPassData->cursorArea == CURSOR_AREA_CANCEL) { PlaySE(SE_PC_OFF); SetMainCallback2(CB2_HideFrontierPass); @@ -613,22 +997,22 @@ void Task_HandleFrontierPassInput(u8 taskId) } else { - var = GetCursorAreaFromCoords(gUnknown_02039CF0->cursorSprite->pos1.x - 5, gUnknown_02039CF0->cursorSprite->pos1.y + 5); - if (gUnknown_02039CEC->cursorArea != var) + var = GetCursorAreaFromCoords(sPassGfx->cursorSprite->pos1.x - 5, sPassGfx->cursorSprite->pos1.y + 5); + if (sPassData->cursorArea != var) { PrintAreaDescription(var); - gUnknown_02039CEC->previousCursorArea = gUnknown_02039CEC->cursorArea; - gUnknown_02039CEC->cursorArea = var; - sub_80C6104(gUnknown_02039CEC->cursorArea, gUnknown_02039CEC->previousCursorArea); + sPassData->previousCursorArea = sPassData->cursorArea; + sPassData->cursorArea = var; + sub_80C6104(sPassData->cursorArea, sPassData->previousCursorArea); } } } -void Task_DoFadeEffect(u8 taskId) +static void Task_DoFadeEffect(u8 taskId) { s16 *data = gTasks[taskId].data; - switch (gUnknown_02039CEC->state) + switch (sPassData->state) { case 0: if (!data[0]) @@ -655,16 +1039,16 @@ void Task_DoFadeEffect(u8 taskId) BlendPalettes(0xFFFFFFFF, 0x10, RGB_WHITE); BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_WHITE); } - gUnknown_02039CF0->setAffine = TRUE; - gUnknown_02039CF0->unk2E = sub_8151624(data[1]); - gUnknown_02039CF0->unk30 = sub_8151624(data[2]); + sPassGfx->setAffine = TRUE; + sPassGfx->unk2E = sub_8151624(data[1]); + sPassGfx->unk30 = sub_8151624(data[2]); break; case 1: UpdatePaletteFade(); data[1] += data[3]; data[2] += data[4]; - gUnknown_02039CF0->unk2E = sub_8151624(data[1]); - gUnknown_02039CF0->unk30 = sub_8151624(data[2]); + sPassGfx->unk2E = sub_8151624(data[1]); + sPassGfx->unk30 = sub_8151624(data[2]); if (!data[0]) { if (data[1] <= 0x1FC) @@ -677,8 +1061,8 @@ void Task_DoFadeEffect(u8 taskId) } break; case 2: - if (gUnknown_02039CF0->setAffine) // Nonsensical check. - gUnknown_02039CF0->setAffine = FALSE; + if (sPassGfx->setAffine) // Nonsensical check. + sPassGfx->setAffine = FALSE; if (UpdatePaletteFade()) return; if (!data[0]) @@ -689,18 +1073,18 @@ void Task_DoFadeEffect(u8 taskId) else { sub_80C5F58(FALSE, FALSE); - gUnknown_02039CEC->unkE = 0; + sPassData->unkE = 0; gTasks[taskId].func = Task_HandleFrontierPassInput; } SetBgAttribute(2, BG_ATTR_WRAPAROUND, 0); - gUnknown_02039CEC->state = 0; + sPassData->state = 0; return; } - gUnknown_02039CEC->state++; + sPassData->state++; } -void ShowAndPrintWindows(void) +static void ShowAndPrintWindows(void) { s32 x; u8 i; @@ -712,19 +1096,19 @@ void ShowAndPrintWindows(void) } x = GetStringCenterAlignXOffset(1, gText_SymbolsEarned, 0x60); - AddTextPrinterParameterized3(WINDOW_EARNED_SYMBOLS, 1, x, 5, gUnknown_08571448[0], 0, gText_SymbolsEarned); + AddTextPrinterParameterized3(WINDOW_EARNED_SYMBOLS, 1, x, 5, sTextColors[0], 0, gText_SymbolsEarned); x = GetStringCenterAlignXOffset(1, gText_BattleRecord, 0x60); - AddTextPrinterParameterized3(WINDOW_BATTLE_RECORD, 1, x, 5, gUnknown_08571448[0], 0, gText_BattleRecord); + AddTextPrinterParameterized3(WINDOW_BATTLE_RECORD, 1, x, 5, sTextColors[0], 0, gText_BattleRecord); - AddTextPrinterParameterized3(WINDOW_BATTLE_POINTS, 8, 5, 4, gUnknown_08571448[0], 0, gText_BattlePoints); - ConvertIntToDecimalStringN(gStringVar4, gUnknown_02039CEC->battlePoints, STR_CONV_MODE_LEFT_ALIGN, 5); + AddTextPrinterParameterized3(WINDOW_BATTLE_POINTS, 8, 5, 4, sTextColors[0], 0, gText_BattlePoints); + ConvertIntToDecimalStringN(gStringVar4, sPassData->battlePoints, STR_CONV_MODE_LEFT_ALIGN, 5); x = GetStringRightAlignXOffset(8, gStringVar4, 0x5B); - AddTextPrinterParameterized3(WINDOW_BATTLE_POINTS, 8, x, 16, gUnknown_08571448[0], 0, gStringVar4); + AddTextPrinterParameterized3(WINDOW_BATTLE_POINTS, 8, x, 16, sTextColors[0], 0, gStringVar4); - gUnknown_02039CEC->cursorArea = GetCursorAreaFromCoords(gUnknown_02039CEC->cursorX - 5, gUnknown_02039CEC->cursorY + 5); - gUnknown_02039CEC->previousCursorArea = CURSOR_AREA_NOTHING; - PrintAreaDescription(gUnknown_02039CEC->cursorArea); + sPassData->cursorArea = GetCursorAreaFromCoords(sPassData->cursorX - 5, sPassData->cursorY + 5); + sPassData->previousCursorArea = CURSOR_AREA_NOTHING; + PrintAreaDescription(sPassData->cursorArea); for (i = 0; i < WINDOW_COUNT; i++) CopyWindowToVram(i, 3); @@ -732,31 +1116,31 @@ void ShowAndPrintWindows(void) CopyBgTilemapBufferToVram(0); } -void PrintAreaDescription(u8 cursorArea) +static void PrintAreaDescription(u8 cursorArea) { FillWindowPixelBuffer(WINDOW_DESCRIPTION, 0); - if (cursorArea == CURSOR_AREA_RECORD && !gUnknown_02039CEC->hasBattleRecord) - AddTextPrinterParameterized3(WINDOW_DESCRIPTION, 1, 2, 0, gUnknown_08571448[1], 0, gUnknown_08571614[0]); + if (cursorArea == CURSOR_AREA_RECORD && !sPassData->hasBattleRecord) + AddTextPrinterParameterized3(WINDOW_DESCRIPTION, 1, 2, 0, sTextColors[1], 0, sPassAreaDescriptions[0]); else if (cursorArea != CURSOR_AREA_NOTHING) - AddTextPrinterParameterized3(WINDOW_DESCRIPTION, 1, 2, 0, gUnknown_08571448[1], 0, gUnknown_08571614[cursorArea]); + AddTextPrinterParameterized3(WINDOW_DESCRIPTION, 1, 2, 0, sTextColors[1], 0, sPassAreaDescriptions[cursorArea]); CopyWindowToVram(WINDOW_DESCRIPTION, 3); CopyBgTilemapBufferToVram(0); } -void sub_80C5F58(bool8 arg0, bool8 arg1) +static void sub_80C5F58(bool8 arg0, bool8 arg1) { - switch (gUnknown_02039CEC->unkE) + switch (sPassData->unkE) { case 1: if (arg0) - CopyToBgTilemapBufferRect_ChangePalette(2, gUnknown_02039CF0->unk20, 16, 3, 12, 7, 16); + CopyToBgTilemapBufferRect_ChangePalette(2, sPassGfx->unk20, 16, 3, 12, 7, 16); else FillBgTilemapBufferRect(2, 0, 16, 3, 12, 7, 16); break; case 2: if (arg0) - CopyToBgTilemapBufferRect_ChangePalette(2, gUnknown_02039CF0->unk20 + 84, 16, 10, 12, 7, 16); + CopyToBgTilemapBufferRect_ChangePalette(2, sPassGfx->unk20 + 84, 16, 10, 12, 7, 16); else FillBgTilemapBufferRect(2, 0, 16, 10, 12, 7, 16); break; @@ -768,10 +1152,10 @@ void sub_80C5F58(bool8 arg0, bool8 arg1) if (arg1) { SetBgAffine(2, - gUnknown_085713E0[gUnknown_02039CEC->unkE - 1][0] << 8, - gUnknown_085713E0[gUnknown_02039CEC->unkE - 1][1] << 8, - gUnknown_085713E0[gUnknown_02039CEC->unkE - 1][0], - gUnknown_085713E0[gUnknown_02039CEC->unkE - 1][1], + gUnknown_085713E0[sPassData->unkE - 1][0] << 8, + gUnknown_085713E0[sPassData->unkE - 1][1] << 8, + gUnknown_085713E0[sPassData->unkE - 1][0], + gUnknown_085713E0[sPassData->unkE - 1][1], sub_8151624(0x1FC), sub_8151624(0x1FC), 0); @@ -779,38 +1163,38 @@ void sub_80C5F58(bool8 arg0, bool8 arg1) else { SetBgAffine(2, - gUnknown_085713E0[gUnknown_02039CEC->unkE - 1][0] << 8, - gUnknown_085713E0[gUnknown_02039CEC->unkE - 1][1] << 8, - gUnknown_085713E0[gUnknown_02039CEC->unkE - 1][0], - gUnknown_085713E0[gUnknown_02039CEC->unkE - 1][1], + gUnknown_085713E0[sPassData->unkE - 1][0] << 8, + gUnknown_085713E0[sPassData->unkE - 1][1] << 8, + gUnknown_085713E0[sPassData->unkE - 1][0], + gUnknown_085713E0[sPassData->unkE - 1][1], sub_8151624(0x100), sub_8151624(0x100), 0); } } -void sub_80C6104(u8 cursorArea, u8 previousCursorArea) +static void sub_80C6104(u8 cursorArea, u8 previousCursorArea) { bool32 var; switch (previousCursorArea) { case CURSOR_AREA_MAP: - CopyToBgTilemapBufferRect_ChangePalette(1, gUnknown_02039CF0->unk24, 16, 3, 12, 7, 17); + CopyToBgTilemapBufferRect_ChangePalette(1, sPassGfx->unk24, 16, 3, 12, 7, 17); var = TRUE; break; case CURSOR_AREA_CARD: - CopyToBgTilemapBufferRect_ChangePalette(1, gUnknown_02039CF0->unk24 + 336, 16, 10, 12, 7, 17); + CopyToBgTilemapBufferRect_ChangePalette(1, sPassGfx->unk24 + 336, 16, 10, 12, 7, 17); var = TRUE; break; case CURSOR_AREA_RECORD: - if (!gUnknown_02039CEC->hasBattleRecord) + if (!sPassData->hasBattleRecord) { var = FALSE; } else { - CopyToBgTilemapBufferRect_ChangePalette(1, gUnknown_02039CF0->unk28, 2, 10, 12, 3, 17); + CopyToBgTilemapBufferRect_ChangePalette(1, sPassGfx->unk28, 2, 10, 12, 3, 17); var = TRUE; } break; @@ -832,18 +1216,18 @@ void sub_80C6104(u8 cursorArea, u8 previousCursorArea) switch (cursorArea) { case CURSOR_AREA_MAP: - CopyToBgTilemapBufferRect_ChangePalette(1, gUnknown_02039CF0->unk24 + 168, 16, 3, 12, 7, 17); + CopyToBgTilemapBufferRect_ChangePalette(1, sPassGfx->unk24 + 168, 16, 3, 12, 7, 17); var = TRUE; break; case CURSOR_AREA_CARD: - CopyToBgTilemapBufferRect_ChangePalette(1, gUnknown_02039CF0->unk24 + 504, 16, 10, 12, 7, 17); + CopyToBgTilemapBufferRect_ChangePalette(1, sPassGfx->unk24 + 504, 16, 10, 12, 7, 17); var = TRUE; break; case CURSOR_AREA_RECORD: - if (!gUnknown_02039CEC->hasBattleRecord) + if (!sPassData->hasBattleRecord) return; - CopyToBgTilemapBufferRect_ChangePalette(1, gUnknown_02039CF0->unk28 + 72, 2, 10, 12, 3, 17); + CopyToBgTilemapBufferRect_ChangePalette(1, sPassGfx->unk28 + 72, 2, 10, 12, 3, 17); var = TRUE; break; case CURSOR_AREA_CANCEL: @@ -865,56 +1249,56 @@ void sub_80C6104(u8 cursorArea, u8 previousCursorArea) CopyBgTilemapBufferToVram(1); } -void sub_80C629C(void) +static void sub_80C629C(void) { CopyToBgTilemapBuffer(1, gUnknown_08DE3060, 0, 0); - sub_80C6104(gUnknown_02039CEC->cursorArea, gUnknown_02039CEC->previousCursorArea); - sub_80C5F58(TRUE, gUnknown_02039CEC->unkE); + sub_80C6104(sPassData->cursorArea, sPassData->previousCursorArea); + sub_80C5F58(TRUE, sPassData->unkE); ShowAndPrintWindows(); CopyBgTilemapBufferToVram(1); } -void LoadCursorAndSymbolSprites(void) +static void LoadCursorAndSymbolSprites(void) { u8 spriteId; u8 i = 0; FreeAllSpritePalettes(); ResetAffineAnimData(); - LoadSpritePalettes(gUnknown_085714E4); - LoadCompressedSpriteSheet(&gUnknown_085714BC[0]); - LoadCompressedSpriteSheet(&gUnknown_085714BC[2]); - spriteId = CreateSprite(&gUnknown_085715B4[0], gUnknown_02039CEC->cursorX, gUnknown_02039CEC->cursorY, 0); - gUnknown_02039CF0->cursorSprite = &gSprites[spriteId]; - gUnknown_02039CF0->cursorSprite->oam.priority = 0; + LoadSpritePalettes(sSpritePalettes); + LoadCompressedSpriteSheet(&sCursorSpriteSheets[0]); + LoadCompressedSpriteSheet(&sCursorSpriteSheets[2]); + spriteId = CreateSprite(&sSpriteTemplates_Cursors[0], sPassData->cursorX, sPassData->cursorY, 0); + sPassGfx->cursorSprite = &gSprites[spriteId]; + sPassGfx->cursorSprite->oam.priority = 0; for (i = 0; i < NUM_FRONTIER_FACILITIES; i++) { - if (gUnknown_02039CEC->facilitySymbols[i] != 0) + if (sPassData->facilitySymbols[i] != 0) { - struct SpriteTemplate sprite = gUnknown_085715E4; + struct SpriteTemplate sprite = sSpriteTemplate_Medal; - sprite.paletteTag += gUnknown_02039CEC->facilitySymbols[i] - 1; - spriteId = CreateSprite(&sprite, gUnknown_08571454[i + CURSOR_AREA_SYMBOL - 1].xStart + 8, gUnknown_08571454[i + CURSOR_AREA_SYMBOL - 1].yStart + 6, i + 1); - gUnknown_02039CF0->symbolSprites[i] = &gSprites[spriteId]; - gUnknown_02039CF0->symbolSprites[i]->oam.priority = 2; - StartSpriteAnim(gUnknown_02039CF0->symbolSprites[i], i); + sprite.paletteTag += sPassData->facilitySymbols[i] - 1; + spriteId = CreateSprite(&sprite, sPassAreasLayout[i + CURSOR_AREA_SYMBOL - 1].xStart + 8, sPassAreasLayout[i + CURSOR_AREA_SYMBOL - 1].yStart + 6, i + 1); + sPassGfx->symbolSprites[i] = &gSprites[spriteId]; + sPassGfx->symbolSprites[i]->oam.priority = 2; + StartSpriteAnim(sPassGfx->symbolSprites[i], i); } } } -void FreeCursorAndSymbolSprites(void) +static void FreeCursorAndSymbolSprites(void) { u8 i = 0; - DestroySprite(gUnknown_02039CF0->cursorSprite); - gUnknown_02039CF0->cursorSprite = NULL; + DestroySprite(sPassGfx->cursorSprite); + sPassGfx->cursorSprite = NULL; for (i = 0; i < NUM_FRONTIER_FACILITIES; i++) { - if (gUnknown_02039CF0->symbolSprites[i] != NULL) + if (sPassGfx->symbolSprites[i] != NULL) { - DestroySprite(gUnknown_02039CF0->symbolSprites[i]); - gUnknown_02039CF0->symbolSprites[i] = NULL; + DestroySprite(sPassGfx->symbolSprites[i]); + sPassGfx->symbolSprites[i] = NULL; } } FreeAllSpritePalettes(); @@ -922,62 +1306,42 @@ void FreeCursorAndSymbolSprites(void) FreeSpriteTilesByTag(0); } -void nullsub_39(void) +static void SpriteCb_Dummy(struct Sprite *sprite) { } // Frontier Map code. -struct FrontierMapData -{ - void (*callback)(void); - struct Sprite *cursorSprite; - struct Sprite *playerHeadSprite; - struct Sprite *mapIndicatorSprite; - u8 cursorPos; - u8 unk11; - u8 tilemapBuff0[0x1000]; - u8 tilemapBuff1[0x1000]; - u8 tilemapBuff2[0x1000]; -}; - -extern struct FrontierMapData *gUnknown_02039CF4; - // Forward declarations. -void sub_80C67BC(u8 taskId); -void sub_80C6B94(void); -void sub_80C6974(void); -void sub_80C6C70(u8 direction); +static void Task_HandleFrontierMap(u8 taskId); +static void PrintOnFrontierMap(void); +static void InitFrontierMapSprites(void); +static void HandleFrontierMapCursorMove(u8 direction); -extern const struct BgTemplate gUnknown_085713F4[3]; -extern const struct WindowTemplate gUnknown_08571428[]; -extern const u32 gUnknown_0856FBBC[]; -extern const u32 gUnknown_08570E00[]; - -void ShowFrontierMap(void (*callback)(void)) +static void ShowFrontierMap(void (*callback)(void)) { - if (gUnknown_02039CF4 != NULL) + if (sMapData != NULL) SetMainCallback2(callback); // This line doesn't make sense at all, since it gets overwritten later anyway. - gUnknown_02039CF4 = AllocZeroed(sizeof(*gUnknown_02039CF4)); - gUnknown_02039CF4->callback = callback; + sMapData = AllocZeroed(sizeof(*sMapData)); + sMapData->callback = callback; ResetTasks(); - CreateTask(sub_80C67BC, 0); + CreateTask(Task_HandleFrontierMap, 0); SetMainCallback2(CB2_FrontierPass); } -void sub_80C6498(void) +static void FreeFrontierMap(void) { ResetTasks(); - SetMainCallback2(gUnknown_02039CF4->callback); - memset(gUnknown_02039CF4, 0, sizeof(*gUnknown_02039CF4)); // Pointless memory clear. - FREE_AND_SET_NULL(gUnknown_02039CF4); + SetMainCallback2(sMapData->callback); + memset(sMapData, 0, sizeof(*sMapData)); // Pointless memory clear. + FREE_AND_SET_NULL(sMapData); } -bool32 sub_80C64CC(void) +static bool32 InitFrontierMap(void) { - switch (gUnknown_02039CEC->state) + switch (sPassData->state) { case 0: SetVBlankCallback(NULL); @@ -985,7 +1349,7 @@ bool32 sub_80C64CC(void) SetVBlankHBlankCallbacksToNull(); break; case 1: - sub_80C50D0(); + ResetGpuRegsAndBgs(); break; case 2: ResetSpriteData(); @@ -995,10 +1359,10 @@ bool32 sub_80C64CC(void) break; case 3: ResetBgsAndClearDma3BusyFlags(0); - InitBgsFromTemplates(0, gUnknown_085713F4, ARRAY_COUNT(gUnknown_085713F4)); - SetBgTilemapBuffer(0, gUnknown_02039CF4->tilemapBuff0); - SetBgTilemapBuffer(1, gUnknown_02039CF4->tilemapBuff1); - SetBgTilemapBuffer(2, gUnknown_02039CF4->tilemapBuff2); + InitBgsFromTemplates(0, sMapBgTemplates, ARRAY_COUNT(sMapBgTemplates)); + SetBgTilemapBuffer(0, sMapData->tilemapBuff0); + SetBgTilemapBuffer(1, sMapData->tilemapBuff1); + SetBgTilemapBuffer(2, sMapData->tilemapBuff2); FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 30, 20); FillBgTilemapBufferRect_Palette0(1, 0, 0, 0, 30, 20); FillBgTilemapBufferRect_Palette0(2, 0, 0, 0, 30, 20); @@ -1007,9 +1371,9 @@ bool32 sub_80C64CC(void) CopyBgTilemapBufferToVram(2); break; case 4: - InitWindows(gUnknown_08571428); + InitWindows(sMapWindowTemplates); DeactivateAllTextPrinters(); - sub_80C6B94(); + PrintOnFrontierMap(); decompress_and_copy_tile_data_to_vram(1, gUnknown_0856FBBC, 0, 0, 0); break; case 5: @@ -1025,7 +1389,7 @@ bool32 sub_80C64CC(void) ShowBg(0); ShowBg(1); ShowBg(2); - sub_80C6974(); + InitFrontierMapSprites(); SetVBlankCallback(VblankCb_FrontierPass); BlendPalettes(0xFFFFFFFF, 0x10, RGB_WHITE); BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_WHITE); @@ -1033,17 +1397,17 @@ bool32 sub_80C64CC(void) case 7: if (UpdatePaletteFade()) return FALSE; - gUnknown_02039CEC->state = 0; + sPassData->state = 0; return TRUE; } - gUnknown_02039CEC->state++; + sPassData->state++; return FALSE; } -bool32 sub_80C66AC(void) +static bool32 ExitFrontierMap(void) { - switch (gUnknown_02039CEC->state) + switch (sPassData->state) { case 0: BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_WHITE); @@ -1062,25 +1426,25 @@ bool32 sub_80C66AC(void) SetVBlankHBlankCallbacksToNull(); break; case 3: - if (gUnknown_02039CF4->cursorSprite != NULL) + if (sMapData->cursorSprite != NULL) { - DestroySprite(gUnknown_02039CF4->cursorSprite); + DestroySprite(sMapData->cursorSprite); FreeSpriteTilesByTag(0); } - if (gUnknown_02039CF4->mapIndicatorSprite != NULL) + if (sMapData->mapIndicatorSprite != NULL) { - DestroySprite(gUnknown_02039CF4->mapIndicatorSprite); + DestroySprite(sMapData->mapIndicatorSprite); FreeSpriteTilesByTag(1); } - if (gUnknown_02039CF4->playerHeadSprite != NULL) + if (sMapData->playerHeadSprite != NULL) { - DestroySprite(gUnknown_02039CF4->playerHeadSprite); + DestroySprite(sMapData->playerHeadSprite); FreeSpriteTilesByTag(4); } FreeAllWindowBuffers(); break; case 4: - sub_80C50D0(); + ResetGpuRegsAndBgs(); ResetSpriteData(); FreeAllSpritePalettes(); break; @@ -1088,22 +1452,22 @@ bool32 sub_80C66AC(void) UnsetBgTilemapBuffer(0); UnsetBgTilemapBuffer(1); UnsetBgTilemapBuffer(2); - gUnknown_02039CEC->state = 0; + sPassData->state = 0; return TRUE; } - gUnknown_02039CEC->state++; + sPassData->state++; return FALSE; } -void sub_80C67BC(u8 taskId) +static void Task_HandleFrontierMap(u8 taskId) { s16 *data = gTasks[taskId].data; switch (data[0]) { case 0: - if (sub_80C64CC()) + if (InitFrontierMap()) break; return; case 1: @@ -1114,15 +1478,15 @@ void sub_80C67BC(u8 taskId) } else if (gMain.newKeys & DPAD_DOWN) { - if (gUnknown_02039CF4->cursorPos >= NUM_FRONTIER_FACILITIES - 1) - sub_80C6C70(0); + if (sMapData->cursorPos >= NUM_FRONTIER_FACILITIES - 1) + HandleFrontierMapCursorMove(0); else data[0] = 2; } else if (gMain.newKeys & DPAD_UP) { - if (gUnknown_02039CF4->cursorPos == 0) - sub_80C6C70(1); + if (sMapData->cursorPos == 0) + HandleFrontierMapCursorMove(1); else data[0] = 3; } @@ -1130,43 +1494,43 @@ void sub_80C67BC(u8 taskId) case 2: if (data[1] > 3) { - sub_80C6C70(0); + HandleFrontierMapCursorMove(0); data[1] = 0; data[0] = 1; } else { - gUnknown_02039CF4->cursorSprite->pos1.y += 4; + sMapData->cursorSprite->pos1.y += 4; data[1]++; } return; case 3: if (data[1] > 3) { - sub_80C6C70(1); + HandleFrontierMapCursorMove(1); data[1] = 0; data[0] = 1; } else { - gUnknown_02039CF4->cursorSprite->pos1.y -= 4; + sMapData->cursorSprite->pos1.y -= 4; data[1]++; } return; case 4: - if (sub_80C66AC()) + if (ExitFrontierMap()) break; return; case 5: DestroyTask(taskId); - sub_80C6498(); + FreeFrontierMap(); return; } data[0]++; } -u8 sub_80C68E8(u16 mapNum) // id + 1, zero means not a frontier map number +static u8 MapNumToFrontierFacilityId(u16 mapNum) // id + 1, zero means not a frontier map number { if ((mapNum >= MAP_NUM(BATTLE_FRONTIER_BATTLE_TOWER_LOBBY) && mapNum <= MAP_NUM(BATTLE_FRONTIER_BATTLE_TOWER_BATTLE_ROOM)) || (mapNum >= MAP_NUM(BATTLE_FRONTIER_BATTLE_TOWER_MULTI_BATTLE_ROOM) && mapNum <= MAP_NUM(BATTLE_FRONTIER_BATTLE_TOWER_BATTLE_ROOM2))) @@ -1203,19 +1567,7 @@ u8 sub_80C68E8(u16 mapNum) // id + 1, zero means not a frontier map number return 0; } -struct -{ - const u8 *name; - const u8 *description; - s16 x; - s16 y; - u8 animNum; -} extern const gUnknown_08571650[]; - -extern const struct CompressedSpriteSheet gUnknown_085714D4[]; -extern const struct SpriteTemplate gUnknown_085715FC; - -void sub_80C6974(void) +static void InitFrontierMapSprites(void) { struct SpriteTemplate sprite; u8 spriteId; @@ -1223,20 +1575,20 @@ void sub_80C6974(void) s16 x = 0, y; FreeAllSpritePalettes(); - LoadSpritePalettes(gUnknown_085714E4); + LoadSpritePalettes(sSpritePalettes); - LoadCompressedSpriteSheet(&gUnknown_085714BC[0]); - spriteId = CreateSprite(&gUnknown_085715B4[0], 155, (gUnknown_02039CF4->cursorPos * 16) + 8, 2); - gUnknown_02039CF4->cursorSprite = &gSprites[spriteId]; - gUnknown_02039CF4->cursorSprite->oam.priority = 0; - gUnknown_02039CF4->cursorSprite->hFlip = TRUE; - StartSpriteAnim(gUnknown_02039CF4->cursorSprite, 1); + LoadCompressedSpriteSheet(&sCursorSpriteSheets[0]); + spriteId = CreateSprite(&sSpriteTemplates_Cursors[0], 155, (sMapData->cursorPos * 16) + 8, 2); + sMapData->cursorSprite = &gSprites[spriteId]; + sMapData->cursorSprite->oam.priority = 0; + sMapData->cursorSprite->hFlip = TRUE; + StartSpriteAnim(sMapData->cursorSprite, 1); - LoadCompressedSpriteSheet(&gUnknown_085714BC[1]); - spriteId = CreateSprite(&gUnknown_085715B4[1], gUnknown_08571650[gUnknown_02039CF4->cursorPos].x, gUnknown_08571650[gUnknown_02039CF4->cursorPos].y, 1); - gUnknown_02039CF4->mapIndicatorSprite = &gSprites[spriteId]; - gUnknown_02039CF4->mapIndicatorSprite->oam.priority = 0; - StartSpriteAnim(gUnknown_02039CF4->mapIndicatorSprite, gUnknown_08571650[gUnknown_02039CF4->cursorPos].animNum); + LoadCompressedSpriteSheet(&sCursorSpriteSheets[1]); + spriteId = CreateSprite(&sSpriteTemplates_Cursors[1], sMapLandmarks[sMapData->cursorPos].x, sMapLandmarks[sMapData->cursorPos].y, 1); + sMapData->mapIndicatorSprite = &gSprites[spriteId]; + sMapData->mapIndicatorSprite->oam.priority = 0; + StartSpriteAnim(sMapData->mapIndicatorSprite, sMapLandmarks[sMapData->cursorPos].animNum); // Create player indicator head sprite only if it's in vicinity of battle frontier. id = GetCurrentRegionMapSectionId(); @@ -1257,11 +1609,11 @@ void sub_80C6974(void) } else { - id = sub_80C68E8(mapNum); + id = MapNumToFrontierFacilityId(mapNum); if (id != 0) { - x = gUnknown_08571650[id - 1].x; - y = gUnknown_08571650[id - 1].y; + x = sMapLandmarks[id - 1].x; + y = sMapLandmarks[id - 1].y; } else { @@ -1278,8 +1630,8 @@ void sub_80C6974(void) } } - LoadCompressedSpriteSheet(gUnknown_085714D4); - sprite = gUnknown_085715FC; + LoadCompressedSpriteSheet(sHeadsSpriteSheet); + sprite = sSpriteTemplate_Head; sprite.paletteTag = gSaveBlock2Ptr->playerGender + 4; if (id != 0) { @@ -1292,22 +1644,14 @@ void sub_80C6974(void) spriteId = CreateSprite(&sprite, x + 20, y + 36, 0); } - gUnknown_02039CF4->playerHeadSprite = &gSprites[spriteId]; - gUnknown_02039CF4->playerHeadSprite->oam.priority = 0; + sMapData->playerHeadSprite = &gSprites[spriteId]; + sMapData->playerHeadSprite->oam.priority = 0; if (gSaveBlock2Ptr->playerGender != MALE) - StartSpriteAnim(gUnknown_02039CF4->playerHeadSprite, 1); + StartSpriteAnim(sMapData->playerHeadSprite, 1); } } -enum -{ - MAP_WINDOW_0, - MAP_WINDOW_NAME, - MAP_WINDOW_DESCRIPTION, - MAP_WINDOW_COUNT -}; - -void sub_80C6B94(void) +static void PrintOnFrontierMap(void) { u8 i; @@ -1319,13 +1663,13 @@ void sub_80C6B94(void) for (i = 0; i < NUM_FRONTIER_FACILITIES; i++) { - if (i == gUnknown_02039CF4->cursorPos) - AddTextPrinterParameterized3(MAP_WINDOW_NAME, 7, 4, (i * 16) + 1, gUnknown_08571448[2], 0, gUnknown_08571650[i].name); + if (i == sMapData->cursorPos) + AddTextPrinterParameterized3(MAP_WINDOW_NAME, 7, 4, (i * 16) + 1, sTextColors[2], 0, sMapLandmarks[i].name); else - AddTextPrinterParameterized3(MAP_WINDOW_NAME, 7, 4, (i * 16) + 1, gUnknown_08571448[1], 0, gUnknown_08571650[i].name); + AddTextPrinterParameterized3(MAP_WINDOW_NAME, 7, 4, (i * 16) + 1, sTextColors[1], 0, sMapLandmarks[i].name); } - AddTextPrinterParameterized3(MAP_WINDOW_DESCRIPTION, 1, 4, 0, gUnknown_08571448[0], 0, gUnknown_08571650[gUnknown_02039CF4->cursorPos].description); + AddTextPrinterParameterized3(MAP_WINDOW_DESCRIPTION, 1, 4, 0, sTextColors[0], 0, sMapLandmarks[sMapData->cursorPos].description); for (i = 0; i < MAP_WINDOW_COUNT; i++) CopyWindowToVram(i, 3); @@ -1333,31 +1677,31 @@ void sub_80C6B94(void) CopyBgTilemapBufferToVram(0); } -void sub_80C6C70(u8 direction) +static void HandleFrontierMapCursorMove(u8 direction) { u8 oldCursorPos, i; if (direction) { - oldCursorPos = gUnknown_02039CF4->cursorPos; - gUnknown_02039CF4->cursorPos = (oldCursorPos + 6) % NUM_FRONTIER_FACILITIES; + oldCursorPos = sMapData->cursorPos; + sMapData->cursorPos = (oldCursorPos + 6) % NUM_FRONTIER_FACILITIES; } else { - oldCursorPos = gUnknown_02039CF4->cursorPos; - gUnknown_02039CF4->cursorPos = (oldCursorPos + 1) % NUM_FRONTIER_FACILITIES; + oldCursorPos = sMapData->cursorPos; + sMapData->cursorPos = (oldCursorPos + 1) % NUM_FRONTIER_FACILITIES; } - AddTextPrinterParameterized3(MAP_WINDOW_NAME, 7, 4, (oldCursorPos * 16) + 1, gUnknown_08571448[1], 0, gUnknown_08571650[oldCursorPos].name); - AddTextPrinterParameterized3(MAP_WINDOW_NAME, 7, 4, (gUnknown_02039CF4->cursorPos * 16) + 1, gUnknown_08571448[2], 0, gUnknown_08571650[gUnknown_02039CF4->cursorPos].name); + AddTextPrinterParameterized3(MAP_WINDOW_NAME, 7, 4, (oldCursorPos * 16) + 1, sTextColors[1], 0, sMapLandmarks[oldCursorPos].name); + AddTextPrinterParameterized3(MAP_WINDOW_NAME, 7, 4, (sMapData->cursorPos * 16) + 1, sTextColors[2], 0, sMapLandmarks[sMapData->cursorPos].name); - gUnknown_02039CF4->cursorSprite->pos1.y = (gUnknown_02039CF4->cursorPos * 16) + 8; + sMapData->cursorSprite->pos1.y = (sMapData->cursorPos * 16) + 8; - StartSpriteAnim(gUnknown_02039CF4->mapIndicatorSprite, gUnknown_08571650[gUnknown_02039CF4->cursorPos].animNum); - gUnknown_02039CF4->mapIndicatorSprite->pos1.x = gUnknown_08571650[gUnknown_02039CF4->cursorPos].x; - gUnknown_02039CF4->mapIndicatorSprite->pos1.y = gUnknown_08571650[gUnknown_02039CF4->cursorPos].y; + StartSpriteAnim(sMapData->mapIndicatorSprite, sMapLandmarks[sMapData->cursorPos].animNum); + sMapData->mapIndicatorSprite->pos1.x = sMapLandmarks[sMapData->cursorPos].x; + sMapData->mapIndicatorSprite->pos1.y = sMapLandmarks[sMapData->cursorPos].y; FillWindowPixelBuffer(MAP_WINDOW_DESCRIPTION, 0); - AddTextPrinterParameterized3(MAP_WINDOW_DESCRIPTION, 1, 4, 0, gUnknown_08571448[0], 0, gUnknown_08571650[gUnknown_02039CF4->cursorPos].description); + AddTextPrinterParameterized3(MAP_WINDOW_DESCRIPTION, 1, 4, 0, sTextColors[0], 0, sMapLandmarks[sMapData->cursorPos].description); for (i = 0; i < 3; i++) CopyWindowToVram(i, 3); diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index dc2e80a61..78fec2fc5 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -1541,7 +1541,7 @@ static const u8 gHandCursorTiles[] = INCBIN_U8("graphics/pokemon_storage/hand_cu static const u8 gHandCursorShadowTiles[] = INCBIN_U8("graphics/pokemon_storage/hand_cursor_shadow.4bpp"); // code -void sub_80C6D80(u8 *string, void *dst, u8 arg2, u8 arg3, s32 arg4) +void sub_80C6D80(const u8 *string, void *dst, u8 arg2, u8 arg3, s32 arg4) { s32 i, val, val2; u16 windowId; @@ -1586,121 +1586,29 @@ void sub_80C6D80(u8 *string, void *dst, u8 arg2, u8 arg3, s32 arg4) RemoveWindow(windowId); } -NAKED -void sub_80C6EAC() +// Unused +void sub_80C6EAC(const u8 *string, void *dst, u16 arg2, u8 arg3, u8 clr2, u8 clr3) { - asm_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, 0x2C\n\ - str r0, [sp, 0x20]\n\ - str r1, [sp, 0x24]\n\ - adds r6, r3, 0\n\ - ldr r0, [sp, 0x4C]\n\ - mov r9, r0\n\ - ldr r1, [sp, 0x50]\n\ - mov r10, r1\n\ - lsls r2, 16\n\ - lsrs r2, 16\n\ - str r2, [sp, 0x28]\n\ - lsls r6, 24\n\ - lsrs r6, 24\n\ - mov r2, r9\n\ - lsls r2, 24\n\ - lsrs r2, 24\n\ - mov r9, r2\n\ - mov r0, r10\n\ - lsls r0, 24\n\ - lsrs r0, 24\n\ - mov r10, r0\n\ - movs r0, 0\n\ - movs r1, 0\n\ - str r0, [sp, 0x18]\n\ - str r1, [sp, 0x1C]\n\ - ldr r0, [sp, 0x20]\n\ - bl StringLength_Multibyte\n\ - lsls r0, 24\n\ - ldr r2, =0x00ffffff\n\ - ldr r1, [sp, 0x18]\n\ - ands r1, r2\n\ - orrs r1, r0\n\ - str r1, [sp, 0x18]\n\ - ldr r1, =0xffffff00\n\ - add r2, sp, 0x18\n\ - mov r8, r2\n\ - ldr r0, [r2, 0x4]\n\ - ands r0, r1\n\ - movs r1, 0x2\n\ - orrs r0, r1\n\ - str r0, [r2, 0x4]\n\ - ldr r5, [sp, 0x18]\n\ - lsrs r5, 24\n\ - lsls r5, 5\n\ - mov r0, r8\n\ - bl AddWindow\n\ - adds r4, r0, 0\n\ - lsls r4, 24\n\ - lsrs r4, 24\n\ - lsls r1, r6, 4\n\ - orrs r1, r6\n\ - lsls r1, 24\n\ - lsrs r1, 24\n\ - adds r0, r4, 0\n\ - bl FillWindowPixelBuffer\n\ - adds r0, r4, 0\n\ - movs r1, 0x7\n\ - bl GetWindowAttribute\n\ - adds r7, r0, 0\n\ - mov r0, r8\n\ - ldrb r0, [r0, 0x3]\n\ - lsls r0, 5\n\ - mov r8, r0\n\ - add r8, r7\n\ - add r0, sp, 0x14\n\ - movs r1, 0\n\ - strb r6, [r0]\n\ - mov r2, r9\n\ - strb r2, [r0, 0x1]\n\ - mov r2, r10\n\ - strb r2, [r0, 0x2]\n\ - str r1, [sp]\n\ - str r1, [sp, 0x4]\n\ - str r0, [sp, 0x8]\n\ - movs r0, 0x1\n\ - negs r0, r0\n\ - str r0, [sp, 0xC]\n\ - ldr r0, [sp, 0x20]\n\ - str r0, [sp, 0x10]\n\ - adds r0, r4, 0\n\ - movs r1, 0x1\n\ - movs r2, 0\n\ - movs r3, 0x2\n\ - bl AddTextPrinterParameterized4\n\ - lsrs r5, 1\n\ - adds r0, r7, 0\n\ - ldr r1, [sp, 0x24]\n\ - adds r2, r5, 0\n\ - bl CpuSet\n\ - ldr r2, [sp, 0x24]\n\ - ldr r0, [sp, 0x28]\n\ - adds r1, r2, r0\n\ - mov r0, r8\n\ - adds r2, r5, 0\n\ - bl CpuSet\n\ - adds r0, r4, 0\n\ - bl RemoveWindow\n\ - add sp, 0x2C\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"); + u32 var; + u8 windowId; + u8 txtColor[3]; + u8 *tileData1, *tileData2; + struct WindowTemplate winTemplate = {0}; + + winTemplate.width = StringLength_Multibyte(string); + winTemplate.height = 2; + var = winTemplate.width * 32; + windowId = AddWindow(&winTemplate); + FillWindowPixelBuffer(windowId, (arg3 << 4) | arg3); + tileData1 = (u8*) GetWindowAttribute(windowId, WINDOW_TILE_DATA); + tileData2 = (winTemplate.width * 32) + tileData1; + txtColor[0] = arg3; + txtColor[1] = clr2; + txtColor[2] = clr3; + AddTextPrinterParameterized4(windowId, 1, 0, 2, 0, 0, txtColor, -1, string); + CpuCopy16(tileData1, dst, var); + CpuCopy16(tileData2, dst + arg2, var); + RemoveWindow(windowId); } u8 CountMonsInBox(u8 boxId) diff --git a/src/string_util.c b/src/string_util.c index 8ce9a97ed..39d235ab8 100644 --- a/src/string_util.c +++ b/src/string_util.c @@ -587,7 +587,7 @@ u8 *StringCopyN_Multibyte(u8 *dest, u8 *src, u32 n) return dest; } -u32 StringLength_Multibyte(u8 *str) +u32 StringLength_Multibyte(const u8 *str) { u32 length = 0; diff --git a/src/trade.c b/src/trade.c index 99c9f6088..70b57fbc7 100644 --- a/src/trade.c +++ b/src/trade.c @@ -26,6 +26,7 @@ #include "pokedex.h" #include "pokemon_icon.h" #include "pokemon_summary_screen.h" +#include "pokemon_storage_system.h" #include "random.h" #include "rom_8011DC0.h" #include "save.h" @@ -49,8 +50,6 @@ #define Trade_SendData(ptr) (SendBlock(bitmask_all_link_players_but_self(), ptr->linkData, 20)) -extern void sub_80C6D80(const u8 *, u8 *, u8, u8, u8); - struct InGameTrade { /*0x00*/ u8 name[11]; /*0x0C*/ u16 species; diff --git a/sym_ewram.txt b/sym_ewram.txt index 75a44bb97..9e836d0fe 100644 --- a/sym_ewram.txt +++ b/sym_ewram.txt @@ -154,19 +154,7 @@ gUnknown_02039B88: @ 2039B88 .space 0x160 .include "src/trainer_card.o" - -gUnknown_02039CEC: @ 2039CEC - .space 0x4 - -gUnknown_02039CF0: @ 2039CF0 - .space 0x4 - -gUnknown_02039CF4: @ 2039CF4 - .space 0x4 - -gUnknown_02039CF8: @ 2039CF8 - .space 0x8 - + .include "src/frontier_pass.o" .include "src/pokemon_storage_system.o" .include "src/script_movement.o" .include "src/fldeff_cut.o" From 251d16b73393b0210d7f279d805601a0e1bed98f Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sat, 26 Jan 2019 21:06:20 +0100 Subject: [PATCH 15/16] Make Frontier pass compile --- src/bg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bg.c b/src/bg.c index 54ec3b347..f73f5998d 100644 --- a/src/bg.c +++ b/src/bg.c @@ -246,7 +246,7 @@ void SetTextModeAndHideBgs(void) SetGpuReg(REG_OFFSET_DISPCNT, GetGpuReg(REG_OFFSET_DISPCNT) & ~DISPCNT_ALL_BG_AND_MODE_BITS); } -static void SetBgAffineInternal(u8 bg, u32 srcCenterX, u32 srcCenterY, s16 dispCenterX, s16 dispCenterY, s16 scaleX, s16 scaleY, u16 rotationAngle) +static void SetBgAffineInternal(u8 bg, s32 srcCenterX, s32 srcCenterY, s16 dispCenterX, s16 dispCenterY, s16 scaleX, s16 scaleY, u16 rotationAngle) { struct BgAffineSrcData src; struct BgAffineDstData dest; @@ -777,7 +777,7 @@ s32 GetBgY(u8 bg) return sGpuBgConfigs2[bg].bg_y; } -void SetBgAffine(u8 bg, u32 srcCenterX, u32 srcCenterY, s16 dispCenterX, s16 dispCenterY, s16 scaleX, s16 scaleY, u16 rotationAngle) +void SetBgAffine(u8 bg, s32 srcCenterX, s32 srcCenterY, s16 dispCenterX, s16 dispCenterY, s16 scaleX, s16 scaleY, u16 rotationAngle) { SetBgAffineInternal(bg, srcCenterX, srcCenterY, dispCenterX, dispCenterY, scaleX, scaleY, rotationAngle); } From 54ddbaaf0cef7aabf69521feb6dbec222e3df6f0 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sat, 26 Jan 2019 22:09:24 +0100 Subject: [PATCH 16/16] Frontier pass clean-up --- src/frontier_pass.c | 152 ++++++++++++++++++++++---------------------- 1 file changed, 75 insertions(+), 77 deletions(-) diff --git a/src/frontier_pass.c b/src/frontier_pass.c index a0f6af73c..0db546c4d 100644 --- a/src/frontier_pass.c +++ b/src/frontier_pass.c @@ -34,12 +34,12 @@ // All windows displayed in the frontier pass. enum { - WINDOW_EARNED_SYMBOLS, - WINDOW_BATTLE_RECORD, - WINDOW_BATTLE_POINTS, - WINDOW_DESCRIPTION, - WINDOW_4, - WINDOW_COUNT + WINDOW_EARNED_SYMBOLS, + WINDOW_BATTLE_RECORD, + WINDOW_BATTLE_POINTS, + WINDOW_DESCRIPTION, + WINDOW_4, + WINDOW_COUNT }; // Windows displayed in the facilities map view. @@ -215,75 +215,75 @@ static const struct BgTemplate sMapBgTemplates[] = static const struct WindowTemplate sPassWindowTemplates[] = { - { - .bg = 0, - .tilemapLeft = 2, - .tilemapTop = 3, - .width = 12, - .height = 3, - .paletteNum = 15, - .baseBlock = 0x1, - }, - { - .bg = 0, - .tilemapLeft = 2, - .tilemapTop = 10, - .width = 12, - .height = 3, - .paletteNum = 15, - .baseBlock = 0x26, - }, - { - .bg = 0, - .tilemapLeft = 2, - .tilemapTop = 13, - .width = 12, - .height = 4, - .paletteNum = 15, - .baseBlock = 0x4B, - }, - { - .bg = 0, - .tilemapLeft = 0, - .tilemapTop = 18, - .width = 30, - .height = 3, - .paletteNum = 15, - .baseBlock = 0x7C, - }, - DUMMY_WIN_TEMPLATE + { + .bg = 0, + .tilemapLeft = 2, + .tilemapTop = 3, + .width = 12, + .height = 3, + .paletteNum = 15, + .baseBlock = 0x1, + }, + { + .bg = 0, + .tilemapLeft = 2, + .tilemapTop = 10, + .width = 12, + .height = 3, + .paletteNum = 15, + .baseBlock = 0x26, + }, + { + .bg = 0, + .tilemapLeft = 2, + .tilemapTop = 13, + .width = 12, + .height = 4, + .paletteNum = 15, + .baseBlock = 0x4B, + }, + { + .bg = 0, + .tilemapLeft = 0, + .tilemapTop = 18, + .width = 30, + .height = 3, + .paletteNum = 15, + .baseBlock = 0x7C, + }, + DUMMY_WIN_TEMPLATE }; static const struct WindowTemplate sMapWindowTemplates[] = { - { - .bg = 0, - .tilemapLeft = 0, - .tilemapTop = 1, - .width = 15, - .height = 5, - .paletteNum = 15, - .baseBlock = 0x1, - }, - { - .bg = 0, - .tilemapLeft = 20, - .tilemapTop = 1, - .width = 10, - .height = 14, - .paletteNum = 15, - .baseBlock = 0x4D, - }, - { - .bg = 0, - .tilemapLeft = 2, - .tilemapTop = 16, - .width = 26, - .height = 4, - .paletteNum = 15, - .baseBlock = 0xDA, - }, - DUMMY_WIN_TEMPLATE + { + .bg = 0, + .tilemapLeft = 0, + .tilemapTop = 1, + .width = 15, + .height = 5, + .paletteNum = 15, + .baseBlock = 0x1, + }, + { + .bg = 0, + .tilemapLeft = 20, + .tilemapTop = 1, + .width = 10, + .height = 14, + .paletteNum = 15, + .baseBlock = 0x4D, + }, + { + .bg = 0, + .tilemapLeft = 2, + .tilemapTop = 16, + .width = 26, + .height = 4, + .paletteNum = 15, + .baseBlock = 0xDA, + }, + DUMMY_WIN_TEMPLATE }; static const u8 sTextColors[][3] = @@ -675,9 +675,7 @@ static void CB2_InitFrontierPass(void) static void CB2_HideFrontierPass(void) { if (HideFrontierPass()) - { LeaveFrontierPass(); - } } static bool32 InitFrontierPass(void) @@ -753,7 +751,7 @@ static bool32 InitFrontierPass(void) ShowBg(2); LoadCursorAndSymbolSprites(); SetVBlankCallback(VblankCb_FrontierPass); - BlendPalettes(0xFFFFFFFF, 0x10, 0); + BlendPalettes(0xFFFFFFFF, 0x10, RGB_BLACK); BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, RGB_BLACK); break; case 10: @@ -1095,15 +1093,15 @@ static void ShowAndPrintWindows(void) FillWindowPixelBuffer(i, 0); } - x = GetStringCenterAlignXOffset(1, gText_SymbolsEarned, 0x60); + x = GetStringCenterAlignXOffset(1, gText_SymbolsEarned, 96); AddTextPrinterParameterized3(WINDOW_EARNED_SYMBOLS, 1, x, 5, sTextColors[0], 0, gText_SymbolsEarned); - x = GetStringCenterAlignXOffset(1, gText_BattleRecord, 0x60); + x = GetStringCenterAlignXOffset(1, gText_BattleRecord, 96); AddTextPrinterParameterized3(WINDOW_BATTLE_RECORD, 1, x, 5, sTextColors[0], 0, gText_BattleRecord); AddTextPrinterParameterized3(WINDOW_BATTLE_POINTS, 8, 5, 4, sTextColors[0], 0, gText_BattlePoints); ConvertIntToDecimalStringN(gStringVar4, sPassData->battlePoints, STR_CONV_MODE_LEFT_ALIGN, 5); - x = GetStringRightAlignXOffset(8, gStringVar4, 0x5B); + x = GetStringRightAlignXOffset(8, gStringVar4, 91); AddTextPrinterParameterized3(WINDOW_BATTLE_POINTS, 8, x, 16, sTextColors[0], 0, gStringVar4); sPassData->cursorArea = GetCursorAreaFromCoords(sPassData->cursorX - 5, sPassData->cursorY + 5);