diff options
author | Determinant <ted.sybil@gmail.com> | 2018-01-04 18:30:00 +0800 |
---|---|---|
committer | Determinant <ted.sybil@gmail.com> | 2018-01-04 18:30:00 +0800 |
commit | df6acf714c3ea975e75057b8b5a1d5e0fdf83109 (patch) | |
tree | c439741c5aa753bb3a56f8e5d9c0c4fa626bf5a1 /src/ppu.rs | |
parent | b93b77d07d91bd2cd518005bce5cfd9a0622e9df (diff) |
optimize CPU/PPU memory access
Diffstat (limited to 'src/ppu.rs')
-rw-r--r-- | src/ppu.rs | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -243,7 +243,7 @@ impl<'a> PPU<'a> { fn load_bgtile(&mut self) { /* load the tile bitmap to high 8 bits of bitmap, * assume the high 8 bits are zeros */ - assert!(self.bg_pixel >> 32 == 0); + debug_assert!(self.bg_pixel >> 32 == 0); let mut t: u64 = 0; let mut bl = self.bg_bit_low; let mut bh = self.bg_bit_high; @@ -505,15 +505,15 @@ impl<'a> PPU<'a> { } fn _tick(&mut self) -> bool { - if self.scanline == 240 { - self.vblank_lines = true - } else if self.scanline == 261 { - self.vblank_lines = false - } //self.elapsed += 1; let cycle = self.cycle; if cycle == 0 { self.cycle = 1; + if self.scanline == 240 { + self.vblank_lines = true + } else if self.scanline == 261 { + self.vblank_lines = false + } return false; } let rendering = self.get_show_bg() || self.get_show_sp(); |