Exemplo n.º 1
0
        private void SpriteReadOp(Clock.Clock clock, byte firstSprite, byte cycle)
        {
            byte sprite = (byte)(firstSprite + (cycle >> 1));

            if ((cycle & 1) == 0)
                _vic.SpritePointers[sprite] = (ushort)(_vic.Memory.Read(_vic.GetVideoMemoryAddress((ushort)(0x3f8 | sprite))) << 6);

            if (_vic.SpriteDMA[sprite])
            {
                if ((cycle & 1) == 0)
                    clock.Stall(2, 1);

                for (byte reads = (byte)((cycle & 1) + 1); reads > 0; reads--)
                {
                    _vic.SDataBuffer[sprite].Enqueue(_vic.Memory.Read((ushort)(_vic.GetRawMemoryAddress((ushort)(_vic.SpritePointers[sprite] + _vic.MC[sprite])))));
                    _vic.MC[sprite]++;
                }
            }
        }
Exemplo n.º 2
0
        private void RefreshReadOp14(Clock.Clock clock)
        {
            if (_vic.BadLine)
            {
                clock.Stall(40, 1);
                _vic.WriteVideoMatrix(_vic.Memory.Read(_vic.GetVideoMemoryAddress(_vic.VC)), _vic.ColorRam.ReadDirect(_vic.VC));
            }

            for (byte i = 0; i < 8; i++)
            {
                if (_vic.YExpandFlip[i] || !_vic.GetSpriteExpY(i))
                {
                    _vic.MCBase[i] += 3;

                    if (_vic.MCBase[i] > 63)
                    {
                        _vic.SDataBuffer[i].Clear();
                        _vic.SpriteDMA[i] = false;
                        _vic.SpriteDisplay[i] = false;
                    }
                }
            }
        }