Fallback to backup DSi Footer in NAND Image (#1154)
* - added fallback to DSi footer copy at 000FF800h if reading footer at end of file failed. See https://problemkaputt.de/gbatek.htm#dsisdmmcimages - changed output of ConsoleID to use PRIx64 to be consistent with all other tools working with the consoleID (readability/cosmetic improvement) * Remove extra space Co-authored-by: Tim Seidel <t.seidel@kts-systeme.de> Co-authored-by: RSDuck <RSDuck@users.noreply.github.com>
This commit is contained in:
parent
e5240a688c
commit
3a9e07c0b1
14
src/DSi.cpp
14
src/DSi.cpp
|
@ -457,15 +457,23 @@ bool LoadNAND()
|
|||
fread(nand_footer, 1, 16, SDMMCFile);
|
||||
if (memcmp(nand_footer, nand_footer_ref, 16))
|
||||
{
|
||||
printf("ERROR: NAND missing nocash footer\n");
|
||||
return false;
|
||||
// There is another copy of the footer at 000FF800h for the case
|
||||
// that by external tools the image was cut off
|
||||
// See https://problemkaputt.de/gbatek.htm#dsisdmmcimages
|
||||
fseek(SDMMCFile, 0x000FF800, SEEK_SET);
|
||||
fread(nand_footer, 1, 16, SDMMCFile);
|
||||
if (memcmp(nand_footer, nand_footer_ref, 16))
|
||||
{
|
||||
printf("ERROR: NAND missing nocash footer\n");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
fread(eMMC_CID, 1, 16, SDMMCFile);
|
||||
fread(&ConsoleID, 1, 8, SDMMCFile);
|
||||
|
||||
printf("eMMC CID: "); printhex(eMMC_CID, 16);
|
||||
printf("Console ID: %" PRIu64 "\n", ConsoleID);
|
||||
printf("Console ID: %" PRIx64 "\n", ConsoleID);
|
||||
}
|
||||
|
||||
memset(ITCMInit, 0, 0x8000);
|
||||
|
|
Loading…
Reference in New Issue