Skip to content

v20261126-c1-controller-implementation

Pre-release
Pre-release

Choose a tag to compare

@TechEdison0 TechEdison0 released this 26 Nov 07:18
· 74 commits to main since this release

C1 Controller Implementation — chunk C1 complete: a controller launcher, function guide, 18-step mapping flow, live input feedback and hardened axis capture on every target.

What's in it

  • Main menu: Controller now opens a two-button launcher:
    • Controller Guide — a plain Button -> Description list with indented examples, built-in arrow glyphs and sprite bullets.
    • Controllers & Mapping — the standalone mapping window with Control, Mapping and Live columns.
  • Mapping flow: 18 prompts covering buttons, D-pad directions, stick axes and triggers. Back/Select/Start/Guide are intentionally absent because handhelds claim them as system buttons; pause is reserved for simultaneous L3+R3.
  • Axis capture: the first axis moving beyond ±22,000 from rest is selected and always stored over the full SDL range (-32768..32767). Direction of the test move cannot invert or truncate the mapping.
  • Trigger axes: read -32768 until SDL reports the first event, so they are not falsely active on first launch or during mapping.
  • Live feedback: buttons show pressed/released, axes show their raw value and D-pads show the hat bitfield, refreshed every 100 ms for the selected controller.
  • controller.cfg: per-GUID mapping persistence beside hotkeys.cfg (button:N, axis:N:min:max, hat:H:bits), auto-saved on completion and restored at start. Config keys are unchanged.
  • Release-gated diagnostics: builds are compiled with -DGAMEPAD_DEBUG_OFF, so the C0 diagnostics window is fully absent.
  • No phone-home: the first-run participation survey is removed and survey transmission is disabled at compile time.

Fixed

  • The old quiet wait could freeze mapping after the first axis if no further input event arrived; it is now a time-based 500 ms ignore window.
  • Guide and launcher windows now have opaque dark backgrounds; the launcher is centered.
  • Literal {..._ARROW} control codes are replaced with real glyphs via a dedicated renderer; D-pad and stick labels use the same path.
  • Triggers no longer need a double click during mapping and no longer start green on first launch.
  • Mapping no longer records partial or inverted axis ranges.

Verified

Compiled and manually tested on Linux x86_64, Windows (Wine, native win32 video + SDL input) and Android arm64-v8a (Galaxy S25 Ultra): the launcher and guide render correctly, the 18-step mapping completes, axis and trigger captures behave correctly, and live values update for the selected controller.

Assets

Asset Size
openttd-20261126-main-g21e2e06c88-linux-x86_64.zip 11.2 MB
openttd-20261126-main-g21e2e06c88-win64.zip 17.6 MB
openttd-20261126-main-g21e2e06c88-android-arm64-v8a-debug.apk 91.6 MB

Pre-release; the next chunk (C2) adds the action layer and input-source switching.