diff --git a/crates/horizon-dualsense/src/lib.rs b/crates/horizon-dualsense/src/lib.rs index 2027b4584..438d8f6fe 100644 --- a/crates/horizon-dualsense/src/lib.rs +++ b/crates/horizon-dualsense/src/lib.rs @@ -346,6 +346,15 @@ mod tests { assert_ne!(out.bluetooth(Vibration::V2, 1)[74..], r[74..]); } + #[test] + fn host_defaults() { + // hid-playstation.c: player 1 is BIT(2) ("--x--"), as SDL's first pattern 0x04; the + // blue it gives a pad; SDL's 0x20 switches LEDs without fading. + assert_eq!(PLAYER_1, 0x04); + assert_eq!(DEFAULT_LIGHTBAR, [0, 0, 128]); + assert_eq!(PLAYER_LEDS_INSTANT, 0x20); + } + #[test] fn dualsense_ids() { assert!(is_dualsense(0x054c, 0x0ce6)); diff --git a/docs/controllers.md b/docs/controllers.md index ec0015790..4e3d82a75 100644 --- a/docs/controllers.md +++ b/docs/controllers.md @@ -446,7 +446,12 @@ Nether, violet in the End. Both at half brightness (the pad's full light is glaring); menus keep the last colour. The player LEDs show player 1 (the middle LED). Off leaves both to the pad. When Horizon lets go of the pad, a lightbar or LEDs it changed go back to a host's defaults: blue (0, 0, 128) -and the middle LED, as Linux's driver gives a first pad. +and the middle LED, as Linux's driver gives a first pad (neither SDL nor +the kernel resets anything when it lets go; Horizon does, so the pad never +keeps a game's colour or a stiff trigger). The microphone's mute LED is +never touched (flags 1, bit 0 stays clear): whatever the system set +stays. Over Bluetooth the colour waits for the pad's connection +animation (see "DualSense output"). Verified against the references only. Byte layout from public references, read for facts; no code is copied from them (the kernel and dualsensectl are GPL):