Document remainder of save.c

This commit is contained in:
GriffinR
2021-10-28 22:54:41 -04:00
parent ab1074e629
commit adf773f1ed
18 changed files with 428 additions and 364 deletions

View File

@@ -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++)