mirror of
https://github.com/d0k3/GodMode9.git
synced 2025-06-26 21:52:48 +00:00
Workaround for empty / incompatible EmuNANDs
This commit is contained in:
parent
7988a26acc
commit
3eeb5fbca3
@ -338,7 +338,7 @@ u32 CheckNandType(u32 nand_src)
|
||||
if (ReadNandSectors(NAND_BUFFER, 0, 1, 0xFF, nand_src) != 0)
|
||||
return 0;
|
||||
if (memcmp(NAND_BUFFER + 0x100, nand_magic_n3ds, 0x60) == 0) {
|
||||
return NAND_TYPE_N3DS;
|
||||
return (GetUnitPlatform() == PLATFORM_3DS) ? 0 : NAND_TYPE_N3DS;
|
||||
} else if (memcmp(NAND_BUFFER + 0x100, nand_magic_o3ds, 0x60) == 0) {
|
||||
return (GetUnitPlatform() == PLATFORM_3DS) ? NAND_TYPE_O3DS : NAND_TYPE_NO3DS;
|
||||
}
|
||||
|
@ -80,8 +80,11 @@ bool FindVirtualFile(VirtualFile* vfile, const char* path, u32 size)
|
||||
if (!virtual_src || (fname - path != 3))
|
||||
return false;
|
||||
|
||||
// check NAND type
|
||||
virtual_type = (virtual_src & VRT_ANYNAND) ? CheckNandType(virtual_src) : virtual_src;
|
||||
// check virtual type
|
||||
if (virtual_src & VRT_ANYNAND) {
|
||||
virtual_type = CheckNandType(virtual_src); // workaround if this comes up with no result
|
||||
if (!virtual_type) virtual_type = (GetUnitPlatform() == PLATFORM_3DS) ? NAND_TYPE_O3DS : NAND_TYPE_N3DS;
|
||||
} else virtual_type = virtual_src;
|
||||
|
||||
// parse the template list, get the correct one
|
||||
u32 n_templates = sizeof(virtualFileTemplates) / sizeof(VirtualFile);
|
||||
|
Loading…
x
Reference in New Issue
Block a user