libtrackerboy/engine/apucontrol

Source   Edit  

APU Control

A module used by the engine module for determining the register writes needed by an ApuOperation object.

This module is part of the inner workings of the engine module, and has an unstable API.

Types

ApuWrite = tuple[regaddr, value: uint8]
Tuple for an APU register write. Consists of an address in the $FF00 page and a value to write. Source   Edit  
ApuWriteList = FixedSeq[64, ApuWrite]
A container for a list of APU writes. Source   Edit  

Procs

proc clearChannel(chno: ChannelId; writes: var ApuWriteList) {....raises: [],
    tags: [], forbids: [].}
Adds the writes needed to the list to clear a given channel. Source   Edit  
func getWrites(op: ApuOperation; wt: WaveformTable; nr51: uint8): ApuWriteList {.
    ...raises: [], tags: [], forbids: [].}
Gets the list of writes needed for a given operation.
  • op: the operation
  • wt: the waveform table to use
  • nr51: the current value of APU register NR51

A list of register writes is returned.

Source   Edit  
func nr43(state: ChannelState): uint8 {....raises: [], tags: [], forbids: [].}
Source   Edit  

Templates

template add(l: var ApuWriteList; regaddr, value: uint8)
Source   Edit