diff options
author | Determinant <[email protected]> | 2017-11-13 20:08:39 -0500 |
---|---|---|
committer | Determinant <[email protected]> | 2017-11-13 20:08:39 -0500 |
commit | 71cbf2b7aeeafb2d7b7c6cfcc1e7938b36f79fb1 (patch) | |
tree | c047dcef78f20f7130f8258bf12de15e8f768d90 /src/main.rs | |
parent | c3581c738a597735d13b755b73c4e305af3cd926 (diff) |
..
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index b5c45de..54885ca 100644 --- a/src/main.rs +++ b/src/main.rs @@ -184,19 +184,25 @@ fn main() { let mut ppu = ppu::PPU::new(&pmem, &win); let mut cpu = mos6502::CPU::new(&mem); mem.init(&mut cpu, &mut ppu); - + let mut cnt = 0; + let mut cnt2 = 0; loop { if win.poll() {break} cpu.step(); //println!("cpu at 0x{:04x}", cpu.get_pc()); while cpu.cycle > 0 { for _ in 0..3 { + cnt2 += 1; if ppu.tick() { println!("triggering nmi"); cpu.trigger_nmi(); + println!("{} cpu {} ppu per frame", cnt, cnt2); + cnt2 = 0; + cnt = 0; } } cpu.cycle -= 1; + cnt += 1; } } } |