MCPcopy Create free account
hub / github.com/fogleman/nes / stepTimer

Method stepTimer

nes/apu.go:685–701  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

683}
684
685func (n *Noise) stepTimer() {
686 if n.timerValue == 0 {
687 n.timerValue = n.timerPeriod
688 var shift byte
689 if n.mode {
690 shift = 6
691 } else {
692 shift = 1
693 }
694 b1 := n.shiftRegister & 1
695 b2 := (n.shiftRegister >> shift) & 1
696 n.shiftRegister >>= 1
697 n.shiftRegister |= (b1 ^ b2) << 14
698 } else {
699 n.timerValue--
700 }
701}
702
703func (n *Noise) stepEnvelope() {
704 if n.envelopeStart {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected