mirror of https://github.com/RPCS3/rpcs3.git
kb/mouse: fix max in init
This commit is contained in:
parent
9cc52c75e3
commit
f77e9f8bc1
|
@ -35,15 +35,12 @@ error_code cellKbInit(u32 max_connect)
|
||||||
{
|
{
|
||||||
sys_io.warning("cellKbInit(max_connect=%d)", max_connect);
|
sys_io.warning("cellKbInit(max_connect=%d)", max_connect);
|
||||||
|
|
||||||
if (max_connect > 7)
|
|
||||||
return CELL_KB_ERROR_INVALID_PARAMETER;
|
|
||||||
|
|
||||||
const auto handler = fxm::import<KeyboardHandlerBase>(Emu.GetCallbacks().get_kb_handler);
|
const auto handler = fxm::import<KeyboardHandlerBase>(Emu.GetCallbacks().get_kb_handler);
|
||||||
|
|
||||||
if (!handler)
|
if (!handler)
|
||||||
return CELL_KB_ERROR_ALREADY_INITIALIZED;
|
return CELL_KB_ERROR_ALREADY_INITIALIZED;
|
||||||
|
|
||||||
handler->Init(max_connect);
|
handler->Init(std::min(max_connect, 7u));
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,11 +12,6 @@ s32 cellMouseInit(u32 max_connect)
|
||||||
{
|
{
|
||||||
sys_io.warning("cellMouseInit(max_connect=%d)", max_connect);
|
sys_io.warning("cellMouseInit(max_connect=%d)", max_connect);
|
||||||
|
|
||||||
if (max_connect > 7)
|
|
||||||
{
|
|
||||||
return CELL_MOUSE_ERROR_INVALID_PARAMETER;
|
|
||||||
}
|
|
||||||
|
|
||||||
const auto handler = fxm::import<MouseHandlerBase>(Emu.GetCallbacks().get_mouse_handler);
|
const auto handler = fxm::import<MouseHandlerBase>(Emu.GetCallbacks().get_mouse_handler);
|
||||||
|
|
||||||
if (!handler)
|
if (!handler)
|
||||||
|
@ -24,7 +19,7 @@ s32 cellMouseInit(u32 max_connect)
|
||||||
return CELL_MOUSE_ERROR_ALREADY_INITIALIZED;
|
return CELL_MOUSE_ERROR_ALREADY_INITIALIZED;
|
||||||
}
|
}
|
||||||
|
|
||||||
handler->Init(max_connect);
|
handler->Init(std::min(max_connect, 7u));
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue