diff options
author | Determinant <ted.sybil@gmail.com> | 2017-11-15 12:38:11 -0500 |
---|---|---|
committer | Determinant <ted.sybil@gmail.com> | 2017-11-15 12:38:11 -0500 |
commit | 7ced09699636956fe1c0e4bc9748d482c1b40239 (patch) | |
tree | 577bfdcdb92348c6d7e1d1f20498e033d22eab15 /src/memory.rs | |
parent | 5e09a190d48a28055bc7a0989940b43bb10d295d (diff) |
...
Diffstat (limited to 'src/memory.rs')
-rw-r--r-- | src/memory.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/memory.rs b/src/memory.rs index d2c9e52..6b960ec 100644 --- a/src/memory.rs +++ b/src/memory.rs @@ -18,18 +18,15 @@ pub struct CPUMemory<'a> { } impl<'a> CPUMemory<'a> { - pub fn new(mapper: &'a VMem) -> Self { + pub fn new(ppu: *mut PPU<'a>, mapper: &'a VMem) -> Self { CPUMemory{sram: UnsafeCell::new([0; 2048]), cpu: Cell::new(null_mut()), - ppu: Cell::new(null_mut()), + ppu: Cell::new(ppu), mapper} } - pub fn init(&self, - cpu: *mut CPU<'a>, - ppu: *mut PPU<'a>) { + pub fn init(&self, cpu: *mut CPU<'a>) { self.cpu.set(cpu); - self.ppu.set(ppu); } } |