summaryrefslogtreecommitdiff
path: root/src/pokemon
diff options
context:
space:
mode:
Diffstat (limited to 'src/pokemon')
-rw-r--r--src/pokemon/pokemon_storage_system_2.c2935
-rw-r--r--src/pokemon/pokemon_storage_system_4.c2
-rw-r--r--src/pokemon/pokemon_summary_screen.c957
3 files changed, 1084 insertions, 2810 deletions
diff --git a/src/pokemon/pokemon_storage_system_2.c b/src/pokemon/pokemon_storage_system_2.c
index 2f12b6bfa..0331abf3e 100644
--- a/src/pokemon/pokemon_storage_system_2.c
+++ b/src/pokemon/pokemon_storage_system_2.c
@@ -189,383 +189,179 @@ void sub_8096848(void)
void sub_8096874(void)
{
- REG_DISPCNT = DISPCNT_OBJ_1D_MAP | DISPCNT_BG_ALL_ON | DISPCNT_OBJ_ON;
+ REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG_ALL_ON | DISPCNT_OBJ_ON;
}
-#if DEBUG
-__attribute__((naked))
-void sub_8096884(void)
-{
- asm("\
- push {r4, lr}\n\
- ldr r0, ._223 @ gMain\n\
- ldr r1, ._223 + 4 @ 0x43c\n\
- add r0, r0, r1\n\
- ldrb r0, [r0]\n\
- cmp r0, #0x9\n\
- bls ._221 @cond_branch\n\
- b ._222\n\
-._221:\n\
- lsl r0, r0, #0x2\n\
- ldr r1, ._223 + 8 @ \n\
- add r0, r0, r1\n\
- ldr r0, [r0]\n\
- mov pc, r0\n\
-._224:\n\
- .align 2, 0\n\
-._223:\n\
- .word gMain\n\
- .word 0x43c\n\
- .word ._225\n\
-._225:\n\
- .word ._226\n\
- .word ._227\n\
- .word ._228\n\
- .word ._229\n\
- .word ._230\n\
- .word ._231\n\
- .word ._232\n\
- .word ._233\n\
- .word ._234\n\
- .word ._235\n\
-._226:\n\
- mov r0, #0x0\n\
- bl SetVBlankCallback\n\
- mov r0, #0x80\n\
- lsl r0, r0, #0x13\n\
- mov r4, #0x0\n\
- strh r4, [r0]\n\
- bl sub_8096804\n\
- ldr r0, ._237 @ unk_2038790\n\
- strb r4, [r0]\n\
- b ._250\n\
-._238:\n\
- .align 2, 0\n\
-._237:\n\
- .word unk_2038790\n\
-._227:\n\
- ldr r0, ._240 @ gWindowTemplate_81E6D00\n\
- bl Text_LoadWindowTemplate\n\
- b ._250\n\
-._241:\n\
- .align 2, 0\n\
-._240:\n\
- .word gWindowTemplate_81E6D00\n\
-._228:\n\
- ldr r0, ._243 @ gWindowTemplate_81E6D00\n\
- bl InitMenuWindow\n\
- bl Menu_EraseScreen\n\
- b ._250\n\
-._244:\n\
- .align 2, 0\n\
-._243:\n\
- .word gWindowTemplate_81E6D00\n\
-._229:\n\
- bl sub_80967DC\n\
- bl sub_8096848\n\
- b ._250\n\
-._230:\n\
- bl ResetPSSMonIconSprites\n\
- bl sub_809AA24\n\
- b ._250\n\
-._231:\n\
- bl sub_8097DE0\n\
- b ._250\n\
-._232:\n\
- bl sub_8097E70\n\
- b ._250\n\
-._233:\n\
- bl sub_8098400\n\
- b ._250\n\
-._234:\n\
- ldr r0, ._251 @ gPokemonStorage\n\
- ldrb r0, [r0]\n\
- bl sub_8099BF8\n\
- ldr r2, ._251 + 4 @ 0x2000000\n\
- ldr r1, ._251 + 8 @ 0x12bc\n\
- add r0, r2, r1\n\
- mov r1, #0xa\n\
- strh r1, [r0]\n\
- ldr r1, ._251 + 12 @ 0x12be\n\
- add r2, r2, r1\n\
- ldr r1, ._251 + 16 @ 0xdacb\n\
- strh r1, [r2]\n\
- bl sub_80F727C\n\
- bl sub_80F7404\n\
- b ._250\n\
-._252:\n\
- .align 2, 0\n\
-._251:\n\
- .word gPokemonStorage\n\
- .word 0x2000000\n\
- .word 0x12bc\n\
- .word 0x12be\n\
- .word 0xdacb\n\
-._235:\n\
- bl sub_8096874\n\
- ldr r0, ._253 @ sub_8096BF0\n\
- bl SetPSSCallback\n\
- ldr r0, ._253 + 4 @ sub_8096B38\n\
- bl SetMainCallback2\n\
- ldr r0, ._253 + 8 @ sub_8096AFC\n\
- bl SetVBlankCallback\n\
-._250:\n\
- ldr r1, ._253 + 12 @ gMain\n\
- ldr r0, ._253 + 16 @ 0x43c\n\
- add r1, r1, r0\n\
- ldrb r0, [r1]\n\
- add r0, r0, #0x1\n\
- strb r0, [r1]\n\
-._222:\n\
- pop {r4}\n\
- pop {r0}\n\
- bx r0\n\
-._254:\n\
- .align 2, 0\n\
-._253:\n\
- .word sub_8096BF0+1\n\
- .word sub_8096B38+1\n\
- .word sub_8096AFC+1\n\
- .word gMain\n\
- .word 0x43c");
-}
-#else
+extern u8 unk_2038790;
+
void sub_8096884(void)
{
switch (gMain.state)
{
- case 0:
- SetVBlankCallback(NULL);
- REG_DISPCNT = 0;
- sub_8096804();
- gMain.state++;
- break;
- case 1:
- Text_LoadWindowTemplate(&gWindowTemplate_81E6D00);
- gMain.state++;
- break;
- case 2:
- InitMenuWindow(&gWindowTemplate_81E6D00);
- Menu_EraseScreen();
- gMain.state++;
- break;
- case 3:
- sub_80967DC();
- sub_8096848();
- gMain.state++;
- break;
- case 4:
- ResetPSSMonIconSprites();
- sub_809AA24();
- gMain.state++;
- break;
- case 5:
- sub_8097DE0();
- gMain.state++;
- break;
- case 6:
- sub_8097E70();
- gMain.state++;
- break;
- case 7:
- sub_8098400();
- gMain.state++;
- break;
- case 8:
- sub_8099BF8(gPokemonStorage.currentBox);
- gPokemonStorageSystemPtr->unk_12bc.baseTileTag = 0x000a;
- gPokemonStorageSystemPtr->unk_12bc.basePaletteTag = 0xdacb;
- sub_80F727C(&gPokemonStorageSystemPtr->unk_12bc);
- sub_80F7404();
- gMain.state++;
- break;
- case 9:
- sub_8096874();
- SetPSSCallback(sub_8096BF0);
- SetMainCallback2(sub_8096B38);
- SetVBlankCallback(sub_8096AFC);
- gMain.state++;
- break;
+ case 0:
+ SetVBlankCallback(NULL);
+ REG_DISPCNT = 0;
+ sub_8096804();
+#if DEBUG
+ unk_2038790 = 0;
+#endif
+ gMain.state++;
+ break;
+ case 1:
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6D00);
+ gMain.state++;
+ break;
+ case 2:
+ InitMenuWindow(&gWindowTemplate_81E6D00);
+ Menu_EraseScreen();
+ gMain.state++;
+ break;
+ case 3:
+ sub_80967DC();
+ sub_8096848();
+ gMain.state++;
+ break;
+ case 4:
+ ResetPSSMonIconSprites();
+ sub_809AA24();
+ gMain.state++;
+ break;
+ case 5:
+ sub_8097DE0();
+ gMain.state++;
+ break;
+ case 6:
+ sub_8097E70();
+ gMain.state++;
+ break;
+ case 7:
+ sub_8098400();
+ gMain.state++;
+ break;
+ case 8:
+ sub_8099BF8(gPokemonStorage.currentBox);
+ gPokemonStorageSystemPtr->unk_12bc.baseTileTag = 0x000a;
+ gPokemonStorageSystemPtr->unk_12bc.basePaletteTag = 0xdacb;
+ sub_80F727C(&gPokemonStorageSystemPtr->unk_12bc);
+ sub_80F7404();
+ gMain.state++;
+ break;
+ case 9:
+ sub_8096874();
+ SetPSSCallback(sub_8096BF0);
+ SetMainCallback2(sub_8096B38);
+ SetVBlankCallback(sub_8096AFC);
+ gMain.state++;
+ break;
}
}
-#endif
void sub_80969A0(void)
{
switch (gMain.state)
{
- case 0:
- SetVBlankCallback(NULL);
- REG_DISPCNT = 0x0000;
- gPokemonStorageSystemPtr->unk_0005 = gUnknown_0203847D;
- sub_8096804();
- if (gUnknown_0203847F == 1)
- sub_809BBC0();
- if (gUnknown_0203847F == 0)
- sub_809BD14();
- gMain.state++;
- break;
- case 1:
- Text_LoadWindowTemplate(&gWindowTemplate_81E6D00);
- gMain.state++;
- break;
- case 2:
- InitMenuWindow(&gWindowTemplate_81E6D00);
- Menu_EraseScreen();
- gMain.state++;
- break;
- case 3:
- sub_80967DC();
- gMain.state++;
- break;
- case 4:
- ResetPSSMonIconSprites();
- sub_809AA98();
- gMain.state++;
- break;
- case 5:
- sub_8097DE0();
- gMain.state++;
- break;
- case 6:
- sub_8097E70();
- gMain.state++;
- break;
- case 7:
- sub_8098400();
- gMain.state++;
- break;
- case 8:
- sub_8099BF8(gPokemonStorage.currentBox);
- gPokemonStorageSystemPtr->unk_12bc.baseTileTag = 0x000a;
- gPokemonStorageSystemPtr->unk_12bc.basePaletteTag = 0xdacb;
- sub_80F727C(&gPokemonStorageSystemPtr->unk_12bc);
- sub_80F7404();
- gMain.state++;
- break;
- case 9:
- BeginNormalPaletteFade(0xffffffff, 0, 16, 0, 0);
- SetVBlankCallback(sub_8096AFC);
- gMain.state++;
- break;
- case 10:
- sub_8096874();
- SetPSSCallback(sub_8096C68);
- SetMainCallback2(sub_8096B38);
- gMain.state++;
- break;
+ case 0:
+ SetVBlankCallback(NULL);
+ REG_DISPCNT = 0;
+ gPokemonStorageSystemPtr->unk_0005 = gUnknown_0203847D;
+ sub_8096804();
+ if (gUnknown_0203847F == 1)
+ sub_809BBC0();
+ if (gUnknown_0203847F == 0)
+ sub_809BD14();
+ gMain.state++;
+ break;
+ case 1:
+ Text_LoadWindowTemplate(&gWindowTemplate_81E6D00);
+ gMain.state++;
+ break;
+ case 2:
+ InitMenuWindow(&gWindowTemplate_81E6D00);
+ Menu_EraseScreen();
+ gMain.state++;
+ break;
+ case 3:
+ sub_80967DC();
+ gMain.state++;
+ break;
+ case 4:
+ ResetPSSMonIconSprites();
+ sub_809AA98();
+ gMain.state++;
+ break;
+ case 5:
+ sub_8097DE0();
+ gMain.state++;
+ break;
+ case 6:
+ sub_8097E70();
+ gMain.state++;
+ break;
+ case 7:
+ sub_8098400();
+ gMain.state++;
+ break;
+ case 8:
+ sub_8099BF8(gPokemonStorage.currentBox);
+ gPokemonStorageSystemPtr->unk_12bc.baseTileTag = 0x000a;
+ gPokemonStorageSystemPtr->unk_12bc.basePaletteTag = 0xdacb;
+ sub_80F727C(&gPokemonStorageSystemPtr->unk_12bc);
+ sub_80F7404();
+ gMain.state++;
+ break;
+ case 9:
+ BeginNormalPaletteFade(0xffffffff, 0, 16, 0, 0);
+ SetVBlankCallback(sub_8096AFC);
+ gMain.state++;
+ break;
+ case 10:
+ sub_8096874();
+ SetPSSCallback(sub_8096C68);
+ SetMainCallback2(sub_8096B38);
+ gMain.state++;
+ break;
}
}
#if DEBUG
-__attribute__((naked))
-void debug_sub_80A4300()
-{
- asm("\
- push {lr}\n\
- ldr r1, ._296 @ gUnknown_0203847D\n\
- mov r0, #0x0\n\
- strb r0, [r1]\n\
- ldr r1, ._296 + 4 @ 0x2000000\n\
- mov r0, #0x0\n\
- strb r0, [r1, #0x5]\n\
- bl sub_8096884\n\
- ldr r0, ._296 + 8 @ gMain\n\
- ldr r1, [r0, #0x4]\n\
- ldr r0, ._296 + 12 @ sub_8096B38\n\
- cmp r1, r0\n\
- bne ._295 @cond_branch\n\
- ldr r1, ._296 + 16 @ unk_2038790\n\
- mov r0, #0x1\n\
- strb r0, [r1]\n\
-._295:\n\
- pop {r0}\n\
- bx r0\n\
-._297:\n\
- .align 2, 0\n\
-._296:\n\
- .word gUnknown_0203847D\n\
- .word 0x2000000\n\
- .word gMain\n\
- .word sub_8096B38+1\n\
- .word unk_2038790");
-}
-
-__attribute__((naked))
-void debug_sub_80A433C()
-{
- asm("\
- push {lr}\n\
- ldr r2, ._298 @ unk_2038794\n\
- str r1, [r2]\n\
- ldr r1, ._298 + 4 @ unk_2038798\n\
- str r0, [r1]\n\
- ldr r0, ._298 + 8 @ debug_sub_80A4300\n\
- bl SetMainCallback2\n\
- pop {r0}\n\
- bx r0\n\
-._299:\n\
- .align 2, 0\n\
-._298:\n\
- .word unk_2038794\n\
- .word unk_2038798\n\
- .word debug_sub_80A4300+1");
-}
-
-__attribute__((naked))
-void debug_sub_80A435C()
-{
- asm("\
- push {r4, r5, lr}\n\
- add sp, sp, #0xfffffffc\n\
- ldr r5, ._303 @ 0x2000000\n\
- ldrb r4, [r5, #0x4]\n\
- cmp r4, #0\n\
- beq ._300 @cond_branch\n\
- cmp r4, #0x1\n\
- beq ._301 @cond_branch\n\
- b ._308\n\
-._304:\n\
- .align 2, 0\n\
-._303:\n\
- .word 0x2000000\n\
-._300:\n\
- ldr r0, ._306 @ unk_2038798\n\
- ldr r0, [r0]\n\
- bl unref_sub_809CB94\n\
- mov r0, #0x1\n\
- neg r0, r0\n\
- str r4, [sp]\n\
- mov r1, #0x0\n\
- mov r2, #0x0\n\
- mov r3, #0x10\n\
- bl BeginNormalPaletteFade\n\
- ldrb r0, [r5, #0x4]\n\
- add r0, r0, #0x1\n\
- strb r0, [r5, #0x4]\n\
- b ._308\n\
-._307:\n\
- .align 2, 0\n\
-._306:\n\
- .word unk_2038798\n\
-._301:\n\
- bl UpdatePaletteFade\n\
- lsl r0, r0, #0x18\n\
- cmp r0, #0\n\
- bne ._308 @cond_branch\n\
- ldr r0, ._309 @ unk_2038794\n\
- ldr r0, [r0]\n\
- bl _call_via_r0\n\
-._308:\n\
- add sp, sp, #0x4\n\
- pop {r4, r5}\n\
- pop {r0}\n\
- bx r0\n\
-._310:\n\
- .align 2, 0\n\
-._309:\n\
- .word unk_2038794");
+
+void debug_sub_80A4300(void)
+{
+ gUnknown_0203847D = 0;
+ gPokemonStorageSystemPtr->unk_0005 = 0;
+ sub_8096884();
+ if (gMain.callback2 == sub_8096B38)
+ unk_2038790 = 1;
+}
+
+extern void (*unk_2038794)(void);
+extern u32 unk_2038798;
+
+extern void unref_sub_809CB94();
+
+void debug_sub_80A433C(u32 a, void (*b)(void))
+{
+ unk_2038794 = b;
+ unk_2038798 = a;
+ SetMainCallback2(debug_sub_80A4300);
+}
+
+void debug_sub_80A435C(void)
+{
+ switch (gPokemonStorageSystemPtr->unk_0004)
+ {
+ case 0:
+ unref_sub_809CB94(unk_2038798);
+ BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0);
+ gPokemonStorageSystemPtr->unk_0004++;
+ break;
+ case 1:
+ if (!UpdatePaletteFade())
+ unk_2038794();
+ break;
+ }
}
+
#endif
void sub_8096AFC(void)
@@ -592,12 +388,12 @@ void sub_8096B5C(void)
{
switch (gPokemonStorageSystemPtr->unk_0006)
{
- case 0:
- ShowPokemonSummaryScreen(gPokemonStorageSystemPtr->unk_2690.pokemon, gPokemonStorageSystemPtr->unk_268d, gPokemonStorageSystemPtr->unk_268c, sub_80969A0, gPokemonStorageSystemPtr->unk_268e);
- break;
- case 1:
- DoNamingScreen(1, gPokemonStorage.boxNames[gPokemonStorage.currentBox], 0, 0, 0, sub_80969A0);
- break;
+ case 0:
+ ShowPokemonSummaryScreen(gPokemonStorageSystemPtr->unk_2690.pokemon, gPokemonStorageSystemPtr->unk_268d, gPokemonStorageSystemPtr->unk_268c, sub_80969A0, gPokemonStorageSystemPtr->unk_268e);
+ break;
+ case 1:
+ DoNamingScreen(1, gPokemonStorage.boxNames[gPokemonStorage.currentBox], 0, 0, 0, sub_80969A0);
+ break;
}
}
@@ -611,24 +407,24 @@ void sub_8096BF0(void)
{
switch (gPokemonStorageSystemPtr->unk_0004)
{
- case 0:
- BlendPalettes(0xffffffff, 16, 0);
- gPokemonStorageSystemPtr->unk_0004++;
- break;
- case 1:
- PlaySE(SE_PC_LOGON);
- gPokemonStorageSystemPtr->unk_000c.tileTag = 14;
- gPokemonStorageSystemPtr->unk_000c.paletteTag = 0xdad0;
- gPokemonStorageSystemPtr->unk_000c.unk04 = 0;
- gPokemonStorageSystemPtr->unk_000c.unk06 = 0;
- sub_80C5CD4(&gPokemonStorageSystemPtr->unk_000c);
- BlendPalettes(0xffffffff, 0, 0);
- gPokemonStorageSystemPtr->unk_0004++;
- break;
- case 2:
- if (sub_80C5DCC())
- SetPSSCallback(sub_8096C84);
- break;
+ case 0:
+ BlendPalettes(0xffffffff, 16, 0);
+ gPokemonStorageSystemPtr->unk_0004++;
+ break;
+ case 1:
+ PlaySE(SE_PC_LOGON);
+ gPokemonStorageSystemPtr->unk_000c.tileTag = 14;
+ gPokemonStorageSystemPtr->unk_000c.paletteTag = 0xdad0;
+ gPokemonStorageSystemPtr->unk_000c.unk04 = 0;
+ gPokemonStorageSystemPtr->unk_000c.unk06 = 0;
+ sub_80C5CD4(&gPokemonStorageSystemPtr->unk_000c);
+ BlendPalettes(0xffffffff, 0, 0);
+ gPokemonStorageSystemPtr->unk_0004++;
+ break;
+ case 2:
+ if (sub_80C5DCC())
+ SetPSSCallback(sub_8096C84);
+ break;
}
}
@@ -638,605 +434,176 @@ void sub_8096C68(void)
SetPSSCallback(sub_8096C84);
}
-#if DEBUG
-__attribute__((naked))
-void sub_8096C84(void)
-{
- asm("\
- push {r4, lr}\n\
- ldr r0, ._347 @ 0x2000000\n\
- ldrb r0, [r0, #0x4]\n\
- cmp r0, #0x6\n\
- bls ._345 @cond_branch\n\
- b ._466\n\
-._345:\n\
- lsl r0, r0, #0x2\n\
- ldr r1, ._347 + 4 @ \n\
- add r0, r0, r1\n\
- ldr r0, [r0]\n\
- mov pc, r0\n\
-._348:\n\
- .align 2, 0\n\
-._347:\n\
- .word 0x2000000\n\
- .word ._349\n\
-._349:\n\
- .word ._350\n\
- .word ._351\n\
- .word ._352\n\
- .word ._353\n\
- .word ._354\n\
- .word ._355\n\
- .word ._356\n\
-._350:\n\
- bl sub_809CA40\n\
- lsl r0, r0, #0x18\n\
- lsr r0, r0, #0x18\n\
- sub r0, r0, #0x1\n\
- cmp r0, #0xf\n\
- bls ._357 @cond_branch\n\
- b ._466\n\
-._357:\n\
- lsl r0, r0, #0x2\n\
- ldr r1, ._360 @ \n\
- add r0, r0, r1\n\
- ldr r0, [r0]\n\
- mov pc, r0\n\
-._361:\n\
- .align 2, 0\n\
-._360:\n\
- .word ._359\n\
-._359:\n\
- .word ._362\n\
- .word ._466\n\
- .word ._466\n\
- .word ._365\n\
- .word ._366\n\
- .word ._367\n\
- .word ._368\n\
- .word ._369\n\
- .word ._370\n\
- .word ._371\n\
- .word ._372\n\
- .word ._373\n\
- .word ._374\n\
- .word ._375\n\
- .word ._376\n\
- .word ._377\n\
-._362:\n\
- mov r0, #0x5\n\
- bl PlaySE\n\
- ldr r1, ._379 @ 0x2000000\n\
- mov r0, #0x1\n\
- strb r0, [r1, #0x4]\n\
- b ._466\n\
-._380:\n\
- .align 2, 0\n\
-._379:\n\
- .word 0x2000000\n\
-._366:\n\
- ldr r4, ._383 @ 0x2000000\n\
- ldrb r0, [r4, #0x5]\n\
- cmp r0, #0x2\n\
- beq ._381 @cond_branch\n\
- mov r0, #0x10\n\
- bl PrintStorageActionText\n\
- mov r0, #0x3\n\
- strb r0, [r4, #0x4]\n\
- b ._466\n\
-._384:\n\
- .align 2, 0\n\
-._383:\n\
- .word 0x2000000\n\
-._381:\n\
- bl sub_809B0D4\n\
- ldr r0, ._386 @ sub_8096FC8\n\
- bl SetPSSCallback\n\
- b ._466\n\
-._387:\n\
- .align 2, 0\n\
-._386:\n\
- .word sub_8096FC8+1\n\
-._367:\n\
- ldr r4, ._394 @ 0x2000000\n\
- ldrb r0, [r4, #0x5]\n\
- cmp r0, #0x2\n\
- beq ._388 @cond_branch\n\
- b ._466\n\
-._388:\n\
- bl sub_809BF20\n\
- lsl r0, r0, #0x18\n\
- cmp r0, #0\n\
- beq ._391 @cond_branch\n\
- ldr r1, ._394 + 4 @ 0x11f2\n\
- add r0, r4, r1\n\
- ldrh r0, [r0]\n\
- bl ItemIsMail\n\
- lsl r0, r0, #0x18\n\
- cmp r0, #0\n\
- beq ._391 @cond_branch\n\
- b ._392\n\
-._391:\n\
- ldr r0, ._394 + 8 @ sub_8097004\n\
- bl SetPSSCallback\n\
- b ._466\n\
-._395:\n\
- .align 2, 0\n\
-._394:\n\
- .word 0x2000000\n\
- .word 0x11f2\n\
- .word sub_8097004+1\n\
-._365:\n\
- ldr r0, ._399 @ unk_2038790\n\
- ldrb r0, [r0]\n\
- cmp r0, #0\n\
- beq ._396 @cond_branch\n\
- b ._466\n\
-._396:\n\
- ldr r0, ._399 + 4 @ sub_8097BA0\n\
- bl SetPSSCallback\n\
- b ._466\n\
-._400:\n\
- .align 2, 0\n\
-._399:\n\
- .word unk_2038790\n\
- .word sub_8097BA0+1\n\
-._377:\n\
- ldr r0, ._404 @ unk_2038790\n\
- ldrb r0, [r0]\n\
- cmp r0, #0\n\
- beq ._401 @cond_branch\n\
- b ._466\n\
-._401:\n\
- ldr r0, ._404 + 4 @ sub_8097CC0\n\
- bl SetPSSCallback\n\
- b ._466\n\
-._405:\n\
- .align 2, 0\n\
-._404:\n\
- .word unk_2038790\n\
- .word sub_8097CC0+1\n\
-._368:\n\
- mov r0, #0x5\n\
- bl PlaySE\n\
- ldr r0, ._407 @ sub_809789C\n\
- bl SetPSSCallback\n\
- b ._466\n\
-._408:\n\
- .align 2, 0\n\
-._407:\n\
- .word sub_809789C+1\n\
-._369:\n\
- mov r0, #0x5\n\
- bl PlaySE\n\
- ldr r0, ._410 @ sub_8097078\n\
- bl SetPSSCallback\n\
- b ._466\n\
-._411:\n\
- .align 2, 0\n\
-._410:\n\
- .word sub_8097078+1\n\
-._370:\n\
- mov r0, #0x5\n\
- bl PlaySE\n\
- ldr r4, ._414 @ 0x2000000\n\
- ldr r0, ._414 + 4 @ gPokemonStorage\n\
- ldrb r0, [r0]\n\
- add r0, r0, #0x1\n\
- ldr r2, ._414 + 8 @ 0x8b2\n\
- add r1, r4, r2\n\
- strh r0, [r1]\n\
- cmp r0, #0xd\n\
- ble ._416 @cond_branch\n\
- mov r0, #0x0\n\
- b ._413\n\
-._415:\n\
- .align 2, 0\n\
-._414:\n\
- .word 0x2000000\n\
- .word gPokemonStorage\n\
- .word 0x8b2\n\
-._371:\n\
- mov r0, #0x5\n\
- bl PlaySE\n\
- ldr r4, ._418 @ 0x2000000\n\
- ldr r0, ._418 + 4 @ gPokemonStorage\n\
- ldrb r0, [r0]\n\
- sub r0, r0, #0x1\n\
- ldr r2, ._418 + 8 @ 0x8b2\n\
- add r1, r4, r2\n\
- strh r0, [r1]\n\
- cmp r0, #0\n\
- bge ._416 @cond_branch\n\
- mov r0, #0xd\n\
-._413:\n\
- strh r0, [r1]\n\
-._416:\n\
- ldrb r0, [r1]\n\
- bl sub_8099C70\n\
- mov r0, #0x2\n\
- strb r0, [r4, #0x4]\n\
- b ._466\n\
-._419:\n\
- .align 2, 0\n\
-._418:\n\
- .word 0x2000000\n\
- .word gPokemonStorage\n\
- .word 0x8b2\n\
-._372:\n\
- bl sub_809BE80\n\
- lsl r0, r0, #0x18\n\
- cmp r0, #0\n\
- bne ._428 @cond_branch\n\
- ldr r4, ._423 @ 0x2000000\n\
- ldr r1, ._423 + 4 @ 0x11f2\n\
- add r0, r4, r1\n\
- ldrh r0, [r0]\n\
- bl ItemIsMail\n\
- lsl r0, r0, #0x18\n\
- cmp r0, #0\n\
- beq ._421 @cond_branch\n\
-._392:\n\
- mov r0, #0x5\n\
- strb r0, [r4, #0x4]\n\
- b ._466\n\
-._424:\n\
- .align 2, 0\n\
-._423:\n\
- .word 0x2000000\n\
- .word 0x11f2\n\
-._421:\n\
- mov r0, #0x5\n\
- bl PlaySE\n\
- ldr r0, ._426 @ sub_809746C\n\
- bl SetPSSCallback\n\
- b ._466\n\
-._427:\n\
- .align 2, 0\n\
-._426:\n\
- .word sub_809746C+1\n\
-._374:\n\
- bl sub_809BE80\n\
- lsl r0, r0, #0x18\n\
- cmp r0, #0\n\
- bne ._428 @cond_branch\n\
- mov r0, #0x5\n\
- bl PlaySE\n\
- ldr r0, ._430 @ sub_80972A8\n\
- bl SetPSSCallback\n\
- b ._466\n\
-._431:\n\
- .align 2, 0\n\
-._430:\n\
- .word sub_80972A8+1\n\
-._375:\n\
- bl sub_809BEBC\n\
- lsl r0, r0, #0x18\n\
- cmp r0, #0\n\
- bne ._432 @cond_branch\n\
-._428:\n\
- ldr r1, ._434 @ 0x2000000\n\
- mov r0, #0x4\n\
- strb r0, [r1, #0x4]\n\
- b ._466\n\
-._435:\n\
- .align 2, 0\n\
-._434:\n\
- .word 0x2000000\n\
-._432:\n\
- mov r0, #0x5\n\
- bl PlaySE\n\
- ldr r0, ._437 @ c3_0808DC50\n\
- bl SetPSSCallback\n\
- b ._466\n\
-._438:\n\
- .align 2, 0\n\
-._437:\n\
- .word c3_0808DC50+1\n\
-._373:\n\
- mov r0, #0x5\n\
- bl PlaySE\n\
- ldr r0, ._440 @ sub_8097390\n\
- bl SetPSSCallback\n\
- b ._466\n\
-._441:\n\
- .align 2, 0\n\
-._440:\n\
- .word sub_8097390+1\n\
-._376:\n\
- mov r0, #0x5\n\
- bl PlaySE\n\
- ldr r0, ._443 @ sub_80972FC\n\
- bl SetPSSCallback\n\
- b ._466\n\
-._444:\n\
- .align 2, 0\n\
-._443:\n\
- .word sub_80972FC+1\n\
-._351:\n\
- bl sub_809AC00\n\
- lsl r0, r0, #0x18\n\
- cmp r0, #0\n\
- bne ._466 @cond_branch\n\
- bl sub_809BF48\n\
- lsl r0, r0, #0x18\n\
- cmp r0, #0\n\
- beq ._446 @cond_branch\n\
- bl sub_80986E8\n\
- b ._447\n\
-._446:\n\
- bl sub_8098710\n\
-._447:\n\
- ldr r4, ._450 @ 0x2000000\n\
- ldr r2, ._450 + 4 @ 0x11f6\n\
- add r0, r4, r2\n\
- ldrb r0, [r0]\n\
- cmp r0, #0\n\
- beq ._448 @cond_branch\n\
- bl BoxSetMosaic\n\
-._448:\n\
- mov r0, #0x0\n\
- strb r0, [r4, #0x4]\n\
- b ._466\n\
-._451:\n\
- .align 2, 0\n\
-._450:\n\
- .word 0x2000000\n\
- .word 0x11f6\n\
-._352:\n\
- bl sub_8099D34\n\
- lsl r0, r0, #0x18\n\
- cmp r0, #0\n\
- bne ._466 @cond_branch\n\
- ldr r1, ._456 @ gPokemonStorage\n\
- ldr r0, ._456 + 4 @ 0x2000000\n\
- ldr r2, ._456 + 8 @ 0x8b2\n\
- add r0, r0, r2\n\
- ldrh r0, [r0]\n\
- strb r0, [r1]\n\
- ldr r0, ._456 + 12 @ gUnknown_0203847C\n\
- ldrb r0, [r0]\n\
- cmp r0, #0\n\
- bne ._455 @cond_branch\n\
- bl sub_809BF20\n\
- lsl r0, r0, #0x18\n\
- cmp r0, #0\n\
- bne ._455 @cond_branch\n\
- bl sub_809B440\n\
- bl BoxSetMosaic\n\
- b ._455\n\
-._457:\n\
- .align 2, 0\n\
-._456:\n\
- .word gPokemonStorage\n\
- .word 0x2000000\n\
- .word 0x8b2\n\
- .word gUnknown_0203847C\n\
-._353:\n\
- ldr r0, ._460 @ gMain\n\
- ldrh r1, [r0, #0x2e]\n\
- mov r0, #0xf3\n\
- and r0, r0, r1\n\
- cmp r0, #0\n\
- beq ._466 @cond_branch\n\
- bl sub_8098A5C\n\
-._455:\n\
- ldr r1, ._460 + 4 @ 0x2000000\n\
- mov r0, #0x0\n\
- strb r0, [r1, #0x4]\n\
- b ._466\n\
-._461:\n\
- .align 2, 0\n\
-._460:\n\
- .word gMain\n\
- .word 0x2000000\n\
-._354:\n\
- mov r0, #0x20\n\
- bl PlaySE\n\
- mov r0, #0xd\n\
- b ._462\n\
-._355:\n\
- mov r0, #0x20\n\
- bl PlaySE\n\
- mov r0, #0x16\n\
-._462:\n\
- bl PrintStorageActionText\n\
- ldr r1, ._464 @ 0x2000000\n\
- mov r0, #0x6\n\
- strb r0, [r1, #0x4]\n\
- b ._466\n\
-._465:\n\
- .align 2, 0\n\
-._464:\n\
- .word 0x2000000\n\
-._356:\n\
- ldr r0, ._467 @ gMain\n\
- ldrh r1, [r0, #0x2e]\n\
- mov r0, #0xf3\n\
- and r0, r0, r1\n\
- cmp r0, #0\n\
- beq ._466 @cond_branch\n\
- bl sub_8098A5C\n\
- ldr r0, ._467 + 4 @ sub_8096C84\n\
- bl SetPSSCallback\n\
-._466:\n\
- pop {r4}\n\
- pop {r0}\n\
- bx r0\n\
-._468:\n\
- .align 2, 0\n\
-._467:\n\
- .word gMain\n\
- .word sub_8096C84+1");
-}
-#else
void sub_8096C84(void)
{
switch (gPokemonStorageSystemPtr->unk_0004)
{
- case 0:
- switch (sub_809CA40())
+ case 0:
+ switch (sub_809CA40())
+ {
+ case 1:
+ PlaySE(SE_SELECT);
+ gPokemonStorageSystemPtr->unk_0004 = 1;
+ break;
+ case 5:
+ if (gPokemonStorageSystemPtr->unk_0005 != 2)
{
- case 1:
- PlaySE(SE_SELECT);
- gPokemonStorageSystemPtr->unk_0004 = 1;
- break;
- case 5:
- if (gPokemonStorageSystemPtr->unk_0005 != 2)
- {
- PrintStorageActionText(PC_TEXT_WHICH_ONE_WILL_TAKE);
- gPokemonStorageSystemPtr->unk_0004 = 3;
- }
- else
- {
- sub_809B0D4();
- SetPSSCallback(sub_8096FC8);
- }
- break;
- case 6:
- if (gPokemonStorageSystemPtr->unk_0005 == 2)
- {
- if (sub_809BF20() && ItemIsMail(gPokemonStorageSystemPtr->unk_11f2))
- {
- gPokemonStorageSystemPtr->unk_0004 = 5;
- }
- else
- {
- SetPSSCallback(sub_8097004);
- }
- }
- break;
- case 4:
- SetPSSCallback(sub_8097BA0);
- break;
- case 16:
- SetPSSCallback(sub_8097CC0);
- break;
- case 7:
- PlaySE(SE_SELECT);
- SetPSSCallback(sub_809789C);
- break;
- case 8:
- PlaySE(SE_SELECT);
- SetPSSCallback(sub_8097078);
- break;
- case 9:
- PlaySE(SE_SELECT);
- gPokemonStorageSystemPtr->unk_08b2 = gPokemonStorage.currentBox + 1;
- if (gPokemonStorageSystemPtr->unk_08b2 > 13)
- gPokemonStorageSystemPtr->unk_08b2 = 0;
- sub_8099C70(gPokemonStorageSystemPtr->unk_08b2);
- gPokemonStorageSystemPtr->unk_0004 = 2;
- break;
- case 10:
- PlaySE(SE_SELECT);
- gPokemonStorageSystemPtr->unk_08b2 = gPokemonStorage.currentBox - 1;
- if (gPokemonStorageSystemPtr->unk_08b2 < 0)
- gPokemonStorageSystemPtr->unk_08b2 = 13;
- sub_8099C70(gPokemonStorageSystemPtr->unk_08b2);
- gPokemonStorageSystemPtr->unk_0004 = 2;
- break;
- case 11:
- if (!sub_809BE80())
- {
- if (ItemIsMail(gPokemonStorageSystemPtr->unk_11f2))
- {
- gPokemonStorageSystemPtr->unk_0004 = 5;
- }
- else
- {
- PlaySE(SE_SELECT);
- SetPSSCallback(sub_809746C);
- }
- }
- else
- {
- gPokemonStorageSystemPtr->unk_0004 = 4;
- }
- break;
- case 13:
- if (sub_809BE80())
- {
- gPokemonStorageSystemPtr->unk_0004 = 4;
- }
- else
- {
- PlaySE(SE_SELECT);
- SetPSSCallback(sub_80972A8);
- }
- break;
- case 14:
- if (!sub_809BEBC())
- {
- gPokemonStorageSystemPtr->unk_0004 = 4;
- }
- else
- {
- PlaySE(SE_SELECT);
- SetPSSCallback(c3_0808DC50);
- }
- break;
- case 12:
- PlaySE(SE_SELECT);
- SetPSSCallback(sub_8097390);
- break;
- case 15:
- PlaySE(SE_SELECT);
- SetPSSCallback(sub_80972FC);
- break;
+ PrintStorageActionText(PC_TEXT_WHICH_ONE_WILL_TAKE);
+ gPokemonStorageSystemPtr->unk_0004 = 3;
+ }
+ else
+ {
+ sub_809B0D4();
+ SetPSSCallback(sub_8096FC8);
}
break;
- case 1:
- if (!sub_809AC00())
+ case 6:
+ if (gPokemonStorageSystemPtr->unk_0005 == 2)
{
- if (sub_809BF48())
- sub_80986E8();
+ if (sub_809BF20() && ItemIsMail(gPokemonStorageSystemPtr->unk_11f2))
+ gPokemonStorageSystemPtr->unk_0004 = 5;
else
- sub_8098710();
- if (gPokemonStorageSystemPtr->unk_11f6)
- BoxSetMosaic();
- gPokemonStorageSystemPtr->unk_0004 = 0;
+ SetPSSCallback(sub_8097004);
}
break;
- case 2:
- if (!sub_8099D34())
+ case 4:
+#if DEBUG
+ if (unk_2038790 != 0)
+ break;
+#endif
+ SetPSSCallback(sub_8097BA0);
+ break;
+ case 16:
+#if DEBUG
+ if (unk_2038790 != 0)
+ break;
+#endif
+ SetPSSCallback(sub_8097CC0);
+ break;
+ case 7:
+ PlaySE(SE_SELECT);
+ SetPSSCallback(sub_809789C);
+ break;
+ case 8:
+ PlaySE(SE_SELECT);
+ SetPSSCallback(sub_8097078);
+ break;
+ case 9:
+ PlaySE(SE_SELECT);
+ gPokemonStorageSystemPtr->unk_08b2 = gPokemonStorage.currentBox + 1;
+ if (gPokemonStorageSystemPtr->unk_08b2 > 13)
+ gPokemonStorageSystemPtr->unk_08b2 = 0;
+ sub_8099C70(gPokemonStorageSystemPtr->unk_08b2);
+ gPokemonStorageSystemPtr->unk_0004 = 2;
+ break;
+ case 10:
+ PlaySE(SE_SELECT);
+ gPokemonStorageSystemPtr->unk_08b2 = gPokemonStorage.currentBox - 1;
+ if (gPokemonStorageSystemPtr->unk_08b2 < 0)
+ gPokemonStorageSystemPtr->unk_08b2 = 13;
+ sub_8099C70(gPokemonStorageSystemPtr->unk_08b2);
+ gPokemonStorageSystemPtr->unk_0004 = 2;
+ break;
+ case 11:
+ if (!sub_809BE80())
{
- gPokemonStorage.currentBox = gPokemonStorageSystemPtr->unk_08b2;
- if (!gUnknown_0203847C && !sub_809BF20())
+ if (ItemIsMail(gPokemonStorageSystemPtr->unk_11f2))
{
- sub_809B440();
- BoxSetMosaic();
+ gPokemonStorageSystemPtr->unk_0004 = 5;
+ }
+ else
+ {
+ PlaySE(SE_SELECT);
+ SetPSSCallback(sub_809746C);
}
- gPokemonStorageSystemPtr->unk_0004 = 0;
+ }
+ else
+ {
+ gPokemonStorageSystemPtr->unk_0004 = 4;
}
break;
- case 3:
- if (gMain.newKeys & (A_BUTTON | B_BUTTON | DPAD_ANY))
+ case 13:
+ if (sub_809BE80())
{
- sub_8098A5C();
- gPokemonStorageSystemPtr->unk_0004 = 0;
+ gPokemonStorageSystemPtr->unk_0004 = 4;
+ }
+ else
+ {
+ PlaySE(SE_SELECT);
+ SetPSSCallback(sub_80972A8);
}
break;
- case 4:
- PlaySE(SE_HAZURE);
- PrintStorageActionText(PC_TEXT_LAST_POKE);
- gPokemonStorageSystemPtr->unk_0004 = 6;
+ case 14:
+ if (!sub_809BEBC())
+ {
+ gPokemonStorageSystemPtr->unk_0004 = 4;
+ }
+ else
+ {
+ PlaySE(SE_SELECT);
+ SetPSSCallback(c3_0808DC50);
+ }
break;
- case 5:
- PlaySE(SE_HAZURE);
- PrintStorageActionText(PC_TEXT_PLEASE_REMOVE_MAIL);
- gPokemonStorageSystemPtr->unk_0004 = 6;
+ case 12:
+ PlaySE(SE_SELECT);
+ SetPSSCallback(sub_8097390);
break;
- case 6:
- if (gMain.newKeys & (A_BUTTON | B_BUTTON | DPAD_ANY))
+ case 15:
+ PlaySE(SE_SELECT);
+ SetPSSCallback(sub_80972FC);
+ break;
+ }
+ break;
+ case 1:
+ if (!sub_809AC00())
+ {
+ if (sub_809BF48())
+ sub_80986E8();
+ else
+ sub_8098710();
+ if (gPokemonStorageSystemPtr->unk_11f6)
+ BoxSetMosaic();
+ gPokemonStorageSystemPtr->unk_0004 = 0;
+ }
+ break;
+ case 2:
+ if (!sub_8099D34())
+ {
+ gPokemonStorage.currentBox = gPokemonStorageSystemPtr->unk_08b2;
+ if (!gUnknown_0203847C && !sub_809BF20())
{
- sub_8098A5C();
- SetPSSCallback(sub_8096C84);
+ sub_809B440();
+ BoxSetMosaic();
}
- break;
+ gPokemonStorageSystemPtr->unk_0004 = 0;
+ }
+ break;
+ case 3:
+ if (gMain.newKeys & (A_BUTTON | B_BUTTON | DPAD_ANY))
+ {
+ sub_8098A5C();
+ gPokemonStorageSystemPtr->unk_0004 = 0;
+ }
+ break;
+ case 4:
+ PlaySE(SE_HAZURE);
+ PrintStorageActionText(PC_TEXT_LAST_POKE);
+ gPokemonStorageSystemPtr->unk_0004 = 6;
+ break;
+ case 5:
+ PlaySE(SE_HAZURE);
+ PrintStorageActionText(PC_TEXT_PLEASE_REMOVE_MAIL);
+ gPokemonStorageSystemPtr->unk_0004 = 6;
+ break;
+ case 6:
+ if (gMain.newKeys & (A_BUTTON | B_BUTTON | DPAD_ANY))
+ {
+ sub_8098A5C();
+ SetPSSCallback(sub_8096C84);
+ }
+ break;
}
}
-#endif
void sub_8096FC8(void)
{
@@ -1280,456 +647,151 @@ void sub_8097004(void)
}
}
-#if DEBUG
-__attribute__((naked))
-void sub_8097078(void)
-{
- asm("\
- push {r4, lr}\n\
- ldr r0, ._495 @ 0x2000000\n\
- ldrb r0, [r0, #0x4]\n\
- cmp r0, #0x5\n\
- bls ._493 @cond_branch\n\
- b ._597\n\
-._493:\n\
- lsl r0, r0, #0x2\n\
- ldr r1, ._495 + 4 @ \n\
- add r0, r0, r1\n\
- ldr r0, [r0]\n\
- mov pc, r0\n\
-._496:\n\
- .align 2, 0\n\
-._495:\n\
- .word 0x2000000\n\
- .word ._497\n\
-._497:\n\
- .word ._498\n\
- .word ._499\n\
- .word ._500\n\
- .word ._501\n\
- .word ._502\n\
- .word ._503\n\
-._498:\n\
- mov r0, #0x4\n\
- bl PrintStorageActionText\n\
- bl sub_809CE84\n\
- ldr r1, ._505 @ 0x2000000\n\
- mov r0, #0x1\n\
- strb r0, [r1, #0x4]\n\
- b ._597\n\
-._506:\n\
- .align 2, 0\n\
-._505:\n\
- .word 0x2000000\n\
-._499:\n\
- bl sub_809CF30\n\
- add r0, r0, #0x1\n\
- lsl r0, r0, #0x10\n\
- asr r0, r0, #0x10\n\
- cmp r0, #0x21\n\
- bls ._507 @cond_branch\n\
- b ._597\n\
-._507:\n\
- lsl r0, r0, #0x2\n\
- ldr r1, ._510 @ \n\
- add r0, r0, r1\n\
- ldr r0, [r0]\n\
- mov pc, r0\n\
-._511:\n\
- .align 2, 0\n\
-._510:\n\
- .word ._509\n\
-._509:\n\
- .word ._513\n\
- .word ._513\n\
- .word ._514\n\
- .word ._515\n\
- .word ._516\n\
- .word ._517\n\
- .word ._518\n\
- .word ._519\n\
- .word ._520\n\
- .word ._521\n\
- .word ._597\n\
- .word ._597\n\
- .word ._597\n\
- .word ._597\n\
- .word ._597\n\
- .word ._597\n\
- .word ._597\n\
- .word ._597\n\
- .word ._597\n\
- .word ._597\n\
- .word ._597\n\
- .word ._597\n\
- .word ._597\n\
- .word ._597\n\
- .word ._597\n\
- .word ._597\n\
- .word ._597\n\
- .word ._597\n\
- .word ._597\n\
- .word ._597\n\
- .word ._597\n\
- .word ._597\n\
- .word ._597\n\
- .word ._545\n\
-._513:\n\
- bl sub_8098A5C\n\
- ldr r0, ._547 @ sub_8096C84\n\
- bl SetPSSCallback\n\
- b ._597\n\
-._548:\n\
- .align 2, 0\n\
-._547:\n\
- .word sub_8096C84+1\n\
-._516:\n\
- bl sub_809BE80\n\
- lsl r0, r0, #0x18\n\
- cmp r0, #0\n\
- bne ._563 @cond_branch\n\
- mov r0, #0x5\n\
- bl PlaySE\n\
- bl sub_8098A5C\n\
- ldr r0, ._551 @ sub_80972A8\n\
- bl SetPSSCallback\n\
- b ._597\n\
-._552:\n\
- .align 2, 0\n\
-._551:\n\
- .word sub_80972A8+1\n\
-._518:\n\
- mov r0, #0x5\n\
- bl PlaySE\n\
- bl sub_8098A5C\n\
- ldr r0, ._554 @ sub_80972FC\n\
- bl SetPSSCallback\n\
- b ._597\n\
-._555:\n\
- .align 2, 0\n\
-._554:\n\
- .word sub_80972FC+1\n\
-._517:\n\
- bl sub_809BEBC\n\
- lsl r0, r0, #0x18\n\
- cmp r0, #0\n\
- beq ._563 @cond_branch\n\
- mov r0, #0x5\n\
- bl PlaySE\n\
- bl sub_8098A5C\n\
- ldr r0, ._558 @ c3_0808DC50\n\
- bl SetPSSCallback\n\
- b ._597\n\
-._559:\n\
- .align 2, 0\n\
-._558:\n\
- .word c3_0808DC50+1\n\
-._515:\n\
- mov r0, #0x5\n\
- bl PlaySE\n\
- bl sub_8098A5C\n\
- ldr r0, ._561 @ sub_8097390\n\
- bl SetPSSCallback\n\
- b ._597\n\
-._562:\n\
- .align 2, 0\n\
-._561:\n\
- .word sub_8097390+1\n\
-._514:\n\
- bl sub_809BE80\n\
- lsl r0, r0, #0x18\n\
- cmp r0, #0\n\
- bne ._563 @cond_branch\n\
- ldr r4, ._566 @ 0x2000000\n\
- ldr r1, ._566 + 4 @ 0x11f2\n\
- add r0, r4, r1\n\
- ldrh r0, [r0]\n\
- bl ItemIsMail\n\
- lsl r0, r0, #0x18\n\
- cmp r0, #0\n\
- bne ._564 @cond_branch\n\
- mov r0, #0x5\n\
- bl PlaySE\n\
- bl sub_8098A5C\n\
- ldr r0, ._566 + 8 @ sub_809746C\n\
- bl SetPSSCallback\n\
- b ._597\n\
-._567:\n\
- .align 2, 0\n\
-._566:\n\
- .word 0x2000000\n\
- .word 0x11f2\n\
- .word sub_809746C+1\n\
-._520:\n\
- bl sub_809BE80\n\
- lsl r0, r0, #0x18\n\
- cmp r0, #0\n\
- beq ._568 @cond_branch\n\
-._563:\n\
- ldr r1, ._570 @ 0x2000000\n\
- mov r0, #0x2\n\
- strb r0, [r1, #0x4]\n\
- b ._597\n\
-._571:\n\
- .align 2, 0\n\
-._570:\n\
- .word 0x2000000\n\
-._568:\n\
- ldr r4, ._574 @ 0x2000000\n\
- ldr r1, ._574 + 4 @ 0x11f9\n\
- add r0, r4, r1\n\
- ldrb r0, [r0]\n\
- cmp r0, #0\n\
- beq ._572 @cond_branch\n\
- mov r0, #0x4\n\
- strb r0, [r4, #0x4]\n\
- b ._597\n\
-._575:\n\
- .align 2, 0\n\
-._574:\n\
- .word 0x2000000\n\
- .word 0x11f9\n\
-._572:\n\
- ldr r1, ._578 @ 0x11f2\n\
- add r0, r4, r1\n\
- ldrh r0, [r0]\n\
- bl ItemIsMail\n\
- lsl r0, r0, #0x18\n\
- cmp r0, #0\n\
- beq ._576 @cond_branch\n\
-._564:\n\
- mov r0, #0x3\n\
- strb r0, [r4, #0x4]\n\
- b ._597\n\
-._579:\n\
- .align 2, 0\n\
-._578:\n\
- .word 0x11f2\n\
-._576:\n\
- mov r0, #0x5\n\
- bl PlaySE\n\
- ldr r0, ._581 @ sub_8097594\n\
- bl SetPSSCallback\n\
- b ._597\n\
-._582:\n\
- .align 2, 0\n\
-._581:\n\
- .word sub_8097594+1\n\
-._519:\n\
- mov r0, #0x5\n\
- bl PlaySE\n\
- ldr r0, ._584 @ sub_8097788\n\
- bl SetPSSCallback\n\
- b ._597\n\
-._585:\n\
- .align 2, 0\n\
-._584:\n\
- .word sub_8097788+1\n\
-._521:\n\
- mov r0, #0x5\n\
- bl PlaySE\n\
- ldr r0, ._587 @ sub_80977E4\n\
- bl SetPSSCallback\n\
- b ._597\n\
-._588:\n\
- .align 2, 0\n\
-._587:\n\
- .word sub_80977E4+1\n\
-._545:\n\
- mov r0, #0x5\n\
- bl PlaySE\n\
- bl sub_8098A5C\n\
- ldr r0, ._590 @ debug_sub_80A435C\n\
- bl SetPSSCallback\n\
- b ._597\n\
-._591:\n\
- .align 2, 0\n\
-._590:\n\
- .word debug_sub_80A435C+1\n\
-._500:\n\
- mov r0, #0x20\n\
- bl PlaySE\n\
- mov r0, #0xd\n\
- b ._593\n\
-._502:\n\
- mov r0, #0x20\n\
- bl PlaySE\n\
- mov r0, #0x11\n\
- b ._593\n\
-._501:\n\
- mov r0, #0x20\n\
- bl PlaySE\n\
- mov r0, #0x16\n\
-._593:\n\
- bl PrintStorageActionText\n\
- ldr r1, ._595 @ 0x2000000\n\
- mov r0, #0x5\n\
- strb r0, [r1, #0x4]\n\
- b ._597\n\
-._596:\n\
- .align 2, 0\n\
-._595:\n\
- .word 0x2000000\n\
-._503:\n\
- ldr r0, ._598 @ gMain\n\
- ldrh r1, [r0, #0x2e]\n\
- mov r0, #0xf3\n\
- and r0, r0, r1\n\
- cmp r0, #0\n\
- beq ._597 @cond_branch\n\
- bl sub_8098A5C\n\
- ldr r0, ._598 + 4 @ sub_8096C84\n\
- bl SetPSSCallback\n\
-._597:\n\
- pop {r4}\n\
- pop {r0}\n\
- bx r0\n\
-._599:\n\
- .align 2, 0\n\
-._598:\n\
- .word gMain\n\
- .word sub_8096C84+1");
-}
-#else
void sub_8097078(void)
{
switch (gPokemonStorageSystemPtr->unk_0004)
{
- case 0:
- PrintStorageActionText(PC_TEXT_IS_SELECTED);
- sub_809CE84();
- gPokemonStorageSystemPtr->unk_0004 = 1;
+ case 0:
+ PrintStorageActionText(PC_TEXT_IS_SELECTED);
+ sub_809CE84();
+ gPokemonStorageSystemPtr->unk_0004 = 1;
+ break;
+ case 1:
+ switch (sub_809CF30())
+ {
+ case -1:
+ case 0:
+ sub_8098A5C();
+ SetPSSCallback(sub_8096C84);
break;
- case 1:
- switch (sub_809CF30())
+ case 3:
+ if (sub_809BE80())
{
- case -1:
- case 0:
- sub_8098A5C();
- SetPSSCallback(sub_8096C84);
- break;
- case 3:
- if (sub_809BE80())
- {
- gPokemonStorageSystemPtr->unk_0004 = 2;
- }
- else
- {
- PlaySE(SE_SELECT);
- sub_8098A5C();
- SetPSSCallback(sub_80972A8);
- }
- break;
- case 5:
- PlaySE(SE_SELECT);
- sub_8098A5C();
- SetPSSCallback(sub_80972FC);
- break;
- case 4:
- if (!sub_809BEBC())
- {
- gPokemonStorageSystemPtr->unk_0004 = 2;
- }
- else
- {
- PlaySE(SE_SELECT);
- sub_8098A5C();
- SetPSSCallback(c3_0808DC50);
- }
- break;
- case 2:
- PlaySE(SE_SELECT);
- sub_8098A5C();
- SetPSSCallback(sub_8097390);
- break;
- case 1:
- if (sub_809BE80())
- {
- gPokemonStorageSystemPtr->unk_0004 = 2;
- }
- else if (ItemIsMail(gPokemonStorageSystemPtr->unk_11f2))
- {
- gPokemonStorageSystemPtr->unk_0004 = 3;
- }
- else
- {
- PlaySE(SE_SELECT);
- sub_8098A5C();
- SetPSSCallback(sub_809746C);
- }
- break;
- case 7:
- if (sub_809BE80())
- {
- gPokemonStorageSystemPtr->unk_0004 = 2;
- }
- else if (gPokemonStorageSystemPtr->unk_11f9)
- {
- gPokemonStorageSystemPtr->unk_0004 = 4;
- }
- else if (ItemIsMail(gPokemonStorageSystemPtr->unk_11f2))
- {
- gPokemonStorageSystemPtr->unk_0004 = 3;
- }
- else
- {
- PlaySE(SE_SELECT);
- SetPSSCallback(sub_8097594);
- }
- break;
- case 6:
- PlaySE(SE_SELECT);
- SetPSSCallback(sub_8097788);
- break;
- case 8:
- PlaySE(SE_SELECT);
- SetPSSCallback(sub_80977E4);
- break;
+ gPokemonStorageSystemPtr->unk_0004 = 2;
+ }
+ else
+ {
+ PlaySE(SE_SELECT);
+ sub_8098A5C();
+ SetPSSCallback(sub_80972A8);
}
break;
- case 2:
- PlaySE(SE_HAZURE);
- PrintStorageActionText(PC_TEXT_LAST_POKE);
- gPokemonStorageSystemPtr->unk_0004 = 5;
+ case 5:
+ PlaySE(SE_SELECT);
+ sub_8098A5C();
+ SetPSSCallback(sub_80972FC);
break;
case 4:
- PlaySE(SE_HAZURE);
- PrintStorageActionText(PC_TEXT_CANT_RELEASE_EGG);
- gPokemonStorageSystemPtr->unk_0004 = 5;
+ if (!sub_809BEBC())
+ {
+ gPokemonStorageSystemPtr->unk_0004 = 2;
+ }
+ else
+ {
+ PlaySE(SE_SELECT);
+ sub_8098A5C();
+ SetPSSCallback(c3_0808DC50);
+ }
break;
- case 3:
- PlaySE(SE_HAZURE);
- PrintStorageActionText(PC_TEXT_PLEASE_REMOVE_MAIL);
- gPokemonStorageSystemPtr->unk_0004 = 5;
+ case 2:
+ PlaySE(SE_SELECT);
+ sub_8098A5C();
+ SetPSSCallback(sub_8097390);
break;
- case 5:
- if (gMain.newKeys & (A_BUTTON | B_BUTTON | DPAD_ANY))
+ case 1:
+ if (sub_809BE80())
+ {
+ gPokemonStorageSystemPtr->unk_0004 = 2;
+ }
+ else if (ItemIsMail(gPokemonStorageSystemPtr->unk_11f2))
+ {
+ gPokemonStorageSystemPtr->unk_0004 = 3;
+ }
+ else
{
+ PlaySE(SE_SELECT);
sub_8098A5C();
- SetPSSCallback(sub_8096C84);
+ SetPSSCallback(sub_809746C);
}
break;
+ case 7:
+ if (sub_809BE80())
+ {
+ gPokemonStorageSystemPtr->unk_0004 = 2;
+ }
+ else if (gPokemonStorageSystemPtr->unk_11f9)
+ {
+ gPokemonStorageSystemPtr->unk_0004 = 4;
+ }
+ else if (ItemIsMail(gPokemonStorageSystemPtr->unk_11f2))
+ {
+ gPokemonStorageSystemPtr->unk_0004 = 3;
+ }
+ else
+ {
+ PlaySE(SE_SELECT);
+ SetPSSCallback(sub_8097594);
+ }
+ break;
+ case 6:
+ PlaySE(SE_SELECT);
+ SetPSSCallback(sub_8097788);
+ break;
+ case 8:
+ PlaySE(SE_SELECT);
+ SetPSSCallback(sub_80977E4);
+ break;
+#if DEBUG
+ case 32:
+ PlaySE(SE_SELECT);
+ sub_8098A5C();
+ SetPSSCallback(debug_sub_80A435C);
+ break;
+#endif
+ }
+ break;
+ case 2:
+ PlaySE(SE_HAZURE);
+ PrintStorageActionText(PC_TEXT_LAST_POKE);
+ gPokemonStorageSystemPtr->unk_0004 = 5;
+ break;
+ case 4:
+ PlaySE(SE_HAZURE);
+ PrintStorageActionText(PC_TEXT_CANT_RELEASE_EGG);
+ gPokemonStorageSystemPtr->unk_0004 = 5;
+ break;
+ case 3:
+ PlaySE(SE_HAZURE);
+ PrintStorageActionText(PC_TEXT_PLEASE_REMOVE_MAIL);
+ gPokemonStorageSystemPtr->unk_0004 = 5;
+ break;
+ case 5:
+ if (gMain.newKeys & (A_BUTTON | B_BUTTON | DPAD_ANY))
+ {
+ sub_8098A5C();
+ SetPSSCallback(sub_8096C84);
+ }
+ break;
}
}
-#endif
void sub_80972A8(void)
{
switch (gPokemonStorageSystemPtr->unk_0004)
{
- case 0:
- sub_809B100(0);
- gPokemonStorageSystemPtr->unk_0004++;
- break;
- case 1:
- if (!sub_809B130())
- {
- if (gUnknown_0203847C)
- SetPSSCallback(sub_8097858);
- else
- SetPSSCallback(sub_8096C84);
- }
- break;
+ case 0:
+ sub_809B100(0);
+ gPokemonStorageSystemPtr->unk_0004++;
+ break;
+ case 1:
+ if (!sub_809B130())
+ {
+ if (gUnknown_0203847C)
+ SetPSSCallback(sub_8097858);
+ else
+ SetPSSCallback(sub_8096C84);
+ }
+ break;
}
}
@@ -1737,19 +799,19 @@ void sub_80972FC(void)
{
switch (gPokemonStorageSystemPtr->unk_0004)
{
- case 0:
- sub_809B100(1);
- gPokemonStorageSystemPtr->unk_0004++;
- break;
- case 1:
- if (!sub_809B130())
- {
- if (gUnknown_0203847C)
- SetPSSCallback(sub_8097858);
- else
- SetPSSCallback(sub_8096C84);
- }
- break;
+ case 0:
+ sub_809B100(1);
+ gPokemonStorageSystemPtr->unk_0004++;
+ break;
+ case 1:
+ if (!sub_809B130())
+ {
+ if (gUnknown_0203847C)
+ SetPSSCallback(sub_8097858);
+ else
+ SetPSSCallback(sub_8096C84);
+ }
+ break;
}
}
@@ -1757,17 +819,17 @@ void c3_0808DC50(void)
{
switch (gPokemonStorageSystemPtr->unk_0004)
{
- case 0:
- sub_809B100(2);
- gPokemonStorageSystemPtr->unk_0004++;
- break;
- case 1:
- if (!sub_809B130())
- {
- BoxSetMosaic();
- SetPSSCallback(sub_8096C84);
- }
- break;
+ case 0:
+ sub_809B100(2);
+ gPokemonStorageSystemPtr->unk_0004++;
+ break;
+ case 1:
+ if (!sub_809B130())
+ {
+ BoxSetMosaic();
+ SetPSSCallback(sub_8096C84);
+ }
+ break;
}
}
@@ -1775,50 +837,50 @@ void sub_8097390(void)
{
switch (gPokemonStorageSystemPtr->unk_0004)
{
- case 0:
- if (CalculatePlayerPartyCount() == 6)
- {
- PrintStorageActionText(PC_TEXT_PARTY_FULL);
- gPokemonStorageSystemPtr->unk_0004 = 1;
- }
- else
- {
- sub_809B0E0();
- sub_809B100(0);
- gPokemonStorageSystemPtr->unk_0004 = 2;
- }
- break;
- case 1:
- if (gMain.newKeys & (A_BUTTON | B_BUTTON | DPAD_ANY))
- {
- sub_8098A5C();
- SetPSSCallback(sub_8096C84);
- }
- break;
- case 2:
- if (!sub_809B130())
- {
- sub_809880C();
- gPokemonStorageSystemPtr->unk_0004++;
- }
- break;
- case 3:
- if (!sub_8098830())
- {
- sub_809B100(1);
- gPokemonStorageSystemPtr->unk_0004++;
- }
- break;
- case 4:
- if (!sub_809B130())
- {
- sub_80987DC();
- gPokemonStorageSystemPtr->unk_0004++;
- }
- break;
- case 5:
- SetPSSCallback(sub_8097004);
- break;
+ case 0:
+ if (CalculatePlayerPartyCount() == 6)
+ {
+ PrintStorageActionText(PC_TEXT_PARTY_FULL);
+ gPokemonStorageSystemPtr->unk_0004 = 1;
+ }
+ else
+ {
+ sub_809B0E0();
+ sub_809B100(0);
+ gPokemonStorageSystemPtr->unk_0004 = 2;
+ }
+ break;
+ case 1:
+ if (gMain.newKeys & (A_BUTTON | B_BUTTON | DPAD_ANY))
+ {
+ sub_8098A5C();
+ SetPSSCallback(sub_8096C84);
+ }
+ break;
+ case 2:
+ if (!sub_809B130())
+ {
+ sub_809880C();
+ gPokemonStorageSystemPtr->unk_0004++;
+ }
+ break;
+ case 3:
+ if (!sub_8098830())
+ {
+ sub_809B100(1);
+ gPokemonStorageSystemPtr->unk_0004++;
+ }
+ break;
+ case 4:
+ if (!sub_809B130())
+ {
+ sub_80987DC();
+ gPokemonStorageSystemPtr->unk_0004++;
+ }
+ break;
+ case 5:
+ SetPSSCallback(sub_8097004);
+ break;
}
}
@@ -1828,60 +890,60 @@ void sub_809746C(void)
switch (gPokemonStorageSystemPtr->unk_0004)
{
- case 0:
- PrintStorageActionText(PC_TEXT_DEPOSIT_IN_WHICH_BOX);
- sub_8096264(&gPokemonStorageSystemPtr->unk_2370, 0x0007, 0xdaca, 3);
- sub_809634C(gUnknown_0203847E);
- gPokemonStorageSystemPtr->unk_0004++;
- break;
- case 1:
- r4 = sub_8096368();
- if (r4 == 200);
- else if (r4 == 201)
+ case 0:
+ PrintStorageActionText(PC_TEXT_DEPOSIT_IN_WHICH_BOX);
+ sub_8096264(&gPokemonStorageSystemPtr->unk_2370, 0x0007, 0xdaca, 3);
+ sub_809634C(gUnknown_0203847E);
+ gPokemonStorageSystemPtr->unk_0004++;
+ break;
+ case 1:
+ r4 = sub_8096368();
+ if (r4 == 200);
+ else if (r4 == 201)
+ {
+ sub_8098A5C();
+ sub_809635C();
+ sub_8096310();
+ SetPSSCallback(sub_8096C84);
+ }
+ else
+ {
+ if (sub_809B62C(r4))
{
sub_8098A5C();
sub_809635C();
sub_8096310();
- SetPSSCallback(sub_8096C84);
+ gPokemonStorageSystemPtr->unk_0004 = 2;
}
else
{
- if (sub_809B62C(r4))
- {
- sub_8098A5C();
- sub_809635C();
- sub_8096310();
- gPokemonStorageSystemPtr->unk_0004 = 2;
- }
- else
- {
- PrintStorageActionText(PC_TEXT_BOX_IS_FULL);
- gPokemonStorageSystemPtr->unk_0004 = 4;
- }
- gUnknown_0203847E = r4;
- }
- break;
- case 2:
- party_compaction();
- sub_8099310();
- gPokemonStorageSystemPtr->unk_0004++;
- break;
- case 3:
- if (sub_8099374() == 0)
- {
- sub_809B6BC();
- BoxSetMosaic();
- sub_80987DC();
- SetPSSCallback(sub_8096C84);
- }
- break;
- case 4:
- if (gMain.newKeys & (A_BUTTON | B_BUTTON))
- {
- PrintStorageActionText(PC_TEXT_DEPOSIT_IN_WHICH_BOX);
- gPokemonStorageSystemPtr->unk_0004 = 1;
+ PrintStorageActionText(PC_TEXT_BOX_IS_FULL);
+ gPokemonStorageSystemPtr->unk_0004 = 4;
}
- break;
+ gUnknown_0203847E = r4;
+ }
+ break;
+ case 2:
+ party_compaction();
+ sub_8099310();
+ gPokemonStorageSystemPtr->unk_0004++;
+ break;
+ case 3:
+ if (sub_8099374() == 0)
+ {
+ sub_809B6BC();
+ BoxSetMosaic();
+ sub_80987DC();
+ SetPSSCallback(sub_8096C84);
+ }
+ break;
+ case 4:
+ if (gMain.newKeys & (A_BUTTON | B_BUTTON))
+ {
+ PrintStorageActionText(PC_TEXT_DEPOSIT_IN_WHICH_BOX);
+ gPokemonStorageSystemPtr->unk_0004 = 1;
+ }
+ break;
}
}
@@ -1889,129 +951,129 @@ void sub_8097594(void)
{
switch (gPokemonStorageSystemPtr->unk_0004)
{
- case 0:
- PrintStorageActionText(PC_TEXT_RELEASE_POKE);
- sub_8098A38(1);
- gPokemonStorageSystemPtr->unk_0004++;
- // fallthrough
- case 1:
- switch (Menu_ProcessInputNoWrap())
- {
- case -1:
- case 1:
- sub_8098A5C();
- SetPSSCallback(sub_8096C84);
- break;
- case 0:
- sub_8098A5C();
- sub_809B7D4();
- sub_809B6DC();
- gPokemonStorageSystemPtr->unk_0004++;
- break;
- }
- break;
- case 2:
- sub_809B960();
- if (!sub_809B734())
- {
- while (1)
- {
- s8 r0 = sub_809B960();
- if (r0 == 1)
- {
- gPokemonStorageSystemPtr->unk_0004++;
- break;
- }
- if (r0 == 0)
- {
- gPokemonStorageSystemPtr->unk_0004 = 8;
- break;
- }
- }
- }
- break;
- case 3:
- sub_809B760();
- sub_809801C();
- PrintStorageActionText(PC_TEXT_WAS_RELEASED);
- gPokemonStorageSystemPtr->unk_0004++;
- break;
- case 4:
- if (gMain.newKeys & (A_BUTTON | B_BUTTON))
- {
- PrintStorageActionText(PC_TEXT_BYE_BYE);
+ case 0:
+ PrintStorageActionText(PC_TEXT_RELEASE_POKE);
+ sub_8098A38(1);
+ gPokemonStorageSystemPtr->unk_0004++;
+ // fallthrough
+ case 1:
+ switch (Menu_ProcessInputNoWrap())
+ {
+ case -1:
+ case 1:
+ sub_8098A5C();
+ SetPSSCallback(sub_8096C84);
+ break;
+ case 0:
+ sub_8098A5C();
+ sub_809B7D4();
+ sub_809B6DC();
gPokemonStorageSystemPtr->unk_0004++;
- }
- break;
- case 5:
- if (gMain.newKeys & (A_BUTTON | B_BUTTON))
+ break;
+ }
+ break;
+ case 2:
+ sub_809B960();
+ if (!sub_809B734())
+ {
+ while (1)
{
- sub_8098A5C();
- if (gUnknown_0203847C)
+ s8 r0 = sub_809B960();
+ if (r0 == 1)
{
- party_compaction();
- sub_8099310();
gPokemonStorageSystemPtr->unk_0004++;
+ break;
}
- else
+ if (r0 == 0)
{
- gPokemonStorageSystemPtr->unk_0004 = 7;
+ gPokemonStorageSystemPtr->unk_0004 = 8;
+ break;
}
}
- break;
- case 6:
- if (sub_8099374() == 0)
- {
- sub_809B440();
- BoxSetMosaic();
- sub_80987DC();
- gPokemonStorageSystemPtr->unk_0004++;
- }
- break;
- case 7:
- SetPSSCallback(sub_8096C84);
- break;
- case 8:
- PrintStorageActionText(PC_TEXT_WAS_RELEASED);
+ }
+ break;
+ case 3:
+ sub_809B760();
+ sub_809801C();
+ PrintStorageActionText(PC_TEXT_WAS_RELEASED);
+ gPokemonStorageSystemPtr->unk_0004++;
+ break;
+ case 4:
+ if (gMain.newKeys & (A_BUTTON | B_BUTTON))
+ {
+ PrintStorageActionText(PC_TEXT_BYE_BYE);
gPokemonStorageSystemPtr->unk_0004++;
- break;
- case 9:
- if (gMain.newKeys & (A_BUTTON | B_BUTTON))
- {
- PrintStorageActionText(PC_TEXT_SURPRISE);
- gPokemonStorageSystemPtr->unk_0004++;
- }
- break;
- case 10:
- if (gMain.newKeys & (A_BUTTON | B_BUTTON))
- {
- sub_8098A5C();
- sub_8099958();
- gPokemonStorageSystemPtr->unk_0004++;
- }
- break;
- case 11:
- if (!sub_8099990())
- {
- sub_809B7AC();
- PrintStorageActionText(PC_TEXT_CAME_BACK);
- gPokemonStorageSystemPtr->unk_0004++;
- }
- break;
- case 12:
- if (gMain.newKeys & (A_BUTTON | B_BUTTON))
+ }
+ break;
+ case 5:
+ if (gMain.newKeys & (A_BUTTON | B_BUTTON))
+ {
+ sub_8098A5C();
+ if (gUnknown_0203847C)
{
- PrintStorageActionText(PC_TEXT_WORRIED);
+ party_compaction();
+ sub_8099310();
gPokemonStorageSystemPtr->unk_0004++;
}
- break;
- case 13:
- if (gMain.newKeys & (A_BUTTON | B_BUTTON))
+ else
{
- sub_8098A5C();
- SetPSSCallback(sub_8096C84);
+ gPokemonStorageSystemPtr->unk_0004 = 7;
}
- break;
+ }
+ break;
+ case 6:
+ if (sub_8099374() == 0)
+ {
+ sub_809B440();
+ BoxSetMosaic();
+ sub_80987DC();
+ gPokemonStorageSystemPtr->unk_0004++;
+ }
+ break;
+ case 7:
+ SetPSSCallback(sub_8096C84);
+ break;
+ case 8:
+ PrintStorageActionText(PC_TEXT_WAS_RELEASED);
+ gPokemonStorageSystemPtr->unk_0004++;
+ break;
+ case 9:
+ if (gMain.newKeys & (A_BUTTON | B_BUTTON))
+ {
+ PrintStorageActionText(PC_TEXT_SURPRISE);
+ gPokemonStorageSystemPtr->unk_0004++;
+ }
+ break;
+ case 10:
+ if (gMain.newKeys & (A_BUTTON | B_BUTTON))
+ {
+ sub_8098A5C();
+ sub_8099958();
+ gPokemonStorageSystemPtr->unk_0004++;
+ }
+ break;
+ case 11:
+ if (!sub_8099990())
+ {
+ sub_809B7AC();
+ PrintStorageActionText(PC_TEXT_CAME_BACK);
+ gPokemonStorageSystemPtr->unk_0004++;
+ }
+ break;
+ case 12:
+ if (gMain.newKeys & (A_BUTTON | B_BUTTON))
+ {
+ PrintStorageActionText(PC_TEXT_WORRIED);
+ gPokemonStorageSystemPtr->unk_0004++;
+ }
+ break;
+ case 13:
+ if (gMain.newKeys & (A_BUTTON | B_BUTTON))
+ {
+ sub_8098A5C();
+ SetPSSCallback(sub_8096C84);
+ }
+ break;
}
}
@@ -2019,19 +1081,19 @@ void sub_8097788(void)
{
switch (gPokemonStorageSystemPtr->unk_0004)
{
- case 0:
- sub_809BC18();
- BeginNormalPaletteFade(0xffffffff, 0, 0, 16, 0);
- gPokemonStorageSystemPtr->unk_0004++;
- break;
- case 1:
- if (!UpdatePaletteFade())
- {
- gUnknown_0203847F = 0;
- gPokemonStorageSystemPtr->unk_0006 = 0;
- SetMainCallback2(sub_8096B5C);
- }
- break;
+ case 0:
+ sub_809BC18();
+ BeginNormalPaletteFade(0xffffffff, 0, 0, 16, 0);
+ gPokemonStorageSystemPtr->unk_0004++;
+ break;
+ case 1:
+ if (!UpdatePaletteFade())
+ {
+ gUnknown_0203847F = 0;
+ gPokemonStorageSystemPtr->unk_0006 = 0;
+ SetMainCallback2(sub_8096B5C);
+ }
+ break;
}
}
@@ -2039,22 +1101,22 @@ void sub_80977E4(void)
{
switch (gPokemonStorageSystemPtr->unk_0004)
{
- case 0:
- PrintStorageActionText(PC_TEXT_MARK_POKE);
- gPokemonStorageSystemPtr->unk_12bc.markings = gPokemonStorageSystemPtr->unk_11f7;
- sub_80F7418(gPokemonStorageSystemPtr->unk_11f7, 0xb0, 0x10);
- gPokemonStorageSystemPtr->unk_0004++;
- break;
- case 1:
- if (!sub_80F7500())
- {
- sub_80F7470();
- sub_8098A5C();
- sub_809BDD8(gPokemonStorageSystemPtr->unk_12bc.markings);
- sub_809801C();
- SetPSSCallback(sub_8096C84);
- }
- break;
+ case 0:
+ PrintStorageActionText(PC_TEXT_MARK_POKE);
+ gPokemonStorageSystemPtr->unk_12bc.markings = gPokemonStorageSystemPtr->unk_11f7;
+ sub_80F7418(gPokemonStorageSystemPtr->unk_11f7, 0xb0, 0x10);
+ gPokemonStorageSystemPtr->unk_0004++;
+ break;
+ case 1:
+ if (!sub_80F7500())
+ {
+ sub_80F7470();
+ sub_8098A5C();
+ sub_809BDD8(gPokemonStorageSystemPtr->unk_12bc.markings);
+ sub_809801C();
+ SetPSSCallback(sub_8096C84);
+ }
+ break;
}
}
@@ -2062,18 +1124,18 @@ void sub_8097858(void)
{
switch (gPokemonStorageSystemPtr->unk_0004)
{
- case 0:
- party_compaction();
- sub_8099310();
- gPokemonStorageSystemPtr->unk_0004++;
- break;
- case 1:
- if (sub_8099374() == 0)
- {
- sub_80987DC();
- SetPSSCallback(sub_8096C84);
- }
- break;
+ case 0:
+ party_compaction();
+ sub_8099310();
+ gPokemonStorageSystemPtr->unk_0004++;
+ break;
+ case 1:
+ if (sub_8099374() == 0)
+ {
+ sub_80987DC();
+ SetPSSCallback(sub_8096C84);
+ }
+ break;
}
}
@@ -2081,36 +1143,36 @@ void sub_809789C(void)
{
switch (gPokemonStorageSystemPtr->unk_0004)
{
- case 0:
- PrintStorageActionText(PC_TEXT_WHAT_YOU_DO);
- sub_809CE84();
- gPokemonStorageSystemPtr->unk_0004++;
+ case 0:
+ PrintStorageActionText(PC_TEXT_WHAT_YOU_DO);
+ sub_809CE84();
+ gPokemonStorageSystemPtr->unk_0004++;
+ break;
+ case 1:
+ switch (sub_809CF30())
+ {
+ case -1:
+ case 0:
+ sub_809A860(TRUE);
+ sub_8098A5C();
+ SetPSSCallback(sub_8096C84);
break;
- case 1:
- switch (sub_809CF30())
- {
- case -1:
- case 0:
- sub_809A860(TRUE);
- sub_8098A5C();
- SetPSSCallback(sub_8096C84);
- break;
- case 11:
- PlaySE(SE_SELECT);
- SetPSSCallback(sub_8097B44);
- break;
- case 10:
- PlaySE(SE_SELECT);
- sub_8098A5C();
- SetPSSCallback(sub_8097974);
- break;
- case 9:
- PlaySE(SE_SELECT);
- sub_8098A5C();
- SetPSSCallback(sub_8097A64);
- break;
- }
+ case 11:
+ PlaySE(SE_SELECT);
+ SetPSSCallback(sub_8097B44);
break;
+ case 10:
+ PlaySE(SE_SELECT);
+ sub_8098A5C();
+ SetPSSCallback(sub_8097974);
+ break;
+ case 9:
+ PlaySE(SE_SELECT);
+ sub_8098A5C();
+ SetPSSCallback(sub_8097A64);
+ break;
+ }
+ break;
}
}
@@ -2118,55 +1180,55 @@ void sub_8097974(void)
{
switch (gPokemonStorageSystemPtr->unk_0004)
{
- case 0:
- sub_8098A80();
- PrintStorageActionText(PC_TEXT_PICK_A_THEME);
+ case 0:
+ sub_8098A80();
+ PrintStorageActionText(PC_TEXT_PICK_A_THEME);
+ gPokemonStorageSystemPtr->unk_0004++;
+ break;
+ case 1:
+ gPokemonStorageSystemPtr->unk_0d5e = sub_809CF30();
+ switch (gPokemonStorageSystemPtr->unk_0d5e)
+ {
+ case -1:
+ sub_809A860(TRUE);
+ sub_8098A5C();
+ SetPSSCallback(sub_8096C84);
+ break;
+ case 12 ... 15:
+ PlaySE(SE_SELECT);
+ gPokemonStorageSystemPtr->unk_0d5e -= 12;
+ sub_8098AA8(gPokemonStorageSystemPtr->unk_0d5e);
+ PrintStorageActionText(PC_TEXT_PICK_A_WALLPAPER);
gPokemonStorageSystemPtr->unk_0004++;
break;
- case 1:
- gPokemonStorageSystemPtr->unk_0d5e = sub_809CF30();
- switch (gPokemonStorageSystemPtr->unk_0d5e)
- {
- case -1:
- sub_809A860(TRUE);
- sub_8098A5C();
- SetPSSCallback(sub_8096C84);
- break;
- case 12 ... 15:
- PlaySE(SE_SELECT);
- gPokemonStorageSystemPtr->unk_0d5e -= 12;
- sub_8098AA8(gPokemonStorageSystemPtr->unk_0d5e);
- PrintStorageActionText(PC_TEXT_PICK_A_WALLPAPER);
- gPokemonStorageSystemPtr->unk_0004++;
- break;
- }
+ }
+ break;
+ case 2:
+ gPokemonStorageSystemPtr->unk_0d60 = sub_809CF30();
+ switch (gPokemonStorageSystemPtr->unk_0d60)
+ {
+ case -1:
+ sub_8098A5C();
+ gPokemonStorageSystemPtr->unk_0004 = 0;
break;
- case 2:
- gPokemonStorageSystemPtr->unk_0d60 = sub_809CF30();
- switch (gPokemonStorageSystemPtr->unk_0d60)
- {
- case -1:
- sub_8098A5C();
- gPokemonStorageSystemPtr->unk_0004 = 0;
- break;
- case -2:
- break;
- default:
- PlaySE(SE_SELECT);
- sub_8098A5C();
- gPokemonStorageSystemPtr->unk_0d60 -= 16;
- sub_8099DCC(gPokemonStorageSystemPtr->unk_0d60);
- gPokemonStorageSystemPtr->unk_0004++;
- break;
- }
+ case -2:
break;
- case 3:
- if (!sub_8099E08())
- {
- sub_809A860(TRUE);
- SetPSSCallback(sub_8096C84);
- }
+ default:
+ PlaySE(SE_SELECT);
+ sub_8098A5C();
+ gPokemonStorageSystemPtr->unk_0d60 -= 16;
+ sub_8099DCC(gPokemonStorageSystemPtr->unk_0d60);
+ gPokemonStorageSystemPtr->unk_0004++;
break;
+ }
+ break;
+ case 3:
+ if (!sub_8099E08())
+ {
+ sub_809A860(TRUE);
+ SetPSSCallback(sub_8096C84);
+ }
+ break;
}
}
@@ -2174,45 +1236,45 @@ void sub_8097A64(void)
{
switch (gPokemonStorageSystemPtr->unk_0004)
{
- case 0:
- PrintStorageActionText(PC_TEXT_JUMP_TO_WHICH_BOX);
- sub_8096264(&gPokemonStorageSystemPtr->unk_2370, 0x0007, 0xdaca, 3);
- sub_809634C(gPokemonStorage.currentBox);
- gPokemonStorageSystemPtr->unk_0004++;
+ case 0:
+ PrintStorageActionText(PC_TEXT_JUMP_TO_WHICH_BOX);
+ sub_8096264(&gPokemonStorageSystemPtr->unk_2370, 0x0007, 0xdaca, 3);
+ sub_809634C(gPokemonStorage.currentBox);
+ gPokemonStorageSystemPtr->unk_0004++;
+ break;
+ case 1:
+ gPokemonStorageSystemPtr->unk_08b2 = sub_8096368();
+ switch (gPokemonStorageSystemPtr->unk_08b2)
+ {
+ case 200:
break;
- case 1:
- gPokemonStorageSystemPtr->unk_08b2 = sub_8096368();
- switch (gPokemonStorageSystemPtr->unk_08b2)
+ default:
+ sub_8098A5C();
+ sub_809635C();
+ sub_8096310();
+ if (gPokemonStorageSystemPtr->unk_08b2 == 201 || gPokemonStorageSystemPtr->unk_08b2 == gPokemonStorage.currentBox)
{
- case 200:
- break;
- default:
- sub_8098A5C();
- sub_809635C();
- sub_8096310();
- if (gPokemonStorageSystemPtr->unk_08b2 == 201 || gPokemonStorageSystemPtr->unk_08b2 == gPokemonStorage.currentBox)
- {
- sub_809A860(TRUE);
- SetPSSCallback(sub_8096C84);
- }
- else
- {
- gPokemonStorageSystemPtr->unk_0004++;
- }
- break;
+ sub_809A860(TRUE);
+ SetPSSCallback(sub_8096C84);
}
- break;
- case 2:
- sub_8099C70(gPokemonStorageSystemPtr->unk_08b2);
- gPokemonStorageSystemPtr->unk_0004++;
- break;
- case 3:
- if (!sub_8099D34())
+ else
{
- gPokemonStorage.currentBox = gPokemonStorageSystemPtr->unk_08b2;
- SetPSSCallback(sub_8096C84);
+ gPokemonStorageSystemPtr->unk_0004++;
}
break;
+ }
+ break;
+ case 2:
+ sub_8099C70(gPokemonStorageSystemPtr->unk_08b2);
+ gPokemonStorageSystemPtr->unk_0004++;
+ break;
+ case 3:
+ if (!sub_8099D34())
+ {
+ gPokemonStorage.currentBox = gPokemonStorageSystemPtr->unk_08b2;
+ SetPSSCallback(sub_8096C84);
+ }
+ break;
}
}
@@ -2220,19 +1282,19 @@ void sub_8097B44(void)
{
switch (gPokemonStorageSystemPtr->unk_0004)
{
- case 0:
- sub_809BB90();
- BeginNormalPaletteFade(0xffffffff, 0, 0, 16, 0);
- gPokemonStorageSystemPtr->unk_0004++;
- break;
- case 1:
- if (!UpdatePaletteFade())
- {
- gUnknown_0203847F = 1;
- gPokemonStorageSystemPtr->unk_0006 = 1;
- SetMainCallback2(sub_8096B5C);
- }
- break;
+ case 0:
+ sub_809BB90();
+ BeginNormalPaletteFade(0xffffffff, 0, 0, 16, 0);
+ gPokemonStorageSystemPtr->unk_0004++;
+ break;
+ case 1:
+ if (!UpdatePaletteFade())
+ {
+ gUnknown_0203847F = 1;
+ gPokemonStorageSystemPtr->unk_0006 = 1;
+ SetMainCallback2(sub_8096B5C);
+ }
+ break;
}
}
@@ -2240,110 +1302,117 @@ void sub_8097BA0(void)
{
switch (gPokemonStorageSystemPtr->unk_0004)
{
- case 0:
- if (sub_809BF20())
- {
- PlaySE(SE_HAZURE);
- PrintStorageActionText(PC_TEXT_HOLDING_POKE);
- gPokemonStorageSystemPtr->unk_0004 = 1;
- }
- else
- {
- PlaySE(SE_SELECT);
- PrintStorageActionText(PC_TEXT_EXIT_BOX);
- sub_8098A38(0);
- gPokemonStorageSystemPtr->unk_0004 = 2;
- }
- break;
+ case 0:
+ if (sub_809BF20())
+ {
+ PlaySE(SE_HAZURE);
+ PrintStorageActionText(PC_TEXT_HOLDING_POKE);
+ gPokemonStorageSystemPtr->unk_0004 = 1;
+ }
+ else
+ {
+ PlaySE(SE_SELECT);
+ PrintStorageActionText(PC_TEXT_EXIT_BOX);
+ sub_8098A38(0);
+ gPokemonStorageSystemPtr->unk_0004 = 2;
+ }
+ break;
+ case 1:
+ if (gMain.newKeys & (A_BUTTON | B_BUTTON | DPAD_ANY))
+ {
+ sub_8098A5C();
+ SetPSSCallback(sub_8096C84);
+ }
+ break;
+ case 2:
+ switch (Menu_ProcessInputNoWrap())
+ {
case 1:
- if (gMain.newKeys & (A_BUTTON | B_BUTTON | DPAD_ANY))
- {
- sub_8098A5C();
- SetPSSCallback(sub_8096C84);
- }
- break;
- case 2:
- switch (Menu_ProcessInputNoWrap())
- {
- case 1:
- case -1:
- sub_8098A5C();
- SetPSSCallback(sub_8096C84);
- break;
- case 0:
- PlaySE(SE_PC_OFF);
- sub_8098A5C();
- gPokemonStorageSystemPtr->unk_0004++;
- break;
- }
+ case -1:
+ sub_8098A5C();
+ SetPSSCallback(sub_8096C84);
break;
- case 3:
- gPokemonStorageSystemPtr->unk_000c.tileTag = 0x000e;
- gPokemonStorageSystemPtr->unk_000c.paletteTag = 0xdad0;
- gPokemonStorageSystemPtr->unk_000c.unk04 = 20;
- gPokemonStorageSystemPtr->unk_000c.unk06 = 0;
- sub_80C5E38(&gPokemonStorageSystemPtr->unk_000c);
+ case 0:
+ PlaySE(SE_PC_OFF);
+ sub_8098A5C();
gPokemonStorageSystemPtr->unk_0004++;
break;
- case 4:
- if (sub_80C5F98())
- {
- gPlayerPartyCount = CalculatePlayerPartyCount();
- SetMainCallback2(sub_80961A8);
- }
- break;
+ }
+ break;
+ case 3:
+ gPokemonStorageSystemPtr->unk_000c.tileTag = 0x000e;
+ gPokemonStorageSystemPtr->unk_000c.paletteTag = 0xdad0;
+ gPokemonStorageSystemPtr->unk_000c.unk04 = 20;
+ gPokemonStorageSystemPtr->unk_000c.unk06 = 0;
+ sub_80C5E38(&gPokemonStorageSystemPtr->unk_000c);
+ gPokemonStorageSystemPtr->unk_0004++;
+ break;
+ case 4:
+ if (sub_80C5F98())
+ {
+ gPlayerPartyCount = CalculatePlayerPartyCount();
+ SetMainCallback2(sub_80961A8);
+ }
+ break;
}
}
-void sub_8097CC0(void) {
- switch (gPokemonStorageSystemPtr->unk_0004) {
+void sub_8097CC0(void)
+{
+ switch (gPokemonStorageSystemPtr->unk_0004)
+ {
+ case 0:
+ if (sub_809BF20())
+ {
+ PlaySE(SE_HAZURE);
+ PrintStorageActionText(PC_TEXT_HOLDING_POKE);
+ gPokemonStorageSystemPtr->unk_0004 = 1;
+ }
+ else
+ {
+ PlaySE(SE_SELECT);
+ PrintStorageActionText(PC_TEXT_CONTINUE_BOX);
+ sub_8098A38(0);
+ gPokemonStorageSystemPtr->unk_0004 = 2;
+ }
+ break;
+ case 1:
+ if (gMain.newKeys & (A_BUTTON | B_BUTTON | DPAD_ANY))
+ {
+ sub_8098A5C();
+ SetPSSCallback(sub_8096C84);
+ }
+ break;
+ case 2:
+ switch (Menu_ProcessInputNoWrap())
+ {
case 0:
- if (sub_809BF20()) {
- PlaySE(SE_HAZURE);
- PrintStorageActionText(PC_TEXT_HOLDING_POKE);
- gPokemonStorageSystemPtr->unk_0004 = 1;
- }
- else {
- PlaySE(SE_SELECT);
- PrintStorageActionText(PC_TEXT_CONTINUE_BOX);
- sub_8098A38(0);
- gPokemonStorageSystemPtr->unk_0004 = 2;
- }
+ sub_8098A5C();
+ SetPSSCallback(sub_8096C84);
break;
+ case -1:
case 1:
- if (gMain.newKeys & (A_BUTTON | B_BUTTON | DPAD_ANY)) {
- sub_8098A5C();
- SetPSSCallback(sub_8096C84);
- }
- break;
- case 2:
- switch (Menu_ProcessInputNoWrap()) {
- case 0:
- sub_8098A5C();
- SetPSSCallback(sub_8096C84);
- break;
- case -1:
- case 1:
- PlaySE(SE_PC_OFF);
- sub_8098A5C();
- gPokemonStorageSystemPtr->unk_0004++;
- break;
- }
- break;
- case 3:
- gPokemonStorageSystemPtr->unk_000c.tileTag = 0x000e;
- gPokemonStorageSystemPtr->unk_000c.paletteTag = 0xdad0;
- gPokemonStorageSystemPtr->unk_000c.unk04 = 20;
- gPokemonStorageSystemPtr->unk_000c.unk06 = 0;
- sub_80C5E38(&gPokemonStorageSystemPtr->unk_000c);
+ PlaySE(SE_PC_OFF);
+ sub_8098A5C();
gPokemonStorageSystemPtr->unk_0004++;
break;
- case 4:
- if (sub_80C5F98()) {
- gPlayerPartyCount = CalculatePlayerPartyCount();
- SetMainCallback2(sub_80961A8);
- }
- break;
+ }
+ break;
+ case 3:
+ gPokemonStorageSystemPtr->unk_000c.tileTag = 0x000e;
+ gPokemonStorageSystemPtr->unk_000c.paletteTag = 0xdad0;
+ gPokemonStorageSystemPtr->unk_000c.unk04 = 20;
+ gPokemonStorageSystemPtr->unk_000c.unk06 = 0;
+ sub_80C5E38(&gPokemonStorageSystemPtr->unk_000c);
+ gPokemonStorageSystemPtr->unk_0004++;
+ break;
+ case 4:
+ if (sub_80C5F98())
+ {
+ gPlayerPartyCount = CalculatePlayerPartyCount();
+ SetMainCallback2(sub_80961A8);
+ }
+ break;
}
}
@@ -2826,28 +1895,29 @@ bool8 sub_8098830(void)
{
switch (gPokemonStorageSystemPtr->unk_08ae)
{
- case 0:
- if (!sub_8098520())
- {
- sub_809B068();
- gPokemonStorageSystemPtr->unk_08ae++;
- }
- break;
- case 1:
- if (!sub_809AC00())
- {
- if (gPokemonStorageSystemPtr->unk_11f6)
- BoxSetMosaic();
- gPokemonStorageSystemPtr->unk_08ae++;
- }
- break;
- case 2:
- return FALSE;
+ case 0:
+ if (!sub_8098520())
+ {
+ sub_809B068();
+ gPokemonStorageSystemPtr->unk_08ae++;
+ }
+ break;
+ case 1:
+ if (!sub_809AC00())
+ {
+ if (gPokemonStorageSystemPtr->unk_11f6)
+ BoxSetMosaic();
+ gPokemonStorageSystemPtr->unk_08ae++;
+ }
+ break;
+ case 2:
+ return FALSE;
}
return TRUE;
}
-const struct StorageAction gPCStorageActionTexts[] = {
+const struct StorageAction gPCStorageActionTexts[] =
+{
{PCText_ExitBox, 0},
{PCText_WhatYouDo, 0},
{PCText_PickATheme, 0},
@@ -2873,41 +1943,37 @@ const struct StorageAction gPCStorageActionTexts[] = {
{PCText_PleaseRemoveMail, 0}
};
-void PrintStorageActionText(u8 index) {
+void PrintStorageActionText(u8 index)
+{
u8 *ptr;
Menu_DrawStdWindowFrame(10, 16, 29, 19);
switch (gPCStorageActionTexts[index].format)
{
-
- case PC_TEXT_FMT_UNK_02:
- ptr = StringCopy(gPokemonStorageSystemPtr->unk_2694, gPCStorageActionTexts[index].text);
- ptr = StringCopy(ptr, gPokemonStorageSystemPtr->unk_11fa);
- break;
-
- case PC_TEXT_FMT_UNK_05:
- ptr = StringCopy(gPokemonStorageSystemPtr->unk_2694, gPCStorageActionTexts[index].text);
- ptr = StringCopy(ptr, gPokemonStorageSystemPtr->unk_26e4);
- break;
-
- case PC_TEXT_FMT_MON_NAME:
- // {var} + " is selected."
- ptr = StringCopy(gPokemonStorageSystemPtr->unk_2694, gPokemonStorageSystemPtr->unk_11fa);
- ptr = StringCopy(ptr, gPCStorageActionTexts[index].text);
- break;
-
- case PC_TEXT_FMT_MON_NAME_2:
- // {var} + " was released."
- ptr = StringCopy(gPokemonStorageSystemPtr->unk_2694, gPokemonStorageSystemPtr->unk_26e4);
+ case PC_TEXT_FMT_UNK_02:
+ ptr = StringCopy(gPokemonStorageSystemPtr->unk_2694, gPCStorageActionTexts[index].text);
+ ptr = StringCopy(ptr, gPokemonStorageSystemPtr->unk_11fa);
+ break;
+ case PC_TEXT_FMT_UNK_05:
+ ptr = StringCopy(gPokemonStorageSystemPtr->unk_2694, gPCStorageActionTexts[index].text);
+ ptr = StringCopy(ptr, gPokemonStorageSystemPtr->unk_26e4);
+ break;
+ case PC_TEXT_FMT_MON_NAME:
+ // {var} + " is selected."
+ ptr = StringCopy(gPokemonStorageSystemPtr->unk_2694, gPokemonStorageSystemPtr->unk_11fa);
+ ptr = StringCopy(ptr, gPCStorageActionTexts[index].text);
+ break;
+ case PC_TEXT_FMT_MON_NAME_2:
+ // {var} + " was released."
+ ptr = StringCopy(gPokemonStorageSystemPtr->unk_2694, gPokemonStorageSystemPtr->unk_26e4);
#if ENGLISH
- ptr = StringCopy(ptr, gPCStorageActionTexts[index].text);
+ ptr = StringCopy(ptr, gPCStorageActionTexts[index].text);
#elif GERMAN
- ptr = de_sub_8073174(gPokemonStorageSystemPtr->unk_2694, gPCStorageActionTexts[index].text);
+ ptr = de_sub_8073174(gPokemonStorageSystemPtr->unk_2694, gPCStorageActionTexts[index].text);
#endif
- break;
-
- case PC_TEXT_FMT_UNK_03:
+ break;
+ case PC_TEXT_FMT_UNK_03:
{
const u8 *stringLength;
const u8 *text;
@@ -2919,10 +1985,8 @@ void PrintStorageActionText(u8 index) {
ptr = StringCopy(ptr, gPokemonStorageSystemPtr->unk_11fa);
ptr = StringCopy(ptr, stringLength);
}
- break;
-
- case PC_TEXT_FMT_MON_NAME_AFTER_EXCL_MARK:
- // "Bye-bye, ".substr(0, -1) + {var} + "Bye-bye, !".substr(-1, 1)
+ break;
+ case PC_TEXT_FMT_MON_NAME_AFTER_EXCL_MARK:
{
const u8 *stringLength;
const u8 *text;
@@ -2934,12 +1998,11 @@ void PrintStorageActionText(u8 index) {
ptr = StringCopy(ptr - 1, gPokemonStorageSystemPtr->unk_26e4);
ptr = StringCopy(ptr, stringLength);
}
- break;
-
- case PC_TEXT_FMT_NORMAL:
- default:
- ptr = StringCopy(gPokemonStorageSystemPtr->unk_2694, gPCStorageActionTexts[index].text);
- break;
+ break;
+ case PC_TEXT_FMT_NORMAL:
+ default:
+ ptr = StringCopy(gPokemonStorageSystemPtr->unk_2694, gPCStorageActionTexts[index].text);
+ break;
}
while (ptr < gPokemonStorageSystemPtr->unk_26a6)
@@ -3029,30 +2092,30 @@ void sub_8098AA8(u8 a0)
sub_809CDCC();
switch (a0)
{
- case 0:
- sub_809CDEC(16);
- sub_809CDEC(17);
- sub_809CDEC(18);
- sub_809CDEC(19);
- break;
- case 1:
- sub_809CDEC(20);
- sub_809CDEC(21);
- sub_809CDEC(22);
- sub_809CDEC(23);
- break;
- case 2:
- sub_809CDEC(24);
- sub_809CDEC(25);
- sub_809CDEC(26);
- sub_809CDEC(27);
- break;
- case 3:
- sub_809CDEC(28);
- sub_809CDEC(29);
- sub_809CDEC(30);
- sub_809CDEC(31);
- break;
+ case 0:
+ sub_809CDEC(16);
+ sub_809CDEC(17);
+ sub_809CDEC(18);
+ sub_809CDEC(19);
+ break;
+ case 1:
+ sub_809CDEC(20);
+ sub_809CDEC(21);
+ sub_809CDEC(22);
+ sub_809CDEC(23);
+ break;
+ case 2:
+ sub_809CDEC(24);
+ sub_809CDEC(25);
+ sub_809CDEC(26);
+ sub_809CDEC(27);
+ break;
+ case 3:
+ sub_809CDEC(28);
+ sub_809CDEC(29);
+ sub_809CDEC(30);
+ sub_809CDEC(31);
+ break;
}
sub_809CE84();
}
diff --git a/src/pokemon/pokemon_storage_system_4.c b/src/pokemon/pokemon_storage_system_4.c
index 19fddc0f7..2f9f79a54 100644
--- a/src/pokemon/pokemon_storage_system_4.c
+++ b/src/pokemon/pokemon_storage_system_4.c
@@ -2101,7 +2101,7 @@ void sub_809C04C(void *pokemon, u8 a1)
buf[1] = 0x06; // size
buf[2] = 0x04;
buf = gPokemonStorageSystemPtr->unk_127a + 8;
- buf = StringCopy(buf, ItemId_GetItem(gPokemonStorageSystemPtr->unk_11f2)->name);
+ buf = StringCopy(buf, ItemId_GetName(gPokemonStorageSystemPtr->unk_11f2));
buf[0] = EXT_CTRL_CODE_BEGIN;
buf[1] = 0x07; // UNKNOWN_7;
buf += 2;
diff --git a/src/pokemon/pokemon_summary_screen.c b/src/pokemon/pokemon_summary_screen.c
index 9c621780a..0acf465f6 100644
--- a/src/pokemon/pokemon_summary_screen.c
+++ b/src/pokemon/pokemon_summary_screen.c
@@ -41,11 +41,11 @@ static void sub_80A0090(struct Pokemon *);
static void sub_80A015C(struct Pokemon *);
static void sub_809DE44(void);
static void sub_809EB40(u8);
-/*static*/ void sub_809EBC4(void);
-/*static*/ void sub_809E044(void);
+static void sub_809EBC4(void);
+static void sub_809E044(void);
static void sub_80A1D84(struct Pokemon *);
-/*static*/ void sub_80A18C4(void);
-/*static*/ bool8 LoadPokemonSummaryScreenGraphics(void);
+static void sub_80A18C4(void);
+static bool8 LoadPokemonSummaryScreenGraphics(void);
static bool8 MonKnowsMultipleMoves(struct Pokemon *);
static void PrintSummaryWindowHeaderText(void);
static void sub_80A1DCC(struct Pokemon *);
@@ -63,8 +63,8 @@ static void PrintHeldItemName(u16, u8, u8);
static void PrintNumRibbons(struct Pokemon *);
static void DrawExperienceProgressBar(struct Pokemon *, u8, u8);
static void sub_809E13C(u8 taskId);
-/*static*/ void sub_80A1950(void);
-/*static*/ void sub_809DE64(void);
+static void sub_80A1950(void);
+static void sub_809DE64(void);
static void SummaryScreenHandleAButton(u8);
static void SummaryScreenHandleUpDownInput(u8, s8);
static bool8 sub_809F7D0(u8);
@@ -571,51 +571,17 @@ static const u8 sUnknown_083C15BC[] = {
-1, 15, 0, 10,
};
-#if DEBUG
-__attribute__((naked))
-void sub_809D844(void)
-{
- asm("\
- push {lr}\n\
- add sp, sp, #0xfffffffc\n\
- bl RunTasks\n\
- bl AnimateSprites\n\
- bl BuildOamBuffer\n\
- bl UpdatePaletteFade\n\
- ldr r0, ._2 @ gLinkOpen\n\
- ldrb r0, [r0]\n\
- cmp r0, #0x1\n\
- bne ._1 @cond_branch\n\
- ldr r0, ._2 + 4 @ gLink\n\
- ldr r1, ._2 + 8 @ 0xfbd\n\
- add r0, r0, r1\n\
- ldrb r0, [r0]\n\
- mov r1, #0x3\n\
- str r1, [sp]\n\
- mov r1, #0x14\n\
- mov r2, #0x1\n\
- mov r3, #0x2\n\
- bl debug_sub_8008264\n\
-._1:\n\
- add sp, sp, #0x4\n\
- pop {r0}\n\
- bx r0\n\
-._3:\n\
- .align 2, 0\n\
-._2:\n\
- .word gLinkOpen\n\
- .word gLink\n\
- .word 0xfbd");
-}
-#else
void sub_809D844(void)
{
RunTasks();
AnimateSprites();
BuildOamBuffer();
UpdatePaletteFade();
-}
+#if DEBUG
+ if (gLinkOpen == TRUE)
+ debug_sub_8008264(gLink.recvQueue.count, 20, 1, 2, 3);
#endif
+}
void sub_809D85C(void)
{
@@ -647,13 +613,9 @@ void ShowPokemonSummaryScreen(struct Pokemon *party, u8 monIndex, u8 maxMonIndex
pssData.disableMoveOrderEditing = FALSE;
if (mode >= PSS_MODE_PC_NORMAL)
- {
pssData.usingPC = TRUE;
- }
else
- {
pssData.usingPC = FALSE;
- }
switch (mode)
{
@@ -725,491 +687,6 @@ void sub_809DA1C(void)
}
}
-#if DEBUG
-__attribute__((naked))
-bool8 sub_809DA84(void)
-{
- asm("\
- push {r4, r5, r6, r7, lr}\n\
- add sp, sp, #0xfffffff8\n\
- ldr r1, ._52 @ gMain\n\
- ldr r2, ._52 + 4 @ 0x43c\n\
- add r0, r1, r2\n\
- ldrb r0, [r0]\n\
- mov ip, r1\n\
- cmp r0, #0x16\n\
- bls ._50 @cond_branch\n\
- b ._51\n\
-._50:\n\
- lsl r0, r0, #0x2\n\
- ldr r1, ._52 + 8 @ \n\
- add r0, r0, r1\n\
- ldr r0, [r0]\n\
- mov pc, r0\n\
-._53:\n\
- .align 2, 0\n\
-._52:\n\
- .word gMain\n\
- .word 0x43c\n\
- .word ._54\n\
-._54:\n\
- .word ._55\n\
- .word ._56\n\
- .word ._57\n\
- .word ._58\n\
- .word ._59\n\
- .word ._60\n\
- .word ._61\n\
- .word ._62\n\
- .word ._63\n\
- .word ._64\n\
- .word ._65\n\
- .word ._66\n\
- .word ._67\n\
- .word ._68\n\
- .word ._69\n\
- .word ._70\n\
- .word ._71\n\
- .word ._72\n\
- .word ._73\n\
- .word ._74\n\
- .word ._75\n\
- .word ._76\n\
- .word ._77\n\
-._55:\n\
- mov r0, #0x0\n\
- bl SetVBlankCallback\n\
- bl ResetSpriteData\n\
- b ._146\n\
-._56:\n\
- bl ScanlineEffect_Stop\n\
- ldr r1, ._80 @ gMain\n\
- ldr r2, ._80 + 4 @ 0x43c\n\
- add r1, r1, r2\n\
- b ._153\n\
-._81:\n\
- .align 2, 0\n\
-._80:\n\
- .word gMain\n\
- .word 0x43c\n\
-._57:\n\
- bl FreeAllSpritePalettes\n\
- b ._146\n\
-._58:\n\
- mov r2, #0xc0\n\
- lsl r2, r2, #0x13\n\
- mov r3, #0x80\n\
- lsl r3, r3, #0x9\n\
- mov r5, #0x0\n\
- ldr r1, ._85 @ 0x40000d4\n\
- mov r4, #0x80\n\
- lsl r4, r4, #0x5\n\
- ldr r6, ._85 + 4 @ 0x85000400\n\
- mov r7, #0x85\n\
- lsl r7, r7, #0x18\n\
-._83:\n\
- str r5, [sp, #0x4]\n\
- add r0, sp, #0x4\n\
- str r0, [r1]\n\
- str r2, [r1, #0x4]\n\
- str r6, [r1, #0x8]\n\
- ldr r0, [r1, #0x8]\n\
- add r2, r2, r4\n\
- sub r3, r3, r4\n\
- cmp r3, r4\n\
- bhi ._83 @cond_branch\n\
- str r5, [sp, #0x4]\n\
- add r0, sp, #0x4\n\
- str r0, [r1]\n\
- str r2, [r1, #0x4]\n\
- lsr r0, r3, #0x2\n\
- orr r0, r0, r7\n\
- str r0, [r1, #0x8]\n\
- ldr r0, [r1, #0x8]\n\
- ldr r1, ._85 + 8 @ 0x43c\n\
- add r1, r1, ip\n\
- b ._153\n\
-._86:\n\
- .align 2, 0\n\
-._85:\n\
- .word 0x40000d4\n\
- .word 0x85000400\n\
- .word 0x43c\n\
-._59:\n\
- bl sub_809DE64\n\
- ldr r1, ._88 @ gMain\n\
- ldr r2, ._88 + 4 @ 0x43c\n\
- add r1, r1, r2\n\
- b ._153\n\
-._89:\n\
- .align 2, 0\n\
-._88:\n\
- .word gMain\n\
- .word 0x43c\n\
-._60:\n\
- ldr r0, ._91 @ gWindowTemplate_81E6E6C\n\
- bl Text_LoadWindowTemplate\n\
- b ._146\n\
-._92:\n\
- .align 2, 0\n\
-._91:\n\
- .word gWindowTemplate_81E6E6C\n\
-._61:\n\
- ldr r0, ._94 @ gWindowTemplate_81E6E6C\n\
- bl MultistepInitMenuWindowBegin\n\
- ldr r1, ._94 + 4 @ gMain\n\
- ldr r2, ._94 + 8 @ 0x43c\n\
- add r1, r1, r2\n\
- b ._153\n\
-._95:\n\
- .align 2, 0\n\
-._94:\n\
- .word gWindowTemplate_81E6E6C\n\
- .word gMain\n\
- .word 0x43c\n\
-._62:\n\
- bl MultistepInitMenuWindowContinue\n\
- cmp r0, #0\n\
- bne ._96 @cond_branch\n\
- b ._157\n\
-._96:\n\
- b ._146\n\
-._63:\n\
- bl sub_809DA1C\n\
- ldr r1, ._100 @ gMain\n\
- ldr r2, ._100 + 4 @ 0x43c\n\
- add r1, r1, r2\n\
- b ._153\n\
-._101:\n\
- .align 2, 0\n\
-._100:\n\
- .word gMain\n\
- .word 0x43c\n\
-._64:\n\
- ldr r1, ._103 @ gSummaryScreenTextTiles\n\
- ldr r2, ._103 + 4 @ 0x600d000\n\
- ldr r0, ._103 + 8 @ 0x40000d4\n\
- str r1, [r0]\n\
- str r2, [r0, #0x4]\n\
- ldr r1, ._103 + 12 @ 0x800000a0\n\
- str r1, [r0, #0x8]\n\
- ldr r1, [r0, #0x8]\n\
- ldr r1, ._103 + 16 @ sSummaryScreenButtonTiles\n\
- ldr r2, ._103 + 20 @ 0x600d140\n\
- str r1, [r0]\n\
- str r2, [r0, #0x4]\n\
- ldr r1, ._103 + 24 @ 0x80000080\n\
- str r1, [r0, #0x8]\n\
- ldr r0, [r0, #0x8]\n\
- ldr r0, ._103 + 28 @ \n\
- add r0, r0, #0x74\n\
- mov r1, #0x0\n\
- strb r1, [r0]\n\
- ldr r1, ._103 + 32 @ \n\
- add r1, r1, ip\n\
- b ._153\n\
-._104:\n\
- .align 2, 0\n\
-._103:\n\
- .word gSummaryScreenTextTiles\n\
- .word 0x600d000\n\
- .word 0x40000d4\n\
- .word 0x800000a0\n\
- .word sSummaryScreenButtonTiles\n\
- .word 0x600d140\n\
- .word 0x80000080\n\
- .word +0x2018000\n\
- .word 0x43c\n\
-._65:\n\
- bl LoadPokemonSummaryScreenGraphics\n\
- lsl r0, r0, #0x18\n\
- cmp r0, #0\n\
- bne ._105 @cond_branch\n\
- b ._157\n\
-._105:\n\
- ldr r0, ._108 @ \n\
- add r0, r0, #0x74\n\
- mov r1, #0x0\n\
- strb r1, [r0]\n\
- b ._146\n\
-._109:\n\
- .align 2, 0\n\
-._108:\n\
- .word +0x2018000\n\
-._66:\n\
- bl sub_80A18C4\n\
- ldr r1, ._111 @ gMain\n\
- ldr r2, ._111 + 4 @ 0x43c\n\
- add r1, r1, r2\n\
- b ._153\n\
-._112:\n\
- .align 2, 0\n\
-._111:\n\
- .word gMain\n\
- .word 0x43c\n\
-._67:\n\
- ldr r4, ._115 @ \n\
- add r0, r4, #0\n\
- bl sub_809F678\n\
- add r0, r4, #0\n\
- bl GetMonStatusAndPokerus\n\
- lsl r0, r0, #0x18\n\
- cmp r0, #0\n\
- bne ._113 @cond_branch\n\
- mov r0, #0x0\n\
- bl sub_80A12D0\n\
- b ._114\n\
-._116:\n\
- .align 2, 0\n\
-._115:\n\
- .word +0x2018010\n\
-._113:\n\
- mov r0, #0xa\n\
- bl sub_80A12D0\n\
-._114:\n\
- ldr r0, ._118 @ \n\
- bl DrawPokerusSurvivorDot\n\
- b ._146\n\
-._119:\n\
- .align 2, 0\n\
-._118:\n\
- .word +0x2018010\n\
-._68:\n\
- bl sub_80A1950\n\
- ldr r0, ._121 @ \n\
- bl sub_80A1D84\n\
- ldr r1, ._121 + 4 @ \n\
- ldr r2, ._121 + 8 @ \n\
- add r1, r1, r2\n\
- b ._153\n\
-._122:\n\
- .align 2, 0\n\
-._121:\n\
- .word +0x2018010\n\
- .word gMain\n\
- .word 0x43c\n\
-._69:\n\
- ldr r4, ._124 @ \n\
- add r0, r4, #0\n\
- bl sub_80A1DE8\n\
- add r4, r4, #0x64\n\
- mov r0, #0x0\n\
- strb r0, [r4]\n\
- b ._146\n\
-._125:\n\
- .align 2, 0\n\
-._124:\n\
- .word +0x2018010\n\
-._70:\n\
- ldr r4, ._129 @ \n\
- add r5, r4, #0\n\
- add r5, r5, #0x64\n\
- add r0, r4, #0\n\
- add r1, r5, #0\n\
- bl sub_809F6B4\n\
- sub r4, r4, #0x10\n\
- strb r0, [r4, #0xc]\n\
- lsl r0, r0, #0x18\n\
- lsr r0, r0, #0x18\n\
- cmp r0, #0xff\n\
- bne ._126 @cond_branch\n\
- b ._157\n\
-._126:\n\
- mov r0, #0x0\n\
- strb r0, [r5]\n\
- ldr r1, ._129 + 4 @ \n\
- ldr r2, ._129 + 8 @ \n\
- add r1, r1, r2\n\
- b ._153\n\
-._130:\n\
- .align 2, 0\n\
-._129:\n\
- .word +0x2018010\n\
- .word gMain\n\
- .word 0x43c\n\
-._71:\n\
- bl sub_809E044\n\
- bl DrawSummaryScreenNavigationDots\n\
- b ._146\n\
-._72:\n\
- ldr r1, ._134 @ \n\
- ldrb r0, [r1, #0xb]\n\
- cmp r0, #0x1\n\
- bhi ._132 @cond_branch\n\
- ldr r0, ._134 + 4 @ \n\
- ldrb r1, [r1, #0xb]\n\
- lsl r1, r1, #0x2\n\
- add r1, r1, r0\n\
- ldr r0, [r1]\n\
- bl _call_via_r0\n\
-._132:\n\
- ldr r1, ._134 + 8 @ \n\
- ldr r2, ._134 + 12 @ \n\
- add r1, r1, r2\n\
- b ._153\n\
-._135:\n\
- .align 2, 0\n\
-._134:\n\
- .word +0x2018000\n\
- .word sUnknown_083C1580\n\
- .word gMain\n\
- .word 0x43c\n\
-._73:\n\
- ldr r0, ._137 @ \n\
- bl sub_809FAC8\n\
- b ._146\n\
-._138:\n\
- .align 2, 0\n\
-._137:\n\
- .word +0x2018010\n\
-._74:\n\
- ldr r2, ._140 @ sUnknown_083C1598\n\
- ldr r0, ._140 + 4 @ \n\
- ldrb r1, [r0, #0xb]\n\
- lsl r1, r1, #0x2\n\
- add r1, r1, r2\n\
- add r0, r0, #0x10\n\
- ldr r1, [r1]\n\
- bl _call_via_r1\n\
- ldr r1, ._140 + 8 @ \n\
- ldr r2, ._140 + 12 @ \n\
- add r1, r1, r2\n\
- b ._153\n\
-._141:\n\
- .align 2, 0\n\
-._140:\n\
- .word sUnknown_083C1598\n\
- .word +0x2018000\n\
- .word gMain\n\
- .word 0x43c\n\
-._75:\n\
- ldr r0, ._144 @ \n\
- mov r1, #0x2d\n\
- bl GetMonData\n\
- add r1, r0, #0\n\
- cmp r1, #0\n\
- beq ._142 @cond_branch\n\
- ldr r1, ._144 + 4 @ \n\
- mov r2, #0x80\n\
- lsl r2, r2, #0x1\n\
- add r0, r2, #0\n\
- strh r0, [r1]\n\
- b ._146\n\
-._145:\n\
- .align 2, 0\n\
-._144:\n\
- .word +0x2018010\n\
- .word gBattle_BG3_X\n\
-._142:\n\
- ldr r0, ._147 @ gBattle_BG3_X\n\
- strh r1, [r0]\n\
- b ._146\n\
-._148:\n\
- .align 2, 0\n\
-._147:\n\
- .word gBattle_BG3_X\n\
-._76:\n\
- bl sub_809EBC4\n\
- ldr r0, ._151 @ \n\
- add r0, r0, #0x79\n\
- ldrb r0, [r0]\n\
- cmp r0, #0\n\
- beq ._149 @cond_branch\n\
- mov r0, #0x0\n\
- mov r1, #0x0\n\
- bl sub_80A1488\n\
- mov r0, #0x0\n\
- mov r1, #0x0\n\
- bl sub_80A1654\n\
- b ._150\n\
-._152:\n\
- .align 2, 0\n\
-._151:\n\
- .word +0x2018000\n\
-._149:\n\
- mov r0, #0xa\n\
- mov r1, #0x0\n\
- bl sub_80A1488\n\
- mov r0, #0xa\n\
- mov r1, #0x0\n\
- bl sub_80A1654\n\
-._150:\n\
- bl PrintSummaryWindowHeaderText\n\
- ldr r1, ._154 @ gMain\n\
- ldr r2, ._154 + 4 @ 0x43c\n\
- add r1, r1, r2\n\
- b ._153\n\
-._155:\n\
- .align 2, 0\n\
-._154:\n\
- .word gMain\n\
- .word 0x43c\n\
-._77:\n\
- bl sub_8055870\n\
- cmp r0, #0x1\n\
- beq ._157 @cond_branch\n\
-._146:\n\
- ldr r1, ._158 @ gMain\n\
- ldr r0, ._158 + 4 @ 0x43c\n\
- add r1, r1, r0\n\
-._153:\n\
- ldrb r0, [r1]\n\
- add r0, r0, #0x1\n\
- strb r0, [r1]\n\
- b ._157\n\
-._159:\n\
- .align 2, 0\n\
-._158:\n\
- .word gMain\n\
- .word 0x43c\n\
-._51:\n\
- ldr r0, ._162 @ sub_809D85C\n\
- bl SetVBlankCallback\n\
- mov r0, #0x1\n\
- str r0, [sp]\n\
- mov r0, #0xff\n\
- mov r1, #0x0\n\
- mov r2, #0x10\n\
- mov r3, #0x0\n\
- bl BeginHardwarePaletteFade\n\
- ldr r0, ._162 + 4 @ sub_809D844\n\
- bl SetMainCallback2\n\
- ldr r2, ._162 + 8 @ gPaletteFade\n\
- ldrb r1, [r2, #0x8]\n\
- mov r0, #0x7f\n\
- and r0, r0, r1\n\
- strb r0, [r2, #0x8]\n\
- ldr r0, ._162 + 12 @ gLinkOpen\n\
- ldrb r0, [r0]\n\
- cmp r0, #0x1\n\
- bne ._160 @cond_branch\n\
- ldr r0, ._162 + 16 @ 0x600dde0\n\
- mov r1, #0x80\n\
- lsl r1, r1, #0x8\n\
- ldr r2, ._162 + 20 @ 0x600f000\n\
- mov r3, #0x3\n\
- bl debug_sub_8008218\n\
-._160:\n\
- mov r0, #0x1\n\
- b ._161\n\
-._163:\n\
- .align 2, 0\n\
-._162:\n\
- .word sub_809D85C+1\n\
- .word sub_809D844+1\n\
- .word gPaletteFade\n\
- .word gLinkOpen\n\
- .word 0x600dde0\n\
- .word 0x600f000\n\
-._157:\n\
- mov r0, #0x0\n\
-._161:\n\
- add sp, sp, #0x8\n\
- pop {r4, r5, r6, r7}\n\
- pop {r1}\n\
- bx r1");
-}
-#else
bool8 sub_809DA84(void)
{
switch (gMain.state)
@@ -1245,9 +722,7 @@ bool8 sub_809DA84(void)
break;
case 7:
if (MultistepInitMenuWindowContinue())
- {
gMain.state++;
- }
break;
case 8:
sub_809DA1C();
@@ -1273,14 +748,9 @@ bool8 sub_809DA84(void)
case 12:
sub_809F678(&pssData.loadedMon);
if (!GetMonStatusAndPokerus(&pssData.loadedMon))
- {
sub_80A12D0(0);
- }
else
- {
sub_80A12D0(10);
- }
-
DrawPokerusSurvivorDot(&pssData.loadedMon);
gMain.state++;
break;
@@ -1308,10 +778,7 @@ bool8 sub_809DA84(void)
break;
case 17:
if (pssData.page <= PSS_PAGE_SKILLS)
- {
sUnknown_083C1580[pssData.page]();
- }
-
gMain.state++;
break;
case 18:
@@ -1324,14 +791,9 @@ bool8 sub_809DA84(void)
break;
case 20:
if (GetMonData(&pssData.loadedMon, MON_DATA_IS_EGG))
- {
gBattle_BG3_X = 256;
- }
else
- {
gBattle_BG3_X = 0;
- }
-
gMain.state++;
break;
case 21:
@@ -1346,28 +808,27 @@ bool8 sub_809DA84(void)
sub_80A1488(10, 0);
sub_80A1654(10, 0);
}
-
PrintSummaryWindowHeaderText();
gMain.state++;
break;
case 22:
if (sub_8055870() != TRUE)
- {
gMain.state++;
- }
break;
default:
SetVBlankCallback(sub_809D85C);
BeginHardwarePaletteFade(0xFF, 0, 16, 0, 1);
SetMainCallback2(sub_809D844);
gPaletteFade.bufferTransferDisabled = 0;
+#if DEBUG
+ if (gLinkOpen == TRUE)
+ debug_sub_8008218((void *)(VRAM + 0xDDE0), 0x8000, (void *)(VRAM + 0xF000), 3);
+#endif
return TRUE;
- break;
}
return FALSE;
}
-#endif
static void sub_809DE44(void)
{
@@ -1375,7 +836,7 @@ static void sub_809DE44(void)
;
}
-/*static*/ void sub_809DE64(void)
+static void sub_809DE64(void)
{
REG_BG0CNT = 0x1E08;
REG_BG1CNT = 0x4801;
@@ -1402,7 +863,7 @@ static void sub_809DE44(void)
REG_DISPCNT = 0x1F40;
}
-/*static*/ bool8 LoadPokemonSummaryScreenGraphics(void)
+static bool8 LoadPokemonSummaryScreenGraphics(void)
{
switch (pssData.loadGfxState)
{
@@ -1452,7 +913,7 @@ static void sub_809DE44(void)
return FALSE;
}
-/*static*/ void sub_809E044(void)
+static void sub_809E044(void)
{
LoadPalette(gUnknownPalette_81E6692 + 14, 129, 2);
LoadPalette(gUnknownPalette_81E6692 + 15, 136, 2);
@@ -1517,14 +978,9 @@ static void SummaryScreenHandleKeyInput(u8 taskId)
else if (gMain.newKeys & A_BUTTON)
{
if (pssData.page >= PSS_PAGE_BATTLE_MOVES)
- {
SummaryScreenHandleAButton(taskId);
- }
-
if (pssData.page == PSS_PAGE_INFO)
- {
SummaryScreenExit(taskId);
- }
}
else if (gMain.newKeys & B_BUTTON)
{
@@ -1550,10 +1006,7 @@ static void sub_809E260(u8 taskId)
else if ((gMain.newKeys & DPAD_LEFT) || sub_80F9284() == 1)
{
if (pssData.page == PSS_PAGE_CONTEST_MOVES && (pssData.selectedMoveIndex != 4 || pssData.moveToLearn != 0))
- {
Menu_EraseWindowRect(0, 14, 9, 18);
- }
-
SummaryScreenHandleLeftRightInput(taskId, -1);
}
else if ((gMain.newKeys & DPAD_RIGHT) || sub_80F9284() == 2)
@@ -1561,10 +1014,7 @@ static void sub_809E260(u8 taskId)
if (pssData.page != pssData.lastPage)
{
if (pssData.page == PSS_PAGE_BATTLE_MOVES && (pssData.selectedMoveIndex != 4 || pssData.moveToLearn != 0))
- {
Menu_EraseWindowRect(0, 14, 9, 18);
- }
-
SummaryScreenHandleLeftRightInput(taskId, 1);
}
}
@@ -1645,9 +1095,7 @@ static bool8 MonKnowsMultipleMoves(struct Pokemon *mon)
for (i = 1; i < 4; i++)
{
if (GetMonMove(mon, i))
- {
return TRUE;
- }
}
return FALSE;
@@ -1758,13 +1206,9 @@ static void sub_809E83C(u8 taskId, s8 b)
if (pssData.selectedMoveIndex != pssData.switchMoveIndex)
{
if (pssData.usingPC == FALSE)
- {
sub_809E5C4();
- }
else
- {
sub_809E6D8();
- }
pssData.selectedMoveIndex = pssData.switchMoveIndex;
sub_809F678(&pssData.loadedMon);
@@ -2031,7 +1475,7 @@ static void sub_809EB40(u8 taskId)
}
}
-/*static*/ void sub_809EBC4(void)
+static void sub_809EBC4(void)
{
if (pssData.page != PSS_PAGE_INFO)
{
@@ -2060,36 +1504,24 @@ void sub_809EC38(u8 taskId)
if (pssData.bgToggle == 0)
{
if (pssData.page != PSS_PAGE_INFO)
- {
gBattle_BG2_X = 0x100;
- }
if (pssData.page == PSS_PAGE_SKILLS)
- {
REG_BG2CNT = (REG_BG2CNT & 0xE0FF) + 0x800;
- }
if (pssData.page == PSS_PAGE_BATTLE_MOVES)
- {
REG_BG2CNT = (REG_BG2CNT & 0xE0FF) + 0xA00;
- }
}
else
{
if (pssData.page != PSS_PAGE_INFO)
- {
gBattle_BG1_X = 0x100;
- }
if (pssData.page == PSS_PAGE_SKILLS)
- {
REG_BG1CNT = (REG_BG1CNT & 0xE0FF) + 0x800;
- }
if (pssData.page == PSS_PAGE_BATTLE_MOVES)
- {
REG_BG1CNT = (REG_BG1CNT & 0xE0FF) + 0xA00;
- }
}
taskData[0]++;
@@ -2131,19 +1563,12 @@ void sub_809EC38(u8 taskId)
else
{
if (pssData.page >= PSS_PAGE_BATTLE_MOVES && (!pssData.disableMoveOrderEditing || pssData.mode == PSS_MODE_NO_MOVE_ORDER_EDIT))
- {
pssData.headerActionTextId = 6;
- }
else if (pssData.page == PSS_PAGE_INFO)
- {
pssData.headerActionTextId = 7;
- }
else
- {
pssData.headerActionTextId = 0;
- }
}
-
taskData[0]++;
break;
case 3:
@@ -2158,26 +1583,21 @@ void sub_809EC38(u8 taskId)
break;
case 5:
if (sub_8055870() != TRUE)
- {
gTasks[taskId].func = gUnknown_03005CF0;
- }
break;
}
}
void sub_809EE74(u8 taskId)
{
- int var1;
- u8 minus2;
s16 *taskData = gTasks[taskId].data;
switch (taskData[0])
{
case 0:
- var1 = pssData.bgToggle;
- if (var1 == 0)
+ if (pssData.bgToggle == 0)
{
- gBattle_BG2_X = pssData.bgToggle;
+ gBattle_BG2_X = 0;
taskData[0]++;
}
else
@@ -2219,27 +1639,20 @@ void sub_809EE74(u8 taskId)
case 2:
if (pssData.bgToggle == 0)
{
- int var2 = gBattle_BG2_X + 0x20;
- gBattle_BG2_X = var2;
- if ((var2 << 16) == 0x1000000)
- {
+ gBattle_BG2_X += 32;
+ if (gBattle_BG2_X == 0x100)
taskData[0]++;
- }
}
else
{
- int var2 = gBattle_BG1_X + 0x20;
- gBattle_BG1_X = var2;
- if ((var2 << 16) == 0x1000000)
- {
+ gBattle_BG1_X += 32;
+ if (gBattle_BG1_X == 0x100)
taskData[0]++;
- }
}
break;
case 3:
pssData.headerTextId = pssData.page + 1;
- minus2 = pssData.mode - 2;
- if (minus2 < 2)
+ if (pssData.mode == 2 || pssData.mode == 3)
{
pssData.headerActionTextId = 0;
sub_80A029C(&pssData.loadedMon);
@@ -2249,19 +1662,12 @@ void sub_809EE74(u8 taskId)
else
{
if (pssData.page >= PSS_PAGE_BATTLE_MOVES && (!pssData.disableMoveOrderEditing || pssData.mode == PSS_MODE_NO_MOVE_ORDER_EDIT))
- {
pssData.headerActionTextId = 6;
- }
else if (pssData.page == PSS_PAGE_INFO)
- {
pssData.headerActionTextId = 7;
- }
else
- {
pssData.headerActionTextId = 0;
- }
}
-
taskData[0]++;
break;
case 4:
@@ -2276,9 +1682,7 @@ void sub_809EE74(u8 taskId)
break;
case 6:
if (sub_8055870() != TRUE)
- {
gTasks[taskId].func = gUnknown_03005CF0;
- }
break;
}
}
@@ -2305,9 +1709,10 @@ static void SummaryScreenHandleLeftRightInput(u8 taskId, s8 direction)
{
if (!GetMonData(&pssData.loadedMon, MON_DATA_IS_EGG))
{
- if (direction == -1 && pssData.page == pssData.firstPage) return;
- if (direction == 1 && pssData.page == pssData.lastPage) return;
-
+ if (direction == -1 && pssData.page == pssData.firstPage)
+ return;
+ if (direction == 1 && pssData.page == pssData.lastPage)
+ return;
if (FindTaskIdByFunc(sub_80A1334) == 0xFF && FindTaskIdByFunc(sub_80A1500) == 0xFF)
{
PlaySE(SE_SELECT);
@@ -2580,11 +1985,8 @@ bool8 sub_809F310(struct Pokemon *mon)
if (GetMonData(mon, MON_DATA_SPECIES))
{
if (pssData.page != PSS_PAGE_INFO || !GetMonData(mon, MON_DATA_IS_EGG))
- {
return TRUE;
- }
}
-
return FALSE;
}
@@ -2594,14 +1996,9 @@ s8 sub_809F344(u8 partyIndex)
{
partyIndex++;
if (partyIndex == PARTY_SIZE)
- {
return -1;
- }
-
if (sub_809F310(&gPlayerParty[sDoubleBattlePartyOrder[partyIndex]]) == TRUE)
- {
return sDoubleBattlePartyOrder[partyIndex];
- }
}
}
@@ -2610,15 +2007,10 @@ s8 sub_809F388(u8 partyIndex)
while (1)
{
if (partyIndex == 0)
- {
return -1;
- }
-
partyIndex--;
if (sub_809F310(&gPlayerParty[sDoubleBattlePartyOrder[partyIndex]]) == TRUE)
- {
return sDoubleBattlePartyOrder[partyIndex];
- }
}
}
@@ -2637,18 +2029,11 @@ s8 sub_809F3CC(s8 direction)
}
if ((direction == -1 && monIndex == 0) || (direction == 1 && monIndex == 5))
- {
return -1;
- }
-
if (direction != 1)
- {
return sub_809F388(monIndex);
- }
else if (monIndex != 5)
- {
return sub_809F344(monIndex);
- }
return -1;
}
@@ -2677,10 +2062,7 @@ void sub_809F43C(u8 taskId)
case 4:
sub_809F678(&pssData.loadedMon);
if (GetMonStatusAndPokerus(&pssData.loadedMon))
- {
sub_80A12D0(2);
- }
-
DrawPokerusSurvivorDot(&pssData.loadedMon);
gMain.state++;
break;
@@ -2689,14 +2071,9 @@ void sub_809F43C(u8 taskId)
{
pssData.loadGfxState = 0;
if (GetMonData(&pssData.loadedMon, MON_DATA_IS_EGG))
- {
gBattle_BG3_X = 256;
- }
else
- {
gBattle_BG3_X = 0;
- }
-
gMain.state++;
}
break;
@@ -2848,10 +2225,7 @@ static bool8 sub_809F7D0(u8 taskId)
sub_809F678(&mon);
move = GetMonMove(&mon, pssData.selectedMoveIndex);
if (IsHMMove(move) == TRUE && pssData.mode != PSS_MODE_UNKNOWN)
- {
return FALSE;
- }
-
return TRUE;
}
@@ -2884,9 +2258,7 @@ void sub_809F814(u8 taskId)
if (pssData.page != PSS_PAGE_BATTLE_MOVES)
{
if (pssData.page == PSS_PAGE_CONTEST_MOVES && (pssData.selectedMoveIndex != 4 || pssData.moveToLearn != 0))
- {
Menu_EraseWindowRect(0, 14, 9, 18);
- }
gTasks[taskId].func = sub_809E260;
@@ -2900,9 +2272,7 @@ void sub_809F814(u8 taskId)
if (pssData.page != pssData.lastPage)
{
if (pssData.page == PSS_PAGE_BATTLE_MOVES && (pssData.selectedMoveIndex != 4 || pssData.moveToLearn != 0))
- {
Menu_EraseWindowRect(0, 14, 9, 18);
- }
gTasks[taskId].func = sub_809E260;
@@ -3055,9 +2425,7 @@ static void sub_809FBE4(void)
u8 i;
for (i = 0; i < 28; i++)
- {
sub_80A1918(i, 1);
- }
Menu_EraseWindowRect(11, 4, 29, 18);
}
@@ -3079,9 +2447,7 @@ static void sub_809FC34(struct Pokemon *mon)
u8 ability;
for (i = 0; i < 5; i++)
- {
sub_80A1918(i, 1);
- }
Menu_EraseWindowRect(11, 9, 28, 12);
if (GetMonData(mon, MON_DATA_IS_EGG))
@@ -3101,21 +2467,13 @@ static void sub_809FC34(struct Pokemon *mon)
friendship = GetMonData(mon, MON_DATA_FRIENDSHIP);
if (friendship < 6)
- {
Menu_PrintText(gOtherText_EggAbout, 11, 9);
- }
else if (friendship < 11)
- {
Menu_PrintText(gOtherText_EggSoon, 11, 9);
- }
else if (friendship < 41)
- {
Menu_PrintText(gOtherText_EggSomeTime, 11, 9);
- }
else
- {
Menu_PrintText(gOtherText_EggLongTime, 11, 9);
- }
PokemonSummaryScreen_PrintEggTrainerMemo(mon, 11, 14);
}
@@ -3130,13 +2488,9 @@ static void sub_809FC34(struct Pokemon *mon)
buffer = StringCopy(buffer, gOtherText_OriginalTrainer);
if (GetMonData(mon, MON_DATA_OT_GENDER) == MALE)
- {
buffer = sub_80A1E58(buffer, 9);
- }
else
- {
buffer = sub_80A1E58(buffer, 10);
- }
buffer = StringCopy(buffer, gStringVar2);
buffer[0] = EXT_CTRL_CODE_BEGIN;
@@ -3150,9 +2504,7 @@ static void sub_809FC34(struct Pokemon *mon)
species = GetMonData(mon, MON_DATA_SPECIES);
sub_80A198C(gBaseStats[species].type1, 120, 48, 0);
if (gBaseStats[species].type1 != gBaseStats[species].type2)
- {
sub_80A198C(gBaseStats[species].type2, 160, 48, 1);
- }
ability = GetAbilityBySpecies(GetMonData(mon, MON_DATA_SPECIES), GetMonData(mon, MON_DATA_ALT_ABILITY));
sub_80A1FF8(gAbilityNames[ability], 13, 11, 9);
@@ -3197,9 +2549,7 @@ static void sub_809FF64(struct Pokemon *mon)
u8 *buffer;
for (i = 0; i < 5; i++)
- {
sub_80A1918(i, 1);
- }
heldItem = GetMonData(mon, MON_DATA_HELD_ITEM);
PrintHeldItemName(heldItem, 11, 4);
@@ -3289,13 +2639,9 @@ static void sub_80A015C(struct Pokemon *mon)
else
{
if (pssData.page == PSS_PAGE_BATTLE_MOVES)
- {
sub_80A198C(gBattleMoves[move].type, 87, ((2 * i) + 4) * 8, i);
- }
else
- {
sub_80A198C(gContestMoves[move].contestCategory + 18, 87, ((2 * i) + 4) * 8, i);
- }
sub_80A1FF8(gMoveNames[move], 13, 15, (2 * i) + 4);
GetStringCenterAlignXOffset(1, 24, (2 * i) + 4);
@@ -3351,9 +2697,7 @@ static void sub_80A0390(void)
u8 i;
for (i = 0; i < MAX_MON_MOVES; i++)
- {
Menu_EraseWindowRect(15, (i * 2) + 4, 28, (i * 2) + 5);
- }
}
u16 sub_80A03BC(struct Pokemon *mon, u8 selectedMoveIndex)
@@ -3367,13 +2711,9 @@ u16 sub_80A03BC(struct Pokemon *mon, u8 selectedMoveIndex)
else
{
if (pssData.moveToLearn != 0)
- {
move = pssData.moveToLearn;
- }
else
- {
move = 0xFFFF;
- }
}
return move;
@@ -3400,61 +2740,56 @@ static void sub_80A0428(struct Pokemon *mon, u8 *selectedMoveIndex)
Menu_EraseWindowRect(11, 15, 28, 18);
if (pssData.page == PSS_PAGE_BATTLE_MOVES)
- {
sub_80A046C(move);
- }
else
- {
sub_80A0498(move);
- }
sub_80A03F0(mon, selectedMoveIndex);
}
static void sub_80A046C(u16 move)
{
- if (move == 0xFFFF) return;
-
- Menu_PrintText(gMoveDescriptions[move - 1], 11, 15);
+ if (move != 0xFFFF)
+ Menu_PrintText(gMoveDescriptions[move - 1], 11, 15);
}
static void sub_80A0498(u16 move)
{
- if (move == 0xFFFF) return;
-
- Menu_PrintText(gContestEffectStrings[gContestMoves[move].effect], 11, 15);
+ if (move != 0xFFFF)
+ Menu_PrintText(gContestEffectStrings[gContestMoves[move].effect], 11, 15);
}
static void sub_80A04CC(u16 move)
{
u8 *buffer;
- if (move == 0xFFFF) return;
-
- if (gBattleMoves[move].power <= 1)
- {
- buffer = gStringVar1;
- buffer = sub_8072C74(buffer, gOtherText_ThreeDashes2, 21, 1);
- Menu_PrintText(gStringVar1, 7, 15);
- }
- else
+ if (move != 0xFFFF)
{
- buffer = gStringVar1;
- buffer = sub_8072C14(buffer, gBattleMoves[move].power, 21, 1);
- Menu_PrintText(gStringVar1, 7, 15);
- }
+ if (gBattleMoves[move].power <= 1)
+ {
+ buffer = gStringVar1;
+ buffer = sub_8072C74(buffer, gOtherText_ThreeDashes2, 21, 1);
+ Menu_PrintText(gStringVar1, 7, 15);
+ }
+ else
+ {
+ buffer = gStringVar1;
+ buffer = sub_8072C14(buffer, gBattleMoves[move].power, 21, 1);
+ Menu_PrintText(gStringVar1, 7, 15);
+ }
- if (gBattleMoves[move].accuracy == 0)
- {
- buffer = gStringVar1;
- buffer = sub_8072C74(buffer, gOtherText_ThreeDashes2, 21, 1);
- Menu_PrintText(gStringVar1, 7, 17);
- }
- else
- {
- buffer = gStringVar1;
- buffer = sub_8072C14(buffer, gBattleMoves[move].accuracy, 21, 1);
- Menu_PrintText(gStringVar1, 7, 17);
+ if (gBattleMoves[move].accuracy == 0)
+ {
+ buffer = gStringVar1;
+ buffer = sub_8072C74(buffer, gOtherText_ThreeDashes2, 21, 1);
+ Menu_PrintText(gStringVar1, 7, 17);
+ }
+ else
+ {
+ buffer = gStringVar1;
+ buffer = sub_8072C14(buffer, gBattleMoves[move].accuracy, 21, 1);
+ Menu_PrintText(gStringVar1, 7, 17);
+ }
}
}
@@ -3470,9 +2805,7 @@ static void sub_80A057C(u16 move)
appeal = gContestEffects[gContestMoves[move].effect].appeal;
if (appeal != 0xFF)
- {
appeal = appeal / 10;
- }
for (i = 0; i < 8; i++)
{
@@ -3480,9 +2813,7 @@ static void sub_80A057C(u16 move)
int and = 3;
int offset = 0x3CC / 2;
if (appeal != 0xFF && i < appeal)
- {
tile = 0x103A;
- }
*(&vramAddr[(i >> 2 << 5) + (i & and)] + offset) = tile;
}
@@ -3706,12 +3037,8 @@ static void PokemonSummaryScreen_PrintTrainerMemo(struct Pokemon *mon, u8 left,
#if ENGLISH
ptr = sub_80A1E9C(ptr, gNatureNames[nature], 14);
-
if (nature != NATURE_BOLD && nature != NATURE_GENTLE)
- {
ptr = StringCopy(ptr, gOtherText_Terminator4);
- }
-
ptr = StringCopy(ptr, gOtherText_Nature);
#elif GERMAN
ptr = StringCopy(gStringVar4, gOtherText_Nature);
@@ -3926,20 +3253,14 @@ static void PrintNumRibbons(struct Pokemon *mon)
static void PrintHeldItemName(u16 itemId, u8 left, u8 top)
{
if (itemId == ITEM_ENIGMA_BERRY
- && sub_80F9344() == TRUE
- && IsLinkDoubleBattle() == TRUE
- && (pssData.monIndex == 1 || pssData.monIndex == 4 || pssData.monIndex == 5))
- {
- StringCopy(gStringVar1, ItemId_GetItem(itemId)->name);
- }
+ && sub_80F9344() == TRUE
+ && IsLinkDoubleBattle() == TRUE
+ && (pssData.monIndex == 1 || pssData.monIndex == 4 || pssData.monIndex == 5))
+ StringCopy(gStringVar1, ItemId_GetName(itemId));
else if (itemId == 0)
- {
StringCopy(gStringVar1, gOtherText_None);
- }
else
- {
CopyItemName(itemId, gStringVar1);
- }
Menu_PrintText(sUnknown_083C15B4, left, top);
}
@@ -3995,13 +3316,9 @@ static void DrawExperienceProgressBar(struct Pokemon *mon, u8 left, u8 top)
u16 baseTile = 0x2062;
if (numExpProgressBarTicks > 7)
- {
tile = 0x206A; // full exp. bar block
- }
else
- {
tile = (numExpProgressBarTicks % 8) + baseTile;
- }
vramAddr[i] = tile;
@@ -4657,13 +3974,9 @@ static void sub_80A12D0(s8 a)
gTasks[newTaskId].data[0] = a;
if (a < 0)
- {
gTasks[newTaskId].data[1] = 10;
- }
else
- {
gTasks[newTaskId].data[1] = 0;
- }
gTasks[newTaskId].data[2] = 1;
}
@@ -4915,26 +4228,18 @@ static void sub_80A1488(s8 a, u8 b)
u8 taskId;
if (pssData.page == PSS_PAGE_BATTLE_MOVES)
- {
Menu_EraseWindowRect(0, 14, 9, 19);
- }
taskId = FindTaskIdByFunc(sub_80A1334);
if (taskId == 0xFF)
- {
taskId = CreateTask(sub_80A1334, 0);
- }
- gTasks[taskId].data[0] = (s8)a;
+ gTasks[taskId].data[0] = a;
- if ((s8)a < 0)
- {
+ if (a < 0)
gTasks[taskId].data[1] = 10;
- }
else
- {
gTasks[taskId].data[1] = 0;
- }
gTasks[taskId].data[2] = 0;
gTasks[taskId].data[3] = b;
@@ -5117,26 +4422,18 @@ static void sub_80A1654(s8 a, u8 b)
u8 taskId;
if (pssData.page == PSS_PAGE_CONTEST_MOVES)
- {
Menu_EraseWindowRect(0, 14, 9, 19);
- }
taskId = FindTaskIdByFunc(sub_80A1500);
if (taskId == 0xFF)
- {
taskId = CreateTask(sub_80A1500, 0);
- }
- gTasks[taskId].data[0] = (s8)a;
+ gTasks[taskId].data[0] = a;
- if ((s8)a < 0)
- {
+ if (a < 0)
gTasks[taskId].data[1] = 10;
- }
else
- {
gTasks[taskId].data[1] = 0;
- }
gTasks[taskId].data[2] = 0;
gTasks[taskId].data[3] = b;
@@ -5374,13 +4671,9 @@ u8 sub_80A1808(struct Pokemon *mon)
gSprites[spriteId].callback = sub_80A1888;
if (!IsPokeSpriteNotFlipped(species))
- {
- gSprites[spriteId].hFlip = 1;
- }
+ gSprites[spriteId].hFlip = TRUE;
else
- {
- gSprites[spriteId].hFlip = 0;
- }
+ gSprites[spriteId].hFlip = FALSE;
return spriteId;
}
@@ -5392,20 +4685,16 @@ static void sub_80A1888(struct Sprite *sprite)
sprite->callback = SpriteCallbackDummy;
if (!GetMonData(&pssData.loadedMon, MON_DATA_IS_EGG))
- {
PlayCry1(sprite->data[0], 0);
- }
}
}
-/*static*/ void sub_80A18C4(void)
+static void sub_80A18C4(void)
{
u8 i;
for (i = 0; i < 30; i++)
- {
ewram1A000[i] = 0xFF;
- }
}
static void sub_80A18E4(u8 a)
@@ -5422,16 +4711,14 @@ static void sub_80A1918(u8 a, u8 invisible)
gSprites[ewram1A000[a]].invisible = invisible;
}
-/*static*/ void sub_80A1950(void)
+static void sub_80A1950(void)
{
u8 i;
for (i = 0; i < 5; i++)
{
if (ewram1A000[i] == 0xFF)
- {
ewram1A000[i] = CreateSprite(&sSpriteTemplate_83C11C0, 0, 0, 2);
- }
sub_80A1918(i, 1);
}
@@ -5457,9 +4744,7 @@ static void sub_80A1A30(u8 a)
if (pssData.page >= PSS_PAGE_BATTLE_MOVES)
{
if (a == 9)
- {
subPriority = 1;
- }
for (i = 0; i < 10; i++)
{
@@ -5467,17 +4752,11 @@ static void sub_80A1A30(u8 a)
ewram1A000[a + i] = CreateSprite(&sSpriteTemplate_83C1280, x, 40, subPriority);
if (i == 0)
- {
StartSpriteAnim(&gSprites[ewram1A000[a]], 4);
- }
else if (i == 9)
- {
StartSpriteAnim(&gSprites[ewram1A000[a + i]], 5);
- }
else
- {
StartSpriteAnim(&gSprites[ewram1A000[a + i]], 6);
- }
gSprites[ewram1A000[a + i]].callback = sub_80A1BC0;
gSprites[ewram1A000[a + i]].data[0] = a;
@@ -5491,9 +4770,7 @@ static void sub_80A1B1C(u8 a)
u8 i;
for (i = 0; i < 10; i++)
- {
sub_80A18E4(a + i);
- }
}
static void sub_80A1B40(u8 a)
@@ -5504,28 +4781,21 @@ static void sub_80A1B40(u8 a)
StartSpriteAnim(&gSprites[ewram1A000[9]], a + 4);
for (i = 0; i < 8; i++)
- {
StartSpriteAnim(&gSprites[ewram1A000[10 + i]], a + 6);
- }
StartSpriteAnim(&gSprites[ewram1A000[18]], a + 5);
}
static void sub_80A1BC0(struct Sprite *sprite)
{
- u8 animNum = sprite->animNum - 4;
- if (animNum < 3)
+ if (sprite->animNum == 4 || sprite->animNum == 5 || sprite->animNum == 6)
{
sprite->data[1] = (sprite->data[1] + 1) & 0x1F;
if (sprite->data[1] > 24)
- {
- sprite->invisible = 1;
- }
+ sprite->invisible = TRUE;
else
- {
- sprite->invisible = 0;
- }
+ sprite->invisible = FALSE;
}
else
{
@@ -5534,69 +4804,23 @@ static void sub_80A1BC0(struct Sprite *sprite)
}
if (sprite->data[0] == 9)
- {
sprite->pos2.y = pssData.selectedMoveIndex * 16;
- }
else
- {
sprite->pos2.y = pssData.switchMoveIndex * 16;
- }
}
-__attribute__((naked))
+#define shared1A009 ((u8 *)(gSharedMem + 0x1A009))
+
void sub_80A1C30(u8 a)
{
- asm(".syntax unified\n\
- push {r4-r7,lr}\n\
- lsls r0, 24\n\
- lsrs r4, r0, 24\n\
- lsls r0, r4, 2\n\
- adds r0, r4\n\
- lsls r0, 25\n\
- lsrs r3, r0, 24\n\
- adds r4, r3, 0\n\
- adds r0, r3, 0\n\
- adds r0, 0xA\n\
- cmp r3, r0\n\
- bge _080A1C82\n\
- ldr r5, _080A1C88 @ =gSprites\n\
- movs r7, 0x5\n\
- negs r7, r7\n\
- ldr r6, _080A1C8C @ =gSharedMem + 0x1A009\n\
-_080A1C50:\n\
- adds r2, r3, r6\n\
- ldrb r1, [r2]\n\
- lsls r0, r1, 4\n\
- adds r0, r1\n\
- lsls r0, 2\n\
- adds r0, r5\n\
- movs r1, 0\n\
- strh r1, [r0, 0x30]\n\
- ldrb r0, [r2]\n\
- lsls r1, r0, 4\n\
- adds r1, r0\n\
- lsls r1, 2\n\
- adds r1, r5\n\
- adds r1, 0x3E\n\
- ldrb r2, [r1]\n\
- adds r0, r7, 0\n\
- ands r0, r2\n\
- strb r0, [r1]\n\
- adds r0, r3, 0x1\n\
- lsls r0, 24\n\
- lsrs r3, r0, 24\n\
- adds r0, r4, 0\n\
- adds r0, 0xA\n\
- cmp r3, r0\n\
- blt _080A1C50\n\
-_080A1C82:\n\
- pop {r4-r7}\n\
- pop {r0}\n\
- bx r0\n\
- .align 2, 0\n\
-_080A1C88: .4byte gSprites\n\
-_080A1C8C: .4byte gSharedMem + 0x1A009\n\
- .syntax divided\n");
+ u8 r3;
+
+ a *= 10;
+ for (r3 = a; r3 < a + 10; r3++)
+ {
+ gSprites[shared1A009[r3]].data[1] = 0;
+ gSprites[shared1A009[r3]].invisible = FALSE;
+ }
}
u8 pokemon_ailments_get_primary(u32 status)
@@ -5620,21 +4844,15 @@ u8 GetMonStatusAndPokerus(struct Pokemon *mon)
u8 statusAilment;
if (GetMonData(mon, MON_DATA_HP) == 0)
- {
return 7;
- }
statusAilment = pokemon_ailments_get_primary(GetMonData(mon, MON_DATA_STATUS));
if (statusAilment == 0)
{
if (!CheckPartyPokerus(mon, 0))
- {
return 0;
- }
else
- {
return 6;
- }
}
return statusAilment;
@@ -5655,9 +4873,7 @@ void sub_80A1D18(void)
statusAndPkrs2 = statusAndPkrs - 1;
if (ewram1A000[29] == 0xFF)
- {
ewram1A000[29] = CreateSprite(&sSpriteTemplate_83C1304, 64, 152, 0);
- }
}
else
{
@@ -5763,10 +4979,9 @@ static u8 *sub_80A1E58(u8 *text, u8 id)
if (id != 0xFF)
{
const u8 *ptr = sUnknown_083C15BC;
+
while (*ptr != 0xFF && *ptr != id)
- {
ptr += 4;
- }
text[0] = EXT_CTRL_CODE_BEGIN;
text[1] = 4;
@@ -5836,9 +5051,7 @@ u8 *PokemonSummaryScreen_CopyPokemonLevel(u8 *dest, u8 level)
dest++;
if (level == 0)
- {
level = 5;
- }
ConvertIntToDecimalString(buffer, level);
dest = sub_80A1E9C(dest, buffer, 14);
@@ -5857,7 +5070,5 @@ static void sub_80A2078(int taskId)
static void sub_80A20A8(u8 taskId)
{
if (sub_8055870() != TRUE)
- {
gTasks[taskId].func = gUnknown_03005CF0;
- }
}