int cellMouseInfoTabletMode(u32 port_no, mem_class_t info) { sys_io.Log("cellMouseInfoTabletMode(port_no=%d,info_addr=0x%x)", port_no, info.GetAddr()); if(!Emu.GetMouseManager().IsInited()) return CELL_MOUSE_ERROR_UNINITIALIZED; if(port_no >= Emu.GetMouseManager().GetMice().size()) return CELL_MOUSE_ERROR_INVALID_PARAMETER; info += 0; // Unimplemented: (0=Tablet mode is not supported) info += 1; // Unimplemented: (1=Mouse mode) return CELL_OK; }
int cellKbGetConfiguration(u32 port_no, mem_class_t config) { sys_io.Log("cellKbGetConfiguration(port_no=%d,config_addr=0x%x)", port_no, config.GetAddr()); if(!Emu.GetKeyboardManager().IsInited()) return CELL_KB_ERROR_UNINITIALIZED; const CellKbConfig& current_config = Emu.GetKeyboardManager().GetConfig(port_no); config += current_config.arrange; config += current_config.read_mode; config += current_config.code_type; return CELL_OK; }
int cellMouseGetInfo(mem_class_t info) { sys_io.Log("cellMouseGetInfo(info_addr=0x%x)", info.GetAddr()); if(!Emu.GetMouseManager().IsInited()) return CELL_MOUSE_ERROR_UNINITIALIZED; const MouseInfo& current_info = Emu.GetMouseManager().GetInfo(); info += current_info.max_connect; info += current_info.now_connect; info += current_info.info; for(u32 i=0; i<CELL_MAX_MICE; i++) info += current_info.vendor_id[i]; for(u32 i=0; i<CELL_MAX_MICE; i++) info += current_info.product_id[i]; for(u32 i=0; i<CELL_MAX_MICE; i++) info += current_info.status[i]; return CELL_OK; }
int cellKbGetInfo(mem_class_t info) { sys_io.Log("cellKbGetInfo(info_addr=0x%x)", info.GetAddr()); if(!Emu.GetKeyboardManager().IsInited()) return CELL_KB_ERROR_UNINITIALIZED; const KbInfo& current_info = Emu.GetKeyboardManager().GetInfo(); info += current_info.max_connect; info += current_info.now_connect; info += current_info.info; for(u32 i=0; i<CELL_KB_MAX_KEYBOARDS; i++) { info += current_info.status[i]; } return CELL_OK; }
int cellMouseGetData(u32 port_no, mem_class_t data) { sys_io.Log("cellMouseGetData(port_no=%d,data_addr=0x%x)", port_no, data.GetAddr()); if(!Emu.GetMouseManager().IsInited()) return CELL_MOUSE_ERROR_UNINITIALIZED; if(port_no >= Emu.GetMouseManager().GetMice().size()) return CELL_MOUSE_ERROR_NO_DEVICE; CellMouseData& current_data = Emu.GetMouseManager().GetData(port_no); data += current_data.update; data += current_data.buttons; data += current_data.x_axis; data += current_data.y_axis; data += current_data.wheel; data += current_data.tilt; current_data.update = CELL_MOUSE_DATA_NON; current_data.x_axis = 0; current_data.y_axis = 0; current_data.wheel = 0; return CELL_OK; }
int cellKbRead(u32 port_no, mem_class_t data) { sys_io.Log("cellKbRead(port_no=%d,info_addr=0x%x)", port_no, data.GetAddr()); const Array<Keyboard>& keyboards = Emu.GetKeyboardManager().GetKeyboards(); if(!Emu.GetKeyboardManager().IsInited()) return CELL_KB_ERROR_UNINITIALIZED; if(port_no >= keyboards.GetCount()) return CELL_KB_ERROR_INVALID_PARAMETER; CellKbData& current_data = Emu.GetKeyboardManager().GetData(port_no); data += current_data.led; data += current_data.mkey; data += min((u32)current_data.len, CELL_KB_MAX_KEYCODES); for(s32 i=0; i<current_data.len; i++) { data += current_data.keycode[i]; } current_data.len = 0; return CELL_OK; }