From f77e9f8bc1e1c2ad42ebe867163249819ee6dbd6 Mon Sep 17 00:00:00 2001 From: Jake Date: Fri, 2 Jun 2017 21:42:34 -0500 Subject: [PATCH] kb/mouse: fix max in init --- rpcs3/Emu/Cell/Modules/cellKb.cpp | 5 +---- rpcs3/Emu/Cell/Modules/cellMouse.cpp | 7 +------ 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/rpcs3/Emu/Cell/Modules/cellKb.cpp b/rpcs3/Emu/Cell/Modules/cellKb.cpp index 98713c7893..0112070fb4 100644 --- a/rpcs3/Emu/Cell/Modules/cellKb.cpp +++ b/rpcs3/Emu/Cell/Modules/cellKb.cpp @@ -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(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; } diff --git a/rpcs3/Emu/Cell/Modules/cellMouse.cpp b/rpcs3/Emu/Cell/Modules/cellMouse.cpp index 2b97b40be8..88baf43eb6 100644 --- a/rpcs3/Emu/Cell/Modules/cellMouse.cpp +++ b/rpcs3/Emu/Cell/Modules/cellMouse.cpp @@ -12,11 +12,6 @@ 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(Emu.GetCallbacks().get_mouse_handler); if (!handler) @@ -24,7 +19,7 @@ s32 cellMouseInit(u32 max_connect) return CELL_MOUSE_ERROR_ALREADY_INITIALIZED; } - handler->Init(max_connect); + handler->Init(std::min(max_connect, 7u)); return CELL_OK; }