hle(input): VICTORY_INPUT_LATCH and VICTORY_STICK_DEADZONE #602

Open
github-bot wants to merge 2 commits from github-bot/gh-598 into main AGit
Owner

@⁠AnastasisKon on GitHub · 2026-11-28 11:24 UTC · original
AnastasisKon:vibe/input-latch-1705ac → main · +580 −26 · 3 files · 2 commits · open

What this changes

Ports halfwave50's two input switches (VIctory-macOS-halfwave50 52e0325, GPL-3.0, credited) to the native macOS host, off by default. Refs #433

  • VICTORY_INPUT_LATCH=1: a button change the title has not read yet waits for its next GetCurrentReading — a tap between two of the title's once-a-frame readings is seen once. Up last reading and pressed since shows down; down last reading and released since shows up; pressed again shows down again. Triggers show their peak since the last reading, sticks their latest value. Readings within 15 ms agree; with no reading for 2 s the latch lets go. Latch state is per device slot, accumulated in State::update, merged at hand-out in current_reading/temporal_reading (State::latched).
  • VICTORY_STICK_DEADZONE=<share>: round dead zone per stick applied to host pads at each Hub::poll (before scripted keys merge), rest of travel rescaled to 0..1.

Both are per-hub atomics read once in Hub::start; tests set them on a fake hub.

How it was tested

  • cargo test -p victory-hle --lib gameinput — 19 passed (5 new: tap seen once then not again, held stays down / release shows up, trigger peak then current value, 2 s timeout lets the stale latch go, latch-off default loses taps, dead-zone rounding/rescaling, dead zone applied at poll) — host and --target x86_64-apple-darwin (Rosetta)
  • cargo test -p victory-hle -p victory -p victory-gpu -p xtask — all ok (11 suites)
  • cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings — RC=0
  • cargo xtask policy — 404 files ok
  • Game run: not yet (game download still in progress)

Checklist

  • No game files, game code, disassembly listings or SDK files are included
  • Guesses about undocumented console behaviour are marked in the code and in docs/native-host.md — latch semantics documented with the switches there
  • New diagnostics are behind a VICTORY_* variable and documented — both switches documented in docs/native-host.md, off by default
**@⁠AnastasisKon** on GitHub · 2026-11-28 11:24 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/pull/598) `AnastasisKon:vibe/input-latch-1705ac` → `main` · +580 −26 · 3 files · 2 commits · open ## What this changes Ports halfwave50's two input switches (VIctory-macOS-halfwave50 `52e0325`, GPL-3.0, credited) to the native macOS host, off by default. Refs #433 - `VICTORY_INPUT_LATCH=1`: a button change the title has not read yet waits for its next `GetCurrentReading` — a tap between two of the title's once-a-frame readings is seen once. Up last reading and pressed since shows down; down last reading and released since shows up; pressed again shows down again. Triggers show their peak since the last reading, sticks their latest value. Readings within 15 ms agree; with no reading for 2 s the latch lets go. Latch state is per device slot, accumulated in `State::update`, merged at hand-out in `current_reading`/`temporal_reading` (`State::latched`). - `VICTORY_STICK_DEADZONE=<share>`: round dead zone per stick applied to host pads at each `Hub::poll` (before scripted keys merge), rest of travel rescaled to 0..1. Both are per-hub atomics read once in `Hub::start`; tests set them on a fake hub. ## How it was tested - [x] `cargo test -p victory-hle --lib gameinput` — 19 passed (5 new: tap seen once then not again, held stays down / release shows up, trigger peak then current value, 2 s timeout lets the stale latch go, latch-off default loses taps, dead-zone rounding/rescaling, dead zone applied at poll) — host and `--target x86_64-apple-darwin` (Rosetta) - [x] `cargo test -p victory-hle -p victory -p victory-gpu -p xtask` — all ok (11 suites) - [x] `cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-gnullvm -- -D warnings` — RC=0 - [x] `cargo xtask policy` — 404 files ok - [ ] Game run: not yet (game download still in progress) ## Checklist - [x] No game files, game code, disassembly listings or SDK files are included - [x] Guesses about undocumented console behaviour are marked in the code and in docs/native-host.md — latch semantics documented with the switches there - [x] New diagnostics are behind a `VICTORY_*` variable and documented — both switches documented in docs/native-host.md, off by default
The texture scanner already read a changed texture whole on its own
thread; the submission then read the same memory again to detile it.
The scanner now keeps those bytes (up to 64 MiB per texture, 512 MiB
in all, evicted oldest-first) and the submission's Job detiles them
directly, halving the reads of scanner-found changes. Torn stashes
self-heal: the next round's hash differs and the texture is read whole.

The sync read threads were a fixed 6; they now use all the host's
cores but two (sync_threads), so an 8-core M1 uses 6 and a 12-core
M1 Pro 10.

Refs #179
At low frame rates the title polls the pad once a frame, so a press and
release between two readings is never seen. With VICTORY_INPUT_LATCH=1 a
button change the title has not read yet waits for its next reading (up
last time and pressed since shows down; down last time and released
since shows up; pressed again shows down again); triggers show their
peak since the last reading, sticks their latest value. Readings within
15 ms agree; with no reading for 2 s the latch lets go. Off by default.

VICTORY_STICK_DEADZONE=<share> applies a round dead zone per stick at
each poll, the rest of the travel spread over 0..1. Off by default.

Ported from halfwave50's VIctory-macOS-halfwave50 (52e0325, GPL-3.0,
credited there). Both switches are per-hub settings read once at start;
tests drive them on a fake hub through GetCurrentReading.

Refs #429
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 11:32:24 +00:00
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/602/head:github-bot/gh-598'
git switch 'github-bot/gh-598'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-598'
git switch 'github-bot/gh-598'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-598'
git switch 'github-bot/gh-598'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-598'
git switch 'main'
git merge --squash 'github-bot/gh-598'
git switch 'main'
git merge --ff-only 'github-bot/gh-598'
git switch 'main'
git merge 'github-bot/gh-598'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.