Beispiel #1
0
        private void SystemTimer_Tick(object sender, EventArgs e)
        {
            byte chr;
            int  value;

            Address4.Value(Computer.Address[3]);
            Address3.Value(Computer.Address[2]);
            Address2.Value(Computer.Address[1]);
            Address1.Value(Computer.Address[0]);
            Data2.Value(Computer.Data[1]);
            Data1.Value(Computer.Data[0]);
            TapeCounter.Text = Computer.TapeDeck.TapeCounter().ToString();
            chr = Computer.TeleType.NextPrintByte();
            while (chr != 0)
            {
                TeleType.AppendText(((char)chr).ToString());
                if (tapePunch.Running)
                {
                    tapePunch.Punch(chr);
                }
                chr = Computer.TeleType.NextPrintByte();
            }
            if (tapeReader.Running)
            {
                value = tapeReader.Next();
                if (value >= 0)
                {
                    Computer.TeleType.Send((byte)value);
                }
            }
            if (Computer.cpu.Debug && !Computer.cpu.NextStep && !singleStepRead)
            {
                DebugA.Text   = Computer.cpu.ac.ToString("X2");
                DebugX.Text   = Computer.cpu.x.ToString("X2");
                DebugY.Text   = Computer.cpu.y.ToString("X2");
                DebugPC.Text  = Computer.cpu.pc.ToString("X2");
                DebugS.Text   = Computer.cpu.sp.ToString("X2");
                FlagN.Visible = ((Computer.cpu.flags & 0x80) == 0x80);
                FlagV.Visible = ((Computer.cpu.flags & 0x40) == 0x40);
                FlagB.Visible = ((Computer.cpu.flags & 0x10) == 0x10);
                FlagD.Visible = ((Computer.cpu.flags & 0x08) == 0x08);
                FlagI.Visible = ((Computer.cpu.flags & 0x04) == 0x04);
                FlagZ.Visible = ((Computer.cpu.flags & 0x02) == 0x02);
                FlagC.Visible = ((Computer.cpu.flags & 0x01) == 0x01);
                DebugOutput.AppendText(Computer.cpu.DebugOutput + "\r\n");
                singleStepRead = true;
            }
        }