diff --git a/rpcs3/Emu/Memory/vm_ptr.h b/rpcs3/Emu/Memory/vm_ptr.h index 693bc5d183..b62d78f61d 100644 --- a/rpcs3/Emu/Memory/vm_ptr.h +++ b/rpcs3/Emu/Memory/vm_ptr.h @@ -270,6 +270,10 @@ namespace vm { AT m_addr; + static_assert(!std::is_floating_point::value, "TODO: Unsupported callback result type (floating point)"); + + static_assert(!std::is_pointer::value, "Invalid callback result type (pointer)"); + __forceinline RT call_func(bool is_async) const { Callback cb; @@ -312,60 +316,27 @@ namespace vm } }; - namespace ps3 - { - template struct ptr; - } - template class _ptr_base { AT m_addr; + static_assert(!std::is_floating_point::value, "TODO: Unsupported callback result type (floating point)"); + + static_assert(!std::is_pointer::value, "Invalid callback result type (pointer)"); + template struct _func_arg { + static_assert(!std::is_floating_point::value, "TODO: Unsupported callback argument type (floating point)"); + + static_assert(!std::is_pointer::value, "Invalid callback argument type (pointer)"); + __forceinline static u64 get_value(const TT& arg) { - return arg; - } - }; - - template - struct _func_arg<_ptr_base> - { - __forceinline static u64 get_value(const _ptr_base& arg) - { - return arg.addr(); - } - }; - - template - struct _func_arg> - { - __forceinline static u64 get_value(const ps3::ptr& arg) - { - return arg.addr(); - } - }; - - template - struct _func_arg<_ref_base> - { - __forceinline static u64 get_value(const _ref_base& arg) - { - return arg.addr(); - } - }; - - template - struct _func_arg> - { - static_assert(!i, "Invalid callback argument type (mem_ptr_t), use vm::ptr"); - - __forceinline static u64 get_value(const mem_ptr_t& arg) - { - return 0; + u64 res = 0; + (TT&)res = arg; + return res; } }; diff --git a/rpcs3/Emu/SysCalls/SC_FUNC.h b/rpcs3/Emu/SysCalls/SC_FUNC.h index 5b6b596234..72fd52e847 100644 --- a/rpcs3/Emu/SysCalls/SC_FUNC.h +++ b/rpcs3/Emu/SysCalls/SC_FUNC.h @@ -74,7 +74,7 @@ namespace detail static_assert(!std::is_pointer::value, "Invalid function result type: pointer"); if (std::is_floating_point::value) { - (T&)CPU.FPR[1] = value; + CPU.FPR[1] = (double)value; } else {