public ExecutionController(AltoSystem system)
        {
            _system = system;

            _execAbort = false;
            _userAbort = false;
        }
Exemple #2
0
        public void AttachSystem(AltoSystem system)
        {
            _system = system;
            _system.AttachDisplay(this);

            _controller = new ExecutionController(_system);

            _controller.ErrorCallback    += OnExecutionError;
            _controller.ShutdownCallback += OnShutdown;

            // Update disk image UI info
            // Diablo disks:
            Drive0ImageName.Text = _system.DiskController.Drives[0].IsLoaded ? Path.GetFileName(_system.DiskController.Drives[0].Pack.PackName) : Resources.NoImageLoadedText;
            Drive1ImageName.Text = _system.DiskController.Drives[1].IsLoaded ? Path.GetFileName(_system.DiskController.Drives[1].Pack.PackName) : Resources.NoImageLoadedText;

            // Trident disks
            for (int i = 0; i < _tridentImageNames.Count; i++)
            {
                TridentDrive drive = _system.TridentController.Drives[i];
                _tridentImageNames[i].Text = drive.IsLoaded ? Path.GetFileName(drive.Pack.PackName) : Resources.NoImageLoadedText;
            }

            //
            // If a startup script was specified, start it running now --
            // tell the script manager to start the script, and start the
            // Alto system running so that the script actually executes.
            //
            if (!string.IsNullOrWhiteSpace(StartupOptions.ScriptFile))
            {
                StartScriptPlayback(StartupOptions.ScriptFile);
                _controller.StartExecution(AlternateBootType.None);
            }
        }
Exemple #3
0
        public void AttachSystem(AltoSystem system)
        {
            _system = system;
            _system.AttachDisplay(this);

            _controller = new ExecutionController(_system);

            _controller.ErrorCallback += OnExecutionError;

            // Update disk image UI info
            Drive0ImageName.Text = _system.DiskController.Drives[0].IsLoaded ? Path.GetFileName(_system.DiskController.Drives[0].Pack.PackName) : _noImageLoadedText;
            Drive1ImageName.Text = _system.DiskController.Drives[1].IsLoaded ? Path.GetFileName(_system.DiskController.Drives[1].Pack.PackName) : _noImageLoadedText;
        }
Exemple #4
0
        static void Main(string[] args)
        {
            // Handle command-line args
            PrintHerald();

            // See if WinPCap is installed and working
            TestPCap();

            _system = new AltoSystem();

            if (!String.IsNullOrEmpty(Configuration.Drive0Image))
            {
                try
                {
                    _system.LoadDrive(0, Configuration.Drive0Image);
                }
                catch (Exception e)
                {
                    Console.WriteLine("Could not load image '{0}' for drive 0.  Error '{1}'.", Configuration.Drive0Image, e.Message);
                    _system.UnloadDrive(0);
                }
            }

            if (!String.IsNullOrEmpty(Configuration.Drive1Image))
            {
                try
                {
                    _system.LoadDrive(1, Configuration.Drive1Image);
                }
                catch (Exception e)
                {
                    Console.WriteLine("Could not load image '{0}' for drive 1.  Error '{1}'.", Configuration.Drive1Image, e.Message);
                    _system.UnloadDrive(1);
                }
            }

            //
            // Attach handlers so that we can properly flush state if we're terminated.
            //
            AppDomain.CurrentDomain.ProcessExit += OnProcessExit;

            //
            // Invoke the main UI window; this will run until the user closes it, at which
            // point we are done.
            //
            using (AltoWindow mainWindow = new AltoWindow())
            {
                mainWindow.AttachSystem(_system);
                Application.Run(mainWindow);
            }
        }
Exemple #5
0
        public Debugger(AltoSystem system, ExecutionController controller)
        {
            _system     = system;
            _controller = controller;
            _microcodeBreakpointEnabled = new bool[5, 1024];
            _novaBreakpointEnabled      = new bool[65536];

            _controller.StepCallback  += OnExecutionStep;
            _controller.ErrorCallback += OnExecutionError;

            // Pick up the current execution status (if the main window hands us a running
            // system, we want to know).
            _execType = _controller.IsRunning ? ExecutionType.Normal : ExecutionType.None;

            InitializeComponent();
            InitControls();
            RefreshUI();
        }
        public void AttachSystem(AltoSystem system)
        {
            _system = system;
            _system.AttachDisplay(this);

            _controller = new ExecutionController(_system);

            _controller.ErrorCallback += OnExecutionError;

            // Update disk image UI info
            // Diablo disks:
            Drive0ImageName.Text = _system.DiskController.Drives[0].IsLoaded ? Path.GetFileName(_system.DiskController.Drives[0].Pack.PackName) : _noImageLoadedText;
            Drive1ImageName.Text = _system.DiskController.Drives[1].IsLoaded ? Path.GetFileName(_system.DiskController.Drives[1].Pack.PackName) : _noImageLoadedText;

            // Trident disks
            for (int i = 0; i < _tridentImageNames.Count; i++)
            {
                TridentDrive drive = _system.TridentController.Drives[i];
                _tridentImageNames[i].Text = drive.IsLoaded ? Path.GetFileName(drive.Pack.PackName) : _noImageLoadedText;
            }
        }
        static void Main(string[] args)
        {
            //
            // Check for command-line arguments.
            // We expect at most one argument, specifying a configuration file to load.
            //
            StartupArgs = args;
            if (args.Length > 1)
            {
                Console.WriteLine("usage: Contralto <config file>");
                return;
            }

            // Handle command-line args
            PrintHerald();

            _system = new AltoSystem();

            // Load disks specified by configuration
            if (!String.IsNullOrEmpty(Configuration.Drive0Image))
            {
                try
                {
                    _system.LoadDiabloDrive(0, Configuration.Drive0Image, false);
                }
                catch (Exception e)
                {
                    Console.WriteLine("Could not load image '{0}' for Diablo drive 0.  Error '{1}'.", Configuration.Drive0Image, e.Message);
                    _system.UnloadDiabloDrive(0);
                }
            }

            if (!String.IsNullOrEmpty(Configuration.Drive1Image))
            {
                try
                {
                    _system.LoadDiabloDrive(1, Configuration.Drive1Image, false);
                }
                catch (Exception e)
                {
                    Console.WriteLine("Could not load image '{0}' for Diablo drive 1.  Error '{1}'.", Configuration.Drive1Image, e.Message);
                    _system.UnloadDiabloDrive(1);
                }
            }


            if (Configuration.TridentImages != null)
            {
                for (int i = 0; i < Math.Min(8, Configuration.TridentImages.Count); i++)
                {
                    try
                    {
                        if (!String.IsNullOrWhiteSpace(Configuration.TridentImages[i]))
                        {
                            _system.LoadTridentDrive(i, Configuration.TridentImages[i], false);
                        }
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine("Could not load image '{0}' for Trident drive {1}.  Error '{2}'.", Configuration.TridentImages[i], i, e.Message);
                        _system.UnloadTridentDrive(i);
                    }
                }
            }

            //
            // Attach handlers so that we can properly flush state if we're terminated.
            //
            AppDomain.CurrentDomain.ProcessExit += OnProcessExit;

            //
            // Invoke the main UI window; this will run until the user closes it, at which
            // point we are done.
            //

            if (Configuration.Platform == PlatformType.Windows)
            {
                using (AltoWindow mainWindow = new AltoWindow())
                {
                    mainWindow.AttachSystem(_system);
                    Application.Run(mainWindow);
                }
            }
            else
            {
                using (SdlAltoWindow mainWindow = new SdlAltoWindow())
                {
                    // Invoke the command-line console
                    SdlConsole console = new SdlConsole(_system);
                    console.Run(mainWindow);

                    // Start the SDL display running.
                    mainWindow.AttachSystem(_system);
                    mainWindow.Run();
                }
            }
        }
Exemple #8
0
        static void Main(string[] args)
        {
            //
            // Check for command-line arguments.
            //
            if (args.Length > 0)
            {
                for (int i = 0; i < args.Length; i++)
                {
                    switch (args[i++].ToLowerInvariant())
                    {
                    case "-config":
                        if (i < args.Length)
                        {
                            StartupOptions.ConfigurationFile = args[i];
                        }
                        else
                        {
                            PrintUsage();
                            return;
                        }
                        break;

                    case "-script":
                        if (i < args.Length)
                        {
                            StartupOptions.ScriptFile = args[i];
                        }
                        else
                        {
                            PrintUsage();
                            return;
                        }
                        break;

                    case "-rompath":
                        if (i < args.Length)
                        {
                            StartupOptions.RomPath = args[i];
                        }
                        else
                        {
                            PrintUsage();
                            return;
                        }
                        break;

                    default:
                        PrintUsage();
                        return;
                    }
                }
            }

            PrintHerald();

            _system = new AltoSystem();

            // Load disks specified by configuration
            if (!String.IsNullOrEmpty(Configuration.Drive0Image))
            {
                try
                {
                    _system.LoadDiabloDrive(0, Configuration.Drive0Image, false);
                }
                catch (Exception e)
                {
                    Console.WriteLine("Could not load image '{0}' for Diablo drive 0.  Error '{1}'.", Configuration.Drive0Image, e.Message);
                    _system.UnloadDiabloDrive(0);
                }
            }

            if (!String.IsNullOrEmpty(Configuration.Drive1Image))
            {
                try
                {
                    _system.LoadDiabloDrive(1, Configuration.Drive1Image, false);
                }
                catch (Exception e)
                {
                    Console.WriteLine("Could not load image '{0}' for Diablo drive 1.  Error '{1}'.", Configuration.Drive1Image, e.Message);
                    _system.UnloadDiabloDrive(1);
                }
            }


            if (Configuration.TridentImages != null)
            {
                for (int i = 0; i < Math.Min(8, Configuration.TridentImages.Count); i++)
                {
                    try
                    {
                        if (!String.IsNullOrWhiteSpace(Configuration.TridentImages[i]))
                        {
                            _system.LoadTridentDrive(i, Configuration.TridentImages[i], false);
                        }
                    }
                    catch (Exception e)
                    {
                        Console.WriteLine("Could not load image '{0}' for Trident drive {1}.  Error '{2}'.", Configuration.TridentImages[i], i, e.Message);
                        _system.UnloadTridentDrive(i);
                    }
                }
            }

            //
            // Attach handlers so that we can properly flush state if we're terminated.
            //
            AppDomain.CurrentDomain.ProcessExit += OnProcessExit;

            //
            // Invoke the main UI window; this will run until the user closes it, at which
            // point we are done.
            //

            if (Configuration.Platform == PlatformType.Windows)
            {
                using (AltoWindow mainWindow = new AltoWindow())
                {
                    mainWindow.AttachSystem(_system);
                    Application.Run(mainWindow);
                }
            }
            else
            {
                using (SdlAltoWindow mainWindow = new SdlAltoWindow())
                {
                    // Invoke the command-line console
                    SdlConsole console = new SdlConsole(_system);
                    console.Run(mainWindow);

                    // Start the SDL display running.
                    mainWindow.AttachSystem(_system);
                    mainWindow.Run();
                }
            }
        }