umd0 solution: Add "OnlyEntireISOFileSystem"

Wraps around an ISOFileSystem, redirecting all the filenames to "" to
achieve the desired effect (should fix Bleach Soul Carnival 2 without resorting
to CPkmn's hack from #6638)

Probably breaks savestates as-is...
This commit is contained in:
Henrik Rydgard
2014-07-27 23:42:46 +02:00
parent 82421f4dcf
commit 8146ff85f3
3 changed files with 89 additions and 33 deletions

View File

@@ -299,9 +299,8 @@ void ISOFileSystem::ReadDirectory(u32 startsector, u32 dirsize, TreeEntry *root,
ISOFileSystem::TreeEntry *ISOFileSystem::GetFromPath(std::string path, bool catchError)
{
if (path.length() == 0)
{
//Ah, the device! "umd0:"
if (path.length() == 0) {
// Ah, the device! "umd0:"
return &entireISO;
}
@@ -311,9 +310,6 @@ ISOFileSystem::TreeEntry *ISOFileSystem::GetFromPath(std::string path, bool catc
if (path[0] == '/')
path.erase(0,1);
if (path == "umd0")
return &entireISO;
TreeEntry *e = treeroot;
if (path.length() == 0)
return e;
@@ -726,6 +722,12 @@ std::string ISOFileSystem::EntryFullPath(TreeEntry *e)
return path;
}
ISOFileSystem::TreeEntry::~TreeEntry() {
for (size_t i = 0; i < children.size(); ++i)
delete children[i];
children.clear();
}
void ISOFileSystem::DoState(PointerWrap &p)
{
auto s = p.Section("ISOFileSystem", 1);