Skip to content

Wii IR scale: preserve stock cursor speed regardless of scale value#155

Open
Copilot wants to merge 3 commits intomasterfrom
copilot/fix-wii-ir-scaling-speed
Open

Wii IR scale: preserve stock cursor speed regardless of scale value#155
Copilot wants to merge 3 commits intomasterfrom
copilot/fix-wii-ir-scaling-speed

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 13, 2026

WII_IR_SCALE was a plain linear multiplier applied uniformly across the screen — setting it above 1.0 made the cursor faster everywhere, not just at the edges. The ask is to keep stock (1:1) tracking speed at all times while still allowing the scale to control how far the cursor reaches.

Approach

Replaces the uniform linear formula with a cubic smooth-step position-dependent curve:

// Before — derivative == scale everywhere
finalX = 0.5 + (finalX - 0.5) * scale;

// After — derivative == 1.0 at centre, ramps to `scale` at the edge
double tx = fabs(finalX - 0.5) * 2.0;          // 0 at centre, 1 at edge
double wx = tx * tx * (3.0 - 2.0 * tx);        // smoothstep(0,1,t)
finalX = 0.5 + (finalX - 0.5) * (1.0 + (scale - 1.0) * wx);
  • Centre derivative is always 1.0 — aiming speed in the middle of the screen is unchanged no matter what WII_IR_SCALE is set to.
  • Scale ramps in toward the edges — coverage/reach is still extended (> 1.0) or contracted (< 1.0) as before.
  • Fallback for scale < 0.5 — the smooth curve becomes non-monotone at extreme compression, so the original linear formula is kept below that threshold to prevent backwards cursor movement.

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…urve

The previous linear IR scale (scaledX = 0.5 + (finalX-0.5)*scale) changed
both coverage and physical-to-screen sensitivity uniformly, making the cursor
feel 2× faster (scale=2) or 2× slower (scale=0.5) everywhere on screen.

Replace with a smooth, position-dependent curve using a cubic smooth-step
weight (smoothstep(0,1,t) = 3t²−2t³):
  - Weight = 0 at screen centre → effective scale = 1.0 → stock speed
  - Weight = 1 at physical screen edge → effective scale = `scale`

This preserves aiming precision in the centre of the screen regardless of the
scale value, while still extending (scale>1) or contracting (scale<1) the
cursor's reachable area toward the edges.  The smooth curve is monotone for
scale ≥ 0.5; the original linear formula is kept as a fallback for scale < 0.5
to avoid non-monotone (backwards) cursor movement at extreme compression.

Also fix a pre-existing mixed-precision literal on the finalY calculation
(1.0f → 1.0).

Co-authored-by: dazzaXx <48131734+dazzaXx@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix Wii IR scaling to maintain stock speed Fix Wii IR scaling: preserve stock centre-screen speed via smooth-step curve Mar 13, 2026
Copilot AI requested a review from dazzaXx March 13, 2026 13:39
WII_IR_SCALE now only affects cursor coverage/reach — the cursor always
tracks at stock (1:1) speed regardless of the configured scale value.

A cubic smooth-step weight (smoothstep(0,1,t) = 3t²−2t³, t = normalised
distance from screen centre) blends the effective scale from 1.0 at the
centre to `scale` at the physical screen edge.  The derivative at the
centre is always exactly 1.0, so centre-screen aiming speed is unchanged
no matter what scale is set.

The linear fallback is kept for scale < 0.5 to prevent non-monotone
(backwards) cursor movement at extreme compression values.

Co-authored-by: dazzaXx <48131734+dazzaXx@users.noreply.github.com>
Copilot AI changed the title Fix Wii IR scaling: preserve stock centre-screen speed via smooth-step curve Wii IR scale: preserve stock cursor speed regardless of scale value Mar 13, 2026
@dazzaXx dazzaXx marked this pull request as ready for review March 17, 2026 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants