start decompiling trainer_card.s

This commit is contained in:
shinny456 2019-01-08 21:51:19 -05:00
parent 1285f96e1d
commit 8a5fce7837
3 changed files with 313 additions and 638 deletions

View File

@ -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}

View File

@ -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);

311
src/trainer_card.c Executable file
View File

@ -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;
}