From 6782b2263785bc50ca175cc8afdd7896e7384e5f Mon Sep 17 00:00:00 2001 From: Zion Nimchuk Date: Thu, 2 Nov 2017 18:02:04 -0700 Subject: [PATCH] Make cellMouseGetDataList return CELL_MOUSE_ERROR_NO_DEVICE if mouse handler is set to null --- rpcs3/Emu/Cell/Modules/cellMouse.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/rpcs3/Emu/Cell/Modules/cellMouse.cpp b/rpcs3/Emu/Cell/Modules/cellMouse.cpp index 88baf43eb6..4aaa269035 100644 --- a/rpcs3/Emu/Cell/Modules/cellMouse.cpp +++ b/rpcs3/Emu/Cell/Modules/cellMouse.cpp @@ -74,7 +74,7 @@ s32 cellMouseGetInfo(vm::ptr info) for (u32 i=0; ivendor_id[i] = current_info.vendor_id[i]; for (u32 i=0; iproduct_id[i] = current_info.product_id[i]; for (u32 i=0; istatus[i] = current_info.status[i]; - + return CELL_OK; } @@ -96,7 +96,7 @@ s32 cellMouseInfoTabletMode(u32 port_no, vm::ptr info) info->is_supported = 0; // Unimplemented: (0=Tablet mode is not supported) info->mode = 1; // Unimplemented: (1=Mouse mode) - + return CELL_OK; } @@ -115,7 +115,7 @@ s32 cellMouseGetData(u32 port_no, vm::ptr data) { return CELL_MOUSE_ERROR_NO_DEVICE; } - + MouseData& current_data = handler->GetData(port_no); data->update = current_data.update; data->buttons = current_data.buttons; @@ -134,22 +134,27 @@ s32 cellMouseGetData(u32 port_no, vm::ptr data) s32 cellMouseGetDataList(u32 port_no, vm::ptr data) { - UNIMPLEMENTED_FUNC(sys_io); - - return CELL_OK; + sys_io.todo("cellMouseGetDataList(port_no=%d, data=0x%x", port_no, data); + if (g_cfg.io.mouse == mouse_handler::null) + return CELL_MOUSE_ERROR_NO_DEVICE; + else + { + data->list_num = 0; + return CELL_OK; + } } s32 cellMouseSetTabletMode(u32 port_no, u32 mode) { UNIMPLEMENTED_FUNC(sys_io); - + return CELL_OK; } s32 cellMouseGetTabletDataList(u32 port_no, u32 data_addr) { UNIMPLEMENTED_FUNC(sys_io); - + return CELL_OK; }