Exemple #1
0
        private void dataPanel_DataClick(object Sender, ushort Addr)
        {
            int num     = m_spectrum.ReadMemory(Addr);
            var service = Locator.Resolve <IUserQuery>();

            if (service == null)
            {
                return;
            }
            if (service.QueryValue("POKE #" + Addr.ToString("X4"), "Value:", "#{0:X2}", ref num, 0, 0xff))
            {
                m_spectrum.WriteMemory(Addr, (byte)num);
                UpdateCPU(false);
            }
        }
Exemple #2
0
        private void bitmapGridSpriteView_MouseUp(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                int clickedPixel = bitmapGridSpriteView.getClickedPixel(e);
                int temp         = (int)numericUpDownActualAddress.Value + clickedPixel / 8;
                if (temp > 0xFFFF)
                {
                    temp -= 0xFFFF;
                }
                UInt16 bitToToggleAddress = Convert.ToUInt16(temp);
                if (bitToToggleAddress < 0x4000)
                {
                    return; //cannot change ROM
                }
                byte memValue = _spectrum.ReadMemory(bitToToggleAddress);

                memValue = (byte)GraphicsTools.ToggleBit(memValue, clickedPixel % 8);
                _spectrum.WriteMemory(Convert.ToUInt16(bitToToggleAddress), memValue);

                setZXImage(); //refresh
            }
        }