Render: don't render all sprites for every background tile

This commit is contained in:
Andrew Glaze
2024-08-21 17:45:32 -04:00
parent 6974110b22
commit bd21449256
3 changed files with 45 additions and 49 deletions

View File

@@ -20,12 +20,8 @@ class Bus {
func tick(_ cycles: UInt8) {
self.cycles += Int(cycles)
let nmiBefore = ppu.nmiInterrupt != nil
//print(nmiBefore)
self.ppu.tick(cycles * 3)
let nmiAfter = ppu.nmiInterrupt != nil
//print(nmiAfter)
if !nmiBefore && nmiAfter {
let newFrame = self.ppu.tick(cycles * 3)
if newFrame {
gameloopCallback(ppu)
}