+ vol btns, / test and service remap, - gfx hook

This commit is contained in:
Hay1tsme
2022-01-08 02:25:42 -05:00
parent 0d3e93ce82
commit 1fa485143c
14 changed files with 120 additions and 62 deletions

View File

@ -34,6 +34,7 @@ HRESULT mercury_io4_hook_init(const struct io4_config *cfg)
static HRESULT mercury_io4_poll(void *ctx, struct io4_state *state)
{
uint8_t opbtn;
uint8_t gamebtn;
HRESULT hr;
assert(mercury_dll.poll != NULL);
@ -49,8 +50,10 @@ static HRESULT mercury_io4_poll(void *ctx, struct io4_state *state)
}
opbtn = 0;
gamebtn = 0;
mercury_dll.get_opbtns(&opbtn);
mercury_dll.get_gamebtns(&gamebtn);
if (opbtn & MERCURY_IO_OPBTN_TEST) {
state->buttons[0] |= IO4_BUTTON_TEST;
@ -60,5 +63,13 @@ static HRESULT mercury_io4_poll(void *ctx, struct io4_state *state)
state->buttons[0] |= IO4_BUTTON_SERVICE;
}
if (gamebtn & MERCURY_IO_GAMEBTN_VOL_UP) {
state->buttons[0] |= 1 << 1;
}
if (gamebtn & MERCURY_IO_GAMEBTN_VOL_DOWN) {
state->buttons[0] |= 1 << 0;
}
return S_OK;
}