Ejemplo n.º 1
0
        public void Tick()
        {
            if (!_transferInProgress)
            {
                return;
            }
            if (++_ticks < 648 / _speedMode.GetSpeedMode())
            {
                return;
            }

            _transferInProgress = false;
            _restarted          = false;
            _ticks = 0;

            for (var i = 0; i < 0xa0; i++)
            {
                _oam.SetByte(0xfe00 + i, _addressSpace.GetByte(_from + i));
            }
        }
Ejemplo n.º 2
0
        public void Tick()
        {
            if (!_transferInProgress)
            {
                return;
            }

            if (++_divider >= Gameboy.TicksPerSec / 8192 / _speedMode.GetSpeedMode())
            {
                _transferInProgress = false;
                try
                {
                    _sb = _serialEndpoint.transfer(_sb);
                }
                catch (IOException e)
                {
                    Debug.WriteLine($"Can't transfer byte {e}");
                    _sb = 0;
                }

                _interruptManager.RequestInterrupt(InterruptManager.InterruptType.Serial);
            }
        }