gameinput: darner_controller, a controller for mods (read, hold, chords, feed) #560
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
hle
input
INTEL
lighting
linux-proton
memory
MULDER
needs-info
needs-logs
needs-rebase
NVIDIA
performance
post-merge
pr-diagnostics
pr-docs
pre-merge
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
relevance
high
relevance
low
relevance
medium
relevance
very-high
rendering
report
roadmap-proposal
saves
series-s
shaders
startup
status
blocked-by-rework
status
needs-test-report
status
needs-triage
status
ready-for-review
status
stale
status
superseded
status
wip
tools
ui
upstream
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
TrustNo1/Darner!560
Loading…
Reference in a new issue
No description provided.
Delete branch "jack/Darner:mods-controller"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Contributor role (optional)
What it changes
%LOCALAPPDATA%\darner\modsruns in our process but has no way to read the pad or to keep its buttons from the title.DARNER_TRAINER=1(menu_share) serves one trainer: a page at a fixed address that always holds the same five buttons.darner.exe exports
darner_controller(version). It returns a C table (crates/darner-hle/src/modules/gameinput/modpad.rs, documented there) that any mod can use:open(name)/close. Each mod's holds, chords and feeds are its own, and several mods can use the controller at once (their holds add up).state(slot), one pad or all of them as one, before anything is held or fed.hold(client, buttons, flags, ms)keeps buttons, and optionally the sticks and triggers, from the title. It lasts at most 1 s unless renewed, so a mod that stops gives the pad back on its own.chord(client, {buttons, hold_ms, guard_ms})andfired(chord). The combination is watched on the input poll thread (every 8 ms), not at the mod's frame rate.guard_mswhile the rest come.hold_ms, and they stay away from the title until they are let go.feed(client, slot, pad, flags, ms)adds a mod's buttons, and optionally its sticks and triggers, to a pad. An empty slot gets a pad while it is fed. Holds do not take fed input.It runs in
Hub::pollright aftermenu_share, on the host pads only (the keyboard's stand-in pad and the mouse look are untouched, as withmenu_share). Until a mod opens a client, nothing changes for the title. The table carries its size and version, and later versions only add fields at the end.Also in it:
apps/darner/build.rsexports the function (/EXPORT, and the.deffor GNU),apps/darner/tests/exports.rschecks darner.exe's export directory, and README's mods-folder line says what a mod can use.How it was tested
Tested revision:
0fc2116(upstreammainc8258f9plus this commit)Commands and results:
cargo test -p darner-hle --lib modpad: 14 passed, 0 failedChanges a default: no. Nothing is held, fed or watched until a mod asks.
A/B result: not needed (no default changes, and no speed claim). With no mod,
exchangetakes one uncontended lock per 8 ms poll and finds nothing to do.Gates run: gate 1 (
cargo clippy --workspace --all-targets --locked -- -D warnings) exit 0; gate 2 (--all-features) exit 0; gate 3 (cargo test --workspace --locked --no-fail-fast) exit 0: 3535 passed, 0 failed, 121 ignored. Gates ran onc8258f9with this change's code, before the README line was added; nothing else differs from0fc2116.Gameplay: not on this revision. The same
modpad.rsand hook ran on my local build of the NVIDIA fork, RTX 4080, Series S profile, DLSS Quality, DLSS frame generation 2x. A mod loader used it:Darner's logs of those runs show no panic, exception or device removal.
Shader wave sizes tested: not relevant.
Hardware dependence: likely general (CPU-side input path).
Coverage gaps: feeds are covered by unit tests only, not by a mod in the game. The GNU
.defexport was not built (MSVC only). Not run on Linux/Proton.Written with Claude Code (Claude Opus 5.5); I read and tested the change.
Checklist
main.docs/asset-policy.md.Checked for overlap
gameinput.rs: #525, #473, #447, #429, #421, #405, #402, #364, #302, #185. They shareapps/darner/build.rs: #130.🤖 Generated with Claude Code
[pr-feature][input] gameinput: darner_controller, a controller for mods (read, hold, chords, feed)to gameinput: darner_controller, a controller for mods (read, hold, chords, feed)Test needed — commit
0fc21164; what to check:%LOCALAPPDATA%\darner\modsruns in our process but has no way to read the pad or to keep its buttons from the title.DARNER_TRAINER=1(menu_share) serves one trainer: a page at a fixed address that always holds the same five buttons.darner.exe exports
darner_controller(version). It returns a C table (crates/darner-hle/src/modules/gameinput/modpad.rs, documented there) that any mod can use:open(name)/close. Each mod's holds, chords and feeds are its own, and several mods can use the controller at once (their holds add up).state(slot), one pad or all of them as one, before anything is held or fed.hold(client, buttons, flags, ms)keeps buttons, and optionally the sticks and triggers, from the title. It lasts at most 1 s unless renewed, so a mod that stops gives the pad back on its own.chord(client, {buttons, hold_ms, guard_ms})andfired(chord). The combination is watched on the input poll thread (every 8 ms), not at the mod's frame rate.guard_mswhile the rest come.Evidence to post: card + driver, settings, commit tested, before/after (switch off vs on, two runs each), fps median and p99, and one line saying you looked at the picture.
Reply
testingto take this run; it's free again after 24 h with no results.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.