From 19e0e4cb5f26df537bf07b428700bea30460fd5b Mon Sep 17 00:00:00 2001 From: Oxore Date: Thu, 5 Mar 2020 00:33:55 +0300 Subject: Use bus for all memory types, etc. Rename Memory to Bus --- src/main.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index f43a33e..5aa3307 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,10 +6,13 @@ use std::io::prelude::*; use std::sync::mpsc::{channel, Receiver, Sender}; use std::thread; use std::time::Duration; +use std::rc::Rc; +use std::cell::RefCell; mod cpu8051; -mod memory; +mod bus; mod progmem; +mod ram; use self::cpu8051::Cpu8051; use self::progmem::ProgramMemory; @@ -135,7 +138,7 @@ fn main() { fs::read_to_string(filename).unwrap_or_else(|_| panic!("Unable to read file {}", filename)); let cpu = Cpu8051::new().rom(match ProgramMemory::from_hex(data) { - Ok(value) => value, + Ok(value) => Rc::new(RefCell::new(value)), Err(err_string) => { println!("{}", err_string); return; -- cgit v1.2.3