/* * VWE fork: in-fork virtual RIO cockpit board (serial1=rio). * * A native DOSBox-X serial backend that *is* the cockpit RIO board: it speaks * the device side of the RIO 9600-8N1 protocol to the game's UART, and sources * its pilot input from an SDL game controller + the host keyboard inside the * emulator. There is no external process and no pipe, so the game<->board * round trip happens entirely in-process at the emulated UART's own byte * cadence -- the same timing a real ISA UART sees on a physical pod, which * removes the whole class of serial / pipe round-trip-latency dropouts * (livelock, TXMAXIDLE, rxburst, 15s retry). * * The protocol state machine + input mapping are transcribed from the * validated vRIO app (C:\VWE\vrio VRio.Core: VRioDevice, the Protocol codec, * Input/InputRouter + BindingProfileFormat), minus its transport, wire pacer, * panel UI and thread locks -- CSerial callbacks, the SDL reads and the host * keyboard hook all run on the single emulator thread. * * Keyboard field (B1): sdlmain's SDL2 event loop offers every key to * RIO_HostKeyEvent() first. While capture is ON (default; PAUSE or * SCROLL LOCK toggles it -- plus an optional `togglekey:`) a key bound * in the profile presses its RIO address (button 0x00-0x47 / keypad * 0x50-0x6F) or drives an axis, and is swallowed before the DOS keyboard * sees it; unbound keys and Ctrl/Alt/Gui chords pass through (bound modifier * keys are exempt from the chord rule), so DOSBox-X host hotkeys keep * working. Toggling capture OFF releases everything held and gives the whole * keyboard back to DOS (needed at the netnub loop / DOS prompts). * * Bindings: the built-in default profile = vRIO's pad + button field * (number/QWERTY rows = upper MFD bank, home/bottom rows = lower bank, * F1-F12 = Secondary/Screen columns, arrows+Space = hat+main) plus keyboard * FLIGHT controls (operator 2026-07-22): numpad 8/2/4/6 = stick, 7/9 = * pedals, LShift/LCtrl = throttle slew, numpad-5 = throttle zero; the * internal keypad is unbound (mission-review-only plumbing). A bindings file * in vRIO's grammar (`key button [toggle]` / `key axis * deflect|slew|rate|set ` / `pad