mirror of
https://github.com/transistorfet/moa.git
synced 2024-06-04 14:29:41 +00:00
7868bc3014
It's now possible to run the monitor program until it loops waiting for the serial transmitter to be ready for writing
39 lines
902 B
Rust
39 lines
902 B
Rust
|
|
#[macro_use]
|
|
mod error;
|
|
mod memory;
|
|
mod cpus;
|
|
mod devices;
|
|
|
|
use crate::memory::{AddressSpace, MemoryBlock};
|
|
use crate::cpus::m68k::MC68010;
|
|
use crate::devices::mc68681::MC68681;
|
|
|
|
fn main() {
|
|
let mut space = AddressSpace::new();
|
|
let monitor = MemoryBlock::load("monitor.bin").unwrap();
|
|
for byte in monitor.contents.iter() {
|
|
print!("{:02x} ", byte);
|
|
}
|
|
space.insert(0x00000000, Box::new(monitor));
|
|
|
|
let ram = MemoryBlock::new(vec![0; 0x00100000]);
|
|
space.insert(0x00100000, Box::new(ram));
|
|
|
|
let serial = MC68681::new();
|
|
space.insert(0x00700000, Box::new(serial));
|
|
|
|
let mut cpu = MC68010::new();
|
|
cpu.set_breakpoint(0x0838);
|
|
while cpu.is_running() {
|
|
match cpu.step(&mut space) {
|
|
Ok(()) => { },
|
|
Err(err) => {
|
|
cpu.dump_state(&space);
|
|
panic!("{:?}", err);
|
|
},
|
|
}
|
|
}
|
|
}
|
|
|