summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGravatar bunnei2014-10-23 18:51:54 -0400
committerGravatar bunnei2014-10-23 18:51:54 -0400
commitce8390ac03661ec2b16e48aeaca02ae8c9291ec5 (patch)
tree0d4a4391fda3c58522b6d6ef056b78f67d2b0592 /src/core
parentMerge pull request #146 from yuriks/inttypes (diff)
parentCommon: Return from CreateFullPath early if the directory creation fails (diff)
downloadyuzu-ce8390ac03661ec2b16e48aeaca02ae8c9291ec5.tar.gz
yuzu-ce8390ac03661ec2b16e48aeaca02ae8c9291ec5.tar.xz
yuzu-ce8390ac03661ec2b16e48aeaca02ae8c9291ec5.zip
Merge pull request #133 from archshift/sdmc-enabled
Use config files to store whether SDMC is enabled or not, auto-create SDMC dir.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/file_sys/archive_sdmc.cpp10
-rw-r--r--src/core/settings.h2
2 files changed, 10 insertions, 2 deletions
diff --git a/src/core/file_sys/archive_sdmc.cpp b/src/core/file_sys/archive_sdmc.cpp
index 213923c02..0b647f7d0 100644
--- a/src/core/file_sys/archive_sdmc.cpp
+++ b/src/core/file_sys/archive_sdmc.cpp
@@ -10,6 +10,7 @@
10#include "core/file_sys/archive_sdmc.h" 10#include "core/file_sys/archive_sdmc.h"
11#include "core/file_sys/directory_sdmc.h" 11#include "core/file_sys/directory_sdmc.h"
12#include "core/file_sys/file_sdmc.h" 12#include "core/file_sys/file_sdmc.h"
13#include "core/settings.h"
13 14
14//////////////////////////////////////////////////////////////////////////////////////////////////// 15////////////////////////////////////////////////////////////////////////////////////////////////////
15// FileSys namespace 16// FileSys namespace
@@ -29,8 +30,13 @@ Archive_SDMC::~Archive_SDMC() {
29 * @return true if it initialized successfully 30 * @return true if it initialized successfully
30 */ 31 */
31bool Archive_SDMC::Initialize() { 32bool Archive_SDMC::Initialize() {
32 if (!FileUtil::IsDirectory(mount_point)) { 33 if (!Settings::values.use_virtual_sd) {
33 WARN_LOG(FILESYS, "Directory %s not found, disabling SDMC.", mount_point.c_str()); 34 WARN_LOG(FILESYS, "SDMC disabled by config.");
35 return false;
36 }
37
38 if (!FileUtil::CreateFullPath(mount_point)) {
39 WARN_LOG(FILESYS, "Unable to create SDMC path.");
34 return false; 40 return false;
35 } 41 }
36 42
diff --git a/src/core/settings.h b/src/core/settings.h
index a84c3d4b6..d586e2ef4 100644
--- a/src/core/settings.h
+++ b/src/core/settings.h
@@ -24,6 +24,8 @@ struct Values {
24 int pad_sdown_key; 24 int pad_sdown_key;
25 int pad_sleft_key; 25 int pad_sleft_key;
26 int pad_sright_key; 26 int pad_sright_key;
27
28 bool use_virtual_sd;
27} extern values; 29} extern values;
28 30
29} 31}