diff --git a/src/core/hle/ipc_helpers.h b/src/core/hle/ipc_helpers.h index 01282a69b..8176f0bbb 100644 --- a/src/core/hle/ipc_helpers.h +++ b/src/core/hle/ipc_helpers.h @@ -141,6 +141,20 @@ inline void RequestBuilder::Push(u64 value) { Push(static_cast(value >> 32)); } +template <> +inline void RequestBuilder::Push(f32 value) { + u32 integral; + std::memcpy(&integral, &value, sizeof(u32)); + Push(integral); +} + +template <> +inline void RequestBuilder::Push(f64 value) { + u64 integral; + std::memcpy(&integral, &value, sizeof(u64)); + Push(integral); +} + template <> inline void RequestBuilder::Push(bool value) { Push(static_cast(value)); @@ -341,6 +355,22 @@ inline s32 RequestParser::Pop() { return data; } +template <> +inline f32 RequestParser::Pop() { + const u32 value = Pop(); + float real; + std::memcpy(&real, &value, sizeof(real)); + return real; +} + +template <> +inline f64 RequestParser::Pop() { + const u64 value = Pop(); + f64 real; + std::memcpy(&real, &value, sizeof(real)); + return real; +} + template <> inline bool RequestParser::Pop() { return Pop() != 0; diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp index ad63ab7a2..667ee12c4 100644 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp @@ -331,7 +331,7 @@ void Module::Interface::GetGyroscopeLowRawToDpsCoefficient(Kernel::HLERequestCon IPC::RequestBuilder rb = rp.MakeBuilder(2, 0); rb.Push(RESULT_SUCCESS); - rb.PushRaw(gyroscope_coef); + rb.Push(gyroscope_coef); } void Module::Interface::GetGyroscopeLowCalibrateParam(Kernel::HLERequestContext& ctx) {