LV2/cellPad: Implement priority-based connection updates

This commit is contained in:
Eladash 2023-08-09 11:11:59 +03:00 committed by Elad Ashkenazi
parent a2416bf7f5
commit 4bbe885f35
8 changed files with 226 additions and 68 deletions

View file

@ -6,8 +6,8 @@
#include "Emu/Io/KeyboardHandler.h"
#include "cellKb.h"
extern void libio_sys_config_init();
extern void libio_sys_config_end();
error_code sys_config_start(ppu_thread& ppu);
error_code sys_config_stop(ppu_thread& ppu);
extern bool is_input_allowed();
@ -61,7 +61,7 @@ void KeyboardHandlerBase::save(utils::serial& ar)
ar(inited ? m_info.max_connect : 0);
}
error_code cellKbInit(u32 max_connect)
error_code cellKbInit(ppu_thread& ppu, u32 max_connect)
{
sys_io.warning("cellKbInit(max_connect=%d)", max_connect);
@ -78,13 +78,13 @@ error_code cellKbInit(u32 max_connect)
return CELL_KB_ERROR_INVALID_PARAMETER;
}
libio_sys_config_init();
sys_config_start(ppu);
handler.Init(std::min(max_connect, 7u));
return CELL_OK;
}
error_code cellKbEnd()
error_code cellKbEnd(ppu_thread& ppu)
{
sys_io.notice("cellKbEnd()");
@ -96,7 +96,7 @@ error_code cellKbEnd()
return CELL_KB_ERROR_UNINITIALIZED;
// TODO
libio_sys_config_end();
sys_config_stop(ppu);
return CELL_OK;
}