initial commit
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
use arc_swap::ArcSwap;
|
||||
use std::{
|
||||
sync::{
|
||||
Arc,
|
||||
atomic::{AtomicBool, AtomicU8},
|
||||
},
|
||||
thread,
|
||||
time::Duration,
|
||||
};
|
||||
|
||||
use crate::processor::{processor::Emulator, state::SharedState};
|
||||
|
||||
mod memory;
|
||||
mod processor;
|
||||
|
||||
fn main() {
|
||||
let mut emulator = Emulator::new();
|
||||
let state = emulator.state_handle();
|
||||
let runner = thread::spawn(move || emulator.run());
|
||||
let observer = thread::spawn(|| observe(state));
|
||||
|
||||
runner.join().unwrap();
|
||||
observer.join().unwrap();
|
||||
}
|
||||
|
||||
fn observe(state: Arc<SharedState>) {
|
||||
loop {
|
||||
thread::sleep(std::time::Duration::from_millis(100));
|
||||
let state = state.proc.load();
|
||||
println!("GP Registers: {:?}", state.gp_registers);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user