aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorAstatin <[email protected]>2025-06-29 00:32:41 +0200
committerAstatin <[email protected]>2025-06-29 00:32:41 +0200
commit4cb95575feedda5e2006d706a9e85db6569043ca (patch)
tree15f89bc7d0845f8920237961bf9bdedee38ed8b7 /src/main.rs
parent00c5b36a37d9b7e8b7009b3a176397e5ce808cbd (diff)
Fix (rewrite ?) FIFO serial communication
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs8
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 {