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

Method Load

nes/apu.go:373–396  ·  view source on GitHub ↗
(decoder *gob.Decoder)

Source from the content-addressed store, hash-verified

371}
372
373func (p *Pulse) Load(decoder *gob.Decoder) error {
374 decoder.Decode(&p.enabled)
375 decoder.Decode(&p.channel)
376 decoder.Decode(&p.lengthEnabled)
377 decoder.Decode(&p.lengthValue)
378 decoder.Decode(&p.timerPeriod)
379 decoder.Decode(&p.timerValue)
380 decoder.Decode(&p.dutyMode)
381 decoder.Decode(&p.dutyValue)
382 decoder.Decode(&p.sweepReload)
383 decoder.Decode(&p.sweepEnabled)
384 decoder.Decode(&p.sweepNegate)
385 decoder.Decode(&p.sweepShift)
386 decoder.Decode(&p.sweepPeriod)
387 decoder.Decode(&p.sweepValue)
388 decoder.Decode(&p.envelopeEnabled)
389 decoder.Decode(&p.envelopeLoop)
390 decoder.Decode(&p.envelopeStart)
391 decoder.Decode(&p.envelopePeriod)
392 decoder.Decode(&p.envelopeValue)
393 decoder.Decode(&p.envelopeVolume)
394 decoder.Decode(&p.constantVolume)
395 return nil
396}
397
398func (p *Pulse) writeControl(value byte) {
399 p.dutyMode = (value >> 6) & 3

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected