mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-27 00:03:37 +01:00
Move umd replace to loaders.
This commit is contained in:
1 parent
0a5ec48382
commit
d09543ebd7
7 files changed
+87
-45
No files matched your search
+35
-1
@@ -83,7 +83,7 @@ void InitMemoryForGameISO(FileLoader *fileLoader) {
|
||||
|
||||
IFileSystem *fileSystem = nullptr;
|
||||
IFileSystem *blockSystem = nullptr;
|
||||
bool actualIso = false;
|
||||
//bool actualIso = false;
|
||||
if (fileLoader->IsDirectory()) {
|
||||
fileSystem = new VirtualDiscFileSystem(&pspFileSystem, fileLoader->Path());
|
||||
blockSystem = fileSystem;
|
||||
@@ -144,6 +144,40 @@ void InitMemoryForGameISO(FileLoader *fileLoader) {
|
||||
}
|
||||
}
|
||||
|
||||
bool ReInitMemoryForGameISO(FileLoader *fileLoader) {
|
||||
if (!fileLoader->Exists()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
IFileSystem *fileSystem = nullptr;
|
||||
IFileSystem *blockSystem = nullptr;
|
||||
|
||||
if (fileLoader->IsDirectory()) {
|
||||
fileSystem = new VirtualDiscFileSystem(&pspFileSystem, fileLoader->Path());
|
||||
blockSystem = fileSystem;
|
||||
}
|
||||
else {
|
||||
auto bd = constructBlockDevice(fileLoader);
|
||||
if (!bd)
|
||||
return false;
|
||||
|
||||
ISOFileSystem *iso = new ISOFileSystem(&pspFileSystem, bd);
|
||||
fileSystem = iso;
|
||||
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("umd:", blockSystem);
|
||||
}
|
||||
|
||||
pspFileSystem.Remount("disc0:", fileSystem);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void InitMemoryForGamePBP(FileLoader *fileLoader) {
|
||||
if (!fileLoader->Exists()) {
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user