From d612c4f98a90573ca1d9de4d8a82c93ed6fd9a81 Mon Sep 17 00:00:00 2001 From: Daryl Date: Thu, 23 Jul 2020 14:31:32 -0600 Subject: [PATCH] when unable to load the default rom directory, just drop into device root. don't show an error when unable to find a load device. --- source/filebrowser.cpp | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/source/filebrowser.cpp b/source/filebrowser.cpp index ebbf3e4..605f2dd 100644 --- a/source/filebrowser.cpp +++ b/source/filebrowser.cpp @@ -72,8 +72,6 @@ int autoLoadMethod() device = DEVICE_DVD; else if(ChangeInterface(DEVICE_SMB, SILENT)) device = DEVICE_SMB; - else - ErrorPrompt("Unable to locate a load device!"); if(GCSettings.LoadMethod == DEVICE_AUTO) GCSettings.LoadMethod = device; // save device found for later use @@ -659,15 +657,31 @@ int OpenGameList () { int device = GCSettings.LoadMethod; + bool autoLoad = false; - if(device == DEVICE_AUTO && strlen(GCSettings.LoadFolder) > 0) + if(device == DEVICE_AUTO && strlen(GCSettings.LoadFolder) > 0) { device = autoLoadMethod(); + autoLoad = true; + } // change current dir to roms directory - if(device > 0) + if(device > 0) { sprintf(browser.dir, "%s%s/", pathPrefix[device], GCSettings.LoadFolder); - else + + if(autoLoad) { + DIR *dir = opendir(browser.dir); + + if(dir == NULL) { + sprintf(browser.dir, "%s", pathPrefix[device]); + } + else { + closedir(dir); + } + } + } + else { browser.dir[0] = 0; + } BrowserChangeFolder(); return browser.numEntries;