Skip to content

Commit

Permalink
Step PPU slower; batching had issues with Star Fox
Browse files Browse the repository at this point in the history
  • Loading branch information
twvd committed Mar 23, 2024
1 parent 2b32271 commit 5b0ab04
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/snes/emulator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ where
}
Schedule::PPU => {
// 5.3 MHz
Ok(self.cpu.bus.ppu.tick(1)? * 4)
Ok(self.cpu.bus.ppu.tick(24)? * 4)
}
Schedule::SPC700 => {
// 1.024 MHz
Expand Down
13 changes: 1 addition & 12 deletions src/snes/ppu/ppu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,18 +292,7 @@ where
}
}

let batch = if self.vblank {
// Next time slice after VBlank
(Self::CYCLES_PER_SCANLINE * Self::SCANLINES_PER_FRAME) - self.cycles
} else if self.hblank {
// Next time slice after HBlank
Self::CYCLES_PER_SCANLINE - Self::LINE_HBLANK_START
} else {
// Next time slice at HBlank
Self::LINE_HBLANK_START
};
self.cycles += batch - ticks;
Ok(batch)
Ok(ticks)
}
}

Expand Down

0 comments on commit 5b0ab04

Please sign in to comment.