[PR #1831] gameinput: preserve controller transitions between polls (OLD-9966, carries #233) #1842

Open
opened 2026-11-26 21:19:09 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1831
Author: @potatoe0100
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: carry/old-9966


📝 Commits (1)

  • 9a96b8b gameinput: preserve controller transitions between polls

📊 Changes

3 files changed (+167 additions, -75 deletions)

View changed files

📝 docs/gameinput.md (+7 -5)
📝 runtime/shims/gameinput.cpp (+118 -70)
📝 runtime/test/gameinput_test.cpp (+42 -0)

📄 Description

Claimed in the coordination issue as: OLD-9966 (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7162810670)

What and why

Carries forward old-pr/9966 (draft #233) by @tedin7, rebased on main 0d80bc5df with the author's commit. A press and release that both land between two polls used to be lost, because each poll only compared the latest snapshot. Pads that were already open replay their SDL button and axis events in timestamp groups, publishing one reading per group, so the title sees each transition.

Rebase notes: runtime/shims/gameinput.cpp conflicted in poll_once(), where main added the LEONIDA_INPUT_LOG press log. The branch moves reading publication into publish_pad_sample(); the press log moved there with it (before last_snap is updated), so replayed transitions are logged too.

Supersedes draft #233 (its branch can be deleted once this lands).

Tested

VS 2022 (MSVC 19.44) RelWithDebInfo + Ninja with -DLEONIDA_SDL3_FETCH=ON (so gameinput and gameinput_script are built and run, not Disabled).

  • gameinput and gameinput_script pass.
  • Full ctest -j 6: 440 of 440 passed.

GPUs tested: NVIDIA GeForce RTX 4060, driver 621.14, Windows 11 Pro 26H2 (build 26300) (no GPU-specific code here)

AI-assisted: yes (Claude Code), by a non-developer tester.

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator change)

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1831 **Author:** [@potatoe0100](https://github.com/potatoe0100) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `carry/old-9966` --- ### 📝 Commits (1) - [`9a96b8b`](https://github.com/ubiquitarianism/leonida/commit/9a96b8ba6aaf2fc8ed3f3ad5177d0e3f420dc62c) gameinput: preserve controller transitions between polls ### 📊 Changes **3 files changed** (+167 additions, -75 deletions) <details> <summary>View changed files</summary> 📝 `docs/gameinput.md` (+7 -5) 📝 `runtime/shims/gameinput.cpp` (+118 -70) 📝 `runtime/test/gameinput_test.cpp` (+42 -0) </details> ### 📄 Description Claimed in the coordination issue as: OLD-9966 (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7162810670) ### What and why Carries forward `old-pr/9966` (draft #233) by @tedin7, rebased on `main` `0d80bc5df` with the author's commit. A press and release that both land between two polls used to be lost, because each poll only compared the latest snapshot. Pads that were already open replay their SDL button and axis events in timestamp groups, publishing one reading per group, so the title sees each transition. Rebase notes: `runtime/shims/gameinput.cpp` conflicted in `poll_once()`, where `main` added the `LEONIDA_INPUT_LOG` press log. The branch moves reading publication into `publish_pad_sample()`; the press log moved there with it (before `last_snap` is updated), so replayed transitions are logged too. Supersedes draft #233 (its branch can be deleted once this lands). ### Tested VS 2022 (MSVC 19.44) RelWithDebInfo + Ninja with `-DLEONIDA_SDL3_FETCH=ON` (so `gameinput` and `gameinput_script` are built and run, not Disabled). - `gameinput` and `gameinput_script` pass. - Full `ctest -j 6`: 440 of 440 passed. GPUs tested: NVIDIA GeForce RTX 4060, driver 621.14, Windows 11 Pro 26H2 (build 26300) (no GPU-specific code here) AI-assisted: yes (Claude Code), by a non-developer tester. ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [x] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator change) 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#1842
No description provided.