summaryrefslogtreecommitdiffstats
path: root/src/core/hle/ipc_helpers.h
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2019-03-16 19:05:01 +0100
committerLioncash <mathew1800@gmail.com>2019-03-16 19:05:03 +0100
commit64444ff48178835b554c1b5d86b70ce2f7d82553 (patch)
tree37d5bc7dc9ab93cb4763bb6105a983b53f2fe2e1 /src/core/hle/ipc_helpers.h
parentMerge pull request #2241 from lioncash/compile-flags (diff)
downloadyuzu-64444ff48178835b554c1b5d86b70ce2f7d82553.tar
yuzu-64444ff48178835b554c1b5d86b70ce2f7d82553.tar.gz
yuzu-64444ff48178835b554c1b5d86b70ce2f7d82553.tar.bz2
yuzu-64444ff48178835b554c1b5d86b70ce2f7d82553.tar.lz
yuzu-64444ff48178835b554c1b5d86b70ce2f7d82553.tar.xz
yuzu-64444ff48178835b554c1b5d86b70ce2f7d82553.tar.zst
yuzu-64444ff48178835b554c1b5d86b70ce2f7d82553.zip
Diffstat (limited to 'src/core/hle/ipc_helpers.h')
-rw-r--r--src/core/hle/ipc_helpers.h30
1 files changed, 30 insertions, 0 deletions
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
@@ -275,6 +275,20 @@ inline void ResponseBuilder::Push(u64 value) {
}
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<u8>(value));
}
@@ -416,6 +430,22 @@ inline s64 RequestParser::Pop() {
}
template <>
+inline float RequestParser::Pop() {
+ const u32 value = Pop<u32>();
+ float real;
+ std::memcpy(&real, &value, sizeof(real));
+ return real;
+}
+
+template <>
+inline double RequestParser::Pop() {
+ const u64 value = Pop<u64>();
+ float real;
+ std::memcpy(&real, &value, sizeof(real));
+ return real;
+}
+
+template <>
inline bool RequestParser::Pop() {
return Pop<u8>() != 0;
}