*Reverted something that was introduced in r341. Nand emulation should now work again.

This commit is contained in:
overjoy.psm 2012-05-12 23:49:00 +00:00
parent 49a31c4f25
commit 05a95db4db

View File

@ -188,13 +188,15 @@ void Nand::Set_NandPath(string path)
if(isalnum(*(path.end()))) if(isalnum(*(path.end())))
path.push_back('/'); path.push_back('/');
else else
path.replace(path.length() - 1, 1, "/"); //path.replace(path.length() - 1, 1, "/"); WTF?
*(path.end()) = '/';
if(path.size() <= 32) if(path.size() <= 32)
memcpy(NandPath, path.c_str(), path.size()); memcpy(NandPath, path.c_str(), path.size());
else else
memset(NandPath, 0, sizeof(NandPath)); memset(NandPath, 0, sizeof(NandPath));
gprintf("NandPath = %s\n", NandPath);
gprintf("NandPath = %s\n", NandPath);
} }
void Nand::__Dec_Enc_TB(void) void Nand::__Dec_Enc_TB(void)
@ -811,7 +813,10 @@ void Nand::CreateTitleTMD(const char *path, dir_discHdr *hdr)
CreatePath("%s/title/%08x/%08x/content", path, highTID, lowTID); CreatePath("%s/title/%08x/%08x/content", path, highTID, lowTID);
char nandpath[MAX_FAT_PATH]; char nandpath[MAX_FAT_PATH];
snprintf(nandpath, sizeof(nandpath), "%s/title/%08x/%08x/content/title.tmd", path, highTID, lowTID); if(path[strlen(path)-1] == '/')
snprintf(nandpath, sizeof(nandpath), "%stitle/%08x/%08x/content/title.tmd", path, highTID, lowTID);
else
snprintf(nandpath, sizeof(nandpath), "%s/title/%08x/%08x/content/title.tmd", path, highTID, lowTID);
struct stat filestat; struct stat filestat;
if (stat(nandpath, &filestat) == 0) if (stat(nandpath, &filestat) == 0)