summaryrefslogtreecommitdiff
path: root/src/save.c
diff options
context:
space:
mode:
authordrifloony <drifloony@users.noreply.github.com>2017-07-21 15:34:05 -0700
committerGitHub <noreply@github.com>2017-07-21 15:34:05 -0700
commit8ed167339c52b32e5149077e9e2c91f981268af9 (patch)
tree765873e0da27644ad94fcf0eee9a8f76f95e96c6 /src/save.c
parent95d3a7848ca07ad7035d1a717b489c4ea303a3ba (diff)
parent68e47a6fa0b56451223c22dc9a759534c988db5b (diff)
Merge branch 'master' into mon_markings
Diffstat (limited to 'src/save.c')
-rw-r--r--src/save.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/save.c b/src/save.c
index 570210fb0..adf39268e 100644
--- a/src/save.c
+++ b/src/save.c
@@ -11,21 +11,23 @@
#define GETBLOCKOFFSET(n) (0xF80 * (n - 1))
#define TOTALNUMSECTORS ((ARRAY_COUNT(gSaveSectionLocations) * 2) + (ARRAY_COUNT(gHallOfFameSaveSectionLocations) * 2)) // there are 2 slots, so double each array count and get the sum.
-extern u32 gLastSaveSectorStatus; // used but in an unferenced function, so unused
-extern u16 gLastWrittenSector;
-extern u32 gLastSaveCounter;
-extern u16 gLastKnownGoodSector;
-extern u32 gDamagedSaveSectors;
-extern u32 gSaveCounter;
extern struct SaveSection unk_2000000; // slow save RAM
-extern struct SaveSection *gFastSaveSection; // the pointer is in fast IWRAM but may sometimes point to the slower EWRAM.
-extern u16 gUnknown_03005EB4;
-extern u16 gSaveFileStatus;
-extern u32 gGameContinueCallback;
+
+u16 gLastWrittenSector;
+u32 gLastSaveCounter;
+u16 gLastKnownGoodSector;
+u32 gDamagedSaveSectors;
+u32 gSaveCounter;
+struct SaveSection *gFastSaveSection; // the pointer is in fast IWRAM but may sometimes point to the slower EWRAM.
+u16 gUnknown_03005EB4;
+u16 gSaveFileStatus;
+u32 gGameContinueCallback;
extern struct PokemonStorage gPokemonStorage;
extern struct HallOfFame gHallOfFame;
+static EWRAM_DATA u32 gLastSaveSectorStatus = 0; // used but in an unferenced function, so unused
+
const struct SaveSectionLocation gSaveSectionLocations[] =
{
{((u8 *) &gSaveBlock2) + GETBLOCKOFFSET(1), GETCHUNKSIZE(gSaveBlock2, 1)},
@@ -672,9 +674,9 @@ u8 sub_8125E2C(void)
return 0;
}
-u8 sub_8125E6C(void)
+bool8 sub_8125E6C(void)
{
- u8 retVal = 0;
+ u8 retVal = FALSE;
u16 val = ++gUnknown_03005EB4;
if (val <= 4)
{
@@ -684,7 +686,7 @@ u8 sub_8125E6C(void)
else
{
sub_81257F0(val, gSaveSectionLocations);
- retVal = 1;
+ retVal = TRUE;
}
if (gDamagedSaveSectors)
DoSaveFailedScreen(1);