summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/audio_core/audio_renderer.cpp2
-rw-r--r--src/audio_core/info_updater.cpp2
-rw-r--r--src/common/CMakeLists.txt1
-rw-r--r--src/common/common_funcs.h25
-rw-r--r--src/common/fs/fs_util.cpp14
-rw-r--r--src/common/fs/fs_util.h33
-rw-r--r--src/common/fs/path_util.cpp6
-rw-r--r--src/common/fs/path_util.h9
-rw-r--r--src/common/page_table.cpp1
-rw-r--r--src/common/page_table.h6
-rw-r--r--src/common/point.h57
-rw-r--r--src/core/arm/dynarmic/arm_dynarmic_32.cpp28
-rw-r--r--src/core/arm/dynarmic/arm_dynarmic_64.cpp32
-rw-r--r--src/core/file_sys/romfs_factory.cpp6
-rw-r--r--src/core/file_sys/savedata_factory.cpp10
-rw-r--r--src/core/file_sys/savedata_factory.h3
-rw-r--r--src/core/hle/kernel/hle_ipc.cpp6
-rw-r--r--src/core/hle/kernel/k_address_arbiter.cpp12
-rw-r--r--src/core/hle/kernel/k_address_arbiter.h4
-rw-r--r--src/core/hle/kernel/k_class_token.cpp79
-rw-r--r--src/core/hle/kernel/k_client_port.cpp2
-rw-r--r--src/core/hle/kernel/k_condition_variable.cpp12
-rw-r--r--src/core/hle/kernel/k_handle_table.cpp6
-rw-r--r--src/core/hle/kernel/k_handle_table.h2
-rw-r--r--src/core/hle/kernel/k_memory_manager.cpp8
-rw-r--r--src/core/hle/kernel/k_page_linked_list.h4
-rw-r--r--src/core/hle/kernel/k_page_table.cpp60
-rw-r--r--src/core/hle/kernel/k_port.cpp2
-rw-r--r--src/core/hle/kernel/k_process.cpp8
-rw-r--r--src/core/hle/kernel/k_process.h2
-rw-r--r--src/core/hle/kernel/k_readable_event.cpp6
-rw-r--r--src/core/hle/kernel/k_resource_limit.cpp2
-rw-r--r--src/core/hle/kernel/k_server_session.cpp16
-rw-r--r--src/core/hle/kernel/k_shared_memory.cpp2
-rw-r--r--src/core/hle/kernel/k_synchronization_object.cpp4
-rw-r--r--src/core/hle/kernel/k_synchronization_object.h2
-rw-r--r--src/core/hle/kernel/k_thread.cpp18
-rw-r--r--src/core/hle/kernel/k_thread.h2
-rw-r--r--src/core/hle/kernel/k_transfer_memory.cpp2
-rw-r--r--src/core/hle/kernel/process_capability.cpp24
-rw-r--r--src/core/hle/kernel/process_capability.h8
-rw-r--r--src/core/hle/kernel/svc.cpp104
-rw-r--r--src/core/hle/result.h36
-rw-r--r--src/core/hle/service/acc/acc.cpp60
-rw-r--r--src/core/hle/service/acc/profile_manager.cpp2
-rw-r--r--src/core/hle/service/am/am.cpp202
-rw-r--r--src/core/hle/service/am/applet_ae.cpp44
-rw-r--r--src/core/hle/service/am/applet_oe.cpp18
-rw-r--r--src/core/hle/service/am/applets/controller.h2
-rw-r--r--src/core/hle/service/am/applets/error.cpp2
-rw-r--r--src/core/hle/service/am/applets/error.h2
-rw-r--r--src/core/hle/service/am/applets/general_backend.cpp6
-rw-r--r--src/core/hle/service/am/applets/profile_select.cpp2
-rw-r--r--src/core/hle/service/am/applets/profile_select.h2
-rw-r--r--src/core/hle/service/am/applets/software_keyboard.cpp27
-rw-r--r--src/core/hle/service/am/applets/software_keyboard.h2
-rw-r--r--src/core/hle/service/am/applets/web_browser.h2
-rw-r--r--src/core/hle/service/aoc/aoc_u.cpp22
-rw-r--r--src/core/hle/service/apm/interface.cpp14
-rw-r--r--src/core/hle/service/audio/audctl.cpp4
-rw-r--r--src/core/hle/service/audio/audin_u.cpp6
-rw-r--r--src/core/hle/service/audio/audout_u.cpp26
-rw-r--r--src/core/hle/service/audio/audren_u.cpp42
-rw-r--r--src/core/hle/service/audio/hwopus.cpp10
-rw-r--r--src/core/hle/service/bcat/backend/backend.cpp4
-rw-r--r--src/core/hle/service/bcat/backend/backend.h2
-rw-r--r--src/core/hle/service/bcat/backend/boxcat.cpp6
-rw-r--r--src/core/hle/service/bcat/module.cpp38
-rw-r--r--src/core/hle/service/btdrv/btdrv.cpp2
-rw-r--r--src/core/hle/service/btm/btm.cpp12
-rw-r--r--src/core/hle/service/caps/caps_c.cpp2
-rw-r--r--src/core/hle/service/caps/caps_su.cpp2
-rw-r--r--src/core/hle/service/caps/caps_u.cpp4
-rw-r--r--src/core/hle/service/es/es.cpp20
-rw-r--r--src/core/hle/service/fatal/fatal.cpp6
-rw-r--r--src/core/hle/service/fgm/fgm.cpp2
-rw-r--r--src/core/hle/service/filesystem/filesystem.cpp66
-rw-r--r--src/core/hle/service/filesystem/filesystem.h2
-rw-r--r--src/core/hle/service/filesystem/fsp_srv.cpp87
-rw-r--r--src/core/hle/service/filesystem/fsp_srv.h1
-rw-r--r--src/core/hle/service/friend/friend.cpp20
-rw-r--r--src/core/hle/service/glue/arp.cpp16
-rw-r--r--src/core/hle/service/glue/bgtc.cpp2
-rw-r--r--src/core/hle/service/glue/manager.cpp4
-rw-r--r--src/core/hle/service/hid/controllers/gesture.h36
-rw-r--r--src/core/hle/service/hid/controllers/touchscreen.cpp13
-rw-r--r--src/core/hle/service/hid/controllers/touchscreen.h7
-rw-r--r--src/core/hle/service/hid/hid.cpp148
-rw-r--r--src/core/hle/service/hid/irs.cpp36
-rw-r--r--src/core/hle/service/lbl/lbl.cpp50
-rw-r--r--src/core/hle/service/ldn/ldn.cpp149
-rw-r--r--src/core/hle/service/ldr/ldr.cpp10
-rw-r--r--src/core/hle/service/lm/lm.cpp6
-rw-r--r--src/core/hle/service/mii/mii.cpp20
-rw-r--r--src/core/hle/service/mm/mm_u.cpp16
-rw-r--r--src/core/hle/service/nfc/nfc.cpp16
-rw-r--r--src/core/hle/service/nfp/nfp.cpp40
-rw-r--r--src/core/hle/service/nifm/nifm.cpp40
-rw-r--r--src/core/hle/service/nim/nim.cpp26
-rw-r--r--src/core/hle/service/ns/ns.cpp14
-rw-r--r--src/core/hle/service/ns/ns.h4
-rw-r--r--src/core/hle/service/ns/pl_u.cpp12
-rw-r--r--src/core/hle/service/nvdrv/interface.cpp26
-rw-r--r--src/core/hle/service/olsc/olsc.cpp6
-rw-r--r--src/core/hle/service/pctl/module.cpp22
-rw-r--r--src/core/hle/service/pm/pm.cpp10
-rw-r--r--src/core/hle/service/prepo/prepo.cpp14
-rw-r--r--src/core/hle/service/psc/psc.cpp2
-rw-r--r--src/core/hle/service/ptm/psm.cpp16
-rw-r--r--src/core/hle/service/service.cpp6
-rw-r--r--src/core/hle/service/set/set.cpp12
-rw-r--r--src/core/hle/service/set/set_sys.cpp6
-rw-r--r--src/core/hle/service/sm/controller.cpp6
-rw-r--r--src/core/hle/service/sm/sm.cpp6
-rw-r--r--src/core/hle/service/sockets/bsd.cpp32
-rw-r--r--src/core/hle/service/sockets/sfdnsres.cpp2
-rw-r--r--src/core/hle/service/spl/module.cpp2
-rw-r--r--src/core/hle/service/ssl/ssl.cpp12
-rw-r--r--src/core/hle/service/time/clock_types.h4
-rw-r--r--src/core/hle/service/time/local_system_clock_context_writer.h2
-rw-r--r--src/core/hle/service/time/network_system_clock_context_writer.h2
-rw-r--r--src/core/hle/service/time/standard_network_system_clock_core.h4
-rw-r--r--src/core/hle/service/time/standard_user_system_clock_core.cpp14
-rw-r--r--src/core/hle/service/time/system_clock_context_update_callback.cpp6
-rw-r--r--src/core/hle/service/time/system_clock_core.cpp12
-rw-r--r--src/core/hle/service/time/system_clock_core.h4
-rw-r--r--src/core/hle/service/time/time.cpp46
-rw-r--r--src/core/hle/service/time/time_manager.cpp8
-rw-r--r--src/core/hle/service/time/time_zone_content_manager.cpp6
-rw-r--r--src/core/hle/service/time/time_zone_manager.cpp22
-rw-r--r--src/core/hle/service/time/time_zone_service.cpp24
-rw-r--r--src/core/hle/service/usb/usb.cpp4
-rw-r--r--src/core/hle/service/vi/vi.cpp58
-rw-r--r--src/core/memory.cpp43
-rw-r--r--src/core/reporter.cpp6
-rw-r--r--src/input_common/sdl/sdl_impl.cpp281
-rw-r--r--src/input_common/sdl/sdl_impl.h37
-rw-r--r--src/video_core/gpu.cpp12
-rw-r--r--src/video_core/gpu.h2
-rw-r--r--src/video_core/vulkan_common/vulkan_memory_allocator.cpp67
-rw-r--r--src/video_core/vulkan_common/vulkan_memory_allocator.h7
-rw-r--r--src/yuzu/applets/software_keyboard.cpp25
-rw-r--r--src/yuzu/configuration/config.cpp3
-rw-r--r--src/yuzu/configuration/configure_per_game.cpp14
-rw-r--r--src/yuzu/configuration/configure_per_game.h4
-rw-r--r--src/yuzu/game_list.cpp56
-rw-r--r--src/yuzu/game_list.h3
-rw-r--r--src/yuzu/game_list_worker.cpp12
-rw-r--r--src/yuzu/main.cpp23
-rw-r--r--src/yuzu/main.h5
150 files changed, 1795 insertions, 1307 deletions
diff --git a/src/audio_core/audio_renderer.cpp b/src/audio_core/audio_renderer.cpp
index ae2201c36..80ffddb10 100644
--- a/src/audio_core/audio_renderer.cpp
+++ b/src/audio_core/audio_renderer.cpp
@@ -197,7 +197,7 @@ ResultCode AudioRenderer::UpdateAudioRenderer(const std::vector<u8>& input_param
197 197
198 ReleaseAndQueueBuffers(); 198 ReleaseAndQueueBuffers();
199 199
200 return RESULT_SUCCESS; 200 return ResultSuccess;
201} 201}
202 202
203void AudioRenderer::QueueMixedBuffer(Buffer::Tag tag) { 203void AudioRenderer::QueueMixedBuffer(Buffer::Tag tag) {
diff --git a/src/audio_core/info_updater.cpp b/src/audio_core/info_updater.cpp
index d3ac90827..4a5b1b4ab 100644
--- a/src/audio_core/info_updater.cpp
+++ b/src/audio_core/info_updater.cpp
@@ -407,7 +407,7 @@ ResultCode InfoUpdater::UpdateMixes(MixContext& mix_context, std::size_t mix_buf
407 407
408 // TODO(ogniK): Sort when splitter is suppoorted 408 // TODO(ogniK): Sort when splitter is suppoorted
409 409
410 return RESULT_SUCCESS; 410 return ResultSuccess;
411} 411}
412 412
413bool InfoUpdater::UpdateSinks(SinkContext& sink_context) { 413bool InfoUpdater::UpdateSinks(SinkContext& sink_context) {
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt
index eafb96b0b..7a4d9e354 100644
--- a/src/common/CMakeLists.txt
+++ b/src/common/CMakeLists.txt
@@ -154,6 +154,7 @@ add_library(common STATIC
154 param_package.cpp 154 param_package.cpp
155 param_package.h 155 param_package.h
156 parent_of_member.h 156 parent_of_member.h
157 point.h
157 quaternion.h 158 quaternion.h
158 ring_buffer.h 159 ring_buffer.h
159 scm_rev.cpp 160 scm_rev.cpp
diff --git a/src/common/common_funcs.h b/src/common/common_funcs.h
index 17d1ee86b..53bd7da60 100644
--- a/src/common/common_funcs.h
+++ b/src/common/common_funcs.h
@@ -97,17 +97,6 @@ __declspec(dllimport) void __stdcall DebugBreak(void);
97 return static_cast<T>(key) == 0; \ 97 return static_cast<T>(key) == 0; \
98 } 98 }
99 99
100/// Evaluates a boolean expression, and returns a result unless that expression is true.
101#define R_UNLESS(expr, res) \
102 { \
103 if (!(expr)) { \
104 if (res.IsError()) { \
105 LOG_ERROR(Kernel, "Failed with result: {}", res.raw); \
106 } \
107 return res; \
108 } \
109 }
110
111#define YUZU_NON_COPYABLE(cls) \ 100#define YUZU_NON_COPYABLE(cls) \
112 cls(const cls&) = delete; \ 101 cls(const cls&) = delete; \
113 cls& operator=(const cls&) = delete 102 cls& operator=(const cls&) = delete
@@ -116,20 +105,6 @@ __declspec(dllimport) void __stdcall DebugBreak(void);
116 cls(cls&&) = delete; \ 105 cls(cls&&) = delete; \
117 cls& operator=(cls&&) = delete 106 cls& operator=(cls&&) = delete
118 107
119#define R_SUCCEEDED(res) (res.IsSuccess())
120
121/// Evaluates an expression that returns a result, and returns the result if it would fail.
122#define R_TRY(res_expr) \
123 { \
124 const auto _tmp_r_try_rc = (res_expr); \
125 if (_tmp_r_try_rc.IsError()) { \
126 return _tmp_r_try_rc; \
127 } \
128 }
129
130/// Evaluates a boolean expression, and succeeds if that expression is true.
131#define R_SUCCEED_IF(expr) R_UNLESS(!(expr), RESULT_SUCCESS)
132
133namespace Common { 108namespace Common {
134 109
135[[nodiscard]] constexpr u32 MakeMagic(char a, char b, char c, char d) { 110[[nodiscard]] constexpr u32 MakeMagic(char a, char b, char c, char d) {
diff --git a/src/common/fs/fs_util.cpp b/src/common/fs/fs_util.cpp
index 0ddfc3131..357cf5855 100644
--- a/src/common/fs/fs_util.cpp
+++ b/src/common/fs/fs_util.cpp
@@ -2,6 +2,8 @@
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
5#include "common/fs/fs_util.h" 7#include "common/fs/fs_util.h"
6 8
7namespace Common::FS { 9namespace Common::FS {
@@ -10,4 +12,16 @@ std::u8string ToU8String(std::string_view utf8_string) {
10 return std::u8string{utf8_string.begin(), utf8_string.end()}; 12 return std::u8string{utf8_string.begin(), utf8_string.end()};
11} 13}
12 14
15std::u8string BufferToU8String(std::span<const u8> buffer) {
16 return std::u8string{buffer.begin(), std::ranges::find(buffer, u8{0})};
17}
18
19std::string ToUTF8String(std::u8string_view u8_string) {
20 return std::string{u8_string.begin(), u8_string.end()};
21}
22
23std::string PathToUTF8String(const std::filesystem::path& path) {
24 return ToUTF8String(path.u8string());
25}
26
13} // namespace Common::FS 27} // namespace Common::FS
diff --git a/src/common/fs/fs_util.h b/src/common/fs/fs_util.h
index 951df53b6..ec9950ee7 100644
--- a/src/common/fs/fs_util.h
+++ b/src/common/fs/fs_util.h
@@ -5,9 +5,13 @@
5#pragma once 5#pragma once
6 6
7#include <concepts> 7#include <concepts>
8#include <filesystem>
9#include <span>
8#include <string> 10#include <string>
9#include <string_view> 11#include <string_view>
10 12
13#include "common/common_types.h"
14
11namespace Common::FS { 15namespace Common::FS {
12 16
13template <typename T> 17template <typename T>
@@ -22,4 +26,33 @@ concept IsChar = std::same_as<T, char>;
22 */ 26 */
23[[nodiscard]] std::u8string ToU8String(std::string_view utf8_string); 27[[nodiscard]] std::u8string ToU8String(std::string_view utf8_string);
24 28
29/**
30 * Converts a buffer of bytes to a UTF8-encoded std::u8string.
31 * This converts from the start of the buffer until the first encountered null-terminator.
32 * If no null-terminator is found, this converts the entire buffer instead.
33 *
34 * @param buffer Buffer of bytes
35 *
36 * @returns UTF-8 encoded std::u8string.
37 */
38[[nodiscard]] std::u8string BufferToU8String(std::span<const u8> buffer);
39
40/**
41 * Converts a std::u8string or std::u8string_view to a UTF-8 encoded std::string.
42 *
43 * @param u8_string UTF-8 encoded u8string
44 *
45 * @returns UTF-8 encoded std::string.
46 */
47[[nodiscard]] std::string ToUTF8String(std::u8string_view u8_string);
48
49/**
50 * Converts a filesystem path to a UTF-8 encoded std::string.
51 *
52 * @param path Filesystem path
53 *
54 * @returns UTF-8 encoded std::string.
55 */
56[[nodiscard]] std::string PathToUTF8String(const std::filesystem::path& path);
57
25} // namespace Common::FS 58} // namespace Common::FS
diff --git a/src/common/fs/path_util.cpp b/src/common/fs/path_util.cpp
index 8b732a21c..6cdd14f13 100644
--- a/src/common/fs/path_util.cpp
+++ b/src/common/fs/path_util.cpp
@@ -129,12 +129,6 @@ private:
129 std::unordered_map<YuzuPath, fs::path> yuzu_paths; 129 std::unordered_map<YuzuPath, fs::path> yuzu_paths;
130}; 130};
131 131
132std::string PathToUTF8String(const fs::path& path) {
133 const auto utf8_string = path.u8string();
134
135 return std::string{utf8_string.begin(), utf8_string.end()};
136}
137
138bool ValidatePath(const fs::path& path) { 132bool ValidatePath(const fs::path& path) {
139 if (path.empty()) { 133 if (path.empty()) {
140 LOG_ERROR(Common_Filesystem, "Input path is empty, path={}", PathToUTF8String(path)); 134 LOG_ERROR(Common_Filesystem, "Input path is empty, path={}", PathToUTF8String(path));
diff --git a/src/common/fs/path_util.h b/src/common/fs/path_util.h
index a9fadbceb..14e8c35d7 100644
--- a/src/common/fs/path_util.h
+++ b/src/common/fs/path_util.h
@@ -26,15 +26,6 @@ enum class YuzuPath {
26}; 26};
27 27
28/** 28/**
29 * Converts a filesystem path to a UTF-8 encoded std::string.
30 *
31 * @param path Filesystem path
32 *
33 * @returns UTF-8 encoded std::string.
34 */
35[[nodiscard]] std::string PathToUTF8String(const std::filesystem::path& path);
36
37/**
38 * Validates a given path. 29 * Validates a given path.
39 * 30 *
40 * A given path is valid if it meets these conditions: 31 * A given path is valid if it meets these conditions:
diff --git a/src/common/page_table.cpp b/src/common/page_table.cpp
index 8fd8620fd..9fffd816f 100644
--- a/src/common/page_table.cpp
+++ b/src/common/page_table.cpp
@@ -14,6 +14,7 @@ void PageTable::Resize(size_t address_space_width_in_bits, size_t page_size_in_b
14 const size_t num_page_table_entries{1ULL << (address_space_width_in_bits - page_size_in_bits)}; 14 const size_t num_page_table_entries{1ULL << (address_space_width_in_bits - page_size_in_bits)};
15 pointers.resize(num_page_table_entries); 15 pointers.resize(num_page_table_entries);
16 backing_addr.resize(num_page_table_entries); 16 backing_addr.resize(num_page_table_entries);
17 current_address_space_width_in_bits = address_space_width_in_bits;
17} 18}
18 19
19} // namespace Common 20} // namespace Common
diff --git a/src/common/page_table.h b/src/common/page_table.h
index 61c5552e0..e92b66b2b 100644
--- a/src/common/page_table.h
+++ b/src/common/page_table.h
@@ -98,6 +98,10 @@ struct PageTable {
98 */ 98 */
99 void Resize(size_t address_space_width_in_bits, size_t page_size_in_bits); 99 void Resize(size_t address_space_width_in_bits, size_t page_size_in_bits);
100 100
101 size_t GetAddressSpaceBits() const {
102 return current_address_space_width_in_bits;
103 }
104
101 /** 105 /**
102 * Vector of memory pointers backing each page. An entry can only be non-null if the 106 * Vector of memory pointers backing each page. An entry can only be non-null if the
103 * corresponding attribute element is of type `Memory`. 107 * corresponding attribute element is of type `Memory`.
@@ -105,6 +109,8 @@ struct PageTable {
105 VirtualBuffer<PageInfo> pointers; 109 VirtualBuffer<PageInfo> pointers;
106 110
107 VirtualBuffer<u64> backing_addr; 111 VirtualBuffer<u64> backing_addr;
112
113 size_t current_address_space_width_in_bits;
108}; 114};
109 115
110} // namespace Common 116} // namespace Common
diff --git a/src/common/point.h b/src/common/point.h
new file mode 100644
index 000000000..c0a52ad8d
--- /dev/null
+++ b/src/common/point.h
@@ -0,0 +1,57 @@
1// Copyright 2021 yuzu Emulator Project
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include <type_traits>
8
9namespace Common {
10
11// Represents a point within a 2D space.
12template <typename T>
13struct Point {
14 static_assert(std::is_arithmetic_v<T>, "T must be an arithmetic type!");
15
16 T x{};
17 T y{};
18
19#define ARITHMETIC_OP(op, compound_op) \
20 friend constexpr Point operator op(const Point& lhs, const Point& rhs) noexcept { \
21 return { \
22 .x = static_cast<T>(lhs.x op rhs.x), \
23 .y = static_cast<T>(lhs.y op rhs.y), \
24 }; \
25 } \
26 friend constexpr Point operator op(const Point& lhs, T value) noexcept { \
27 return { \
28 .x = static_cast<T>(lhs.x op value), \
29 .y = static_cast<T>(lhs.y op value), \
30 }; \
31 } \
32 friend constexpr Point operator op(T value, const Point& rhs) noexcept { \
33 return { \
34 .x = static_cast<T>(value op rhs.x), \
35 .y = static_cast<T>(value op rhs.y), \
36 }; \
37 } \
38 friend constexpr Point& operator compound_op(Point& lhs, const Point& rhs) noexcept { \
39 lhs.x = static_cast<T>(lhs.x op rhs.x); \
40 lhs.y = static_cast<T>(lhs.y op rhs.y); \
41 return lhs; \
42 } \
43 friend constexpr Point& operator compound_op(Point& lhs, T value) noexcept { \
44 lhs.x = static_cast<T>(lhs.x op value); \
45 lhs.y = static_cast<T>(lhs.y op value); \
46 return lhs; \
47 }
48 ARITHMETIC_OP(+, +=)
49 ARITHMETIC_OP(-, -=)
50 ARITHMETIC_OP(*, *=)
51 ARITHMETIC_OP(/, /=)
52#undef ARITHMETIC_OP
53
54 friend constexpr bool operator==(const Point&, const Point&) = default;
55};
56
57} // namespace Common
diff --git a/src/core/arm/dynarmic/arm_dynarmic_32.cpp b/src/core/arm/dynarmic/arm_dynarmic_32.cpp
index e5b78210a..cea7f0fb1 100644
--- a/src/core/arm/dynarmic/arm_dynarmic_32.cpp
+++ b/src/core/arm/dynarmic/arm_dynarmic_32.cpp
@@ -24,45 +24,46 @@ namespace Core {
24 24
25class DynarmicCallbacks32 : public Dynarmic::A32::UserCallbacks { 25class DynarmicCallbacks32 : public Dynarmic::A32::UserCallbacks {
26public: 26public:
27 explicit DynarmicCallbacks32(ARM_Dynarmic_32& parent_) : parent{parent_} {} 27 explicit DynarmicCallbacks32(ARM_Dynarmic_32& parent_)
28 : parent{parent_}, memory(parent.system.Memory()) {}
28 29
29 u8 MemoryRead8(u32 vaddr) override { 30 u8 MemoryRead8(u32 vaddr) override {
30 return parent.system.Memory().Read8(vaddr); 31 return memory.Read8(vaddr);
31 } 32 }
32 u16 MemoryRead16(u32 vaddr) override { 33 u16 MemoryRead16(u32 vaddr) override {
33 return parent.system.Memory().Read16(vaddr); 34 return memory.Read16(vaddr);
34 } 35 }
35 u32 MemoryRead32(u32 vaddr) override { 36 u32 MemoryRead32(u32 vaddr) override {
36 return parent.system.Memory().Read32(vaddr); 37 return memory.Read32(vaddr);
37 } 38 }
38 u64 MemoryRead64(u32 vaddr) override { 39 u64 MemoryRead64(u32 vaddr) override {
39 return parent.system.Memory().Read64(vaddr); 40 return memory.Read64(vaddr);
40 } 41 }
41 42
42 void MemoryWrite8(u32 vaddr, u8 value) override { 43 void MemoryWrite8(u32 vaddr, u8 value) override {
43 parent.system.Memory().Write8(vaddr, value); 44 memory.Write8(vaddr, value);
44 } 45 }
45 void MemoryWrite16(u32 vaddr, u16 value) override { 46 void MemoryWrite16(u32 vaddr, u16 value) override {
46 parent.system.Memory().Write16(vaddr, value); 47 memory.Write16(vaddr, value);
47 } 48 }
48 void MemoryWrite32(u32 vaddr, u32 value) override { 49 void MemoryWrite32(u32 vaddr, u32 value) override {
49 parent.system.Memory().Write32(vaddr, value); 50 memory.Write32(vaddr, value);
50 } 51 }
51 void MemoryWrite64(u32 vaddr, u64 value) override { 52 void MemoryWrite64(u32 vaddr, u64 value) override {
52 parent.system.Memory().Write64(vaddr, value); 53 memory.Write64(vaddr, value);
53 } 54 }
54 55
55 bool MemoryWriteExclusive8(u32 vaddr, u8 value, u8 expected) override { 56 bool MemoryWriteExclusive8(u32 vaddr, u8 value, u8 expected) override {
56 return parent.system.Memory().WriteExclusive8(vaddr, value, expected); 57 return memory.WriteExclusive8(vaddr, value, expected);
57 } 58 }
58 bool MemoryWriteExclusive16(u32 vaddr, u16 value, u16 expected) override { 59 bool MemoryWriteExclusive16(u32 vaddr, u16 value, u16 expected) override {
59 return parent.system.Memory().WriteExclusive16(vaddr, value, expected); 60 return memory.WriteExclusive16(vaddr, value, expected);
60 } 61 }
61 bool MemoryWriteExclusive32(u32 vaddr, u32 value, u32 expected) override { 62 bool MemoryWriteExclusive32(u32 vaddr, u32 value, u32 expected) override {
62 return parent.system.Memory().WriteExclusive32(vaddr, value, expected); 63 return memory.WriteExclusive32(vaddr, value, expected);
63 } 64 }
64 bool MemoryWriteExclusive64(u32 vaddr, u64 value, u64 expected) override { 65 bool MemoryWriteExclusive64(u32 vaddr, u64 value, u64 expected) override {
65 return parent.system.Memory().WriteExclusive64(vaddr, value, expected); 66 return memory.WriteExclusive64(vaddr, value, expected);
66 } 67 }
67 68
68 void InterpreterFallback(u32 pc, std::size_t num_instructions) override { 69 void InterpreterFallback(u32 pc, std::size_t num_instructions) override {
@@ -112,6 +113,7 @@ public:
112 } 113 }
113 114
114 ARM_Dynarmic_32& parent; 115 ARM_Dynarmic_32& parent;
116 Core::Memory::Memory& memory;
115 std::size_t num_interpreted_instructions{}; 117 std::size_t num_interpreted_instructions{};
116 static constexpr u64 minimum_run_cycles = 1000U; 118 static constexpr u64 minimum_run_cycles = 1000U;
117}; 119};
diff --git a/src/core/arm/dynarmic/arm_dynarmic_64.cpp b/src/core/arm/dynarmic/arm_dynarmic_64.cpp
index dd439f55e..63193dcb1 100644
--- a/src/core/arm/dynarmic/arm_dynarmic_64.cpp
+++ b/src/core/arm/dynarmic/arm_dynarmic_64.cpp
@@ -27,57 +27,56 @@ using Vector = Dynarmic::A64::Vector;
27 27
28class DynarmicCallbacks64 : public Dynarmic::A64::UserCallbacks { 28class DynarmicCallbacks64 : public Dynarmic::A64::UserCallbacks {
29public: 29public:
30 explicit DynarmicCallbacks64(ARM_Dynarmic_64& parent_) : parent{parent_} {} 30 explicit DynarmicCallbacks64(ARM_Dynarmic_64& parent_)
31 : parent{parent_}, memory(parent.system.Memory()) {}
31 32
32 u8 MemoryRead8(u64 vaddr) override { 33 u8 MemoryRead8(u64 vaddr) override {
33 return parent.system.Memory().Read8(vaddr); 34 return memory.Read8(vaddr);
34 } 35 }
35 u16 MemoryRead16(u64 vaddr) override { 36 u16 MemoryRead16(u64 vaddr) override {
36 return parent.system.Memory().Read16(vaddr); 37 return memory.Read16(vaddr);
37 } 38 }
38 u32 MemoryRead32(u64 vaddr) override { 39 u32 MemoryRead32(u64 vaddr) override {
39 return parent.system.Memory().Read32(vaddr); 40 return memory.Read32(vaddr);
40 } 41 }
41 u64 MemoryRead64(u64 vaddr) override { 42 u64 MemoryRead64(u64 vaddr) override {
42 return parent.system.Memory().Read64(vaddr); 43 return memory.Read64(vaddr);
43 } 44 }
44 Vector MemoryRead128(u64 vaddr) override { 45 Vector MemoryRead128(u64 vaddr) override {
45 auto& memory = parent.system.Memory();
46 return {memory.Read64(vaddr), memory.Read64(vaddr + 8)}; 46 return {memory.Read64(vaddr), memory.Read64(vaddr + 8)};
47 } 47 }
48 48
49 void MemoryWrite8(u64 vaddr, u8 value) override { 49 void MemoryWrite8(u64 vaddr, u8 value) override {
50 parent.system.Memory().Write8(vaddr, value); 50 memory.Write8(vaddr, value);
51 } 51 }
52 void MemoryWrite16(u64 vaddr, u16 value) override { 52 void MemoryWrite16(u64 vaddr, u16 value) override {
53 parent.system.Memory().Write16(vaddr, value); 53 memory.Write16(vaddr, value);
54 } 54 }
55 void MemoryWrite32(u64 vaddr, u32 value) override { 55 void MemoryWrite32(u64 vaddr, u32 value) override {
56 parent.system.Memory().Write32(vaddr, value); 56 memory.Write32(vaddr, value);
57 } 57 }
58 void MemoryWrite64(u64 vaddr, u64 value) override { 58 void MemoryWrite64(u64 vaddr, u64 value) override {
59 parent.system.Memory().Write64(vaddr, value); 59 memory.Write64(vaddr, value);
60 } 60 }
61 void MemoryWrite128(u64 vaddr, Vector value) override { 61 void MemoryWrite128(u64 vaddr, Vector value) override {
62 auto& memory = parent.system.Memory();
63 memory.Write64(vaddr, value[0]); 62 memory.Write64(vaddr, value[0]);
64 memory.Write64(vaddr + 8, value[1]); 63 memory.Write64(vaddr + 8, value[1]);
65 } 64 }
66 65
67 bool MemoryWriteExclusive8(u64 vaddr, std::uint8_t value, std::uint8_t expected) override { 66 bool MemoryWriteExclusive8(u64 vaddr, std::uint8_t value, std::uint8_t expected) override {
68 return parent.system.Memory().WriteExclusive8(vaddr, value, expected); 67 return memory.WriteExclusive8(vaddr, value, expected);
69 } 68 }
70 bool MemoryWriteExclusive16(u64 vaddr, std::uint16_t value, std::uint16_t expected) override { 69 bool MemoryWriteExclusive16(u64 vaddr, std::uint16_t value, std::uint16_t expected) override {
71 return parent.system.Memory().WriteExclusive16(vaddr, value, expected); 70 return memory.WriteExclusive16(vaddr, value, expected);
72 } 71 }
73 bool MemoryWriteExclusive32(u64 vaddr, std::uint32_t value, std::uint32_t expected) override { 72 bool MemoryWriteExclusive32(u64 vaddr, std::uint32_t value, std::uint32_t expected) override {
74 return parent.system.Memory().WriteExclusive32(vaddr, value, expected); 73 return memory.WriteExclusive32(vaddr, value, expected);
75 } 74 }
76 bool MemoryWriteExclusive64(u64 vaddr, std::uint64_t value, std::uint64_t expected) override { 75 bool MemoryWriteExclusive64(u64 vaddr, std::uint64_t value, std::uint64_t expected) override {
77 return parent.system.Memory().WriteExclusive64(vaddr, value, expected); 76 return memory.WriteExclusive64(vaddr, value, expected);
78 } 77 }
79 bool MemoryWriteExclusive128(u64 vaddr, Vector value, Vector expected) override { 78 bool MemoryWriteExclusive128(u64 vaddr, Vector value, Vector expected) override {
80 return parent.system.Memory().WriteExclusive128(vaddr, value, expected); 79 return memory.WriteExclusive128(vaddr, value, expected);
81 } 80 }
82 81
83 void InterpreterFallback(u64 pc, std::size_t num_instructions) override { 82 void InterpreterFallback(u64 pc, std::size_t num_instructions) override {
@@ -139,6 +138,7 @@ public:
139 } 138 }
140 139
141 ARM_Dynarmic_64& parent; 140 ARM_Dynarmic_64& parent;
141 Core::Memory::Memory& memory;
142 u64 tpidrro_el0 = 0; 142 u64 tpidrro_el0 = 0;
143 u64 tpidr_el0 = 0; 143 u64 tpidr_el0 = 0;
144 static constexpr u64 minimum_run_cycles = 1000U; 144 static constexpr u64 minimum_run_cycles = 1000U;
diff --git a/src/core/file_sys/romfs_factory.cpp b/src/core/file_sys/romfs_factory.cpp
index aa7f3072f..638c6cea8 100644
--- a/src/core/file_sys/romfs_factory.cpp
+++ b/src/core/file_sys/romfs_factory.cpp
@@ -53,7 +53,7 @@ ResultVal<VirtualFile> RomFSFactory::OpenPatchedRomFS(u64 title_id, ContentRecor
53 53
54 if (nca == nullptr) { 54 if (nca == nullptr) {
55 // TODO: Find the right error code to use here 55 // TODO: Find the right error code to use here
56 return RESULT_UNKNOWN; 56 return ResultUnknown;
57 } 57 }
58 58
59 const PatchManager patch_manager{title_id, filesystem_controller, content_provider}; 59 const PatchManager patch_manager{title_id, filesystem_controller, content_provider};
@@ -74,13 +74,13 @@ ResultVal<VirtualFile> RomFSFactory::Open(u64 title_id, StorageId storage,
74 const std::shared_ptr<NCA> res = GetEntry(title_id, storage, type); 74 const std::shared_ptr<NCA> res = GetEntry(title_id, storage, type);
75 if (res == nullptr) { 75 if (res == nullptr) {
76 // TODO(DarkLordZach): Find the right error code to use here 76 // TODO(DarkLordZach): Find the right error code to use here
77 return RESULT_UNKNOWN; 77 return ResultUnknown;
78 } 78 }
79 79
80 const auto romfs = res->GetRomFS(); 80 const auto romfs = res->GetRomFS();
81 if (romfs == nullptr) { 81 if (romfs == nullptr) {
82 // TODO(DarkLordZach): Find the right error code to use here 82 // TODO(DarkLordZach): Find the right error code to use here
83 return RESULT_UNKNOWN; 83 return ResultUnknown;
84 } 84 }
85 85
86 return MakeResult<VirtualFile>(romfs); 86 return MakeResult<VirtualFile>(romfs);
diff --git a/src/core/file_sys/savedata_factory.cpp b/src/core/file_sys/savedata_factory.cpp
index f973d1d21..b5254dd75 100644
--- a/src/core/file_sys/savedata_factory.cpp
+++ b/src/core/file_sys/savedata_factory.cpp
@@ -91,7 +91,7 @@ ResultVal<VirtualDir> SaveDataFactory::Create(SaveDataSpaceId space,
91 // Return an error if the save data doesn't actually exist. 91 // Return an error if the save data doesn't actually exist.
92 if (out == nullptr) { 92 if (out == nullptr) {
93 // TODO(DarkLordZach): Find out correct error code. 93 // TODO(DarkLordZach): Find out correct error code.
94 return RESULT_UNKNOWN; 94 return ResultUnknown;
95 } 95 }
96 96
97 return MakeResult<VirtualDir>(std::move(out)); 97 return MakeResult<VirtualDir>(std::move(out));
@@ -105,14 +105,14 @@ ResultVal<VirtualDir> SaveDataFactory::Open(SaveDataSpaceId space,
105 105
106 auto out = dir->GetDirectoryRelative(save_directory); 106 auto out = dir->GetDirectoryRelative(save_directory);
107 107
108 if (out == nullptr && ShouldSaveDataBeAutomaticallyCreated(space, meta)) { 108 if (out == nullptr && (ShouldSaveDataBeAutomaticallyCreated(space, meta) && auto_create)) {
109 return Create(space, meta); 109 return Create(space, meta);
110 } 110 }
111 111
112 // Return an error if the save data doesn't actually exist. 112 // Return an error if the save data doesn't actually exist.
113 if (out == nullptr) { 113 if (out == nullptr) {
114 // TODO(Subv): Find out correct error code. 114 // TODO(Subv): Find out correct error code.
115 return RESULT_UNKNOWN; 115 return ResultUnknown;
116 } 116 }
117 117
118 return MakeResult<VirtualDir>(std::move(out)); 118 return MakeResult<VirtualDir>(std::move(out));
@@ -199,4 +199,8 @@ void SaveDataFactory::WriteSaveDataSize(SaveDataType type, u64 title_id, u128 us
199 size_file->WriteObject(new_value); 199 size_file->WriteObject(new_value);
200} 200}
201 201
202void SaveDataFactory::SetAutoCreate(bool state) {
203 auto_create = state;
204}
205
202} // namespace FileSys 206} // namespace FileSys
diff --git a/src/core/file_sys/savedata_factory.h b/src/core/file_sys/savedata_factory.h
index 86c9f5350..1d8dc981f 100644
--- a/src/core/file_sys/savedata_factory.h
+++ b/src/core/file_sys/savedata_factory.h
@@ -104,9 +104,12 @@ public:
104 void WriteSaveDataSize(SaveDataType type, u64 title_id, u128 user_id, 104 void WriteSaveDataSize(SaveDataType type, u64 title_id, u128 user_id,
105 SaveDataSize new_value) const; 105 SaveDataSize new_value) const;
106 106
107 void SetAutoCreate(bool state);
108
107private: 109private:
108 VirtualDir dir; 110 VirtualDir dir;
109 Core::System& system; 111 Core::System& system;
112 bool auto_create{true};
110}; 113};
111 114
112} // namespace FileSys 115} // namespace FileSys
diff --git a/src/core/hle/kernel/hle_ipc.cpp b/src/core/hle/kernel/hle_ipc.cpp
index 9d069a78f..2b5c30f7a 100644
--- a/src/core/hle/kernel/hle_ipc.cpp
+++ b/src/core/hle/kernel/hle_ipc.cpp
@@ -169,12 +169,12 @@ ResultCode HLERequestContext::PopulateFromIncomingCommandBuffer(const KHandleTab
169 169
170 if (command_header->IsCloseCommand()) { 170 if (command_header->IsCloseCommand()) {
171 // Close does not populate the rest of the IPC header 171 // Close does not populate the rest of the IPC header
172 return RESULT_SUCCESS; 172 return ResultSuccess;
173 } 173 }
174 174
175 std::copy_n(src_cmdbuf, IPC::COMMAND_BUFFER_LENGTH, cmd_buf.begin()); 175 std::copy_n(src_cmdbuf, IPC::COMMAND_BUFFER_LENGTH, cmd_buf.begin());
176 176
177 return RESULT_SUCCESS; 177 return ResultSuccess;
178} 178}
179 179
180ResultCode HLERequestContext::WriteToOutgoingCommandBuffer(KThread& requesting_thread) { 180ResultCode HLERequestContext::WriteToOutgoingCommandBuffer(KThread& requesting_thread) {
@@ -216,7 +216,7 @@ ResultCode HLERequestContext::WriteToOutgoingCommandBuffer(KThread& requesting_t
216 memory.WriteBlock(owner_process, requesting_thread.GetTLSAddress(), cmd_buf.data(), 216 memory.WriteBlock(owner_process, requesting_thread.GetTLSAddress(), cmd_buf.data(),
217 write_size * sizeof(u32)); 217 write_size * sizeof(u32));
218 218
219 return RESULT_SUCCESS; 219 return ResultSuccess;
220} 220}
221 221
222std::vector<u8> HLERequestContext::ReadBuffer(std::size_t buffer_index) const { 222std::vector<u8> HLERequestContext::ReadBuffer(std::size_t buffer_index) const {
diff --git a/src/core/hle/kernel/k_address_arbiter.cpp b/src/core/hle/kernel/k_address_arbiter.cpp
index 7018f56da..1b429bc1e 100644
--- a/src/core/hle/kernel/k_address_arbiter.cpp
+++ b/src/core/hle/kernel/k_address_arbiter.cpp
@@ -97,7 +97,7 @@ ResultCode KAddressArbiter::Signal(VAddr addr, s32 count) {
97 while ((it != thread_tree.end()) && (count <= 0 || num_waiters < count) && 97 while ((it != thread_tree.end()) && (count <= 0 || num_waiters < count) &&
98 (it->GetAddressArbiterKey() == addr)) { 98 (it->GetAddressArbiterKey() == addr)) {
99 KThread* target_thread = std::addressof(*it); 99 KThread* target_thread = std::addressof(*it);
100 target_thread->SetSyncedObject(nullptr, RESULT_SUCCESS); 100 target_thread->SetSyncedObject(nullptr, ResultSuccess);
101 101
102 ASSERT(target_thread->IsWaitingForAddressArbiter()); 102 ASSERT(target_thread->IsWaitingForAddressArbiter());
103 target_thread->Wakeup(); 103 target_thread->Wakeup();
@@ -107,7 +107,7 @@ ResultCode KAddressArbiter::Signal(VAddr addr, s32 count) {
107 ++num_waiters; 107 ++num_waiters;
108 } 108 }
109 } 109 }
110 return RESULT_SUCCESS; 110 return ResultSuccess;
111} 111}
112 112
113ResultCode KAddressArbiter::SignalAndIncrementIfEqual(VAddr addr, s32 value, s32 count) { 113ResultCode KAddressArbiter::SignalAndIncrementIfEqual(VAddr addr, s32 value, s32 count) {
@@ -130,7 +130,7 @@ ResultCode KAddressArbiter::SignalAndIncrementIfEqual(VAddr addr, s32 value, s32
130 while ((it != thread_tree.end()) && (count <= 0 || num_waiters < count) && 130 while ((it != thread_tree.end()) && (count <= 0 || num_waiters < count) &&
131 (it->GetAddressArbiterKey() == addr)) { 131 (it->GetAddressArbiterKey() == addr)) {
132 KThread* target_thread = std::addressof(*it); 132 KThread* target_thread = std::addressof(*it);
133 target_thread->SetSyncedObject(nullptr, RESULT_SUCCESS); 133 target_thread->SetSyncedObject(nullptr, ResultSuccess);
134 134
135 ASSERT(target_thread->IsWaitingForAddressArbiter()); 135 ASSERT(target_thread->IsWaitingForAddressArbiter());
136 target_thread->Wakeup(); 136 target_thread->Wakeup();
@@ -140,7 +140,7 @@ ResultCode KAddressArbiter::SignalAndIncrementIfEqual(VAddr addr, s32 value, s32
140 ++num_waiters; 140 ++num_waiters;
141 } 141 }
142 } 142 }
143 return RESULT_SUCCESS; 143 return ResultSuccess;
144} 144}
145 145
146ResultCode KAddressArbiter::SignalAndModifyByWaitingCountIfEqual(VAddr addr, s32 value, s32 count) { 146ResultCode KAddressArbiter::SignalAndModifyByWaitingCountIfEqual(VAddr addr, s32 value, s32 count) {
@@ -198,7 +198,7 @@ ResultCode KAddressArbiter::SignalAndModifyByWaitingCountIfEqual(VAddr addr, s32
198 while ((it != thread_tree.end()) && (count <= 0 || num_waiters < count) && 198 while ((it != thread_tree.end()) && (count <= 0 || num_waiters < count) &&
199 (it->GetAddressArbiterKey() == addr)) { 199 (it->GetAddressArbiterKey() == addr)) {
200 KThread* target_thread = std::addressof(*it); 200 KThread* target_thread = std::addressof(*it);
201 target_thread->SetSyncedObject(nullptr, RESULT_SUCCESS); 201 target_thread->SetSyncedObject(nullptr, ResultSuccess);
202 202
203 ASSERT(target_thread->IsWaitingForAddressArbiter()); 203 ASSERT(target_thread->IsWaitingForAddressArbiter());
204 target_thread->Wakeup(); 204 target_thread->Wakeup();
@@ -208,7 +208,7 @@ ResultCode KAddressArbiter::SignalAndModifyByWaitingCountIfEqual(VAddr addr, s32
208 ++num_waiters; 208 ++num_waiters;
209 } 209 }
210 } 210 }
211 return RESULT_SUCCESS; 211 return ResultSuccess;
212} 212}
213 213
214ResultCode KAddressArbiter::WaitIfLessThan(VAddr addr, s32 value, bool decrement, s64 timeout) { 214ResultCode KAddressArbiter::WaitIfLessThan(VAddr addr, s32 value, bool decrement, s64 timeout) {
diff --git a/src/core/hle/kernel/k_address_arbiter.h b/src/core/hle/kernel/k_address_arbiter.h
index 8d379b524..bf8b46665 100644
--- a/src/core/hle/kernel/k_address_arbiter.h
+++ b/src/core/hle/kernel/k_address_arbiter.h
@@ -37,7 +37,7 @@ public:
37 return SignalAndModifyByWaitingCountIfEqual(addr, value, count); 37 return SignalAndModifyByWaitingCountIfEqual(addr, value, count);
38 } 38 }
39 UNREACHABLE(); 39 UNREACHABLE();
40 return RESULT_UNKNOWN; 40 return ResultUnknown;
41 } 41 }
42 42
43 [[nodiscard]] ResultCode WaitForAddress(VAddr addr, Svc::ArbitrationType type, s32 value, 43 [[nodiscard]] ResultCode WaitForAddress(VAddr addr, Svc::ArbitrationType type, s32 value,
@@ -51,7 +51,7 @@ public:
51 return WaitIfEqual(addr, value, timeout); 51 return WaitIfEqual(addr, value, timeout);
52 } 52 }
53 UNREACHABLE(); 53 UNREACHABLE();
54 return RESULT_UNKNOWN; 54 return ResultUnknown;
55 } 55 }
56 56
57private: 57private:
diff --git a/src/core/hle/kernel/k_class_token.cpp b/src/core/hle/kernel/k_class_token.cpp
index beb8a2a05..0be0027be 100644
--- a/src/core/hle/kernel/k_class_token.cpp
+++ b/src/core/hle/kernel/k_class_token.cpp
@@ -84,50 +84,43 @@ static_assert(ClassToken<KTransferMemory> == ((0b10010001 << 8) | ClassToken<KAu
84// Ensure that the token hierarchy reflects the class hierarchy. 84// Ensure that the token hierarchy reflects the class hierarchy.
85 85
86// Base classes. 86// Base classes.
87static_assert(!std::is_final<KSynchronizationObject>::value && 87static_assert(!std::is_final_v<KSynchronizationObject> &&
88 std::is_base_of<KAutoObject, KSynchronizationObject>::value); 88 std::is_base_of_v<KAutoObject, KSynchronizationObject>);
89static_assert(!std::is_final<KReadableEvent>::value && 89static_assert(!std::is_final_v<KReadableEvent> &&
90 std::is_base_of<KSynchronizationObject, KReadableEvent>::value); 90 std::is_base_of_v<KSynchronizationObject, KReadableEvent>);
91 91
92// Final classes 92// Final classes
93// static_assert(std::is_final<KInterruptEvent>::value && 93// static_assert(std::is_final_v<KInterruptEvent> &&
94// std::is_base_of<KReadableEvent, KInterruptEvent>::value); 94// std::is_base_of_v<KReadableEvent, KInterruptEvent>);
95// static_assert(std::is_final<KDebug>::value && 95// static_assert(std::is_final_v<KDebug> &&
96// std::is_base_of<KSynchronizationObject, KDebug>::value); 96// std::is_base_of_v<KSynchronizationObject, KDebug>);
97static_assert(std::is_final<KThread>::value && 97static_assert(std::is_final_v<KThread> && std::is_base_of_v<KSynchronizationObject, KThread>);
98 std::is_base_of<KSynchronizationObject, KThread>::value); 98static_assert(std::is_final_v<KServerPort> &&
99static_assert(std::is_final<KServerPort>::value && 99 std::is_base_of_v<KSynchronizationObject, KServerPort>);
100 std::is_base_of<KSynchronizationObject, KServerPort>::value); 100static_assert(std::is_final_v<KServerSession> &&
101static_assert(std::is_final<KServerSession>::value && 101 std::is_base_of_v<KSynchronizationObject, KServerSession>);
102 std::is_base_of<KSynchronizationObject, KServerSession>::value); 102static_assert(std::is_final_v<KClientPort> &&
103static_assert(std::is_final<KClientPort>::value && 103 std::is_base_of_v<KSynchronizationObject, KClientPort>);
104 std::is_base_of<KSynchronizationObject, KClientPort>::value); 104static_assert(std::is_final_v<KClientSession> && std::is_base_of_v<KAutoObject, KClientSession>);
105static_assert(std::is_final<KClientSession>::value && 105static_assert(std::is_final_v<KProcess> && std::is_base_of_v<KSynchronizationObject, KProcess>);
106 std::is_base_of<KAutoObject, KClientSession>::value); 106static_assert(std::is_final_v<KResourceLimit> && std::is_base_of_v<KAutoObject, KResourceLimit>);
107static_assert(std::is_final<KProcess>::value && 107// static_assert(std::is_final_v<KLightSession> &&
108 std::is_base_of<KSynchronizationObject, KProcess>::value); 108// std::is_base_of_v<KAutoObject, KLightSession>);
109static_assert(std::is_final<KResourceLimit>::value && 109static_assert(std::is_final_v<KPort> && std::is_base_of_v<KAutoObject, KPort>);
110 std::is_base_of<KAutoObject, KResourceLimit>::value); 110static_assert(std::is_final_v<KSession> && std::is_base_of_v<KAutoObject, KSession>);
111// static_assert(std::is_final<KLightSession>::value && 111static_assert(std::is_final_v<KSharedMemory> && std::is_base_of_v<KAutoObject, KSharedMemory>);
112// std::is_base_of<KAutoObject, KLightSession>::value); 112static_assert(std::is_final_v<KEvent> && std::is_base_of_v<KAutoObject, KEvent>);
113static_assert(std::is_final<KPort>::value && std::is_base_of<KAutoObject, KPort>::value); 113static_assert(std::is_final_v<KWritableEvent> && std::is_base_of_v<KAutoObject, KWritableEvent>);
114static_assert(std::is_final<KSession>::value && std::is_base_of<KAutoObject, KSession>::value); 114// static_assert(std::is_final_v<KLightClientSession> &&
115static_assert(std::is_final<KSharedMemory>::value && 115// std::is_base_of_v<KAutoObject, KLightClientSession>);
116 std::is_base_of<KAutoObject, KSharedMemory>::value); 116// static_assert(std::is_final_v<KLightServerSession> &&
117static_assert(std::is_final<KEvent>::value && std::is_base_of<KAutoObject, KEvent>::value); 117// std::is_base_of_v<KAutoObject, KLightServerSession>);
118static_assert(std::is_final<KWritableEvent>::value && 118static_assert(std::is_final_v<KTransferMemory> && std::is_base_of_v<KAutoObject, KTransferMemory>);
119 std::is_base_of<KAutoObject, KWritableEvent>::value); 119// static_assert(std::is_final_v<KDeviceAddressSpace> &&
120// static_assert(std::is_final<KLightClientSession>::value && 120// std::is_base_of_v<KAutoObject, KDeviceAddressSpace>);
121// std::is_base_of<KAutoObject, KLightClientSession>::value); 121// static_assert(std::is_final_v<KSessionRequest> &&
122// static_assert(std::is_final<KLightServerSession>::value && 122// std::is_base_of_v<KAutoObject, KSessionRequest>);
123// std::is_base_of<KAutoObject, KLightServerSession>::value); 123// static_assert(std::is_final_v<KCodeMemory> &&
124static_assert(std::is_final<KTransferMemory>::value && 124// std::is_base_of_v<KAutoObject, KCodeMemory>);
125 std::is_base_of<KAutoObject, KTransferMemory>::value);
126// static_assert(std::is_final<KDeviceAddressSpace>::value &&
127// std::is_base_of<KAutoObject, KDeviceAddressSpace>::value);
128// static_assert(std::is_final<KSessionRequest>::value &&
129// std::is_base_of<KAutoObject, KSessionRequest>::value);
130// static_assert(std::is_final<KCodeMemory>::value &&
131// std::is_base_of<KAutoObject, KCodeMemory>::value);
132 125
133} // namespace Kernel 126} // namespace Kernel
diff --git a/src/core/hle/kernel/k_client_port.cpp b/src/core/hle/kernel/k_client_port.cpp
index 4a12dee10..23d830d1f 100644
--- a/src/core/hle/kernel/k_client_port.cpp
+++ b/src/core/hle/kernel/k_client_port.cpp
@@ -119,7 +119,7 @@ ResultCode KClientPort::CreateSession(KClientSession** out) {
119 // We succeeded, so set the output. 119 // We succeeded, so set the output.
120 session_guard.Cancel(); 120 session_guard.Cancel();
121 *out = std::addressof(session->GetClientSession()); 121 *out = std::addressof(session->GetClientSession());
122 return RESULT_SUCCESS; 122 return ResultSuccess;
123} 123}
124 124
125} // namespace Kernel 125} // namespace Kernel
diff --git a/src/core/hle/kernel/k_condition_variable.cpp b/src/core/hle/kernel/k_condition_variable.cpp
index ce3bade60..ef14ad1d2 100644
--- a/src/core/hle/kernel/k_condition_variable.cpp
+++ b/src/core/hle/kernel/k_condition_variable.cpp
@@ -86,7 +86,7 @@ ResultCode KConditionVariable::SignalToAddress(VAddr addr) {
86 next_value |= Svc::HandleWaitMask; 86 next_value |= Svc::HandleWaitMask;
87 } 87 }
88 88
89 next_owner_thread->SetSyncedObject(nullptr, RESULT_SUCCESS); 89 next_owner_thread->SetSyncedObject(nullptr, ResultSuccess);
90 next_owner_thread->Wakeup(); 90 next_owner_thread->Wakeup();
91 } 91 }
92 92
@@ -100,7 +100,7 @@ ResultCode KConditionVariable::SignalToAddress(VAddr addr) {
100 } 100 }
101 } 101 }
102 102
103 return RESULT_SUCCESS; 103 return ResultSuccess;
104} 104}
105 105
106ResultCode KConditionVariable::WaitForAddress(Handle handle, VAddr addr, u32 value) { 106ResultCode KConditionVariable::WaitForAddress(Handle handle, VAddr addr, u32 value) {
@@ -112,7 +112,7 @@ ResultCode KConditionVariable::WaitForAddress(Handle handle, VAddr addr, u32 val
112 ASSERT(owner_thread.IsNull()); 112 ASSERT(owner_thread.IsNull());
113 { 113 {
114 KScopedSchedulerLock sl(kernel); 114 KScopedSchedulerLock sl(kernel);
115 cur_thread->SetSyncedObject(nullptr, RESULT_SUCCESS); 115 cur_thread->SetSyncedObject(nullptr, ResultSuccess);
116 116
117 // Check if the thread should terminate. 117 // Check if the thread should terminate.
118 R_UNLESS(!cur_thread->IsTerminationRequested(), ResultTerminationRequested); 118 R_UNLESS(!cur_thread->IsTerminationRequested(), ResultTerminationRequested);
@@ -124,7 +124,7 @@ ResultCode KConditionVariable::WaitForAddress(Handle handle, VAddr addr, u32 val
124 ResultInvalidCurrentMemory); 124 ResultInvalidCurrentMemory);
125 125
126 // If the tag isn't the handle (with wait mask), we're done. 126 // If the tag isn't the handle (with wait mask), we're done.
127 R_UNLESS(test_tag == (handle | Svc::HandleWaitMask), RESULT_SUCCESS); 127 R_UNLESS(test_tag == (handle | Svc::HandleWaitMask), ResultSuccess);
128 128
129 // Get the lock owner thread. 129 // Get the lock owner thread.
130 owner_thread = 130 owner_thread =
@@ -181,7 +181,7 @@ KThread* KConditionVariable::SignalImpl(KThread* thread) {
181 if (can_access) { 181 if (can_access) {
182 if (prev_tag == Svc::InvalidHandle) { 182 if (prev_tag == Svc::InvalidHandle) {
183 // If nobody held the lock previously, we're all good. 183 // If nobody held the lock previously, we're all good.
184 thread->SetSyncedObject(nullptr, RESULT_SUCCESS); 184 thread->SetSyncedObject(nullptr, ResultSuccess);
185 thread->Wakeup(); 185 thread->Wakeup();
186 } else { 186 } else {
187 // Get the previous owner. 187 // Get the previous owner.
@@ -292,7 +292,7 @@ ResultCode KConditionVariable::Wait(VAddr addr, u64 key, u32 value, s64 timeout)
292 } 292 }
293 293
294 // Wake up the next owner. 294 // Wake up the next owner.
295 next_owner_thread->SetSyncedObject(nullptr, RESULT_SUCCESS); 295 next_owner_thread->SetSyncedObject(nullptr, ResultSuccess);
296 next_owner_thread->Wakeup(); 296 next_owner_thread->Wakeup();
297 } 297 }
298 298
diff --git a/src/core/hle/kernel/k_handle_table.cpp b/src/core/hle/kernel/k_handle_table.cpp
index 0378447f6..6a420d5b0 100644
--- a/src/core/hle/kernel/k_handle_table.cpp
+++ b/src/core/hle/kernel/k_handle_table.cpp
@@ -25,7 +25,7 @@ ResultCode KHandleTable::Finalize() {
25 } 25 }
26 } 26 }
27 27
28 return RESULT_SUCCESS; 28 return ResultSuccess;
29} 29}
30 30
31bool KHandleTable::Remove(Handle handle) { 31bool KHandleTable::Remove(Handle handle) {
@@ -79,7 +79,7 @@ ResultCode KHandleTable::Add(Handle* out_handle, KAutoObject* obj, u16 type) {
79 *out_handle = EncodeHandle(static_cast<u16>(index), linear_id); 79 *out_handle = EncodeHandle(static_cast<u16>(index), linear_id);
80 } 80 }
81 81
82 return RESULT_SUCCESS; 82 return ResultSuccess;
83} 83}
84 84
85ResultCode KHandleTable::Reserve(Handle* out_handle) { 85ResultCode KHandleTable::Reserve(Handle* out_handle) {
@@ -89,7 +89,7 @@ ResultCode KHandleTable::Reserve(Handle* out_handle) {
89 R_UNLESS(m_count < m_table_size, ResultOutOfHandles); 89 R_UNLESS(m_count < m_table_size, ResultOutOfHandles);
90 90
91 *out_handle = EncodeHandle(static_cast<u16>(this->AllocateEntry()), this->AllocateLinearId()); 91 *out_handle = EncodeHandle(static_cast<u16>(this->AllocateEntry()), this->AllocateLinearId());
92 return RESULT_SUCCESS; 92 return ResultSuccess;
93} 93}
94 94
95void KHandleTable::Unreserve(Handle handle) { 95void KHandleTable::Unreserve(Handle handle) {
diff --git a/src/core/hle/kernel/k_handle_table.h b/src/core/hle/kernel/k_handle_table.h
index ba9dd061d..2ff6aa160 100644
--- a/src/core/hle/kernel/k_handle_table.h
+++ b/src/core/hle/kernel/k_handle_table.h
@@ -50,7 +50,7 @@ public:
50 m_free_head_index = i; 50 m_free_head_index = i;
51 } 51 }
52 52
53 return RESULT_SUCCESS; 53 return ResultSuccess;
54 } 54 }
55 55
56 size_t GetTableSize() const { 56 size_t GetTableSize() const {
diff --git a/src/core/hle/kernel/k_memory_manager.cpp b/src/core/hle/kernel/k_memory_manager.cpp
index aa71697b2..0166df0a5 100644
--- a/src/core/hle/kernel/k_memory_manager.cpp
+++ b/src/core/hle/kernel/k_memory_manager.cpp
@@ -86,7 +86,7 @@ ResultCode KMemoryManager::Allocate(KPageLinkedList& page_list, std::size_t num_
86 86
87 // Early return if we're allocating no pages 87 // Early return if we're allocating no pages
88 if (num_pages == 0) { 88 if (num_pages == 0) {
89 return RESULT_SUCCESS; 89 return ResultSuccess;
90 } 90 }
91 91
92 // Lock the pool that we're allocating from 92 // Lock the pool that we're allocating from
@@ -146,14 +146,14 @@ ResultCode KMemoryManager::Allocate(KPageLinkedList& page_list, std::size_t num_
146 146
147 // We succeeded! 147 // We succeeded!
148 group_guard.Cancel(); 148 group_guard.Cancel();
149 return RESULT_SUCCESS; 149 return ResultSuccess;
150} 150}
151 151
152ResultCode KMemoryManager::Free(KPageLinkedList& page_list, std::size_t num_pages, Pool pool, 152ResultCode KMemoryManager::Free(KPageLinkedList& page_list, std::size_t num_pages, Pool pool,
153 Direction dir) { 153 Direction dir) {
154 // Early return if we're freeing no pages 154 // Early return if we're freeing no pages
155 if (!num_pages) { 155 if (!num_pages) {
156 return RESULT_SUCCESS; 156 return ResultSuccess;
157 } 157 }
158 158
159 // Lock the pool that we're freeing from 159 // Lock the pool that we're freeing from
@@ -170,7 +170,7 @@ ResultCode KMemoryManager::Free(KPageLinkedList& page_list, std::size_t num_page
170 chosen_manager.Free(it.GetAddress(), min_num_pages); 170 chosen_manager.Free(it.GetAddress(), min_num_pages);
171 } 171 }
172 172
173 return RESULT_SUCCESS; 173 return ResultSuccess;
174} 174}
175 175
176std::size_t KMemoryManager::Impl::CalculateManagementOverheadSize(std::size_t region_size) { 176std::size_t KMemoryManager::Impl::CalculateManagementOverheadSize(std::size_t region_size) {
diff --git a/src/core/hle/kernel/k_page_linked_list.h b/src/core/hle/kernel/k_page_linked_list.h
index dfdac5321..3362fb236 100644
--- a/src/core/hle/kernel/k_page_linked_list.h
+++ b/src/core/hle/kernel/k_page_linked_list.h
@@ -71,7 +71,7 @@ public:
71 71
72 ResultCode AddBlock(u64 address, u64 num_pages) { 72 ResultCode AddBlock(u64 address, u64 num_pages) {
73 if (!num_pages) { 73 if (!num_pages) {
74 return RESULT_SUCCESS; 74 return ResultSuccess;
75 } 75 }
76 if (!nodes.empty()) { 76 if (!nodes.empty()) {
77 const auto node = nodes.back(); 77 const auto node = nodes.back();
@@ -82,7 +82,7 @@ public:
82 } 82 }
83 } 83 }
84 nodes.push_back({address, num_pages}); 84 nodes.push_back({address, num_pages});
85 return RESULT_SUCCESS; 85 return ResultSuccess;
86 } 86 }
87 87
88private: 88private:
diff --git a/src/core/hle/kernel/k_page_table.cpp b/src/core/hle/kernel/k_page_table.cpp
index 27dbf0ebc..66d260635 100644
--- a/src/core/hle/kernel/k_page_table.cpp
+++ b/src/core/hle/kernel/k_page_table.cpp
@@ -292,7 +292,7 @@ ResultCode KPageTable::MapProcessCode(VAddr addr, std::size_t num_pages, KMemory
292 292
293 block_manager->Update(addr, num_pages, state, perm); 293 block_manager->Update(addr, num_pages, state, perm);
294 294
295 return RESULT_SUCCESS; 295 return ResultSuccess;
296} 296}
297 297
298ResultCode KPageTable::MapProcessCodeMemory(VAddr dst_addr, VAddr src_addr, std::size_t size) { 298ResultCode KPageTable::MapProcessCodeMemory(VAddr dst_addr, VAddr src_addr, std::size_t size) {
@@ -329,14 +329,14 @@ ResultCode KPageTable::MapProcessCodeMemory(VAddr dst_addr, VAddr src_addr, std:
329 KMemoryAttribute::Locked); 329 KMemoryAttribute::Locked);
330 block_manager->Update(dst_addr, num_pages, KMemoryState::AliasCode); 330 block_manager->Update(dst_addr, num_pages, KMemoryState::AliasCode);
331 331
332 return RESULT_SUCCESS; 332 return ResultSuccess;
333} 333}
334 334
335ResultCode KPageTable::UnmapProcessCodeMemory(VAddr dst_addr, VAddr src_addr, std::size_t size) { 335ResultCode KPageTable::UnmapProcessCodeMemory(VAddr dst_addr, VAddr src_addr, std::size_t size) {
336 std::lock_guard lock{page_table_lock}; 336 std::lock_guard lock{page_table_lock};
337 337
338 if (!size) { 338 if (!size) {
339 return RESULT_SUCCESS; 339 return ResultSuccess;
340 } 340 }
341 341
342 const std::size_t num_pages{size / PageSize}; 342 const std::size_t num_pages{size / PageSize};
@@ -360,7 +360,7 @@ ResultCode KPageTable::UnmapProcessCodeMemory(VAddr dst_addr, VAddr src_addr, st
360 block_manager->Update(src_addr, num_pages, KMemoryState::Normal, 360 block_manager->Update(src_addr, num_pages, KMemoryState::Normal,
361 KMemoryPermission::ReadAndWrite); 361 KMemoryPermission::ReadAndWrite);
362 362
363 return RESULT_SUCCESS; 363 return ResultSuccess;
364} 364}
365 365
366void KPageTable::MapPhysicalMemory(KPageLinkedList& page_linked_list, VAddr start, VAddr end) { 366void KPageTable::MapPhysicalMemory(KPageLinkedList& page_linked_list, VAddr start, VAddr end) {
@@ -408,7 +408,7 @@ ResultCode KPageTable::MapPhysicalMemory(VAddr addr, std::size_t size) {
408 }); 408 });
409 409
410 if (mapped_size == size) { 410 if (mapped_size == size) {
411 return RESULT_SUCCESS; 411 return ResultSuccess;
412 } 412 }
413 413
414 const std::size_t remaining_size{size - mapped_size}; 414 const std::size_t remaining_size{size - mapped_size};
@@ -440,14 +440,14 @@ ResultCode KPageTable::MapPhysicalMemory(VAddr addr, std::size_t size) {
440 KMemoryAttribute::None, KMemoryState::Normal, 440 KMemoryAttribute::None, KMemoryState::Normal,
441 KMemoryPermission::ReadAndWrite, KMemoryAttribute::None); 441 KMemoryPermission::ReadAndWrite, KMemoryAttribute::None);
442 442
443 return RESULT_SUCCESS; 443 return ResultSuccess;
444} 444}
445 445
446ResultCode KPageTable::UnmapPhysicalMemory(VAddr addr, std::size_t size) { 446ResultCode KPageTable::UnmapPhysicalMemory(VAddr addr, std::size_t size) {
447 std::lock_guard lock{page_table_lock}; 447 std::lock_guard lock{page_table_lock};
448 448
449 const VAddr end_addr{addr + size}; 449 const VAddr end_addr{addr + size};
450 ResultCode result{RESULT_SUCCESS}; 450 ResultCode result{ResultSuccess};
451 std::size_t mapped_size{}; 451 std::size_t mapped_size{};
452 452
453 // Verify that the region can be unmapped 453 // Verify that the region can be unmapped
@@ -468,7 +468,7 @@ ResultCode KPageTable::UnmapPhysicalMemory(VAddr addr, std::size_t size) {
468 } 468 }
469 469
470 if (!mapped_size) { 470 if (!mapped_size) {
471 return RESULT_SUCCESS; 471 return ResultSuccess;
472 } 472 }
473 473
474 CASCADE_CODE(UnmapMemory(addr, size)); 474 CASCADE_CODE(UnmapMemory(addr, size));
@@ -477,14 +477,14 @@ ResultCode KPageTable::UnmapPhysicalMemory(VAddr addr, std::size_t size) {
477 process->GetResourceLimit()->Release(LimitableResource::PhysicalMemory, mapped_size); 477 process->GetResourceLimit()->Release(LimitableResource::PhysicalMemory, mapped_size);
478 physical_memory_usage -= mapped_size; 478 physical_memory_usage -= mapped_size;
479 479
480 return RESULT_SUCCESS; 480 return ResultSuccess;
481} 481}
482 482
483ResultCode KPageTable::UnmapMemory(VAddr addr, std::size_t size) { 483ResultCode KPageTable::UnmapMemory(VAddr addr, std::size_t size) {
484 std::lock_guard lock{page_table_lock}; 484 std::lock_guard lock{page_table_lock};
485 485
486 const VAddr end_addr{addr + size}; 486 const VAddr end_addr{addr + size};
487 ResultCode result{RESULT_SUCCESS}; 487 ResultCode result{ResultSuccess};
488 KPageLinkedList page_linked_list; 488 KPageLinkedList page_linked_list;
489 489
490 // Unmap each region within the range 490 // Unmap each region within the range
@@ -513,7 +513,7 @@ ResultCode KPageTable::UnmapMemory(VAddr addr, std::size_t size) {
513 513
514 block_manager->Update(addr, num_pages, KMemoryState::Free); 514 block_manager->Update(addr, num_pages, KMemoryState::Free);
515 515
516 return RESULT_SUCCESS; 516 return ResultSuccess;
517} 517}
518 518
519ResultCode KPageTable::Map(VAddr dst_addr, VAddr src_addr, std::size_t size) { 519ResultCode KPageTable::Map(VAddr dst_addr, VAddr src_addr, std::size_t size) {
@@ -552,7 +552,7 @@ ResultCode KPageTable::Map(VAddr dst_addr, VAddr src_addr, std::size_t size) {
552 block_manager->Update(dst_addr, num_pages, KMemoryState::Stack, 552 block_manager->Update(dst_addr, num_pages, KMemoryState::Stack,
553 KMemoryPermission::ReadAndWrite); 553 KMemoryPermission::ReadAndWrite);
554 554
555 return RESULT_SUCCESS; 555 return ResultSuccess;
556} 556}
557 557
558ResultCode KPageTable::Unmap(VAddr dst_addr, VAddr src_addr, std::size_t size) { 558ResultCode KPageTable::Unmap(VAddr dst_addr, VAddr src_addr, std::size_t size) {
@@ -594,7 +594,7 @@ ResultCode KPageTable::Unmap(VAddr dst_addr, VAddr src_addr, std::size_t size) {
594 block_manager->Update(src_addr, num_pages, src_state, KMemoryPermission::ReadAndWrite); 594 block_manager->Update(src_addr, num_pages, src_state, KMemoryPermission::ReadAndWrite);
595 block_manager->Update(dst_addr, num_pages, KMemoryState::Free); 595 block_manager->Update(dst_addr, num_pages, KMemoryState::Free);
596 596
597 return RESULT_SUCCESS; 597 return ResultSuccess;
598} 598}
599 599
600ResultCode KPageTable::MapPages(VAddr addr, const KPageLinkedList& page_linked_list, 600ResultCode KPageTable::MapPages(VAddr addr, const KPageLinkedList& page_linked_list,
@@ -616,7 +616,7 @@ ResultCode KPageTable::MapPages(VAddr addr, const KPageLinkedList& page_linked_l
616 cur_addr += node.GetNumPages() * PageSize; 616 cur_addr += node.GetNumPages() * PageSize;
617 } 617 }
618 618
619 return RESULT_SUCCESS; 619 return ResultSuccess;
620} 620}
621 621
622ResultCode KPageTable::MapPages(VAddr addr, KPageLinkedList& page_linked_list, KMemoryState state, 622ResultCode KPageTable::MapPages(VAddr addr, KPageLinkedList& page_linked_list, KMemoryState state,
@@ -638,7 +638,7 @@ ResultCode KPageTable::MapPages(VAddr addr, KPageLinkedList& page_linked_list, K
638 638
639 block_manager->Update(addr, num_pages, state, perm); 639 block_manager->Update(addr, num_pages, state, perm);
640 640
641 return RESULT_SUCCESS; 641 return ResultSuccess;
642} 642}
643 643
644ResultCode KPageTable::UnmapPages(VAddr addr, const KPageLinkedList& page_linked_list) { 644ResultCode KPageTable::UnmapPages(VAddr addr, const KPageLinkedList& page_linked_list) {
@@ -655,7 +655,7 @@ ResultCode KPageTable::UnmapPages(VAddr addr, const KPageLinkedList& page_linked
655 cur_addr += node.GetNumPages() * PageSize; 655 cur_addr += node.GetNumPages() * PageSize;
656 } 656 }
657 657
658 return RESULT_SUCCESS; 658 return ResultSuccess;
659} 659}
660 660
661ResultCode KPageTable::UnmapPages(VAddr addr, KPageLinkedList& page_linked_list, 661ResultCode KPageTable::UnmapPages(VAddr addr, KPageLinkedList& page_linked_list,
@@ -677,7 +677,7 @@ ResultCode KPageTable::UnmapPages(VAddr addr, KPageLinkedList& page_linked_list,
677 677
678 block_manager->Update(addr, num_pages, state, KMemoryPermission::None); 678 block_manager->Update(addr, num_pages, state, KMemoryPermission::None);
679 679
680 return RESULT_SUCCESS; 680 return ResultSuccess;
681} 681}
682 682
683ResultCode KPageTable::SetCodeMemoryPermission(VAddr addr, std::size_t size, 683ResultCode KPageTable::SetCodeMemoryPermission(VAddr addr, std::size_t size,
@@ -708,7 +708,7 @@ ResultCode KPageTable::SetCodeMemoryPermission(VAddr addr, std::size_t size,
708 708
709 // Return early if there is nothing to change 709 // Return early if there is nothing to change
710 if (state == prev_state && perm == prev_perm) { 710 if (state == prev_state && perm == prev_perm) {
711 return RESULT_SUCCESS; 711 return ResultSuccess;
712 } 712 }
713 713
714 if ((prev_perm & KMemoryPermission::Execute) != (perm & KMemoryPermission::Execute)) { 714 if ((prev_perm & KMemoryPermission::Execute) != (perm & KMemoryPermission::Execute)) {
@@ -725,7 +725,7 @@ ResultCode KPageTable::SetCodeMemoryPermission(VAddr addr, std::size_t size,
725 725
726 block_manager->Update(addr, num_pages, state, perm); 726 block_manager->Update(addr, num_pages, state, perm);
727 727
728 return RESULT_SUCCESS; 728 return ResultSuccess;
729} 729}
730 730
731KMemoryInfo KPageTable::QueryInfoImpl(VAddr addr) { 731KMemoryInfo KPageTable::QueryInfoImpl(VAddr addr) {
@@ -758,7 +758,7 @@ ResultCode KPageTable::ReserveTransferMemory(VAddr addr, std::size_t size, KMemo
758 758
759 block_manager->Update(addr, size / PageSize, state, perm, attribute | KMemoryAttribute::Locked); 759 block_manager->Update(addr, size / PageSize, state, perm, attribute | KMemoryAttribute::Locked);
760 760
761 return RESULT_SUCCESS; 761 return ResultSuccess;
762} 762}
763 763
764ResultCode KPageTable::ResetTransferMemory(VAddr addr, std::size_t size) { 764ResultCode KPageTable::ResetTransferMemory(VAddr addr, std::size_t size) {
@@ -775,7 +775,7 @@ ResultCode KPageTable::ResetTransferMemory(VAddr addr, std::size_t size) {
775 775
776 block_manager->Update(addr, size / PageSize, state, KMemoryPermission::ReadAndWrite); 776 block_manager->Update(addr, size / PageSize, state, KMemoryPermission::ReadAndWrite);
777 777
778 return RESULT_SUCCESS; 778 return ResultSuccess;
779} 779}
780 780
781ResultCode KPageTable::SetMemoryAttribute(VAddr addr, std::size_t size, KMemoryAttribute mask, 781ResultCode KPageTable::SetMemoryAttribute(VAddr addr, std::size_t size, KMemoryAttribute mask,
@@ -797,13 +797,13 @@ ResultCode KPageTable::SetMemoryAttribute(VAddr addr, std::size_t size, KMemoryA
797 797
798 block_manager->Update(addr, size / PageSize, state, perm, attribute); 798 block_manager->Update(addr, size / PageSize, state, perm, attribute);
799 799
800 return RESULT_SUCCESS; 800 return ResultSuccess;
801} 801}
802 802
803ResultCode KPageTable::SetHeapCapacity(std::size_t new_heap_capacity) { 803ResultCode KPageTable::SetHeapCapacity(std::size_t new_heap_capacity) {
804 std::lock_guard lock{page_table_lock}; 804 std::lock_guard lock{page_table_lock};
805 heap_capacity = new_heap_capacity; 805 heap_capacity = new_heap_capacity;
806 return RESULT_SUCCESS; 806 return ResultSuccess;
807} 807}
808 808
809ResultVal<VAddr> KPageTable::SetHeapSize(std::size_t size) { 809ResultVal<VAddr> KPageTable::SetHeapSize(std::size_t size) {
@@ -911,7 +911,7 @@ ResultCode KPageTable::LockForDeviceAddressSpace(VAddr addr, std::size_t size) {
911 }, 911 },
912 perm); 912 perm);
913 913
914 return RESULT_SUCCESS; 914 return ResultSuccess;
915} 915}
916 916
917ResultCode KPageTable::UnlockForDeviceAddressSpace(VAddr addr, std::size_t size) { 917ResultCode KPageTable::UnlockForDeviceAddressSpace(VAddr addr, std::size_t size) {
@@ -934,13 +934,13 @@ ResultCode KPageTable::UnlockForDeviceAddressSpace(VAddr addr, std::size_t size)
934 }, 934 },
935 perm); 935 perm);
936 936
937 return RESULT_SUCCESS; 937 return ResultSuccess;
938} 938}
939 939
940ResultCode KPageTable::InitializeMemoryLayout(VAddr start, VAddr end) { 940ResultCode KPageTable::InitializeMemoryLayout(VAddr start, VAddr end) {
941 block_manager = std::make_unique<KMemoryBlockManager>(start, end); 941 block_manager = std::make_unique<KMemoryBlockManager>(start, end);
942 942
943 return RESULT_SUCCESS; 943 return ResultSuccess;
944} 944}
945 945
946bool KPageTable::IsRegionMapped(VAddr address, u64 size) { 946bool KPageTable::IsRegionMapped(VAddr address, u64 size) {
@@ -1006,7 +1006,7 @@ ResultCode KPageTable::Operate(VAddr addr, std::size_t num_pages, const KPageLin
1006 addr += size; 1006 addr += size;
1007 } 1007 }
1008 1008
1009 return RESULT_SUCCESS; 1009 return ResultSuccess;
1010} 1010}
1011 1011
1012ResultCode KPageTable::Operate(VAddr addr, std::size_t num_pages, KMemoryPermission perm, 1012ResultCode KPageTable::Operate(VAddr addr, std::size_t num_pages, KMemoryPermission perm,
@@ -1033,7 +1033,7 @@ ResultCode KPageTable::Operate(VAddr addr, std::size_t num_pages, KMemoryPermiss
1033 default: 1033 default:
1034 UNREACHABLE(); 1034 UNREACHABLE();
1035 } 1035 }
1036 return RESULT_SUCCESS; 1036 return ResultSuccess;
1037} 1037}
1038 1038
1039constexpr VAddr KPageTable::GetRegionAddress(KMemoryState state) const { 1039constexpr VAddr KPageTable::GetRegionAddress(KMemoryState state) const {
@@ -1164,7 +1164,7 @@ constexpr ResultCode KPageTable::CheckMemoryState(const KMemoryInfo& info, KMemo
1164 return ResultInvalidCurrentMemory; 1164 return ResultInvalidCurrentMemory;
1165 } 1165 }
1166 1166
1167 return RESULT_SUCCESS; 1167 return ResultSuccess;
1168} 1168}
1169 1169
1170ResultCode KPageTable::CheckMemoryState(KMemoryState* out_state, KMemoryPermission* out_perm, 1170ResultCode KPageTable::CheckMemoryState(KMemoryState* out_state, KMemoryPermission* out_perm,
@@ -1223,7 +1223,7 @@ ResultCode KPageTable::CheckMemoryState(KMemoryState* out_state, KMemoryPermissi
1223 *out_attr = first_attr & static_cast<KMemoryAttribute>(~ignore_attr); 1223 *out_attr = first_attr & static_cast<KMemoryAttribute>(~ignore_attr);
1224 } 1224 }
1225 1225
1226 return RESULT_SUCCESS; 1226 return ResultSuccess;
1227} 1227}
1228 1228
1229} // namespace Kernel 1229} // namespace Kernel
diff --git a/src/core/hle/kernel/k_port.cpp b/src/core/hle/kernel/k_port.cpp
index 223c0b205..a8ba09c4a 100644
--- a/src/core/hle/kernel/k_port.cpp
+++ b/src/core/hle/kernel/k_port.cpp
@@ -59,7 +59,7 @@ ResultCode KPort::EnqueueSession(KServerSession* session) {
59 server.EnqueueSession(session); 59 server.EnqueueSession(session);
60 server.GetSessionRequestHandler()->ClientConnected(server.AcceptSession()); 60 server.GetSessionRequestHandler()->ClientConnected(server.AcceptSession());
61 61
62 return RESULT_SUCCESS; 62 return ResultSuccess;
63} 63}
64 64
65} // namespace Kernel 65} // namespace Kernel
diff --git a/src/core/hle/kernel/k_process.cpp b/src/core/hle/kernel/k_process.cpp
index bdcbaeeaa..06b8ce151 100644
--- a/src/core/hle/kernel/k_process.cpp
+++ b/src/core/hle/kernel/k_process.cpp
@@ -142,7 +142,7 @@ ResultCode KProcess::Initialize(KProcess* process, Core::System& system, std::st
142 // Open a reference to the resource limit. 142 // Open a reference to the resource limit.
143 process->resource_limit->Open(); 143 process->resource_limit->Open();
144 144
145 return RESULT_SUCCESS; 145 return ResultSuccess;
146} 146}
147 147
148KResourceLimit* KProcess::GetResourceLimit() const { 148KResourceLimit* KProcess::GetResourceLimit() const {
@@ -258,7 +258,7 @@ ResultCode KProcess::AddSharedMemory(KSharedMemory* shmem, [[maybe_unused]] VAdd
258 // Open a reference to the shared memory. 258 // Open a reference to the shared memory.
259 shmem->Open(); 259 shmem->Open();
260 260
261 return RESULT_SUCCESS; 261 return ResultSuccess;
262} 262}
263 263
264void KProcess::RemoveSharedMemory(KSharedMemory* shmem, [[maybe_unused]] VAddr address, 264void KProcess::RemoveSharedMemory(KSharedMemory* shmem, [[maybe_unused]] VAddr address,
@@ -291,7 +291,7 @@ ResultCode KProcess::Reset() {
291 291
292 // Clear signaled. 292 // Clear signaled.
293 is_signaled = false; 293 is_signaled = false;
294 return RESULT_SUCCESS; 294 return ResultSuccess;
295} 295}
296 296
297ResultCode KProcess::LoadFromMetadata(const FileSys::ProgramMetadata& metadata, 297ResultCode KProcess::LoadFromMetadata(const FileSys::ProgramMetadata& metadata,
@@ -524,7 +524,7 @@ ResultCode KProcess::AllocateMainThreadStack(std::size_t stack_size) {
524 524
525 main_thread_stack_top += main_thread_stack_size; 525 main_thread_stack_top += main_thread_stack_size;
526 526
527 return RESULT_SUCCESS; 527 return ResultSuccess;
528} 528}
529 529
530} // namespace Kernel 530} // namespace Kernel
diff --git a/src/core/hle/kernel/k_process.h b/src/core/hle/kernel/k_process.h
index c0656b9af..a03c074fb 100644
--- a/src/core/hle/kernel/k_process.h
+++ b/src/core/hle/kernel/k_process.h
@@ -310,7 +310,7 @@ public:
310 * 310 *
311 * @param metadata The provided metadata to load process specific info from. 311 * @param metadata The provided metadata to load process specific info from.
312 * 312 *
313 * @returns RESULT_SUCCESS if all relevant metadata was able to be 313 * @returns ResultSuccess if all relevant metadata was able to be
314 * loaded and parsed. Otherwise, an error code is returned. 314 * loaded and parsed. Otherwise, an error code is returned.
315 */ 315 */
316 ResultCode LoadFromMetadata(const FileSys::ProgramMetadata& metadata, std::size_t code_size); 316 ResultCode LoadFromMetadata(const FileSys::ProgramMetadata& metadata, std::size_t code_size);
diff --git a/src/core/hle/kernel/k_readable_event.cpp b/src/core/hle/kernel/k_readable_event.cpp
index 0ea2d0275..bf1db10d4 100644
--- a/src/core/hle/kernel/k_readable_event.cpp
+++ b/src/core/hle/kernel/k_readable_event.cpp
@@ -36,13 +36,13 @@ ResultCode KReadableEvent::Signal() {
36 NotifyAvailable(); 36 NotifyAvailable();
37 } 37 }
38 38
39 return RESULT_SUCCESS; 39 return ResultSuccess;
40} 40}
41 41
42ResultCode KReadableEvent::Clear() { 42ResultCode KReadableEvent::Clear() {
43 Reset(); 43 Reset();
44 44
45 return RESULT_SUCCESS; 45 return ResultSuccess;
46} 46}
47 47
48ResultCode KReadableEvent::Reset() { 48ResultCode KReadableEvent::Reset() {
@@ -53,7 +53,7 @@ ResultCode KReadableEvent::Reset() {
53 } 53 }
54 54
55 is_signaled = false; 55 is_signaled = false;
56 return RESULT_SUCCESS; 56 return ResultSuccess;
57} 57}
58 58
59} // namespace Kernel 59} // namespace Kernel
diff --git a/src/core/hle/kernel/k_resource_limit.cpp b/src/core/hle/kernel/k_resource_limit.cpp
index bf20bf7d0..f91cb65dc 100644
--- a/src/core/hle/kernel/k_resource_limit.cpp
+++ b/src/core/hle/kernel/k_resource_limit.cpp
@@ -80,7 +80,7 @@ ResultCode KResourceLimit::SetLimitValue(LimitableResource which, s64 value) {
80 80
81 limit_values[index] = value; 81 limit_values[index] = value;
82 82
83 return RESULT_SUCCESS; 83 return ResultSuccess;
84} 84}
85 85
86bool KResourceLimit::Reserve(LimitableResource which, s64 value) { 86bool KResourceLimit::Reserve(LimitableResource which, s64 value) {
diff --git a/src/core/hle/kernel/k_server_session.cpp b/src/core/hle/kernel/k_server_session.cpp
index 457fdfd60..dbf03b462 100644
--- a/src/core/hle/kernel/k_server_session.cpp
+++ b/src/core/hle/kernel/k_server_session.cpp
@@ -71,7 +71,7 @@ std::size_t KServerSession::NumDomainRequestHandlers() const {
71 71
72ResultCode KServerSession::HandleDomainSyncRequest(Kernel::HLERequestContext& context) { 72ResultCode KServerSession::HandleDomainSyncRequest(Kernel::HLERequestContext& context) {
73 if (!context.HasDomainMessageHeader()) { 73 if (!context.HasDomainMessageHeader()) {
74 return RESULT_SUCCESS; 74 return ResultSuccess;
75 } 75 }
76 76
77 // Set domain handlers in HLE context, used for domain objects (IPC interfaces) as inputs 77 // Set domain handlers in HLE context, used for domain objects (IPC interfaces) as inputs
@@ -88,7 +88,7 @@ ResultCode KServerSession::HandleDomainSyncRequest(Kernel::HLERequestContext& co
88 "to {} needed to return a new interface!", 88 "to {} needed to return a new interface!",
89 object_id, name); 89 object_id, name);
90 UNREACHABLE(); 90 UNREACHABLE();
91 return RESULT_SUCCESS; // Ignore error if asserts are off 91 return ResultSuccess; // Ignore error if asserts are off
92 } 92 }
93 return manager->DomainHandler(object_id - 1)->HandleSyncRequest(*this, context); 93 return manager->DomainHandler(object_id - 1)->HandleSyncRequest(*this, context);
94 94
@@ -98,14 +98,14 @@ ResultCode KServerSession::HandleDomainSyncRequest(Kernel::HLERequestContext& co
98 manager->CloseDomainHandler(object_id - 1); 98 manager->CloseDomainHandler(object_id - 1);
99 99
100 IPC::ResponseBuilder rb{context, 2}; 100 IPC::ResponseBuilder rb{context, 2};
101 rb.Push(RESULT_SUCCESS); 101 rb.Push(ResultSuccess);
102 return RESULT_SUCCESS; 102 return ResultSuccess;
103 } 103 }
104 } 104 }
105 105
106 LOG_CRITICAL(IPC, "Unknown domain command={}", domain_message_header.command.Value()); 106 LOG_CRITICAL(IPC, "Unknown domain command={}", domain_message_header.command.Value());
107 ASSERT(false); 107 ASSERT(false);
108 return RESULT_SUCCESS; 108 return ResultSuccess;
109} 109}
110 110
111ResultCode KServerSession::QueueSyncRequest(KThread* thread, Core::Memory::Memory& memory) { 111ResultCode KServerSession::QueueSyncRequest(KThread* thread, Core::Memory::Memory& memory) {
@@ -116,14 +116,14 @@ ResultCode KServerSession::QueueSyncRequest(KThread* thread, Core::Memory::Memor
116 116
117 if (auto strong_ptr = service_thread.lock()) { 117 if (auto strong_ptr = service_thread.lock()) {
118 strong_ptr->QueueSyncRequest(*parent, std::move(context)); 118 strong_ptr->QueueSyncRequest(*parent, std::move(context));
119 return RESULT_SUCCESS; 119 return ResultSuccess;
120 } 120 }
121 121
122 return RESULT_SUCCESS; 122 return ResultSuccess;
123} 123}
124 124
125ResultCode KServerSession::CompleteSyncRequest(HLERequestContext& context) { 125ResultCode KServerSession::CompleteSyncRequest(HLERequestContext& context) {
126 ResultCode result = RESULT_SUCCESS; 126 ResultCode result = ResultSuccess;
127 // If the session has been converted to a domain, handle the domain request 127 // If the session has been converted to a domain, handle the domain request
128 if (IsDomain() && context.HasDomainMessageHeader()) { 128 if (IsDomain() && context.HasDomainMessageHeader()) {
129 result = HandleDomainSyncRequest(context); 129 result = HandleDomainSyncRequest(context);
diff --git a/src/core/hle/kernel/k_shared_memory.cpp b/src/core/hle/kernel/k_shared_memory.cpp
index 7770b1868..51d7538ca 100644
--- a/src/core/hle/kernel/k_shared_memory.cpp
+++ b/src/core/hle/kernel/k_shared_memory.cpp
@@ -55,7 +55,7 @@ ResultCode KSharedMemory::Initialize(Core::DeviceMemory& device_memory_, KProces
55 // Clear all pages in the memory. 55 // Clear all pages in the memory.
56 std::memset(device_memory_.GetPointer(physical_address_), 0, size_); 56 std::memset(device_memory_.GetPointer(physical_address_), 0, size_);
57 57
58 return RESULT_SUCCESS; 58 return ResultSuccess;
59} 59}
60 60
61void KSharedMemory::Finalize() { 61void KSharedMemory::Finalize() {
diff --git a/src/core/hle/kernel/k_synchronization_object.cpp b/src/core/hle/kernel/k_synchronization_object.cpp
index 45380dea0..f168b4f21 100644
--- a/src/core/hle/kernel/k_synchronization_object.cpp
+++ b/src/core/hle/kernel/k_synchronization_object.cpp
@@ -38,7 +38,7 @@ ResultCode KSynchronizationObject::Wait(KernelCore& kernel_ctx, s32* out_index,
38 if (objects[i]->IsSignaled()) { 38 if (objects[i]->IsSignaled()) {
39 *out_index = i; 39 *out_index = i;
40 slp.CancelSleep(); 40 slp.CancelSleep();
41 return RESULT_SUCCESS; 41 return ResultSuccess;
42 } 42 }
43 } 43 }
44 44
@@ -97,7 +97,7 @@ ResultCode KSynchronizationObject::Wait(KernelCore& kernel_ctx, s32* out_index,
97 kernel_ctx.TimeManager().UnscheduleTimeEvent(thread); 97 kernel_ctx.TimeManager().UnscheduleTimeEvent(thread);
98 98
99 // Get the wait result. 99 // Get the wait result.
100 ResultCode wait_result{RESULT_SUCCESS}; 100 ResultCode wait_result{ResultSuccess};
101 s32 sync_index = -1; 101 s32 sync_index = -1;
102 { 102 {
103 KScopedSchedulerLock lock(kernel_ctx); 103 KScopedSchedulerLock lock(kernel_ctx);
diff --git a/src/core/hle/kernel/k_synchronization_object.h b/src/core/hle/kernel/k_synchronization_object.h
index 3d4ce1fbc..898e58e16 100644
--- a/src/core/hle/kernel/k_synchronization_object.h
+++ b/src/core/hle/kernel/k_synchronization_object.h
@@ -43,7 +43,7 @@ protected:
43 43
44 void NotifyAvailable(ResultCode result); 44 void NotifyAvailable(ResultCode result);
45 void NotifyAvailable() { 45 void NotifyAvailable() {
46 return this->NotifyAvailable(RESULT_SUCCESS); 46 return this->NotifyAvailable(ResultSuccess);
47 } 47 }
48 48
49private: 49private:
diff --git a/src/core/hle/kernel/k_thread.cpp b/src/core/hle/kernel/k_thread.cpp
index 3cf43d290..9f1d3156b 100644
--- a/src/core/hle/kernel/k_thread.cpp
+++ b/src/core/hle/kernel/k_thread.cpp
@@ -205,7 +205,7 @@ ResultCode KThread::Initialize(KThreadFunction func, uintptr_t arg, VAddr user_s
205 } 205 }
206 } 206 }
207 207
208 return RESULT_SUCCESS; 208 return ResultSuccess;
209} 209}
210 210
211ResultCode KThread::InitializeThread(KThread* thread, KThreadFunction func, uintptr_t arg, 211ResultCode KThread::InitializeThread(KThread* thread, KThreadFunction func, uintptr_t arg,
@@ -219,7 +219,7 @@ ResultCode KThread::InitializeThread(KThread* thread, KThreadFunction func, uint
219 thread->host_context = 219 thread->host_context =
220 std::make_shared<Common::Fiber>(std::move(init_func), init_func_parameter); 220 std::make_shared<Common::Fiber>(std::move(init_func), init_func_parameter);
221 221
222 return RESULT_SUCCESS; 222 return ResultSuccess;
223} 223}
224 224
225ResultCode KThread::InitializeDummyThread(KThread* thread) { 225ResultCode KThread::InitializeDummyThread(KThread* thread) {
@@ -460,7 +460,7 @@ ResultCode KThread::GetCoreMask(s32* out_ideal_core, u64* out_affinity_mask) {
460 *out_ideal_core = virtual_ideal_core_id; 460 *out_ideal_core = virtual_ideal_core_id;
461 *out_affinity_mask = virtual_affinity_mask; 461 *out_affinity_mask = virtual_affinity_mask;
462 462
463 return RESULT_SUCCESS; 463 return ResultSuccess;
464} 464}
465 465
466ResultCode KThread::GetPhysicalCoreMask(s32* out_ideal_core, u64* out_affinity_mask) { 466ResultCode KThread::GetPhysicalCoreMask(s32* out_ideal_core, u64* out_affinity_mask) {
@@ -476,7 +476,7 @@ ResultCode KThread::GetPhysicalCoreMask(s32* out_ideal_core, u64* out_affinity_m
476 *out_affinity_mask = original_physical_affinity_mask.GetAffinityMask(); 476 *out_affinity_mask = original_physical_affinity_mask.GetAffinityMask();
477 } 477 }
478 478
479 return RESULT_SUCCESS; 479 return ResultSuccess;
480} 480}
481 481
482ResultCode KThread::SetCoreMask(s32 cpu_core_id, u64 v_affinity_mask) { 482ResultCode KThread::SetCoreMask(s32 cpu_core_id, u64 v_affinity_mask) {
@@ -599,7 +599,7 @@ ResultCode KThread::SetCoreMask(s32 cpu_core_id, u64 v_affinity_mask) {
599 } 599 }
600 } 600 }
601 601
602 return RESULT_SUCCESS; 602 return ResultSuccess;
603} 603}
604 604
605void KThread::SetBasePriority(s32 value) { 605void KThread::SetBasePriority(s32 value) {
@@ -778,7 +778,7 @@ ResultCode KThread::SetActivity(Svc::ThreadActivity activity) {
778 } 778 }
779 } 779 }
780 780
781 return RESULT_SUCCESS; 781 return ResultSuccess;
782} 782}
783 783
784ResultCode KThread::GetThreadContext3(std::vector<u8>& out) { 784ResultCode KThread::GetThreadContext3(std::vector<u8>& out) {
@@ -813,7 +813,7 @@ ResultCode KThread::GetThreadContext3(std::vector<u8>& out) {
813 } 813 }
814 } 814 }
815 815
816 return RESULT_SUCCESS; 816 return ResultSuccess;
817} 817}
818 818
819void KThread::AddWaiterImpl(KThread* thread) { 819void KThread::AddWaiterImpl(KThread* thread) {
@@ -970,7 +970,7 @@ ResultCode KThread::Run() {
970 970
971 // Set our state and finish. 971 // Set our state and finish.
972 SetState(ThreadState::Runnable); 972 SetState(ThreadState::Runnable);
973 return RESULT_SUCCESS; 973 return ResultSuccess;
974 } 974 }
975} 975}
976 976
@@ -1020,7 +1020,7 @@ ResultCode KThread::Sleep(s64 timeout) {
1020 // Cancel the timer. 1020 // Cancel the timer.
1021 kernel.TimeManager().UnscheduleTimeEvent(this); 1021 kernel.TimeManager().UnscheduleTimeEvent(this);
1022 1022
1023 return RESULT_SUCCESS; 1023 return ResultSuccess;
1024} 1024}
1025 1025
1026void KThread::SetState(ThreadState state) { 1026void KThread::SetState(ThreadState state) {
diff --git a/src/core/hle/kernel/k_thread.h b/src/core/hle/kernel/k_thread.h
index 01eebb165..c77f44ad4 100644
--- a/src/core/hle/kernel/k_thread.h
+++ b/src/core/hle/kernel/k_thread.h
@@ -684,7 +684,7 @@ private:
684 u32 address_key_value{}; 684 u32 address_key_value{};
685 u32 suspend_request_flags{}; 685 u32 suspend_request_flags{};
686 u32 suspend_allowed_flags{}; 686 u32 suspend_allowed_flags{};
687 ResultCode wait_result{RESULT_SUCCESS}; 687 ResultCode wait_result{ResultSuccess};
688 s32 base_priority{}; 688 s32 base_priority{};
689 s32 physical_ideal_core_id{}; 689 s32 physical_ideal_core_id{};
690 s32 virtual_ideal_core_id{}; 690 s32 virtual_ideal_core_id{};
diff --git a/src/core/hle/kernel/k_transfer_memory.cpp b/src/core/hle/kernel/k_transfer_memory.cpp
index 5bc33706d..1732925c9 100644
--- a/src/core/hle/kernel/k_transfer_memory.cpp
+++ b/src/core/hle/kernel/k_transfer_memory.cpp
@@ -28,7 +28,7 @@ ResultCode KTransferMemory::Initialize(VAddr address_, std::size_t size_,
28 size = size_; 28 size = size_;
29 is_initialized = true; 29 is_initialized = true;
30 30
31 return RESULT_SUCCESS; 31 return ResultSuccess;
32} 32}
33 33
34void KTransferMemory::Finalize() { 34void KTransferMemory::Finalize() {
diff --git a/src/core/hle/kernel/process_capability.cpp b/src/core/hle/kernel/process_capability.cpp
index b2ceeceb3..31a0867d3 100644
--- a/src/core/hle/kernel/process_capability.cpp
+++ b/src/core/hle/kernel/process_capability.cpp
@@ -153,7 +153,7 @@ ResultCode ProcessCapabilities::ParseCapabilities(const u32* capabilities,
153 } 153 }
154 } 154 }
155 155
156 return RESULT_SUCCESS; 156 return ResultSuccess;
157} 157}
158 158
159ResultCode ProcessCapabilities::ParseSingleFlagCapability(u32& set_flags, u32& set_svc_bits, 159ResultCode ProcessCapabilities::ParseSingleFlagCapability(u32& set_flags, u32& set_svc_bits,
@@ -167,7 +167,7 @@ ResultCode ProcessCapabilities::ParseSingleFlagCapability(u32& set_flags, u32& s
167 // Bail early on ignorable entries, as one would expect, 167 // Bail early on ignorable entries, as one would expect,
168 // ignorable descriptors can be ignored. 168 // ignorable descriptors can be ignored.
169 if (type == CapabilityType::Ignorable) { 169 if (type == CapabilityType::Ignorable) {
170 return RESULT_SUCCESS; 170 return ResultSuccess;
171 } 171 }
172 172
173 // Ensure that the give flag hasn't already been initialized before. 173 // Ensure that the give flag hasn't already been initialized before.
@@ -264,7 +264,7 @@ ResultCode ProcessCapabilities::HandlePriorityCoreNumFlags(u32 flags) {
264 264
265 core_mask = make_mask(core_num_min, core_num_max); 265 core_mask = make_mask(core_num_min, core_num_max);
266 priority_mask = make_mask(priority_min, priority_max); 266 priority_mask = make_mask(priority_min, priority_max);
267 return RESULT_SUCCESS; 267 return ResultSuccess;
268} 268}
269 269
270ResultCode ProcessCapabilities::HandleSyscallFlags(u32& set_svc_bits, u32 flags) { 270ResultCode ProcessCapabilities::HandleSyscallFlags(u32& set_svc_bits, u32 flags) {
@@ -288,23 +288,23 @@ ResultCode ProcessCapabilities::HandleSyscallFlags(u32& set_svc_bits, u32 flags)
288 svc_capabilities[svc_number] = true; 288 svc_capabilities[svc_number] = true;
289 } 289 }
290 290
291 return RESULT_SUCCESS; 291 return ResultSuccess;
292} 292}
293 293
294ResultCode ProcessCapabilities::HandleMapPhysicalFlags(u32 flags, u32 size_flags, 294ResultCode ProcessCapabilities::HandleMapPhysicalFlags(u32 flags, u32 size_flags,
295 KPageTable& page_table) { 295 KPageTable& page_table) {
296 // TODO(Lioncache): Implement once the memory manager can handle this. 296 // TODO(Lioncache): Implement once the memory manager can handle this.
297 return RESULT_SUCCESS; 297 return ResultSuccess;
298} 298}
299 299
300ResultCode ProcessCapabilities::HandleMapIOFlags(u32 flags, KPageTable& page_table) { 300ResultCode ProcessCapabilities::HandleMapIOFlags(u32 flags, KPageTable& page_table) {
301 // TODO(Lioncache): Implement once the memory manager can handle this. 301 // TODO(Lioncache): Implement once the memory manager can handle this.
302 return RESULT_SUCCESS; 302 return ResultSuccess;
303} 303}
304 304
305ResultCode ProcessCapabilities::HandleMapRegionFlags(u32 flags, KPageTable& page_table) { 305ResultCode ProcessCapabilities::HandleMapRegionFlags(u32 flags, KPageTable& page_table) {
306 // TODO(Lioncache): Implement once the memory manager can handle this. 306 // TODO(Lioncache): Implement once the memory manager can handle this.
307 return RESULT_SUCCESS; 307 return ResultSuccess;
308} 308}
309 309
310ResultCode ProcessCapabilities::HandleInterruptFlags(u32 flags) { 310ResultCode ProcessCapabilities::HandleInterruptFlags(u32 flags) {
@@ -331,7 +331,7 @@ ResultCode ProcessCapabilities::HandleInterruptFlags(u32 flags) {
331 interrupt_capabilities[interrupt] = true; 331 interrupt_capabilities[interrupt] = true;
332 } 332 }
333 333
334 return RESULT_SUCCESS; 334 return ResultSuccess;
335} 335}
336 336
337ResultCode ProcessCapabilities::HandleProgramTypeFlags(u32 flags) { 337ResultCode ProcessCapabilities::HandleProgramTypeFlags(u32 flags) {
@@ -342,7 +342,7 @@ ResultCode ProcessCapabilities::HandleProgramTypeFlags(u32 flags) {
342 } 342 }
343 343
344 program_type = static_cast<ProgramType>((flags >> 14) & 0b111); 344 program_type = static_cast<ProgramType>((flags >> 14) & 0b111);
345 return RESULT_SUCCESS; 345 return ResultSuccess;
346} 346}
347 347
348ResultCode ProcessCapabilities::HandleKernelVersionFlags(u32 flags) { 348ResultCode ProcessCapabilities::HandleKernelVersionFlags(u32 flags) {
@@ -362,7 +362,7 @@ ResultCode ProcessCapabilities::HandleKernelVersionFlags(u32 flags) {
362 } 362 }
363 363
364 kernel_version = flags; 364 kernel_version = flags;
365 return RESULT_SUCCESS; 365 return ResultSuccess;
366} 366}
367 367
368ResultCode ProcessCapabilities::HandleHandleTableFlags(u32 flags) { 368ResultCode ProcessCapabilities::HandleHandleTableFlags(u32 flags) {
@@ -373,7 +373,7 @@ ResultCode ProcessCapabilities::HandleHandleTableFlags(u32 flags) {
373 } 373 }
374 374
375 handle_table_size = static_cast<s32>((flags >> 16) & 0x3FF); 375 handle_table_size = static_cast<s32>((flags >> 16) & 0x3FF);
376 return RESULT_SUCCESS; 376 return ResultSuccess;
377} 377}
378 378
379ResultCode ProcessCapabilities::HandleDebugFlags(u32 flags) { 379ResultCode ProcessCapabilities::HandleDebugFlags(u32 flags) {
@@ -385,7 +385,7 @@ ResultCode ProcessCapabilities::HandleDebugFlags(u32 flags) {
385 385
386 is_debuggable = (flags & 0x20000) != 0; 386 is_debuggable = (flags & 0x20000) != 0;
387 can_force_debug = (flags & 0x40000) != 0; 387 can_force_debug = (flags & 0x40000) != 0;
388 return RESULT_SUCCESS; 388 return ResultSuccess;
389} 389}
390 390
391} // namespace Kernel 391} // namespace Kernel
diff --git a/src/core/hle/kernel/process_capability.h b/src/core/hle/kernel/process_capability.h
index 2a7bf5505..a9b44325b 100644
--- a/src/core/hle/kernel/process_capability.h
+++ b/src/core/hle/kernel/process_capability.h
@@ -84,7 +84,7 @@ public:
84 /// @param page_table The memory manager to use for handling any mapping-related 84 /// @param page_table The memory manager to use for handling any mapping-related
85 /// operations (such as mapping IO memory, etc). 85 /// operations (such as mapping IO memory, etc).
86 /// 86 ///
87 /// @returns RESULT_SUCCESS if this capabilities instance was able to be initialized, 87 /// @returns ResultSuccess if this capabilities instance was able to be initialized,
88 /// otherwise, an error code upon failure. 88 /// otherwise, an error code upon failure.
89 /// 89 ///
90 ResultCode InitializeForKernelProcess(const u32* capabilities, std::size_t num_capabilities, 90 ResultCode InitializeForKernelProcess(const u32* capabilities, std::size_t num_capabilities,
@@ -97,7 +97,7 @@ public:
97 /// @param page_table The memory manager to use for handling any mapping-related 97 /// @param page_table The memory manager to use for handling any mapping-related
98 /// operations (such as mapping IO memory, etc). 98 /// operations (such as mapping IO memory, etc).
99 /// 99 ///
100 /// @returns RESULT_SUCCESS if this capabilities instance was able to be initialized, 100 /// @returns ResultSuccess if this capabilities instance was able to be initialized,
101 /// otherwise, an error code upon failure. 101 /// otherwise, an error code upon failure.
102 /// 102 ///
103 ResultCode InitializeForUserProcess(const u32* capabilities, std::size_t num_capabilities, 103 ResultCode InitializeForUserProcess(const u32* capabilities, std::size_t num_capabilities,
@@ -184,7 +184,7 @@ private:
184 /// @param page_table The memory manager that will perform any memory 184 /// @param page_table The memory manager that will perform any memory
185 /// mapping if necessary. 185 /// mapping if necessary.
186 /// 186 ///
187 /// @return RESULT_SUCCESS if no errors occur, otherwise an error code. 187 /// @return ResultSuccess if no errors occur, otherwise an error code.
188 /// 188 ///
189 ResultCode ParseCapabilities(const u32* capabilities, std::size_t num_capabilities, 189 ResultCode ParseCapabilities(const u32* capabilities, std::size_t num_capabilities,
190 KPageTable& page_table); 190 KPageTable& page_table);
@@ -199,7 +199,7 @@ private:
199 /// @param page_table The memory manager that will perform any memory 199 /// @param page_table The memory manager that will perform any memory
200 /// mapping if necessary. 200 /// mapping if necessary.
201 /// 201 ///
202 /// @return RESULT_SUCCESS if no errors occurred, otherwise an error code. 202 /// @return ResultSuccess if no errors occurred, otherwise an error code.
203 /// 203 ///
204 ResultCode ParseSingleFlagCapability(u32& set_flags, u32& set_svc_bits, u32 flag, 204 ResultCode ParseSingleFlagCapability(u32& set_flags, u32& set_svc_bits, u32 flag,
205 KPageTable& page_table); 205 KPageTable& page_table);
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index 81e23f700..28bcae6e7 100644
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -132,7 +132,7 @@ ResultCode MapUnmapMemorySanityChecks(const KPageTable& manager, VAddr dst_addr,
132 return ResultInvalidMemoryRegion; 132 return ResultInvalidMemoryRegion;
133 } 133 }
134 134
135 return RESULT_SUCCESS; 135 return ResultSuccess;
136} 136}
137 137
138enum class ResourceLimitValueType { 138enum class ResourceLimitValueType {
@@ -164,7 +164,7 @@ static ResultCode SetHeapSize(Core::System& system, VAddr* heap_addr, u64 heap_s
164 164
165 CASCADE_RESULT(*heap_addr, page_table.SetHeapSize(heap_size)); 165 CASCADE_RESULT(*heap_addr, page_table.SetHeapSize(heap_size));
166 166
167 return RESULT_SUCCESS; 167 return ResultSuccess;
168} 168}
169 169
170static ResultCode SetHeapSize32(Core::System& system, u32* heap_addr, u32 heap_size) { 170static ResultCode SetHeapSize32(Core::System& system, u32* heap_addr, u32 heap_size) {
@@ -305,7 +305,7 @@ static ResultCode ConnectToNamedPort(Core::System& system, Handle* out, VAddr po
305 305
306 // We succeeded. 306 // We succeeded.
307 handle_guard.Cancel(); 307 handle_guard.Cancel();
308 return RESULT_SUCCESS; 308 return ResultSuccess;
309} 309}
310 310
311static ResultCode ConnectToNamedPort32(Core::System& system, Handle* out_handle, 311static ResultCode ConnectToNamedPort32(Core::System& system, Handle* out_handle,
@@ -349,7 +349,7 @@ static ResultCode GetThreadId(Core::System& system, u64* out_thread_id, Handle t
349 349
350 // Get the thread's id. 350 // Get the thread's id.
351 *out_thread_id = thread->GetId(); 351 *out_thread_id = thread->GetId();
352 return RESULT_SUCCESS; 352 return ResultSuccess;
353} 353}
354 354
355static ResultCode GetThreadId32(Core::System& system, u32* out_thread_id_low, 355static ResultCode GetThreadId32(Core::System& system, u32* out_thread_id_low,
@@ -454,7 +454,7 @@ static ResultCode CancelSynchronization(Core::System& system, Handle handle) {
454 454
455 // Cancel the thread's wait. 455 // Cancel the thread's wait.
456 thread->WaitCancel(); 456 thread->WaitCancel();
457 return RESULT_SUCCESS; 457 return ResultSuccess;
458} 458}
459 459
460static ResultCode CancelSynchronization32(Core::System& system, Handle handle) { 460static ResultCode CancelSynchronization32(Core::System& system, Handle handle) {
@@ -715,76 +715,76 @@ static ResultCode GetInfo(Core::System& system, u64* result, u64 info_id, Handle
715 switch (info_id_type) { 715 switch (info_id_type) {
716 case GetInfoType::AllowedCPUCoreMask: 716 case GetInfoType::AllowedCPUCoreMask:
717 *result = process->GetCoreMask(); 717 *result = process->GetCoreMask();
718 return RESULT_SUCCESS; 718 return ResultSuccess;
719 719
720 case GetInfoType::AllowedThreadPriorityMask: 720 case GetInfoType::AllowedThreadPriorityMask:
721 *result = process->GetPriorityMask(); 721 *result = process->GetPriorityMask();
722 return RESULT_SUCCESS; 722 return ResultSuccess;
723 723
724 case GetInfoType::MapRegionBaseAddr: 724 case GetInfoType::MapRegionBaseAddr:
725 *result = process->PageTable().GetAliasRegionStart(); 725 *result = process->PageTable().GetAliasRegionStart();
726 return RESULT_SUCCESS; 726 return ResultSuccess;
727 727
728 case GetInfoType::MapRegionSize: 728 case GetInfoType::MapRegionSize:
729 *result = process->PageTable().GetAliasRegionSize(); 729 *result = process->PageTable().GetAliasRegionSize();
730 return RESULT_SUCCESS; 730 return ResultSuccess;
731 731
732 case GetInfoType::HeapRegionBaseAddr: 732 case GetInfoType::HeapRegionBaseAddr:
733 *result = process->PageTable().GetHeapRegionStart(); 733 *result = process->PageTable().GetHeapRegionStart();
734 return RESULT_SUCCESS; 734 return ResultSuccess;
735 735
736 case GetInfoType::HeapRegionSize: 736 case GetInfoType::HeapRegionSize:
737 *result = process->PageTable().GetHeapRegionSize(); 737 *result = process->PageTable().GetHeapRegionSize();
738 return RESULT_SUCCESS; 738 return ResultSuccess;
739 739
740 case GetInfoType::ASLRRegionBaseAddr: 740 case GetInfoType::ASLRRegionBaseAddr:
741 *result = process->PageTable().GetAliasCodeRegionStart(); 741 *result = process->PageTable().GetAliasCodeRegionStart();
742 return RESULT_SUCCESS; 742 return ResultSuccess;
743 743
744 case GetInfoType::ASLRRegionSize: 744 case GetInfoType::ASLRRegionSize:
745 *result = process->PageTable().GetAliasCodeRegionSize(); 745 *result = process->PageTable().GetAliasCodeRegionSize();
746 return RESULT_SUCCESS; 746 return ResultSuccess;
747 747
748 case GetInfoType::StackRegionBaseAddr: 748 case GetInfoType::StackRegionBaseAddr:
749 *result = process->PageTable().GetStackRegionStart(); 749 *result = process->PageTable().GetStackRegionStart();
750 return RESULT_SUCCESS; 750 return ResultSuccess;
751 751
752 case GetInfoType::StackRegionSize: 752 case GetInfoType::StackRegionSize:
753 *result = process->PageTable().GetStackRegionSize(); 753 *result = process->PageTable().GetStackRegionSize();
754 return RESULT_SUCCESS; 754 return ResultSuccess;
755 755
756 case GetInfoType::TotalPhysicalMemoryAvailable: 756 case GetInfoType::TotalPhysicalMemoryAvailable:
757 *result = process->GetTotalPhysicalMemoryAvailable(); 757 *result = process->GetTotalPhysicalMemoryAvailable();
758 return RESULT_SUCCESS; 758 return ResultSuccess;
759 759
760 case GetInfoType::TotalPhysicalMemoryUsed: 760 case GetInfoType::TotalPhysicalMemoryUsed:
761 *result = process->GetTotalPhysicalMemoryUsed(); 761 *result = process->GetTotalPhysicalMemoryUsed();
762 return RESULT_SUCCESS; 762 return ResultSuccess;
763 763
764 case GetInfoType::SystemResourceSize: 764 case GetInfoType::SystemResourceSize:
765 *result = process->GetSystemResourceSize(); 765 *result = process->GetSystemResourceSize();
766 return RESULT_SUCCESS; 766 return ResultSuccess;
767 767
768 case GetInfoType::SystemResourceUsage: 768 case GetInfoType::SystemResourceUsage:
769 LOG_WARNING(Kernel_SVC, "(STUBBED) Attempted to query system resource usage"); 769 LOG_WARNING(Kernel_SVC, "(STUBBED) Attempted to query system resource usage");
770 *result = process->GetSystemResourceUsage(); 770 *result = process->GetSystemResourceUsage();
771 return RESULT_SUCCESS; 771 return ResultSuccess;
772 772
773 case GetInfoType::TitleId: 773 case GetInfoType::TitleId:
774 *result = process->GetTitleID(); 774 *result = process->GetTitleID();
775 return RESULT_SUCCESS; 775 return ResultSuccess;
776 776
777 case GetInfoType::UserExceptionContextAddr: 777 case GetInfoType::UserExceptionContextAddr:
778 *result = process->GetTLSRegionAddress(); 778 *result = process->GetTLSRegionAddress();
779 return RESULT_SUCCESS; 779 return ResultSuccess;
780 780
781 case GetInfoType::TotalPhysicalMemoryAvailableWithoutSystemResource: 781 case GetInfoType::TotalPhysicalMemoryAvailableWithoutSystemResource:
782 *result = process->GetTotalPhysicalMemoryAvailableWithoutSystemResource(); 782 *result = process->GetTotalPhysicalMemoryAvailableWithoutSystemResource();
783 return RESULT_SUCCESS; 783 return ResultSuccess;
784 784
785 case GetInfoType::TotalPhysicalMemoryUsedWithoutSystemResource: 785 case GetInfoType::TotalPhysicalMemoryUsedWithoutSystemResource:
786 *result = process->GetTotalPhysicalMemoryUsedWithoutSystemResource(); 786 *result = process->GetTotalPhysicalMemoryUsedWithoutSystemResource();
787 return RESULT_SUCCESS; 787 return ResultSuccess;
788 788
789 default: 789 default:
790 break; 790 break;
@@ -796,7 +796,7 @@ static ResultCode GetInfo(Core::System& system, u64* result, u64 info_id, Handle
796 796
797 case GetInfoType::IsCurrentProcessBeingDebugged: 797 case GetInfoType::IsCurrentProcessBeingDebugged:
798 *result = 0; 798 *result = 0;
799 return RESULT_SUCCESS; 799 return ResultSuccess;
800 800
801 case GetInfoType::RegisterResourceLimit: { 801 case GetInfoType::RegisterResourceLimit: {
802 if (handle != 0) { 802 if (handle != 0) {
@@ -816,14 +816,14 @@ static ResultCode GetInfo(Core::System& system, u64* result, u64 info_id, Handle
816 if (!resource_limit) { 816 if (!resource_limit) {
817 *result = Svc::InvalidHandle; 817 *result = Svc::InvalidHandle;
818 // Yes, the kernel considers this a successful operation. 818 // Yes, the kernel considers this a successful operation.
819 return RESULT_SUCCESS; 819 return ResultSuccess;
820 } 820 }
821 821
822 Handle resource_handle{}; 822 Handle resource_handle{};
823 R_TRY(handle_table.Add(&resource_handle, resource_limit)); 823 R_TRY(handle_table.Add(&resource_handle, resource_limit));
824 824
825 *result = resource_handle; 825 *result = resource_handle;
826 return RESULT_SUCCESS; 826 return ResultSuccess;
827 } 827 }
828 828
829 case GetInfoType::RandomEntropy: 829 case GetInfoType::RandomEntropy:
@@ -840,13 +840,13 @@ static ResultCode GetInfo(Core::System& system, u64* result, u64 info_id, Handle
840 } 840 }
841 841
842 *result = system.Kernel().CurrentProcess()->GetRandomEntropy(info_sub_id); 842 *result = system.Kernel().CurrentProcess()->GetRandomEntropy(info_sub_id);
843 return RESULT_SUCCESS; 843 return ResultSuccess;
844 844
845 case GetInfoType::PrivilegedProcessId: 845 case GetInfoType::PrivilegedProcessId:
846 LOG_WARNING(Kernel_SVC, 846 LOG_WARNING(Kernel_SVC,
847 "(STUBBED) Attempted to query privileged process id bounds, returned 0"); 847 "(STUBBED) Attempted to query privileged process id bounds, returned 0");
848 *result = 0; 848 *result = 0;
849 return RESULT_SUCCESS; 849 return ResultSuccess;
850 850
851 case GetInfoType::ThreadTickCount: { 851 case GetInfoType::ThreadTickCount: {
852 constexpr u64 num_cpus = 4; 852 constexpr u64 num_cpus = 4;
@@ -881,7 +881,7 @@ static ResultCode GetInfo(Core::System& system, u64* result, u64 info_id, Handle
881 } 881 }
882 882
883 *result = out_ticks; 883 *result = out_ticks;
884 return RESULT_SUCCESS; 884 return ResultSuccess;
885 } 885 }
886 886
887 default: 887 default:
@@ -1034,7 +1034,7 @@ static ResultCode SetThreadActivity(Core::System& system, Handle thread_handle,
1034 // Set the activity. 1034 // Set the activity.
1035 R_TRY(thread->SetActivity(thread_activity)); 1035 R_TRY(thread->SetActivity(thread_activity));
1036 1036
1037 return RESULT_SUCCESS; 1037 return ResultSuccess;
1038} 1038}
1039 1039
1040static ResultCode SetThreadActivity32(Core::System& system, Handle thread_handle, 1040static ResultCode SetThreadActivity32(Core::System& system, Handle thread_handle,
@@ -1094,10 +1094,10 @@ static ResultCode GetThreadContext(Core::System& system, VAddr out_context, Hand
1094 // Copy the thread context to user space. 1094 // Copy the thread context to user space.
1095 system.Memory().WriteBlock(out_context, context.data(), context.size()); 1095 system.Memory().WriteBlock(out_context, context.data(), context.size());
1096 1096
1097 return RESULT_SUCCESS; 1097 return ResultSuccess;
1098 } 1098 }
1099 1099
1100 return RESULT_SUCCESS; 1100 return ResultSuccess;
1101} 1101}
1102 1102
1103static ResultCode GetThreadContext32(Core::System& system, u32 out_context, Handle thread_handle) { 1103static ResultCode GetThreadContext32(Core::System& system, u32 out_context, Handle thread_handle) {
@@ -1115,7 +1115,7 @@ static ResultCode GetThreadPriority(Core::System& system, u32* out_priority, Han
1115 1115
1116 // Get the thread's priority. 1116 // Get the thread's priority.
1117 *out_priority = thread->GetPriority(); 1117 *out_priority = thread->GetPriority();
1118 return RESULT_SUCCESS; 1118 return ResultSuccess;
1119} 1119}
1120 1120
1121static ResultCode GetThreadPriority32(Core::System& system, u32* out_priority, Handle handle) { 1121static ResultCode GetThreadPriority32(Core::System& system, u32* out_priority, Handle handle) {
@@ -1138,7 +1138,7 @@ static ResultCode SetThreadPriority(Core::System& system, Handle thread_handle,
1138 1138
1139 // Set the thread priority. 1139 // Set the thread priority.
1140 thread->SetBasePriority(priority); 1140 thread->SetBasePriority(priority);
1141 return RESULT_SUCCESS; 1141 return ResultSuccess;
1142} 1142}
1143 1143
1144static ResultCode SetThreadPriority32(Core::System& system, Handle thread_handle, u32 priority) { 1144static ResultCode SetThreadPriority32(Core::System& system, Handle thread_handle, u32 priority) {
@@ -1207,7 +1207,7 @@ static ResultCode MapSharedMemory(Core::System& system, Handle shmem_handle, VAd
1207 1207
1208 // We succeeded. 1208 // We succeeded.
1209 guard.Cancel(); 1209 guard.Cancel();
1210 return RESULT_SUCCESS; 1210 return ResultSuccess;
1211} 1211}
1212 1212
1213static ResultCode MapSharedMemory32(Core::System& system, Handle shmem_handle, u32 address, 1213static ResultCode MapSharedMemory32(Core::System& system, Handle shmem_handle, u32 address,
@@ -1240,7 +1240,7 @@ static ResultCode UnmapSharedMemory(Core::System& system, Handle shmem_handle, V
1240 // Remove the shared memory from the process. 1240 // Remove the shared memory from the process.
1241 process.RemoveSharedMemory(shmem.GetPointerUnsafe(), address, size); 1241 process.RemoveSharedMemory(shmem.GetPointerUnsafe(), address, size);
1242 1242
1243 return RESULT_SUCCESS; 1243 return ResultSuccess;
1244} 1244}
1245 1245
1246static ResultCode UnmapSharedMemory32(Core::System& system, Handle shmem_handle, u32 address, 1246static ResultCode UnmapSharedMemory32(Core::System& system, Handle shmem_handle, u32 address,
@@ -1276,7 +1276,7 @@ static ResultCode QueryProcessMemory(Core::System& system, VAddr memory_info_add
1276 // Page info appears to be currently unused by the kernel and is always set to zero. 1276 // Page info appears to be currently unused by the kernel and is always set to zero.
1277 memory.Write32(page_info_address, 0); 1277 memory.Write32(page_info_address, 0);
1278 1278
1279 return RESULT_SUCCESS; 1279 return ResultSuccess;
1280} 1280}
1281 1281
1282static ResultCode QueryMemory(Core::System& system, VAddr memory_info_address, 1282static ResultCode QueryMemory(Core::System& system, VAddr memory_info_address,
@@ -1524,7 +1524,7 @@ static ResultCode CreateThread(Core::System& system, Handle* out_handle, VAddr e
1524 // Add the thread to the handle table. 1524 // Add the thread to the handle table.
1525 R_TRY(process.GetHandleTable().Add(out_handle, thread)); 1525 R_TRY(process.GetHandleTable().Add(out_handle, thread));
1526 1526
1527 return RESULT_SUCCESS; 1527 return ResultSuccess;
1528} 1528}
1529 1529
1530static ResultCode CreateThread32(Core::System& system, Handle* out_handle, u32 priority, 1530static ResultCode CreateThread32(Core::System& system, Handle* out_handle, u32 priority,
@@ -1547,7 +1547,7 @@ static ResultCode StartThread(Core::System& system, Handle thread_handle) {
1547 // If we succeeded, persist a reference to the thread. 1547 // If we succeeded, persist a reference to the thread.
1548 thread->Open(); 1548 thread->Open();
1549 1549
1550 return RESULT_SUCCESS; 1550 return ResultSuccess;
1551} 1551}
1552 1552
1553static ResultCode StartThread32(Core::System& system, Handle thread_handle) { 1553static ResultCode StartThread32(Core::System& system, Handle thread_handle) {
@@ -1796,7 +1796,7 @@ static ResultCode CloseHandle(Core::System& system, Handle handle) {
1796 R_UNLESS(system.Kernel().CurrentProcess()->GetHandleTable().Remove(handle), 1796 R_UNLESS(system.Kernel().CurrentProcess()->GetHandleTable().Remove(handle),
1797 ResultInvalidHandle); 1797 ResultInvalidHandle);
1798 1798
1799 return RESULT_SUCCESS; 1799 return ResultSuccess;
1800} 1800}
1801 1801
1802static ResultCode CloseHandle32(Core::System& system, Handle handle) { 1802static ResultCode CloseHandle32(Core::System& system, Handle handle) {
@@ -1891,7 +1891,7 @@ static ResultCode CreateTransferMemory(Core::System& system, Handle* out, VAddr
1891 // Add the transfer memory to the handle table. 1891 // Add the transfer memory to the handle table.
1892 R_TRY(handle_table.Add(out, trmem)); 1892 R_TRY(handle_table.Add(out, trmem));
1893 1893
1894 return RESULT_SUCCESS; 1894 return ResultSuccess;
1895} 1895}
1896 1896
1897static ResultCode CreateTransferMemory32(Core::System& system, Handle* out, u32 address, u32 size, 1897static ResultCode CreateTransferMemory32(Core::System& system, Handle* out, u32 address, u32 size,
@@ -1911,7 +1911,7 @@ static ResultCode GetThreadCoreMask(Core::System& system, Handle thread_handle,
1911 // Get the core mask. 1911 // Get the core mask.
1912 R_TRY(thread->GetCoreMask(out_core_id, out_affinity_mask)); 1912 R_TRY(thread->GetCoreMask(out_core_id, out_affinity_mask));
1913 1913
1914 return RESULT_SUCCESS; 1914 return ResultSuccess;
1915} 1915}
1916 1916
1917static ResultCode GetThreadCoreMask32(Core::System& system, Handle thread_handle, s32* out_core_id, 1917static ResultCode GetThreadCoreMask32(Core::System& system, Handle thread_handle, s32* out_core_id,
@@ -1952,7 +1952,7 @@ static ResultCode SetThreadCoreMask(Core::System& system, Handle thread_handle,
1952 // Set the core mask. 1952 // Set the core mask.
1953 R_TRY(thread->SetCoreMask(core_id, affinity_mask)); 1953 R_TRY(thread->SetCoreMask(core_id, affinity_mask));
1954 1954
1955 return RESULT_SUCCESS; 1955 return ResultSuccess;
1956} 1956}
1957 1957
1958static ResultCode SetThreadCoreMask32(Core::System& system, Handle thread_handle, s32 core_id, 1958static ResultCode SetThreadCoreMask32(Core::System& system, Handle thread_handle, s32 core_id,
@@ -2051,7 +2051,7 @@ static ResultCode CreateEvent(Core::System& system, Handle* out_write, Handle* o
2051 2051
2052 // We succeeded. 2052 // We succeeded.
2053 handle_guard.Cancel(); 2053 handle_guard.Cancel();
2054 return RESULT_SUCCESS; 2054 return ResultSuccess;
2055} 2055}
2056 2056
2057static ResultCode CreateEvent32(Core::System& system, Handle* out_write, Handle* out_read) { 2057static ResultCode CreateEvent32(Core::System& system, Handle* out_write, Handle* out_read) {
@@ -2081,7 +2081,7 @@ static ResultCode GetProcessInfo(Core::System& system, u64* out, Handle process_
2081 } 2081 }
2082 2082
2083 *out = static_cast<u64>(process->GetStatus()); 2083 *out = static_cast<u64>(process->GetStatus());
2084 return RESULT_SUCCESS; 2084 return ResultSuccess;
2085} 2085}
2086 2086
2087static ResultCode CreateResourceLimit(Core::System& system, Handle* out_handle) { 2087static ResultCode CreateResourceLimit(Core::System& system, Handle* out_handle) {
@@ -2104,7 +2104,7 @@ static ResultCode CreateResourceLimit(Core::System& system, Handle* out_handle)
2104 // Add the limit to the handle table. 2104 // Add the limit to the handle table.
2105 R_TRY(kernel.CurrentProcess()->GetHandleTable().Add(out_handle, resource_limit)); 2105 R_TRY(kernel.CurrentProcess()->GetHandleTable().Add(out_handle, resource_limit));
2106 2106
2107 return RESULT_SUCCESS; 2107 return ResultSuccess;
2108} 2108}
2109 2109
2110static ResultCode GetResourceLimitLimitValue(Core::System& system, u64* out_limit_value, 2110static ResultCode GetResourceLimitLimitValue(Core::System& system, u64* out_limit_value,
@@ -2125,7 +2125,7 @@ static ResultCode GetResourceLimitLimitValue(Core::System& system, u64* out_limi
2125 // Get the limit value. 2125 // Get the limit value.
2126 *out_limit_value = resource_limit->GetLimitValue(which); 2126 *out_limit_value = resource_limit->GetLimitValue(which);
2127 2127
2128 return RESULT_SUCCESS; 2128 return ResultSuccess;
2129} 2129}
2130 2130
2131static ResultCode GetResourceLimitCurrentValue(Core::System& system, u64* out_current_value, 2131static ResultCode GetResourceLimitCurrentValue(Core::System& system, u64* out_current_value,
@@ -2146,7 +2146,7 @@ static ResultCode GetResourceLimitCurrentValue(Core::System& system, u64* out_cu
2146 // Get the current value. 2146 // Get the current value.
2147 *out_current_value = resource_limit->GetCurrentValue(which); 2147 *out_current_value = resource_limit->GetCurrentValue(which);
2148 2148
2149 return RESULT_SUCCESS; 2149 return ResultSuccess;
2150} 2150}
2151 2151
2152static ResultCode SetResourceLimitLimitValue(Core::System& system, Handle resource_limit_handle, 2152static ResultCode SetResourceLimitLimitValue(Core::System& system, Handle resource_limit_handle,
@@ -2166,7 +2166,7 @@ static ResultCode SetResourceLimitLimitValue(Core::System& system, Handle resour
2166 // Set the limit value. 2166 // Set the limit value.
2167 R_TRY(resource_limit->SetLimitValue(which, limit_value)); 2167 R_TRY(resource_limit->SetLimitValue(which, limit_value));
2168 2168
2169 return RESULT_SUCCESS; 2169 return ResultSuccess;
2170} 2170}
2171 2171
2172static ResultCode GetProcessList(Core::System& system, u32* out_num_processes, 2172static ResultCode GetProcessList(Core::System& system, u32* out_num_processes,
@@ -2203,7 +2203,7 @@ static ResultCode GetProcessList(Core::System& system, u32* out_num_processes,
2203 } 2203 }
2204 2204
2205 *out_num_processes = static_cast<u32>(num_processes); 2205 *out_num_processes = static_cast<u32>(num_processes);
2206 return RESULT_SUCCESS; 2206 return ResultSuccess;
2207} 2207}
2208 2208
2209static ResultCode GetThreadList(Core::System& system, u32* out_num_threads, VAddr out_thread_ids, 2209static ResultCode GetThreadList(Core::System& system, u32* out_num_threads, VAddr out_thread_ids,
@@ -2243,7 +2243,7 @@ static ResultCode GetThreadList(Core::System& system, u32* out_num_threads, VAdd
2243 } 2243 }
2244 2244
2245 *out_num_threads = static_cast<u32>(num_threads); 2245 *out_num_threads = static_cast<u32>(num_threads);
2246 return RESULT_SUCCESS; 2246 return ResultSuccess;
2247} 2247}
2248 2248
2249static ResultCode FlushProcessDataCache32([[maybe_unused]] Core::System& system, 2249static ResultCode FlushProcessDataCache32([[maybe_unused]] Core::System& system,
@@ -2253,7 +2253,7 @@ static ResultCode FlushProcessDataCache32([[maybe_unused]] Core::System& system,
2253 // as all emulation is done in the same cache level in host architecture, thus data cache 2253 // as all emulation is done in the same cache level in host architecture, thus data cache
2254 // does not need flushing. 2254 // does not need flushing.
2255 LOG_DEBUG(Kernel_SVC, "called"); 2255 LOG_DEBUG(Kernel_SVC, "called");
2256 return RESULT_SUCCESS; 2256 return ResultSuccess;
2257} 2257}
2258 2258
2259namespace { 2259namespace {
diff --git a/src/core/hle/result.h b/src/core/hle/result.h
index 43968386f..605236552 100644
--- a/src/core/hle/result.h
+++ b/src/core/hle/result.h
@@ -144,7 +144,7 @@ constexpr bool operator!=(const ResultCode& a, const ResultCode& b) {
144// Convenience functions for creating some common kinds of errors: 144// Convenience functions for creating some common kinds of errors:
145 145
146/// The default success `ResultCode`. 146/// The default success `ResultCode`.
147constexpr ResultCode RESULT_SUCCESS(0); 147constexpr ResultCode ResultSuccess(0);
148 148
149/** 149/**
150 * Placeholder result code used for unknown error codes. 150 * Placeholder result code used for unknown error codes.
@@ -152,7 +152,7 @@ constexpr ResultCode RESULT_SUCCESS(0);
152 * @note This should only be used when a particular error code 152 * @note This should only be used when a particular error code
153 * is not known yet. 153 * is not known yet.
154 */ 154 */
155constexpr ResultCode RESULT_UNKNOWN(UINT32_MAX); 155constexpr ResultCode ResultUnknown(UINT32_MAX);
156 156
157/** 157/**
158 * This is an optional value type. It holds a `ResultCode` and, if that code is a success code, 158 * This is an optional value type. It holds a `ResultCode` and, if that code is a success code,
@@ -191,7 +191,7 @@ class ResultVal {
191public: 191public:
192 /// Constructs an empty `ResultVal` with the given error code. The code must not be a success 192 /// Constructs an empty `ResultVal` with the given error code. The code must not be a success
193 /// code. 193 /// code.
194 ResultVal(ResultCode error_code = RESULT_UNKNOWN) : result_code(error_code) { 194 ResultVal(ResultCode error_code = ResultUnknown) : result_code(error_code) {
195 ASSERT(error_code.IsError()); 195 ASSERT(error_code.IsError());
196 } 196 }
197 197
@@ -321,7 +321,7 @@ private:
321 */ 321 */
322template <typename T, typename... Args> 322template <typename T, typename... Args>
323ResultVal<T> MakeResult(Args&&... args) { 323ResultVal<T> MakeResult(Args&&... args) {
324 return ResultVal<T>::WithCode(RESULT_SUCCESS, std::forward<Args>(args)...); 324 return ResultVal<T>::WithCode(ResultSuccess, std::forward<Args>(args)...);
325} 325}
326 326
327/** 327/**
@@ -330,8 +330,7 @@ ResultVal<T> MakeResult(Args&&... args) {
330 */ 330 */
331template <typename Arg> 331template <typename Arg>
332ResultVal<std::remove_reference_t<Arg>> MakeResult(Arg&& arg) { 332ResultVal<std::remove_reference_t<Arg>> MakeResult(Arg&& arg) {
333 return ResultVal<std::remove_reference_t<Arg>>::WithCode(RESULT_SUCCESS, 333 return ResultVal<std::remove_reference_t<Arg>>::WithCode(ResultSuccess, std::forward<Arg>(arg));
334 std::forward<Arg>(arg));
335} 334}
336 335
337/** 336/**
@@ -358,3 +357,28 @@ ResultVal<std::remove_reference_t<Arg>> MakeResult(Arg&& arg) {
358 return CONCAT2(check_result_L, __LINE__); \ 357 return CONCAT2(check_result_L, __LINE__); \
359 } \ 358 } \
360 } while (false) 359 } while (false)
360
361#define R_SUCCEEDED(res) (res.IsSuccess())
362
363/// Evaluates a boolean expression, and succeeds if that expression is true.
364#define R_SUCCEED_IF(expr) R_UNLESS(!(expr), ResultSuccess)
365
366/// Evaluates a boolean expression, and returns a result unless that expression is true.
367#define R_UNLESS(expr, res) \
368 { \
369 if (!(expr)) { \
370 if (res.IsError()) { \
371 LOG_ERROR(Kernel, "Failed with result: {}", res.raw); \
372 } \
373 return res; \
374 } \
375 }
376
377/// Evaluates an expression that returns a result, and returns the result if it would fail.
378#define R_TRY(res_expr) \
379 { \
380 const auto _tmp_r_try_rc = (res_expr); \
381 if (_tmp_r_try_rc.IsError()) { \
382 return _tmp_r_try_rc; \
383 } \
384 }
diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp
index 39cd1efc1..d1c1fb71d 100644
--- a/src/core/hle/service/acc/acc.cpp
+++ b/src/core/hle/service/acc/acc.cpp
@@ -298,13 +298,13 @@ protected:
298 if (profile_manager.GetProfileBaseAndData(user_id, profile_base, data)) { 298 if (profile_manager.GetProfileBaseAndData(user_id, profile_base, data)) {
299 ctx.WriteBuffer(data); 299 ctx.WriteBuffer(data);
300 IPC::ResponseBuilder rb{ctx, 16}; 300 IPC::ResponseBuilder rb{ctx, 16};
301 rb.Push(RESULT_SUCCESS); 301 rb.Push(ResultSuccess);
302 rb.PushRaw(profile_base); 302 rb.PushRaw(profile_base);
303 } else { 303 } else {
304 LOG_ERROR(Service_ACC, "Failed to get profile base and data for user={}", 304 LOG_ERROR(Service_ACC, "Failed to get profile base and data for user={}",
305 user_id.Format()); 305 user_id.Format());
306 IPC::ResponseBuilder rb{ctx, 2}; 306 IPC::ResponseBuilder rb{ctx, 2};
307 rb.Push(RESULT_UNKNOWN); // TODO(ogniK): Get actual error code 307 rb.Push(ResultUnknown); // TODO(ogniK): Get actual error code
308 } 308 }
309 } 309 }
310 310
@@ -313,12 +313,12 @@ protected:
313 ProfileBase profile_base{}; 313 ProfileBase profile_base{};
314 if (profile_manager.GetProfileBase(user_id, profile_base)) { 314 if (profile_manager.GetProfileBase(user_id, profile_base)) {
315 IPC::ResponseBuilder rb{ctx, 16}; 315 IPC::ResponseBuilder rb{ctx, 16};
316 rb.Push(RESULT_SUCCESS); 316 rb.Push(ResultSuccess);
317 rb.PushRaw(profile_base); 317 rb.PushRaw(profile_base);
318 } else { 318 } else {
319 LOG_ERROR(Service_ACC, "Failed to get profile base for user={}", user_id.Format()); 319 LOG_ERROR(Service_ACC, "Failed to get profile base for user={}", user_id.Format());
320 IPC::ResponseBuilder rb{ctx, 2}; 320 IPC::ResponseBuilder rb{ctx, 2};
321 rb.Push(RESULT_UNKNOWN); // TODO(ogniK): Get actual error code 321 rb.Push(ResultUnknown); // TODO(ogniK): Get actual error code
322 } 322 }
323 } 323 }
324 324
@@ -326,7 +326,7 @@ protected:
326 LOG_DEBUG(Service_ACC, "called"); 326 LOG_DEBUG(Service_ACC, "called");
327 327
328 IPC::ResponseBuilder rb{ctx, 3}; 328 IPC::ResponseBuilder rb{ctx, 3};
329 rb.Push(RESULT_SUCCESS); 329 rb.Push(ResultSuccess);
330 330
331 const Common::FS::IOFile image(GetImagePath(user_id), Common::FS::FileAccessMode::Read, 331 const Common::FS::IOFile image(GetImagePath(user_id), Common::FS::FileAccessMode::Read,
332 Common::FS::FileType::BinaryFile); 332 Common::FS::FileType::BinaryFile);
@@ -352,7 +352,7 @@ protected:
352 void GetImageSize(Kernel::HLERequestContext& ctx) { 352 void GetImageSize(Kernel::HLERequestContext& ctx) {
353 LOG_DEBUG(Service_ACC, "called"); 353 LOG_DEBUG(Service_ACC, "called");
354 IPC::ResponseBuilder rb{ctx, 3}; 354 IPC::ResponseBuilder rb{ctx, 3};
355 rb.Push(RESULT_SUCCESS); 355 rb.Push(ResultSuccess);
356 356
357 const Common::FS::IOFile image(GetImagePath(user_id), Common::FS::FileAccessMode::Read, 357 const Common::FS::IOFile image(GetImagePath(user_id), Common::FS::FileAccessMode::Read,
358 Common::FS::FileType::BinaryFile); 358 Common::FS::FileType::BinaryFile);
@@ -395,7 +395,7 @@ protected:
395 } 395 }
396 396
397 IPC::ResponseBuilder rb{ctx, 2}; 397 IPC::ResponseBuilder rb{ctx, 2};
398 rb.Push(RESULT_SUCCESS); 398 rb.Push(ResultSuccess);
399 } 399 }
400 400
401 void StoreWithImage(Kernel::HLERequestContext& ctx) { 401 void StoreWithImage(Kernel::HLERequestContext& ctx) {
@@ -433,7 +433,7 @@ protected:
433 } 433 }
434 434
435 IPC::ResponseBuilder rb{ctx, 2}; 435 IPC::ResponseBuilder rb{ctx, 2};
436 rb.Push(RESULT_SUCCESS); 436 rb.Push(ResultSuccess);
437 } 437 }
438 438
439 ProfileManager& profile_manager; 439 ProfileManager& profile_manager;
@@ -528,7 +528,7 @@ private:
528 void CheckAvailability(Kernel::HLERequestContext& ctx) { 528 void CheckAvailability(Kernel::HLERequestContext& ctx) {
529 LOG_WARNING(Service_ACC, "(STUBBED) called"); 529 LOG_WARNING(Service_ACC, "(STUBBED) called");
530 IPC::ResponseBuilder rb{ctx, 3}; 530 IPC::ResponseBuilder rb{ctx, 3};
531 rb.Push(RESULT_SUCCESS); 531 rb.Push(ResultSuccess);
532 rb.Push(false); // TODO: Check when this is supposed to return true and when not 532 rb.Push(false); // TODO: Check when this is supposed to return true and when not
533 } 533 }
534 534
@@ -536,7 +536,7 @@ private:
536 LOG_DEBUG(Service_ACC, "called"); 536 LOG_DEBUG(Service_ACC, "called");
537 537
538 IPC::ResponseBuilder rb{ctx, 4}; 538 IPC::ResponseBuilder rb{ctx, 4};
539 rb.Push(RESULT_SUCCESS); 539 rb.Push(ResultSuccess);
540 rb.PushRaw<u64>(user_id.GetNintendoID()); 540 rb.PushRaw<u64>(user_id.GetNintendoID());
541 } 541 }
542 542
@@ -552,14 +552,14 @@ private:
552 } 552 }
553 553
554 IPC::ResponseBuilder rb{ctx, 4}; 554 IPC::ResponseBuilder rb{ctx, 4};
555 rb.Push(RESULT_SUCCESS); 555 rb.Push(ResultSuccess);
556 rb.PushRaw<u64>(user_id.GetNintendoID()); 556 rb.PushRaw<u64>(user_id.GetNintendoID());
557 } 557 }
558 558
559 void StoreOpenContext(Kernel::HLERequestContext& ctx) { 559 void StoreOpenContext(Kernel::HLERequestContext& ctx) {
560 LOG_WARNING(Service_ACC, "(STUBBED) called"); 560 LOG_WARNING(Service_ACC, "(STUBBED) called");
561 IPC::ResponseBuilder rb{ctx, 2}; 561 IPC::ResponseBuilder rb{ctx, 2};
562 rb.Push(RESULT_SUCCESS); 562 rb.Push(ResultSuccess);
563 } 563 }
564 564
565 Common::UUID user_id{Common::INVALID_UUID}; 565 Common::UUID user_id{Common::INVALID_UUID};
@@ -655,7 +655,7 @@ public:
655void Module::Interface::GetUserCount(Kernel::HLERequestContext& ctx) { 655void Module::Interface::GetUserCount(Kernel::HLERequestContext& ctx) {
656 LOG_DEBUG(Service_ACC, "called"); 656 LOG_DEBUG(Service_ACC, "called");
657 IPC::ResponseBuilder rb{ctx, 3}; 657 IPC::ResponseBuilder rb{ctx, 3};
658 rb.Push(RESULT_SUCCESS); 658 rb.Push(ResultSuccess);
659 rb.Push<u32>(static_cast<u32>(profile_manager->GetUserCount())); 659 rb.Push<u32>(static_cast<u32>(profile_manager->GetUserCount()));
660} 660}
661 661
@@ -665,7 +665,7 @@ void Module::Interface::GetUserExistence(Kernel::HLERequestContext& ctx) {
665 LOG_DEBUG(Service_ACC, "called user_id={}", user_id.Format()); 665 LOG_DEBUG(Service_ACC, "called user_id={}", user_id.Format());
666 666
667 IPC::ResponseBuilder rb{ctx, 3}; 667 IPC::ResponseBuilder rb{ctx, 3};
668 rb.Push(RESULT_SUCCESS); 668 rb.Push(ResultSuccess);
669 rb.Push(profile_manager->UserExists(user_id)); 669 rb.Push(profile_manager->UserExists(user_id));
670} 670}
671 671
@@ -673,20 +673,20 @@ void Module::Interface::ListAllUsers(Kernel::HLERequestContext& ctx) {
673 LOG_DEBUG(Service_ACC, "called"); 673 LOG_DEBUG(Service_ACC, "called");
674 ctx.WriteBuffer(profile_manager->GetAllUsers()); 674 ctx.WriteBuffer(profile_manager->GetAllUsers());
675 IPC::ResponseBuilder rb{ctx, 2}; 675 IPC::ResponseBuilder rb{ctx, 2};
676 rb.Push(RESULT_SUCCESS); 676 rb.Push(ResultSuccess);
677} 677}
678 678
679void Module::Interface::ListOpenUsers(Kernel::HLERequestContext& ctx) { 679void Module::Interface::ListOpenUsers(Kernel::HLERequestContext& ctx) {
680 LOG_DEBUG(Service_ACC, "called"); 680 LOG_DEBUG(Service_ACC, "called");
681 ctx.WriteBuffer(profile_manager->GetOpenUsers()); 681 ctx.WriteBuffer(profile_manager->GetOpenUsers());
682 IPC::ResponseBuilder rb{ctx, 2}; 682 IPC::ResponseBuilder rb{ctx, 2};
683 rb.Push(RESULT_SUCCESS); 683 rb.Push(ResultSuccess);
684} 684}
685 685
686void Module::Interface::GetLastOpenedUser(Kernel::HLERequestContext& ctx) { 686void Module::Interface::GetLastOpenedUser(Kernel::HLERequestContext& ctx) {
687 LOG_DEBUG(Service_ACC, "called"); 687 LOG_DEBUG(Service_ACC, "called");
688 IPC::ResponseBuilder rb{ctx, 6}; 688 IPC::ResponseBuilder rb{ctx, 6};
689 rb.Push(RESULT_SUCCESS); 689 rb.Push(ResultSuccess);
690 rb.PushRaw<Common::UUID>(profile_manager->GetLastOpenedUser()); 690 rb.PushRaw<Common::UUID>(profile_manager->GetLastOpenedUser());
691} 691}
692 692
@@ -696,14 +696,14 @@ void Module::Interface::GetProfile(Kernel::HLERequestContext& ctx) {
696 LOG_DEBUG(Service_ACC, "called user_id={}", user_id.Format()); 696 LOG_DEBUG(Service_ACC, "called user_id={}", user_id.Format());
697 697
698 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 698 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
699 rb.Push(RESULT_SUCCESS); 699 rb.Push(ResultSuccess);
700 rb.PushIpcInterface<IProfile>(system, user_id, *profile_manager); 700 rb.PushIpcInterface<IProfile>(system, user_id, *profile_manager);
701} 701}
702 702
703void Module::Interface::IsUserRegistrationRequestPermitted(Kernel::HLERequestContext& ctx) { 703void Module::Interface::IsUserRegistrationRequestPermitted(Kernel::HLERequestContext& ctx) {
704 LOG_WARNING(Service_ACC, "(STUBBED) called"); 704 LOG_WARNING(Service_ACC, "(STUBBED) called");
705 IPC::ResponseBuilder rb{ctx, 3}; 705 IPC::ResponseBuilder rb{ctx, 3};
706 rb.Push(RESULT_SUCCESS); 706 rb.Push(ResultSuccess);
707 rb.Push(profile_manager->CanSystemRegisterUser()); 707 rb.Push(profile_manager->CanSystemRegisterUser());
708} 708}
709 709
@@ -761,13 +761,13 @@ ResultCode Module::Interface::InitializeApplicationInfoBase() {
761 LOG_WARNING(Service_ACC, "ApplicationInfo init required"); 761 LOG_WARNING(Service_ACC, "ApplicationInfo init required");
762 // TODO(ogniK): Actual initalization here 762 // TODO(ogniK): Actual initalization here
763 763
764 return RESULT_SUCCESS; 764 return ResultSuccess;
765} 765}
766 766
767void Module::Interface::GetBaasAccountManagerForApplication(Kernel::HLERequestContext& ctx) { 767void Module::Interface::GetBaasAccountManagerForApplication(Kernel::HLERequestContext& ctx) {
768 LOG_DEBUG(Service_ACC, "called"); 768 LOG_DEBUG(Service_ACC, "called");
769 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 769 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
770 rb.Push(RESULT_SUCCESS); 770 rb.Push(ResultSuccess);
771 rb.PushIpcInterface<IManagerForApplication>(system, profile_manager->GetLastOpenedUser()); 771 rb.PushIpcInterface<IManagerForApplication>(system, profile_manager->GetLastOpenedUser());
772} 772}
773 773
@@ -794,7 +794,7 @@ void Module::Interface::IsUserAccountSwitchLocked(Kernel::HLERequestContext& ctx
794 } 794 }
795 795
796 IPC::ResponseBuilder rb{ctx, 3}; 796 IPC::ResponseBuilder rb{ctx, 3};
797 rb.Push(RESULT_SUCCESS); 797 rb.Push(ResultSuccess);
798 rb.Push(is_locked); 798 rb.Push(is_locked);
799} 799}
800 800
@@ -805,7 +805,7 @@ void Module::Interface::GetProfileEditor(Kernel::HLERequestContext& ctx) {
805 LOG_DEBUG(Service_ACC, "called, user_id={}", user_id.Format()); 805 LOG_DEBUG(Service_ACC, "called, user_id={}", user_id.Format());
806 806
807 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 807 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
808 rb.Push(RESULT_SUCCESS); 808 rb.Push(ResultSuccess);
809 rb.PushIpcInterface<IProfileEditor>(system, user_id, *profile_manager); 809 rb.PushIpcInterface<IProfileEditor>(system, user_id, *profile_manager);
810} 810}
811 811
@@ -817,7 +817,7 @@ void Module::Interface::ListQualifiedUsers(Kernel::HLERequestContext& ctx) {
817 // the game regardless of parental control settings. 817 // the game regardless of parental control settings.
818 ctx.WriteBuffer(profile_manager->GetAllUsers()); 818 ctx.WriteBuffer(profile_manager->GetAllUsers());
819 IPC::ResponseBuilder rb{ctx, 2}; 819 IPC::ResponseBuilder rb{ctx, 2};
820 rb.Push(RESULT_SUCCESS); 820 rb.Push(ResultSuccess);
821} 821}
822 822
823void Module::Interface::LoadOpenContext(Kernel::HLERequestContext& ctx) { 823void Module::Interface::LoadOpenContext(Kernel::HLERequestContext& ctx) {
@@ -827,7 +827,7 @@ void Module::Interface::LoadOpenContext(Kernel::HLERequestContext& ctx) {
827 // This command is used concurrently with ListOpenContextStoredUsers 827 // This command is used concurrently with ListOpenContextStoredUsers
828 // TODO: Find the differences between this and GetBaasAccountManagerForApplication 828 // TODO: Find the differences between this and GetBaasAccountManagerForApplication
829 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 829 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
830 rb.Push(RESULT_SUCCESS); 830 rb.Push(ResultSuccess);
831 rb.PushIpcInterface<IManagerForApplication>(system, profile_manager->GetLastOpenedUser()); 831 rb.PushIpcInterface<IManagerForApplication>(system, profile_manager->GetLastOpenedUser());
832} 832}
833 833
@@ -837,7 +837,7 @@ void Module::Interface::ListOpenContextStoredUsers(Kernel::HLERequestContext& ct
837 // TODO(ogniK): Handle open contexts 837 // TODO(ogniK): Handle open contexts
838 ctx.WriteBuffer(profile_manager->GetOpenUsers()); 838 ctx.WriteBuffer(profile_manager->GetOpenUsers());
839 IPC::ResponseBuilder rb{ctx, 2}; 839 IPC::ResponseBuilder rb{ctx, 2};
840 rb.Push(RESULT_SUCCESS); 840 rb.Push(ResultSuccess);
841} 841}
842 842
843void Module::Interface::StoreSaveDataThumbnailApplication(Kernel::HLERequestContext& ctx) { 843void Module::Interface::StoreSaveDataThumbnailApplication(Kernel::HLERequestContext& ctx) {
@@ -886,7 +886,7 @@ void Module::Interface::StoreSaveDataThumbnail(Kernel::HLERequestContext& ctx,
886 } 886 }
887 887
888 // TODO(ogniK): Construct save data thumbnail 888 // TODO(ogniK): Construct save data thumbnail
889 rb.Push(RESULT_SUCCESS); 889 rb.Push(ResultSuccess);
890} 890}
891 891
892void Module::Interface::TrySelectUserWithoutInteraction(Kernel::HLERequestContext& ctx) { 892void Module::Interface::TrySelectUserWithoutInteraction(Kernel::HLERequestContext& ctx) {
@@ -895,7 +895,7 @@ void Module::Interface::TrySelectUserWithoutInteraction(Kernel::HLERequestContex
895 // access to use the network or not by the looks of it 895 // access to use the network or not by the looks of it
896 IPC::ResponseBuilder rb{ctx, 6}; 896 IPC::ResponseBuilder rb{ctx, 6};
897 if (profile_manager->GetUserCount() != 1) { 897 if (profile_manager->GetUserCount() != 1) {
898 rb.Push(RESULT_SUCCESS); 898 rb.Push(ResultSuccess);
899 rb.PushRaw<u128>(Common::INVALID_UUID); 899 rb.PushRaw<u128>(Common::INVALID_UUID);
900 return; 900 return;
901 } 901 }
@@ -903,13 +903,13 @@ void Module::Interface::TrySelectUserWithoutInteraction(Kernel::HLERequestContex
903 const auto user_list = profile_manager->GetAllUsers(); 903 const auto user_list = profile_manager->GetAllUsers();
904 if (std::all_of(user_list.begin(), user_list.end(), 904 if (std::all_of(user_list.begin(), user_list.end(),
905 [](const auto& user) { return user.uuid == Common::INVALID_UUID; })) { 905 [](const auto& user) { return user.uuid == Common::INVALID_UUID; })) {
906 rb.Push(RESULT_UNKNOWN); // TODO(ogniK): Find the correct error code 906 rb.Push(ResultUnknown); // TODO(ogniK): Find the correct error code
907 rb.PushRaw<u128>(Common::INVALID_UUID); 907 rb.PushRaw<u128>(Common::INVALID_UUID);
908 return; 908 return;
909 } 909 }
910 910
911 // Select the first user we have 911 // Select the first user we have
912 rb.Push(RESULT_SUCCESS); 912 rb.Push(ResultSuccess);
913 rb.PushRaw<u128>(profile_manager->GetUser(0)->uuid); 913 rb.PushRaw<u128>(profile_manager->GetUser(0)->uuid);
914} 914}
915 915
diff --git a/src/core/hle/service/acc/profile_manager.cpp b/src/core/hle/service/acc/profile_manager.cpp
index 77510489c..f72d5d561 100644
--- a/src/core/hle/service/acc/profile_manager.cpp
+++ b/src/core/hle/service/acc/profile_manager.cpp
@@ -91,7 +91,7 @@ ResultCode ProfileManager::AddUser(const ProfileInfo& user) {
91 if (!AddToProfiles(user)) { 91 if (!AddToProfiles(user)) {
92 return ERROR_TOO_MANY_USERS; 92 return ERROR_TOO_MANY_USERS;
93 } 93 }
94 return RESULT_SUCCESS; 94 return ResultSuccess;
95} 95}
96 96
97/// Create a new user on the system. If the uuid of the user already exists, the user is not 97/// Create a new user on the system. If the uuid of the user already exists, the user is not
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index 234173297..b578153d3 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -91,14 +91,14 @@ void IWindowController::GetAppletResourceUserId(Kernel::HLERequestContext& ctx)
91 LOG_DEBUG(Service_AM, "called. Process ID=0x{:016X}", process_id); 91 LOG_DEBUG(Service_AM, "called. Process ID=0x{:016X}", process_id);
92 92
93 IPC::ResponseBuilder rb{ctx, 4}; 93 IPC::ResponseBuilder rb{ctx, 4};
94 rb.Push(RESULT_SUCCESS); 94 rb.Push(ResultSuccess);
95 rb.Push<u64>(process_id); 95 rb.Push<u64>(process_id);
96} 96}
97 97
98void IWindowController::AcquireForegroundRights(Kernel::HLERequestContext& ctx) { 98void IWindowController::AcquireForegroundRights(Kernel::HLERequestContext& ctx) {
99 LOG_WARNING(Service_AM, "(STUBBED) called"); 99 LOG_WARNING(Service_AM, "(STUBBED) called");
100 IPC::ResponseBuilder rb{ctx, 2}; 100 IPC::ResponseBuilder rb{ctx, 2};
101 rb.Push(RESULT_SUCCESS); 101 rb.Push(ResultSuccess);
102} 102}
103 103
104IAudioController::IAudioController(Core::System& system_) 104IAudioController::IAudioController(Core::System& system_)
@@ -132,20 +132,20 @@ void IAudioController::SetExpectedMasterVolume(Kernel::HLERequestContext& ctx) {
132 std::clamp(library_applet_volume_tmp, min_allowed_volume, max_allowed_volume); 132 std::clamp(library_applet_volume_tmp, min_allowed_volume, max_allowed_volume);
133 133
134 IPC::ResponseBuilder rb{ctx, 2}; 134 IPC::ResponseBuilder rb{ctx, 2};
135 rb.Push(RESULT_SUCCESS); 135 rb.Push(ResultSuccess);
136} 136}
137 137
138void IAudioController::GetMainAppletExpectedMasterVolume(Kernel::HLERequestContext& ctx) { 138void IAudioController::GetMainAppletExpectedMasterVolume(Kernel::HLERequestContext& ctx) {
139 LOG_DEBUG(Service_AM, "called. main_applet_volume={}", main_applet_volume); 139 LOG_DEBUG(Service_AM, "called. main_applet_volume={}", main_applet_volume);
140 IPC::ResponseBuilder rb{ctx, 3}; 140 IPC::ResponseBuilder rb{ctx, 3};
141 rb.Push(RESULT_SUCCESS); 141 rb.Push(ResultSuccess);
142 rb.Push(main_applet_volume); 142 rb.Push(main_applet_volume);
143} 143}
144 144
145void IAudioController::GetLibraryAppletExpectedMasterVolume(Kernel::HLERequestContext& ctx) { 145void IAudioController::GetLibraryAppletExpectedMasterVolume(Kernel::HLERequestContext& ctx) {
146 LOG_DEBUG(Service_AM, "called. library_applet_volume={}", library_applet_volume); 146 LOG_DEBUG(Service_AM, "called. library_applet_volume={}", library_applet_volume);
147 IPC::ResponseBuilder rb{ctx, 3}; 147 IPC::ResponseBuilder rb{ctx, 3};
148 rb.Push(RESULT_SUCCESS); 148 rb.Push(ResultSuccess);
149 rb.Push(library_applet_volume); 149 rb.Push(library_applet_volume);
150} 150}
151 151
@@ -166,7 +166,7 @@ void IAudioController::ChangeMainAppletMasterVolume(Kernel::HLERequestContext& c
166 fade_time_ns = std::chrono::nanoseconds{parameters.fade_time_ns}; 166 fade_time_ns = std::chrono::nanoseconds{parameters.fade_time_ns};
167 167
168 IPC::ResponseBuilder rb{ctx, 2}; 168 IPC::ResponseBuilder rb{ctx, 2};
169 rb.Push(RESULT_SUCCESS); 169 rb.Push(ResultSuccess);
170} 170}
171 171
172void IAudioController::SetTransparentAudioRate(Kernel::HLERequestContext& ctx) { 172void IAudioController::SetTransparentAudioRate(Kernel::HLERequestContext& ctx) {
@@ -180,7 +180,7 @@ void IAudioController::SetTransparentAudioRate(Kernel::HLERequestContext& ctx) {
180 std::clamp(transparent_volume_rate_tmp, min_allowed_volume, max_allowed_volume); 180 std::clamp(transparent_volume_rate_tmp, min_allowed_volume, max_allowed_volume);
181 181
182 IPC::ResponseBuilder rb{ctx, 2}; 182 IPC::ResponseBuilder rb{ctx, 2};
183 rb.Push(RESULT_SUCCESS); 183 rb.Push(ResultSuccess);
184} 184}
185 185
186IDisplayController::IDisplayController(Core::System& system_) 186IDisplayController::IDisplayController(Core::System& system_)
@@ -332,7 +332,7 @@ void ISelfController::Exit(Kernel::HLERequestContext& ctx) {
332 system.Shutdown(); 332 system.Shutdown();
333 333
334 IPC::ResponseBuilder rb{ctx, 2}; 334 IPC::ResponseBuilder rb{ctx, 2};
335 rb.Push(RESULT_SUCCESS); 335 rb.Push(ResultSuccess);
336} 336}
337 337
338void ISelfController::LockExit(Kernel::HLERequestContext& ctx) { 338void ISelfController::LockExit(Kernel::HLERequestContext& ctx) {
@@ -341,7 +341,7 @@ void ISelfController::LockExit(Kernel::HLERequestContext& ctx) {
341 system.SetExitLock(true); 341 system.SetExitLock(true);
342 342
343 IPC::ResponseBuilder rb{ctx, 2}; 343 IPC::ResponseBuilder rb{ctx, 2};
344 rb.Push(RESULT_SUCCESS); 344 rb.Push(ResultSuccess);
345} 345}
346 346
347void ISelfController::UnlockExit(Kernel::HLERequestContext& ctx) { 347void ISelfController::UnlockExit(Kernel::HLERequestContext& ctx) {
@@ -350,7 +350,7 @@ void ISelfController::UnlockExit(Kernel::HLERequestContext& ctx) {
350 system.SetExitLock(false); 350 system.SetExitLock(false);
351 351
352 IPC::ResponseBuilder rb{ctx, 2}; 352 IPC::ResponseBuilder rb{ctx, 2};
353 rb.Push(RESULT_SUCCESS); 353 rb.Push(ResultSuccess);
354} 354}
355 355
356void ISelfController::EnterFatalSection(Kernel::HLERequestContext& ctx) { 356void ISelfController::EnterFatalSection(Kernel::HLERequestContext& ctx) {
@@ -358,7 +358,7 @@ void ISelfController::EnterFatalSection(Kernel::HLERequestContext& ctx) {
358 LOG_DEBUG(Service_AM, "called. Num fatal sections entered: {}", num_fatal_sections_entered); 358 LOG_DEBUG(Service_AM, "called. Num fatal sections entered: {}", num_fatal_sections_entered);
359 359
360 IPC::ResponseBuilder rb{ctx, 2}; 360 IPC::ResponseBuilder rb{ctx, 2};
361 rb.Push(RESULT_SUCCESS); 361 rb.Push(ResultSuccess);
362} 362}
363 363
364void ISelfController::LeaveFatalSection(Kernel::HLERequestContext& ctx) { 364void ISelfController::LeaveFatalSection(Kernel::HLERequestContext& ctx) {
@@ -374,7 +374,7 @@ void ISelfController::LeaveFatalSection(Kernel::HLERequestContext& ctx) {
374 --num_fatal_sections_entered; 374 --num_fatal_sections_entered;
375 375
376 IPC::ResponseBuilder rb{ctx, 2}; 376 IPC::ResponseBuilder rb{ctx, 2};
377 rb.Push(RESULT_SUCCESS); 377 rb.Push(ResultSuccess);
378} 378}
379 379
380void ISelfController::GetLibraryAppletLaunchableEvent(Kernel::HLERequestContext& ctx) { 380void ISelfController::GetLibraryAppletLaunchableEvent(Kernel::HLERequestContext& ctx) {
@@ -383,7 +383,7 @@ void ISelfController::GetLibraryAppletLaunchableEvent(Kernel::HLERequestContext&
383 launchable_event.GetWritableEvent().Signal(); 383 launchable_event.GetWritableEvent().Signal();
384 384
385 IPC::ResponseBuilder rb{ctx, 2, 1}; 385 IPC::ResponseBuilder rb{ctx, 2, 1};
386 rb.Push(RESULT_SUCCESS); 386 rb.Push(ResultSuccess);
387 rb.PushCopyObjects(launchable_event.GetReadableEvent()); 387 rb.PushCopyObjects(launchable_event.GetReadableEvent());
388} 388}
389 389
@@ -395,7 +395,7 @@ void ISelfController::SetScreenShotPermission(Kernel::HLERequestContext& ctx) {
395 screenshot_permission = permission; 395 screenshot_permission = permission;
396 396
397 IPC::ResponseBuilder rb{ctx, 2}; 397 IPC::ResponseBuilder rb{ctx, 2};
398 rb.Push(RESULT_SUCCESS); 398 rb.Push(ResultSuccess);
399} 399}
400 400
401void ISelfController::SetOperationModeChangedNotification(Kernel::HLERequestContext& ctx) { 401void ISelfController::SetOperationModeChangedNotification(Kernel::HLERequestContext& ctx) {
@@ -405,7 +405,7 @@ void ISelfController::SetOperationModeChangedNotification(Kernel::HLERequestCont
405 LOG_WARNING(Service_AM, "(STUBBED) called flag={}", flag); 405 LOG_WARNING(Service_AM, "(STUBBED) called flag={}", flag);
406 406
407 IPC::ResponseBuilder rb{ctx, 2}; 407 IPC::ResponseBuilder rb{ctx, 2};
408 rb.Push(RESULT_SUCCESS); 408 rb.Push(ResultSuccess);
409} 409}
410 410
411void ISelfController::SetPerformanceModeChangedNotification(Kernel::HLERequestContext& ctx) { 411void ISelfController::SetPerformanceModeChangedNotification(Kernel::HLERequestContext& ctx) {
@@ -415,7 +415,7 @@ void ISelfController::SetPerformanceModeChangedNotification(Kernel::HLERequestCo
415 LOG_WARNING(Service_AM, "(STUBBED) called flag={}", flag); 415 LOG_WARNING(Service_AM, "(STUBBED) called flag={}", flag);
416 416
417 IPC::ResponseBuilder rb{ctx, 2}; 417 IPC::ResponseBuilder rb{ctx, 2};
418 rb.Push(RESULT_SUCCESS); 418 rb.Push(ResultSuccess);
419} 419}
420 420
421void ISelfController::SetFocusHandlingMode(Kernel::HLERequestContext& ctx) { 421void ISelfController::SetFocusHandlingMode(Kernel::HLERequestContext& ctx) {
@@ -434,14 +434,14 @@ void ISelfController::SetFocusHandlingMode(Kernel::HLERequestContext& ctx) {
434 flags.unknown0, flags.unknown1, flags.unknown2); 434 flags.unknown0, flags.unknown1, flags.unknown2);
435 435
436 IPC::ResponseBuilder rb{ctx, 2}; 436 IPC::ResponseBuilder rb{ctx, 2};
437 rb.Push(RESULT_SUCCESS); 437 rb.Push(ResultSuccess);
438} 438}
439 439
440void ISelfController::SetRestartMessageEnabled(Kernel::HLERequestContext& ctx) { 440void ISelfController::SetRestartMessageEnabled(Kernel::HLERequestContext& ctx) {
441 LOG_WARNING(Service_AM, "(STUBBED) called"); 441 LOG_WARNING(Service_AM, "(STUBBED) called");
442 442
443 IPC::ResponseBuilder rb{ctx, 2}; 443 IPC::ResponseBuilder rb{ctx, 2};
444 rb.Push(RESULT_SUCCESS); 444 rb.Push(ResultSuccess);
445} 445}
446 446
447void ISelfController::SetOutOfFocusSuspendingEnabled(Kernel::HLERequestContext& ctx) { 447void ISelfController::SetOutOfFocusSuspendingEnabled(Kernel::HLERequestContext& ctx) {
@@ -453,14 +453,14 @@ void ISelfController::SetOutOfFocusSuspendingEnabled(Kernel::HLERequestContext&
453 LOG_WARNING(Service_AM, "(STUBBED) called enabled={}", enabled); 453 LOG_WARNING(Service_AM, "(STUBBED) called enabled={}", enabled);
454 454
455 IPC::ResponseBuilder rb{ctx, 2}; 455 IPC::ResponseBuilder rb{ctx, 2};
456 rb.Push(RESULT_SUCCESS); 456 rb.Push(ResultSuccess);
457} 457}
458 458
459void ISelfController::SetAlbumImageOrientation(Kernel::HLERequestContext& ctx) { 459void ISelfController::SetAlbumImageOrientation(Kernel::HLERequestContext& ctx) {
460 LOG_WARNING(Service_AM, "(STUBBED) called"); 460 LOG_WARNING(Service_AM, "(STUBBED) called");
461 461
462 IPC::ResponseBuilder rb{ctx, 2}; 462 IPC::ResponseBuilder rb{ctx, 2};
463 rb.Push(RESULT_SUCCESS); 463 rb.Push(ResultSuccess);
464} 464}
465 465
466void ISelfController::CreateManagedDisplayLayer(Kernel::HLERequestContext& ctx) { 466void ISelfController::CreateManagedDisplayLayer(Kernel::HLERequestContext& ctx) {
@@ -472,7 +472,7 @@ void ISelfController::CreateManagedDisplayLayer(Kernel::HLERequestContext& ctx)
472 const auto layer_id = nvflinger.CreateLayer(*display_id); 472 const auto layer_id = nvflinger.CreateLayer(*display_id);
473 473
474 IPC::ResponseBuilder rb{ctx, 4}; 474 IPC::ResponseBuilder rb{ctx, 4};
475 rb.Push(RESULT_SUCCESS); 475 rb.Push(ResultSuccess);
476 rb.Push(*layer_id); 476 rb.Push(*layer_id);
477} 477}
478 478
@@ -490,7 +490,7 @@ void ISelfController::CreateManagedDisplaySeparableLayer(Kernel::HLERequestConte
490 const auto layer_id = nvflinger.CreateLayer(*display_id); 490 const auto layer_id = nvflinger.CreateLayer(*display_id);
491 491
492 IPC::ResponseBuilder rb{ctx, 4}; 492 IPC::ResponseBuilder rb{ctx, 4};
493 rb.Push(RESULT_SUCCESS); 493 rb.Push(ResultSuccess);
494 rb.Push(*layer_id); 494 rb.Push(*layer_id);
495} 495}
496 496
@@ -498,7 +498,7 @@ void ISelfController::SetHandlesRequestToDisplay(Kernel::HLERequestContext& ctx)
498 LOG_WARNING(Service_AM, "(STUBBED) called"); 498 LOG_WARNING(Service_AM, "(STUBBED) called");
499 499
500 IPC::ResponseBuilder rb{ctx, 2}; 500 IPC::ResponseBuilder rb{ctx, 2};
501 rb.Push(RESULT_SUCCESS); 501 rb.Push(ResultSuccess);
502} 502}
503 503
504void ISelfController::SetIdleTimeDetectionExtension(Kernel::HLERequestContext& ctx) { 504void ISelfController::SetIdleTimeDetectionExtension(Kernel::HLERequestContext& ctx) {
@@ -508,14 +508,14 @@ void ISelfController::SetIdleTimeDetectionExtension(Kernel::HLERequestContext& c
508 idle_time_detection_extension); 508 idle_time_detection_extension);
509 509
510 IPC::ResponseBuilder rb{ctx, 2}; 510 IPC::ResponseBuilder rb{ctx, 2};
511 rb.Push(RESULT_SUCCESS); 511 rb.Push(ResultSuccess);
512} 512}
513 513
514void ISelfController::GetIdleTimeDetectionExtension(Kernel::HLERequestContext& ctx) { 514void ISelfController::GetIdleTimeDetectionExtension(Kernel::HLERequestContext& ctx) {
515 LOG_WARNING(Service_AM, "(STUBBED) called"); 515 LOG_WARNING(Service_AM, "(STUBBED) called");
516 516
517 IPC::ResponseBuilder rb{ctx, 3}; 517 IPC::ResponseBuilder rb{ctx, 3};
518 rb.Push(RESULT_SUCCESS); 518 rb.Push(ResultSuccess);
519 rb.Push<u32>(idle_time_detection_extension); 519 rb.Push<u32>(idle_time_detection_extension);
520} 520}
521 521
@@ -536,14 +536,14 @@ void ISelfController::SetAutoSleepDisabled(Kernel::HLERequestContext& ctx) {
536 LOG_DEBUG(Service_AM, "called. is_auto_sleep_disabled={}", is_auto_sleep_disabled); 536 LOG_DEBUG(Service_AM, "called. is_auto_sleep_disabled={}", is_auto_sleep_disabled);
537 537
538 IPC::ResponseBuilder rb{ctx, 2}; 538 IPC::ResponseBuilder rb{ctx, 2};
539 rb.Push(RESULT_SUCCESS); 539 rb.Push(ResultSuccess);
540} 540}
541 541
542void ISelfController::IsAutoSleepDisabled(Kernel::HLERequestContext& ctx) { 542void ISelfController::IsAutoSleepDisabled(Kernel::HLERequestContext& ctx) {
543 LOG_DEBUG(Service_AM, "called."); 543 LOG_DEBUG(Service_AM, "called.");
544 544
545 IPC::ResponseBuilder rb{ctx, 3}; 545 IPC::ResponseBuilder rb{ctx, 3};
546 rb.Push(RESULT_SUCCESS); 546 rb.Push(ResultSuccess);
547 rb.Push(is_auto_sleep_disabled); 547 rb.Push(is_auto_sleep_disabled);
548} 548}
549 549
@@ -554,7 +554,7 @@ void ISelfController::GetAccumulatedSuspendedTickValue(Kernel::HLERequestContext
554 // where the game was suspended. Since Yuzu doesn't implement game suspension, this command 554 // where the game was suspended. Since Yuzu doesn't implement game suspension, this command
555 // can just always return 0 ticks. 555 // can just always return 0 ticks.
556 IPC::ResponseBuilder rb{ctx, 4}; 556 IPC::ResponseBuilder rb{ctx, 4};
557 rb.Push(RESULT_SUCCESS); 557 rb.Push(ResultSuccess);
558 rb.Push<u64>(0); 558 rb.Push<u64>(0);
559} 559}
560 560
@@ -562,7 +562,7 @@ void ISelfController::GetAccumulatedSuspendedTickChangedEvent(Kernel::HLERequest
562 LOG_DEBUG(Service_AM, "called."); 562 LOG_DEBUG(Service_AM, "called.");
563 563
564 IPC::ResponseBuilder rb{ctx, 2, 1}; 564 IPC::ResponseBuilder rb{ctx, 2, 1};
565 rb.Push(RESULT_SUCCESS); 565 rb.Push(ResultSuccess);
566 rb.PushCopyObjects(accumulated_suspended_tick_changed_event.GetReadableEvent()); 566 rb.PushCopyObjects(accumulated_suspended_tick_changed_event.GetReadableEvent());
567} 567}
568 568
@@ -578,7 +578,7 @@ void ISelfController::SetAlbumImageTakenNotificationEnabled(Kernel::HLERequestCo
578 album_image_taken_notification_enabled); 578 album_image_taken_notification_enabled);
579 579
580 IPC::ResponseBuilder rb{ctx, 2}; 580 IPC::ResponseBuilder rb{ctx, 2};
581 rb.Push(RESULT_SUCCESS); 581 rb.Push(ResultSuccess);
582} 582}
583 583
584AppletMessageQueue::AppletMessageQueue(Kernel::KernelCore& kernel) 584AppletMessageQueue::AppletMessageQueue(Kernel::KernelCore& kernel)
@@ -704,7 +704,7 @@ void ICommonStateGetter::GetBootMode(Kernel::HLERequestContext& ctx) {
704 LOG_DEBUG(Service_AM, "called"); 704 LOG_DEBUG(Service_AM, "called");
705 705
706 IPC::ResponseBuilder rb{ctx, 3}; 706 IPC::ResponseBuilder rb{ctx, 3};
707 rb.Push(RESULT_SUCCESS); 707 rb.Push(ResultSuccess);
708 rb.Push<u8>(static_cast<u8>(Service::PM::SystemBootMode::Normal)); // Normal boot mode 708 rb.Push<u8>(static_cast<u8>(Service::PM::SystemBootMode::Normal)); // Normal boot mode
709} 709}
710 710
@@ -712,7 +712,7 @@ void ICommonStateGetter::GetEventHandle(Kernel::HLERequestContext& ctx) {
712 LOG_DEBUG(Service_AM, "called"); 712 LOG_DEBUG(Service_AM, "called");
713 713
714 IPC::ResponseBuilder rb{ctx, 2, 1}; 714 IPC::ResponseBuilder rb{ctx, 2, 1};
715 rb.Push(RESULT_SUCCESS); 715 rb.Push(ResultSuccess);
716 rb.PushCopyObjects(msg_queue->GetMessageReceiveEvent()); 716 rb.PushCopyObjects(msg_queue->GetMessageReceiveEvent());
717} 717}
718 718
@@ -729,7 +729,7 @@ void ICommonStateGetter::ReceiveMessage(Kernel::HLERequestContext& ctx) {
729 return; 729 return;
730 } 730 }
731 731
732 rb.Push(RESULT_SUCCESS); 732 rb.Push(ResultSuccess);
733 rb.PushEnum<AppletMessageQueue::AppletMessage>(message); 733 rb.PushEnum<AppletMessageQueue::AppletMessage>(message);
734} 734}
735 735
@@ -737,7 +737,7 @@ void ICommonStateGetter::GetCurrentFocusState(Kernel::HLERequestContext& ctx) {
737 LOG_WARNING(Service_AM, "(STUBBED) called"); 737 LOG_WARNING(Service_AM, "(STUBBED) called");
738 738
739 IPC::ResponseBuilder rb{ctx, 3}; 739 IPC::ResponseBuilder rb{ctx, 3};
740 rb.Push(RESULT_SUCCESS); 740 rb.Push(ResultSuccess);
741 rb.Push(static_cast<u8>(FocusState::InFocus)); 741 rb.Push(static_cast<u8>(FocusState::InFocus));
742} 742}
743 743
@@ -745,7 +745,7 @@ void ICommonStateGetter::IsVrModeEnabled(Kernel::HLERequestContext& ctx) {
745 LOG_DEBUG(Service_AM, "called"); 745 LOG_DEBUG(Service_AM, "called");
746 746
747 IPC::ResponseBuilder rb{ctx, 3}; 747 IPC::ResponseBuilder rb{ctx, 3};
748 rb.Push(RESULT_SUCCESS); 748 rb.Push(ResultSuccess);
749 rb.Push(vr_mode_state); 749 rb.Push(vr_mode_state);
750} 750}
751 751
@@ -756,7 +756,7 @@ void ICommonStateGetter::SetVrModeEnabled(Kernel::HLERequestContext& ctx) {
756 LOG_WARNING(Service_AM, "VR Mode is {}", vr_mode_state ? "on" : "off"); 756 LOG_WARNING(Service_AM, "VR Mode is {}", vr_mode_state ? "on" : "off");
757 757
758 IPC::ResponseBuilder rb{ctx, 2}; 758 IPC::ResponseBuilder rb{ctx, 2};
759 rb.Push(RESULT_SUCCESS); 759 rb.Push(ResultSuccess);
760} 760}
761 761
762void ICommonStateGetter::SetLcdBacklighOffEnabled(Kernel::HLERequestContext& ctx) { 762void ICommonStateGetter::SetLcdBacklighOffEnabled(Kernel::HLERequestContext& ctx) {
@@ -767,28 +767,28 @@ void ICommonStateGetter::SetLcdBacklighOffEnabled(Kernel::HLERequestContext& ctx
767 is_lcd_backlight_off_enabled); 767 is_lcd_backlight_off_enabled);
768 768
769 IPC::ResponseBuilder rb{ctx, 2}; 769 IPC::ResponseBuilder rb{ctx, 2};
770 rb.Push(RESULT_SUCCESS); 770 rb.Push(ResultSuccess);
771} 771}
772 772
773void ICommonStateGetter::BeginVrModeEx(Kernel::HLERequestContext& ctx) { 773void ICommonStateGetter::BeginVrModeEx(Kernel::HLERequestContext& ctx) {
774 LOG_WARNING(Service_AM, "(STUBBED) called"); 774 LOG_WARNING(Service_AM, "(STUBBED) called");
775 775
776 IPC::ResponseBuilder rb{ctx, 2}; 776 IPC::ResponseBuilder rb{ctx, 2};
777 rb.Push(RESULT_SUCCESS); 777 rb.Push(ResultSuccess);
778} 778}
779 779
780void ICommonStateGetter::EndVrModeEx(Kernel::HLERequestContext& ctx) { 780void ICommonStateGetter::EndVrModeEx(Kernel::HLERequestContext& ctx) {
781 LOG_WARNING(Service_AM, "(STUBBED) called"); 781 LOG_WARNING(Service_AM, "(STUBBED) called");
782 782
783 IPC::ResponseBuilder rb{ctx, 2}; 783 IPC::ResponseBuilder rb{ctx, 2};
784 rb.Push(RESULT_SUCCESS); 784 rb.Push(ResultSuccess);
785} 785}
786 786
787void ICommonStateGetter::GetDefaultDisplayResolutionChangeEvent(Kernel::HLERequestContext& ctx) { 787void ICommonStateGetter::GetDefaultDisplayResolutionChangeEvent(Kernel::HLERequestContext& ctx) {
788 LOG_DEBUG(Service_AM, "called"); 788 LOG_DEBUG(Service_AM, "called");
789 789
790 IPC::ResponseBuilder rb{ctx, 2, 1}; 790 IPC::ResponseBuilder rb{ctx, 2, 1};
791 rb.Push(RESULT_SUCCESS); 791 rb.Push(ResultSuccess);
792 rb.PushCopyObjects(msg_queue->GetOperationModeChangedEvent()); 792 rb.PushCopyObjects(msg_queue->GetOperationModeChangedEvent());
793} 793}
794 794
@@ -796,7 +796,7 @@ void ICommonStateGetter::GetDefaultDisplayResolution(Kernel::HLERequestContext&
796 LOG_DEBUG(Service_AM, "called"); 796 LOG_DEBUG(Service_AM, "called");
797 797
798 IPC::ResponseBuilder rb{ctx, 4}; 798 IPC::ResponseBuilder rb{ctx, 4};
799 rb.Push(RESULT_SUCCESS); 799 rb.Push(ResultSuccess);
800 800
801 if (Settings::values.use_docked_mode.GetValue()) { 801 if (Settings::values.use_docked_mode.GetValue()) {
802 rb.Push(static_cast<u32>(Service::VI::DisplayResolution::DockedWidth) * 802 rb.Push(static_cast<u32>(Service::VI::DisplayResolution::DockedWidth) *
@@ -826,7 +826,7 @@ void ICommonStateGetter::SetRequestExitToLibraryAppletAtExecuteNextProgramEnable
826 LOG_WARNING(Service_AM, "(STUBBED) called"); 826 LOG_WARNING(Service_AM, "(STUBBED) called");
827 827
828 IPC::ResponseBuilder rb{ctx, 2}; 828 IPC::ResponseBuilder rb{ctx, 2};
829 rb.Push(RESULT_SUCCESS); 829 rb.Push(ResultSuccess);
830} 830}
831 831
832IStorageImpl::~IStorageImpl() = default; 832IStorageImpl::~IStorageImpl() = default;
@@ -875,7 +875,7 @@ void IStorage::Open(Kernel::HLERequestContext& ctx) {
875 875
876 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 876 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
877 877
878 rb.Push(RESULT_SUCCESS); 878 rb.Push(ResultSuccess);
879 rb.PushIpcInterface<IStorageAccessor>(system, *this); 879 rb.PushIpcInterface<IStorageAccessor>(system, *this);
880} 880}
881 881
@@ -884,7 +884,7 @@ void ICommonStateGetter::GetOperationMode(Kernel::HLERequestContext& ctx) {
884 LOG_DEBUG(Service_AM, "called, use_docked_mode={}", use_docked_mode); 884 LOG_DEBUG(Service_AM, "called, use_docked_mode={}", use_docked_mode);
885 885
886 IPC::ResponseBuilder rb{ctx, 3}; 886 IPC::ResponseBuilder rb{ctx, 3};
887 rb.Push(RESULT_SUCCESS); 887 rb.Push(ResultSuccess);
888 rb.Push(static_cast<u8>(use_docked_mode ? OperationMode::Docked : OperationMode::Handheld)); 888 rb.Push(static_cast<u8>(use_docked_mode ? OperationMode::Docked : OperationMode::Handheld));
889} 889}
890 890
@@ -892,7 +892,7 @@ void ICommonStateGetter::GetPerformanceMode(Kernel::HLERequestContext& ctx) {
892 LOG_DEBUG(Service_AM, "called"); 892 LOG_DEBUG(Service_AM, "called");
893 893
894 IPC::ResponseBuilder rb{ctx, 3}; 894 IPC::ResponseBuilder rb{ctx, 3};
895 rb.Push(RESULT_SUCCESS); 895 rb.Push(ResultSuccess);
896 rb.PushEnum(system.GetAPMController().GetCurrentPerformanceMode()); 896 rb.PushEnum(system.GetAPMController().GetCurrentPerformanceMode());
897} 897}
898 898
@@ -932,7 +932,7 @@ private:
932 LOG_DEBUG(Service_AM, "called"); 932 LOG_DEBUG(Service_AM, "called");
933 933
934 IPC::ResponseBuilder rb{ctx, 2, 1}; 934 IPC::ResponseBuilder rb{ctx, 2, 1};
935 rb.Push(RESULT_SUCCESS); 935 rb.Push(ResultSuccess);
936 rb.PushCopyObjects(applet->GetBroker().GetStateChangedEvent()); 936 rb.PushCopyObjects(applet->GetBroker().GetStateChangedEvent());
937 } 937 }
938 938
@@ -940,7 +940,7 @@ private:
940 LOG_DEBUG(Service_AM, "called"); 940 LOG_DEBUG(Service_AM, "called");
941 941
942 IPC::ResponseBuilder rb{ctx, 3}; 942 IPC::ResponseBuilder rb{ctx, 3};
943 rb.Push(RESULT_SUCCESS); 943 rb.Push(ResultSuccess);
944 rb.Push<u32>(applet->TransactionComplete()); 944 rb.Push<u32>(applet->TransactionComplete());
945 } 945 }
946 946
@@ -955,7 +955,7 @@ private:
955 LOG_WARNING(Service_AM, "(STUBBED) called"); 955 LOG_WARNING(Service_AM, "(STUBBED) called");
956 956
957 IPC::ResponseBuilder rb{ctx, 2}; 957 IPC::ResponseBuilder rb{ctx, 2};
958 rb.Push(RESULT_SUCCESS); 958 rb.Push(ResultSuccess);
959 } 959 }
960 960
961 void Start(Kernel::HLERequestContext& ctx) { 961 void Start(Kernel::HLERequestContext& ctx) {
@@ -967,7 +967,7 @@ private:
967 applet->Execute(); 967 applet->Execute();
968 968
969 IPC::ResponseBuilder rb{ctx, 2}; 969 IPC::ResponseBuilder rb{ctx, 2};
970 rb.Push(RESULT_SUCCESS); 970 rb.Push(ResultSuccess);
971 } 971 }
972 972
973 void PushInData(Kernel::HLERequestContext& ctx) { 973 void PushInData(Kernel::HLERequestContext& ctx) {
@@ -977,7 +977,7 @@ private:
977 applet->GetBroker().PushNormalDataFromGame(rp.PopIpcInterface<IStorage>()); 977 applet->GetBroker().PushNormalDataFromGame(rp.PopIpcInterface<IStorage>());
978 978
979 IPC::ResponseBuilder rb{ctx, 2}; 979 IPC::ResponseBuilder rb{ctx, 2};
980 rb.Push(RESULT_SUCCESS); 980 rb.Push(ResultSuccess);
981 } 981 }
982 982
983 void PopOutData(Kernel::HLERequestContext& ctx) { 983 void PopOutData(Kernel::HLERequestContext& ctx) {
@@ -993,7 +993,7 @@ private:
993 } 993 }
994 994
995 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 995 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
996 rb.Push(RESULT_SUCCESS); 996 rb.Push(ResultSuccess);
997 rb.PushIpcInterface<IStorage>(std::move(storage)); 997 rb.PushIpcInterface<IStorage>(std::move(storage));
998 } 998 }
999 999
@@ -1008,7 +1008,7 @@ private:
1008 applet->Execute(); 1008 applet->Execute();
1009 1009
1010 IPC::ResponseBuilder rb{ctx, 2}; 1010 IPC::ResponseBuilder rb{ctx, 2};
1011 rb.Push(RESULT_SUCCESS); 1011 rb.Push(ResultSuccess);
1012 } 1012 }
1013 1013
1014 void PopInteractiveOutData(Kernel::HLERequestContext& ctx) { 1014 void PopInteractiveOutData(Kernel::HLERequestContext& ctx) {
@@ -1024,7 +1024,7 @@ private:
1024 } 1024 }
1025 1025
1026 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 1026 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
1027 rb.Push(RESULT_SUCCESS); 1027 rb.Push(ResultSuccess);
1028 rb.PushIpcInterface<IStorage>(std::move(storage)); 1028 rb.PushIpcInterface<IStorage>(std::move(storage));
1029 } 1029 }
1030 1030
@@ -1032,7 +1032,7 @@ private:
1032 LOG_DEBUG(Service_AM, "called"); 1032 LOG_DEBUG(Service_AM, "called");
1033 1033
1034 IPC::ResponseBuilder rb{ctx, 2, 1}; 1034 IPC::ResponseBuilder rb{ctx, 2, 1};
1035 rb.Push(RESULT_SUCCESS); 1035 rb.Push(ResultSuccess);
1036 rb.PushCopyObjects(applet->GetBroker().GetNormalDataEvent()); 1036 rb.PushCopyObjects(applet->GetBroker().GetNormalDataEvent());
1037 } 1037 }
1038 1038
@@ -1040,7 +1040,7 @@ private:
1040 LOG_DEBUG(Service_AM, "called"); 1040 LOG_DEBUG(Service_AM, "called");
1041 1041
1042 IPC::ResponseBuilder rb{ctx, 2, 1}; 1042 IPC::ResponseBuilder rb{ctx, 2, 1};
1043 rb.Push(RESULT_SUCCESS); 1043 rb.Push(ResultSuccess);
1044 rb.PushCopyObjects(applet->GetBroker().GetInteractiveDataEvent()); 1044 rb.PushCopyObjects(applet->GetBroker().GetInteractiveDataEvent());
1045 } 1045 }
1046 1046
@@ -1052,7 +1052,7 @@ private:
1052 constexpr u64 handle = 0xdeadbeef; 1052 constexpr u64 handle = 0xdeadbeef;
1053 1053
1054 IPC::ResponseBuilder rb{ctx, 4}; 1054 IPC::ResponseBuilder rb{ctx, 4};
1055 rb.Push(RESULT_SUCCESS); 1055 rb.Push(ResultSuccess);
1056 rb.Push(handle); 1056 rb.Push(handle);
1057 } 1057 }
1058 1058
@@ -1079,7 +1079,7 @@ void IStorageAccessor::GetSize(Kernel::HLERequestContext& ctx) {
1079 1079
1080 IPC::ResponseBuilder rb{ctx, 4}; 1080 IPC::ResponseBuilder rb{ctx, 4};
1081 1081
1082 rb.Push(RESULT_SUCCESS); 1082 rb.Push(ResultSuccess);
1083 rb.Push(static_cast<u64>(backing.GetSize())); 1083 rb.Push(static_cast<u64>(backing.GetSize()));
1084} 1084}
1085 1085
@@ -1105,7 +1105,7 @@ void IStorageAccessor::Write(Kernel::HLERequestContext& ctx) {
1105 std::memcpy(backing.GetData().data() + offset, data.data(), size); 1105 std::memcpy(backing.GetData().data() + offset, data.data(), size);
1106 1106
1107 IPC::ResponseBuilder rb{ctx, 2}; 1107 IPC::ResponseBuilder rb{ctx, 2};
1108 rb.Push(RESULT_SUCCESS); 1108 rb.Push(ResultSuccess);
1109} 1109}
1110 1110
1111void IStorageAccessor::Read(Kernel::HLERequestContext& ctx) { 1111void IStorageAccessor::Read(Kernel::HLERequestContext& ctx) {
@@ -1128,7 +1128,7 @@ void IStorageAccessor::Read(Kernel::HLERequestContext& ctx) {
1128 ctx.WriteBuffer(backing.GetData().data() + offset, size); 1128 ctx.WriteBuffer(backing.GetData().data() + offset, size);
1129 1129
1130 IPC::ResponseBuilder rb{ctx, 2}; 1130 IPC::ResponseBuilder rb{ctx, 2};
1131 rb.Push(RESULT_SUCCESS); 1131 rb.Push(ResultSuccess);
1132} 1132}
1133 1133
1134ILibraryAppletCreator::ILibraryAppletCreator(Core::System& system_) 1134ILibraryAppletCreator::ILibraryAppletCreator(Core::System& system_)
@@ -1162,13 +1162,13 @@ void ILibraryAppletCreator::CreateLibraryApplet(Kernel::HLERequestContext& ctx)
1162 LOG_ERROR(Service_AM, "Applet doesn't exist! applet_id={}", applet_id); 1162 LOG_ERROR(Service_AM, "Applet doesn't exist! applet_id={}", applet_id);
1163 1163
1164 IPC::ResponseBuilder rb{ctx, 2}; 1164 IPC::ResponseBuilder rb{ctx, 2};
1165 rb.Push(RESULT_UNKNOWN); 1165 rb.Push(ResultUnknown);
1166 return; 1166 return;
1167 } 1167 }
1168 1168
1169 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 1169 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
1170 1170
1171 rb.Push(RESULT_SUCCESS); 1171 rb.Push(ResultSuccess);
1172 rb.PushIpcInterface<ILibraryAppletAccessor>(system, applet); 1172 rb.PushIpcInterface<ILibraryAppletAccessor>(system, applet);
1173} 1173}
1174 1174
@@ -1182,14 +1182,14 @@ void ILibraryAppletCreator::CreateStorage(Kernel::HLERequestContext& ctx) {
1182 if (size <= 0) { 1182 if (size <= 0) {
1183 LOG_ERROR(Service_AM, "size is less than or equal to 0"); 1183 LOG_ERROR(Service_AM, "size is less than or equal to 0");
1184 IPC::ResponseBuilder rb{ctx, 2}; 1184 IPC::ResponseBuilder rb{ctx, 2};
1185 rb.Push(RESULT_UNKNOWN); 1185 rb.Push(ResultUnknown);
1186 return; 1186 return;
1187 } 1187 }
1188 1188
1189 std::vector<u8> buffer(size); 1189 std::vector<u8> buffer(size);
1190 1190
1191 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 1191 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
1192 rb.Push(RESULT_SUCCESS); 1192 rb.Push(ResultSuccess);
1193 rb.PushIpcInterface<IStorage>(system, std::move(buffer)); 1193 rb.PushIpcInterface<IStorage>(system, std::move(buffer));
1194} 1194}
1195 1195
@@ -1210,7 +1210,7 @@ void ILibraryAppletCreator::CreateTransferMemoryStorage(Kernel::HLERequestContex
1210 if (parameters.size <= 0) { 1210 if (parameters.size <= 0) {
1211 LOG_ERROR(Service_AM, "size is less than or equal to 0"); 1211 LOG_ERROR(Service_AM, "size is less than or equal to 0");
1212 IPC::ResponseBuilder rb{ctx, 2}; 1212 IPC::ResponseBuilder rb{ctx, 2};
1213 rb.Push(RESULT_UNKNOWN); 1213 rb.Push(ResultUnknown);
1214 return; 1214 return;
1215 } 1215 }
1216 1216
@@ -1220,7 +1220,7 @@ void ILibraryAppletCreator::CreateTransferMemoryStorage(Kernel::HLERequestContex
1220 if (transfer_mem.IsNull()) { 1220 if (transfer_mem.IsNull()) {
1221 LOG_ERROR(Service_AM, "transfer_mem is a nullptr for handle={:08X}", handle); 1221 LOG_ERROR(Service_AM, "transfer_mem is a nullptr for handle={:08X}", handle);
1222 IPC::ResponseBuilder rb{ctx, 2}; 1222 IPC::ResponseBuilder rb{ctx, 2};
1223 rb.Push(RESULT_UNKNOWN); 1223 rb.Push(ResultUnknown);
1224 return; 1224 return;
1225 } 1225 }
1226 1226
@@ -1229,7 +1229,7 @@ void ILibraryAppletCreator::CreateTransferMemoryStorage(Kernel::HLERequestContex
1229 std::vector<u8> memory{mem_begin, mem_end}; 1229 std::vector<u8> memory{mem_begin, mem_end};
1230 1230
1231 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 1231 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
1232 rb.Push(RESULT_SUCCESS); 1232 rb.Push(ResultSuccess);
1233 rb.PushIpcInterface<IStorage>(system, std::move(memory)); 1233 rb.PushIpcInterface<IStorage>(system, std::move(memory));
1234} 1234}
1235 1235
@@ -1244,7 +1244,7 @@ void ILibraryAppletCreator::CreateHandleStorage(Kernel::HLERequestContext& ctx)
1244 if (size <= 0) { 1244 if (size <= 0) {
1245 LOG_ERROR(Service_AM, "size is less than or equal to 0"); 1245 LOG_ERROR(Service_AM, "size is less than or equal to 0");
1246 IPC::ResponseBuilder rb{ctx, 2}; 1246 IPC::ResponseBuilder rb{ctx, 2};
1247 rb.Push(RESULT_UNKNOWN); 1247 rb.Push(ResultUnknown);
1248 return; 1248 return;
1249 } 1249 }
1250 1250
@@ -1254,7 +1254,7 @@ void ILibraryAppletCreator::CreateHandleStorage(Kernel::HLERequestContext& ctx)
1254 if (transfer_mem.IsNull()) { 1254 if (transfer_mem.IsNull()) {
1255 LOG_ERROR(Service_AM, "transfer_mem is a nullptr for handle={:08X}", handle); 1255 LOG_ERROR(Service_AM, "transfer_mem is a nullptr for handle={:08X}", handle);
1256 IPC::ResponseBuilder rb{ctx, 2}; 1256 IPC::ResponseBuilder rb{ctx, 2};
1257 rb.Push(RESULT_UNKNOWN); 1257 rb.Push(ResultUnknown);
1258 return; 1258 return;
1259 } 1259 }
1260 1260
@@ -1263,7 +1263,7 @@ void ILibraryAppletCreator::CreateHandleStorage(Kernel::HLERequestContext& ctx)
1263 std::vector<u8> memory{mem_begin, mem_end}; 1263 std::vector<u8> memory{mem_begin, mem_end};
1264 1264
1265 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 1265 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
1266 rb.Push(RESULT_SUCCESS); 1266 rb.Push(ResultSuccess);
1267 rb.PushIpcInterface<IStorage>(system, std::move(memory)); 1267 rb.PushIpcInterface<IStorage>(system, std::move(memory));
1268} 1268}
1269 1269
@@ -1355,7 +1355,7 @@ void IApplicationFunctions::EnableApplicationCrashReport(Kernel::HLERequestConte
1355 LOG_WARNING(Service_AM, "(STUBBED) called"); 1355 LOG_WARNING(Service_AM, "(STUBBED) called");
1356 1356
1357 IPC::ResponseBuilder rb{ctx, 2}; 1357 IPC::ResponseBuilder rb{ctx, 2};
1358 rb.Push(RESULT_SUCCESS); 1358 rb.Push(ResultSuccess);
1359} 1359}
1360 1360
1361void IApplicationFunctions::InitializeApplicationCopyrightFrameBuffer( 1361void IApplicationFunctions::InitializeApplicationCopyrightFrameBuffer(
@@ -1363,14 +1363,14 @@ void IApplicationFunctions::InitializeApplicationCopyrightFrameBuffer(
1363 LOG_WARNING(Service_AM, "(STUBBED) called"); 1363 LOG_WARNING(Service_AM, "(STUBBED) called");
1364 1364
1365 IPC::ResponseBuilder rb{ctx, 2}; 1365 IPC::ResponseBuilder rb{ctx, 2};
1366 rb.Push(RESULT_SUCCESS); 1366 rb.Push(ResultSuccess);
1367} 1367}
1368 1368
1369void IApplicationFunctions::SetApplicationCopyrightImage(Kernel::HLERequestContext& ctx) { 1369void IApplicationFunctions::SetApplicationCopyrightImage(Kernel::HLERequestContext& ctx) {
1370 LOG_WARNING(Service_AM, "(STUBBED) called"); 1370 LOG_WARNING(Service_AM, "(STUBBED) called");
1371 1371
1372 IPC::ResponseBuilder rb{ctx, 2}; 1372 IPC::ResponseBuilder rb{ctx, 2};
1373 rb.Push(RESULT_SUCCESS); 1373 rb.Push(ResultSuccess);
1374} 1374}
1375 1375
1376void IApplicationFunctions::SetApplicationCopyrightVisibility(Kernel::HLERequestContext& ctx) { 1376void IApplicationFunctions::SetApplicationCopyrightVisibility(Kernel::HLERequestContext& ctx) {
@@ -1380,7 +1380,7 @@ void IApplicationFunctions::SetApplicationCopyrightVisibility(Kernel::HLERequest
1380 LOG_WARNING(Service_AM, "(STUBBED) called, is_visible={}", is_visible); 1380 LOG_WARNING(Service_AM, "(STUBBED) called, is_visible={}", is_visible);
1381 1381
1382 IPC::ResponseBuilder rb{ctx, 2}; 1382 IPC::ResponseBuilder rb{ctx, 2};
1383 rb.Push(RESULT_SUCCESS); 1383 rb.Push(ResultSuccess);
1384} 1384}
1385 1385
1386void IApplicationFunctions::BeginBlockingHomeButtonShortAndLongPressed( 1386void IApplicationFunctions::BeginBlockingHomeButtonShortAndLongPressed(
@@ -1388,7 +1388,7 @@ void IApplicationFunctions::BeginBlockingHomeButtonShortAndLongPressed(
1388 LOG_WARNING(Service_AM, "(STUBBED) called"); 1388 LOG_WARNING(Service_AM, "(STUBBED) called");
1389 1389
1390 IPC::ResponseBuilder rb{ctx, 2}; 1390 IPC::ResponseBuilder rb{ctx, 2};
1391 rb.Push(RESULT_SUCCESS); 1391 rb.Push(ResultSuccess);
1392} 1392}
1393 1393
1394void IApplicationFunctions::EndBlockingHomeButtonShortAndLongPressed( 1394void IApplicationFunctions::EndBlockingHomeButtonShortAndLongPressed(
@@ -1396,21 +1396,21 @@ void IApplicationFunctions::EndBlockingHomeButtonShortAndLongPressed(
1396 LOG_WARNING(Service_AM, "(STUBBED) called"); 1396 LOG_WARNING(Service_AM, "(STUBBED) called");
1397 1397
1398 IPC::ResponseBuilder rb{ctx, 2}; 1398 IPC::ResponseBuilder rb{ctx, 2};
1399 rb.Push(RESULT_SUCCESS); 1399 rb.Push(ResultSuccess);
1400} 1400}
1401 1401
1402void IApplicationFunctions::BeginBlockingHomeButton(Kernel::HLERequestContext& ctx) { 1402void IApplicationFunctions::BeginBlockingHomeButton(Kernel::HLERequestContext& ctx) {
1403 LOG_WARNING(Service_AM, "(STUBBED) called"); 1403 LOG_WARNING(Service_AM, "(STUBBED) called");
1404 1404
1405 IPC::ResponseBuilder rb{ctx, 2}; 1405 IPC::ResponseBuilder rb{ctx, 2};
1406 rb.Push(RESULT_SUCCESS); 1406 rb.Push(ResultSuccess);
1407} 1407}
1408 1408
1409void IApplicationFunctions::EndBlockingHomeButton(Kernel::HLERequestContext& ctx) { 1409void IApplicationFunctions::EndBlockingHomeButton(Kernel::HLERequestContext& ctx) {
1410 LOG_WARNING(Service_AM, "(STUBBED) called"); 1410 LOG_WARNING(Service_AM, "(STUBBED) called");
1411 1411
1412 IPC::ResponseBuilder rb{ctx, 2}; 1412 IPC::ResponseBuilder rb{ctx, 2};
1413 rb.Push(RESULT_SUCCESS); 1413 rb.Push(ResultSuccess);
1414} 1414}
1415 1415
1416void IApplicationFunctions::PopLaunchParameter(Kernel::HLERequestContext& ctx) { 1416void IApplicationFunctions::PopLaunchParameter(Kernel::HLERequestContext& ctx) {
@@ -1430,7 +1430,7 @@ void IApplicationFunctions::PopLaunchParameter(Kernel::HLERequestContext& ctx) {
1430 auto data = backend->GetLaunchParameter({system.CurrentProcess()->GetTitleID(), build_id}); 1430 auto data = backend->GetLaunchParameter({system.CurrentProcess()->GetTitleID(), build_id});
1431 if (data.has_value()) { 1431 if (data.has_value()) {
1432 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 1432 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
1433 rb.Push(RESULT_SUCCESS); 1433 rb.Push(ResultSuccess);
1434 rb.PushIpcInterface<IStorage>(system, std::move(*data)); 1434 rb.PushIpcInterface<IStorage>(system, std::move(*data));
1435 launch_popped_application_specific = true; 1435 launch_popped_application_specific = true;
1436 return; 1436 return;
@@ -1449,7 +1449,7 @@ void IApplicationFunctions::PopLaunchParameter(Kernel::HLERequestContext& ctx) {
1449 1449
1450 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 1450 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
1451 1451
1452 rb.Push(RESULT_SUCCESS); 1452 rb.Push(ResultSuccess);
1453 1453
1454 std::vector<u8> buffer(sizeof(LaunchParameterAccountPreselectedUser)); 1454 std::vector<u8> buffer(sizeof(LaunchParameterAccountPreselectedUser));
1455 std::memcpy(buffer.data(), &params, buffer.size()); 1455 std::memcpy(buffer.data(), &params, buffer.size());
@@ -1469,7 +1469,7 @@ void IApplicationFunctions::CreateApplicationAndRequestToStartForQuest(
1469 LOG_WARNING(Service_AM, "(STUBBED) called"); 1469 LOG_WARNING(Service_AM, "(STUBBED) called");
1470 1470
1471 IPC::ResponseBuilder rb{ctx, 2}; 1471 IPC::ResponseBuilder rb{ctx, 2};
1472 rb.Push(RESULT_SUCCESS); 1472 rb.Push(ResultSuccess);
1473} 1473}
1474 1474
1475void IApplicationFunctions::EnsureSaveData(Kernel::HLERequestContext& ctx) { 1475void IApplicationFunctions::EnsureSaveData(Kernel::HLERequestContext& ctx) {
@@ -1500,7 +1500,7 @@ void IApplicationFunctions::SetTerminateResult(Kernel::HLERequestContext& ctx) {
1500 LOG_WARNING(Service_AM, "(STUBBED) called, result=0x{:08X}", result); 1500 LOG_WARNING(Service_AM, "(STUBBED) called, result=0x{:08X}", result);
1501 1501
1502 IPC::ResponseBuilder rb{ctx, 2}; 1502 IPC::ResponseBuilder rb{ctx, 2};
1503 rb.Push(RESULT_SUCCESS); 1503 rb.Push(ResultSuccess);
1504} 1504}
1505 1505
1506void IApplicationFunctions::GetDisplayVersion(Kernel::HLERequestContext& ctx) { 1506void IApplicationFunctions::GetDisplayVersion(Kernel::HLERequestContext& ctx) {
@@ -1533,7 +1533,7 @@ void IApplicationFunctions::GetDisplayVersion(Kernel::HLERequestContext& ctx) {
1533 } 1533 }
1534 1534
1535 IPC::ResponseBuilder rb{ctx, 6}; 1535 IPC::ResponseBuilder rb{ctx, 6};
1536 rb.Push(RESULT_SUCCESS); 1536 rb.Push(ResultSuccess);
1537 rb.PushRaw(version_string); 1537 rb.PushRaw(version_string);
1538} 1538}
1539 1539
@@ -1589,7 +1589,7 @@ void IApplicationFunctions::GetDesiredLanguage(Kernel::HLERequestContext& ctx) {
1589 LOG_DEBUG(Service_AM, "got desired_language={:016X}", *res_code); 1589 LOG_DEBUG(Service_AM, "got desired_language={:016X}", *res_code);
1590 1590
1591 IPC::ResponseBuilder rb{ctx, 4}; 1591 IPC::ResponseBuilder rb{ctx, 4};
1592 rb.Push(RESULT_SUCCESS); 1592 rb.Push(ResultSuccess);
1593 rb.Push(*res_code); 1593 rb.Push(*res_code);
1594} 1594}
1595 1595
@@ -1599,7 +1599,7 @@ void IApplicationFunctions::IsGamePlayRecordingSupported(Kernel::HLERequestConte
1599 constexpr bool gameplay_recording_supported = false; 1599 constexpr bool gameplay_recording_supported = false;
1600 1600
1601 IPC::ResponseBuilder rb{ctx, 3}; 1601 IPC::ResponseBuilder rb{ctx, 3};
1602 rb.Push(RESULT_SUCCESS); 1602 rb.Push(ResultSuccess);
1603 rb.Push(gameplay_recording_supported); 1603 rb.Push(gameplay_recording_supported);
1604} 1604}
1605 1605
@@ -1607,21 +1607,21 @@ void IApplicationFunctions::InitializeGamePlayRecording(Kernel::HLERequestContex
1607 LOG_WARNING(Service_AM, "(STUBBED) called"); 1607 LOG_WARNING(Service_AM, "(STUBBED) called");
1608 1608
1609 IPC::ResponseBuilder rb{ctx, 2}; 1609 IPC::ResponseBuilder rb{ctx, 2};
1610 rb.Push(RESULT_SUCCESS); 1610 rb.Push(ResultSuccess);
1611} 1611}
1612 1612
1613void IApplicationFunctions::SetGamePlayRecordingState(Kernel::HLERequestContext& ctx) { 1613void IApplicationFunctions::SetGamePlayRecordingState(Kernel::HLERequestContext& ctx) {
1614 LOG_WARNING(Service_AM, "(STUBBED) called"); 1614 LOG_WARNING(Service_AM, "(STUBBED) called");
1615 1615
1616 IPC::ResponseBuilder rb{ctx, 2}; 1616 IPC::ResponseBuilder rb{ctx, 2};
1617 rb.Push(RESULT_SUCCESS); 1617 rb.Push(ResultSuccess);
1618} 1618}
1619 1619
1620void IApplicationFunctions::NotifyRunning(Kernel::HLERequestContext& ctx) { 1620void IApplicationFunctions::NotifyRunning(Kernel::HLERequestContext& ctx) {
1621 LOG_WARNING(Service_AM, "(STUBBED) called"); 1621 LOG_WARNING(Service_AM, "(STUBBED) called");
1622 1622
1623 IPC::ResponseBuilder rb{ctx, 3}; 1623 IPC::ResponseBuilder rb{ctx, 3};
1624 rb.Push(RESULT_SUCCESS); 1624 rb.Push(ResultSuccess);
1625 rb.Push<u8>(0); // Unknown, seems to be ignored by official processes 1625 rb.Push<u8>(0); // Unknown, seems to be ignored by official processes
1626} 1626}
1627 1627
@@ -1629,7 +1629,7 @@ void IApplicationFunctions::GetPseudoDeviceId(Kernel::HLERequestContext& ctx) {
1629 LOG_WARNING(Service_AM, "(STUBBED) called"); 1629 LOG_WARNING(Service_AM, "(STUBBED) called");
1630 1630
1631 IPC::ResponseBuilder rb{ctx, 6}; 1631 IPC::ResponseBuilder rb{ctx, 6};
1632 rb.Push(RESULT_SUCCESS); 1632 rb.Push(ResultSuccess);
1633 1633
1634 // Returns a 128-bit UUID 1634 // Returns a 128-bit UUID
1635 rb.Push<u64>(0); 1635 rb.Push<u64>(0);
@@ -1657,7 +1657,7 @@ void IApplicationFunctions::ExtendSaveData(Kernel::HLERequestContext& ctx) {
1657 type, system.CurrentProcess()->GetTitleID(), user_id, {new_normal_size, new_journal_size}); 1657 type, system.CurrentProcess()->GetTitleID(), user_id, {new_normal_size, new_journal_size});
1658 1658
1659 IPC::ResponseBuilder rb{ctx, 4}; 1659 IPC::ResponseBuilder rb{ctx, 4};
1660 rb.Push(RESULT_SUCCESS); 1660 rb.Push(ResultSuccess);
1661 1661
1662 // The following value is used upon failure to help the system recover. 1662 // The following value is used upon failure to help the system recover.
1663 // Since we always succeed, this should be 0. 1663 // Since we always succeed, this should be 0.
@@ -1681,7 +1681,7 @@ void IApplicationFunctions::GetSaveDataSize(Kernel::HLERequestContext& ctx) {
1681 type, system.CurrentProcess()->GetTitleID(), user_id); 1681 type, system.CurrentProcess()->GetTitleID(), user_id);
1682 1682
1683 IPC::ResponseBuilder rb{ctx, 6}; 1683 IPC::ResponseBuilder rb{ctx, 6};
1684 rb.Push(RESULT_SUCCESS); 1684 rb.Push(ResultSuccess);
1685 rb.Push(size.normal); 1685 rb.Push(size.normal);
1686 rb.Push(size.journal); 1686 rb.Push(size.journal);
1687} 1687}
@@ -1690,7 +1690,7 @@ void IApplicationFunctions::QueryApplicationPlayStatistics(Kernel::HLERequestCon
1690 LOG_WARNING(Service_AM, "(STUBBED) called"); 1690 LOG_WARNING(Service_AM, "(STUBBED) called");
1691 1691
1692 IPC::ResponseBuilder rb{ctx, 3}; 1692 IPC::ResponseBuilder rb{ctx, 3};
1693 rb.Push(RESULT_SUCCESS); 1693 rb.Push(ResultSuccess);
1694 rb.Push<u32>(0); 1694 rb.Push<u32>(0);
1695} 1695}
1696 1696
@@ -1698,7 +1698,7 @@ void IApplicationFunctions::QueryApplicationPlayStatisticsByUid(Kernel::HLEReque
1698 LOG_WARNING(Service_AM, "(STUBBED) called"); 1698 LOG_WARNING(Service_AM, "(STUBBED) called");
1699 1699
1700 IPC::ResponseBuilder rb{ctx, 3}; 1700 IPC::ResponseBuilder rb{ctx, 3};
1701 rb.Push(RESULT_SUCCESS); 1701 rb.Push(ResultSuccess);
1702 rb.Push<u32>(0); 1702 rb.Push<u32>(0);
1703} 1703}
1704 1704
@@ -1711,7 +1711,7 @@ void IApplicationFunctions::ExecuteProgram(Kernel::HLERequestContext& ctx) {
1711 const auto program_index = rp.Pop<u64>(); 1711 const auto program_index = rp.Pop<u64>();
1712 1712
1713 IPC::ResponseBuilder rb{ctx, 2}; 1713 IPC::ResponseBuilder rb{ctx, 2};
1714 rb.Push(RESULT_SUCCESS); 1714 rb.Push(ResultSuccess);
1715 1715
1716 system.ExecuteProgram(program_index); 1716 system.ExecuteProgram(program_index);
1717} 1717}
@@ -1720,21 +1720,21 @@ void IApplicationFunctions::ClearUserChannel(Kernel::HLERequestContext& ctx) {
1720 LOG_WARNING(Service_AM, "(STUBBED) called"); 1720 LOG_WARNING(Service_AM, "(STUBBED) called");
1721 1721
1722 IPC::ResponseBuilder rb{ctx, 2}; 1722 IPC::ResponseBuilder rb{ctx, 2};
1723 rb.Push(RESULT_SUCCESS); 1723 rb.Push(ResultSuccess);
1724} 1724}
1725 1725
1726void IApplicationFunctions::UnpopToUserChannel(Kernel::HLERequestContext& ctx) { 1726void IApplicationFunctions::UnpopToUserChannel(Kernel::HLERequestContext& ctx) {
1727 LOG_WARNING(Service_AM, "(STUBBED) called"); 1727 LOG_WARNING(Service_AM, "(STUBBED) called");
1728 1728
1729 IPC::ResponseBuilder rb{ctx, 2}; 1729 IPC::ResponseBuilder rb{ctx, 2};
1730 rb.Push(RESULT_SUCCESS); 1730 rb.Push(ResultSuccess);
1731} 1731}
1732 1732
1733void IApplicationFunctions::GetPreviousProgramIndex(Kernel::HLERequestContext& ctx) { 1733void IApplicationFunctions::GetPreviousProgramIndex(Kernel::HLERequestContext& ctx) {
1734 LOG_WARNING(Service_AM, "(STUBBED) called"); 1734 LOG_WARNING(Service_AM, "(STUBBED) called");
1735 1735
1736 IPC::ResponseBuilder rb{ctx, 3}; 1736 IPC::ResponseBuilder rb{ctx, 3};
1737 rb.Push(RESULT_SUCCESS); 1737 rb.Push(ResultSuccess);
1738 rb.Push<s32>(previous_program_index); 1738 rb.Push<s32>(previous_program_index);
1739} 1739}
1740 1740
@@ -1742,7 +1742,7 @@ void IApplicationFunctions::GetGpuErrorDetectedSystemEvent(Kernel::HLERequestCon
1742 LOG_WARNING(Service_AM, "(STUBBED) called"); 1742 LOG_WARNING(Service_AM, "(STUBBED) called");
1743 1743
1744 IPC::ResponseBuilder rb{ctx, 2, 1}; 1744 IPC::ResponseBuilder rb{ctx, 2, 1};
1745 rb.Push(RESULT_SUCCESS); 1745 rb.Push(ResultSuccess);
1746 rb.PushCopyObjects(gpu_error_detected_event.GetReadableEvent()); 1746 rb.PushCopyObjects(gpu_error_detected_event.GetReadableEvent());
1747} 1747}
1748 1748
@@ -1750,7 +1750,7 @@ void IApplicationFunctions::GetFriendInvitationStorageChannelEvent(Kernel::HLERe
1750 LOG_DEBUG(Service_AM, "called"); 1750 LOG_DEBUG(Service_AM, "called");
1751 1751
1752 IPC::ResponseBuilder rb{ctx, 2, 1}; 1752 IPC::ResponseBuilder rb{ctx, 2, 1};
1753 rb.Push(RESULT_SUCCESS); 1753 rb.Push(ResultSuccess);
1754 rb.PushCopyObjects(friend_invitation_storage_channel_event.GetReadableEvent()); 1754 rb.PushCopyObjects(friend_invitation_storage_channel_event.GetReadableEvent());
1755} 1755}
1756 1756
@@ -1766,7 +1766,7 @@ void IApplicationFunctions::GetHealthWarningDisappearedSystemEvent(Kernel::HLERe
1766 LOG_DEBUG(Service_AM, "called"); 1766 LOG_DEBUG(Service_AM, "called");
1767 1767
1768 IPC::ResponseBuilder rb{ctx, 2, 1}; 1768 IPC::ResponseBuilder rb{ctx, 2, 1};
1769 rb.Push(RESULT_SUCCESS); 1769 rb.Push(ResultSuccess);
1770 rb.PushCopyObjects(health_warning_disappeared_system_event.GetReadableEvent()); 1770 rb.PushCopyObjects(health_warning_disappeared_system_event.GetReadableEvent());
1771} 1771}
1772 1772
@@ -1817,14 +1817,14 @@ void IHomeMenuFunctions::RequestToGetForeground(Kernel::HLERequestContext& ctx)
1817 LOG_WARNING(Service_AM, "(STUBBED) called"); 1817 LOG_WARNING(Service_AM, "(STUBBED) called");
1818 1818
1819 IPC::ResponseBuilder rb{ctx, 2}; 1819 IPC::ResponseBuilder rb{ctx, 2};
1820 rb.Push(RESULT_SUCCESS); 1820 rb.Push(ResultSuccess);
1821} 1821}
1822 1822
1823void IHomeMenuFunctions::GetPopFromGeneralChannelEvent(Kernel::HLERequestContext& ctx) { 1823void IHomeMenuFunctions::GetPopFromGeneralChannelEvent(Kernel::HLERequestContext& ctx) {
1824 LOG_WARNING(Service_AM, "(STUBBED) called"); 1824 LOG_WARNING(Service_AM, "(STUBBED) called");
1825 1825
1826 IPC::ResponseBuilder rb{ctx, 2, 1}; 1826 IPC::ResponseBuilder rb{ctx, 2, 1};
1827 rb.Push(RESULT_SUCCESS); 1827 rb.Push(ResultSuccess);
1828 rb.PushCopyObjects(pop_from_general_channel_event.GetReadableEvent()); 1828 rb.PushCopyObjects(pop_from_general_channel_event.GetReadableEvent());
1829} 1829}
1830 1830
diff --git a/src/core/hle/service/am/applet_ae.cpp b/src/core/hle/service/am/applet_ae.cpp
index 5421e0da0..0ec4fd4ca 100644
--- a/src/core/hle/service/am/applet_ae.cpp
+++ b/src/core/hle/service/am/applet_ae.cpp
@@ -41,7 +41,7 @@ private:
41 LOG_DEBUG(Service_AM, "called"); 41 LOG_DEBUG(Service_AM, "called");
42 42
43 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 43 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
44 rb.Push(RESULT_SUCCESS); 44 rb.Push(ResultSuccess);
45 rb.PushIpcInterface<ICommonStateGetter>(system, msg_queue); 45 rb.PushIpcInterface<ICommonStateGetter>(system, msg_queue);
46 } 46 }
47 47
@@ -49,7 +49,7 @@ private:
49 LOG_DEBUG(Service_AM, "called"); 49 LOG_DEBUG(Service_AM, "called");
50 50
51 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 51 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
52 rb.Push(RESULT_SUCCESS); 52 rb.Push(ResultSuccess);
53 rb.PushIpcInterface<ISelfController>(system, nvflinger); 53 rb.PushIpcInterface<ISelfController>(system, nvflinger);
54 } 54 }
55 55
@@ -57,7 +57,7 @@ private:
57 LOG_DEBUG(Service_AM, "called"); 57 LOG_DEBUG(Service_AM, "called");
58 58
59 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 59 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
60 rb.Push(RESULT_SUCCESS); 60 rb.Push(ResultSuccess);
61 rb.PushIpcInterface<IWindowController>(system); 61 rb.PushIpcInterface<IWindowController>(system);
62 } 62 }
63 63
@@ -65,7 +65,7 @@ private:
65 LOG_DEBUG(Service_AM, "called"); 65 LOG_DEBUG(Service_AM, "called");
66 66
67 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 67 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
68 rb.Push(RESULT_SUCCESS); 68 rb.Push(ResultSuccess);
69 rb.PushIpcInterface<IAudioController>(system); 69 rb.PushIpcInterface<IAudioController>(system);
70 } 70 }
71 71
@@ -73,7 +73,7 @@ private:
73 LOG_DEBUG(Service_AM, "called"); 73 LOG_DEBUG(Service_AM, "called");
74 74
75 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 75 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
76 rb.Push(RESULT_SUCCESS); 76 rb.Push(ResultSuccess);
77 rb.PushIpcInterface<IDisplayController>(system); 77 rb.PushIpcInterface<IDisplayController>(system);
78 } 78 }
79 79
@@ -81,7 +81,7 @@ private:
81 LOG_DEBUG(Service_AM, "called"); 81 LOG_DEBUG(Service_AM, "called");
82 82
83 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 83 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
84 rb.Push(RESULT_SUCCESS); 84 rb.Push(ResultSuccess);
85 rb.PushIpcInterface<IProcessWindingController>(system); 85 rb.PushIpcInterface<IProcessWindingController>(system);
86 } 86 }
87 87
@@ -89,7 +89,7 @@ private:
89 LOG_DEBUG(Service_AM, "called"); 89 LOG_DEBUG(Service_AM, "called");
90 90
91 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 91 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
92 rb.Push(RESULT_SUCCESS); 92 rb.Push(ResultSuccess);
93 rb.PushIpcInterface<IDebugFunctions>(system); 93 rb.PushIpcInterface<IDebugFunctions>(system);
94 } 94 }
95 95
@@ -97,7 +97,7 @@ private:
97 LOG_DEBUG(Service_AM, "called"); 97 LOG_DEBUG(Service_AM, "called");
98 98
99 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 99 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
100 rb.Push(RESULT_SUCCESS); 100 rb.Push(ResultSuccess);
101 rb.PushIpcInterface<ILibraryAppletCreator>(system); 101 rb.PushIpcInterface<ILibraryAppletCreator>(system);
102 } 102 }
103 103
@@ -105,7 +105,7 @@ private:
105 LOG_DEBUG(Service_AM, "called"); 105 LOG_DEBUG(Service_AM, "called");
106 106
107 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 107 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
108 rb.Push(RESULT_SUCCESS); 108 rb.Push(ResultSuccess);
109 rb.PushIpcInterface<IApplicationFunctions>(system); 109 rb.PushIpcInterface<IApplicationFunctions>(system);
110 } 110 }
111 111
@@ -145,7 +145,7 @@ private:
145 LOG_DEBUG(Service_AM, "called"); 145 LOG_DEBUG(Service_AM, "called");
146 146
147 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 147 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
148 rb.Push(RESULT_SUCCESS); 148 rb.Push(ResultSuccess);
149 rb.PushIpcInterface<ICommonStateGetter>(system, msg_queue); 149 rb.PushIpcInterface<ICommonStateGetter>(system, msg_queue);
150 } 150 }
151 151
@@ -153,7 +153,7 @@ private:
153 LOG_DEBUG(Service_AM, "called"); 153 LOG_DEBUG(Service_AM, "called");
154 154
155 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 155 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
156 rb.Push(RESULT_SUCCESS); 156 rb.Push(ResultSuccess);
157 rb.PushIpcInterface<ISelfController>(system, nvflinger); 157 rb.PushIpcInterface<ISelfController>(system, nvflinger);
158 } 158 }
159 159
@@ -161,7 +161,7 @@ private:
161 LOG_DEBUG(Service_AM, "called"); 161 LOG_DEBUG(Service_AM, "called");
162 162
163 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 163 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
164 rb.Push(RESULT_SUCCESS); 164 rb.Push(ResultSuccess);
165 rb.PushIpcInterface<IWindowController>(system); 165 rb.PushIpcInterface<IWindowController>(system);
166 } 166 }
167 167
@@ -169,7 +169,7 @@ private:
169 LOG_DEBUG(Service_AM, "called"); 169 LOG_DEBUG(Service_AM, "called");
170 170
171 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 171 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
172 rb.Push(RESULT_SUCCESS); 172 rb.Push(ResultSuccess);
173 rb.PushIpcInterface<IAudioController>(system); 173 rb.PushIpcInterface<IAudioController>(system);
174 } 174 }
175 175
@@ -177,7 +177,7 @@ private:
177 LOG_DEBUG(Service_AM, "called"); 177 LOG_DEBUG(Service_AM, "called");
178 178
179 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 179 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
180 rb.Push(RESULT_SUCCESS); 180 rb.Push(ResultSuccess);
181 rb.PushIpcInterface<IDisplayController>(system); 181 rb.PushIpcInterface<IDisplayController>(system);
182 } 182 }
183 183
@@ -185,7 +185,7 @@ private:
185 LOG_DEBUG(Service_AM, "called"); 185 LOG_DEBUG(Service_AM, "called");
186 186
187 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 187 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
188 rb.Push(RESULT_SUCCESS); 188 rb.Push(ResultSuccess);
189 rb.PushIpcInterface<IDebugFunctions>(system); 189 rb.PushIpcInterface<IDebugFunctions>(system);
190 } 190 }
191 191
@@ -193,7 +193,7 @@ private:
193 LOG_DEBUG(Service_AM, "called"); 193 LOG_DEBUG(Service_AM, "called");
194 194
195 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 195 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
196 rb.Push(RESULT_SUCCESS); 196 rb.Push(ResultSuccess);
197 rb.PushIpcInterface<ILibraryAppletCreator>(system); 197 rb.PushIpcInterface<ILibraryAppletCreator>(system);
198 } 198 }
199 199
@@ -201,7 +201,7 @@ private:
201 LOG_DEBUG(Service_AM, "called"); 201 LOG_DEBUG(Service_AM, "called");
202 202
203 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 203 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
204 rb.Push(RESULT_SUCCESS); 204 rb.Push(ResultSuccess);
205 rb.PushIpcInterface<IHomeMenuFunctions>(system); 205 rb.PushIpcInterface<IHomeMenuFunctions>(system);
206 } 206 }
207 207
@@ -209,7 +209,7 @@ private:
209 LOG_DEBUG(Service_AM, "called"); 209 LOG_DEBUG(Service_AM, "called");
210 210
211 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 211 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
212 rb.Push(RESULT_SUCCESS); 212 rb.Push(ResultSuccess);
213 rb.PushIpcInterface<IGlobalStateController>(system); 213 rb.PushIpcInterface<IGlobalStateController>(system);
214 } 214 }
215 215
@@ -217,7 +217,7 @@ private:
217 LOG_DEBUG(Service_AM, "called"); 217 LOG_DEBUG(Service_AM, "called");
218 218
219 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 219 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
220 rb.Push(RESULT_SUCCESS); 220 rb.Push(ResultSuccess);
221 rb.PushIpcInterface<IApplicationCreator>(system); 221 rb.PushIpcInterface<IApplicationCreator>(system);
222 } 222 }
223 223
@@ -229,7 +229,7 @@ void AppletAE::OpenSystemAppletProxy(Kernel::HLERequestContext& ctx) {
229 LOG_DEBUG(Service_AM, "called"); 229 LOG_DEBUG(Service_AM, "called");
230 230
231 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 231 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
232 rb.Push(RESULT_SUCCESS); 232 rb.Push(ResultSuccess);
233 rb.PushIpcInterface<ISystemAppletProxy>(nvflinger, msg_queue, system); 233 rb.PushIpcInterface<ISystemAppletProxy>(nvflinger, msg_queue, system);
234} 234}
235 235
@@ -237,7 +237,7 @@ void AppletAE::OpenLibraryAppletProxy(Kernel::HLERequestContext& ctx) {
237 LOG_DEBUG(Service_AM, "called"); 237 LOG_DEBUG(Service_AM, "called");
238 238
239 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 239 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
240 rb.Push(RESULT_SUCCESS); 240 rb.Push(ResultSuccess);
241 rb.PushIpcInterface<ILibraryAppletProxy>(nvflinger, msg_queue, system); 241 rb.PushIpcInterface<ILibraryAppletProxy>(nvflinger, msg_queue, system);
242} 242}
243 243
@@ -245,7 +245,7 @@ void AppletAE::OpenLibraryAppletProxyOld(Kernel::HLERequestContext& ctx) {
245 LOG_DEBUG(Service_AM, "called"); 245 LOG_DEBUG(Service_AM, "called");
246 246
247 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 247 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
248 rb.Push(RESULT_SUCCESS); 248 rb.Push(ResultSuccess);
249 rb.PushIpcInterface<ILibraryAppletProxy>(nvflinger, msg_queue, system); 249 rb.PushIpcInterface<ILibraryAppletProxy>(nvflinger, msg_queue, system);
250} 250}
251 251
diff --git a/src/core/hle/service/am/applet_oe.cpp b/src/core/hle/service/am/applet_oe.cpp
index f9eba8f52..b8859f4e6 100644
--- a/src/core/hle/service/am/applet_oe.cpp
+++ b/src/core/hle/service/am/applet_oe.cpp
@@ -39,7 +39,7 @@ private:
39 LOG_DEBUG(Service_AM, "called"); 39 LOG_DEBUG(Service_AM, "called");
40 40
41 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 41 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
42 rb.Push(RESULT_SUCCESS); 42 rb.Push(ResultSuccess);
43 rb.PushIpcInterface<IAudioController>(system); 43 rb.PushIpcInterface<IAudioController>(system);
44 } 44 }
45 45
@@ -47,7 +47,7 @@ private:
47 LOG_DEBUG(Service_AM, "called"); 47 LOG_DEBUG(Service_AM, "called");
48 48
49 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 49 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
50 rb.Push(RESULT_SUCCESS); 50 rb.Push(ResultSuccess);
51 rb.PushIpcInterface<IDisplayController>(system); 51 rb.PushIpcInterface<IDisplayController>(system);
52 } 52 }
53 53
@@ -55,7 +55,7 @@ private:
55 LOG_DEBUG(Service_AM, "called"); 55 LOG_DEBUG(Service_AM, "called");
56 56
57 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 57 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
58 rb.Push(RESULT_SUCCESS); 58 rb.Push(ResultSuccess);
59 rb.PushIpcInterface<IDebugFunctions>(system); 59 rb.PushIpcInterface<IDebugFunctions>(system);
60 } 60 }
61 61
@@ -63,7 +63,7 @@ private:
63 LOG_DEBUG(Service_AM, "called"); 63 LOG_DEBUG(Service_AM, "called");
64 64
65 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 65 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
66 rb.Push(RESULT_SUCCESS); 66 rb.Push(ResultSuccess);
67 rb.PushIpcInterface<IWindowController>(system); 67 rb.PushIpcInterface<IWindowController>(system);
68 } 68 }
69 69
@@ -71,7 +71,7 @@ private:
71 LOG_DEBUG(Service_AM, "called"); 71 LOG_DEBUG(Service_AM, "called");
72 72
73 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 73 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
74 rb.Push(RESULT_SUCCESS); 74 rb.Push(ResultSuccess);
75 rb.PushIpcInterface<ISelfController>(system, nvflinger); 75 rb.PushIpcInterface<ISelfController>(system, nvflinger);
76 } 76 }
77 77
@@ -79,7 +79,7 @@ private:
79 LOG_DEBUG(Service_AM, "called"); 79 LOG_DEBUG(Service_AM, "called");
80 80
81 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 81 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
82 rb.Push(RESULT_SUCCESS); 82 rb.Push(ResultSuccess);
83 rb.PushIpcInterface<ICommonStateGetter>(system, msg_queue); 83 rb.PushIpcInterface<ICommonStateGetter>(system, msg_queue);
84 } 84 }
85 85
@@ -87,7 +87,7 @@ private:
87 LOG_DEBUG(Service_AM, "called"); 87 LOG_DEBUG(Service_AM, "called");
88 88
89 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 89 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
90 rb.Push(RESULT_SUCCESS); 90 rb.Push(ResultSuccess);
91 rb.PushIpcInterface<ILibraryAppletCreator>(system); 91 rb.PushIpcInterface<ILibraryAppletCreator>(system);
92 } 92 }
93 93
@@ -95,7 +95,7 @@ private:
95 LOG_DEBUG(Service_AM, "called"); 95 LOG_DEBUG(Service_AM, "called");
96 96
97 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 97 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
98 rb.Push(RESULT_SUCCESS); 98 rb.Push(ResultSuccess);
99 rb.PushIpcInterface<IApplicationFunctions>(system); 99 rb.PushIpcInterface<IApplicationFunctions>(system);
100 } 100 }
101 101
@@ -107,7 +107,7 @@ void AppletOE::OpenApplicationProxy(Kernel::HLERequestContext& ctx) {
107 LOG_DEBUG(Service_AM, "called"); 107 LOG_DEBUG(Service_AM, "called");
108 108
109 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 109 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
110 rb.Push(RESULT_SUCCESS); 110 rb.Push(ResultSuccess);
111 rb.PushIpcInterface<IApplicationProxy>(nvflinger, msg_queue, system); 111 rb.PushIpcInterface<IApplicationProxy>(nvflinger, msg_queue, system);
112} 112}
113 113
diff --git a/src/core/hle/service/am/applets/controller.h b/src/core/hle/service/am/applets/controller.h
index 2d4dae0bd..20617e91f 100644
--- a/src/core/hle/service/am/applets/controller.h
+++ b/src/core/hle/service/am/applets/controller.h
@@ -129,7 +129,7 @@ private:
129 ControllerSupportArgNew controller_user_arg_new; 129 ControllerSupportArgNew controller_user_arg_new;
130 ControllerUpdateFirmwareArg controller_update_arg; 130 ControllerUpdateFirmwareArg controller_update_arg;
131 bool complete{false}; 131 bool complete{false};
132 ResultCode status{RESULT_SUCCESS}; 132 ResultCode status{ResultSuccess};
133 bool is_single_mode{false}; 133 bool is_single_mode{false};
134 std::vector<u8> out_data; 134 std::vector<u8> out_data;
135}; 135};
diff --git a/src/core/hle/service/am/applets/error.cpp b/src/core/hle/service/am/applets/error.cpp
index 08348b180..c724e5d5b 100644
--- a/src/core/hle/service/am/applets/error.cpp
+++ b/src/core/hle/service/am/applets/error.cpp
@@ -135,7 +135,7 @@ bool Error::TransactionComplete() const {
135} 135}
136 136
137ResultCode Error::GetStatus() const { 137ResultCode Error::GetStatus() const {
138 return RESULT_SUCCESS; 138 return ResultSuccess;
139} 139}
140 140
141void Error::ExecuteInteractive() { 141void Error::ExecuteInteractive() {
diff --git a/src/core/hle/service/am/applets/error.h b/src/core/hle/service/am/applets/error.h
index e606d12ce..8aa9046a5 100644
--- a/src/core/hle/service/am/applets/error.h
+++ b/src/core/hle/service/am/applets/error.h
@@ -42,7 +42,7 @@ private:
42 union ErrorArguments; 42 union ErrorArguments;
43 43
44 const Core::Frontend::ErrorApplet& frontend; 44 const Core::Frontend::ErrorApplet& frontend;
45 ResultCode error_code = RESULT_SUCCESS; 45 ResultCode error_code = ResultSuccess;
46 ErrorAppletMode mode = ErrorAppletMode::ShowError; 46 ErrorAppletMode mode = ErrorAppletMode::ShowError;
47 std::unique_ptr<ErrorArguments> args; 47 std::unique_ptr<ErrorArguments> args;
48 48
diff --git a/src/core/hle/service/am/applets/general_backend.cpp b/src/core/hle/service/am/applets/general_backend.cpp
index e95499edd..9fcb9f95b 100644
--- a/src/core/hle/service/am/applets/general_backend.cpp
+++ b/src/core/hle/service/am/applets/general_backend.cpp
@@ -76,7 +76,7 @@ bool Auth::TransactionComplete() const {
76} 76}
77 77
78ResultCode Auth::GetStatus() const { 78ResultCode Auth::GetStatus() const {
79 return successful ? RESULT_SUCCESS : ERROR_INVALID_PIN; 79 return successful ? ResultSuccess : ERROR_INVALID_PIN;
80} 80}
81 81
82void Auth::ExecuteInteractive() { 82void Auth::ExecuteInteractive() {
@@ -175,7 +175,7 @@ bool PhotoViewer::TransactionComplete() const {
175} 175}
176 176
177ResultCode PhotoViewer::GetStatus() const { 177ResultCode PhotoViewer::GetStatus() const {
178 return RESULT_SUCCESS; 178 return ResultSuccess;
179} 179}
180 180
181void PhotoViewer::ExecuteInteractive() { 181void PhotoViewer::ExecuteInteractive() {
@@ -229,7 +229,7 @@ bool StubApplet::TransactionComplete() const {
229 229
230ResultCode StubApplet::GetStatus() const { 230ResultCode StubApplet::GetStatus() const {
231 LOG_WARNING(Service_AM, "called (STUBBED)"); 231 LOG_WARNING(Service_AM, "called (STUBBED)");
232 return RESULT_SUCCESS; 232 return ResultSuccess;
233} 233}
234 234
235void StubApplet::ExecuteInteractive() { 235void StubApplet::ExecuteInteractive() {
diff --git a/src/core/hle/service/am/applets/profile_select.cpp b/src/core/hle/service/am/applets/profile_select.cpp
index c91a9776a..37048be26 100644
--- a/src/core/hle/service/am/applets/profile_select.cpp
+++ b/src/core/hle/service/am/applets/profile_select.cpp
@@ -23,7 +23,7 @@ ProfileSelect::~ProfileSelect() = default;
23 23
24void ProfileSelect::Initialize() { 24void ProfileSelect::Initialize() {
25 complete = false; 25 complete = false;
26 status = RESULT_SUCCESS; 26 status = ResultSuccess;
27 final_data.clear(); 27 final_data.clear();
28 28
29 Applet::Initialize(); 29 Applet::Initialize();
diff --git a/src/core/hle/service/am/applets/profile_select.h b/src/core/hle/service/am/applets/profile_select.h
index f0dd6c1f3..8fb76e6c4 100644
--- a/src/core/hle/service/am/applets/profile_select.h
+++ b/src/core/hle/service/am/applets/profile_select.h
@@ -51,7 +51,7 @@ private:
51 51
52 UserSelectionConfig config; 52 UserSelectionConfig config;
53 bool complete = false; 53 bool complete = false;
54 ResultCode status = RESULT_SUCCESS; 54 ResultCode status = ResultSuccess;
55 std::vector<u8> final_data; 55 std::vector<u8> final_data;
56 Core::System& system; 56 Core::System& system;
57}; 57};
diff --git a/src/core/hle/service/am/applets/software_keyboard.cpp b/src/core/hle/service/am/applets/software_keyboard.cpp
index b05a5da04..00dfe1675 100644
--- a/src/core/hle/service/am/applets/software_keyboard.cpp
+++ b/src/core/hle/service/am/applets/software_keyboard.cpp
@@ -273,8 +273,13 @@ void SoftwareKeyboard::ProcessTextCheck() {
273 273
274 std::memcpy(&swkbd_text_check, text_check_data.data(), sizeof(SwkbdTextCheck)); 274 std::memcpy(&swkbd_text_check, text_check_data.data(), sizeof(SwkbdTextCheck));
275 275
276 std::u16string text_check_message = Common::UTF16StringFromFixedZeroTerminatedBuffer( 276 std::u16string text_check_message =
277 swkbd_text_check.text_check_message.data(), swkbd_text_check.text_check_message.size()); 277 swkbd_text_check.text_check_result == SwkbdTextCheckResult::Failure ||
278 swkbd_text_check.text_check_result == SwkbdTextCheckResult::Confirm
279 ? Common::UTF16StringFromFixedZeroTerminatedBuffer(
280 swkbd_text_check.text_check_message.data(),
281 swkbd_text_check.text_check_message.size())
282 : u"";
278 283
279 LOG_INFO(Service_AM, "\nTextCheckResult: {}\nTextCheckMessage: {}", 284 LOG_INFO(Service_AM, "\nTextCheckResult: {}\nTextCheckMessage: {}",
280 GetTextCheckResultName(swkbd_text_check.text_check_result), 285 GetTextCheckResultName(swkbd_text_check.text_check_result),
@@ -285,10 +290,10 @@ void SoftwareKeyboard::ProcessTextCheck() {
285 SubmitNormalOutputAndExit(SwkbdResult::Ok, current_text); 290 SubmitNormalOutputAndExit(SwkbdResult::Ok, current_text);
286 break; 291 break;
287 case SwkbdTextCheckResult::Failure: 292 case SwkbdTextCheckResult::Failure:
288 ShowTextCheckDialog(SwkbdTextCheckResult::Failure, text_check_message); 293 ShowTextCheckDialog(SwkbdTextCheckResult::Failure, std::move(text_check_message));
289 break; 294 break;
290 case SwkbdTextCheckResult::Confirm: 295 case SwkbdTextCheckResult::Confirm:
291 ShowTextCheckDialog(SwkbdTextCheckResult::Confirm, text_check_message); 296 ShowTextCheckDialog(SwkbdTextCheckResult::Confirm, std::move(text_check_message));
292 break; 297 break;
293 case SwkbdTextCheckResult::Silent: 298 case SwkbdTextCheckResult::Silent:
294 default: 299 default:
@@ -482,7 +487,7 @@ void SoftwareKeyboard::InitializeFrontendKeyboard() {
482 max_text_length <= 32 ? SwkbdTextDrawType::Line : SwkbdTextDrawType::Box; 487 max_text_length <= 32 ? SwkbdTextDrawType::Line : SwkbdTextDrawType::Box;
483 488
484 Core::Frontend::KeyboardInitializeParameters initialize_parameters{ 489 Core::Frontend::KeyboardInitializeParameters initialize_parameters{
485 .ok_text{ok_text}, 490 .ok_text{std::move(ok_text)},
486 .header_text{}, 491 .header_text{},
487 .sub_text{}, 492 .sub_text{},
488 .guide_text{}, 493 .guide_text{},
@@ -558,10 +563,10 @@ void SoftwareKeyboard::InitializeFrontendKeyboard() {
558 : false; 563 : false;
559 564
560 Core::Frontend::KeyboardInitializeParameters initialize_parameters{ 565 Core::Frontend::KeyboardInitializeParameters initialize_parameters{
561 .ok_text{ok_text}, 566 .ok_text{std::move(ok_text)},
562 .header_text{header_text}, 567 .header_text{std::move(header_text)},
563 .sub_text{sub_text}, 568 .sub_text{std::move(sub_text)},
564 .guide_text{guide_text}, 569 .guide_text{std::move(guide_text)},
565 .initial_text{initial_text}, 570 .initial_text{initial_text},
566 .max_text_length{max_text_length}, 571 .max_text_length{max_text_length},
567 .min_text_length{min_text_length}, 572 .min_text_length{min_text_length},
@@ -590,7 +595,7 @@ void SoftwareKeyboard::ShowNormalKeyboard() {
590 595
591void SoftwareKeyboard::ShowTextCheckDialog(SwkbdTextCheckResult text_check_result, 596void SoftwareKeyboard::ShowTextCheckDialog(SwkbdTextCheckResult text_check_result,
592 std::u16string text_check_message) { 597 std::u16string text_check_message) {
593 frontend.ShowTextCheckDialog(text_check_result, text_check_message); 598 frontend.ShowTextCheckDialog(text_check_result, std::move(text_check_message));
594} 599}
595 600
596void SoftwareKeyboard::ShowInlineKeyboard() { 601void SoftwareKeyboard::ShowInlineKeyboard() {
@@ -653,7 +658,7 @@ void SoftwareKeyboard::InlineTextChanged() {
653 658
654void SoftwareKeyboard::ExitKeyboard() { 659void SoftwareKeyboard::ExitKeyboard() {
655 complete = true; 660 complete = true;
656 status = RESULT_SUCCESS; 661 status = ResultSuccess;
657 662
658 frontend.ExitKeyboard(); 663 frontend.ExitKeyboard();
659 664
diff --git a/src/core/hle/service/am/applets/software_keyboard.h b/src/core/hle/service/am/applets/software_keyboard.h
index 7bdef78a7..e3fc733d0 100644
--- a/src/core/hle/service/am/applets/software_keyboard.h
+++ b/src/core/hle/service/am/applets/software_keyboard.h
@@ -160,7 +160,7 @@ private:
160 bool is_background{false}; 160 bool is_background{false};
161 161
162 bool complete{false}; 162 bool complete{false};
163 ResultCode status{RESULT_SUCCESS}; 163 ResultCode status{ResultSuccess};
164}; 164};
165 165
166} // namespace Service::AM::Applets 166} // namespace Service::AM::Applets
diff --git a/src/core/hle/service/am/applets/web_browser.h b/src/core/hle/service/am/applets/web_browser.h
index cdeaf2c40..9f81214b6 100644
--- a/src/core/hle/service/am/applets/web_browser.h
+++ b/src/core/hle/service/am/applets/web_browser.h
@@ -68,7 +68,7 @@ private:
68 const Core::Frontend::WebBrowserApplet& frontend; 68 const Core::Frontend::WebBrowserApplet& frontend;
69 69
70 bool complete{false}; 70 bool complete{false};
71 ResultCode status{RESULT_SUCCESS}; 71 ResultCode status{ResultSuccess};
72 72
73 WebAppletVersion web_applet_version{}; 73 WebAppletVersion web_applet_version{};
74 WebArgHeader web_arg_header{}; 74 WebArgHeader web_arg_header{};
diff --git a/src/core/hle/service/aoc/aoc_u.cpp b/src/core/hle/service/aoc/aoc_u.cpp
index 1863260f1..fec704c65 100644
--- a/src/core/hle/service/aoc/aoc_u.cpp
+++ b/src/core/hle/service/aoc/aoc_u.cpp
@@ -76,7 +76,7 @@ private:
76 LOG_WARNING(Service_AOC, "(STUBBED) called, unknown_1={}", unknown_1); 76 LOG_WARNING(Service_AOC, "(STUBBED) called, unknown_1={}", unknown_1);
77 77
78 IPC::ResponseBuilder rb{ctx, 2}; 78 IPC::ResponseBuilder rb{ctx, 2};
79 rb.Push(RESULT_SUCCESS); 79 rb.Push(ResultSuccess);
80 } 80 }
81 81
82 void SetDeliveryTarget(Kernel::HLERequestContext& ctx) { 82 void SetDeliveryTarget(Kernel::HLERequestContext& ctx) {
@@ -88,14 +88,14 @@ private:
88 LOG_WARNING(Service_AOC, "(STUBBED) called, unknown_1={}", unknown_1); 88 LOG_WARNING(Service_AOC, "(STUBBED) called, unknown_1={}", unknown_1);
89 89
90 IPC::ResponseBuilder rb{ctx, 2}; 90 IPC::ResponseBuilder rb{ctx, 2};
91 rb.Push(RESULT_SUCCESS); 91 rb.Push(ResultSuccess);
92 } 92 }
93 93
94 void GetPurchasedEventReadableHandle(Kernel::HLERequestContext& ctx) { 94 void GetPurchasedEventReadableHandle(Kernel::HLERequestContext& ctx) {
95 LOG_WARNING(Service_AOC, "called"); 95 LOG_WARNING(Service_AOC, "called");
96 96
97 IPC::ResponseBuilder rb{ctx, 2, 1}; 97 IPC::ResponseBuilder rb{ctx, 2, 1};
98 rb.Push(RESULT_SUCCESS); 98 rb.Push(ResultSuccess);
99 rb.PushCopyObjects(purchased_event.GetReadableEvent()); 99 rb.PushCopyObjects(purchased_event.GetReadableEvent());
100 } 100 }
101 101
@@ -144,7 +144,7 @@ void AOC_U::CountAddOnContent(Kernel::HLERequestContext& ctx) {
144 LOG_DEBUG(Service_AOC, "called. process_id={}", params.process_id); 144 LOG_DEBUG(Service_AOC, "called. process_id={}", params.process_id);
145 145
146 IPC::ResponseBuilder rb{ctx, 3}; 146 IPC::ResponseBuilder rb{ctx, 3};
147 rb.Push(RESULT_SUCCESS); 147 rb.Push(ResultSuccess);
148 148
149 const auto current = system.CurrentProcess()->GetTitleID(); 149 const auto current = system.CurrentProcess()->GetTitleID();
150 150
@@ -190,7 +190,7 @@ void AOC_U::ListAddOnContent(Kernel::HLERequestContext& ctx) {
190 if (out.size() < offset) { 190 if (out.size() < offset) {
191 IPC::ResponseBuilder rb{ctx, 2}; 191 IPC::ResponseBuilder rb{ctx, 2};
192 // TODO(DarkLordZach): Find the correct error code. 192 // TODO(DarkLordZach): Find the correct error code.
193 rb.Push(RESULT_UNKNOWN); 193 rb.Push(ResultUnknown);
194 return; 194 return;
195 } 195 }
196 196
@@ -201,7 +201,7 @@ void AOC_U::ListAddOnContent(Kernel::HLERequestContext& ctx) {
201 ctx.WriteBuffer(out); 201 ctx.WriteBuffer(out);
202 202
203 IPC::ResponseBuilder rb{ctx, 3}; 203 IPC::ResponseBuilder rb{ctx, 3};
204 rb.Push(RESULT_SUCCESS); 204 rb.Push(ResultSuccess);
205 rb.Push(out_count); 205 rb.Push(out_count);
206} 206}
207 207
@@ -217,7 +217,7 @@ void AOC_U::GetAddOnContentBaseId(Kernel::HLERequestContext& ctx) {
217 LOG_DEBUG(Service_AOC, "called. process_id={}", params.process_id); 217 LOG_DEBUG(Service_AOC, "called. process_id={}", params.process_id);
218 218
219 IPC::ResponseBuilder rb{ctx, 4}; 219 IPC::ResponseBuilder rb{ctx, 4};
220 rb.Push(RESULT_SUCCESS); 220 rb.Push(ResultSuccess);
221 221
222 const auto title_id = system.CurrentProcess()->GetTitleID(); 222 const auto title_id = system.CurrentProcess()->GetTitleID();
223 const FileSys::PatchManager pm{title_id, system.GetFileSystemController(), 223 const FileSys::PatchManager pm{title_id, system.GetFileSystemController(),
@@ -246,14 +246,14 @@ void AOC_U::PrepareAddOnContent(Kernel::HLERequestContext& ctx) {
246 process_id); 246 process_id);
247 247
248 IPC::ResponseBuilder rb{ctx, 2}; 248 IPC::ResponseBuilder rb{ctx, 2};
249 rb.Push(RESULT_SUCCESS); 249 rb.Push(ResultSuccess);
250} 250}
251 251
252void AOC_U::GetAddOnContentListChangedEvent(Kernel::HLERequestContext& ctx) { 252void AOC_U::GetAddOnContentListChangedEvent(Kernel::HLERequestContext& ctx) {
253 LOG_WARNING(Service_AOC, "(STUBBED) called"); 253 LOG_WARNING(Service_AOC, "(STUBBED) called");
254 254
255 IPC::ResponseBuilder rb{ctx, 2, 1}; 255 IPC::ResponseBuilder rb{ctx, 2, 1};
256 rb.Push(RESULT_SUCCESS); 256 rb.Push(ResultSuccess);
257 rb.PushCopyObjects(aoc_change_event.GetReadableEvent()); 257 rb.PushCopyObjects(aoc_change_event.GetReadableEvent());
258} 258}
259 259
@@ -261,7 +261,7 @@ void AOC_U::CreateEcPurchasedEventManager(Kernel::HLERequestContext& ctx) {
261 LOG_WARNING(Service_AOC, "(STUBBED) called"); 261 LOG_WARNING(Service_AOC, "(STUBBED) called");
262 262
263 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 263 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
264 rb.Push(RESULT_SUCCESS); 264 rb.Push(ResultSuccess);
265 rb.PushIpcInterface<IPurchaseEventManager>(system); 265 rb.PushIpcInterface<IPurchaseEventManager>(system);
266} 266}
267 267
@@ -269,7 +269,7 @@ void AOC_U::CreatePermanentEcPurchasedEventManager(Kernel::HLERequestContext& ct
269 LOG_WARNING(Service_AOC, "(STUBBED) called"); 269 LOG_WARNING(Service_AOC, "(STUBBED) called");
270 270
271 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 271 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
272 rb.Push(RESULT_SUCCESS); 272 rb.Push(ResultSuccess);
273 rb.PushIpcInterface<IPurchaseEventManager>(system); 273 rb.PushIpcInterface<IPurchaseEventManager>(system);
274} 274}
275 275
diff --git a/src/core/hle/service/apm/interface.cpp b/src/core/hle/service/apm/interface.cpp
index 0bff97a37..d69ddd135 100644
--- a/src/core/hle/service/apm/interface.cpp
+++ b/src/core/hle/service/apm/interface.cpp
@@ -33,7 +33,7 @@ private:
33 controller.SetPerformanceConfiguration(mode, config); 33 controller.SetPerformanceConfiguration(mode, config);
34 34
35 IPC::ResponseBuilder rb{ctx, 2}; 35 IPC::ResponseBuilder rb{ctx, 2};
36 rb.Push(RESULT_SUCCESS); 36 rb.Push(ResultSuccess);
37 } 37 }
38 38
39 void GetPerformanceConfiguration(Kernel::HLERequestContext& ctx) { 39 void GetPerformanceConfiguration(Kernel::HLERequestContext& ctx) {
@@ -43,7 +43,7 @@ private:
43 LOG_DEBUG(Service_APM, "called mode={}", mode); 43 LOG_DEBUG(Service_APM, "called mode={}", mode);
44 44
45 IPC::ResponseBuilder rb{ctx, 3}; 45 IPC::ResponseBuilder rb{ctx, 3};
46 rb.Push(RESULT_SUCCESS); 46 rb.Push(ResultSuccess);
47 rb.PushEnum(controller.GetCurrentPerformanceConfiguration(mode)); 47 rb.PushEnum(controller.GetCurrentPerformanceConfiguration(mode));
48 } 48 }
49 49
@@ -67,7 +67,7 @@ void APM::OpenSession(Kernel::HLERequestContext& ctx) {
67 LOG_DEBUG(Service_APM, "called"); 67 LOG_DEBUG(Service_APM, "called");
68 68
69 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 69 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
70 rb.Push(RESULT_SUCCESS); 70 rb.Push(ResultSuccess);
71 rb.PushIpcInterface<ISession>(system, controller); 71 rb.PushIpcInterface<ISession>(system, controller);
72} 72}
73 73
@@ -82,7 +82,7 @@ void APM::IsCpuOverclockEnabled(Kernel::HLERequestContext& ctx) {
82 LOG_WARNING(Service_APM, "(STUBBED) called"); 82 LOG_WARNING(Service_APM, "(STUBBED) called");
83 83
84 IPC::ResponseBuilder rb{ctx, 3}; 84 IPC::ResponseBuilder rb{ctx, 3};
85 rb.Push(RESULT_SUCCESS); 85 rb.Push(ResultSuccess);
86 rb.Push(false); 86 rb.Push(false);
87} 87}
88 88
@@ -110,7 +110,7 @@ void APM_Sys::GetPerformanceEvent(Kernel::HLERequestContext& ctx) {
110 LOG_DEBUG(Service_APM, "called"); 110 LOG_DEBUG(Service_APM, "called");
111 111
112 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 112 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
113 rb.Push(RESULT_SUCCESS); 113 rb.Push(ResultSuccess);
114 rb.PushIpcInterface<ISession>(system, controller); 114 rb.PushIpcInterface<ISession>(system, controller);
115} 115}
116 116
@@ -123,14 +123,14 @@ void APM_Sys::SetCpuBoostMode(Kernel::HLERequestContext& ctx) {
123 controller.SetFromCpuBoostMode(mode); 123 controller.SetFromCpuBoostMode(mode);
124 124
125 IPC::ResponseBuilder rb{ctx, 2}; 125 IPC::ResponseBuilder rb{ctx, 2};
126 rb.Push(RESULT_SUCCESS); 126 rb.Push(ResultSuccess);
127} 127}
128 128
129void APM_Sys::GetCurrentPerformanceConfiguration(Kernel::HLERequestContext& ctx) { 129void APM_Sys::GetCurrentPerformanceConfiguration(Kernel::HLERequestContext& ctx) {
130 LOG_DEBUG(Service_APM, "called"); 130 LOG_DEBUG(Service_APM, "called");
131 131
132 IPC::ResponseBuilder rb{ctx, 3}; 132 IPC::ResponseBuilder rb{ctx, 3};
133 rb.Push(RESULT_SUCCESS); 133 rb.Push(ResultSuccess);
134 rb.PushEnum( 134 rb.PushEnum(
135 controller.GetCurrentPerformanceConfiguration(controller.GetCurrentPerformanceMode())); 135 controller.GetCurrentPerformanceConfiguration(controller.GetCurrentPerformanceMode()));
136} 136}
diff --git a/src/core/hle/service/audio/audctl.cpp b/src/core/hle/service/audio/audctl.cpp
index 84890be72..8c4c49b85 100644
--- a/src/core/hle/service/audio/audctl.cpp
+++ b/src/core/hle/service/audio/audctl.cpp
@@ -57,7 +57,7 @@ void AudCtl::GetTargetVolumeMin(Kernel::HLERequestContext& ctx) {
57 constexpr s32 target_min_volume = 0; 57 constexpr s32 target_min_volume = 0;
58 58
59 IPC::ResponseBuilder rb{ctx, 3}; 59 IPC::ResponseBuilder rb{ctx, 3};
60 rb.Push(RESULT_SUCCESS); 60 rb.Push(ResultSuccess);
61 rb.Push(target_min_volume); 61 rb.Push(target_min_volume);
62} 62}
63 63
@@ -69,7 +69,7 @@ void AudCtl::GetTargetVolumeMax(Kernel::HLERequestContext& ctx) {
69 constexpr s32 target_max_volume = 15; 69 constexpr s32 target_max_volume = 15;
70 70
71 IPC::ResponseBuilder rb{ctx, 3}; 71 IPC::ResponseBuilder rb{ctx, 3};
72 rb.Push(RESULT_SUCCESS); 72 rb.Push(ResultSuccess);
73 rb.Push(target_max_volume); 73 rb.Push(target_max_volume);
74} 74}
75 75
diff --git a/src/core/hle/service/audio/audin_u.cpp b/src/core/hle/service/audio/audin_u.cpp
index ecd05e4a6..3e7fd6024 100644
--- a/src/core/hle/service/audio/audin_u.cpp
+++ b/src/core/hle/service/audio/audin_u.cpp
@@ -70,7 +70,7 @@ void AudInU::ListAudioIns(Kernel::HLERequestContext& ctx) {
70 ctx.WriteBuffer(device_names); 70 ctx.WriteBuffer(device_names);
71 71
72 IPC::ResponseBuilder rb{ctx, 3}; 72 IPC::ResponseBuilder rb{ctx, 3};
73 rb.Push(RESULT_SUCCESS); 73 rb.Push(ResultSuccess);
74 rb.Push(static_cast<u32>(device_names.size())); 74 rb.Push(static_cast<u32>(device_names.size()));
75} 75}
76 76
@@ -82,7 +82,7 @@ void AudInU::ListAudioInsAutoFiltered(Kernel::HLERequestContext& ctx) {
82 // device listing just omits the default input device 82 // device listing just omits the default input device
83 83
84 IPC::ResponseBuilder rb{ctx, 3}; 84 IPC::ResponseBuilder rb{ctx, 3};
85 rb.Push(RESULT_SUCCESS); 85 rb.Push(ResultSuccess);
86 rb.Push(static_cast<u32>(device_count)); 86 rb.Push(static_cast<u32>(device_count));
87} 87}
88 88
@@ -94,7 +94,7 @@ void AudInU::OpenInOutImpl(Kernel::HLERequestContext& ctx) {
94 params.state = State::Started; 94 params.state = State::Started;
95 95
96 IPC::ResponseBuilder rb{ctx, 6, 0, 1}; 96 IPC::ResponseBuilder rb{ctx, 6, 0, 1};
97 rb.Push(RESULT_SUCCESS); 97 rb.Push(ResultSuccess);
98 rb.PushRaw<AudInOutParams>(params); 98 rb.PushRaw<AudInOutParams>(params);
99 rb.PushIpcInterface<IAudioIn>(system); 99 rb.PushIpcInterface<IAudioIn>(system);
100} 100}
diff --git a/src/core/hle/service/audio/audout_u.cpp b/src/core/hle/service/audio/audout_u.cpp
index e1ae726f5..804c6b10c 100644
--- a/src/core/hle/service/audio/audout_u.cpp
+++ b/src/core/hle/service/audio/audout_u.cpp
@@ -91,7 +91,7 @@ private:
91 LOG_DEBUG(Service_Audio, "called"); 91 LOG_DEBUG(Service_Audio, "called");
92 92
93 IPC::ResponseBuilder rb{ctx, 3}; 93 IPC::ResponseBuilder rb{ctx, 3};
94 rb.Push(RESULT_SUCCESS); 94 rb.Push(ResultSuccess);
95 rb.Push(static_cast<u32>(stream->IsPlaying() ? AudioState::Started : AudioState::Stopped)); 95 rb.Push(static_cast<u32>(stream->IsPlaying() ? AudioState::Started : AudioState::Stopped));
96 } 96 }
97 97
@@ -107,7 +107,7 @@ private:
107 audio_core.StartStream(stream); 107 audio_core.StartStream(stream);
108 108
109 IPC::ResponseBuilder rb{ctx, 2}; 109 IPC::ResponseBuilder rb{ctx, 2};
110 rb.Push(RESULT_SUCCESS); 110 rb.Push(ResultSuccess);
111 } 111 }
112 112
113 void StopAudioOut(Kernel::HLERequestContext& ctx) { 113 void StopAudioOut(Kernel::HLERequestContext& ctx) {
@@ -118,14 +118,14 @@ private:
118 } 118 }
119 119
120 IPC::ResponseBuilder rb{ctx, 2}; 120 IPC::ResponseBuilder rb{ctx, 2};
121 rb.Push(RESULT_SUCCESS); 121 rb.Push(ResultSuccess);
122 } 122 }
123 123
124 void RegisterBufferEvent(Kernel::HLERequestContext& ctx) { 124 void RegisterBufferEvent(Kernel::HLERequestContext& ctx) {
125 LOG_DEBUG(Service_Audio, "called"); 125 LOG_DEBUG(Service_Audio, "called");
126 126
127 IPC::ResponseBuilder rb{ctx, 2, 1}; 127 IPC::ResponseBuilder rb{ctx, 2, 1};
128 rb.Push(RESULT_SUCCESS); 128 rb.Push(ResultSuccess);
129 rb.PushCopyObjects(buffer_event.GetReadableEvent()); 129 rb.PushCopyObjects(buffer_event.GetReadableEvent());
130 } 130 }
131 131
@@ -150,7 +150,7 @@ private:
150 } 150 }
151 151
152 IPC::ResponseBuilder rb{ctx, 2}; 152 IPC::ResponseBuilder rb{ctx, 2};
153 rb.Push(RESULT_SUCCESS); 153 rb.Push(ResultSuccess);
154 } 154 }
155 155
156 void GetReleasedAudioOutBufferImpl(Kernel::HLERequestContext& ctx) { 156 void GetReleasedAudioOutBufferImpl(Kernel::HLERequestContext& ctx) {
@@ -164,7 +164,7 @@ private:
164 ctx.WriteBuffer(tags); 164 ctx.WriteBuffer(tags);
165 165
166 IPC::ResponseBuilder rb{ctx, 3}; 166 IPC::ResponseBuilder rb{ctx, 3};
167 rb.Push(RESULT_SUCCESS); 167 rb.Push(ResultSuccess);
168 rb.Push<u32>(static_cast<u32>(released_buffers.size())); 168 rb.Push<u32>(static_cast<u32>(released_buffers.size()));
169 } 169 }
170 170
@@ -174,7 +174,7 @@ private:
174 IPC::RequestParser rp{ctx}; 174 IPC::RequestParser rp{ctx};
175 const u64 tag{rp.Pop<u64>()}; 175 const u64 tag{rp.Pop<u64>()};
176 IPC::ResponseBuilder rb{ctx, 3}; 176 IPC::ResponseBuilder rb{ctx, 3};
177 rb.Push(RESULT_SUCCESS); 177 rb.Push(ResultSuccess);
178 rb.Push(stream->ContainsBuffer(tag)); 178 rb.Push(stream->ContainsBuffer(tag));
179 } 179 }
180 180
@@ -182,7 +182,7 @@ private:
182 LOG_DEBUG(Service_Audio, "called"); 182 LOG_DEBUG(Service_Audio, "called");
183 183
184 IPC::ResponseBuilder rb{ctx, 3}; 184 IPC::ResponseBuilder rb{ctx, 3};
185 rb.Push(RESULT_SUCCESS); 185 rb.Push(ResultSuccess);
186 rb.Push(static_cast<u32>(stream->GetQueueSize())); 186 rb.Push(static_cast<u32>(stream->GetQueueSize()));
187 } 187 }
188 188
@@ -190,7 +190,7 @@ private:
190 LOG_DEBUG(Service_Audio, "called"); 190 LOG_DEBUG(Service_Audio, "called");
191 191
192 IPC::ResponseBuilder rb{ctx, 3}; 192 IPC::ResponseBuilder rb{ctx, 3};
193 rb.Push(RESULT_SUCCESS); 193 rb.Push(ResultSuccess);
194 rb.Push(stream->Flush()); 194 rb.Push(stream->Flush());
195 } 195 }
196 196
@@ -202,14 +202,14 @@ private:
202 stream->SetVolume(volume); 202 stream->SetVolume(volume);
203 203
204 IPC::ResponseBuilder rb{ctx, 2}; 204 IPC::ResponseBuilder rb{ctx, 2};
205 rb.Push(RESULT_SUCCESS); 205 rb.Push(ResultSuccess);
206 } 206 }
207 207
208 void GetAudioOutVolume(Kernel::HLERequestContext& ctx) { 208 void GetAudioOutVolume(Kernel::HLERequestContext& ctx) {
209 LOG_DEBUG(Service_Audio, "called"); 209 LOG_DEBUG(Service_Audio, "called");
210 210
211 IPC::ResponseBuilder rb{ctx, 3}; 211 IPC::ResponseBuilder rb{ctx, 3};
212 rb.Push(RESULT_SUCCESS); 212 rb.Push(ResultSuccess);
213 rb.Push(stream->GetVolume()); 213 rb.Push(stream->GetVolume());
214 } 214 }
215 215
@@ -246,7 +246,7 @@ void AudOutU::ListAudioOutsImpl(Kernel::HLERequestContext& ctx) {
246 ctx.WriteBuffer(DefaultDevice); 246 ctx.WriteBuffer(DefaultDevice);
247 247
248 IPC::ResponseBuilder rb{ctx, 3}; 248 IPC::ResponseBuilder rb{ctx, 3};
249 rb.Push(RESULT_SUCCESS); 249 rb.Push(ResultSuccess);
250 rb.Push<u32>(1); // Amount of audio devices 250 rb.Push<u32>(1); // Amount of audio devices
251} 251}
252 252
@@ -279,7 +279,7 @@ void AudOutU::OpenAudioOutImpl(Kernel::HLERequestContext& ctx) {
279 system, params, *audio_core, std::move(device_name), std::move(unique_name)); 279 system, params, *audio_core, std::move(device_name), std::move(unique_name));
280 280
281 IPC::ResponseBuilder rb{ctx, 6, 0, 1}; 281 IPC::ResponseBuilder rb{ctx, 6, 0, 1};
282 rb.Push(RESULT_SUCCESS); 282 rb.Push(ResultSuccess);
283 rb.Push<u32>(DefaultSampleRate); 283 rb.Push<u32>(DefaultSampleRate);
284 rb.Push<u32>(params.channel_count); 284 rb.Push<u32>(params.channel_count);
285 rb.Push<u32>(static_cast<u32>(AudioCore::Codec::PcmFormat::Int16)); 285 rb.Push<u32>(static_cast<u32>(AudioCore::Codec::PcmFormat::Int16));
diff --git a/src/core/hle/service/audio/audren_u.cpp b/src/core/hle/service/audio/audren_u.cpp
index ae4284adf..800feba6e 100644
--- a/src/core/hle/service/audio/audren_u.cpp
+++ b/src/core/hle/service/audio/audren_u.cpp
@@ -65,7 +65,7 @@ private:
65 LOG_DEBUG(Service_Audio, "called"); 65 LOG_DEBUG(Service_Audio, "called");
66 66
67 IPC::ResponseBuilder rb{ctx, 3}; 67 IPC::ResponseBuilder rb{ctx, 3};
68 rb.Push(RESULT_SUCCESS); 68 rb.Push(ResultSuccess);
69 rb.Push<u32>(renderer->GetSampleRate()); 69 rb.Push<u32>(renderer->GetSampleRate());
70 } 70 }
71 71
@@ -73,7 +73,7 @@ private:
73 LOG_DEBUG(Service_Audio, "called"); 73 LOG_DEBUG(Service_Audio, "called");
74 74
75 IPC::ResponseBuilder rb{ctx, 3}; 75 IPC::ResponseBuilder rb{ctx, 3};
76 rb.Push(RESULT_SUCCESS); 76 rb.Push(ResultSuccess);
77 rb.Push<u32>(renderer->GetSampleCount()); 77 rb.Push<u32>(renderer->GetSampleCount());
78 } 78 }
79 79
@@ -81,7 +81,7 @@ private:
81 LOG_DEBUG(Service_Audio, "called"); 81 LOG_DEBUG(Service_Audio, "called");
82 82
83 IPC::ResponseBuilder rb{ctx, 3}; 83 IPC::ResponseBuilder rb{ctx, 3};
84 rb.Push(RESULT_SUCCESS); 84 rb.Push(ResultSuccess);
85 rb.Push<u32>(static_cast<u32>(renderer->GetStreamState())); 85 rb.Push<u32>(static_cast<u32>(renderer->GetStreamState()));
86 } 86 }
87 87
@@ -89,7 +89,7 @@ private:
89 LOG_DEBUG(Service_Audio, "called"); 89 LOG_DEBUG(Service_Audio, "called");
90 90
91 IPC::ResponseBuilder rb{ctx, 3}; 91 IPC::ResponseBuilder rb{ctx, 3};
92 rb.Push(RESULT_SUCCESS); 92 rb.Push(ResultSuccess);
93 rb.Push<u32>(renderer->GetMixBufferCount()); 93 rb.Push<u32>(renderer->GetMixBufferCount());
94 } 94 }
95 95
@@ -112,7 +112,7 @@ private:
112 112
113 IPC::ResponseBuilder rb{ctx, 2}; 113 IPC::ResponseBuilder rb{ctx, 2};
114 114
115 rb.Push(RESULT_SUCCESS); 115 rb.Push(ResultSuccess);
116 } 116 }
117 117
118 void Stop(Kernel::HLERequestContext& ctx) { 118 void Stop(Kernel::HLERequestContext& ctx) {
@@ -120,14 +120,14 @@ private:
120 120
121 IPC::ResponseBuilder rb{ctx, 2}; 121 IPC::ResponseBuilder rb{ctx, 2};
122 122
123 rb.Push(RESULT_SUCCESS); 123 rb.Push(ResultSuccess);
124 } 124 }
125 125
126 void QuerySystemEvent(Kernel::HLERequestContext& ctx) { 126 void QuerySystemEvent(Kernel::HLERequestContext& ctx) {
127 LOG_WARNING(Service_Audio, "(STUBBED) called"); 127 LOG_WARNING(Service_Audio, "(STUBBED) called");
128 128
129 IPC::ResponseBuilder rb{ctx, 2, 1}; 129 IPC::ResponseBuilder rb{ctx, 2, 1};
130 rb.Push(RESULT_SUCCESS); 130 rb.Push(ResultSuccess);
131 rb.PushCopyObjects(system_event.GetReadableEvent()); 131 rb.PushCopyObjects(system_event.GetReadableEvent());
132 } 132 }
133 133
@@ -140,14 +140,14 @@ private:
140 ASSERT(rendering_time_limit_percent <= 100); 140 ASSERT(rendering_time_limit_percent <= 100);
141 141
142 IPC::ResponseBuilder rb{ctx, 2}; 142 IPC::ResponseBuilder rb{ctx, 2};
143 rb.Push(RESULT_SUCCESS); 143 rb.Push(ResultSuccess);
144 } 144 }
145 145
146 void GetRenderingTimeLimit(Kernel::HLERequestContext& ctx) { 146 void GetRenderingTimeLimit(Kernel::HLERequestContext& ctx) {
147 LOG_DEBUG(Service_Audio, "called"); 147 LOG_DEBUG(Service_Audio, "called");
148 148
149 IPC::ResponseBuilder rb{ctx, 3}; 149 IPC::ResponseBuilder rb{ctx, 3};
150 rb.Push(RESULT_SUCCESS); 150 rb.Push(ResultSuccess);
151 rb.Push(rendering_time_limit_percent); 151 rb.Push(rendering_time_limit_percent);
152 } 152 }
153 153
@@ -230,7 +230,7 @@ private:
230 ctx.WriteBuffer(name_buffer); 230 ctx.WriteBuffer(name_buffer);
231 231
232 IPC::ResponseBuilder rb{ctx, 3}; 232 IPC::ResponseBuilder rb{ctx, 3};
233 rb.Push(RESULT_SUCCESS); 233 rb.Push(ResultSuccess);
234 rb.Push(static_cast<u32>(name_buffer.size())); 234 rb.Push(static_cast<u32>(name_buffer.size()));
235 } 235 }
236 236
@@ -244,7 +244,7 @@ private:
244 LOG_WARNING(Service_Audio, "(STUBBED) called. name={}, volume={}", name, volume); 244 LOG_WARNING(Service_Audio, "(STUBBED) called. name={}, volume={}", name, volume);
245 245
246 IPC::ResponseBuilder rb{ctx, 2}; 246 IPC::ResponseBuilder rb{ctx, 2};
247 rb.Push(RESULT_SUCCESS); 247 rb.Push(ResultSuccess);
248 } 248 }
249 249
250 void GetAudioDeviceOutputVolume(Kernel::HLERequestContext& ctx) { 250 void GetAudioDeviceOutputVolume(Kernel::HLERequestContext& ctx) {
@@ -254,7 +254,7 @@ private:
254 LOG_WARNING(Service_Audio, "(STUBBED) called. name={}", name); 254 LOG_WARNING(Service_Audio, "(STUBBED) called. name={}", name);
255 255
256 IPC::ResponseBuilder rb{ctx, 3}; 256 IPC::ResponseBuilder rb{ctx, 3};
257 rb.Push(RESULT_SUCCESS); 257 rb.Push(ResultSuccess);
258 rb.Push(1.0f); 258 rb.Push(1.0f);
259 } 259 }
260 260
@@ -270,7 +270,7 @@ private:
270 ctx.WriteBuffer(out_device_name); 270 ctx.WriteBuffer(out_device_name);
271 271
272 IPC::ResponseBuilder rb{ctx, 2}; 272 IPC::ResponseBuilder rb{ctx, 2};
273 rb.Push(RESULT_SUCCESS); 273 rb.Push(ResultSuccess);
274 } 274 }
275 275
276 void QueryAudioDeviceSystemEvent(Kernel::HLERequestContext& ctx) { 276 void QueryAudioDeviceSystemEvent(Kernel::HLERequestContext& ctx) {
@@ -279,7 +279,7 @@ private:
279 buffer_event.GetWritableEvent().Signal(); 279 buffer_event.GetWritableEvent().Signal();
280 280
281 IPC::ResponseBuilder rb{ctx, 2, 1}; 281 IPC::ResponseBuilder rb{ctx, 2, 1};
282 rb.Push(RESULT_SUCCESS); 282 rb.Push(ResultSuccess);
283 rb.PushCopyObjects(buffer_event.GetReadableEvent()); 283 rb.PushCopyObjects(buffer_event.GetReadableEvent());
284 } 284 }
285 285
@@ -287,7 +287,7 @@ private:
287 LOG_WARNING(Service_Audio, "(STUBBED) called"); 287 LOG_WARNING(Service_Audio, "(STUBBED) called");
288 288
289 IPC::ResponseBuilder rb{ctx, 3}; 289 IPC::ResponseBuilder rb{ctx, 3};
290 rb.Push(RESULT_SUCCESS); 290 rb.Push(ResultSuccess);
291 rb.Push<u32>(1); 291 rb.Push<u32>(1);
292 } 292 }
293 293
@@ -296,7 +296,7 @@ private:
296 LOG_WARNING(Service_Audio, "(STUBBED) called"); 296 LOG_WARNING(Service_Audio, "(STUBBED) called");
297 297
298 IPC::ResponseBuilder rb{ctx, 2, 1}; 298 IPC::ResponseBuilder rb{ctx, 2, 1};
299 rb.Push(RESULT_SUCCESS); 299 rb.Push(ResultSuccess);
300 rb.PushCopyObjects(buffer_event.GetReadableEvent()); 300 rb.PushCopyObjects(buffer_event.GetReadableEvent());
301 } 301 }
302 302
@@ -304,7 +304,7 @@ private:
304 LOG_DEBUG(Service_Audio, "called"); 304 LOG_DEBUG(Service_Audio, "called");
305 305
306 IPC::ResponseBuilder rb{ctx, 2, 1}; 306 IPC::ResponseBuilder rb{ctx, 2, 1};
307 rb.Push(RESULT_SUCCESS); 307 rb.Push(ResultSuccess);
308 rb.PushCopyObjects(buffer_event.GetReadableEvent()); 308 rb.PushCopyObjects(buffer_event.GetReadableEvent());
309 } 309 }
310 310
@@ -636,7 +636,7 @@ void AudRenU::GetAudioRendererWorkBufferSize(Kernel::HLERequestContext& ctx) {
636 size = Common::AlignUp(size, 4096); 636 size = Common::AlignUp(size, 4096);
637 637
638 IPC::ResponseBuilder rb{ctx, 4}; 638 IPC::ResponseBuilder rb{ctx, 4};
639 rb.Push(RESULT_SUCCESS); 639 rb.Push(ResultSuccess);
640 rb.Push<u64>(size); 640 rb.Push<u64>(size);
641 641
642 LOG_DEBUG(Service_Audio, "buffer_size=0x{:X}", size); 642 LOG_DEBUG(Service_Audio, "buffer_size=0x{:X}", size);
@@ -651,7 +651,7 @@ void AudRenU::GetAudioDeviceService(Kernel::HLERequestContext& ctx) {
651 // Revisionless variant of GetAudioDeviceServiceWithRevisionInfo that 651 // Revisionless variant of GetAudioDeviceServiceWithRevisionInfo that
652 // always assumes the initial release revision (REV1). 652 // always assumes the initial release revision (REV1).
653 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 653 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
654 rb.Push(RESULT_SUCCESS); 654 rb.Push(ResultSuccess);
655 rb.PushIpcInterface<IAudioDevice>(system, buffer_event, Common::MakeMagic('R', 'E', 'V', '1')); 655 rb.PushIpcInterface<IAudioDevice>(system, buffer_event, Common::MakeMagic('R', 'E', 'V', '1'));
656} 656}
657 657
@@ -673,7 +673,7 @@ void AudRenU::GetAudioDeviceServiceWithRevisionInfo(Kernel::HLERequestContext& c
673 LOG_DEBUG(Service_Audio, "called. revision={:08X}, aruid={:016X}", revision, aruid); 673 LOG_DEBUG(Service_Audio, "called. revision={:08X}, aruid={:016X}", revision, aruid);
674 674
675 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 675 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
676 rb.Push(RESULT_SUCCESS); 676 rb.Push(ResultSuccess);
677 rb.PushIpcInterface<IAudioDevice>(system, buffer_event, revision); 677 rb.PushIpcInterface<IAudioDevice>(system, buffer_event, revision);
678} 678}
679 679
@@ -682,7 +682,7 @@ void AudRenU::OpenAudioRendererImpl(Kernel::HLERequestContext& ctx) {
682 const auto params = rp.PopRaw<AudioCommon::AudioRendererParameter>(); 682 const auto params = rp.PopRaw<AudioCommon::AudioRendererParameter>();
683 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 683 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
684 684
685 rb.Push(RESULT_SUCCESS); 685 rb.Push(ResultSuccess);
686 rb.PushIpcInterface<IAudioRenderer>(system, params, audren_instance_count++); 686 rb.PushIpcInterface<IAudioRenderer>(system, params, audren_instance_count++);
687} 687}
688 688
diff --git a/src/core/hle/service/audio/hwopus.cpp b/src/core/hle/service/audio/hwopus.cpp
index ee5ec8cd6..10e6f7a64 100644
--- a/src/core/hle/service/audio/hwopus.cpp
+++ b/src/core/hle/service/audio/hwopus.cpp
@@ -80,13 +80,13 @@ private:
80 LOG_ERROR(Audio, "Failed to decode opus data"); 80 LOG_ERROR(Audio, "Failed to decode opus data");
81 IPC::ResponseBuilder rb{ctx, 2}; 81 IPC::ResponseBuilder rb{ctx, 2};
82 // TODO(ogniK): Use correct error code 82 // TODO(ogniK): Use correct error code
83 rb.Push(RESULT_UNKNOWN); 83 rb.Push(ResultUnknown);
84 return; 84 return;
85 } 85 }
86 86
87 const u32 param_size = performance != nullptr ? 6 : 4; 87 const u32 param_size = performance != nullptr ? 6 : 4;
88 IPC::ResponseBuilder rb{ctx, param_size}; 88 IPC::ResponseBuilder rb{ctx, param_size};
89 rb.Push(RESULT_SUCCESS); 89 rb.Push(ResultSuccess);
90 rb.Push<u32>(consumed); 90 rb.Push<u32>(consumed);
91 rb.Push<u32>(sample_count); 91 rb.Push<u32>(sample_count);
92 if (performance) { 92 if (performance) {
@@ -249,7 +249,7 @@ void HwOpus::GetWorkBufferSize(Kernel::HLERequestContext& ctx) {
249 LOG_DEBUG(Audio, "worker_buffer_sz={}", worker_buffer_sz); 249 LOG_DEBUG(Audio, "worker_buffer_sz={}", worker_buffer_sz);
250 250
251 IPC::ResponseBuilder rb{ctx, 3}; 251 IPC::ResponseBuilder rb{ctx, 3};
252 rb.Push(RESULT_SUCCESS); 252 rb.Push(ResultSuccess);
253 rb.Push<u32>(worker_buffer_sz); 253 rb.Push<u32>(worker_buffer_sz);
254} 254}
255 255
@@ -281,12 +281,12 @@ void HwOpus::OpenOpusDecoder(Kernel::HLERequestContext& ctx) {
281 LOG_ERROR(Audio, "Failed to create Opus decoder (error={}).", error); 281 LOG_ERROR(Audio, "Failed to create Opus decoder (error={}).", error);
282 IPC::ResponseBuilder rb{ctx, 2}; 282 IPC::ResponseBuilder rb{ctx, 2};
283 // TODO(ogniK): Use correct error code 283 // TODO(ogniK): Use correct error code
284 rb.Push(RESULT_UNKNOWN); 284 rb.Push(ResultUnknown);
285 return; 285 return;
286 } 286 }
287 287
288 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 288 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
289 rb.Push(RESULT_SUCCESS); 289 rb.Push(ResultSuccess);
290 rb.PushIpcInterface<IHardwareOpusDecoderManager>( 290 rb.PushIpcInterface<IHardwareOpusDecoderManager>(
291 system, OpusDecoderState{std::move(decoder), sample_rate, channel_count}); 291 system, OpusDecoderState{std::move(decoder), sample_rate, channel_count});
292} 292}
diff --git a/src/core/hle/service/bcat/backend/backend.cpp b/src/core/hle/service/bcat/backend/backend.cpp
index 0e935bfa6..a78544c88 100644
--- a/src/core/hle/service/bcat/backend/backend.cpp
+++ b/src/core/hle/service/bcat/backend/backend.cpp
@@ -106,7 +106,7 @@ bool NullBackend::Synchronize(TitleIDVersion title, ProgressServiceBackend& prog
106 LOG_DEBUG(Service_BCAT, "called, title_id={:016X}, build_id={:016X}", title.title_id, 106 LOG_DEBUG(Service_BCAT, "called, title_id={:016X}, build_id={:016X}", title.title_id,
107 title.build_id); 107 title.build_id);
108 108
109 progress.FinishDownload(RESULT_SUCCESS); 109 progress.FinishDownload(ResultSuccess);
110 return true; 110 return true;
111} 111}
112 112
@@ -115,7 +115,7 @@ bool NullBackend::SynchronizeDirectory(TitleIDVersion title, std::string name,
115 LOG_DEBUG(Service_BCAT, "called, title_id={:016X}, build_id={:016X}, name={}", title.title_id, 115 LOG_DEBUG(Service_BCAT, "called, title_id={:016X}, build_id={:016X}, name={}", title.title_id,
116 title.build_id, name); 116 title.build_id, name);
117 117
118 progress.FinishDownload(RESULT_SUCCESS); 118 progress.FinishDownload(ResultSuccess);
119 return true; 119 return true;
120} 120}
121 121
diff --git a/src/core/hle/service/bcat/backend/backend.h b/src/core/hle/service/bcat/backend/backend.h
index f591a362a..e79a9c2ad 100644
--- a/src/core/hle/service/bcat/backend/backend.h
+++ b/src/core/hle/service/bcat/backend/backend.h
@@ -51,7 +51,7 @@ struct DeliveryCacheProgressImpl {
51 }; 51 };
52 52
53 Status status; 53 Status status;
54 ResultCode result = RESULT_SUCCESS; 54 ResultCode result = ResultSuccess;
55 DirectoryName current_directory; 55 DirectoryName current_directory;
56 FileName current_file; 56 FileName current_file;
57 s64 current_downloaded_bytes; ///< Bytes downloaded on current file. 57 s64 current_downloaded_bytes; ///< Bytes downloaded on current file.
diff --git a/src/core/hle/service/bcat/backend/boxcat.cpp b/src/core/hle/service/bcat/backend/boxcat.cpp
index 3cc397604..d9fdc2dca 100644
--- a/src/core/hle/service/bcat/backend/boxcat.cpp
+++ b/src/core/hle/service/bcat/backend/boxcat.cpp
@@ -121,7 +121,7 @@ void HandleDownloadDisplayResult(const AM::Applets::AppletManager& applet_manage
121 121
122 const auto& frontend{applet_manager.GetAppletFrontendSet()}; 122 const auto& frontend{applet_manager.GetAppletFrontendSet()};
123 frontend.error->ShowCustomErrorText( 123 frontend.error->ShowCustomErrorText(
124 RESULT_UNKNOWN, "There was an error while attempting to use Boxcat.", 124 ResultUnknown, "There was an error while attempting to use Boxcat.",
125 DOWNLOAD_RESULT_LOG_MESSAGES[static_cast<std::size_t>(res)], [] {}); 125 DOWNLOAD_RESULT_LOG_MESSAGES[static_cast<std::size_t>(res)], [] {});
126} 126}
127 127
@@ -300,7 +300,7 @@ void SynchronizeInternal(AM::Applets::AppletManager& applet_manager, DirectoryGe
300 const auto dir = dir_getter(title.title_id); 300 const auto dir = dir_getter(title.title_id);
301 if (dir) 301 if (dir)
302 progress.SetTotalSize(dir->GetSize()); 302 progress.SetTotalSize(dir->GetSize());
303 progress.FinishDownload(RESULT_SUCCESS); 303 progress.FinishDownload(ResultSuccess);
304 return; 304 return;
305 } 305 }
306 306
@@ -383,7 +383,7 @@ void SynchronizeInternal(AM::Applets::AppletManager& applet_manager, DirectoryGe
383 } 383 }
384 } 384 }
385 385
386 progress.FinishDownload(RESULT_SUCCESS); 386 progress.FinishDownload(ResultSuccess);
387} 387}
388 388
389bool Boxcat::Synchronize(TitleIDVersion title, ProgressServiceBackend& progress) { 389bool Boxcat::Synchronize(TitleIDVersion title, ProgressServiceBackend& progress) {
diff --git a/src/core/hle/service/bcat/module.cpp b/src/core/hle/service/bcat/module.cpp
index 0206cbb6a..44e4d0509 100644
--- a/src/core/hle/service/bcat/module.cpp
+++ b/src/core/hle/service/bcat/module.cpp
@@ -106,7 +106,7 @@ private:
106 LOG_DEBUG(Service_BCAT, "called"); 106 LOG_DEBUG(Service_BCAT, "called");
107 107
108 IPC::ResponseBuilder rb{ctx, 2, 1}; 108 IPC::ResponseBuilder rb{ctx, 2, 1};
109 rb.Push(RESULT_SUCCESS); 109 rb.Push(ResultSuccess);
110 rb.PushCopyObjects(event); 110 rb.PushCopyObjects(event);
111 } 111 }
112 112
@@ -116,7 +116,7 @@ private:
116 ctx.WriteBuffer(impl); 116 ctx.WriteBuffer(impl);
117 117
118 IPC::ResponseBuilder rb{ctx, 2}; 118 IPC::ResponseBuilder rb{ctx, 2};
119 rb.Push(RESULT_SUCCESS); 119 rb.Push(ResultSuccess);
120 } 120 }
121 121
122 Kernel::KReadableEvent& event; 122 Kernel::KReadableEvent& event;
@@ -185,7 +185,7 @@ private:
185 GetProgressBackend(SyncType::Normal)); 185 GetProgressBackend(SyncType::Normal));
186 186
187 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 187 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
188 rb.Push(RESULT_SUCCESS); 188 rb.Push(ResultSuccess);
189 rb.PushIpcInterface(CreateProgressService(SyncType::Normal)); 189 rb.PushIpcInterface(CreateProgressService(SyncType::Normal));
190 } 190 }
191 191
@@ -202,7 +202,7 @@ private:
202 name, GetProgressBackend(SyncType::Directory)); 202 name, GetProgressBackend(SyncType::Directory));
203 203
204 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 204 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
205 rb.Push(RESULT_SUCCESS); 205 rb.Push(ResultSuccess);
206 rb.PushIpcInterface(CreateProgressService(SyncType::Directory)); 206 rb.PushIpcInterface(CreateProgressService(SyncType::Directory));
207 } 207 }
208 208
@@ -235,7 +235,7 @@ private:
235 backend.SetPassphrase(title_id, passphrase); 235 backend.SetPassphrase(title_id, passphrase);
236 236
237 IPC::ResponseBuilder rb{ctx, 2}; 237 IPC::ResponseBuilder rb{ctx, 2};
238 rb.Push(RESULT_SUCCESS); 238 rb.Push(ResultSuccess);
239 } 239 }
240 240
241 void ClearDeliveryCacheStorage(Kernel::HLERequestContext& ctx) { 241 void ClearDeliveryCacheStorage(Kernel::HLERequestContext& ctx) {
@@ -259,7 +259,7 @@ private:
259 } 259 }
260 260
261 IPC::ResponseBuilder rb{ctx, 2}; 261 IPC::ResponseBuilder rb{ctx, 2};
262 rb.Push(RESULT_SUCCESS); 262 rb.Push(ResultSuccess);
263 } 263 }
264 264
265 ProgressServiceBackend& GetProgressBackend(SyncType type) { 265 ProgressServiceBackend& GetProgressBackend(SyncType type) {
@@ -278,7 +278,7 @@ void Module::Interface::CreateBcatService(Kernel::HLERequestContext& ctx) {
278 LOG_DEBUG(Service_BCAT, "called"); 278 LOG_DEBUG(Service_BCAT, "called");
279 279
280 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 280 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
281 rb.Push(RESULT_SUCCESS); 281 rb.Push(ResultSuccess);
282 rb.PushIpcInterface<IBcatService>(system, *backend); 282 rb.PushIpcInterface<IBcatService>(system, *backend);
283} 283}
284 284
@@ -340,7 +340,7 @@ private:
340 } 340 }
341 341
342 IPC::ResponseBuilder rb{ctx, 2}; 342 IPC::ResponseBuilder rb{ctx, 2};
343 rb.Push(RESULT_SUCCESS); 343 rb.Push(ResultSuccess);
344 } 344 }
345 345
346 void Read(Kernel::HLERequestContext& ctx) { 346 void Read(Kernel::HLERequestContext& ctx) {
@@ -362,7 +362,7 @@ private:
362 ctx.WriteBuffer(buffer); 362 ctx.WriteBuffer(buffer);
363 363
364 IPC::ResponseBuilder rb{ctx, 4}; 364 IPC::ResponseBuilder rb{ctx, 4};
365 rb.Push(RESULT_SUCCESS); 365 rb.Push(ResultSuccess);
366 rb.Push<u64>(buffer.size()); 366 rb.Push<u64>(buffer.size());
367 } 367 }
368 368
@@ -376,7 +376,7 @@ private:
376 } 376 }
377 377
378 IPC::ResponseBuilder rb{ctx, 4}; 378 IPC::ResponseBuilder rb{ctx, 4};
379 rb.Push(RESULT_SUCCESS); 379 rb.Push(ResultSuccess);
380 rb.Push<u64>(current_file->GetSize()); 380 rb.Push<u64>(current_file->GetSize());
381 } 381 }
382 382
@@ -390,7 +390,7 @@ private:
390 } 390 }
391 391
392 IPC::ResponseBuilder rb{ctx, 6}; 392 IPC::ResponseBuilder rb{ctx, 6};
393 rb.Push(RESULT_SUCCESS); 393 rb.Push(ResultSuccess);
394 rb.PushRaw(DigestFile(current_file)); 394 rb.PushRaw(DigestFile(current_file));
395 } 395 }
396 396
@@ -443,7 +443,7 @@ private:
443 } 443 }
444 444
445 IPC::ResponseBuilder rb{ctx, 2}; 445 IPC::ResponseBuilder rb{ctx, 2};
446 rb.Push(RESULT_SUCCESS); 446 rb.Push(ResultSuccess);
447 } 447 }
448 448
449 void Read(Kernel::HLERequestContext& ctx) { 449 void Read(Kernel::HLERequestContext& ctx) {
@@ -472,7 +472,7 @@ private:
472 ctx.WriteBuffer(entries); 472 ctx.WriteBuffer(entries);
473 473
474 IPC::ResponseBuilder rb{ctx, 3}; 474 IPC::ResponseBuilder rb{ctx, 3};
475 rb.Push(RESULT_SUCCESS); 475 rb.Push(ResultSuccess);
476 rb.Push(static_cast<u32>(write_size * sizeof(DeliveryCacheDirectoryEntry))); 476 rb.Push(static_cast<u32>(write_size * sizeof(DeliveryCacheDirectoryEntry)));
477 } 477 }
478 478
@@ -489,7 +489,7 @@ private:
489 const auto files = current_dir->GetFiles(); 489 const auto files = current_dir->GetFiles();
490 490
491 IPC::ResponseBuilder rb{ctx, 3}; 491 IPC::ResponseBuilder rb{ctx, 3};
492 rb.Push(RESULT_SUCCESS); 492 rb.Push(ResultSuccess);
493 rb.Push(static_cast<u32>(files.size())); 493 rb.Push(static_cast<u32>(files.size()));
494 } 494 }
495 495
@@ -524,7 +524,7 @@ private:
524 LOG_DEBUG(Service_BCAT, "called"); 524 LOG_DEBUG(Service_BCAT, "called");
525 525
526 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 526 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
527 rb.Push(RESULT_SUCCESS); 527 rb.Push(ResultSuccess);
528 rb.PushIpcInterface<IDeliveryCacheFileService>(system, root); 528 rb.PushIpcInterface<IDeliveryCacheFileService>(system, root);
529 } 529 }
530 530
@@ -532,7 +532,7 @@ private:
532 LOG_DEBUG(Service_BCAT, "called"); 532 LOG_DEBUG(Service_BCAT, "called");
533 533
534 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 534 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
535 rb.Push(RESULT_SUCCESS); 535 rb.Push(ResultSuccess);
536 rb.PushIpcInterface<IDeliveryCacheDirectoryService>(system, root); 536 rb.PushIpcInterface<IDeliveryCacheDirectoryService>(system, root);
537 } 537 }
538 538
@@ -546,7 +546,7 @@ private:
546 next_read_index += size; 546 next_read_index += size;
547 547
548 IPC::ResponseBuilder rb{ctx, 3}; 548 IPC::ResponseBuilder rb{ctx, 3};
549 rb.Push(RESULT_SUCCESS); 549 rb.Push(ResultSuccess);
550 rb.Push(static_cast<u32>(size)); 550 rb.Push(static_cast<u32>(size));
551 } 551 }
552 552
@@ -560,7 +560,7 @@ void Module::Interface::CreateDeliveryCacheStorageService(Kernel::HLERequestCont
560 560
561 const auto title_id = system.CurrentProcess()->GetTitleID(); 561 const auto title_id = system.CurrentProcess()->GetTitleID();
562 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 562 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
563 rb.Push(RESULT_SUCCESS); 563 rb.Push(ResultSuccess);
564 rb.PushIpcInterface<IDeliveryCacheStorageService>(system, fsc.GetBCATDirectory(title_id)); 564 rb.PushIpcInterface<IDeliveryCacheStorageService>(system, fsc.GetBCATDirectory(title_id));
565} 565}
566 566
@@ -572,7 +572,7 @@ void Module::Interface::CreateDeliveryCacheStorageServiceWithApplicationId(
572 LOG_DEBUG(Service_BCAT, "called, title_id={:016X}", title_id); 572 LOG_DEBUG(Service_BCAT, "called, title_id={:016X}", title_id);
573 573
574 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 574 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
575 rb.Push(RESULT_SUCCESS); 575 rb.Push(ResultSuccess);
576 rb.PushIpcInterface<IDeliveryCacheStorageService>(system, fsc.GetBCATDirectory(title_id)); 576 rb.PushIpcInterface<IDeliveryCacheStorageService>(system, fsc.GetBCATDirectory(title_id));
577} 577}
578 578
diff --git a/src/core/hle/service/btdrv/btdrv.cpp b/src/core/hle/service/btdrv/btdrv.cpp
index fd97a822c..46da438ef 100644
--- a/src/core/hle/service/btdrv/btdrv.cpp
+++ b/src/core/hle/service/btdrv/btdrv.cpp
@@ -44,7 +44,7 @@ private:
44 LOG_WARNING(Service_BTM, "(STUBBED) called"); 44 LOG_WARNING(Service_BTM, "(STUBBED) called");
45 45
46 IPC::ResponseBuilder rb{ctx, 2, 1}; 46 IPC::ResponseBuilder rb{ctx, 2, 1};
47 rb.Push(RESULT_SUCCESS); 47 rb.Push(ResultSuccess);
48 rb.PushCopyObjects(register_event.GetReadableEvent()); 48 rb.PushCopyObjects(register_event.GetReadableEvent());
49 } 49 }
50 50
diff --git a/src/core/hle/service/btm/btm.cpp b/src/core/hle/service/btm/btm.cpp
index 3b5ef69e1..3ab29036a 100644
--- a/src/core/hle/service/btm/btm.cpp
+++ b/src/core/hle/service/btm/btm.cpp
@@ -76,7 +76,7 @@ private:
76 LOG_WARNING(Service_BTM, "(STUBBED) called"); 76 LOG_WARNING(Service_BTM, "(STUBBED) called");
77 77
78 IPC::ResponseBuilder rb{ctx, 2, 1}; 78 IPC::ResponseBuilder rb{ctx, 2, 1};
79 rb.Push(RESULT_SUCCESS); 79 rb.Push(ResultSuccess);
80 rb.PushCopyObjects(scan_event.GetReadableEvent()); 80 rb.PushCopyObjects(scan_event.GetReadableEvent());
81 } 81 }
82 82
@@ -84,7 +84,7 @@ private:
84 LOG_WARNING(Service_BTM, "(STUBBED) called"); 84 LOG_WARNING(Service_BTM, "(STUBBED) called");
85 85
86 IPC::ResponseBuilder rb{ctx, 2, 1}; 86 IPC::ResponseBuilder rb{ctx, 2, 1};
87 rb.Push(RESULT_SUCCESS); 87 rb.Push(ResultSuccess);
88 rb.PushCopyObjects(connection_event.GetReadableEvent()); 88 rb.PushCopyObjects(connection_event.GetReadableEvent());
89 } 89 }
90 90
@@ -92,7 +92,7 @@ private:
92 LOG_WARNING(Service_BTM, "(STUBBED) called"); 92 LOG_WARNING(Service_BTM, "(STUBBED) called");
93 93
94 IPC::ResponseBuilder rb{ctx, 2, 1}; 94 IPC::ResponseBuilder rb{ctx, 2, 1};
95 rb.Push(RESULT_SUCCESS); 95 rb.Push(ResultSuccess);
96 rb.PushCopyObjects(service_discovery.GetReadableEvent()); 96 rb.PushCopyObjects(service_discovery.GetReadableEvent());
97 } 97 }
98 98
@@ -100,7 +100,7 @@ private:
100 LOG_WARNING(Service_BTM, "(STUBBED) called"); 100 LOG_WARNING(Service_BTM, "(STUBBED) called");
101 101
102 IPC::ResponseBuilder rb{ctx, 2, 1}; 102 IPC::ResponseBuilder rb{ctx, 2, 1};
103 rb.Push(RESULT_SUCCESS); 103 rb.Push(ResultSuccess);
104 rb.PushCopyObjects(config_event.GetReadableEvent()); 104 rb.PushCopyObjects(config_event.GetReadableEvent());
105 } 105 }
106 106
@@ -126,7 +126,7 @@ private:
126 LOG_DEBUG(Service_BTM, "called"); 126 LOG_DEBUG(Service_BTM, "called");
127 127
128 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 128 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
129 rb.Push(RESULT_SUCCESS); 129 rb.Push(ResultSuccess);
130 rb.PushIpcInterface<IBtmUserCore>(system); 130 rb.PushIpcInterface<IBtmUserCore>(system);
131 } 131 }
132}; 132};
@@ -273,7 +273,7 @@ private:
273 LOG_DEBUG(Service_BTM, "called"); 273 LOG_DEBUG(Service_BTM, "called");
274 274
275 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 275 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
276 rb.Push(RESULT_SUCCESS); 276 rb.Push(ResultSuccess);
277 rb.PushIpcInterface<IBtmSystemCore>(system); 277 rb.PushIpcInterface<IBtmSystemCore>(system);
278 } 278 }
279}; 279};
diff --git a/src/core/hle/service/caps/caps_c.cpp b/src/core/hle/service/caps/caps_c.cpp
index 45c1c9d30..a9ad5c8b1 100644
--- a/src/core/hle/service/caps/caps_c.cpp
+++ b/src/core/hle/service/caps/caps_c.cpp
@@ -84,7 +84,7 @@ void CAPS_C::SetShimLibraryVersion(Kernel::HLERequestContext& ctx) {
84 library_version, applet_resource_user_id); 84 library_version, applet_resource_user_id);
85 85
86 IPC::ResponseBuilder rb{ctx, 2}; 86 IPC::ResponseBuilder rb{ctx, 2};
87 rb.Push(RESULT_SUCCESS); 87 rb.Push(ResultSuccess);
88} 88}
89 89
90} // namespace Service::Capture 90} // namespace Service::Capture
diff --git a/src/core/hle/service/caps/caps_su.cpp b/src/core/hle/service/caps/caps_su.cpp
index eae39eb7b..45b705950 100644
--- a/src/core/hle/service/caps/caps_su.cpp
+++ b/src/core/hle/service/caps/caps_su.cpp
@@ -33,7 +33,7 @@ void CAPS_SU::SetShimLibraryVersion(Kernel::HLERequestContext& ctx) {
33 library_version, applet_resource_user_id); 33 library_version, applet_resource_user_id);
34 34
35 IPC::ResponseBuilder rb{ctx, 2}; 35 IPC::ResponseBuilder rb{ctx, 2};
36 rb.Push(RESULT_SUCCESS); 36 rb.Push(ResultSuccess);
37} 37}
38 38
39} // namespace Service::Capture 39} // namespace Service::Capture
diff --git a/src/core/hle/service/caps/caps_u.cpp b/src/core/hle/service/caps/caps_u.cpp
index 10b8d54b1..8f8ee2bb4 100644
--- a/src/core/hle/service/caps/caps_u.cpp
+++ b/src/core/hle/service/caps/caps_u.cpp
@@ -62,7 +62,7 @@ void CAPS_U::SetShimLibraryVersion(Kernel::HLERequestContext& ctx) {
62 library_version, applet_resource_user_id); 62 library_version, applet_resource_user_id);
63 63
64 IPC::ResponseBuilder rb{ctx, 2}; 64 IPC::ResponseBuilder rb{ctx, 2};
65 rb.Push(RESULT_SUCCESS); 65 rb.Push(ResultSuccess);
66} 66}
67 67
68void CAPS_U::GetAlbumContentsFileListForApplication(Kernel::HLERequestContext& ctx) { 68void CAPS_U::GetAlbumContentsFileListForApplication(Kernel::HLERequestContext& ctx) {
@@ -89,7 +89,7 @@ void CAPS_U::GetAlbumContentsFileListForApplication(Kernel::HLERequestContext& c
89 total_entries_1, total_entries_2); 89 total_entries_1, total_entries_2);
90 90
91 IPC::ResponseBuilder rb{ctx, 4}; 91 IPC::ResponseBuilder rb{ctx, 4};
92 rb.Push(RESULT_SUCCESS); 92 rb.Push(ResultSuccess);
93 rb.Push(total_entries_1); 93 rb.Push(total_entries_1);
94 rb.Push(total_entries_2); 94 rb.Push(total_entries_2);
95} 95}
diff --git a/src/core/hle/service/es/es.cpp b/src/core/hle/service/es/es.cpp
index 26d1e3306..110c7cb1c 100644
--- a/src/core/hle/service/es/es.cpp
+++ b/src/core/hle/service/es/es.cpp
@@ -137,7 +137,7 @@ private:
137 } 137 }
138 138
139 IPC::ResponseBuilder rb{ctx, 2}; 139 IPC::ResponseBuilder rb{ctx, 2};
140 rb.Push(RESULT_SUCCESS); 140 rb.Push(ResultSuccess);
141 } 141 }
142 142
143 void GetTitleKey(Kernel::HLERequestContext& ctx) { 143 void GetTitleKey(Kernel::HLERequestContext& ctx) {
@@ -163,7 +163,7 @@ private:
163 ctx.WriteBuffer(key); 163 ctx.WriteBuffer(key);
164 164
165 IPC::ResponseBuilder rb{ctx, 2}; 165 IPC::ResponseBuilder rb{ctx, 2};
166 rb.Push(RESULT_SUCCESS); 166 rb.Push(ResultSuccess);
167 } 167 }
168 168
169 void CountCommonTicket(Kernel::HLERequestContext& ctx) { 169 void CountCommonTicket(Kernel::HLERequestContext& ctx) {
@@ -172,7 +172,7 @@ private:
172 const u32 count = static_cast<u32>(keys.GetCommonTickets().size()); 172 const u32 count = static_cast<u32>(keys.GetCommonTickets().size());
173 173
174 IPC::ResponseBuilder rb{ctx, 3}; 174 IPC::ResponseBuilder rb{ctx, 3};
175 rb.Push(RESULT_SUCCESS); 175 rb.Push(ResultSuccess);
176 rb.Push<u32>(count); 176 rb.Push<u32>(count);
177 } 177 }
178 178
@@ -182,7 +182,7 @@ private:
182 const u32 count = static_cast<u32>(keys.GetPersonalizedTickets().size()); 182 const u32 count = static_cast<u32>(keys.GetPersonalizedTickets().size());
183 183
184 IPC::ResponseBuilder rb{ctx, 3}; 184 IPC::ResponseBuilder rb{ctx, 3};
185 rb.Push(RESULT_SUCCESS); 185 rb.Push(ResultSuccess);
186 rb.Push<u32>(count); 186 rb.Push<u32>(count);
187 } 187 }
188 188
@@ -205,7 +205,7 @@ private:
205 ctx.WriteBuffer(ids.data(), out_entries * sizeof(u128)); 205 ctx.WriteBuffer(ids.data(), out_entries * sizeof(u128));
206 206
207 IPC::ResponseBuilder rb{ctx, 3}; 207 IPC::ResponseBuilder rb{ctx, 3};
208 rb.Push(RESULT_SUCCESS); 208 rb.Push(ResultSuccess);
209 rb.Push<u32>(out_entries); 209 rb.Push<u32>(out_entries);
210 } 210 }
211 211
@@ -228,7 +228,7 @@ private:
228 ctx.WriteBuffer(ids.data(), out_entries * sizeof(u128)); 228 ctx.WriteBuffer(ids.data(), out_entries * sizeof(u128));
229 229
230 IPC::ResponseBuilder rb{ctx, 3}; 230 IPC::ResponseBuilder rb{ctx, 3};
231 rb.Push(RESULT_SUCCESS); 231 rb.Push(ResultSuccess);
232 rb.Push<u32>(out_entries); 232 rb.Push<u32>(out_entries);
233 } 233 }
234 234
@@ -244,7 +244,7 @@ private:
244 const auto ticket = keys.GetCommonTickets().at(rights_id); 244 const auto ticket = keys.GetCommonTickets().at(rights_id);
245 245
246 IPC::ResponseBuilder rb{ctx, 4}; 246 IPC::ResponseBuilder rb{ctx, 4};
247 rb.Push(RESULT_SUCCESS); 247 rb.Push(ResultSuccess);
248 rb.Push<u64>(ticket.GetSize()); 248 rb.Push<u64>(ticket.GetSize());
249 } 249 }
250 250
@@ -260,7 +260,7 @@ private:
260 const auto ticket = keys.GetPersonalizedTickets().at(rights_id); 260 const auto ticket = keys.GetPersonalizedTickets().at(rights_id);
261 261
262 IPC::ResponseBuilder rb{ctx, 4}; 262 IPC::ResponseBuilder rb{ctx, 4};
263 rb.Push(RESULT_SUCCESS); 263 rb.Push(ResultSuccess);
264 rb.Push<u64>(ticket.GetSize()); 264 rb.Push<u64>(ticket.GetSize());
265 } 265 }
266 266
@@ -279,7 +279,7 @@ private:
279 ctx.WriteBuffer(&ticket, write_size); 279 ctx.WriteBuffer(&ticket, write_size);
280 280
281 IPC::ResponseBuilder rb{ctx, 4}; 281 IPC::ResponseBuilder rb{ctx, 4};
282 rb.Push(RESULT_SUCCESS); 282 rb.Push(ResultSuccess);
283 rb.Push<u64>(write_size); 283 rb.Push<u64>(write_size);
284 } 284 }
285 285
@@ -298,7 +298,7 @@ private:
298 ctx.WriteBuffer(&ticket, write_size); 298 ctx.WriteBuffer(&ticket, write_size);
299 299
300 IPC::ResponseBuilder rb{ctx, 4}; 300 IPC::ResponseBuilder rb{ctx, 4};
301 rb.Push(RESULT_SUCCESS); 301 rb.Push(ResultSuccess);
302 rb.Push<u64>(write_size); 302 rb.Push<u64>(write_size);
303 } 303 }
304 304
diff --git a/src/core/hle/service/fatal/fatal.cpp b/src/core/hle/service/fatal/fatal.cpp
index b7666e95a..2c2619a7d 100644
--- a/src/core/hle/service/fatal/fatal.cpp
+++ b/src/core/hle/service/fatal/fatal.cpp
@@ -135,7 +135,7 @@ void Module::Interface::ThrowFatal(Kernel::HLERequestContext& ctx) {
135 135
136 ThrowFatalError(system, error_code, FatalType::ErrorScreen, {}); 136 ThrowFatalError(system, error_code, FatalType::ErrorScreen, {});
137 IPC::ResponseBuilder rb{ctx, 2}; 137 IPC::ResponseBuilder rb{ctx, 2};
138 rb.Push(RESULT_SUCCESS); 138 rb.Push(ResultSuccess);
139} 139}
140 140
141void Module::Interface::ThrowFatalWithPolicy(Kernel::HLERequestContext& ctx) { 141void Module::Interface::ThrowFatalWithPolicy(Kernel::HLERequestContext& ctx) {
@@ -147,7 +147,7 @@ void Module::Interface::ThrowFatalWithPolicy(Kernel::HLERequestContext& ctx) {
147 ThrowFatalError(system, error_code, fatal_type, 147 ThrowFatalError(system, error_code, fatal_type,
148 {}); // No info is passed with ThrowFatalWithPolicy 148 {}); // No info is passed with ThrowFatalWithPolicy
149 IPC::ResponseBuilder rb{ctx, 2}; 149 IPC::ResponseBuilder rb{ctx, 2};
150 rb.Push(RESULT_SUCCESS); 150 rb.Push(ResultSuccess);
151} 151}
152 152
153void Module::Interface::ThrowFatalWithCpuContext(Kernel::HLERequestContext& ctx) { 153void Module::Interface::ThrowFatalWithCpuContext(Kernel::HLERequestContext& ctx) {
@@ -163,7 +163,7 @@ void Module::Interface::ThrowFatalWithCpuContext(Kernel::HLERequestContext& ctx)
163 163
164 ThrowFatalError(system, error_code, fatal_type, info); 164 ThrowFatalError(system, error_code, fatal_type, info);
165 IPC::ResponseBuilder rb{ctx, 2}; 165 IPC::ResponseBuilder rb{ctx, 2};
166 rb.Push(RESULT_SUCCESS); 166 rb.Push(ResultSuccess);
167} 167}
168 168
169void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system) { 169void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system) {
diff --git a/src/core/hle/service/fgm/fgm.cpp b/src/core/hle/service/fgm/fgm.cpp
index 9dc1bc52e..25c6c0194 100644
--- a/src/core/hle/service/fgm/fgm.cpp
+++ b/src/core/hle/service/fgm/fgm.cpp
@@ -45,7 +45,7 @@ private:
45 LOG_DEBUG(Service_FGM, "called"); 45 LOG_DEBUG(Service_FGM, "called");
46 46
47 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 47 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
48 rb.Push(RESULT_SUCCESS); 48 rb.Push(ResultSuccess);
49 rb.PushIpcInterface<IRequest>(system); 49 rb.PushIpcInterface<IRequest>(system);
50 } 50 }
51}; 51};
diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp
index 78664439d..3c16fe6c7 100644
--- a/src/core/hle/service/filesystem/filesystem.cpp
+++ b/src/core/hle/service/filesystem/filesystem.cpp
@@ -60,27 +60,27 @@ ResultCode VfsDirectoryServiceWrapper::CreateFile(const std::string& path_, u64
60 } 60 }
61 61
62 const auto entry_type = GetEntryType(path); 62 const auto entry_type = GetEntryType(path);
63 if (entry_type.Code() == RESULT_SUCCESS) { 63 if (entry_type.Code() == ResultSuccess) {
64 return FileSys::ERROR_PATH_ALREADY_EXISTS; 64 return FileSys::ERROR_PATH_ALREADY_EXISTS;
65 } 65 }
66 66
67 auto file = dir->CreateFile(Common::FS::GetFilename(path)); 67 auto file = dir->CreateFile(Common::FS::GetFilename(path));
68 if (file == nullptr) { 68 if (file == nullptr) {
69 // TODO(DarkLordZach): Find a better error code for this 69 // TODO(DarkLordZach): Find a better error code for this
70 return RESULT_UNKNOWN; 70 return ResultUnknown;
71 } 71 }
72 if (!file->Resize(size)) { 72 if (!file->Resize(size)) {
73 // TODO(DarkLordZach): Find a better error code for this 73 // TODO(DarkLordZach): Find a better error code for this
74 return RESULT_UNKNOWN; 74 return ResultUnknown;
75 } 75 }
76 return RESULT_SUCCESS; 76 return ResultSuccess;
77} 77}
78 78
79ResultCode VfsDirectoryServiceWrapper::DeleteFile(const std::string& path_) const { 79ResultCode VfsDirectoryServiceWrapper::DeleteFile(const std::string& path_) const {
80 std::string path(Common::FS::SanitizePath(path_)); 80 std::string path(Common::FS::SanitizePath(path_));
81 if (path.empty()) { 81 if (path.empty()) {
82 // TODO(DarkLordZach): Why do games call this and what should it do? Works as is but... 82 // TODO(DarkLordZach): Why do games call this and what should it do? Works as is but...
83 return RESULT_SUCCESS; 83 return ResultSuccess;
84 } 84 }
85 85
86 auto dir = GetDirectoryRelativeWrapped(backing, Common::FS::GetParentPath(path)); 86 auto dir = GetDirectoryRelativeWrapped(backing, Common::FS::GetParentPath(path));
@@ -89,10 +89,10 @@ ResultCode VfsDirectoryServiceWrapper::DeleteFile(const std::string& path_) cons
89 } 89 }
90 if (!dir->DeleteFile(Common::FS::GetFilename(path))) { 90 if (!dir->DeleteFile(Common::FS::GetFilename(path))) {
91 // TODO(DarkLordZach): Find a better error code for this 91 // TODO(DarkLordZach): Find a better error code for this
92 return RESULT_UNKNOWN; 92 return ResultUnknown;
93 } 93 }
94 94
95 return RESULT_SUCCESS; 95 return ResultSuccess;
96} 96}
97 97
98ResultCode VfsDirectoryServiceWrapper::CreateDirectory(const std::string& path_) const { 98ResultCode VfsDirectoryServiceWrapper::CreateDirectory(const std::string& path_) const {
@@ -104,9 +104,9 @@ ResultCode VfsDirectoryServiceWrapper::CreateDirectory(const std::string& path_)
104 auto new_dir = dir->CreateSubdirectory(Common::FS::GetFilename(path)); 104 auto new_dir = dir->CreateSubdirectory(Common::FS::GetFilename(path));
105 if (new_dir == nullptr) { 105 if (new_dir == nullptr) {
106 // TODO(DarkLordZach): Find a better error code for this 106 // TODO(DarkLordZach): Find a better error code for this
107 return RESULT_UNKNOWN; 107 return ResultUnknown;
108 } 108 }
109 return RESULT_SUCCESS; 109 return ResultSuccess;
110} 110}
111 111
112ResultCode VfsDirectoryServiceWrapper::DeleteDirectory(const std::string& path_) const { 112ResultCode VfsDirectoryServiceWrapper::DeleteDirectory(const std::string& path_) const {
@@ -114,9 +114,9 @@ ResultCode VfsDirectoryServiceWrapper::DeleteDirectory(const std::string& path_)
114 auto dir = GetDirectoryRelativeWrapped(backing, Common::FS::GetParentPath(path)); 114 auto dir = GetDirectoryRelativeWrapped(backing, Common::FS::GetParentPath(path));
115 if (!dir->DeleteSubdirectory(Common::FS::GetFilename(path))) { 115 if (!dir->DeleteSubdirectory(Common::FS::GetFilename(path))) {
116 // TODO(DarkLordZach): Find a better error code for this 116 // TODO(DarkLordZach): Find a better error code for this
117 return RESULT_UNKNOWN; 117 return ResultUnknown;
118 } 118 }
119 return RESULT_SUCCESS; 119 return ResultSuccess;
120} 120}
121 121
122ResultCode VfsDirectoryServiceWrapper::DeleteDirectoryRecursively(const std::string& path_) const { 122ResultCode VfsDirectoryServiceWrapper::DeleteDirectoryRecursively(const std::string& path_) const {
@@ -124,9 +124,9 @@ ResultCode VfsDirectoryServiceWrapper::DeleteDirectoryRecursively(const std::str
124 auto dir = GetDirectoryRelativeWrapped(backing, Common::FS::GetParentPath(path)); 124 auto dir = GetDirectoryRelativeWrapped(backing, Common::FS::GetParentPath(path));
125 if (!dir->DeleteSubdirectoryRecursive(Common::FS::GetFilename(path))) { 125 if (!dir->DeleteSubdirectoryRecursive(Common::FS::GetFilename(path))) {
126 // TODO(DarkLordZach): Find a better error code for this 126 // TODO(DarkLordZach): Find a better error code for this
127 return RESULT_UNKNOWN; 127 return ResultUnknown;
128 } 128 }
129 return RESULT_SUCCESS; 129 return ResultSuccess;
130} 130}
131 131
132ResultCode VfsDirectoryServiceWrapper::CleanDirectoryRecursively(const std::string& path) const { 132ResultCode VfsDirectoryServiceWrapper::CleanDirectoryRecursively(const std::string& path) const {
@@ -135,10 +135,10 @@ ResultCode VfsDirectoryServiceWrapper::CleanDirectoryRecursively(const std::stri
135 135
136 if (!dir->CleanSubdirectoryRecursive(Common::FS::GetFilename(sanitized_path))) { 136 if (!dir->CleanSubdirectoryRecursive(Common::FS::GetFilename(sanitized_path))) {
137 // TODO(DarkLordZach): Find a better error code for this 137 // TODO(DarkLordZach): Find a better error code for this
138 return RESULT_UNKNOWN; 138 return ResultUnknown;
139 } 139 }
140 140
141 return RESULT_SUCCESS; 141 return ResultSuccess;
142} 142}
143 143
144ResultCode VfsDirectoryServiceWrapper::RenameFile(const std::string& src_path_, 144ResultCode VfsDirectoryServiceWrapper::RenameFile(const std::string& src_path_,
@@ -152,14 +152,14 @@ ResultCode VfsDirectoryServiceWrapper::RenameFile(const std::string& src_path_,
152 return FileSys::ERROR_PATH_NOT_FOUND; 152 return FileSys::ERROR_PATH_NOT_FOUND;
153 if (!src->Rename(Common::FS::GetFilename(dest_path))) { 153 if (!src->Rename(Common::FS::GetFilename(dest_path))) {
154 // TODO(DarkLordZach): Find a better error code for this 154 // TODO(DarkLordZach): Find a better error code for this
155 return RESULT_UNKNOWN; 155 return ResultUnknown;
156 } 156 }
157 return RESULT_SUCCESS; 157 return ResultSuccess;
158 } 158 }
159 159
160 // Move by hand -- TODO(DarkLordZach): Optimize 160 // Move by hand -- TODO(DarkLordZach): Optimize
161 auto c_res = CreateFile(dest_path, src->GetSize()); 161 auto c_res = CreateFile(dest_path, src->GetSize());
162 if (c_res != RESULT_SUCCESS) 162 if (c_res != ResultSuccess)
163 return c_res; 163 return c_res;
164 164
165 auto dest = backing->GetFileRelative(dest_path); 165 auto dest = backing->GetFileRelative(dest_path);
@@ -170,10 +170,10 @@ ResultCode VfsDirectoryServiceWrapper::RenameFile(const std::string& src_path_,
170 170
171 if (!src->GetContainingDirectory()->DeleteFile(Common::FS::GetFilename(src_path))) { 171 if (!src->GetContainingDirectory()->DeleteFile(Common::FS::GetFilename(src_path))) {
172 // TODO(DarkLordZach): Find a better error code for this 172 // TODO(DarkLordZach): Find a better error code for this
173 return RESULT_UNKNOWN; 173 return ResultUnknown;
174 } 174 }
175 175
176 return RESULT_SUCCESS; 176 return ResultSuccess;
177} 177}
178 178
179ResultCode VfsDirectoryServiceWrapper::RenameDirectory(const std::string& src_path_, 179ResultCode VfsDirectoryServiceWrapper::RenameDirectory(const std::string& src_path_,
@@ -187,9 +187,9 @@ ResultCode VfsDirectoryServiceWrapper::RenameDirectory(const std::string& src_pa
187 return FileSys::ERROR_PATH_NOT_FOUND; 187 return FileSys::ERROR_PATH_NOT_FOUND;
188 if (!src->Rename(Common::FS::GetFilename(dest_path))) { 188 if (!src->Rename(Common::FS::GetFilename(dest_path))) {
189 // TODO(DarkLordZach): Find a better error code for this 189 // TODO(DarkLordZach): Find a better error code for this
190 return RESULT_UNKNOWN; 190 return ResultUnknown;
191 } 191 }
192 return RESULT_SUCCESS; 192 return ResultSuccess;
193 } 193 }
194 194
195 // TODO(DarkLordZach): Implement renaming across the tree (move). 195 // TODO(DarkLordZach): Implement renaming across the tree (move).
@@ -199,7 +199,7 @@ ResultCode VfsDirectoryServiceWrapper::RenameDirectory(const std::string& src_pa
199 src_path, dest_path); 199 src_path, dest_path);
200 200
201 // TODO(DarkLordZach): Find a better error code for this 201 // TODO(DarkLordZach): Find a better error code for this
202 return RESULT_UNKNOWN; 202 return ResultUnknown;
203} 203}
204 204
205ResultVal<FileSys::VirtualFile> VfsDirectoryServiceWrapper::OpenFile(const std::string& path_, 205ResultVal<FileSys::VirtualFile> VfsDirectoryServiceWrapper::OpenFile(const std::string& path_,
@@ -258,7 +258,7 @@ FileSystemController::~FileSystemController() = default;
258ResultCode FileSystemController::RegisterRomFS(std::unique_ptr<FileSys::RomFSFactory>&& factory) { 258ResultCode FileSystemController::RegisterRomFS(std::unique_ptr<FileSys::RomFSFactory>&& factory) {
259 romfs_factory = std::move(factory); 259 romfs_factory = std::move(factory);
260 LOG_DEBUG(Service_FS, "Registered RomFS"); 260 LOG_DEBUG(Service_FS, "Registered RomFS");
261 return RESULT_SUCCESS; 261 return ResultSuccess;
262} 262}
263 263
264ResultCode FileSystemController::RegisterSaveData( 264ResultCode FileSystemController::RegisterSaveData(
@@ -266,21 +266,21 @@ ResultCode FileSystemController::RegisterSaveData(
266 ASSERT_MSG(save_data_factory == nullptr, "Tried to register a second save data"); 266 ASSERT_MSG(save_data_factory == nullptr, "Tried to register a second save data");
267 save_data_factory = std::move(factory); 267 save_data_factory = std::move(factory);
268 LOG_DEBUG(Service_FS, "Registered save data"); 268 LOG_DEBUG(Service_FS, "Registered save data");
269 return RESULT_SUCCESS; 269 return ResultSuccess;
270} 270}
271 271
272ResultCode FileSystemController::RegisterSDMC(std::unique_ptr<FileSys::SDMCFactory>&& factory) { 272ResultCode FileSystemController::RegisterSDMC(std::unique_ptr<FileSys::SDMCFactory>&& factory) {
273 ASSERT_MSG(sdmc_factory == nullptr, "Tried to register a second SDMC"); 273 ASSERT_MSG(sdmc_factory == nullptr, "Tried to register a second SDMC");
274 sdmc_factory = std::move(factory); 274 sdmc_factory = std::move(factory);
275 LOG_DEBUG(Service_FS, "Registered SDMC"); 275 LOG_DEBUG(Service_FS, "Registered SDMC");
276 return RESULT_SUCCESS; 276 return ResultSuccess;
277} 277}
278 278
279ResultCode FileSystemController::RegisterBIS(std::unique_ptr<FileSys::BISFactory>&& factory) { 279ResultCode FileSystemController::RegisterBIS(std::unique_ptr<FileSys::BISFactory>&& factory) {
280 ASSERT_MSG(bis_factory == nullptr, "Tried to register a second BIS"); 280 ASSERT_MSG(bis_factory == nullptr, "Tried to register a second BIS");
281 bis_factory = std::move(factory); 281 bis_factory = std::move(factory);
282 LOG_DEBUG(Service_FS, "Registered BIS"); 282 LOG_DEBUG(Service_FS, "Registered BIS");
283 return RESULT_SUCCESS; 283 return ResultSuccess;
284} 284}
285 285
286void FileSystemController::SetPackedUpdate(FileSys::VirtualFile update_raw) { 286void FileSystemController::SetPackedUpdate(FileSys::VirtualFile update_raw) {
@@ -297,7 +297,7 @@ ResultVal<FileSys::VirtualFile> FileSystemController::OpenRomFSCurrentProcess()
297 297
298 if (romfs_factory == nullptr) { 298 if (romfs_factory == nullptr) {
299 // TODO(bunnei): Find a better error code for this 299 // TODO(bunnei): Find a better error code for this
300 return RESULT_UNKNOWN; 300 return ResultUnknown;
301 } 301 }
302 302
303 return romfs_factory->OpenCurrentProcess(system.CurrentProcess()->GetTitleID()); 303 return romfs_factory->OpenCurrentProcess(system.CurrentProcess()->GetTitleID());
@@ -309,7 +309,7 @@ ResultVal<FileSys::VirtualFile> FileSystemController::OpenPatchedRomFS(
309 309
310 if (romfs_factory == nullptr) { 310 if (romfs_factory == nullptr) {
311 // TODO: Find a better error code for this 311 // TODO: Find a better error code for this
312 return RESULT_UNKNOWN; 312 return ResultUnknown;
313 } 313 }
314 314
315 return romfs_factory->OpenPatchedRomFS(title_id, type); 315 return romfs_factory->OpenPatchedRomFS(title_id, type);
@@ -322,7 +322,7 @@ ResultVal<FileSys::VirtualFile> FileSystemController::OpenPatchedRomFSWithProgra
322 322
323 if (romfs_factory == nullptr) { 323 if (romfs_factory == nullptr) {
324 // TODO: Find a better error code for this 324 // TODO: Find a better error code for this
325 return RESULT_UNKNOWN; 325 return ResultUnknown;
326 } 326 }
327 327
328 return romfs_factory->OpenPatchedRomFSWithProgramIndex(title_id, program_index, type); 328 return romfs_factory->OpenPatchedRomFSWithProgramIndex(title_id, program_index, type);
@@ -335,7 +335,7 @@ ResultVal<FileSys::VirtualFile> FileSystemController::OpenRomFS(
335 335
336 if (romfs_factory == nullptr) { 336 if (romfs_factory == nullptr) {
337 // TODO(bunnei): Find a better error code for this 337 // TODO(bunnei): Find a better error code for this
338 return RESULT_UNKNOWN; 338 return ResultUnknown;
339 } 339 }
340 340
341 return romfs_factory->Open(title_id, storage_id, type); 341 return romfs_factory->Open(title_id, storage_id, type);
@@ -721,6 +721,10 @@ FileSys::VirtualDir FileSystemController::GetBCATDirectory(u64 title_id) const {
721 return bis_factory->GetBCATDirectory(title_id); 721 return bis_factory->GetBCATDirectory(title_id);
722} 722}
723 723
724void FileSystemController::SetAutoSaveDataCreation(bool enable) {
725 save_data_factory->SetAutoCreate(enable);
726}
727
724void FileSystemController::CreateFactories(FileSys::VfsFilesystem& vfs, bool overwrite) { 728void FileSystemController::CreateFactories(FileSys::VfsFilesystem& vfs, bool overwrite) {
725 if (overwrite) { 729 if (overwrite) {
726 bis_factory = nullptr; 730 bis_factory = nullptr;
diff --git a/src/core/hle/service/filesystem/filesystem.h b/src/core/hle/service/filesystem/filesystem.h
index 7102d3f9a..b6b1b9220 100644
--- a/src/core/hle/service/filesystem/filesystem.h
+++ b/src/core/hle/service/filesystem/filesystem.h
@@ -120,6 +120,8 @@ public:
120 120
121 FileSys::VirtualDir GetBCATDirectory(u64 title_id) const; 121 FileSys::VirtualDir GetBCATDirectory(u64 title_id) const;
122 122
123 void SetAutoSaveDataCreation(bool enable);
124
123 // Creates the SaveData, SDMC, and BIS Factories. Should be called once and before any function 125 // Creates the SaveData, SDMC, and BIS Factories. Should be called once and before any function
124 // above is called. 126 // above is called.
125 void CreateFactories(FileSys::VfsFilesystem& vfs, bool overwrite = true); 127 void CreateFactories(FileSys::VfsFilesystem& vfs, bool overwrite = true);
diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cpp
index 92ea27074..3af9881c2 100644
--- a/src/core/hle/service/filesystem/fsp_srv.cpp
+++ b/src/core/hle/service/filesystem/fsp_srv.cpp
@@ -100,7 +100,7 @@ private:
100 ctx.WriteBuffer(output); 100 ctx.WriteBuffer(output);
101 101
102 IPC::ResponseBuilder rb{ctx, 2}; 102 IPC::ResponseBuilder rb{ctx, 2};
103 rb.Push(RESULT_SUCCESS); 103 rb.Push(ResultSuccess);
104 } 104 }
105 105
106 void GetSize(Kernel::HLERequestContext& ctx) { 106 void GetSize(Kernel::HLERequestContext& ctx) {
@@ -108,7 +108,7 @@ private:
108 LOG_DEBUG(Service_FS, "called, size={}", size); 108 LOG_DEBUG(Service_FS, "called, size={}", size);
109 109
110 IPC::ResponseBuilder rb{ctx, 4}; 110 IPC::ResponseBuilder rb{ctx, 4};
111 rb.Push(RESULT_SUCCESS); 111 rb.Push(ResultSuccess);
112 rb.Push<u64>(size); 112 rb.Push<u64>(size);
113 } 113 }
114}; 114};
@@ -162,7 +162,7 @@ private:
162 ctx.WriteBuffer(output); 162 ctx.WriteBuffer(output);
163 163
164 IPC::ResponseBuilder rb{ctx, 4}; 164 IPC::ResponseBuilder rb{ctx, 4};
165 rb.Push(RESULT_SUCCESS); 165 rb.Push(ResultSuccess);
166 rb.Push(static_cast<u64>(output.size())); 166 rb.Push(static_cast<u64>(output.size()));
167 } 167 }
168 168
@@ -206,7 +206,7 @@ private:
206 written); 206 written);
207 207
208 IPC::ResponseBuilder rb{ctx, 2}; 208 IPC::ResponseBuilder rb{ctx, 2};
209 rb.Push(RESULT_SUCCESS); 209 rb.Push(ResultSuccess);
210 } 210 }
211 211
212 void Flush(Kernel::HLERequestContext& ctx) { 212 void Flush(Kernel::HLERequestContext& ctx) {
@@ -215,7 +215,7 @@ private:
215 // Exists for SDK compatibiltity -- No need to flush file. 215 // Exists for SDK compatibiltity -- No need to flush file.
216 216
217 IPC::ResponseBuilder rb{ctx, 2}; 217 IPC::ResponseBuilder rb{ctx, 2};
218 rb.Push(RESULT_SUCCESS); 218 rb.Push(ResultSuccess);
219 } 219 }
220 220
221 void SetSize(Kernel::HLERequestContext& ctx) { 221 void SetSize(Kernel::HLERequestContext& ctx) {
@@ -226,7 +226,7 @@ private:
226 backend->Resize(size); 226 backend->Resize(size);
227 227
228 IPC::ResponseBuilder rb{ctx, 2}; 228 IPC::ResponseBuilder rb{ctx, 2};
229 rb.Push(RESULT_SUCCESS); 229 rb.Push(ResultSuccess);
230 } 230 }
231 231
232 void GetSize(Kernel::HLERequestContext& ctx) { 232 void GetSize(Kernel::HLERequestContext& ctx) {
@@ -234,7 +234,7 @@ private:
234 LOG_DEBUG(Service_FS, "called, size={}", size); 234 LOG_DEBUG(Service_FS, "called, size={}", size);
235 235
236 IPC::ResponseBuilder rb{ctx, 4}; 236 IPC::ResponseBuilder rb{ctx, 4};
237 rb.Push(RESULT_SUCCESS); 237 rb.Push(ResultSuccess);
238 rb.Push<u64>(size); 238 rb.Push<u64>(size);
239 } 239 }
240}; 240};
@@ -290,7 +290,7 @@ private:
290 ctx.WriteBuffer(begin, range_size); 290 ctx.WriteBuffer(begin, range_size);
291 291
292 IPC::ResponseBuilder rb{ctx, 4}; 292 IPC::ResponseBuilder rb{ctx, 4};
293 rb.Push(RESULT_SUCCESS); 293 rb.Push(ResultSuccess);
294 rb.Push(actual_entries); 294 rb.Push(actual_entries);
295 } 295 }
296 296
@@ -300,7 +300,7 @@ private:
300 u64 count = entries.size() - next_entry_index; 300 u64 count = entries.size() - next_entry_index;
301 301
302 IPC::ResponseBuilder rb{ctx, 4}; 302 IPC::ResponseBuilder rb{ctx, 4};
303 rb.Push(RESULT_SUCCESS); 303 rb.Push(ResultSuccess);
304 rb.Push(count); 304 rb.Push(count);
305 } 305 }
306}; 306};
@@ -430,7 +430,7 @@ public:
430 auto file = std::make_shared<IFile>(system, result.Unwrap()); 430 auto file = std::make_shared<IFile>(system, result.Unwrap());
431 431
432 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 432 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
433 rb.Push(RESULT_SUCCESS); 433 rb.Push(ResultSuccess);
434 rb.PushIpcInterface<IFile>(std::move(file)); 434 rb.PushIpcInterface<IFile>(std::move(file));
435 } 435 }
436 436
@@ -455,7 +455,7 @@ public:
455 auto directory = std::make_shared<IDirectory>(system, result.Unwrap()); 455 auto directory = std::make_shared<IDirectory>(system, result.Unwrap());
456 456
457 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 457 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
458 rb.Push(RESULT_SUCCESS); 458 rb.Push(ResultSuccess);
459 rb.PushIpcInterface<IDirectory>(std::move(directory)); 459 rb.PushIpcInterface<IDirectory>(std::move(directory));
460 } 460 }
461 461
@@ -473,7 +473,7 @@ public:
473 } 473 }
474 474
475 IPC::ResponseBuilder rb{ctx, 3}; 475 IPC::ResponseBuilder rb{ctx, 3};
476 rb.Push(RESULT_SUCCESS); 476 rb.Push(ResultSuccess);
477 rb.Push<u32>(static_cast<u32>(*result)); 477 rb.Push<u32>(static_cast<u32>(*result));
478 } 478 }
479 479
@@ -481,14 +481,14 @@ public:
481 LOG_WARNING(Service_FS, "(STUBBED) called"); 481 LOG_WARNING(Service_FS, "(STUBBED) called");
482 482
483 IPC::ResponseBuilder rb{ctx, 2}; 483 IPC::ResponseBuilder rb{ctx, 2};
484 rb.Push(RESULT_SUCCESS); 484 rb.Push(ResultSuccess);
485 } 485 }
486 486
487 void GetFreeSpaceSize(Kernel::HLERequestContext& ctx) { 487 void GetFreeSpaceSize(Kernel::HLERequestContext& ctx) {
488 LOG_DEBUG(Service_FS, "called"); 488 LOG_DEBUG(Service_FS, "called");
489 489
490 IPC::ResponseBuilder rb{ctx, 4}; 490 IPC::ResponseBuilder rb{ctx, 4};
491 rb.Push(RESULT_SUCCESS); 491 rb.Push(ResultSuccess);
492 rb.Push(size.get_free_size()); 492 rb.Push(size.get_free_size());
493 } 493 }
494 494
@@ -496,7 +496,7 @@ public:
496 LOG_DEBUG(Service_FS, "called"); 496 LOG_DEBUG(Service_FS, "called");
497 497
498 IPC::ResponseBuilder rb{ctx, 4}; 498 IPC::ResponseBuilder rb{ctx, 4};
499 rb.Push(RESULT_SUCCESS); 499 rb.Push(ResultSuccess);
500 rb.Push(size.get_total_size()); 500 rb.Push(size.get_total_size());
501 } 501 }
502 502
@@ -538,7 +538,7 @@ public:
538 ctx.WriteBuffer(begin, range_size); 538 ctx.WriteBuffer(begin, range_size);
539 539
540 IPC::ResponseBuilder rb{ctx, 3}; 540 IPC::ResponseBuilder rb{ctx, 3};
541 rb.Push(RESULT_SUCCESS); 541 rb.Push(ResultSuccess);
542 rb.Push<u32>(static_cast<u32>(actual_entries)); 542 rb.Push<u32>(static_cast<u32>(actual_entries));
543 } 543 }
544 544
@@ -764,7 +764,7 @@ FSP_SRV::FSP_SRV(Core::System& system_)
764 {1000, nullptr, "SetBisRootForHost"}, 764 {1000, nullptr, "SetBisRootForHost"},
765 {1001, nullptr, "SetSaveDataSize"}, 765 {1001, nullptr, "SetSaveDataSize"},
766 {1002, nullptr, "SetSaveDataRootPath"}, 766 {1002, nullptr, "SetSaveDataRootPath"},
767 {1003, nullptr, "DisableAutoSaveDataCreation"}, 767 {1003, &FSP_SRV::DisableAutoSaveDataCreation, "DisableAutoSaveDataCreation"},
768 {1004, &FSP_SRV::SetGlobalAccessLogMode, "SetGlobalAccessLogMode"}, 768 {1004, &FSP_SRV::SetGlobalAccessLogMode, "SetGlobalAccessLogMode"},
769 {1005, &FSP_SRV::GetGlobalAccessLogMode, "GetGlobalAccessLogMode"}, 769 {1005, &FSP_SRV::GetGlobalAccessLogMode, "GetGlobalAccessLogMode"},
770 {1006, &FSP_SRV::OutputAccessLogToSdCard, "OutputAccessLogToSdCard"}, 770 {1006, &FSP_SRV::OutputAccessLogToSdCard, "OutputAccessLogToSdCard"},
@@ -796,7 +796,7 @@ void FSP_SRV::SetCurrentProcess(Kernel::HLERequestContext& ctx) {
796 LOG_DEBUG(Service_FS, "called. current_process_id=0x{:016X}", current_process_id); 796 LOG_DEBUG(Service_FS, "called. current_process_id=0x{:016X}", current_process_id);
797 797
798 IPC::ResponseBuilder rb{ctx, 2}; 798 IPC::ResponseBuilder rb{ctx, 2};
799 rb.Push(RESULT_SUCCESS); 799 rb.Push(ResultSuccess);
800} 800}
801 801
802void FSP_SRV::OpenFileSystemWithPatch(Kernel::HLERequestContext& ctx) { 802void FSP_SRV::OpenFileSystemWithPatch(Kernel::HLERequestContext& ctx) {
@@ -807,7 +807,7 @@ void FSP_SRV::OpenFileSystemWithPatch(Kernel::HLERequestContext& ctx) {
807 LOG_WARNING(Service_FS, "(STUBBED) called with type={}, title_id={:016X}", type, title_id); 807 LOG_WARNING(Service_FS, "(STUBBED) called with type={}, title_id={:016X}", type, title_id);
808 808
809 IPC::ResponseBuilder rb{ctx, 2, 0, 0}; 809 IPC::ResponseBuilder rb{ctx, 2, 0, 0};
810 rb.Push(RESULT_UNKNOWN); 810 rb.Push(ResultUnknown);
811} 811}
812 812
813void FSP_SRV::OpenSdCardFileSystem(Kernel::HLERequestContext& ctx) { 813void FSP_SRV::OpenSdCardFileSystem(Kernel::HLERequestContext& ctx) {
@@ -818,7 +818,7 @@ void FSP_SRV::OpenSdCardFileSystem(Kernel::HLERequestContext& ctx) {
818 SizeGetter::FromStorageId(fsc, FileSys::StorageId::SdCard)); 818 SizeGetter::FromStorageId(fsc, FileSys::StorageId::SdCard));
819 819
820 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 820 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
821 rb.Push(RESULT_SUCCESS); 821 rb.Push(ResultSuccess);
822 rb.PushIpcInterface<IFileSystem>(std::move(filesystem)); 822 rb.PushIpcInterface<IFileSystem>(std::move(filesystem));
823} 823}
824 824
@@ -835,7 +835,7 @@ void FSP_SRV::CreateSaveDataFileSystem(Kernel::HLERequestContext& ctx) {
835 fsc.CreateSaveData(FileSys::SaveDataSpaceId::NandUser, save_struct); 835 fsc.CreateSaveData(FileSys::SaveDataSpaceId::NandUser, save_struct);
836 836
837 IPC::ResponseBuilder rb{ctx, 2}; 837 IPC::ResponseBuilder rb{ctx, 2};
838 rb.Push(RESULT_SUCCESS); 838 rb.Push(ResultSuccess);
839} 839}
840 840
841void FSP_SRV::OpenSaveDataFileSystem(Kernel::HLERequestContext& ctx) { 841void FSP_SRV::OpenSaveDataFileSystem(Kernel::HLERequestContext& ctx) {
@@ -879,7 +879,7 @@ void FSP_SRV::OpenSaveDataFileSystem(Kernel::HLERequestContext& ctx) {
879 SizeGetter::FromStorageId(fsc, id)); 879 SizeGetter::FromStorageId(fsc, id));
880 880
881 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 881 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
882 rb.Push(RESULT_SUCCESS); 882 rb.Push(ResultSuccess);
883 rb.PushIpcInterface<IFileSystem>(std::move(filesystem)); 883 rb.PushIpcInterface<IFileSystem>(std::move(filesystem));
884} 884}
885 885
@@ -894,7 +894,7 @@ void FSP_SRV::OpenSaveDataInfoReaderBySaveDataSpaceId(Kernel::HLERequestContext&
894 LOG_INFO(Service_FS, "called, space={}", space); 894 LOG_INFO(Service_FS, "called, space={}", space);
895 895
896 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 896 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
897 rb.Push(RESULT_SUCCESS); 897 rb.Push(ResultSuccess);
898 rb.PushIpcInterface<ISaveDataInfoReader>( 898 rb.PushIpcInterface<ISaveDataInfoReader>(
899 std::make_shared<ISaveDataInfoReader>(system, space, fsc)); 899 std::make_shared<ISaveDataInfoReader>(system, space, fsc));
900} 900}
@@ -903,7 +903,7 @@ void FSP_SRV::WriteSaveDataFileSystemExtraDataBySaveDataAttribute(Kernel::HLEReq
903 LOG_WARNING(Service_FS, "(STUBBED) called."); 903 LOG_WARNING(Service_FS, "(STUBBED) called.");
904 904
905 IPC::ResponseBuilder rb{ctx, 2}; 905 IPC::ResponseBuilder rb{ctx, 2};
906 rb.Push(RESULT_SUCCESS); 906 rb.Push(ResultSuccess);
907} 907}
908 908
909void FSP_SRV::ReadSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute( 909void FSP_SRV::ReadSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute(
@@ -929,7 +929,7 @@ void FSP_SRV::ReadSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute(
929 parameters.attribute.index); 929 parameters.attribute.index);
930 930
931 IPC::ResponseBuilder rb{ctx, 3}; 931 IPC::ResponseBuilder rb{ctx, 3};
932 rb.Push(RESULT_SUCCESS); 932 rb.Push(ResultSuccess);
933 rb.Push(flags); 933 rb.Push(flags);
934} 934}
935 935
@@ -941,14 +941,14 @@ void FSP_SRV::OpenDataStorageByCurrentProcess(Kernel::HLERequestContext& ctx) {
941 // TODO (bunnei): Find the right error code to use here 941 // TODO (bunnei): Find the right error code to use here
942 LOG_CRITICAL(Service_FS, "no file system interface available!"); 942 LOG_CRITICAL(Service_FS, "no file system interface available!");
943 IPC::ResponseBuilder rb{ctx, 2}; 943 IPC::ResponseBuilder rb{ctx, 2};
944 rb.Push(RESULT_UNKNOWN); 944 rb.Push(ResultUnknown);
945 return; 945 return;
946 } 946 }
947 947
948 auto storage = std::make_shared<IStorage>(system, std::move(current_romfs.Unwrap())); 948 auto storage = std::make_shared<IStorage>(system, std::move(current_romfs.Unwrap()));
949 949
950 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 950 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
951 rb.Push(RESULT_SUCCESS); 951 rb.Push(ResultSuccess);
952 rb.PushIpcInterface<IStorage>(std::move(storage)); 952 rb.PushIpcInterface<IStorage>(std::move(storage));
953} 953}
954 954
@@ -968,7 +968,7 @@ void FSP_SRV::OpenDataStorageByDataId(Kernel::HLERequestContext& ctx) {
968 968
969 if (archive != nullptr) { 969 if (archive != nullptr) {
970 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 970 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
971 rb.Push(RESULT_SUCCESS); 971 rb.Push(ResultSuccess);
972 rb.PushIpcInterface(std::make_shared<IStorage>(system, archive)); 972 rb.PushIpcInterface(std::make_shared<IStorage>(system, archive));
973 return; 973 return;
974 } 974 }
@@ -978,7 +978,7 @@ void FSP_SRV::OpenDataStorageByDataId(Kernel::HLERequestContext& ctx) {
978 "could not open data storage with title_id={:016X}, storage_id={:02X}", title_id, 978 "could not open data storage with title_id={:016X}, storage_id={:02X}", title_id,
979 storage_id); 979 storage_id);
980 IPC::ResponseBuilder rb{ctx, 2}; 980 IPC::ResponseBuilder rb{ctx, 2};
981 rb.Push(RESULT_UNKNOWN); 981 rb.Push(ResultUnknown);
982 return; 982 return;
983 } 983 }
984 984
@@ -988,7 +988,7 @@ void FSP_SRV::OpenDataStorageByDataId(Kernel::HLERequestContext& ctx) {
988 system, pm.PatchRomFS(std::move(data.Unwrap()), 0, FileSys::ContentRecordType::Data)); 988 system, pm.PatchRomFS(std::move(data.Unwrap()), 0, FileSys::ContentRecordType::Data));
989 989
990 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 990 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
991 rb.Push(RESULT_SUCCESS); 991 rb.Push(ResultSuccess);
992 rb.PushIpcInterface<IStorage>(std::move(storage)); 992 rb.PushIpcInterface<IStorage>(std::move(storage));
993} 993}
994 994
@@ -1019,17 +1019,26 @@ void FSP_SRV::OpenDataStorageWithProgramIndex(Kernel::HLERequestContext& ctx) {
1019 LOG_ERROR(Service_FS, "could not open storage with program_index={}", program_index); 1019 LOG_ERROR(Service_FS, "could not open storage with program_index={}", program_index);
1020 1020
1021 IPC::ResponseBuilder rb{ctx, 2}; 1021 IPC::ResponseBuilder rb{ctx, 2};
1022 rb.Push(RESULT_UNKNOWN); 1022 rb.Push(ResultUnknown);
1023 return; 1023 return;
1024 } 1024 }
1025 1025
1026 auto storage = std::make_shared<IStorage>(system, std::move(patched_romfs.Unwrap())); 1026 auto storage = std::make_shared<IStorage>(system, std::move(patched_romfs.Unwrap()));
1027 1027
1028 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 1028 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
1029 rb.Push(RESULT_SUCCESS); 1029 rb.Push(ResultSuccess);
1030 rb.PushIpcInterface<IStorage>(std::move(storage)); 1030 rb.PushIpcInterface<IStorage>(std::move(storage));
1031} 1031}
1032 1032
1033void FSP_SRV::DisableAutoSaveDataCreation(Kernel::HLERequestContext& ctx) {
1034 LOG_DEBUG(Service_FS, "called");
1035
1036 fsc.SetAutoSaveDataCreation(false);
1037
1038 IPC::ResponseBuilder rb{ctx, 2};
1039 rb.Push(ResultSuccess);
1040}
1041
1033void FSP_SRV::SetGlobalAccessLogMode(Kernel::HLERequestContext& ctx) { 1042void FSP_SRV::SetGlobalAccessLogMode(Kernel::HLERequestContext& ctx) {
1034 IPC::RequestParser rp{ctx}; 1043 IPC::RequestParser rp{ctx};
1035 log_mode = rp.PopEnum<LogMode>(); 1044 log_mode = rp.PopEnum<LogMode>();
@@ -1037,14 +1046,14 @@ void FSP_SRV::SetGlobalAccessLogMode(Kernel::HLERequestContext& ctx) {
1037 LOG_DEBUG(Service_FS, "called, log_mode={:08X}", log_mode); 1046 LOG_DEBUG(Service_FS, "called, log_mode={:08X}", log_mode);
1038 1047
1039 IPC::ResponseBuilder rb{ctx, 2}; 1048 IPC::ResponseBuilder rb{ctx, 2};
1040 rb.Push(RESULT_SUCCESS); 1049 rb.Push(ResultSuccess);
1041} 1050}
1042 1051
1043void FSP_SRV::GetGlobalAccessLogMode(Kernel::HLERequestContext& ctx) { 1052void FSP_SRV::GetGlobalAccessLogMode(Kernel::HLERequestContext& ctx) {
1044 LOG_DEBUG(Service_FS, "called"); 1053 LOG_DEBUG(Service_FS, "called");
1045 1054
1046 IPC::ResponseBuilder rb{ctx, 3}; 1055 IPC::ResponseBuilder rb{ctx, 3};
1047 rb.Push(RESULT_SUCCESS); 1056 rb.Push(ResultSuccess);
1048 rb.PushEnum(log_mode); 1057 rb.PushEnum(log_mode);
1049} 1058}
1050 1059
@@ -1058,14 +1067,14 @@ void FSP_SRV::OutputAccessLogToSdCard(Kernel::HLERequestContext& ctx) {
1058 reporter.SaveFilesystemAccessReport(log_mode, std::move(log)); 1067 reporter.SaveFilesystemAccessReport(log_mode, std::move(log));
1059 1068
1060 IPC::ResponseBuilder rb{ctx, 2}; 1069 IPC::ResponseBuilder rb{ctx, 2};
1061 rb.Push(RESULT_SUCCESS); 1070 rb.Push(ResultSuccess);
1062} 1071}
1063 1072
1064void FSP_SRV::GetProgramIndexForAccessLog(Kernel::HLERequestContext& ctx) { 1073void FSP_SRV::GetProgramIndexForAccessLog(Kernel::HLERequestContext& ctx) {
1065 LOG_DEBUG(Service_FS, "called"); 1074 LOG_DEBUG(Service_FS, "called");
1066 1075
1067 IPC::ResponseBuilder rb{ctx, 4}; 1076 IPC::ResponseBuilder rb{ctx, 4};
1068 rb.Push(RESULT_SUCCESS); 1077 rb.Push(ResultSuccess);
1069 rb.PushEnum(AccessLogVersion::Latest); 1078 rb.PushEnum(AccessLogVersion::Latest);
1070 rb.Push(access_log_program_index); 1079 rb.Push(access_log_program_index);
1071} 1080}
@@ -1088,14 +1097,14 @@ private:
1088 LOG_WARNING(Service_FS, "(STUBBED) called"); 1097 LOG_WARNING(Service_FS, "(STUBBED) called");
1089 1098
1090 IPC::ResponseBuilder rb{ctx, 2}; 1099 IPC::ResponseBuilder rb{ctx, 2};
1091 rb.Push(RESULT_SUCCESS); 1100 rb.Push(ResultSuccess);
1092 } 1101 }
1093 1102
1094 void Commit(Kernel::HLERequestContext& ctx) { 1103 void Commit(Kernel::HLERequestContext& ctx) {
1095 LOG_WARNING(Service_FS, "(STUBBED) called"); 1104 LOG_WARNING(Service_FS, "(STUBBED) called");
1096 1105
1097 IPC::ResponseBuilder rb{ctx, 2}; 1106 IPC::ResponseBuilder rb{ctx, 2};
1098 rb.Push(RESULT_SUCCESS); 1107 rb.Push(ResultSuccess);
1099 } 1108 }
1100}; 1109};
1101 1110
@@ -1103,7 +1112,7 @@ void FSP_SRV::OpenMultiCommitManager(Kernel::HLERequestContext& ctx) {
1103 LOG_DEBUG(Service_FS, "called"); 1112 LOG_DEBUG(Service_FS, "called");
1104 1113
1105 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 1114 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
1106 rb.Push(RESULT_SUCCESS); 1115 rb.Push(ResultSuccess);
1107 rb.PushIpcInterface<IMultiCommitManager>(std::make_shared<IMultiCommitManager>(system)); 1116 rb.PushIpcInterface<IMultiCommitManager>(std::make_shared<IMultiCommitManager>(system));
1108} 1117}
1109 1118
diff --git a/src/core/hle/service/filesystem/fsp_srv.h b/src/core/hle/service/filesystem/fsp_srv.h
index b01b924eb..ff7455a20 100644
--- a/src/core/hle/service/filesystem/fsp_srv.h
+++ b/src/core/hle/service/filesystem/fsp_srv.h
@@ -50,6 +50,7 @@ private:
50 void OpenDataStorageByDataId(Kernel::HLERequestContext& ctx); 50 void OpenDataStorageByDataId(Kernel::HLERequestContext& ctx);
51 void OpenPatchDataStorageByCurrentProcess(Kernel::HLERequestContext& ctx); 51 void OpenPatchDataStorageByCurrentProcess(Kernel::HLERequestContext& ctx);
52 void OpenDataStorageWithProgramIndex(Kernel::HLERequestContext& ctx); 52 void OpenDataStorageWithProgramIndex(Kernel::HLERequestContext& ctx);
53 void DisableAutoSaveDataCreation(Kernel::HLERequestContext& ctx);
53 void SetGlobalAccessLogMode(Kernel::HLERequestContext& ctx); 54 void SetGlobalAccessLogMode(Kernel::HLERequestContext& ctx);
54 void GetGlobalAccessLogMode(Kernel::HLERequestContext& ctx); 55 void GetGlobalAccessLogMode(Kernel::HLERequestContext& ctx);
55 void OutputAccessLogToSdCard(Kernel::HLERequestContext& ctx); 56 void OutputAccessLogToSdCard(Kernel::HLERequestContext& ctx);
diff --git a/src/core/hle/service/friend/friend.cpp b/src/core/hle/service/friend/friend.cpp
index 91c202952..c5f88bce7 100644
--- a/src/core/hle/service/friend/friend.cpp
+++ b/src/core/hle/service/friend/friend.cpp
@@ -135,7 +135,7 @@ private:
135 // blocked users. 135 // blocked users.
136 LOG_WARNING(Service_Friend, "(STUBBED) called"); 136 LOG_WARNING(Service_Friend, "(STUBBED) called");
137 IPC::ResponseBuilder rb{ctx, 3}; 137 IPC::ResponseBuilder rb{ctx, 3};
138 rb.Push(RESULT_SUCCESS); 138 rb.Push(ResultSuccess);
139 rb.Push<u32>(0); // Indicates there are no blocked users 139 rb.Push<u32>(0); // Indicates there are no blocked users
140 } 140 }
141 141
@@ -143,14 +143,14 @@ private:
143 // Stub used by Splatoon 2 143 // Stub used by Splatoon 2
144 LOG_WARNING(Service_Friend, "(STUBBED) called"); 144 LOG_WARNING(Service_Friend, "(STUBBED) called");
145 IPC::ResponseBuilder rb{ctx, 2}; 145 IPC::ResponseBuilder rb{ctx, 2};
146 rb.Push(RESULT_SUCCESS); 146 rb.Push(ResultSuccess);
147 } 147 }
148 148
149 void UpdateUserPresence(Kernel::HLERequestContext& ctx) { 149 void UpdateUserPresence(Kernel::HLERequestContext& ctx) {
150 // Stub used by Retro City Rampage 150 // Stub used by Retro City Rampage
151 LOG_WARNING(Service_Friend, "(STUBBED) called"); 151 LOG_WARNING(Service_Friend, "(STUBBED) called");
152 IPC::ResponseBuilder rb{ctx, 2}; 152 IPC::ResponseBuilder rb{ctx, 2};
153 rb.Push(RESULT_SUCCESS); 153 rb.Push(ResultSuccess);
154 } 154 }
155 155
156 void GetPlayHistoryRegistrationKey(Kernel::HLERequestContext& ctx) { 156 void GetPlayHistoryRegistrationKey(Kernel::HLERequestContext& ctx) {
@@ -162,7 +162,7 @@ private:
162 uuid.Format()); 162 uuid.Format());
163 163
164 IPC::ResponseBuilder rb{ctx, 2}; 164 IPC::ResponseBuilder rb{ctx, 2};
165 rb.Push(RESULT_SUCCESS); 165 rb.Push(ResultSuccess);
166 } 166 }
167 167
168 void GetFriendList(Kernel::HLERequestContext& ctx) { 168 void GetFriendList(Kernel::HLERequestContext& ctx) {
@@ -175,7 +175,7 @@ private:
175 uuid.Format(), pid); 175 uuid.Format(), pid);
176 176
177 IPC::ResponseBuilder rb{ctx, 3}; 177 IPC::ResponseBuilder rb{ctx, 3};
178 rb.Push(RESULT_SUCCESS); 178 rb.Push(ResultSuccess);
179 179
180 rb.Push<u32>(0); // Friend count 180 rb.Push<u32>(0); // Friend count
181 // TODO(ogniK): Return a buffer of u64s which are the "NetworkServiceAccountId" 181 // TODO(ogniK): Return a buffer of u64s which are the "NetworkServiceAccountId"
@@ -206,7 +206,7 @@ private:
206 LOG_DEBUG(Service_Friend, "called"); 206 LOG_DEBUG(Service_Friend, "called");
207 207
208 IPC::ResponseBuilder rb{ctx, 2, 1}; 208 IPC::ResponseBuilder rb{ctx, 2, 1};
209 rb.Push(RESULT_SUCCESS); 209 rb.Push(ResultSuccess);
210 rb.PushCopyObjects(notification_event.GetReadableEvent()); 210 rb.PushCopyObjects(notification_event.GetReadableEvent());
211 } 211 }
212 212
@@ -218,7 +218,7 @@ private:
218 std::memset(&states, 0, sizeof(States)); 218 std::memset(&states, 0, sizeof(States));
219 219
220 IPC::ResponseBuilder rb{ctx, 2}; 220 IPC::ResponseBuilder rb{ctx, 2};
221 rb.Push(RESULT_SUCCESS); 221 rb.Push(ResultSuccess);
222 } 222 }
223 223
224 void Pop(Kernel::HLERequestContext& ctx) { 224 void Pop(Kernel::HLERequestContext& ctx) {
@@ -249,7 +249,7 @@ private:
249 } 249 }
250 250
251 IPC::ResponseBuilder rb{ctx, 6}; 251 IPC::ResponseBuilder rb{ctx, 6};
252 rb.Push(RESULT_SUCCESS); 252 rb.Push(ResultSuccess);
253 rb.PushRaw<SizedNotificationInfo>(notification); 253 rb.PushRaw<SizedNotificationInfo>(notification);
254 } 254 }
255 255
@@ -280,7 +280,7 @@ private:
280 280
281void Module::Interface::CreateFriendService(Kernel::HLERequestContext& ctx) { 281void Module::Interface::CreateFriendService(Kernel::HLERequestContext& ctx) {
282 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 282 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
283 rb.Push(RESULT_SUCCESS); 283 rb.Push(ResultSuccess);
284 rb.PushIpcInterface<IFriendService>(system); 284 rb.PushIpcInterface<IFriendService>(system);
285 LOG_DEBUG(Service_Friend, "called"); 285 LOG_DEBUG(Service_Friend, "called");
286} 286}
@@ -292,7 +292,7 @@ void Module::Interface::CreateNotificationService(Kernel::HLERequestContext& ctx
292 LOG_DEBUG(Service_Friend, "called, uuid={}", uuid.Format()); 292 LOG_DEBUG(Service_Friend, "called, uuid={}", uuid.Format());
293 293
294 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 294 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
295 rb.Push(RESULT_SUCCESS); 295 rb.Push(ResultSuccess);
296 rb.PushIpcInterface<INotificationService>(uuid, system); 296 rb.PushIpcInterface<INotificationService>(uuid, system);
297} 297}
298 298
diff --git a/src/core/hle/service/glue/arp.cpp b/src/core/hle/service/glue/arp.cpp
index 6ad62ee5a..ca25df67e 100644
--- a/src/core/hle/service/glue/arp.cpp
+++ b/src/core/hle/service/glue/arp.cpp
@@ -79,7 +79,7 @@ void ARP_R::GetApplicationLaunchProperty(Kernel::HLERequestContext& ctx) {
79 } 79 }
80 80
81 IPC::ResponseBuilder rb{ctx, 6}; 81 IPC::ResponseBuilder rb{ctx, 6};
82 rb.Push(RESULT_SUCCESS); 82 rb.Push(ResultSuccess);
83 rb.PushRaw(*res); 83 rb.PushRaw(*res);
84} 84}
85 85
@@ -99,7 +99,7 @@ void ARP_R::GetApplicationLaunchPropertyWithApplicationId(Kernel::HLERequestCont
99 } 99 }
100 100
101 IPC::ResponseBuilder rb{ctx, 6}; 101 IPC::ResponseBuilder rb{ctx, 6};
102 rb.Push(RESULT_SUCCESS); 102 rb.Push(ResultSuccess);
103 rb.PushRaw(*res); 103 rb.PushRaw(*res);
104} 104}
105 105
@@ -129,7 +129,7 @@ void ARP_R::GetApplicationControlProperty(Kernel::HLERequestContext& ctx) {
129 ctx.WriteBuffer(*res); 129 ctx.WriteBuffer(*res);
130 130
131 IPC::ResponseBuilder rb{ctx, 2}; 131 IPC::ResponseBuilder rb{ctx, 2};
132 rb.Push(RESULT_SUCCESS); 132 rb.Push(ResultSuccess);
133} 133}
134 134
135void ARP_R::GetApplicationControlPropertyWithApplicationId(Kernel::HLERequestContext& ctx) { 135void ARP_R::GetApplicationControlPropertyWithApplicationId(Kernel::HLERequestContext& ctx) {
@@ -150,7 +150,7 @@ void ARP_R::GetApplicationControlPropertyWithApplicationId(Kernel::HLERequestCon
150 ctx.WriteBuffer(*res); 150 ctx.WriteBuffer(*res);
151 151
152 IPC::ResponseBuilder rb{ctx, 2}; 152 IPC::ResponseBuilder rb{ctx, 2};
153 rb.Push(RESULT_SUCCESS); 153 rb.Push(ResultSuccess);
154} 154}
155 155
156class IRegistrar final : public ServiceFramework<IRegistrar> { 156class IRegistrar final : public ServiceFramework<IRegistrar> {
@@ -198,7 +198,7 @@ private:
198 issued = true; 198 issued = true;
199 199
200 IPC::ResponseBuilder rb{ctx, 2}; 200 IPC::ResponseBuilder rb{ctx, 2};
201 rb.Push(RESULT_SUCCESS); 201 rb.Push(ResultSuccess);
202 } 202 }
203 203
204 void SetApplicationLaunchProperty(Kernel::HLERequestContext& ctx) { 204 void SetApplicationLaunchProperty(Kernel::HLERequestContext& ctx) {
@@ -217,7 +217,7 @@ private:
217 launch = rp.PopRaw<ApplicationLaunchProperty>(); 217 launch = rp.PopRaw<ApplicationLaunchProperty>();
218 218
219 IPC::ResponseBuilder rb{ctx, 2}; 219 IPC::ResponseBuilder rb{ctx, 2};
220 rb.Push(RESULT_SUCCESS); 220 rb.Push(ResultSuccess);
221 } 221 }
222 222
223 void SetApplicationControlProperty(Kernel::HLERequestContext& ctx) { 223 void SetApplicationControlProperty(Kernel::HLERequestContext& ctx) {
@@ -235,7 +235,7 @@ private:
235 control = ctx.ReadBuffer(); 235 control = ctx.ReadBuffer();
236 236
237 IPC::ResponseBuilder rb{ctx, 2}; 237 IPC::ResponseBuilder rb{ctx, 2};
238 rb.Push(RESULT_SUCCESS); 238 rb.Push(ResultSuccess);
239 } 239 }
240 240
241 IssuerFn issue_process_id; 241 IssuerFn issue_process_id;
@@ -273,7 +273,7 @@ void ARP_W::AcquireRegistrar(Kernel::HLERequestContext& ctx) {
273 }); 273 });
274 274
275 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 275 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
276 rb.Push(RESULT_SUCCESS); 276 rb.Push(ResultSuccess);
277 rb.PushIpcInterface(registrar); 277 rb.PushIpcInterface(registrar);
278} 278}
279 279
diff --git a/src/core/hle/service/glue/bgtc.cpp b/src/core/hle/service/glue/bgtc.cpp
index daecfff15..564c3b750 100644
--- a/src/core/hle/service/glue/bgtc.cpp
+++ b/src/core/hle/service/glue/bgtc.cpp
@@ -25,7 +25,7 @@ void BGTC_T::OpenTaskService(Kernel::HLERequestContext& ctx) {
25 LOG_DEBUG(Service_BGTC, "called"); 25 LOG_DEBUG(Service_BGTC, "called");
26 26
27 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 27 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
28 rb.Push(RESULT_SUCCESS); 28 rb.Push(ResultSuccess);
29 rb.PushIpcInterface<ITaskService>(system); 29 rb.PushIpcInterface<ITaskService>(system);
30} 30}
31 31
diff --git a/src/core/hle/service/glue/manager.cpp b/src/core/hle/service/glue/manager.cpp
index 6da52d2d6..9b1754cf8 100644
--- a/src/core/hle/service/glue/manager.cpp
+++ b/src/core/hle/service/glue/manager.cpp
@@ -54,7 +54,7 @@ ResultCode ARPManager::Register(u64 title_id, ApplicationLaunchProperty launch,
54 } 54 }
55 55
56 entries.insert_or_assign(title_id, MapEntry{launch, std::move(control)}); 56 entries.insert_or_assign(title_id, MapEntry{launch, std::move(control)});
57 return RESULT_SUCCESS; 57 return ResultSuccess;
58} 58}
59 59
60ResultCode ARPManager::Unregister(u64 title_id) { 60ResultCode ARPManager::Unregister(u64 title_id) {
@@ -68,7 +68,7 @@ ResultCode ARPManager::Unregister(u64 title_id) {
68 } 68 }
69 69
70 entries.erase(iter); 70 entries.erase(iter);
71 return RESULT_SUCCESS; 71 return ResultSuccess;
72} 72}
73 73
74void ARPManager::ResetAll() { 74void ARPManager::ResetAll() {
diff --git a/src/core/hle/service/hid/controllers/gesture.h b/src/core/hle/service/hid/controllers/gesture.h
index eecfeaad5..7e7ae6625 100644
--- a/src/core/hle/service/hid/controllers/gesture.h
+++ b/src/core/hle/service/hid/controllers/gesture.h
@@ -7,6 +7,7 @@
7#include <array> 7#include <array>
8#include "common/bit_field.h" 8#include "common/bit_field.h"
9#include "common/common_types.h" 9#include "common/common_types.h"
10#include "common/point.h"
10#include "core/frontend/input.h" 11#include "core/frontend/input.h"
11#include "core/hle/service/hid/controllers/controller_base.h" 12#include "core/hle/service/hid/controllers/controller_base.h"
12 13
@@ -63,44 +64,21 @@ private:
63 }; 64 };
64 static_assert(sizeof(Attribute) == 4, "Attribute is an invalid size"); 65 static_assert(sizeof(Attribute) == 4, "Attribute is an invalid size");
65 66
66 template <typename T>
67 struct Point {
68 T x{};
69 T y{};
70
71 friend Point operator+(const Point& lhs, const Point& rhs) {
72 return {
73 .x = lhs.x + rhs.x,
74 .y = lhs.y + rhs.y,
75 };
76 }
77
78 friend Point operator-(const Point& lhs, const Point& rhs) {
79 return {
80 .x = lhs.x - rhs.x,
81 .y = lhs.y - rhs.y,
82 };
83 }
84
85 friend bool operator==(const Point&, const Point&) = default;
86 };
87 static_assert(sizeof(Point<s32_le>) == 8, "Point is an invalid size");
88
89 struct GestureState { 67 struct GestureState {
90 s64_le sampling_number; 68 s64_le sampling_number;
91 s64_le sampling_number2; 69 s64_le sampling_number2;
92 s64_le detection_count; 70 s64_le detection_count;
93 TouchType type; 71 TouchType type;
94 Direction direction; 72 Direction direction;
95 Point<s32_le> pos; 73 Common::Point<s32_le> pos;
96 Point<s32_le> delta; 74 Common::Point<s32_le> delta;
97 f32 vel_x; 75 f32 vel_x;
98 f32 vel_y; 76 f32 vel_y;
99 Attribute attributes; 77 Attribute attributes;
100 f32 scale; 78 f32 scale;
101 f32 rotation_angle; 79 f32 rotation_angle;
102 s32_le point_count; 80 s32_le point_count;
103 std::array<Point<s32_le>, 4> points; 81 std::array<Common::Point<s32_le>, 4> points;
104 }; 82 };
105 static_assert(sizeof(GestureState) == 0x68, "GestureState is an invalid size"); 83 static_assert(sizeof(GestureState) == 0x68, "GestureState is an invalid size");
106 84
@@ -111,14 +89,14 @@ private:
111 static_assert(sizeof(SharedMemory) == 0x708, "SharedMemory is an invalid size"); 89 static_assert(sizeof(SharedMemory) == 0x708, "SharedMemory is an invalid size");
112 90
113 struct Finger { 91 struct Finger {
114 Point<f32> pos{}; 92 Common::Point<f32> pos{};
115 bool pressed{}; 93 bool pressed{};
116 }; 94 };
117 95
118 struct GestureProperties { 96 struct GestureProperties {
119 std::array<Point<s32_le>, MAX_POINTS> points{}; 97 std::array<Common::Point<s32_le>, MAX_POINTS> points{};
120 std::size_t active_points{}; 98 std::size_t active_points{};
121 Point<s32_le> mid_point{}; 99 Common::Point<s32_le> mid_point{};
122 s64_le detection_count{}; 100 s64_le detection_count{};
123 u64_le delta_time{}; 101 u64_le delta_time{};
124 f32 average_distance{}; 102 f32 average_distance{};
diff --git a/src/core/hle/service/hid/controllers/touchscreen.cpp b/src/core/hle/service/hid/controllers/touchscreen.cpp
index ac9112c40..6ef17acc5 100644
--- a/src/core/hle/service/hid/controllers/touchscreen.cpp
+++ b/src/core/hle/service/hid/controllers/touchscreen.cpp
@@ -74,8 +74,11 @@ void Controller_Touchscreen::OnUpdate(const Core::Timing::CoreTiming& core_timin
74 for (std::size_t id = 0; id < MAX_FINGERS; ++id) { 74 for (std::size_t id = 0; id < MAX_FINGERS; ++id) {
75 auto& touch_entry = cur_entry.states[id]; 75 auto& touch_entry = cur_entry.states[id];
76 if (id < active_fingers_count) { 76 if (id < active_fingers_count) {
77 touch_entry.x = static_cast<u16>(active_fingers[id].x * Layout::ScreenUndocked::Width); 77 const auto& [active_x, active_y] = active_fingers[id].position;
78 touch_entry.y = static_cast<u16>(active_fingers[id].y * Layout::ScreenUndocked::Height); 78 touch_entry.position = {
79 .x = static_cast<u16>(active_x * Layout::ScreenUndocked::Width),
80 .y = static_cast<u16>(active_y * Layout::ScreenUndocked::Height),
81 };
79 touch_entry.diameter_x = Settings::values.touchscreen.diameter_x; 82 touch_entry.diameter_x = Settings::values.touchscreen.diameter_x;
80 touch_entry.diameter_y = Settings::values.touchscreen.diameter_y; 83 touch_entry.diameter_y = Settings::values.touchscreen.diameter_y;
81 touch_entry.rotation_angle = Settings::values.touchscreen.rotation_angle; 84 touch_entry.rotation_angle = Settings::values.touchscreen.rotation_angle;
@@ -86,8 +89,7 @@ void Controller_Touchscreen::OnUpdate(const Core::Timing::CoreTiming& core_timin
86 } else { 89 } else {
87 // Clear touch entry 90 // Clear touch entry
88 touch_entry.attribute.raw = 0; 91 touch_entry.attribute.raw = 0;
89 touch_entry.x = 0; 92 touch_entry.position = {};
90 touch_entry.y = 0;
91 touch_entry.diameter_x = 0; 93 touch_entry.diameter_x = 0;
92 touch_entry.diameter_y = 0; 94 touch_entry.diameter_y = 0;
93 touch_entry.rotation_angle = 0; 95 touch_entry.rotation_angle = 0;
@@ -140,8 +142,7 @@ std::size_t Controller_Touchscreen::UpdateTouchInputEvent(
140 fingers[finger_id].id = static_cast<u32_le>(finger_id); 142 fingers[finger_id].id = static_cast<u32_le>(finger_id);
141 attribute.start_touch.Assign(1); 143 attribute.start_touch.Assign(1);
142 } 144 }
143 fingers[finger_id].x = x; 145 fingers[finger_id].position = {x, y};
144 fingers[finger_id].y = y;
145 fingers[finger_id].attribute = attribute; 146 fingers[finger_id].attribute = attribute;
146 return finger_id; 147 return finger_id;
147 } 148 }
diff --git a/src/core/hle/service/hid/controllers/touchscreen.h b/src/core/hle/service/hid/controllers/touchscreen.h
index 2869d0cfd..ef2becefd 100644
--- a/src/core/hle/service/hid/controllers/touchscreen.h
+++ b/src/core/hle/service/hid/controllers/touchscreen.h
@@ -7,6 +7,7 @@
7#include "common/bit_field.h" 7#include "common/bit_field.h"
8#include "common/common_funcs.h" 8#include "common/common_funcs.h"
9#include "common/common_types.h" 9#include "common/common_types.h"
10#include "common/point.h"
10#include "common/swap.h" 11#include "common/swap.h"
11#include "core/frontend/input.h" 12#include "core/frontend/input.h"
12#include "core/hle/service/hid/controllers/controller_base.h" 13#include "core/hle/service/hid/controllers/controller_base.h"
@@ -55,8 +56,7 @@ private:
55 u64_le delta_time; 56 u64_le delta_time;
56 Attributes attribute; 57 Attributes attribute;
57 u32_le finger; 58 u32_le finger;
58 u32_le x; 59 Common::Point<u32_le> position;
59 u32_le y;
60 u32_le diameter_x; 60 u32_le diameter_x;
61 u32_le diameter_y; 61 u32_le diameter_y;
62 u32_le rotation_angle; 62 u32_le rotation_angle;
@@ -81,8 +81,7 @@ private:
81 81
82 struct Finger { 82 struct Finger {
83 u64_le last_touch{}; 83 u64_le last_touch{};
84 float x{}; 84 Common::Point<float> position;
85 float y{};
86 u32_le id{}; 85 u32_le id{};
87 bool pressed{}; 86 bool pressed{};
88 Attributes attribute; 87 Attributes attribute;
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp
index df0fe1c8e..fa6213d3c 100644
--- a/src/core/hle/service/hid/hid.cpp
+++ b/src/core/hle/service/hid/hid.cpp
@@ -114,7 +114,7 @@ void IAppletResource::GetSharedMemoryHandle(Kernel::HLERequestContext& ctx) {
114 LOG_DEBUG(Service_HID, "called"); 114 LOG_DEBUG(Service_HID, "called");
115 115
116 IPC::ResponseBuilder rb{ctx, 2, 1}; 116 IPC::ResponseBuilder rb{ctx, 2, 1};
117 rb.Push(RESULT_SUCCESS); 117 rb.Push(ResultSuccess);
118 rb.PushCopyObjects(&system.Kernel().GetHidSharedMem()); 118 rb.PushCopyObjects(&system.Kernel().GetHidSharedMem());
119} 119}
120 120
@@ -183,7 +183,7 @@ private:
183 vibration_device_handle.device_index); 183 vibration_device_handle.device_index);
184 184
185 IPC::ResponseBuilder rb{ctx, 2}; 185 IPC::ResponseBuilder rb{ctx, 2};
186 rb.Push(RESULT_SUCCESS); 186 rb.Push(ResultSuccess);
187 } 187 }
188 188
189 std::shared_ptr<IAppletResource> applet_resource; 189 std::shared_ptr<IAppletResource> applet_resource;
@@ -351,7 +351,7 @@ void Hid::CreateAppletResource(Kernel::HLERequestContext& ctx) {
351 } 351 }
352 352
353 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 353 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
354 rb.Push(RESULT_SUCCESS); 354 rb.Push(ResultSuccess);
355 rb.PushIpcInterface<IAppletResource>(applet_resource); 355 rb.PushIpcInterface<IAppletResource>(applet_resource);
356} 356}
357 357
@@ -364,7 +364,7 @@ void Hid::ActivateDebugPad(Kernel::HLERequestContext& ctx) {
364 LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id); 364 LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id);
365 365
366 IPC::ResponseBuilder rb{ctx, 2}; 366 IPC::ResponseBuilder rb{ctx, 2};
367 rb.Push(RESULT_SUCCESS); 367 rb.Push(ResultSuccess);
368} 368}
369 369
370void Hid::ActivateTouchScreen(Kernel::HLERequestContext& ctx) { 370void Hid::ActivateTouchScreen(Kernel::HLERequestContext& ctx) {
@@ -376,7 +376,7 @@ void Hid::ActivateTouchScreen(Kernel::HLERequestContext& ctx) {
376 LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id); 376 LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id);
377 377
378 IPC::ResponseBuilder rb{ctx, 2}; 378 IPC::ResponseBuilder rb{ctx, 2};
379 rb.Push(RESULT_SUCCESS); 379 rb.Push(ResultSuccess);
380} 380}
381 381
382void Hid::ActivateMouse(Kernel::HLERequestContext& ctx) { 382void Hid::ActivateMouse(Kernel::HLERequestContext& ctx) {
@@ -388,7 +388,7 @@ void Hid::ActivateMouse(Kernel::HLERequestContext& ctx) {
388 LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id); 388 LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id);
389 389
390 IPC::ResponseBuilder rb{ctx, 2}; 390 IPC::ResponseBuilder rb{ctx, 2};
391 rb.Push(RESULT_SUCCESS); 391 rb.Push(ResultSuccess);
392} 392}
393 393
394void Hid::ActivateKeyboard(Kernel::HLERequestContext& ctx) { 394void Hid::ActivateKeyboard(Kernel::HLERequestContext& ctx) {
@@ -400,7 +400,7 @@ void Hid::ActivateKeyboard(Kernel::HLERequestContext& ctx) {
400 LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id); 400 LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id);
401 401
402 IPC::ResponseBuilder rb{ctx, 2}; 402 IPC::ResponseBuilder rb{ctx, 2};
403 rb.Push(RESULT_SUCCESS); 403 rb.Push(ResultSuccess);
404} 404}
405 405
406void Hid::SendKeyboardLockKeyEvent(Kernel::HLERequestContext& ctx) { 406void Hid::SendKeyboardLockKeyEvent(Kernel::HLERequestContext& ctx) {
@@ -410,7 +410,7 @@ void Hid::SendKeyboardLockKeyEvent(Kernel::HLERequestContext& ctx) {
410 LOG_WARNING(Service_HID, "(STUBBED) called. flags={}", flags); 410 LOG_WARNING(Service_HID, "(STUBBED) called. flags={}", flags);
411 411
412 IPC::ResponseBuilder rb{ctx, 2}; 412 IPC::ResponseBuilder rb{ctx, 2};
413 rb.Push(RESULT_SUCCESS); 413 rb.Push(ResultSuccess);
414} 414}
415 415
416void Hid::ActivateXpad(Kernel::HLERequestContext& ctx) { 416void Hid::ActivateXpad(Kernel::HLERequestContext& ctx) {
@@ -429,7 +429,7 @@ void Hid::ActivateXpad(Kernel::HLERequestContext& ctx) {
429 parameters.basic_xpad_id, parameters.applet_resource_user_id); 429 parameters.basic_xpad_id, parameters.applet_resource_user_id);
430 430
431 IPC::ResponseBuilder rb{ctx, 2}; 431 IPC::ResponseBuilder rb{ctx, 2};
432 rb.Push(RESULT_SUCCESS); 432 rb.Push(ResultSuccess);
433} 433}
434 434
435void Hid::GetXpadIDs(Kernel::HLERequestContext& ctx) { 435void Hid::GetXpadIDs(Kernel::HLERequestContext& ctx) {
@@ -439,7 +439,7 @@ void Hid::GetXpadIDs(Kernel::HLERequestContext& ctx) {
439 LOG_DEBUG(Service_HID, "(STUBBED) called, applet_resource_user_id={}", applet_resource_user_id); 439 LOG_DEBUG(Service_HID, "(STUBBED) called, applet_resource_user_id={}", applet_resource_user_id);
440 440
441 IPC::ResponseBuilder rb{ctx, 3}; 441 IPC::ResponseBuilder rb{ctx, 3};
442 rb.Push(RESULT_SUCCESS); 442 rb.Push(ResultSuccess);
443 rb.Push(0); 443 rb.Push(0);
444} 444}
445 445
@@ -461,7 +461,7 @@ void Hid::ActivateSixAxisSensor(Kernel::HLERequestContext& ctx) {
461 parameters.sixaxis_handle.device_index, parameters.applet_resource_user_id); 461 parameters.sixaxis_handle.device_index, parameters.applet_resource_user_id);
462 462
463 IPC::ResponseBuilder rb{ctx, 2}; 463 IPC::ResponseBuilder rb{ctx, 2};
464 rb.Push(RESULT_SUCCESS); 464 rb.Push(ResultSuccess);
465} 465}
466 466
467void Hid::DeactivateSixAxisSensor(Kernel::HLERequestContext& ctx) { 467void Hid::DeactivateSixAxisSensor(Kernel::HLERequestContext& ctx) {
@@ -482,7 +482,7 @@ void Hid::DeactivateSixAxisSensor(Kernel::HLERequestContext& ctx) {
482 parameters.sixaxis_handle.device_index, parameters.applet_resource_user_id); 482 parameters.sixaxis_handle.device_index, parameters.applet_resource_user_id);
483 483
484 IPC::ResponseBuilder rb{ctx, 2}; 484 IPC::ResponseBuilder rb{ctx, 2};
485 rb.Push(RESULT_SUCCESS); 485 rb.Push(ResultSuccess);
486} 486}
487 487
488void Hid::StartSixAxisSensor(Kernel::HLERequestContext& ctx) { 488void Hid::StartSixAxisSensor(Kernel::HLERequestContext& ctx) {
@@ -503,7 +503,7 @@ void Hid::StartSixAxisSensor(Kernel::HLERequestContext& ctx) {
503 parameters.sixaxis_handle.device_index, parameters.applet_resource_user_id); 503 parameters.sixaxis_handle.device_index, parameters.applet_resource_user_id);
504 504
505 IPC::ResponseBuilder rb{ctx, 2}; 505 IPC::ResponseBuilder rb{ctx, 2};
506 rb.Push(RESULT_SUCCESS); 506 rb.Push(ResultSuccess);
507} 507}
508 508
509void Hid::StopSixAxisSensor(Kernel::HLERequestContext& ctx) { 509void Hid::StopSixAxisSensor(Kernel::HLERequestContext& ctx) {
@@ -524,7 +524,7 @@ void Hid::StopSixAxisSensor(Kernel::HLERequestContext& ctx) {
524 parameters.sixaxis_handle.device_index, parameters.applet_resource_user_id); 524 parameters.sixaxis_handle.device_index, parameters.applet_resource_user_id);
525 525
526 IPC::ResponseBuilder rb{ctx, 2}; 526 IPC::ResponseBuilder rb{ctx, 2};
527 rb.Push(RESULT_SUCCESS); 527 rb.Push(ResultSuccess);
528} 528}
529 529
530void Hid::EnableSixAxisSensorFusion(Kernel::HLERequestContext& ctx) { 530void Hid::EnableSixAxisSensorFusion(Kernel::HLERequestContext& ctx) {
@@ -547,7 +547,7 @@ void Hid::EnableSixAxisSensorFusion(Kernel::HLERequestContext& ctx) {
547 parameters.applet_resource_user_id); 547 parameters.applet_resource_user_id);
548 548
549 IPC::ResponseBuilder rb{ctx, 2}; 549 IPC::ResponseBuilder rb{ctx, 2};
550 rb.Push(RESULT_SUCCESS); 550 rb.Push(ResultSuccess);
551} 551}
552 552
553void Hid::SetSixAxisSensorFusionParameters(Kernel::HLERequestContext& ctx) { 553void Hid::SetSixAxisSensorFusionParameters(Kernel::HLERequestContext& ctx) {
@@ -573,7 +573,7 @@ void Hid::SetSixAxisSensorFusionParameters(Kernel::HLERequestContext& ctx) {
573 parameters.parameter2, parameters.applet_resource_user_id); 573 parameters.parameter2, parameters.applet_resource_user_id);
574 574
575 IPC::ResponseBuilder rb{ctx, 2}; 575 IPC::ResponseBuilder rb{ctx, 2};
576 rb.Push(RESULT_SUCCESS); 576 rb.Push(ResultSuccess);
577} 577}
578 578
579void Hid::GetSixAxisSensorFusionParameters(Kernel::HLERequestContext& ctx) { 579void Hid::GetSixAxisSensorFusionParameters(Kernel::HLERequestContext& ctx) {
@@ -599,7 +599,7 @@ void Hid::GetSixAxisSensorFusionParameters(Kernel::HLERequestContext& ctx) {
599 parameters.sixaxis_handle.device_index, parameters.applet_resource_user_id); 599 parameters.sixaxis_handle.device_index, parameters.applet_resource_user_id);
600 600
601 IPC::ResponseBuilder rb{ctx, 4}; 601 IPC::ResponseBuilder rb{ctx, 4};
602 rb.Push(RESULT_SUCCESS); 602 rb.Push(ResultSuccess);
603 rb.Push(parameter1); 603 rb.Push(parameter1);
604 rb.Push(parameter2); 604 rb.Push(parameter2);
605} 605}
@@ -624,7 +624,7 @@ void Hid::ResetSixAxisSensorFusionParameters(Kernel::HLERequestContext& ctx) {
624 parameters.sixaxis_handle.device_index, parameters.applet_resource_user_id); 624 parameters.sixaxis_handle.device_index, parameters.applet_resource_user_id);
625 625
626 IPC::ResponseBuilder rb{ctx, 2}; 626 IPC::ResponseBuilder rb{ctx, 2};
627 rb.Push(RESULT_SUCCESS); 627 rb.Push(ResultSuccess);
628} 628}
629 629
630void Hid::SetGyroscopeZeroDriftMode(Kernel::HLERequestContext& ctx) { 630void Hid::SetGyroscopeZeroDriftMode(Kernel::HLERequestContext& ctx) {
@@ -643,7 +643,7 @@ void Hid::SetGyroscopeZeroDriftMode(Kernel::HLERequestContext& ctx) {
643 drift_mode, applet_resource_user_id); 643 drift_mode, applet_resource_user_id);
644 644
645 IPC::ResponseBuilder rb{ctx, 2}; 645 IPC::ResponseBuilder rb{ctx, 2};
646 rb.Push(RESULT_SUCCESS); 646 rb.Push(ResultSuccess);
647} 647}
648 648
649void Hid::GetGyroscopeZeroDriftMode(Kernel::HLERequestContext& ctx) { 649void Hid::GetGyroscopeZeroDriftMode(Kernel::HLERequestContext& ctx) {
@@ -662,7 +662,7 @@ void Hid::GetGyroscopeZeroDriftMode(Kernel::HLERequestContext& ctx) {
662 parameters.sixaxis_handle.device_index, parameters.applet_resource_user_id); 662 parameters.sixaxis_handle.device_index, parameters.applet_resource_user_id);
663 663
664 IPC::ResponseBuilder rb{ctx, 3}; 664 IPC::ResponseBuilder rb{ctx, 3};
665 rb.Push(RESULT_SUCCESS); 665 rb.Push(ResultSuccess);
666 rb.PushEnum(applet_resource->GetController<Controller_NPad>(HidController::NPad) 666 rb.PushEnum(applet_resource->GetController<Controller_NPad>(HidController::NPad)
667 .GetGyroscopeZeroDriftMode()); 667 .GetGyroscopeZeroDriftMode());
668} 668}
@@ -686,7 +686,7 @@ void Hid::ResetGyroscopeZeroDriftMode(Kernel::HLERequestContext& ctx) {
686 parameters.sixaxis_handle.device_index, parameters.applet_resource_user_id); 686 parameters.sixaxis_handle.device_index, parameters.applet_resource_user_id);
687 687
688 IPC::ResponseBuilder rb{ctx, 2}; 688 IPC::ResponseBuilder rb{ctx, 2};
689 rb.Push(RESULT_SUCCESS); 689 rb.Push(ResultSuccess);
690} 690}
691 691
692void Hid::IsSixAxisSensorAtRest(Kernel::HLERequestContext& ctx) { 692void Hid::IsSixAxisSensorAtRest(Kernel::HLERequestContext& ctx) {
@@ -705,7 +705,7 @@ void Hid::IsSixAxisSensorAtRest(Kernel::HLERequestContext& ctx) {
705 parameters.sixaxis_handle.device_index, parameters.applet_resource_user_id); 705 parameters.sixaxis_handle.device_index, parameters.applet_resource_user_id);
706 706
707 IPC::ResponseBuilder rb{ctx, 3}; 707 IPC::ResponseBuilder rb{ctx, 3};
708 rb.Push(RESULT_SUCCESS); 708 rb.Push(ResultSuccess);
709 rb.Push(applet_resource->GetController<Controller_NPad>(HidController::NPad) 709 rb.Push(applet_resource->GetController<Controller_NPad>(HidController::NPad)
710 .IsSixAxisSensorAtRest()); 710 .IsSixAxisSensorAtRest());
711} 711}
@@ -726,7 +726,7 @@ void Hid::ActivateGesture(Kernel::HLERequestContext& ctx) {
726 parameters.applet_resource_user_id); 726 parameters.applet_resource_user_id);
727 727
728 IPC::ResponseBuilder rb{ctx, 2}; 728 IPC::ResponseBuilder rb{ctx, 2};
729 rb.Push(RESULT_SUCCESS); 729 rb.Push(ResultSuccess);
730} 730}
731 731
732void Hid::SetSupportedNpadStyleSet(Kernel::HLERequestContext& ctx) { 732void Hid::SetSupportedNpadStyleSet(Kernel::HLERequestContext& ctx) {
@@ -739,7 +739,7 @@ void Hid::SetSupportedNpadStyleSet(Kernel::HLERequestContext& ctx) {
739 LOG_DEBUG(Service_HID, "called, supported_styleset={}", supported_styleset); 739 LOG_DEBUG(Service_HID, "called, supported_styleset={}", supported_styleset);
740 740
741 IPC::ResponseBuilder rb{ctx, 2}; 741 IPC::ResponseBuilder rb{ctx, 2};
742 rb.Push(RESULT_SUCCESS); 742 rb.Push(ResultSuccess);
743} 743}
744 744
745void Hid::GetSupportedNpadStyleSet(Kernel::HLERequestContext& ctx) { 745void Hid::GetSupportedNpadStyleSet(Kernel::HLERequestContext& ctx) {
@@ -749,7 +749,7 @@ void Hid::GetSupportedNpadStyleSet(Kernel::HLERequestContext& ctx) {
749 LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id); 749 LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id);
750 750
751 IPC::ResponseBuilder rb{ctx, 3}; 751 IPC::ResponseBuilder rb{ctx, 3};
752 rb.Push(RESULT_SUCCESS); 752 rb.Push(ResultSuccess);
753 rb.Push(applet_resource->GetController<Controller_NPad>(HidController::NPad) 753 rb.Push(applet_resource->GetController<Controller_NPad>(HidController::NPad)
754 .GetSupportedStyleSet() 754 .GetSupportedStyleSet()
755 .raw); 755 .raw);
@@ -765,7 +765,7 @@ void Hid::SetSupportedNpadIdType(Kernel::HLERequestContext& ctx) {
765 LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id); 765 LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id);
766 766
767 IPC::ResponseBuilder rb{ctx, 2}; 767 IPC::ResponseBuilder rb{ctx, 2};
768 rb.Push(RESULT_SUCCESS); 768 rb.Push(ResultSuccess);
769} 769}
770 770
771void Hid::ActivateNpad(Kernel::HLERequestContext& ctx) { 771void Hid::ActivateNpad(Kernel::HLERequestContext& ctx) {
@@ -777,7 +777,7 @@ void Hid::ActivateNpad(Kernel::HLERequestContext& ctx) {
777 LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id); 777 LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id);
778 778
779 IPC::ResponseBuilder rb{ctx, 2}; 779 IPC::ResponseBuilder rb{ctx, 2};
780 rb.Push(RESULT_SUCCESS); 780 rb.Push(ResultSuccess);
781} 781}
782 782
783void Hid::DeactivateNpad(Kernel::HLERequestContext& ctx) { 783void Hid::DeactivateNpad(Kernel::HLERequestContext& ctx) {
@@ -789,7 +789,7 @@ void Hid::DeactivateNpad(Kernel::HLERequestContext& ctx) {
789 LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id); 789 LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id);
790 790
791 IPC::ResponseBuilder rb{ctx, 2}; 791 IPC::ResponseBuilder rb{ctx, 2};
792 rb.Push(RESULT_SUCCESS); 792 rb.Push(ResultSuccess);
793} 793}
794 794
795void Hid::AcquireNpadStyleSetUpdateEventHandle(Kernel::HLERequestContext& ctx) { 795void Hid::AcquireNpadStyleSetUpdateEventHandle(Kernel::HLERequestContext& ctx) {
@@ -807,7 +807,7 @@ void Hid::AcquireNpadStyleSetUpdateEventHandle(Kernel::HLERequestContext& ctx) {
807 parameters.npad_id, parameters.applet_resource_user_id, parameters.unknown); 807 parameters.npad_id, parameters.applet_resource_user_id, parameters.unknown);
808 808
809 IPC::ResponseBuilder rb{ctx, 2, 1}; 809 IPC::ResponseBuilder rb{ctx, 2, 1};
810 rb.Push(RESULT_SUCCESS); 810 rb.Push(ResultSuccess);
811 rb.PushCopyObjects(applet_resource->GetController<Controller_NPad>(HidController::NPad) 811 rb.PushCopyObjects(applet_resource->GetController<Controller_NPad>(HidController::NPad)
812 .GetStyleSetChangedEvent(parameters.npad_id)); 812 .GetStyleSetChangedEvent(parameters.npad_id));
813} 813}
@@ -829,7 +829,7 @@ void Hid::DisconnectNpad(Kernel::HLERequestContext& ctx) {
829 parameters.applet_resource_user_id); 829 parameters.applet_resource_user_id);
830 830
831 IPC::ResponseBuilder rb{ctx, 2}; 831 IPC::ResponseBuilder rb{ctx, 2};
832 rb.Push(RESULT_SUCCESS); 832 rb.Push(ResultSuccess);
833} 833}
834 834
835void Hid::GetPlayerLedPattern(Kernel::HLERequestContext& ctx) { 835void Hid::GetPlayerLedPattern(Kernel::HLERequestContext& ctx) {
@@ -839,7 +839,7 @@ void Hid::GetPlayerLedPattern(Kernel::HLERequestContext& ctx) {
839 LOG_DEBUG(Service_HID, "called, npad_id={}", npad_id); 839 LOG_DEBUG(Service_HID, "called, npad_id={}", npad_id);
840 840
841 IPC::ResponseBuilder rb{ctx, 4}; 841 IPC::ResponseBuilder rb{ctx, 4};
842 rb.Push(RESULT_SUCCESS); 842 rb.Push(ResultSuccess);
843 rb.Push(applet_resource->GetController<Controller_NPad>(HidController::NPad) 843 rb.Push(applet_resource->GetController<Controller_NPad>(HidController::NPad)
844 .GetLedPattern(npad_id) 844 .GetLedPattern(npad_id)
845 .raw); 845 .raw);
@@ -862,7 +862,7 @@ void Hid::ActivateNpadWithRevision(Kernel::HLERequestContext& ctx) {
862 parameters.applet_resource_user_id); 862 parameters.applet_resource_user_id);
863 863
864 IPC::ResponseBuilder rb{ctx, 2}; 864 IPC::ResponseBuilder rb{ctx, 2};
865 rb.Push(RESULT_SUCCESS); 865 rb.Push(ResultSuccess);
866} 866}
867 867
868void Hid::SetNpadJoyHoldType(Kernel::HLERequestContext& ctx) { 868void Hid::SetNpadJoyHoldType(Kernel::HLERequestContext& ctx) {
@@ -876,7 +876,7 @@ void Hid::SetNpadJoyHoldType(Kernel::HLERequestContext& ctx) {
876 applet_resource_user_id, hold_type); 876 applet_resource_user_id, hold_type);
877 877
878 IPC::ResponseBuilder rb{ctx, 2}; 878 IPC::ResponseBuilder rb{ctx, 2};
879 rb.Push(RESULT_SUCCESS); 879 rb.Push(ResultSuccess);
880} 880}
881 881
882void Hid::GetNpadJoyHoldType(Kernel::HLERequestContext& ctx) { 882void Hid::GetNpadJoyHoldType(Kernel::HLERequestContext& ctx) {
@@ -886,7 +886,7 @@ void Hid::GetNpadJoyHoldType(Kernel::HLERequestContext& ctx) {
886 LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id); 886 LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id);
887 887
888 IPC::ResponseBuilder rb{ctx, 4}; 888 IPC::ResponseBuilder rb{ctx, 4};
889 rb.Push(RESULT_SUCCESS); 889 rb.Push(ResultSuccess);
890 rb.PushEnum(applet_resource->GetController<Controller_NPad>(HidController::NPad).GetHoldType()); 890 rb.PushEnum(applet_resource->GetController<Controller_NPad>(HidController::NPad).GetHoldType());
891} 891}
892 892
@@ -907,7 +907,7 @@ void Hid::SetNpadJoyAssignmentModeSingleByDefault(Kernel::HLERequestContext& ctx
907 parameters.npad_id, parameters.applet_resource_user_id); 907 parameters.npad_id, parameters.applet_resource_user_id);
908 908
909 IPC::ResponseBuilder rb{ctx, 2}; 909 IPC::ResponseBuilder rb{ctx, 2};
910 rb.Push(RESULT_SUCCESS); 910 rb.Push(ResultSuccess);
911} 911}
912 912
913void Hid::SetNpadJoyAssignmentModeSingle(Kernel::HLERequestContext& ctx) { 913void Hid::SetNpadJoyAssignmentModeSingle(Kernel::HLERequestContext& ctx) {
@@ -931,7 +931,7 @@ void Hid::SetNpadJoyAssignmentModeSingle(Kernel::HLERequestContext& ctx) {
931 parameters.npad_joy_device_type); 931 parameters.npad_joy_device_type);
932 932
933 IPC::ResponseBuilder rb{ctx, 2}; 933 IPC::ResponseBuilder rb{ctx, 2};
934 rb.Push(RESULT_SUCCESS); 934 rb.Push(ResultSuccess);
935} 935}
936 936
937void Hid::SetNpadJoyAssignmentModeDual(Kernel::HLERequestContext& ctx) { 937void Hid::SetNpadJoyAssignmentModeDual(Kernel::HLERequestContext& ctx) {
@@ -951,7 +951,7 @@ void Hid::SetNpadJoyAssignmentModeDual(Kernel::HLERequestContext& ctx) {
951 parameters.npad_id, parameters.applet_resource_user_id); 951 parameters.npad_id, parameters.applet_resource_user_id);
952 952
953 IPC::ResponseBuilder rb{ctx, 2}; 953 IPC::ResponseBuilder rb{ctx, 2};
954 rb.Push(RESULT_SUCCESS); 954 rb.Push(ResultSuccess);
955} 955}
956 956
957void Hid::MergeSingleJoyAsDualJoy(Kernel::HLERequestContext& ctx) { 957void Hid::MergeSingleJoyAsDualJoy(Kernel::HLERequestContext& ctx) {
@@ -967,7 +967,7 @@ void Hid::MergeSingleJoyAsDualJoy(Kernel::HLERequestContext& ctx) {
967 npad_id_1, npad_id_2, applet_resource_user_id); 967 npad_id_1, npad_id_2, applet_resource_user_id);
968 968
969 IPC::ResponseBuilder rb{ctx, 2}; 969 IPC::ResponseBuilder rb{ctx, 2};
970 rb.Push(RESULT_SUCCESS); 970 rb.Push(ResultSuccess);
971} 971}
972 972
973void Hid::StartLrAssignmentMode(Kernel::HLERequestContext& ctx) { 973void Hid::StartLrAssignmentMode(Kernel::HLERequestContext& ctx) {
@@ -979,7 +979,7 @@ void Hid::StartLrAssignmentMode(Kernel::HLERequestContext& ctx) {
979 LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id); 979 LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id);
980 980
981 IPC::ResponseBuilder rb{ctx, 2}; 981 IPC::ResponseBuilder rb{ctx, 2};
982 rb.Push(RESULT_SUCCESS); 982 rb.Push(ResultSuccess);
983} 983}
984 984
985void Hid::StopLrAssignmentMode(Kernel::HLERequestContext& ctx) { 985void Hid::StopLrAssignmentMode(Kernel::HLERequestContext& ctx) {
@@ -991,7 +991,7 @@ void Hid::StopLrAssignmentMode(Kernel::HLERequestContext& ctx) {
991 LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id); 991 LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id);
992 992
993 IPC::ResponseBuilder rb{ctx, 2}; 993 IPC::ResponseBuilder rb{ctx, 2};
994 rb.Push(RESULT_SUCCESS); 994 rb.Push(ResultSuccess);
995} 995}
996 996
997void Hid::SetNpadHandheldActivationMode(Kernel::HLERequestContext& ctx) { 997void Hid::SetNpadHandheldActivationMode(Kernel::HLERequestContext& ctx) {
@@ -1006,7 +1006,7 @@ void Hid::SetNpadHandheldActivationMode(Kernel::HLERequestContext& ctx) {
1006 applet_resource_user_id, activation_mode); 1006 applet_resource_user_id, activation_mode);
1007 1007
1008 IPC::ResponseBuilder rb{ctx, 2}; 1008 IPC::ResponseBuilder rb{ctx, 2};
1009 rb.Push(RESULT_SUCCESS); 1009 rb.Push(ResultSuccess);
1010} 1010}
1011 1011
1012void Hid::GetNpadHandheldActivationMode(Kernel::HLERequestContext& ctx) { 1012void Hid::GetNpadHandheldActivationMode(Kernel::HLERequestContext& ctx) {
@@ -1016,7 +1016,7 @@ void Hid::GetNpadHandheldActivationMode(Kernel::HLERequestContext& ctx) {
1016 LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id); 1016 LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id);
1017 1017
1018 IPC::ResponseBuilder rb{ctx, 4}; 1018 IPC::ResponseBuilder rb{ctx, 4};
1019 rb.Push(RESULT_SUCCESS); 1019 rb.Push(ResultSuccess);
1020 rb.PushEnum(applet_resource->GetController<Controller_NPad>(HidController::NPad) 1020 rb.PushEnum(applet_resource->GetController<Controller_NPad>(HidController::NPad)
1021 .GetNpadHandheldActivationMode()); 1021 .GetNpadHandheldActivationMode());
1022} 1022}
@@ -1035,7 +1035,7 @@ void Hid::SwapNpadAssignment(Kernel::HLERequestContext& ctx) {
1035 1035
1036 IPC::ResponseBuilder rb{ctx, 2}; 1036 IPC::ResponseBuilder rb{ctx, 2};
1037 if (res) { 1037 if (res) {
1038 rb.Push(RESULT_SUCCESS); 1038 rb.Push(ResultSuccess);
1039 } else { 1039 } else {
1040 LOG_ERROR(Service_HID, "Npads are not connected!"); 1040 LOG_ERROR(Service_HID, "Npads are not connected!");
1041 rb.Push(ERR_NPAD_NOT_CONNECTED); 1041 rb.Push(ERR_NPAD_NOT_CONNECTED);
@@ -1056,7 +1056,7 @@ void Hid::IsUnintendedHomeButtonInputProtectionEnabled(Kernel::HLERequestContext
1056 parameters.npad_id, parameters.applet_resource_user_id); 1056 parameters.npad_id, parameters.applet_resource_user_id);
1057 1057
1058 IPC::ResponseBuilder rb{ctx, 3}; 1058 IPC::ResponseBuilder rb{ctx, 3};
1059 rb.Push(RESULT_SUCCESS); 1059 rb.Push(ResultSuccess);
1060 rb.Push(applet_resource->GetController<Controller_NPad>(HidController::NPad) 1060 rb.Push(applet_resource->GetController<Controller_NPad>(HidController::NPad)
1061 .IsUnintendedHomeButtonInputProtectionEnabled(parameters.npad_id)); 1061 .IsUnintendedHomeButtonInputProtectionEnabled(parameters.npad_id));
1062} 1062}
@@ -1083,7 +1083,7 @@ void Hid::EnableUnintendedHomeButtonInputProtection(Kernel::HLERequestContext& c
1083 parameters.applet_resource_user_id); 1083 parameters.applet_resource_user_id);
1084 1084
1085 IPC::ResponseBuilder rb{ctx, 2}; 1085 IPC::ResponseBuilder rb{ctx, 2};
1086 rb.Push(RESULT_SUCCESS); 1086 rb.Push(ResultSuccess);
1087} 1087}
1088 1088
1089void Hid::SetNpadAnalogStickUseCenterClamp(Kernel::HLERequestContext& ctx) { 1089void Hid::SetNpadAnalogStickUseCenterClamp(Kernel::HLERequestContext& ctx) {
@@ -1104,7 +1104,7 @@ void Hid::SetNpadAnalogStickUseCenterClamp(Kernel::HLERequestContext& ctx) {
1104 parameters.analog_stick_use_center_clamp, parameters.applet_resource_user_id); 1104 parameters.analog_stick_use_center_clamp, parameters.applet_resource_user_id);
1105 1105
1106 IPC::ResponseBuilder rb{ctx, 2}; 1106 IPC::ResponseBuilder rb{ctx, 2};
1107 rb.Push(RESULT_SUCCESS); 1107 rb.Push(ResultSuccess);
1108} 1108}
1109 1109
1110void Hid::GetVibrationDeviceInfo(Kernel::HLERequestContext& ctx) { 1110void Hid::GetVibrationDeviceInfo(Kernel::HLERequestContext& ctx) {
@@ -1148,7 +1148,7 @@ void Hid::GetVibrationDeviceInfo(Kernel::HLERequestContext& ctx) {
1148 vibration_device_info.type, vibration_device_info.position); 1148 vibration_device_info.type, vibration_device_info.position);
1149 1149
1150 IPC::ResponseBuilder rb{ctx, 4}; 1150 IPC::ResponseBuilder rb{ctx, 4};
1151 rb.Push(RESULT_SUCCESS); 1151 rb.Push(ResultSuccess);
1152 rb.PushRaw(vibration_device_info); 1152 rb.PushRaw(vibration_device_info);
1153} 1153}
1154 1154
@@ -1173,7 +1173,7 @@ void Hid::SendVibrationValue(Kernel::HLERequestContext& ctx) {
1173 parameters.vibration_device_handle.device_index, parameters.applet_resource_user_id); 1173 parameters.vibration_device_handle.device_index, parameters.applet_resource_user_id);
1174 1174
1175 IPC::ResponseBuilder rb{ctx, 2}; 1175 IPC::ResponseBuilder rb{ctx, 2};
1176 rb.Push(RESULT_SUCCESS); 1176 rb.Push(ResultSuccess);
1177} 1177}
1178 1178
1179void Hid::GetActualVibrationValue(Kernel::HLERequestContext& ctx) { 1179void Hid::GetActualVibrationValue(Kernel::HLERequestContext& ctx) {
@@ -1193,7 +1193,7 @@ void Hid::GetActualVibrationValue(Kernel::HLERequestContext& ctx) {
1193 parameters.vibration_device_handle.device_index, parameters.applet_resource_user_id); 1193 parameters.vibration_device_handle.device_index, parameters.applet_resource_user_id);
1194 1194
1195 IPC::ResponseBuilder rb{ctx, 6}; 1195 IPC::ResponseBuilder rb{ctx, 6};
1196 rb.Push(RESULT_SUCCESS); 1196 rb.Push(ResultSuccess);
1197 rb.PushRaw(applet_resource->GetController<Controller_NPad>(HidController::NPad) 1197 rb.PushRaw(applet_resource->GetController<Controller_NPad>(HidController::NPad)
1198 .GetLastVibration(parameters.vibration_device_handle)); 1198 .GetLastVibration(parameters.vibration_device_handle));
1199} 1199}
@@ -1202,7 +1202,7 @@ void Hid::CreateActiveVibrationDeviceList(Kernel::HLERequestContext& ctx) {
1202 LOG_DEBUG(Service_HID, "called"); 1202 LOG_DEBUG(Service_HID, "called");
1203 1203
1204 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 1204 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
1205 rb.Push(RESULT_SUCCESS); 1205 rb.Push(ResultSuccess);
1206 rb.PushIpcInterface<IActiveVibrationDeviceList>(system, applet_resource); 1206 rb.PushIpcInterface<IActiveVibrationDeviceList>(system, applet_resource);
1207} 1207}
1208 1208
@@ -1215,14 +1215,14 @@ void Hid::PermitVibration(Kernel::HLERequestContext& ctx) {
1215 LOG_DEBUG(Service_HID, "called, can_vibrate={}", can_vibrate); 1215 LOG_DEBUG(Service_HID, "called, can_vibrate={}", can_vibrate);
1216 1216
1217 IPC::ResponseBuilder rb{ctx, 2}; 1217 IPC::ResponseBuilder rb{ctx, 2};
1218 rb.Push(RESULT_SUCCESS); 1218 rb.Push(ResultSuccess);
1219} 1219}
1220 1220
1221void Hid::IsVibrationPermitted(Kernel::HLERequestContext& ctx) { 1221void Hid::IsVibrationPermitted(Kernel::HLERequestContext& ctx) {
1222 LOG_DEBUG(Service_HID, "called"); 1222 LOG_DEBUG(Service_HID, "called");
1223 1223
1224 IPC::ResponseBuilder rb{ctx, 3}; 1224 IPC::ResponseBuilder rb{ctx, 3};
1225 rb.Push(RESULT_SUCCESS); 1225 rb.Push(ResultSuccess);
1226 rb.Push(Settings::values.vibration_enabled.GetValue()); 1226 rb.Push(Settings::values.vibration_enabled.GetValue());
1227} 1227}
1228 1228
@@ -1247,7 +1247,7 @@ void Hid::SendVibrationValues(Kernel::HLERequestContext& ctx) {
1247 LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id); 1247 LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id);
1248 1248
1249 IPC::ResponseBuilder rb{ctx, 2}; 1249 IPC::ResponseBuilder rb{ctx, 2};
1250 rb.Push(RESULT_SUCCESS); 1250 rb.Push(ResultSuccess);
1251} 1251}
1252 1252
1253void Hid::SendVibrationGcErmCommand(Kernel::HLERequestContext& ctx) { 1253void Hid::SendVibrationGcErmCommand(Kernel::HLERequestContext& ctx) {
@@ -1307,7 +1307,7 @@ void Hid::SendVibrationGcErmCommand(Kernel::HLERequestContext& ctx) {
1307 parameters.gc_erm_command); 1307 parameters.gc_erm_command);
1308 1308
1309 IPC::ResponseBuilder rb{ctx, 2}; 1309 IPC::ResponseBuilder rb{ctx, 2};
1310 rb.Push(RESULT_SUCCESS); 1310 rb.Push(ResultSuccess);
1311} 1311}
1312 1312
1313void Hid::GetActualVibrationGcErmCommand(Kernel::HLERequestContext& ctx) { 1313void Hid::GetActualVibrationGcErmCommand(Kernel::HLERequestContext& ctx) {
@@ -1348,7 +1348,7 @@ void Hid::GetActualVibrationGcErmCommand(Kernel::HLERequestContext& ctx) {
1348 parameters.vibration_device_handle.device_index, parameters.applet_resource_user_id); 1348 parameters.vibration_device_handle.device_index, parameters.applet_resource_user_id);
1349 1349
1350 IPC::ResponseBuilder rb{ctx, 4}; 1350 IPC::ResponseBuilder rb{ctx, 4};
1351 rb.Push(RESULT_SUCCESS); 1351 rb.Push(ResultSuccess);
1352 rb.PushEnum(gc_erm_command); 1352 rb.PushEnum(gc_erm_command);
1353} 1353}
1354 1354
@@ -1362,7 +1362,7 @@ void Hid::BeginPermitVibrationSession(Kernel::HLERequestContext& ctx) {
1362 LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id); 1362 LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id);
1363 1363
1364 IPC::ResponseBuilder rb{ctx, 2}; 1364 IPC::ResponseBuilder rb{ctx, 2};
1365 rb.Push(RESULT_SUCCESS); 1365 rb.Push(ResultSuccess);
1366} 1366}
1367 1367
1368void Hid::EndPermitVibrationSession(Kernel::HLERequestContext& ctx) { 1368void Hid::EndPermitVibrationSession(Kernel::HLERequestContext& ctx) {
@@ -1372,7 +1372,7 @@ void Hid::EndPermitVibrationSession(Kernel::HLERequestContext& ctx) {
1372 LOG_DEBUG(Service_HID, "called"); 1372 LOG_DEBUG(Service_HID, "called");
1373 1373
1374 IPC::ResponseBuilder rb{ctx, 2}; 1374 IPC::ResponseBuilder rb{ctx, 2};
1375 rb.Push(RESULT_SUCCESS); 1375 rb.Push(ResultSuccess);
1376} 1376}
1377 1377
1378void Hid::IsVibrationDeviceMounted(Kernel::HLERequestContext& ctx) { 1378void Hid::IsVibrationDeviceMounted(Kernel::HLERequestContext& ctx) {
@@ -1392,7 +1392,7 @@ void Hid::IsVibrationDeviceMounted(Kernel::HLERequestContext& ctx) {
1392 parameters.vibration_device_handle.device_index, parameters.applet_resource_user_id); 1392 parameters.vibration_device_handle.device_index, parameters.applet_resource_user_id);
1393 1393
1394 IPC::ResponseBuilder rb{ctx, 3}; 1394 IPC::ResponseBuilder rb{ctx, 3};
1395 rb.Push(RESULT_SUCCESS); 1395 rb.Push(ResultSuccess);
1396 rb.Push(applet_resource->GetController<Controller_NPad>(HidController::NPad) 1396 rb.Push(applet_resource->GetController<Controller_NPad>(HidController::NPad)
1397 .IsVibrationDeviceMounted(parameters.vibration_device_handle)); 1397 .IsVibrationDeviceMounted(parameters.vibration_device_handle));
1398} 1398}
@@ -1406,7 +1406,7 @@ void Hid::ActivateConsoleSixAxisSensor(Kernel::HLERequestContext& ctx) {
1406 LOG_WARNING(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id); 1406 LOG_WARNING(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id);
1407 1407
1408 IPC::ResponseBuilder rb{ctx, 2}; 1408 IPC::ResponseBuilder rb{ctx, 2};
1409 rb.Push(RESULT_SUCCESS); 1409 rb.Push(ResultSuccess);
1410} 1410}
1411 1411
1412void Hid::StartConsoleSixAxisSensor(Kernel::HLERequestContext& ctx) { 1412void Hid::StartConsoleSixAxisSensor(Kernel::HLERequestContext& ctx) {
@@ -1426,7 +1426,7 @@ void Hid::StartConsoleSixAxisSensor(Kernel::HLERequestContext& ctx) {
1426 parameters.sixaxis_handle.device_index, parameters.applet_resource_user_id); 1426 parameters.sixaxis_handle.device_index, parameters.applet_resource_user_id);
1427 1427
1428 IPC::ResponseBuilder rb{ctx, 2}; 1428 IPC::ResponseBuilder rb{ctx, 2};
1429 rb.Push(RESULT_SUCCESS); 1429 rb.Push(ResultSuccess);
1430} 1430}
1431 1431
1432void Hid::StopConsoleSixAxisSensor(Kernel::HLERequestContext& ctx) { 1432void Hid::StopConsoleSixAxisSensor(Kernel::HLERequestContext& ctx) {
@@ -1446,7 +1446,7 @@ void Hid::StopConsoleSixAxisSensor(Kernel::HLERequestContext& ctx) {
1446 parameters.sixaxis_handle.device_index, parameters.applet_resource_user_id); 1446 parameters.sixaxis_handle.device_index, parameters.applet_resource_user_id);
1447 1447
1448 IPC::ResponseBuilder rb{ctx, 2}; 1448 IPC::ResponseBuilder rb{ctx, 2};
1449 rb.Push(RESULT_SUCCESS); 1449 rb.Push(ResultSuccess);
1450} 1450}
1451 1451
1452void Hid::ActivateSevenSixAxisSensor(Kernel::HLERequestContext& ctx) { 1452void Hid::ActivateSevenSixAxisSensor(Kernel::HLERequestContext& ctx) {
@@ -1458,7 +1458,7 @@ void Hid::ActivateSevenSixAxisSensor(Kernel::HLERequestContext& ctx) {
1458 LOG_WARNING(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id); 1458 LOG_WARNING(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id);
1459 1459
1460 IPC::ResponseBuilder rb{ctx, 2}; 1460 IPC::ResponseBuilder rb{ctx, 2};
1461 rb.Push(RESULT_SUCCESS); 1461 rb.Push(ResultSuccess);
1462} 1462}
1463 1463
1464void Hid::StartSevenSixAxisSensor(Kernel::HLERequestContext& ctx) { 1464void Hid::StartSevenSixAxisSensor(Kernel::HLERequestContext& ctx) {
@@ -1469,7 +1469,7 @@ void Hid::StartSevenSixAxisSensor(Kernel::HLERequestContext& ctx) {
1469 applet_resource_user_id); 1469 applet_resource_user_id);
1470 1470
1471 IPC::ResponseBuilder rb{ctx, 2}; 1471 IPC::ResponseBuilder rb{ctx, 2};
1472 rb.Push(RESULT_SUCCESS); 1472 rb.Push(ResultSuccess);
1473} 1473}
1474 1474
1475void Hid::StopSevenSixAxisSensor(Kernel::HLERequestContext& ctx) { 1475void Hid::StopSevenSixAxisSensor(Kernel::HLERequestContext& ctx) {
@@ -1480,7 +1480,7 @@ void Hid::StopSevenSixAxisSensor(Kernel::HLERequestContext& ctx) {
1480 applet_resource_user_id); 1480 applet_resource_user_id);
1481 1481
1482 IPC::ResponseBuilder rb{ctx, 2}; 1482 IPC::ResponseBuilder rb{ctx, 2};
1483 rb.Push(RESULT_SUCCESS); 1483 rb.Push(ResultSuccess);
1484} 1484}
1485 1485
1486void Hid::InitializeSevenSixAxisSensor(Kernel::HLERequestContext& ctx) { 1486void Hid::InitializeSevenSixAxisSensor(Kernel::HLERequestContext& ctx) {
@@ -1500,7 +1500,7 @@ void Hid::InitializeSevenSixAxisSensor(Kernel::HLERequestContext& ctx) {
1500 if (t_mem_1.IsNull()) { 1500 if (t_mem_1.IsNull()) {
1501 LOG_ERROR(Service_HID, "t_mem_1 is a nullptr for handle=0x{:08X}", t_mem_1_handle); 1501 LOG_ERROR(Service_HID, "t_mem_1 is a nullptr for handle=0x{:08X}", t_mem_1_handle);
1502 IPC::ResponseBuilder rb{ctx, 2}; 1502 IPC::ResponseBuilder rb{ctx, 2};
1503 rb.Push(RESULT_UNKNOWN); 1503 rb.Push(ResultUnknown);
1504 return; 1504 return;
1505 } 1505 }
1506 1506
@@ -1510,7 +1510,7 @@ void Hid::InitializeSevenSixAxisSensor(Kernel::HLERequestContext& ctx) {
1510 if (t_mem_2.IsNull()) { 1510 if (t_mem_2.IsNull()) {
1511 LOG_ERROR(Service_HID, "t_mem_2 is a nullptr for handle=0x{:08X}", t_mem_2_handle); 1511 LOG_ERROR(Service_HID, "t_mem_2 is a nullptr for handle=0x{:08X}", t_mem_2_handle);
1512 IPC::ResponseBuilder rb{ctx, 2}; 1512 IPC::ResponseBuilder rb{ctx, 2};
1513 rb.Push(RESULT_UNKNOWN); 1513 rb.Push(ResultUnknown);
1514 return; 1514 return;
1515 } 1515 }
1516 1516
@@ -1530,7 +1530,7 @@ void Hid::InitializeSevenSixAxisSensor(Kernel::HLERequestContext& ctx) {
1530 t_mem_1_handle, t_mem_2_handle, applet_resource_user_id); 1530 t_mem_1_handle, t_mem_2_handle, applet_resource_user_id);
1531 1531
1532 IPC::ResponseBuilder rb{ctx, 2}; 1532 IPC::ResponseBuilder rb{ctx, 2};
1533 rb.Push(RESULT_SUCCESS); 1533 rb.Push(ResultSuccess);
1534} 1534}
1535 1535
1536void Hid::FinalizeSevenSixAxisSensor(Kernel::HLERequestContext& ctx) { 1536void Hid::FinalizeSevenSixAxisSensor(Kernel::HLERequestContext& ctx) {
@@ -1541,7 +1541,7 @@ void Hid::FinalizeSevenSixAxisSensor(Kernel::HLERequestContext& ctx) {
1541 applet_resource_user_id); 1541 applet_resource_user_id);
1542 1542
1543 IPC::ResponseBuilder rb{ctx, 2}; 1543 IPC::ResponseBuilder rb{ctx, 2};
1544 rb.Push(RESULT_SUCCESS); 1544 rb.Push(ResultSuccess);
1545} 1545}
1546 1546
1547void Hid::ResetSevenSixAxisSensorTimestamp(Kernel::HLERequestContext& ctx) { 1547void Hid::ResetSevenSixAxisSensorTimestamp(Kernel::HLERequestContext& ctx) {
@@ -1554,7 +1554,7 @@ void Hid::ResetSevenSixAxisSensorTimestamp(Kernel::HLERequestContext& ctx) {
1554 LOG_WARNING(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id); 1554 LOG_WARNING(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id);
1555 1555
1556 IPC::ResponseBuilder rb{ctx, 2}; 1556 IPC::ResponseBuilder rb{ctx, 2};
1557 rb.Push(RESULT_SUCCESS); 1557 rb.Push(ResultSuccess);
1558} 1558}
1559 1559
1560void Hid::SetIsPalmaAllConnectable(Kernel::HLERequestContext& ctx) { 1560void Hid::SetIsPalmaAllConnectable(Kernel::HLERequestContext& ctx) {
@@ -1567,7 +1567,7 @@ void Hid::SetIsPalmaAllConnectable(Kernel::HLERequestContext& ctx) {
1567 applet_resource_user_id, is_palma_all_connectable); 1567 applet_resource_user_id, is_palma_all_connectable);
1568 1568
1569 IPC::ResponseBuilder rb{ctx, 2}; 1569 IPC::ResponseBuilder rb{ctx, 2};
1570 rb.Push(RESULT_SUCCESS); 1570 rb.Push(ResultSuccess);
1571} 1571}
1572 1572
1573void Hid::SetPalmaBoostMode(Kernel::HLERequestContext& ctx) { 1573void Hid::SetPalmaBoostMode(Kernel::HLERequestContext& ctx) {
@@ -1577,7 +1577,7 @@ void Hid::SetPalmaBoostMode(Kernel::HLERequestContext& ctx) {
1577 LOG_WARNING(Service_HID, "(STUBBED) called, palma_boost_mode={}", palma_boost_mode); 1577 LOG_WARNING(Service_HID, "(STUBBED) called, palma_boost_mode={}", palma_boost_mode);
1578 1578
1579 IPC::ResponseBuilder rb{ctx, 2}; 1579 IPC::ResponseBuilder rb{ctx, 2};
1580 rb.Push(RESULT_SUCCESS); 1580 rb.Push(ResultSuccess);
1581} 1581}
1582 1582
1583void Hid::SetNpadCommunicationMode(Kernel::HLERequestContext& ctx) { 1583void Hid::SetNpadCommunicationMode(Kernel::HLERequestContext& ctx) {
@@ -1592,7 +1592,7 @@ void Hid::SetNpadCommunicationMode(Kernel::HLERequestContext& ctx) {
1592 applet_resource_user_id, communication_mode); 1592 applet_resource_user_id, communication_mode);
1593 1593
1594 IPC::ResponseBuilder rb{ctx, 2}; 1594 IPC::ResponseBuilder rb{ctx, 2};
1595 rb.Push(RESULT_SUCCESS); 1595 rb.Push(ResultSuccess);
1596} 1596}
1597 1597
1598void Hid::GetNpadCommunicationMode(Kernel::HLERequestContext& ctx) { 1598void Hid::GetNpadCommunicationMode(Kernel::HLERequestContext& ctx) {
@@ -1603,7 +1603,7 @@ void Hid::GetNpadCommunicationMode(Kernel::HLERequestContext& ctx) {
1603 applet_resource_user_id); 1603 applet_resource_user_id);
1604 1604
1605 IPC::ResponseBuilder rb{ctx, 4}; 1605 IPC::ResponseBuilder rb{ctx, 4};
1606 rb.Push(RESULT_SUCCESS); 1606 rb.Push(ResultSuccess);
1607 rb.PushEnum(applet_resource->GetController<Controller_NPad>(HidController::NPad) 1607 rb.PushEnum(applet_resource->GetController<Controller_NPad>(HidController::NPad)
1608 .GetNpadCommunicationMode()); 1608 .GetNpadCommunicationMode());
1609} 1609}
@@ -1956,7 +1956,7 @@ private:
1956 LOG_WARNING(Service_HID, "called"); 1956 LOG_WARNING(Service_HID, "called");
1957 1957
1958 IPC::ResponseBuilder rb{ctx, 2}; 1958 IPC::ResponseBuilder rb{ctx, 2};
1959 rb.Push(RESULT_SUCCESS); 1959 rb.Push(ResultSuccess);
1960 } 1960 }
1961}; 1961};
1962 1962
diff --git a/src/core/hle/service/hid/irs.cpp b/src/core/hle/service/hid/irs.cpp
index 3c6085990..4a92c6234 100644
--- a/src/core/hle/service/hid/irs.cpp
+++ b/src/core/hle/service/hid/irs.cpp
@@ -43,21 +43,21 @@ void IRS::ActivateIrsensor(Kernel::HLERequestContext& ctx) {
43 LOG_WARNING(Service_IRS, "(STUBBED) called"); 43 LOG_WARNING(Service_IRS, "(STUBBED) called");
44 44
45 IPC::ResponseBuilder rb{ctx, 2}; 45 IPC::ResponseBuilder rb{ctx, 2};
46 rb.Push(RESULT_SUCCESS); 46 rb.Push(ResultSuccess);
47} 47}
48 48
49void IRS::DeactivateIrsensor(Kernel::HLERequestContext& ctx) { 49void IRS::DeactivateIrsensor(Kernel::HLERequestContext& ctx) {
50 LOG_WARNING(Service_IRS, "(STUBBED) called"); 50 LOG_WARNING(Service_IRS, "(STUBBED) called");
51 51
52 IPC::ResponseBuilder rb{ctx, 2}; 52 IPC::ResponseBuilder rb{ctx, 2};
53 rb.Push(RESULT_SUCCESS); 53 rb.Push(ResultSuccess);
54} 54}
55 55
56void IRS::GetIrsensorSharedMemoryHandle(Kernel::HLERequestContext& ctx) { 56void IRS::GetIrsensorSharedMemoryHandle(Kernel::HLERequestContext& ctx) {
57 LOG_DEBUG(Service_IRS, "called"); 57 LOG_DEBUG(Service_IRS, "called");
58 58
59 IPC::ResponseBuilder rb{ctx, 2, 1}; 59 IPC::ResponseBuilder rb{ctx, 2, 1};
60 rb.Push(RESULT_SUCCESS); 60 rb.Push(ResultSuccess);
61 rb.PushCopyObjects(&system.Kernel().GetIrsSharedMem()); 61 rb.PushCopyObjects(&system.Kernel().GetIrsSharedMem());
62} 62}
63 63
@@ -65,35 +65,35 @@ void IRS::StopImageProcessor(Kernel::HLERequestContext& ctx) {
65 LOG_WARNING(Service_IRS, "(STUBBED) called"); 65 LOG_WARNING(Service_IRS, "(STUBBED) called");
66 66
67 IPC::ResponseBuilder rb{ctx, 2}; 67 IPC::ResponseBuilder rb{ctx, 2};
68 rb.Push(RESULT_SUCCESS); 68 rb.Push(ResultSuccess);
69} 69}
70 70
71void IRS::RunMomentProcessor(Kernel::HLERequestContext& ctx) { 71void IRS::RunMomentProcessor(Kernel::HLERequestContext& ctx) {
72 LOG_WARNING(Service_IRS, "(STUBBED) called"); 72 LOG_WARNING(Service_IRS, "(STUBBED) called");
73 73
74 IPC::ResponseBuilder rb{ctx, 2}; 74 IPC::ResponseBuilder rb{ctx, 2};
75 rb.Push(RESULT_SUCCESS); 75 rb.Push(ResultSuccess);
76} 76}
77 77
78void IRS::RunClusteringProcessor(Kernel::HLERequestContext& ctx) { 78void IRS::RunClusteringProcessor(Kernel::HLERequestContext& ctx) {
79 LOG_WARNING(Service_IRS, "(STUBBED) called"); 79 LOG_WARNING(Service_IRS, "(STUBBED) called");
80 80
81 IPC::ResponseBuilder rb{ctx, 2}; 81 IPC::ResponseBuilder rb{ctx, 2};
82 rb.Push(RESULT_SUCCESS); 82 rb.Push(ResultSuccess);
83} 83}
84 84
85void IRS::RunImageTransferProcessor(Kernel::HLERequestContext& ctx) { 85void IRS::RunImageTransferProcessor(Kernel::HLERequestContext& ctx) {
86 LOG_WARNING(Service_IRS, "(STUBBED) called"); 86 LOG_WARNING(Service_IRS, "(STUBBED) called");
87 87
88 IPC::ResponseBuilder rb{ctx, 2}; 88 IPC::ResponseBuilder rb{ctx, 2};
89 rb.Push(RESULT_SUCCESS); 89 rb.Push(ResultSuccess);
90} 90}
91 91
92void IRS::GetImageTransferProcessorState(Kernel::HLERequestContext& ctx) { 92void IRS::GetImageTransferProcessorState(Kernel::HLERequestContext& ctx) {
93 LOG_WARNING(Service_IRS, "(STUBBED) called"); 93 LOG_WARNING(Service_IRS, "(STUBBED) called");
94 94
95 IPC::ResponseBuilder rb{ctx, 5}; 95 IPC::ResponseBuilder rb{ctx, 5};
96 rb.Push(RESULT_SUCCESS); 96 rb.Push(ResultSuccess);
97 rb.PushRaw<u64>(system.CoreTiming().GetCPUTicks()); 97 rb.PushRaw<u64>(system.CoreTiming().GetCPUTicks());
98 rb.PushRaw<u32>(0); 98 rb.PushRaw<u32>(0);
99} 99}
@@ -102,14 +102,14 @@ void IRS::RunTeraPluginProcessor(Kernel::HLERequestContext& ctx) {
102 LOG_WARNING(Service_IRS, "(STUBBED) called"); 102 LOG_WARNING(Service_IRS, "(STUBBED) called");
103 103
104 IPC::ResponseBuilder rb{ctx, 2}; 104 IPC::ResponseBuilder rb{ctx, 2};
105 rb.Push(RESULT_SUCCESS); 105 rb.Push(ResultSuccess);
106} 106}
107 107
108void IRS::GetNpadIrCameraHandle(Kernel::HLERequestContext& ctx) { 108void IRS::GetNpadIrCameraHandle(Kernel::HLERequestContext& ctx) {
109 LOG_WARNING(Service_IRS, "(STUBBED) called"); 109 LOG_WARNING(Service_IRS, "(STUBBED) called");
110 110
111 IPC::ResponseBuilder rb{ctx, 3}; 111 IPC::ResponseBuilder rb{ctx, 3};
112 rb.Push(RESULT_SUCCESS); 112 rb.Push(ResultSuccess);
113 rb.PushRaw<u32>(device_handle); 113 rb.PushRaw<u32>(device_handle);
114} 114}
115 115
@@ -117,56 +117,56 @@ void IRS::RunPointingProcessor(Kernel::HLERequestContext& ctx) {
117 LOG_WARNING(Service_IRS, "(STUBBED) called"); 117 LOG_WARNING(Service_IRS, "(STUBBED) called");
118 118
119 IPC::ResponseBuilder rb{ctx, 2}; 119 IPC::ResponseBuilder rb{ctx, 2};
120 rb.Push(RESULT_SUCCESS); 120 rb.Push(ResultSuccess);
121} 121}
122 122
123void IRS::SuspendImageProcessor(Kernel::HLERequestContext& ctx) { 123void IRS::SuspendImageProcessor(Kernel::HLERequestContext& ctx) {
124 LOG_WARNING(Service_IRS, "(STUBBED) called"); 124 LOG_WARNING(Service_IRS, "(STUBBED) called");
125 125
126 IPC::ResponseBuilder rb{ctx, 2}; 126 IPC::ResponseBuilder rb{ctx, 2};
127 rb.Push(RESULT_SUCCESS); 127 rb.Push(ResultSuccess);
128} 128}
129 129
130void IRS::CheckFirmwareVersion(Kernel::HLERequestContext& ctx) { 130void IRS::CheckFirmwareVersion(Kernel::HLERequestContext& ctx) {
131 LOG_WARNING(Service_IRS, "(STUBBED) called"); 131 LOG_WARNING(Service_IRS, "(STUBBED) called");
132 132
133 IPC::ResponseBuilder rb{ctx, 2}; 133 IPC::ResponseBuilder rb{ctx, 2};
134 rb.Push(RESULT_SUCCESS); 134 rb.Push(ResultSuccess);
135} 135}
136 136
137void IRS::SetFunctionLevel(Kernel::HLERequestContext& ctx) { 137void IRS::SetFunctionLevel(Kernel::HLERequestContext& ctx) {
138 LOG_WARNING(Service_IRS, "(STUBBED) called"); 138 LOG_WARNING(Service_IRS, "(STUBBED) called");
139 139
140 IPC::ResponseBuilder rb{ctx, 2}; 140 IPC::ResponseBuilder rb{ctx, 2};
141 rb.Push(RESULT_SUCCESS); 141 rb.Push(ResultSuccess);
142} 142}
143 143
144void IRS::RunImageTransferExProcessor(Kernel::HLERequestContext& ctx) { 144void IRS::RunImageTransferExProcessor(Kernel::HLERequestContext& ctx) {
145 LOG_WARNING(Service_IRS, "(STUBBED) called"); 145 LOG_WARNING(Service_IRS, "(STUBBED) called");
146 146
147 IPC::ResponseBuilder rb{ctx, 2}; 147 IPC::ResponseBuilder rb{ctx, 2};
148 rb.Push(RESULT_SUCCESS); 148 rb.Push(ResultSuccess);
149} 149}
150 150
151void IRS::RunIrLedProcessor(Kernel::HLERequestContext& ctx) { 151void IRS::RunIrLedProcessor(Kernel::HLERequestContext& ctx) {
152 LOG_WARNING(Service_IRS, "(STUBBED) called"); 152 LOG_WARNING(Service_IRS, "(STUBBED) called");
153 153
154 IPC::ResponseBuilder rb{ctx, 2}; 154 IPC::ResponseBuilder rb{ctx, 2};
155 rb.Push(RESULT_SUCCESS); 155 rb.Push(ResultSuccess);
156} 156}
157 157
158void IRS::StopImageProcessorAsync(Kernel::HLERequestContext& ctx) { 158void IRS::StopImageProcessorAsync(Kernel::HLERequestContext& ctx) {
159 LOG_WARNING(Service_IRS, "(STUBBED) called"); 159 LOG_WARNING(Service_IRS, "(STUBBED) called");
160 160
161 IPC::ResponseBuilder rb{ctx, 2}; 161 IPC::ResponseBuilder rb{ctx, 2};
162 rb.Push(RESULT_SUCCESS); 162 rb.Push(ResultSuccess);
163} 163}
164 164
165void IRS::ActivateIrsensorWithFunctionLevel(Kernel::HLERequestContext& ctx) { 165void IRS::ActivateIrsensorWithFunctionLevel(Kernel::HLERequestContext& ctx) {
166 LOG_WARNING(Service_IRS, "(STUBBED) called"); 166 LOG_WARNING(Service_IRS, "(STUBBED) called");
167 167
168 IPC::ResponseBuilder rb{ctx, 2}; 168 IPC::ResponseBuilder rb{ctx, 2};
169 rb.Push(RESULT_SUCCESS); 169 rb.Push(ResultSuccess);
170} 170}
171 171
172IRS::~IRS() = default; 172IRS::~IRS() = default;
diff --git a/src/core/hle/service/lbl/lbl.cpp b/src/core/hle/service/lbl/lbl.cpp
index 3a5a2f4f5..24890c830 100644
--- a/src/core/hle/service/lbl/lbl.cpp
+++ b/src/core/hle/service/lbl/lbl.cpp
@@ -75,7 +75,7 @@ private:
75 update_instantly = true; 75 update_instantly = true;
76 76
77 IPC::ResponseBuilder rb{ctx, 2}; 77 IPC::ResponseBuilder rb{ctx, 2};
78 rb.Push(RESULT_SUCCESS); 78 rb.Push(ResultSuccess);
79 } 79 }
80 80
81 void GetCurrentBrightnessSetting(Kernel::HLERequestContext& ctx) { 81 void GetCurrentBrightnessSetting(Kernel::HLERequestContext& ctx) {
@@ -88,7 +88,7 @@ private:
88 LOG_DEBUG(Service_LBL, "called brightness={}", brightness); 88 LOG_DEBUG(Service_LBL, "called brightness={}", brightness);
89 89
90 IPC::ResponseBuilder rb{ctx, 3}; 90 IPC::ResponseBuilder rb{ctx, 3};
91 rb.Push(RESULT_SUCCESS); 91 rb.Push(ResultSuccess);
92 rb.Push(brightness); 92 rb.Push(brightness);
93 } 93 }
94 94
@@ -100,7 +100,7 @@ private:
100 backlight_enabled = true; 100 backlight_enabled = true;
101 101
102 IPC::ResponseBuilder rb{ctx, 2}; 102 IPC::ResponseBuilder rb{ctx, 2};
103 rb.Push(RESULT_SUCCESS); 103 rb.Push(ResultSuccess);
104 } 104 }
105 105
106 void SwitchBacklightOff(Kernel::HLERequestContext& ctx) { 106 void SwitchBacklightOff(Kernel::HLERequestContext& ctx) {
@@ -111,14 +111,14 @@ private:
111 backlight_enabled = false; 111 backlight_enabled = false;
112 112
113 IPC::ResponseBuilder rb{ctx, 2}; 113 IPC::ResponseBuilder rb{ctx, 2};
114 rb.Push(RESULT_SUCCESS); 114 rb.Push(ResultSuccess);
115 } 115 }
116 116
117 void GetBacklightSwitchStatus(Kernel::HLERequestContext& ctx) { 117 void GetBacklightSwitchStatus(Kernel::HLERequestContext& ctx) {
118 LOG_DEBUG(Service_LBL, "called"); 118 LOG_DEBUG(Service_LBL, "called");
119 119
120 IPC::ResponseBuilder rb{ctx, 3}; 120 IPC::ResponseBuilder rb{ctx, 3};
121 rb.Push(RESULT_SUCCESS); 121 rb.Push(ResultSuccess);
122 rb.PushEnum<BacklightSwitchStatus>(backlight_enabled ? BacklightSwitchStatus::On 122 rb.PushEnum<BacklightSwitchStatus>(backlight_enabled ? BacklightSwitchStatus::On
123 : BacklightSwitchStatus::Off); 123 : BacklightSwitchStatus::Off);
124 } 124 }
@@ -129,7 +129,7 @@ private:
129 dimming = true; 129 dimming = true;
130 130
131 IPC::ResponseBuilder rb{ctx, 2}; 131 IPC::ResponseBuilder rb{ctx, 2};
132 rb.Push(RESULT_SUCCESS); 132 rb.Push(ResultSuccess);
133 } 133 }
134 134
135 void DisableDimming(Kernel::HLERequestContext& ctx) { 135 void DisableDimming(Kernel::HLERequestContext& ctx) {
@@ -138,14 +138,14 @@ private:
138 dimming = false; 138 dimming = false;
139 139
140 IPC::ResponseBuilder rb{ctx, 2}; 140 IPC::ResponseBuilder rb{ctx, 2};
141 rb.Push(RESULT_SUCCESS); 141 rb.Push(ResultSuccess);
142 } 142 }
143 143
144 void IsDimmingEnabled(Kernel::HLERequestContext& ctx) { 144 void IsDimmingEnabled(Kernel::HLERequestContext& ctx) {
145 LOG_DEBUG(Service_LBL, "called"); 145 LOG_DEBUG(Service_LBL, "called");
146 146
147 IPC::ResponseBuilder rb{ctx, 3}; 147 IPC::ResponseBuilder rb{ctx, 3};
148 rb.Push(RESULT_SUCCESS); 148 rb.Push(ResultSuccess);
149 rb.Push(dimming); 149 rb.Push(dimming);
150 } 150 }
151 151
@@ -155,7 +155,7 @@ private:
155 update_instantly = true; 155 update_instantly = true;
156 156
157 IPC::ResponseBuilder rb{ctx, 2}; 157 IPC::ResponseBuilder rb{ctx, 2};
158 rb.Push(RESULT_SUCCESS); 158 rb.Push(ResultSuccess);
159 } 159 }
160 160
161 void DisableAutoBrightnessControl(Kernel::HLERequestContext& ctx) { 161 void DisableAutoBrightnessControl(Kernel::HLERequestContext& ctx) {
@@ -163,14 +163,14 @@ private:
163 auto_brightness = false; 163 auto_brightness = false;
164 164
165 IPC::ResponseBuilder rb{ctx, 2}; 165 IPC::ResponseBuilder rb{ctx, 2};
166 rb.Push(RESULT_SUCCESS); 166 rb.Push(ResultSuccess);
167 } 167 }
168 168
169 void IsAutoBrightnessControlEnabled(Kernel::HLERequestContext& ctx) { 169 void IsAutoBrightnessControlEnabled(Kernel::HLERequestContext& ctx) {
170 LOG_DEBUG(Service_LBL, "called"); 170 LOG_DEBUG(Service_LBL, "called");
171 171
172 IPC::ResponseBuilder rb{ctx, 3}; 172 IPC::ResponseBuilder rb{ctx, 3};
173 rb.Push(RESULT_SUCCESS); 173 rb.Push(ResultSuccess);
174 rb.Push(auto_brightness); 174 rb.Push(auto_brightness);
175 } 175 }
176 176
@@ -183,14 +183,14 @@ private:
183 ambient_light_value = light_value; 183 ambient_light_value = light_value;
184 184
185 IPC::ResponseBuilder rb{ctx, 2}; 185 IPC::ResponseBuilder rb{ctx, 2};
186 rb.Push(RESULT_SUCCESS); 186 rb.Push(ResultSuccess);
187 } 187 }
188 188
189 void GetAmbientLightSensorValue(Kernel::HLERequestContext& ctx) { 189 void GetAmbientLightSensorValue(Kernel::HLERequestContext& ctx) {
190 LOG_DEBUG(Service_LBL, "called"); 190 LOG_DEBUG(Service_LBL, "called");
191 191
192 IPC::ResponseBuilder rb{ctx, 3}; 192 IPC::ResponseBuilder rb{ctx, 3};
193 rb.Push(RESULT_SUCCESS); 193 rb.Push(ResultSuccess);
194 rb.Push(ambient_light_value); 194 rb.Push(ambient_light_value);
195 } 195 }
196 196
@@ -199,7 +199,7 @@ private:
199 LOG_DEBUG(Service_LBL, "called"); 199 LOG_DEBUG(Service_LBL, "called");
200 200
201 IPC::ResponseBuilder rb{ctx, 2}; 201 IPC::ResponseBuilder rb{ctx, 2};
202 rb.Push(RESULT_SUCCESS); 202 rb.Push(ResultSuccess);
203 } 203 }
204 204
205 void GetBrightnessReflectionDelayLevel(Kernel::HLERequestContext& ctx) { 205 void GetBrightnessReflectionDelayLevel(Kernel::HLERequestContext& ctx) {
@@ -207,7 +207,7 @@ private:
207 LOG_DEBUG(Service_LBL, "called"); 207 LOG_DEBUG(Service_LBL, "called");
208 208
209 IPC::ResponseBuilder rb{ctx, 3}; 209 IPC::ResponseBuilder rb{ctx, 3};
210 rb.Push(RESULT_SUCCESS); 210 rb.Push(ResultSuccess);
211 rb.Push(0.0f); 211 rb.Push(0.0f);
212 } 212 }
213 213
@@ -216,7 +216,7 @@ private:
216 LOG_DEBUG(Service_LBL, "called"); 216 LOG_DEBUG(Service_LBL, "called");
217 217
218 IPC::ResponseBuilder rb{ctx, 2}; 218 IPC::ResponseBuilder rb{ctx, 2};
219 rb.Push(RESULT_SUCCESS); 219 rb.Push(ResultSuccess);
220 } 220 }
221 221
222 void GetCurrentBrightnessMapping(Kernel::HLERequestContext& ctx) { 222 void GetCurrentBrightnessMapping(Kernel::HLERequestContext& ctx) {
@@ -224,7 +224,7 @@ private:
224 LOG_DEBUG(Service_LBL, "called"); 224 LOG_DEBUG(Service_LBL, "called");
225 225
226 IPC::ResponseBuilder rb{ctx, 2}; 226 IPC::ResponseBuilder rb{ctx, 2};
227 rb.Push(RESULT_SUCCESS); 227 rb.Push(ResultSuccess);
228 // This function is suppose to return something but it seems like it doesn't 228 // This function is suppose to return something but it seems like it doesn't
229 } 229 }
230 230
@@ -233,7 +233,7 @@ private:
233 LOG_DEBUG(Service_LBL, "called"); 233 LOG_DEBUG(Service_LBL, "called");
234 234
235 IPC::ResponseBuilder rb{ctx, 2}; 235 IPC::ResponseBuilder rb{ctx, 2};
236 rb.Push(RESULT_SUCCESS); 236 rb.Push(ResultSuccess);
237 } 237 }
238 238
239 void GetCurrentAmbientLightSensorMapping(Kernel::HLERequestContext& ctx) { 239 void GetCurrentAmbientLightSensorMapping(Kernel::HLERequestContext& ctx) {
@@ -241,14 +241,14 @@ private:
241 LOG_DEBUG(Service_LBL, "called"); 241 LOG_DEBUG(Service_LBL, "called");
242 242
243 IPC::ResponseBuilder rb{ctx, 2}; 243 IPC::ResponseBuilder rb{ctx, 2};
244 rb.Push(RESULT_SUCCESS); 244 rb.Push(ResultSuccess);
245 // This function is suppose to return something but it seems like it doesn't 245 // This function is suppose to return something but it seems like it doesn't
246 } 246 }
247 247
248 void IsAmbientLightSensorAvailable(Kernel::HLERequestContext& ctx) { 248 void IsAmbientLightSensorAvailable(Kernel::HLERequestContext& ctx) {
249 LOG_WARNING(Service_LBL, "(STUBBED) called"); 249 LOG_WARNING(Service_LBL, "(STUBBED) called");
250 IPC::ResponseBuilder rb{ctx, 3}; 250 IPC::ResponseBuilder rb{ctx, 3};
251 rb.Push(RESULT_SUCCESS); 251 rb.Push(ResultSuccess);
252 // TODO(ogniK): Only return true if there's no device error 252 // TODO(ogniK): Only return true if there's no device error
253 rb.Push(true); 253 rb.Push(true);
254 } 254 }
@@ -267,7 +267,7 @@ private:
267 current_vr_brightness = brightness; 267 current_vr_brightness = brightness;
268 268
269 IPC::ResponseBuilder rb{ctx, 2}; 269 IPC::ResponseBuilder rb{ctx, 2};
270 rb.Push(RESULT_SUCCESS); 270 rb.Push(ResultSuccess);
271 } 271 }
272 272
273 void GetCurrentBrightnessSettingForVrMode(Kernel::HLERequestContext& ctx) { 273 void GetCurrentBrightnessSettingForVrMode(Kernel::HLERequestContext& ctx) {
@@ -280,7 +280,7 @@ private:
280 LOG_DEBUG(Service_LBL, "called brightness={}", brightness); 280 LOG_DEBUG(Service_LBL, "called brightness={}", brightness);
281 281
282 IPC::ResponseBuilder rb{ctx, 3}; 282 IPC::ResponseBuilder rb{ctx, 3};
283 rb.Push(RESULT_SUCCESS); 283 rb.Push(ResultSuccess);
284 rb.Push(brightness); 284 rb.Push(brightness);
285 } 285 }
286 286
@@ -288,7 +288,7 @@ private:
288 LOG_DEBUG(Service_LBL, "called"); 288 LOG_DEBUG(Service_LBL, "called");
289 289
290 IPC::ResponseBuilder rb{ctx, 2}; 290 IPC::ResponseBuilder rb{ctx, 2};
291 rb.Push(RESULT_SUCCESS); 291 rb.Push(ResultSuccess);
292 292
293 vr_mode_enabled = true; 293 vr_mode_enabled = true;
294 } 294 }
@@ -297,7 +297,7 @@ private:
297 LOG_DEBUG(Service_LBL, "called"); 297 LOG_DEBUG(Service_LBL, "called");
298 298
299 IPC::ResponseBuilder rb{ctx, 2}; 299 IPC::ResponseBuilder rb{ctx, 2};
300 rb.Push(RESULT_SUCCESS); 300 rb.Push(ResultSuccess);
301 301
302 vr_mode_enabled = false; 302 vr_mode_enabled = false;
303 } 303 }
@@ -306,7 +306,7 @@ private:
306 LOG_DEBUG(Service_LBL, "called"); 306 LOG_DEBUG(Service_LBL, "called");
307 307
308 IPC::ResponseBuilder rb{ctx, 3}; 308 IPC::ResponseBuilder rb{ctx, 3};
309 rb.Push(RESULT_SUCCESS); 309 rb.Push(ResultSuccess);
310 rb.Push(vr_mode_enabled); 310 rb.Push(vr_mode_enabled);
311 } 311 }
312 312
diff --git a/src/core/hle/service/ldn/ldn.cpp b/src/core/hle/service/ldn/ldn.cpp
index d160ffe87..6ccbe9623 100644
--- a/src/core/hle/service/ldn/ldn.cpp
+++ b/src/core/hle/service/ldn/ldn.cpp
@@ -48,7 +48,7 @@ public:
48 LOG_DEBUG(Service_LDN, "called"); 48 LOG_DEBUG(Service_LDN, "called");
49 49
50 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 50 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
51 rb.Push(RESULT_SUCCESS); 51 rb.Push(ResultSuccess);
52 rb.PushIpcInterface<IMonitorService>(system); 52 rb.PushIpcInterface<IMonitorService>(system);
53 } 53 }
54}; 54};
@@ -147,7 +147,7 @@ public:
147 // Indicate a network error, as we do not actually emulate LDN 147 // Indicate a network error, as we do not actually emulate LDN
148 rb.Push(static_cast<u32>(State::Error)); 148 rb.Push(static_cast<u32>(State::Error));
149 149
150 rb.Push(RESULT_SUCCESS); 150 rb.Push(ResultSuccess);
151 } 151 }
152 152
153 void Initialize2(Kernel::HLERequestContext& ctx) { 153 void Initialize2(Kernel::HLERequestContext& ctx) {
@@ -189,7 +189,7 @@ public:
189 LOG_DEBUG(Service_LDN, "called"); 189 LOG_DEBUG(Service_LDN, "called");
190 190
191 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 191 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
192 rb.Push(RESULT_SUCCESS); 192 rb.Push(ResultSuccess);
193 rb.PushIpcInterface<ISystemLocalCommunicationService>(system); 193 rb.PushIpcInterface<ISystemLocalCommunicationService>(system);
194 } 194 }
195}; 195};
@@ -210,15 +210,156 @@ public:
210 LOG_DEBUG(Service_LDN, "called"); 210 LOG_DEBUG(Service_LDN, "called");
211 211
212 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 212 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
213 rb.Push(RESULT_SUCCESS); 213 rb.Push(ResultSuccess);
214 rb.PushIpcInterface<IUserLocalCommunicationService>(system); 214 rb.PushIpcInterface<IUserLocalCommunicationService>(system);
215 } 215 }
216}; 216};
217 217
218class INetworkService final : public ServiceFramework<INetworkService> {
219public:
220 explicit INetworkService(Core::System& system_) : ServiceFramework{system_, "INetworkService"} {
221 // clang-format off
222 static const FunctionInfo functions[] = {
223 {0, nullptr, "Initialize"},
224 {256, nullptr, "AttachNetworkInterfaceStateChangeEvent"},
225 {264, nullptr, "GetNetworkInterfaceLastError"},
226 {272, nullptr, "GetRole"},
227 {280, nullptr, "GetAdvertiseData"},
228 {288, nullptr, "GetGroupInfo"},
229 {296, nullptr, "GetGroupInfo2"},
230 {304, nullptr, "GetGroupOwner"},
231 {312, nullptr, "GetIpConfig"},
232 {320, nullptr, "GetLinkLevel"},
233 {512, nullptr, "Scan"},
234 {768, nullptr, "CreateGroup"},
235 {776, nullptr, "DestroyGroup"},
236 {784, nullptr, "SetAdvertiseData"},
237 {1536, nullptr, "SendToOtherGroup"},
238 {1544, nullptr, "RecvFromOtherGroup"},
239 {1552, nullptr, "AddAcceptableGroupId"},
240 {1560, nullptr, "ClearAcceptableGroupId"},
241 };
242 // clang-format on
243
244 RegisterHandlers(functions);
245 }
246};
247
248class INetworkServiceMonitor final : public ServiceFramework<INetworkServiceMonitor> {
249public:
250 explicit INetworkServiceMonitor(Core::System& system_)
251 : ServiceFramework{system_, "INetworkServiceMonitor"} {
252 // clang-format off
253 static const FunctionInfo functions[] = {
254 {0, &INetworkServiceMonitor::Initialize, "Initialize"},
255 {256, nullptr, "AttachNetworkInterfaceStateChangeEvent"},
256 {264, nullptr, "GetNetworkInterfaceLastError"},
257 {272, nullptr, "GetRole"},
258 {280, nullptr, "GetAdvertiseData"},
259 {281, nullptr, "GetAdvertiseData2"},
260 {288, nullptr, "GetGroupInfo"},
261 {296, nullptr, "GetGroupInfo2"},
262 {304, nullptr, "GetGroupOwner"},
263 {312, nullptr, "GetIpConfig"},
264 {320, nullptr, "GetLinkLevel"},
265 {328, nullptr, "AttachJoinEvent"},
266 {336, nullptr, "GetMembers"},
267 };
268 // clang-format on
269
270 RegisterHandlers(functions);
271 }
272
273 void Initialize(Kernel::HLERequestContext& ctx) {
274 LOG_WARNING(Service_LDN, "(STUBBED) called");
275
276 IPC::ResponseBuilder rb{ctx, 2};
277 rb.Push(ERROR_DISABLED);
278 }
279};
280
281class LP2PAPP final : public ServiceFramework<LP2PAPP> {
282public:
283 explicit LP2PAPP(Core::System& system_) : ServiceFramework{system_, "lp2p:app"} {
284 // clang-format off
285 static const FunctionInfo functions[] = {
286 {0, &LP2PAPP::CreateMonitorService, "CreateNetworkService"},
287 {8, &LP2PAPP::CreateMonitorService, "CreateNetworkServiceMonitor"},
288 };
289 // clang-format on
290
291 RegisterHandlers(functions);
292 }
293
294 void CreateNetworkervice(Kernel::HLERequestContext& ctx) {
295 IPC::RequestParser rp{ctx};
296 const u64 reserved_input = rp.Pop<u64>();
297 const u32 input = rp.Pop<u32>();
298
299 LOG_WARNING(Service_LDN, "(STUBBED) called reserved_input={} input={}", reserved_input,
300 input);
301
302 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
303 rb.Push(ResultSuccess);
304 rb.PushIpcInterface<INetworkService>(system);
305 }
306
307 void CreateMonitorService(Kernel::HLERequestContext& ctx) {
308 IPC::RequestParser rp{ctx};
309 const u64 reserved_input = rp.Pop<u64>();
310
311 LOG_WARNING(Service_LDN, "(STUBBED) called reserved_input={}", reserved_input);
312
313 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
314 rb.Push(ResultSuccess);
315 rb.PushIpcInterface<INetworkServiceMonitor>(system);
316 }
317};
318
319class LP2PSYS final : public ServiceFramework<LP2PSYS> {
320public:
321 explicit LP2PSYS(Core::System& system_) : ServiceFramework{system_, "lp2p:sys"} {
322 // clang-format off
323 static const FunctionInfo functions[] = {
324 {0, &LP2PSYS::CreateMonitorService, "CreateNetworkService"},
325 {8, &LP2PSYS::CreateMonitorService, "CreateNetworkServiceMonitor"},
326 };
327 // clang-format on
328
329 RegisterHandlers(functions);
330 }
331
332 void CreateNetworkervice(Kernel::HLERequestContext& ctx) {
333 IPC::RequestParser rp{ctx};
334 const u64 reserved_input = rp.Pop<u64>();
335 const u32 input = rp.Pop<u32>();
336
337 LOG_WARNING(Service_LDN, "(STUBBED) called reserved_input={} input={}", reserved_input,
338 input);
339
340 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
341 rb.Push(ResultSuccess);
342 rb.PushIpcInterface<INetworkService>(system);
343 }
344
345 void CreateMonitorService(Kernel::HLERequestContext& ctx) {
346 IPC::RequestParser rp{ctx};
347 const u64 reserved_input = rp.Pop<u64>();
348
349 LOG_WARNING(Service_LDN, "(STUBBED) called reserved_input={}", reserved_input);
350
351 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
352 rb.Push(ResultSuccess);
353 rb.PushIpcInterface<INetworkServiceMonitor>(system);
354 }
355};
356
218void InstallInterfaces(SM::ServiceManager& sm, Core::System& system) { 357void InstallInterfaces(SM::ServiceManager& sm, Core::System& system) {
219 std::make_shared<LDNM>(system)->InstallAsService(sm); 358 std::make_shared<LDNM>(system)->InstallAsService(sm);
220 std::make_shared<LDNS>(system)->InstallAsService(sm); 359 std::make_shared<LDNS>(system)->InstallAsService(sm);
221 std::make_shared<LDNU>(system)->InstallAsService(sm); 360 std::make_shared<LDNU>(system)->InstallAsService(sm);
361 std::make_shared<LP2PAPP>(system)->InstallAsService(sm);
362 std::make_shared<LP2PSYS>(system)->InstallAsService(sm);
222} 363}
223 364
224} // namespace Service::LDN 365} // namespace Service::LDN
diff --git a/src/core/hle/service/ldr/ldr.cpp b/src/core/hle/service/ldr/ldr.cpp
index c3948eb8e..24b7e4435 100644
--- a/src/core/hle/service/ldr/ldr.cpp
+++ b/src/core/hle/service/ldr/ldr.cpp
@@ -270,7 +270,7 @@ public:
270 nrr.insert_or_assign(nrr_address, std::move(hashes)); 270 nrr.insert_or_assign(nrr_address, std::move(hashes));
271 271
272 IPC::ResponseBuilder rb{ctx, 2}; 272 IPC::ResponseBuilder rb{ctx, 2};
273 rb.Push(RESULT_SUCCESS); 273 rb.Push(ResultSuccess);
274 } 274 }
275 275
276 void UnregisterModuleInfo(Kernel::HLERequestContext& ctx) { 276 void UnregisterModuleInfo(Kernel::HLERequestContext& ctx) {
@@ -284,7 +284,7 @@ public:
284 284
285 IPC::ResponseBuilder rb{ctx, 2}; 285 IPC::ResponseBuilder rb{ctx, 2};
286 286
287 rb.Push(RESULT_SUCCESS); 287 rb.Push(ResultSuccess);
288 } 288 }
289 289
290 bool ValidateRegionForMap(Kernel::KPageTable& page_table, VAddr start, std::size_t size) const { 290 bool ValidateRegionForMap(Kernel::KPageTable& page_table, VAddr start, std::size_t size) const {
@@ -524,7 +524,7 @@ public:
524 header.segment_headers[DATA_INDEX].memory_size, nro_address}); 524 header.segment_headers[DATA_INDEX].memory_size, nro_address});
525 525
526 IPC::ResponseBuilder rb{ctx, 4}; 526 IPC::ResponseBuilder rb{ctx, 4};
527 rb.Push(RESULT_SUCCESS); 527 rb.Push(ResultSuccess);
528 rb.Push(*map_result); 528 rb.Push(*map_result);
529 } 529 }
530 530
@@ -541,7 +541,7 @@ public:
541 info.nro_address + info.text_size, info.src_addr + info.text_size, info.ro_size)); 541 info.nro_address + info.text_size, info.src_addr + info.text_size, info.ro_size));
542 CASCADE_CODE( 542 CASCADE_CODE(
543 page_table.UnmapProcessCodeMemory(info.nro_address, info.src_addr, info.text_size)); 543 page_table.UnmapProcessCodeMemory(info.nro_address, info.src_addr, info.text_size));
544 return RESULT_SUCCESS; 544 return ResultSuccess;
545 } 545 }
546 546
547 void UnloadModule(Kernel::HLERequestContext& ctx) { 547 void UnloadModule(Kernel::HLERequestContext& ctx) {
@@ -596,7 +596,7 @@ public:
596 initialized = true; 596 initialized = true;
597 597
598 IPC::ResponseBuilder rb{ctx, 2}; 598 IPC::ResponseBuilder rb{ctx, 2};
599 rb.Push(RESULT_SUCCESS); 599 rb.Push(ResultSuccess);
600 } 600 }
601 601
602private: 602private:
diff --git a/src/core/hle/service/lm/lm.cpp b/src/core/hle/service/lm/lm.cpp
index 9bcf8870d..311e4fb2d 100644
--- a/src/core/hle/service/lm/lm.cpp
+++ b/src/core/hle/service/lm/lm.cpp
@@ -84,7 +84,7 @@ private:
84 84
85 // This function only succeeds - Get that out of the way 85 // This function only succeeds - Get that out of the way
86 IPC::ResponseBuilder rb{ctx, 2}; 86 IPC::ResponseBuilder rb{ctx, 2};
87 rb.Push(RESULT_SUCCESS); 87 rb.Push(ResultSuccess);
88 88
89 if (data.size() < sizeof(LogPacketHeader)) { 89 if (data.size() < sizeof(LogPacketHeader)) {
90 LOG_ERROR(Service_LM, "Data size is too small for header! size={}", data.size()); 90 LOG_ERROR(Service_LM, "Data size is too small for header! size={}", data.size());
@@ -141,7 +141,7 @@ private:
141 destination = log_destination; 141 destination = log_destination;
142 142
143 IPC::ResponseBuilder rb{ctx, 2}; 143 IPC::ResponseBuilder rb{ctx, 2};
144 rb.Push(RESULT_SUCCESS); 144 rb.Push(ResultSuccess);
145 } 145 }
146 146
147 u64 ReadLeb128(const std::vector<u8>& data, std::size_t& offset) { 147 u64 ReadLeb128(const std::vector<u8>& data, std::size_t& offset) {
@@ -357,7 +357,7 @@ private:
357 LOG_DEBUG(Service_LM, "called"); 357 LOG_DEBUG(Service_LM, "called");
358 358
359 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 359 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
360 rb.Push(RESULT_SUCCESS); 360 rb.Push(ResultSuccess);
361 rb.PushIpcInterface<ILogger>(system); 361 rb.PushIpcInterface<ILogger>(system);
362 } 362 }
363}; 363};
diff --git a/src/core/hle/service/mii/mii.cpp b/src/core/hle/service/mii/mii.cpp
index 81f150a88..bbd81a88a 100644
--- a/src/core/hle/service/mii/mii.cpp
+++ b/src/core/hle/service/mii/mii.cpp
@@ -74,7 +74,7 @@ private:
74 LOG_DEBUG(Service_Mii, "called with source_flag={}", source_flag); 74 LOG_DEBUG(Service_Mii, "called with source_flag={}", source_flag);
75 75
76 IPC::ResponseBuilder rb{ctx, 3}; 76 IPC::ResponseBuilder rb{ctx, 3};
77 rb.Push(RESULT_SUCCESS); 77 rb.Push(ResultSuccess);
78 rb.Push(manager.CheckAndResetUpdateCounter(source_flag, current_update_counter)); 78 rb.Push(manager.CheckAndResetUpdateCounter(source_flag, current_update_counter));
79 } 79 }
80 80
@@ -82,7 +82,7 @@ private:
82 LOG_DEBUG(Service_Mii, "called"); 82 LOG_DEBUG(Service_Mii, "called");
83 83
84 IPC::ResponseBuilder rb{ctx, 3}; 84 IPC::ResponseBuilder rb{ctx, 3};
85 rb.Push(RESULT_SUCCESS); 85 rb.Push(ResultSuccess);
86 rb.Push(manager.IsFullDatabase()); 86 rb.Push(manager.IsFullDatabase());
87 } 87 }
88 88
@@ -93,7 +93,7 @@ private:
93 LOG_DEBUG(Service_Mii, "called with source_flag={}", source_flag); 93 LOG_DEBUG(Service_Mii, "called with source_flag={}", source_flag);
94 94
95 IPC::ResponseBuilder rb{ctx, 3}; 95 IPC::ResponseBuilder rb{ctx, 3};
96 rb.Push(RESULT_SUCCESS); 96 rb.Push(ResultSuccess);
97 rb.Push<u32>(manager.GetCount(source_flag)); 97 rb.Push<u32>(manager.GetCount(source_flag));
98 } 98 }
99 99
@@ -115,7 +115,7 @@ private:
115 } 115 }
116 116
117 IPC::ResponseBuilder rb{ctx, 3}; 117 IPC::ResponseBuilder rb{ctx, 3};
118 rb.Push(RESULT_SUCCESS); 118 rb.Push(ResultSuccess);
119 rb.Push<u32>(static_cast<u32>(result->size())); 119 rb.Push<u32>(static_cast<u32>(result->size()));
120 } 120 }
121 121
@@ -140,7 +140,7 @@ private:
140 ctx.WriteBuffer(SerializeArray(values)); 140 ctx.WriteBuffer(SerializeArray(values));
141 141
142 IPC::ResponseBuilder rb{ctx, 3}; 142 IPC::ResponseBuilder rb{ctx, 3};
143 rb.Push(RESULT_SUCCESS); 143 rb.Push(ResultSuccess);
144 rb.Push<u32>(static_cast<u32>(result->size())); 144 rb.Push<u32>(static_cast<u32>(result->size()));
145 } 145 }
146 146
@@ -159,7 +159,7 @@ private:
159 } 159 }
160 160
161 IPC::ResponseBuilder rb{ctx, 2 + sizeof(MiiInfo) / sizeof(u32)}; 161 IPC::ResponseBuilder rb{ctx, 2 + sizeof(MiiInfo) / sizeof(u32)};
162 rb.Push(RESULT_SUCCESS); 162 rb.Push(ResultSuccess);
163 rb.PushRaw<MiiInfo>(*result); 163 rb.PushRaw<MiiInfo>(*result);
164 } 164 }
165 165
@@ -194,7 +194,7 @@ private:
194 } 194 }
195 195
196 IPC::ResponseBuilder rb{ctx, 2 + sizeof(MiiInfo) / sizeof(u32)}; 196 IPC::ResponseBuilder rb{ctx, 2 + sizeof(MiiInfo) / sizeof(u32)};
197 rb.Push(RESULT_SUCCESS); 197 rb.Push(ResultSuccess);
198 rb.PushRaw<MiiInfo>(manager.BuildRandom(age, gender, race)); 198 rb.PushRaw<MiiInfo>(manager.BuildRandom(age, gender, race));
199 } 199 }
200 200
@@ -213,7 +213,7 @@ private:
213 } 213 }
214 214
215 IPC::ResponseBuilder rb{ctx, 2 + sizeof(MiiInfo) / sizeof(u32)}; 215 IPC::ResponseBuilder rb{ctx, 2 + sizeof(MiiInfo) / sizeof(u32)};
216 rb.Push(RESULT_SUCCESS); 216 rb.Push(ResultSuccess);
217 rb.PushRaw<MiiInfo>(manager.BuildDefault(index)); 217 rb.PushRaw<MiiInfo>(manager.BuildDefault(index));
218 } 218 }
219 219
@@ -238,7 +238,7 @@ private:
238 UNIMPLEMENTED_IF(current_interface_version != 1); 238 UNIMPLEMENTED_IF(current_interface_version != 1);
239 239
240 IPC::ResponseBuilder rb{ctx, 2}; 240 IPC::ResponseBuilder rb{ctx, 2};
241 rb.Push(RESULT_SUCCESS); 241 rb.Push(ResultSuccess);
242 } 242 }
243 243
244 constexpr bool IsInterfaceVersionSupported(u32 interface_version) const { 244 constexpr bool IsInterfaceVersionSupported(u32 interface_version) const {
@@ -267,7 +267,7 @@ public:
267private: 267private:
268 void GetDatabaseService(Kernel::HLERequestContext& ctx) { 268 void GetDatabaseService(Kernel::HLERequestContext& ctx) {
269 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 269 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
270 rb.Push(RESULT_SUCCESS); 270 rb.Push(ResultSuccess);
271 rb.PushIpcInterface<IDatabaseService>(system); 271 rb.PushIpcInterface<IDatabaseService>(system);
272 272
273 LOG_DEBUG(Service_Mii, "called"); 273 LOG_DEBUG(Service_Mii, "called");
diff --git a/src/core/hle/service/mm/mm_u.cpp b/src/core/hle/service/mm/mm_u.cpp
index c8519e2db..0ccfe91cd 100644
--- a/src/core/hle/service/mm/mm_u.cpp
+++ b/src/core/hle/service/mm/mm_u.cpp
@@ -33,14 +33,14 @@ private:
33 LOG_WARNING(Service_MM, "(STUBBED) called"); 33 LOG_WARNING(Service_MM, "(STUBBED) called");
34 34
35 IPC::ResponseBuilder rb{ctx, 2}; 35 IPC::ResponseBuilder rb{ctx, 2};
36 rb.Push(RESULT_SUCCESS); 36 rb.Push(ResultSuccess);
37 } 37 }
38 38
39 void FinalizeOld(Kernel::HLERequestContext& ctx) { 39 void FinalizeOld(Kernel::HLERequestContext& ctx) {
40 LOG_WARNING(Service_MM, "(STUBBED) called"); 40 LOG_WARNING(Service_MM, "(STUBBED) called");
41 41
42 IPC::ResponseBuilder rb{ctx, 2}; 42 IPC::ResponseBuilder rb{ctx, 2};
43 rb.Push(RESULT_SUCCESS); 43 rb.Push(ResultSuccess);
44 } 44 }
45 45
46 void SetAndWaitOld(Kernel::HLERequestContext& ctx) { 46 void SetAndWaitOld(Kernel::HLERequestContext& ctx) {
@@ -51,14 +51,14 @@ private:
51 51
52 current = min; 52 current = min;
53 IPC::ResponseBuilder rb{ctx, 2}; 53 IPC::ResponseBuilder rb{ctx, 2};
54 rb.Push(RESULT_SUCCESS); 54 rb.Push(ResultSuccess);
55 } 55 }
56 56
57 void GetOld(Kernel::HLERequestContext& ctx) { 57 void GetOld(Kernel::HLERequestContext& ctx) {
58 LOG_WARNING(Service_MM, "(STUBBED) called"); 58 LOG_WARNING(Service_MM, "(STUBBED) called");
59 59
60 IPC::ResponseBuilder rb{ctx, 3}; 60 IPC::ResponseBuilder rb{ctx, 3};
61 rb.Push(RESULT_SUCCESS); 61 rb.Push(ResultSuccess);
62 rb.Push(current); 62 rb.Push(current);
63 } 63 }
64 64
@@ -66,7 +66,7 @@ private:
66 LOG_WARNING(Service_MM, "(STUBBED) called"); 66 LOG_WARNING(Service_MM, "(STUBBED) called");
67 67
68 IPC::ResponseBuilder rb{ctx, 3}; 68 IPC::ResponseBuilder rb{ctx, 3};
69 rb.Push(RESULT_SUCCESS); 69 rb.Push(ResultSuccess);
70 rb.Push<u32>(id); // Any non zero value 70 rb.Push<u32>(id); // Any non zero value
71 } 71 }
72 72
@@ -74,7 +74,7 @@ private:
74 LOG_WARNING(Service_MM, "(STUBBED) called"); 74 LOG_WARNING(Service_MM, "(STUBBED) called");
75 75
76 IPC::ResponseBuilder rb{ctx, 2}; 76 IPC::ResponseBuilder rb{ctx, 2};
77 rb.Push(RESULT_SUCCESS); 77 rb.Push(ResultSuccess);
78 } 78 }
79 79
80 void SetAndWait(Kernel::HLERequestContext& ctx) { 80 void SetAndWait(Kernel::HLERequestContext& ctx) {
@@ -87,14 +87,14 @@ private:
87 87
88 current = min; 88 current = min;
89 IPC::ResponseBuilder rb{ctx, 2}; 89 IPC::ResponseBuilder rb{ctx, 2};
90 rb.Push(RESULT_SUCCESS); 90 rb.Push(ResultSuccess);
91 } 91 }
92 92
93 void Get(Kernel::HLERequestContext& ctx) { 93 void Get(Kernel::HLERequestContext& ctx) {
94 LOG_WARNING(Service_MM, "(STUBBED) called"); 94 LOG_WARNING(Service_MM, "(STUBBED) called");
95 95
96 IPC::ResponseBuilder rb{ctx, 3}; 96 IPC::ResponseBuilder rb{ctx, 3};
97 rb.Push(RESULT_SUCCESS); 97 rb.Push(ResultSuccess);
98 rb.Push(current); 98 rb.Push(current);
99 } 99 }
100 100
diff --git a/src/core/hle/service/nfc/nfc.cpp b/src/core/hle/service/nfc/nfc.cpp
index 44a5d5789..b014ea826 100644
--- a/src/core/hle/service/nfc/nfc.cpp
+++ b/src/core/hle/service/nfc/nfc.cpp
@@ -46,7 +46,7 @@ private:
46 LOG_DEBUG(Service_NFC, "called"); 46 LOG_DEBUG(Service_NFC, "called");
47 47
48 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 48 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
49 rb.Push(RESULT_SUCCESS); 49 rb.Push(ResultSuccess);
50 rb.PushIpcInterface<IAm>(system); 50 rb.PushIpcInterface<IAm>(system);
51 } 51 }
52}; 52};
@@ -94,7 +94,7 @@ private:
94 LOG_DEBUG(Service_NFC, "called"); 94 LOG_DEBUG(Service_NFC, "called");
95 95
96 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 96 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
97 rb.Push(RESULT_SUCCESS); 97 rb.Push(ResultSuccess);
98 rb.PushIpcInterface<MFIUser>(system); 98 rb.PushIpcInterface<MFIUser>(system);
99 } 99 }
100}; 100};
@@ -141,7 +141,7 @@ private:
141 LOG_DEBUG(Service_NFC, "called"); 141 LOG_DEBUG(Service_NFC, "called");
142 142
143 IPC::ResponseBuilder rb{ctx, 2, 0}; 143 IPC::ResponseBuilder rb{ctx, 2, 0};
144 rb.Push(RESULT_SUCCESS); 144 rb.Push(ResultSuccess);
145 // We don't deal with hardware initialization so we can just stub this. 145 // We don't deal with hardware initialization so we can just stub this.
146 } 146 }
147 147
@@ -149,7 +149,7 @@ private:
149 LOG_DEBUG(Service_NFC, "IsNfcEnabledOld"); 149 LOG_DEBUG(Service_NFC, "IsNfcEnabledOld");
150 150
151 IPC::ResponseBuilder rb{ctx, 3}; 151 IPC::ResponseBuilder rb{ctx, 3};
152 rb.Push(RESULT_SUCCESS); 152 rb.Push(ResultSuccess);
153 rb.PushRaw<u8>(true); 153 rb.PushRaw<u8>(true);
154 } 154 }
155 155
@@ -157,7 +157,7 @@ private:
157 LOG_WARNING(Service_NFC, "(STUBBED) called"); 157 LOG_WARNING(Service_NFC, "(STUBBED) called");
158 158
159 IPC::ResponseBuilder rb{ctx, 3}; 159 IPC::ResponseBuilder rb{ctx, 3};
160 rb.Push(RESULT_SUCCESS); 160 rb.Push(ResultSuccess);
161 rb.PushEnum(NfcStates::Finalized); // TODO(ogniK): Figure out if this matches nfp 161 rb.PushEnum(NfcStates::Finalized); // TODO(ogniK): Figure out if this matches nfp
162 } 162 }
163 163
@@ -165,7 +165,7 @@ private:
165 LOG_WARNING(Service_NFC, "(STUBBED) called"); 165 LOG_WARNING(Service_NFC, "(STUBBED) called");
166 166
167 IPC::ResponseBuilder rb{ctx, 2}; 167 IPC::ResponseBuilder rb{ctx, 2};
168 rb.Push(RESULT_SUCCESS); 168 rb.Push(ResultSuccess);
169 } 169 }
170}; 170};
171 171
@@ -186,7 +186,7 @@ private:
186 LOG_DEBUG(Service_NFC, "called"); 186 LOG_DEBUG(Service_NFC, "called");
187 187
188 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 188 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
189 rb.Push(RESULT_SUCCESS); 189 rb.Push(ResultSuccess);
190 rb.PushIpcInterface<IUser>(system); 190 rb.PushIpcInterface<IUser>(system);
191 } 191 }
192}; 192};
@@ -245,7 +245,7 @@ private:
245 LOG_DEBUG(Service_NFC, "called"); 245 LOG_DEBUG(Service_NFC, "called");
246 246
247 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 247 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
248 rb.Push(RESULT_SUCCESS); 248 rb.Push(ResultSuccess);
249 rb.PushIpcInterface<ISystem>(system); 249 rb.PushIpcInterface<ISystem>(system);
250 } 250 }
251}; 251};
diff --git a/src/core/hle/service/nfp/nfp.cpp b/src/core/hle/service/nfp/nfp.cpp
index d25b20ab5..5f1ca029d 100644
--- a/src/core/hle/service/nfp/nfp.cpp
+++ b/src/core/hle/service/nfp/nfp.cpp
@@ -113,7 +113,7 @@ private:
113 LOG_DEBUG(Service_NFC, "called"); 113 LOG_DEBUG(Service_NFC, "called");
114 114
115 IPC::ResponseBuilder rb{ctx, 2, 0}; 115 IPC::ResponseBuilder rb{ctx, 2, 0};
116 rb.Push(RESULT_SUCCESS); 116 rb.Push(ResultSuccess);
117 117
118 state = State::Initialized; 118 state = State::Initialized;
119 } 119 }
@@ -122,7 +122,7 @@ private:
122 LOG_DEBUG(Service_NFC, "called"); 122 LOG_DEBUG(Service_NFC, "called");
123 123
124 IPC::ResponseBuilder rb{ctx, 3, 0}; 124 IPC::ResponseBuilder rb{ctx, 3, 0};
125 rb.Push(RESULT_SUCCESS); 125 rb.Push(ResultSuccess);
126 rb.PushRaw<u32>(static_cast<u32>(state)); 126 rb.PushRaw<u32>(static_cast<u32>(state));
127 } 127 }
128 128
@@ -134,7 +134,7 @@ private:
134 ctx.WriteBuffer(device_handle); 134 ctx.WriteBuffer(device_handle);
135 135
136 IPC::ResponseBuilder rb{ctx, 3}; 136 IPC::ResponseBuilder rb{ctx, 3};
137 rb.Push(RESULT_SUCCESS); 137 rb.Push(ResultSuccess);
138 rb.Push<u32>(1); 138 rb.Push<u32>(1);
139 } 139 }
140 140
@@ -144,7 +144,7 @@ private:
144 LOG_DEBUG(Service_NFP, "called, dev_handle=0x{:X}", dev_handle); 144 LOG_DEBUG(Service_NFP, "called, dev_handle=0x{:X}", dev_handle);
145 145
146 IPC::ResponseBuilder rb{ctx, 3}; 146 IPC::ResponseBuilder rb{ctx, 3};
147 rb.Push(RESULT_SUCCESS); 147 rb.Push(ResultSuccess);
148 rb.Push<u32>(npad_id); 148 rb.Push<u32>(npad_id);
149 } 149 }
150 150
@@ -154,7 +154,7 @@ private:
154 LOG_DEBUG(Service_NFP, "called, dev_handle=0x{:X}", dev_handle); 154 LOG_DEBUG(Service_NFP, "called, dev_handle=0x{:X}", dev_handle);
155 155
156 IPC::ResponseBuilder rb{ctx, 2, 1}; 156 IPC::ResponseBuilder rb{ctx, 2, 1};
157 rb.Push(RESULT_SUCCESS); 157 rb.Push(ResultSuccess);
158 rb.PushCopyObjects(nfp_interface.GetNFCEvent()); 158 rb.PushCopyObjects(nfp_interface.GetNFCEvent());
159 has_attached_handle = true; 159 has_attached_handle = true;
160 } 160 }
@@ -165,7 +165,7 @@ private:
165 LOG_DEBUG(Service_NFP, "called, dev_handle=0x{:X}", dev_handle); 165 LOG_DEBUG(Service_NFP, "called, dev_handle=0x{:X}", dev_handle);
166 166
167 IPC::ResponseBuilder rb{ctx, 2, 1}; 167 IPC::ResponseBuilder rb{ctx, 2, 1};
168 rb.Push(RESULT_SUCCESS); 168 rb.Push(ResultSuccess);
169 rb.PushCopyObjects(deactivate_event.GetReadableEvent()); 169 rb.PushCopyObjects(deactivate_event.GetReadableEvent());
170 } 170 }
171 171
@@ -186,14 +186,14 @@ private:
186 break; 186 break;
187 } 187 }
188 IPC::ResponseBuilder rb{ctx, 2}; 188 IPC::ResponseBuilder rb{ctx, 2};
189 rb.Push(RESULT_SUCCESS); 189 rb.Push(ResultSuccess);
190 } 190 }
191 191
192 void GetDeviceState(Kernel::HLERequestContext& ctx) { 192 void GetDeviceState(Kernel::HLERequestContext& ctx) {
193 LOG_DEBUG(Service_NFP, "called"); 193 LOG_DEBUG(Service_NFP, "called");
194 194
195 IPC::ResponseBuilder rb{ctx, 3}; 195 IPC::ResponseBuilder rb{ctx, 3};
196 rb.Push(RESULT_SUCCESS); 196 rb.Push(ResultSuccess);
197 rb.Push<u32>(static_cast<u32>(device_state)); 197 rb.Push<u32>(static_cast<u32>(device_state));
198 } 198 }
199 199
@@ -204,7 +204,7 @@ private:
204 device_state = DeviceState::SearchingForTag; 204 device_state = DeviceState::SearchingForTag;
205 } 205 }
206 IPC::ResponseBuilder rb{ctx, 2}; 206 IPC::ResponseBuilder rb{ctx, 2};
207 rb.Push(RESULT_SUCCESS); 207 rb.Push(ResultSuccess);
208 } 208 }
209 209
210 void GetTagInfo(Kernel::HLERequestContext& ctx) { 210 void GetTagInfo(Kernel::HLERequestContext& ctx) {
@@ -221,7 +221,7 @@ private:
221 .padding_2 = {}, 221 .padding_2 = {},
222 }; 222 };
223 ctx.WriteBuffer(tag_info); 223 ctx.WriteBuffer(tag_info);
224 rb.Push(RESULT_SUCCESS); 224 rb.Push(ResultSuccess);
225 } 225 }
226 226
227 void Mount(Kernel::HLERequestContext& ctx) { 227 void Mount(Kernel::HLERequestContext& ctx) {
@@ -229,7 +229,7 @@ private:
229 229
230 device_state = DeviceState::TagNearby; 230 device_state = DeviceState::TagNearby;
231 IPC::ResponseBuilder rb{ctx, 2}; 231 IPC::ResponseBuilder rb{ctx, 2};
232 rb.Push(RESULT_SUCCESS); 232 rb.Push(ResultSuccess);
233 } 233 }
234 234
235 void GetModelInfo(Kernel::HLERequestContext& ctx) { 235 void GetModelInfo(Kernel::HLERequestContext& ctx) {
@@ -238,7 +238,7 @@ private:
238 IPC::ResponseBuilder rb{ctx, 2}; 238 IPC::ResponseBuilder rb{ctx, 2};
239 const auto& amiibo = nfp_interface.GetAmiiboBuffer(); 239 const auto& amiibo = nfp_interface.GetAmiiboBuffer();
240 ctx.WriteBuffer(amiibo.model_info); 240 ctx.WriteBuffer(amiibo.model_info);
241 rb.Push(RESULT_SUCCESS); 241 rb.Push(ResultSuccess);
242 } 242 }
243 243
244 void Unmount(Kernel::HLERequestContext& ctx) { 244 void Unmount(Kernel::HLERequestContext& ctx) {
@@ -247,7 +247,7 @@ private:
247 device_state = DeviceState::TagFound; 247 device_state = DeviceState::TagFound;
248 248
249 IPC::ResponseBuilder rb{ctx, 2}; 249 IPC::ResponseBuilder rb{ctx, 2};
250 rb.Push(RESULT_SUCCESS); 250 rb.Push(ResultSuccess);
251 } 251 }
252 252
253 void Finalize(Kernel::HLERequestContext& ctx) { 253 void Finalize(Kernel::HLERequestContext& ctx) {
@@ -256,14 +256,14 @@ private:
256 device_state = DeviceState::Finalized; 256 device_state = DeviceState::Finalized;
257 257
258 IPC::ResponseBuilder rb{ctx, 2}; 258 IPC::ResponseBuilder rb{ctx, 2};
259 rb.Push(RESULT_SUCCESS); 259 rb.Push(ResultSuccess);
260 } 260 }
261 261
262 void AttachAvailabilityChangeEvent(Kernel::HLERequestContext& ctx) { 262 void AttachAvailabilityChangeEvent(Kernel::HLERequestContext& ctx) {
263 LOG_WARNING(Service_NFP, "(STUBBED) called"); 263 LOG_WARNING(Service_NFP, "(STUBBED) called");
264 264
265 IPC::ResponseBuilder rb{ctx, 2, 1}; 265 IPC::ResponseBuilder rb{ctx, 2, 1};
266 rb.Push(RESULT_SUCCESS); 266 rb.Push(ResultSuccess);
267 rb.PushCopyObjects(availability_change_event.GetReadableEvent()); 267 rb.PushCopyObjects(availability_change_event.GetReadableEvent());
268 } 268 }
269 269
@@ -273,7 +273,7 @@ private:
273 // TODO(ogniK): Pull Mii and owner data from amiibo 273 // TODO(ogniK): Pull Mii and owner data from amiibo
274 274
275 IPC::ResponseBuilder rb{ctx, 2}; 275 IPC::ResponseBuilder rb{ctx, 2};
276 rb.Push(RESULT_SUCCESS); 276 rb.Push(ResultSuccess);
277 } 277 }
278 278
279 void GetCommonInfo(Kernel::HLERequestContext& ctx) { 279 void GetCommonInfo(Kernel::HLERequestContext& ctx) {
@@ -286,7 +286,7 @@ private:
286 ctx.WriteBuffer(common_info); 286 ctx.WriteBuffer(common_info);
287 287
288 IPC::ResponseBuilder rb{ctx, 2}; 288 IPC::ResponseBuilder rb{ctx, 2};
289 rb.Push(RESULT_SUCCESS); 289 rb.Push(ResultSuccess);
290 } 290 }
291 291
292 void OpenApplicationArea(Kernel::HLERequestContext& ctx) { 292 void OpenApplicationArea(Kernel::HLERequestContext& ctx) {
@@ -299,7 +299,7 @@ private:
299 LOG_WARNING(Service_NFP, "(STUBBED) called"); 299 LOG_WARNING(Service_NFP, "(STUBBED) called");
300 // We don't need to worry about this since we can just open the file 300 // We don't need to worry about this since we can just open the file
301 IPC::ResponseBuilder rb{ctx, 3}; 301 IPC::ResponseBuilder rb{ctx, 3};
302 rb.Push(RESULT_SUCCESS); 302 rb.Push(ResultSuccess);
303 rb.PushRaw<u32>(0); // This is from the GetCommonInfo stub 303 rb.PushRaw<u32>(0); // This is from the GetCommonInfo stub
304 } 304 }
305 305
@@ -309,7 +309,7 @@ private:
309 // TODO(ogniK): Pull application area from amiibo 309 // TODO(ogniK): Pull application area from amiibo
310 310
311 IPC::ResponseBuilder rb{ctx, 3}; 311 IPC::ResponseBuilder rb{ctx, 3};
312 rb.Push(RESULT_SUCCESS); 312 rb.Push(ResultSuccess);
313 rb.PushRaw<u32>(0); // This is from the GetCommonInfo stub 313 rb.PushRaw<u32>(0); // This is from the GetCommonInfo stub
314 } 314 }
315 315
@@ -327,7 +327,7 @@ void Module::Interface::CreateUserInterface(Kernel::HLERequestContext& ctx) {
327 LOG_DEBUG(Service_NFP, "called"); 327 LOG_DEBUG(Service_NFP, "called");
328 328
329 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 329 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
330 rb.Push(RESULT_SUCCESS); 330 rb.Push(ResultSuccess);
331 rb.PushIpcInterface<IUser>(*this, system); 331 rb.PushIpcInterface<IUser>(*this, system);
332} 332}
333 333
diff --git a/src/core/hle/service/nifm/nifm.cpp b/src/core/hle/service/nifm/nifm.cpp
index 76e3832df..f03b2666a 100644
--- a/src/core/hle/service/nifm/nifm.cpp
+++ b/src/core/hle/service/nifm/nifm.cpp
@@ -170,14 +170,14 @@ private:
170 LOG_WARNING(Service_NIFM, "(STUBBED) called"); 170 LOG_WARNING(Service_NIFM, "(STUBBED) called");
171 171
172 IPC::ResponseBuilder rb{ctx, 2}; 172 IPC::ResponseBuilder rb{ctx, 2};
173 rb.Push(RESULT_SUCCESS); 173 rb.Push(ResultSuccess);
174 } 174 }
175 175
176 void GetRequestState(Kernel::HLERequestContext& ctx) { 176 void GetRequestState(Kernel::HLERequestContext& ctx) {
177 LOG_WARNING(Service_NIFM, "(STUBBED) called"); 177 LOG_WARNING(Service_NIFM, "(STUBBED) called");
178 178
179 IPC::ResponseBuilder rb{ctx, 3}; 179 IPC::ResponseBuilder rb{ctx, 3};
180 rb.Push(RESULT_SUCCESS); 180 rb.Push(ResultSuccess);
181 181
182 if (Settings::values.bcat_backend == "none") { 182 if (Settings::values.bcat_backend == "none") {
183 rb.PushEnum(RequestState::NotSubmitted); 183 rb.PushEnum(RequestState::NotSubmitted);
@@ -190,14 +190,14 @@ private:
190 LOG_WARNING(Service_NIFM, "(STUBBED) called"); 190 LOG_WARNING(Service_NIFM, "(STUBBED) called");
191 191
192 IPC::ResponseBuilder rb{ctx, 2}; 192 IPC::ResponseBuilder rb{ctx, 2};
193 rb.Push(RESULT_SUCCESS); 193 rb.Push(ResultSuccess);
194 } 194 }
195 195
196 void GetSystemEventReadableHandles(Kernel::HLERequestContext& ctx) { 196 void GetSystemEventReadableHandles(Kernel::HLERequestContext& ctx) {
197 LOG_WARNING(Service_NIFM, "(STUBBED) called"); 197 LOG_WARNING(Service_NIFM, "(STUBBED) called");
198 198
199 IPC::ResponseBuilder rb{ctx, 2, 2}; 199 IPC::ResponseBuilder rb{ctx, 2, 2};
200 rb.Push(RESULT_SUCCESS); 200 rb.Push(ResultSuccess);
201 rb.PushCopyObjects(event1.GetReadableEvent(), event2.GetReadableEvent()); 201 rb.PushCopyObjects(event1.GetReadableEvent(), event2.GetReadableEvent());
202 } 202 }
203 203
@@ -205,14 +205,14 @@ private:
205 LOG_WARNING(Service_NIFM, "(STUBBED) called"); 205 LOG_WARNING(Service_NIFM, "(STUBBED) called");
206 206
207 IPC::ResponseBuilder rb{ctx, 2}; 207 IPC::ResponseBuilder rb{ctx, 2};
208 rb.Push(RESULT_SUCCESS); 208 rb.Push(ResultSuccess);
209 } 209 }
210 210
211 void SetConnectionConfirmationOption(Kernel::HLERequestContext& ctx) { 211 void SetConnectionConfirmationOption(Kernel::HLERequestContext& ctx) {
212 LOG_WARNING(Service_NIFM, "(STUBBED) called"); 212 LOG_WARNING(Service_NIFM, "(STUBBED) called");
213 213
214 IPC::ResponseBuilder rb{ctx, 2}; 214 IPC::ResponseBuilder rb{ctx, 2};
215 rb.Push(RESULT_SUCCESS); 215 rb.Push(ResultSuccess);
216 } 216 }
217 217
218 void GetAppletInfo(Kernel::HLERequestContext& ctx) { 218 void GetAppletInfo(Kernel::HLERequestContext& ctx) {
@@ -223,7 +223,7 @@ private:
223 ctx.WriteBuffer(out_buffer); 223 ctx.WriteBuffer(out_buffer);
224 224
225 IPC::ResponseBuilder rb{ctx, 5}; 225 IPC::ResponseBuilder rb{ctx, 5};
226 rb.Push(RESULT_SUCCESS); 226 rb.Push(ResultSuccess);
227 rb.Push<u32>(0); 227 rb.Push<u32>(0);
228 rb.Push<u32>(0); 228 rb.Push<u32>(0);
229 rb.Push<u32>(0); 229 rb.Push<u32>(0);
@@ -254,7 +254,7 @@ private:
254 LOG_WARNING(Service_NIFM, "(STUBBED) called"); 254 LOG_WARNING(Service_NIFM, "(STUBBED) called");
255 255
256 IPC::ResponseBuilder rb{ctx, 4}; 256 IPC::ResponseBuilder rb{ctx, 4};
257 rb.Push(RESULT_SUCCESS); 257 rb.Push(ResultSuccess);
258 rb.Push<u64>(client_id); // Client ID needs to be non zero otherwise it's considered invalid 258 rb.Push<u64>(client_id); // Client ID needs to be non zero otherwise it's considered invalid
259 } 259 }
260 void CreateScanRequest(Kernel::HLERequestContext& ctx) { 260 void CreateScanRequest(Kernel::HLERequestContext& ctx) {
@@ -262,7 +262,7 @@ private:
262 262
263 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 263 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
264 264
265 rb.Push(RESULT_SUCCESS); 265 rb.Push(ResultSuccess);
266 rb.PushIpcInterface<IScanRequest>(system); 266 rb.PushIpcInterface<IScanRequest>(system);
267 } 267 }
268 void CreateRequest(Kernel::HLERequestContext& ctx) { 268 void CreateRequest(Kernel::HLERequestContext& ctx) {
@@ -270,7 +270,7 @@ private:
270 270
271 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 271 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
272 272
273 rb.Push(RESULT_SUCCESS); 273 rb.Push(ResultSuccess);
274 rb.PushIpcInterface<IRequest>(system); 274 rb.PushIpcInterface<IRequest>(system);
275 } 275 }
276 void GetCurrentNetworkProfile(Kernel::HLERequestContext& ctx) { 276 void GetCurrentNetworkProfile(Kernel::HLERequestContext& ctx) {
@@ -311,13 +311,13 @@ private:
311 ctx.WriteBuffer(network_profile_data); 311 ctx.WriteBuffer(network_profile_data);
312 312
313 IPC::ResponseBuilder rb{ctx, 2}; 313 IPC::ResponseBuilder rb{ctx, 2};
314 rb.Push(RESULT_SUCCESS); 314 rb.Push(ResultSuccess);
315 } 315 }
316 void RemoveNetworkProfile(Kernel::HLERequestContext& ctx) { 316 void RemoveNetworkProfile(Kernel::HLERequestContext& ctx) {
317 LOG_WARNING(Service_NIFM, "(STUBBED) called"); 317 LOG_WARNING(Service_NIFM, "(STUBBED) called");
318 318
319 IPC::ResponseBuilder rb{ctx, 2}; 319 IPC::ResponseBuilder rb{ctx, 2};
320 rb.Push(RESULT_SUCCESS); 320 rb.Push(ResultSuccess);
321 } 321 }
322 void GetCurrentIpAddress(Kernel::HLERequestContext& ctx) { 322 void GetCurrentIpAddress(Kernel::HLERequestContext& ctx) {
323 LOG_WARNING(Service_NIFM, "(STUBBED) called"); 323 LOG_WARNING(Service_NIFM, "(STUBBED) called");
@@ -326,7 +326,7 @@ private:
326 UNIMPLEMENTED_IF(error != Network::Errno::SUCCESS); 326 UNIMPLEMENTED_IF(error != Network::Errno::SUCCESS);
327 327
328 IPC::ResponseBuilder rb{ctx, 3}; 328 IPC::ResponseBuilder rb{ctx, 3};
329 rb.Push(RESULT_SUCCESS); 329 rb.Push(ResultSuccess);
330 rb.PushRaw(ipv4); 330 rb.PushRaw(ipv4);
331 } 331 }
332 void CreateTemporaryNetworkProfile(Kernel::HLERequestContext& ctx) { 332 void CreateTemporaryNetworkProfile(Kernel::HLERequestContext& ctx) {
@@ -340,7 +340,7 @@ private:
340 340
341 IPC::ResponseBuilder rb{ctx, 6, 0, 1}; 341 IPC::ResponseBuilder rb{ctx, 6, 0, 1};
342 342
343 rb.Push(RESULT_SUCCESS); 343 rb.Push(ResultSuccess);
344 rb.PushIpcInterface<INetworkProfile>(system); 344 rb.PushIpcInterface<INetworkProfile>(system);
345 rb.PushRaw<u128>(uuid); 345 rb.PushRaw<u128>(uuid);
346 } 346 }
@@ -369,21 +369,21 @@ private:
369 }; 369 };
370 370
371 IPC::ResponseBuilder rb{ctx, 2 + (sizeof(IpConfigInfo) + 3) / sizeof(u32)}; 371 IPC::ResponseBuilder rb{ctx, 2 + (sizeof(IpConfigInfo) + 3) / sizeof(u32)};
372 rb.Push(RESULT_SUCCESS); 372 rb.Push(ResultSuccess);
373 rb.PushRaw<IpConfigInfo>(ip_config_info); 373 rb.PushRaw<IpConfigInfo>(ip_config_info);
374 } 374 }
375 void IsWirelessCommunicationEnabled(Kernel::HLERequestContext& ctx) { 375 void IsWirelessCommunicationEnabled(Kernel::HLERequestContext& ctx) {
376 LOG_WARNING(Service_NIFM, "(STUBBED) called"); 376 LOG_WARNING(Service_NIFM, "(STUBBED) called");
377 377
378 IPC::ResponseBuilder rb{ctx, 3}; 378 IPC::ResponseBuilder rb{ctx, 3};
379 rb.Push(RESULT_SUCCESS); 379 rb.Push(ResultSuccess);
380 rb.Push<u8>(0); 380 rb.Push<u8>(0);
381 } 381 }
382 void IsEthernetCommunicationEnabled(Kernel::HLERequestContext& ctx) { 382 void IsEthernetCommunicationEnabled(Kernel::HLERequestContext& ctx) {
383 LOG_WARNING(Service_NIFM, "(STUBBED) called"); 383 LOG_WARNING(Service_NIFM, "(STUBBED) called");
384 384
385 IPC::ResponseBuilder rb{ctx, 3}; 385 IPC::ResponseBuilder rb{ctx, 3};
386 rb.Push(RESULT_SUCCESS); 386 rb.Push(ResultSuccess);
387 if (Settings::values.bcat_backend == "none") { 387 if (Settings::values.bcat_backend == "none") {
388 rb.Push<u8>(0); 388 rb.Push<u8>(0);
389 } else { 389 } else {
@@ -394,7 +394,7 @@ private:
394 LOG_WARNING(Service_NIFM, "(STUBBED) called"); 394 LOG_WARNING(Service_NIFM, "(STUBBED) called");
395 395
396 IPC::ResponseBuilder rb{ctx, 3}; 396 IPC::ResponseBuilder rb{ctx, 3};
397 rb.Push(RESULT_SUCCESS); 397 rb.Push(ResultSuccess);
398 if (Settings::values.bcat_backend == "none") { 398 if (Settings::values.bcat_backend == "none") {
399 rb.Push<u8>(0); 399 rb.Push<u8>(0);
400 } else { 400 } else {
@@ -471,7 +471,7 @@ private:
471 LOG_DEBUG(Service_NIFM, "called"); 471 LOG_DEBUG(Service_NIFM, "called");
472 472
473 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 473 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
474 rb.Push(RESULT_SUCCESS); 474 rb.Push(ResultSuccess);
475 rb.PushIpcInterface<IGeneralService>(system); 475 rb.PushIpcInterface<IGeneralService>(system);
476 } 476 }
477 477
@@ -479,7 +479,7 @@ private:
479 LOG_DEBUG(Service_NIFM, "called"); 479 LOG_DEBUG(Service_NIFM, "called");
480 480
481 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 481 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
482 rb.Push(RESULT_SUCCESS); 482 rb.Push(ResultSuccess);
483 rb.PushIpcInterface<IGeneralService>(system); 483 rb.PushIpcInterface<IGeneralService>(system);
484 } 484 }
485}; 485};
diff --git a/src/core/hle/service/nim/nim.cpp b/src/core/hle/service/nim/nim.cpp
index 420a5a075..7447cc38f 100644
--- a/src/core/hle/service/nim/nim.cpp
+++ b/src/core/hle/service/nim/nim.cpp
@@ -52,7 +52,7 @@ private:
52 void CreateAsyncInterface(Kernel::HLERequestContext& ctx) { 52 void CreateAsyncInterface(Kernel::HLERequestContext& ctx) {
53 LOG_WARNING(Service_NIM, "(STUBBED) called"); 53 LOG_WARNING(Service_NIM, "(STUBBED) called");
54 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 54 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
55 rb.Push(RESULT_SUCCESS); 55 rb.Push(ResultSuccess);
56 rb.PushIpcInterface<IShopServiceAsync>(system); 56 rb.PushIpcInterface<IShopServiceAsync>(system);
57 } 57 }
58}; 58};
@@ -74,7 +74,7 @@ private:
74 void CreateAccessorInterface(Kernel::HLERequestContext& ctx) { 74 void CreateAccessorInterface(Kernel::HLERequestContext& ctx) {
75 LOG_WARNING(Service_NIM, "(STUBBED) called"); 75 LOG_WARNING(Service_NIM, "(STUBBED) called");
76 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 76 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
77 rb.Push(RESULT_SUCCESS); 77 rb.Push(ResultSuccess);
78 rb.PushIpcInterface<IShopServiceAccessor>(system); 78 rb.PushIpcInterface<IShopServiceAccessor>(system);
79 } 79 }
80}; 80};
@@ -240,7 +240,7 @@ private:
240 void CreateServerInterface(Kernel::HLERequestContext& ctx) { 240 void CreateServerInterface(Kernel::HLERequestContext& ctx) {
241 LOG_WARNING(Service_NIM, "(STUBBED) called"); 241 LOG_WARNING(Service_NIM, "(STUBBED) called");
242 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 242 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
243 rb.Push(RESULT_SUCCESS); 243 rb.Push(ResultSuccess);
244 rb.PushIpcInterface<IShopServiceAccessServer>(system); 244 rb.PushIpcInterface<IShopServiceAccessServer>(system);
245 } 245 }
246 246
@@ -252,7 +252,7 @@ private:
252 LOG_INFO(Service_NIM, "(STUBBED) called, unknown={}", unknown); 252 LOG_INFO(Service_NIM, "(STUBBED) called, unknown={}", unknown);
253 253
254 IPC::ResponseBuilder rb{ctx, 3}; 254 IPC::ResponseBuilder rb{ctx, 3};
255 rb.Push(RESULT_SUCCESS); 255 rb.Push(ResultSuccess);
256 rb.Push(false); 256 rb.Push(false);
257 } 257 }
258}; 258};
@@ -325,14 +325,14 @@ private:
325 LOG_DEBUG(Service_NIM, "called"); 325 LOG_DEBUG(Service_NIM, "called");
326 finished_event.GetWritableEvent().Signal(); 326 finished_event.GetWritableEvent().Signal();
327 IPC::ResponseBuilder rb{ctx, 2}; 327 IPC::ResponseBuilder rb{ctx, 2};
328 rb.Push(RESULT_SUCCESS); 328 rb.Push(ResultSuccess);
329 } 329 }
330 330
331 void GetFinishNotificationEvent(Kernel::HLERequestContext& ctx) { 331 void GetFinishNotificationEvent(Kernel::HLERequestContext& ctx) {
332 LOG_DEBUG(Service_NIM, "called"); 332 LOG_DEBUG(Service_NIM, "called");
333 333
334 IPC::ResponseBuilder rb{ctx, 2, 1}; 334 IPC::ResponseBuilder rb{ctx, 2, 1};
335 rb.Push(RESULT_SUCCESS); 335 rb.Push(ResultSuccess);
336 rb.PushCopyObjects(finished_event.GetReadableEvent()); 336 rb.PushCopyObjects(finished_event.GetReadableEvent());
337 } 337 }
338 338
@@ -340,21 +340,21 @@ private:
340 LOG_DEBUG(Service_NIM, "called"); 340 LOG_DEBUG(Service_NIM, "called");
341 341
342 IPC::ResponseBuilder rb{ctx, 2}; 342 IPC::ResponseBuilder rb{ctx, 2};
343 rb.Push(RESULT_SUCCESS); 343 rb.Push(ResultSuccess);
344 } 344 }
345 345
346 void Cancel(Kernel::HLERequestContext& ctx) { 346 void Cancel(Kernel::HLERequestContext& ctx) {
347 LOG_DEBUG(Service_NIM, "called"); 347 LOG_DEBUG(Service_NIM, "called");
348 finished_event.GetWritableEvent().Clear(); 348 finished_event.GetWritableEvent().Clear();
349 IPC::ResponseBuilder rb{ctx, 2}; 349 IPC::ResponseBuilder rb{ctx, 2};
350 rb.Push(RESULT_SUCCESS); 350 rb.Push(ResultSuccess);
351 } 351 }
352 352
353 void IsProcessing(Kernel::HLERequestContext& ctx) { 353 void IsProcessing(Kernel::HLERequestContext& ctx) {
354 LOG_DEBUG(Service_NIM, "called"); 354 LOG_DEBUG(Service_NIM, "called");
355 355
356 IPC::ResponseBuilder rb{ctx, 3}; 356 IPC::ResponseBuilder rb{ctx, 3};
357 rb.Push(RESULT_SUCCESS); 357 rb.Push(ResultSuccess);
358 rb.PushRaw<u32>(0); // We instantly process the request 358 rb.PushRaw<u32>(0); // We instantly process the request
359 } 359 }
360 360
@@ -365,7 +365,7 @@ private:
365 std::chrono::system_clock::now().time_since_epoch()) 365 std::chrono::system_clock::now().time_since_epoch())
366 .count()}; 366 .count()};
367 IPC::ResponseBuilder rb{ctx, 4}; 367 IPC::ResponseBuilder rb{ctx, 4};
368 rb.Push(RESULT_SUCCESS); 368 rb.Push(ResultSuccess);
369 rb.PushRaw<s64>(server_time); 369 rb.PushRaw<s64>(server_time);
370 } 370 }
371}; 371};
@@ -389,7 +389,7 @@ private:
389 LOG_DEBUG(Service_NIM, "called"); 389 LOG_DEBUG(Service_NIM, "called");
390 390
391 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 391 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
392 rb.Push(RESULT_SUCCESS); 392 rb.Push(ResultSuccess);
393 rb.PushIpcInterface<IEnsureNetworkClockAvailabilityService>(system); 393 rb.PushIpcInterface<IEnsureNetworkClockAvailabilityService>(system);
394 } 394 }
395 395
@@ -398,14 +398,14 @@ private:
398 LOG_WARNING(Service_NIM, "(STUBBED) called"); 398 LOG_WARNING(Service_NIM, "(STUBBED) called");
399 399
400 IPC::ResponseBuilder rb{ctx, 2}; 400 IPC::ResponseBuilder rb{ctx, 2};
401 rb.Push(RESULT_SUCCESS); 401 rb.Push(ResultSuccess);
402 } 402 }
403 403
404 void ResumeAutonomicTimeCorrection(Kernel::HLERequestContext& ctx) { 404 void ResumeAutonomicTimeCorrection(Kernel::HLERequestContext& ctx) {
405 LOG_WARNING(Service_NIM, "(STUBBED) called"); 405 LOG_WARNING(Service_NIM, "(STUBBED) called");
406 406
407 IPC::ResponseBuilder rb{ctx, 2}; 407 IPC::ResponseBuilder rb{ctx, 2};
408 rb.Push(RESULT_SUCCESS); 408 rb.Push(ResultSuccess);
409 } 409 }
410}; 410};
411 411
diff --git a/src/core/hle/service/ns/ns.cpp b/src/core/hle/service/ns/ns.cpp
index e373609a1..8ce1f3296 100644
--- a/src/core/hle/service/ns/ns.cpp
+++ b/src/core/hle/service/ns/ns.cpp
@@ -335,7 +335,7 @@ void IApplicationManagerInterface::GetApplicationControlData(Kernel::HLERequestC
335 "output buffer is too small! (actual={:016X}, expected_min=0x4000)", size); 335 "output buffer is too small! (actual={:016X}, expected_min=0x4000)", size);
336 IPC::ResponseBuilder rb{ctx, 2}; 336 IPC::ResponseBuilder rb{ctx, 2};
337 // TODO(DarkLordZach): Find a better error code for this. 337 // TODO(DarkLordZach): Find a better error code for this.
338 rb.Push(RESULT_UNKNOWN); 338 rb.Push(ResultUnknown);
339 return; 339 return;
340 } 340 }
341 341
@@ -355,7 +355,7 @@ void IApplicationManagerInterface::GetApplicationControlData(Kernel::HLERequestC
355 0x4000 + control.second->GetSize()); 355 0x4000 + control.second->GetSize());
356 IPC::ResponseBuilder rb{ctx, 2}; 356 IPC::ResponseBuilder rb{ctx, 2};
357 // TODO(DarkLordZach): Find a better error code for this. 357 // TODO(DarkLordZach): Find a better error code for this.
358 rb.Push(RESULT_UNKNOWN); 358 rb.Push(ResultUnknown);
359 return; 359 return;
360 } 360 }
361 361
@@ -369,7 +369,7 @@ void IApplicationManagerInterface::GetApplicationControlData(Kernel::HLERequestC
369 ctx.WriteBuffer(out); 369 ctx.WriteBuffer(out);
370 370
371 IPC::ResponseBuilder rb{ctx, 3}; 371 IPC::ResponseBuilder rb{ctx, 3};
372 rb.Push(RESULT_SUCCESS); 372 rb.Push(ResultSuccess);
373 rb.Push<u32>(static_cast<u32>(out.size())); 373 rb.Push<u32>(static_cast<u32>(out.size()));
374} 374}
375 375
@@ -380,7 +380,7 @@ void IApplicationManagerInterface::GetApplicationDesiredLanguage(Kernel::HLERequ
380 const auto res = GetApplicationDesiredLanguage(supported_languages); 380 const auto res = GetApplicationDesiredLanguage(supported_languages);
381 if (res.Succeeded()) { 381 if (res.Succeeded()) {
382 IPC::ResponseBuilder rb{ctx, 3}; 382 IPC::ResponseBuilder rb{ctx, 3};
383 rb.Push(RESULT_SUCCESS); 383 rb.Push(ResultSuccess);
384 rb.Push<u32>(*res); 384 rb.Push<u32>(*res);
385 } else { 385 } else {
386 IPC::ResponseBuilder rb{ctx, 2}; 386 IPC::ResponseBuilder rb{ctx, 2};
@@ -432,7 +432,7 @@ void IApplicationManagerInterface::ConvertApplicationLanguageToLanguageCode(
432 const auto res = ConvertApplicationLanguageToLanguageCode(application_language); 432 const auto res = ConvertApplicationLanguageToLanguageCode(application_language);
433 if (res.Succeeded()) { 433 if (res.Succeeded()) {
434 IPC::ResponseBuilder rb{ctx, 4}; 434 IPC::ResponseBuilder rb{ctx, 4};
435 rb.Push(RESULT_SUCCESS); 435 rb.Push(ResultSuccess);
436 rb.Push(*res); 436 rb.Push(*res);
437 } else { 437 } else {
438 IPC::ResponseBuilder rb{ctx, 2}; 438 IPC::ResponseBuilder rb{ctx, 2};
@@ -697,7 +697,7 @@ private:
697 LOG_DEBUG(Service_NS, "called"); 697 LOG_DEBUG(Service_NS, "called");
698 698
699 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 699 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
700 rb.Push(RESULT_SUCCESS); 700 rb.Push(ResultSuccess);
701 rb.PushIpcInterface<ISystemUpdateControl>(system); 701 rb.PushIpcInterface<ISystemUpdateControl>(system);
702 } 702 }
703}; 703};
@@ -721,7 +721,7 @@ private:
721 LOG_WARNING(Service_NS, "(STUBBED) called"); 721 LOG_WARNING(Service_NS, "(STUBBED) called");
722 722
723 IPC::ResponseBuilder rb{ctx, 3}; 723 IPC::ResponseBuilder rb{ctx, 3};
724 rb.Push(RESULT_SUCCESS); 724 rb.Push(ResultSuccess);
725 rb.Push(false); 725 rb.Push(false);
726 } 726 }
727}; 727};
diff --git a/src/core/hle/service/ns/ns.h b/src/core/hle/service/ns/ns.h
index 991271f3e..218eec3ec 100644
--- a/src/core/hle/service/ns/ns.h
+++ b/src/core/hle/service/ns/ns.h
@@ -87,7 +87,7 @@ private:
87 LOG_DEBUG(Service_NS, "called"); 87 LOG_DEBUG(Service_NS, "called");
88 88
89 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 89 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
90 rb.Push(RESULT_SUCCESS); 90 rb.Push(ResultSuccess);
91 rb.PushIpcInterface<T>(system); 91 rb.PushIpcInterface<T>(system);
92 } 92 }
93 93
@@ -95,7 +95,7 @@ private:
95 LOG_DEBUG(Service_NS, "called"); 95 LOG_DEBUG(Service_NS, "called");
96 96
97 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 97 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
98 rb.Push(RESULT_SUCCESS); 98 rb.Push(ResultSuccess);
99 rb.PushIpcInterface<IApplicationManagerInterface>(system); 99 rb.PushIpcInterface<IApplicationManagerInterface>(system);
100 } 100 }
101 101
diff --git a/src/core/hle/service/ns/pl_u.cpp b/src/core/hle/service/ns/pl_u.cpp
index 90ba5c752..6e5ba26a3 100644
--- a/src/core/hle/service/ns/pl_u.cpp
+++ b/src/core/hle/service/ns/pl_u.cpp
@@ -216,7 +216,7 @@ void PL_U::RequestLoad(Kernel::HLERequestContext& ctx) {
216 LOG_DEBUG(Service_NS, "called, shared_font_type={}", shared_font_type); 216 LOG_DEBUG(Service_NS, "called, shared_font_type={}", shared_font_type);
217 217
218 IPC::ResponseBuilder rb{ctx, 2}; 218 IPC::ResponseBuilder rb{ctx, 2};
219 rb.Push(RESULT_SUCCESS); 219 rb.Push(ResultSuccess);
220} 220}
221 221
222void PL_U::GetLoadState(Kernel::HLERequestContext& ctx) { 222void PL_U::GetLoadState(Kernel::HLERequestContext& ctx) {
@@ -225,7 +225,7 @@ void PL_U::GetLoadState(Kernel::HLERequestContext& ctx) {
225 LOG_DEBUG(Service_NS, "called, font_id={}", font_id); 225 LOG_DEBUG(Service_NS, "called, font_id={}", font_id);
226 226
227 IPC::ResponseBuilder rb{ctx, 3}; 227 IPC::ResponseBuilder rb{ctx, 3};
228 rb.Push(RESULT_SUCCESS); 228 rb.Push(ResultSuccess);
229 rb.Push<u32>(static_cast<u32>(LoadState::Done)); 229 rb.Push<u32>(static_cast<u32>(LoadState::Done));
230} 230}
231 231
@@ -235,7 +235,7 @@ void PL_U::GetSize(Kernel::HLERequestContext& ctx) {
235 LOG_DEBUG(Service_NS, "called, font_id={}", font_id); 235 LOG_DEBUG(Service_NS, "called, font_id={}", font_id);
236 236
237 IPC::ResponseBuilder rb{ctx, 3}; 237 IPC::ResponseBuilder rb{ctx, 3};
238 rb.Push(RESULT_SUCCESS); 238 rb.Push(ResultSuccess);
239 rb.Push<u32>(impl->GetSharedFontRegion(font_id).size); 239 rb.Push<u32>(impl->GetSharedFontRegion(font_id).size);
240} 240}
241 241
@@ -245,7 +245,7 @@ void PL_U::GetSharedMemoryAddressOffset(Kernel::HLERequestContext& ctx) {
245 LOG_DEBUG(Service_NS, "called, font_id={}", font_id); 245 LOG_DEBUG(Service_NS, "called, font_id={}", font_id);
246 246
247 IPC::ResponseBuilder rb{ctx, 3}; 247 IPC::ResponseBuilder rb{ctx, 3};
248 rb.Push(RESULT_SUCCESS); 248 rb.Push(ResultSuccess);
249 rb.Push<u32>(impl->GetSharedFontRegion(font_id).offset); 249 rb.Push<u32>(impl->GetSharedFontRegion(font_id).offset);
250} 250}
251 251
@@ -260,7 +260,7 @@ void PL_U::GetSharedMemoryNativeHandle(Kernel::HLERequestContext& ctx) {
260 impl->shared_font->size()); 260 impl->shared_font->size());
261 261
262 IPC::ResponseBuilder rb{ctx, 2, 1}; 262 IPC::ResponseBuilder rb{ctx, 2, 1};
263 rb.Push(RESULT_SUCCESS); 263 rb.Push(ResultSuccess);
264 rb.PushCopyObjects(&kernel.GetFontSharedMem()); 264 rb.PushCopyObjects(&kernel.GetFontSharedMem());
265} 265}
266 266
@@ -294,7 +294,7 @@ void PL_U::GetSharedFontInOrderOfPriority(Kernel::HLERequestContext& ctx) {
294 ctx.WriteBuffer(font_offsets, 1); 294 ctx.WriteBuffer(font_offsets, 1);
295 ctx.WriteBuffer(font_sizes, 2); 295 ctx.WriteBuffer(font_sizes, 2);
296 296
297 rb.Push(RESULT_SUCCESS); 297 rb.Push(ResultSuccess);
298 rb.Push<u8>(static_cast<u8>(LoadState::Done)); // Fonts Loaded 298 rb.Push<u8>(static_cast<u8>(LoadState::Done)); // Fonts Loaded
299 rb.Push<u32>(static_cast<u32>(font_codes.size())); 299 rb.Push<u32>(static_cast<u32>(font_codes.size()));
300} 300}
diff --git a/src/core/hle/service/nvdrv/interface.cpp b/src/core/hle/service/nvdrv/interface.cpp
index dc9b9341f..e4d495000 100644
--- a/src/core/hle/service/nvdrv/interface.cpp
+++ b/src/core/hle/service/nvdrv/interface.cpp
@@ -23,7 +23,7 @@ void NVDRV::SignalGPUInterruptSyncpt(const u32 syncpoint_id, const u32 value) {
23void NVDRV::Open(Kernel::HLERequestContext& ctx) { 23void NVDRV::Open(Kernel::HLERequestContext& ctx) {
24 LOG_DEBUG(Service_NVDRV, "called"); 24 LOG_DEBUG(Service_NVDRV, "called");
25 IPC::ResponseBuilder rb{ctx, 4}; 25 IPC::ResponseBuilder rb{ctx, 4};
26 rb.Push(RESULT_SUCCESS); 26 rb.Push(ResultSuccess);
27 27
28 if (!is_initialized) { 28 if (!is_initialized) {
29 rb.Push<DeviceFD>(0); 29 rb.Push<DeviceFD>(0);
@@ -52,7 +52,7 @@ void NVDRV::Open(Kernel::HLERequestContext& ctx) {
52 52
53void NVDRV::ServiceError(Kernel::HLERequestContext& ctx, NvResult result) { 53void NVDRV::ServiceError(Kernel::HLERequestContext& ctx, NvResult result) {
54 IPC::ResponseBuilder rb{ctx, 3}; 54 IPC::ResponseBuilder rb{ctx, 3};
55 rb.Push(RESULT_SUCCESS); 55 rb.Push(ResultSuccess);
56 rb.PushEnum(result); 56 rb.PushEnum(result);
57} 57}
58 58
@@ -78,7 +78,7 @@ void NVDRV::Ioctl1(Kernel::HLERequestContext& ctx) {
78 } 78 }
79 79
80 IPC::ResponseBuilder rb{ctx, 3}; 80 IPC::ResponseBuilder rb{ctx, 3};
81 rb.Push(RESULT_SUCCESS); 81 rb.Push(ResultSuccess);
82 rb.PushEnum(nv_result); 82 rb.PushEnum(nv_result);
83} 83}
84 84
@@ -105,7 +105,7 @@ void NVDRV::Ioctl2(Kernel::HLERequestContext& ctx) {
105 } 105 }
106 106
107 IPC::ResponseBuilder rb{ctx, 3}; 107 IPC::ResponseBuilder rb{ctx, 3};
108 rb.Push(RESULT_SUCCESS); 108 rb.Push(ResultSuccess);
109 rb.PushEnum(nv_result); 109 rb.PushEnum(nv_result);
110} 110}
111 111
@@ -133,7 +133,7 @@ void NVDRV::Ioctl3(Kernel::HLERequestContext& ctx) {
133 } 133 }
134 134
135 IPC::ResponseBuilder rb{ctx, 3}; 135 IPC::ResponseBuilder rb{ctx, 3};
136 rb.Push(RESULT_SUCCESS); 136 rb.Push(ResultSuccess);
137 rb.PushEnum(nv_result); 137 rb.PushEnum(nv_result);
138} 138}
139 139
@@ -151,7 +151,7 @@ void NVDRV::Close(Kernel::HLERequestContext& ctx) {
151 const auto result = nvdrv->Close(fd); 151 const auto result = nvdrv->Close(fd);
152 152
153 IPC::ResponseBuilder rb{ctx, 3}; 153 IPC::ResponseBuilder rb{ctx, 3};
154 rb.Push(RESULT_SUCCESS); 154 rb.Push(ResultSuccess);
155 rb.PushEnum(result); 155 rb.PushEnum(result);
156} 156}
157 157
@@ -161,7 +161,7 @@ void NVDRV::Initialize(Kernel::HLERequestContext& ctx) {
161 is_initialized = true; 161 is_initialized = true;
162 162
163 IPC::ResponseBuilder rb{ctx, 3}; 163 IPC::ResponseBuilder rb{ctx, 3};
164 rb.Push(RESULT_SUCCESS); 164 rb.Push(ResultSuccess);
165 rb.PushEnum(NvResult::Success); 165 rb.PushEnum(NvResult::Success);
166} 166}
167 167
@@ -186,14 +186,14 @@ void NVDRV::QueryEvent(Kernel::HLERequestContext& ctx) {
186 186
187 if (event_id < MaxNvEvents) { 187 if (event_id < MaxNvEvents) {
188 IPC::ResponseBuilder rb{ctx, 3, 1}; 188 IPC::ResponseBuilder rb{ctx, 3, 1};
189 rb.Push(RESULT_SUCCESS); 189 rb.Push(ResultSuccess);
190 auto& event = nvdrv->GetEvent(event_id); 190 auto& event = nvdrv->GetEvent(event_id);
191 event.Clear(); 191 event.Clear();
192 rb.PushCopyObjects(event); 192 rb.PushCopyObjects(event);
193 rb.PushEnum(NvResult::Success); 193 rb.PushEnum(NvResult::Success);
194 } else { 194 } else {
195 IPC::ResponseBuilder rb{ctx, 3}; 195 IPC::ResponseBuilder rb{ctx, 3};
196 rb.Push(RESULT_SUCCESS); 196 rb.Push(ResultSuccess);
197 rb.PushEnum(NvResult::BadParameter); 197 rb.PushEnum(NvResult::BadParameter);
198 } 198 }
199} 199}
@@ -204,7 +204,7 @@ void NVDRV::SetAruid(Kernel::HLERequestContext& ctx) {
204 LOG_WARNING(Service_NVDRV, "(STUBBED) called, pid=0x{:X}", pid); 204 LOG_WARNING(Service_NVDRV, "(STUBBED) called, pid=0x{:X}", pid);
205 205
206 IPC::ResponseBuilder rb{ctx, 3}; 206 IPC::ResponseBuilder rb{ctx, 3};
207 rb.Push(RESULT_SUCCESS); 207 rb.Push(ResultSuccess);
208 rb.PushEnum(NvResult::Success); 208 rb.PushEnum(NvResult::Success);
209} 209}
210 210
@@ -212,14 +212,14 @@ void NVDRV::SetGraphicsFirmwareMemoryMarginEnabled(Kernel::HLERequestContext& ct
212 LOG_WARNING(Service_NVDRV, "(STUBBED) called"); 212 LOG_WARNING(Service_NVDRV, "(STUBBED) called");
213 213
214 IPC::ResponseBuilder rb{ctx, 2}; 214 IPC::ResponseBuilder rb{ctx, 2};
215 rb.Push(RESULT_SUCCESS); 215 rb.Push(ResultSuccess);
216} 216}
217 217
218void NVDRV::GetStatus(Kernel::HLERequestContext& ctx) { 218void NVDRV::GetStatus(Kernel::HLERequestContext& ctx) {
219 LOG_WARNING(Service_NVDRV, "(STUBBED) called"); 219 LOG_WARNING(Service_NVDRV, "(STUBBED) called");
220 220
221 IPC::ResponseBuilder rb{ctx, 3}; 221 IPC::ResponseBuilder rb{ctx, 3};
222 rb.Push(RESULT_SUCCESS); 222 rb.Push(ResultSuccess);
223 rb.PushEnum(NvResult::Success); 223 rb.PushEnum(NvResult::Success);
224} 224}
225 225
@@ -229,7 +229,7 @@ void NVDRV::DumpGraphicsMemoryInfo(Kernel::HLERequestContext& ctx) {
229 LOG_DEBUG(Service_NVDRV, "called"); 229 LOG_DEBUG(Service_NVDRV, "called");
230 230
231 IPC::ResponseBuilder rb{ctx, 2}; 231 IPC::ResponseBuilder rb{ctx, 2};
232 rb.Push(RESULT_SUCCESS); 232 rb.Push(ResultSuccess);
233} 233}
234 234
235NVDRV::NVDRV(Core::System& system_, std::shared_ptr<Module> nvdrv_, const char* name) 235NVDRV::NVDRV(Core::System& system_, std::shared_ptr<Module> nvdrv_, const char* name)
diff --git a/src/core/hle/service/olsc/olsc.cpp b/src/core/hle/service/olsc/olsc.cpp
index b066c3417..3bbe1bfe2 100644
--- a/src/core/hle/service/olsc/olsc.cpp
+++ b/src/core/hle/service/olsc/olsc.cpp
@@ -50,7 +50,7 @@ private:
50 initialized = true; 50 initialized = true;
51 51
52 IPC::ResponseBuilder rb{ctx, 2}; 52 IPC::ResponseBuilder rb{ctx, 2};
53 rb.Push(RESULT_SUCCESS); 53 rb.Push(ResultSuccess);
54 } 54 }
55 55
56 void GetSaveDataBackupSetting(Kernel::HLERequestContext& ctx) { 56 void GetSaveDataBackupSetting(Kernel::HLERequestContext& ctx) {
@@ -60,7 +60,7 @@ private:
60 constexpr u64 backup_setting = 0; 60 constexpr u64 backup_setting = 0;
61 61
62 IPC::ResponseBuilder rb{ctx, 4}; 62 IPC::ResponseBuilder rb{ctx, 4};
63 rb.Push(RESULT_SUCCESS); 63 rb.Push(ResultSuccess);
64 rb.Push(backup_setting); 64 rb.Push(backup_setting);
65 } 65 }
66 66
@@ -68,7 +68,7 @@ private:
68 LOG_WARNING(Service_OLSC, "(STUBBED) called"); 68 LOG_WARNING(Service_OLSC, "(STUBBED) called");
69 69
70 IPC::ResponseBuilder rb{ctx, 2}; 70 IPC::ResponseBuilder rb{ctx, 2};
71 rb.Push(RESULT_SUCCESS); 71 rb.Push(ResultSuccess);
72 } 72 }
73 73
74 bool initialized{}; 74 bool initialized{};
diff --git a/src/core/hle/service/pctl/module.cpp b/src/core/hle/service/pctl/module.cpp
index 1c3d81143..1e31d05a6 100644
--- a/src/core/hle/service/pctl/module.cpp
+++ b/src/core/hle/service/pctl/module.cpp
@@ -213,7 +213,7 @@ private:
213 } 213 }
214 } 214 }
215 215
216 rb.Push(RESULT_SUCCESS); 216 rb.Push(ResultSuccess);
217 } 217 }
218 218
219 void CheckFreeCommunicationPermission(Kernel::HLERequestContext& ctx) { 219 void CheckFreeCommunicationPermission(Kernel::HLERequestContext& ctx) {
@@ -223,7 +223,7 @@ private:
223 if (!CheckFreeCommunicationPermissionImpl()) { 223 if (!CheckFreeCommunicationPermissionImpl()) {
224 rb.Push(Error::ResultNoFreeCommunication); 224 rb.Push(Error::ResultNoFreeCommunication);
225 } else { 225 } else {
226 rb.Push(RESULT_SUCCESS); 226 rb.Push(ResultSuccess);
227 } 227 }
228 228
229 states.free_communication = true; 229 states.free_communication = true;
@@ -234,7 +234,7 @@ private:
234 states.stereo_vision = true; 234 states.stereo_vision = true;
235 235
236 IPC::ResponseBuilder rb{ctx, 2}; 236 IPC::ResponseBuilder rb{ctx, 2};
237 rb.Push(RESULT_SUCCESS); 237 rb.Push(ResultSuccess);
238 } 238 }
239 239
240 void IsFreeCommunicationAvailable(Kernel::HLERequestContext& ctx) { 240 void IsFreeCommunicationAvailable(Kernel::HLERequestContext& ctx) {
@@ -244,7 +244,7 @@ private:
244 if (!CheckFreeCommunicationPermissionImpl()) { 244 if (!CheckFreeCommunicationPermissionImpl()) {
245 rb.Push(Error::ResultNoFreeCommunication); 245 rb.Push(Error::ResultNoFreeCommunication);
246 } else { 246 } else {
247 rb.Push(RESULT_SUCCESS); 247 rb.Push(ResultSuccess);
248 } 248 }
249 } 249 }
250 250
@@ -278,7 +278,7 @@ private:
278 return; 278 return;
279 } 279 }
280 280
281 rb.Push(RESULT_SUCCESS); 281 rb.Push(ResultSuccess);
282 } 282 }
283 283
284 void IsStereoVisionPermitted(Kernel::HLERequestContext& ctx) { 284 void IsStereoVisionPermitted(Kernel::HLERequestContext& ctx) {
@@ -289,7 +289,7 @@ private:
289 rb.Push(Error::ResultStereoVisionRestricted); 289 rb.Push(Error::ResultStereoVisionRestricted);
290 rb.Push(false); 290 rb.Push(false);
291 } else { 291 } else {
292 rb.Push(RESULT_SUCCESS); 292 rb.Push(ResultSuccess);
293 rb.Push(true); 293 rb.Push(true);
294 } 294 }
295 } 295 }
@@ -307,7 +307,7 @@ private:
307 } 307 }
308 308
309 SetStereoVisionRestrictionImpl(can_use); 309 SetStereoVisionRestrictionImpl(can_use);
310 rb.Push(RESULT_SUCCESS); 310 rb.Push(ResultSuccess);
311 } 311 }
312 312
313 void GetStereoVisionRestriction(Kernel::HLERequestContext& ctx) { 313 void GetStereoVisionRestriction(Kernel::HLERequestContext& ctx) {
@@ -321,7 +321,7 @@ private:
321 return; 321 return;
322 } 322 }
323 323
324 rb.Push(RESULT_SUCCESS); 324 rb.Push(ResultSuccess);
325 rb.Push(settings.is_stero_vision_restricted); 325 rb.Push(settings.is_stero_vision_restricted);
326 } 326 }
327 327
@@ -331,7 +331,7 @@ private:
331 states.stereo_vision = false; 331 states.stereo_vision = false;
332 332
333 IPC::ResponseBuilder rb{ctx, 2}; 333 IPC::ResponseBuilder rb{ctx, 2};
334 rb.Push(RESULT_SUCCESS); 334 rb.Push(ResultSuccess);
335 } 335 }
336 336
337 struct ApplicationInfo { 337 struct ApplicationInfo {
@@ -368,7 +368,7 @@ void Module::Interface::CreateService(Kernel::HLERequestContext& ctx) {
368 LOG_DEBUG(Service_PCTL, "called"); 368 LOG_DEBUG(Service_PCTL, "called");
369 369
370 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 370 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
371 rb.Push(RESULT_SUCCESS); 371 rb.Push(ResultSuccess);
372 // TODO(ogniK): Get TID from process 372 // TODO(ogniK): Get TID from process
373 373
374 rb.PushIpcInterface<IParentalControlService>(system, capability); 374 rb.PushIpcInterface<IParentalControlService>(system, capability);
@@ -378,7 +378,7 @@ void Module::Interface::CreateServiceWithoutInitialize(Kernel::HLERequestContext
378 LOG_DEBUG(Service_PCTL, "called"); 378 LOG_DEBUG(Service_PCTL, "called");
379 379
380 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 380 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
381 rb.Push(RESULT_SUCCESS); 381 rb.Push(ResultSuccess);
382 rb.PushIpcInterface<IParentalControlService>(system, capability); 382 rb.PushIpcInterface<IParentalControlService>(system, capability);
383} 383}
384 384
diff --git a/src/core/hle/service/pm/pm.cpp b/src/core/hle/service/pm/pm.cpp
index a43185c44..f675740b4 100644
--- a/src/core/hle/service/pm/pm.cpp
+++ b/src/core/hle/service/pm/pm.cpp
@@ -36,7 +36,7 @@ void GetApplicationPidGeneric(Kernel::HLERequestContext& ctx,
36 }); 36 });
37 37
38 IPC::ResponseBuilder rb{ctx, 4}; 38 IPC::ResponseBuilder rb{ctx, 4};
39 rb.Push(RESULT_SUCCESS); 39 rb.Push(ResultSuccess);
40 rb.Push(process.has_value() ? (*process)->GetProcessID() : NO_PROCESS_FOUND_PID); 40 rb.Push(process.has_value() ? (*process)->GetProcessID() : NO_PROCESS_FOUND_PID);
41} 41}
42 42
@@ -57,7 +57,7 @@ private:
57 LOG_DEBUG(Service_PM, "called"); 57 LOG_DEBUG(Service_PM, "called");
58 58
59 IPC::ResponseBuilder rb{ctx, 3}; 59 IPC::ResponseBuilder rb{ctx, 3};
60 rb.Push(RESULT_SUCCESS); 60 rb.Push(ResultSuccess);
61 rb.PushEnum(boot_mode); 61 rb.PushEnum(boot_mode);
62 } 62 }
63 63
@@ -67,7 +67,7 @@ private:
67 boot_mode = SystemBootMode::Maintenance; 67 boot_mode = SystemBootMode::Maintenance;
68 68
69 IPC::ResponseBuilder rb{ctx, 2}; 69 IPC::ResponseBuilder rb{ctx, 2};
70 rb.Push(RESULT_SUCCESS); 70 rb.Push(ResultSuccess);
71 } 71 }
72 72
73 SystemBootMode boot_mode = SystemBootMode::Normal; 73 SystemBootMode boot_mode = SystemBootMode::Normal;
@@ -111,7 +111,7 @@ private:
111 } 111 }
112 112
113 IPC::ResponseBuilder rb{ctx, 4}; 113 IPC::ResponseBuilder rb{ctx, 4};
114 rb.Push(RESULT_SUCCESS); 114 rb.Push(ResultSuccess);
115 rb.Push((*process)->GetProcessID()); 115 rb.Push((*process)->GetProcessID());
116 } 116 }
117 117
@@ -151,7 +151,7 @@ private:
151 } 151 }
152 152
153 IPC::ResponseBuilder rb{ctx, 4}; 153 IPC::ResponseBuilder rb{ctx, 4};
154 rb.Push(RESULT_SUCCESS); 154 rb.Push(ResultSuccess);
155 rb.Push((*process)->GetTitleID()); 155 rb.Push((*process)->GetTitleID());
156 } 156 }
157 157
diff --git a/src/core/hle/service/prepo/prepo.cpp b/src/core/hle/service/prepo/prepo.cpp
index c914f8145..32db6834c 100644
--- a/src/core/hle/service/prepo/prepo.cpp
+++ b/src/core/hle/service/prepo/prepo.cpp
@@ -77,7 +77,7 @@ private:
77 process_id); 77 process_id);
78 78
79 IPC::ResponseBuilder rb{ctx, 2}; 79 IPC::ResponseBuilder rb{ctx, 2};
80 rb.Push(RESULT_SUCCESS); 80 rb.Push(ResultSuccess);
81 } 81 }
82 82
83 template <Core::Reporter::PlayReportType Type> 83 template <Core::Reporter::PlayReportType Type>
@@ -105,14 +105,14 @@ private:
105 process_id, user_id); 105 process_id, user_id);
106 106
107 IPC::ResponseBuilder rb{ctx, 2}; 107 IPC::ResponseBuilder rb{ctx, 2};
108 rb.Push(RESULT_SUCCESS); 108 rb.Push(ResultSuccess);
109 } 109 }
110 110
111 void RequestImmediateTransmission(Kernel::HLERequestContext& ctx) { 111 void RequestImmediateTransmission(Kernel::HLERequestContext& ctx) {
112 LOG_WARNING(Service_PREPO, "(STUBBED) called"); 112 LOG_WARNING(Service_PREPO, "(STUBBED) called");
113 113
114 IPC::ResponseBuilder rb{ctx, 2}; 114 IPC::ResponseBuilder rb{ctx, 2};
115 rb.Push(RESULT_SUCCESS); 115 rb.Push(ResultSuccess);
116 } 116 }
117 117
118 void GetTransmissionStatus(Kernel::HLERequestContext& ctx) { 118 void GetTransmissionStatus(Kernel::HLERequestContext& ctx) {
@@ -121,7 +121,7 @@ private:
121 constexpr s32 status = 0; 121 constexpr s32 status = 0;
122 122
123 IPC::ResponseBuilder rb{ctx, 3}; 123 IPC::ResponseBuilder rb{ctx, 3};
124 rb.Push(RESULT_SUCCESS); 124 rb.Push(ResultSuccess);
125 rb.Push(status); 125 rb.Push(status);
126 } 126 }
127 127
@@ -130,7 +130,7 @@ private:
130 130
131 constexpr u64 system_session_id = 0; 131 constexpr u64 system_session_id = 0;
132 IPC::ResponseBuilder rb{ctx, 4}; 132 IPC::ResponseBuilder rb{ctx, 4};
133 rb.Push(RESULT_SUCCESS); 133 rb.Push(ResultSuccess);
134 rb.Push(system_session_id); 134 rb.Push(system_session_id);
135 } 135 }
136 136
@@ -154,7 +154,7 @@ private:
154 reporter.SavePlayReport(Core::Reporter::PlayReportType::System, title_id, {data1, data2}); 154 reporter.SavePlayReport(Core::Reporter::PlayReportType::System, title_id, {data1, data2});
155 155
156 IPC::ResponseBuilder rb{ctx, 2}; 156 IPC::ResponseBuilder rb{ctx, 2};
157 rb.Push(RESULT_SUCCESS); 157 rb.Push(ResultSuccess);
158 } 158 }
159 159
160 void SaveSystemReportWithUser(Kernel::HLERequestContext& ctx) { 160 void SaveSystemReportWithUser(Kernel::HLERequestContext& ctx) {
@@ -181,7 +181,7 @@ private:
181 std::nullopt, user_id); 181 std::nullopt, user_id);
182 182
183 IPC::ResponseBuilder rb{ctx, 2}; 183 IPC::ResponseBuilder rb{ctx, 2};
184 rb.Push(RESULT_SUCCESS); 184 rb.Push(ResultSuccess);
185 } 185 }
186}; 186};
187 187
diff --git a/src/core/hle/service/psc/psc.cpp b/src/core/hle/service/psc/psc.cpp
index 5a52b2b05..f8ea02b58 100644
--- a/src/core/hle/service/psc/psc.cpp
+++ b/src/core/hle/service/psc/psc.cpp
@@ -67,7 +67,7 @@ private:
67 LOG_DEBUG(Service_PSC, "called"); 67 LOG_DEBUG(Service_PSC, "called");
68 68
69 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 69 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
70 rb.Push(RESULT_SUCCESS); 70 rb.Push(ResultSuccess);
71 rb.PushIpcInterface<IPmModule>(system); 71 rb.PushIpcInterface<IPmModule>(system);
72 } 72 }
73}; 73};
diff --git a/src/core/hle/service/ptm/psm.cpp b/src/core/hle/service/ptm/psm.cpp
index bb7af9217..d9897c5c5 100644
--- a/src/core/hle/service/ptm/psm.cpp
+++ b/src/core/hle/service/ptm/psm.cpp
@@ -64,7 +64,7 @@ private:
64 should_signal = true; 64 should_signal = true;
65 65
66 IPC::ResponseBuilder rb{ctx, 2, 1}; 66 IPC::ResponseBuilder rb{ctx, 2, 1};
67 rb.Push(RESULT_SUCCESS); 67 rb.Push(ResultSuccess);
68 rb.PushCopyObjects(state_change_event.GetReadableEvent()); 68 rb.PushCopyObjects(state_change_event.GetReadableEvent());
69 } 69 }
70 70
@@ -74,7 +74,7 @@ private:
74 should_signal = false; 74 should_signal = false;
75 75
76 IPC::ResponseBuilder rb{ctx, 2}; 76 IPC::ResponseBuilder rb{ctx, 2};
77 rb.Push(RESULT_SUCCESS); 77 rb.Push(ResultSuccess);
78 } 78 }
79 79
80 void SetChargerTypeChangeEventEnabled(Kernel::HLERequestContext& ctx) { 80 void SetChargerTypeChangeEventEnabled(Kernel::HLERequestContext& ctx) {
@@ -85,7 +85,7 @@ private:
85 should_signal_charger_type = state; 85 should_signal_charger_type = state;
86 86
87 IPC::ResponseBuilder rb{ctx, 2}; 87 IPC::ResponseBuilder rb{ctx, 2};
88 rb.Push(RESULT_SUCCESS); 88 rb.Push(ResultSuccess);
89 } 89 }
90 90
91 void SetPowerSupplyChangeEventEnabled(Kernel::HLERequestContext& ctx) { 91 void SetPowerSupplyChangeEventEnabled(Kernel::HLERequestContext& ctx) {
@@ -96,7 +96,7 @@ private:
96 should_signal_power_supply = state; 96 should_signal_power_supply = state;
97 97
98 IPC::ResponseBuilder rb{ctx, 2}; 98 IPC::ResponseBuilder rb{ctx, 2};
99 rb.Push(RESULT_SUCCESS); 99 rb.Push(ResultSuccess);
100 } 100 }
101 101
102 void SetBatteryVoltageStateChangeEventEnabled(Kernel::HLERequestContext& ctx) { 102 void SetBatteryVoltageStateChangeEventEnabled(Kernel::HLERequestContext& ctx) {
@@ -107,7 +107,7 @@ private:
107 should_signal_battery_voltage = state; 107 should_signal_battery_voltage = state;
108 108
109 IPC::ResponseBuilder rb{ctx, 2}; 109 IPC::ResponseBuilder rb{ctx, 2};
110 rb.Push(RESULT_SUCCESS); 110 rb.Push(ResultSuccess);
111 } 111 }
112 112
113 bool should_signal_charger_type{}; 113 bool should_signal_charger_type{};
@@ -154,7 +154,7 @@ private:
154 LOG_DEBUG(Service_PSM, "called"); 154 LOG_DEBUG(Service_PSM, "called");
155 155
156 IPC::ResponseBuilder rb{ctx, 3}; 156 IPC::ResponseBuilder rb{ctx, 3};
157 rb.Push(RESULT_SUCCESS); 157 rb.Push(ResultSuccess);
158 rb.Push<u32>(battery_charge_percentage); 158 rb.Push<u32>(battery_charge_percentage);
159 } 159 }
160 160
@@ -162,7 +162,7 @@ private:
162 LOG_DEBUG(Service_PSM, "called"); 162 LOG_DEBUG(Service_PSM, "called");
163 163
164 IPC::ResponseBuilder rb{ctx, 3}; 164 IPC::ResponseBuilder rb{ctx, 3};
165 rb.Push(RESULT_SUCCESS); 165 rb.Push(ResultSuccess);
166 rb.PushEnum(charger_type); 166 rb.PushEnum(charger_type);
167 } 167 }
168 168
@@ -170,7 +170,7 @@ private:
170 LOG_DEBUG(Service_PSM, "called"); 170 LOG_DEBUG(Service_PSM, "called");
171 171
172 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 172 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
173 rb.Push(RESULT_SUCCESS); 173 rb.Push(ResultSuccess);
174 rb.PushIpcInterface<IPsmSession>(system); 174 rb.PushIpcInterface<IPsmSession>(system);
175 } 175 }
176 176
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index fa61a5c7b..7a15eeba0 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -162,7 +162,7 @@ void ServiceFrameworkBase::ReportUnimplementedFunction(Kernel::HLERequestContext
162 if (Settings::values.use_auto_stub) { 162 if (Settings::values.use_auto_stub) {
163 LOG_WARNING(Service, "Using auto stub fallback!"); 163 LOG_WARNING(Service, "Using auto stub fallback!");
164 IPC::ResponseBuilder rb{ctx, 2}; 164 IPC::ResponseBuilder rb{ctx, 2};
165 rb.Push(RESULT_SUCCESS); 165 rb.Push(ResultSuccess);
166 } 166 }
167} 167}
168 168
@@ -200,7 +200,7 @@ ResultCode ServiceFrameworkBase::HandleSyncRequest(Kernel::KServerSession& sessi
200 case IPC::CommandType::TIPC_Close: { 200 case IPC::CommandType::TIPC_Close: {
201 session.Close(); 201 session.Close();
202 IPC::ResponseBuilder rb{ctx, 2}; 202 IPC::ResponseBuilder rb{ctx, 2};
203 rb.Push(RESULT_SUCCESS); 203 rb.Push(ResultSuccess);
204 return IPC::ERR_REMOTE_PROCESS_DEAD; 204 return IPC::ERR_REMOTE_PROCESS_DEAD;
205 } 205 }
206 case IPC::CommandType::ControlWithContext: 206 case IPC::CommandType::ControlWithContext:
@@ -228,7 +228,7 @@ ResultCode ServiceFrameworkBase::HandleSyncRequest(Kernel::KServerSession& sessi
228 ctx.WriteToOutgoingCommandBuffer(ctx.GetThread()); 228 ctx.WriteToOutgoingCommandBuffer(ctx.GetThread());
229 } 229 }
230 230
231 return RESULT_SUCCESS; 231 return ResultSuccess;
232} 232}
233 233
234/// Initialize Services 234/// Initialize Services
diff --git a/src/core/hle/service/set/set.cpp b/src/core/hle/service/set/set.cpp
index fbdc4793d..ece2a74c6 100644
--- a/src/core/hle/service/set/set.cpp
+++ b/src/core/hle/service/set/set.cpp
@@ -77,7 +77,7 @@ constexpr ResultCode ERR_INVALID_LANGUAGE{ErrorModule::Settings, 625};
77 77
78void PushResponseLanguageCode(Kernel::HLERequestContext& ctx, std::size_t num_language_codes) { 78void PushResponseLanguageCode(Kernel::HLERequestContext& ctx, std::size_t num_language_codes) {
79 IPC::ResponseBuilder rb{ctx, 3}; 79 IPC::ResponseBuilder rb{ctx, 3};
80 rb.Push(RESULT_SUCCESS); 80 rb.Push(ResultSuccess);
81 rb.Push(static_cast<u32>(num_language_codes)); 81 rb.Push(static_cast<u32>(num_language_codes));
82} 82}
83 83
@@ -107,7 +107,7 @@ void GetKeyCodeMapImpl(Kernel::HLERequestContext& ctx) {
107 ctx.WriteBuffer(layout); 107 ctx.WriteBuffer(layout);
108 108
109 IPC::ResponseBuilder rb{ctx, 2}; 109 IPC::ResponseBuilder rb{ctx, 2};
110 rb.Push(RESULT_SUCCESS); 110 rb.Push(ResultSuccess);
111} 111}
112} // Anonymous namespace 112} // Anonymous namespace
113 113
@@ -133,7 +133,7 @@ void SET::MakeLanguageCode(Kernel::HLERequestContext& ctx) {
133 } 133 }
134 134
135 IPC::ResponseBuilder rb{ctx, 4}; 135 IPC::ResponseBuilder rb{ctx, 4};
136 rb.Push(RESULT_SUCCESS); 136 rb.Push(ResultSuccess);
137 rb.PushEnum(available_language_codes[index]); 137 rb.PushEnum(available_language_codes[index]);
138} 138}
139 139
@@ -159,7 +159,7 @@ void SET::GetQuestFlag(Kernel::HLERequestContext& ctx) {
159 LOG_DEBUG(Service_SET, "called"); 159 LOG_DEBUG(Service_SET, "called");
160 160
161 IPC::ResponseBuilder rb{ctx, 3}; 161 IPC::ResponseBuilder rb{ctx, 3};
162 rb.Push(RESULT_SUCCESS); 162 rb.Push(ResultSuccess);
163 rb.Push(static_cast<u32>(Settings::values.quest_flag)); 163 rb.Push(static_cast<u32>(Settings::values.quest_flag));
164} 164}
165 165
@@ -167,7 +167,7 @@ void SET::GetLanguageCode(Kernel::HLERequestContext& ctx) {
167 LOG_DEBUG(Service_SET, "called {}", Settings::values.language_index.GetValue()); 167 LOG_DEBUG(Service_SET, "called {}", Settings::values.language_index.GetValue());
168 168
169 IPC::ResponseBuilder rb{ctx, 4}; 169 IPC::ResponseBuilder rb{ctx, 4};
170 rb.Push(RESULT_SUCCESS); 170 rb.Push(ResultSuccess);
171 rb.PushEnum(available_language_codes[Settings::values.language_index.GetValue()]); 171 rb.PushEnum(available_language_codes[Settings::values.language_index.GetValue()]);
172} 172}
173 173
@@ -175,7 +175,7 @@ void SET::GetRegionCode(Kernel::HLERequestContext& ctx) {
175 LOG_DEBUG(Service_SET, "called"); 175 LOG_DEBUG(Service_SET, "called");
176 176
177 IPC::ResponseBuilder rb{ctx, 3}; 177 IPC::ResponseBuilder rb{ctx, 3};
178 rb.Push(RESULT_SUCCESS); 178 rb.Push(ResultSuccess);
179 rb.Push(Settings::values.region_index.GetValue()); 179 rb.Push(Settings::values.region_index.GetValue());
180} 180}
181 181
diff --git a/src/core/hle/service/set/set_sys.cpp b/src/core/hle/service/set/set_sys.cpp
index 4f1ffe55f..8299c6b68 100644
--- a/src/core/hle/service/set/set_sys.cpp
+++ b/src/core/hle/service/set/set_sys.cpp
@@ -70,7 +70,7 @@ void GetFirmwareVersionImpl(Kernel::HLERequestContext& ctx, GetFirmwareVersionTy
70 ctx.WriteBuffer(data); 70 ctx.WriteBuffer(data);
71 71
72 IPC::ResponseBuilder rb{ctx, 2}; 72 IPC::ResponseBuilder rb{ctx, 2};
73 rb.Push(RESULT_SUCCESS); 73 rb.Push(ResultSuccess);
74} 74}
75} // Anonymous namespace 75} // Anonymous namespace
76 76
@@ -89,7 +89,7 @@ void SET_SYS::GetColorSetId(Kernel::HLERequestContext& ctx) {
89 89
90 IPC::ResponseBuilder rb{ctx, 3}; 90 IPC::ResponseBuilder rb{ctx, 3};
91 91
92 rb.Push(RESULT_SUCCESS); 92 rb.Push(ResultSuccess);
93 rb.PushEnum(color_set); 93 rb.PushEnum(color_set);
94} 94}
95 95
@@ -100,7 +100,7 @@ void SET_SYS::SetColorSetId(Kernel::HLERequestContext& ctx) {
100 color_set = rp.PopEnum<ColorSet>(); 100 color_set = rp.PopEnum<ColorSet>();
101 101
102 IPC::ResponseBuilder rb{ctx, 2}; 102 IPC::ResponseBuilder rb{ctx, 2};
103 rb.Push(RESULT_SUCCESS); 103 rb.Push(ResultSuccess);
104} 104}
105 105
106SET_SYS::SET_SYS(Core::System& system_) : ServiceFramework{system_, "set:sys"} { 106SET_SYS::SET_SYS(Core::System& system_) : ServiceFramework{system_, "set:sys"} {
diff --git a/src/core/hle/service/sm/controller.cpp b/src/core/hle/service/sm/controller.cpp
index 147f12147..5fa5e0512 100644
--- a/src/core/hle/service/sm/controller.cpp
+++ b/src/core/hle/service/sm/controller.cpp
@@ -23,7 +23,7 @@ void Controller::ConvertCurrentObjectToDomain(Kernel::HLERequestContext& ctx) {
23 ctx.Session()->ConvertToDomain(); 23 ctx.Session()->ConvertToDomain();
24 24
25 IPC::ResponseBuilder rb{ctx, 3}; 25 IPC::ResponseBuilder rb{ctx, 3};
26 rb.Push(RESULT_SUCCESS); 26 rb.Push(ResultSuccess);
27 rb.Push<u32>(1); // Converted sessions start with 1 request handler 27 rb.Push<u32>(1); // Converted sessions start with 1 request handler
28} 28}
29 29
@@ -62,7 +62,7 @@ void Controller::CloneCurrentObject(Kernel::HLERequestContext& ctx) {
62 62
63 // We succeeded. 63 // We succeeded.
64 IPC::ResponseBuilder rb{ctx, 2, 0, 1, IPC::ResponseBuilder::Flags::AlwaysMoveHandles}; 64 IPC::ResponseBuilder rb{ctx, 2, 0, 1, IPC::ResponseBuilder::Flags::AlwaysMoveHandles};
65 rb.Push(RESULT_SUCCESS); 65 rb.Push(ResultSuccess);
66 rb.PushMoveObjects(clone->GetClientSession()); 66 rb.PushMoveObjects(clone->GetClientSession());
67} 67}
68 68
@@ -76,7 +76,7 @@ void Controller::QueryPointerBufferSize(Kernel::HLERequestContext& ctx) {
76 LOG_WARNING(Service, "(STUBBED) called"); 76 LOG_WARNING(Service, "(STUBBED) called");
77 77
78 IPC::ResponseBuilder rb{ctx, 3}; 78 IPC::ResponseBuilder rb{ctx, 3};
79 rb.Push(RESULT_SUCCESS); 79 rb.Push(ResultSuccess);
80 rb.Push<u16>(0x8000); 80 rb.Push<u16>(0x8000);
81} 81}
82 82
diff --git a/src/core/hle/service/sm/sm.cpp b/src/core/hle/service/sm/sm.cpp
index a9bc7da74..d8b20a3f2 100644
--- a/src/core/hle/service/sm/sm.cpp
+++ b/src/core/hle/service/sm/sm.cpp
@@ -36,7 +36,7 @@ static ResultCode ValidateServiceName(const std::string& name) {
36 LOG_ERROR(Service_SM, "Invalid service name! service={}", name); 36 LOG_ERROR(Service_SM, "Invalid service name! service={}", name);
37 return ERR_INVALID_NAME; 37 return ERR_INVALID_NAME;
38 } 38 }
39 return RESULT_SUCCESS; 39 return ResultSuccess;
40} 40}
41 41
42Kernel::KClientPort& ServiceManager::InterfaceFactory(ServiceManager& self, Core::System& system) { 42Kernel::KClientPort& ServiceManager::InterfaceFactory(ServiceManager& self, Core::System& system) {
@@ -79,7 +79,7 @@ ResultCode ServiceManager::UnregisterService(const std::string& name) {
79 iter->second->Close(); 79 iter->second->Close();
80 80
81 registered_services.erase(iter); 81 registered_services.erase(iter);
82 return RESULT_SUCCESS; 82 return ResultSuccess;
83} 83}
84 84
85ResultVal<Kernel::KPort*> ServiceManager::GetServicePort(const std::string& name) { 85ResultVal<Kernel::KPort*> ServiceManager::GetServicePort(const std::string& name) {
@@ -109,7 +109,7 @@ void SM::Initialize(Kernel::HLERequestContext& ctx) {
109 is_initialized = true; 109 is_initialized = true;
110 110
111 IPC::ResponseBuilder rb{ctx, 2}; 111 IPC::ResponseBuilder rb{ctx, 2};
112 rb.Push(RESULT_SUCCESS); 112 rb.Push(ResultSuccess);
113} 113}
114 114
115void SM::GetService(Kernel::HLERequestContext& ctx) { 115void SM::GetService(Kernel::HLERequestContext& ctx) {
diff --git a/src/core/hle/service/sockets/bsd.cpp b/src/core/hle/service/sockets/bsd.cpp
index 5fcd91f68..7d85ecb6a 100644
--- a/src/core/hle/service/sockets/bsd.cpp
+++ b/src/core/hle/service/sockets/bsd.cpp
@@ -47,7 +47,7 @@ void BSD::PollWork::Response(Kernel::HLERequestContext& ctx) {
47 } 47 }
48 48
49 IPC::ResponseBuilder rb{ctx, 4}; 49 IPC::ResponseBuilder rb{ctx, 4};
50 rb.Push(RESULT_SUCCESS); 50 rb.Push(ResultSuccess);
51 rb.Push<s32>(ret); 51 rb.Push<s32>(ret);
52 rb.PushEnum(bsd_errno); 52 rb.PushEnum(bsd_errno);
53} 53}
@@ -62,7 +62,7 @@ void BSD::AcceptWork::Response(Kernel::HLERequestContext& ctx) {
62 } 62 }
63 63
64 IPC::ResponseBuilder rb{ctx, 5}; 64 IPC::ResponseBuilder rb{ctx, 5};
65 rb.Push(RESULT_SUCCESS); 65 rb.Push(ResultSuccess);
66 rb.Push<s32>(ret); 66 rb.Push<s32>(ret);
67 rb.PushEnum(bsd_errno); 67 rb.PushEnum(bsd_errno);
68 rb.Push<u32>(static_cast<u32>(write_buffer.size())); 68 rb.Push<u32>(static_cast<u32>(write_buffer.size()));
@@ -74,7 +74,7 @@ void BSD::ConnectWork::Execute(BSD* bsd) {
74 74
75void BSD::ConnectWork::Response(Kernel::HLERequestContext& ctx) { 75void BSD::ConnectWork::Response(Kernel::HLERequestContext& ctx) {
76 IPC::ResponseBuilder rb{ctx, 4}; 76 IPC::ResponseBuilder rb{ctx, 4};
77 rb.Push(RESULT_SUCCESS); 77 rb.Push(ResultSuccess);
78 rb.Push<s32>(bsd_errno == Errno::SUCCESS ? 0 : -1); 78 rb.Push<s32>(bsd_errno == Errno::SUCCESS ? 0 : -1);
79 rb.PushEnum(bsd_errno); 79 rb.PushEnum(bsd_errno);
80} 80}
@@ -87,7 +87,7 @@ void BSD::RecvWork::Response(Kernel::HLERequestContext& ctx) {
87 ctx.WriteBuffer(message); 87 ctx.WriteBuffer(message);
88 88
89 IPC::ResponseBuilder rb{ctx, 4}; 89 IPC::ResponseBuilder rb{ctx, 4};
90 rb.Push(RESULT_SUCCESS); 90 rb.Push(ResultSuccess);
91 rb.Push<s32>(ret); 91 rb.Push<s32>(ret);
92 rb.PushEnum(bsd_errno); 92 rb.PushEnum(bsd_errno);
93} 93}
@@ -103,7 +103,7 @@ void BSD::RecvFromWork::Response(Kernel::HLERequestContext& ctx) {
103 } 103 }
104 104
105 IPC::ResponseBuilder rb{ctx, 5}; 105 IPC::ResponseBuilder rb{ctx, 5};
106 rb.Push(RESULT_SUCCESS); 106 rb.Push(ResultSuccess);
107 rb.Push<s32>(ret); 107 rb.Push<s32>(ret);
108 rb.PushEnum(bsd_errno); 108 rb.PushEnum(bsd_errno);
109 rb.Push<u32>(static_cast<u32>(addr.size())); 109 rb.Push<u32>(static_cast<u32>(addr.size()));
@@ -115,7 +115,7 @@ void BSD::SendWork::Execute(BSD* bsd) {
115 115
116void BSD::SendWork::Response(Kernel::HLERequestContext& ctx) { 116void BSD::SendWork::Response(Kernel::HLERequestContext& ctx) {
117 IPC::ResponseBuilder rb{ctx, 4}; 117 IPC::ResponseBuilder rb{ctx, 4};
118 rb.Push(RESULT_SUCCESS); 118 rb.Push(ResultSuccess);
119 rb.Push<s32>(ret); 119 rb.Push<s32>(ret);
120 rb.PushEnum(bsd_errno); 120 rb.PushEnum(bsd_errno);
121} 121}
@@ -126,7 +126,7 @@ void BSD::SendToWork::Execute(BSD* bsd) {
126 126
127void BSD::SendToWork::Response(Kernel::HLERequestContext& ctx) { 127void BSD::SendToWork::Response(Kernel::HLERequestContext& ctx) {
128 IPC::ResponseBuilder rb{ctx, 4}; 128 IPC::ResponseBuilder rb{ctx, 4};
129 rb.Push(RESULT_SUCCESS); 129 rb.Push(ResultSuccess);
130 rb.Push<s32>(ret); 130 rb.Push<s32>(ret);
131 rb.PushEnum(bsd_errno); 131 rb.PushEnum(bsd_errno);
132} 132}
@@ -136,7 +136,7 @@ void BSD::RegisterClient(Kernel::HLERequestContext& ctx) {
136 136
137 IPC::ResponseBuilder rb{ctx, 3}; 137 IPC::ResponseBuilder rb{ctx, 3};
138 138
139 rb.Push(RESULT_SUCCESS); 139 rb.Push(ResultSuccess);
140 rb.Push<s32>(0); // bsd errno 140 rb.Push<s32>(0); // bsd errno
141} 141}
142 142
@@ -145,7 +145,7 @@ void BSD::StartMonitoring(Kernel::HLERequestContext& ctx) {
145 145
146 IPC::ResponseBuilder rb{ctx, 2}; 146 IPC::ResponseBuilder rb{ctx, 2};
147 147
148 rb.Push(RESULT_SUCCESS); 148 rb.Push(ResultSuccess);
149} 149}
150 150
151void BSD::Socket(Kernel::HLERequestContext& ctx) { 151void BSD::Socket(Kernel::HLERequestContext& ctx) {
@@ -160,7 +160,7 @@ void BSD::Socket(Kernel::HLERequestContext& ctx) {
160 static_cast<Protocol>(protocol)); 160 static_cast<Protocol>(protocol));
161 161
162 IPC::ResponseBuilder rb{ctx, 4}; 162 IPC::ResponseBuilder rb{ctx, 4};
163 rb.Push(RESULT_SUCCESS); 163 rb.Push(ResultSuccess);
164 rb.Push<s32>(fd); 164 rb.Push<s32>(fd);
165 rb.PushEnum(bsd_errno); 165 rb.PushEnum(bsd_errno);
166} 166}
@@ -170,7 +170,7 @@ void BSD::Select(Kernel::HLERequestContext& ctx) {
170 170
171 IPC::ResponseBuilder rb{ctx, 4}; 171 IPC::ResponseBuilder rb{ctx, 4};
172 172
173 rb.Push(RESULT_SUCCESS); 173 rb.Push(ResultSuccess);
174 rb.Push<u32>(0); // ret 174 rb.Push<u32>(0); // ret
175 rb.Push<u32>(0); // bsd errno 175 rb.Push<u32>(0); // bsd errno
176} 176}
@@ -235,7 +235,7 @@ void BSD::GetPeerName(Kernel::HLERequestContext& ctx) {
235 ctx.WriteBuffer(write_buffer); 235 ctx.WriteBuffer(write_buffer);
236 236
237 IPC::ResponseBuilder rb{ctx, 5}; 237 IPC::ResponseBuilder rb{ctx, 5};
238 rb.Push(RESULT_SUCCESS); 238 rb.Push(ResultSuccess);
239 rb.Push<s32>(bsd_errno != Errno::SUCCESS ? -1 : 0); 239 rb.Push<s32>(bsd_errno != Errno::SUCCESS ? -1 : 0);
240 rb.PushEnum(bsd_errno); 240 rb.PushEnum(bsd_errno);
241 rb.Push<u32>(static_cast<u32>(write_buffer.size())); 241 rb.Push<u32>(static_cast<u32>(write_buffer.size()));
@@ -253,7 +253,7 @@ void BSD::GetSockName(Kernel::HLERequestContext& ctx) {
253 ctx.WriteBuffer(write_buffer); 253 ctx.WriteBuffer(write_buffer);
254 254
255 IPC::ResponseBuilder rb{ctx, 5}; 255 IPC::ResponseBuilder rb{ctx, 5};
256 rb.Push(RESULT_SUCCESS); 256 rb.Push(ResultSuccess);
257 rb.Push<s32>(bsd_errno != Errno::SUCCESS ? -1 : 0); 257 rb.Push<s32>(bsd_errno != Errno::SUCCESS ? -1 : 0);
258 rb.PushEnum(bsd_errno); 258 rb.PushEnum(bsd_errno);
259 rb.Push<u32>(static_cast<u32>(write_buffer.size())); 259 rb.Push<u32>(static_cast<u32>(write_buffer.size()));
@@ -272,7 +272,7 @@ void BSD::GetSockOpt(Kernel::HLERequestContext& ctx) {
272 ctx.WriteBuffer(optval); 272 ctx.WriteBuffer(optval);
273 273
274 IPC::ResponseBuilder rb{ctx, 5}; 274 IPC::ResponseBuilder rb{ctx, 5};
275 rb.Push(RESULT_SUCCESS); 275 rb.Push(ResultSuccess);
276 rb.Push<s32>(-1); 276 rb.Push<s32>(-1);
277 rb.PushEnum(Errno::NOTCONN); 277 rb.PushEnum(Errno::NOTCONN);
278 rb.Push<u32>(static_cast<u32>(optval.size())); 278 rb.Push<u32>(static_cast<u32>(optval.size()));
@@ -299,7 +299,7 @@ void BSD::Fcntl(Kernel::HLERequestContext& ctx) {
299 const auto [ret, bsd_errno] = FcntlImpl(fd, static_cast<FcntlCmd>(cmd), arg); 299 const auto [ret, bsd_errno] = FcntlImpl(fd, static_cast<FcntlCmd>(cmd), arg);
300 300
301 IPC::ResponseBuilder rb{ctx, 4}; 301 IPC::ResponseBuilder rb{ctx, 4};
302 rb.Push(RESULT_SUCCESS); 302 rb.Push(ResultSuccess);
303 rb.Push<s32>(ret); 303 rb.Push<s32>(ret);
304 rb.PushEnum(bsd_errno); 304 rb.PushEnum(bsd_errno);
305} 305}
@@ -822,7 +822,7 @@ bool BSD::IsFileDescriptorValid(s32 fd) const noexcept {
822void BSD::BuildErrnoResponse(Kernel::HLERequestContext& ctx, Errno bsd_errno) const noexcept { 822void BSD::BuildErrnoResponse(Kernel::HLERequestContext& ctx, Errno bsd_errno) const noexcept {
823 IPC::ResponseBuilder rb{ctx, 4}; 823 IPC::ResponseBuilder rb{ctx, 4};
824 824
825 rb.Push(RESULT_SUCCESS); 825 rb.Push(ResultSuccess);
826 rb.Push<s32>(bsd_errno == Errno::SUCCESS ? 0 : -1); 826 rb.Push<s32>(bsd_errno == Errno::SUCCESS ? 0 : -1);
827 rb.PushEnum(bsd_errno); 827 rb.PushEnum(bsd_errno);
828} 828}
diff --git a/src/core/hle/service/sockets/sfdnsres.cpp b/src/core/hle/service/sockets/sfdnsres.cpp
index 5c71f423c..fb6142c49 100644
--- a/src/core/hle/service/sockets/sfdnsres.cpp
+++ b/src/core/hle/service/sockets/sfdnsres.cpp
@@ -46,7 +46,7 @@ void SFDNSRES::GetAddrInfoRequest(Kernel::HLERequestContext& ctx) {
46 parameters.use_nsd_resolve, parameters.unknown, parameters.process_id); 46 parameters.use_nsd_resolve, parameters.unknown, parameters.process_id);
47 47
48 IPC::ResponseBuilder rb{ctx, 2}; 48 IPC::ResponseBuilder rb{ctx, 2};
49 rb.Push(RESULT_SUCCESS); 49 rb.Push(ResultSuccess);
50} 50}
51 51
52} // namespace Service::Sockets 52} // namespace Service::Sockets
diff --git a/src/core/hle/service/spl/module.cpp b/src/core/hle/service/spl/module.cpp
index b1552c3f0..0b5e2b7c3 100644
--- a/src/core/hle/service/spl/module.cpp
+++ b/src/core/hle/service/spl/module.cpp
@@ -36,7 +36,7 @@ void Module::Interface::GetRandomBytes(Kernel::HLERequestContext& ctx) {
36 ctx.WriteBuffer(data); 36 ctx.WriteBuffer(data);
37 37
38 IPC::ResponseBuilder rb{ctx, 2}; 38 IPC::ResponseBuilder rb{ctx, 2};
39 rb.Push(RESULT_SUCCESS); 39 rb.Push(ResultSuccess);
40} 40}
41 41
42void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system) { 42void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system) {
diff --git a/src/core/hle/service/ssl/ssl.cpp b/src/core/hle/service/ssl/ssl.cpp
index 3b072f6bc..921f4d776 100644
--- a/src/core/hle/service/ssl/ssl.cpp
+++ b/src/core/hle/service/ssl/ssl.cpp
@@ -89,14 +89,14 @@ private:
89 parameters.option); 89 parameters.option);
90 90
91 IPC::ResponseBuilder rb{ctx, 2}; 91 IPC::ResponseBuilder rb{ctx, 2};
92 rb.Push(RESULT_SUCCESS); 92 rb.Push(ResultSuccess);
93 } 93 }
94 94
95 void CreateConnection(Kernel::HLERequestContext& ctx) { 95 void CreateConnection(Kernel::HLERequestContext& ctx) {
96 LOG_WARNING(Service_SSL, "(STUBBED) called"); 96 LOG_WARNING(Service_SSL, "(STUBBED) called");
97 97
98 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 98 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
99 rb.Push(RESULT_SUCCESS); 99 rb.Push(ResultSuccess);
100 rb.PushIpcInterface<ISslConnection>(system); 100 rb.PushIpcInterface<ISslConnection>(system);
101 } 101 }
102 102
@@ -110,7 +110,7 @@ private:
110 LOG_WARNING(Service_SSL, "(STUBBED) called, certificate_format={}", certificate_format); 110 LOG_WARNING(Service_SSL, "(STUBBED) called, certificate_format={}", certificate_format);
111 111
112 IPC::ResponseBuilder rb{ctx, 4}; 112 IPC::ResponseBuilder rb{ctx, 4};
113 rb.Push(RESULT_SUCCESS); 113 rb.Push(ResultSuccess);
114 rb.Push(server_id); 114 rb.Push(server_id);
115 } 115 }
116 116
@@ -129,7 +129,7 @@ private:
129 LOG_WARNING(Service_SSL, "(STUBBED) called"); 129 LOG_WARNING(Service_SSL, "(STUBBED) called");
130 130
131 IPC::ResponseBuilder rb{ctx, 4}; 131 IPC::ResponseBuilder rb{ctx, 4};
132 rb.Push(RESULT_SUCCESS); 132 rb.Push(ResultSuccess);
133 rb.Push(client_id); 133 rb.Push(client_id);
134 } 134 }
135}; 135};
@@ -160,7 +160,7 @@ private:
160 LOG_WARNING(Service_SSL, "(STUBBED) called"); 160 LOG_WARNING(Service_SSL, "(STUBBED) called");
161 161
162 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 162 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
163 rb.Push(RESULT_SUCCESS); 163 rb.Push(ResultSuccess);
164 rb.PushIpcInterface<ISslContext>(system); 164 rb.PushIpcInterface<ISslContext>(system);
165 } 165 }
166 166
@@ -171,7 +171,7 @@ private:
171 ssl_version = rp.Pop<u32>(); 171 ssl_version = rp.Pop<u32>();
172 172
173 IPC::ResponseBuilder rb{ctx, 2}; 173 IPC::ResponseBuilder rb{ctx, 2};
174 rb.Push(RESULT_SUCCESS); 174 rb.Push(ResultSuccess);
175 } 175 }
176}; 176};
177 177
diff --git a/src/core/hle/service/time/clock_types.h b/src/core/hle/service/time/clock_types.h
index a9cfe3eb0..392e16863 100644
--- a/src/core/hle/service/time/clock_types.h
+++ b/src/core/hle/service/time/clock_types.h
@@ -32,7 +32,7 @@ struct SteadyClockTimePoint {
32 32
33 span = other.time_point - time_point; 33 span = other.time_point - time_point;
34 34
35 return RESULT_SUCCESS; 35 return ResultSuccess;
36 } 36 }
37 37
38 static SteadyClockTimePoint GetRandom() { 38 static SteadyClockTimePoint GetRandom() {
@@ -101,7 +101,7 @@ struct ClockSnapshot {
101 return ERROR_TIME_MISMATCH; 101 return ERROR_TIME_MISMATCH;
102 } 102 }
103 current_time = steady_clock_time_point.time_point + context.offset; 103 current_time = steady_clock_time_point.time_point + context.offset;
104 return RESULT_SUCCESS; 104 return ResultSuccess;
105 } 105 }
106}; 106};
107static_assert(sizeof(ClockSnapshot) == 0xD0, "ClockSnapshot is incorrect size"); 107static_assert(sizeof(ClockSnapshot) == 0xD0, "ClockSnapshot is incorrect size");
diff --git a/src/core/hle/service/time/local_system_clock_context_writer.h b/src/core/hle/service/time/local_system_clock_context_writer.h
index 490d0ef3e..6be617392 100644
--- a/src/core/hle/service/time/local_system_clock_context_writer.h
+++ b/src/core/hle/service/time/local_system_clock_context_writer.h
@@ -18,7 +18,7 @@ public:
18protected: 18protected:
19 ResultCode Update() override { 19 ResultCode Update() override {
20 shared_memory.UpdateLocalSystemClockContext(context); 20 shared_memory.UpdateLocalSystemClockContext(context);
21 return RESULT_SUCCESS; 21 return ResultSuccess;
22 } 22 }
23 23
24private: 24private:
diff --git a/src/core/hle/service/time/network_system_clock_context_writer.h b/src/core/hle/service/time/network_system_clock_context_writer.h
index e2920b8eb..a54fd7fe1 100644
--- a/src/core/hle/service/time/network_system_clock_context_writer.h
+++ b/src/core/hle/service/time/network_system_clock_context_writer.h
@@ -18,7 +18,7 @@ public:
18protected: 18protected:
19 ResultCode Update() override { 19 ResultCode Update() override {
20 shared_memory.UpdateNetworkSystemClockContext(context); 20 shared_memory.UpdateNetworkSystemClockContext(context);
21 return RESULT_SUCCESS; 21 return ResultSuccess;
22 } 22 }
23 23
24private: 24private:
diff --git a/src/core/hle/service/time/standard_network_system_clock_core.h b/src/core/hle/service/time/standard_network_system_clock_core.h
index 9d0aeaedb..95923a27b 100644
--- a/src/core/hle/service/time/standard_network_system_clock_core.h
+++ b/src/core/hle/service/time/standard_network_system_clock_core.h
@@ -25,13 +25,13 @@ public:
25 25
26 bool IsStandardNetworkSystemClockAccuracySufficient(Core::System& system) const { 26 bool IsStandardNetworkSystemClockAccuracySufficient(Core::System& system) const {
27 SystemClockContext clock_ctx{}; 27 SystemClockContext clock_ctx{};
28 if (GetClockContext(system, clock_ctx) != RESULT_SUCCESS) { 28 if (GetClockContext(system, clock_ctx) != ResultSuccess) {
29 return {}; 29 return {};
30 } 30 }
31 31
32 s64 span{}; 32 s64 span{};
33 if (clock_ctx.steady_time_point.GetSpanBetween( 33 if (clock_ctx.steady_time_point.GetSpanBetween(
34 GetSteadyClockCore().GetCurrentTimePoint(system), span) != RESULT_SUCCESS) { 34 GetSteadyClockCore().GetCurrentTimePoint(system), span) != ResultSuccess) {
35 return {}; 35 return {};
36 } 36 }
37 37
diff --git a/src/core/hle/service/time/standard_user_system_clock_core.cpp b/src/core/hle/service/time/standard_user_system_clock_core.cpp
index 41bc01abd..ef79ab917 100644
--- a/src/core/hle/service/time/standard_user_system_clock_core.cpp
+++ b/src/core/hle/service/time/standard_user_system_clock_core.cpp
@@ -24,20 +24,18 @@ StandardUserSystemClockCore::StandardUserSystemClockCore(
24 24
25ResultCode StandardUserSystemClockCore::SetAutomaticCorrectionEnabled(Core::System& system, 25ResultCode StandardUserSystemClockCore::SetAutomaticCorrectionEnabled(Core::System& system,
26 bool value) { 26 bool value) {
27 if (const ResultCode result{ApplyAutomaticCorrection(system, value)}; 27 if (const ResultCode result{ApplyAutomaticCorrection(system, value)}; result != ResultSuccess) {
28 result != RESULT_SUCCESS) {
29 return result; 28 return result;
30 } 29 }
31 30
32 auto_correction_enabled = value; 31 auto_correction_enabled = value;
33 32
34 return RESULT_SUCCESS; 33 return ResultSuccess;
35} 34}
36 35
37ResultCode StandardUserSystemClockCore::GetClockContext(Core::System& system, 36ResultCode StandardUserSystemClockCore::GetClockContext(Core::System& system,
38 SystemClockContext& ctx) const { 37 SystemClockContext& ctx) const {
39 if (const ResultCode result{ApplyAutomaticCorrection(system, false)}; 38 if (const ResultCode result{ApplyAutomaticCorrection(system, false)}; result != ResultSuccess) {
40 result != RESULT_SUCCESS) {
41 return result; 39 return result;
42 } 40 }
43 41
@@ -57,7 +55,7 @@ ResultCode StandardUserSystemClockCore::SetClockContext(const SystemClockContext
57ResultCode StandardUserSystemClockCore::ApplyAutomaticCorrection(Core::System& system, 55ResultCode StandardUserSystemClockCore::ApplyAutomaticCorrection(Core::System& system,
58 bool value) const { 56 bool value) const {
59 if (auto_correction_enabled == value) { 57 if (auto_correction_enabled == value) {
60 return RESULT_SUCCESS; 58 return ResultSuccess;
61 } 59 }
62 60
63 if (!network_system_clock_core.IsClockSetup(system)) { 61 if (!network_system_clock_core.IsClockSetup(system)) {
@@ -66,13 +64,13 @@ ResultCode StandardUserSystemClockCore::ApplyAutomaticCorrection(Core::System& s
66 64
67 SystemClockContext ctx{}; 65 SystemClockContext ctx{};
68 if (const ResultCode result{network_system_clock_core.GetClockContext(system, ctx)}; 66 if (const ResultCode result{network_system_clock_core.GetClockContext(system, ctx)};
69 result != RESULT_SUCCESS) { 67 result != ResultSuccess) {
70 return result; 68 return result;
71 } 69 }
72 70
73 local_system_clock_core.SetClockContext(ctx); 71 local_system_clock_core.SetClockContext(ctx);
74 72
75 return RESULT_SUCCESS; 73 return ResultSuccess;
76} 74}
77 75
78} // namespace Service::Time::Clock 76} // namespace Service::Time::Clock
diff --git a/src/core/hle/service/time/system_clock_context_update_callback.cpp b/src/core/hle/service/time/system_clock_context_update_callback.cpp
index bca7d869e..f656fab1c 100644
--- a/src/core/hle/service/time/system_clock_context_update_callback.cpp
+++ b/src/core/hle/service/time/system_clock_context_update_callback.cpp
@@ -32,7 +32,7 @@ void SystemClockContextUpdateCallback::BroadcastOperationEvent() {
32} 32}
33 33
34ResultCode SystemClockContextUpdateCallback::Update(const SystemClockContext& value) { 34ResultCode SystemClockContextUpdateCallback::Update(const SystemClockContext& value) {
35 ResultCode result{RESULT_SUCCESS}; 35 ResultCode result{ResultSuccess};
36 36
37 if (NeedUpdate(value)) { 37 if (NeedUpdate(value)) {
38 context = value; 38 context = value;
@@ -40,7 +40,7 @@ ResultCode SystemClockContextUpdateCallback::Update(const SystemClockContext& va
40 40
41 result = Update(); 41 result = Update();
42 42
43 if (result == RESULT_SUCCESS) { 43 if (result == ResultSuccess) {
44 BroadcastOperationEvent(); 44 BroadcastOperationEvent();
45 } 45 }
46 } 46 }
@@ -49,7 +49,7 @@ ResultCode SystemClockContextUpdateCallback::Update(const SystemClockContext& va
49} 49}
50 50
51ResultCode SystemClockContextUpdateCallback::Update() { 51ResultCode SystemClockContextUpdateCallback::Update() {
52 return RESULT_SUCCESS; 52 return ResultSuccess;
53} 53}
54 54
55} // namespace Service::Time::Clock 55} // namespace Service::Time::Clock
diff --git a/src/core/hle/service/time/system_clock_core.cpp b/src/core/hle/service/time/system_clock_core.cpp
index 2ef442b56..bd334bbef 100644
--- a/src/core/hle/service/time/system_clock_core.cpp
+++ b/src/core/hle/service/time/system_clock_core.cpp
@@ -21,7 +21,7 @@ ResultCode SystemClockCore::GetCurrentTime(Core::System& system, s64& posix_time
21 const SteadyClockTimePoint current_time_point{steady_clock_core.GetCurrentTimePoint(system)}; 21 const SteadyClockTimePoint current_time_point{steady_clock_core.GetCurrentTimePoint(system)};
22 22
23 SystemClockContext clock_context{}; 23 SystemClockContext clock_context{};
24 if (const ResultCode result{GetClockContext(system, clock_context)}; result != RESULT_SUCCESS) { 24 if (const ResultCode result{GetClockContext(system, clock_context)}; result != ResultSuccess) {
25 return result; 25 return result;
26 } 26 }
27 27
@@ -31,7 +31,7 @@ ResultCode SystemClockCore::GetCurrentTime(Core::System& system, s64& posix_time
31 31
32 posix_time = clock_context.offset + current_time_point.time_point; 32 posix_time = clock_context.offset + current_time_point.time_point;
33 33
34 return RESULT_SUCCESS; 34 return ResultSuccess;
35} 35}
36 36
37ResultCode SystemClockCore::SetCurrentTime(Core::System& system, s64 posix_time) { 37ResultCode SystemClockCore::SetCurrentTime(Core::System& system, s64 posix_time) {
@@ -39,7 +39,7 @@ ResultCode SystemClockCore::SetCurrentTime(Core::System& system, s64 posix_time)
39 const SystemClockContext clock_context{posix_time - current_time_point.time_point, 39 const SystemClockContext clock_context{posix_time - current_time_point.time_point,
40 current_time_point}; 40 current_time_point};
41 41
42 if (const ResultCode result{SetClockContext(clock_context)}; result != RESULT_SUCCESS) { 42 if (const ResultCode result{SetClockContext(clock_context)}; result != ResultSuccess) {
43 return result; 43 return result;
44 } 44 }
45 return Flush(clock_context); 45 return Flush(clock_context);
@@ -47,13 +47,13 @@ ResultCode SystemClockCore::SetCurrentTime(Core::System& system, s64 posix_time)
47 47
48ResultCode SystemClockCore::Flush(const SystemClockContext& clock_context) { 48ResultCode SystemClockCore::Flush(const SystemClockContext& clock_context) {
49 if (!system_clock_context_update_callback) { 49 if (!system_clock_context_update_callback) {
50 return RESULT_SUCCESS; 50 return ResultSuccess;
51 } 51 }
52 return system_clock_context_update_callback->Update(clock_context); 52 return system_clock_context_update_callback->Update(clock_context);
53} 53}
54 54
55ResultCode SystemClockCore::SetSystemClockContext(const SystemClockContext& clock_context) { 55ResultCode SystemClockCore::SetSystemClockContext(const SystemClockContext& clock_context) {
56 if (const ResultCode result{SetClockContext(clock_context)}; result != RESULT_SUCCESS) { 56 if (const ResultCode result{SetClockContext(clock_context)}; result != ResultSuccess) {
57 return result; 57 return result;
58 } 58 }
59 return Flush(clock_context); 59 return Flush(clock_context);
@@ -61,7 +61,7 @@ ResultCode SystemClockCore::SetSystemClockContext(const SystemClockContext& cloc
61 61
62bool SystemClockCore::IsClockSetup(Core::System& system) const { 62bool SystemClockCore::IsClockSetup(Core::System& system) const {
63 SystemClockContext value{}; 63 SystemClockContext value{};
64 if (GetClockContext(system, value) == RESULT_SUCCESS) { 64 if (GetClockContext(system, value) == ResultSuccess) {
65 const SteadyClockTimePoint steady_clock_time_point{ 65 const SteadyClockTimePoint steady_clock_time_point{
66 steady_clock_core.GetCurrentTimePoint(system)}; 66 steady_clock_core.GetCurrentTimePoint(system)};
67 return steady_clock_time_point.clock_source_id == value.steady_time_point.clock_source_id; 67 return steady_clock_time_point.clock_source_id == value.steady_time_point.clock_source_id;
diff --git a/src/core/hle/service/time/system_clock_core.h b/src/core/hle/service/time/system_clock_core.h
index b8e6122bf..83d0e5d62 100644
--- a/src/core/hle/service/time/system_clock_core.h
+++ b/src/core/hle/service/time/system_clock_core.h
@@ -35,12 +35,12 @@ public:
35 virtual ResultCode GetClockContext([[maybe_unused]] Core::System& system, 35 virtual ResultCode GetClockContext([[maybe_unused]] Core::System& system,
36 SystemClockContext& value) const { 36 SystemClockContext& value) const {
37 value = context; 37 value = context;
38 return RESULT_SUCCESS; 38 return ResultSuccess;
39 } 39 }
40 40
41 virtual ResultCode SetClockContext(const SystemClockContext& value) { 41 virtual ResultCode SetClockContext(const SystemClockContext& value) {
42 context = value; 42 context = value;
43 return RESULT_SUCCESS; 43 return ResultSuccess;
44 } 44 }
45 45
46 virtual ResultCode Flush(const SystemClockContext& clock_context); 46 virtual ResultCode Flush(const SystemClockContext& clock_context);
diff --git a/src/core/hle/service/time/time.cpp b/src/core/hle/service/time/time.cpp
index e7991012b..d6f710eba 100644
--- a/src/core/hle/service/time/time.cpp
+++ b/src/core/hle/service/time/time.cpp
@@ -54,7 +54,7 @@ private:
54 } 54 }
55 55
56 IPC::ResponseBuilder rb{ctx, 4}; 56 IPC::ResponseBuilder rb{ctx, 4};
57 rb.Push(RESULT_SUCCESS); 57 rb.Push(ResultSuccess);
58 rb.Push<s64>(posix_time); 58 rb.Push<s64>(posix_time);
59 } 59 }
60 60
@@ -76,7 +76,7 @@ private:
76 } 76 }
77 77
78 IPC::ResponseBuilder rb{ctx, sizeof(Clock::SystemClockContext) / 4 + 2}; 78 IPC::ResponseBuilder rb{ctx, sizeof(Clock::SystemClockContext) / 4 + 2};
79 rb.Push(RESULT_SUCCESS); 79 rb.Push(ResultSuccess);
80 rb.PushRaw(system_clock_context); 80 rb.PushRaw(system_clock_context);
81 } 81 }
82 82
@@ -112,7 +112,7 @@ private:
112 112
113 const Clock::SteadyClockTimePoint time_point{clock_core.GetCurrentTimePoint(system)}; 113 const Clock::SteadyClockTimePoint time_point{clock_core.GetCurrentTimePoint(system)};
114 IPC::ResponseBuilder rb{ctx, (sizeof(Clock::SteadyClockTimePoint) / 4) + 2}; 114 IPC::ResponseBuilder rb{ctx, (sizeof(Clock::SteadyClockTimePoint) / 4) + 2};
115 rb.Push(RESULT_SUCCESS); 115 rb.Push(ResultSuccess);
116 rb.PushRaw(time_point); 116 rb.PushRaw(time_point);
117 } 117 }
118 118
@@ -135,7 +135,7 @@ ResultCode Module::Interface::GetClockSnapshotFromSystemClockContextInternal(
135 if (const ResultCode result{ 135 if (const ResultCode result{
136 time_manager.GetTimeZoneContentManager().GetTimeZoneManager().GetDeviceLocationName( 136 time_manager.GetTimeZoneContentManager().GetTimeZoneManager().GetDeviceLocationName(
137 clock_snapshot.location_name)}; 137 clock_snapshot.location_name)};
138 result != RESULT_SUCCESS) { 138 result != ResultSuccess) {
139 return result; 139 return result;
140 } 140 }
141 141
@@ -144,7 +144,7 @@ ResultCode Module::Interface::GetClockSnapshotFromSystemClockContextInternal(
144 if (const ResultCode result{Clock::ClockSnapshot::GetCurrentTime( 144 if (const ResultCode result{Clock::ClockSnapshot::GetCurrentTime(
145 clock_snapshot.user_time, clock_snapshot.steady_clock_time_point, 145 clock_snapshot.user_time, clock_snapshot.steady_clock_time_point,
146 clock_snapshot.user_context)}; 146 clock_snapshot.user_context)};
147 result != RESULT_SUCCESS) { 147 result != ResultSuccess) {
148 return result; 148 return result;
149 } 149 }
150 150
@@ -152,7 +152,7 @@ ResultCode Module::Interface::GetClockSnapshotFromSystemClockContextInternal(
152 if (const ResultCode result{ 152 if (const ResultCode result{
153 time_manager.GetTimeZoneContentManager().GetTimeZoneManager().ToCalendarTimeWithMyRules( 153 time_manager.GetTimeZoneContentManager().GetTimeZoneManager().ToCalendarTimeWithMyRules(
154 clock_snapshot.user_time, userCalendarInfo)}; 154 clock_snapshot.user_time, userCalendarInfo)};
155 result != RESULT_SUCCESS) { 155 result != ResultSuccess) {
156 return result; 156 return result;
157 } 157 }
158 158
@@ -163,7 +163,7 @@ ResultCode Module::Interface::GetClockSnapshotFromSystemClockContextInternal(
163 163
164 if (Clock::ClockSnapshot::GetCurrentTime(clock_snapshot.network_time, 164 if (Clock::ClockSnapshot::GetCurrentTime(clock_snapshot.network_time,
165 clock_snapshot.steady_clock_time_point, 165 clock_snapshot.steady_clock_time_point,
166 clock_snapshot.network_context) != RESULT_SUCCESS) { 166 clock_snapshot.network_context) != ResultSuccess) {
167 clock_snapshot.network_time = 0; 167 clock_snapshot.network_time = 0;
168 } 168 }
169 169
@@ -171,20 +171,20 @@ ResultCode Module::Interface::GetClockSnapshotFromSystemClockContextInternal(
171 if (const ResultCode result{ 171 if (const ResultCode result{
172 time_manager.GetTimeZoneContentManager().GetTimeZoneManager().ToCalendarTimeWithMyRules( 172 time_manager.GetTimeZoneContentManager().GetTimeZoneManager().ToCalendarTimeWithMyRules(
173 clock_snapshot.network_time, networkCalendarInfo)}; 173 clock_snapshot.network_time, networkCalendarInfo)};
174 result != RESULT_SUCCESS) { 174 result != ResultSuccess) {
175 return result; 175 return result;
176 } 176 }
177 177
178 clock_snapshot.network_calendar_time = networkCalendarInfo.time; 178 clock_snapshot.network_calendar_time = networkCalendarInfo.time;
179 clock_snapshot.network_calendar_additional_time = networkCalendarInfo.additional_info; 179 clock_snapshot.network_calendar_additional_time = networkCalendarInfo.additional_info;
180 180
181 return RESULT_SUCCESS; 181 return ResultSuccess;
182} 182}
183 183
184void Module::Interface::GetStandardUserSystemClock(Kernel::HLERequestContext& ctx) { 184void Module::Interface::GetStandardUserSystemClock(Kernel::HLERequestContext& ctx) {
185 LOG_DEBUG(Service_Time, "called"); 185 LOG_DEBUG(Service_Time, "called");
186 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 186 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
187 rb.Push(RESULT_SUCCESS); 187 rb.Push(ResultSuccess);
188 rb.PushIpcInterface<ISystemClock>(system.GetTimeManager().GetStandardUserSystemClockCore(), 188 rb.PushIpcInterface<ISystemClock>(system.GetTimeManager().GetStandardUserSystemClockCore(),
189 system); 189 system);
190} 190}
@@ -192,7 +192,7 @@ void Module::Interface::GetStandardUserSystemClock(Kernel::HLERequestContext& ct
192void Module::Interface::GetStandardNetworkSystemClock(Kernel::HLERequestContext& ctx) { 192void Module::Interface::GetStandardNetworkSystemClock(Kernel::HLERequestContext& ctx) {
193 LOG_DEBUG(Service_Time, "called"); 193 LOG_DEBUG(Service_Time, "called");
194 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 194 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
195 rb.Push(RESULT_SUCCESS); 195 rb.Push(ResultSuccess);
196 rb.PushIpcInterface<ISystemClock>(system.GetTimeManager().GetStandardNetworkSystemClockCore(), 196 rb.PushIpcInterface<ISystemClock>(system.GetTimeManager().GetStandardNetworkSystemClockCore(),
197 system); 197 system);
198} 198}
@@ -200,14 +200,14 @@ void Module::Interface::GetStandardNetworkSystemClock(Kernel::HLERequestContext&
200void Module::Interface::GetStandardSteadyClock(Kernel::HLERequestContext& ctx) { 200void Module::Interface::GetStandardSteadyClock(Kernel::HLERequestContext& ctx) {
201 LOG_DEBUG(Service_Time, "called"); 201 LOG_DEBUG(Service_Time, "called");
202 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 202 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
203 rb.Push(RESULT_SUCCESS); 203 rb.Push(ResultSuccess);
204 rb.PushIpcInterface<ISteadyClock>(system.GetTimeManager().GetStandardSteadyClockCore(), system); 204 rb.PushIpcInterface<ISteadyClock>(system.GetTimeManager().GetStandardSteadyClockCore(), system);
205} 205}
206 206
207void Module::Interface::GetTimeZoneService(Kernel::HLERequestContext& ctx) { 207void Module::Interface::GetTimeZoneService(Kernel::HLERequestContext& ctx) {
208 LOG_DEBUG(Service_Time, "called"); 208 LOG_DEBUG(Service_Time, "called");
209 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 209 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
210 rb.Push(RESULT_SUCCESS); 210 rb.Push(ResultSuccess);
211 rb.PushIpcInterface<ITimeZoneService>(system, 211 rb.PushIpcInterface<ITimeZoneService>(system,
212 system.GetTimeManager().GetTimeZoneContentManager()); 212 system.GetTimeManager().GetTimeZoneContentManager());
213} 213}
@@ -215,7 +215,7 @@ void Module::Interface::GetTimeZoneService(Kernel::HLERequestContext& ctx) {
215void Module::Interface::GetStandardLocalSystemClock(Kernel::HLERequestContext& ctx) { 215void Module::Interface::GetStandardLocalSystemClock(Kernel::HLERequestContext& ctx) {
216 LOG_DEBUG(Service_Time, "called"); 216 LOG_DEBUG(Service_Time, "called");
217 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 217 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
218 rb.Push(RESULT_SUCCESS); 218 rb.Push(ResultSuccess);
219 rb.PushIpcInterface<ISystemClock>(system.GetTimeManager().GetStandardLocalSystemClockCore(), 219 rb.PushIpcInterface<ISystemClock>(system.GetTimeManager().GetStandardLocalSystemClockCore(),
220 system); 220 system);
221} 221}
@@ -225,7 +225,7 @@ void Module::Interface::IsStandardNetworkSystemClockAccuracySufficient(
225 LOG_DEBUG(Service_Time, "called"); 225 LOG_DEBUG(Service_Time, "called");
226 auto& clock_core{system.GetTimeManager().GetStandardNetworkSystemClockCore()}; 226 auto& clock_core{system.GetTimeManager().GetStandardNetworkSystemClockCore()};
227 IPC::ResponseBuilder rb{ctx, 3}; 227 IPC::ResponseBuilder rb{ctx, 3};
228 rb.Push(RESULT_SUCCESS); 228 rb.Push(ResultSuccess);
229 rb.Push<u32>(clock_core.IsStandardNetworkSystemClockAccuracySufficient(system)); 229 rb.Push<u32>(clock_core.IsStandardNetworkSystemClockAccuracySufficient(system));
230} 230}
231 231
@@ -249,7 +249,7 @@ void Module::Interface::CalculateMonotonicSystemClockBaseTimePoint(Kernel::HLERe
249 const s64 base_time_point{context.offset + current_time_point.time_point - 249 const s64 base_time_point{context.offset + current_time_point.time_point -
250 ticks.ToSeconds()}; 250 ticks.ToSeconds()};
251 IPC::ResponseBuilder rb{ctx, (sizeof(s64) / 4) + 2}; 251 IPC::ResponseBuilder rb{ctx, (sizeof(s64) / 4) + 2};
252 rb.Push(RESULT_SUCCESS); 252 rb.Push(ResultSuccess);
253 rb.PushRaw(base_time_point); 253 rb.PushRaw(base_time_point);
254 return; 254 return;
255 } 255 }
@@ -296,7 +296,7 @@ void Module::Interface::GetClockSnapshot(Kernel::HLERequestContext& ctx) {
296 ctx.WriteBuffer(clock_snapshot); 296 ctx.WriteBuffer(clock_snapshot);
297 297
298 IPC::ResponseBuilder rb{ctx, 2}; 298 IPC::ResponseBuilder rb{ctx, 2};
299 rb.Push(RESULT_SUCCESS); 299 rb.Push(ResultSuccess);
300} 300}
301 301
302void Module::Interface::GetClockSnapshotFromSystemClockContext(Kernel::HLERequestContext& ctx) { 302void Module::Interface::GetClockSnapshotFromSystemClockContext(Kernel::HLERequestContext& ctx) {
@@ -313,7 +313,7 @@ void Module::Interface::GetClockSnapshotFromSystemClockContext(Kernel::HLEReques
313 Clock::ClockSnapshot clock_snapshot{}; 313 Clock::ClockSnapshot clock_snapshot{};
314 if (const ResultCode result{GetClockSnapshotFromSystemClockContextInternal( 314 if (const ResultCode result{GetClockSnapshotFromSystemClockContextInternal(
315 &ctx.GetThread(), user_context, network_context, type, clock_snapshot)}; 315 &ctx.GetThread(), user_context, network_context, type, clock_snapshot)};
316 result != RESULT_SUCCESS) { 316 result != ResultSuccess) {
317 IPC::ResponseBuilder rb{ctx, 2}; 317 IPC::ResponseBuilder rb{ctx, 2};
318 rb.Push(result); 318 rb.Push(result);
319 return; 319 return;
@@ -322,7 +322,7 @@ void Module::Interface::GetClockSnapshotFromSystemClockContext(Kernel::HLEReques
322 ctx.WriteBuffer(clock_snapshot); 322 ctx.WriteBuffer(clock_snapshot);
323 323
324 IPC::ResponseBuilder rb{ctx, 2}; 324 IPC::ResponseBuilder rb{ctx, 2};
325 rb.Push(RESULT_SUCCESS); 325 rb.Push(ResultSuccess);
326} 326}
327 327
328void Module::Interface::CalculateStandardUserSystemClockDifferenceByUser( 328void Module::Interface::CalculateStandardUserSystemClockDifferenceByUser(
@@ -349,7 +349,7 @@ void Module::Interface::CalculateStandardUserSystemClockDifferenceByUser(
349 } 349 }
350 350
351 IPC::ResponseBuilder rb{ctx, (sizeof(s64) / 4) + 2}; 351 IPC::ResponseBuilder rb{ctx, (sizeof(s64) / 4) + 2};
352 rb.Push(RESULT_SUCCESS); 352 rb.Push(ResultSuccess);
353 rb.PushRaw(time_span_type.nanoseconds); 353 rb.PushRaw(time_span_type.nanoseconds);
354} 354}
355 355
@@ -370,7 +370,7 @@ void Module::Interface::CalculateSpanBetween(Kernel::HLERequestContext& ctx) {
370 370
371 if (const ResultCode result{snapshot_a.steady_clock_time_point.GetSpanBetween( 371 if (const ResultCode result{snapshot_a.steady_clock_time_point.GetSpanBetween(
372 snapshot_b.steady_clock_time_point, span)}; 372 snapshot_b.steady_clock_time_point, span)};
373 result != RESULT_SUCCESS) { 373 result != ResultSuccess) {
374 if (snapshot_a.network_time && snapshot_b.network_time) { 374 if (snapshot_a.network_time && snapshot_b.network_time) {
375 time_span_type = 375 time_span_type =
376 Clock::TimeSpanType::FromSeconds(snapshot_b.network_time - snapshot_a.network_time); 376 Clock::TimeSpanType::FromSeconds(snapshot_b.network_time - snapshot_a.network_time);
@@ -384,14 +384,14 @@ void Module::Interface::CalculateSpanBetween(Kernel::HLERequestContext& ctx) {
384 } 384 }
385 385
386 IPC::ResponseBuilder rb{ctx, (sizeof(s64) / 4) + 2}; 386 IPC::ResponseBuilder rb{ctx, (sizeof(s64) / 4) + 2};
387 rb.Push(RESULT_SUCCESS); 387 rb.Push(ResultSuccess);
388 rb.PushRaw(time_span_type.nanoseconds); 388 rb.PushRaw(time_span_type.nanoseconds);
389} 389}
390 390
391void Module::Interface::GetSharedMemoryNativeHandle(Kernel::HLERequestContext& ctx) { 391void Module::Interface::GetSharedMemoryNativeHandle(Kernel::HLERequestContext& ctx) {
392 LOG_DEBUG(Service_Time, "called"); 392 LOG_DEBUG(Service_Time, "called");
393 IPC::ResponseBuilder rb{ctx, 2, 1}; 393 IPC::ResponseBuilder rb{ctx, 2, 1};
394 rb.Push(RESULT_SUCCESS); 394 rb.Push(ResultSuccess);
395 rb.PushCopyObjects(&system.Kernel().GetTimeSharedMem()); 395 rb.PushCopyObjects(&system.Kernel().GetTimeSharedMem());
396} 396}
397 397
diff --git a/src/core/hle/service/time/time_manager.cpp b/src/core/hle/service/time/time_manager.cpp
index 4f9684de8..4bbc606a1 100644
--- a/src/core/hle/service/time/time_manager.cpp
+++ b/src/core/hle/service/time/time_manager.cpp
@@ -108,7 +108,7 @@ struct TimeManager::Impl final {
108 std::size_t total_location_name_count, u128 time_zone_rule_version, 108 std::size_t total_location_name_count, u128 time_zone_rule_version,
109 FileSys::VirtualFile& vfs_file) { 109 FileSys::VirtualFile& vfs_file) {
110 if (time_zone_content_manager.GetTimeZoneManager().SetDeviceLocationNameWithTimeZoneRule( 110 if (time_zone_content_manager.GetTimeZoneManager().SetDeviceLocationNameWithTimeZoneRule(
111 location_name, vfs_file) != RESULT_SUCCESS) { 111 location_name, vfs_file) != ResultSuccess) {
112 UNREACHABLE(); 112 UNREACHABLE();
113 return; 113 return;
114 } 114 }
@@ -152,7 +152,7 @@ struct TimeManager::Impl final {
152 standard_local_system_clock_core.SetSystemClockContext(clock_context); 152 standard_local_system_clock_core.SetSystemClockContext(clock_context);
153 } else { 153 } else {
154 if (standard_local_system_clock_core.SetCurrentTime(system_, posix_time) != 154 if (standard_local_system_clock_core.SetCurrentTime(system_, posix_time) !=
155 RESULT_SUCCESS) { 155 ResultSuccess) {
156 UNREACHABLE(); 156 UNREACHABLE();
157 return; 157 return;
158 } 158 }
@@ -167,7 +167,7 @@ struct TimeManager::Impl final {
167 network_system_clock_context_writer); 167 network_system_clock_context_writer);
168 168
169 if (standard_network_system_clock_core.SetSystemClockContext(clock_context) != 169 if (standard_network_system_clock_core.SetSystemClockContext(clock_context) !=
170 RESULT_SUCCESS) { 170 ResultSuccess) {
171 UNREACHABLE(); 171 UNREACHABLE();
172 return; 172 return;
173 } 173 }
@@ -180,7 +180,7 @@ struct TimeManager::Impl final {
180 void SetupStandardUserSystemClock(Core::System& system_, bool is_automatic_correction_enabled, 180 void SetupStandardUserSystemClock(Core::System& system_, bool is_automatic_correction_enabled,
181 Clock::SteadyClockTimePoint steady_clock_time_point) { 181 Clock::SteadyClockTimePoint steady_clock_time_point) {
182 if (standard_user_system_clock_core.SetAutomaticCorrectionEnabled( 182 if (standard_user_system_clock_core.SetAutomaticCorrectionEnabled(
183 system_, is_automatic_correction_enabled) != RESULT_SUCCESS) { 183 system_, is_automatic_correction_enabled) != ResultSuccess) {
184 UNREACHABLE(); 184 UNREACHABLE();
185 return; 185 return;
186 } 186 }
diff --git a/src/core/hle/service/time/time_zone_content_manager.cpp b/src/core/hle/service/time/time_zone_content_manager.cpp
index 57f71e6f0..bf4402308 100644
--- a/src/core/hle/service/time/time_zone_content_manager.cpp
+++ b/src/core/hle/service/time/time_zone_content_manager.cpp
@@ -81,7 +81,7 @@ void TimeZoneContentManager::Initialize(TimeManager& time_manager) {
81 } 81 }
82 82
83 if (FileSys::VirtualFile vfs_file; 83 if (FileSys::VirtualFile vfs_file;
84 GetTimeZoneInfoFile(location_name, vfs_file) == RESULT_SUCCESS) { 84 GetTimeZoneInfoFile(location_name, vfs_file) == ResultSuccess) {
85 const auto time_point{ 85 const auto time_point{
86 time_manager.GetStandardSteadyClockCore().GetCurrentTimePoint(system)}; 86 time_manager.GetStandardSteadyClockCore().GetCurrentTimePoint(system)};
87 time_manager.SetupTimeZoneManager(location_name, time_point, location_name_cache.size(), {}, 87 time_manager.SetupTimeZoneManager(location_name, time_point, location_name_cache.size(), {},
@@ -95,7 +95,7 @@ ResultCode TimeZoneContentManager::LoadTimeZoneRule(TimeZoneRule& rules,
95 const std::string& location_name) const { 95 const std::string& location_name) const {
96 FileSys::VirtualFile vfs_file; 96 FileSys::VirtualFile vfs_file;
97 if (const ResultCode result{GetTimeZoneInfoFile(location_name, vfs_file)}; 97 if (const ResultCode result{GetTimeZoneInfoFile(location_name, vfs_file)};
98 result != RESULT_SUCCESS) { 98 result != ResultSuccess) {
99 return result; 99 return result;
100 } 100 }
101 101
@@ -138,7 +138,7 @@ ResultCode TimeZoneContentManager::GetTimeZoneInfoFile(const std::string& locati
138 return ERROR_TIME_NOT_FOUND; 138 return ERROR_TIME_NOT_FOUND;
139 } 139 }
140 140
141 return RESULT_SUCCESS; 141 return ResultSuccess;
142} 142}
143 143
144} // namespace Service::Time::TimeZone 144} // namespace Service::Time::TimeZone
diff --git a/src/core/hle/service/time/time_zone_manager.cpp b/src/core/hle/service/time/time_zone_manager.cpp
index 3032ca193..6da893790 100644
--- a/src/core/hle/service/time/time_zone_manager.cpp
+++ b/src/core/hle/service/time/time_zone_manager.cpp
@@ -742,7 +742,7 @@ static ResultCode CreateCalendarTime(s64 time, int gmt_offset, CalendarTimeInter
742 calendar_additional_info.is_dst = false; 742 calendar_additional_info.is_dst = false;
743 calendar_additional_info.gmt_offset = gmt_offset; 743 calendar_additional_info.gmt_offset = gmt_offset;
744 744
745 return RESULT_SUCCESS; 745 return ResultSuccess;
746} 746}
747 747
748static ResultCode ToCalendarTimeInternal(const TimeZoneRule& rules, s64 time, 748static ResultCode ToCalendarTimeInternal(const TimeZoneRule& rules, s64 time,
@@ -772,7 +772,7 @@ static ResultCode ToCalendarTimeInternal(const TimeZoneRule& rules, s64 time,
772 } 772 }
773 if (const ResultCode result{ 773 if (const ResultCode result{
774 ToCalendarTimeInternal(rules, new_time, calendar_time, calendar_additional_info)}; 774 ToCalendarTimeInternal(rules, new_time, calendar_time, calendar_additional_info)};
775 result != RESULT_SUCCESS) { 775 result != ResultSuccess) {
776 return result; 776 return result;
777 } 777 }
778 if (time < rules.ats[0]) { 778 if (time < rules.ats[0]) {
@@ -781,7 +781,7 @@ static ResultCode ToCalendarTimeInternal(const TimeZoneRule& rules, s64 time,
781 calendar_time.year += years; 781 calendar_time.year += years;
782 } 782 }
783 783
784 return RESULT_SUCCESS; 784 return ResultSuccess;
785 } 785 }
786 786
787 s32 tti_index{}; 787 s32 tti_index{};
@@ -803,7 +803,7 @@ static ResultCode ToCalendarTimeInternal(const TimeZoneRule& rules, s64 time,
803 803
804 if (const ResultCode result{CreateCalendarTime(time, rules.ttis[tti_index].gmt_offset, 804 if (const ResultCode result{CreateCalendarTime(time, rules.ttis[tti_index].gmt_offset,
805 calendar_time, calendar_additional_info)}; 805 calendar_time, calendar_additional_info)};
806 result != RESULT_SUCCESS) { 806 result != ResultSuccess) {
807 return result; 807 return result;
808 } 808 }
809 809
@@ -812,7 +812,7 @@ static ResultCode ToCalendarTimeInternal(const TimeZoneRule& rules, s64 time,
812 for (int index{}; time_zone[index] != '\0'; ++index) { 812 for (int index{}; time_zone[index] != '\0'; ++index) {
813 calendar_additional_info.timezone_name[index] = time_zone[index]; 813 calendar_additional_info.timezone_name[index] = time_zone[index];
814 } 814 }
815 return RESULT_SUCCESS; 815 return ResultSuccess;
816} 816}
817 817
818static ResultCode ToCalendarTimeImpl(const TimeZoneRule& rules, s64 time, CalendarInfo& calendar) { 818static ResultCode ToCalendarTimeImpl(const TimeZoneRule& rules, s64 time, CalendarInfo& calendar) {
@@ -845,14 +845,14 @@ ResultCode TimeZoneManager::SetDeviceLocationNameWithTimeZoneRule(const std::str
845 if (ParseTimeZoneBinary(rule, vfs_file)) { 845 if (ParseTimeZoneBinary(rule, vfs_file)) {
846 device_location_name = location_name; 846 device_location_name = location_name;
847 time_zone_rule = rule; 847 time_zone_rule = rule;
848 return RESULT_SUCCESS; 848 return ResultSuccess;
849 } 849 }
850 return ERROR_TIME_ZONE_CONVERSION_FAILED; 850 return ERROR_TIME_ZONE_CONVERSION_FAILED;
851} 851}
852 852
853ResultCode TimeZoneManager::SetUpdatedTime(const Clock::SteadyClockTimePoint& value) { 853ResultCode TimeZoneManager::SetUpdatedTime(const Clock::SteadyClockTimePoint& value) {
854 time_zone_update_time_point = value; 854 time_zone_update_time_point = value;
855 return RESULT_SUCCESS; 855 return ResultSuccess;
856} 856}
857 857
858ResultCode TimeZoneManager::ToCalendarTimeWithMyRules(s64 time, CalendarInfo& calendar) const { 858ResultCode TimeZoneManager::ToCalendarTimeWithMyRules(s64 time, CalendarInfo& calendar) const {
@@ -868,7 +868,7 @@ ResultCode TimeZoneManager::ParseTimeZoneRuleBinary(TimeZoneRule& rules,
868 if (!ParseTimeZoneBinary(rules, vfs_file)) { 868 if (!ParseTimeZoneBinary(rules, vfs_file)) {
869 return ERROR_TIME_ZONE_CONVERSION_FAILED; 869 return ERROR_TIME_ZONE_CONVERSION_FAILED;
870 } 870 }
871 return RESULT_SUCCESS; 871 return ResultSuccess;
872} 872}
873 873
874ResultCode TimeZoneManager::ToPosixTime(const TimeZoneRule& rules, 874ResultCode TimeZoneManager::ToPosixTime(const TimeZoneRule& rules,
@@ -981,7 +981,7 @@ ResultCode TimeZoneManager::ToPosixTime(const TimeZoneRule& rules,
981 CalendarTimeInternal candidate_calendar_time{}; 981 CalendarTimeInternal candidate_calendar_time{};
982 CalendarAdditionalInfo unused{}; 982 CalendarAdditionalInfo unused{};
983 if (ToCalendarTimeInternal(rules, pivot, candidate_calendar_time, unused) != 983 if (ToCalendarTimeInternal(rules, pivot, candidate_calendar_time, unused) !=
984 RESULT_SUCCESS) { 984 ResultSuccess) {
985 if (pivot > 0) { 985 if (pivot > 0) {
986 direction = 1; 986 direction = 1;
987 } else { 987 } else {
@@ -1021,7 +1021,7 @@ ResultCode TimeZoneManager::ToPosixTime(const TimeZoneRule& rules,
1021 } 1021 }
1022 } 1022 }
1023 } 1023 }
1024 return RESULT_SUCCESS; 1024 return ResultSuccess;
1025} 1025}
1026 1026
1027ResultCode TimeZoneManager::ToPosixTimeWithMyRule(const CalendarTime& calendar_time, 1027ResultCode TimeZoneManager::ToPosixTimeWithMyRule(const CalendarTime& calendar_time,
@@ -1038,7 +1038,7 @@ ResultCode TimeZoneManager::GetDeviceLocationName(LocationName& value) const {
1038 return ERROR_UNINITIALIZED_CLOCK; 1038 return ERROR_UNINITIALIZED_CLOCK;
1039 } 1039 }
1040 std::memcpy(value.data(), device_location_name.c_str(), device_location_name.size()); 1040 std::memcpy(value.data(), device_location_name.c_str(), device_location_name.size());
1041 return RESULT_SUCCESS; 1041 return ResultSuccess;
1042} 1042}
1043 1043
1044} // namespace Service::Time::TimeZone 1044} // namespace Service::Time::TimeZone
diff --git a/src/core/hle/service/time/time_zone_service.cpp b/src/core/hle/service/time/time_zone_service.cpp
index 19d7a1a0c..5c3108768 100644
--- a/src/core/hle/service/time/time_zone_service.cpp
+++ b/src/core/hle/service/time/time_zone_service.cpp
@@ -35,14 +35,14 @@ void ITimeZoneService::GetDeviceLocationName(Kernel::HLERequestContext& ctx) {
35 TimeZone::LocationName location_name{}; 35 TimeZone::LocationName location_name{};
36 if (const ResultCode result{ 36 if (const ResultCode result{
37 time_zone_content_manager.GetTimeZoneManager().GetDeviceLocationName(location_name)}; 37 time_zone_content_manager.GetTimeZoneManager().GetDeviceLocationName(location_name)};
38 result != RESULT_SUCCESS) { 38 result != ResultSuccess) {
39 IPC::ResponseBuilder rb{ctx, 2}; 39 IPC::ResponseBuilder rb{ctx, 2};
40 rb.Push(result); 40 rb.Push(result);
41 return; 41 return;
42 } 42 }
43 43
44 IPC::ResponseBuilder rb{ctx, (sizeof(location_name) / 4) + 2}; 44 IPC::ResponseBuilder rb{ctx, (sizeof(location_name) / 4) + 2};
45 rb.Push(RESULT_SUCCESS); 45 rb.Push(ResultSuccess);
46 rb.PushRaw(location_name); 46 rb.PushRaw(location_name);
47} 47}
48 48
@@ -64,7 +64,7 @@ void ITimeZoneService::LoadTimeZoneRule(Kernel::HLERequestContext& ctx) {
64 TimeZone::TimeZoneRule time_zone_rule{}; 64 TimeZone::TimeZoneRule time_zone_rule{};
65 if (const ResultCode result{ 65 if (const ResultCode result{
66 time_zone_content_manager.LoadTimeZoneRule(time_zone_rule, location_name)}; 66 time_zone_content_manager.LoadTimeZoneRule(time_zone_rule, location_name)};
67 result != RESULT_SUCCESS) { 67 result != ResultSuccess) {
68 IPC::ResponseBuilder rb{ctx, 2}; 68 IPC::ResponseBuilder rb{ctx, 2};
69 rb.Push(result); 69 rb.Push(result);
70 return; 70 return;
@@ -75,7 +75,7 @@ void ITimeZoneService::LoadTimeZoneRule(Kernel::HLERequestContext& ctx) {
75 ctx.WriteBuffer(time_zone_rule_outbuffer); 75 ctx.WriteBuffer(time_zone_rule_outbuffer);
76 76
77 IPC::ResponseBuilder rb{ctx, 2}; 77 IPC::ResponseBuilder rb{ctx, 2};
78 rb.Push(RESULT_SUCCESS); 78 rb.Push(ResultSuccess);
79} 79}
80 80
81void ITimeZoneService::ToCalendarTime(Kernel::HLERequestContext& ctx) { 81void ITimeZoneService::ToCalendarTime(Kernel::HLERequestContext& ctx) {
@@ -91,14 +91,14 @@ void ITimeZoneService::ToCalendarTime(Kernel::HLERequestContext& ctx) {
91 TimeZone::CalendarInfo calendar_info{}; 91 TimeZone::CalendarInfo calendar_info{};
92 if (const ResultCode result{time_zone_content_manager.GetTimeZoneManager().ToCalendarTime( 92 if (const ResultCode result{time_zone_content_manager.GetTimeZoneManager().ToCalendarTime(
93 time_zone_rule, posix_time, calendar_info)}; 93 time_zone_rule, posix_time, calendar_info)};
94 result != RESULT_SUCCESS) { 94 result != ResultSuccess) {
95 IPC::ResponseBuilder rb{ctx, 2}; 95 IPC::ResponseBuilder rb{ctx, 2};
96 rb.Push(result); 96 rb.Push(result);
97 return; 97 return;
98 } 98 }
99 99
100 IPC::ResponseBuilder rb{ctx, 2 + (sizeof(TimeZone::CalendarInfo) / 4)}; 100 IPC::ResponseBuilder rb{ctx, 2 + (sizeof(TimeZone::CalendarInfo) / 4)};
101 rb.Push(RESULT_SUCCESS); 101 rb.Push(ResultSuccess);
102 rb.PushRaw(calendar_info); 102 rb.PushRaw(calendar_info);
103} 103}
104 104
@@ -112,14 +112,14 @@ void ITimeZoneService::ToCalendarTimeWithMyRule(Kernel::HLERequestContext& ctx)
112 if (const ResultCode result{ 112 if (const ResultCode result{
113 time_zone_content_manager.GetTimeZoneManager().ToCalendarTimeWithMyRules( 113 time_zone_content_manager.GetTimeZoneManager().ToCalendarTimeWithMyRules(
114 posix_time, calendar_info)}; 114 posix_time, calendar_info)};
115 result != RESULT_SUCCESS) { 115 result != ResultSuccess) {
116 IPC::ResponseBuilder rb{ctx, 2}; 116 IPC::ResponseBuilder rb{ctx, 2};
117 rb.Push(result); 117 rb.Push(result);
118 return; 118 return;
119 } 119 }
120 120
121 IPC::ResponseBuilder rb{ctx, 2 + (sizeof(TimeZone::CalendarInfo) / 4)}; 121 IPC::ResponseBuilder rb{ctx, 2 + (sizeof(TimeZone::CalendarInfo) / 4)};
122 rb.Push(RESULT_SUCCESS); 122 rb.Push(ResultSuccess);
123 rb.PushRaw(calendar_info); 123 rb.PushRaw(calendar_info);
124} 124}
125 125
@@ -134,7 +134,7 @@ void ITimeZoneService::ToPosixTime(Kernel::HLERequestContext& ctx) {
134 s64 posix_time{}; 134 s64 posix_time{};
135 if (const ResultCode result{time_zone_content_manager.GetTimeZoneManager().ToPosixTime( 135 if (const ResultCode result{time_zone_content_manager.GetTimeZoneManager().ToPosixTime(
136 time_zone_rule, calendar_time, posix_time)}; 136 time_zone_rule, calendar_time, posix_time)};
137 result != RESULT_SUCCESS) { 137 result != ResultSuccess) {
138 IPC::ResponseBuilder rb{ctx, 2}; 138 IPC::ResponseBuilder rb{ctx, 2};
139 rb.Push(result); 139 rb.Push(result);
140 return; 140 return;
@@ -144,7 +144,7 @@ void ITimeZoneService::ToPosixTime(Kernel::HLERequestContext& ctx) {
144 144
145 // TODO(bunnei): Handle multiple times 145 // TODO(bunnei): Handle multiple times
146 IPC::ResponseBuilder rb{ctx, 3}; 146 IPC::ResponseBuilder rb{ctx, 3};
147 rb.Push(RESULT_SUCCESS); 147 rb.Push(ResultSuccess);
148 rb.PushRaw<u32>(1); // Number of times we're returning 148 rb.PushRaw<u32>(1); // Number of times we're returning
149} 149}
150 150
@@ -158,7 +158,7 @@ void ITimeZoneService::ToPosixTimeWithMyRule(Kernel::HLERequestContext& ctx) {
158 if (const ResultCode result{ 158 if (const ResultCode result{
159 time_zone_content_manager.GetTimeZoneManager().ToPosixTimeWithMyRule(calendar_time, 159 time_zone_content_manager.GetTimeZoneManager().ToPosixTimeWithMyRule(calendar_time,
160 posix_time)}; 160 posix_time)};
161 result != RESULT_SUCCESS) { 161 result != ResultSuccess) {
162 IPC::ResponseBuilder rb{ctx, 2}; 162 IPC::ResponseBuilder rb{ctx, 2};
163 rb.Push(result); 163 rb.Push(result);
164 return; 164 return;
@@ -167,7 +167,7 @@ void ITimeZoneService::ToPosixTimeWithMyRule(Kernel::HLERequestContext& ctx) {
167 ctx.WriteBuffer(posix_time); 167 ctx.WriteBuffer(posix_time);
168 168
169 IPC::ResponseBuilder rb{ctx, 3}; 169 IPC::ResponseBuilder rb{ctx, 3};
170 rb.Push(RESULT_SUCCESS); 170 rb.Push(ResultSuccess);
171 rb.PushRaw<u32>(1); // Number of times we're returning 171 rb.PushRaw<u32>(1); // Number of times we're returning
172} 172}
173 173
diff --git a/src/core/hle/service/usb/usb.cpp b/src/core/hle/service/usb/usb.cpp
index b3b230a8c..7f436c3bb 100644
--- a/src/core/hle/service/usb/usb.cpp
+++ b/src/core/hle/service/usb/usb.cpp
@@ -165,7 +165,7 @@ private:
165 LOG_DEBUG(Service_USB, "called"); 165 LOG_DEBUG(Service_USB, "called");
166 166
167 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 167 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
168 rb.Push(RESULT_SUCCESS); 168 rb.Push(ResultSuccess);
169 rb.PushIpcInterface<IPdSession>(system); 169 rb.PushIpcInterface<IPdSession>(system);
170 } 170 }
171}; 171};
@@ -207,7 +207,7 @@ public:
207private: 207private:
208 void GetPdCradleSession(Kernel::HLERequestContext& ctx) { 208 void GetPdCradleSession(Kernel::HLERequestContext& ctx) {
209 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 209 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
210 rb.Push(RESULT_SUCCESS); 210 rb.Push(ResultSuccess);
211 rb.PushIpcInterface<IPdCradleSession>(system); 211 rb.PushIpcInterface<IPdCradleSession>(system);
212 212
213 LOG_DEBUG(Service_USB, "called"); 213 LOG_DEBUG(Service_USB, "called");
diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp
index fdd2b4b4f..3e5949d52 100644
--- a/src/core/hle/service/vi/vi.cpp
+++ b/src/core/hle/service/vi/vi.cpp
@@ -646,7 +646,7 @@ private:
646 } 646 }
647 647
648 IPC::ResponseBuilder rb{ctx, 2}; 648 IPC::ResponseBuilder rb{ctx, 2};
649 rb.Push(RESULT_SUCCESS); 649 rb.Push(ResultSuccess);
650 } 650 }
651 651
652 void AdjustRefcount(Kernel::HLERequestContext& ctx) { 652 void AdjustRefcount(Kernel::HLERequestContext& ctx) {
@@ -659,7 +659,7 @@ private:
659 type); 659 type);
660 660
661 IPC::ResponseBuilder rb{ctx, 2}; 661 IPC::ResponseBuilder rb{ctx, 2};
662 rb.Push(RESULT_SUCCESS); 662 rb.Push(ResultSuccess);
663 } 663 }
664 664
665 void GetNativeHandle(Kernel::HLERequestContext& ctx) { 665 void GetNativeHandle(Kernel::HLERequestContext& ctx) {
@@ -671,7 +671,7 @@ private:
671 671
672 // TODO(Subv): Find out what this actually is. 672 // TODO(Subv): Find out what this actually is.
673 IPC::ResponseBuilder rb{ctx, 2, 1}; 673 IPC::ResponseBuilder rb{ctx, 2, 1};
674 rb.Push(RESULT_SUCCESS); 674 rb.Push(ResultSuccess);
675 rb.PushCopyObjects(nv_flinger.FindBufferQueue(id)->GetBufferWaitEvent()); 675 rb.PushCopyObjects(nv_flinger.FindBufferQueue(id)->GetBufferWaitEvent());
676 } 676 }
677 677
@@ -744,7 +744,7 @@ private:
744 z_value); 744 z_value);
745 745
746 IPC::ResponseBuilder rb{ctx, 2}; 746 IPC::ResponseBuilder rb{ctx, 2};
747 rb.Push(RESULT_SUCCESS); 747 rb.Push(ResultSuccess);
748 } 748 }
749 749
750 // This function currently does nothing but return a success error code in 750 // This function currently does nothing but return a success error code in
@@ -757,14 +757,14 @@ private:
757 LOG_DEBUG(Service_VI, "called, layer_id=0x{:08X}, visibility={}", layer_id, visibility); 757 LOG_DEBUG(Service_VI, "called, layer_id=0x{:08X}, visibility={}", layer_id, visibility);
758 758
759 IPC::ResponseBuilder rb{ctx, 2}; 759 IPC::ResponseBuilder rb{ctx, 2};
760 rb.Push(RESULT_SUCCESS); 760 rb.Push(ResultSuccess);
761 } 761 }
762 762
763 void GetDisplayMode(Kernel::HLERequestContext& ctx) { 763 void GetDisplayMode(Kernel::HLERequestContext& ctx) {
764 LOG_WARNING(Service_VI, "(STUBBED) called"); 764 LOG_WARNING(Service_VI, "(STUBBED) called");
765 765
766 IPC::ResponseBuilder rb{ctx, 6}; 766 IPC::ResponseBuilder rb{ctx, 6};
767 rb.Push(RESULT_SUCCESS); 767 rb.Push(ResultSuccess);
768 768
769 if (Settings::values.use_docked_mode.GetValue()) { 769 if (Settings::values.use_docked_mode.GetValue()) {
770 rb.Push(static_cast<u32>(Service::VI::DisplayResolution::DockedWidth) * 770 rb.Push(static_cast<u32>(Service::VI::DisplayResolution::DockedWidth) *
@@ -879,7 +879,7 @@ private:
879 LOG_WARNING(Service_VI, "(STUBBED) called. display=0x{:016X}", display); 879 LOG_WARNING(Service_VI, "(STUBBED) called. display=0x{:016X}", display);
880 880
881 IPC::ResponseBuilder rb{ctx, 2}; 881 IPC::ResponseBuilder rb{ctx, 2};
882 rb.Push(RESULT_SUCCESS); 882 rb.Push(ResultSuccess);
883 } 883 }
884 884
885 void CreateManagedLayer(Kernel::HLERequestContext& ctx) { 885 void CreateManagedLayer(Kernel::HLERequestContext& ctx) {
@@ -902,7 +902,7 @@ private:
902 } 902 }
903 903
904 IPC::ResponseBuilder rb{ctx, 4}; 904 IPC::ResponseBuilder rb{ctx, 4};
905 rb.Push(RESULT_SUCCESS); 905 rb.Push(ResultSuccess);
906 rb.Push(*layer_id); 906 rb.Push(*layer_id);
907 } 907 }
908 908
@@ -915,7 +915,7 @@ private:
915 layer_id); 915 layer_id);
916 916
917 IPC::ResponseBuilder rb{ctx, 2}; 917 IPC::ResponseBuilder rb{ctx, 2};
918 rb.Push(RESULT_SUCCESS); 918 rb.Push(ResultSuccess);
919 } 919 }
920 920
921 void SetLayerVisibility(Kernel::HLERequestContext& ctx) { 921 void SetLayerVisibility(Kernel::HLERequestContext& ctx) {
@@ -927,7 +927,7 @@ private:
927 visibility); 927 visibility);
928 928
929 IPC::ResponseBuilder rb{ctx, 2}; 929 IPC::ResponseBuilder rb{ctx, 2};
930 rb.Push(RESULT_SUCCESS); 930 rb.Push(ResultSuccess);
931 } 931 }
932 932
933 NVFlinger::NVFlinger& nv_flinger; 933 NVFlinger::NVFlinger& nv_flinger;
@@ -958,7 +958,7 @@ private:
958 LOG_WARNING(Service_VI, "(STUBBED) called"); 958 LOG_WARNING(Service_VI, "(STUBBED) called");
959 959
960 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 960 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
961 rb.Push(RESULT_SUCCESS); 961 rb.Push(ResultSuccess);
962 rb.PushIpcInterface<IHOSBinderDriver>(system, nv_flinger); 962 rb.PushIpcInterface<IHOSBinderDriver>(system, nv_flinger);
963 } 963 }
964 964
@@ -966,7 +966,7 @@ private:
966 LOG_WARNING(Service_VI, "(STUBBED) called"); 966 LOG_WARNING(Service_VI, "(STUBBED) called");
967 967
968 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 968 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
969 rb.Push(RESULT_SUCCESS); 969 rb.Push(ResultSuccess);
970 rb.PushIpcInterface<ISystemDisplayService>(system); 970 rb.PushIpcInterface<ISystemDisplayService>(system);
971 } 971 }
972 972
@@ -974,7 +974,7 @@ private:
974 LOG_WARNING(Service_VI, "(STUBBED) called"); 974 LOG_WARNING(Service_VI, "(STUBBED) called");
975 975
976 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 976 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
977 rb.Push(RESULT_SUCCESS); 977 rb.Push(ResultSuccess);
978 rb.PushIpcInterface<IManagerDisplayService>(system, nv_flinger); 978 rb.PushIpcInterface<IManagerDisplayService>(system, nv_flinger);
979 } 979 }
980 980
@@ -982,7 +982,7 @@ private:
982 LOG_WARNING(Service_VI, "(STUBBED) called"); 982 LOG_WARNING(Service_VI, "(STUBBED) called");
983 983
984 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 984 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
985 rb.Push(RESULT_SUCCESS); 985 rb.Push(ResultSuccess);
986 rb.PushIpcInterface<IHOSBinderDriver>(system, nv_flinger); 986 rb.PushIpcInterface<IHOSBinderDriver>(system, nv_flinger);
987 } 987 }
988 988
@@ -1019,7 +1019,7 @@ private:
1019 } 1019 }
1020 1020
1021 IPC::ResponseBuilder rb{ctx, 4}; 1021 IPC::ResponseBuilder rb{ctx, 4};
1022 rb.Push(RESULT_SUCCESS); 1022 rb.Push(ResultSuccess);
1023 rb.Push<u64>(*display_id); 1023 rb.Push<u64>(*display_id);
1024 } 1024 }
1025 1025
@@ -1030,7 +1030,7 @@ private:
1030 LOG_WARNING(Service_VI, "(STUBBED) called. display_id=0x{:016X}", display_id); 1030 LOG_WARNING(Service_VI, "(STUBBED) called. display_id=0x{:016X}", display_id);
1031 1031
1032 IPC::ResponseBuilder rb{ctx, 2}; 1032 IPC::ResponseBuilder rb{ctx, 2};
1033 rb.Push(RESULT_SUCCESS); 1033 rb.Push(ResultSuccess);
1034 } 1034 }
1035 1035
1036 // This literally does nothing internally in the actual service itself, 1036 // This literally does nothing internally in the actual service itself,
@@ -1039,7 +1039,7 @@ private:
1039 LOG_DEBUG(Service_VI, "called."); 1039 LOG_DEBUG(Service_VI, "called.");
1040 1040
1041 IPC::ResponseBuilder rb{ctx, 2}; 1041 IPC::ResponseBuilder rb{ctx, 2};
1042 rb.Push(RESULT_SUCCESS); 1042 rb.Push(ResultSuccess);
1043 } 1043 }
1044 1044
1045 void GetDisplayResolution(Kernel::HLERequestContext& ctx) { 1045 void GetDisplayResolution(Kernel::HLERequestContext& ctx) {
@@ -1049,7 +1049,7 @@ private:
1049 LOG_DEBUG(Service_VI, "called. display_id=0x{:016X}", display_id); 1049 LOG_DEBUG(Service_VI, "called. display_id=0x{:016X}", display_id);
1050 1050
1051 IPC::ResponseBuilder rb{ctx, 6}; 1051 IPC::ResponseBuilder rb{ctx, 6};
1052 rb.Push(RESULT_SUCCESS); 1052 rb.Push(ResultSuccess);
1053 1053
1054 // This only returns the fixed values of 1280x720 and makes no distinguishing 1054 // This only returns the fixed values of 1280x720 and makes no distinguishing
1055 // between docked and undocked dimensions. We take the liberty of applying 1055 // between docked and undocked dimensions. We take the liberty of applying
@@ -1083,7 +1083,7 @@ private:
1083 return; 1083 return;
1084 } 1084 }
1085 1085
1086 rb.Push(RESULT_SUCCESS); 1086 rb.Push(ResultSuccess);
1087 } 1087 }
1088 1088
1089 void ListDisplays(Kernel::HLERequestContext& ctx) { 1089 void ListDisplays(Kernel::HLERequestContext& ctx) {
@@ -1094,7 +1094,7 @@ private:
1094 display_info.height *= static_cast<u64>(Settings::values.resolution_factor.GetValue()); 1094 display_info.height *= static_cast<u64>(Settings::values.resolution_factor.GetValue());
1095 ctx.WriteBuffer(&display_info, sizeof(DisplayInfo)); 1095 ctx.WriteBuffer(&display_info, sizeof(DisplayInfo));
1096 IPC::ResponseBuilder rb{ctx, 4}; 1096 IPC::ResponseBuilder rb{ctx, 4};
1097 rb.Push(RESULT_SUCCESS); 1097 rb.Push(ResultSuccess);
1098 rb.Push<u64>(1); 1098 rb.Push<u64>(1);
1099 } 1099 }
1100 1100
@@ -1130,7 +1130,7 @@ private:
1130 const auto buffer_size = ctx.WriteBuffer(native_window.Serialize()); 1130 const auto buffer_size = ctx.WriteBuffer(native_window.Serialize());
1131 1131
1132 IPC::ResponseBuilder rb{ctx, 4}; 1132 IPC::ResponseBuilder rb{ctx, 4};
1133 rb.Push(RESULT_SUCCESS); 1133 rb.Push(ResultSuccess);
1134 rb.Push<u64>(buffer_size); 1134 rb.Push<u64>(buffer_size);
1135 } 1135 }
1136 1136
@@ -1143,7 +1143,7 @@ private:
1143 nv_flinger.CloseLayer(layer_id); 1143 nv_flinger.CloseLayer(layer_id);
1144 1144
1145 IPC::ResponseBuilder rb{ctx, 2}; 1145 IPC::ResponseBuilder rb{ctx, 2};
1146 rb.Push(RESULT_SUCCESS); 1146 rb.Push(ResultSuccess);
1147 } 1147 }
1148 1148
1149 void CreateStrayLayer(Kernel::HLERequestContext& ctx) { 1149 void CreateStrayLayer(Kernel::HLERequestContext& ctx) {
@@ -1176,7 +1176,7 @@ private:
1176 const auto buffer_size = ctx.WriteBuffer(native_window.Serialize()); 1176 const auto buffer_size = ctx.WriteBuffer(native_window.Serialize());
1177 1177
1178 IPC::ResponseBuilder rb{ctx, 6}; 1178 IPC::ResponseBuilder rb{ctx, 6};
1179 rb.Push(RESULT_SUCCESS); 1179 rb.Push(ResultSuccess);
1180 rb.Push(*layer_id); 1180 rb.Push(*layer_id);
1181 rb.Push<u64>(buffer_size); 1181 rb.Push<u64>(buffer_size);
1182 } 1182 }
@@ -1188,7 +1188,7 @@ private:
1188 LOG_WARNING(Service_VI, "(STUBBED) called. layer_id=0x{:016X}", layer_id); 1188 LOG_WARNING(Service_VI, "(STUBBED) called. layer_id=0x{:016X}", layer_id);
1189 1189
1190 IPC::ResponseBuilder rb{ctx, 2}; 1190 IPC::ResponseBuilder rb{ctx, 2};
1191 rb.Push(RESULT_SUCCESS); 1191 rb.Push(ResultSuccess);
1192 } 1192 }
1193 1193
1194 void GetDisplayVsyncEvent(Kernel::HLERequestContext& ctx) { 1194 void GetDisplayVsyncEvent(Kernel::HLERequestContext& ctx) {
@@ -1206,7 +1206,7 @@ private:
1206 } 1206 }
1207 1207
1208 IPC::ResponseBuilder rb{ctx, 2, 1}; 1208 IPC::ResponseBuilder rb{ctx, 2, 1};
1209 rb.Push(RESULT_SUCCESS); 1209 rb.Push(ResultSuccess);
1210 rb.PushCopyObjects(vsync_event); 1210 rb.PushCopyObjects(vsync_event);
1211 } 1211 }
1212 1212
@@ -1219,7 +1219,7 @@ private:
1219 1219
1220 if (converted_mode.Succeeded()) { 1220 if (converted_mode.Succeeded()) {
1221 IPC::ResponseBuilder rb{ctx, 4}; 1221 IPC::ResponseBuilder rb{ctx, 4};
1222 rb.Push(RESULT_SUCCESS); 1222 rb.Push(ResultSuccess);
1223 rb.PushEnum(*converted_mode); 1223 rb.PushEnum(*converted_mode);
1224 } else { 1224 } else {
1225 IPC::ResponseBuilder rb{ctx, 2}; 1225 IPC::ResponseBuilder rb{ctx, 2};
@@ -1250,7 +1250,7 @@ private:
1250 IPC::ResponseBuilder rb{ctx, 6}; 1250 IPC::ResponseBuilder rb{ctx, 6};
1251 rb.Push(unknown_result_1); 1251 rb.Push(unknown_result_1);
1252 rb.Push(unknown_result_2); 1252 rb.Push(unknown_result_2);
1253 rb.Push(RESULT_SUCCESS); 1253 rb.Push(ResultSuccess);
1254 } 1254 }
1255 1255
1256 void GetIndirectLayerImageRequiredMemoryInfo(Kernel::HLERequestContext& ctx) { 1256 void GetIndirectLayerImageRequiredMemoryInfo(Kernel::HLERequestContext& ctx) {
@@ -1265,7 +1265,7 @@ private:
1265 const auto out_size = (texture_size + base_size - 1) / base_size * base_size; 1265 const auto out_size = (texture_size + base_size - 1) / base_size * base_size;
1266 1266
1267 IPC::ResponseBuilder rb{ctx, 6}; 1267 IPC::ResponseBuilder rb{ctx, 6};
1268 rb.Push(RESULT_SUCCESS); 1268 rb.Push(ResultSuccess);
1269 rb.Push(out_size); 1269 rb.Push(out_size);
1270 rb.Push(alignment); 1270 rb.Push(alignment);
1271 } 1271 }
@@ -1347,7 +1347,7 @@ void detail::GetDisplayServiceImpl(Kernel::HLERequestContext& ctx, Core::System&
1347 } 1347 }
1348 1348
1349 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 1349 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
1350 rb.Push(RESULT_SUCCESS); 1350 rb.Push(ResultSuccess);
1351 rb.PushIpcInterface<IApplicationDisplayService>(system, nv_flinger); 1351 rb.PushIpcInterface<IApplicationDisplayService>(system, nv_flinger);
1352} 1352}
1353 1353
diff --git a/src/core/memory.cpp b/src/core/memory.cpp
index bf2ef7816..9857278f6 100644
--- a/src/core/memory.cpp
+++ b/src/core/memory.cpp
@@ -591,7 +591,15 @@ struct Memory::Impl {
591 * @returns The instance of T read from the specified virtual address. 591 * @returns The instance of T read from the specified virtual address.
592 */ 592 */
593 template <typename T> 593 template <typename T>
594 T Read(const VAddr vaddr) { 594 T Read(VAddr vaddr) {
595 // AARCH64 masks the upper 16 bit of all memory accesses
596 vaddr &= 0xffffffffffffLL;
597
598 if (vaddr >= 1uLL << current_page_table->GetAddressSpaceBits()) {
599 LOG_ERROR(HW_Memory, "Unmapped Read{} @ 0x{:08X}", sizeof(T) * 8, vaddr);
600 return 0;
601 }
602
595 // Avoid adding any extra logic to this fast-path block 603 // Avoid adding any extra logic to this fast-path block
596 const uintptr_t raw_pointer = current_page_table->pointers[vaddr >> PAGE_BITS].Raw(); 604 const uintptr_t raw_pointer = current_page_table->pointers[vaddr >> PAGE_BITS].Raw();
597 if (const u8* const pointer = Common::PageTable::PageInfo::ExtractPointer(raw_pointer)) { 605 if (const u8* const pointer = Common::PageTable::PageInfo::ExtractPointer(raw_pointer)) {
@@ -629,7 +637,16 @@ struct Memory::Impl {
629 * is undefined. 637 * is undefined.
630 */ 638 */
631 template <typename T> 639 template <typename T>
632 void Write(const VAddr vaddr, const T data) { 640 void Write(VAddr vaddr, const T data) {
641 // AARCH64 masks the upper 16 bit of all memory accesses
642 vaddr &= 0xffffffffffffLL;
643
644 if (vaddr >= 1uLL << current_page_table->GetAddressSpaceBits()) {
645 LOG_ERROR(HW_Memory, "Unmapped Write{} 0x{:08X} @ 0x{:016X}", sizeof(data) * 8,
646 static_cast<u32>(data), vaddr);
647 return;
648 }
649
633 // Avoid adding any extra logic to this fast-path block 650 // Avoid adding any extra logic to this fast-path block
634 const uintptr_t raw_pointer = current_page_table->pointers[vaddr >> PAGE_BITS].Raw(); 651 const uintptr_t raw_pointer = current_page_table->pointers[vaddr >> PAGE_BITS].Raw();
635 if (u8* const pointer = Common::PageTable::PageInfo::ExtractPointer(raw_pointer)) { 652 if (u8* const pointer = Common::PageTable::PageInfo::ExtractPointer(raw_pointer)) {
@@ -656,7 +673,16 @@ struct Memory::Impl {
656 } 673 }
657 674
658 template <typename T> 675 template <typename T>
659 bool WriteExclusive(const VAddr vaddr, const T data, const T expected) { 676 bool WriteExclusive(VAddr vaddr, const T data, const T expected) {
677 // AARCH64 masks the upper 16 bit of all memory accesses
678 vaddr &= 0xffffffffffffLL;
679
680 if (vaddr >= 1uLL << current_page_table->GetAddressSpaceBits()) {
681 LOG_ERROR(HW_Memory, "Unmapped Write{} 0x{:08X} @ 0x{:016X}", sizeof(data) * 8,
682 static_cast<u32>(data), vaddr);
683 return true;
684 }
685
660 const uintptr_t raw_pointer = current_page_table->pointers[vaddr >> PAGE_BITS].Raw(); 686 const uintptr_t raw_pointer = current_page_table->pointers[vaddr >> PAGE_BITS].Raw();
661 if (u8* const pointer = Common::PageTable::PageInfo::ExtractPointer(raw_pointer)) { 687 if (u8* const pointer = Common::PageTable::PageInfo::ExtractPointer(raw_pointer)) {
662 // NOTE: Avoid adding any extra logic to this fast-path block 688 // NOTE: Avoid adding any extra logic to this fast-path block
@@ -683,7 +709,16 @@ struct Memory::Impl {
683 return true; 709 return true;
684 } 710 }
685 711
686 bool WriteExclusive128(const VAddr vaddr, const u128 data, const u128 expected) { 712 bool WriteExclusive128(VAddr vaddr, const u128 data, const u128 expected) {
713 // AARCH64 masks the upper 16 bit of all memory accesses
714 vaddr &= 0xffffffffffffLL;
715
716 if (vaddr >= 1uLL << current_page_table->GetAddressSpaceBits()) {
717 LOG_ERROR(HW_Memory, "Unmapped Write{} 0x{:08X} @ 0x{:016X}", sizeof(data) * 8,
718 static_cast<u32>(data[0]), vaddr);
719 return true;
720 }
721
687 const uintptr_t raw_pointer = current_page_table->pointers[vaddr >> PAGE_BITS].Raw(); 722 const uintptr_t raw_pointer = current_page_table->pointers[vaddr >> PAGE_BITS].Raw();
688 if (u8* const pointer = Common::PageTable::PageInfo::ExtractPointer(raw_pointer)) { 723 if (u8* const pointer = Common::PageTable::PageInfo::ExtractPointer(raw_pointer)) {
689 // NOTE: Avoid adding any extra logic to this fast-path block 724 // NOTE: Avoid adding any extra logic to this fast-path block
diff --git a/src/core/reporter.cpp b/src/core/reporter.cpp
index a9596fe4d..ec2a16e62 100644
--- a/src/core/reporter.cpp
+++ b/src/core/reporter.cpp
@@ -144,7 +144,7 @@ json GetFullDataAuto(const std::string& timestamp, u64 title_id, Core::System& s
144 json out; 144 json out;
145 145
146 out["yuzu_version"] = GetYuzuVersionData(); 146 out["yuzu_version"] = GetYuzuVersionData();
147 out["report_common"] = GetReportCommonData(title_id, RESULT_SUCCESS, timestamp); 147 out["report_common"] = GetReportCommonData(title_id, ResultSuccess, timestamp);
148 out["processor_state"] = GetProcessorStateDataAuto(system); 148 out["processor_state"] = GetProcessorStateDataAuto(system);
149 out["backtrace"] = GetBacktraceData(system); 149 out["backtrace"] = GetBacktraceData(system);
150 150
@@ -322,7 +322,7 @@ void Reporter::SavePlayReport(PlayReportType type, u64 title_id, std::vector<std
322 json out; 322 json out;
323 323
324 out["yuzu_version"] = GetYuzuVersionData(); 324 out["yuzu_version"] = GetYuzuVersionData();
325 out["report_common"] = GetReportCommonData(title_id, RESULT_SUCCESS, timestamp, user_id); 325 out["report_common"] = GetReportCommonData(title_id, ResultSuccess, timestamp, user_id);
326 326
327 auto data_out = json::array(); 327 auto data_out = json::array();
328 for (const auto& d : data) { 328 for (const auto& d : data) {
@@ -372,7 +372,7 @@ void Reporter::SaveFilesystemAccessReport(Service::FileSystem::LogMode log_mode,
372 json out; 372 json out;
373 373
374 out["yuzu_version"] = GetYuzuVersionData(); 374 out["yuzu_version"] = GetYuzuVersionData();
375 out["report_common"] = GetReportCommonData(title_id, RESULT_SUCCESS, timestamp); 375 out["report_common"] = GetReportCommonData(title_id, ResultSuccess, timestamp);
376 376
377 out["log_mode"] = fmt::format("{:08X}", static_cast<u32>(log_mode)); 377 out["log_mode"] = fmt::format("{:08X}", static_cast<u32>(log_mode));
378 out["log_message"] = std::move(log_message); 378 out["log_message"] = std::move(log_message);
diff --git a/src/input_common/sdl/sdl_impl.cpp b/src/input_common/sdl/sdl_impl.cpp
index b9b584b2a..68672a92b 100644
--- a/src/input_common/sdl/sdl_impl.cpp
+++ b/src/input_common/sdl/sdl_impl.cpp
@@ -18,16 +18,6 @@
18#include <utility> 18#include <utility>
19#include <vector> 19#include <vector>
20 20
21// Ignore -Wimplicit-fallthrough due to https://github.com/libsdl-org/SDL/issues/4307
22#ifdef __clang__
23#pragma clang diagnostic push
24#pragma clang diagnostic ignored "-Wimplicit-fallthrough"
25#endif
26#include <SDL.h>
27#ifdef __clang__
28#pragma clang diagnostic pop
29#endif
30
31#include "common/logging/log.h" 21#include "common/logging/log.h"
32#include "common/math_util.h" 22#include "common/math_util.h"
33#include "common/param_package.h" 23#include "common/param_package.h"
@@ -214,6 +204,40 @@ public:
214 sdl_controller.reset(controller); 204 sdl_controller.reset(controller);
215 } 205 }
216 206
207 bool IsJoyconLeft() const {
208 return std::strstr(GetControllerName().c_str(), "Joy-Con Left") != nullptr;
209 }
210
211 bool IsJoyconRight() const {
212 return std::strstr(GetControllerName().c_str(), "Joy-Con Right") != nullptr;
213 }
214
215 std::string GetControllerName() const {
216 if (sdl_controller) {
217 switch (SDL_GameControllerGetType(sdl_controller.get())) {
218 case SDL_CONTROLLER_TYPE_XBOX360:
219 return "XBox 360 Controller";
220 case SDL_CONTROLLER_TYPE_XBOXONE:
221 return "XBox One Controller";
222 default:
223 break;
224 }
225 const auto name = SDL_GameControllerName(sdl_controller.get());
226 if (name) {
227 return name;
228 }
229 }
230
231 if (sdl_joystick) {
232 const auto name = SDL_JoystickName(sdl_joystick.get());
233 if (name) {
234 return name;
235 }
236 }
237
238 return "Unknown";
239 }
240
217private: 241private:
218 struct State { 242 struct State {
219 std::unordered_map<int, bool> buttons; 243 std::unordered_map<int, bool> buttons;
@@ -858,23 +882,42 @@ SDLState::~SDLState() {
858std::vector<Common::ParamPackage> SDLState::GetInputDevices() { 882std::vector<Common::ParamPackage> SDLState::GetInputDevices() {
859 std::scoped_lock lock(joystick_map_mutex); 883 std::scoped_lock lock(joystick_map_mutex);
860 std::vector<Common::ParamPackage> devices; 884 std::vector<Common::ParamPackage> devices;
885 std::unordered_map<int, std::shared_ptr<SDLJoystick>> joycon_pairs;
886 for (const auto& [key, value] : joystick_map) {
887 for (const auto& joystick : value) {
888 if (!joystick->GetSDLJoystick()) {
889 continue;
890 }
891 std::string name =
892 fmt::format("{} {}", joystick->GetControllerName(), joystick->GetPort());
893 devices.emplace_back(Common::ParamPackage{
894 {"class", "sdl"},
895 {"display", std::move(name)},
896 {"guid", joystick->GetGUID()},
897 {"port", std::to_string(joystick->GetPort())},
898 });
899 if (joystick->IsJoyconLeft()) {
900 joycon_pairs.insert_or_assign(joystick->GetPort(), joystick);
901 }
902 }
903 }
904
905 // Add dual controllers
861 for (const auto& [key, value] : joystick_map) { 906 for (const auto& [key, value] : joystick_map) {
862 for (const auto& joystick : value) { 907 for (const auto& joystick : value) {
863 if (auto* const controller = joystick->GetSDLGameController()) { 908 if (joystick->IsJoyconRight()) {
909 if (!joycon_pairs.contains(joystick->GetPort())) {
910 continue;
911 }
912 const auto joystick2 = joycon_pairs.at(joystick->GetPort());
913
864 std::string name = 914 std::string name =
865 fmt::format("{} {}", GetControllerName(controller), joystick->GetPort()); 915 fmt::format("{} {}", "Nintendo Dual Joy-Con", joystick->GetPort());
866 devices.emplace_back(Common::ParamPackage{
867 {"class", "sdl"},
868 {"display", std::move(name)},
869 {"guid", joystick->GetGUID()},
870 {"port", std::to_string(joystick->GetPort())},
871 });
872 } else if (auto* const joy = joystick->GetSDLJoystick()) {
873 std::string name = fmt::format("{} {}", SDL_JoystickName(joy), joystick->GetPort());
874 devices.emplace_back(Common::ParamPackage{ 916 devices.emplace_back(Common::ParamPackage{
875 {"class", "sdl"}, 917 {"class", "sdl"},
876 {"display", std::move(name)}, 918 {"display", std::move(name)},
877 {"guid", joystick->GetGUID()}, 919 {"guid", joystick->GetGUID()},
920 {"guid2", joystick2->GetGUID()},
878 {"port", std::to_string(joystick->GetPort())}, 921 {"port", std::to_string(joystick->GetPort())},
879 }); 922 });
880 } 923 }
@@ -883,17 +926,6 @@ std::vector<Common::ParamPackage> SDLState::GetInputDevices() {
883 return devices; 926 return devices;
884} 927}
885 928
886std::string SDLState::GetControllerName(SDL_GameController* controller) const {
887 switch (SDL_GameControllerGetType(controller)) {
888 case SDL_CONTROLLER_TYPE_XBOX360:
889 return "XBox 360 Controller";
890 case SDL_CONTROLLER_TYPE_XBOXONE:
891 return "XBox One Controller";
892 default:
893 return SDL_GameControllerName(controller);
894 }
895}
896
897namespace { 929namespace {
898Common::ParamPackage BuildAnalogParamPackageForButton(int port, std::string guid, s32 axis, 930Common::ParamPackage BuildAnalogParamPackageForButton(int port, std::string guid, s32 axis,
899 float value = 0.1f) { 931 float value = 0.1f) {
@@ -1073,24 +1105,48 @@ ButtonMapping SDLState::GetButtonMappingForDevice(const Common::ParamPackage& pa
1073 return {}; 1105 return {};
1074 } 1106 }
1075 const auto joystick = GetSDLJoystickByGUID(params.Get("guid", ""), params.Get("port", 0)); 1107 const auto joystick = GetSDLJoystickByGUID(params.Get("guid", ""), params.Get("port", 0));
1108
1076 auto* controller = joystick->GetSDLGameController(); 1109 auto* controller = joystick->GetSDLGameController();
1077 if (controller == nullptr) { 1110 if (controller == nullptr) {
1078 return {}; 1111 return {};
1079 } 1112 }
1080 1113
1081 const bool invert =
1082 SDL_GameControllerGetType(controller) != SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO;
1083
1084 // This list is missing ZL/ZR since those are not considered buttons in SDL GameController. 1114 // This list is missing ZL/ZR since those are not considered buttons in SDL GameController.
1085 // We will add those afterwards 1115 // We will add those afterwards
1086 // This list also excludes Screenshot since theres not really a mapping for that 1116 // This list also excludes Screenshot since theres not really a mapping for that
1087 using ButtonBindings = 1117 ButtonBindings switch_to_sdl_button;
1088 std::array<std::pair<Settings::NativeButton::Values, SDL_GameControllerButton>, 17>; 1118
1089 const ButtonBindings switch_to_sdl_button{{ 1119 if (SDL_GameControllerGetType(controller) == SDL_CONTROLLER_TYPE_NINTENDO_SWITCH_PRO) {
1090 {Settings::NativeButton::A, invert ? SDL_CONTROLLER_BUTTON_B : SDL_CONTROLLER_BUTTON_A}, 1120 switch_to_sdl_button = GetNintendoButtonBinding(joystick);
1091 {Settings::NativeButton::B, invert ? SDL_CONTROLLER_BUTTON_A : SDL_CONTROLLER_BUTTON_B}, 1121 } else {
1092 {Settings::NativeButton::X, invert ? SDL_CONTROLLER_BUTTON_Y : SDL_CONTROLLER_BUTTON_X}, 1122 switch_to_sdl_button = GetDefaultButtonBinding();
1093 {Settings::NativeButton::Y, invert ? SDL_CONTROLLER_BUTTON_X : SDL_CONTROLLER_BUTTON_Y}, 1123 }
1124
1125 // Add the missing bindings for ZL/ZR
1126 static constexpr ZButtonBindings switch_to_sdl_axis{{
1127 {Settings::NativeButton::ZL, SDL_CONTROLLER_AXIS_TRIGGERLEFT},
1128 {Settings::NativeButton::ZR, SDL_CONTROLLER_AXIS_TRIGGERRIGHT},
1129 }};
1130
1131 // Parameters contain two joysticks return dual
1132 if (params.Has("guid2")) {
1133 const auto joystick2 = GetSDLJoystickByGUID(params.Get("guid2", ""), params.Get("port", 0));
1134
1135 if (joystick2->GetSDLGameController() != nullptr) {
1136 return GetDualControllerMapping(joystick, joystick2, switch_to_sdl_button,
1137 switch_to_sdl_axis);
1138 }
1139 }
1140
1141 return GetSingleControllerMapping(joystick, switch_to_sdl_button, switch_to_sdl_axis);
1142}
1143
1144ButtonBindings SDLState::GetDefaultButtonBinding() const {
1145 return {
1146 std::pair{Settings::NativeButton::A, SDL_CONTROLLER_BUTTON_B},
1147 {Settings::NativeButton::B, SDL_CONTROLLER_BUTTON_A},
1148 {Settings::NativeButton::X, SDL_CONTROLLER_BUTTON_Y},
1149 {Settings::NativeButton::Y, SDL_CONTROLLER_BUTTON_X},
1094 {Settings::NativeButton::LStick, SDL_CONTROLLER_BUTTON_LEFTSTICK}, 1150 {Settings::NativeButton::LStick, SDL_CONTROLLER_BUTTON_LEFTSTICK},
1095 {Settings::NativeButton::RStick, SDL_CONTROLLER_BUTTON_RIGHTSTICK}, 1151 {Settings::NativeButton::RStick, SDL_CONTROLLER_BUTTON_RIGHTSTICK},
1096 {Settings::NativeButton::L, SDL_CONTROLLER_BUTTON_LEFTSHOULDER}, 1152 {Settings::NativeButton::L, SDL_CONTROLLER_BUTTON_LEFTSHOULDER},
@@ -1104,18 +1160,51 @@ ButtonMapping SDLState::GetButtonMappingForDevice(const Common::ParamPackage& pa
1104 {Settings::NativeButton::SL, SDL_CONTROLLER_BUTTON_LEFTSHOULDER}, 1160 {Settings::NativeButton::SL, SDL_CONTROLLER_BUTTON_LEFTSHOULDER},
1105 {Settings::NativeButton::SR, SDL_CONTROLLER_BUTTON_RIGHTSHOULDER}, 1161 {Settings::NativeButton::SR, SDL_CONTROLLER_BUTTON_RIGHTSHOULDER},
1106 {Settings::NativeButton::Home, SDL_CONTROLLER_BUTTON_GUIDE}, 1162 {Settings::NativeButton::Home, SDL_CONTROLLER_BUTTON_GUIDE},
1107 }}; 1163 };
1164}
1108 1165
1109 // Add the missing bindings for ZL/ZR 1166ButtonBindings SDLState::GetNintendoButtonBinding(
1110 using ZBindings = 1167 const std::shared_ptr<SDLJoystick>& joystick) const {
1111 std::array<std::pair<Settings::NativeButton::Values, SDL_GameControllerAxis>, 2>; 1168 // Default SL/SR mapping for pro controllers
1112 static constexpr ZBindings switch_to_sdl_axis{{ 1169 auto sl_button = SDL_CONTROLLER_BUTTON_LEFTSHOULDER;
1113 {Settings::NativeButton::ZL, SDL_CONTROLLER_AXIS_TRIGGERLEFT}, 1170 auto sr_button = SDL_CONTROLLER_BUTTON_RIGHTSHOULDER;
1114 {Settings::NativeButton::ZR, SDL_CONTROLLER_AXIS_TRIGGERRIGHT}, 1171
1115 }}; 1172 if (joystick->IsJoyconLeft()) {
1173 sl_button = SDL_CONTROLLER_BUTTON_PADDLE2;
1174 sr_button = SDL_CONTROLLER_BUTTON_PADDLE4;
1175 }
1176 if (joystick->IsJoyconRight()) {
1177 sl_button = SDL_CONTROLLER_BUTTON_PADDLE3;
1178 sr_button = SDL_CONTROLLER_BUTTON_PADDLE1;
1179 }
1116 1180
1181 return {
1182 std::pair{Settings::NativeButton::A, SDL_CONTROLLER_BUTTON_A},
1183 {Settings::NativeButton::B, SDL_CONTROLLER_BUTTON_B},
1184 {Settings::NativeButton::X, SDL_CONTROLLER_BUTTON_X},
1185 {Settings::NativeButton::Y, SDL_CONTROLLER_BUTTON_Y},
1186 {Settings::NativeButton::LStick, SDL_CONTROLLER_BUTTON_LEFTSTICK},
1187 {Settings::NativeButton::RStick, SDL_CONTROLLER_BUTTON_RIGHTSTICK},
1188 {Settings::NativeButton::L, SDL_CONTROLLER_BUTTON_LEFTSHOULDER},
1189 {Settings::NativeButton::R, SDL_CONTROLLER_BUTTON_RIGHTSHOULDER},
1190 {Settings::NativeButton::Plus, SDL_CONTROLLER_BUTTON_START},
1191 {Settings::NativeButton::Minus, SDL_CONTROLLER_BUTTON_BACK},
1192 {Settings::NativeButton::DLeft, SDL_CONTROLLER_BUTTON_DPAD_LEFT},
1193 {Settings::NativeButton::DUp, SDL_CONTROLLER_BUTTON_DPAD_UP},
1194 {Settings::NativeButton::DRight, SDL_CONTROLLER_BUTTON_DPAD_RIGHT},
1195 {Settings::NativeButton::DDown, SDL_CONTROLLER_BUTTON_DPAD_DOWN},
1196 {Settings::NativeButton::SL, sl_button},
1197 {Settings::NativeButton::SR, sr_button},
1198 {Settings::NativeButton::Home, SDL_CONTROLLER_BUTTON_GUIDE},
1199 };
1200}
1201
1202ButtonMapping SDLState::GetSingleControllerMapping(
1203 const std::shared_ptr<SDLJoystick>& joystick, const ButtonBindings& switch_to_sdl_button,
1204 const ZButtonBindings& switch_to_sdl_axis) const {
1117 ButtonMapping mapping; 1205 ButtonMapping mapping;
1118 mapping.reserve(switch_to_sdl_button.size() + switch_to_sdl_axis.size()); 1206 mapping.reserve(switch_to_sdl_button.size() + switch_to_sdl_axis.size());
1207 auto* controller = joystick->GetSDLGameController();
1119 1208
1120 for (const auto& [switch_button, sdl_button] : switch_to_sdl_button) { 1209 for (const auto& [switch_button, sdl_button] : switch_to_sdl_button) {
1121 const auto& binding = SDL_GameControllerGetBindForButton(controller, sdl_button); 1210 const auto& binding = SDL_GameControllerGetBindForButton(controller, sdl_button);
@@ -1133,11 +1222,68 @@ ButtonMapping SDLState::GetButtonMappingForDevice(const Common::ParamPackage& pa
1133 return mapping; 1222 return mapping;
1134} 1223}
1135 1224
1225ButtonMapping SDLState::GetDualControllerMapping(const std::shared_ptr<SDLJoystick>& joystick,
1226 const std::shared_ptr<SDLJoystick>& joystick2,
1227 const ButtonBindings& switch_to_sdl_button,
1228 const ZButtonBindings& switch_to_sdl_axis) const {
1229 ButtonMapping mapping;
1230 mapping.reserve(switch_to_sdl_button.size() + switch_to_sdl_axis.size());
1231 auto* controller = joystick->GetSDLGameController();
1232 auto* controller2 = joystick2->GetSDLGameController();
1233
1234 for (const auto& [switch_button, sdl_button] : switch_to_sdl_button) {
1235 if (IsButtonOnLeftSide(switch_button)) {
1236 const auto& binding = SDL_GameControllerGetBindForButton(controller2, sdl_button);
1237 mapping.insert_or_assign(
1238 switch_button,
1239 BuildParamPackageForBinding(joystick2->GetPort(), joystick2->GetGUID(), binding));
1240 continue;
1241 }
1242 const auto& binding = SDL_GameControllerGetBindForButton(controller, sdl_button);
1243 mapping.insert_or_assign(
1244 switch_button,
1245 BuildParamPackageForBinding(joystick->GetPort(), joystick->GetGUID(), binding));
1246 }
1247 for (const auto& [switch_button, sdl_axis] : switch_to_sdl_axis) {
1248 if (IsButtonOnLeftSide(switch_button)) {
1249 const auto& binding = SDL_GameControllerGetBindForAxis(controller2, sdl_axis);
1250 mapping.insert_or_assign(
1251 switch_button,
1252 BuildParamPackageForBinding(joystick2->GetPort(), joystick2->GetGUID(), binding));
1253 continue;
1254 }
1255 const auto& binding = SDL_GameControllerGetBindForAxis(controller, sdl_axis);
1256 mapping.insert_or_assign(
1257 switch_button,
1258 BuildParamPackageForBinding(joystick->GetPort(), joystick->GetGUID(), binding));
1259 }
1260
1261 return mapping;
1262}
1263
1264bool SDLState::IsButtonOnLeftSide(Settings::NativeButton::Values button) const {
1265 switch (button) {
1266 case Settings::NativeButton::DDown:
1267 case Settings::NativeButton::DLeft:
1268 case Settings::NativeButton::DRight:
1269 case Settings::NativeButton::DUp:
1270 case Settings::NativeButton::L:
1271 case Settings::NativeButton::LStick:
1272 case Settings::NativeButton::Minus:
1273 case Settings::NativeButton::Screenshot:
1274 case Settings::NativeButton::ZL:
1275 return true;
1276 default:
1277 return false;
1278 }
1279}
1280
1136AnalogMapping SDLState::GetAnalogMappingForDevice(const Common::ParamPackage& params) { 1281AnalogMapping SDLState::GetAnalogMappingForDevice(const Common::ParamPackage& params) {
1137 if (!params.Has("guid") || !params.Has("port")) { 1282 if (!params.Has("guid") || !params.Has("port")) {
1138 return {}; 1283 return {};
1139 } 1284 }
1140 const auto joystick = GetSDLJoystickByGUID(params.Get("guid", ""), params.Get("port", 0)); 1285 const auto joystick = GetSDLJoystickByGUID(params.Get("guid", ""), params.Get("port", 0));
1286 const auto joystick2 = GetSDLJoystickByGUID(params.Get("guid2", ""), params.Get("port", 0));
1141 auto* controller = joystick->GetSDLGameController(); 1287 auto* controller = joystick->GetSDLGameController();
1142 if (controller == nullptr) { 1288 if (controller == nullptr) {
1143 return {}; 1289 return {};
@@ -1148,10 +1294,17 @@ AnalogMapping SDLState::GetAnalogMappingForDevice(const Common::ParamPackage& pa
1148 SDL_GameControllerGetBindForAxis(controller, SDL_CONTROLLER_AXIS_LEFTX); 1294 SDL_GameControllerGetBindForAxis(controller, SDL_CONTROLLER_AXIS_LEFTX);
1149 const auto& binding_left_y = 1295 const auto& binding_left_y =
1150 SDL_GameControllerGetBindForAxis(controller, SDL_CONTROLLER_AXIS_LEFTY); 1296 SDL_GameControllerGetBindForAxis(controller, SDL_CONTROLLER_AXIS_LEFTY);
1151 mapping.insert_or_assign(Settings::NativeAnalog::LStick, 1297 if (params.Has("guid2")) {
1152 BuildParamPackageForAnalog(joystick->GetPort(), joystick->GetGUID(), 1298 mapping.insert_or_assign(
1153 binding_left_x.value.axis, 1299 Settings::NativeAnalog::LStick,
1154 binding_left_y.value.axis)); 1300 BuildParamPackageForAnalog(joystick2->GetPort(), joystick2->GetGUID(),
1301 binding_left_x.value.axis, binding_left_y.value.axis));
1302 } else {
1303 mapping.insert_or_assign(
1304 Settings::NativeAnalog::LStick,
1305 BuildParamPackageForAnalog(joystick->GetPort(), joystick->GetGUID(),
1306 binding_left_x.value.axis, binding_left_y.value.axis));
1307 }
1155 const auto& binding_right_x = 1308 const auto& binding_right_x =
1156 SDL_GameControllerGetBindForAxis(controller, SDL_CONTROLLER_AXIS_RIGHTX); 1309 SDL_GameControllerGetBindForAxis(controller, SDL_CONTROLLER_AXIS_RIGHTX);
1157 const auto& binding_right_y = 1310 const auto& binding_right_y =
@@ -1168,20 +1321,32 @@ MotionMapping SDLState::GetMotionMappingForDevice(const Common::ParamPackage& pa
1168 return {}; 1321 return {};
1169 } 1322 }
1170 const auto joystick = GetSDLJoystickByGUID(params.Get("guid", ""), params.Get("port", 0)); 1323 const auto joystick = GetSDLJoystickByGUID(params.Get("guid", ""), params.Get("port", 0));
1324 const auto joystick2 = GetSDLJoystickByGUID(params.Get("guid2", ""), params.Get("port", 0));
1171 auto* controller = joystick->GetSDLGameController(); 1325 auto* controller = joystick->GetSDLGameController();
1172 if (controller == nullptr) { 1326 if (controller == nullptr) {
1173 return {}; 1327 return {};
1174 } 1328 }
1175 1329
1330 MotionMapping mapping = {};
1176 joystick->EnableMotion(); 1331 joystick->EnableMotion();
1177 1332
1178 if (!joystick->HasGyro() && !joystick->HasAccel()) { 1333 if (joystick->HasGyro() || joystick->HasAccel()) {
1179 return {}; 1334 mapping.insert_or_assign(Settings::NativeMotion::MotionRight,
1335 BuildMotionParam(joystick->GetPort(), joystick->GetGUID()));
1336 }
1337 if (params.Has("guid2")) {
1338 joystick2->EnableMotion();
1339 if (joystick2->HasGyro() || joystick2->HasAccel()) {
1340 mapping.insert_or_assign(Settings::NativeMotion::MotionLeft,
1341 BuildMotionParam(joystick2->GetPort(), joystick2->GetGUID()));
1342 }
1343 } else {
1344 if (joystick->HasGyro() || joystick->HasAccel()) {
1345 mapping.insert_or_assign(Settings::NativeMotion::MotionLeft,
1346 BuildMotionParam(joystick->GetPort(), joystick->GetGUID()));
1347 }
1180 } 1348 }
1181 1349
1182 MotionMapping mapping = {};
1183 mapping.insert_or_assign(Settings::NativeMotion::MotionLeft,
1184 BuildMotionParam(joystick->GetPort(), joystick->GetGUID()));
1185 return mapping; 1350 return mapping;
1186} 1351}
1187namespace Polling { 1352namespace Polling {
diff --git a/src/input_common/sdl/sdl_impl.h b/src/input_common/sdl/sdl_impl.h
index 121e01913..b77afcbd8 100644
--- a/src/input_common/sdl/sdl_impl.h
+++ b/src/input_common/sdl/sdl_impl.h
@@ -9,6 +9,17 @@
9#include <mutex> 9#include <mutex>
10#include <thread> 10#include <thread>
11#include <unordered_map> 11#include <unordered_map>
12
13// Ignore -Wimplicit-fallthrough due to https://github.com/libsdl-org/SDL/issues/4307
14#ifdef __GNUC__
15#pragma GCC diagnostic push
16#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
17#endif
18#include <SDL.h>
19#ifdef __GNUC__
20#pragma GCC diagnostic pop
21#endif
22
12#include "common/common_types.h" 23#include "common/common_types.h"
13#include "common/threadsafe_queue.h" 24#include "common/threadsafe_queue.h"
14#include "input_common/sdl/sdl.h" 25#include "input_common/sdl/sdl.h"
@@ -18,6 +29,11 @@ using SDL_GameController = struct _SDL_GameController;
18using SDL_Joystick = struct _SDL_Joystick; 29using SDL_Joystick = struct _SDL_Joystick;
19using SDL_JoystickID = s32; 30using SDL_JoystickID = s32;
20 31
32using ButtonBindings =
33 std::array<std::pair<Settings::NativeButton::Values, SDL_GameControllerButton>, 17>;
34using ZButtonBindings =
35 std::array<std::pair<Settings::NativeButton::Values, SDL_GameControllerAxis>, 2>;
36
21namespace InputCommon::SDL { 37namespace InputCommon::SDL {
22 38
23class SDLAnalogFactory; 39class SDLAnalogFactory;
@@ -66,8 +82,25 @@ private:
66 /// Needs to be called before SDL_QuitSubSystem. 82 /// Needs to be called before SDL_QuitSubSystem.
67 void CloseJoysticks(); 83 void CloseJoysticks();
68 84
69 /// Returns a custom name for specific controllers because the default name is not correct 85 /// Returns the default button bindings list for generic controllers
70 std::string GetControllerName(SDL_GameController* controller) const; 86 ButtonBindings GetDefaultButtonBinding() const;
87
88 /// Returns the default button bindings list for nintendo controllers
89 ButtonBindings GetNintendoButtonBinding(const std::shared_ptr<SDLJoystick>& joystick) const;
90
91 /// Returns the button mappings from a single controller
92 ButtonMapping GetSingleControllerMapping(const std::shared_ptr<SDLJoystick>& joystick,
93 const ButtonBindings& switch_to_sdl_button,
94 const ZButtonBindings& switch_to_sdl_axis) const;
95
96 /// Returns the button mappings from two different controllers
97 ButtonMapping GetDualControllerMapping(const std::shared_ptr<SDLJoystick>& joystick,
98 const std::shared_ptr<SDLJoystick>& joystick2,
99 const ButtonBindings& switch_to_sdl_button,
100 const ZButtonBindings& switch_to_sdl_axis) const;
101
102 /// Returns true if the button is on the left joycon
103 bool IsButtonOnLeftSide(Settings::NativeButton::Values button) const;
71 104
72 // Set to true if SDL supports game controller subsystem 105 // Set to true if SDL supports game controller subsystem
73 bool has_gamecontroller = false; 106 bool has_gamecontroller = false;
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp
index 37f7b24e1..35cc561be 100644
--- a/src/video_core/gpu.cpp
+++ b/src/video_core/gpu.cpp
@@ -104,7 +104,13 @@ void GPU::WaitFence(u32 syncpoint_id, u32 value) {
104 } 104 }
105 MICROPROFILE_SCOPE(GPU_wait); 105 MICROPROFILE_SCOPE(GPU_wait);
106 std::unique_lock lock{sync_mutex}; 106 std::unique_lock lock{sync_mutex};
107 sync_cv.wait(lock, [=, this] { return syncpoints.at(syncpoint_id).load() >= value; }); 107 sync_cv.wait(lock, [=, this] {
108 if (shutting_down.load(std::memory_order_relaxed)) {
109 // We're shutting down, ensure no threads continue to wait for the next syncpoint
110 return true;
111 }
112 return syncpoints.at(syncpoint_id).load() >= value;
113 });
108} 114}
109 115
110void GPU::IncrementSyncPoint(const u32 syncpoint_id) { 116void GPU::IncrementSyncPoint(const u32 syncpoint_id) {
@@ -523,6 +529,10 @@ void GPU::TriggerCpuInterrupt(const u32 syncpoint_id, const u32 value) const {
523} 529}
524 530
525void GPU::ShutDown() { 531void GPU::ShutDown() {
532 // Signal that threads should no longer block on syncpoint fences
533 shutting_down.store(true, std::memory_order_relaxed);
534 sync_cv.notify_all();
535
526 gpu_thread.ShutDown(); 536 gpu_thread.ShutDown();
527} 537}
528 538
diff --git a/src/video_core/gpu.h b/src/video_core/gpu.h
index 29a867863..a8e98e51b 100644
--- a/src/video_core/gpu.h
+++ b/src/video_core/gpu.h
@@ -389,6 +389,8 @@ private:
389 std::unique_ptr<Engines::KeplerMemory> kepler_memory; 389 std::unique_ptr<Engines::KeplerMemory> kepler_memory;
390 /// Shader build notifier 390 /// Shader build notifier
391 std::unique_ptr<VideoCore::ShaderNotify> shader_notify; 391 std::unique_ptr<VideoCore::ShaderNotify> shader_notify;
392 /// When true, we are about to shut down emulation session, so terminate outstanding tasks
393 std::atomic_bool shutting_down{};
392 394
393 std::array<std::atomic<u32>, Service::Nvidia::MaxSyncPoints> syncpoints{}; 395 std::array<std::atomic<u32>, Service::Nvidia::MaxSyncPoints> syncpoints{};
394 396
diff --git a/src/video_core/vulkan_common/vulkan_memory_allocator.cpp b/src/video_core/vulkan_common/vulkan_memory_allocator.cpp
index fa37aa79a..5edd06ebc 100644
--- a/src/video_core/vulkan_common/vulkan_memory_allocator.cpp
+++ b/src/video_core/vulkan_common/vulkan_memory_allocator.cpp
@@ -53,6 +53,18 @@ struct Range {
53 UNREACHABLE_MSG("Invalid memory usage={}", usage); 53 UNREACHABLE_MSG("Invalid memory usage={}", usage);
54 return VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT; 54 return VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;
55} 55}
56
57constexpr VkExportMemoryAllocateInfo EXPORT_ALLOCATE_INFO{
58 .sType = VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO,
59 .pNext = nullptr,
60#ifdef _WIN32
61 .handleTypes = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT,
62#elif __unix__
63 .handleTypes = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT,
64#else
65 .handleTypes = 0,
66#endif
67};
56} // Anonymous namespace 68} // Anonymous namespace
57 69
58class MemoryAllocation { 70class MemoryAllocation {
@@ -131,7 +143,7 @@ public:
131 143
132 /// Returns whether this allocation is compatible with the arguments. 144 /// Returns whether this allocation is compatible with the arguments.
133 [[nodiscard]] bool IsCompatible(VkMemoryPropertyFlags flags, u32 type_mask) const { 145 [[nodiscard]] bool IsCompatible(VkMemoryPropertyFlags flags, u32 type_mask) const {
134 return (flags & property_flags) && (type_mask & shifted_memory_type) != 0; 146 return (flags & property_flags) == property_flags && (type_mask & shifted_memory_type) != 0;
135 } 147 }
136 148
137private: 149private:
@@ -217,14 +229,18 @@ MemoryAllocator::~MemoryAllocator() = default;
217 229
218MemoryCommit MemoryAllocator::Commit(const VkMemoryRequirements& requirements, MemoryUsage usage) { 230MemoryCommit MemoryAllocator::Commit(const VkMemoryRequirements& requirements, MemoryUsage usage) {
219 // Find the fastest memory flags we can afford with the current requirements 231 // Find the fastest memory flags we can afford with the current requirements
220 const VkMemoryPropertyFlags flags = MemoryPropertyFlags(requirements.memoryTypeBits, usage); 232 const u32 type_mask = requirements.memoryTypeBits;
233 const VkMemoryPropertyFlags usage_flags = MemoryUsagePropertyFlags(usage);
234 const VkMemoryPropertyFlags flags = MemoryPropertyFlags(type_mask, usage_flags);
221 if (std::optional<MemoryCommit> commit = TryCommit(requirements, flags)) { 235 if (std::optional<MemoryCommit> commit = TryCommit(requirements, flags)) {
222 return std::move(*commit); 236 return std::move(*commit);
223 } 237 }
224 // Commit has failed, allocate more memory. 238 // Commit has failed, allocate more memory.
225 // TODO(Rodrigo): Handle out of memory situations in some way like flushing to guest memory. 239 const u64 chunk_size = AllocationChunkSize(requirements.size);
226 AllocMemory(flags, requirements.memoryTypeBits, AllocationChunkSize(requirements.size)); 240 if (!TryAllocMemory(flags, type_mask, chunk_size)) {
227 241 // TODO(Rodrigo): Handle out of memory situations in some way like flushing to guest memory.
242 throw vk::Exception(VK_ERROR_OUT_OF_DEVICE_MEMORY);
243 }
228 // Commit again, this time it won't fail since there's a fresh allocation above. 244 // Commit again, this time it won't fail since there's a fresh allocation above.
229 // If it does, there's a bug. 245 // If it does, there's a bug.
230 return TryCommit(requirements, flags).value(); 246 return TryCommit(requirements, flags).value();
@@ -242,26 +258,25 @@ MemoryCommit MemoryAllocator::Commit(const vk::Image& image, MemoryUsage usage)
242 return commit; 258 return commit;
243} 259}
244 260
245void MemoryAllocator::AllocMemory(VkMemoryPropertyFlags flags, u32 type_mask, u64 size) { 261bool MemoryAllocator::TryAllocMemory(VkMemoryPropertyFlags flags, u32 type_mask, u64 size) {
246 const u32 type = FindType(flags, type_mask).value(); 262 const u32 type = FindType(flags, type_mask).value();
247 const VkExportMemoryAllocateInfo export_allocate_info{ 263 vk::DeviceMemory memory = device.GetLogical().TryAllocateMemory({
248 .sType = VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO,
249 .pNext = nullptr,
250#ifdef _WIN32
251 .handleTypes = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT,
252#elif __unix__
253 .handleTypes = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT,
254#else
255 .handleTypes = 0,
256#endif
257 };
258 vk::DeviceMemory memory = device.GetLogical().AllocateMemory({
259 .sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO, 264 .sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO,
260 .pNext = export_allocations ? &export_allocate_info : nullptr, 265 .pNext = export_allocations ? &EXPORT_ALLOCATE_INFO : nullptr,
261 .allocationSize = size, 266 .allocationSize = size,
262 .memoryTypeIndex = type, 267 .memoryTypeIndex = type,
263 }); 268 });
269 if (!memory) {
270 if ((flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) != 0) {
271 // Try to allocate non device local memory
272 return TryAllocMemory(flags & ~VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT, type_mask, size);
273 } else {
274 // RIP
275 return false;
276 }
277 }
264 allocations.push_back(std::make_unique<MemoryAllocation>(std::move(memory), flags, size, type)); 278 allocations.push_back(std::make_unique<MemoryAllocation>(std::move(memory), flags, size, type));
279 return true;
265} 280}
266 281
267std::optional<MemoryCommit> MemoryAllocator::TryCommit(const VkMemoryRequirements& requirements, 282std::optional<MemoryCommit> MemoryAllocator::TryCommit(const VkMemoryRequirements& requirements,
@@ -274,24 +289,24 @@ std::optional<MemoryCommit> MemoryAllocator::TryCommit(const VkMemoryRequirement
274 return commit; 289 return commit;
275 } 290 }
276 } 291 }
292 if ((flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) != 0) {
293 // Look for non device local commits on failure
294 return TryCommit(requirements, flags & ~VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT);
295 }
277 return std::nullopt; 296 return std::nullopt;
278} 297}
279 298
280VkMemoryPropertyFlags MemoryAllocator::MemoryPropertyFlags(u32 type_mask, MemoryUsage usage) const {
281 return MemoryPropertyFlags(type_mask, MemoryUsagePropertyFlags(usage));
282}
283
284VkMemoryPropertyFlags MemoryAllocator::MemoryPropertyFlags(u32 type_mask, 299VkMemoryPropertyFlags MemoryAllocator::MemoryPropertyFlags(u32 type_mask,
285 VkMemoryPropertyFlags flags) const { 300 VkMemoryPropertyFlags flags) const {
286 if (FindType(flags, type_mask)) { 301 if (FindType(flags, type_mask)) {
287 // Found a memory type with those requirements 302 // Found a memory type with those requirements
288 return flags; 303 return flags;
289 } 304 }
290 if (flags & VK_MEMORY_PROPERTY_HOST_CACHED_BIT) { 305 if ((flags & VK_MEMORY_PROPERTY_HOST_CACHED_BIT) != 0) {
291 // Remove host cached bit in case it's not supported 306 // Remove host cached bit in case it's not supported
292 return MemoryPropertyFlags(type_mask, flags & ~VK_MEMORY_PROPERTY_HOST_CACHED_BIT); 307 return MemoryPropertyFlags(type_mask, flags & ~VK_MEMORY_PROPERTY_HOST_CACHED_BIT);
293 } 308 }
294 if (flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) { 309 if ((flags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT) != 0) {
295 // Remove device local, if it's not supported by the requested resource 310 // Remove device local, if it's not supported by the requested resource
296 return MemoryPropertyFlags(type_mask, flags & ~VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT); 311 return MemoryPropertyFlags(type_mask, flags & ~VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT);
297 } 312 }
@@ -302,7 +317,7 @@ VkMemoryPropertyFlags MemoryAllocator::MemoryPropertyFlags(u32 type_mask,
302std::optional<u32> MemoryAllocator::FindType(VkMemoryPropertyFlags flags, u32 type_mask) const { 317std::optional<u32> MemoryAllocator::FindType(VkMemoryPropertyFlags flags, u32 type_mask) const {
303 for (u32 type_index = 0; type_index < properties.memoryTypeCount; ++type_index) { 318 for (u32 type_index = 0; type_index < properties.memoryTypeCount; ++type_index) {
304 const VkMemoryPropertyFlags type_flags = properties.memoryTypes[type_index].propertyFlags; 319 const VkMemoryPropertyFlags type_flags = properties.memoryTypes[type_index].propertyFlags;
305 if ((type_mask & (1U << type_index)) && (type_flags & flags)) { 320 if ((type_mask & (1U << type_index)) != 0 && (type_flags & flags) == flags) {
306 // The type matches in type and in the wanted properties. 321 // The type matches in type and in the wanted properties.
307 return type_index; 322 return type_index;
308 } 323 }
diff --git a/src/video_core/vulkan_common/vulkan_memory_allocator.h b/src/video_core/vulkan_common/vulkan_memory_allocator.h
index d1ce29450..db12d02f4 100644
--- a/src/video_core/vulkan_common/vulkan_memory_allocator.h
+++ b/src/video_core/vulkan_common/vulkan_memory_allocator.h
@@ -101,16 +101,13 @@ public:
101 MemoryCommit Commit(const vk::Image& image, MemoryUsage usage); 101 MemoryCommit Commit(const vk::Image& image, MemoryUsage usage);
102 102
103private: 103private:
104 /// Allocates a chunk of memory. 104 /// Tries to allocate a chunk of memory.
105 void AllocMemory(VkMemoryPropertyFlags flags, u32 type_mask, u64 size); 105 bool TryAllocMemory(VkMemoryPropertyFlags flags, u32 type_mask, u64 size);
106 106
107 /// Tries to allocate a memory commit. 107 /// Tries to allocate a memory commit.
108 std::optional<MemoryCommit> TryCommit(const VkMemoryRequirements& requirements, 108 std::optional<MemoryCommit> TryCommit(const VkMemoryRequirements& requirements,
109 VkMemoryPropertyFlags flags); 109 VkMemoryPropertyFlags flags);
110 110
111 /// Returns the fastest compatible memory property flags from a wanted usage.
112 VkMemoryPropertyFlags MemoryPropertyFlags(u32 type_mask, MemoryUsage usage) const;
113
114 /// Returns the fastest compatible memory property flags from the wanted flags. 111 /// Returns the fastest compatible memory property flags from the wanted flags.
115 VkMemoryPropertyFlags MemoryPropertyFlags(u32 type_mask, VkMemoryPropertyFlags flags) const; 112 VkMemoryPropertyFlags MemoryPropertyFlags(u32 type_mask, VkMemoryPropertyFlags flags) const;
116 113
diff --git a/src/yuzu/applets/software_keyboard.cpp b/src/yuzu/applets/software_keyboard.cpp
index a9a095d58..aa453a79f 100644
--- a/src/yuzu/applets/software_keyboard.cpp
+++ b/src/yuzu/applets/software_keyboard.cpp
@@ -1101,12 +1101,11 @@ void QtSoftwareKeyboardDialog::NormalKeyboardButtonClicked(QPushButton* button)
1101 } 1101 }
1102 1102
1103 if (button == ui->button_ok || button == ui->button_ok_shift || button == ui->button_ok_num) { 1103 if (button == ui->button_ok || button == ui->button_ok_shift || button == ui->button_ok_num) {
1104 if (ui->topOSK->currentIndex() == 1) { 1104 auto text = ui->topOSK->currentIndex() == 1
1105 emit SubmitNormalText(SwkbdResult::Ok, 1105 ? ui->text_edit_osk->toPlainText().toStdU16String()
1106 ui->text_edit_osk->toPlainText().toStdU16String()); 1106 : ui->line_edit_osk->text().toStdU16String();
1107 } else { 1107
1108 emit SubmitNormalText(SwkbdResult::Ok, ui->line_edit_osk->text().toStdU16String()); 1108 emit SubmitNormalText(SwkbdResult::Ok, std::move(text));
1109 }
1110 return; 1109 return;
1111 } 1110 }
1112 1111
@@ -1265,13 +1264,11 @@ void QtSoftwareKeyboardDialog::TranslateButtonPress(HIDButton button) {
1265 if (is_inline) { 1264 if (is_inline) {
1266 emit SubmitInlineText(SwkbdReplyType::DecidedCancel, current_text, cursor_position); 1265 emit SubmitInlineText(SwkbdReplyType::DecidedCancel, current_text, cursor_position);
1267 } else { 1266 } else {
1268 if (ui->topOSK->currentIndex() == 1) { 1267 auto text = ui->topOSK->currentIndex() == 1
1269 emit SubmitNormalText(SwkbdResult::Cancel, 1268 ? ui->text_edit_osk->toPlainText().toStdU16String()
1270 ui->text_edit_osk->toPlainText().toStdU16String()); 1269 : ui->line_edit_osk->text().toStdU16String();
1271 } else { 1270
1272 emit SubmitNormalText(SwkbdResult::Cancel, 1271 emit SubmitNormalText(SwkbdResult::Cancel, std::move(text));
1273 ui->line_edit_osk->text().toStdU16String());
1274 }
1275 } 1272 }
1276 break; 1273 break;
1277 case HIDButton::Y: 1274 case HIDButton::Y:
@@ -1563,7 +1560,7 @@ void QtSoftwareKeyboard::ShowNormalKeyboard() const {
1563void QtSoftwareKeyboard::ShowTextCheckDialog( 1560void QtSoftwareKeyboard::ShowTextCheckDialog(
1564 Service::AM::Applets::SwkbdTextCheckResult text_check_result, 1561 Service::AM::Applets::SwkbdTextCheckResult text_check_result,
1565 std::u16string text_check_message) const { 1562 std::u16string text_check_message) const {
1566 emit MainWindowShowTextCheckDialog(text_check_result, text_check_message); 1563 emit MainWindowShowTextCheckDialog(text_check_result, std::move(text_check_message));
1567} 1564}
1568 1565
1569void QtSoftwareKeyboard::ShowInlineKeyboard( 1566void QtSoftwareKeyboard::ShowInlineKeyboard(
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp
index eb58bfa5b..e9d4bef60 100644
--- a/src/yuzu/configuration/config.cpp
+++ b/src/yuzu/configuration/config.cpp
@@ -255,7 +255,8 @@ void Config::Initialize(const std::string& config_name) {
255 Reload(); 255 Reload();
256 break; 256 break;
257 case ConfigType::PerGameConfig: 257 case ConfigType::PerGameConfig:
258 qt_config_loc = FS::PathToUTF8String(fs_config_loc / "custom" / config_file); 258 qt_config_loc =
259 FS::PathToUTF8String(fs_config_loc / "custom" / FS::ToU8String(config_file));
259 void(FS::CreateParentDir(qt_config_loc)); 260 void(FS::CreateParentDir(qt_config_loc));
260 qt_config = std::make_unique<QSettings>(QString::fromStdString(qt_config_loc), 261 qt_config = std::make_unique<QSettings>(QString::fromStdString(qt_config_loc),
261 QSettings::IniFormat); 262 QSettings::IniFormat);
diff --git a/src/yuzu/configuration/configure_per_game.cpp b/src/yuzu/configuration/configure_per_game.cpp
index d89f1ad4b..a1d434aca 100644
--- a/src/yuzu/configuration/configure_per_game.cpp
+++ b/src/yuzu/configuration/configure_per_game.cpp
@@ -3,9 +3,13 @@
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <algorithm> 5#include <algorithm>
6#include <filesystem>
6#include <memory> 7#include <memory>
8#include <string>
7#include <utility> 9#include <utility>
8 10
11#include <fmt/format.h>
12
9#include <QAbstractButton> 13#include <QAbstractButton>
10#include <QCheckBox> 14#include <QCheckBox>
11#include <QDialogButtonBox> 15#include <QDialogButtonBox>
@@ -17,6 +21,8 @@
17#include <QTimer> 21#include <QTimer>
18#include <QTreeView> 22#include <QTreeView>
19 23
24#include "common/fs/fs_util.h"
25#include "common/fs/path_util.h"
20#include "core/core.h" 26#include "core/core.h"
21#include "core/file_sys/control_metadata.h" 27#include "core/file_sys/control_metadata.h"
22#include "core/file_sys/patch_manager.h" 28#include "core/file_sys/patch_manager.h"
@@ -29,10 +35,12 @@
29#include "yuzu/uisettings.h" 35#include "yuzu/uisettings.h"
30#include "yuzu/util/util.h" 36#include "yuzu/util/util.h"
31 37
32ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id) 38ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id, const std::string& file_name)
33 : QDialog(parent), ui(std::make_unique<Ui::ConfigurePerGame>()), title_id(title_id) { 39 : QDialog(parent), ui(std::make_unique<Ui::ConfigurePerGame>()), title_id(title_id) {
34 game_config = std::make_unique<Config>(fmt::format("{:016X}", title_id), 40 const auto file_path = std::filesystem::path(Common::FS::ToU8String(file_name));
35 Config::ConfigType::PerGameConfig); 41 const auto config_file_name = title_id == 0 ? Common::FS::PathToUTF8String(file_path.filename())
42 : fmt::format("{:016X}", title_id);
43 game_config = std::make_unique<Config>(config_file_name, Config::ConfigType::PerGameConfig);
36 44
37 Settings::SetConfiguringGlobal(false); 45 Settings::SetConfiguringGlobal(false);
38 46
diff --git a/src/yuzu/configuration/configure_per_game.h b/src/yuzu/configuration/configure_per_game.h
index f6e6ab7c4..a2d0211a3 100644
--- a/src/yuzu/configuration/configure_per_game.h
+++ b/src/yuzu/configuration/configure_per_game.h
@@ -5,6 +5,7 @@
5#pragma once 5#pragma once
6 6
7#include <memory> 7#include <memory>
8#include <string>
8#include <vector> 9#include <vector>
9 10
10#include <QDialog> 11#include <QDialog>
@@ -27,7 +28,8 @@ class ConfigurePerGame : public QDialog {
27 Q_OBJECT 28 Q_OBJECT
28 29
29public: 30public:
30 explicit ConfigurePerGame(QWidget* parent, u64 title_id); 31 // Cannot use std::filesystem::path due to https://bugreports.qt.io/browse/QTBUG-73263
32 explicit ConfigurePerGame(QWidget* parent, u64 title_id, const std::string& file_name);
31 ~ConfigurePerGame() override; 33 ~ConfigurePerGame() override;
32 34
33 /// Save all button configurations to settings file 35 /// Save all button configurations to settings file
diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp
index 63cf82f7d..9308cfef8 100644
--- a/src/yuzu/game_list.cpp
+++ b/src/yuzu/game_list.cpp
@@ -91,9 +91,8 @@ QString GameListSearchField::filterText() const {
91 91
92QString GameList::GetLastFilterResultItem() const { 92QString GameList::GetLastFilterResultItem() const {
93 QString file_path; 93 QString file_path;
94 const int folder_count = item_model->rowCount();
95 94
96 for (int i = 0; i < folder_count; ++i) { 95 for (int i = 1; i < item_model->rowCount() - 1; ++i) {
97 const QStandardItem* folder = item_model->item(i, 0); 96 const QStandardItem* folder = item_model->item(i, 0);
98 const QModelIndex folder_index = folder->index(); 97 const QModelIndex folder_index = folder->index();
99 const int children_count = folder->rowCount(); 98 const int children_count = folder->rowCount();
@@ -184,7 +183,6 @@ void GameList::OnItemExpanded(const QModelIndex& item) {
184 183
185// Event in order to filter the gamelist after editing the searchfield 184// Event in order to filter the gamelist after editing the searchfield
186void GameList::OnTextChanged(const QString& new_text) { 185void GameList::OnTextChanged(const QString& new_text) {
187 const int folder_count = tree_view->model()->rowCount();
188 QString edit_filter_text = new_text.toLower(); 186 QString edit_filter_text = new_text.toLower();
189 QStandardItem* folder; 187 QStandardItem* folder;
190 int children_total = 0; 188 int children_total = 0;
@@ -194,7 +192,7 @@ void GameList::OnTextChanged(const QString& new_text) {
194 if (edit_filter_text.isEmpty()) { 192 if (edit_filter_text.isEmpty()) {
195 tree_view->setRowHidden(0, item_model->invisibleRootItem()->index(), 193 tree_view->setRowHidden(0, item_model->invisibleRootItem()->index(),
196 UISettings::values.favorited_ids.size() == 0); 194 UISettings::values.favorited_ids.size() == 0);
197 for (int i = 1; i < folder_count; ++i) { 195 for (int i = 1; i < item_model->rowCount() - 1; ++i) {
198 folder = item_model->item(i, 0); 196 folder = item_model->item(i, 0);
199 const QModelIndex folder_index = folder->index(); 197 const QModelIndex folder_index = folder->index();
200 const int children_count = folder->rowCount(); 198 const int children_count = folder->rowCount();
@@ -207,7 +205,7 @@ void GameList::OnTextChanged(const QString& new_text) {
207 } else { 205 } else {
208 tree_view->setRowHidden(0, item_model->invisibleRootItem()->index(), true); 206 tree_view->setRowHidden(0, item_model->invisibleRootItem()->index(), true);
209 int result_count = 0; 207 int result_count = 0;
210 for (int i = 1; i < folder_count; ++i) { 208 for (int i = 1; i < item_model->rowCount() - 1; ++i) {
211 folder = item_model->item(i, 0); 209 folder = item_model->item(i, 0);
212 const QModelIndex folder_index = folder->index(); 210 const QModelIndex folder_index = folder->index();
213 const int children_count = folder->rowCount(); 211 const int children_count = folder->rowCount();
@@ -328,18 +326,14 @@ GameList::GameList(FileSys::VirtualFilesystem vfs, FileSys::ManualContentProvide
328 tree_view->setContextMenuPolicy(Qt::CustomContextMenu); 326 tree_view->setContextMenuPolicy(Qt::CustomContextMenu);
329 tree_view->setStyleSheet(QStringLiteral("QTreeView{ border: none; }")); 327 tree_view->setStyleSheet(QStringLiteral("QTreeView{ border: none; }"));
330 328
331 item_model->insertColumns(0, UISettings::values.show_add_ons ? COLUMN_COUNT : COLUMN_COUNT - 1); 329 item_model->insertColumns(0, COLUMN_COUNT);
332 item_model->setHeaderData(COLUMN_NAME, Qt::Horizontal, tr("Name")); 330 item_model->setHeaderData(COLUMN_NAME, Qt::Horizontal, tr("Name"));
333 item_model->setHeaderData(COLUMN_COMPATIBILITY, Qt::Horizontal, tr("Compatibility")); 331 item_model->setHeaderData(COLUMN_COMPATIBILITY, Qt::Horizontal, tr("Compatibility"));
334 332
335 if (UISettings::values.show_add_ons) { 333 item_model->setHeaderData(COLUMN_ADD_ONS, Qt::Horizontal, tr("Add-ons"));
336 item_model->setHeaderData(COLUMN_ADD_ONS, Qt::Horizontal, tr("Add-ons")); 334 tree_view->setColumnHidden(COLUMN_ADD_ONS, !UISettings::values.show_add_ons);
337 item_model->setHeaderData(COLUMN_FILE_TYPE, Qt::Horizontal, tr("File type")); 335 item_model->setHeaderData(COLUMN_FILE_TYPE, Qt::Horizontal, tr("File type"));
338 item_model->setHeaderData(COLUMN_SIZE, Qt::Horizontal, tr("Size")); 336 item_model->setHeaderData(COLUMN_SIZE, Qt::Horizontal, tr("Size"));
339 } else {
340 item_model->setHeaderData(COLUMN_FILE_TYPE - 1, Qt::Horizontal, tr("File type"));
341 item_model->setHeaderData(COLUMN_SIZE - 1, Qt::Horizontal, tr("Size"));
342 }
343 item_model->setSortRole(GameListItemPath::SortRole); 337 item_model->setSortRole(GameListItemPath::SortRole);
344 338
345 connect(main_window, &GMainWindow::UpdateThemedIcons, this, &GameList::OnUpdateThemedIcons); 339 connect(main_window, &GMainWindow::UpdateThemedIcons, this, &GameList::OnUpdateThemedIcons);
@@ -466,9 +460,8 @@ void GameList::DonePopulating(const QStringList& watch_list) {
466 QCoreApplication::processEvents(); 460 QCoreApplication::processEvents();
467 } 461 }
468 tree_view->setEnabled(true); 462 tree_view->setEnabled(true);
469 const int folder_count = tree_view->model()->rowCount();
470 int children_total = 0; 463 int children_total = 0;
471 for (int i = 1; i < folder_count; ++i) { 464 for (int i = 1; i < item_model->rowCount() - 1; ++i) {
472 children_total += item_model->item(i, 0)->rowCount(); 465 children_total += item_model->item(i, 0)->rowCount();
473 } 466 }
474 search_field->setFilterResult(children_total, children_total); 467 search_field->setFilterResult(children_total, children_total);
@@ -561,11 +554,11 @@ void GameList::AddGamePopup(QMenu& context_menu, u64 program_id, const std::stri
561 connect(remove_dlc, &QAction::triggered, [this, program_id]() { 554 connect(remove_dlc, &QAction::triggered, [this, program_id]() {
562 emit RemoveInstalledEntryRequested(program_id, InstalledEntryType::AddOnContent); 555 emit RemoveInstalledEntryRequested(program_id, InstalledEntryType::AddOnContent);
563 }); 556 });
564 connect(remove_shader_cache, &QAction::triggered, [this, program_id]() { 557 connect(remove_shader_cache, &QAction::triggered, [this, program_id, path]() {
565 emit RemoveFileRequested(program_id, GameListRemoveTarget::ShaderCache); 558 emit RemoveFileRequested(program_id, GameListRemoveTarget::ShaderCache, path);
566 }); 559 });
567 connect(remove_custom_config, &QAction::triggered, [this, program_id]() { 560 connect(remove_custom_config, &QAction::triggered, [this, program_id, path]() {
568 emit RemoveFileRequested(program_id, GameListRemoveTarget::CustomConfiguration); 561 emit RemoveFileRequested(program_id, GameListRemoveTarget::CustomConfiguration, path);
569 }); 562 });
570 connect(dump_romfs, &QAction::triggered, 563 connect(dump_romfs, &QAction::triggered,
571 [this, program_id, path]() { emit DumpRomFSRequested(program_id, path); }); 564 [this, program_id, path]() { emit DumpRomFSRequested(program_id, path); });
@@ -649,9 +642,9 @@ void GameList::AddPermDirPopup(QMenu& context_menu, QModelIndex selected) {
649} 642}
650 643
651void GameList::AddFavoritesPopup(QMenu& context_menu) { 644void GameList::AddFavoritesPopup(QMenu& context_menu) {
652 QAction* clear_all = context_menu.addAction(tr("Clear")); 645 QAction* clear = context_menu.addAction(tr("Clear"));
653 646
654 connect(clear_all, &QAction::triggered, [this] { 647 connect(clear, &QAction::triggered, [this] {
655 for (const auto id : UISettings::values.favorited_ids) { 648 for (const auto id : UISettings::values.favorited_ids) {
656 RemoveFavorite(id); 649 RemoveFavorite(id);
657 } 650 }
@@ -708,22 +701,7 @@ void GameList::PopulateAsync(QVector<UISettings::GameDir>& game_dirs) {
708 tree_view->setEnabled(false); 701 tree_view->setEnabled(false);
709 702
710 // Update the columns in case UISettings has changed 703 // Update the columns in case UISettings has changed
711 item_model->removeColumns(0, item_model->columnCount()); 704 tree_view->setColumnHidden(COLUMN_ADD_ONS, !UISettings::values.show_add_ons);
712 item_model->insertColumns(0, UISettings::values.show_add_ons ? COLUMN_COUNT : COLUMN_COUNT - 1);
713 item_model->setHeaderData(COLUMN_NAME, Qt::Horizontal, tr("Name"));
714 item_model->setHeaderData(COLUMN_COMPATIBILITY, Qt::Horizontal, tr("Compatibility"));
715
716 if (UISettings::values.show_add_ons) {
717 item_model->setHeaderData(COLUMN_ADD_ONS, Qt::Horizontal, tr("Add-ons"));
718 item_model->setHeaderData(COLUMN_FILE_TYPE, Qt::Horizontal, tr("File type"));
719 item_model->setHeaderData(COLUMN_SIZE, Qt::Horizontal, tr("Size"));
720 } else {
721 item_model->setHeaderData(COLUMN_FILE_TYPE - 1, Qt::Horizontal, tr("File type"));
722 item_model->setHeaderData(COLUMN_SIZE - 1, Qt::Horizontal, tr("Size"));
723 item_model->removeColumns(COLUMN_COUNT - 1, 1);
724 }
725
726 LoadInterfaceLayout();
727 705
728 // Delete any rows that might already exist if we're repopulating 706 // Delete any rows that might already exist if we're repopulating
729 item_model->removeRows(0, item_model->rowCount()); 707 item_model->removeRows(0, item_model->rowCount());
@@ -800,7 +778,7 @@ void GameList::AddFavorite(u64 program_id) {
800 if (folder->child(j)->data(GameListItemPath::ProgramIdRole).toULongLong() == 778 if (folder->child(j)->data(GameListItemPath::ProgramIdRole).toULongLong() ==
801 program_id) { 779 program_id) {
802 QList<QStandardItem*> list; 780 QList<QStandardItem*> list;
803 for (int k = 0; k < item_model->columnCount(); k++) { 781 for (int k = 0; k < COLUMN_COUNT; k++) {
804 list.append(folder->child(j, k)->clone()); 782 list.append(folder->child(j, k)->clone());
805 } 783 }
806 list[0]->setData(folder->child(j)->data(GameListItem::SortRole), 784 list[0]->setData(folder->child(j)->data(GameListItem::SortRole),
diff --git a/src/yuzu/game_list.h b/src/yuzu/game_list.h
index 9c0a1a482..ab6866735 100644
--- a/src/yuzu/game_list.h
+++ b/src/yuzu/game_list.h
@@ -88,7 +88,8 @@ signals:
88 const std::string& game_path); 88 const std::string& game_path);
89 void OpenTransferableShaderCacheRequested(u64 program_id); 89 void OpenTransferableShaderCacheRequested(u64 program_id);
90 void RemoveInstalledEntryRequested(u64 program_id, InstalledEntryType type); 90 void RemoveInstalledEntryRequested(u64 program_id, InstalledEntryType type);
91 void RemoveFileRequested(u64 program_id, GameListRemoveTarget target); 91 void RemoveFileRequested(u64 program_id, GameListRemoveTarget target,
92 const std::string& game_path);
92 void DumpRomFSRequested(u64 program_id, const std::string& game_path); 93 void DumpRomFSRequested(u64 program_id, const std::string& game_path);
93 void CopyTIDRequested(u64 program_id); 94 void CopyTIDRequested(u64 program_id);
94 void NavigateToGamedbEntryRequested(u64 program_id, 95 void NavigateToGamedbEntryRequested(u64 program_id,
diff --git a/src/yuzu/game_list_worker.cpp b/src/yuzu/game_list_worker.cpp
index 485045334..33cc90d5a 100644
--- a/src/yuzu/game_list_worker.cpp
+++ b/src/yuzu/game_list_worker.cpp
@@ -215,13 +215,11 @@ QList<QStandardItem*> MakeGameListEntry(const std::string& path, const std::stri
215 new GameListItemSize(Common::FS::GetSize(path)), 215 new GameListItemSize(Common::FS::GetSize(path)),
216 }; 216 };
217 217
218 if (UISettings::values.show_add_ons) { 218 const auto patch_versions = GetGameListCachedObject(
219 const auto patch_versions = GetGameListCachedObject( 219 fmt::format("{:016X}", patch.GetTitleID()), "pv.txt", [&patch, &loader] {
220 fmt::format("{:016X}", patch.GetTitleID()), "pv.txt", [&patch, &loader] { 220 return FormatPatchNameVersions(patch, loader, loader.IsRomFSUpdatable());
221 return FormatPatchNameVersions(patch, loader, loader.IsRomFSUpdatable()); 221 });
222 }); 222 list.insert(2, new GameListItem(patch_versions));
223 list.insert(2, new GameListItem(patch_versions));
224 }
225 223
226 return list; 224 return list;
227} 225}
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 0f0e228b0..237e26829 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -1334,7 +1334,11 @@ void GMainWindow::BootGame(const QString& filename, std::size_t program_index) {
1334 1334
1335 if (!(loader == nullptr || loader->ReadProgramId(title_id) != Loader::ResultStatus::Success)) { 1335 if (!(loader == nullptr || loader->ReadProgramId(title_id) != Loader::ResultStatus::Success)) {
1336 // Load per game settings 1336 // Load per game settings
1337 Config per_game_config(fmt::format("{:016X}", title_id), Config::ConfigType::PerGameConfig); 1337 const auto file_path = std::filesystem::path{filename.toStdU16String()};
1338 const auto config_file_name = title_id == 0
1339 ? Common::FS::PathToUTF8String(file_path.filename())
1340 : fmt::format("{:016X}", title_id);
1341 Config per_game_config(config_file_name, Config::ConfigType::PerGameConfig);
1338 } 1342 }
1339 1343
1340 ConfigureVibration::SetAllVibrationDevices(); 1344 ConfigureVibration::SetAllVibrationDevices();
@@ -1795,7 +1799,8 @@ void GMainWindow::RemoveAddOnContent(u64 program_id, const QString& entry_type)
1795 tr("Successfully removed %1 installed DLC.").arg(count)); 1799 tr("Successfully removed %1 installed DLC.").arg(count));
1796} 1800}
1797 1801
1798void GMainWindow::OnGameListRemoveFile(u64 program_id, GameListRemoveTarget target) { 1802void GMainWindow::OnGameListRemoveFile(u64 program_id, GameListRemoveTarget target,
1803 const std::string& game_path) {
1799 const QString question = [this, target] { 1804 const QString question = [this, target] {
1800 switch (target) { 1805 switch (target) {
1801 case GameListRemoveTarget::ShaderCache: 1806 case GameListRemoveTarget::ShaderCache:
@@ -1817,7 +1822,7 @@ void GMainWindow::OnGameListRemoveFile(u64 program_id, GameListRemoveTarget targ
1817 RemoveTransferableShaderCache(program_id); 1822 RemoveTransferableShaderCache(program_id);
1818 break; 1823 break;
1819 case GameListRemoveTarget::CustomConfiguration: 1824 case GameListRemoveTarget::CustomConfiguration:
1820 RemoveCustomConfiguration(program_id); 1825 RemoveCustomConfiguration(program_id, game_path);
1821 break; 1826 break;
1822 } 1827 }
1823} 1828}
@@ -1842,9 +1847,13 @@ void GMainWindow::RemoveTransferableShaderCache(u64 program_id) {
1842 } 1847 }
1843} 1848}
1844 1849
1845void GMainWindow::RemoveCustomConfiguration(u64 program_id) { 1850void GMainWindow::RemoveCustomConfiguration(u64 program_id, const std::string& game_path) {
1846 const auto custom_config_file_path = Common::FS::GetYuzuPath(Common::FS::YuzuPath::ConfigDir) / 1851 const auto file_path = std::filesystem::path(Common::FS::ToU8String(game_path));
1847 "custom" / fmt::format("{:016X}.ini", program_id); 1852 const auto config_file_name =
1853 program_id == 0 ? Common::FS::PathToUTF8String(file_path.filename()).append(".ini")
1854 : fmt::format("{:016X}.ini", program_id);
1855 const auto custom_config_file_path =
1856 Common::FS::GetYuzuPath(Common::FS::YuzuPath::ConfigDir) / "custom" / config_file_name;
1848 1857
1849 if (!Common::FS::Exists(custom_config_file_path)) { 1858 if (!Common::FS::Exists(custom_config_file_path)) {
1850 QMessageBox::warning(this, tr("Error Removing Custom Configuration"), 1859 QMessageBox::warning(this, tr("Error Removing Custom Configuration"),
@@ -2635,7 +2644,7 @@ void GMainWindow::OpenPerGameConfiguration(u64 title_id, const std::string& file
2635 const auto v_file = Core::GetGameFileFromPath(vfs, file_name); 2644 const auto v_file = Core::GetGameFileFromPath(vfs, file_name);
2636 const auto& system = Core::System::GetInstance(); 2645 const auto& system = Core::System::GetInstance();
2637 2646
2638 ConfigurePerGame dialog(this, title_id); 2647 ConfigurePerGame dialog(this, title_id, file_name);
2639 dialog.LoadFromFile(v_file); 2648 dialog.LoadFromFile(v_file);
2640 const auto result = dialog.exec(); 2649 const auto result = dialog.exec();
2641 2650
diff --git a/src/yuzu/main.h b/src/yuzu/main.h
index b3a5033ce..490b6889f 100644
--- a/src/yuzu/main.h
+++ b/src/yuzu/main.h
@@ -236,7 +236,8 @@ private slots:
236 const std::string& game_path); 236 const std::string& game_path);
237 void OnTransferableShaderCacheOpenFile(u64 program_id); 237 void OnTransferableShaderCacheOpenFile(u64 program_id);
238 void OnGameListRemoveInstalledEntry(u64 program_id, InstalledEntryType type); 238 void OnGameListRemoveInstalledEntry(u64 program_id, InstalledEntryType type);
239 void OnGameListRemoveFile(u64 program_id, GameListRemoveTarget target); 239 void OnGameListRemoveFile(u64 program_id, GameListRemoveTarget target,
240 const std::string& game_path);
240 void OnGameListDumpRomFS(u64 program_id, const std::string& game_path); 241 void OnGameListDumpRomFS(u64 program_id, const std::string& game_path);
241 void OnGameListCopyTID(u64 program_id); 242 void OnGameListCopyTID(u64 program_id);
242 void OnGameListNavigateToGamedbEntry(u64 program_id, 243 void OnGameListNavigateToGamedbEntry(u64 program_id,
@@ -275,7 +276,7 @@ private:
275 void RemoveUpdateContent(u64 program_id, const QString& entry_type); 276 void RemoveUpdateContent(u64 program_id, const QString& entry_type);
276 void RemoveAddOnContent(u64 program_id, const QString& entry_type); 277 void RemoveAddOnContent(u64 program_id, const QString& entry_type);
277 void RemoveTransferableShaderCache(u64 program_id); 278 void RemoveTransferableShaderCache(u64 program_id);
278 void RemoveCustomConfiguration(u64 program_id); 279 void RemoveCustomConfiguration(u64 program_id, const std::string& game_path);
279 std::optional<u64> SelectRomFSDumpTarget(const FileSys::ContentProvider&, u64 program_id); 280 std::optional<u64> SelectRomFSDumpTarget(const FileSys::ContentProvider&, u64 program_id);
280 InstallResult InstallNSPXCI(const QString& filename); 281 InstallResult InstallNSPXCI(const QString& filename);
281 InstallResult InstallNCA(const QString& filename); 282 InstallResult InstallNCA(const QString& filename);