mirror of
https://github.com/sal063/AC6_recomp
synced 2026-08-22 07:04:31 -04:00
Add native KB+M support: menus, flight, mouse steering, pad-free play
Keyboard/mouse state is injected at the guest XamInput wrapper boundary, so every layer of the input stack sees KB+M exactly as a connected pad, and a real pad keeps working alongside. Menu and flight key sets (AC7-style defaults) switch automatically via a flight-sim heartbeat; the mouse steers pitch/roll with a velocity model, or pans the camera while the camera-control key is held. With no controller connected, a synthetic pad is presented on slot 0. Bindings and mouse feel live in ac6_input.toml (auto-created on first run, hot-reloaded ~1x/s). Everything is off unless ac6_kbm_enabled is set.
This commit is contained in:
@@ -41,6 +41,7 @@ set(AC6RECOMP_SOURCES
|
||||
src/ac6_backend_fixes/ac6_backend_hooks.cpp
|
||||
src/ac6_backend_fixes/ac6_backend_pass_classifier.cpp
|
||||
src/ac6_backend_fixes/ac6_fps_physics_fix.cpp
|
||||
src/ac6_backend_fixes/ac6_kbm_input.cpp
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
|
||||
@@ -164,11 +164,18 @@ void BlendFieldDelta(uint8_t* base, uint32_t ea, float pre, double ratio, const
|
||||
PPC_EXTERN_FUNC(__imp__rex_sub_823046A0); // flight-model force step
|
||||
PPC_EXTERN_FUNC(__imp__rex_sub_82329B40); // flight-model input shaping
|
||||
|
||||
// KB+M context switch (ac6_kbm_input.cpp): the force step is the reliable
|
||||
// "flight sim is stepping" heartbeat (runs per frame for every aircraft,
|
||||
// halts when paused / in menus).
|
||||
void ac6KbmNotifyFlightStep();
|
||||
|
||||
// Flight-model core force step (0x823046A0): rescale the per-frame stepped
|
||||
// longitudinal force/speed command at [this+1320].
|
||||
PPC_FUNC_IMPL(rex_sub_823046A0) {
|
||||
PPC_FUNC_PROLOGUE();
|
||||
|
||||
ac6KbmNotifyFlightStep();
|
||||
|
||||
const uint32_t self = ctx.r3.u32;
|
||||
const double ratio = StepRatio();
|
||||
// 1.0 is the exact pass-through value (native cadence, or the fix disabled).
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user