private void bw_DoWork(object sender, DoWorkEventArgs e)
        {
            BackgroundWorker worker = sender as BackgroundWorker;
            System8080       system = e.Argument as System8080;

            system.boot();
        }
        private void initializeCpu()
        {
            system = new System8080();
            debug  = new Debugger(system);

            system.addOutput(new DebugDevice(6), 6);
            system.addOutput(new DebugDevice(3), 3);
            system.addOutput(new DebugDevice(5), 5);
            var controller = new ArcadeController();

            system.addInput(controller, 1);
            system.addInput(new DebugDevice(0, true, 0xff), 0);
            //system.addInput(new DebugDevice(1, false, 0x81), 1);
            system.addInput(new DebugDevice(2, false, 0x83), 2);

            this.KeyDown += new KeyEventHandler(controller.KeyDown);
            this.KeyUp   += new KeyEventHandler(controller.KeyUp);


            var shift = new ShiftDevice();

            system.addInput(shift, 3);
            system.addOutput(shift, 2);
            system.addOutput(shift, 4);

            system.AddVideo(this);


            MemoryStream ms = loadInvaders();

            system.loadProgram(ms, 0);

            startInterruptTimer();

            // boot i8080
            bw         = new BackgroundWorker();
            bw.DoWork += new DoWorkEventHandler(bw_DoWork);
            bw.RunWorkerAsync(system);
        }