foxygit / fake-08-xbox360 Log in
commit a1f1b239a59994810fcafd5460698e84db000079
Author:     jtothebell <j.to.the.bell@gmail.com>
AuthorDate: Tue May 11 22:11:44 2021 -0600
Commit:     jtothebell <j.to.the.bell@gmail.com>
CommitDate: Tue May 11 22:11:44 2021 -0600

    Fix switch build
---
 platform/switch/source/SwitchHost.cpp | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/platform/switch/source/SwitchHost.cpp b/platform/switch/source/SwitchHost.cpp
index 35529e2..3675434 100644
--- a/platform/switch/source/SwitchHost.cpp
+++ b/platform/switch/source/SwitchHost.cpp
@@ -30,6 +30,7 @@ using namespace std;

 string _desktopSdl2SettingsDir = "switch/fake08";
 string _desktopSdl2SettingsPrefix = "switch/fake08/";
+string _switchCartDir = "/p8carts";
 string _desktopSdl2customBiosLua = "cartpath = \"sdmc:/p8carts/\"\n";

 PadState pad;
@@ -109,7 +110,8 @@ Host::Host()
         RENDERER_FLAGS,
         PIXEL_FORMAT,
         _desktopSdl2SettingsPrefix,
-        _desktopSdl2customBiosLua
+        _desktopSdl2customBiosLua,
+        _switchCartDir
     );
 }

@@ -156,14 +158,13 @@ InputState_t Host::scanInput(){
 vector<string> Host::listcarts(){
     vector<string> carts;

-    DIR* dir = opendir("/p8carts");
+    DIR* dir = opendir(_cartDirectory.c_str());
     struct dirent *ent;
-    std::string fullCartDir = "/p8carts/";

     if (dir) {
         /* print all the files and directories within directory */
         while ((ent = readdir (dir)) != NULL) {
-            carts.push_back(fullCartDir + ent->d_name);
+            carts.push_back(_cartDirectory + "/" + ent->d_name);
         }
         closedir (dir);
     }