cellPad: Fix logic error in setPressMode and setSensorMode

This commit is contained in:
Jake 2014-05-20 19:54:08 -05:00
parent 840e9d8ed8
commit 233b179f65

View File

@ -353,9 +353,9 @@ int cellPadInfoSensorMode(u32 port_no)
int cellPadSetPressMode(u32 port_no, u32 mode)
{
sys_io.Log("cellPadSetPressMode(port_no=%d)", port_no);
sys_io.Log("cellPadSetPressMode(port_no=%u, mode=%u)", port_no, mode);
if (!Emu.GetPadManager().IsInited()) return CELL_PAD_ERROR_UNINITIALIZED;
if (mode != 0 || mode != 1) return CELL_PAD_ERROR_INVALID_PARAMETER;
if (mode != 0 && mode != 1) return CELL_PAD_ERROR_INVALID_PARAMETER;
const PadInfo& rinfo = Emu.GetPadManager().GetInfo();
if (port_no >= rinfo.max_connect) return CELL_PAD_ERROR_INVALID_PARAMETER;
if (port_no >= rinfo.now_connect) return CELL_PAD_ERROR_NO_DEVICE;
@ -372,9 +372,9 @@ int cellPadSetPressMode(u32 port_no, u32 mode)
int cellPadSetSensorMode(u32 port_no, u32 mode)
{
sys_io.Log("cellPadSetPressMode(port_no=%d)", port_no);
sys_io.Log("cellPadSetSensorMode(port_no=%u, mode=%u)", port_no, mode);
if (!Emu.GetPadManager().IsInited()) return CELL_PAD_ERROR_UNINITIALIZED;
if (mode != 0 || mode != 1) return CELL_PAD_ERROR_INVALID_PARAMETER;
if (mode != 0 && mode != 1) return CELL_PAD_ERROR_INVALID_PARAMETER;
const PadInfo& rinfo = Emu.GetPadManager().GetInfo();
if (port_no >= rinfo.max_connect) return CELL_PAD_ERROR_INVALID_PARAMETER;
if (port_no >= rinfo.now_connect) return CELL_PAD_ERROR_NO_DEVICE;