summaryrefslogtreecommitdiff
path: root/src/core/hle
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle')
-rw-r--r--src/core/hle/service/cfg/cfg.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/core/hle/service/cfg/cfg.cpp b/src/core/hle/service/cfg/cfg.cpp
index 034a2c0d6..abc2480f3 100644
--- a/src/core/hle/service/cfg/cfg.cpp
+++ b/src/core/hle/service/cfg/cfg.cpp
@@ -2,6 +2,7 @@
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>
5#include "common/log.h" 6#include "common/log.h"
6#include "common/make_unique.h" 7#include "common/make_unique.h"
7#include "core/file_sys/archive_systemsavedata.h" 8#include "core/file_sys/archive_systemsavedata.h"
@@ -33,8 +34,8 @@ const std::array<float, 8> STEREO_CAMERA_SETTINGS = {
33 10.0f, 5.0f, 55.58000183105469f, 21.56999969482422f 34 10.0f, 5.0f, 55.58000183105469f, 21.56999969482422f
34}; 35};
35 36
36const u32 CONFIG_SAVEFILE_SIZE = 0x8000; 37static const u32 CONFIG_SAVEFILE_SIZE = 0x8000;
37std::array<u8, CONFIG_SAVEFILE_SIZE> cfg_config_file_buffer = {}; 38static std::array<u8, CONFIG_SAVEFILE_SIZE> cfg_config_file_buffer;
38 39
39static std::unique_ptr<FileSys::Archive_SystemSaveData> cfg_system_save_data; 40static std::unique_ptr<FileSys::Archive_SystemSaveData> cfg_system_save_data;
40 41
@@ -118,7 +119,7 @@ ResultCode FormatConfig() {
118 if (!res.IsSuccess()) 119 if (!res.IsSuccess())
119 return res; 120 return res;
120 // Delete the old data 121 // Delete the old data
121 std::fill(cfg_config_file_buffer.begin(), cfg_config_file_buffer.end(), 0); 122 cfg_config_file_buffer.fill(0);
122 // Create the header 123 // Create the header
123 SaveFileConfig* config = reinterpret_cast<SaveFileConfig*>(cfg_config_file_buffer.data()); 124 SaveFileConfig* config = reinterpret_cast<SaveFileConfig*>(cfg_config_file_buffer.data());
124 // This value is hardcoded, taken from 3dbrew, verified by hardware, it's always the same value 125 // This value is hardcoded, taken from 3dbrew, verified by hardware, it's always the same value
@@ -160,9 +161,8 @@ ResultCode FormatConfig() {
160void CFGInit() { 161void CFGInit() {
161 // TODO(Subv): In the future we should use the FS service to query this archive, 162 // TODO(Subv): In the future we should use the FS service to query this archive,
162 // currently it is not possible because you can only have one open archive of the same type at any time 163 // currently it is not possible because you can only have one open archive of the same type at any time
163 using Common::make_unique;
164 std::string syssavedata_directory = FileUtil::GetUserPath(D_SYSSAVEDATA_IDX); 164 std::string syssavedata_directory = FileUtil::GetUserPath(D_SYSSAVEDATA_IDX);
165 cfg_system_save_data = make_unique<FileSys::Archive_SystemSaveData>( 165 cfg_system_save_data = Common::make_unique<FileSys::Archive_SystemSaveData>(
166 syssavedata_directory, CFG_SAVE_ID); 166 syssavedata_directory, CFG_SAVE_ID);
167 if (!cfg_system_save_data->Initialize()) { 167 if (!cfg_system_save_data->Initialize()) {
168 LOG_CRITICAL(Service_CFG, "Could not initialize SystemSaveData archive for the CFG:U service"); 168 LOG_CRITICAL(Service_CFG, "Could not initialize SystemSaveData archive for the CFG:U service");