mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-11 00:56:37 +00:00
fix
This commit is contained in:
parent
44660bd9ae
commit
9fa4ae7b15
@ -286,15 +286,25 @@ void MetaFileSystem::Unmount(std::string prefix, IFileSystem *system) {
|
||||
fileSystems.erase(std::remove(fileSystems.begin(), fileSystems.end(), x), fileSystems.end());
|
||||
}
|
||||
|
||||
void MetaFileSystem::Remount(std::string prefix, IFileSystem *newSystem, bool delOldSystem) {
|
||||
void MetaFileSystem::Remount(std::string prefix, IFileSystem *newSystem) {
|
||||
std::lock_guard<std::recursive_mutex> guard(lock);
|
||||
IFileSystem *oldSystem = nullptr;
|
||||
for (auto &it : fileSystems) {
|
||||
if (it.prefix == prefix) {
|
||||
if (delOldSystem)
|
||||
delete it.system;
|
||||
oldSystem = it.system;
|
||||
it.system = newSystem;
|
||||
}
|
||||
}
|
||||
|
||||
bool delOldSystem = true;
|
||||
for (auto &it : fileSystems) {
|
||||
if (it.system == oldSystem) {
|
||||
delOldSystem = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (delOldSystem)
|
||||
delete oldSystem;
|
||||
}
|
||||
|
||||
IFileSystem *MetaFileSystem::GetSystemFromFilename(const std::string &filename) {
|
||||
|
@ -52,7 +52,7 @@ public:
|
||||
|
||||
void Mount(std::string prefix, IFileSystem *system);
|
||||
void Unmount(std::string prefix, IFileSystem *system);
|
||||
void Remount(std::string prefix, IFileSystem *newSystem, bool delOldSystem = true);
|
||||
void Remount(std::string prefix, IFileSystem *newSystem);
|
||||
|
||||
IFileSystem *GetSystem(const std::string &prefix);
|
||||
IFileSystem *GetSystemFromFilename(const std::string &filename);
|
||||
|
@ -1977,9 +1977,6 @@ static int sceIoChangeAsyncPriority(int id, int priority) {
|
||||
return hleLogSuccessI(SCEIO, 0);
|
||||
}
|
||||
|
||||
if (priority == -1)
|
||||
priority = KernelCurThreadPriority();
|
||||
|
||||
u32 error;
|
||||
FileNode *f = __IoGetFd(id, error);
|
||||
if (!f) {
|
||||
|
@ -495,7 +495,7 @@ static u32 sceUmdGetErrorStat()
|
||||
}
|
||||
|
||||
void __UmdReplace(std::string filepath) {
|
||||
char *error = "";
|
||||
std::string error = "";
|
||||
if (!UmdReplace(filepath, error)) {
|
||||
ERROR_LOG(SCEIO, "UMD Replace failed: %s", error);
|
||||
return;
|
||||
|
@ -356,7 +356,7 @@ bool LoadFile(FileLoader **fileLoaderPtr, std::string *error_string) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool UmdReplace(std::string filepath, char *error) {
|
||||
bool UmdReplace(std::string filepath, std::string &error) {
|
||||
IFileSystem* currentUMD = pspFileSystem.GetSystem("disc0:");
|
||||
|
||||
if (!currentUMD) {
|
||||
@ -368,7 +368,7 @@ bool UmdReplace(std::string filepath, char *error) {
|
||||
|
||||
if (!loadedFile->Exists()) {
|
||||
delete loadedFile;
|
||||
sprintf(error, "%s doesn't exist", loadedFile->Path().c_str());
|
||||
error = loadedFile->Path() + " doesn't exist";
|
||||
return false;
|
||||
}
|
||||
UpdateLoadedFile(loadedFile);
|
||||
@ -387,7 +387,7 @@ bool UmdReplace(std::string filepath, char *error) {
|
||||
|
||||
break;
|
||||
default:
|
||||
sprintf(error, "Unsupported file type: %i", type);
|
||||
error = "Unsupported file type:" + std::to_string((int)type);
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
|
@ -159,4 +159,4 @@ void RegisterFileLoaderFactory(std::string name, std::unique_ptr<FileLoaderFacto
|
||||
// Can modify the string filename, as it calls IdentifyFile above.
|
||||
bool LoadFile(FileLoader **fileLoaderPtr, std::string *error_string);
|
||||
|
||||
bool UmdReplace(std::string filepath, char* error);
|
||||
bool UmdReplace(std::string filepath, std::string &error);
|
||||
|
@ -83,7 +83,7 @@ void InitMemoryForGameISO(FileLoader *fileLoader) {
|
||||
|
||||
IFileSystem *fileSystem = nullptr;
|
||||
IFileSystem *blockSystem = nullptr;
|
||||
//bool actualIso = false;
|
||||
|
||||
if (fileLoader->IsDirectory()) {
|
||||
fileSystem = new VirtualDiscFileSystem(&pspFileSystem, fileLoader->Path());
|
||||
blockSystem = fileSystem;
|
||||
@ -155,8 +155,7 @@ bool ReInitMemoryForGameISO(FileLoader *fileLoader) {
|
||||
if (fileLoader->IsDirectory()) {
|
||||
fileSystem = new VirtualDiscFileSystem(&pspFileSystem, fileLoader->Path());
|
||||
blockSystem = fileSystem;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
auto bd = constructBlockDevice(fileLoader);
|
||||
if (!bd)
|
||||
return false;
|
||||
@ -166,15 +165,11 @@ bool ReInitMemoryForGameISO(FileLoader *fileLoader) {
|
||||
blockSystem = new ISOBlockSystem(iso);
|
||||
}
|
||||
|
||||
if (pspFileSystem.GetSystem("disc0:") != pspFileSystem.GetSystem("umd0:")) {
|
||||
// We mounted an ISO block system separately.
|
||||
pspFileSystem.Remount("umd0:", blockSystem, false);
|
||||
pspFileSystem.Remount("umd1:", blockSystem, false);
|
||||
pspFileSystem.Remount("umd0:", blockSystem);
|
||||
pspFileSystem.Remount("umd1:", blockSystem);
|
||||
pspFileSystem.Remount("umd:", blockSystem);
|
||||
}
|
||||
|
||||
pspFileSystem.Remount("disc0:", fileSystem);
|
||||
|
||||
pspFileSystem.Remount("disc0:", fileSystem);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user