Add Moza FFB + ViGEm virtual gamepad integration#1
Draft
drowhunter with Copilot wants to merge 6 commits into
Draft
Add Moza FFB + ViGEm virtual gamepad integration#1drowhunter with Copilot wants to merge 6 commits into
drowhunter with Copilot wants to merge 6 commits into
Conversation
…er type, NormToShort range
Copilot created this pull request from a session on behalf of
drowhunter
July 19, 2026 04:43
View session
Upgraded target framework to net48 and added Microsoft.CSharp reference. Added references and build logic for MOZA_API_CSharp.dll, Nefarius.ViGEm.Client.dll, and native Moza DLLs. Enhanced build to copy native DLLs to a x64 subfolder and set DLL search path at runtime for P/Invoke compatibility. Improved logging for native DLL path setup.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the full FFB plan from
plan.md: Moza wheel → force feedback from live telemetry, wheel input → ViGEm virtual Xbox 360 controller.Architecture
New components
Config/WheelConfig.cs— BepInExConfigEntry<T>bindings forWheel/General,Wheel/FFB,Wheel/Input; all live-tunable at runtimeContracts/—IWheelInputProvider,IWheelFfbProvider,IVirtualGamepadOutput; backend-agnostic for future DirectInput supportMoza/MozaSdkAdapter.cs— Single boundary around all MOZA SDK calls; usesdynamicfor effect objects (HIDDatais a reference type); wrapsinstallMozaSDK/removeMozaSDK,getHIDData,createWheelbaseETDamper,createWheelbaseETConstantForce,stopForceFeedbackMoza/MozaWheelInputProvider.cs— PollsgetHIDDataeach frame; normalisesfSteeringWheelAngleto −1..1 with configurable deadzone/saturation; mapsint16pedal axes to 0..1Moza/MozaWheelFfbProvider.cs— Manages two persistent DirectInput effects: ETDamper (continuous cForce resistance) + ETConstantForce (tire impulse bursts)Ffb/FfbModel.cs— ComputesFfbCommandper frame: cForce → damper coefficient with exponential smoothing;TireFR − TireFL→ threshold-gated, cooldown-limited impulse magnitudeOutput/VigemXboxGamepadOutput.cs— ViGEm Bus virtual Xbox 360 controller; steer → left stick X (fullshortrange), throttle/brake → triggersRuntime/WheelIntegrationRuntime.cs— Orchestrator: x64 guard, graceful degradation on partial init failures (FFB-without-pad and pad-without-FFB both handled), clean teardownPlugin wiring (
NewStarTelemetryPlugin.cs)Dependencies added
Nefarius.VigemClient 1.22.40(NuGet)libs/moza/x64/MOZA_API_CSharp.dll(local reference,<Private>true</Private>)Runtime requirements
Native DLLs
MOZA_API_C.dll+MOZA_SDK.dllmust be copied fromlibs/moza/x64/into the game root directory. ViGEm Bus driver must be installed. MOZA Pithouz must be running.