fix reading emunand sector 0

This commit is contained in:
aspargas2 2021-10-21 12:46:35 -04:00 committed by TuxSH
parent 26ea031f0e
commit ee16c0b104
2 changed files with 3 additions and 3 deletions

View File

@ -348,7 +348,7 @@ int ctrNandInit(void)
u8 __attribute__((aligned(4))) temp[0x200]; u8 __attribute__((aligned(4))) temp[0x200];
//Read NCSD header //Read NCSD header
result = firmSource == FIRMWARE_SYSNAND ? sdmmc_nand_readsectors(0, 1, temp) : sdmmc_sdcard_readsectors(emuHeader, 1, temp); result = firmSource == FIRMWARE_SYSNAND ? sdmmc_nand_readsectors(0, 1, temp) : sdmmc_sdcard_readsectors(emuOffset + emuHeader, 1, temp);
if(!result) if(!result)
{ {

View File

@ -77,7 +77,7 @@ void locateEmuNand(FirmwareSource *nandType)
if(!sdmmc_sdcard_readsectors(nandOffset + 1, 1, temp) && memcmp(temp + 0x100, "NCSD", 4) == 0) if(!sdmmc_sdcard_readsectors(nandOffset + 1, 1, temp) && memcmp(temp + 0x100, "NCSD", 4) == 0)
{ {
emuOffset = nandOffset + 1; emuOffset = nandOffset + 1;
emuHeader = nandOffset + 1; emuHeader = 0;
return; return;
} }
@ -85,7 +85,7 @@ void locateEmuNand(FirmwareSource *nandType)
else if(i != 2 && !sdmmc_sdcard_readsectors(nandOffset + nandSize, 1, temp) && memcmp(temp + 0x100, "NCSD", 4) == 0) else if(i != 2 && !sdmmc_sdcard_readsectors(nandOffset + nandSize, 1, temp) && memcmp(temp + 0x100, "NCSD", 4) == 0)
{ {
emuOffset = nandOffset; emuOffset = nandOffset;
emuHeader = nandOffset + nandSize; emuHeader = nandSize;
return; return;
} }
} }