rmg-001/src/console.rs

38 lines
1.0 KiB
Rust
Raw Normal View History

2021-10-14 01:50:48 +00:00
use std::{thread, time};
use crate::cpu::CPU;
use crate::ppu::PPU;
use crate::bus::Bus;
pub struct Console {
cpu: CPU,
ppu: PPU,
bus: Bus,
}
impl Console {
pub fn new() -> Self {
Self {
cpu: CPU::new(),
ppu: PPU::new(),
bus: Bus::new(),
}
}
pub fn cpu_run(&mut self) {
2021-10-14 01:50:48 +00:00
let mut exit = false;
while !exit {
self.cpu.run(&mut self.bus);
2021-10-18 15:13:23 +00:00
// thread::sleep(time::Duration::from_millis(100));
2021-10-20 02:55:35 +00:00
// exit = self.cpu.get_exec_calls_count() >= 1258895; // log 1
// exit = self.cpu.get_exec_calls_count() >= 1068422; // log 3
2021-10-20 03:36:10 +00:00
// exit = self.cpu.get_exec_calls_count() >= 1262766; // log 4
// exit = self.cpu.get_exec_calls_count() >= 1763388; // log 5
// exit = self.cpu.get_exec_calls_count() >= 1763388; // log 5
// exit = self.cpu.get_exec_calls_count() >= 243272; // log 6
2021-10-20 17:29:55 +00:00
// exit = self.cpu.get_exec_calls_count() >= 287416; // log 7
2021-10-14 01:50:48 +00:00
}
}
}