Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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;
        }