summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/battle_anim.h18
-rw-r--r--include/battle_main.h2
-rw-r--r--include/constants/battle.h3
-rw-r--r--include/constants/pokemon.h4
-rw-r--r--include/constants/sound.h48
-rw-r--r--include/crt0.h5
-rw-r--r--include/data.h4
-rw-r--r--include/global.h8
-rw-r--r--include/graphics.h6
-rw-r--r--include/item.h1
-rw-r--r--include/load_save.h34
-rw-r--r--include/palette.h8
-rw-r--r--include/pokeball.h2
-rw-r--r--include/pokemon_icon.h2
-rw-r--r--include/save.h129
-rw-r--r--include/sound.h33
-rw-r--r--include/strings.h4
17 files changed, 187 insertions, 124 deletions
diff --git a/include/battle_anim.h b/include/battle_anim.h
index 3f73f1daf..8745b0d26 100644
--- a/include/battle_anim.h
+++ b/include/battle_anim.h
@@ -74,7 +74,7 @@ void HandleIntroSlide(u8 terrainId);
int GetAnimBgAttribute(u8 bgId, u8 attributeId);
// battle_anim_mons.c
-void TranslateSpriteInEllipseOverDuration(struct Sprite *sprite);
+void TranslateSpriteInEllipse(struct Sprite *sprite);
void AnimTranslateLinearAndFlicker(struct Sprite *sprite);
void AnimTranslateLinearAndFlicker_Flipped(struct Sprite *sprite);
void AnimWeatherBallUp(struct Sprite *sprite);
@@ -103,7 +103,7 @@ u8 GetBattlerYCoordWithElevation(u8 battlerId);
void WaitAnimForDuration(struct Sprite *sprite);
void AnimTravelDiagonally(struct Sprite *sprite);
void InitAnimLinearTranslation(struct Sprite *sprite);
-void AnimTranslateLinear_WaitEnd(struct Sprite *sprite);
+void AnimTranslateLinear_WithFollowup(struct Sprite *sprite);
u8 GetBattlerSpriteBGPriority(u8 battlerId);
void *LoadPointerFromVars(s16 bottom, s16 top);
void StorePointerInVars(s16 *bottom, s16 *top, const void *ptr);
@@ -113,7 +113,7 @@ void GetBattleAnimBgData(struct BattleAnimBgData*, u32 arg1);
u8 GetBattlerSpriteSubpriority(u8 battlerId);
bool8 TranslateAnimHorizontalArc(struct Sprite *sprite);
void sub_80A6630(struct Sprite *sprite);
-void TranslateMonSpriteLinearFixedPoint(struct Sprite *sprite);
+void TranslateSpriteLinearByIdFixedPoint(struct Sprite *sprite);
void ResetSpriteRotScale(u8 spriteId);
void SetSpriteRotScale(u8 spriteId, s16 xScale, s16 yScale, u16 rotation);
void InitSpriteDataForLinearTranslation(struct Sprite *sprite);
@@ -123,12 +123,12 @@ u32 GetBattleBgPalettesMask(u8 battleBackground, u8 attacker, u8 target, u8 atta
u32 GetBattleMonSpritePalettesMask(u8 playerLeft, u8 playerRight, u8 opponentLeft, u8 opponentRight);
u8 AnimDummyReturnArg(u8 battler);
s16 CloneBattlerSpriteWithBlend(u8);
-void obj_delete_but_dont_free_vram(struct Sprite*);
+void DestroySpriteWithActiveSheet(struct Sprite*);
u8 CreateInvisibleSpriteCopy(int, u8, int);
void AnimLoadCompressedBgTilemapHandleContest(struct BattleAnimBgData*, const void*, bool32);
void AnimLoadCompressedBgGfx(u32, const u32*, u32);
void UpdateAnimBg3ScreenSize(bool8);
-void TranslateSpriteInGrowingCircleOverDuration(struct Sprite *);
+void TranslateSpriteInGrowingCircle(struct Sprite *);
void sub_80A653C(struct Sprite *);
void SetBattlerSpriteYOffsetFromYScale(u8 spriteId);
void PrepareEruptAnimTaskData(struct Task *task, u8 a2, s16 a3, s16 a4, s16 a5, s16 a6, u16 a7);
@@ -138,16 +138,16 @@ void AnimLoadCompressedBgTilemap(u32 bgId, const void *src);
void InitAnimFastLinearTranslationWithSpeed(struct Sprite *sprite);
bool8 AnimFastTranslateLinear(struct Sprite *sprite);
void InitAndRunAnimFastLinearTranslation(struct Sprite *sprite);
-void TranslateMonSpriteLinear(struct Sprite *sprite);
+void TranslateSpriteLinearById(struct Sprite *sprite);
void TranslateSpriteLinear(struct Sprite *sprite);
void AnimSpriteOnMonPos(struct Sprite *sprite);
void InitAnimLinearTranslationWithSpeedAndPos(struct Sprite *sprite);
-void TranslateSpriteInCircleOverDuration(struct Sprite *sprite);
+void TranslateSpriteInCircle(struct Sprite *sprite);
void SetGrayscaleOrOriginalPalette(u16 palNum, bool8 restoreOriginal);
void PrepareAffineAnimInTaskData(struct Task *task, u8 spriteId, const union AffineAnimCmd *affineAnimCmds);
bool8 RunAffineAnimFromTaskData(struct Task *task);
void AnimThrowProjectile(struct Sprite *sprite);
-void sub_80A6BFC(struct BattleAnimBgData *unk, u8 unused);
+void GetBgDataForTransform(struct BattleAnimBgData *dest, u8 battlerId);
u8 CreateAdditionalMonSpriteForMoveAnim(u16 species, bool8 isBackpic, u8 a3, s16 x, s16 y, u8 subpriority, u32 personality, u32 trainerId, u32 battlerId, bool32 ignoreDeoxysForm);
void ResetSpriteRotScale_PreserveAffine(struct Sprite *sprite);
void TradeMenuBouncePartySprites(struct Sprite *sprite);
@@ -157,7 +157,7 @@ void SetBattlerSpriteYOffsetFromOtherYScale(u8 spriteId, u8 otherSpriteId);
u8 GetBattlerSide(u8 battler);
u8 GetBattlerPosition(u8 battler);
u8 GetBattlerAtPosition(u8 position);
-void sub_80A64EC(struct Sprite *sprite);
+void ConvertPosDataToTranslateLinearData(struct Sprite *sprite);
void InitAnimFastLinearTranslationWithSpeedAndPos(struct Sprite *sprite);
enum
diff --git a/include/battle_main.h b/include/battle_main.h
index f3e961b7b..b7691b4fd 100644
--- a/include/battle_main.h
+++ b/include/battle_main.h
@@ -65,7 +65,7 @@ void DoBounceEffect(u8 battlerId, u8 b, s8 c, s8 d);
void EndBounceEffect(u8 battlerId, bool8 b);
void SpriteCB_PlayerMonFromBall(struct Sprite *sprite);
void SpriteCB_TrainerThrowObject(struct Sprite *sprite);
-void sub_8039E9C(struct Sprite *sprite);
+void AnimSetCenterToCornerVecX(struct Sprite *sprite);
void BeginBattleIntroDummy(void);
void BeginBattleIntro(void);
void SwitchInClearSetData(void);
diff --git a/include/constants/battle.h b/include/constants/battle.h
index 2534ade4b..d87a800e2 100644
--- a/include/constants/battle.h
+++ b/include/constants/battle.h
@@ -358,4 +358,7 @@
// Flag for BattlePutTextOnWindow. Never set
#define B_WIN_COPYTOVRAM (1 << 7)
+// Indicator for the party summary bar to display an empty slot.
+#define HP_EMPTY_SLOT 0xFFFF
+
#endif // GUARD_CONSTANTS_BATTLE_H
diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h
index af5d0ea8a..9fa023cd5 100644
--- a/include/constants/pokemon.h
+++ b/include/constants/pokemon.h
@@ -339,7 +339,9 @@
#define NUM_MALE_LINK_FACILITY_CLASSES 8
#define NUM_FEMALE_LINK_FACILITY_CLASSES 8
-#define MON_PIC_SIZE (64 * 64 / 2)
+#define MON_PIC_WIDTH 64
+#define MON_PIC_HEIGHT 64
+#define MON_PIC_SIZE (MON_PIC_WIDTH * MON_PIC_HEIGHT / 2)
#define BATTLE_ALIVE_EXCEPT_ACTIVE 0
#define BATTLE_ALIVE_ATK_SIDE 1
diff --git a/include/constants/sound.h b/include/constants/sound.h
new file mode 100644
index 000000000..dc434bcf8
--- /dev/null
+++ b/include/constants/sound.h
@@ -0,0 +1,48 @@
+#ifndef GUARD_CONSTANTS_SOUND_H
+#define GUARD_CONSTANTS_SOUND_H
+
+#define FANFARE_LEVEL_UP 0
+#define FANFARE_OBTAIN_ITEM 1
+#define FANFARE_EVOLVED 2
+#define FANFARE_OBTAIN_TMHM 3
+#define FANFARE_HEAL 4
+#define FANFARE_OBTAIN_BADGE 5
+#define FANFARE_MOVE_DELETED 6
+#define FANFARE_OBTAIN_BERRY 7
+#define FANFARE_AWAKEN_LEGEND 8
+#define FANFARE_SLOTS_JACKPOT 9
+#define FANFARE_SLOTS_WIN 10
+#define FANFARE_TOO_BAD 11
+#define FANFARE_RG_POKE_FLUTE 12
+#define FANFARE_RG_OBTAIN_KEY_ITEM 13
+#define FANFARE_RG_DEX_RATING 14
+#define FANFARE_OBTAIN_B_POINTS 15
+#define FANFARE_OBTAIN_SYMBOL 16
+#define FANFARE_REGISTER_MATCH_CALL 17
+
+#define CRY_MODE_NORMAL 0 // Default
+#define CRY_MODE_DOUBLES 1 // Shortened cry for double battles
+#define CRY_MODE_ENCOUNTER 2 // Used when starting a static encounter, or when a Pokémon is "aggressive"
+#define CRY_MODE_HIGH_PITCH 3 // Highest pitch mode, used exclusively by the move Howl
+#define CRY_MODE_ECHO_START 4 // For 1st half of cry used by the move Hyper Voice. Played in reverse
+#define CRY_MODE_FAINT 5 // Used when a Pokémon faints
+#define CRY_MODE_ECHO_END 6 // For 2nd half of cry used by the move Hyper Voice
+#define CRY_MODE_ROAR_1 7 // For 1st cry used by the move Roar
+#define CRY_MODE_ROAR_2 8 // For 2nd cry used by the move Roar
+#define CRY_MODE_GROWL_1 9 // For 1st cry used by the move Growl. Played in reverse
+#define CRY_MODE_GROWL_2 10 // For 2nd cry used by the move Growl
+#define CRY_MODE_WEAK 11 // Used when a Pokémon is unhealthy
+#define CRY_MODE_WEAK_DOUBLES 12 // Equivalent to CRY_MODE_DOUBLES for CRY_MODE_WEAK
+
+// Given to SoundTask_PlayDoubleCry to determine which cry mode to use. Values are arbitrary
+#define DOUBLE_CRY_ROAR 2
+#define DOUBLE_CRY_GROWL 255
+
+#define CRY_PRIORITY_NORMAL 10
+#define CRY_PRIORITY_AMBIENT 1
+
+// Cry volume was changed from 125 in R/S to 120 for FRLG/Em, but was (accidentally?) not updated outside of sound.c
+#define CRY_VOLUME 120
+#define CRY_VOLUME_RS 125
+
+#endif // GUARD_CONSTANTS_SOUND_H
diff --git a/include/crt0.h b/include/crt0.h
index 3121eeaed..a4a5c7f79 100644
--- a/include/crt0.h
+++ b/include/crt0.h
@@ -1,11 +1,6 @@
#ifndef GUARD_CRT0_H
#define GUARD_CRT0_H
-// Exported type declarations
-
-// Exported RAM declarations
-
-// Exported ROM declarations
extern u32 IntrMain[];
#endif //GUARD_CRT0_H
diff --git a/include/data.h b/include/data.h
index 374435cba..2d3619e67 100644
--- a/include/data.h
+++ b/include/data.h
@@ -21,6 +21,10 @@ struct MonCoords
u8 y_offset;
};
+#define MON_COORDS_SIZE(width, height)(DIV_ROUND_UP(width, 8) << 4 | DIV_ROUND_UP(height, 8))
+#define GET_MON_COORDS_WIDTH(size)((size >> 4) * 8)
+#define GET_MON_COORDS_HEIGHT(size)((size & 0xF) * 8)
+
struct TrainerMonNoItemDefaultMoves
{
u16 iv;
diff --git a/include/global.h b/include/global.h
index dd02a1790..53e9ba134 100644
--- a/include/global.h
+++ b/include/global.h
@@ -120,10 +120,12 @@
f; \
})
-#define ROUND_BITS_TO_BYTES(numBits)(((numBits) / 8) + (((numBits) % 8) ? 1 : 0))
+#define DIV_ROUND_UP(val, roundBy)(((val) / (roundBy)) + (((val) % (roundBy)) ? 1 : 0))
-#define DEX_FLAGS_NO (ROUND_BITS_TO_BYTES(NUM_SPECIES))
-#define NUM_FLAG_BYTES (ROUND_BITS_TO_BYTES(FLAGS_COUNT))
+#define ROUND_BITS_TO_BYTES(numBits) DIV_ROUND_UP(numBits, 8)
+
+#define DEX_FLAGS_NO ROUND_BITS_TO_BYTES(NUM_SPECIES)
+#define NUM_FLAG_BYTES ROUND_BITS_TO_BYTES(FLAGS_COUNT)
struct Coords8
{
diff --git a/include/graphics.h b/include/graphics.h
index eeb8f65a3..e2fe5cf77 100644
--- a/include/graphics.h
+++ b/include/graphics.h
@@ -4637,9 +4637,9 @@ extern const u32 gBattleAnimSpritePal_RedHeart[];
extern const u32 gBattleAnimSpritePal_RedOrb[];
extern const u32 gBattleAnimSpritePal_EyeSparkle[];
extern const u32 gBattleAnimSpritePal_PinkHeart[];
-extern const u32 gBattleAnimBgImage_Attract;
-extern const u32 gBattleAnimBgPalette_Attract;
-extern const u32 gBattleAnimBgTilemap_Attract;
+extern const u32 gBattleAnimBgImage_Attract[];
+extern const u32 gBattleAnimBgPalette_Attract[];
+extern const u32 gBattleAnimBgTilemap_Attract[];
extern const u32 gBattleAnimSpritePal_Angel[];
extern const u32 gBattleAnimSpritePal_Devil[];
extern const u32 gBattleAnimSpritePal_Swipe[];
diff --git a/include/item.h b/include/item.h
index 87ff57bc7..ceca83bd5 100644
--- a/include/item.h
+++ b/include/item.h
@@ -29,6 +29,7 @@ struct BagPocket
u8 capacity;
};
+extern const struct Item gItems[];
extern struct BagPocket gBagPockets[];
void ApplyNewEncryptionKeyToBagItems(u32 newKey);
diff --git a/include/load_save.h b/include/load_save.h
index 2f4a9ace6..309e62e2b 100644
--- a/include/load_save.h
+++ b/include/load_save.h
@@ -1,9 +1,33 @@
#ifndef GUARD_LOAD_SAVE_H
#define GUARD_LOAD_SAVE_H
-extern struct SaveBlock1 gSaveblock1;
-extern struct SaveBlock2 gSaveblock2;
-extern struct PokemonStorage gPokemonStorage;
+#include "pokemon_storage_system.h"
+
+#define SAVEBLOCK_MOVE_RANGE 128
+
+/**
+ * These structs are to prevent them from being reordered on newer or modern
+ * toolchains. If this is not done, the ClearSav functions will end up erasing
+ * the wrong memory leading to various glitches.
+ */
+struct SaveBlock2DMA {
+ struct SaveBlock2 block;
+ u8 dma[SAVEBLOCK_MOVE_RANGE];
+};
+
+struct SaveBlock1DMA {
+ struct SaveBlock1 block;
+ u8 dma[SAVEBLOCK_MOVE_RANGE];
+};
+
+struct PokemonStorageDMA {
+ struct PokemonStorage block;
+ u8 dma[SAVEBLOCK_MOVE_RANGE];
+};
+
+extern struct SaveBlock1DMA gSaveblock1;
+extern struct SaveBlock2DMA gSaveblock2;
+extern struct PokemonStorageDMA gPokemonStorage;
extern bool32 gFlashMemoryPresent;
extern struct SaveBlock1 *gSaveBlock1Ptr;
@@ -24,8 +48,8 @@ void SavePlayerParty(void);
void LoadPlayerParty(void);
void SaveObjectEvents(void);
void LoadObjectEvents(void);
-void SaveSerializedGame(void);
-void LoadSerializedGame(void);
+void CopyPartyAndObjectsToSave(void);
+void CopyPartyAndObjectsFromSave(void);
void LoadPlayerBag(void);
void SavePlayerBag(void);
void ApplyNewEncryptionKeyToHword(u16 *hWord, u32 newKey);
diff --git a/include/palette.h b/include/palette.h
index be2a0dd48..81a1e1cae 100644
--- a/include/palette.h
+++ b/include/palette.h
@@ -58,15 +58,9 @@ void FillPalette(u16, u16, u16);
void TransferPlttBuffer(void);
u8 UpdatePaletteFade(void);
void ResetPaletteFade(void);
-void ReadPlttIntoBuffers(void);
bool8 BeginNormalPaletteFade(u32, s8, u8, u8, u16);
-bool8 unref_sub_8073D3C(u32, u8, u8, u8, u16);
-void unref_sub_8073D84(u8, u32 *);
-void ResetPaletteStructByUid(u16);
-void ResetPaletteStruct(u8);
+void PaletteStruct_ResetById(u16);
void ResetPaletteFadeControl(void);
-void unref_sub_8074168(u16);
-void unref_sub_8074194(u16);
void InvertPlttBuffer(u32);
void TintPlttBuffer(u32, s8, s8, s8);
void UnfadePlttBuffer(u32);
diff --git a/include/pokeball.h b/include/pokeball.h
index d88e80173..297788db1 100644
--- a/include/pokeball.h
+++ b/include/pokeball.h
@@ -26,6 +26,8 @@ enum {
BALL_AFFINE_ANIM_4
};
+extern const struct CompressedSpriteSheet gBallSpriteSheets[];
+extern const struct CompressedSpritePalette gBallSpritePalettes[];
extern const struct SpriteTemplate gBallSpriteTemplates[];
#define POKEBALL_PLAYER_SENDOUT 0xFF
diff --git a/include/pokemon_icon.h b/include/pokemon_icon.h
index 4731da90e..9b917c3bf 100644
--- a/include/pokemon_icon.h
+++ b/include/pokemon_icon.h
@@ -2,6 +2,8 @@
#define GUARD_POKEMON_ICON_H
extern const u8 gMonIconPaletteIndices[];
+extern const u8 *const gMonIconTable[];
+extern const struct SpritePalette gMonIconPaletteTable[];
const u8 *GetMonIconTiles(u16 species, bool32);
void TryLoadAllMonIconPalettesAtOffset(u16 offset);
diff --git a/include/save.h b/include/save.h
index 406e2e492..be7961136 100644
--- a/include/save.h
+++ b/include/save.h
@@ -1,43 +1,43 @@
#ifndef GUARD_SAVE_H
#define GUARD_SAVE_H
-struct SaveSectionLocation
-{
- void *data;
- u16 size;
-};
-
-struct SaveSection
-{
- u8 data[0xFF4];
- u16 id;
- u16 checksum;
- u32 security;
- u32 counter;
-}; // size is 0x1000
-
-// headless save section?
-struct UnkSaveSection
-{
- u8 data[0xFF4];
- u32 security;
-}; // size is 0xFF8
-
-struct SaveSectionOffsets
-{
- u16 toAdd;
- u16 size;
-};
-
-// Each 4 KiB flash sector contains 3968 bytes of actual data followed by a 128 byte footer
+// Each 4 KiB flash sector contains 3968 bytes of actual data followed by a 128 byte footer.
+// Only 12 bytes of the footer are used.
#define SECTOR_DATA_SIZE 3968
#define SECTOR_FOOTER_SIZE 128
#define SECTOR_SIZE (SECTOR_DATA_SIZE + SECTOR_FOOTER_SIZE)
#define NUM_SAVE_SLOTS 2
-#define UNKNOWN_CHECK_VALUE 0x8012025
-#define SPECIAL_SECTION_SENTINEL 0xB39D
+// If the sector's security field is not this value then the sector is either invalid or empty.
+#define SECTOR_SECURITY_NUM 0x8012025
+
+#define SPECIAL_SECTOR_SENTINEL 0xB39D
+
+#define SECTOR_ID_SAVEBLOCK2 0
+#define SECTOR_ID_SAVEBLOCK1_START 1
+#define SECTOR_ID_SAVEBLOCK1_END 4
+#define SECTOR_ID_PKMN_STORAGE_START 5
+#define SECTOR_ID_PKMN_STORAGE_END 13
+#define NUM_SECTORS_PER_SLOT 14
+// Save Slot 1: 0-13; Save Slot 2: 14-27
+#define SECTOR_ID_HOF_1 28
+#define SECTOR_ID_HOF_2 29
+#define SECTOR_ID_TRAINER_HILL 30
+#define SECTOR_ID_RECORDED_BATTLE 31
+#define SECTORS_COUNT 32
+
+#define NUM_HOF_SECTORS 2
+
+#define SAVE_STATUS_EMPTY 0
+#define SAVE_STATUS_OK 1
+#define SAVE_STATUS_CORRUPT 2
+#define SAVE_STATUS_NO_FLASH 4
+#define SAVE_STATUS_ERROR 0xFF
+
+// Special sector id value for certain save functions to
+// indicate that no specific sector should be used.
+#define FULL_SAVE_SLOT 0xFFFF
// SetDamagedSectorBits states
enum
@@ -51,7 +51,7 @@ enum
enum
{
SAVE_NORMAL,
- SAVE_LINK,
+ SAVE_LINK, // Link / Battle Frontier
//EREADER_SAVE, // deprecated in Emerald
SAVE_LINK2, // unknown 2nd link save
SAVE_HALL_OF_FAME,
@@ -59,54 +59,55 @@ enum
SAVE_HALL_OF_FAME_ERASE_BEFORE // unused
};
-#define SECTOR_ID_SAVEBLOCK2 0
-#define SECTOR_ID_SAVEBLOCK1_START 1
-#define SECTOR_ID_SAVEBLOCK1_END 4
-#define SECTOR_ID_PKMN_STORAGE_START 5
-#define SECTOR_ID_PKMN_STORAGE_END 13
-#define NUM_SECTORS_PER_SLOT 14
-// Save Slot 1: 0-13; Save Slot 2: 14-27
-#define SECTOR_ID_HOF_1 28
-#define SECTOR_ID_HOF_2 29
-#define SECTOR_ID_TRAINER_HILL 30
-#define SECTOR_ID_RECORDED_BATTLE 31
-#define SECTORS_COUNT 32
+// A save sector location holds a pointer to the data for a particular sector
+// and the size of that data. Size cannot be greater than SECTOR_DATA_SIZE.
+struct SaveSectorLocation
+{
+ void *data;
+ u16 size;
+};
-#define SAVE_STATUS_EMPTY 0
-#define SAVE_STATUS_OK 1
-#define SAVE_STATUS_CORRUPT 2
-#define SAVE_STATUS_NO_FLASH 4
-#define SAVE_STATUS_ERROR 0xFF
+struct SaveSector
+{
+ u8 data[SECTOR_DATA_SIZE];
+ u8 unused[SECTOR_FOOTER_SIZE - 12]; // Unused portion of the footer
+ u16 id;
+ u16 checksum;
+ u32 security;
+ u32 counter;
+}; // size is SECTOR_SIZE (0x1000)
+
+#define SECTOR_SECURITY_OFFSET offsetof(struct SaveSector, security)
+#define SECTOR_COUNTER_OFFSET offsetof(struct SaveSector, counter)
extern u16 gLastWrittenSector;
extern u32 gLastSaveCounter;
extern u16 gLastKnownGoodSector;
extern u32 gDamagedSaveSectors;
extern u32 gSaveCounter;
-extern struct SaveSection *gFastSaveSection;
-extern u16 gUnknown_03006208;
+extern struct SaveSector *gFastSaveSector;
+extern u16 gIncrementalSectorId;
extern u16 gSaveFileStatus;
extern void (*gGameContinueCallback)(void);
-extern struct SaveSectionLocation gRamSaveSectionLocations[];
-extern u16 gUnknown_03006294;
+extern struct SaveSectorLocation gRamSaveSectorLocations[];
-extern struct SaveSection gSaveDataBuffer;
+extern struct SaveSector gSaveDataBuffer;
void ClearSaveData(void);
void Save_ResetSaveCounters(void);
u8 HandleSavingData(u8 saveType);
u8 TrySavingData(u8 saveType);
-bool8 sub_8153380(void);
-bool8 sub_81533AC(void);
-bool8 sub_81533E0(void);
-bool8 sub_8153408(void);
-bool8 FullSaveGame(void);
-bool8 CheckSaveFile(void);
-u8 Save_LoadGameData(u8 saveType);
+bool8 LinkFullSave_Init(void);
+bool8 LinkFullSave_WriteSector(void);
+bool8 LinkFullSave_ReplaceLastSector(void);
+bool8 LinkFullSave_SetLastSectorSecurity(void);
+bool8 WriteSaveBlock2(void);
+bool8 WriteSaveBlock1Sector(void);
+u8 LoadGameSave(u8 saveType);
u16 GetSaveBlocksPointersBaseOffset(void);
-u32 TryReadSpecialSaveSection(u8 sector, u8* dst);
-u32 TryWriteSpecialSaveSection(u8 sector, u8* src);
-void Task_LinkSave(u8 taskId);
+u32 TryReadSpecialSaveSector(u8 sector, u8* dst);
+u32 TryWriteSpecialSaveSector(u8 sector, u8* src);
+void Task_LinkFullSave(u8 taskId);
// save_failed_screen.c
void DoSaveFailedScreen(u8 saveType);
diff --git a/include/sound.h b/include/sound.h
index 25ffa2d6e..a5463a456 100644
--- a/include/sound.h
+++ b/include/sound.h
@@ -1,26 +1,7 @@
#ifndef GUARD_SOUND_H
#define GUARD_SOUND_H
-enum {
- FANFARE_LEVEL_UP,
- FANFARE_OBTAIN_ITEM,
- FANFARE_EVOLVED,
- FANFARE_OBTAIN_TMHM,
- FANFARE_HEAL,
- FANFARE_OBTAIN_BADGE,
- FANFARE_MOVE_DELETED,
- FANFARE_OBTAIN_BERRY,
- FANFARE_AWAKEN_LEGEND,
- FANFARE_SLOTS_JACKPOT,
- FANFARE_SLOTS_WIN,
- FANFARE_TOO_BAD,
- FANFARE_RG_POKE_FLUTE,
- FANFARE_RG_OBTAIN_KEY_ITEM,
- FANFARE_RG_DEX_RATING,
- FANFARE_OBTAIN_B_POINTS,
- FANFARE_OBTAIN_SYMBOL,
- FANFARE_REGISTER_MATCH_CALL,
-};
+#include "constants/sound.h"
void InitMapMusic(void);
void MapMusicMain(void);
@@ -44,12 +25,12 @@ bool8 IsBGMPausedOrStopped(void);
void FadeInBGM(u8 speed);
void FadeOutBGM(u8 speed);
bool8 IsBGMStopped(void);
-void PlayCry1(u16 species, s8 pan);
-void PlayCry2(u16 species, s8 pan, s8 volume, u8 priority);
-void PlayCry3(u16 species, s8 pan, u8 mode);
-void PlayCry4(u16 species, s8 pan, u8 mode);
-void PlayCry5(u16 species, u8 mode);
-void PlayCry6(u16 species, s8 pan, u8 mode);
+void PlayCry_Normal(u16 species, s8 pan);
+void PlayCry_NormalNoDucking(u16 species, s8 pan, s8 volume, u8 priority);
+void PlayCry_ByMode(u16 species, s8 pan, u8 mode);
+void PlayCry_ReleaseDouble(u16 species, s8 pan, u8 mode);
+void PlayCry_Script(u16 species, u8 mode);
+void PlayCry_DuckNoRestore(u16 species, s8 pan, u8 mode);
void PlayCryInternal(u16 species, s8 pan, s8 volume, u8 priority, u8 mode);
bool8 IsCryFinished(void);
void StopCryAndClearCrySongs(void);
diff --git a/include/strings.h b/include/strings.h
index 48a2eccd7..a22aa307b 100644
--- a/include/strings.h
+++ b/include/strings.h
@@ -611,6 +611,10 @@ extern const u8 gText_PlayersBattleResults[];
extern const u8 gText_WinLoseDraw[];
extern const u8 gText_ColorTransparent[];
extern const u8 gText_Slash[];
+extern const u8 gText_HealthboxNickname[];
+extern const u8 gText_HealthboxGender_None[];
+extern const u8 gText_HealthboxGender_Male[];
+extern const u8 gText_HealthboxGender_Female[];
extern const u8 gText_99TimesPlus[];
extern const u8 gText_1MinutePlus[];