Fix XInput query.
This commit is contained in:
parent
9b02cfb560
commit
21efe58254
|
@ -66,18 +66,17 @@ SHIM_CALL XamInputGetState_shim(
|
||||||
user_index,
|
user_index,
|
||||||
state_ptr);
|
state_ptr);
|
||||||
|
|
||||||
if (!state_ptr) {
|
// Games call this with a NULL state ptr, probably as a query.
|
||||||
SHIM_SET_RETURN(X_ERROR_BAD_ARGUMENTS);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
InputSystem* input_system = state->emulator()->input_system();
|
InputSystem* input_system = state->emulator()->input_system();
|
||||||
|
|
||||||
X_INPUT_STATE input_state;
|
X_INPUT_STATE input_state;
|
||||||
X_RESULT result = input_system->GetState(user_index, input_state);
|
X_RESULT result = input_system->GetState(user_index, input_state);
|
||||||
if (XSUCCEEDED(result)) {
|
if (XSUCCEEDED(result)) {
|
||||||
|
if (state_ptr) {
|
||||||
input_state.Write(SHIM_MEM_BASE, state_ptr);
|
input_state.Write(SHIM_MEM_BASE, state_ptr);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
SHIM_SET_RETURN(result);
|
SHIM_SET_RETURN(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue