Skip to content

Commit

Permalink
kb/mouse: fix max in init
Browse files Browse the repository at this point in the history
  • Loading branch information
jarveson authored and Nekotekina committed Jun 21, 2017
1 parent 9cc52c7 commit f77e9f8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
5 changes: 1 addition & 4 deletions rpcs3/Emu/Cell/Modules/cellKb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,12 @@ error_code cellKbInit(u32 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);

if (!handler)
return CELL_KB_ERROR_ALREADY_INITIALIZED;

handler->Init(max_connect);
handler->Init(std::min(max_connect, 7u));

return CELL_OK;
}
Expand Down
7 changes: 1 addition & 6 deletions rpcs3/Emu/Cell/Modules/cellMouse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,14 @@ s32 cellMouseInit(u32 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);

if (!handler)
{
return CELL_MOUSE_ERROR_ALREADY_INITIALIZED;
}

handler->Init(max_connect);
handler->Init(std::min(max_connect, 7u));
return CELL_OK;
}

Expand Down

0 comments on commit f77e9f8

Please sign in to comment.