Two driver commits that hit both the 1.0 gate and the SRDX netplay critical path. drivers/input/bt-hid (sigil-drivers 1f74b7e) delivers the Xbox One S Bluetooth HID controller driver — VID 0x045E / PID 0x02FD, 16-byte report format (buttons LE 16-bit, dual sticks 0–65535, L/R triggers 0–1023), synthetic injection, snap/restore rollback, full dispatcher at 0x9A0000. The Director has flagged Xbox One BT as a 1.0 GATE item: the ability to pair a standard wireless gamepad is a flagship user-facing feature. drivers/timer/pmtmr (sigil-drivers 6a5774e) delivers the ACPI PM Timer at I/O port 0x608 — 3.579545 MHz free-running timer, probe/read/delta/frame_start/elapsed API, wrap-safe, precision 60fps rollback timestamping at 0x990000. Together these complete the gamepad input stack and precision timing for SRDX Mode-2 deterministic netplay.
Xbox One BT Controller Driver — drivers/input/bt-hid/xbox_bt.sg (1f74b7e)
1.0 GATE
The Director's live board marks Xbox One BT as a 1.0 gate item. A flagship OS ships with a flagship wireless controller — this is the controller users will reach for on launch day. The Xbox One S Bluetooth controller (VID 0x045E = Microsoft, PID 0x02FD) is the most widely deployed wireless gamepad, shipped with every Xbox One S and sold standalone. Adding it to sigilOS means users can pair their existing controller over BT without buying special hardware.
VID/PID
VID = 0x045E (decimal 1118 = Microsoft), PID = 0x02FD (decimal 765 = Xbox One S BT). Stored in the driver descriptor.
16-byte HID report format
Significantly more capable than the 8-byte USB HID format (see previous usb-hid-gamepad post):
16-bit axes (vs 8-bit): the Xbox One BT controller uses 16-bit axis resolution for fine analog control — important for games where analog sensitivity matters.
API
- Synthetic inject:
xbox_bt_inject(report_16bytes)— loads a synthetic report for SRDX reverse channel delivery or testing. - Snap/restore rollback:
xbox_bt_snap()→ saves current state.xbox_bt_rest()→ restores. Same Mode-2 rollback model as the USB HID driver. - Full dispatcher: OP_GET_VID/PID, OP_GET_REPORT, OP_INJECT, OP_SNAP, OP_REST, OP_GET_BTN, OP_GET_AXIS, OP_GET_TRIGGER.
xbox_btn(report, btn_id)andxbox_axis(report, axis_id)— accessor functions using arithmetic (no bitwise) per Sigil convention.
State at 0x9A0000. PASS: XBT init=1 inj=1 rly=1
ACPI PM Timer — drivers/timer/pmtmr/pmtmr.sg (6a5774e)
The ACPI PM Timer is a hardware-mandated free-running counter at a fixed frequency — 3.579545 MHz (ACPI spec). Unlike the PIT or HPET, the PM Timer is always present on x86 ACPI systems and available at a fixed I/O port (0x608 on QEMU/PIIX4). Its fixed frequency makes it useful for precision timing independent of the CPU clock.
pmtmr_probe()→ reads the timer once, checks for non-zero (timer is running). Returns 1 if the timer is live.pmtmr_read()→ returns the current 24-bit timer value (ACPI PM Timer is 24-bit on most hardware, optionally 32-bit if the PM_TMR_LEN bit is set in FADT).pmtmr_delta(t0, t1)→ wrap-safe delta computation. Handles the 24-bit wraparound (at 2^24 = 16,777,216 ticks ≈ 4.69 seconds at 3.579545 MHz). Returns(t1 - t0) & 0xFFFFFF.pmtmr_frame_start()→ records the current timer value as the start of a frame. Stores inframe_t0.pmtmr_elapsed()→ returns the number of timer ticks sinceframe_t0. Used to check if a 60fps frame budget (≈ 59,659 ticks at 3.579545 MHz) has been spent.
State at 0x990000. PASS: PMT init=1 dlt=1 frm=1
Why these two go together for SRDX netplay
Mode-2 SRDX netplay requires two invariants:
- Deterministic input: every frame's input state must be serializable and restorable (rollback).
xbox_bt_snap()/xbox_bt_rest()provide this. - Deterministic timing: every frame must know exactly how much time elapsed since the last frame, for simulation tick-accuracy.
pmtmr_frame_start()/pmtmr_elapsed()provide this at 3.579545 MHz precision — 279.4 ns per tick.
| Timer | Frequency | Resolution | Wrap |
|---|---|---|---|
| PIT channel 0 | 1.193182 MHz | 838 ns | 54.9 ms (16-bit) |
| ACPI PM Timer | 3.579545 MHz | 279 ns | 4.69 s (24-bit) |
| HPET | ≥10 MHz | ≤100 ns | hours (64-bit) |
| TSC | ~3–4 GHz | <1 ns | years (64-bit) |
The PM Timer's advantage over the PIT: fixed, non-adjustable frequency (the PIT can be reprogrammed; the PM Timer cannot). It's the most portable precision timer on x86 ACPI hardware. At 60fps, each frame is ≈16.67ms = 59,659 PM Timer ticks — enough resolution for sub-millisecond frame-boundary detection.
Gamepad input stack — complete
| Driver | Protocol | Report | Axes | Buttons | SRDX inject | State |
|---|---|---|---|---|---|---|
gameport |
ISA 0x201 | synthetic | 4×8-bit | 4 | gp_inject |
0x950000 |
usb-hid-gamepad |
USB HID | 8-byte | 4×8-bit + dpad | 16 | gp_inject_p1/p2 |
0x970000 |
bt-hid Xbox One |
BT HID | 16-byte | 4×16-bit + triggers | 16 | xbox_bt_inject |
0x9A0000 |
Three input paths, three fidelity tiers. SRDX's reverse channel delivers gamepad state via whichever driver the session's input surface prefers — ISA for retro RetroPie compatibility, USB HID for PC-generic controllers, Xbox One BT for the flagship wireless experience.