CLI flag to open player 2 (thx Elrinth)

This commit is contained in:
Simon Gellis 2026-02-19 23:52:52 -05:00
parent 640078e9b9
commit d269082c8b
No known key found for this signature in database
GPG Key ID: DA576912FED9577B
2 changed files with 13 additions and 1 deletions

View File

@ -84,7 +84,7 @@ impl Application {
let proxy = proxy.clone();
thread::spawn(|| process_gamepad_input(mappings, proxy));
}
Self {
let app = Self {
icon,
wgpu,
client,
@ -106,7 +106,16 @@ impl Application {
init_framebuffers: args.frame_buffers,
init_registers: args.registers,
init_terminal: args.terminal,
};
if args.player2 {
app.client
.send_command(EmulatorCommand::StartSecondSim(args.rom.clone()));
app.proxy
.send_event(UserEvent::OpenPlayer2)
.expect("Failed to open Player 2 window");
}
app
}
fn open(&mut self, event_loop: &ActiveEventLoop, window: Box<dyn AppWindow>) {

View File

@ -40,6 +40,9 @@ pub struct CliArgs {
/// Watch ROM files for changes, automatically reload
#[arg(short, long)]
pub watch: bool,
/// Automatically open Player 2 for multiplayer
#[arg(long)]
pub player2: bool,
}
pub const COLOR_PRESETS: [[Color32; 2]; 3] = [