fixed PPU scroll issue

This commit is contained in:
2026-08-10 22:36:13 -05:00
parent 2c0aa5f18f
commit 2e8244f0cf
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -79,7 +79,7 @@ fn run_dbg(path: &str) {
cpu.reset(&mut bus); cpu.reset(&mut bus);
let mut dumper = dump::Dumper::new(); let mut dumper = dump::Dumper::new();
let mut renderer = PpmRenderer::new(); // <-- add this let mut renderer = PpmRenderer::new(); // <-- add this
let frames: u32 = 360; let frames: u32 = 1800;
for f in 0..frames { for f in 0..frames {
while !bus.frame_done() { while !bus.frame_done() {
+1 -1
View File
@@ -179,7 +179,7 @@ impl Ppu {
pub fn write(&mut self, cart: &mut Cartridge, addr: u16, val: u8) { pub fn write(&mut self, cart: &mut Cartridge, addr: u16, val: u8) {
match addr & 0x2007 { match addr & 0x2007 {
0x2000 => self.ctrl = val, 0x2000 => { self.ctrl = val; self.t = (self.t & !0x0C00) | (((val & 0x03) as u16) << 10); },
0x2001 => self.mask = val, 0x2001 => self.mask = val,
0x2002 => {} // write ignored 0x2002 => {} // write ignored
0x2003 => self.oamaddr = val, 0x2003 => self.oamaddr = val,