public void RewireInputChain() { ControllerInputCoalescer.Clear(); ControllerInputCoalescer.Definition = ActiveController.Definition; UdLRControllerAdapter.Source = ActiveController.Or(AutoFireController); StickyXorAdapter.Source = UdLRControllerAdapter; AutofireStickyXorAdapter.Source = StickyXorAdapter; MultitrackRewiringAdapter.Source = AutofireStickyXorAdapter; MovieInputSourceAdapter.Source = MultitrackRewiringAdapter; ControllerOutput.Source = MovieOutputHardpoint; Global.MovieSession.MovieControllerAdapter.Definition = MovieInputSourceAdapter.Definition; // connect the movie session before MovieOutputHardpoint if it is doing anything // otherwise connect the MovieInputSourceAdapter to it, effectively bypassing the movie session if (Global.MovieSession != null) { MovieOutputHardpoint.Source = Global.MovieSession.MovieControllerAdapter; } else { MovieOutputHardpoint.Source = MovieInputSourceAdapter; } }
public void SyncControls(IEmulator emulator, IMovieSession session, Config config) { var def = emulator.ControllerDefinition; ActiveController = BindToDefinition(def, config.AllTrollers, config.AllTrollersAnalog); AutoFireController = BindToDefinitionAF(emulator, config.AllTrollersAutoFire, config.AutofireOn, config.AutofireOff); // allow propagating controls that are in the current controller definition but not in the prebaked one // these two lines shouldn't be required anymore under the new system? ActiveController.ForceType(new ControllerDefinition(def)); ClickyVirtualPadController.Definition = new ControllerDefinition(def); // Wire up input chain ControllerInputCoalescer.Clear(); ControllerInputCoalescer.Definition = ActiveController.Definition; UdLRControllerAdapter.Source = ActiveController.Or(AutoFireController); UdLRControllerAdapter.AllowUdlr = config.AllowUdlr; StickyXorAdapter.Source = UdLRControllerAdapter; AutofireStickyXorAdapter.Source = StickyXorAdapter; session.MovieIn = AutofireStickyXorAdapter; session.StickySource = AutofireStickyXorAdapter; ControllerOutput.Source = session.MovieOut; }