initial commit

This commit is contained in:
2026-03-03 10:26:19 +00:00
commit ebb9489410
15 changed files with 633 additions and 0 deletions
+32
View File
@@ -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);
}
}