Пример #1
0
        private void DrawScreen()
        {
            var i = 0;

            DrawBorder();

            for (var y = 0; y < 200; y++)
            {
                var offset = (y + 8) * Width + 8;
                var x      = 0;
                if (!_mem.IsDirty(y))
                {
                    i += 40;
                }
                else
                {
                    for (var xx = 0; xx < 40; xx++)
                    {
                        var col = _mem.Color(i);
                        var c2  = col & 0x0F;
                        var c1  = col >> 4;
                        var cc2 = Palette[c1];
                        var cc1 = Palette[c2];

                        var pt = _mem.Point(i);
                        if ((0x80 & pt) != 0)
                        {
                            _pixels[x + offset] = cc2;
                        }
                        else
                        {
                            _pixels[x + offset] = cc1;
                        }
                        x++;
                        if ((0x40 & pt) != 0)
                        {
                            _pixels[x + offset] = cc2;
                        }
                        else
                        {
                            _pixels[x + offset] = cc1;
                        }
                        x++;
                        if ((0x20 & pt) != 0)
                        {
                            _pixels[x + offset] = cc2;
                        }
                        else
                        {
                            _pixels[x + offset] = cc1;
                        }
                        x++;
                        if ((0x10 & pt) != 0)
                        {
                            _pixels[x + offset] = cc2;
                        }
                        else
                        {
                            _pixels[x + offset] = cc1;
                        }
                        x++;
                        if ((0x08 & pt) != 0)
                        {
                            _pixels[x + offset] = cc2;
                        }
                        else
                        {
                            _pixels[x + offset] = cc1;
                        }
                        x++;
                        if ((0x04 & pt) != 0)
                        {
                            _pixels[x + offset] = cc2;
                        }
                        else
                        {
                            _pixels[x + offset] = cc1;
                        }
                        x++;
                        if ((0x02 & pt) != 0)
                        {
                            _pixels[x + offset] = cc2;
                        }
                        else
                        {
                            _pixels[x + offset] = cc1;
                        }
                        x++;
                        if ((0x01 & pt) != 0)
                        {
                            _pixels[x + offset] = cc2;
                        }
                        else
                        {
                            _pixels[x + offset] = cc1;
                        }
                        x++;
                        i++;
                    }
                }
            }
        }