summaryrefslogtreecommitdiff
path: root/src/save_failed_screen.c
diff options
context:
space:
mode:
authorGriffinR <griffin.g.richards@gmail.com>2021-11-13 23:19:08 -0500
committerGitHub <noreply@github.com>2021-11-13 23:19:08 -0500
commit9a932cd9c3089c03adada30ace4c79a84bf73cf0 (patch)
treeb8dfc2d147b8e5f92c0f8e67e3d06bcc2f8453cc /src/save_failed_screen.c
parentb14fe9dce369b1a78c5f4f653b4c7e2e2d67d98d (diff)
parent8e8b70c15c1e34074d27acaa07f8e28d0d3d9e89 (diff)
Merge pull request #1549 from GriffinRichards/doc-binterface
Document remaining symbols in battle_interface, palette, and save
Diffstat (limited to 'src/save_failed_screen.c')
-rw-r--r--src/save_failed_screen.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/save_failed_screen.c b/src/save_failed_screen.c
index e7bdc3400..9b32a938f 100644
--- a/src/save_failed_screen.c
+++ b/src/save_failed_screen.c
@@ -363,9 +363,10 @@ static bool8 VerifySectorWipe(u16 sector)
ReadFlash(sector, 0, (u8 *)ptr, SECTOR_SIZE);
- for (i = 0; i < 0x400; i++, ptr++)
+ // 1/4 because ptr is u32
+ for (i = 0; i < SECTOR_SIZE / 4; i++, ptr++)
if (*ptr)
- return TRUE;
+ return TRUE; // Sector has nonzero data, failed
return FALSE;
}
@@ -375,6 +376,7 @@ static bool8 WipeSector(u16 sector)
u16 i, j;
bool8 failed = TRUE;
+ // Attempt to wipe sector with an arbitrary attempt limit of 130
for (i = 0; failed && i < 130; i++)
{
for (j = 0; j < SECTOR_SIZE; j++)