From ac603cf1309783ea0647b032c845679784d24227 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 29 Jan 2019 13:09:29 -0500 Subject: hle/ipc_helpers: Allow pushing signed values This is kind of a large hole in the API, given we allow popping signed values. This fixes that. --- src/core/hle/ipc_helpers.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/core/hle') diff --git a/src/core/hle/ipc_helpers.h b/src/core/hle/ipc_helpers.h index 0d6c85aed..eba2f5d02 100644 --- a/src/core/hle/ipc_helpers.h +++ b/src/core/hle/ipc_helpers.h @@ -216,6 +216,11 @@ private: /// Push /// +template <> +inline void ResponseBuilder::Push(s32 value) { + cmdbuf[index++] = static_cast(value); +} + template <> inline void ResponseBuilder::Push(u32 value) { cmdbuf[index++] = value; @@ -234,11 +239,28 @@ inline void ResponseBuilder::Push(ResultCode value) { Push(0); } +template <> +inline void ResponseBuilder::Push(s8 value) { + PushRaw(value); +} + +template <> +inline void ResponseBuilder::Push(s16 value) { + PushRaw(value); +} + +template <> +inline void ResponseBuilder::Push(s64 value) { + Push(static_cast(value)); + Push(static_cast(value >> 32)); +} + template <> inline void ResponseBuilder::Push(u8 value) { PushRaw(value); } + template <> inline void ResponseBuilder::Push(u16 value) { PushRaw(value); -- cgit v1.2.3