From 59e2c93bb5fd4301a7653c568419376374c2c33a Mon Sep 17 00:00:00 2001 From: Oxore Date: Mon, 11 Nov 2019 01:43:23 +0300 Subject: Add ram and rom, implement basic MOV functionality --- src/main.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 358ac4e..dc2f600 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,14 +7,14 @@ use std::thread::sleep; use std::{thread, time}; mod core; -mod ram; +mod rom; use self::core::Core; fn core_worker(mut core: Core, should_stop: &Mutex, cvar: &Condvar) { loop { while !(*should_stop.lock().unwrap()) { - core.step(); println!("{}", core.op()); + core.step(); sleep(time::Duration::from_millis(1000)); } @@ -55,7 +55,7 @@ fn main() { let asyncpair = Arc::new((Mutex::new(false), Condvar::new())); let asyncpair2 = asyncpair.clone(); - let core = match Core::new_with_ram_from_hex(data) { + let core = match Core::new_with_rom_from_hex(data) { Ok(value) => value, Err(err_string) => { println!("{}", err_string); @@ -63,8 +63,6 @@ fn main() { } }; - println!("{}", core.op()); - thread::spawn(move || { let (ref should_stop, ref condvar) = *asyncpair2; core_worker(core, should_stop, condvar); -- cgit v1.2.3