public void ApplyCommand(byte commandCode) { var command = PsgCommandUtils.Create(commandCode); switch (command) { case LatchPsgCommand lc: _latchType = lc.Type; _latchChannel = lc.Channel; WriteFourLowBits(lc.FourLowBits); UpdateLatchFrequencyAndVolume(); break; case DataPsgCommand dc: WriteHighBits(dc.Data); UpdateLatchFrequencyAndVolume(); break; default: throw new InvalidOperationException(); } }
public LatchPsgCommand(PsgChannel channel, PsgLatchType type, int fourLowBits) { Channel = channel; Type = type; FourLowBits = fourLowBits; }