reoganised project
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
use std::path::Path;
|
||||
use std::thread::sleep;
|
||||
use std::time::Duration;
|
||||
use std::{env, fs};
|
||||
|
||||
use crate::emulator::system::model::State;
|
||||
use crate::emulator::system::model::{Command, Running};
|
||||
use crate::emulator::{config::Config, system::model::State};
|
||||
|
||||
pub fn run_cli() -> Result<(), Box<dyn std::error::Error>> {
|
||||
// Initialize channels and read in configuration.
|
||||
@@ -34,8 +33,11 @@ pub fn run_cli() -> Result<(), Box<dyn std::error::Error>> {
|
||||
|
||||
sleep(Duration::from_secs(1));
|
||||
|
||||
state.update().unwrap();
|
||||
state.cmd_sender.send(Command::Start).unwrap();
|
||||
state.update().expect("state failed to update");
|
||||
state
|
||||
.cmd_sender
|
||||
.send(Command::Start)
|
||||
.expect("state failed to update");
|
||||
loop {
|
||||
sleep(Duration::from_millis(20));
|
||||
state.send(Command::DisplayRequest);
|
||||
|
||||
@@ -114,7 +114,7 @@ pub fn run_emulator(
|
||||
processor.memory.write_range(offset, data);
|
||||
}
|
||||
Command::Interrupt(_interrupt) => {
|
||||
update = true;
|
||||
// update = true;
|
||||
|
||||
todo!("implement interrupts")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user