private void FlushOutputEvent() { UpdateCycles(); // TODO: better than simple decimation here!! Output(_highCycles * short.MaxValue / _totalCycles); _highCycles = _totalCycles = 0; _events.AddEvent(CyclesPerFlush * _cpu.Multiplier, EventCallbacks.FlushOutput); }
public Speaker(MachineEvents events, ICpu cpu) { _events = events; _cpu = cpu; _events.AddEventDelegate(EventCallbacks.FlushOutput, FlushOutputEvent); _events.AddEvent(CyclesPerFlush * _cpu.Multiplier, EventCallbacks.FlushOutput); _isHigh = false; _highCycles = _totalCycles = 0; }