From 09c337682706fb46d99e6ef47cd83f14ee8f443c Mon Sep 17 00:00:00 2001 From: Daryl Date: Thu, 23 Jul 2020 14:31:03 -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 ce07a2f..44a2bcd 100644 --- a/source/filebrowser.cpp +++ b/source/filebrowser.cpp @@ -78,8 +78,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 @@ -672,15 +670,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;