This commit is contained in:
Daniel Bauer
2020-01-04 23:19:17 +01:00
parent 6ed5f0339a
commit 47043b42a2
3 changed files with 26 additions and 18 deletions

View File

@@ -32,19 +32,24 @@ impl NES {
}
}
// Insert a cartridge into the NES. This inserts the cartridge memory
// into the NES address range
pub fn insert_cartridge(&mut self, cartridge: Cartridge) {
self.memory.insert_cartridge(cartridge);
}
// Initializes the NES CPU programm pointer
pub fn start(&mut self) {
self.cpu.find_pc_addr(&self.memory);
}
// Reset the CPU
pub fn reset(&mut self) {
self.clock_count = 0;
self.cpu.reset(&self.memory);
}
// A single clock on the NES
pub fn clock(&mut self) {
self.clock_count += 1;
if self.clock_count % 3 == 0 {