mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-24 14:49:53 -06:00
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:

committed by
GitHub

parent
e5240a688c
commit
3a9e07c0b1
14
src/DSi.cpp
14
src/DSi.cpp
@ -457,15 +457,23 @@ bool LoadNAND()
|
|||||||
fread(nand_footer, 1, 16, SDMMCFile);
|
fread(nand_footer, 1, 16, SDMMCFile);
|
||||||
if (memcmp(nand_footer, nand_footer_ref, 16))
|
if (memcmp(nand_footer, nand_footer_ref, 16))
|
||||||
{
|
{
|
||||||
printf("ERROR: NAND missing nocash footer\n");
|
// There is another copy of the footer at 000FF800h for the case
|
||||||
return false;
|
// 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(eMMC_CID, 1, 16, SDMMCFile);
|
||||||
fread(&ConsoleID, 1, 8, SDMMCFile);
|
fread(&ConsoleID, 1, 8, SDMMCFile);
|
||||||
|
|
||||||
printf("eMMC CID: "); printhex(eMMC_CID, 16);
|
printf("eMMC CID: "); printhex(eMMC_CID, 16);
|
||||||
printf("Console ID: %" PRIu64 "\n", ConsoleID);
|
printf("Console ID: %" PRIx64 "\n", ConsoleID);
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(ITCMInit, 0, 0x8000);
|
memset(ITCMInit, 0, 0x8000);
|
||||||
|
Reference in New Issue
Block a user