diff options
Diffstat (limited to 'src')
172 files changed, 1712 insertions, 1311 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 | ||
| 203 | void AudioRenderer::QueueMixedBuffer(Buffer::Tag tag) { | 203 | void 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 | ||
| 413 | bool InfoUpdater::UpdateSinks(SinkContext& sink_context) { | 413 | bool InfoUpdater::UpdateSinks(SinkContext& sink_context) { |
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 7a4d9e354..2d403d471 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt | |||
| @@ -21,14 +21,14 @@ find_package(Git QUIET) | |||
| 21 | 21 | ||
| 22 | add_custom_command(OUTPUT scm_rev.cpp | 22 | add_custom_command(OUTPUT scm_rev.cpp |
| 23 | COMMAND ${CMAKE_COMMAND} | 23 | COMMAND ${CMAKE_COMMAND} |
| 24 | -DSRC_DIR="${CMAKE_SOURCE_DIR}" | 24 | -DSRC_DIR=${CMAKE_SOURCE_DIR} |
| 25 | -DBUILD_REPOSITORY="${BUILD_REPOSITORY}" | 25 | -DBUILD_REPOSITORY=${BUILD_REPOSITORY} |
| 26 | -DTITLE_BAR_FORMAT_IDLE="${TITLE_BAR_FORMAT_IDLE}" | 26 | -DTITLE_BAR_FORMAT_IDLE=${TITLE_BAR_FORMAT_IDLE} |
| 27 | -DTITLE_BAR_FORMAT_RUNNING="${TITLE_BAR_FORMAT_RUNNING}" | 27 | -DTITLE_BAR_FORMAT_RUNNING=${TITLE_BAR_FORMAT_RUNNING} |
| 28 | -DBUILD_TAG="${BUILD_TAG}" | 28 | -DBUILD_TAG=${BUILD_TAG} |
| 29 | -DBUILD_ID="${DISPLAY_VERSION}" | 29 | -DBUILD_ID=${DISPLAY_VERSION} |
| 30 | -DGIT_EXECUTABLE="${GIT_EXECUTABLE}" | 30 | -DGIT_EXECUTABLE=${GIT_EXECUTABLE} |
| 31 | -P "${CMAKE_SOURCE_DIR}/CMakeModules/GenerateSCMRev.cmake" | 31 | -P ${CMAKE_SOURCE_DIR}/CMakeModules/GenerateSCMRev.cmake |
| 32 | DEPENDS | 32 | DEPENDS |
| 33 | # WARNING! It was too much work to try and make a common location for this list, | 33 | # WARNING! It was too much work to try and make a common location for this list, |
| 34 | # so if you need to change it, please update CMakeModules/GenerateSCMRev.cmake as well | 34 | # so if you need to change it, please update CMakeModules/GenerateSCMRev.cmake as well |
| @@ -92,6 +92,7 @@ add_custom_command(OUTPUT scm_rev.cpp | |||
| 92 | "${CMAKE_CURRENT_SOURCE_DIR}/scm_rev.h" | 92 | "${CMAKE_CURRENT_SOURCE_DIR}/scm_rev.h" |
| 93 | # technically we should regenerate if the git version changed, but its not worth the effort imo | 93 | # technically we should regenerate if the git version changed, but its not worth the effort imo |
| 94 | "${CMAKE_SOURCE_DIR}/CMakeModules/GenerateSCMRev.cmake" | 94 | "${CMAKE_SOURCE_DIR}/CMakeModules/GenerateSCMRev.cmake" |
| 95 | VERBATIM | ||
| 95 | ) | 96 | ) |
| 96 | 97 | ||
| 97 | add_library(common STATIC | 98 | add_library(common STATIC |
diff --git a/src/common/fs/path_util.h b/src/common/fs/path_util.h index 14e8c35d7..f956ac9a2 100644 --- a/src/common/fs/path_util.h +++ b/src/common/fs/path_util.h | |||
| @@ -209,7 +209,7 @@ void SetYuzuPath(YuzuPath yuzu_path, const std::filesystem::path& new_path); | |||
| 209 | 209 | ||
| 210 | #ifdef _WIN32 | 210 | #ifdef _WIN32 |
| 211 | template <typename Path> | 211 | template <typename Path> |
| 212 | [[nodiscard]] void SetYuzuPath(YuzuPath yuzu_path, const Path& new_path) { | 212 | void SetYuzuPath(YuzuPath yuzu_path, const Path& new_path) { |
| 213 | if constexpr (IsChar<typename Path::value_type>) { | 213 | if constexpr (IsChar<typename Path::value_type>) { |
| 214 | SetYuzuPath(yuzu_path, ToU8String(new_path)); | 214 | SetYuzuPath(yuzu_path, ToU8String(new_path)); |
| 215 | } else { | 215 | } else { |
diff --git a/src/core/file_sys/program_metadata.cpp b/src/core/file_sys/program_metadata.cpp index 83b83a044..01ae1a567 100644 --- a/src/core/file_sys/program_metadata.cpp +++ b/src/core/file_sys/program_metadata.cpp | |||
| @@ -150,7 +150,9 @@ void ProgramMetadata::Print() const { | |||
| 150 | LOG_DEBUG(Service_FS, " > Is Retail: {}", acid_header.is_retail ? "YES" : "NO"); | 150 | LOG_DEBUG(Service_FS, " > Is Retail: {}", acid_header.is_retail ? "YES" : "NO"); |
| 151 | LOG_DEBUG(Service_FS, "Title ID Min: 0x{:016X}", acid_header.title_id_min); | 151 | LOG_DEBUG(Service_FS, "Title ID Min: 0x{:016X}", acid_header.title_id_min); |
| 152 | LOG_DEBUG(Service_FS, "Title ID Max: 0x{:016X}", acid_header.title_id_max); | 152 | LOG_DEBUG(Service_FS, "Title ID Max: 0x{:016X}", acid_header.title_id_max); |
| 153 | LOG_DEBUG(Service_FS, "Filesystem Access: 0x{:016X}\n", acid_file_access.permissions); | 153 | u64_le permissions_l; // local copy to fix alignment error |
| 154 | std::memcpy(&permissions_l, &acid_file_access.permissions, sizeof(permissions_l)); | ||
| 155 | LOG_DEBUG(Service_FS, "Filesystem Access: 0x{:016X}\n", permissions_l); | ||
| 154 | 156 | ||
| 155 | // Begin ACI0 printing (actual perms, unsigned) | 157 | // Begin ACI0 printing (actual perms, unsigned) |
| 156 | LOG_DEBUG(Service_FS, "Magic: {:.4}", aci_header.magic.data()); | 158 | LOG_DEBUG(Service_FS, "Magic: {:.4}", aci_header.magic.data()); |
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 | ||
| 202 | void 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 | |||
| 107 | private: | 109 | private: |
| 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/frontend/input.h b/src/core/frontend/input.h index 0c5d2b3b0..7a047803e 100644 --- a/src/core/frontend/input.h +++ b/src/core/frontend/input.h | |||
| @@ -27,6 +27,10 @@ struct AnalogProperties { | |||
| 27 | float range; | 27 | float range; |
| 28 | float threshold; | 28 | float threshold; |
| 29 | }; | 29 | }; |
| 30 | template <typename StatusType> | ||
| 31 | struct InputCallback { | ||
| 32 | std::function<void(StatusType)> on_change; | ||
| 33 | }; | ||
| 30 | 34 | ||
| 31 | /// An abstract class template for an input device (a button, an analog input, etc.). | 35 | /// An abstract class template for an input device (a button, an analog input, etc.). |
| 32 | template <typename StatusType> | 36 | template <typename StatusType> |
| @@ -50,6 +54,17 @@ public: | |||
| 50 | [[maybe_unused]] f32 freq_high) const { | 54 | [[maybe_unused]] f32 freq_high) const { |
| 51 | return {}; | 55 | return {}; |
| 52 | } | 56 | } |
| 57 | void SetCallback(InputCallback<StatusType> callback_) { | ||
| 58 | callback = std::move(callback_); | ||
| 59 | } | ||
| 60 | void TriggerOnChange() { | ||
| 61 | if (callback.on_change) { | ||
| 62 | callback.on_change(GetStatus()); | ||
| 63 | } | ||
| 64 | } | ||
| 65 | |||
| 66 | private: | ||
| 67 | InputCallback<StatusType> callback; | ||
| 53 | }; | 68 | }; |
| 54 | 69 | ||
| 55 | /// An abstract class template for a factory that can create input devices. | 70 | /// An abstract class template for a factory that can create input devices. |
diff --git a/src/core/hle/kernel/hle_ipc.cpp b/src/core/hle/kernel/hle_ipc.cpp index 9d069a78f..28ed6265a 100644 --- a/src/core/hle/kernel/hle_ipc.cpp +++ b/src/core/hle/kernel/hle_ipc.cpp | |||
| @@ -30,16 +30,38 @@ | |||
| 30 | 30 | ||
| 31 | namespace Kernel { | 31 | namespace Kernel { |
| 32 | 32 | ||
| 33 | SessionRequestHandler::SessionRequestHandler() = default; | 33 | SessionRequestHandler::SessionRequestHandler(KernelCore& kernel_, const char* service_name_) |
| 34 | : kernel{kernel_}, service_thread{kernel.CreateServiceThread(service_name_)} {} | ||
| 34 | 35 | ||
| 35 | SessionRequestHandler::~SessionRequestHandler() = default; | 36 | SessionRequestHandler::~SessionRequestHandler() { |
| 37 | kernel.ReleaseServiceThread(service_thread); | ||
| 38 | } | ||
| 39 | |||
| 40 | SessionRequestManager::SessionRequestManager(KernelCore& kernel_) : kernel{kernel_} {} | ||
| 41 | |||
| 42 | SessionRequestManager::~SessionRequestManager() = default; | ||
| 43 | |||
| 44 | bool SessionRequestManager::HasSessionRequestHandler(const HLERequestContext& context) const { | ||
| 45 | if (IsDomain() && context.HasDomainMessageHeader()) { | ||
| 46 | const auto& message_header = context.GetDomainMessageHeader(); | ||
| 47 | const auto object_id = message_header.object_id; | ||
| 48 | |||
| 49 | if (object_id > DomainHandlerCount()) { | ||
| 50 | LOG_CRITICAL(IPC, "object_id {} is too big!", object_id); | ||
| 51 | return false; | ||
| 52 | } | ||
| 53 | return DomainHandler(object_id - 1) != nullptr; | ||
| 54 | } else { | ||
| 55 | return session_handler != nullptr; | ||
| 56 | } | ||
| 57 | } | ||
| 36 | 58 | ||
| 37 | void SessionRequestHandler::ClientConnected(KServerSession* session) { | 59 | void SessionRequestHandler::ClientConnected(KServerSession* session) { |
| 38 | session->SetSessionHandler(shared_from_this()); | 60 | session->ClientConnected(shared_from_this()); |
| 39 | } | 61 | } |
| 40 | 62 | ||
| 41 | void SessionRequestHandler::ClientDisconnected(KServerSession* session) { | 63 | void SessionRequestHandler::ClientDisconnected(KServerSession* session) { |
| 42 | session->SetSessionHandler(nullptr); | 64 | session->ClientDisconnected(); |
| 43 | } | 65 | } |
| 44 | 66 | ||
| 45 | HLERequestContext::HLERequestContext(KernelCore& kernel_, Core::Memory::Memory& memory_, | 67 | HLERequestContext::HLERequestContext(KernelCore& kernel_, Core::Memory::Memory& memory_, |
| @@ -169,12 +191,12 @@ ResultCode HLERequestContext::PopulateFromIncomingCommandBuffer(const KHandleTab | |||
| 169 | 191 | ||
| 170 | if (command_header->IsCloseCommand()) { | 192 | if (command_header->IsCloseCommand()) { |
| 171 | // Close does not populate the rest of the IPC header | 193 | // Close does not populate the rest of the IPC header |
| 172 | return RESULT_SUCCESS; | 194 | return ResultSuccess; |
| 173 | } | 195 | } |
| 174 | 196 | ||
| 175 | std::copy_n(src_cmdbuf, IPC::COMMAND_BUFFER_LENGTH, cmd_buf.begin()); | 197 | std::copy_n(src_cmdbuf, IPC::COMMAND_BUFFER_LENGTH, cmd_buf.begin()); |
| 176 | 198 | ||
| 177 | return RESULT_SUCCESS; | 199 | return ResultSuccess; |
| 178 | } | 200 | } |
| 179 | 201 | ||
| 180 | ResultCode HLERequestContext::WriteToOutgoingCommandBuffer(KThread& requesting_thread) { | 202 | ResultCode HLERequestContext::WriteToOutgoingCommandBuffer(KThread& requesting_thread) { |
| @@ -216,7 +238,7 @@ ResultCode HLERequestContext::WriteToOutgoingCommandBuffer(KThread& requesting_t | |||
| 216 | memory.WriteBlock(owner_process, requesting_thread.GetTLSAddress(), cmd_buf.data(), | 238 | memory.WriteBlock(owner_process, requesting_thread.GetTLSAddress(), cmd_buf.data(), |
| 217 | write_size * sizeof(u32)); | 239 | write_size * sizeof(u32)); |
| 218 | 240 | ||
| 219 | return RESULT_SUCCESS; | 241 | return ResultSuccess; |
| 220 | } | 242 | } |
| 221 | 243 | ||
| 222 | std::vector<u8> HLERequestContext::ReadBuffer(std::size_t buffer_index) const { | 244 | std::vector<u8> HLERequestContext::ReadBuffer(std::size_t buffer_index) const { |
diff --git a/src/core/hle/kernel/hle_ipc.h b/src/core/hle/kernel/hle_ipc.h index b47e363cc..a61870f8b 100644 --- a/src/core/hle/kernel/hle_ipc.h +++ b/src/core/hle/kernel/hle_ipc.h | |||
| @@ -46,6 +46,7 @@ class KThread; | |||
| 46 | class KReadableEvent; | 46 | class KReadableEvent; |
| 47 | class KSession; | 47 | class KSession; |
| 48 | class KWritableEvent; | 48 | class KWritableEvent; |
| 49 | class ServiceThread; | ||
| 49 | 50 | ||
| 50 | enum class ThreadWakeupReason; | 51 | enum class ThreadWakeupReason; |
| 51 | 52 | ||
| @@ -56,7 +57,7 @@ enum class ThreadWakeupReason; | |||
| 56 | */ | 57 | */ |
| 57 | class SessionRequestHandler : public std::enable_shared_from_this<SessionRequestHandler> { | 58 | class SessionRequestHandler : public std::enable_shared_from_this<SessionRequestHandler> { |
| 58 | public: | 59 | public: |
| 59 | SessionRequestHandler(); | 60 | SessionRequestHandler(KernelCore& kernel, const char* service_name_); |
| 60 | virtual ~SessionRequestHandler(); | 61 | virtual ~SessionRequestHandler(); |
| 61 | 62 | ||
| 62 | /** | 63 | /** |
| @@ -83,6 +84,14 @@ public: | |||
| 83 | * @param server_session ServerSession associated with the connection. | 84 | * @param server_session ServerSession associated with the connection. |
| 84 | */ | 85 | */ |
| 85 | void ClientDisconnected(KServerSession* session); | 86 | void ClientDisconnected(KServerSession* session); |
| 87 | |||
| 88 | std::weak_ptr<ServiceThread> GetServiceThread() const { | ||
| 89 | return service_thread; | ||
| 90 | } | ||
| 91 | |||
| 92 | protected: | ||
| 93 | KernelCore& kernel; | ||
| 94 | std::weak_ptr<ServiceThread> service_thread; | ||
| 86 | }; | 95 | }; |
| 87 | 96 | ||
| 88 | using SessionRequestHandlerPtr = std::shared_ptr<SessionRequestHandler>; | 97 | using SessionRequestHandlerPtr = std::shared_ptr<SessionRequestHandler>; |
| @@ -94,7 +103,8 @@ using SessionRequestHandlerPtr = std::shared_ptr<SessionRequestHandler>; | |||
| 94 | */ | 103 | */ |
| 95 | class SessionRequestManager final { | 104 | class SessionRequestManager final { |
| 96 | public: | 105 | public: |
| 97 | SessionRequestManager() = default; | 106 | explicit SessionRequestManager(KernelCore& kernel); |
| 107 | ~SessionRequestManager(); | ||
| 98 | 108 | ||
| 99 | bool IsDomain() const { | 109 | bool IsDomain() const { |
| 100 | return is_domain; | 110 | return is_domain; |
| @@ -142,10 +152,19 @@ public: | |||
| 142 | session_handler = std::move(handler); | 152 | session_handler = std::move(handler); |
| 143 | } | 153 | } |
| 144 | 154 | ||
| 155 | std::weak_ptr<ServiceThread> GetServiceThread() const { | ||
| 156 | return session_handler->GetServiceThread(); | ||
| 157 | } | ||
| 158 | |||
| 159 | bool HasSessionRequestHandler(const HLERequestContext& context) const; | ||
| 160 | |||
| 145 | private: | 161 | private: |
| 146 | bool is_domain{}; | 162 | bool is_domain{}; |
| 147 | SessionRequestHandlerPtr session_handler; | 163 | SessionRequestHandlerPtr session_handler; |
| 148 | std::vector<SessionRequestHandlerPtr> domain_handlers; | 164 | std::vector<SessionRequestHandlerPtr> domain_handlers; |
| 165 | |||
| 166 | private: | ||
| 167 | KernelCore& kernel; | ||
| 149 | }; | 168 | }; |
| 150 | 169 | ||
| 151 | /** | 170 | /** |
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 | ||
| 113 | ResultCode KAddressArbiter::SignalAndIncrementIfEqual(VAddr addr, s32 value, s32 count) { | 113 | ResultCode 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 | ||
| 146 | ResultCode KAddressArbiter::SignalAndModifyByWaitingCountIfEqual(VAddr addr, s32 value, s32 count) { | 146 | ResultCode 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 | ||
| 214 | ResultCode KAddressArbiter::WaitIfLessThan(VAddr addr, s32 value, bool decrement, s64 timeout) { | 214 | ResultCode 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 | ||
| 57 | private: | 57 | private: |
diff --git a/src/core/hle/kernel/k_auto_object.h b/src/core/hle/kernel/k_auto_object.h index bc18582be..88a052f65 100644 --- a/src/core/hle/kernel/k_auto_object.h +++ b/src/core/hle/kernel/k_auto_object.h | |||
| @@ -7,10 +7,11 @@ | |||
| 7 | #include <atomic> | 7 | #include <atomic> |
| 8 | #include <string> | 8 | #include <string> |
| 9 | 9 | ||
| 10 | #include <boost/intrusive/rbtree.hpp> | ||
| 11 | |||
| 10 | #include "common/assert.h" | 12 | #include "common/assert.h" |
| 11 | #include "common/common_funcs.h" | 13 | #include "common/common_funcs.h" |
| 12 | #include "common/common_types.h" | 14 | #include "common/common_types.h" |
| 13 | #include "common/intrusive_red_black_tree.h" | ||
| 14 | #include "core/hle/kernel/k_class_token.h" | 15 | #include "core/hle/kernel/k_class_token.h" |
| 15 | 16 | ||
| 16 | namespace Kernel { | 17 | namespace Kernel { |
| @@ -175,7 +176,7 @@ private: | |||
| 175 | 176 | ||
| 176 | class KAutoObjectWithListContainer; | 177 | class KAutoObjectWithListContainer; |
| 177 | 178 | ||
| 178 | class KAutoObjectWithList : public KAutoObject { | 179 | class KAutoObjectWithList : public KAutoObject, public boost::intrusive::set_base_hook<> { |
| 179 | public: | 180 | public: |
| 180 | explicit KAutoObjectWithList(KernelCore& kernel_) : KAutoObject(kernel_) {} | 181 | explicit KAutoObjectWithList(KernelCore& kernel_) : KAutoObject(kernel_) {} |
| 181 | 182 | ||
| @@ -192,6 +193,10 @@ public: | |||
| 192 | } | 193 | } |
| 193 | } | 194 | } |
| 194 | 195 | ||
| 196 | friend bool operator<(const KAutoObjectWithList& left, const KAutoObjectWithList& right) { | ||
| 197 | return &left < &right; | ||
| 198 | } | ||
| 199 | |||
| 195 | public: | 200 | public: |
| 196 | virtual u64 GetId() const { | 201 | virtual u64 GetId() const { |
| 197 | return reinterpret_cast<u64>(this); | 202 | return reinterpret_cast<u64>(this); |
| @@ -203,8 +208,6 @@ public: | |||
| 203 | 208 | ||
| 204 | private: | 209 | private: |
| 205 | friend class KAutoObjectWithListContainer; | 210 | friend class KAutoObjectWithListContainer; |
| 206 | |||
| 207 | Common::IntrusiveRedBlackTreeNode list_node; | ||
| 208 | }; | 211 | }; |
| 209 | 212 | ||
| 210 | template <typename T> | 213 | template <typename T> |
diff --git a/src/core/hle/kernel/k_auto_object_container.cpp b/src/core/hle/kernel/k_auto_object_container.cpp index fc0c28874..010006bb7 100644 --- a/src/core/hle/kernel/k_auto_object_container.cpp +++ b/src/core/hle/kernel/k_auto_object_container.cpp | |||
| @@ -9,13 +9,13 @@ namespace Kernel { | |||
| 9 | void KAutoObjectWithListContainer::Register(KAutoObjectWithList* obj) { | 9 | void KAutoObjectWithListContainer::Register(KAutoObjectWithList* obj) { |
| 10 | KScopedLightLock lk(m_lock); | 10 | KScopedLightLock lk(m_lock); |
| 11 | 11 | ||
| 12 | m_object_list.insert(*obj); | 12 | m_object_list.insert_unique(*obj); |
| 13 | } | 13 | } |
| 14 | 14 | ||
| 15 | void KAutoObjectWithListContainer::Unregister(KAutoObjectWithList* obj) { | 15 | void KAutoObjectWithListContainer::Unregister(KAutoObjectWithList* obj) { |
| 16 | KScopedLightLock lk(m_lock); | 16 | KScopedLightLock lk(m_lock); |
| 17 | 17 | ||
| 18 | m_object_list.erase(m_object_list.iterator_to(*obj)); | 18 | m_object_list.erase(*obj); |
| 19 | } | 19 | } |
| 20 | 20 | ||
| 21 | size_t KAutoObjectWithListContainer::GetOwnedCount(KProcess* owner) { | 21 | size_t KAutoObjectWithListContainer::GetOwnedCount(KProcess* owner) { |
diff --git a/src/core/hle/kernel/k_auto_object_container.h b/src/core/hle/kernel/k_auto_object_container.h index ff40cf5a7..459953450 100644 --- a/src/core/hle/kernel/k_auto_object_container.h +++ b/src/core/hle/kernel/k_auto_object_container.h | |||
| @@ -6,6 +6,8 @@ | |||
| 6 | 6 | ||
| 7 | #include <atomic> | 7 | #include <atomic> |
| 8 | 8 | ||
| 9 | #include <boost/intrusive/rbtree.hpp> | ||
| 10 | |||
| 9 | #include "common/assert.h" | 11 | #include "common/assert.h" |
| 10 | #include "common/common_funcs.h" | 12 | #include "common/common_funcs.h" |
| 11 | #include "common/common_types.h" | 13 | #include "common/common_types.h" |
| @@ -23,8 +25,7 @@ class KAutoObjectWithListContainer { | |||
| 23 | YUZU_NON_MOVEABLE(KAutoObjectWithListContainer); | 25 | YUZU_NON_MOVEABLE(KAutoObjectWithListContainer); |
| 24 | 26 | ||
| 25 | public: | 27 | public: |
| 26 | using ListType = Common::IntrusiveRedBlackTreeMemberTraits< | 28 | using ListType = boost::intrusive::rbtree<KAutoObjectWithList>; |
| 27 | &KAutoObjectWithList::list_node>::TreeType<KAutoObjectWithList>; | ||
| 28 | 29 | ||
| 29 | public: | 30 | public: |
| 30 | class ListAccessor : public KScopedLightLock { | 31 | class ListAccessor : public KScopedLightLock { |
diff --git a/src/core/hle/kernel/k_client_port.cpp b/src/core/hle/kernel/k_client_port.cpp index 4a12dee10..ef168fe87 100644 --- a/src/core/hle/kernel/k_client_port.cpp +++ b/src/core/hle/kernel/k_client_port.cpp | |||
| @@ -16,11 +16,11 @@ namespace Kernel { | |||
| 16 | KClientPort::KClientPort(KernelCore& kernel_) : KSynchronizationObject{kernel_} {} | 16 | KClientPort::KClientPort(KernelCore& kernel_) : KSynchronizationObject{kernel_} {} |
| 17 | KClientPort::~KClientPort() = default; | 17 | KClientPort::~KClientPort() = default; |
| 18 | 18 | ||
| 19 | void KClientPort::Initialize(KPort* parent_, s32 max_sessions_, std::string&& name_) { | 19 | void KClientPort::Initialize(KPort* parent_port_, s32 max_sessions_, std::string&& name_) { |
| 20 | // Set member variables. | 20 | // Set member variables. |
| 21 | num_sessions = 0; | 21 | num_sessions = 0; |
| 22 | peak_sessions = 0; | 22 | peak_sessions = 0; |
| 23 | parent = parent_; | 23 | parent = parent_port_; |
| 24 | max_sessions = max_sessions_; | 24 | max_sessions = max_sessions_; |
| 25 | name = std::move(name_); | 25 | name = std::move(name_); |
| 26 | } | 26 | } |
| @@ -28,6 +28,9 @@ void KClientPort::Initialize(KPort* parent_, s32 max_sessions_, std::string&& na | |||
| 28 | void KClientPort::OnSessionFinalized() { | 28 | void KClientPort::OnSessionFinalized() { |
| 29 | KScopedSchedulerLock sl{kernel}; | 29 | KScopedSchedulerLock sl{kernel}; |
| 30 | 30 | ||
| 31 | // This might happen if a session was improperly used with this port. | ||
| 32 | ASSERT_MSG(num_sessions > 0, "num_sessions is invalid"); | ||
| 33 | |||
| 31 | const auto prev = num_sessions--; | 34 | const auto prev = num_sessions--; |
| 32 | if (prev == max_sessions) { | 35 | if (prev == max_sessions) { |
| 33 | this->NotifyAvailable(); | 36 | this->NotifyAvailable(); |
| @@ -56,7 +59,8 @@ bool KClientPort::IsSignaled() const { | |||
| 56 | return num_sessions < max_sessions; | 59 | return num_sessions < max_sessions; |
| 57 | } | 60 | } |
| 58 | 61 | ||
| 59 | ResultCode KClientPort::CreateSession(KClientSession** out) { | 62 | ResultCode KClientPort::CreateSession(KClientSession** out, |
| 63 | std::shared_ptr<SessionRequestManager> session_manager) { | ||
| 60 | // Reserve a new session from the resource limit. | 64 | // Reserve a new session from the resource limit. |
| 61 | KScopedResourceReservation session_reservation(kernel.CurrentProcess()->GetResourceLimit(), | 65 | KScopedResourceReservation session_reservation(kernel.CurrentProcess()->GetResourceLimit(), |
| 62 | LimitableResource::Sessions); | 66 | LimitableResource::Sessions); |
| @@ -65,7 +69,7 @@ ResultCode KClientPort::CreateSession(KClientSession** out) { | |||
| 65 | // Update the session counts. | 69 | // Update the session counts. |
| 66 | { | 70 | { |
| 67 | // Atomically increment the number of sessions. | 71 | // Atomically increment the number of sessions. |
| 68 | s32 new_sessions; | 72 | s32 new_sessions{}; |
| 69 | { | 73 | { |
| 70 | const auto max = max_sessions; | 74 | const auto max = max_sessions; |
| 71 | auto cur_sessions = num_sessions.load(std::memory_order_acquire); | 75 | auto cur_sessions = num_sessions.load(std::memory_order_acquire); |
| @@ -101,7 +105,7 @@ ResultCode KClientPort::CreateSession(KClientSession** out) { | |||
| 101 | } | 105 | } |
| 102 | 106 | ||
| 103 | // Initialize the session. | 107 | // Initialize the session. |
| 104 | session->Initialize(this, parent->GetName()); | 108 | session->Initialize(this, parent->GetName(), session_manager); |
| 105 | 109 | ||
| 106 | // Commit the session reservation. | 110 | // Commit the session reservation. |
| 107 | session_reservation.Commit(); | 111 | session_reservation.Commit(); |
| @@ -119,7 +123,7 @@ ResultCode KClientPort::CreateSession(KClientSession** out) { | |||
| 119 | // We succeeded, so set the output. | 123 | // We succeeded, so set the output. |
| 120 | session_guard.Cancel(); | 124 | session_guard.Cancel(); |
| 121 | *out = std::addressof(session->GetClientSession()); | 125 | *out = std::addressof(session->GetClientSession()); |
| 122 | return RESULT_SUCCESS; | 126 | return ResultSuccess; |
| 123 | } | 127 | } |
| 124 | 128 | ||
| 125 | } // namespace Kernel | 129 | } // namespace Kernel |
diff --git a/src/core/hle/kernel/k_client_port.h b/src/core/hle/kernel/k_client_port.h index f2fff3b01..54bb05e20 100644 --- a/src/core/hle/kernel/k_client_port.h +++ b/src/core/hle/kernel/k_client_port.h | |||
| @@ -16,6 +16,7 @@ namespace Kernel { | |||
| 16 | class KClientSession; | 16 | class KClientSession; |
| 17 | class KernelCore; | 17 | class KernelCore; |
| 18 | class KPort; | 18 | class KPort; |
| 19 | class SessionRequestManager; | ||
| 19 | 20 | ||
| 20 | class KClientPort final : public KSynchronizationObject { | 21 | class KClientPort final : public KSynchronizationObject { |
| 21 | KERNEL_AUTOOBJECT_TRAITS(KClientPort, KSynchronizationObject); | 22 | KERNEL_AUTOOBJECT_TRAITS(KClientPort, KSynchronizationObject); |
| @@ -52,7 +53,8 @@ public: | |||
| 52 | void Destroy() override; | 53 | void Destroy() override; |
| 53 | bool IsSignaled() const override; | 54 | bool IsSignaled() const override; |
| 54 | 55 | ||
| 55 | ResultCode CreateSession(KClientSession** out); | 56 | ResultCode CreateSession(KClientSession** out, |
| 57 | std::shared_ptr<SessionRequestManager> session_manager = nullptr); | ||
| 56 | 58 | ||
| 57 | private: | 59 | private: |
| 58 | std::atomic<s32> num_sessions{}; | 60 | std::atomic<s32> num_sessions{}; |
diff --git a/src/core/hle/kernel/k_client_session.h b/src/core/hle/kernel/k_client_session.h index b11d5b4e3..230e3b6b8 100644 --- a/src/core/hle/kernel/k_client_session.h +++ b/src/core/hle/kernel/k_client_session.h | |||
| @@ -36,9 +36,9 @@ public: | |||
| 36 | explicit KClientSession(KernelCore& kernel_); | 36 | explicit KClientSession(KernelCore& kernel_); |
| 37 | ~KClientSession() override; | 37 | ~KClientSession() override; |
| 38 | 38 | ||
| 39 | void Initialize(KSession* parent_, std::string&& name_) { | 39 | void Initialize(KSession* parent_session_, std::string&& name_) { |
| 40 | // Set member variables. | 40 | // Set member variables. |
| 41 | parent = parent_; | 41 | parent = parent_session_; |
| 42 | name = std::move(name_); | 42 | name = std::move(name_); |
| 43 | } | 43 | } |
| 44 | 44 | ||
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 | ||
| 106 | ResultCode KConditionVariable::WaitForAddress(Handle handle, VAddr addr, u32 value) { | 106 | ResultCode 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 | ||
| 31 | bool KHandleTable::Remove(Handle handle) { | 31 | bool 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 | ||
| 85 | ResultCode KHandleTable::Reserve(Handle* out_handle) { | 85 | ResultCode 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 | ||
| 95 | void KHandleTable::Unreserve(Handle handle) { | 95 | void 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 | ||
| 152 | ResultCode KMemoryManager::Free(KPageLinkedList& page_list, std::size_t num_pages, Pool pool, | 152 | ResultCode 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 | ||
| 176 | std::size_t KMemoryManager::Impl::CalculateManagementOverheadSize(std::size_t region_size) { | 176 | std::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 | ||
| 88 | private: | 88 | private: |
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 | ||
| 298 | ResultCode KPageTable::MapProcessCodeMemory(VAddr dst_addr, VAddr src_addr, std::size_t size) { | 298 | ResultCode 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 | ||
| 335 | ResultCode KPageTable::UnmapProcessCodeMemory(VAddr dst_addr, VAddr src_addr, std::size_t size) { | 335 | ResultCode 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 | ||
| 366 | void KPageTable::MapPhysicalMemory(KPageLinkedList& page_linked_list, VAddr start, VAddr end) { | 366 | void 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 | ||
| 446 | ResultCode KPageTable::UnmapPhysicalMemory(VAddr addr, std::size_t size) { | 446 | ResultCode 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 | ||
| 483 | ResultCode KPageTable::UnmapMemory(VAddr addr, std::size_t size) { | 483 | ResultCode 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 | ||
| 519 | ResultCode KPageTable::Map(VAddr dst_addr, VAddr src_addr, std::size_t size) { | 519 | ResultCode 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 | ||
| 558 | ResultCode KPageTable::Unmap(VAddr dst_addr, VAddr src_addr, std::size_t size) { | 558 | ResultCode 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 | ||
| 600 | ResultCode KPageTable::MapPages(VAddr addr, const KPageLinkedList& page_linked_list, | 600 | ResultCode 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 | ||
| 622 | ResultCode KPageTable::MapPages(VAddr addr, KPageLinkedList& page_linked_list, KMemoryState state, | 622 | ResultCode 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 | ||
| 644 | ResultCode KPageTable::UnmapPages(VAddr addr, const KPageLinkedList& page_linked_list) { | 644 | ResultCode 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 | ||
| 661 | ResultCode KPageTable::UnmapPages(VAddr addr, KPageLinkedList& page_linked_list, | 661 | ResultCode 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 | ||
| 683 | ResultCode KPageTable::SetCodeMemoryPermission(VAddr addr, std::size_t size, | 683 | ResultCode 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 | ||
| 731 | KMemoryInfo KPageTable::QueryInfoImpl(VAddr addr) { | 731 | KMemoryInfo 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 | ||
| 764 | ResultCode KPageTable::ResetTransferMemory(VAddr addr, std::size_t size) { | 764 | ResultCode 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 | ||
| 781 | ResultCode KPageTable::SetMemoryAttribute(VAddr addr, std::size_t size, KMemoryAttribute mask, | 781 | ResultCode 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 | ||
| 803 | ResultCode KPageTable::SetHeapCapacity(std::size_t new_heap_capacity) { | 803 | ResultCode 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 | ||
| 809 | ResultVal<VAddr> KPageTable::SetHeapSize(std::size_t size) { | 809 | ResultVal<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 | ||
| 917 | ResultCode KPageTable::UnlockForDeviceAddressSpace(VAddr addr, std::size_t size) { | 917 | ResultCode 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 | ||
| 940 | ResultCode KPageTable::InitializeMemoryLayout(VAddr start, VAddr end) { | 940 | ResultCode 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 | ||
| 946 | bool KPageTable::IsRegionMapped(VAddr address, u64 size) { | 946 | bool 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 | ||
| 1012 | ResultCode KPageTable::Operate(VAddr addr, std::size_t num_pages, KMemoryPermission perm, | 1012 | ResultCode 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 | ||
| 1039 | constexpr VAddr KPageTable::GetRegionAddress(KMemoryState state) const { | 1039 | constexpr 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 | ||
| 1170 | ResultCode KPageTable::CheckMemoryState(KMemoryState* out_state, KMemoryPermission* out_perm, | 1170 | ResultCode 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 | ||
| 148 | KResourceLimit* KProcess::GetResourceLimit() const { | 148 | KResourceLimit* 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 | ||
| 264 | void KProcess::RemoveSharedMemory(KSharedMemory* shmem, [[maybe_unused]] VAddr address, | 264 | void 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 | ||
| 297 | ResultCode KProcess::LoadFromMetadata(const FileSys::ProgramMetadata& metadata, | 297 | ResultCode 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 | ||
| 42 | ResultCode KReadableEvent::Clear() { | 42 | ResultCode KReadableEvent::Clear() { |
| 43 | Reset(); | 43 | Reset(); |
| 44 | 44 | ||
| 45 | return RESULT_SUCCESS; | 45 | return ResultSuccess; |
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | ResultCode KReadableEvent::Reset() { | 48 | ResultCode 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_readable_event.h b/src/core/hle/kernel/k_readable_event.h index b2850ac7b..149fa78dd 100644 --- a/src/core/hle/kernel/k_readable_event.h +++ b/src/core/hle/kernel/k_readable_event.h | |||
| @@ -21,9 +21,9 @@ public: | |||
| 21 | explicit KReadableEvent(KernelCore& kernel_); | 21 | explicit KReadableEvent(KernelCore& kernel_); |
| 22 | ~KReadableEvent() override; | 22 | ~KReadableEvent() override; |
| 23 | 23 | ||
| 24 | void Initialize(KEvent* parent_, std::string&& name_) { | 24 | void Initialize(KEvent* parent_event_, std::string&& name_) { |
| 25 | is_signaled = false; | 25 | is_signaled = false; |
| 26 | parent = parent_; | 26 | parent = parent_event_; |
| 27 | name = std::move(name_); | 27 | name = std::move(name_); |
| 28 | } | 28 | } |
| 29 | 29 | ||
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 | ||
| 86 | bool KResourceLimit::Reserve(LimitableResource which, s64 value) { | 86 | bool KResourceLimit::Reserve(LimitableResource which, s64 value) { |
diff --git a/src/core/hle/kernel/k_server_port.cpp b/src/core/hle/kernel/k_server_port.cpp index 8cbde177a..c5dc58387 100644 --- a/src/core/hle/kernel/k_server_port.cpp +++ b/src/core/hle/kernel/k_server_port.cpp | |||
| @@ -17,9 +17,9 @@ namespace Kernel { | |||
| 17 | KServerPort::KServerPort(KernelCore& kernel_) : KSynchronizationObject{kernel_} {} | 17 | KServerPort::KServerPort(KernelCore& kernel_) : KSynchronizationObject{kernel_} {} |
| 18 | KServerPort::~KServerPort() = default; | 18 | KServerPort::~KServerPort() = default; |
| 19 | 19 | ||
| 20 | void KServerPort::Initialize(KPort* parent_, std::string&& name_) { | 20 | void KServerPort::Initialize(KPort* parent_port_, std::string&& name_) { |
| 21 | // Set member variables. | 21 | // Set member variables. |
| 22 | parent = parent_; | 22 | parent = parent_port_; |
| 23 | name = std::move(name_); | 23 | name = std::move(name_); |
| 24 | } | 24 | } |
| 25 | 25 | ||
diff --git a/src/core/hle/kernel/k_server_port.h b/src/core/hle/kernel/k_server_port.h index 55481d63f..67a36da40 100644 --- a/src/core/hle/kernel/k_server_port.h +++ b/src/core/hle/kernel/k_server_port.h | |||
| @@ -29,7 +29,7 @@ public: | |||
| 29 | explicit KServerPort(KernelCore& kernel_); | 29 | explicit KServerPort(KernelCore& kernel_); |
| 30 | ~KServerPort() override; | 30 | ~KServerPort() override; |
| 31 | 31 | ||
| 32 | void Initialize(KPort* parent_, std::string&& name_); | 32 | void Initialize(KPort* parent_port_, std::string&& name_); |
| 33 | 33 | ||
| 34 | /// Whether or not this server port has an HLE handler available. | 34 | /// Whether or not this server port has an HLE handler available. |
| 35 | bool HasSessionRequestHandler() const { | 35 | bool HasSessionRequestHandler() const { |
diff --git a/src/core/hle/kernel/k_server_session.cpp b/src/core/hle/kernel/k_server_session.cpp index 457fdfd60..5c3c13ce6 100644 --- a/src/core/hle/kernel/k_server_session.cpp +++ b/src/core/hle/kernel/k_server_session.cpp | |||
| @@ -8,13 +8,16 @@ | |||
| 8 | #include "common/assert.h" | 8 | #include "common/assert.h" |
| 9 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 10 | #include "common/logging/log.h" | 10 | #include "common/logging/log.h" |
| 11 | #include "common/scope_exit.h" | ||
| 11 | #include "core/core_timing.h" | 12 | #include "core/core_timing.h" |
| 12 | #include "core/hle/ipc_helpers.h" | 13 | #include "core/hle/ipc_helpers.h" |
| 13 | #include "core/hle/kernel/hle_ipc.h" | 14 | #include "core/hle/kernel/hle_ipc.h" |
| 14 | #include "core/hle/kernel/k_client_port.h" | 15 | #include "core/hle/kernel/k_client_port.h" |
| 15 | #include "core/hle/kernel/k_handle_table.h" | 16 | #include "core/hle/kernel/k_handle_table.h" |
| 17 | #include "core/hle/kernel/k_port.h" | ||
| 16 | #include "core/hle/kernel/k_process.h" | 18 | #include "core/hle/kernel/k_process.h" |
| 17 | #include "core/hle/kernel/k_scheduler.h" | 19 | #include "core/hle/kernel/k_scheduler.h" |
| 20 | #include "core/hle/kernel/k_server_port.h" | ||
| 18 | #include "core/hle/kernel/k_server_session.h" | 21 | #include "core/hle/kernel/k_server_session.h" |
| 19 | #include "core/hle/kernel/k_session.h" | 22 | #include "core/hle/kernel/k_session.h" |
| 20 | #include "core/hle/kernel/k_thread.h" | 23 | #include "core/hle/kernel/k_thread.h" |
| @@ -23,18 +26,21 @@ | |||
| 23 | 26 | ||
| 24 | namespace Kernel { | 27 | namespace Kernel { |
| 25 | 28 | ||
| 26 | KServerSession::KServerSession(KernelCore& kernel_) | 29 | KServerSession::KServerSession(KernelCore& kernel_) : KSynchronizationObject{kernel_} {} |
| 27 | : KSynchronizationObject{kernel_}, manager{std::make_shared<SessionRequestManager>()} {} | ||
| 28 | 30 | ||
| 29 | KServerSession::~KServerSession() { | 31 | KServerSession::~KServerSession() {} |
| 30 | kernel.ReleaseServiceThread(service_thread); | ||
| 31 | } | ||
| 32 | 32 | ||
| 33 | void KServerSession::Initialize(KSession* parent_, std::string&& name_) { | 33 | void KServerSession::Initialize(KSession* parent_session_, std::string&& name_, |
| 34 | std::shared_ptr<SessionRequestManager> manager_) { | ||
| 34 | // Set member variables. | 35 | // Set member variables. |
| 35 | parent = parent_; | 36 | parent = parent_session_; |
| 36 | name = std::move(name_); | 37 | name = std::move(name_); |
| 37 | service_thread = kernel.CreateServiceThread(name); | 38 | |
| 39 | if (manager_) { | ||
| 40 | manager = manager_; | ||
| 41 | } else { | ||
| 42 | manager = std::make_shared<SessionRequestManager>(kernel); | ||
| 43 | } | ||
| 38 | } | 44 | } |
| 39 | 45 | ||
| 40 | void KServerSession::Destroy() { | 46 | void KServerSession::Destroy() { |
| @@ -71,7 +77,7 @@ std::size_t KServerSession::NumDomainRequestHandlers() const { | |||
| 71 | 77 | ||
| 72 | ResultCode KServerSession::HandleDomainSyncRequest(Kernel::HLERequestContext& context) { | 78 | ResultCode KServerSession::HandleDomainSyncRequest(Kernel::HLERequestContext& context) { |
| 73 | if (!context.HasDomainMessageHeader()) { | 79 | if (!context.HasDomainMessageHeader()) { |
| 74 | return RESULT_SUCCESS; | 80 | return ResultSuccess; |
| 75 | } | 81 | } |
| 76 | 82 | ||
| 77 | // Set domain handlers in HLE context, used for domain objects (IPC interfaces) as inputs | 83 | // Set domain handlers in HLE context, used for domain objects (IPC interfaces) as inputs |
| @@ -88,7 +94,7 @@ ResultCode KServerSession::HandleDomainSyncRequest(Kernel::HLERequestContext& co | |||
| 88 | "to {} needed to return a new interface!", | 94 | "to {} needed to return a new interface!", |
| 89 | object_id, name); | 95 | object_id, name); |
| 90 | UNREACHABLE(); | 96 | UNREACHABLE(); |
| 91 | return RESULT_SUCCESS; // Ignore error if asserts are off | 97 | return ResultSuccess; // Ignore error if asserts are off |
| 92 | } | 98 | } |
| 93 | return manager->DomainHandler(object_id - 1)->HandleSyncRequest(*this, context); | 99 | return manager->DomainHandler(object_id - 1)->HandleSyncRequest(*this, context); |
| 94 | 100 | ||
| @@ -98,14 +104,14 @@ ResultCode KServerSession::HandleDomainSyncRequest(Kernel::HLERequestContext& co | |||
| 98 | manager->CloseDomainHandler(object_id - 1); | 104 | manager->CloseDomainHandler(object_id - 1); |
| 99 | 105 | ||
| 100 | IPC::ResponseBuilder rb{context, 2}; | 106 | IPC::ResponseBuilder rb{context, 2}; |
| 101 | rb.Push(RESULT_SUCCESS); | 107 | rb.Push(ResultSuccess); |
| 102 | return RESULT_SUCCESS; | 108 | return ResultSuccess; |
| 103 | } | 109 | } |
| 104 | } | 110 | } |
| 105 | 111 | ||
| 106 | LOG_CRITICAL(IPC, "Unknown domain command={}", domain_message_header.command.Value()); | 112 | LOG_CRITICAL(IPC, "Unknown domain command={}", domain_message_header.command.Value()); |
| 107 | ASSERT(false); | 113 | ASSERT(false); |
| 108 | return RESULT_SUCCESS; | 114 | return ResultSuccess; |
| 109 | } | 115 | } |
| 110 | 116 | ||
| 111 | ResultCode KServerSession::QueueSyncRequest(KThread* thread, Core::Memory::Memory& memory) { | 117 | ResultCode KServerSession::QueueSyncRequest(KThread* thread, Core::Memory::Memory& memory) { |
| @@ -114,23 +120,46 @@ ResultCode KServerSession::QueueSyncRequest(KThread* thread, Core::Memory::Memor | |||
| 114 | 120 | ||
| 115 | context->PopulateFromIncomingCommandBuffer(kernel.CurrentProcess()->GetHandleTable(), cmd_buf); | 121 | context->PopulateFromIncomingCommandBuffer(kernel.CurrentProcess()->GetHandleTable(), cmd_buf); |
| 116 | 122 | ||
| 117 | if (auto strong_ptr = service_thread.lock()) { | 123 | // In the event that something fails here, stub a result to prevent the game from crashing. |
| 118 | strong_ptr->QueueSyncRequest(*parent, std::move(context)); | 124 | // This is a work-around in the event that somehow we process a service request after the |
| 119 | return RESULT_SUCCESS; | 125 | // session has been closed by the game. This has been observed to happen rarely in Pokemon |
| 126 | // Sword/Shield and is likely a result of us using host threads/scheduling for services. | ||
| 127 | // TODO(bunnei): Find a better solution here. | ||
| 128 | auto error_guard = SCOPE_GUARD({ CompleteSyncRequest(*context); }); | ||
| 129 | |||
| 130 | // Ensure we have a session request handler | ||
| 131 | if (manager->HasSessionRequestHandler(*context)) { | ||
| 132 | if (auto strong_ptr = manager->GetServiceThread().lock()) { | ||
| 133 | strong_ptr->QueueSyncRequest(*parent, std::move(context)); | ||
| 134 | |||
| 135 | // We succeeded. | ||
| 136 | error_guard.Cancel(); | ||
| 137 | } else { | ||
| 138 | ASSERT_MSG(false, "strong_ptr is nullptr!"); | ||
| 139 | } | ||
| 140 | } else { | ||
| 141 | ASSERT_MSG(false, "handler is invalid!"); | ||
| 120 | } | 142 | } |
| 121 | 143 | ||
| 122 | return RESULT_SUCCESS; | 144 | return ResultSuccess; |
| 123 | } | 145 | } |
| 124 | 146 | ||
| 125 | ResultCode KServerSession::CompleteSyncRequest(HLERequestContext& context) { | 147 | ResultCode KServerSession::CompleteSyncRequest(HLERequestContext& context) { |
| 126 | ResultCode result = RESULT_SUCCESS; | 148 | ResultCode result = ResultSuccess; |
| 149 | |||
| 127 | // If the session has been converted to a domain, handle the domain request | 150 | // If the session has been converted to a domain, handle the domain request |
| 128 | if (IsDomain() && context.HasDomainMessageHeader()) { | 151 | if (manager->HasSessionRequestHandler(context)) { |
| 129 | result = HandleDomainSyncRequest(context); | 152 | if (IsDomain() && context.HasDomainMessageHeader()) { |
| 130 | // If there is no domain header, the regular session handler is used | 153 | result = HandleDomainSyncRequest(context); |
| 131 | } else if (manager->HasSessionHandler()) { | 154 | // If there is no domain header, the regular session handler is used |
| 132 | // If this ServerSession has an associated HLE handler, forward the request to it. | 155 | } else if (manager->HasSessionHandler()) { |
| 133 | result = manager->SessionHandler().HandleSyncRequest(*this, context); | 156 | // If this ServerSession has an associated HLE handler, forward the request to it. |
| 157 | result = manager->SessionHandler().HandleSyncRequest(*this, context); | ||
| 158 | } | ||
| 159 | } else { | ||
| 160 | ASSERT_MSG(false, "Session handler is invalid, stubbing response!"); | ||
| 161 | IPC::ResponseBuilder rb(context, 2); | ||
| 162 | rb.Push(ResultSuccess); | ||
| 134 | } | 163 | } |
| 135 | 164 | ||
| 136 | if (convert_to_domain) { | 165 | if (convert_to_domain) { |
diff --git a/src/core/hle/kernel/k_server_session.h b/src/core/hle/kernel/k_server_session.h index 27b757ad2..d44bc9d4f 100644 --- a/src/core/hle/kernel/k_server_session.h +++ b/src/core/hle/kernel/k_server_session.h | |||
| @@ -32,6 +32,7 @@ class HLERequestContext; | |||
| 32 | class KernelCore; | 32 | class KernelCore; |
| 33 | class KSession; | 33 | class KSession; |
| 34 | class SessionRequestHandler; | 34 | class SessionRequestHandler; |
| 35 | class SessionRequestManager; | ||
| 35 | class KThread; | 36 | class KThread; |
| 36 | 37 | ||
| 37 | class KServerSession final : public KSynchronizationObject, | 38 | class KServerSession final : public KSynchronizationObject, |
| @@ -46,7 +47,8 @@ public: | |||
| 46 | 47 | ||
| 47 | void Destroy() override; | 48 | void Destroy() override; |
| 48 | 49 | ||
| 49 | void Initialize(KSession* parent_, std::string&& name_); | 50 | void Initialize(KSession* parent_session_, std::string&& name_, |
| 51 | std::shared_ptr<SessionRequestManager> manager_); | ||
| 50 | 52 | ||
| 51 | KSession* GetParent() { | 53 | KSession* GetParent() { |
| 52 | return parent; | 54 | return parent; |
| @@ -60,15 +62,14 @@ public: | |||
| 60 | 62 | ||
| 61 | void OnClientClosed(); | 63 | void OnClientClosed(); |
| 62 | 64 | ||
| 63 | /** | 65 | void ClientConnected(SessionRequestHandlerPtr handler) { |
| 64 | * Sets the HLE handler for the session. This handler will be called to service IPC requests | ||
| 65 | * instead of the regular IPC machinery. (The regular IPC machinery is currently not | ||
| 66 | * implemented.) | ||
| 67 | */ | ||
| 68 | void SetSessionHandler(SessionRequestHandlerPtr handler) { | ||
| 69 | manager->SetSessionHandler(std::move(handler)); | 66 | manager->SetSessionHandler(std::move(handler)); |
| 70 | } | 67 | } |
| 71 | 68 | ||
| 69 | void ClientDisconnected() { | ||
| 70 | manager = nullptr; | ||
| 71 | } | ||
| 72 | |||
| 72 | /** | 73 | /** |
| 73 | * Handle a sync request from the emulated application. | 74 | * Handle a sync request from the emulated application. |
| 74 | * | 75 | * |
| @@ -104,16 +105,6 @@ public: | |||
| 104 | return manager; | 105 | return manager; |
| 105 | } | 106 | } |
| 106 | 107 | ||
| 107 | /// Gets the session request manager, which forwards requests to the underlying service | ||
| 108 | const std::shared_ptr<SessionRequestManager>& GetSessionRequestManager() const { | ||
| 109 | return manager; | ||
| 110 | } | ||
| 111 | |||
| 112 | /// Sets the session request manager, which forwards requests to the underlying service | ||
| 113 | void SetSessionRequestManager(std::shared_ptr<SessionRequestManager> manager_) { | ||
| 114 | manager = std::move(manager_); | ||
| 115 | } | ||
| 116 | |||
| 117 | private: | 108 | private: |
| 118 | /// Queues a sync request from the emulated application. | 109 | /// Queues a sync request from the emulated application. |
| 119 | ResultCode QueueSyncRequest(KThread* thread, Core::Memory::Memory& memory); | 110 | ResultCode QueueSyncRequest(KThread* thread, Core::Memory::Memory& memory); |
| @@ -131,9 +122,6 @@ private: | |||
| 131 | /// When set to True, converts the session to a domain at the end of the command | 122 | /// When set to True, converts the session to a domain at the end of the command |
| 132 | bool convert_to_domain{}; | 123 | bool convert_to_domain{}; |
| 133 | 124 | ||
| 134 | /// Thread to dispatch service requests | ||
| 135 | std::weak_ptr<ServiceThread> service_thread; | ||
| 136 | |||
| 137 | /// KSession that owns this KServerSession | 125 | /// KSession that owns this KServerSession |
| 138 | KSession* parent{}; | 126 | KSession* parent{}; |
| 139 | }; | 127 | }; |
diff --git a/src/core/hle/kernel/k_session.cpp b/src/core/hle/kernel/k_session.cpp index 025b8b555..940878e03 100644 --- a/src/core/hle/kernel/k_session.cpp +++ b/src/core/hle/kernel/k_session.cpp | |||
| @@ -15,7 +15,8 @@ KSession::KSession(KernelCore& kernel_) | |||
| 15 | : KAutoObjectWithSlabHeapAndContainer{kernel_}, server{kernel_}, client{kernel_} {} | 15 | : KAutoObjectWithSlabHeapAndContainer{kernel_}, server{kernel_}, client{kernel_} {} |
| 16 | KSession::~KSession() = default; | 16 | KSession::~KSession() = default; |
| 17 | 17 | ||
| 18 | void KSession::Initialize(KClientPort* port_, const std::string& name_) { | 18 | void KSession::Initialize(KClientPort* port_, const std::string& name_, |
| 19 | std::shared_ptr<SessionRequestManager> manager_) { | ||
| 19 | // Increment reference count. | 20 | // Increment reference count. |
| 20 | // Because reference count is one on creation, this will result | 21 | // Because reference count is one on creation, this will result |
| 21 | // in a reference count of two. Thus, when both server and client are closed | 22 | // in a reference count of two. Thus, when both server and client are closed |
| @@ -27,7 +28,7 @@ void KSession::Initialize(KClientPort* port_, const std::string& name_) { | |||
| 27 | KAutoObject::Create(std::addressof(client)); | 28 | KAutoObject::Create(std::addressof(client)); |
| 28 | 29 | ||
| 29 | // Initialize our sub sessions. | 30 | // Initialize our sub sessions. |
| 30 | server.Initialize(this, name_ + ":Server"); | 31 | server.Initialize(this, name_ + ":Server", manager_); |
| 31 | client.Initialize(this, name_ + ":Client"); | 32 | client.Initialize(this, name_ + ":Client"); |
| 32 | 33 | ||
| 33 | // Set state and name. | 34 | // Set state and name. |
diff --git a/src/core/hle/kernel/k_session.h b/src/core/hle/kernel/k_session.h index 4ddd080d2..62c328a68 100644 --- a/src/core/hle/kernel/k_session.h +++ b/src/core/hle/kernel/k_session.h | |||
| @@ -13,6 +13,8 @@ | |||
| 13 | 13 | ||
| 14 | namespace Kernel { | 14 | namespace Kernel { |
| 15 | 15 | ||
| 16 | class SessionRequestManager; | ||
| 17 | |||
| 16 | class KSession final : public KAutoObjectWithSlabHeapAndContainer<KSession, KAutoObjectWithList> { | 18 | class KSession final : public KAutoObjectWithSlabHeapAndContainer<KSession, KAutoObjectWithList> { |
| 17 | KERNEL_AUTOOBJECT_TRAITS(KSession, KAutoObject); | 19 | KERNEL_AUTOOBJECT_TRAITS(KSession, KAutoObject); |
| 18 | 20 | ||
| @@ -20,7 +22,8 @@ public: | |||
| 20 | explicit KSession(KernelCore& kernel_); | 22 | explicit KSession(KernelCore& kernel_); |
| 21 | ~KSession() override; | 23 | ~KSession() override; |
| 22 | 24 | ||
| 23 | void Initialize(KClientPort* port_, const std::string& name_); | 25 | void Initialize(KClientPort* port_, const std::string& name_, |
| 26 | std::shared_ptr<SessionRequestManager> manager_ = nullptr); | ||
| 24 | 27 | ||
| 25 | void Finalize() override; | 28 | void Finalize() override; |
| 26 | 29 | ||
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 | ||
| 61 | void KSharedMemory::Finalize() { | 61 | void 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 | ||
| 49 | private: | 49 | private: |
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 | ||
| 211 | ResultCode KThread::InitializeThread(KThread* thread, KThreadFunction func, uintptr_t arg, | 211 | ResultCode 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 | ||
| 225 | ResultCode KThread::InitializeDummyThread(KThread* thread) { | 225 | ResultCode 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 | ||
| 466 | ResultCode KThread::GetPhysicalCoreMask(s32* out_ideal_core, u64* out_affinity_mask) { | 466 | ResultCode 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 | ||
| 482 | ResultCode KThread::SetCoreMask(s32 cpu_core_id, u64 v_affinity_mask) { | 482 | ResultCode 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 | ||
| 605 | void KThread::SetBasePriority(s32 value) { | 605 | void 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 | ||
| 784 | ResultCode KThread::GetThreadContext3(std::vector<u8>& out) { | 784 | ResultCode 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 | ||
| 819 | void KThread::AddWaiterImpl(KThread* thread) { | 819 | void 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 | ||
| 1026 | void KThread::SetState(ThreadState state) { | 1026 | void 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 | ||
| 34 | void KTransferMemory::Finalize() { | 34 | void KTransferMemory::Finalize() { |
diff --git a/src/core/hle/kernel/k_writable_event.cpp b/src/core/hle/kernel/k_writable_event.cpp index b7b83c151..bdb1db6d5 100644 --- a/src/core/hle/kernel/k_writable_event.cpp +++ b/src/core/hle/kernel/k_writable_event.cpp | |||
| @@ -13,8 +13,8 @@ KWritableEvent::KWritableEvent(KernelCore& kernel_) | |||
| 13 | 13 | ||
| 14 | KWritableEvent::~KWritableEvent() = default; | 14 | KWritableEvent::~KWritableEvent() = default; |
| 15 | 15 | ||
| 16 | void KWritableEvent::Initialize(KEvent* parent_, std::string&& name_) { | 16 | void KWritableEvent::Initialize(KEvent* parent_event_, std::string&& name_) { |
| 17 | parent = parent_; | 17 | parent = parent_event_; |
| 18 | name = std::move(name_); | 18 | name = std::move(name_); |
| 19 | parent->GetReadableEvent().Open(); | 19 | parent->GetReadableEvent().Open(); |
| 20 | } | 20 | } |
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index 0ffb78d51..2ceeaeb5f 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp | |||
| @@ -63,8 +63,6 @@ struct KernelCore::Impl { | |||
| 63 | global_scheduler_context = std::make_unique<Kernel::GlobalSchedulerContext>(kernel); | 63 | global_scheduler_context = std::make_unique<Kernel::GlobalSchedulerContext>(kernel); |
| 64 | global_handle_table = std::make_unique<Kernel::KHandleTable>(kernel); | 64 | global_handle_table = std::make_unique<Kernel::KHandleTable>(kernel); |
| 65 | 65 | ||
| 66 | service_thread_manager = | ||
| 67 | std::make_unique<Common::ThreadWorker>(1, "yuzu:ServiceThreadManager"); | ||
| 68 | is_phantom_mode_for_singlecore = false; | 66 | is_phantom_mode_for_singlecore = false; |
| 69 | 67 | ||
| 70 | InitializePhysicalCores(); | 68 | InitializePhysicalCores(); |
| @@ -96,7 +94,6 @@ struct KernelCore::Impl { | |||
| 96 | process_list.clear(); | 94 | process_list.clear(); |
| 97 | 95 | ||
| 98 | // Ensures all service threads gracefully shutdown | 96 | // Ensures all service threads gracefully shutdown |
| 99 | service_thread_manager.reset(); | ||
| 100 | service_threads.clear(); | 97 | service_threads.clear(); |
| 101 | 98 | ||
| 102 | next_object_id = 0; | 99 | next_object_id = 0; |
| @@ -680,10 +677,6 @@ struct KernelCore::Impl { | |||
| 680 | // Threads used for services | 677 | // Threads used for services |
| 681 | std::unordered_set<std::shared_ptr<Kernel::ServiceThread>> service_threads; | 678 | std::unordered_set<std::shared_ptr<Kernel::ServiceThread>> service_threads; |
| 682 | 679 | ||
| 683 | // Service threads are managed by a worker thread, so that a calling service thread can queue up | ||
| 684 | // the release of itself | ||
| 685 | std::unique_ptr<Common::ThreadWorker> service_thread_manager; | ||
| 686 | |||
| 687 | std::array<KThread*, Core::Hardware::NUM_CPU_CORES> suspend_threads; | 680 | std::array<KThread*, Core::Hardware::NUM_CPU_CORES> suspend_threads; |
| 688 | std::array<Core::CPUInterruptHandler, Core::Hardware::NUM_CPU_CORES> interrupts{}; | 681 | std::array<Core::CPUInterruptHandler, Core::Hardware::NUM_CPU_CORES> interrupts{}; |
| 689 | std::array<std::unique_ptr<Kernel::KScheduler>, Core::Hardware::NUM_CPU_CORES> schedulers{}; | 682 | std::array<std::unique_ptr<Kernel::KScheduler>, Core::Hardware::NUM_CPU_CORES> schedulers{}; |
| @@ -986,17 +979,14 @@ void KernelCore::ExitSVCProfile() { | |||
| 986 | 979 | ||
| 987 | std::weak_ptr<Kernel::ServiceThread> KernelCore::CreateServiceThread(const std::string& name) { | 980 | std::weak_ptr<Kernel::ServiceThread> KernelCore::CreateServiceThread(const std::string& name) { |
| 988 | auto service_thread = std::make_shared<Kernel::ServiceThread>(*this, 1, name); | 981 | auto service_thread = std::make_shared<Kernel::ServiceThread>(*this, 1, name); |
| 989 | impl->service_thread_manager->QueueWork( | 982 | impl->service_threads.emplace(service_thread); |
| 990 | [this, service_thread] { impl->service_threads.emplace(service_thread); }); | ||
| 991 | return service_thread; | 983 | return service_thread; |
| 992 | } | 984 | } |
| 993 | 985 | ||
| 994 | void KernelCore::ReleaseServiceThread(std::weak_ptr<Kernel::ServiceThread> service_thread) { | 986 | void KernelCore::ReleaseServiceThread(std::weak_ptr<Kernel::ServiceThread> service_thread) { |
| 995 | impl->service_thread_manager->QueueWork([this, service_thread] { | 987 | if (auto strong_ptr = service_thread.lock()) { |
| 996 | if (auto strong_ptr = service_thread.lock()) { | 988 | impl->service_threads.erase(strong_ptr); |
| 997 | impl->service_threads.erase(strong_ptr); | 989 | } |
| 998 | } | ||
| 999 | }); | ||
| 1000 | } | 990 | } |
| 1001 | 991 | ||
| 1002 | Init::KSlabResourceCounts& KernelCore::SlabResourceCounts() { | 992 | Init::KSlabResourceCounts& KernelCore::SlabResourceCounts() { |
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 | ||
| 159 | ResultCode ProcessCapabilities::ParseSingleFlagCapability(u32& set_flags, u32& set_svc_bits, | 159 | ResultCode 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 | ||
| 270 | ResultCode ProcessCapabilities::HandleSyscallFlags(u32& set_svc_bits, u32 flags) { | 270 | ResultCode 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 | ||
| 294 | ResultCode ProcessCapabilities::HandleMapPhysicalFlags(u32 flags, u32 size_flags, | 294 | ResultCode 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 | ||
| 300 | ResultCode ProcessCapabilities::HandleMapIOFlags(u32 flags, KPageTable& page_table) { | 300 | ResultCode 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 | ||
| 305 | ResultCode ProcessCapabilities::HandleMapRegionFlags(u32 flags, KPageTable& page_table) { | 305 | ResultCode 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 | ||
| 310 | ResultCode ProcessCapabilities::HandleInterruptFlags(u32 flags) { | 310 | ResultCode 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 | ||
| 337 | ResultCode ProcessCapabilities::HandleProgramTypeFlags(u32 flags) { | 337 | ResultCode 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 | ||
| 348 | ResultCode ProcessCapabilities::HandleKernelVersionFlags(u32 flags) { | 348 | ResultCode 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 | ||
| 368 | ResultCode ProcessCapabilities::HandleHandleTableFlags(u32 flags) { | 368 | ResultCode 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 | ||
| 379 | ResultCode ProcessCapabilities::HandleDebugFlags(u32 flags) { | 379 | ResultCode 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..8339e11a0 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 | ||
| 138 | enum class ResourceLimitValueType { | 138 | enum 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 | ||
| 170 | static ResultCode SetHeapSize32(Core::System& system, u32* heap_addr, u32 heap_size) { | 170 | static 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 | ||
| 311 | static ResultCode ConnectToNamedPort32(Core::System& system, Handle* out_handle, | 311 | static 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 | ||
| 355 | static ResultCode GetThreadId32(Core::System& system, u32* out_thread_id_low, | 355 | static ResultCode GetThreadId32(Core::System& system, u32* out_thread_id_low, |
| @@ -449,12 +449,12 @@ static ResultCode CancelSynchronization(Core::System& system, Handle handle) { | |||
| 449 | 449 | ||
| 450 | // Get the thread from its handle. | 450 | // Get the thread from its handle. |
| 451 | KScopedAutoObject thread = | 451 | KScopedAutoObject thread = |
| 452 | system.Kernel().CurrentProcess()->GetHandleTable().GetObject<KThread>( | 452 | system.Kernel().CurrentProcess()->GetHandleTable().GetObject<KThread>(handle); |
| 453 | static_cast<Handle>(handle)); | 453 | R_UNLESS(thread.IsNotNull(), ResultInvalidHandle); |
| 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 | ||
| 460 | static ResultCode CancelSynchronization32(Core::System& system, Handle handle) { | 460 | static 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 | ||
| 1040 | static ResultCode SetThreadActivity32(Core::System& system, Handle thread_handle, | 1040 | static 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 | ||
| 1103 | static ResultCode GetThreadContext32(Core::System& system, u32 out_context, Handle thread_handle) { | 1103 | static 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 | ||
| 1121 | static ResultCode GetThreadPriority32(Core::System& system, u32* out_priority, Handle handle) { | 1121 | static 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 | ||
| 1144 | static ResultCode SetThreadPriority32(Core::System& system, Handle thread_handle, u32 priority) { | 1144 | static 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 | ||
| 1213 | static ResultCode MapSharedMemory32(Core::System& system, Handle shmem_handle, u32 address, | 1213 | static 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 | ||
| 1246 | static ResultCode UnmapSharedMemory32(Core::System& system, Handle shmem_handle, u32 address, | 1246 | static 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 | ||
| 1282 | static ResultCode QueryMemory(Core::System& system, VAddr memory_info_address, | 1282 | static 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 | ||
| 1530 | static ResultCode CreateThread32(Core::System& system, Handle* out_handle, u32 priority, | 1530 | static 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 | ||
| 1553 | static ResultCode StartThread32(Core::System& system, Handle thread_handle) { | 1553 | static 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 | ||
| 1802 | static ResultCode CloseHandle32(Core::System& system, Handle handle) { | 1802 | static 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 | ||
| 1897 | static ResultCode CreateTransferMemory32(Core::System& system, Handle* out, u32 address, u32 size, | 1897 | static 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 | ||
| 1917 | static ResultCode GetThreadCoreMask32(Core::System& system, Handle thread_handle, s32* out_core_id, | 1917 | static 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 | ||
| 1958 | static ResultCode SetThreadCoreMask32(Core::System& system, Handle thread_handle, s32 core_id, | 1958 | static 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 | ||
| 2057 | static ResultCode CreateEvent32(Core::System& system, Handle* out_write, Handle* out_read) { | 2057 | static 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 | ||
| 2087 | static ResultCode CreateResourceLimit(Core::System& system, Handle* out_handle) { | 2087 | static 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 | ||
| 2110 | static ResultCode GetResourceLimitLimitValue(Core::System& system, u64* out_limit_value, | 2110 | static 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 | ||
| 2131 | static ResultCode GetResourceLimitCurrentValue(Core::System& system, u64* out_current_value, | 2131 | static 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 | ||
| 2152 | static ResultCode SetResourceLimitLimitValue(Core::System& system, Handle resource_limit_handle, | 2152 | static 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 | ||
| 2172 | static ResultCode GetProcessList(Core::System& system, u32* out_num_processes, | 2172 | static 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 | ||
| 2209 | static ResultCode GetThreadList(Core::System& system, u32* out_num_threads, VAddr out_thread_ids, | 2209 | static 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 | ||
| 2249 | static ResultCode FlushProcessDataCache32([[maybe_unused]] Core::System& system, | 2249 | static 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 | ||
| 2259 | namespace { | 2259 | namespace { |
diff --git a/src/core/hle/result.h b/src/core/hle/result.h index df3283fe3..a755008d5 100644 --- a/src/core/hle/result.h +++ b/src/core/hle/result.h | |||
| @@ -124,27 +124,27 @@ union ResultCode { | |||
| 124 | constexpr ResultCode(ErrorModule module_, u32 description_) | 124 | constexpr ResultCode(ErrorModule module_, u32 description_) |
| 125 | : raw(module.FormatValue(module_) | description.FormatValue(description_)) {} | 125 | : raw(module.FormatValue(module_) | description.FormatValue(description_)) {} |
| 126 | 126 | ||
| 127 | constexpr bool IsSuccess() const { | 127 | [[nodiscard]] constexpr bool IsSuccess() const { |
| 128 | return raw == 0; | 128 | return raw == 0; |
| 129 | } | 129 | } |
| 130 | 130 | ||
| 131 | constexpr bool IsError() const { | 131 | [[nodiscard]] constexpr bool IsError() const { |
| 132 | return raw != 0; | 132 | return !IsSuccess(); |
| 133 | } | 133 | } |
| 134 | }; | 134 | }; |
| 135 | 135 | ||
| 136 | constexpr bool operator==(const ResultCode& a, const ResultCode& b) { | 136 | [[nodiscard]] constexpr bool operator==(const ResultCode& a, const ResultCode& b) { |
| 137 | return a.raw == b.raw; | 137 | return a.raw == b.raw; |
| 138 | } | 138 | } |
| 139 | 139 | ||
| 140 | constexpr bool operator!=(const ResultCode& a, const ResultCode& b) { | 140 | [[nodiscard]] constexpr bool operator!=(const ResultCode& a, const ResultCode& b) { |
| 141 | return a.raw != b.raw; | 141 | return !operator==(a, b); |
| 142 | } | 142 | } |
| 143 | 143 | ||
| 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`. |
| 147 | constexpr ResultCode RESULT_SUCCESS(0); | 147 | constexpr 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 | */ |
| 155 | constexpr ResultCode RESULT_UNKNOWN(UINT32_MAX); | 155 | constexpr 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 { | |||
| 191 | public: | 191 | public: |
| 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 | ||
| @@ -200,7 +200,7 @@ public: | |||
| 200 | * specify the success code. `success_code` must not be an error code. | 200 | * specify the success code. `success_code` must not be an error code. |
| 201 | */ | 201 | */ |
| 202 | template <typename... Args> | 202 | template <typename... Args> |
| 203 | static ResultVal WithCode(ResultCode success_code, Args&&... args) { | 203 | [[nodiscard]] static ResultVal WithCode(ResultCode success_code, Args&&... args) { |
| 204 | ResultVal<T> result; | 204 | ResultVal<T> result; |
| 205 | result.emplace(success_code, std::forward<Args>(args)...); | 205 | result.emplace(success_code, std::forward<Args>(args)...); |
| 206 | return result; | 206 | return result; |
| @@ -259,49 +259,49 @@ public: | |||
| 259 | } | 259 | } |
| 260 | 260 | ||
| 261 | /// Returns true if the `ResultVal` contains an error code and no value. | 261 | /// Returns true if the `ResultVal` contains an error code and no value. |
| 262 | bool empty() const { | 262 | [[nodiscard]] bool empty() const { |
| 263 | return result_code.IsError(); | 263 | return result_code.IsError(); |
| 264 | } | 264 | } |
| 265 | 265 | ||
| 266 | /// Returns true if the `ResultVal` contains a return value. | 266 | /// Returns true if the `ResultVal` contains a return value. |
| 267 | bool Succeeded() const { | 267 | [[nodiscard]] bool Succeeded() const { |
| 268 | return result_code.IsSuccess(); | 268 | return result_code.IsSuccess(); |
| 269 | } | 269 | } |
| 270 | /// Returns true if the `ResultVal` contains an error code and no value. | 270 | /// Returns true if the `ResultVal` contains an error code and no value. |
| 271 | bool Failed() const { | 271 | [[nodiscard]] bool Failed() const { |
| 272 | return empty(); | 272 | return empty(); |
| 273 | } | 273 | } |
| 274 | 274 | ||
| 275 | ResultCode Code() const { | 275 | [[nodiscard]] ResultCode Code() const { |
| 276 | return result_code; | 276 | return result_code; |
| 277 | } | 277 | } |
| 278 | 278 | ||
| 279 | const T& operator*() const { | 279 | [[nodiscard]] const T& operator*() const { |
| 280 | return object; | 280 | return object; |
| 281 | } | 281 | } |
| 282 | T& operator*() { | 282 | [[nodiscard]] T& operator*() { |
| 283 | return object; | 283 | return object; |
| 284 | } | 284 | } |
| 285 | const T* operator->() const { | 285 | [[nodiscard]] const T* operator->() const { |
| 286 | return &object; | 286 | return &object; |
| 287 | } | 287 | } |
| 288 | T* operator->() { | 288 | [[nodiscard]] T* operator->() { |
| 289 | return &object; | 289 | return &object; |
| 290 | } | 290 | } |
| 291 | 291 | ||
| 292 | /// Returns the value contained in this `ResultVal`, or the supplied default if it is missing. | 292 | /// Returns the value contained in this `ResultVal`, or the supplied default if it is missing. |
| 293 | template <typename U> | 293 | template <typename U> |
| 294 | T ValueOr(U&& value) const { | 294 | [[nodiscard]] T ValueOr(U&& value) const { |
| 295 | return !empty() ? object : std::move(value); | 295 | return !empty() ? object : std::move(value); |
| 296 | } | 296 | } |
| 297 | 297 | ||
| 298 | /// Asserts that the result succeeded and returns a reference to it. | 298 | /// Asserts that the result succeeded and returns a reference to it. |
| 299 | T& Unwrap() & { | 299 | [[nodiscard]] T& Unwrap() & { |
| 300 | ASSERT_MSG(Succeeded(), "Tried to Unwrap empty ResultVal"); | 300 | ASSERT_MSG(Succeeded(), "Tried to Unwrap empty ResultVal"); |
| 301 | return **this; | 301 | return **this; |
| 302 | } | 302 | } |
| 303 | 303 | ||
| 304 | T&& Unwrap() && { | 304 | [[nodiscard]] T&& Unwrap() && { |
| 305 | ASSERT_MSG(Succeeded(), "Tried to Unwrap empty ResultVal"); | 305 | ASSERT_MSG(Succeeded(), "Tried to Unwrap empty ResultVal"); |
| 306 | return std::move(**this); | 306 | return std::move(**this); |
| 307 | } | 307 | } |
| @@ -320,8 +320,8 @@ private: | |||
| 320 | * `T` with and creates a success `ResultVal` contained the constructed value. | 320 | * `T` with and creates a success `ResultVal` contained the constructed value. |
| 321 | */ | 321 | */ |
| 322 | template <typename T, typename... Args> | 322 | template <typename T, typename... Args> |
| 323 | ResultVal<T> MakeResult(Args&&... args) { | 323 | [[nodiscard]] ResultVal<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 | /** |
| @@ -329,9 +329,8 @@ ResultVal<T> MakeResult(Args&&... args) { | |||
| 329 | * copy or move constructing. | 329 | * copy or move constructing. |
| 330 | */ | 330 | */ |
| 331 | template <typename Arg> | 331 | template <typename Arg> |
| 332 | ResultVal<std::remove_reference_t<Arg>> MakeResult(Arg&& arg) { | 332 | [[nodiscard]] ResultVal<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 | /** |
| @@ -362,7 +361,7 @@ ResultVal<std::remove_reference_t<Arg>> MakeResult(Arg&& arg) { | |||
| 362 | #define R_SUCCEEDED(res) (res.IsSuccess()) | 361 | #define R_SUCCEEDED(res) (res.IsSuccess()) |
| 363 | 362 | ||
| 364 | /// Evaluates a boolean expression, and succeeds if that expression is true. | 363 | /// Evaluates a boolean expression, and succeeds if that expression is true. |
| 365 | #define R_SUCCEED_IF(expr) R_UNLESS(!(expr), RESULT_SUCCESS) | 364 | #define R_SUCCEED_IF(expr) R_UNLESS(!(expr), ResultSuccess) |
| 366 | 365 | ||
| 367 | /// Evaluates a boolean expression, and returns a result unless that expression is true. | 366 | /// Evaluates a boolean expression, and returns a result unless that expression is true. |
| 368 | #define R_UNLESS(expr, res) \ | 367 | #define R_UNLESS(expr, res) \ |
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: | |||
| 655 | void Module::Interface::GetUserCount(Kernel::HLERequestContext& ctx) { | 655 | void 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 | ||
| 679 | void Module::Interface::ListOpenUsers(Kernel::HLERequestContext& ctx) { | 679 | void 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 | ||
| 686 | void Module::Interface::GetLastOpenedUser(Kernel::HLERequestContext& ctx) { | 686 | void 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 | ||
| 703 | void Module::Interface::IsUserRegistrationRequestPermitted(Kernel::HLERequestContext& ctx) { | 703 | void 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 | ||
| 767 | void Module::Interface::GetBaasAccountManagerForApplication(Kernel::HLERequestContext& ctx) { | 767 | void 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 | ||
| 823 | void Module::Interface::LoadOpenContext(Kernel::HLERequestContext& ctx) { | 823 | void 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 | ||
| 843 | void Module::Interface::StoreSaveDataThumbnailApplication(Kernel::HLERequestContext& ctx) { | 843 | void 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 | ||
| 892 | void Module::Interface::TrySelectUserWithoutInteraction(Kernel::HLERequestContext& ctx) { | 892 | void 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 | ||
| 98 | void IWindowController::AcquireForegroundRights(Kernel::HLERequestContext& ctx) { | 98 | void 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 | ||
| 104 | IAudioController::IAudioController(Core::System& system_) | 104 | IAudioController::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 | ||
| 138 | void IAudioController::GetMainAppletExpectedMasterVolume(Kernel::HLERequestContext& ctx) { | 138 | void 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 | ||
| 145 | void IAudioController::GetLibraryAppletExpectedMasterVolume(Kernel::HLERequestContext& ctx) { | 145 | void 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 | ||
| 172 | void IAudioController::SetTransparentAudioRate(Kernel::HLERequestContext& ctx) { | 172 | void 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 | ||
| 186 | IDisplayController::IDisplayController(Core::System& system_) | 186 | IDisplayController::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 | ||
| 338 | void ISelfController::LockExit(Kernel::HLERequestContext& ctx) { | 338 | void 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 | ||
| 347 | void ISelfController::UnlockExit(Kernel::HLERequestContext& ctx) { | 347 | void 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 | ||
| 356 | void ISelfController::EnterFatalSection(Kernel::HLERequestContext& ctx) { | 356 | void 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 | ||
| 364 | void ISelfController::LeaveFatalSection(Kernel::HLERequestContext& ctx) { | 364 | void 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 | ||
| 380 | void ISelfController::GetLibraryAppletLaunchableEvent(Kernel::HLERequestContext& ctx) { | 380 | void 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 | ||
| 401 | void ISelfController::SetOperationModeChangedNotification(Kernel::HLERequestContext& ctx) { | 401 | void 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 | ||
| 411 | void ISelfController::SetPerformanceModeChangedNotification(Kernel::HLERequestContext& ctx) { | 411 | void 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 | ||
| 421 | void ISelfController::SetFocusHandlingMode(Kernel::HLERequestContext& ctx) { | 421 | void 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 | ||
| 440 | void ISelfController::SetRestartMessageEnabled(Kernel::HLERequestContext& ctx) { | 440 | void 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 | ||
| 447 | void ISelfController::SetOutOfFocusSuspendingEnabled(Kernel::HLERequestContext& ctx) { | 447 | void 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 | ||
| 459 | void ISelfController::SetAlbumImageOrientation(Kernel::HLERequestContext& ctx) { | 459 | void 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 | ||
| 466 | void ISelfController::CreateManagedDisplayLayer(Kernel::HLERequestContext& ctx) { | 466 | void 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 | ||
| 504 | void ISelfController::SetIdleTimeDetectionExtension(Kernel::HLERequestContext& ctx) { | 504 | void 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 | ||
| 514 | void ISelfController::GetIdleTimeDetectionExtension(Kernel::HLERequestContext& ctx) { | 514 | void 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 | ||
| 542 | void ISelfController::IsAutoSleepDisabled(Kernel::HLERequestContext& ctx) { | 542 | void 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 | ||
| 584 | AppletMessageQueue::AppletMessageQueue(Kernel::KernelCore& kernel) | 584 | AppletMessageQueue::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 | ||
| 762 | void ICommonStateGetter::SetLcdBacklighOffEnabled(Kernel::HLERequestContext& ctx) { | 762 | void 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 | ||
| 773 | void ICommonStateGetter::BeginVrModeEx(Kernel::HLERequestContext& ctx) { | 773 | void 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 | ||
| 780 | void ICommonStateGetter::EndVrModeEx(Kernel::HLERequestContext& ctx) { | 780 | void 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 | ||
| 787 | void ICommonStateGetter::GetDefaultDisplayResolutionChangeEvent(Kernel::HLERequestContext& ctx) { | 787 | void 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 | ||
| 832 | IStorageImpl::~IStorageImpl() = default; | 832 | IStorageImpl::~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 | ||
| 1111 | void IStorageAccessor::Read(Kernel::HLERequestContext& ctx) { | 1111 | void 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 | ||
| 1134 | ILibraryAppletCreator::ILibraryAppletCreator(Core::System& system_) | 1134 | ILibraryAppletCreator::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 | ||
| 1361 | void IApplicationFunctions::InitializeApplicationCopyrightFrameBuffer( | 1361 | void 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 | ||
| 1369 | void IApplicationFunctions::SetApplicationCopyrightImage(Kernel::HLERequestContext& ctx) { | 1369 | void 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 | ||
| 1376 | void IApplicationFunctions::SetApplicationCopyrightVisibility(Kernel::HLERequestContext& ctx) { | 1376 | void 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 | ||
| 1386 | void IApplicationFunctions::BeginBlockingHomeButtonShortAndLongPressed( | 1386 | void 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 | ||
| 1394 | void IApplicationFunctions::EndBlockingHomeButtonShortAndLongPressed( | 1394 | void 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 | ||
| 1402 | void IApplicationFunctions::BeginBlockingHomeButton(Kernel::HLERequestContext& ctx) { | 1402 | void 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 | ||
| 1409 | void IApplicationFunctions::EndBlockingHomeButton(Kernel::HLERequestContext& ctx) { | 1409 | void 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 | ||
| 1416 | void IApplicationFunctions::PopLaunchParameter(Kernel::HLERequestContext& ctx) { | 1416 | void 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(), ¶ms, buffer.size()); | 1455 | std::memcpy(buffer.data(), ¶ms, 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 | ||
| 1475 | void IApplicationFunctions::EnsureSaveData(Kernel::HLERequestContext& ctx) { | 1475 | void 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 | ||
| 1506 | void IApplicationFunctions::GetDisplayVersion(Kernel::HLERequestContext& ctx) { | 1506 | void 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 | ||
| 1613 | void IApplicationFunctions::SetGamePlayRecordingState(Kernel::HLERequestContext& ctx) { | 1613 | void 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 | ||
| 1620 | void IApplicationFunctions::NotifyRunning(Kernel::HLERequestContext& ctx) { | 1620 | void 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 | ||
| 1726 | void IApplicationFunctions::UnpopToUserChannel(Kernel::HLERequestContext& ctx) { | 1726 | void 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 | ||
| 1733 | void IApplicationFunctions::GetPreviousProgramIndex(Kernel::HLERequestContext& ctx) { | 1733 | void 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 | ||
| 1823 | void IHomeMenuFunctions::GetPopFromGeneralChannelEvent(Kernel::HLERequestContext& ctx) { | 1823 | void 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 | ||
| 137 | ResultCode Error::GetStatus() const { | 137 | ResultCode Error::GetStatus() const { |
| 138 | return RESULT_SUCCESS; | 138 | return ResultSuccess; |
| 139 | } | 139 | } |
| 140 | 140 | ||
| 141 | void Error::ExecuteInteractive() { | 141 | void 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 | ||
| 78 | ResultCode Auth::GetStatus() const { | 78 | ResultCode Auth::GetStatus() const { |
| 79 | return successful ? RESULT_SUCCESS : ERROR_INVALID_PIN; | 79 | return successful ? ResultSuccess : ERROR_INVALID_PIN; |
| 80 | } | 80 | } |
| 81 | 81 | ||
| 82 | void Auth::ExecuteInteractive() { | 82 | void Auth::ExecuteInteractive() { |
| @@ -175,7 +175,7 @@ bool PhotoViewer::TransactionComplete() const { | |||
| 175 | } | 175 | } |
| 176 | 176 | ||
| 177 | ResultCode PhotoViewer::GetStatus() const { | 177 | ResultCode PhotoViewer::GetStatus() const { |
| 178 | return RESULT_SUCCESS; | 178 | return ResultSuccess; |
| 179 | } | 179 | } |
| 180 | 180 | ||
| 181 | void PhotoViewer::ExecuteInteractive() { | 181 | void PhotoViewer::ExecuteInteractive() { |
| @@ -229,7 +229,7 @@ bool StubApplet::TransactionComplete() const { | |||
| 229 | 229 | ||
| 230 | ResultCode StubApplet::GetStatus() const { | 230 | ResultCode 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 | ||
| 235 | void StubApplet::ExecuteInteractive() { | 235 | void 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 | ||
| 24 | void ProfileSelect::Initialize() { | 24 | void 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 b1a81810b..00dfe1675 100644 --- a/src/core/hle/service/am/applets/software_keyboard.cpp +++ b/src/core/hle/service/am/applets/software_keyboard.cpp | |||
| @@ -658,7 +658,7 @@ void SoftwareKeyboard::InlineTextChanged() { | |||
| 658 | 658 | ||
| 659 | void SoftwareKeyboard::ExitKeyboard() { | 659 | void SoftwareKeyboard::ExitKeyboard() { |
| 660 | complete = true; | 660 | complete = true; |
| 661 | status = RESULT_SUCCESS; | 661 | status = ResultSuccess; |
| 662 | 662 | ||
| 663 | frontend.ExitKeyboard(); | 663 | frontend.ExitKeyboard(); |
| 664 | 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 | ||
| 252 | void AOC_U::GetAddOnContentListChangedEvent(Kernel::HLERequestContext& ctx) { | 252 | void 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 | ||
| 129 | void APM_Sys::GetCurrentPerformanceConfiguration(Kernel::HLERequestContext& ctx) { | 129 | void 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 | ||
| 389 | bool Boxcat::Synchronize(TitleIDVersion title, ProgressServiceBackend& progress) { | 389 | bool 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 | ||
| 68 | void CAPS_U::GetAlbumContentsFileListForApplication(Kernel::HLERequestContext& ctx) { | 68 | void 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 | ||
| 141 | void Module::Interface::ThrowFatalWithPolicy(Kernel::HLERequestContext& ctx) { | 141 | void 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 | ||
| 153 | void Module::Interface::ThrowFatalWithCpuContext(Kernel::HLERequestContext& ctx) { | 153 | void 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 | ||
| 169 | void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system) { | 169 | void 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 | ||
| 79 | ResultCode VfsDirectoryServiceWrapper::DeleteFile(const std::string& path_) const { | 79 | ResultCode 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 | ||
| 98 | ResultCode VfsDirectoryServiceWrapper::CreateDirectory(const std::string& path_) const { | 98 | ResultCode 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 | ||
| 112 | ResultCode VfsDirectoryServiceWrapper::DeleteDirectory(const std::string& path_) const { | 112 | ResultCode 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 | ||
| 122 | ResultCode VfsDirectoryServiceWrapper::DeleteDirectoryRecursively(const std::string& path_) const { | 122 | ResultCode 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 | ||
| 132 | ResultCode VfsDirectoryServiceWrapper::CleanDirectoryRecursively(const std::string& path) const { | 132 | ResultCode 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 | ||
| 144 | ResultCode VfsDirectoryServiceWrapper::RenameFile(const std::string& src_path_, | 144 | ResultCode 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 | ||
| 179 | ResultCode VfsDirectoryServiceWrapper::RenameDirectory(const std::string& src_path_, | 179 | ResultCode 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 | ||
| 205 | ResultVal<FileSys::VirtualFile> VfsDirectoryServiceWrapper::OpenFile(const std::string& path_, | 205 | ResultVal<FileSys::VirtualFile> VfsDirectoryServiceWrapper::OpenFile(const std::string& path_, |
| @@ -258,7 +258,7 @@ FileSystemController::~FileSystemController() = default; | |||
| 258 | ResultCode FileSystemController::RegisterRomFS(std::unique_ptr<FileSys::RomFSFactory>&& factory) { | 258 | ResultCode 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 | ||
| 264 | ResultCode FileSystemController::RegisterSaveData( | 264 | ResultCode 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 | ||
| 272 | ResultCode FileSystemController::RegisterSDMC(std::unique_ptr<FileSys::SDMCFactory>&& factory) { | 272 | ResultCode 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 | ||
| 279 | ResultCode FileSystemController::RegisterBIS(std::unique_ptr<FileSys::BISFactory>&& factory) { | 279 | ResultCode 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 | ||
| 286 | void FileSystemController::SetPackedUpdate(FileSys::VirtualFile update_raw) { | 286 | void 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 | ||
| 724 | void FileSystemController::SetAutoSaveDataCreation(bool enable) { | ||
| 725 | save_data_factory->SetAutoCreate(enable); | ||
| 726 | } | ||
| 727 | |||
| 724 | void FileSystemController::CreateFactories(FileSys::VfsFilesystem& vfs, bool overwrite) { | 728 | void 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 | ||
| 802 | void FSP_SRV::OpenFileSystemWithPatch(Kernel::HLERequestContext& ctx) { | 802 | void 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 | ||
| 813 | void FSP_SRV::OpenSdCardFileSystem(Kernel::HLERequestContext& ctx) { | 813 | void 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 | ||
| 841 | void FSP_SRV::OpenSaveDataFileSystem(Kernel::HLERequestContext& ctx) { | 841 | void 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 | ||
| 909 | void FSP_SRV::ReadSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute( | 909 | void 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 | ||
| 1033 | void 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 | |||
| 1033 | void FSP_SRV::SetGlobalAccessLogMode(Kernel::HLERequestContext& ctx) { | 1042 | void 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 | ||
| 1043 | void FSP_SRV::GetGlobalAccessLogMode(Kernel::HLERequestContext& ctx) { | 1052 | void 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 | ||
| 1064 | void FSP_SRV::GetProgramIndexForAccessLog(Kernel::HLERequestContext& ctx) { | 1073 | void 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 | ||
| 281 | void Module::Interface::CreateFriendService(Kernel::HLERequestContext& ctx) { | 281 | void 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 | ||
| 135 | void ARP_R::GetApplicationControlPropertyWithApplicationId(Kernel::HLERequestContext& ctx) { | 135 | void 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 | ||
| 156 | class IRegistrar final : public ServiceFramework<IRegistrar> { | 156 | class 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 | ||
| 60 | ResultCode ARPManager::Unregister(u64 title_id) { | 60 | ResultCode 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 | ||
| 74 | void ARPManager::ResetAll() { | 74 | void ARPManager::ResetAll() { |
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 | ||
| 370 | void Hid::ActivateTouchScreen(Kernel::HLERequestContext& ctx) { | 370 | void 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 | ||
| 382 | void Hid::ActivateMouse(Kernel::HLERequestContext& ctx) { | 382 | void 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 | ||
| 394 | void Hid::ActivateKeyboard(Kernel::HLERequestContext& ctx) { | 394 | void 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 | ||
| 406 | void Hid::SendKeyboardLockKeyEvent(Kernel::HLERequestContext& ctx) { | 406 | void 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 | ||
| 416 | void Hid::ActivateXpad(Kernel::HLERequestContext& ctx) { | 416 | void 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 | ||
| 435 | void Hid::GetXpadIDs(Kernel::HLERequestContext& ctx) { | 435 | void 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 | ||
| 467 | void Hid::DeactivateSixAxisSensor(Kernel::HLERequestContext& ctx) { | 467 | void 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 | ||
| 488 | void Hid::StartSixAxisSensor(Kernel::HLERequestContext& ctx) { | 488 | void 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 | ||
| 509 | void Hid::StopSixAxisSensor(Kernel::HLERequestContext& ctx) { | 509 | void 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 | ||
| 530 | void Hid::EnableSixAxisSensorFusion(Kernel::HLERequestContext& ctx) { | 530 | void 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 | ||
| 553 | void Hid::SetSixAxisSensorFusionParameters(Kernel::HLERequestContext& ctx) { | 553 | void 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 | ||
| 579 | void Hid::GetSixAxisSensorFusionParameters(Kernel::HLERequestContext& ctx) { | 579 | void 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 | ||
| 630 | void Hid::SetGyroscopeZeroDriftMode(Kernel::HLERequestContext& ctx) { | 630 | void 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 | ||
| 649 | void Hid::GetGyroscopeZeroDriftMode(Kernel::HLERequestContext& ctx) { | 649 | void 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 | ||
| 692 | void Hid::IsSixAxisSensorAtRest(Kernel::HLERequestContext& ctx) { | 692 | void 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 | ||
| 732 | void Hid::SetSupportedNpadStyleSet(Kernel::HLERequestContext& ctx) { | 732 | void 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 | ||
| 745 | void Hid::GetSupportedNpadStyleSet(Kernel::HLERequestContext& ctx) { | 745 | void 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 | ||
| 771 | void Hid::ActivateNpad(Kernel::HLERequestContext& ctx) { | 771 | void 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 | ||
| 783 | void Hid::DeactivateNpad(Kernel::HLERequestContext& ctx) { | 783 | void 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 | ||
| 795 | void Hid::AcquireNpadStyleSetUpdateEventHandle(Kernel::HLERequestContext& ctx) { | 795 | void 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 | ||
| 835 | void Hid::GetPlayerLedPattern(Kernel::HLERequestContext& ctx) { | 835 | void 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 | ||
| 868 | void Hid::SetNpadJoyHoldType(Kernel::HLERequestContext& ctx) { | 868 | void 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 | ||
| 882 | void Hid::GetNpadJoyHoldType(Kernel::HLERequestContext& ctx) { | 882 | void 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 | ||
| 913 | void Hid::SetNpadJoyAssignmentModeSingle(Kernel::HLERequestContext& ctx) { | 913 | void 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 | ||
| 937 | void Hid::SetNpadJoyAssignmentModeDual(Kernel::HLERequestContext& ctx) { | 937 | void 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 | ||
| 957 | void Hid::MergeSingleJoyAsDualJoy(Kernel::HLERequestContext& ctx) { | 957 | void 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 | ||
| 973 | void Hid::StartLrAssignmentMode(Kernel::HLERequestContext& ctx) { | 973 | void 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 | ||
| 985 | void Hid::StopLrAssignmentMode(Kernel::HLERequestContext& ctx) { | 985 | void 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 | ||
| 997 | void Hid::SetNpadHandheldActivationMode(Kernel::HLERequestContext& ctx) { | 997 | void 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 | ||
| 1012 | void Hid::GetNpadHandheldActivationMode(Kernel::HLERequestContext& ctx) { | 1012 | void 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 | ||
| 1089 | void Hid::SetNpadAnalogStickUseCenterClamp(Kernel::HLERequestContext& ctx) { | 1089 | void 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 | ||
| 1110 | void Hid::GetVibrationDeviceInfo(Kernel::HLERequestContext& ctx) { | 1110 | void 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 | ||
| 1179 | void Hid::GetActualVibrationValue(Kernel::HLERequestContext& ctx) { | 1179 | void 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 | ||
| 1221 | void Hid::IsVibrationPermitted(Kernel::HLERequestContext& ctx) { | 1221 | void 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 | ||
| 1253 | void Hid::SendVibrationGcErmCommand(Kernel::HLERequestContext& ctx) { | 1253 | void 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 | ||
| 1313 | void Hid::GetActualVibrationGcErmCommand(Kernel::HLERequestContext& ctx) { | 1313 | void 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 | ||
| 1368 | void Hid::EndPermitVibrationSession(Kernel::HLERequestContext& ctx) { | 1368 | void 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 | ||
| 1378 | void Hid::IsVibrationDeviceMounted(Kernel::HLERequestContext& ctx) { | 1378 | void 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 | ||
| 1412 | void Hid::StartConsoleSixAxisSensor(Kernel::HLERequestContext& ctx) { | 1412 | void 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 | ||
| 1432 | void Hid::StopConsoleSixAxisSensor(Kernel::HLERequestContext& ctx) { | 1432 | void 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 | ||
| 1452 | void Hid::ActivateSevenSixAxisSensor(Kernel::HLERequestContext& ctx) { | 1452 | void 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 | ||
| 1464 | void Hid::StartSevenSixAxisSensor(Kernel::HLERequestContext& ctx) { | 1464 | void 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 | ||
| 1475 | void Hid::StopSevenSixAxisSensor(Kernel::HLERequestContext& ctx) { | 1475 | void 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 | ||
| 1486 | void Hid::InitializeSevenSixAxisSensor(Kernel::HLERequestContext& ctx) { | 1486 | void 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 | ||
| 1536 | void Hid::FinalizeSevenSixAxisSensor(Kernel::HLERequestContext& ctx) { | 1536 | void 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 | ||
| 1547 | void Hid::ResetSevenSixAxisSensorTimestamp(Kernel::HLERequestContext& ctx) { | 1547 | void 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 | ||
| 1560 | void Hid::SetIsPalmaAllConnectable(Kernel::HLERequestContext& ctx) { | 1560 | void 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 | ||
| 1573 | void Hid::SetPalmaBoostMode(Kernel::HLERequestContext& ctx) { | 1573 | void 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 | ||
| 1583 | void Hid::SetNpadCommunicationMode(Kernel::HLERequestContext& ctx) { | 1583 | void 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 | ||
| 1598 | void Hid::GetNpadCommunicationMode(Kernel::HLERequestContext& ctx) { | 1598 | void 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 | ||
| 49 | void IRS::DeactivateIrsensor(Kernel::HLERequestContext& ctx) { | 49 | void 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 | ||
| 56 | void IRS::GetIrsensorSharedMemoryHandle(Kernel::HLERequestContext& ctx) { | 56 | void 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 | ||
| 71 | void IRS::RunMomentProcessor(Kernel::HLERequestContext& ctx) { | 71 | void 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 | ||
| 78 | void IRS::RunClusteringProcessor(Kernel::HLERequestContext& ctx) { | 78 | void 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 | ||
| 85 | void IRS::RunImageTransferProcessor(Kernel::HLERequestContext& ctx) { | 85 | void 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 | ||
| 92 | void IRS::GetImageTransferProcessorState(Kernel::HLERequestContext& ctx) { | 92 | void 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 | ||
| 108 | void IRS::GetNpadIrCameraHandle(Kernel::HLERequestContext& ctx) { | 108 | void 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 | ||
| 123 | void IRS::SuspendImageProcessor(Kernel::HLERequestContext& ctx) { | 123 | void 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 | ||
| 130 | void IRS::CheckFirmwareVersion(Kernel::HLERequestContext& ctx) { | 130 | void 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 | ||
| 137 | void IRS::SetFunctionLevel(Kernel::HLERequestContext& ctx) { | 137 | void 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 | ||
| 144 | void IRS::RunImageTransferExProcessor(Kernel::HLERequestContext& ctx) { | 144 | void 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 | ||
| 151 | void IRS::RunIrLedProcessor(Kernel::HLERequestContext& ctx) { | 151 | void 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 | ||
| 158 | void IRS::StopImageProcessorAsync(Kernel::HLERequestContext& ctx) { | 158 | void 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 | ||
| 165 | void IRS::ActivateIrsensorWithFunctionLevel(Kernel::HLERequestContext& ctx) { | 165 | void 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 | ||
| 172 | IRS::~IRS() = default; | 172 | IRS::~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 c709a8028..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,7 +210,7 @@ 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 | }; |
| @@ -300,7 +300,7 @@ public: | |||
| 300 | input); | 300 | input); |
| 301 | 301 | ||
| 302 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 302 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
| 303 | rb.Push(RESULT_SUCCESS); | 303 | rb.Push(ResultSuccess); |
| 304 | rb.PushIpcInterface<INetworkService>(system); | 304 | rb.PushIpcInterface<INetworkService>(system); |
| 305 | } | 305 | } |
| 306 | 306 | ||
| @@ -311,7 +311,7 @@ public: | |||
| 311 | LOG_WARNING(Service_LDN, "(STUBBED) called reserved_input={}", reserved_input); | 311 | LOG_WARNING(Service_LDN, "(STUBBED) called reserved_input={}", reserved_input); |
| 312 | 312 | ||
| 313 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 313 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
| 314 | rb.Push(RESULT_SUCCESS); | 314 | rb.Push(ResultSuccess); |
| 315 | rb.PushIpcInterface<INetworkServiceMonitor>(system); | 315 | rb.PushIpcInterface<INetworkServiceMonitor>(system); |
| 316 | } | 316 | } |
| 317 | }; | 317 | }; |
| @@ -338,7 +338,7 @@ public: | |||
| 338 | input); | 338 | input); |
| 339 | 339 | ||
| 340 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 340 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
| 341 | rb.Push(RESULT_SUCCESS); | 341 | rb.Push(ResultSuccess); |
| 342 | rb.PushIpcInterface<INetworkService>(system); | 342 | rb.PushIpcInterface<INetworkService>(system); |
| 343 | } | 343 | } |
| 344 | 344 | ||
| @@ -349,7 +349,7 @@ public: | |||
| 349 | LOG_WARNING(Service_LDN, "(STUBBED) called reserved_input={}", reserved_input); | 349 | LOG_WARNING(Service_LDN, "(STUBBED) called reserved_input={}", reserved_input); |
| 350 | 350 | ||
| 351 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 351 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
| 352 | rb.Push(RESULT_SUCCESS); | 352 | rb.Push(ResultSuccess); |
| 353 | rb.PushIpcInterface<INetworkServiceMonitor>(system); | 353 | rb.PushIpcInterface<INetworkServiceMonitor>(system); |
| 354 | } | 354 | } |
| 355 | }; | 355 | }; |
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 | ||
| 602 | private: | 602 | private: |
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: | |||
| 267 | private: | 267 | private: |
| 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..74cc45f1e 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 | ||
| 222 | void PL_U::GetLoadState(Kernel::HLERequestContext& ctx) { | 222 | void 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 | ||
| @@ -254,13 +254,11 @@ void PL_U::GetSharedMemoryNativeHandle(Kernel::HLERequestContext& ctx) { | |||
| 254 | LOG_DEBUG(Service_NS, "called"); | 254 | LOG_DEBUG(Service_NS, "called"); |
| 255 | 255 | ||
| 256 | // Create shared font memory object | 256 | // Create shared font memory object |
| 257 | auto& kernel = system.Kernel(); | ||
| 258 | |||
| 259 | std::memcpy(kernel.GetFontSharedMem().GetPointer(), impl->shared_font->data(), | 257 | std::memcpy(kernel.GetFontSharedMem().GetPointer(), impl->shared_font->data(), |
| 260 | impl->shared_font->size()); | 258 | impl->shared_font->size()); |
| 261 | 259 | ||
| 262 | IPC::ResponseBuilder rb{ctx, 2, 1}; | 260 | IPC::ResponseBuilder rb{ctx, 2, 1}; |
| 263 | rb.Push(RESULT_SUCCESS); | 261 | rb.Push(ResultSuccess); |
| 264 | rb.PushCopyObjects(&kernel.GetFontSharedMem()); | 262 | rb.PushCopyObjects(&kernel.GetFontSharedMem()); |
| 265 | } | 263 | } |
| 266 | 264 | ||
| @@ -294,7 +292,7 @@ void PL_U::GetSharedFontInOrderOfPriority(Kernel::HLERequestContext& ctx) { | |||
| 294 | ctx.WriteBuffer(font_offsets, 1); | 292 | ctx.WriteBuffer(font_offsets, 1); |
| 295 | ctx.WriteBuffer(font_sizes, 2); | 293 | ctx.WriteBuffer(font_sizes, 2); |
| 296 | 294 | ||
| 297 | rb.Push(RESULT_SUCCESS); | 295 | rb.Push(ResultSuccess); |
| 298 | rb.Push<u8>(static_cast<u8>(LoadState::Done)); // Fonts Loaded | 296 | rb.Push<u8>(static_cast<u8>(LoadState::Done)); // Fonts Loaded |
| 299 | rb.Push<u32>(static_cast<u32>(font_codes.size())); | 297 | rb.Push<u32>(static_cast<u32>(font_codes.size())); |
| 300 | } | 298 | } |
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) { | |||
| 23 | void NVDRV::Open(Kernel::HLERequestContext& ctx) { | 23 | void 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 | ||
| 53 | void NVDRV::ServiceError(Kernel::HLERequestContext& ctx, NvResult result) { | 53 | void 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 | ||
| 218 | void NVDRV::GetStatus(Kernel::HLERequestContext& ctx) { | 218 | void 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 | ||
| 235 | NVDRV::NVDRV(Core::System& system_, std::shared_ptr<Module> nvdrv_, const char* name) | 235 | NVDRV::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..4e1541630 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp | |||
| @@ -93,8 +93,8 @@ namespace Service { | |||
| 93 | 93 | ||
| 94 | ServiceFrameworkBase::ServiceFrameworkBase(Core::System& system_, const char* service_name_, | 94 | ServiceFrameworkBase::ServiceFrameworkBase(Core::System& system_, const char* service_name_, |
| 95 | u32 max_sessions_, InvokerFn* handler_invoker_) | 95 | u32 max_sessions_, InvokerFn* handler_invoker_) |
| 96 | : system{system_}, service_name{service_name_}, max_sessions{max_sessions_}, | 96 | : SessionRequestHandler(system_.Kernel(), service_name_), system{system_}, |
| 97 | handler_invoker{handler_invoker_} {} | 97 | service_name{service_name_}, max_sessions{max_sessions_}, handler_invoker{handler_invoker_} {} |
| 98 | 98 | ||
| 99 | ServiceFrameworkBase::~ServiceFrameworkBase() { | 99 | ServiceFrameworkBase::~ServiceFrameworkBase() { |
| 100 | // Wait for other threads to release access before destroying | 100 | // Wait for other threads to release access before destroying |
| @@ -111,7 +111,7 @@ void ServiceFrameworkBase::InstallAsService(SM::ServiceManager& service_manager) | |||
| 111 | port_installed = true; | 111 | port_installed = true; |
| 112 | } | 112 | } |
| 113 | 113 | ||
| 114 | Kernel::KClientPort& ServiceFrameworkBase::CreatePort(Kernel::KernelCore& kernel) { | 114 | Kernel::KClientPort& ServiceFrameworkBase::CreatePort() { |
| 115 | const auto guard = LockService(); | 115 | const auto guard = LockService(); |
| 116 | 116 | ||
| 117 | ASSERT(!port_installed); | 117 | ASSERT(!port_installed); |
| @@ -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/service.h b/src/core/hle/service/service.h index 4c048173b..e078ac176 100644 --- a/src/core/hle/service/service.h +++ b/src/core/hle/service/service.h | |||
| @@ -23,6 +23,7 @@ namespace Kernel { | |||
| 23 | class HLERequestContext; | 23 | class HLERequestContext; |
| 24 | class KClientPort; | 24 | class KClientPort; |
| 25 | class KServerSession; | 25 | class KServerSession; |
| 26 | class ServiceThread; | ||
| 26 | } // namespace Kernel | 27 | } // namespace Kernel |
| 27 | 28 | ||
| 28 | namespace Service { | 29 | namespace Service { |
| @@ -39,9 +40,11 @@ namespace SM { | |||
| 39 | class ServiceManager; | 40 | class ServiceManager; |
| 40 | } | 41 | } |
| 41 | 42 | ||
| 42 | static const int kMaxPortSize = 8; ///< Maximum size of a port name (8 characters) | 43 | /// Default number of maximum connections to a server session. |
| 43 | /// Arbitrary default number of maximum connections to an HLE service. | 44 | static constexpr u32 ServerSessionCountMax = 0x40; |
| 44 | static const u32 DefaultMaxSessions = 10; | 45 | static_assert(ServerSessionCountMax == 0x40, |
| 46 | "ServerSessionCountMax isn't 0x40 somehow, this assert is a reminder that this will " | ||
| 47 | "break lots of things"); | ||
| 45 | 48 | ||
| 46 | /** | 49 | /** |
| 47 | * This is an non-templated base of ServiceFramework to reduce code bloat and compilation times, it | 50 | * This is an non-templated base of ServiceFramework to reduce code bloat and compilation times, it |
| @@ -74,7 +77,7 @@ public: | |||
| 74 | void InvokeRequestTipc(Kernel::HLERequestContext& ctx); | 77 | void InvokeRequestTipc(Kernel::HLERequestContext& ctx); |
| 75 | 78 | ||
| 76 | /// Creates a port pair and registers it on the kernel's global port registry. | 79 | /// Creates a port pair and registers it on the kernel's global port registry. |
| 77 | Kernel::KClientPort& CreatePort(Kernel::KernelCore& kernel); | 80 | Kernel::KClientPort& CreatePort(); |
| 78 | 81 | ||
| 79 | /// Handles a synchronization request for the service. | 82 | /// Handles a synchronization request for the service. |
| 80 | ResultCode HandleSyncRequest(Kernel::KServerSession& session, | 83 | ResultCode HandleSyncRequest(Kernel::KServerSession& session, |
| @@ -177,7 +180,7 @@ protected: | |||
| 177 | * connected to this service at the same time. | 180 | * connected to this service at the same time. |
| 178 | */ | 181 | */ |
| 179 | explicit ServiceFramework(Core::System& system_, const char* service_name_, | 182 | explicit ServiceFramework(Core::System& system_, const char* service_name_, |
| 180 | u32 max_sessions_ = DefaultMaxSessions) | 183 | u32 max_sessions_ = ServerSessionCountMax) |
| 181 | : ServiceFrameworkBase(system_, service_name_, max_sessions_, Invoker) {} | 184 | : ServiceFrameworkBase(system_, service_name_, max_sessions_, Invoker) {} |
| 182 | 185 | ||
| 183 | /// Registers handlers in the service. | 186 | /// Registers handlers in the service. |
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 | ||
| 78 | void PushResponseLanguageCode(Kernel::HLERequestContext& ctx, std::size_t num_language_codes) { | 78 | void 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 | ||
| 106 | SET_SYS::SET_SYS(Core::System& system_) : ServiceFramework{system_, "set:sys"} { | 106 | SET_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..8b9418e0f 100644 --- a/src/core/hle/service/sm/controller.cpp +++ b/src/core/hle/service/sm/controller.cpp | |||
| @@ -23,47 +23,30 @@ 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 | ||
| 30 | void Controller::CloneCurrentObject(Kernel::HLERequestContext& ctx) { | 30 | void Controller::CloneCurrentObject(Kernel::HLERequestContext& ctx) { |
| 31 | // TODO(bunnei): This is just creating a new handle to the same Session. I assume this is wrong | ||
| 32 | // and that we probably want to actually make an entirely new Session, but we still need to | ||
| 33 | // verify this on hardware. | ||
| 34 | |||
| 35 | LOG_DEBUG(Service, "called"); | 31 | LOG_DEBUG(Service, "called"); |
| 36 | 32 | ||
| 37 | auto& kernel = system.Kernel(); | 33 | auto& parent_session = *ctx.Session()->GetParent(); |
| 38 | auto* session = ctx.Session()->GetParent(); | 34 | auto& parent_port = parent_session.GetParent()->GetParent()->GetClientPort(); |
| 39 | auto* port = session->GetParent()->GetParent(); | 35 | auto& session_manager = parent_session.GetServerSession().GetSessionRequestManager(); |
| 40 | 36 | ||
| 41 | // Reserve a new session from the process resource limit. | 37 | // Create a session. |
| 42 | Kernel::KScopedResourceReservation session_reservation( | 38 | Kernel::KClientSession* session{}; |
| 43 | kernel.CurrentProcess()->GetResourceLimit(), Kernel::LimitableResource::Sessions); | 39 | const ResultCode result = parent_port.CreateSession(std::addressof(session), session_manager); |
| 44 | if (!session_reservation.Succeeded()) { | 40 | if (result.IsError()) { |
| 41 | LOG_CRITICAL(Service, "CreateSession failed with error 0x{:08X}", result.raw); | ||
| 45 | IPC::ResponseBuilder rb{ctx, 2}; | 42 | IPC::ResponseBuilder rb{ctx, 2}; |
| 46 | rb.Push(Kernel::ResultLimitReached); | 43 | rb.Push(result); |
| 47 | } | 44 | } |
| 48 | 45 | ||
| 49 | // Create a new session. | ||
| 50 | auto* clone = Kernel::KSession::Create(kernel); | ||
| 51 | clone->Initialize(&port->GetClientPort(), session->GetName()); | ||
| 52 | |||
| 53 | // Commit the session reservation. | ||
| 54 | session_reservation.Commit(); | ||
| 55 | |||
| 56 | // Enqueue the session with the named port. | ||
| 57 | port->EnqueueSession(&clone->GetServerSession()); | ||
| 58 | |||
| 59 | // Set the session request manager. | ||
| 60 | clone->GetServerSession().SetSessionRequestManager( | ||
| 61 | session->GetServerSession().GetSessionRequestManager()); | ||
| 62 | |||
| 63 | // We succeeded. | 46 | // We succeeded. |
| 64 | IPC::ResponseBuilder rb{ctx, 2, 0, 1, IPC::ResponseBuilder::Flags::AlwaysMoveHandles}; | 47 | IPC::ResponseBuilder rb{ctx, 2, 0, 1, IPC::ResponseBuilder::Flags::AlwaysMoveHandles}; |
| 65 | rb.Push(RESULT_SUCCESS); | 48 | rb.Push(ResultSuccess); |
| 66 | rb.PushMoveObjects(clone->GetClientSession()); | 49 | rb.PushMoveObjects(session); |
| 67 | } | 50 | } |
| 68 | 51 | ||
| 69 | void Controller::CloneCurrentObjectEx(Kernel::HLERequestContext& ctx) { | 52 | void Controller::CloneCurrentObjectEx(Kernel::HLERequestContext& ctx) { |
| @@ -76,7 +59,7 @@ void Controller::QueryPointerBufferSize(Kernel::HLERequestContext& ctx) { | |||
| 76 | LOG_WARNING(Service, "(STUBBED) called"); | 59 | LOG_WARNING(Service, "(STUBBED) called"); |
| 77 | 60 | ||
| 78 | IPC::ResponseBuilder rb{ctx, 3}; | 61 | IPC::ResponseBuilder rb{ctx, 3}; |
| 79 | rb.Push(RESULT_SUCCESS); | 62 | rb.Push(ResultSuccess); |
| 80 | rb.Push<u16>(0x8000); | 63 | rb.Push<u16>(0x8000); |
| 81 | } | 64 | } |
| 82 | 65 | ||
diff --git a/src/core/hle/service/sm/sm.cpp b/src/core/hle/service/sm/sm.cpp index a9bc7da74..c7828c3bd 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 | ||
| 42 | Kernel::KClientPort& ServiceManager::InterfaceFactory(ServiceManager& self, Core::System& system) { | 42 | Kernel::KClientPort& ServiceManager::InterfaceFactory(ServiceManager& self, Core::System& system) { |
| @@ -46,7 +46,7 @@ Kernel::KClientPort& ServiceManager::InterfaceFactory(ServiceManager& self, Core | |||
| 46 | self.sm_interface = sm; | 46 | self.sm_interface = sm; |
| 47 | self.controller_interface = std::make_unique<Controller>(system); | 47 | self.controller_interface = std::make_unique<Controller>(system); |
| 48 | 48 | ||
| 49 | return sm->CreatePort(system.Kernel()); | 49 | return sm->CreatePort(); |
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | ResultVal<Kernel::KServerPort*> ServiceManager::RegisterService(std::string name, | 52 | ResultVal<Kernel::KServerPort*> ServiceManager::RegisterService(std::string name, |
| @@ -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 | ||
| 85 | ResultVal<Kernel::KPort*> ServiceManager::GetServicePort(const std::string& name) { | 85 | ResultVal<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 | ||
| 115 | void SM::GetService(Kernel::HLERequestContext& ctx) { | 115 | void SM::GetService(Kernel::HLERequestContext& ctx) { |
| @@ -151,31 +151,23 @@ ResultVal<Kernel::KClientSession*> SM::GetServiceImpl(Kernel::HLERequestContext& | |||
| 151 | std::string name(PopServiceName(rp)); | 151 | std::string name(PopServiceName(rp)); |
| 152 | 152 | ||
| 153 | // Find the named port. | 153 | // Find the named port. |
| 154 | auto result = service_manager.GetServicePort(name); | 154 | auto port_result = service_manager.GetServicePort(name); |
| 155 | if (result.Failed()) { | 155 | if (port_result.Failed()) { |
| 156 | LOG_ERROR(Service_SM, "called service={} -> error 0x{:08X}", name, result.Code().raw); | 156 | LOG_ERROR(Service_SM, "called service={} -> error 0x{:08X}", name, port_result.Code().raw); |
| 157 | return result.Code(); | 157 | return port_result.Code(); |
| 158 | } | 158 | } |
| 159 | auto* port = result.Unwrap(); | 159 | auto& port = port_result.Unwrap()->GetClientPort(); |
| 160 | |||
| 161 | // Reserve a new session from the process resource limit. | ||
| 162 | Kernel::KScopedResourceReservation session_reservation( | ||
| 163 | kernel.CurrentProcess()->GetResourceLimit(), Kernel::LimitableResource::Sessions); | ||
| 164 | R_UNLESS(session_reservation.Succeeded(), Kernel::ResultLimitReached); | ||
| 165 | 160 | ||
| 166 | // Create a new session. | 161 | // Create a new session. |
| 167 | auto* session = Kernel::KSession::Create(kernel); | 162 | Kernel::KClientSession* session{}; |
| 168 | session->Initialize(&port->GetClientPort(), std::move(name)); | 163 | if (const auto result = port.CreateSession(std::addressof(session)); result.IsError()) { |
| 169 | 164 | LOG_ERROR(Service_SM, "called service={} -> error 0x{:08X}", name, result.raw); | |
| 170 | // Commit the session reservation. | 165 | return result; |
| 171 | session_reservation.Commit(); | 166 | } |
| 172 | |||
| 173 | // Enqueue the session with the named port. | ||
| 174 | port->EnqueueSession(&session->GetServerSession()); | ||
| 175 | 167 | ||
| 176 | LOG_DEBUG(Service_SM, "called service={} -> session={}", name, session->GetId()); | 168 | LOG_DEBUG(Service_SM, "called service={} -> session={}", name, session->GetId()); |
| 177 | 169 | ||
| 178 | return MakeResult(&session->GetClientSession()); | 170 | return MakeResult(session); |
| 179 | } | 171 | } |
| 180 | 172 | ||
| 181 | void SM::RegisterService(Kernel::HLERequestContext& ctx) { | 173 | void SM::RegisterService(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 | ||
| 75 | void BSD::ConnectWork::Response(Kernel::HLERequestContext& ctx) { | 75 | void 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 | ||
| 116 | void BSD::SendWork::Response(Kernel::HLERequestContext& ctx) { | 116 | void 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 | ||
| 127 | void BSD::SendToWork::Response(Kernel::HLERequestContext& ctx) { | 127 | void 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 | ||
| 151 | void BSD::Socket(Kernel::HLERequestContext& ctx) { | 151 | void 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 { | |||
| 822 | void BSD::BuildErrnoResponse(Kernel::HLERequestContext& ctx, Errno bsd_errno) const noexcept { | 822 | void 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 | ||
| 42 | void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system) { | 42 | void 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 | }; |
| 107 | static_assert(sizeof(ClockSnapshot) == 0xD0, "ClockSnapshot is incorrect size"); | 107 | static_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: | |||
| 18 | protected: | 18 | protected: |
| 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 | ||
| 24 | private: | 24 | private: |
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: | |||
| 18 | protected: | 18 | protected: |
| 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 | ||
| 24 | private: | 24 | private: |
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 | ||
| 25 | ResultCode StandardUserSystemClockCore::SetAutomaticCorrectionEnabled(Core::System& system, | 25 | ResultCode 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 | ||
| 37 | ResultCode StandardUserSystemClockCore::GetClockContext(Core::System& system, | 36 | ResultCode 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 | |||
| 57 | ResultCode StandardUserSystemClockCore::ApplyAutomaticCorrection(Core::System& system, | 55 | ResultCode 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 | ||
| 34 | ResultCode SystemClockContextUpdateCallback::Update(const SystemClockContext& value) { | 34 | ResultCode 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 | ||
| 51 | ResultCode SystemClockContextUpdateCallback::Update() { | 51 | ResultCode 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 | ||
| 37 | ResultCode SystemClockCore::SetCurrentTime(Core::System& system, s64 posix_time) { | 37 | ResultCode 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 | ||
| 48 | ResultCode SystemClockCore::Flush(const SystemClockContext& clock_context) { | 48 | ResultCode 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 | ||
| 55 | ResultCode SystemClockCore::SetSystemClockContext(const SystemClockContext& clock_context) { | 55 | ResultCode 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 | ||
| 62 | bool SystemClockCore::IsClockSetup(Core::System& system) const { | 62 | bool 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 | ||
| 184 | void Module::Interface::GetStandardUserSystemClock(Kernel::HLERequestContext& ctx) { | 184 | void 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 | |||
| 192 | void Module::Interface::GetStandardNetworkSystemClock(Kernel::HLERequestContext& ctx) { | 192 | void 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& | |||
| 200 | void Module::Interface::GetStandardSteadyClock(Kernel::HLERequestContext& ctx) { | 200 | void 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 | ||
| 207 | void Module::Interface::GetTimeZoneService(Kernel::HLERequestContext& ctx) { | 207 | void 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) { | |||
| 215 | void Module::Interface::GetStandardLocalSystemClock(Kernel::HLERequestContext& ctx) { | 215 | void 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 | ||
| 302 | void Module::Interface::GetClockSnapshotFromSystemClockContext(Kernel::HLERequestContext& ctx) { | 302 | void 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 | ||
| 328 | void Module::Interface::CalculateStandardUserSystemClockDifferenceByUser( | 328 | void 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 | ||
| 391 | void Module::Interface::GetSharedMemoryNativeHandle(Kernel::HLERequestContext& ctx) { | 391 | void 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 | ||
| 748 | static ResultCode ToCalendarTimeInternal(const TimeZoneRule& rules, s64 time, | 748 | static 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 | ||
| 818 | static ResultCode ToCalendarTimeImpl(const TimeZoneRule& rules, s64 time, CalendarInfo& calendar) { | 818 | static 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 | ||
| 853 | ResultCode TimeZoneManager::SetUpdatedTime(const Clock::SteadyClockTimePoint& value) { | 853 | ResultCode 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 | ||
| 858 | ResultCode TimeZoneManager::ToCalendarTimeWithMyRules(s64 time, CalendarInfo& calendar) const { | 858 | ResultCode 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 | ||
| 874 | ResultCode TimeZoneManager::ToPosixTime(const TimeZoneRule& rules, | 874 | ResultCode 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 | ||
| 1027 | ResultCode TimeZoneManager::ToPosixTimeWithMyRule(const CalendarTime& calendar_time, | 1027 | ResultCode 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 | ||
| 81 | void ITimeZoneService::ToCalendarTime(Kernel::HLERequestContext& ctx) { | 81 | void 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: | |||
| 207 | private: | 207 | private: |
| 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/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/analog_from_button.cpp b/src/input_common/analog_from_button.cpp index f8ec179d0..100138d11 100755 --- a/src/input_common/analog_from_button.cpp +++ b/src/input_common/analog_from_button.cpp | |||
| @@ -21,104 +21,153 @@ public: | |||
| 21 | : up(std::move(up_)), down(std::move(down_)), left(std::move(left_)), | 21 | : up(std::move(up_)), down(std::move(down_)), left(std::move(left_)), |
| 22 | right(std::move(right_)), modifier(std::move(modifier_)), modifier_scale(modifier_scale_), | 22 | right(std::move(right_)), modifier(std::move(modifier_)), modifier_scale(modifier_scale_), |
| 23 | modifier_angle(modifier_angle_) { | 23 | modifier_angle(modifier_angle_) { |
| 24 | update_thread_running.store(true); | 24 | Input::InputCallback<bool> callbacks{ |
| 25 | update_thread = std::thread(&Analog::UpdateStatus, this); | 25 | [this]([[maybe_unused]] bool status) { UpdateStatus(); }}; |
| 26 | up->SetCallback(callbacks); | ||
| 27 | down->SetCallback(callbacks); | ||
| 28 | left->SetCallback(callbacks); | ||
| 29 | right->SetCallback(callbacks); | ||
| 26 | } | 30 | } |
| 27 | 31 | ||
| 28 | ~Analog() override { | 32 | bool IsAngleGreater(float old_angle, float new_angle) const { |
| 29 | if (update_thread_running.load()) { | 33 | constexpr float TAU = Common::PI * 2.0f; |
| 30 | update_thread_running.store(false); | 34 | // Use wider angle to ease the transition. |
| 31 | if (update_thread.joinable()) { | 35 | constexpr float aperture = TAU * 0.15f; |
| 32 | update_thread.join(); | 36 | const float top_limit = new_angle + aperture; |
| 33 | } | 37 | return (old_angle > new_angle && old_angle <= top_limit) || |
| 34 | } | 38 | (old_angle + TAU > new_angle && old_angle + TAU <= top_limit); |
| 35 | } | 39 | } |
| 36 | 40 | ||
| 37 | void MoveToDirection(bool enable, float to_angle) { | 41 | bool IsAngleSmaller(float old_angle, float new_angle) const { |
| 38 | if (!enable) { | ||
| 39 | return; | ||
| 40 | } | ||
| 41 | constexpr float TAU = Common::PI * 2.0f; | 42 | constexpr float TAU = Common::PI * 2.0f; |
| 42 | // Use wider angle to ease the transition. | 43 | // Use wider angle to ease the transition. |
| 43 | constexpr float aperture = TAU * 0.15f; | 44 | constexpr float aperture = TAU * 0.15f; |
| 44 | const float top_limit = to_angle + aperture; | 45 | const float bottom_limit = new_angle - aperture; |
| 45 | const float bottom_limit = to_angle - aperture; | 46 | return (old_angle >= bottom_limit && old_angle < new_angle) || |
| 46 | 47 | (old_angle - TAU >= bottom_limit && old_angle - TAU < new_angle); | |
| 47 | if ((angle > to_angle && angle <= top_limit) || | 48 | } |
| 48 | (angle + TAU > to_angle && angle + TAU <= top_limit)) { | 49 | |
| 49 | angle -= modifier_angle; | 50 | float GetAngle(std::chrono::time_point<std::chrono::steady_clock> now) const { |
| 50 | if (angle < 0) { | 51 | constexpr float TAU = Common::PI * 2.0f; |
| 51 | angle += TAU; | 52 | float new_angle = angle; |
| 53 | |||
| 54 | auto time_difference = static_cast<float>( | ||
| 55 | std::chrono::duration_cast<std::chrono::microseconds>(now - last_update).count()); | ||
| 56 | time_difference /= 1000.0f * 1000.0f; | ||
| 57 | if (time_difference > 0.5f) { | ||
| 58 | time_difference = 0.5f; | ||
| 59 | } | ||
| 60 | |||
| 61 | if (IsAngleGreater(new_angle, goal_angle)) { | ||
| 62 | new_angle -= modifier_angle * time_difference; | ||
| 63 | if (new_angle < 0) { | ||
| 64 | new_angle += TAU; | ||
| 65 | } | ||
| 66 | if (!IsAngleGreater(new_angle, goal_angle)) { | ||
| 67 | return goal_angle; | ||
| 52 | } | 68 | } |
| 53 | } else if ((angle >= bottom_limit && angle < to_angle) || | 69 | } else if (IsAngleSmaller(new_angle, goal_angle)) { |
| 54 | (angle - TAU >= bottom_limit && angle - TAU < to_angle)) { | 70 | new_angle += modifier_angle * time_difference; |
| 55 | angle += modifier_angle; | 71 | if (new_angle >= TAU) { |
| 56 | if (angle >= TAU) { | 72 | new_angle -= TAU; |
| 57 | angle -= TAU; | 73 | } |
| 74 | if (!IsAngleSmaller(new_angle, goal_angle)) { | ||
| 75 | return goal_angle; | ||
| 58 | } | 76 | } |
| 59 | } else { | 77 | } else { |
| 60 | angle = to_angle; | 78 | return goal_angle; |
| 61 | } | 79 | } |
| 80 | return new_angle; | ||
| 62 | } | 81 | } |
| 63 | 82 | ||
| 64 | void UpdateStatus() { | 83 | void SetGoalAngle(bool r, bool l, bool u, bool d) { |
| 65 | while (update_thread_running.load()) { | 84 | // Move to the right |
| 66 | const float coef = modifier->GetStatus() ? modifier_scale : 1.0f; | 85 | if (r && !u && !d) { |
| 67 | 86 | goal_angle = 0.0f; | |
| 68 | bool r = right->GetStatus(); | 87 | } |
| 69 | bool l = left->GetStatus(); | 88 | |
| 70 | bool u = up->GetStatus(); | 89 | // Move to the upper right |
| 71 | bool d = down->GetStatus(); | 90 | if (r && u && !d) { |
| 72 | 91 | goal_angle = Common::PI * 0.25f; | |
| 73 | // Eliminate contradictory movements | 92 | } |
| 74 | if (r && l) { | ||
| 75 | r = false; | ||
| 76 | l = false; | ||
| 77 | } | ||
| 78 | if (u && d) { | ||
| 79 | u = false; | ||
| 80 | d = false; | ||
| 81 | } | ||
| 82 | 93 | ||
| 83 | // Move to the right | 94 | // Move up |
| 84 | MoveToDirection(r && !u && !d, 0.0f); | 95 | if (u && !l && !r) { |
| 96 | goal_angle = Common::PI * 0.5f; | ||
| 97 | } | ||
| 85 | 98 | ||
| 86 | // Move to the upper right | 99 | // Move to the upper left |
| 87 | MoveToDirection(r && u && !d, Common::PI * 0.25f); | 100 | if (l && u && !d) { |
| 101 | goal_angle = Common::PI * 0.75f; | ||
| 102 | } | ||
| 88 | 103 | ||
| 89 | // Move up | 104 | // Move to the left |
| 90 | MoveToDirection(u && !l && !r, Common::PI * 0.5f); | 105 | if (l && !u && !d) { |
| 106 | goal_angle = Common::PI; | ||
| 107 | } | ||
| 91 | 108 | ||
| 92 | // Move to the upper left | 109 | // Move to the bottom left |
| 93 | MoveToDirection(l && u && !d, Common::PI * 0.75f); | 110 | if (l && !u && d) { |
| 111 | goal_angle = Common::PI * 1.25f; | ||
| 112 | } | ||
| 94 | 113 | ||
| 95 | // Move to the left | 114 | // Move down |
| 96 | MoveToDirection(l && !u && !d, Common::PI); | 115 | if (d && !l && !r) { |
| 116 | goal_angle = Common::PI * 1.5f; | ||
| 117 | } | ||
| 97 | 118 | ||
| 98 | // Move to the bottom left | 119 | // Move to the bottom right |
| 99 | MoveToDirection(l && !u && d, Common::PI * 1.25f); | 120 | if (r && !u && d) { |
| 121 | goal_angle = Common::PI * 1.75f; | ||
| 122 | } | ||
| 123 | } | ||
| 100 | 124 | ||
| 101 | // Move down | 125 | void UpdateStatus() { |
| 102 | MoveToDirection(d && !l && !r, Common::PI * 1.5f); | 126 | const float coef = modifier->GetStatus() ? modifier_scale : 1.0f; |
| 103 | 127 | ||
| 104 | // Move to the bottom right | 128 | bool r = right->GetStatus(); |
| 105 | MoveToDirection(r && !u && d, Common::PI * 1.75f); | 129 | bool l = left->GetStatus(); |
| 130 | bool u = up->GetStatus(); | ||
| 131 | bool d = down->GetStatus(); | ||
| 106 | 132 | ||
| 107 | // Move if a key is pressed | 133 | // Eliminate contradictory movements |
| 108 | if (r || l || u || d) { | 134 | if (r && l) { |
| 109 | amplitude = coef; | 135 | r = false; |
| 110 | } else { | 136 | l = false; |
| 111 | amplitude = 0; | 137 | } |
| 112 | } | 138 | if (u && d) { |
| 139 | u = false; | ||
| 140 | d = false; | ||
| 141 | } | ||
| 113 | 142 | ||
| 114 | // Delay the update rate to 100hz | 143 | // Move if a key is pressed |
| 115 | std::this_thread::sleep_for(std::chrono::milliseconds(10)); | 144 | if (r || l || u || d) { |
| 145 | amplitude = coef; | ||
| 146 | } else { | ||
| 147 | amplitude = 0; | ||
| 116 | } | 148 | } |
| 149 | |||
| 150 | const auto now = std::chrono::steady_clock::now(); | ||
| 151 | const auto time_difference = static_cast<u64>( | ||
| 152 | std::chrono::duration_cast<std::chrono::milliseconds>(now - last_update).count()); | ||
| 153 | |||
| 154 | if (time_difference < 10) { | ||
| 155 | // Disable analog mode if inputs are too fast | ||
| 156 | SetGoalAngle(r, l, u, d); | ||
| 157 | angle = goal_angle; | ||
| 158 | } else { | ||
| 159 | angle = GetAngle(now); | ||
| 160 | SetGoalAngle(r, l, u, d); | ||
| 161 | } | ||
| 162 | |||
| 163 | last_update = now; | ||
| 117 | } | 164 | } |
| 118 | 165 | ||
| 119 | std::tuple<float, float> GetStatus() const override { | 166 | std::tuple<float, float> GetStatus() const override { |
| 120 | if (Settings::values.emulate_analog_keyboard) { | 167 | if (Settings::values.emulate_analog_keyboard) { |
| 121 | return std::make_tuple(std::cos(angle) * amplitude, std::sin(angle) * amplitude); | 168 | const auto now = std::chrono::steady_clock::now(); |
| 169 | float angle_ = GetAngle(now); | ||
| 170 | return std::make_tuple(std::cos(angle_) * amplitude, std::sin(angle_) * amplitude); | ||
| 122 | } | 171 | } |
| 123 | constexpr float SQRT_HALF = 0.707106781f; | 172 | constexpr float SQRT_HALF = 0.707106781f; |
| 124 | int x = 0, y = 0; | 173 | int x = 0, y = 0; |
| @@ -166,9 +215,9 @@ private: | |||
| 166 | float modifier_scale; | 215 | float modifier_scale; |
| 167 | float modifier_angle; | 216 | float modifier_angle; |
| 168 | float angle{}; | 217 | float angle{}; |
| 218 | float goal_angle{}; | ||
| 169 | float amplitude{}; | 219 | float amplitude{}; |
| 170 | std::thread update_thread; | 220 | std::chrono::time_point<std::chrono::steady_clock> last_update; |
| 171 | std::atomic<bool> update_thread_running{}; | ||
| 172 | }; | 221 | }; |
| 173 | 222 | ||
| 174 | std::unique_ptr<Input::AnalogDevice> AnalogFromButton::Create(const Common::ParamPackage& params) { | 223 | std::unique_ptr<Input::AnalogDevice> AnalogFromButton::Create(const Common::ParamPackage& params) { |
| @@ -179,7 +228,7 @@ std::unique_ptr<Input::AnalogDevice> AnalogFromButton::Create(const Common::Para | |||
| 179 | auto right = Input::CreateDevice<Input::ButtonDevice>(params.Get("right", null_engine)); | 228 | auto right = Input::CreateDevice<Input::ButtonDevice>(params.Get("right", null_engine)); |
| 180 | auto modifier = Input::CreateDevice<Input::ButtonDevice>(params.Get("modifier", null_engine)); | 229 | auto modifier = Input::CreateDevice<Input::ButtonDevice>(params.Get("modifier", null_engine)); |
| 181 | auto modifier_scale = params.Get("modifier_scale", 0.5f); | 230 | auto modifier_scale = params.Get("modifier_scale", 0.5f); |
| 182 | auto modifier_angle = params.Get("modifier_angle", 0.035f); | 231 | auto modifier_angle = params.Get("modifier_angle", 5.5f); |
| 183 | return std::make_unique<Analog>(std::move(up), std::move(down), std::move(left), | 232 | return std::make_unique<Analog>(std::move(up), std::move(down), std::move(left), |
| 184 | std::move(right), std::move(modifier), modifier_scale, | 233 | std::move(right), std::move(modifier), modifier_scale, |
| 185 | modifier_angle); | 234 | modifier_angle); |
diff --git a/src/input_common/keyboard.cpp b/src/input_common/keyboard.cpp index c467ff4c5..8261e76fd 100644 --- a/src/input_common/keyboard.cpp +++ b/src/input_common/keyboard.cpp | |||
| @@ -75,6 +75,7 @@ public: | |||
| 75 | } else { | 75 | } else { |
| 76 | pair.key_button->UnlockButton(); | 76 | pair.key_button->UnlockButton(); |
| 77 | } | 77 | } |
| 78 | pair.key_button->TriggerOnChange(); | ||
| 78 | } | 79 | } |
| 79 | } | 80 | } |
| 80 | } | 81 | } |
diff --git a/src/video_core/buffer_cache/buffer_base.h b/src/video_core/buffer_cache/buffer_base.h index 0c00ae280..a39505903 100644 --- a/src/video_core/buffer_cache/buffer_base.h +++ b/src/video_core/buffer_cache/buffer_base.h | |||
| @@ -476,6 +476,9 @@ private: | |||
| 476 | current_size = 0; | 476 | current_size = 0; |
| 477 | on_going = false; | 477 | on_going = false; |
| 478 | } | 478 | } |
| 479 | if (empty_bits == PAGES_PER_WORD) { | ||
| 480 | break; | ||
| 481 | } | ||
| 479 | page += empty_bits; | 482 | page += empty_bits; |
| 480 | 483 | ||
| 481 | const int continuous_bits = std::countr_one(word >> page); | 484 | const int continuous_bits = std::countr_one(word >> page); |
diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index 9e6b87960..d371b842f 100644 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h | |||
| @@ -110,6 +110,8 @@ public: | |||
| 110 | 110 | ||
| 111 | void BindGraphicsUniformBuffer(size_t stage, u32 index, GPUVAddr gpu_addr, u32 size); | 111 | void BindGraphicsUniformBuffer(size_t stage, u32 index, GPUVAddr gpu_addr, u32 size); |
| 112 | 112 | ||
| 113 | void DisableGraphicsUniformBuffer(size_t stage, u32 index); | ||
| 114 | |||
| 113 | void UpdateGraphicsBuffers(bool is_indexed); | 115 | void UpdateGraphicsBuffers(bool is_indexed); |
| 114 | 116 | ||
| 115 | void UpdateComputeBuffers(); | 117 | void UpdateComputeBuffers(); |
| @@ -419,10 +421,6 @@ template <class P> | |||
| 419 | void BufferCache<P>::BindGraphicsUniformBuffer(size_t stage, u32 index, GPUVAddr gpu_addr, | 421 | void BufferCache<P>::BindGraphicsUniformBuffer(size_t stage, u32 index, GPUVAddr gpu_addr, |
| 420 | u32 size) { | 422 | u32 size) { |
| 421 | const std::optional<VAddr> cpu_addr = gpu_memory.GpuToCpuAddress(gpu_addr); | 423 | const std::optional<VAddr> cpu_addr = gpu_memory.GpuToCpuAddress(gpu_addr); |
| 422 | if (!cpu_addr) { | ||
| 423 | uniform_buffers[stage][index] = NULL_BINDING; | ||
| 424 | return; | ||
| 425 | } | ||
| 426 | const Binding binding{ | 424 | const Binding binding{ |
| 427 | .cpu_addr = *cpu_addr, | 425 | .cpu_addr = *cpu_addr, |
| 428 | .size = size, | 426 | .size = size, |
| @@ -432,6 +430,11 @@ void BufferCache<P>::BindGraphicsUniformBuffer(size_t stage, u32 index, GPUVAddr | |||
| 432 | } | 430 | } |
| 433 | 431 | ||
| 434 | template <class P> | 432 | template <class P> |
| 433 | void BufferCache<P>::DisableGraphicsUniformBuffer(size_t stage, u32 index) { | ||
| 434 | uniform_buffers[stage][index] = NULL_BINDING; | ||
| 435 | } | ||
| 436 | |||
| 437 | template <class P> | ||
| 435 | void BufferCache<P>::UpdateGraphicsBuffers(bool is_indexed) { | 438 | void BufferCache<P>::UpdateGraphicsBuffers(bool is_indexed) { |
| 436 | MICROPROFILE_SCOPE(GPU_PrepareBuffers); | 439 | MICROPROFILE_SCOPE(GPU_PrepareBuffers); |
| 437 | do { | 440 | do { |
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp index 75517a4f7..aab6b8f7a 100644 --- a/src/video_core/engines/maxwell_3d.cpp +++ b/src/video_core/engines/maxwell_3d.cpp | |||
| @@ -578,8 +578,12 @@ void Maxwell3D::ProcessCBBind(size_t stage_index) { | |||
| 578 | buffer.size = regs.const_buffer.cb_size; | 578 | buffer.size = regs.const_buffer.cb_size; |
| 579 | 579 | ||
| 580 | const bool is_enabled = bind_data.valid.Value() != 0; | 580 | const bool is_enabled = bind_data.valid.Value() != 0; |
| 581 | const GPUVAddr gpu_addr = is_enabled ? regs.const_buffer.BufferAddress() : 0; | 581 | if (!is_enabled) { |
| 582 | const u32 size = is_enabled ? regs.const_buffer.cb_size : 0; | 582 | rasterizer->DisableGraphicsUniformBuffer(stage_index, bind_data.index); |
| 583 | return; | ||
| 584 | } | ||
| 585 | const GPUVAddr gpu_addr = regs.const_buffer.BufferAddress(); | ||
| 586 | const u32 size = regs.const_buffer.cb_size; | ||
| 583 | rasterizer->BindGraphicsUniformBuffer(stage_index, bind_data.index, gpu_addr, size); | 587 | rasterizer->BindGraphicsUniformBuffer(stage_index, bind_data.index, gpu_addr, size); |
| 584 | } | 588 | } |
| 585 | 589 | ||
diff --git a/src/video_core/memory_manager.cpp b/src/video_core/memory_manager.cpp index eb58ac6b6..7124c755c 100644 --- a/src/video_core/memory_manager.cpp +++ b/src/video_core/memory_manager.cpp | |||
| @@ -163,6 +163,9 @@ std::optional<GPUVAddr> MemoryManager::FindFreeRange(std::size_t size, std::size | |||
| 163 | } | 163 | } |
| 164 | 164 | ||
| 165 | std::optional<VAddr> MemoryManager::GpuToCpuAddress(GPUVAddr gpu_addr) const { | 165 | std::optional<VAddr> MemoryManager::GpuToCpuAddress(GPUVAddr gpu_addr) const { |
| 166 | if (gpu_addr == 0) { | ||
| 167 | return std::nullopt; | ||
| 168 | } | ||
| 166 | const auto page_entry{GetPageEntry(gpu_addr)}; | 169 | const auto page_entry{GetPageEntry(gpu_addr)}; |
| 167 | if (!page_entry.IsValid()) { | 170 | if (!page_entry.IsValid()) { |
| 168 | return std::nullopt; | 171 | return std::nullopt; |
diff --git a/src/video_core/rasterizer_interface.h b/src/video_core/rasterizer_interface.h index 50491b758..f968b5b16 100644 --- a/src/video_core/rasterizer_interface.h +++ b/src/video_core/rasterizer_interface.h | |||
| @@ -54,6 +54,9 @@ public: | |||
| 54 | virtual void BindGraphicsUniformBuffer(size_t stage, u32 index, GPUVAddr gpu_addr, | 54 | virtual void BindGraphicsUniformBuffer(size_t stage, u32 index, GPUVAddr gpu_addr, |
| 55 | u32 size) = 0; | 55 | u32 size) = 0; |
| 56 | 56 | ||
| 57 | /// Signal disabling of a uniform buffer | ||
| 58 | virtual void DisableGraphicsUniformBuffer(size_t stage, u32 index) = 0; | ||
| 59 | |||
| 57 | /// Signal a GPU based semaphore as a fence | 60 | /// Signal a GPU based semaphore as a fence |
| 58 | virtual void SignalSemaphore(GPUVAddr addr, u32 value) = 0; | 61 | virtual void SignalSemaphore(GPUVAddr addr, u32 value) = 0; |
| 59 | 62 | ||
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index a5dbb9adf..f87bb269b 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp | |||
| @@ -526,6 +526,10 @@ void RasterizerOpenGL::BindGraphicsUniformBuffer(size_t stage, u32 index, GPUVAd | |||
| 526 | buffer_cache.BindGraphicsUniformBuffer(stage, index, gpu_addr, size); | 526 | buffer_cache.BindGraphicsUniformBuffer(stage, index, gpu_addr, size); |
| 527 | } | 527 | } |
| 528 | 528 | ||
| 529 | void RasterizerOpenGL::DisableGraphicsUniformBuffer(size_t stage, u32 index) { | ||
| 530 | buffer_cache.DisableGraphicsUniformBuffer(stage, index); | ||
| 531 | } | ||
| 532 | |||
| 529 | void RasterizerOpenGL::FlushAll() {} | 533 | void RasterizerOpenGL::FlushAll() {} |
| 530 | 534 | ||
| 531 | void RasterizerOpenGL::FlushRegion(VAddr addr, u64 size) { | 535 | void RasterizerOpenGL::FlushRegion(VAddr addr, u64 size) { |
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h index 3745cf637..76298517f 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.h +++ b/src/video_core/renderer_opengl/gl_rasterizer.h | |||
| @@ -72,6 +72,7 @@ public: | |||
| 72 | void ResetCounter(VideoCore::QueryType type) override; | 72 | void ResetCounter(VideoCore::QueryType type) override; |
| 73 | void Query(GPUVAddr gpu_addr, VideoCore::QueryType type, std::optional<u64> timestamp) override; | 73 | void Query(GPUVAddr gpu_addr, VideoCore::QueryType type, std::optional<u64> timestamp) override; |
| 74 | void BindGraphicsUniformBuffer(size_t stage, u32 index, GPUVAddr gpu_addr, u32 size) override; | 74 | void BindGraphicsUniformBuffer(size_t stage, u32 index, GPUVAddr gpu_addr, u32 size) override; |
| 75 | void DisableGraphicsUniformBuffer(size_t stage, u32 index) override; | ||
| 75 | void FlushAll() override; | 76 | void FlushAll() override; |
| 76 | void FlushRegion(VAddr addr, u64 size) override; | 77 | void FlushRegion(VAddr addr, u64 size) override; |
| 77 | bool MustFlushRegion(VAddr addr, u64 size) override; | 78 | bool MustFlushRegion(VAddr addr, u64 size) override; |
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index e9a0e7811..1c9120170 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp | |||
| @@ -476,6 +476,10 @@ void RasterizerVulkan::BindGraphicsUniformBuffer(size_t stage, u32 index, GPUVAd | |||
| 476 | buffer_cache.BindGraphicsUniformBuffer(stage, index, gpu_addr, size); | 476 | buffer_cache.BindGraphicsUniformBuffer(stage, index, gpu_addr, size); |
| 477 | } | 477 | } |
| 478 | 478 | ||
| 479 | void Vulkan::RasterizerVulkan::DisableGraphicsUniformBuffer(size_t stage, u32 index) { | ||
| 480 | buffer_cache.DisableGraphicsUniformBuffer(stage, index); | ||
| 481 | } | ||
| 482 | |||
| 479 | void RasterizerVulkan::FlushAll() {} | 483 | void RasterizerVulkan::FlushAll() {} |
| 480 | 484 | ||
| 481 | void RasterizerVulkan::FlushRegion(VAddr addr, u64 size) { | 485 | void RasterizerVulkan::FlushRegion(VAddr addr, u64 size) { |
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.h b/src/video_core/renderer_vulkan/vk_rasterizer.h index 235afc6f3..cb8c5c279 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.h +++ b/src/video_core/renderer_vulkan/vk_rasterizer.h | |||
| @@ -64,6 +64,7 @@ public: | |||
| 64 | void ResetCounter(VideoCore::QueryType type) override; | 64 | void ResetCounter(VideoCore::QueryType type) override; |
| 65 | void Query(GPUVAddr gpu_addr, VideoCore::QueryType type, std::optional<u64> timestamp) override; | 65 | void Query(GPUVAddr gpu_addr, VideoCore::QueryType type, std::optional<u64> timestamp) override; |
| 66 | void BindGraphicsUniformBuffer(size_t stage, u32 index, GPUVAddr gpu_addr, u32 size) override; | 66 | void BindGraphicsUniformBuffer(size_t stage, u32 index, GPUVAddr gpu_addr, u32 size) override; |
| 67 | void DisableGraphicsUniformBuffer(size_t stage, u32 index) override; | ||
| 67 | void FlushAll() override; | 68 | void FlushAll() override; |
| 68 | void FlushRegion(VAddr addr, u64 size) override; | 69 | void FlushRegion(VAddr addr, u64 size) override; |
| 69 | bool MustFlushRegion(VAddr addr, u64 size) override; | 70 | bool MustFlushRegion(VAddr addr, u64 size) override; |
diff --git a/src/video_core/texture_cache/util.cpp b/src/video_core/texture_cache/util.cpp index 8c4a5523b..906604a39 100644 --- a/src/video_core/texture_cache/util.cpp +++ b/src/video_core/texture_cache/util.cpp | |||
| @@ -647,6 +647,9 @@ u32 CalculateLayerSize(const ImageInfo& info) noexcept { | |||
| 647 | } | 647 | } |
| 648 | 648 | ||
| 649 | LevelArray CalculateMipLevelOffsets(const ImageInfo& info) noexcept { | 649 | LevelArray CalculateMipLevelOffsets(const ImageInfo& info) noexcept { |
| 650 | if (info.type == ImageType::Linear) { | ||
| 651 | return {}; | ||
| 652 | } | ||
| 650 | ASSERT(info.resources.levels <= static_cast<s32>(MAX_MIP_LEVELS)); | 653 | ASSERT(info.resources.levels <= static_cast<s32>(MAX_MIP_LEVELS)); |
| 651 | const LevelInfo level_info = MakeLevelInfo(info); | 654 | const LevelInfo level_info = MakeLevelInfo(info); |
| 652 | LevelArray offsets{}; | 655 | LevelArray offsets{}; |
diff --git a/src/video_core/textures/decoders.cpp b/src/video_core/textures/decoders.cpp index 3a463d5db..f1f523ad1 100644 --- a/src/video_core/textures/decoders.cpp +++ b/src/video_core/textures/decoders.cpp | |||
| @@ -63,6 +63,14 @@ void Swizzle(std::span<u8> output, std::span<const u8> input, u32 bytes_per_pixe | |||
| 63 | const u32 unswizzled_offset = | 63 | const u32 unswizzled_offset = |
| 64 | slice * pitch * height + line * pitch + column * bytes_per_pixel; | 64 | slice * pitch * height + line * pitch + column * bytes_per_pixel; |
| 65 | 65 | ||
| 66 | if (const auto offset = (TO_LINEAR ? unswizzled_offset : swizzled_offset); | ||
| 67 | offset >= input.size()) { | ||
| 68 | // TODO(Rodrigo): This is an out of bounds access that should never happen. To | ||
| 69 | // avoid crashing the emulator, break. | ||
| 70 | ASSERT_MSG(false, "offset {} exceeds input size {}!", offset, input.size()); | ||
| 71 | break; | ||
| 72 | } | ||
| 73 | |||
| 66 | u8* const dst = &output[TO_LINEAR ? swizzled_offset : unswizzled_offset]; | 74 | u8* const dst = &output[TO_LINEAR ? swizzled_offset : unswizzled_offset]; |
| 67 | const u8* const src = &input[TO_LINEAR ? unswizzled_offset : swizzled_offset]; | 75 | const u8* const src = &input[TO_LINEAR ? unswizzled_offset : swizzled_offset]; |
| 68 | std::memcpy(dst, src, bytes_per_pixel); | 76 | std::memcpy(dst, src, bytes_per_pixel); |
diff --git a/src/yuzu/configuration/configure_dialog.cpp b/src/yuzu/configuration/configure_dialog.cpp index 6028135c5..371bc01b1 100644 --- a/src/yuzu/configuration/configure_dialog.cpp +++ b/src/yuzu/configuration/configure_dialog.cpp | |||
| @@ -27,6 +27,8 @@ ConfigureDialog::ConfigureDialog(QWidget* parent, HotkeyRegistry& registry, | |||
| 27 | 27 | ||
| 28 | ui->inputTab->Initialize(input_subsystem); | 28 | ui->inputTab->Initialize(input_subsystem); |
| 29 | 29 | ||
| 30 | ui->generalTab->SetResetCallback([&] { this->close(); }); | ||
| 31 | |||
| 30 | SetConfiguration(); | 32 | SetConfiguration(); |
| 31 | PopulateSelectionList(); | 33 | PopulateSelectionList(); |
| 32 | 34 | ||
diff --git a/src/yuzu/configuration/configure_general.cpp b/src/yuzu/configuration/configure_general.cpp index 55a6a37bd..38edb4d8d 100644 --- a/src/yuzu/configuration/configure_general.cpp +++ b/src/yuzu/configuration/configure_general.cpp | |||
| @@ -2,11 +2,15 @@ | |||
| 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 <functional> | ||
| 6 | #include <utility> | ||
| 5 | #include <QCheckBox> | 7 | #include <QCheckBox> |
| 8 | #include <QMessageBox> | ||
| 6 | #include <QSpinBox> | 9 | #include <QSpinBox> |
| 7 | #include "common/settings.h" | 10 | #include "common/settings.h" |
| 8 | #include "core/core.h" | 11 | #include "core/core.h" |
| 9 | #include "ui_configure_general.h" | 12 | #include "ui_configure_general.h" |
| 13 | #include "yuzu/configuration/config.h" | ||
| 10 | #include "yuzu/configuration/configuration_shared.h" | 14 | #include "yuzu/configuration/configuration_shared.h" |
| 11 | #include "yuzu/configuration/configure_general.h" | 15 | #include "yuzu/configuration/configure_general.h" |
| 12 | #include "yuzu/uisettings.h" | 16 | #include "yuzu/uisettings.h" |
| @@ -23,6 +27,9 @@ ConfigureGeneral::ConfigureGeneral(QWidget* parent) | |||
| 23 | connect(ui->toggle_frame_limit, &QCheckBox::clicked, ui->frame_limit, | 27 | connect(ui->toggle_frame_limit, &QCheckBox::clicked, ui->frame_limit, |
| 24 | [this]() { ui->frame_limit->setEnabled(ui->toggle_frame_limit->isChecked()); }); | 28 | [this]() { ui->frame_limit->setEnabled(ui->toggle_frame_limit->isChecked()); }); |
| 25 | } | 29 | } |
| 30 | |||
| 31 | connect(ui->button_reset_defaults, &QPushButton::clicked, this, | ||
| 32 | &ConfigureGeneral::ResetDefaults); | ||
| 26 | } | 33 | } |
| 27 | 34 | ||
| 28 | ConfigureGeneral::~ConfigureGeneral() = default; | 35 | ConfigureGeneral::~ConfigureGeneral() = default; |
| @@ -41,6 +48,8 @@ void ConfigureGeneral::SetConfiguration() { | |||
| 41 | ui->toggle_frame_limit->setChecked(Settings::values.use_frame_limit.GetValue()); | 48 | ui->toggle_frame_limit->setChecked(Settings::values.use_frame_limit.GetValue()); |
| 42 | ui->frame_limit->setValue(Settings::values.frame_limit.GetValue()); | 49 | ui->frame_limit->setValue(Settings::values.frame_limit.GetValue()); |
| 43 | 50 | ||
| 51 | ui->button_reset_defaults->setEnabled(runtime_lock); | ||
| 52 | |||
| 44 | if (Settings::IsConfiguringGlobal()) { | 53 | if (Settings::IsConfiguringGlobal()) { |
| 45 | ui->frame_limit->setEnabled(Settings::values.use_frame_limit.GetValue()); | 54 | ui->frame_limit->setEnabled(Settings::values.use_frame_limit.GetValue()); |
| 46 | } else { | 55 | } else { |
| @@ -49,6 +58,25 @@ void ConfigureGeneral::SetConfiguration() { | |||
| 49 | } | 58 | } |
| 50 | } | 59 | } |
| 51 | 60 | ||
| 61 | // Called to set the callback when resetting settings to defaults | ||
| 62 | void ConfigureGeneral::SetResetCallback(std::function<void()> callback) { | ||
| 63 | reset_callback = std::move(callback); | ||
| 64 | } | ||
| 65 | |||
| 66 | void ConfigureGeneral::ResetDefaults() { | ||
| 67 | QMessageBox::StandardButton answer = QMessageBox::question( | ||
| 68 | this, tr("yuzu"), | ||
| 69 | tr("This reset all settings and remove all per-game configurations. This will not delete " | ||
| 70 | "game directories, profiles, or input profiles. Proceed?"), | ||
| 71 | QMessageBox::Yes | QMessageBox::No, QMessageBox::No); | ||
| 72 | if (answer == QMessageBox::No) { | ||
| 73 | return; | ||
| 74 | } | ||
| 75 | UISettings::values.reset_to_defaults = true; | ||
| 76 | UISettings::values.is_game_list_reload_pending.exchange(true); | ||
| 77 | reset_callback(); | ||
| 78 | } | ||
| 79 | |||
| 52 | void ConfigureGeneral::ApplyConfiguration() { | 80 | void ConfigureGeneral::ApplyConfiguration() { |
| 53 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_multi_core, ui->use_multi_core, | 81 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_multi_core, ui->use_multi_core, |
| 54 | use_multi_core); | 82 | use_multi_core); |
| @@ -105,6 +133,8 @@ void ConfigureGeneral::SetupPerGameUI() { | |||
| 105 | ui->toggle_background_pause->setVisible(false); | 133 | ui->toggle_background_pause->setVisible(false); |
| 106 | ui->toggle_hide_mouse->setVisible(false); | 134 | ui->toggle_hide_mouse->setVisible(false); |
| 107 | 135 | ||
| 136 | ui->button_reset_defaults->setVisible(false); | ||
| 137 | |||
| 108 | ConfigurationShared::SetColoredTristate(ui->toggle_frame_limit, | 138 | ConfigurationShared::SetColoredTristate(ui->toggle_frame_limit, |
| 109 | Settings::values.use_frame_limit, use_frame_limit); | 139 | Settings::values.use_frame_limit, use_frame_limit); |
| 110 | ConfigurationShared::SetColoredTristate(ui->use_multi_core, Settings::values.use_multi_core, | 140 | ConfigurationShared::SetColoredTristate(ui->use_multi_core, Settings::values.use_multi_core, |
diff --git a/src/yuzu/configuration/configure_general.h b/src/yuzu/configuration/configure_general.h index 323ffbd8f..a0fd52492 100644 --- a/src/yuzu/configuration/configure_general.h +++ b/src/yuzu/configuration/configure_general.h | |||
| @@ -4,9 +4,12 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <functional> | ||
| 7 | #include <memory> | 8 | #include <memory> |
| 8 | #include <QWidget> | 9 | #include <QWidget> |
| 9 | 10 | ||
| 11 | class ConfigureDialog; | ||
| 12 | |||
| 10 | namespace ConfigurationShared { | 13 | namespace ConfigurationShared { |
| 11 | enum class CheckState; | 14 | enum class CheckState; |
| 12 | } | 15 | } |
| @@ -24,6 +27,8 @@ public: | |||
| 24 | explicit ConfigureGeneral(QWidget* parent = nullptr); | 27 | explicit ConfigureGeneral(QWidget* parent = nullptr); |
| 25 | ~ConfigureGeneral() override; | 28 | ~ConfigureGeneral() override; |
| 26 | 29 | ||
| 30 | void SetResetCallback(std::function<void()> callback); | ||
| 31 | void ResetDefaults(); | ||
| 27 | void ApplyConfiguration(); | 32 | void ApplyConfiguration(); |
| 28 | 33 | ||
| 29 | private: | 34 | private: |
| @@ -34,6 +39,8 @@ private: | |||
| 34 | 39 | ||
| 35 | void SetupPerGameUI(); | 40 | void SetupPerGameUI(); |
| 36 | 41 | ||
| 42 | std::function<void()> reset_callback; | ||
| 43 | |||
| 37 | std::unique_ptr<Ui::ConfigureGeneral> ui; | 44 | std::unique_ptr<Ui::ConfigureGeneral> ui; |
| 38 | 45 | ||
| 39 | ConfigurationShared::CheckState use_frame_limit; | 46 | ConfigurationShared::CheckState use_frame_limit; |
diff --git a/src/yuzu/configuration/configure_general.ui b/src/yuzu/configuration/configure_general.ui index 2711116a2..bc7041090 100644 --- a/src/yuzu/configuration/configure_general.ui +++ b/src/yuzu/configuration/configure_general.ui | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | <rect> | 6 | <rect> |
| 7 | <x>0</x> | 7 | <x>0</x> |
| 8 | <y>0</y> | 8 | <y>0</y> |
| 9 | <width>300</width> | 9 | <width>329</width> |
| 10 | <height>407</height> | 10 | <height>407</height> |
| 11 | </rect> | 11 | </rect> |
| 12 | </property> | 12 | </property> |
| @@ -104,6 +104,45 @@ | |||
| 104 | </property> | 104 | </property> |
| 105 | </spacer> | 105 | </spacer> |
| 106 | </item> | 106 | </item> |
| 107 | <item> | ||
| 108 | <layout class="QHBoxLayout" name="layout_reset"> | ||
| 109 | <property name="spacing"> | ||
| 110 | <number>6</number> | ||
| 111 | </property> | ||
| 112 | <property name="leftMargin"> | ||
| 113 | <number>5</number> | ||
| 114 | </property> | ||
| 115 | <property name="topMargin"> | ||
| 116 | <number>5</number> | ||
| 117 | </property> | ||
| 118 | <property name="rightMargin"> | ||
| 119 | <number>5</number> | ||
| 120 | </property> | ||
| 121 | <property name="bottomMargin"> | ||
| 122 | <number>5</number> | ||
| 123 | </property> | ||
| 124 | <item> | ||
| 125 | <widget class="QPushButton" name="button_reset_defaults"> | ||
| 126 | <property name="text"> | ||
| 127 | <string>Reset All Settings</string> | ||
| 128 | </property> | ||
| 129 | </widget> | ||
| 130 | </item> | ||
| 131 | <item> | ||
| 132 | <spacer name="spacer_reset"> | ||
| 133 | <property name="orientation"> | ||
| 134 | <enum>Qt::Horizontal</enum> | ||
| 135 | </property> | ||
| 136 | <property name="sizeHint" stdset="0"> | ||
| 137 | <size> | ||
| 138 | <width>40</width> | ||
| 139 | <height>20</height> | ||
| 140 | </size> | ||
| 141 | </property> | ||
| 142 | </spacer> | ||
| 143 | </item> | ||
| 144 | </layout> | ||
| 145 | </item> | ||
| 107 | </layout> | 146 | </layout> |
| 108 | </item> | 147 | </item> |
| 109 | </layout> | 148 | </layout> |
diff --git a/src/yuzu/configuration/configure_input_player.cpp b/src/yuzu/configuration/configure_input_player.cpp index ab3512810..d5d624b96 100644 --- a/src/yuzu/configuration/configure_input_player.cpp +++ b/src/yuzu/configuration/configure_input_player.cpp | |||
| @@ -1395,7 +1395,8 @@ void ConfigureInputPlayer::keyPressEvent(QKeyEvent* event) { | |||
| 1395 | 1395 | ||
| 1396 | void ConfigureInputPlayer::CreateProfile() { | 1396 | void ConfigureInputPlayer::CreateProfile() { |
| 1397 | const auto profile_name = | 1397 | const auto profile_name = |
| 1398 | LimitableInputDialog::GetText(this, tr("New Profile"), tr("Enter a profile name:"), 1, 20); | 1398 | LimitableInputDialog::GetText(this, tr("New Profile"), tr("Enter a profile name:"), 1, 20, |
| 1399 | LimitableInputDialog::InputLimiter::Filesystem); | ||
| 1399 | 1400 | ||
| 1400 | if (profile_name.isEmpty()) { | 1401 | if (profile_name.isEmpty()) { |
| 1401 | return; | 1402 | return; |
diff --git a/src/yuzu/configuration/configure_input_player_widget.cpp b/src/yuzu/configuration/configure_input_player_widget.cpp index 61ba91cef..f50cda2f3 100644 --- a/src/yuzu/configuration/configure_input_player_widget.cpp +++ b/src/yuzu/configuration/configure_input_player_widget.cpp | |||
| @@ -85,6 +85,8 @@ void PlayerControlPreview::SetConnectedStatus(bool checked) { | |||
| 85 | led_color[1] = led_pattern.position2 ? colors.led_on : colors.led_off; | 85 | led_color[1] = led_pattern.position2 ? colors.led_on : colors.led_off; |
| 86 | led_color[2] = led_pattern.position3 ? colors.led_on : colors.led_off; | 86 | led_color[2] = led_pattern.position3 ? colors.led_on : colors.led_off; |
| 87 | led_color[3] = led_pattern.position4 ? colors.led_on : colors.led_off; | 87 | led_color[3] = led_pattern.position4 ? colors.led_on : colors.led_off; |
| 88 | is_enabled = checked; | ||
| 89 | ResetInputs(); | ||
| 88 | } | 90 | } |
| 89 | 91 | ||
| 90 | void PlayerControlPreview::SetControllerType(const Settings::ControllerType type) { | 92 | void PlayerControlPreview::SetControllerType(const Settings::ControllerType type) { |
| @@ -108,6 +110,7 @@ void PlayerControlPreview::EndMapping() { | |||
| 108 | analog_mapping_index = Settings::NativeAnalog::NumAnalogs; | 110 | analog_mapping_index = Settings::NativeAnalog::NumAnalogs; |
| 109 | mapping_active = false; | 111 | mapping_active = false; |
| 110 | blink_counter = 0; | 112 | blink_counter = 0; |
| 113 | ResetInputs(); | ||
| 111 | } | 114 | } |
| 112 | 115 | ||
| 113 | void PlayerControlPreview::UpdateColors() { | 116 | void PlayerControlPreview::UpdateColors() { |
| @@ -156,7 +159,23 @@ void PlayerControlPreview::UpdateColors() { | |||
| 156 | // colors.right = QColor(Settings::values.players.GetValue()[player_index].body_color_right); | 159 | // colors.right = QColor(Settings::values.players.GetValue()[player_index].body_color_right); |
| 157 | } | 160 | } |
| 158 | 161 | ||
| 162 | void PlayerControlPreview::ResetInputs() { | ||
| 163 | for (std::size_t index = 0; index < button_values.size(); ++index) { | ||
| 164 | button_values[index] = false; | ||
| 165 | } | ||
| 166 | |||
| 167 | for (std::size_t index = 0; index < axis_values.size(); ++index) { | ||
| 168 | axis_values[index].properties = {0, 1, 0}; | ||
| 169 | axis_values[index].value = {0, 0}; | ||
| 170 | axis_values[index].raw_value = {0, 0}; | ||
| 171 | } | ||
| 172 | update(); | ||
| 173 | } | ||
| 174 | |||
| 159 | void PlayerControlPreview::UpdateInput() { | 175 | void PlayerControlPreview::UpdateInput() { |
| 176 | if (!is_enabled && !mapping_active) { | ||
| 177 | return; | ||
| 178 | } | ||
| 160 | bool input_changed = false; | 179 | bool input_changed = false; |
| 161 | const auto& button_state = buttons; | 180 | const auto& button_state = buttons; |
| 162 | for (std::size_t index = 0; index < button_values.size(); ++index) { | 181 | for (std::size_t index = 0; index < button_values.size(); ++index) { |
diff --git a/src/yuzu/configuration/configure_input_player_widget.h b/src/yuzu/configuration/configure_input_player_widget.h index 51bb84eb6..5fc16d8af 100644 --- a/src/yuzu/configuration/configure_input_player_widget.h +++ b/src/yuzu/configuration/configure_input_player_widget.h | |||
| @@ -100,6 +100,7 @@ private: | |||
| 100 | 100 | ||
| 101 | static LedPattern GetColorPattern(std::size_t index, bool player_on); | 101 | static LedPattern GetColorPattern(std::size_t index, bool player_on); |
| 102 | void UpdateColors(); | 102 | void UpdateColors(); |
| 103 | void ResetInputs(); | ||
| 103 | 104 | ||
| 104 | // Draw controller functions | 105 | // Draw controller functions |
| 105 | void DrawHandheldController(QPainter& p, QPointF center); | 106 | void DrawHandheldController(QPainter& p, QPointF center); |
| @@ -176,6 +177,7 @@ private: | |||
| 176 | using StickArray = | 177 | using StickArray = |
| 177 | std::array<std::unique_ptr<Input::AnalogDevice>, Settings::NativeAnalog::NUM_STICKS_HID>; | 178 | std::array<std::unique_ptr<Input::AnalogDevice>, Settings::NativeAnalog::NUM_STICKS_HID>; |
| 178 | 179 | ||
| 180 | bool is_enabled{}; | ||
| 179 | bool mapping_active{}; | 181 | bool mapping_active{}; |
| 180 | int blink_counter{}; | 182 | int blink_counter{}; |
| 181 | QColor button_color{}; | 183 | QColor button_color{}; |
diff --git a/src/yuzu/configuration/configure_ui.cpp b/src/yuzu/configuration/configure_ui.cpp index 0a28c87c0..9674119e1 100644 --- a/src/yuzu/configuration/configure_ui.cpp +++ b/src/yuzu/configuration/configure_ui.cpp | |||
| @@ -17,17 +17,30 @@ | |||
| 17 | 17 | ||
| 18 | namespace { | 18 | namespace { |
| 19 | constexpr std::array default_icon_sizes{ | 19 | constexpr std::array default_icon_sizes{ |
| 20 | std::make_pair(0, QT_TR_NOOP("None")), | 20 | std::make_pair(0, QT_TRANSLATE_NOOP("ConfigureUI", "None")), |
| 21 | std::make_pair(32, QT_TR_NOOP("Small (32x32)")), | 21 | std::make_pair(32, QT_TRANSLATE_NOOP("ConfigureUI", "Small (32x32)")), |
| 22 | std::make_pair(64, QT_TR_NOOP("Standard (64x64)")), | 22 | std::make_pair(64, QT_TRANSLATE_NOOP("ConfigureUI", "Standard (64x64)")), |
| 23 | std::make_pair(128, QT_TR_NOOP("Large (128x128)")), | 23 | std::make_pair(128, QT_TRANSLATE_NOOP("ConfigureUI", "Large (128x128)")), |
| 24 | std::make_pair(256, QT_TR_NOOP("Full Size (256x256)")), | 24 | std::make_pair(256, QT_TRANSLATE_NOOP("ConfigureUI", "Full Size (256x256)")), |
| 25 | }; | 25 | }; |
| 26 | 26 | ||
| 27 | // clang-format off | ||
| 27 | constexpr std::array row_text_names{ | 28 | constexpr std::array row_text_names{ |
| 28 | QT_TR_NOOP("Filename"), QT_TR_NOOP("Filetype"), QT_TR_NOOP("Title ID"), | 29 | QT_TRANSLATE_NOOP("ConfigureUI", "Filename"), |
| 29 | QT_TR_NOOP("Title Name"), QT_TR_NOOP("None"), | 30 | QT_TRANSLATE_NOOP("ConfigureUI", "Filetype"), |
| 31 | QT_TRANSLATE_NOOP("ConfigureUI", "Title ID"), | ||
| 32 | QT_TRANSLATE_NOOP("ConfigureUI", "Title Name"), | ||
| 33 | QT_TRANSLATE_NOOP("ConfigureUI", "None"), | ||
| 30 | }; | 34 | }; |
| 35 | // clang-format on | ||
| 36 | |||
| 37 | QString GetTranslatedIconSize(size_t index) { | ||
| 38 | return QCoreApplication::translate("ConfigureUI", default_icon_sizes[index].second); | ||
| 39 | } | ||
| 40 | |||
| 41 | QString GetTranslatedRowTextName(size_t index) { | ||
| 42 | return QCoreApplication::translate("ConfigureUI", row_text_names[index]); | ||
| 43 | } | ||
| 31 | } // Anonymous namespace | 44 | } // Anonymous namespace |
| 32 | 45 | ||
| 33 | ConfigureUi::ConfigureUi(QWidget* parent) : QWidget(parent), ui(new Ui::ConfigureUi) { | 46 | ConfigureUi::ConfigureUi(QWidget* parent) : QWidget(parent), ui(new Ui::ConfigureUi) { |
| @@ -121,11 +134,11 @@ void ConfigureUi::RetranslateUI() { | |||
| 121 | ui->retranslateUi(this); | 134 | ui->retranslateUi(this); |
| 122 | 135 | ||
| 123 | for (int i = 0; i < ui->icon_size_combobox->count(); i++) { | 136 | for (int i = 0; i < ui->icon_size_combobox->count(); i++) { |
| 124 | ui->icon_size_combobox->setItemText(i, tr(default_icon_sizes[i].second)); | 137 | ui->icon_size_combobox->setItemText(i, GetTranslatedIconSize(static_cast<size_t>(i))); |
| 125 | } | 138 | } |
| 126 | 139 | ||
| 127 | for (int i = 0; i < ui->row_1_text_combobox->count(); i++) { | 140 | for (int i = 0; i < ui->row_1_text_combobox->count(); i++) { |
| 128 | const QString name = tr(row_text_names[i]); | 141 | const QString name = GetTranslatedRowTextName(static_cast<size_t>(i)); |
| 129 | 142 | ||
| 130 | ui->row_1_text_combobox->setItemText(i, name); | 143 | ui->row_1_text_combobox->setItemText(i, name); |
| 131 | ui->row_2_text_combobox->setItemText(i, name); | 144 | ui->row_2_text_combobox->setItemText(i, name); |
| @@ -152,8 +165,9 @@ void ConfigureUi::InitializeLanguageComboBox() { | |||
| 152 | } | 165 | } |
| 153 | 166 | ||
| 154 | void ConfigureUi::InitializeIconSizeComboBox() { | 167 | void ConfigureUi::InitializeIconSizeComboBox() { |
| 155 | for (const auto& size : default_icon_sizes) { | 168 | for (size_t i = 0; i < default_icon_sizes.size(); i++) { |
| 156 | ui->icon_size_combobox->addItem(QString::fromUtf8(size.second), size.first); | 169 | const auto size = default_icon_sizes[i].first; |
| 170 | ui->icon_size_combobox->addItem(GetTranslatedIconSize(i), size); | ||
| 157 | } | 171 | } |
| 158 | } | 172 | } |
| 159 | 173 | ||
| @@ -170,7 +184,7 @@ void ConfigureUi::UpdateFirstRowComboBox(bool init) { | |||
| 170 | ui->row_1_text_combobox->clear(); | 184 | ui->row_1_text_combobox->clear(); |
| 171 | 185 | ||
| 172 | for (std::size_t i = 0; i < row_text_names.size(); i++) { | 186 | for (std::size_t i = 0; i < row_text_names.size(); i++) { |
| 173 | const QString row_text_name = QString::fromUtf8(row_text_names[i]); | 187 | const QString row_text_name = GetTranslatedRowTextName(i); |
| 174 | ui->row_1_text_combobox->addItem(row_text_name, QVariant::fromValue(i)); | 188 | ui->row_1_text_combobox->addItem(row_text_name, QVariant::fromValue(i)); |
| 175 | } | 189 | } |
| 176 | 190 | ||
| @@ -189,7 +203,7 @@ void ConfigureUi::UpdateSecondRowComboBox(bool init) { | |||
| 189 | ui->row_2_text_combobox->clear(); | 203 | ui->row_2_text_combobox->clear(); |
| 190 | 204 | ||
| 191 | for (std::size_t i = 0; i < row_text_names.size(); ++i) { | 205 | for (std::size_t i = 0; i < row_text_names.size(); ++i) { |
| 192 | const QString row_text_name = QString::fromUtf8(row_text_names[i]); | 206 | const QString row_text_name = GetTranslatedRowTextName(i); |
| 193 | ui->row_2_text_combobox->addItem(row_text_name, QVariant::fromValue(i)); | 207 | ui->row_2_text_combobox->addItem(row_text_name, QVariant::fromValue(i)); |
| 194 | } | 208 | } |
| 195 | 209 | ||
diff --git a/src/yuzu/debugger/controller.cpp b/src/yuzu/debugger/controller.cpp index d85408ac6..c1fc69578 100644 --- a/src/yuzu/debugger/controller.cpp +++ b/src/yuzu/debugger/controller.cpp | |||
| @@ -28,6 +28,7 @@ ControllerDialog::ControllerDialog(QWidget* parent) : QWidget(parent, Qt::Dialog | |||
| 28 | // Configure focus so that widget is focusable and the dialog automatically forwards focus to | 28 | // Configure focus so that widget is focusable and the dialog automatically forwards focus to |
| 29 | // it. | 29 | // it. |
| 30 | setFocusProxy(widget); | 30 | setFocusProxy(widget); |
| 31 | widget->SetConnectedStatus(false); | ||
| 31 | widget->setFocusPolicy(Qt::StrongFocus); | 32 | widget->setFocusPolicy(Qt::StrongFocus); |
| 32 | widget->setFocus(); | 33 | widget->setFocus(); |
| 33 | } | 34 | } |
| @@ -36,9 +37,8 @@ void ControllerDialog::refreshConfiguration() { | |||
| 36 | const auto& players = Settings::values.players.GetValue(); | 37 | const auto& players = Settings::values.players.GetValue(); |
| 37 | constexpr std::size_t player = 0; | 38 | constexpr std::size_t player = 0; |
| 38 | widget->SetPlayerInputRaw(player, players[player].buttons, players[player].analogs); | 39 | widget->SetPlayerInputRaw(player, players[player].buttons, players[player].analogs); |
| 39 | widget->SetConnectedStatus(players[player].connected); | ||
| 40 | widget->SetControllerType(players[player].controller_type); | 40 | widget->SetControllerType(players[player].controller_type); |
| 41 | widget->repaint(); | 41 | widget->SetConnectedStatus(players[player].connected); |
| 42 | } | 42 | } |
| 43 | 43 | ||
| 44 | QAction* ControllerDialog::toggleViewAction() { | 44 | QAction* ControllerDialog::toggleViewAction() { |
| @@ -56,6 +56,7 @@ void ControllerDialog::showEvent(QShowEvent* ev) { | |||
| 56 | if (toggle_view_action) { | 56 | if (toggle_view_action) { |
| 57 | toggle_view_action->setChecked(isVisible()); | 57 | toggle_view_action->setChecked(isVisible()); |
| 58 | } | 58 | } |
| 59 | refreshConfiguration(); | ||
| 59 | QWidget::showEvent(ev); | 60 | QWidget::showEvent(ev); |
| 60 | } | 61 | } |
| 61 | 62 | ||
| @@ -63,5 +64,6 @@ void ControllerDialog::hideEvent(QHideEvent* ev) { | |||
| 63 | if (toggle_view_action) { | 64 | if (toggle_view_action) { |
| 64 | toggle_view_action->setChecked(isVisible()); | 65 | toggle_view_action->setChecked(isVisible()); |
| 65 | } | 66 | } |
| 67 | widget->SetConnectedStatus(false); | ||
| 66 | QWidget::hideEvent(ev); | 68 | QWidget::hideEvent(ev); |
| 67 | } | 69 | } |
diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp index aa3bd5e34..da956c99b 100644 --- a/src/yuzu/game_list.cpp +++ b/src/yuzu/game_list.cpp | |||
| @@ -91,9 +91,8 @@ QString GameListSearchField::filterText() const { | |||
| 91 | 91 | ||
| 92 | QString GameList::GetLastFilterResultItem() const { | 92 | QString 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 |
| 186 | void GameList::OnTextChanged(const QString& new_text) { | 185 | void 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); |
| @@ -512,6 +505,10 @@ void GameList::PopupContextMenu(const QPoint& menu_location) { | |||
| 512 | void GameList::AddGamePopup(QMenu& context_menu, u64 program_id, const std::string& path) { | 505 | void GameList::AddGamePopup(QMenu& context_menu, u64 program_id, const std::string& path) { |
| 513 | QAction* favorite = context_menu.addAction(tr("Favorite")); | 506 | QAction* favorite = context_menu.addAction(tr("Favorite")); |
| 514 | context_menu.addSeparator(); | 507 | context_menu.addSeparator(); |
| 508 | QAction* start_game = context_menu.addAction(tr("Start Game")); | ||
| 509 | QAction* start_game_global = | ||
| 510 | context_menu.addAction(tr("Start Game without Custom Configuration")); | ||
| 511 | context_menu.addSeparator(); | ||
| 515 | QAction* open_save_location = context_menu.addAction(tr("Open Save Data Location")); | 512 | QAction* open_save_location = context_menu.addAction(tr("Open Save Data Location")); |
| 516 | QAction* open_mod_location = context_menu.addAction(tr("Open Mod Data Location")); | 513 | QAction* open_mod_location = context_menu.addAction(tr("Open Mod Data Location")); |
| 517 | QAction* open_transferable_shader_cache = | 514 | QAction* open_transferable_shader_cache = |
| @@ -547,6 +544,12 @@ void GameList::AddGamePopup(QMenu& context_menu, u64 program_id, const std::stri | |||
| 547 | connect(open_save_location, &QAction::triggered, [this, program_id, path]() { | 544 | connect(open_save_location, &QAction::triggered, [this, program_id, path]() { |
| 548 | emit OpenFolderRequested(program_id, GameListOpenTarget::SaveData, path); | 545 | emit OpenFolderRequested(program_id, GameListOpenTarget::SaveData, path); |
| 549 | }); | 546 | }); |
| 547 | connect(start_game, &QAction::triggered, [this, path]() { | ||
| 548 | emit BootGame(QString::fromStdString(path), 0, StartGameType::Normal); | ||
| 549 | }); | ||
| 550 | connect(start_game_global, &QAction::triggered, [this, path]() { | ||
| 551 | emit BootGame(QString::fromStdString(path), 0, StartGameType::Global); | ||
| 552 | }); | ||
| 550 | connect(open_mod_location, &QAction::triggered, [this, program_id, path]() { | 553 | connect(open_mod_location, &QAction::triggered, [this, program_id, path]() { |
| 551 | emit OpenFolderRequested(program_id, GameListOpenTarget::ModData, path); | 554 | emit OpenFolderRequested(program_id, GameListOpenTarget::ModData, path); |
| 552 | }); | 555 | }); |
| @@ -649,9 +652,9 @@ void GameList::AddPermDirPopup(QMenu& context_menu, QModelIndex selected) { | |||
| 649 | } | 652 | } |
| 650 | 653 | ||
| 651 | void GameList::AddFavoritesPopup(QMenu& context_menu) { | 654 | void GameList::AddFavoritesPopup(QMenu& context_menu) { |
| 652 | QAction* clear_all = context_menu.addAction(tr("Clear")); | 655 | QAction* clear = context_menu.addAction(tr("Clear")); |
| 653 | 656 | ||
| 654 | connect(clear_all, &QAction::triggered, [this] { | 657 | connect(clear, &QAction::triggered, [this] { |
| 655 | for (const auto id : UISettings::values.favorited_ids) { | 658 | for (const auto id : UISettings::values.favorited_ids) { |
| 656 | RemoveFavorite(id); | 659 | RemoveFavorite(id); |
| 657 | } | 660 | } |
| @@ -708,22 +711,7 @@ void GameList::PopulateAsync(QVector<UISettings::GameDir>& game_dirs) { | |||
| 708 | tree_view->setEnabled(false); | 711 | tree_view->setEnabled(false); |
| 709 | 712 | ||
| 710 | // Update the columns in case UISettings has changed | 713 | // Update the columns in case UISettings has changed |
| 711 | item_model->removeColumns(0, item_model->columnCount()); | 714 | 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 | 715 | ||
| 728 | // Delete any rows that might already exist if we're repopulating | 716 | // Delete any rows that might already exist if we're repopulating |
| 729 | item_model->removeRows(0, item_model->rowCount()); | 717 | item_model->removeRows(0, item_model->rowCount()); |
| @@ -800,7 +788,7 @@ void GameList::AddFavorite(u64 program_id) { | |||
| 800 | if (folder->child(j)->data(GameListItemPath::ProgramIdRole).toULongLong() == | 788 | if (folder->child(j)->data(GameListItemPath::ProgramIdRole).toULongLong() == |
| 801 | program_id) { | 789 | program_id) { |
| 802 | QList<QStandardItem*> list; | 790 | QList<QStandardItem*> list; |
| 803 | for (int k = 0; k < item_model->columnCount(); k++) { | 791 | for (int k = 0; k < COLUMN_COUNT; k++) { |
| 804 | list.append(folder->child(j, k)->clone()); | 792 | list.append(folder->child(j, k)->clone()); |
| 805 | } | 793 | } |
| 806 | list[0]->setData(folder->child(j)->data(GameListItem::SortRole), | 794 | list[0]->setData(folder->child(j)->data(GameListItem::SortRole), |
diff --git a/src/yuzu/game_list.h b/src/yuzu/game_list.h index ab6866735..b630e34ff 100644 --- a/src/yuzu/game_list.h +++ b/src/yuzu/game_list.h | |||
| @@ -28,6 +28,7 @@ class GameListWorker; | |||
| 28 | class GameListSearchField; | 28 | class GameListSearchField; |
| 29 | class GameListDir; | 29 | class GameListDir; |
| 30 | class GMainWindow; | 30 | class GMainWindow; |
| 31 | enum class StartGameType; | ||
| 31 | 32 | ||
| 32 | namespace FileSys { | 33 | namespace FileSys { |
| 33 | class ManualContentProvider; | 34 | class ManualContentProvider; |
| @@ -82,6 +83,7 @@ public: | |||
| 82 | static const QStringList supported_file_extensions; | 83 | static const QStringList supported_file_extensions; |
| 83 | 84 | ||
| 84 | signals: | 85 | signals: |
| 86 | void BootGame(const QString& game_path, std::size_t program_index, StartGameType type); | ||
| 85 | void GameChosen(const QString& game_path); | 87 | void GameChosen(const QString& game_path); |
| 86 | void ShouldCancelWorker(); | 88 | void ShouldCancelWorker(); |
| 87 | void OpenFolderRequested(u64 program_id, GameListOpenTarget target, | 89 | void OpenFolderRequested(u64 program_id, GameListOpenTarget target, |
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 237e26829..19339ff2d 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -1094,6 +1094,7 @@ void GMainWindow::OnAppFocusStateChanged(Qt::ApplicationState state) { | |||
| 1094 | } | 1094 | } |
| 1095 | 1095 | ||
| 1096 | void GMainWindow::ConnectWidgetEvents() { | 1096 | void GMainWindow::ConnectWidgetEvents() { |
| 1097 | connect(game_list, &GameList::BootGame, this, &GMainWindow::BootGame); | ||
| 1097 | connect(game_list, &GameList::GameChosen, this, &GMainWindow::OnGameListLoadFile); | 1098 | connect(game_list, &GameList::GameChosen, this, &GMainWindow::OnGameListLoadFile); |
| 1098 | connect(game_list, &GameList::OpenDirectory, this, &GMainWindow::OnGameListOpenDirectory); | 1099 | connect(game_list, &GameList::OpenDirectory, this, &GMainWindow::OnGameListOpenDirectory); |
| 1099 | connect(game_list, &GameList::OpenFolderRequested, this, &GMainWindow::OnGameListOpenFolder); | 1100 | connect(game_list, &GameList::OpenFolderRequested, this, &GMainWindow::OnGameListOpenFolder); |
| @@ -1320,7 +1321,7 @@ void GMainWindow::SelectAndSetCurrentUser() { | |||
| 1320 | Settings::values.current_user = dialog.GetIndex(); | 1321 | Settings::values.current_user = dialog.GetIndex(); |
| 1321 | } | 1322 | } |
| 1322 | 1323 | ||
| 1323 | void GMainWindow::BootGame(const QString& filename, std::size_t program_index) { | 1324 | void GMainWindow::BootGame(const QString& filename, std::size_t program_index, StartGameType type) { |
| 1324 | LOG_INFO(Frontend, "yuzu starting..."); | 1325 | LOG_INFO(Frontend, "yuzu starting..."); |
| 1325 | StoreRecentFile(filename); // Put the filename on top of the list | 1326 | StoreRecentFile(filename); // Put the filename on top of the list |
| 1326 | 1327 | ||
| @@ -1332,7 +1333,8 @@ void GMainWindow::BootGame(const QString& filename, std::size_t program_index) { | |||
| 1332 | const auto v_file = Core::GetGameFileFromPath(vfs, filename.toUtf8().constData()); | 1333 | const auto v_file = Core::GetGameFileFromPath(vfs, filename.toUtf8().constData()); |
| 1333 | const auto loader = Loader::GetLoader(system, v_file, program_index); | 1334 | const auto loader = Loader::GetLoader(system, v_file, program_index); |
| 1334 | 1335 | ||
| 1335 | if (!(loader == nullptr || loader->ReadProgramId(title_id) != Loader::ResultStatus::Success)) { | 1336 | if (loader != nullptr && loader->ReadProgramId(title_id) == Loader::ResultStatus::Success && |
| 1337 | type == StartGameType::Normal) { | ||
| 1336 | // Load per game settings | 1338 | // Load per game settings |
| 1337 | const auto file_path = std::filesystem::path{filename.toStdU16String()}; | 1339 | const auto file_path = std::filesystem::path{filename.toStdU16String()}; |
| 1338 | const auto config_file_name = title_id == 0 | 1340 | const auto config_file_name = title_id == 0 |
| @@ -2596,13 +2598,53 @@ void GMainWindow::OnConfigure() { | |||
| 2596 | &GMainWindow::OnLanguageChanged); | 2598 | &GMainWindow::OnLanguageChanged); |
| 2597 | 2599 | ||
| 2598 | const auto result = configure_dialog.exec(); | 2600 | const auto result = configure_dialog.exec(); |
| 2599 | if (result != QDialog::Accepted && !UISettings::values.configuration_applied) { | 2601 | if (result != QDialog::Accepted && !UISettings::values.configuration_applied && |
| 2602 | !UISettings::values.reset_to_defaults) { | ||
| 2603 | // Runs if the user hit Cancel or closed the window, and did not ever press the Apply button | ||
| 2604 | // or `Reset to Defaults` button | ||
| 2600 | return; | 2605 | return; |
| 2601 | } else if (result == QDialog::Accepted) { | 2606 | } else if (result == QDialog::Accepted) { |
| 2607 | // Only apply new changes if user hit Okay | ||
| 2608 | // This is here to avoid applying changes if the user hit Apply, made some changes, then hit | ||
| 2609 | // Cancel | ||
| 2602 | configure_dialog.ApplyConfiguration(); | 2610 | configure_dialog.ApplyConfiguration(); |
| 2603 | controller_dialog->refreshConfiguration(); | 2611 | } else if (UISettings::values.reset_to_defaults) { |
| 2612 | LOG_INFO(Frontend, "Resetting all settings to defaults"); | ||
| 2613 | if (!Common::FS::RemoveFile(config->GetConfigFilePath())) { | ||
| 2614 | LOG_WARNING(Frontend, "Failed to remove configuration file"); | ||
| 2615 | } | ||
| 2616 | if (!Common::FS::RemoveDirContentsRecursively( | ||
| 2617 | Common::FS::GetYuzuPath(Common::FS::YuzuPath::ConfigDir) / "custom")) { | ||
| 2618 | LOG_WARNING(Frontend, "Failed to remove custom configuration files"); | ||
| 2619 | } | ||
| 2620 | if (!Common::FS::RemoveDirRecursively( | ||
| 2621 | Common::FS::GetYuzuPath(Common::FS::YuzuPath::CacheDir) / "game_list")) { | ||
| 2622 | LOG_WARNING(Frontend, "Failed to remove game metadata cache files"); | ||
| 2623 | } | ||
| 2624 | |||
| 2625 | // Explicitly save the game directories, since reinitializing config does not explicitly do | ||
| 2626 | // so. | ||
| 2627 | QVector<UISettings::GameDir> old_game_dirs = std::move(UISettings::values.game_dirs); | ||
| 2628 | QVector<u64> old_favorited_ids = std::move(UISettings::values.favorited_ids); | ||
| 2629 | |||
| 2630 | Settings::values.disabled_addons.clear(); | ||
| 2631 | |||
| 2632 | config = std::make_unique<Config>(); | ||
| 2633 | UISettings::values.reset_to_defaults = false; | ||
| 2634 | |||
| 2635 | UISettings::values.game_dirs = std::move(old_game_dirs); | ||
| 2636 | UISettings::values.favorited_ids = std::move(old_favorited_ids); | ||
| 2637 | |||
| 2638 | InitializeRecentFileMenuActions(); | ||
| 2639 | |||
| 2640 | SetDefaultUIGeometry(); | ||
| 2641 | RestoreUIState(); | ||
| 2642 | |||
| 2643 | ShowTelemetryCallout(); | ||
| 2604 | } | 2644 | } |
| 2645 | controller_dialog->refreshConfiguration(); | ||
| 2605 | InitializeHotkeys(); | 2646 | InitializeHotkeys(); |
| 2647 | |||
| 2606 | if (UISettings::values.theme != old_theme) { | 2648 | if (UISettings::values.theme != old_theme) { |
| 2607 | UpdateUITheme(); | 2649 | UpdateUITheme(); |
| 2608 | } | 2650 | } |
diff --git a/src/yuzu/main.h b/src/yuzu/main.h index 490b6889f..11f152cbe 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h | |||
| @@ -39,6 +39,11 @@ class GameListPlaceholder; | |||
| 39 | 39 | ||
| 40 | class QtSoftwareKeyboardDialog; | 40 | class QtSoftwareKeyboardDialog; |
| 41 | 41 | ||
| 42 | enum class StartGameType { | ||
| 43 | Normal, // Can use custom configuration | ||
| 44 | Global, // Only uses global configuration | ||
| 45 | }; | ||
| 46 | |||
| 42 | namespace Core::Frontend { | 47 | namespace Core::Frontend { |
| 43 | struct ControllerParameters; | 48 | struct ControllerParameters; |
| 44 | struct InlineAppearParameters; | 49 | struct InlineAppearParameters; |
| @@ -181,7 +186,8 @@ private: | |||
| 181 | void AllowOSSleep(); | 186 | void AllowOSSleep(); |
| 182 | 187 | ||
| 183 | bool LoadROM(const QString& filename, std::size_t program_index); | 188 | bool LoadROM(const QString& filename, std::size_t program_index); |
| 184 | void BootGame(const QString& filename, std::size_t program_index = 0); | 189 | void BootGame(const QString& filename, std::size_t program_index = 0, |
| 190 | StartGameType with_config = StartGameType::Normal); | ||
| 185 | void ShutdownGame(); | 191 | void ShutdownGame(); |
| 186 | 192 | ||
| 187 | void ShowTelemetryCallout(); | 193 | void ShowTelemetryCallout(); |
diff --git a/src/yuzu/uisettings.h b/src/yuzu/uisettings.h index 49122ec32..cdcb83f9f 100644 --- a/src/yuzu/uisettings.h +++ b/src/yuzu/uisettings.h | |||
| @@ -97,6 +97,7 @@ struct Values { | |||
| 97 | bool cache_game_list; | 97 | bool cache_game_list; |
| 98 | 98 | ||
| 99 | bool configuration_applied; | 99 | bool configuration_applied; |
| 100 | bool reset_to_defaults; | ||
| 100 | }; | 101 | }; |
| 101 | 102 | ||
| 102 | extern Values values; | 103 | extern Values values; |
diff --git a/src/yuzu/util/limitable_input_dialog.cpp b/src/yuzu/util/limitable_input_dialog.cpp index edd78e579..6fea41f95 100644 --- a/src/yuzu/util/limitable_input_dialog.cpp +++ b/src/yuzu/util/limitable_input_dialog.cpp | |||
| @@ -21,11 +21,13 @@ void LimitableInputDialog::CreateUI() { | |||
| 21 | 21 | ||
| 22 | text_label = new QLabel(this); | 22 | text_label = new QLabel(this); |
| 23 | text_entry = new QLineEdit(this); | 23 | text_entry = new QLineEdit(this); |
| 24 | text_label_invalid = new QLabel(this); | ||
| 24 | buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this); | 25 | buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this); |
| 25 | 26 | ||
| 26 | auto* const layout = new QVBoxLayout; | 27 | auto* const layout = new QVBoxLayout; |
| 27 | layout->addWidget(text_label); | 28 | layout->addWidget(text_label); |
| 28 | layout->addWidget(text_entry); | 29 | layout->addWidget(text_entry); |
| 30 | layout->addWidget(text_label_invalid); | ||
| 29 | layout->addWidget(buttons); | 31 | layout->addWidget(buttons); |
| 30 | 32 | ||
| 31 | setLayout(layout); | 33 | setLayout(layout); |
| @@ -37,18 +39,36 @@ void LimitableInputDialog::ConnectEvents() { | |||
| 37 | } | 39 | } |
| 38 | 40 | ||
| 39 | QString LimitableInputDialog::GetText(QWidget* parent, const QString& title, const QString& text, | 41 | QString LimitableInputDialog::GetText(QWidget* parent, const QString& title, const QString& text, |
| 40 | int min_character_limit, int max_character_limit) { | 42 | int min_character_limit, int max_character_limit, |
| 43 | InputLimiter limit_type) { | ||
| 41 | Q_ASSERT(min_character_limit <= max_character_limit); | 44 | Q_ASSERT(min_character_limit <= max_character_limit); |
| 42 | 45 | ||
| 43 | LimitableInputDialog dialog{parent}; | 46 | LimitableInputDialog dialog{parent}; |
| 44 | dialog.setWindowTitle(title); | 47 | dialog.setWindowTitle(title); |
| 45 | dialog.text_label->setText(text); | 48 | dialog.text_label->setText(text); |
| 46 | dialog.text_entry->setMaxLength(max_character_limit); | 49 | dialog.text_entry->setMaxLength(max_character_limit); |
| 50 | dialog.text_label_invalid->show(); | ||
| 51 | |||
| 52 | switch (limit_type) { | ||
| 53 | case InputLimiter::Filesystem: | ||
| 54 | dialog.invalid_characters = QStringLiteral("<>:;\"/\\|,.!?*"); | ||
| 55 | break; | ||
| 56 | default: | ||
| 57 | dialog.invalid_characters.clear(); | ||
| 58 | dialog.text_label_invalid->hide(); | ||
| 59 | break; | ||
| 60 | } | ||
| 61 | dialog.text_label_invalid->setText( | ||
| 62 | tr("The text can't contain any of the following characters:\n%1") | ||
| 63 | .arg(dialog.invalid_characters)); | ||
| 47 | 64 | ||
| 48 | auto* const ok_button = dialog.buttons->button(QDialogButtonBox::Ok); | 65 | auto* const ok_button = dialog.buttons->button(QDialogButtonBox::Ok); |
| 49 | ok_button->setEnabled(false); | 66 | ok_button->setEnabled(false); |
| 50 | connect(dialog.text_entry, &QLineEdit::textEdited, [&](const QString& new_text) { | 67 | connect(dialog.text_entry, &QLineEdit::textEdited, [&] { |
| 51 | ok_button->setEnabled(new_text.length() >= min_character_limit); | 68 | if (!dialog.invalid_characters.isEmpty()) { |
| 69 | dialog.RemoveInvalidCharacters(); | ||
| 70 | } | ||
| 71 | ok_button->setEnabled(dialog.text_entry->text().length() >= min_character_limit); | ||
| 52 | }); | 72 | }); |
| 53 | 73 | ||
| 54 | if (dialog.exec() != QDialog::Accepted) { | 74 | if (dialog.exec() != QDialog::Accepted) { |
| @@ -57,3 +77,15 @@ QString LimitableInputDialog::GetText(QWidget* parent, const QString& title, con | |||
| 57 | 77 | ||
| 58 | return dialog.text_entry->text(); | 78 | return dialog.text_entry->text(); |
| 59 | } | 79 | } |
| 80 | |||
| 81 | void LimitableInputDialog::RemoveInvalidCharacters() { | ||
| 82 | auto cpos = text_entry->cursorPosition(); | ||
| 83 | for (int i = 0; i < text_entry->text().length(); i++) { | ||
| 84 | if (invalid_characters.contains(text_entry->text().at(i))) { | ||
| 85 | text_entry->setText(text_entry->text().remove(i, 1)); | ||
| 86 | i--; | ||
| 87 | cpos--; | ||
| 88 | } | ||
| 89 | } | ||
| 90 | text_entry->setCursorPosition(cpos); | ||
| 91 | } | ||
diff --git a/src/yuzu/util/limitable_input_dialog.h b/src/yuzu/util/limitable_input_dialog.h index 164ad7301..a8e31098b 100644 --- a/src/yuzu/util/limitable_input_dialog.h +++ b/src/yuzu/util/limitable_input_dialog.h | |||
| @@ -18,14 +18,24 @@ public: | |||
| 18 | explicit LimitableInputDialog(QWidget* parent = nullptr); | 18 | explicit LimitableInputDialog(QWidget* parent = nullptr); |
| 19 | ~LimitableInputDialog() override; | 19 | ~LimitableInputDialog() override; |
| 20 | 20 | ||
| 21 | enum class InputLimiter { | ||
| 22 | None, | ||
| 23 | Filesystem, | ||
| 24 | }; | ||
| 25 | |||
| 21 | static QString GetText(QWidget* parent, const QString& title, const QString& text, | 26 | static QString GetText(QWidget* parent, const QString& title, const QString& text, |
| 22 | int min_character_limit, int max_character_limit); | 27 | int min_character_limit, int max_character_limit, |
| 28 | InputLimiter limit_type = InputLimiter::None); | ||
| 23 | 29 | ||
| 24 | private: | 30 | private: |
| 25 | void CreateUI(); | 31 | void CreateUI(); |
| 26 | void ConnectEvents(); | 32 | void ConnectEvents(); |
| 27 | 33 | ||
| 34 | void RemoveInvalidCharacters(); | ||
| 35 | QString invalid_characters; | ||
| 36 | |||
| 28 | QLabel* text_label; | 37 | QLabel* text_label; |
| 29 | QLineEdit* text_entry; | 38 | QLineEdit* text_entry; |
| 39 | QLabel* text_label_invalid; | ||
| 30 | QDialogButtonBox* buttons; | 40 | QDialogButtonBox* buttons; |
| 31 | }; | 41 | }; |
diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp index a2ab69cdd..63f368fe5 100644 --- a/src/yuzu_cmd/config.cpp +++ b/src/yuzu_cmd/config.cpp | |||
| @@ -317,6 +317,43 @@ void Config::ReadValues() { | |||
| 317 | sdl2_config->GetInteger("ControlsGeneral", "touch_diameter_x", 15); | 317 | sdl2_config->GetInteger("ControlsGeneral", "touch_diameter_x", 15); |
| 318 | Settings::values.touchscreen.diameter_y = | 318 | Settings::values.touchscreen.diameter_y = |
| 319 | sdl2_config->GetInteger("ControlsGeneral", "touch_diameter_y", 15); | 319 | sdl2_config->GetInteger("ControlsGeneral", "touch_diameter_y", 15); |
| 320 | |||
| 321 | int num_touch_from_button_maps = | ||
| 322 | sdl2_config->GetInteger("ControlsGeneral", "touch_from_button_map", 0); | ||
| 323 | if (num_touch_from_button_maps > 0) { | ||
| 324 | for (int i = 0; i < num_touch_from_button_maps; ++i) { | ||
| 325 | Settings::TouchFromButtonMap map; | ||
| 326 | map.name = sdl2_config->Get("ControlsGeneral", | ||
| 327 | std::string("touch_from_button_maps_") + std::to_string(i) + | ||
| 328 | std::string("_name"), | ||
| 329 | "default"); | ||
| 330 | const int num_touch_maps = sdl2_config->GetInteger( | ||
| 331 | "ControlsGeneral", | ||
| 332 | std::string("touch_from_button_maps_") + std::to_string(i) + std::string("_count"), | ||
| 333 | 0); | ||
| 334 | map.buttons.reserve(num_touch_maps); | ||
| 335 | |||
| 336 | for (int j = 0; j < num_touch_maps; ++j) { | ||
| 337 | std::string touch_mapping = | ||
| 338 | sdl2_config->Get("ControlsGeneral", | ||
| 339 | std::string("touch_from_button_maps_") + std::to_string(i) + | ||
| 340 | std::string("_bind_") + std::to_string(j), | ||
| 341 | ""); | ||
| 342 | map.buttons.emplace_back(std::move(touch_mapping)); | ||
| 343 | } | ||
| 344 | |||
| 345 | Settings::values.touch_from_button_maps.emplace_back(std::move(map)); | ||
| 346 | } | ||
| 347 | } else { | ||
| 348 | Settings::values.touch_from_button_maps.emplace_back( | ||
| 349 | Settings::TouchFromButtonMap{"default", {}}); | ||
| 350 | num_touch_from_button_maps = 1; | ||
| 351 | } | ||
| 352 | Settings::values.use_touch_from_button = | ||
| 353 | sdl2_config->GetBoolean("ControlsGeneral", "use_touch_from_button", false); | ||
| 354 | Settings::values.touch_from_button_map_index = | ||
| 355 | std::clamp(Settings::values.touch_from_button_map_index, 0, num_touch_from_button_maps - 1); | ||
| 356 | |||
| 320 | Settings::values.udp_input_servers = | 357 | Settings::values.udp_input_servers = |
| 321 | sdl2_config->Get("Controls", "udp_input_address", InputCommon::CemuhookUDP::DEFAULT_SRV); | 358 | sdl2_config->Get("Controls", "udp_input_address", InputCommon::CemuhookUDP::DEFAULT_SRV); |
| 322 | 359 | ||
diff --git a/src/yuzu_cmd/default_ini.h b/src/yuzu_cmd/default_ini.h index 4ce8e08e4..8ce2967ac 100644 --- a/src/yuzu_cmd/default_ini.h +++ b/src/yuzu_cmd/default_ini.h | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | namespace DefaultINI { | 7 | namespace DefaultINI { |
| 8 | 8 | ||
| 9 | const char* sdl2_config_file = R"( | 9 | const char* sdl2_config_file = R"( |
| 10 | [Controls] | 10 | [ControlsGeneral] |
| 11 | # The input devices and parameters for each Switch native input | 11 | # The input devices and parameters for each Switch native input |
| 12 | # It should be in the format of "engine:[engine_name],[param1]:[value1],[param2]:[value2]..." | 12 | # It should be in the format of "engine:[engine_name],[param1]:[value1],[param2]:[value2]..." |
| 13 | # Escape characters $0 (for ':'), $1 (for ',') and $2 (for '$') can be used in values | 13 | # Escape characters $0 (for ':'), $1 (for ',') and $2 (for '$') can be used in values |
| @@ -86,6 +86,18 @@ motion_device= | |||
| 86 | # - "min_x", "min_y", "max_x", "max_y": defines the udp device's touch screen coordinate system | 86 | # - "min_x", "min_y", "max_x", "max_y": defines the udp device's touch screen coordinate system |
| 87 | touch_device= | 87 | touch_device= |
| 88 | 88 | ||
| 89 | # Whether to enable or disable touch input from button | ||
| 90 | # 0 (default): Disabled, 1: Enabled | ||
| 91 | use_touch_from_button= | ||
| 92 | |||
| 93 | # for mapping buttons to touch inputs. | ||
| 94 | #touch_from_button_map=1 | ||
| 95 | #touch_from_button_maps_0_name=default | ||
| 96 | #touch_from_button_maps_0_count=2 | ||
| 97 | #touch_from_button_maps_0_bind_0=foo | ||
| 98 | #touch_from_button_maps_0_bind_1=bar | ||
| 99 | # etc. | ||
| 100 | |||
| 89 | # Most desktop operating systems do not expose a way to poll the motion state of the controllers | 101 | # Most desktop operating systems do not expose a way to poll the motion state of the controllers |
| 90 | # so as a way around it, cemuhook created a udp client/server protocol to broadcast the data directly | 102 | # so as a way around it, cemuhook created a udp client/server protocol to broadcast the data directly |
| 91 | # from a controller device to the client program. Citra has a client that can connect and read | 103 | # from a controller device to the client program. Citra has a client that can connect and read |
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp index 3c49a300b..837a44be7 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp | |||
| @@ -32,17 +32,17 @@ | |||
| 32 | 32 | ||
| 33 | class SDLGLContext : public Core::Frontend::GraphicsContext { | 33 | class SDLGLContext : public Core::Frontend::GraphicsContext { |
| 34 | public: | 34 | public: |
| 35 | explicit SDLGLContext() { | 35 | explicit SDLGLContext(SDL_Window* window_) : window{window_} { |
| 36 | // create a hidden window to make the shared context against | ||
| 37 | window = SDL_CreateWindow(NULL, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 0, 0, | ||
| 38 | SDL_WINDOW_HIDDEN | SDL_WINDOW_OPENGL); | ||
| 39 | context = SDL_GL_CreateContext(window); | 36 | context = SDL_GL_CreateContext(window); |
| 40 | } | 37 | } |
| 41 | 38 | ||
| 42 | ~SDLGLContext() { | 39 | ~SDLGLContext() { |
| 43 | DoneCurrent(); | 40 | DoneCurrent(); |
| 44 | SDL_GL_DeleteContext(context); | 41 | SDL_GL_DeleteContext(context); |
| 45 | SDL_DestroyWindow(window); | 42 | } |
| 43 | |||
| 44 | void SwapBuffers() override { | ||
| 45 | SDL_GL_SwapWindow(window); | ||
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | void MakeCurrent() override { | 48 | void MakeCurrent() override { |
| @@ -114,9 +114,6 @@ EmuWindow_SDL2_GL::EmuWindow_SDL2_GL(InputCommon::InputSubsystem* input_subsyste | |||
| 114 | exit(1); | 114 | exit(1); |
| 115 | } | 115 | } |
| 116 | 116 | ||
| 117 | dummy_window = SDL_CreateWindow(NULL, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 0, 0, | ||
| 118 | SDL_WINDOW_HIDDEN | SDL_WINDOW_OPENGL); | ||
| 119 | |||
| 120 | SetWindowIcon(); | 117 | SetWindowIcon(); |
| 121 | 118 | ||
| 122 | if (fullscreen) { | 119 | if (fullscreen) { |
| @@ -159,5 +156,5 @@ EmuWindow_SDL2_GL::~EmuWindow_SDL2_GL() { | |||
| 159 | } | 156 | } |
| 160 | 157 | ||
| 161 | std::unique_ptr<Core::Frontend::GraphicsContext> EmuWindow_SDL2_GL::CreateSharedContext() const { | 158 | std::unique_ptr<Core::Frontend::GraphicsContext> EmuWindow_SDL2_GL::CreateSharedContext() const { |
| 162 | return std::make_unique<SDLGLContext>(); | 159 | return std::make_unique<SDLGLContext>(render_window); |
| 163 | } | 160 | } |
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.h b/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.h index dba5c293c..9e694d985 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.h +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.h | |||
| @@ -20,9 +20,6 @@ public: | |||
| 20 | std::unique_ptr<Core::Frontend::GraphicsContext> CreateSharedContext() const override; | 20 | std::unique_ptr<Core::Frontend::GraphicsContext> CreateSharedContext() const override; |
| 21 | 21 | ||
| 22 | private: | 22 | private: |
| 23 | /// Fake hidden window for the core context | ||
| 24 | SDL_Window* dummy_window{}; | ||
| 25 | |||
| 26 | /// Whether the GPU and driver supports the OpenGL extension required | 23 | /// Whether the GPU and driver supports the OpenGL extension required |
| 27 | bool SupportsRequiredGLExtensions(); | 24 | bool SupportsRequiredGLExtensions(); |
| 28 | 25 | ||