diff options
author | Oxore <oxore@protonmail.com> | 2020-03-05 00:33:55 +0300 |
---|---|---|
committer | Oxore <oxore@protonmail.com> | 2020-03-05 00:36:29 +0300 |
commit | 19e0e4cb5f26df537bf07b428700bea30460fd5b (patch) | |
tree | 8f55e2525d107d28899aa3b486c3c8485965aa04 /src/main.rs | |
parent | 7d4dfd8af842796c4eb8a88df0cc5ab30f99232d (diff) |
Use bus for all memory types, etc.
Rename Memory to Bus
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 7 |
1 files changed, 5 insertions, 2 deletions
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; |