MCPcopy
hub / github.com/fogleman/nes / Step

Method Step

nes/apu.go:99–114  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

97}
98
99func (apu *APU) Step() {
100 cycle1 := apu.cycle
101 apu.cycle++
102 cycle2 := apu.cycle
103 apu.stepTimer()
104 f1 := int(float64(cycle1) / frameCounterRate)
105 f2 := int(float64(cycle2) / frameCounterRate)
106 if f1 != f2 {
107 apu.stepFrameCounter()
108 }
109 s1 := int(float64(cycle1) / apu.sampleRate)
110 s2 := int(float64(cycle2) / apu.sampleRate)
111 if s1 != s2 {
112 apu.sendSample()
113 }
114}
115
116func (apu *APU) sendSample() {
117 output := apu.filterChain.Step(apu.output())

Callers

nothing calls this directly

Calls 3

stepTimerMethod · 0.95
stepFrameCounterMethod · 0.95
sendSampleMethod · 0.95

Tested by

no test coverage detected