From 7ced09699636956fe1c0e4bc9748d482c1b40239 Mon Sep 17 00:00:00 2001 From: Determinant Date: Wed, 15 Nov 2017 12:38:11 -0500 Subject: ... --- src/mos6502.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/mos6502.rs') diff --git a/src/mos6502.rs b/src/mos6502.rs index 7b39de4..fdce0ab 100644 --- a/src/mos6502.rs +++ b/src/mos6502.rs @@ -1,5 +1,5 @@ #![allow(dead_code)] -use memory::VMem; +use memory::{CPUMemory, VMem}; pub const CPU_FREQ: u32 = 1789773; macro_rules! make_optable { ($x:ident, $t: ty) => (pub const $x: [$t; 0x100] = [ @@ -233,6 +233,7 @@ macro_rules! read16 { } mod ops { + use memory::VMem; use mos6502::*; make_optable!(OPS, fn (&mut CPU)); @@ -595,6 +596,7 @@ mod ops { } mod addr { + use memory::VMem; use mos6502::{CPU}; make_addrtable!(ADDR_MODES, fn (&mut CPU) -> u8); @@ -686,7 +688,7 @@ pub struct CPU<'a> { imm_val: u8, pub cycle: u32, int: Option, - pub mem: &'a VMem + pub mem: CPUMemory<'a> } macro_rules! make_int { @@ -712,7 +714,7 @@ impl<'a> CPU<'a> { #[inline(always)] pub fn get_over(&self) -> u8 { (self.status >> 6) & 1 } #[inline(always)] pub fn get_neg(&self) -> u8 { (self.status >> 7) & 1 } - pub fn new(mem: &'a VMem) -> Self { + pub fn new(mem: CPUMemory<'a>) -> Self { let pc = read16!(mem, RESET_VECTOR as u16); /* nes power up state */ let a = 0; -- cgit v1.2.3-70-g09d2