summaryrefslogtreecommitdiff
path: root/src/egg_hatch.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/egg_hatch.c')
-rw-r--r--src/egg_hatch.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/src/egg_hatch.c b/src/egg_hatch.c
index 5a2fe5ca2..8914d6ff3 100644
--- a/src/egg_hatch.c
+++ b/src/egg_hatch.c
@@ -25,6 +25,7 @@
#include "window.h"
#include "constants/abilities.h"
#include "daycare.h"
+#include "overworld.h"
#include "battle.h" // to get rid of later
struct EggHatchData
@@ -44,9 +45,6 @@ struct EggHatchData
u8 textColor[3];
};
-extern struct SpriteTemplate gUnknown_0202499C;
-extern void (*gFieldCallback)(void);
-
extern const struct CompressedSpriteSheet gMonFrontPicTable[];
extern const u8 gBattleTextboxTiles[];
extern const u8 gBattleTextboxTilemap[];
@@ -58,20 +56,14 @@ extern const u8 gText_HatchedFromEgg[];
extern const u8 gText_NickHatchPrompt[];
extern u8 sav1_map_get_name(void);
-extern s8 ProcessMenuInputNoWrap_(void);
extern void TVShowConvertInternationalString(u8* str1, u8* str2, u8);
extern void sub_806A068(u16, u8);
extern void FadeScreen(u8, u8);
extern void overworld_free_bg_tilemaps(void);
extern void sub_80AF168(void);
-extern void AllocateMonSpritesGfx(void);
-extern void FreeMonSpritesGfx(void);
extern void ScanlineEffect_Stop(void);
-extern void reset_temp_tile_data_buffers(void);
-extern void c2_exit_to_overworld_2_switch(void);
+extern void CB2_ReturnToField(void);
extern void play_some_sound(void);
-extern void copy_decompressed_tile_data_to_vram_autofree(u8 bg_id, const void* src, u16 size, u16 offset, u8 mode);
-extern void CreateYesNoMenu(const struct WindowTemplate*, u16, u8, u8);
extern void DoNamingScreen(u8, const u8*, u16, u8, u32, MainCallback);
extern u16 sub_80D22D0(void);
extern u8 CountPartyAliveNonEggMonsExcept(u8);
@@ -440,12 +432,12 @@ static u8 EggHatchCreateMonSprite(u8 a0, u8 switchID, u8 pokeID, u16* speciesLoc
HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[species],
gMonSpritesGfxPtr->sprites[(a0 * 2) + 1],
species, pid);
- LoadCompressedObjectPalette(sub_806E794(mon));
+ LoadCompressedObjectPalette(GetMonSpritePalStruct(mon));
*speciesLoc = species;
}
break;
case 1:
- sub_806A068(sub_806E794(mon)->tag, r5);
+ sub_806A068(GetMonSpritePalStruct(mon)->tag, r5);
spriteID = CreateSprite(&gUnknown_0202499C, 120, 75, 6);
gSprites[spriteID].invisible = 1;
gSprites[spriteID].callback = SpriteCallbackDummy;
@@ -571,7 +563,7 @@ static void EggHatchSetMonNickname(void)
SetMonData(&gPlayerParty[gSpecialVar_0x8004], MON_DATA_NICKNAME, gStringVar3);
FreeMonSpritesGfx();
Free(sEggHatchData);
- SetMainCallback2(c2_exit_to_overworld_2_switch);
+ SetMainCallback2(CB2_ReturnToField);
}
static void Task_EggHatchPlayBGM(u8 taskID)
@@ -582,10 +574,10 @@ static void Task_EggHatchPlayBGM(u8 taskID)
play_some_sound();
}
if (gTasks[taskID].data[0] == 1)
- PlayBGM(376);
+ PlayBGM(MUS_ME_SHINKA);
if (gTasks[taskID].data[0] > 60)
{
- PlayBGM(377);
+ PlayBGM(MUS_SHINKA);
DestroyTask(taskID);
// UB: task is destroyed, yet the value is incremented
}
@@ -695,7 +687,7 @@ static void CB2_EggHatch_1(void)
UnsetBgTilemapBuffer(0);
UnsetBgTilemapBuffer(1);
Free(sEggHatchData);
- SetMainCallback2(c2_exit_to_overworld_2_switch);
+ SetMainCallback2(CB2_ReturnToField);
}
break;
}