PSP2: allow loading games from uma0: in addition to ux0:
This commit is contained in:
parent
b875f46db0
commit
a4fe03c0a5
2 changed files with 24 additions and 1 deletions
|
@ -62,6 +62,16 @@ void POSIXFilesystemNode::setFlags() {
|
||||||
POSIXFilesystemNode::POSIXFilesystemNode(const Common::String &p) {
|
POSIXFilesystemNode::POSIXFilesystemNode(const Common::String &p) {
|
||||||
assert(p.size() > 0);
|
assert(p.size() > 0);
|
||||||
|
|
||||||
|
#ifdef PSP2
|
||||||
|
if (p == "/") {
|
||||||
|
_isDirectory = true;
|
||||||
|
_isValid = false;
|
||||||
|
_path = p;
|
||||||
|
_displayName = p;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// Expand "~/" to the value of the HOME env variable
|
// Expand "~/" to the value of the HOME env variable
|
||||||
if (p.hasPrefix("~/")) {
|
if (p.hasPrefix("~/")) {
|
||||||
const char *home = getenv("HOME");
|
const char *home = getenv("HOME");
|
||||||
|
@ -152,6 +162,15 @@ bool POSIXFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, boo
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef PSP2
|
||||||
|
if (_path == "/") {
|
||||||
|
POSIXFilesystemNode *entry1 = new POSIXFilesystemNode("ux0:");
|
||||||
|
myList.push_back(entry1);
|
||||||
|
POSIXFilesystemNode *entry2 = new POSIXFilesystemNode("uma0:");
|
||||||
|
myList.push_back(entry2);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
DIR *dirp = opendir(_path.c_str());
|
DIR *dirp = opendir(_path.c_str());
|
||||||
struct dirent *dp;
|
struct dirent *dp;
|
||||||
|
@ -230,6 +249,10 @@ AbstractFSNode *POSIXFilesystemNode::getParent() const {
|
||||||
// This is a root directory of a drive
|
// This is a root directory of a drive
|
||||||
return makeNode("/"); // return a virtual root for a list of drives
|
return makeNode("/"); // return a virtual root for a list of drives
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef PSP2
|
||||||
|
if (_path.hasSuffix(":"))
|
||||||
|
return makeNode("/");
|
||||||
|
#endif
|
||||||
|
|
||||||
const char *start = _path.c_str();
|
const char *start = _path.c_str();
|
||||||
const char *end = start + _path.size();
|
const char *end = start + _path.size();
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
#include "backends/fs/psp2/psp2-fs-factory.h"
|
#include "backends/fs/psp2/psp2-fs-factory.h"
|
||||||
|
|
||||||
AbstractFSNode *PSP2FilesystemFactory::makeRootFileNode() const {
|
AbstractFSNode *PSP2FilesystemFactory::makeRootFileNode() const {
|
||||||
return new POSIXFilesystemNode("ux0:");
|
return new POSIXFilesystemNode("/");
|
||||||
}
|
}
|
||||||
|
|
||||||
AbstractFSNode *PSP2FilesystemFactory::makeCurrentDirectoryFileNode() const {
|
AbstractFSNode *PSP2FilesystemFactory::makeCurrentDirectoryFileNode() const {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue