Improve flow of command-line debugging
This commit is contained in:
@@ -92,6 +92,7 @@ pub struct EmulatorBuilder {
|
||||
state: Arc<Atomic<EmulatorState>>,
|
||||
audio_on: Arc<[AtomicBool; 2]>,
|
||||
linked: Arc<AtomicBool>,
|
||||
start_paused: bool,
|
||||
}
|
||||
|
||||
impl EmulatorBuilder {
|
||||
@@ -107,6 +108,7 @@ impl EmulatorBuilder {
|
||||
state: Arc::new(Atomic::new(EmulatorState::Paused)),
|
||||
audio_on: Arc::new([AtomicBool::new(true), AtomicBool::new(true)]),
|
||||
linked: Arc::new(AtomicBool::new(false)),
|
||||
start_paused: false,
|
||||
};
|
||||
let client = EmulatorClient {
|
||||
queue,
|
||||
@@ -125,6 +127,13 @@ impl EmulatorBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn start_paused(self, paused: bool) -> Self {
|
||||
Self {
|
||||
start_paused: paused,
|
||||
..self
|
||||
}
|
||||
}
|
||||
|
||||
pub fn build(self) -> Result<Emulator> {
|
||||
let mut emulator = Emulator::new(
|
||||
self.commands,
|
||||
@@ -136,6 +145,9 @@ impl EmulatorBuilder {
|
||||
if let Some(path) = self.rom {
|
||||
emulator.load_cart(SimId::Player1, &path)?;
|
||||
}
|
||||
if self.start_paused {
|
||||
emulator.pause_sims()?;
|
||||
}
|
||||
Ok(emulator)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user