Example #1
0
 private void dasmPanel_GetData(object Sender, ushort ADDR, int len, out byte[] data)
 {
     data = new byte[len];
     for (int i = 0; i < len; i++)
     {
         data[i] = m_spectrum.ReadMemory((ushort)(ADDR + i));
     }
 }
Example #2
0
 public void wrapInterface(IDebuggable i_debuggable)
 {
     readMemory8BitDelegate  = delegate(ushort memAdress) { return(i_debuggable.ReadMemory(memAdress)); };
     readMemory16BitDelegate = delegate(ushort memAdress)
     {
         return((ushort)(i_debuggable.ReadMemory(memAdress) | i_debuggable.ReadMemory(++memAdress) << 8));
     };
 }
Example #3
0
        public void setBitmapBits(IDebuggable i_spectrum, ushort i_startAddress)
        {
            int gridBytes = X_BIT_COUNT / 8 * Y_BIT_COUNT;

            _gridBits = new BitArray[gridBytes];

            for (int counter = 0; counter < gridBytes; counter++)
            {
                byte blockByte = i_spectrum.ReadMemory(i_startAddress++);
                _gridBits[counter] = GraphicsTools.getAttributePixels(blockByte, false);
            }
        }
Example #4
0
        /// <summary>
        /// Screen View type
        /// </summary>
        public void setZXScreenView()
        {
            if (_spectrum == null || m_instance == null)
            {
                return;
            }

            pictureZXDisplay.Width  = ZX_SCREEN_WIDTH;
            pictureZXDisplay.Height = ZX_SCREEN_HEIGHT;

            bmpZXMonochromatic = new Bitmap(ZX_SCREEN_WIDTH / 2, ZX_SCREEN_HEIGHT / 2);
            ushort screenPointer = (ushort)numericUpDownActualAddress.Value;

            //Screen View
            for (int segments = 0; segments < 3; segments++)
            {
                for (int eightLines = 0; eightLines < 8; eightLines++)
                {
                    //Cycle: Fill 8 lines in one segment
                    for (int linesInSegment = 0; linesInSegment < 64; linesInSegment += 8)
                    {
                        // Cycle: all attributes in 1 line
                        for (int attributes = 0; attributes < 32; attributes++)
                        {
                            byte blockByte = _spectrum.ReadMemory(screenPointer++);

                            BitArray spriteBits = GraphicsTools.getAttributePixels(blockByte, m_instance.checkBoxMirror.Checked);
                            if (spriteBits == null)
                            {
                                return;
                            }

                            // Cycle: fill 8 pixels for 1 attribute
                            for (int pixels = 0; pixels < 8; pixels++)
                            {
                                if (spriteBits[pixels])
                                {
                                    bmpZXMonochromatic.SetPixel(pixels + (attributes * 8), linesInSegment + eightLines + (segments * 64), Color.Black);
                                }
                                else
                                {
                                    bmpZXMonochromatic.SetPixel(pixels + (attributes * 8), linesInSegment + eightLines + (segments * 64), Color.White);
                                }
                            }
                        }
                    }
                }
            } // 3 segments of the ZX Screen

            //Size newSize = new Size((int)(pictureZXDisplay.Width), (int)(pictureZXDisplay.Height));

            /*pictureZXDisplay.Image = bmpZXMonochromatic;
             * pictureZXDisplay.Width = ZX_SCREEN_WIDTH;
             * pictureZXDisplay.Height = ZX_SCREEN_HEIGHT;*/
            Image resizedImage = bmpZXMonochromatic.GetThumbnailImage(ZX_SCREEN_WIDTH, ZX_SCREEN_HEIGHT, null, IntPtr.Zero);

            pictureZXDisplay.Image    = resizedImage;
            pictureZXDisplay.SizeMode = PictureBoxSizeMode.StretchImage;
        }