src/emulator/PPU.js
// tick updates Cycle, ScanLine and Frame counters
tick updates Cycle, ScanLine and Frame counters
tick updates Cycle ScanLine and Frame counters
tick() {
        if (this.nmiDelay > 0) {
            this.nmiDelay--
            if (this.nmiDelay == 0 && this.nmiOutput && this.nmiOccurred) {
                this.nes.CPU.triggerNMI()
            }
        }
        if (this.flagShowBackground != 0 || this.flagShowSprites != 0) {
            if (this.f == 1 && this.scanLine == 261 && this.cycle == 339) {
                this.cycle = 0
                this.scanLine = 0
                this.frameCounter++
                this.f ^= 1
                return
            }
        }
        this.cycle++
        if (this.cycle > 340) {
            this.cycle = 0
            this.scanLine++
            if (this.scanLine > 261) {
                this.scanLine = 0
                this.frameCounter++
                this.f ^= 1
            }
        }
    }
tick ( ) { if ( this . nmiDelay > 0 ) { this . nmiDelay -- if ( this . nmiDelay == 0 && this . nmiOutput && this . nmiOccurred ) { this . nes . CPU . triggerNMI ( ) } } if ( this . flagShowBackground != 0 || this . flagShowSprites != 0 ) { if ( this . f == 1 && this . scanLine == 261 && this . cycle == 339 ) { this . cycle = 0 this . scanLine = 0 this . frameCounter ++ this . f ^= 1 return } } this . cycle ++ if ( this . cycle > 340 ) { this . cycle = 0 this . scanLine ++ if ( this . scanLine > 261 ) { this . scanLine = 0 this . frameCounter ++ this . f ^= 1 } } }
tick updates Cycle, ScanLine and Frame counters
tick updates Cycle ScanLine and Frame counters