idac: add ffb emulation

This commit is contained in:
2024-09-30 18:50:46 +02:00
parent 53fb8c28ea
commit c06bb408e7
26 changed files with 930 additions and 149 deletions

View File

@ -19,7 +19,7 @@ static bool idac_io_coin;
uint16_t idac_io_get_api_version(void)
{
return 0x0101;
return 0x0102;
}
HRESULT idac_io_init(void)
@ -62,6 +62,8 @@ void idac_io_get_opbtns(uint8_t *opbtn_out)
opbtn = 0;
/* Common operator buttons, not backend-specific */
if (GetAsyncKeyState(idac_io_cfg.vk_test) & 0x8000) {
opbtn |= IDAC_IO_OPBTN_TEST;
}
@ -159,3 +161,38 @@ void idac_io_led_set_leds(const uint8_t *rgb)
return;
}
HRESULT idac_io_ffb_init(void)
{
assert(idac_io_backend != NULL);
return idac_io_backend->ffb_init();
}
void idac_io_ffb_toggle(bool active)
{
assert(idac_io_backend != NULL);
idac_io_backend->ffb_toggle(active);
}
void idac_io_ffb_constant_force(uint8_t direction, uint8_t force)
{
assert(idac_io_backend != NULL);
idac_io_backend->ffb_constant_force(direction, force);
}
void idac_io_ffb_rumble(uint8_t period, uint8_t force)
{
assert(idac_io_backend != NULL);
idac_io_backend->ffb_rumble(period, force);
}
void idac_io_ffb_damper(uint8_t force)
{
assert(idac_io_backend != NULL);
idac_io_backend->ffb_damper(force);
}