Skip to content

picocalc-extras 2.2.1: gamepads reconnect

Choose a tag to compare

@ctorkildson-netizen ctorkildson-netizen released this 11 Nov 00:38
· 16 commits to main since this release
0be400f

picocalc-extras 2.2.1 fixes two things found by using a PS4 pad with the NES emulator.

Gamepads reconnect

A PS4 pad paired, but afterwards wouldn't reconnect: pressing PS made it flash three times and switch off. Before reconnecting, it asks the PicoCalc what services it has, and btkbd had no answer, so the pad hung up. Now the PicoCalc answers, and pressing the pad's home button (PS) connects it again, in btpair and in any program.

Gamepads no longer slow programs down

A PS4 pad sends hundreds of reports a second, over a thousand when it's busy, and the Pico takes every one. In the NES emulator that was enough to make games sluggish and stutter. A gamepad is now held to 125 reports a second (Bluetooth sniff mode, the radio waking every 8 ms), and with that the NES emulator runs as fast as it does with no pad at all.

For programs (bluetooth/)

  • Nothing to change: rebuild with 2.2.1 and both fixes come with it.
  • btkbd_gamepad_sniff(ms) changes the 8 ms; 0 lets the pad report as often as it likes.
  • btkbd_gamepad_reports() counts the reports that have come.

Tried with

A Sony PS4 controller, in btpair and in the NES emulator's Bluetooth build.

If a gamepad misbehaves, press D then F5 in btpair, and send the two files it saves in /screenshots; that log is how both of these were found.