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).
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.
Synthetic inject and snap/restore
- Synthetic inject:
ds4_inject(report_77bytes)— injects a synthetic 77-byte report for the SRDX reverse channel or testing. - Snap/restore:
ds4_snap()/ds4_rest()— Mode-2 rollback state management.
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
- MAME dat (XML): arcade ROMs are ZIP files. The scanner CRC32s each file inside the ZIP and matches against the MAME dat's
<rom>entries. This is the exact method MAME uses for ROM validation — a matched CRC32 against the dat means the ROM is byte-for-byte correct. - No-Intro dats (XML): cartridge ROMs (SNES, NES, GBA, etc.) are single files. The scanner CRC32s the whole file and compares against the No-Intro dat's
<rom crc="...">attribute. No-Intro is the gold standard for console ROM preservation — a matched CRC means a verified, unmodified dump. - Fallback title: if no dat is available or no CRC match is found, the scanner generates a title from the filename — strip region tags like
(USA),(E),(J), replace underscores with spaces, title-case the result.
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()rom_title(i)rom_path(i)rom_system_id(i)rom_year(i) / rom_publisher(i)rom_crc32(i) / rom_verified(i)rom_system_start(sys_id) / rom_system_count(sys_id)rom_for_system(sys_id, local_idx)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.
- Info bar (bottom of grid): year, publisher, and a
[dat verified]badge ifrom_verified(i)is true — CRC32 matched against the official dat. The badge distinguishes exact dumps from filename-only matches. - L1/R1 navigation: Left/Right shoulder buttons skip to the previous/next system that has ROMs — no empty system pages.
lib_prev_system()/lib_next_system(). EV_BACK: return to Level 0 (system browser).EV_SELECT: launch the selected ROM — callslauncher_launch(sys_id, rom_path).
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.
| Driver | Protocol | Controller | Report | Key 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.