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

Method writeControl

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

Source from the content-addressed store, hash-verified

396}
397
398func (p *Pulse) writeControl(value byte) {
399 p.dutyMode = (value >> 6) & 3
400 p.lengthEnabled = (value>>5)&1 == 0
401 p.envelopeLoop = (value>>5)&1 == 1
402 p.envelopeEnabled = (value>>4)&1 == 0
403 p.envelopePeriod = value & 15
404 p.constantVolume = value & 15
405 p.envelopeStart = true
406}
407
408func (p *Pulse) writeSweep(value byte) {
409 p.sweepEnabled = (value>>7)&1 == 1

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected