summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/fs/fs_util.cpp4
-rw-r--r--src/common/fs/fs_util.h11
-rw-r--r--src/common/settings.cpp8
-rw-r--r--src/common/settings.h5
4 files changed, 22 insertions, 6 deletions
diff --git a/src/common/fs/fs_util.cpp b/src/common/fs/fs_util.cpp
index 357cf5855..9f8671982 100644
--- a/src/common/fs/fs_util.cpp
+++ b/src/common/fs/fs_util.cpp
@@ -20,6 +20,10 @@ std::string ToUTF8String(std::u8string_view u8_string) {
20 return std::string{u8_string.begin(), u8_string.end()}; 20 return std::string{u8_string.begin(), u8_string.end()};
21} 21}
22 22
23std::string BufferToUTF8String(std::span<const u8> buffer) {
24 return std::string{buffer.begin(), std::ranges::find(buffer, u8{0})};
25}
26
23std::string PathToUTF8String(const std::filesystem::path& path) { 27std::string PathToUTF8String(const std::filesystem::path& path) {
24 return ToUTF8String(path.u8string()); 28 return ToUTF8String(path.u8string());
25} 29}
diff --git a/src/common/fs/fs_util.h b/src/common/fs/fs_util.h
index ec9950ee7..1ec82eb35 100644
--- a/src/common/fs/fs_util.h
+++ b/src/common/fs/fs_util.h
@@ -47,6 +47,17 @@ concept IsChar = std::same_as<T, char>;
47[[nodiscard]] std::string ToUTF8String(std::u8string_view u8_string); 47[[nodiscard]] std::string ToUTF8String(std::u8string_view u8_string);
48 48
49/** 49/**
50 * Converts a buffer of bytes to a UTF8-encoded std::string.
51 * This converts from the start of the buffer until the first encountered null-terminator.
52 * If no null-terminator is found, this converts the entire buffer instead.
53 *
54 * @param buffer Buffer of bytes
55 *
56 * @returns UTF-8 encoded std::string.
57 */
58[[nodiscard]] std::string BufferToUTF8String(std::span<const u8> buffer);
59
60/**
50 * Converts a filesystem path to a UTF-8 encoded std::string. 61 * Converts a filesystem path to a UTF-8 encoded std::string.
51 * 62 *
52 * @param path Filesystem path 63 * @param path Filesystem path
diff --git a/src/common/settings.cpp b/src/common/settings.cpp
index 66268ea0f..996315999 100644
--- a/src/common/settings.cpp
+++ b/src/common/settings.cpp
@@ -48,8 +48,8 @@ void LogSettings() {
48 log_setting("Core_UseMultiCore", values.use_multi_core.GetValue()); 48 log_setting("Core_UseMultiCore", values.use_multi_core.GetValue());
49 log_setting("CPU_Accuracy", values.cpu_accuracy.GetValue()); 49 log_setting("CPU_Accuracy", values.cpu_accuracy.GetValue());
50 log_setting("Renderer_UseResolutionFactor", values.resolution_factor.GetValue()); 50 log_setting("Renderer_UseResolutionFactor", values.resolution_factor.GetValue());
51 log_setting("Renderer_UseFrameLimit", values.use_frame_limit.GetValue()); 51 log_setting("Renderer_UseSpeedLimit", values.use_speed_limit.GetValue());
52 log_setting("Renderer_FrameLimit", values.frame_limit.GetValue()); 52 log_setting("Renderer_SpeedLimit", values.speed_limit.GetValue());
53 log_setting("Renderer_UseDiskShaderCache", values.use_disk_shader_cache.GetValue()); 53 log_setting("Renderer_UseDiskShaderCache", values.use_disk_shader_cache.GetValue());
54 log_setting("Renderer_GPUAccuracyLevel", values.gpu_accuracy.GetValue()); 54 log_setting("Renderer_GPUAccuracyLevel", values.gpu_accuracy.GetValue());
55 log_setting("Renderer_UseAsynchronousGpuEmulation", 55 log_setting("Renderer_UseAsynchronousGpuEmulation",
@@ -132,8 +132,8 @@ void RestoreGlobalState(bool is_powered_on) {
132 values.vulkan_device.SetGlobal(true); 132 values.vulkan_device.SetGlobal(true);
133 values.aspect_ratio.SetGlobal(true); 133 values.aspect_ratio.SetGlobal(true);
134 values.max_anisotropy.SetGlobal(true); 134 values.max_anisotropy.SetGlobal(true);
135 values.use_frame_limit.SetGlobal(true); 135 values.use_speed_limit.SetGlobal(true);
136 values.frame_limit.SetGlobal(true); 136 values.speed_limit.SetGlobal(true);
137 values.use_disk_shader_cache.SetGlobal(true); 137 values.use_disk_shader_cache.SetGlobal(true);
138 values.gpu_accuracy.SetGlobal(true); 138 values.gpu_accuracy.SetGlobal(true);
139 values.use_asynchronous_gpu_emulation.SetGlobal(true); 139 values.use_asynchronous_gpu_emulation.SetGlobal(true);
diff --git a/src/common/settings.h b/src/common/settings.h
index 801bed603..cfc1ab46f 100644
--- a/src/common/settings.h
+++ b/src/common/settings.h
@@ -336,14 +336,15 @@ struct Values {
336 "fullscreen_mode"}; 336 "fullscreen_mode"};
337 Setting<int> aspect_ratio{0, "aspect_ratio"}; 337 Setting<int> aspect_ratio{0, "aspect_ratio"};
338 Setting<int> max_anisotropy{0, "max_anisotropy"}; 338 Setting<int> max_anisotropy{0, "max_anisotropy"};
339 Setting<bool> use_frame_limit{true, "use_frame_limit"}; 339 Setting<bool> use_speed_limit{true, "use_speed_limit"};
340 Setting<u16> frame_limit{100, "frame_limit"}; 340 Setting<u16> speed_limit{100, "speed_limit"};
341 Setting<bool> use_disk_shader_cache{true, "use_disk_shader_cache"}; 341 Setting<bool> use_disk_shader_cache{true, "use_disk_shader_cache"};
342 Setting<GPUAccuracy> gpu_accuracy{GPUAccuracy::High, "gpu_accuracy"}; 342 Setting<GPUAccuracy> gpu_accuracy{GPUAccuracy::High, "gpu_accuracy"};
343 Setting<bool> use_asynchronous_gpu_emulation{true, "use_asynchronous_gpu_emulation"}; 343 Setting<bool> use_asynchronous_gpu_emulation{true, "use_asynchronous_gpu_emulation"};
344 Setting<bool> use_nvdec_emulation{true, "use_nvdec_emulation"}; 344 Setting<bool> use_nvdec_emulation{true, "use_nvdec_emulation"};
345 Setting<bool> accelerate_astc{true, "accelerate_astc"}; 345 Setting<bool> accelerate_astc{true, "accelerate_astc"};
346 Setting<bool> use_vsync{true, "use_vsync"}; 346 Setting<bool> use_vsync{true, "use_vsync"};
347 BasicSetting<u16> fps_cap{1000, "fps_cap"};
347 BasicSetting<bool> disable_fps_limit{false, "disable_fps_limit"}; 348 BasicSetting<bool> disable_fps_limit{false, "disable_fps_limit"};
348 Setting<ShaderBackend> shader_backend{ShaderBackend::GLASM, "shader_backend"}; 349 Setting<ShaderBackend> shader_backend{ShaderBackend::GLASM, "shader_backend"};
349 Setting<bool> use_asynchronous_shaders{false, "use_asynchronous_shaders"}; 350 Setting<bool> use_asynchronous_shaders{false, "use_asynchronous_shaders"};