summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2018-01-08 22:05:43 -0500
committerPikalaxALT <pikalaxalt@gmail.com>2018-01-08 22:05:43 -0500
commite2ff8b73c7e17777be8c4065a93e8727768bb914 (patch)
tree82662844fe76ab4347a62330a2ccd8efa70e6ba9 /src
parent2fe1da46d9dda22fbe2184a53f71d5e2b8f03aba (diff)
through sub_8097BA0; fix calls to pc_screen_effect from scene/hall_of_fame
Diffstat (limited to 'src')
-rw-r--r--src/pokemon/pokemon_storage_system.c130
-rw-r--r--src/scene/hall_of_fame.c35
2 files changed, 140 insertions, 25 deletions
diff --git a/src/pokemon/pokemon_storage_system.c b/src/pokemon/pokemon_storage_system.c
index 0f2350df2..daae82df6 100644
--- a/src/pokemon/pokemon_storage_system.c
+++ b/src/pokemon/pokemon_storage_system.c
@@ -177,6 +177,7 @@ void sub_8099310(void);
bool8 sub_8099374(void);
void sub_8099958(void);
bool8 sub_8099990(void);
+void sub_809BB90(void);
void sub_8099BF8(u8 a0);
void sub_8099C70(u8 whichBox);
bool8 sub_8099D34(void);
@@ -670,7 +671,7 @@ void ShowPokemonStorageSystem(void)
ScriptContext2_Enable();
}
-void sub_8096130(void)
+void FieldCB_ReturnToOverworld(void)
{
u8 taskId = CreateTask(Task_PokemonStorageSystem, 80);
gTasks[taskId].data[0] = 0;
@@ -688,7 +689,7 @@ void StorageSystemCreatePrimaryMenu(u8 whichMenu)
void sub_80961A8(void)
{
gUnknown_02038474 = gPokemonStorageSystemPtr->unk_0005;
- gFieldCallback = sub_8096130;
+ gFieldCallback = FieldCB_ReturnToOverworld;
SetMainCallback2(c2_exit_to_overworld_2_switch);
}
@@ -1947,6 +1948,131 @@ void sub_8097974(void)
}
}
+void sub_8097A64(void)
+{
+ switch (ePokemonStorageSystem.unk_0004)
+ {
+ case 0:
+ PrintStorageActionText(PC_TEXT_JUMP_TO_WHICH_BOX);
+ sub_8096264(&ePokemonStorageSystem.unk_2370, 0x0007, 0xdaca, 3);
+ sub_809634C(gPokemonStorage.currentBox);
+ ePokemonStorageSystem.unk_0004++;
+ break;
+ case 1:
+ ePokemonStorageSystem.unk_08b2 = sub_8096368();
+ switch (ePokemonStorageSystem.unk_08b2)
+ {
+ case 200:
+ break;
+ default:
+ sub_8098A5C();
+ sub_809635C();
+ sub_8096310();
+ if (ePokemonStorageSystem.unk_08b2 == 201 || ePokemonStorageSystem.unk_08b2 == gPokemonStorage.currentBox)
+ {
+ sub_809A860(1);
+ SetPSSCallback(sub_8096C84);
+ }
+ else
+ {
+ ePokemonStorageSystem.unk_0004++;
+ }
+ break;
+ }
+ break;
+ case 2:
+ sub_8099C70(ePokemonStorageSystem.unk_08b2);
+ ePokemonStorageSystem.unk_0004++;
+ break;
+ case 3:
+ if (!sub_8099D34())
+ {
+ gPokemonStorage.currentBox = ePokemonStorageSystem.unk_08b2;
+ SetPSSCallback(sub_8096C84);
+ }
+ break;
+ }
+}
+
+void sub_8097B44(void)
+{
+ switch (ePokemonStorageSystem.unk_0004)
+ {
+ case 0:
+ sub_809BB90();
+ BeginNormalPaletteFade(0xffffffff, 0, 0, 16, 0);
+ ePokemonStorageSystem.unk_0004++;
+ break;
+ case 1:
+ if (!UpdatePaletteFade())
+ {
+ gUnknown_0203847F = 1;
+ ePokemonStorageSystem.unk_0006 = 1;
+ SetMainCallback2(sub_8096B5C);
+ }
+ break;
+ }
+}
+
+void sub_8097BA0(void)
+{
+ switch (ePokemonStorageSystem.unk_0004)
+ {
+ case 0:
+ if (sub_809BF20())
+ {
+ PlaySE(SE_HAZURE);
+ PrintStorageActionText(PC_TEXT_HOLDING_POKE);
+ ePokemonStorageSystem.unk_0004 = 1;
+ }
+ else
+ {
+ PlaySE(SE_SELECT);
+ PrintStorageActionText(PC_TEXT_EXIT_BOX);
+ sub_8098A38(0);
+ ePokemonStorageSystem.unk_0004 = 2;
+ }
+ break;
+ case 1:
+ if (gMain.newKeys & (A_BUTTON | B_BUTTON | DPAD_ANY))
+ {
+ sub_8098A5C();
+ SetPSSCallback(sub_8096C84);
+ }
+ break;
+ case 2:
+ switch (ProcessMenuInputNoWrap())
+ {
+ case 1:
+ case -1:
+ sub_8098A5C();
+ SetPSSCallback(sub_8096C84);
+ break;
+ case 0:
+ PlaySE(SE_PC_OFF);
+ sub_8098A5C();
+ ePokemonStorageSystem.unk_0004++;
+ break;
+ }
+ break;
+ case 3:
+ ePokemonStorageSystem.unk_000c.tileTag = 0x000e;
+ ePokemonStorageSystem.unk_000c.paletteTag = 0xdad0;
+ ePokemonStorageSystem.unk_000c.unk04 = 20;
+ ePokemonStorageSystem.unk_000c.unk06 = 0;
+ sub_80C5E38(&ePokemonStorageSystem.unk_000c);
+ ePokemonStorageSystem.unk_0004++;
+ break;
+ case 4:
+ if (sub_80C5F98())
+ {
+ gPlayerPartyCount = CalculatePlayerPartyCount();
+ SetMainCallback2(sub_80961A8);
+ }
+ break;
+ }
+}
+
asm(".section .text.8098898");
void PrintStorageActionText(u8 index) {
diff --git a/src/scene/hall_of_fame.c b/src/scene/hall_of_fame.c
index 812c28137..ef5e6f873 100644
--- a/src/scene/hall_of_fame.c
+++ b/src/scene/hall_of_fame.c
@@ -90,11 +90,7 @@ static bool8 sub_81438C4(void);
// functions from different files
void sub_81439D0(void);
-void sub_80C5E38(void*); // ?
-bool8 sub_80C5DCC(void);
-bool8 sub_80C5F98(void);
void ReturnFromHallOfFamePC(void);
-u16 SpeciesToPokedexNum(u16 species);
void remove_some_task(void);
// data and gfx
@@ -130,9 +126,10 @@ static const s16 sHallOfFame_MonsHalfTeamPositions[3][4] =
{-41, 214, 184, 64}
};
-static const struct HallofFameMon sDummyFameMon =
+static const struct PCScreenEffectStruct sDummyFameMon =
{
- 0x3EA03EA, 0, 0, 0, {0}
+ .tileTag = 0x3ea,
+ .paletteTag = 0x3ea
};
static const u8 sUnused2[6] = {2, 1, 3, 6, 4, 5};
@@ -800,20 +797,15 @@ void sub_81428CC(void)
}
break;
case 3:
- {
- struct HallofFameMons* fameMons;
-
- REG_BLDCNT = 0;
- REG_BLDALPHA = 0;
- REG_BLDY = 0;
- sub_81435B8();
+ REG_BLDCNT = 0;
+ REG_BLDALPHA = 0;
+ REG_BLDY = 0;
+ sub_81435B8();
- fameMons = eHallOfFameMons1;
- fameMons->mons[0] = sDummyFameMon;
+ eHOFPCScreenEffect = sDummyFameMon;
- sub_80C5CD4((struct PCScreenEffectStruct *)fameMons);
- gMain.state++;
- }
+ sub_80C5CD4(&eHOFPCScreenEffect);
+ gMain.state++;
break;
case 4:
AnimateSprites();
@@ -1022,12 +1014,9 @@ static void sub_8142DF4(u8 taskID)
static void sub_8142F78(u8 taskID)
{
- struct HallofFameMons* fameMons;
-
CpuSet(gPlttBufferFaded, gPlttBufferUnfaded, 0x200);
- fameMons = eHallOfFameMons1;
- fameMons->mons[0] = sDummyFameMon;
- sub_80C5E38(fameMons);
+ eHOFPCScreenEffect = sDummyFameMon;
+ sub_80C5E38(&eHOFPCScreenEffect);
gTasks[taskID].func = sub_8142FCC;
}