Skip to content

libretro: add Wiimote IR passthrough - #471

Open
XenuIsWatching wants to merge 1 commit into
libretro:masterfrom
XenuIsWatching:feature/ir-passthrough-cher
Open

libretro: add Wiimote IR passthrough#471
XenuIsWatching wants to merge 1 commit into
libretro:masterfrom
XenuIsWatching:feature/ir-passthrough-cher

Conversation

@XenuIsWatching

Copy link
Copy Markdown

Adds dolphin_ir_passthrough, letting the frontend supply the Wiimote camera's view of the sensor bar directly instead of having the core synthesise it from a cursor position.

The cursor path cannot be made exact, and it is worth saying why. It parks a notional remote two metres from the bar and rotates it by Total Yaw / Total Pitch, a scale with no physical derivation, then CameraLogic projects the LEDs through that. Where the game finally draws its hand therefore depends on a constant fitted per game, which is what Dolphin's own "defaults chosen to reach screen edges in most games" is admitting. It also cannot express roll or distance at all: two angles have nowhere to put them.

A frontend that knows the real geometry, a VR room, a tracked light gun , can compute the two dots outright and get all of that for free, which is what BuildDesiredWiimoteState already supports and nothing exposed.

Four pieces:

  • The option itself, off by default, under Wiimote IR.

  • The Pointer device now registers all four touch indices rather than only the first. libretro's pointer is multi-touch already, so the four IR objects ride on indices 0-3 instead of needing a new device type. Index 0 keeps the names it had, so the existing mouse-mode IR binding is untouched.

  • IRPassthrough is bound and enabled when the option is on: object N takes Pointer:XN+ / Pointer:YN+ across the camera's 0..1 field (so a frontend sends the positive half of the pointer range), with PressedN as presence and a small constant size, games read size to reject noise, and there is no spare axis to carry it. Bindings are CLEARED when the option is off, because AreInputsBound() is half of what selects this path and a stale binding would keep the cursor route switched off after it was turned back on.

  • irPassthrough is raised at controller setup as well as on an option change, so the setting applies on a cold boot. The IR offset, yaw and pitch settings are gated on IsUpdated alone, which means their declared defaults never reach the emulated remote until something moves them, a trap this option should not inherit.

Adds dolphin_ir_passthrough, letting the frontend supply the Wiimote
camera's view of the sensor bar directly instead of having the core
synthesise it from a cursor position.

The cursor path cannot be made exact, and it is worth saying why. It
parks a notional remote two metres from the bar and rotates it by
Total Yaw / Total Pitch, a scale with no physical derivation, then
CameraLogic projects the LEDs through that. Where the game finally draws
its hand therefore depends on a constant fitted per game, which is what
Dolphin's own "defaults chosen to reach screen edges in most games" is
admitting. It also cannot express roll or distance at all: two angles
have nowhere to put them.

A frontend that knows the real geometry, a VR room, a tracked light gun
, can compute the two dots outright and get all of that for free, which
is what BuildDesiredWiimoteState already supports and nothing exposed.

Four pieces:

  * The option itself, off by default, under Wiimote IR.

  * The Pointer device now registers all four touch indices rather than
    only the first. libretro's pointer is multi-touch already, so the
    four IR objects ride on indices 0-3 instead of needing a new device
    type. Index 0 keeps the names it had, so the existing mouse-mode IR
    binding is untouched.

  * IRPassthrough is bound and enabled when the option is on: object N
    takes Pointer:XN+ / Pointer:YN+ across the camera's 0..1 field (so a
    frontend sends the positive half of the pointer range), with
    PressedN as presence and a small constant size, games read size to
    reject noise, and there is no spare axis to carry it. Bindings are
    CLEARED when the option is off, because AreInputsBound() is half of
    what selects this path and a stale binding would keep the cursor
    route switched off after it was turned back on.

  * irPassthrough is raised at controller setup as well as on an option
    change, so the setting applies on a cold boot. The IR offset, yaw
    and pitch settings are gated on IsUpdated alone, which means their
    declared defaults never reach the emulated remote until something
    moves them, a trap this option should not inherit.
@XenuIsWatching

Copy link
Copy Markdown
Author

essentially just allows me to then tilt/twist the pointer

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.

1 participant