public ScreenAdapter(ZXSpectrum.Screen zxScreen)
        {
            this.zxScreen = zxScreen;

            // Initialize the ZX Spectrum color palette
            IList<Color> zxColors = new List<Color>();
            zxColors.Add(Color.FromRgb(0x00, 0x00, 0x00)); // black      -- (bright 0) --
            zxColors.Add(Color.FromRgb(0x00, 0x00, 0xCD)); // blue
            zxColors.Add(Color.FromRgb(0xCD, 0x00, 0x00)); // red
            zxColors.Add(Color.FromRgb(0xCD, 0x00, 0xCD)); // magenta
            zxColors.Add(Color.FromRgb(0x00, 0xCD, 0x00)); // green
            zxColors.Add(Color.FromRgb(0x00, 0xCD, 0xCD)); // cyan
            zxColors.Add(Color.FromRgb(0xCD, 0xCD, 0x00)); // yellow
            zxColors.Add(Color.FromRgb(0xCD, 0xCD, 0xCD)); // white
            zxColors.Add(Color.FromRgb(0x00, 0x00, 0x00)); // black      -- (bright 1) --
            zxColors.Add(Color.FromRgb(0x00, 0x00, 0xFF)); // blue
            zxColors.Add(Color.FromRgb(0xFF, 0x00, 0x00)); // red
            zxColors.Add(Color.FromRgb(0xFF, 0x00, 0xFF)); // magenta
            zxColors.Add(Color.FromRgb(0x00, 0xFF, 0x00)); // green
            zxColors.Add(Color.FromRgb(0x00, 0xFF, 0xFF)); // cyan
            zxColors.Add(Color.FromRgb(0xFF, 0xFF, 0x00)); // yellow
            zxColors.Add(Color.FromRgb(0xFF, 0xFF, 0xFF)); // white
            BitmapPalette zxPalette = new BitmapPalette(zxColors);

            // Initialize a writeable bitmap to draw the zx screen, and display it through an image
            zxScreenBitmap = new WriteableBitmap(ZXSpectrum.Screen.WIDTH, ZXSpectrum.Screen.HEIGHT, 96, 96, PixelFormats.Indexed4, zxPalette);
        }
Exemplo n.º 2
0
        public ScreenAdapter(ZXSpectrum.Screen zxScreen)
        {
            this.zxScreen = zxScreen;

            // Initialize the ZX Spectrum color palette
            IList <Color> zxColors = new List <Color>();

            zxColors.Add(Color.FromRgb(0x00, 0x00, 0x00)); // black      -- (bright 0) --
            zxColors.Add(Color.FromRgb(0x00, 0x00, 0xCD)); // blue
            zxColors.Add(Color.FromRgb(0xCD, 0x00, 0x00)); // red
            zxColors.Add(Color.FromRgb(0xCD, 0x00, 0xCD)); // magenta
            zxColors.Add(Color.FromRgb(0x00, 0xCD, 0x00)); // green
            zxColors.Add(Color.FromRgb(0x00, 0xCD, 0xCD)); // cyan
            zxColors.Add(Color.FromRgb(0xCD, 0xCD, 0x00)); // yellow
            zxColors.Add(Color.FromRgb(0xCD, 0xCD, 0xCD)); // white
            zxColors.Add(Color.FromRgb(0x00, 0x00, 0x00)); // black      -- (bright 1) --
            zxColors.Add(Color.FromRgb(0x00, 0x00, 0xFF)); // blue
            zxColors.Add(Color.FromRgb(0xFF, 0x00, 0x00)); // red
            zxColors.Add(Color.FromRgb(0xFF, 0x00, 0xFF)); // magenta
            zxColors.Add(Color.FromRgb(0x00, 0xFF, 0x00)); // green
            zxColors.Add(Color.FromRgb(0x00, 0xFF, 0xFF)); // cyan
            zxColors.Add(Color.FromRgb(0xFF, 0xFF, 0x00)); // yellow
            zxColors.Add(Color.FromRgb(0xFF, 0xFF, 0xFF)); // white
            BitmapPalette zxPalette = new BitmapPalette(zxColors);

            // Initialize a writeable bitmap to draw the zx screen, and display it through an image
            zxScreenBitmap = new WriteableBitmap(ZXSpectrum.Screen.WIDTH, ZXSpectrum.Screen.HEIGHT, 96, 96, PixelFormats.Indexed4, zxPalette);
        }