Fix cellKb

This commit is contained in:
Nekotekina 2017-10-01 04:00:56 +03:00
parent e5f756205c
commit 45a855ef1f

View File

@ -177,6 +177,9 @@ error_code cellKbSetCodeType(u32 port_no, u32 type)
if (!handler) if (!handler)
return CELL_KB_ERROR_UNINITIALIZED; return CELL_KB_ERROR_UNINITIALIZED;
if (port_no >= handler->GetKeyboards().size())
return CELL_KB_ERROR_INVALID_PARAMETER;
KbConfig& current_config = handler->GetConfig(port_no); KbConfig& current_config = handler->GetConfig(port_no);
current_config.code_type = type; current_config.code_type = type;
@ -197,6 +200,9 @@ error_code cellKbSetReadMode(u32 port_no, u32 rmode)
if (!handler) if (!handler)
return CELL_KB_ERROR_UNINITIALIZED; return CELL_KB_ERROR_UNINITIALIZED;
if (port_no >= handler->GetKeyboards().size())
return CELL_KB_ERROR_INVALID_PARAMETER;
KbConfig& current_config = handler->GetConfig(port_no); KbConfig& current_config = handler->GetConfig(port_no);
current_config.read_mode = rmode; current_config.read_mode = rmode;
@ -213,6 +219,9 @@ error_code cellKbGetConfiguration(u32 port_no, vm::ptr<CellKbConfig> config)
if (!handler) if (!handler)
return CELL_KB_ERROR_UNINITIALIZED; return CELL_KB_ERROR_UNINITIALIZED;
if (port_no >= handler->GetKeyboards().size())
return CELL_KB_ERROR_INVALID_PARAMETER;
const KbConfig& current_config = handler->GetConfig(port_no); const KbConfig& current_config = handler->GetConfig(port_no);
config->arrange = current_config.arrange; config->arrange = current_config.arrange;
config->read_mode = current_config.read_mode; config->read_mode = current_config.read_mode;