diff options
author | Narr the Reg <juangerman-13@hotmail.com> | 2024-01-31 17:25:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-31 17:25:28 +0100 |
commit | 7cc7d027f74b5bffc0b3f8f3a6c3110999c7cc4c (patch) | |
tree | 24b2ed412f2683c8460839778ea7761d052bc38f /src/core/hle/service/am/frontend/applet_controller.cpp | |
parent | Merge pull request #12858 from liamwhite/non-blocking (diff) | |
parent | am: push storage from error applet with non-zero size (diff) | |
download | yuzu-7cc7d027f74b5bffc0b3f8f3a6c3110999c7cc4c.tar yuzu-7cc7d027f74b5bffc0b3f8f3a6c3110999c7cc4c.tar.gz yuzu-7cc7d027f74b5bffc0b3f8f3a6c3110999c7cc4c.tar.bz2 yuzu-7cc7d027f74b5bffc0b3f8f3a6c3110999c7cc4c.tar.lz yuzu-7cc7d027f74b5bffc0b3f8f3a6c3110999c7cc4c.tar.xz yuzu-7cc7d027f74b5bffc0b3f8f3a6c3110999c7cc4c.tar.zst yuzu-7cc7d027f74b5bffc0b3f8f3a6c3110999c7cc4c.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/am/frontend/applet_controller.cpp (renamed from src/core/hle/service/am/applets/applet_controller.cpp) | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/src/core/hle/service/am/applets/applet_controller.cpp b/src/core/hle/service/am/frontend/applet_controller.cpp index 0e4d9cc39..bd3e49fc4 100644 --- a/src/core/hle/service/am/applets/applet_controller.cpp +++ b/src/core/hle/service/am/frontend/applet_controller.cpp @@ -11,13 +11,14 @@ #include "core/frontend/applets/controller.h" #include "core/hle/result.h" #include "core/hle/service/am/am.h" -#include "core/hle/service/am/applets/applet_controller.h" +#include "core/hle/service/am/frontend/applet_controller.h" +#include "core/hle/service/am/storage.h" #include "hid_core/frontend/emulated_controller.h" #include "hid_core/hid_core.h" #include "hid_core/hid_types.h" #include "hid_core/resources/npad/npad.h" -namespace Service::AM::Applets { +namespace Service::AM::Frontend { [[maybe_unused]] constexpr Result ResultControllerSupportCanceled{ErrorModule::HID, 3101}; [[maybe_unused]] constexpr Result ResultControllerSupportNotSupportedNpadStyle{ErrorModule::HID, @@ -46,14 +47,15 @@ static Core::Frontend::ControllerParameters ConvertToFrontendParameters( }; } -Controller::Controller(Core::System& system_, LibraryAppletMode applet_mode_, +Controller::Controller(Core::System& system_, std::shared_ptr<Applet> applet_, + LibraryAppletMode applet_mode_, const Core::Frontend::ControllerApplet& frontend_) - : Applet{system_, applet_mode_}, frontend{frontend_}, system{system_} {} + : FrontendApplet{system_, applet_, applet_mode_}, frontend{frontend_} {} Controller::~Controller() = default; void Controller::Initialize() { - Applet::Initialize(); + FrontendApplet::Initialize(); LOG_INFO(Service_HID, "Initializing Controller Applet."); @@ -66,7 +68,7 @@ void Controller::Initialize() { controller_applet_version = ControllerAppletVersion{common_args.library_version}; - const auto private_arg_storage = broker.PopNormalDataToApplet(); + const std::shared_ptr<IStorage> private_arg_storage = PopInData(); ASSERT(private_arg_storage != nullptr); const auto& private_arg = private_arg_storage->GetData(); @@ -116,7 +118,7 @@ void Controller::Initialize() { switch (controller_private_arg.mode) { case ControllerSupportMode::ShowControllerSupport: case ControllerSupportMode::ShowControllerStrapGuide: { - const auto user_arg_storage = broker.PopNormalDataToApplet(); + const std::shared_ptr<IStorage> user_arg_storage = PopInData(); ASSERT(user_arg_storage != nullptr); const auto& user_arg = user_arg_storage->GetData(); @@ -142,7 +144,7 @@ void Controller::Initialize() { break; } case ControllerSupportMode::ShowControllerFirmwareUpdate: { - const auto update_arg_storage = broker.PopNormalDataToApplet(); + const std::shared_ptr<IStorage> update_arg_storage = PopInData(); ASSERT(update_arg_storage != nullptr); const auto& update_arg = update_arg_storage->GetData(); @@ -152,7 +154,7 @@ void Controller::Initialize() { break; } case ControllerSupportMode::ShowControllerKeyRemappingForSystem: { - const auto remapping_arg_storage = broker.PopNormalDataToApplet(); + const std::shared_ptr<IStorage> remapping_arg_storage = PopInData(); ASSERT(remapping_arg_storage != nullptr); const auto& remapping_arg = remapping_arg_storage->GetData(); @@ -168,10 +170,6 @@ void Controller::Initialize() { } } -bool Controller::TransactionComplete() const { - return complete; -} - Result Controller::GetStatus() const { return status; } @@ -260,8 +258,9 @@ void Controller::ConfigurationComplete(bool is_success) { complete = true; out_data = std::vector<u8>(sizeof(ControllerSupportResultInfo)); std::memcpy(out_data.data(), &result_info, out_data.size()); - broker.PushNormalDataFromApplet(std::make_shared<IStorage>(system, std::move(out_data))); - broker.SignalStateChanged(); + + PushOutData(std::make_shared<IStorage>(system, std::move(out_data))); + Exit(); } Result Controller::RequestExit() { @@ -269,4 +268,4 @@ Result Controller::RequestExit() { R_SUCCEED(); } -} // namespace Service::AM::Applets +} // namespace Service::AM::Frontend |