Start of DMD machine-level
This commit is contained in:
parent
584722eaab
commit
839008f66b
|
@ -2,3 +2,4 @@
|
||||||
**/*.rs.bk
|
**/*.rs.bk
|
||||||
Cargo.lock
|
Cargo.lock
|
||||||
.idea
|
.idea
|
||||||
|
.DS_Store
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
use bus::{AccessCode, Bus};
|
use bus::{AccessCode, Bus};
|
||||||
use err::{CpuError, CpuException};
|
use err::*;
|
||||||
use instr::*;
|
use instr::*;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
|
@ -391,7 +391,7 @@ impl<'a> Cpu<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Reset the CPU.
|
/// Reset the CPU.
|
||||||
pub fn reset(&mut self, bus: &mut Bus) -> Result<(), CpuError> {
|
pub fn reset(&mut self, bus: &mut Bus) -> Result<(), BusError> {
|
||||||
//
|
//
|
||||||
// The WE32100 Manual, Page 2-52, describes the reset process
|
// The WE32100 Manual, Page 2-52, describes the reset process
|
||||||
//
|
//
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
use bus::Bus;
|
||||||
|
use cpu::Cpu;
|
||||||
|
use rom_lo::LO_ROM;
|
||||||
|
use rom_hi::HI_ROM;
|
||||||
|
use err::*;
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
|
pub struct Dmd<'a> {
|
||||||
|
bus: Bus<'a>,
|
||||||
|
cpu: Cpu<'a>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
|
impl<'a> Dmd<'a> {
|
||||||
|
pub fn new() -> Dmd<'a> {
|
||||||
|
let cpu = Cpu::new();
|
||||||
|
let bus = Bus::new(0x20000);
|
||||||
|
Dmd { cpu, bus }
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn reset(&mut self) -> Result<(), BusError> {
|
||||||
|
self.bus.load(0, &LO_ROM)?;
|
||||||
|
self.bus.load(0x10000, &HI_ROM)?;
|
||||||
|
self.cpu.reset(&mut self.bus)?;
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -5,6 +5,9 @@ pub mod cpu;
|
||||||
pub mod err;
|
pub mod err;
|
||||||
pub mod mem;
|
pub mod mem;
|
||||||
pub mod instr;
|
pub mod instr;
|
||||||
|
pub mod rom_lo;
|
||||||
|
pub mod rom_hi;
|
||||||
|
pub mod dmd;
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate lazy_static;
|
extern crate lazy_static;
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue