|
@@ -232,16 +232,17 @@ static void MapTriggerAxis(Uint64 timestamp, SDL_Joystick *joystick, Uint8 axis,
|
|
|
|
|
|
|
|
static bool UpdateSlotLED(SDL_DriverSwitch2_Context *ctx)
|
|
static bool UpdateSlotLED(SDL_DriverSwitch2_Context *ctx)
|
|
|
{
|
|
{
|
|
|
- unsigned char SET_LED_DATA[] = {
|
|
|
|
|
|
|
+ Uint8 set_led_data[] = {
|
|
|
0x09, 0x91, 0x00, 0x07, 0x00, 0x08, 0x00, 0x00,
|
|
0x09, 0x91, 0x00, 0x07, 0x00, 0x08, 0x00, 0x00,
|
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
|
|
};
|
|
};
|
|
|
- unsigned char reply[8] = {0};
|
|
|
|
|
|
|
+ Uint8 reply[8] = {0};
|
|
|
|
|
+ const Uint8 player_pattern[] = { 0x1, 0x3, 0x7, 0xf, 0x9, 0x5, 0xd, 0x6 };
|
|
|
|
|
|
|
|
if (ctx->player_lights && ctx->player_index >= 0) {
|
|
if (ctx->player_lights && ctx->player_index >= 0) {
|
|
|
- SET_LED_DATA[8] = (1 << (ctx->player_index % 4));
|
|
|
|
|
|
|
+ set_led_data[8] = player_pattern[ctx->player_index % 8];
|
|
|
}
|
|
}
|
|
|
- int res = SendBulkData(ctx, SET_LED_DATA, sizeof(SET_LED_DATA));
|
|
|
|
|
|
|
+ int res = SendBulkData(ctx, set_led_data, sizeof(set_led_data));
|
|
|
if (res < 0) {
|
|
if (res < 0) {
|
|
|
return SDL_SetError("Couldn't set LED data: %d\n", res);
|
|
return SDL_SetError("Couldn't set LED data: %d\n", res);
|
|
|
}
|
|
}
|