Potential fix for errors related to 'Not enough free blocks'
changes fs getusage to return 1 additional inode to account for the directory itself Fixes save creation for at least two games, R8XE52 (Jurassic: The Hunted), STEETR (Tetris Party Deluxe) doesnt harm save creation in any games that i tested (about 25) also it is now possible to boot a nand title by selecting the tmd file using File > Open git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7575 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
84906edf61
commit
1fa17b7e29
|
@ -156,7 +156,7 @@ bool CWII_IPC_HLE_Device_FileIO::Open(u32 _CommandAddress, u32 _Mode)
|
|||
}
|
||||
else
|
||||
{
|
||||
WARN_LOG(WII_IPC_FILEIO, "FileIO: Open failed - File doesn't exist %s", m_Filename.c_str());
|
||||
WARN_LOG(WII_IPC_FILEIO, "FileIO: Open (%s) failed - File doesn't exist %s", Modes[_Mode], m_Filename.c_str());
|
||||
ReturnValue = FS_FILE_NOT_EXIST;
|
||||
}
|
||||
|
||||
|
|
|
@ -190,20 +190,34 @@ bool CWII_IPC_HLE_Device_fs::IOCtlV(u32 _CommandAddress)
|
|||
// this command sucks because it asks of the number of used
|
||||
// fsBlocks and inodes
|
||||
// It should be correct, but don't count on it...
|
||||
std::string path(HLE_IPC_BuildFilename((const char*)Memory::GetPointer(CommandBuffer.InBuffer[0].m_Address), CommandBuffer.InBuffer[0].m_Size));
|
||||
const char *relativepath = (const char*)Memory::GetPointer(CommandBuffer.InBuffer[0].m_Address);
|
||||
std::string path(HLE_IPC_BuildFilename(relativepath, CommandBuffer.InBuffer[0].m_Size));
|
||||
u32 fsBlocks = 0;
|
||||
u32 iNodes = 0;
|
||||
|
||||
INFO_LOG(WII_IPC_FILEIO, "IOCTL_GETUSAGE %s", path.c_str());
|
||||
if (File::IsDirectory(path))
|
||||
{
|
||||
File::FSTEntry parentDir;
|
||||
iNodes = File::ScanDirectoryTree(path, parentDir);
|
||||
// LPFaint99: After I found that setting the number of inodes to the number of children + 1 for the directory itself
|
||||
// I decided to compare with sneek which has the following 2 special cases which are
|
||||
// Copyright (C) 2009-2011 crediar http://code.google.com/p/sneek/
|
||||
if ((memcmp(relativepath, "/title/00010001", 16 ) == 0 ) ||
|
||||
(memcmp(relativepath, "/title/00010005", 16) == 0 ))
|
||||
{
|
||||
fsBlocks = 23; // size is size/0x4000
|
||||
iNodes = 42; // empty folders return a FileCount of 1
|
||||
}
|
||||
else
|
||||
{
|
||||
File::FSTEntry parentDir;
|
||||
// add one for the folder itself, allows some games to create their save files
|
||||
// R8XE52 (Jurassic: The Hunted), STEETR (Tetris Party Deluxe) now create their saves with this change
|
||||
iNodes = 1 + File::ScanDirectoryTree(path, parentDir);
|
||||
|
||||
u64 totalSize = ComputeTotalFileSize(parentDir); // "Real" size, to be converted to nand blocks
|
||||
|
||||
fsBlocks = (u32)(totalSize / (16 * 1024)); // one bock is 16kb
|
||||
u64 totalSize = ComputeTotalFileSize(parentDir); // "Real" size, to be converted to nand blocks
|
||||
|
||||
fsBlocks = (u32)(totalSize / (16 * 1024)); // one bock is 16kb
|
||||
}
|
||||
ReturnValue = FS_RESULT_OK;
|
||||
|
||||
INFO_LOG(WII_IPC_FILEIO, "FS: fsBlock: %i, iNodes: %i", fsBlocks, iNodes);
|
||||
|
|
|
@ -212,7 +212,7 @@ bool CNANDContentLoader::Initialize(const std::string& _rName)
|
|||
}
|
||||
else
|
||||
{
|
||||
SplitPath(TMDFileName, &m_Path, NULL, NULL);
|
||||
m_Path = TMDFileName.substr(0, TMDFileName.find("title.tmd"));
|
||||
}
|
||||
File::IOFile pTMDFile(TMDFileName, "rb");
|
||||
if (!pTMDFile)
|
||||
|
|
|
@ -662,7 +662,7 @@ void CFrame::DoOpen(bool Boot)
|
|||
_("Select the file to load"),
|
||||
wxEmptyString, wxEmptyString, wxEmptyString,
|
||||
_("All GC/Wii files (elf, dol, gcm, iso, ciso, gcz, wad)") +
|
||||
wxString::Format(wxT("|*.elf;*.dol;*.gcm;*.iso;*.ciso;*.gcz;*.wad;*.dff|%s"),
|
||||
wxString::Format(wxT("|*.elf;*.dol;*.gcm;*.iso;*.ciso;*.gcz;*.wad;*.dff;*.tmd|%s"),
|
||||
wxGetTranslation(wxALL_FILES)),
|
||||
wxFD_OPEN | wxFD_FILE_MUST_EXIST,
|
||||
this);
|
||||
|
|
Loading…
Reference in New Issue