diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index 20bfc9c..d4cdb34 100644 --- a/src/main.rs +++ b/src/main.rs @@ -10,7 +10,7 @@ pub mod state; use crate::desktop::input::{Gamepad, GamepadRecorder, GamepadReplay, Keyboard}; use crate::desktop::load_save::FSLoadSave; -use crate::io::Input; +use crate::io::{Serial, Input}; use clap::Parser; #[derive(Parser)] @@ -73,9 +73,13 @@ fn main() { println!("Starting {:?}...", &cli.rom); - let serial = desktop::serial::UnconnectedSerial {}; let window = desktop::window::DesktopWindow::new(cli.title).unwrap(); + let serial: Box<dyn Serial> = match (cli.fifo_input, cli.fifo_output) { + (Some(fifo_input), Some(fifo_output)) => Box::new(desktop::serial::FIFOSerial::new(fifo_input, fifo_output)), + _ => Box::new(desktop::serial::UnconnectedSerial {}) + }; + let mut gamepad: Box<dyn Input> = if let Some(record_file) = cli.replay_input { Box::new(GamepadReplay::new(record_file)) } else if cli.keyboard { |