Exemplo n.º 1
0
        public Form1()
        {
            InitializeComponent();
            Show();
            desasm.Init();
            VGA.DecodeurAdresse = 0;            // VGA.ROMSUP_OFF;
            Z80.Init();
            pictureBox1.Image = VGA.Init(pictureBox1.Width, pictureBox1.Height);
            PPI.Init();
            UPD.Init();
            CRTC.Init();
            Keyboard.OptReset();
            int nbCycles = 0;

            while (!finMain)
            {
                int  cycle    = Z80.ExecInstr();
                bool DoResync = CRTC.CycleCRTC(cycle);
                UPD.Cycle(cycle);
                nbCycles += cycle;
                if (debugMode.Checked)
                {
                    while (!doExec && debugMode.Checked)
                    {
                        DoRefresh();
                    }
                    doExec = false;
                }
                else
                {
                    if ((DoResync && nbCycles > 1000) || nbCycles > 100000)
                    {
                        DoRefresh();
                        nbCycles = 0;
                    }
                }
            }
        }