feat: reimplement cycles newtype

This commit is contained in:
2021-01-18 22:54:38 -06:00
parent 2fc7ac3833
commit 9b4c95ce4c
8 changed files with 273 additions and 143 deletions

View File

@@ -1,3 +1,5 @@
use crate::instruction::Cycles;
use super::cartridge::Cartridge;
use super::high_ram::HighRAM;
use super::interrupt::Interrupt;
@@ -50,6 +52,12 @@ impl Bus {
pub fn load_cartridge(&mut self, path: &str) {
self.cartridge = Some(Cartridge::new(path).unwrap());
}
pub fn step(&mut self, cycles: Cycles) {
let _ = self.timer.step(cycles);
let _ = self.sound.step(cycles);
let _ = self.ppu.step(cycles);
}
}
impl Bus {