summaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2018-07-28 05:55:23 +0200
committerZach Hilman <zachhilman@gmail.com>2018-08-01 06:16:54 +0200
commitdf5b75694f5abde94ccf05fa6c7a557b1ba9079b (patch)
tree70f0cf96b1a9834360fb1c5d5547939693ecd577 /src/common
parentMerge pull request #871 from bunnei/audio-config (diff)
downloadyuzu-df5b75694f5abde94ccf05fa6c7a557b1ba9079b.tar
yuzu-df5b75694f5abde94ccf05fa6c7a557b1ba9079b.tar.gz
yuzu-df5b75694f5abde94ccf05fa6c7a557b1ba9079b.tar.bz2
yuzu-df5b75694f5abde94ccf05fa6c7a557b1ba9079b.tar.lz
yuzu-df5b75694f5abde94ccf05fa6c7a557b1ba9079b.tar.xz
yuzu-df5b75694f5abde94ccf05fa6c7a557b1ba9079b.tar.zst
yuzu-df5b75694f5abde94ccf05fa6c7a557b1ba9079b.zip
Diffstat (limited to '')
-rw-r--r--src/common/file_util.cpp12
-rw-r--r--src/common/file_util.h2
-rw-r--r--src/common/logging/backend.cpp1
-rw-r--r--src/common/logging/log.h1
4 files changed, 16 insertions, 0 deletions
diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp
index b8dd92b65..89004c3c0 100644
--- a/src/common/file_util.cpp
+++ b/src/common/file_util.cpp
@@ -736,6 +736,18 @@ const std::string& GetUserPath(UserPath path, const std::string& new_path) {
return paths[path];
}
+std::string GetHactoolConfigurationPath() {
+#ifdef _WIN32
+ char path[MAX_PATH];
+ if (SHGetFolderPathA(NULL, CSIDL_PROFILE, NULL, 0, path) != S_OK)
+ return "";
+ std::string local_path = Common::StringFromFixedZeroTerminatedBuffer(path, MAX_PATH);
+ return local_path + "\\.switch";
+#else
+ return GetHomeDirectory() + "/.switch";
+#endif
+}
+
size_t WriteStringToFile(bool text_file, const std::string& str, const char* filename) {
return FileUtil::IOFile(filename, text_file ? "w" : "wb").WriteBytes(str.data(), str.size());
}
diff --git a/src/common/file_util.h b/src/common/file_util.h
index bc9272d89..d530d86c9 100644
--- a/src/common/file_util.h
+++ b/src/common/file_util.h
@@ -125,6 +125,8 @@ bool SetCurrentDir(const std::string& directory);
// directory. To be used in "multi-user" mode (that is, installed).
const std::string& GetUserPath(UserPath path, const std::string& new_path = "");
+std::string GetHactoolConfigurationPath();
+
// Returns the path to where the sys file are
std::string GetSysDirectory();
diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp
index d86c40d26..d7d2f9a20 100644
--- a/src/common/logging/backend.cpp
+++ b/src/common/logging/backend.cpp
@@ -212,6 +212,7 @@ void FileBackend::Write(const Entry& entry) {
CLS(Input) \
CLS(Network) \
CLS(Loader) \
+ CLS(Crypto) \
CLS(WebService)
// GetClassName is a macro defined by Windows.h, grrr...
diff --git a/src/common/logging/log.h b/src/common/logging/log.h
index 140cd8e47..5a580b004 100644
--- a/src/common/logging/log.h
+++ b/src/common/logging/log.h
@@ -97,6 +97,7 @@ enum class Class : ClassType {
Audio_DSP, ///< The HLE implementation of the DSP
Audio_Sink, ///< Emulator audio output backend
Loader, ///< ROM loader
+ Crypto, ///< Cryptographic engine/functions
Input, ///< Input emulation
Network, ///< Network emulation
WebService, ///< Interface to yuzu Web Services