From 5be0d9084b4e10a82caec8f6ca86c2d56856ce0e Mon Sep 17 00:00:00 2001 From: Determinant Date: Fri, 24 Nov 2017 22:50:53 -0500 Subject: wrap around the palette value --- src/bin.rs | 4 ++-- src/ppu.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bin.rs b/src/bin.rs index e608e7e..76ef5c9 100644 --- a/src/bin.rs +++ b/src/bin.rs @@ -2,8 +2,8 @@ extern crate core; use std::fs::File; use std::io::Read; -use core::cell::RefCell; -use core::intrinsics::transmute; +use std::cell::RefCell; +use std::intrinsics::transmute; use std::time::{Instant, Duration}; use std::thread::sleep; diff --git a/src/ppu.rs b/src/ppu.rs index 095e3e1..faf0664 100644 --- a/src/ppu.rs +++ b/src/ppu.rs @@ -440,7 +440,7 @@ impl<'a> PPU<'a> { 0 => 0, _ => bg } - })); + }) & 0x3f); } pub fn new(mem: PPUMemory<'a>, scr: &'a mut Screen) -> Self { -- cgit v1.2.3-70-g09d2