idz: add ffb and led emulation

This commit is contained in:
2024-09-30 23:10:16 +02:00
parent 2251585ef0
commit 259b763a13
26 changed files with 886 additions and 152 deletions

View File

@ -20,7 +20,7 @@ static uint16_t idz_io_coins;
uint16_t idz_io_get_api_version(void)
{
return 0x0100;
return 0x0102;
}
HRESULT idz_io_jvs_init(void)
@ -123,3 +123,79 @@ void idz_io_jvs_read_coin_counter(uint16_t *out)
*out = idz_io_coins;
}
HRESULT idz_io_led_init(void)
{
return S_OK;
}
void idz_io_led_set_fet_output(const uint8_t *rgb)
{
#if 0
dprintf("IDZ LED: LEFT SEAT LED: %02X\n", rgb[0]);
dprintf("IDZ LED: RIGHT SEAT LED: %02X\n", rgb[1]);
#endif
return;
}
void idz_io_led_gs_update(const uint8_t *rgb)
{
#if 0
for (int i = 0; i < 9; i++) {
dprintf("IDZ LED: LED %d: %02X %02X %02X Speed: %02X\n",
i, rgb[i * 4], rgb[i * 4 + 1], rgb[i * 4 + 2], rgb[i * 4 + 3]);
}
#endif
return;
}
void idz_io_led_set_leds(const uint8_t *rgb)
{
#if 0
dprintf("IDZ LED: START: %02X\n", rgb[0]);
dprintf("IDZ LED: VIEW CHANGE: %02X\n", rgb[1]);
dprintf("IDZ LED: UP: %02X\n", rgb[2]);
dprintf("IDZ LED: DOWN: %02X\n", rgb[3]);
dprintf("IDZ LED: RIGHT: %02X\n", rgb[4]);
dprintf("IDZ LED: LEFT: %02X\n", rgb[5]);
#endif
return;
}
HRESULT idz_io_ffb_init(void)
{
assert(idz_io_backend != NULL);
return idz_io_backend->ffb_init();
}
void idz_io_ffb_toggle(bool active)
{
assert(idz_io_backend != NULL);
idz_io_backend->ffb_toggle(active);
}
void idz_io_ffb_constant_force(uint8_t direction, uint8_t force)
{
assert(idz_io_backend != NULL);
idz_io_backend->ffb_constant_force(direction, force);
}
void idz_io_ffb_rumble(uint8_t period, uint8_t force)
{
assert(idz_io_backend != NULL);
idz_io_backend->ffb_rumble(period, force);
}
void idz_io_ffb_damper(uint8_t force)
{
assert(idz_io_backend != NULL);
idz_io_backend->ffb_damper(force);
}