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
+7
View File
@@ -1,2 +1,9 @@
# forge # forge
A flash emulator with my own stuff A flash emulator with my own stuff
## Opcodes
| OP | INST | Action |
|-----------|-----------|-----------|
| 0 | LBK | Goes to the next instruction |
| 1 | HLT | Stops further emulation of the program |
+28 -1
View File
@@ -2,6 +2,33 @@ mod binary;
mod emulator; mod emulator;
mod text; mod text;
use std::sync::Arc;
use osui::prelude::*;
fn main() { 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}"
}
}
} }