diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/common_paths.h | 6 | ||||
| -rw-r--r-- | src/common/file_util.cpp | 68 | ||||
| -rw-r--r-- | src/common/file_util.h | 27 | ||||
| -rw-r--r-- | src/core/arm/arm_interface.h | 3 | ||||
| -rw-r--r-- | src/core/arm/dynarmic/arm_dynarmic.cpp | 2 | ||||
| -rw-r--r-- | src/core/arm/unicorn/arm_unicorn.cpp | 4 | ||||
| -rw-r--r-- | src/core/file_sys/partition_filesystem.cpp | 12 | ||||
| -rw-r--r-- | src/core/file_sys/vfs_real.cpp | 16 | ||||
| -rw-r--r-- | src/core/hle/service/filesystem/filesystem.cpp | 4 | ||||
| -rw-r--r-- | src/core/hle/service/ns/pl_u.cpp | 2 | ||||
| -rw-r--r-- | src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp | 30 | ||||
| -rw-r--r-- | src/core/hle/service/nvdrv/devices/nvhost_gpu.h | 8 | ||||
| -rw-r--r-- | src/core/hle/service/nvdrv/interface.cpp | 2 | ||||
| -rw-r--r-- | src/core/telemetry_session.cpp | 6 | ||||
| -rw-r--r-- | src/yuzu/configuration/config.cpp | 2 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_debug.cpp | 2 | ||||
| -rw-r--r-- | src/yuzu/main.cpp | 18 | ||||
| -rw-r--r-- | src/yuzu_cmd/config.cpp | 2 | ||||
| -rw-r--r-- | src/yuzu_cmd/yuzu.cpp | 21 |
19 files changed, 139 insertions, 96 deletions
diff --git a/src/common/common_paths.h b/src/common/common_paths.h index 9bf3efaf2..6799a357a 100644 --- a/src/common/common_paths.h +++ b/src/common/common_paths.h | |||
| @@ -26,7 +26,7 @@ | |||
| 26 | #define USA_DIR "USA" | 26 | #define USA_DIR "USA" |
| 27 | #define JAP_DIR "JAP" | 27 | #define JAP_DIR "JAP" |
| 28 | 28 | ||
| 29 | // Subdirs in the User dir returned by GetUserPath(D_USER_IDX) | 29 | // Subdirs in the User dir returned by GetUserPath(UserPath::UserDir) |
| 30 | #define CONFIG_DIR "config" | 30 | #define CONFIG_DIR "config" |
| 31 | #define CACHE_DIR "cache" | 31 | #define CACHE_DIR "cache" |
| 32 | #define SDMC_DIR "sdmc" | 32 | #define SDMC_DIR "sdmc" |
| @@ -35,11 +35,11 @@ | |||
| 35 | #define LOG_DIR "log" | 35 | #define LOG_DIR "log" |
| 36 | 36 | ||
| 37 | // Filenames | 37 | // Filenames |
| 38 | // Files in the directory returned by GetUserPath(D_CONFIG_IDX) | 38 | // Files in the directory returned by GetUserPath(UserPath::ConfigDir) |
| 39 | #define EMU_CONFIG "emu.ini" | 39 | #define EMU_CONFIG "emu.ini" |
| 40 | #define DEBUGGER_CONFIG "debugger.ini" | 40 | #define DEBUGGER_CONFIG "debugger.ini" |
| 41 | #define LOGGER_CONFIG "logger.ini" | 41 | #define LOGGER_CONFIG "logger.ini" |
| 42 | // Files in the directory returned by GetUserPath(D_LOGS_IDX) | 42 | // Files in the directory returned by GetUserPath(UserPath::LogDir) |
| 43 | #define LOG_FILE "yuzu_log.txt" | 43 | #define LOG_FILE "yuzu_log.txt" |
| 44 | 44 | ||
| 45 | // Sys files | 45 | // Sys files |
diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp index c882ab39f..1e28f7cbb 100644 --- a/src/common/file_util.cpp +++ b/src/common/file_util.cpp | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <sstream> | 5 | #include <sstream> |
| 6 | #include <unordered_map> | ||
| 6 | #include "common/assert.h" | 7 | #include "common/assert.h" |
| 7 | #include "common/common_funcs.h" | 8 | #include "common/common_funcs.h" |
| 8 | #include "common/common_paths.h" | 9 | #include "common/common_paths.h" |
| @@ -681,67 +682,68 @@ std::string GetSysDirectory() { | |||
| 681 | 682 | ||
| 682 | // Returns a string with a yuzu data dir or file in the user's home | 683 | // Returns a string with a yuzu data dir or file in the user's home |
| 683 | // directory. To be used in "multi-user" mode (that is, installed). | 684 | // directory. To be used in "multi-user" mode (that is, installed). |
| 684 | const std::string& GetUserPath(const unsigned int DirIDX, const std::string& newPath) { | 685 | const std::string& GetUserPath(UserPath path, const std::string& new_path) { |
| 685 | static std::string paths[NUM_PATH_INDICES]; | 686 | static std::unordered_map<UserPath, std::string> paths; |
| 687 | auto& user_path = paths[UserPath::UserDir]; | ||
| 686 | 688 | ||
| 687 | // Set up all paths and files on the first run | 689 | // Set up all paths and files on the first run |
| 688 | if (paths[D_USER_IDX].empty()) { | 690 | if (user_path.empty()) { |
| 689 | #ifdef _WIN32 | 691 | #ifdef _WIN32 |
| 690 | paths[D_USER_IDX] = GetExeDirectory() + DIR_SEP USERDATA_DIR DIR_SEP; | 692 | user_path = GetExeDirectory() + DIR_SEP USERDATA_DIR DIR_SEP; |
| 691 | if (!FileUtil::IsDirectory(paths[D_USER_IDX])) { | 693 | if (!FileUtil::IsDirectory(user_path)) { |
| 692 | paths[D_USER_IDX] = AppDataRoamingDirectory() + DIR_SEP EMU_DATA_DIR DIR_SEP; | 694 | user_path = AppDataRoamingDirectory() + DIR_SEP EMU_DATA_DIR DIR_SEP; |
| 693 | } else { | 695 | } else { |
| 694 | LOG_INFO(Common_Filesystem, "Using the local user directory"); | 696 | LOG_INFO(Common_Filesystem, "Using the local user directory"); |
| 695 | } | 697 | } |
| 696 | 698 | ||
| 697 | paths[D_CONFIG_IDX] = paths[D_USER_IDX] + CONFIG_DIR DIR_SEP; | 699 | paths.emplace(UserPath::ConfigDir, user_path + CONFIG_DIR DIR_SEP); |
| 698 | paths[D_CACHE_IDX] = paths[D_USER_IDX] + CACHE_DIR DIR_SEP; | 700 | paths.emplace(UserPath::CacheDir, user_path + CACHE_DIR DIR_SEP); |
| 699 | #else | 701 | #else |
| 700 | if (FileUtil::Exists(ROOT_DIR DIR_SEP USERDATA_DIR)) { | 702 | if (FileUtil::Exists(ROOT_DIR DIR_SEP USERDATA_DIR)) { |
| 701 | paths[D_USER_IDX] = ROOT_DIR DIR_SEP USERDATA_DIR DIR_SEP; | 703 | user_path = ROOT_DIR DIR_SEP USERDATA_DIR DIR_SEP; |
| 702 | paths[D_CONFIG_IDX] = paths[D_USER_IDX] + CONFIG_DIR DIR_SEP; | 704 | paths.emplace(UserPath::ConfigDir, user_path + CONFIG_DIR DIR_SEP); |
| 703 | paths[D_CACHE_IDX] = paths[D_USER_IDX] + CACHE_DIR DIR_SEP; | 705 | paths.emplace(UserPath::CacheDir, user_path + CACHE_DIR DIR_SEP); |
| 704 | } else { | 706 | } else { |
| 705 | std::string data_dir = GetUserDirectory("XDG_DATA_HOME"); | 707 | std::string data_dir = GetUserDirectory("XDG_DATA_HOME"); |
| 706 | std::string config_dir = GetUserDirectory("XDG_CONFIG_HOME"); | 708 | std::string config_dir = GetUserDirectory("XDG_CONFIG_HOME"); |
| 707 | std::string cache_dir = GetUserDirectory("XDG_CACHE_HOME"); | 709 | std::string cache_dir = GetUserDirectory("XDG_CACHE_HOME"); |
| 708 | 710 | ||
| 709 | paths[D_USER_IDX] = data_dir + DIR_SEP EMU_DATA_DIR DIR_SEP; | 711 | user_path = data_dir + DIR_SEP EMU_DATA_DIR DIR_SEP; |
| 710 | paths[D_CONFIG_IDX] = config_dir + DIR_SEP EMU_DATA_DIR DIR_SEP; | 712 | paths.emplace(UserPath::ConfigDir, config_dir + DIR_SEP EMU_DATA_DIR DIR_SEP); |
| 711 | paths[D_CACHE_IDX] = cache_dir + DIR_SEP EMU_DATA_DIR DIR_SEP; | 713 | paths.emplace(UserPath::CacheDir, cache_dir + DIR_SEP EMU_DATA_DIR DIR_SEP); |
| 712 | } | 714 | } |
| 713 | #endif | 715 | #endif |
| 714 | paths[D_SDMC_IDX] = paths[D_USER_IDX] + SDMC_DIR DIR_SEP; | 716 | paths.emplace(UserPath::SDMCDir, user_path + SDMC_DIR DIR_SEP); |
| 715 | paths[D_NAND_IDX] = paths[D_USER_IDX] + NAND_DIR DIR_SEP; | 717 | paths.emplace(UserPath::NANDDir, user_path + NAND_DIR DIR_SEP); |
| 716 | paths[D_SYSDATA_IDX] = paths[D_USER_IDX] + SYSDATA_DIR DIR_SEP; | 718 | paths.emplace(UserPath::SysDataDir, user_path + SYSDATA_DIR DIR_SEP); |
| 717 | // TODO: Put the logs in a better location for each OS | 719 | // TODO: Put the logs in a better location for each OS |
| 718 | paths[D_LOGS_IDX] = paths[D_USER_IDX] + LOG_DIR DIR_SEP; | 720 | paths.emplace(UserPath::LogDir, user_path + LOG_DIR DIR_SEP); |
| 719 | } | 721 | } |
| 720 | 722 | ||
| 721 | if (!newPath.empty()) { | 723 | if (!new_path.empty()) { |
| 722 | if (!FileUtil::IsDirectory(newPath)) { | 724 | if (!FileUtil::IsDirectory(new_path)) { |
| 723 | LOG_ERROR(Common_Filesystem, "Invalid path specified {}", newPath); | 725 | LOG_ERROR(Common_Filesystem, "Invalid path specified {}", new_path); |
| 724 | return paths[DirIDX]; | 726 | return paths[path]; |
| 725 | } else { | 727 | } else { |
| 726 | paths[DirIDX] = newPath; | 728 | paths[path] = new_path; |
| 727 | } | 729 | } |
| 728 | 730 | ||
| 729 | switch (DirIDX) { | 731 | switch (path) { |
| 730 | case D_ROOT_IDX: | 732 | case UserPath::RootDir: |
| 731 | paths[D_USER_IDX] = paths[D_ROOT_IDX] + DIR_SEP; | 733 | user_path = paths[UserPath::RootDir] + DIR_SEP; |
| 732 | break; | 734 | break; |
| 733 | 735 | ||
| 734 | case D_USER_IDX: | 736 | case UserPath::UserDir: |
| 735 | paths[D_USER_IDX] = paths[D_ROOT_IDX] + DIR_SEP; | 737 | user_path = paths[UserPath::RootDir] + DIR_SEP; |
| 736 | paths[D_CONFIG_IDX] = paths[D_USER_IDX] + CONFIG_DIR DIR_SEP; | 738 | paths[UserPath::ConfigDir] = user_path + CONFIG_DIR DIR_SEP; |
| 737 | paths[D_CACHE_IDX] = paths[D_USER_IDX] + CACHE_DIR DIR_SEP; | 739 | paths[UserPath::CacheDir] = user_path + CACHE_DIR DIR_SEP; |
| 738 | paths[D_SDMC_IDX] = paths[D_USER_IDX] + SDMC_DIR DIR_SEP; | 740 | paths[UserPath::SDMCDir] = user_path + SDMC_DIR DIR_SEP; |
| 739 | paths[D_NAND_IDX] = paths[D_USER_IDX] + NAND_DIR DIR_SEP; | 741 | paths[UserPath::NANDDir] = user_path + NAND_DIR DIR_SEP; |
| 740 | break; | 742 | break; |
| 741 | } | 743 | } |
| 742 | } | 744 | } |
| 743 | 745 | ||
| 744 | return paths[DirIDX]; | 746 | return paths[path]; |
| 745 | } | 747 | } |
| 746 | 748 | ||
| 747 | size_t WriteStringToFile(bool text_file, const std::string& str, const char* filename) { | 749 | size_t WriteStringToFile(bool text_file, const std::string& str, const char* filename) { |
diff --git a/src/common/file_util.h b/src/common/file_util.h index 1f38b1560..ff01bf0ff 100644 --- a/src/common/file_util.h +++ b/src/common/file_util.h | |||
| @@ -16,21 +16,20 @@ | |||
| 16 | #include "common/string_util.h" | 16 | #include "common/string_util.h" |
| 17 | #endif | 17 | #endif |
| 18 | 18 | ||
| 19 | // User directory indices for GetUserPath | ||
| 20 | enum { | ||
| 21 | D_USER_IDX, | ||
| 22 | D_ROOT_IDX, | ||
| 23 | D_CONFIG_IDX, | ||
| 24 | D_CACHE_IDX, | ||
| 25 | D_SDMC_IDX, | ||
| 26 | D_NAND_IDX, | ||
| 27 | D_SYSDATA_IDX, | ||
| 28 | D_LOGS_IDX, | ||
| 29 | NUM_PATH_INDICES | ||
| 30 | }; | ||
| 31 | |||
| 32 | namespace FileUtil { | 19 | namespace FileUtil { |
| 33 | 20 | ||
| 21 | // User paths for GetUserPath | ||
| 22 | enum class UserPath { | ||
| 23 | CacheDir, | ||
| 24 | ConfigDir, | ||
| 25 | LogDir, | ||
| 26 | NANDDir, | ||
| 27 | RootDir, | ||
| 28 | SDMCDir, | ||
| 29 | SysDataDir, | ||
| 30 | UserDir, | ||
| 31 | }; | ||
| 32 | |||
| 34 | // FileSystem tree node/ | 33 | // FileSystem tree node/ |
| 35 | struct FSTEntry { | 34 | struct FSTEntry { |
| 36 | bool isDirectory; | 35 | bool isDirectory; |
| @@ -123,7 +122,7 @@ bool SetCurrentDir(const std::string& directory); | |||
| 123 | 122 | ||
| 124 | // Returns a pointer to a string with a yuzu data dir in the user's home | 123 | // Returns a pointer to a string with a yuzu data dir in the user's home |
| 125 | // directory. To be used in "multi-user" mode (that is, installed). | 124 | // directory. To be used in "multi-user" mode (that is, installed). |
| 126 | const std::string& GetUserPath(const unsigned int DirIDX, const std::string& newPath = ""); | 125 | const std::string& GetUserPath(UserPath path, const std::string& new_path = ""); |
| 127 | 126 | ||
| 128 | // Returns the path to where the sys file are | 127 | // Returns the path to where the sys file are |
| 129 | std::string GetSysDirectory(); | 128 | std::string GetSysDirectory(); |
diff --git a/src/core/arm/arm_interface.h b/src/core/arm/arm_interface.h index 28a99defe..b0d7ced7f 100644 --- a/src/core/arm/arm_interface.h +++ b/src/core/arm/arm_interface.h | |||
| @@ -20,9 +20,6 @@ public: | |||
| 20 | u64 cpsr; | 20 | u64 cpsr; |
| 21 | std::array<u128, 32> fpu_registers; | 21 | std::array<u128, 32> fpu_registers; |
| 22 | u64 fpscr; | 22 | u64 fpscr; |
| 23 | |||
| 24 | // TODO(bunnei): Fix once we have proper support for tpidrro_el0, etc. in the JIT | ||
| 25 | VAddr tls_address; | ||
| 26 | }; | 23 | }; |
| 27 | 24 | ||
| 28 | /// Runs the CPU until an event happens | 25 | /// Runs the CPU until an event happens |
diff --git a/src/core/arm/dynarmic/arm_dynarmic.cpp b/src/core/arm/dynarmic/arm_dynarmic.cpp index df47d5ee8..5d7efc9b6 100644 --- a/src/core/arm/dynarmic/arm_dynarmic.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic.cpp | |||
| @@ -211,7 +211,6 @@ void ARM_Dynarmic::SaveContext(ARM_Interface::ThreadContext& ctx) { | |||
| 211 | ctx.cpsr = jit->GetPstate(); | 211 | ctx.cpsr = jit->GetPstate(); |
| 212 | ctx.fpu_registers = jit->GetVectors(); | 212 | ctx.fpu_registers = jit->GetVectors(); |
| 213 | ctx.fpscr = jit->GetFpcr(); | 213 | ctx.fpscr = jit->GetFpcr(); |
| 214 | ctx.tls_address = cb->tpidrro_el0; | ||
| 215 | } | 214 | } |
| 216 | 215 | ||
| 217 | void ARM_Dynarmic::LoadContext(const ARM_Interface::ThreadContext& ctx) { | 216 | void ARM_Dynarmic::LoadContext(const ARM_Interface::ThreadContext& ctx) { |
| @@ -221,7 +220,6 @@ void ARM_Dynarmic::LoadContext(const ARM_Interface::ThreadContext& ctx) { | |||
| 221 | jit->SetPstate(static_cast<u32>(ctx.cpsr)); | 220 | jit->SetPstate(static_cast<u32>(ctx.cpsr)); |
| 222 | jit->SetVectors(ctx.fpu_registers); | 221 | jit->SetVectors(ctx.fpu_registers); |
| 223 | jit->SetFpcr(static_cast<u32>(ctx.fpscr)); | 222 | jit->SetFpcr(static_cast<u32>(ctx.fpscr)); |
| 224 | cb->tpidrro_el0 = ctx.tls_address; | ||
| 225 | } | 223 | } |
| 226 | 224 | ||
| 227 | void ARM_Dynarmic::PrepareReschedule() { | 225 | void ARM_Dynarmic::PrepareReschedule() { |
diff --git a/src/core/arm/unicorn/arm_unicorn.cpp b/src/core/arm/unicorn/arm_unicorn.cpp index 44a46bf04..4c11f35a4 100644 --- a/src/core/arm/unicorn/arm_unicorn.cpp +++ b/src/core/arm/unicorn/arm_unicorn.cpp | |||
| @@ -230,8 +230,6 @@ void ARM_Unicorn::SaveContext(ARM_Interface::ThreadContext& ctx) { | |||
| 230 | 230 | ||
| 231 | CHECKED(uc_reg_read_batch(uc, uregs, tregs, 31)); | 231 | CHECKED(uc_reg_read_batch(uc, uregs, tregs, 31)); |
| 232 | 232 | ||
| 233 | ctx.tls_address = GetTlsAddress(); | ||
| 234 | |||
| 235 | for (int i = 0; i < 32; ++i) { | 233 | for (int i = 0; i < 32; ++i) { |
| 236 | uregs[i] = UC_ARM64_REG_Q0 + i; | 234 | uregs[i] = UC_ARM64_REG_Q0 + i; |
| 237 | tregs[i] = &ctx.fpu_registers[i]; | 235 | tregs[i] = &ctx.fpu_registers[i]; |
| @@ -259,8 +257,6 @@ void ARM_Unicorn::LoadContext(const ARM_Interface::ThreadContext& ctx) { | |||
| 259 | 257 | ||
| 260 | CHECKED(uc_reg_write_batch(uc, uregs, tregs, 31)); | 258 | CHECKED(uc_reg_write_batch(uc, uregs, tregs, 31)); |
| 261 | 259 | ||
| 262 | SetTlsAddress(ctx.tls_address); | ||
| 263 | |||
| 264 | for (auto i = 0; i < 32; ++i) { | 260 | for (auto i = 0; i < 32; ++i) { |
| 265 | uregs[i] = UC_ARM64_REG_Q0 + i; | 261 | uregs[i] = UC_ARM64_REG_Q0 + i; |
| 266 | tregs[i] = (void*)&ctx.fpu_registers[i]; | 262 | tregs[i] = (void*)&ctx.fpu_registers[i]; |
diff --git a/src/core/file_sys/partition_filesystem.cpp b/src/core/file_sys/partition_filesystem.cpp index 7ccca1089..8d2bd9f6b 100644 --- a/src/core/file_sys/partition_filesystem.cpp +++ b/src/core/file_sys/partition_filesystem.cpp | |||
| @@ -2,7 +2,12 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <algorithm> | ||
| 6 | #include <cstddef> | ||
| 7 | #include <cstring> | ||
| 8 | #include <iterator> | ||
| 5 | #include <utility> | 9 | #include <utility> |
| 10 | |||
| 6 | #include "common/file_util.h" | 11 | #include "common/file_util.h" |
| 7 | #include "common/logging/log.h" | 12 | #include "common/logging/log.h" |
| 8 | #include "core/file_sys/partition_filesystem.h" | 13 | #include "core/file_sys/partition_filesystem.h" |
| @@ -99,14 +104,15 @@ void PartitionFilesystem::PrintDebugInfo() const { | |||
| 99 | } | 104 | } |
| 100 | 105 | ||
| 101 | bool PartitionFilesystem::ReplaceFileWithSubdirectory(VirtualFile file, VirtualDir dir) { | 106 | bool PartitionFilesystem::ReplaceFileWithSubdirectory(VirtualFile file, VirtualDir dir) { |
| 102 | auto iter = std::find(pfs_files.begin(), pfs_files.end(), file); | 107 | const auto iter = std::find(pfs_files.begin(), pfs_files.end(), file); |
| 103 | if (iter == pfs_files.end()) | 108 | if (iter == pfs_files.end()) |
| 104 | return false; | 109 | return false; |
| 105 | 110 | ||
| 106 | pfs_files[iter - pfs_files.begin()] = pfs_files.back(); | 111 | const std::ptrdiff_t offset = std::distance(pfs_files.begin(), iter); |
| 112 | pfs_files[offset] = pfs_files.back(); | ||
| 107 | pfs_files.pop_back(); | 113 | pfs_files.pop_back(); |
| 108 | 114 | ||
| 109 | pfs_dirs.emplace_back(dir); | 115 | pfs_dirs.emplace_back(std::move(dir)); |
| 110 | 116 | ||
| 111 | return true; | 117 | return true; |
| 112 | } | 118 | } |
diff --git a/src/core/file_sys/vfs_real.cpp b/src/core/file_sys/vfs_real.cpp index 22c858e0d..f27fb1f2a 100644 --- a/src/core/file_sys/vfs_real.cpp +++ b/src/core/file_sys/vfs_real.cpp | |||
| @@ -2,6 +2,11 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <algorithm> | ||
| 6 | #include <cstddef> | ||
| 7 | #include <iterator> | ||
| 8 | #include <utility> | ||
| 9 | |||
| 5 | #include "common/common_paths.h" | 10 | #include "common/common_paths.h" |
| 6 | #include "common/logging/log.h" | 11 | #include "common/logging/log.h" |
| 7 | #include "core/file_sys/vfs_real.h" | 12 | #include "core/file_sys/vfs_real.h" |
| @@ -104,11 +109,11 @@ RealVfsDirectory::RealVfsDirectory(const std::string& path_, Mode perms_) | |||
| 104 | } | 109 | } |
| 105 | 110 | ||
| 106 | std::vector<std::shared_ptr<VfsFile>> RealVfsDirectory::GetFiles() const { | 111 | std::vector<std::shared_ptr<VfsFile>> RealVfsDirectory::GetFiles() const { |
| 107 | return std::vector<std::shared_ptr<VfsFile>>(files); | 112 | return files; |
| 108 | } | 113 | } |
| 109 | 114 | ||
| 110 | std::vector<std::shared_ptr<VfsDirectory>> RealVfsDirectory::GetSubdirectories() const { | 115 | std::vector<std::shared_ptr<VfsDirectory>> RealVfsDirectory::GetSubdirectories() const { |
| 111 | return std::vector<std::shared_ptr<VfsDirectory>>(subdirectories); | 116 | return subdirectories; |
| 112 | } | 117 | } |
| 113 | 118 | ||
| 114 | bool RealVfsDirectory::IsWritable() const { | 119 | bool RealVfsDirectory::IsWritable() const { |
| @@ -163,14 +168,15 @@ bool RealVfsDirectory::Rename(const std::string& name) { | |||
| 163 | } | 168 | } |
| 164 | 169 | ||
| 165 | bool RealVfsDirectory::ReplaceFileWithSubdirectory(VirtualFile file, VirtualDir dir) { | 170 | bool RealVfsDirectory::ReplaceFileWithSubdirectory(VirtualFile file, VirtualDir dir) { |
| 166 | auto iter = std::find(files.begin(), files.end(), file); | 171 | const auto iter = std::find(files.begin(), files.end(), file); |
| 167 | if (iter == files.end()) | 172 | if (iter == files.end()) |
| 168 | return false; | 173 | return false; |
| 169 | 174 | ||
| 170 | files[iter - files.begin()] = files.back(); | 175 | const std::ptrdiff_t offset = std::distance(files.begin(), iter); |
| 176 | files[offset] = files.back(); | ||
| 171 | files.pop_back(); | 177 | files.pop_back(); |
| 172 | 178 | ||
| 173 | subdirectories.emplace_back(dir); | 179 | subdirectories.emplace_back(std::move(dir)); |
| 174 | 180 | ||
| 175 | return true; | 181 | return true; |
| 176 | } | 182 | } |
diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp index dffcdfbaf..671e0b8d0 100644 --- a/src/core/hle/service/filesystem/filesystem.cpp +++ b/src/core/hle/service/filesystem/filesystem.cpp | |||
| @@ -272,9 +272,9 @@ void RegisterFileSystems() { | |||
| 272 | sdmc_factory = nullptr; | 272 | sdmc_factory = nullptr; |
| 273 | 273 | ||
| 274 | auto nand_directory = std::make_shared<FileSys::RealVfsDirectory>( | 274 | auto nand_directory = std::make_shared<FileSys::RealVfsDirectory>( |
| 275 | FileUtil::GetUserPath(D_NAND_IDX), FileSys::Mode::Write); | 275 | FileUtil::GetUserPath(FileUtil::UserPath::NANDDir), FileSys::Mode::Write); |
| 276 | auto sd_directory = std::make_shared<FileSys::RealVfsDirectory>( | 276 | auto sd_directory = std::make_shared<FileSys::RealVfsDirectory>( |
| 277 | FileUtil::GetUserPath(D_SDMC_IDX), FileSys::Mode::Write); | 277 | FileUtil::GetUserPath(FileUtil::UserPath::SDMCDir), FileSys::Mode::Write); |
| 278 | 278 | ||
| 279 | auto savedata = std::make_unique<FileSys::SaveDataFactory>(std::move(nand_directory)); | 279 | auto savedata = std::make_unique<FileSys::SaveDataFactory>(std::move(nand_directory)); |
| 280 | save_data_factory = std::move(savedata); | 280 | save_data_factory = std::move(savedata); |
diff --git a/src/core/hle/service/ns/pl_u.cpp b/src/core/hle/service/ns/pl_u.cpp index 691b1d106..bad27894a 100644 --- a/src/core/hle/service/ns/pl_u.cpp +++ b/src/core/hle/service/ns/pl_u.cpp | |||
| @@ -42,7 +42,7 @@ PL_U::PL_U() : ServiceFramework("pl:u") { | |||
| 42 | RegisterHandlers(functions); | 42 | RegisterHandlers(functions); |
| 43 | 43 | ||
| 44 | // Attempt to load shared font data from disk | 44 | // Attempt to load shared font data from disk |
| 45 | const std::string filepath{FileUtil::GetUserPath(D_SYSDATA_IDX) + SHARED_FONT}; | 45 | const std::string filepath{FileUtil::GetUserPath(FileUtil::UserPath::SysDataDir) + SHARED_FONT}; |
| 46 | FileUtil::CreateFullPath(filepath); // Create path if not already created | 46 | FileUtil::CreateFullPath(filepath); // Create path if not already created |
| 47 | FileUtil::IOFile file(filepath, "rb"); | 47 | FileUtil::IOFile file(filepath, "rb"); |
| 48 | 48 | ||
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp index 8de870596..126782573 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp +++ b/src/core/hle/service/nvdrv/devices/nvhost_gpu.cpp | |||
| @@ -42,6 +42,9 @@ u32 nvhost_gpu::ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u | |||
| 42 | if (command.cmd == NVGPU_IOCTL_CHANNEL_SUBMIT_GPFIFO) { | 42 | if (command.cmd == NVGPU_IOCTL_CHANNEL_SUBMIT_GPFIFO) { |
| 43 | return SubmitGPFIFO(input, output); | 43 | return SubmitGPFIFO(input, output); |
| 44 | } | 44 | } |
| 45 | if (command.cmd == NVGPU_IOCTL_CHANNEL_KICKOFF_PB) { | ||
| 46 | return KickoffPB(input, output); | ||
| 47 | } | ||
| 45 | } | 48 | } |
| 46 | 49 | ||
| 47 | UNIMPLEMENTED_MSG("Unimplemented ioctl"); | 50 | UNIMPLEMENTED_MSG("Unimplemented ioctl"); |
| @@ -127,14 +130,37 @@ u32 nvhost_gpu::SubmitGPFIFO(const std::vector<u8>& input, std::vector<u8>& outp | |||
| 127 | IoctlSubmitGpfifo params{}; | 130 | IoctlSubmitGpfifo params{}; |
| 128 | std::memcpy(¶ms, input.data(), sizeof(IoctlSubmitGpfifo)); | 131 | std::memcpy(¶ms, input.data(), sizeof(IoctlSubmitGpfifo)); |
| 129 | LOG_WARNING(Service_NVDRV, "(STUBBED) called, gpfifo={:X}, num_entries={:X}, flags={:X}", | 132 | LOG_WARNING(Service_NVDRV, "(STUBBED) called, gpfifo={:X}, num_entries={:X}, flags={:X}", |
| 130 | params.gpfifo, params.num_entries, params.flags); | 133 | params.address, params.num_entries, params.flags); |
| 131 | 134 | ||
| 132 | auto entries = std::vector<IoctlGpfifoEntry>(); | 135 | auto entries = std::vector<IoctlGpfifoEntry>(); |
| 133 | entries.resize(params.num_entries); | 136 | entries.resize(params.num_entries); |
| 134 | std::memcpy(&entries[0], &input.data()[sizeof(IoctlSubmitGpfifo)], | 137 | std::memcpy(&entries[0], &input.data()[sizeof(IoctlSubmitGpfifo)], |
| 135 | params.num_entries * sizeof(IoctlGpfifoEntry)); | 138 | params.num_entries * sizeof(IoctlGpfifoEntry)); |
| 136 | for (auto entry : entries) { | 139 | for (auto entry : entries) { |
| 137 | VAddr va_addr = entry.Address(); | 140 | Tegra::GPUVAddr va_addr = entry.Address(); |
| 141 | Core::System::GetInstance().GPU().ProcessCommandList(va_addr, entry.sz); | ||
| 142 | } | ||
| 143 | params.fence_out.id = 0; | ||
| 144 | params.fence_out.value = 0; | ||
| 145 | std::memcpy(output.data(), ¶ms, output.size()); | ||
| 146 | return 0; | ||
| 147 | } | ||
| 148 | |||
| 149 | u32 nvhost_gpu::KickoffPB(const std::vector<u8>& input, std::vector<u8>& output) { | ||
| 150 | if (input.size() < sizeof(IoctlSubmitGpfifo)) { | ||
| 151 | UNIMPLEMENTED(); | ||
| 152 | } | ||
| 153 | IoctlSubmitGpfifo params{}; | ||
| 154 | std::memcpy(¶ms, input.data(), sizeof(IoctlSubmitGpfifo)); | ||
| 155 | LOG_WARNING(Service_NVDRV, "(STUBBED) called, gpfifo={:X}, num_entries={:X}, flags={:X}", | ||
| 156 | params.address, params.num_entries, params.flags); | ||
| 157 | |||
| 158 | std::vector<IoctlGpfifoEntry> entries(params.num_entries); | ||
| 159 | Memory::ReadBlock(params.address, entries.data(), | ||
| 160 | params.num_entries * sizeof(IoctlGpfifoEntry)); | ||
| 161 | |||
| 162 | for (auto entry : entries) { | ||
| 163 | Tegra::GPUVAddr va_addr = entry.Address(); | ||
| 138 | Core::System::GetInstance().GPU().ProcessCommandList(va_addr, entry.sz); | 164 | Core::System::GetInstance().GPU().ProcessCommandList(va_addr, entry.sz); |
| 139 | } | 165 | } |
| 140 | params.fence_out.id = 0; | 166 | params.fence_out.id = 0; |
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_gpu.h b/src/core/hle/service/nvdrv/devices/nvhost_gpu.h index c9f6b9b6a..aa8df2e6e 100644 --- a/src/core/hle/service/nvdrv/devices/nvhost_gpu.h +++ b/src/core/hle/service/nvdrv/devices/nvhost_gpu.h | |||
| @@ -15,6 +15,7 @@ namespace Service::Nvidia::Devices { | |||
| 15 | class nvmap; | 15 | class nvmap; |
| 16 | constexpr u32 NVGPU_IOCTL_MAGIC('H'); | 16 | constexpr u32 NVGPU_IOCTL_MAGIC('H'); |
| 17 | constexpr u32 NVGPU_IOCTL_CHANNEL_SUBMIT_GPFIFO(0x8); | 17 | constexpr u32 NVGPU_IOCTL_CHANNEL_SUBMIT_GPFIFO(0x8); |
| 18 | constexpr u32 NVGPU_IOCTL_CHANNEL_KICKOFF_PB(0x1b); | ||
| 18 | 19 | ||
| 19 | class nvhost_gpu final : public nvdevice { | 20 | class nvhost_gpu final : public nvdevice { |
| 20 | public: | 21 | public: |
| @@ -158,14 +159,14 @@ private: | |||
| 158 | BitField<31, 1, u32_le> unk2; | 159 | BitField<31, 1, u32_le> unk2; |
| 159 | }; | 160 | }; |
| 160 | 161 | ||
| 161 | VAddr Address() const { | 162 | Tegra::GPUVAddr Address() const { |
| 162 | return (static_cast<VAddr>(gpu_va_hi) << 32) | entry0; | 163 | return (static_cast<Tegra::GPUVAddr>(gpu_va_hi) << 32) | entry0; |
| 163 | } | 164 | } |
| 164 | }; | 165 | }; |
| 165 | static_assert(sizeof(IoctlGpfifoEntry) == 8, "IoctlGpfifoEntry is incorrect size"); | 166 | static_assert(sizeof(IoctlGpfifoEntry) == 8, "IoctlGpfifoEntry is incorrect size"); |
| 166 | 167 | ||
| 167 | struct IoctlSubmitGpfifo { | 168 | struct IoctlSubmitGpfifo { |
| 168 | u64_le gpfifo; // (ignored) pointer to gpfifo fence structs | 169 | u64_le address; // pointer to gpfifo entry structs |
| 169 | u32_le num_entries; // number of fence objects being submitted | 170 | u32_le num_entries; // number of fence objects being submitted |
| 170 | u32_le flags; | 171 | u32_le flags; |
| 171 | IoctlFence fence_out; // returned new fence object for others to wait on | 172 | IoctlFence fence_out; // returned new fence object for others to wait on |
| @@ -193,6 +194,7 @@ private: | |||
| 193 | u32 AllocGPFIFOEx2(const std::vector<u8>& input, std::vector<u8>& output); | 194 | u32 AllocGPFIFOEx2(const std::vector<u8>& input, std::vector<u8>& output); |
| 194 | u32 AllocateObjectContext(const std::vector<u8>& input, std::vector<u8>& output); | 195 | u32 AllocateObjectContext(const std::vector<u8>& input, std::vector<u8>& output); |
| 195 | u32 SubmitGPFIFO(const std::vector<u8>& input, std::vector<u8>& output); | 196 | u32 SubmitGPFIFO(const std::vector<u8>& input, std::vector<u8>& output); |
| 197 | u32 KickoffPB(const std::vector<u8>& input, std::vector<u8>& output); | ||
| 196 | u32 GetWaitbase(const std::vector<u8>& input, std::vector<u8>& output); | 198 | u32 GetWaitbase(const std::vector<u8>& input, std::vector<u8>& output); |
| 197 | u32 ChannelSetTimeout(const std::vector<u8>& input, std::vector<u8>& output); | 199 | u32 ChannelSetTimeout(const std::vector<u8>& input, std::vector<u8>& output); |
| 198 | 200 | ||
diff --git a/src/core/hle/service/nvdrv/interface.cpp b/src/core/hle/service/nvdrv/interface.cpp index b10efd5c9..1b497b814 100644 --- a/src/core/hle/service/nvdrv/interface.cpp +++ b/src/core/hle/service/nvdrv/interface.cpp | |||
| @@ -101,7 +101,7 @@ NVDRV::NVDRV(std::shared_ptr<Module> nvdrv, const char* name) | |||
| 101 | {8, &NVDRV::SetClientPID, "SetClientPID"}, | 101 | {8, &NVDRV::SetClientPID, "SetClientPID"}, |
| 102 | {9, nullptr, "DumpGraphicsMemoryInfo"}, | 102 | {9, nullptr, "DumpGraphicsMemoryInfo"}, |
| 103 | {10, nullptr, "InitializeDevtools"}, | 103 | {10, nullptr, "InitializeDevtools"}, |
| 104 | {11, nullptr, "Ioctl2"}, | 104 | {11, &NVDRV::Ioctl, "Ioctl2"}, |
| 105 | {12, nullptr, "Ioctl3"}, | 105 | {12, nullptr, "Ioctl3"}, |
| 106 | {13, &NVDRV::FinishInitialize, "FinishInitialize"}, | 106 | {13, &NVDRV::FinishInitialize, "FinishInitialize"}, |
| 107 | }; | 107 | }; |
diff --git a/src/core/telemetry_session.cpp b/src/core/telemetry_session.cpp index b9a603df3..69aa7a7be 100644 --- a/src/core/telemetry_session.cpp +++ b/src/core/telemetry_session.cpp | |||
| @@ -37,7 +37,8 @@ static u64 GenerateTelemetryId() { | |||
| 37 | 37 | ||
| 38 | u64 GetTelemetryId() { | 38 | u64 GetTelemetryId() { |
| 39 | u64 telemetry_id{}; | 39 | u64 telemetry_id{}; |
| 40 | static const std::string& filename{FileUtil::GetUserPath(D_CONFIG_IDX) + "telemetry_id"}; | 40 | static const std::string& filename{FileUtil::GetUserPath(FileUtil::UserPath::ConfigDir) + |
| 41 | "telemetry_id"}; | ||
| 41 | 42 | ||
| 42 | if (FileUtil::Exists(filename)) { | 43 | if (FileUtil::Exists(filename)) { |
| 43 | FileUtil::IOFile file(filename, "rb"); | 44 | FileUtil::IOFile file(filename, "rb"); |
| @@ -61,7 +62,8 @@ u64 GetTelemetryId() { | |||
| 61 | 62 | ||
| 62 | u64 RegenerateTelemetryId() { | 63 | u64 RegenerateTelemetryId() { |
| 63 | const u64 new_telemetry_id{GenerateTelemetryId()}; | 64 | const u64 new_telemetry_id{GenerateTelemetryId()}; |
| 64 | static const std::string& filename{FileUtil::GetUserPath(D_CONFIG_IDX) + "telemetry_id"}; | 65 | static const std::string& filename{FileUtil::GetUserPath(FileUtil::UserPath::ConfigDir) + |
| 66 | "telemetry_id"}; | ||
| 65 | 67 | ||
| 66 | FileUtil::IOFile file(filename, "wb"); | 68 | FileUtil::IOFile file(filename, "wb"); |
| 67 | if (!file.IsOpen()) { | 69 | if (!file.IsOpen()) { |
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index 62754a1a9..98969fe10 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp | |||
| @@ -10,7 +10,7 @@ | |||
| 10 | 10 | ||
| 11 | Config::Config() { | 11 | Config::Config() { |
| 12 | // TODO: Don't hardcode the path; let the frontend decide where to put the config files. | 12 | // TODO: Don't hardcode the path; let the frontend decide where to put the config files. |
| 13 | qt_config_loc = FileUtil::GetUserPath(D_CONFIG_IDX) + "qt-config.ini"; | 13 | qt_config_loc = FileUtil::GetUserPath(FileUtil::UserPath::ConfigDir) + "qt-config.ini"; |
| 14 | FileUtil::CreateFullPath(qt_config_loc); | 14 | FileUtil::CreateFullPath(qt_config_loc); |
| 15 | qt_config = new QSettings(QString::fromStdString(qt_config_loc), QSettings::IniFormat); | 15 | qt_config = new QSettings(QString::fromStdString(qt_config_loc), QSettings::IniFormat); |
| 16 | 16 | ||
diff --git a/src/yuzu/configuration/configure_debug.cpp b/src/yuzu/configuration/configure_debug.cpp index 241db4ae3..5e66239ff 100644 --- a/src/yuzu/configuration/configure_debug.cpp +++ b/src/yuzu/configuration/configure_debug.cpp | |||
| @@ -19,7 +19,7 @@ ConfigureDebug::ConfigureDebug(QWidget* parent) : QWidget(parent), ui(new Ui::Co | |||
| 19 | ui->setupUi(this); | 19 | ui->setupUi(this); |
| 20 | this->setConfiguration(); | 20 | this->setConfiguration(); |
| 21 | connect(ui->open_log_button, &QPushButton::pressed, []() { | 21 | connect(ui->open_log_button, &QPushButton::pressed, []() { |
| 22 | QString path = QString::fromStdString(FileUtil::GetUserPath(D_LOGS_IDX)); | 22 | QString path = QString::fromStdString(FileUtil::GetUserPath(FileUtil::UserPath::LogDir)); |
| 23 | QDesktopServices::openUrl(QUrl::fromLocalFile(path)); | 23 | QDesktopServices::openUrl(QUrl::fromLocalFile(path)); |
| 24 | }); | 24 | }); |
| 25 | } | 25 | } |
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 16812e077..16a95bb19 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -909,6 +909,16 @@ void GMainWindow::UpdateUITheme() { | |||
| 909 | #undef main | 909 | #undef main |
| 910 | #endif | 910 | #endif |
| 911 | 911 | ||
| 912 | static void InitializeLogging() { | ||
| 913 | Log::Filter log_filter; | ||
| 914 | log_filter.ParseFilterString(Settings::values.log_filter); | ||
| 915 | Log::SetGlobalFilter(log_filter); | ||
| 916 | |||
| 917 | const std::string& log_dir = FileUtil::GetUserPath(FileUtil::UserPath::LogDir); | ||
| 918 | FileUtil::CreateFullPath(log_dir); | ||
| 919 | Log::AddBackend(std::make_unique<Log::FileBackend>(log_dir + LOG_FILE)); | ||
| 920 | } | ||
| 921 | |||
| 912 | int main(int argc, char* argv[]) { | 922 | int main(int argc, char* argv[]) { |
| 913 | MicroProfileOnThreadCreate("Frontend"); | 923 | MicroProfileOnThreadCreate("Frontend"); |
| 914 | SCOPE_EXIT({ MicroProfileShutdown(); }); | 924 | SCOPE_EXIT({ MicroProfileShutdown(); }); |
| @@ -927,13 +937,7 @@ int main(int argc, char* argv[]) { | |||
| 927 | 937 | ||
| 928 | GMainWindow main_window; | 938 | GMainWindow main_window; |
| 929 | // After settings have been loaded by GMainWindow, apply the filter | 939 | // After settings have been loaded by GMainWindow, apply the filter |
| 930 | Log::Filter log_filter; | 940 | InitializeLogging(); |
| 931 | log_filter.ParseFilterString(Settings::values.log_filter); | ||
| 932 | Log::SetGlobalFilter(log_filter); | ||
| 933 | FileUtil::CreateFullPath(FileUtil::GetUserPath(D_LOGS_IDX)); | ||
| 934 | Log::AddBackend( | ||
| 935 | std::make_unique<Log::FileBackend>(FileUtil::GetUserPath(D_LOGS_IDX) + LOG_FILE)); | ||
| 936 | |||
| 937 | main_window.show(); | 941 | main_window.show(); |
| 938 | return app.exec(); | 942 | return app.exec(); |
| 939 | } | 943 | } |
diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp index 723e8b4cc..cea1a5e62 100644 --- a/src/yuzu_cmd/config.cpp +++ b/src/yuzu_cmd/config.cpp | |||
| @@ -15,7 +15,7 @@ | |||
| 15 | 15 | ||
| 16 | Config::Config() { | 16 | Config::Config() { |
| 17 | // TODO: Don't hardcode the path; let the frontend decide where to put the config files. | 17 | // TODO: Don't hardcode the path; let the frontend decide where to put the config files. |
| 18 | sdl2_config_loc = FileUtil::GetUserPath(D_CONFIG_IDX) + "sdl2-config.ini"; | 18 | sdl2_config_loc = FileUtil::GetUserPath(FileUtil::UserPath::ConfigDir) + "sdl2-config.ini"; |
| 19 | sdl2_config = std::make_unique<INIReader>(sdl2_config_loc); | 19 | sdl2_config = std::make_unique<INIReader>(sdl2_config_loc); |
| 20 | 20 | ||
| 21 | Reload(); | 21 | Reload(); |
diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp index 24db1065a..b5392c499 100644 --- a/src/yuzu_cmd/yuzu.cpp +++ b/src/yuzu_cmd/yuzu.cpp | |||
| @@ -56,6 +56,18 @@ static void PrintVersion() { | |||
| 56 | std::cout << "yuzu " << Common::g_scm_branch << " " << Common::g_scm_desc << std::endl; | 56 | std::cout << "yuzu " << Common::g_scm_branch << " " << Common::g_scm_desc << std::endl; |
| 57 | } | 57 | } |
| 58 | 58 | ||
| 59 | static void InitializeLogging() { | ||
| 60 | Log::Filter log_filter(Log::Level::Debug); | ||
| 61 | log_filter.ParseFilterString(Settings::values.log_filter); | ||
| 62 | Log::SetGlobalFilter(log_filter); | ||
| 63 | |||
| 64 | Log::AddBackend(std::make_unique<Log::ColorConsoleBackend>()); | ||
| 65 | |||
| 66 | const std::string& log_dir = FileUtil::GetUserPath(FileUtil::UserPath::LogDir); | ||
| 67 | FileUtil::CreateFullPath(log_dir); | ||
| 68 | Log::AddBackend(std::make_unique<Log::FileBackend>(log_dir + LOG_FILE)); | ||
| 69 | } | ||
| 70 | |||
| 59 | /// Application entry point | 71 | /// Application entry point |
| 60 | int main(int argc, char** argv) { | 72 | int main(int argc, char** argv) { |
| 61 | Config config; | 73 | Config config; |
| @@ -124,14 +136,7 @@ int main(int argc, char** argv) { | |||
| 124 | LocalFree(argv_w); | 136 | LocalFree(argv_w); |
| 125 | #endif | 137 | #endif |
| 126 | 138 | ||
| 127 | Log::Filter log_filter(Log::Level::Debug); | 139 | InitializeLogging(); |
| 128 | log_filter.ParseFilterString(Settings::values.log_filter); | ||
| 129 | Log::SetGlobalFilter(log_filter); | ||
| 130 | |||
| 131 | Log::AddBackend(std::make_unique<Log::ColorConsoleBackend>()); | ||
| 132 | FileUtil::CreateFullPath(FileUtil::GetUserPath(D_LOGS_IDX)); | ||
| 133 | Log::AddBackend( | ||
| 134 | std::make_unique<Log::FileBackend>(FileUtil::GetUserPath(D_LOGS_IDX) + LOG_FILE)); | ||
| 135 | 140 | ||
| 136 | MicroProfileOnThreadCreate("EmuThread"); | 141 | MicroProfileOnThreadCreate("EmuThread"); |
| 137 | SCOPE_EXIT({ MicroProfileShutdown(); }); | 142 | SCOPE_EXIT({ MicroProfileShutdown(); }); |