moa/src/main.rs
transistor 92342c23ed More instruction execution, enough to loop
I'm using the monitor.bin binary built from computie to boot the
virtual machine, and it currently runs and loops, but there is no
actual serial device, so it's hard to tell if it's working correctly
2021-09-29 21:52:38 -07:00

36 lines
784 B
Rust

#[macro_use]
mod error;
mod memory;
mod cpus;
use crate::memory::{AddressSpace, Segment};
use crate::cpus::m68k::MC68010;
fn main() {
let mut space = AddressSpace::new();
let monitor = Segment::load(0x00000000, "monitor.bin").unwrap();
for byte in monitor.contents.iter() {
print!("{:02x} ", byte);
}
space.insert(monitor);
let ram = Segment::new(0x00100000, vec![0; 0x00100000]);
space.insert(ram);
let serial = Segment::new(0x00700000, vec![0; 0x30]);
space.insert(serial);
let mut cpu = MC68010::new();
while cpu.is_running() {
match cpu.step(&mut space) {
Ok(()) => { },
Err(err) => {
cpu.dump_state();
panic!("{:?}", err);
},
}
}
}