-
Xinput?
I have the following code and get errors and I dont know why:
Code:
dword_result_t XamInputGetCapabilities(dword_t user_index, dword_t flags, pointer_t<X_INPUT_CAPABILITIES> caps_ptr) {
if (!caps_ptr) {
return X_ERROR_BAD_ARGUMENTS;
return;
}
if ((flags & 0xFF) && (flags & XINPUT_FLAG_GAMEPAD) == 0) {
// Ignore any query for other types of devices.
return X_ERROR_DEVICE_NOT_CONNECTED;
return;
}
if ((user_index & 0xFF) == 0xFF || (flags & XINPUT_FLAG_ANY_USER)) {
// Always pin user to 0.
user_index = 0;
}
auto input_system = kernel_state()->emulator()->input_system();
X_RESULT result = input_system->GetCapabilities(user_index, flags, caps_ptr);
return result;
}
The following errors:
error C2561: 'xe::kernel::xam::XamInputGetCapabilities': func
tion must return a value
error C2678: binary '=': no operator found which takes a left
-hand operand of type 'const xe::kernel::shim::ParamBase<uint32_t>
Now the parameters at this link and I am changing the code from a shim call to dword_result_t
shim_utils.h Source View - Source code download - xenia dword_t I am guessing is wrong for user_index unless I have to do something like user_index.value() = 0;
-
I would simply delete lines 4 and 9, those empty (and unreachable) return statements without a value.
You return values on the return statements on the preceding lines.
Also, why do this?
X_RESULT result = input_system->GetCapabilities(user_index, flags, caps_ptr);
return result;
When you can do this
return input_system->GetCapabilities(user_index, flags, caps_ptr);
-
I have most of it working thanks Salem. However, I still get this error:
c:\users\tom\xenia\src\xenia\kernel\xam\xam_input. cc(67): error C2678: binary '=': no operator found which takes a left
-hand operand of type 'const xe::kernel::shim::ParamBase<uint32_t>' (or there is no acceptable conversion)
This is the defined list and I am guessing I have to do something with user_index.
- using int_t = const shim::ParamBase<int32_t>&;
- using word_t = const shim::ParamBase<uint16_t>&;
- using dword_t = const shim::ParamBase<uint32_t>&;
- using qword_t = const shim::ParamBase<uint64_t>&;
- using float_t = const shim::ParamBase<float>&;
- using double_t = const shim::ParamBase<double>&;
- using lpvoid_t = const shim::PointerParam&;
- using lpword_t = const shim::PrimitivePointerParam<uint16_t>&;
- using lpdword_t = const shim::PrimitivePointerParam<uint32_t>&;
- using lpqword_t = const shim::PrimitivePointerParam<uint64_t>&;
- using lpfloat_t = const shim::PrimitivePointerParam<float>&;
- using lpdouble_t = const shim::PrimitivePointerParam<double>&;
- using lpstring_t = const shim::StringPointerParam<char, std::string>&;
- using lpwstring_t = const shim::StringPointerParam<wchar_t, std::wstring>&;
- using function_t = const shim::ParamBase<uint32_t>&;
- using unknown_t = const shim::ParamBase<uint32_t>&;
- using lpunknown_t = const shim::PointerParam&;
- template <typename T>
- using pointer_t = const shim::TypedPointerParam<T>&;
-
- using int_result_t = shim::Result<int32_t>;
- using dword_result_t = shim::Result<uint32_t>;
- using pointer_result_t = shim::Result<uint32_t>;
-
I am still getting this error and I think need to do something with user_index.
error C2678: binary '=': no operator found which takes a left
-hand operand of type 'const xe::kernel::shim::ParamBase<uint32_t>'
c:\users\tom\xenia\src\xenia\kernel\util\shim_util s.h(145): note: or 'xe::kernel::shim::ParamBase<uint32_t> &xe
::kernel::shim::ParamBase<uint32_t>::operator =(const T &)'
with
[
T=uint32_t
]
c:\users\tom\xenia\src\xenia\kernel\xam\xam_input. cc(67): note: while trying to match the argument list '(const xe::k
ernel::shim::ParamBase<uint32_t>, int)'
Here is the types list I think:
- using int_t = const shim::ParamBase<int32_t>&;
- using word_t = const shim::ParamBase<uint16_t>&;
- using dword_t = const shim::ParamBase<uint32_t>&;
- using qword_t = const shim::ParamBase<uint64_t>&;
- using float_t = const shim::ParamBase<float>&;
- using double_t = const shim::ParamBase<double>&;
- using lpvoid_t = const shim::PointerParam&;
- using lpword_t = const shim::PrimitivePointerParam<uint16_t>&;
- using lpdword_t = const shim::PrimitivePointerParam<uint32_t>&;
- using lpqword_t = const shim::PrimitivePointerParam<uint64_t>&;
- using lpfloat_t = const shim::PrimitivePointerParam<float>&;
- using lpdouble_t = const shim::PrimitivePointerParam<double>&;
- using lpstring_t = const shim::StringPointerParam<char, std::string>&;
- using lpwstring_t = const shim::StringPointerParam<wchar_t, std::wstring>&;
- using function_t = const shim::ParamBase<uint32_t>&;
- using unknown_t = const shim::ParamBase<uint32_t>&;
- using lpunknown_t = const shim::PointerParam&;
- template <typename T>
- using pointer_t = const shim::TypedPointerParam<T>&;
-
- using int_result_t = shim::Result<int32_t>;
- using dword_result_t = shim::Result<uint32_t>;
- using pointer_result_t = shim::Result<uint32_t>;
-
I figured it out. Now I have to figure out the keyboard one.