CPU can now decode instructions, just waiting on the assembler

This commit is contained in:
2025-06-15 02:34:23 +01:00
parent 4e9cc2849e
commit 53ed41c077
12 changed files with 588 additions and 224 deletions
+13 -16
View File
@@ -1,24 +1,23 @@
use std::{sync::{Arc, Mutex}, thread};
use std::{
sync::{Arc, Mutex},
thread,
};
use dsa_rs::emulator::{system::{emulator::run_emulator, memory::MainStore, processor::Processor}, ui::{control_unit::ControlPanel, interface::EmulatorUI}};
use egui::Memory;
use dsa_rs::emulator::{
system::{emulator::run_emulator, memory::MainStore, processor::Processor},
ui::{control_unit::ControlPanel, interface::EmulatorUI, memory_inspector::MemoryInspector, stack_inspector::StackInspector},
};
fn main() -> Result<(), eframe::Error> {
// Initialize Channels
let (cmd_sender, cmd_receiver) = std::sync::mpsc::channel();
let (state_sender, state_receiver) = std::sync::mpsc::channel();
let mainstore = MainStore::new();
let processor = Processor::new(Box::new(mainstore));
thread::spawn(move || {
run_emulator(
cmd_receiver,
state_sender,
Arc::new(Mutex::new(processor)),
);
run_emulator(cmd_receiver, state_sender, Arc::new(Mutex::new(processor)));
});
// Create UI
@@ -28,13 +27,11 @@ fn main() -> Result<(), eframe::Error> {
let control_unit = ControlPanel::new(cmd_sender.clone());
ui.add_component(Box::new(control_unit));
let mem_inspector = MemoryInspector::new(cmd_sender.clone());
ui.add_component(Box::new(mem_inspector));
let stack_inspector = StackInspector::new();
ui.add_component(Box::new(stack_inspector));
// Run UI
let options = eframe::NativeOptions {