diff --git a/src/core/hle/ipc_helpers.h b/src/core/hle/ipc_helpers.h index a1e4be070..68406eb63 100644 --- a/src/core/hle/ipc_helpers.h +++ b/src/core/hle/ipc_helpers.h @@ -274,6 +274,20 @@ inline void ResponseBuilder::Push(u64 value) { Push(static_cast(value >> 32)); } +template <> +inline void ResponseBuilder::Push(float value) { + u32 integral; + std::memcpy(&integral, &value, sizeof(u32)); + Push(integral); +} + +template <> +inline void ResponseBuilder::Push(double value) { + u64 integral; + std::memcpy(&integral, &value, sizeof(u64)); + Push(integral); +} + template <> inline void ResponseBuilder::Push(bool value) { Push(static_cast(value)); @@ -415,6 +429,22 @@ inline s64 RequestParser::Pop() { return static_cast(Pop()); } +template <> +inline float RequestParser::Pop() { + const u32 value = Pop(); + float real; + std::memcpy(&real, &value, sizeof(real)); + return real; +} + +template <> +inline double RequestParser::Pop() { + const u64 value = Pop(); + float real; + std::memcpy(&real, &value, sizeof(real)); + return real; +} + template <> inline bool RequestParser::Pop() { return Pop() != 0;