aboutsummaryrefslogtreecommitdiff
path: root/src/ppu.rs
diff options
context:
space:
mode:
authorDeterminant <ted.sybil@gmail.com>2017-12-09 15:30:31 +0800
committerDeterminant <ted.sybil@gmail.com>2017-12-09 15:30:31 +0800
commitbc6440d96f3226d39a4a56dcc55dc7809f7fbc37 (patch)
tree45526a847f9dcc6b1bcd56b18dd0b4bb64cc4103 /src/ppu.rs
parent1f664ad8d6a820a73bba52bc78b6e2fbb1b12345 (diff)
clock by audio
Diffstat (limited to 'src/ppu.rs')
-rw-r--r--src/ppu.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ppu.rs b/src/ppu.rs
index 945100a..87ac6de 100644
--- a/src/ppu.rs
+++ b/src/ppu.rs
@@ -6,6 +6,7 @@ use core::intrinsics::transmute;
pub trait Screen {
fn put(&mut self, x: u8, y: u8, color: u8);
fn render(&mut self);
+ fn frame(&mut self);
}
#[repr(C, packed)]
@@ -52,7 +53,7 @@ pub struct PPU<'a> {
early_read: bool,
/* IO */
mem: PPUMemory<'a>,
- scr: &'a mut Screen,
+ pub scr: &'a mut Screen,
}
impl<'a> PPU<'a> {
@@ -199,7 +200,6 @@ impl<'a> PPU<'a> {
const FLAG_OVERFLOW: u8 = 1 << 5;
const FLAG_SPRITE_ZERO: u8 = 1 << 6;
const FLAG_VBLANK: u8 = 1 << 7;
-
#[inline(always)]
fn fetch_nametable_byte(&mut self) {
self.bg_nt = self.mem.read_nametable(self.v & 0x0fff);