Simple emulation (not even close)

This commit is contained in:
2025-10-28 19:53:56 +01:00
parent edd221bb3e
commit 775000e505
2 changed files with 35 additions and 1 deletions
+28 -1
View File
@@ -2,6 +2,33 @@ mod binary;
mod emulator;
mod text;
use std::sync::Arc;
use osui::prelude::*;
fn main() {
let screen = Screen::new();
app(&screen).draw(&screen);
screen.run().unwrap();
}
fn app(_screen: &Arc<Screen>) -> Rsx {
let pc = use_state::<u32>(0);
// Spawn a thread to emulate the program
std::thread::spawn({
let pc = pc.clone();
move || loop {
**pc.get() += 1;
}
});
rsx! {
FlexRow {
%pc
"Program Counter: {pc}"
}
}
}