aboutsummaryrefslogtreecommitdiff
path: root/backends/fs/posix
diff options
context:
space:
mode:
authorrsn88872018-03-28 22:58:39 -0500
committerrsn88872018-03-28 23:01:01 -0500
commita4fe03c0a53ad89960f4934ea677ff0a7c0bc1f7 (patch)
tree7a6c2a3f35966b6a6019e050dc3eb3e62a623b06 /backends/fs/posix
parentb875f46db0f15f6fbbcda952457712ff9453a05b (diff)
downloadscummvm-rg350-a4fe03c0a53ad89960f4934ea677ff0a7c0bc1f7.tar.gz
scummvm-rg350-a4fe03c0a53ad89960f4934ea677ff0a7c0bc1f7.tar.bz2
scummvm-rg350-a4fe03c0a53ad89960f4934ea677ff0a7c0bc1f7.zip
PSP2: allow loading games from uma0: in addition to ux0:
Diffstat (limited to 'backends/fs/posix')
-rw-r--r--backends/fs/posix/posix-fs.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/backends/fs/posix/posix-fs.cpp b/backends/fs/posix/posix-fs.cpp
index 3f90fc1a19..01c2751857 100644
--- a/backends/fs/posix/posix-fs.cpp
+++ b/backends/fs/posix/posix-fs.cpp
@@ -62,6 +62,16 @@ void POSIXFilesystemNode::setFlags() {
POSIXFilesystemNode::POSIXFilesystemNode(const Common::String &p) {
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
if (p.hasPrefix("~/")) {
const char *home = getenv("HOME");
@@ -152,6 +162,15 @@ bool POSIXFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, boo
return true;
}
#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());
struct dirent *dp;
@@ -230,6 +249,10 @@ AbstractFSNode *POSIXFilesystemNode::getParent() const {
// This is a root directory of a drive
return makeNode("/"); // return a virtual root for a list of drives
#endif
+#ifdef PSP2
+ if (_path.hasSuffix(":"))
+ return makeNode("/");
+#endif
const char *start = _path.c_str();
const char *end = start + _path.size();