diff options
-rw-r--r-- | src/core/hle/service/prepo/prepo.cpp | 21 | ||||
-rw-r--r-- | src/core/hle/service/sockets/bsd.cpp | 6 | ||||
-rwxr-xr-x | src/input_common/analog_from_button.cpp | 14 |
3 files changed, 31 insertions, 10 deletions
diff --git a/src/core/hle/service/prepo/prepo.cpp b/src/core/hle/service/prepo/prepo.cpp index 86ecc5b97..d5b3b17a5 100644 --- a/src/core/hle/service/prepo/prepo.cpp +++ b/src/core/hle/service/prepo/prepo.cpp @@ -25,8 +25,8 @@ public: {10103, &PlayReport::SaveReportWithUser<Core::Reporter::PlayReportType::Old2>, "SaveReportWithUserOld2"}, {10104, &PlayReport::SaveReport<Core::Reporter::PlayReportType::New>, "SaveReport"}, {10105, &PlayReport::SaveReportWithUser<Core::Reporter::PlayReportType::New>, "SaveReportWithUser"}, - {10200, nullptr, "RequestImmediateTransmission"}, - {10300, nullptr, "GetTransmissionStatus"}, + {10200, &PlayReport::RequestImmediateTransmission, "RequestImmediateTransmission"}, + {10300, &PlayReport::GetTransmissionStatus, "GetTransmissionStatus"}, {10400, &PlayReport::GetSystemSessionId, "GetSystemSessionId"}, {20100, &PlayReport::SaveSystemReport, "SaveSystemReport"}, {20101, &PlayReport::SaveSystemReportWithUser, "SaveSystemReportWithUser"}, @@ -108,6 +108,23 @@ private: rb.Push(RESULT_SUCCESS); } + void RequestImmediateTransmission(Kernel::HLERequestContext& ctx) { + LOG_WARNING(Service_PREPO, "(STUBBED) called"); + + IPC::ResponseBuilder rb{ctx, 2}; + rb.Push(RESULT_SUCCESS); + } + + void GetTransmissionStatus(Kernel::HLERequestContext& ctx) { + LOG_WARNING(Service_PREPO, "(STUBBED) called"); + + constexpr s32 status = 0; + + IPC::ResponseBuilder rb{ctx, 3}; + rb.Push(RESULT_SUCCESS); + rb.Push(status); + } + void GetSystemSessionId(Kernel::HLERequestContext& ctx) { LOG_WARNING(Service_PREPO, "(STUBBED) called"); diff --git a/src/core/hle/service/sockets/bsd.cpp b/src/core/hle/service/sockets/bsd.cpp index 9a5b32975..0b306b87a 100644 --- a/src/core/hle/service/sockets/bsd.cpp +++ b/src/core/hle/service/sockets/bsd.cpp @@ -421,11 +421,11 @@ void BSD::Close(Kernel::HLERequestContext& ctx) { } void BSD::EventFd(Kernel::HLERequestContext& ctx) { - LOG_WARNING(Service, "(STUBBED) called"); IPC::RequestParser rp{ctx}; - const s32 fd = rp.Pop<s32>(); + const u64 initval = rp.Pop<u64>(); + const u32 flags = rp.Pop<u32>(); - LOG_DEBUG(Service, "called. fd={}", fd); + LOG_WARNING(Service, "(STUBBED) called. initval={}, flags={}", initval, flags); BuildErrnoResponse(ctx, Errno::SUCCESS); } diff --git a/src/input_common/analog_from_button.cpp b/src/input_common/analog_from_button.cpp index 40b516f85..07a0fa4a1 100755 --- a/src/input_common/analog_from_button.cpp +++ b/src/input_common/analog_from_button.cpp @@ -2,6 +2,7 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include <atomic> #include <chrono> #include <cmath> #include <thread> @@ -20,13 +21,16 @@ public: : up(std::move(up_)), down(std::move(down_)), left(std::move(left_)), right(std::move(right_)), modifier(std::move(modifier_)), modifier_scale(modifier_scale_), modifier_angle(modifier_angle_) { + update_thread_running.store(true); update_thread = std::thread(&Analog::UpdateStatus, this); } ~Analog() override { - update_thread_running = false; - if (update_thread.joinable()) { - update_thread.join(); + if (update_thread_running.load()) { + update_thread_running.store(false); + if (update_thread.joinable()) { + update_thread.join(); + } } } @@ -58,7 +62,7 @@ public: } void UpdateStatus() { - while (update_thread_running) { + while (update_thread_running.load()) { const float coef = modifier->GetStatus() ? modifier_scale : 1.0f; bool r = right->GetStatus(); @@ -160,7 +164,7 @@ private: float angle{}; float amplitude{}; std::thread update_thread; - bool update_thread_running{true}; + std::atomic<bool> update_thread_running{}; }; std::unique_ptr<Input::AnalogDevice> AnalogFromButton::Create(const Common::ParamPackage& params) { |