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

Method writeControl

nes/apu.go:666–673  ·  view source on GitHub ↗
(value byte)

Source from the content-addressed store, hash-verified

664}
665
666func (n *Noise) writeControl(value byte) {
667 n.lengthEnabled = (value>>5)&1 == 0
668 n.envelopeLoop = (value>>5)&1 == 1
669 n.envelopeEnabled = (value>>4)&1 == 0
670 n.envelopePeriod = value & 15
671 n.constantVolume = value & 15
672 n.envelopeStart = true
673}
674
675func (n *Noise) writePeriod(value byte) {
676 n.mode = value&0x80 == 0x80

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected