cellPad: Fix logic error in setPressMode and setSensorMode
This commit is contained in:
@@ -353,9 +353,9 @@ int cellPadInfoSensorMode(u32 port_no)
|
|||||||
|
|
||||||
int cellPadSetPressMode(u32 port_no, u32 mode)
|
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 (!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();
|
const PadInfo& rinfo = Emu.GetPadManager().GetInfo();
|
||||||
if (port_no >= rinfo.max_connect) return CELL_PAD_ERROR_INVALID_PARAMETER;
|
if (port_no >= rinfo.max_connect) return CELL_PAD_ERROR_INVALID_PARAMETER;
|
||||||
if (port_no >= rinfo.now_connect) return CELL_PAD_ERROR_NO_DEVICE;
|
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)
|
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 (!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();
|
const PadInfo& rinfo = Emu.GetPadManager().GetInfo();
|
||||||
if (port_no >= rinfo.max_connect) return CELL_PAD_ERROR_INVALID_PARAMETER;
|
if (port_no >= rinfo.max_connect) return CELL_PAD_ERROR_INVALID_PARAMETER;
|
||||||
if (port_no >= rinfo.now_connect) return CELL_PAD_ERROR_NO_DEVICE;
|
if (port_no >= rinfo.now_connect) return CELL_PAD_ERROR_NO_DEVICE;
|
||||||
|
|||||||
Reference in New Issue
Block a user