← Blog
RETROPIE · DRIVERS · 0.6.0

DualShock 4 BT Driver + ROM Library CRC32 Scanner + Two-Level Browser — Player Experience Complete

June 22, 2026 · sigil-drivers · sigil-retropie · Sigil-Docs
retropie gaming drivers input 0.6.0

Two "player experience" commits round out the 0.6.0 feature set for the RetroPie fleet. drivers/input/bt-hid/ds4_bt.sg (sigil-drivers 183a71f) adds the Sony DualShock 4 Bluetooth HID driver — both DS4 v1 (054C:05C4) and v2 (054C:09CC), 77-byte HID report 0x11, full button/axis/D-pad/touchpad surface, synthetic inject + snap/restore rollback, 21 checks PASS. tools/rom_scan.py + ui/library_scene.sg (sigil-retropie 960b9bd) deliver the ROM library: a MAME/No-Intro CRC32 scanner that identifies and verifies ROMs against official dat files, generates a compile-time Sigil catalog (lib/rom_catalog_gen.sg), and drives a two-level launcher UI (4×5 card grid, L1/R1 system navigation, year/publisher/verified badge).

sigilOS RetroPie launcher — ROM browser card grid
sigilOS RetroPie launcher — the ROM browser card grid navigates 73 systems and their libraries

DualShock 4 BT driver (183a71f — sigil-drivers)

Sony DualShock 4 is the most-used controller for PlayStation-era RetroPie titles (PS1, PS2, and PS4 games). The BT HID driver covers both hardware revisions.

VID/PID: DS4 v1: 054C:05C4 (Sony, first-gen, shipped with PS4 launch units 2013–2016); DS4 v2: 054C:09CC (Sony, revised hardware 2016+, adds rumble/touchpad improvements). Both are covered by the same driver.

77-byte HID input report (report ID 0x11)

The DS4 BT report is significantly larger than the Xbox One BT 16-byte report. The extra bytes carry touchpad coordinates, gyroscope/accelerometer data, battery level, and extended button states.

Byte 0
Report ID (0x11)
Byte 1
Left stick X (0–255, center=128)
Byte 2
Left stick Y (inverted: 0=up)
Byte 3
Right stick X
Byte 4
Right stick Y
Byte 5
D-pad hat (lower nibble, 0=N/1=NE/…/7=NW/8=center) + Triangle/Circle/Cross/Square buttons (upper nibble)
Byte 6
L1/R1/L2/R2/Share/Options/L3/R3
Byte 7
PS button + Touchpad click
Bytes 8–9
L2 trigger value (0–255, redundant analog in BT mode)
Bytes 10–11
R2 trigger value
Bytes 33–36
Gyroscope (X/Y as Int16)
Bytes 37–40
Accelerometer
Byte 44
Battery level (low nibble = 0–10, upper nibble = cable status)

Synthetic inject and snap/restore

21 checks PASS: VID/PID both revisions, each button individually, all 4 axes, triggers, touchpad click, PS button, hat switch all directions, battery level read, rollback restore. State at 0x9C0000. PASS: DS4 init=1 inj=1 rly=1.


ROM library CRC32 scanner (960b9bd — sigil-retropie)

A RetroPie is only as useful as its ROM library. tools/rom_scan.py is a host-side Python scanner (thin host tooling — same exception class as dpost.py) that walks /roms/<system>/ and identifies ROMs against official dat catalogs.

Two dat formats

Output: lib/rom_catalog_gen.sg

A Sigil source file compiled into the sigilOS image — zero runtime file I/O needed to display the library. Functions:

rom_count()
Total ROMs across all systems
rom_title(i)
Display title — dat-matched name or filename fallback
rom_path(i)
Absolute ROM path on the RetroPie filesystem
rom_system_id(i)
System index (maps to the 73-system catalog)
rom_year(i) / rom_publisher(i)
Release year and publisher (from dat metadata where available)
rom_crc32(i) / rom_verified(i)
CRC32 hex string; verified=1 if CRC matched an official dat entry
rom_system_start(sys_id) / rom_system_count(sys_id)
ROM index range for a given system
rom_for_system(sys_id, local_idx)
Global ROM index from system-local index

The scanner also writes docs/rom_library.json — a human-readable JSON index for debugging and web display.


Two-level ROM browser (960b9bd — sigil-retropie)

ui/library_scene.sg + updated ui/launcher_app.sg deliver a two-level launcher: pick a system, then browse its ROMs in a card grid.

Level 0 — system browser (launcher_app.sg)

The existing system browser lists 73 systems in a scrollable list. Updated in this commit to wire EV_SELECT into Level 1: selecting a system opens its ROM library.

Level 1 — ROM browser (library_scene.sg)

A 4×5 card grid (4 columns, 5 rows = 20 ROMs per page, paginated). Each card shows the ROM title (from catalog or filename fallback), system name, and year.

API: lib_scene(sys, sel) (render the grid for system sys, selected index sel), lib_nav(ev) (handle input events), lib_next_system() / lib_prev_system().


BT gamepad stack — now three controllers

With the DS4 driver shipping, the sigilOS wireless gamepad stack covers the two dominant controllers. All three drivers implement the Mode-2 snap/restore ABI — any of them can serve as the SRDX netplay reverse channel.

DriverProtocolControllerReportKey feature
usb-hid-gamepad USB HID Generic 8 B 16 buttons, 4×8-bit axes
bt-hid/xbox_bt BT HID Xbox One S 16 B 16 buttons, 4×16-bit sticks, 2 triggers
bt-hid/ds4_bt BT HID DualShock 4 77 B Full Sony surface: gyro, accel, touchpad, battery

The three drivers together cover the two dominant wireless controllers — Xbox One S and DualShock 4 together represent more than 80% of the installed wireless gamepad base. The USB generic driver covers wired controllers and the long tail of HID-compliant gamepads.