Skip to content

v0.5.0

Latest

Choose a tag to compare

@jeffory jeffory released this 29 Sep 11:18

PicoDeck v0.5.0

A logical gamepad you can rebind, an OS frame counter, gapless video audio, and MP3 playback without skips.

PicoDeck runs on a PicoCalc fitted with a Pimoroni Pico Plus 2 W. On v0.3.0 or later, System Update installs this release; from v0.2.0 or earlier, install picodeck.uf2 with BOOTSEL (see the v0.3.0 notes).

Gamepad

  • A gamepad for games. Twelve buttons (D-pad, A, B, X, Y, L, R, Start, Select) that games read instead of raw keys. Each is an alias for keys, so the keys still work as themselves. Defaults: arrows, A = F4, B = F5, X = Delete, Y = Backspace, L = F2, R = F3, Start = F1, Select = Tab. Lua reads it through picocalc.gamepad, native apps through api->gamepad. See API Gamepad. The bundled games move onto it in a later release.
  • Settings → Controls. Rebind any button to a primary and an alternate key, for all games or, from inside a game, just that one. Bindings are saved in /system/gamepad.json and /data/<app id>/gamepad.json.
  • Delete key. Delete now registers on the device (BTN_DEL); it used to work only in the simulator.

System menu

  • Show FPS. A new Settings item shows a frame counter, drawn by the OS, in any corner for every app, Lua or native. Off by default.
  • The app gets its screen back. Closing the menu restores the app's screen at once. Apps that redraw only when something moves, such as Panels Demo, no longer keep a dimmed screen or the closed menu until the next redraw.
  • More room for settings. The system settings store holds more keys, and uses less memory doing it.

Audio and video

  • MP3 skips fixed. MP3 playback dropped a frame about every 1.3 s at 128 kbps (every 5 s at 96 kbps), in music and video soundtracks alike. Every frame now plays.
  • Video audio. A looping video keeps its sound across the loop instead of restarting it, resuming after a seek while paused has sound, the volume you set is kept across loops, seeks and load(), and low-frame-rate videos no longer lose part of their audio. A short gap remains when you seek (#20).
  • FilePlayer. setLoopRange(start, end) now loops that range; load() returns nil and the reason for a file it can't play; didUnderrun() and setStopOnUnderrun() work; new getSampleRate().

Graphics

  • Pixel access from Lua. image.new plus img:getPixel/setPixel, bulk img:getPixels/setPixels, and display.getPixel, so apps can build textures at runtime (for example for drawPlane and drawTexturedColumn).
  • drawScaled rotates in radians on the device, as documented (it used degrees), draws without a stray wrong-coloured edge, and rejects a scale that would draw beyond 4096 px with an error saying it takes a multiplier.
  • draw and drawStretched accept a positional source rectangle, {x, y, w, h}.
  • Fonts: display.loadFont returns nil and the reason on failure, and graphics.font.new names the actual problem.
  • Animations: animator.new works with its documented four- and five-argument forms, including a start delay.

For app developers

  • Native API version 9 adds the gamepad table (check api->version >= 9).
  • Native changes:
    • zip->read returns -2 (PCZIP_ERR_TOO_SMALL) when the buffer is too small, so test for < 0, not == -1.
    • mp3PlayerPlay(mp, 0) now loops until stopped, like the other players.
    • http->newConn with port 0 uses the scheme's default port.
  • Lua fs.seek(file, offset, whence) takes "set", "cur" or "end".
  • Pacing: an app no longer inherits the previous app's frame pacing.
  • SDK: sdk/lua/picocalc.lua is corrected (about 40 wrong signatures and returns), and CI now checks it against the firmware. The docs gain the Lua HTTP flow, the ZIP archive object, the terminal's native-only calls, the Lua 5.4 removals (unpack, math.atan2, …), every applyEffect effect and the transparent-colour rules. The SDK's sample app now handles Exit App.

Known issues

  • Seeking a video leaves a short audio gap (#20).
  • With Shift held, the keyboard sends nothing for Left, Right, Backspace and Space. This comes from the keyboard's own firmware.
  • Plain buttons (not the gamepad) can stay held if Shift is pressed or released while a key is down.