mirror of
https://github.com/Candygoblen123/SwiftNES.git
synced 2025-09-12 05:22:02 -05:00
PPU: impl NMI interrupt
This commit is contained in:
@@ -2,6 +2,7 @@ class Bus {
|
||||
var cpuVram: [UInt8] = .init(repeating: 0, count: 2048)
|
||||
var prgRom: [UInt8]
|
||||
var ppu: NesPPU
|
||||
var cycles: Int = 0
|
||||
|
||||
fileprivate let RAM : UInt16 = 0x0000
|
||||
fileprivate let RAM_MIRRORS_END: UInt16 = 0x1FFF
|
||||
@@ -14,6 +15,15 @@ class Bus {
|
||||
ppu = NesPPU(rom.character, rom.screenMirror)
|
||||
self.prgRom = rom.program
|
||||
}
|
||||
|
||||
func tick(_ cycles: UInt8) {
|
||||
self.cycles += Int(cycles)
|
||||
self.ppu.tick(cycles * 3)
|
||||
}
|
||||
|
||||
func pollNMI() -> UInt8? {
|
||||
ppu.nmiInterrupt
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user