aboutsummaryrefslogtreecommitdiff
path: root/src/mos6502.rs
diff options
context:
space:
mode:
authorDeterminant <ted.sybil@gmail.com>2017-11-15 12:38:11 -0500
committerDeterminant <ted.sybil@gmail.com>2017-11-15 12:38:11 -0500
commit7ced09699636956fe1c0e4bc9748d482c1b40239 (patch)
tree577bfdcdb92348c6d7e1d1f20498e033d22eab15 /src/mos6502.rs
parent5e09a190d48a28055bc7a0989940b43bb10d295d (diff)
...
Diffstat (limited to 'src/mos6502.rs')
-rw-r--r--src/mos6502.rs8
1 files changed, 5 insertions, 3 deletions
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<IntType>,
- 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;