コード例 #1
0
ファイル: Program.cs プロジェクト: fschuhi/Robotron_2084
        static void Main(string[] args)
        {
            /*
             * using (var reader = new StreamReader( @"s:\source\repos\Robotron_2084\VirtuRoX\tmp\MemoryOperations.csv" ))
             * using (var csv = new CsvReader( reader, Thread.CurrentThread.CurrentCulture )) {
             *  _records = csv.GetRecords<RecordedMemoryOperation>().ToList();
             * }
             *
             * var bla = _records.GroupBy( info => info.Address ).Select( group => new Tuple<int, int>( group.Key, group.Count() ) ).OrderBy( x => x.Item1 );
             * _dict = bla.ToDictionary( x => x.Item1 );
             * Console.WriteLine( _dict.Count );
             * object[,] res = GetReadCounts( 224, 32 );
             * Console.WriteLine( _dict.ToString() );
             * return;
             */
            /*
             * AsmLinesWindow wnd1 = new AsmLinesWindow();
             * wnd1.ShowDialog();
             * return;
             */

            Parser.Default.ParseArguments <Options>(args)
            .WithParsed <Options>(o => {
                ConsoleTraceListener tracer = new ConsoleTraceListener();
                Trace.Listeners.Add(tracer);
                Trace.WriteLine("Main() start");

                AsmReader reader = new AsmReader(@"s:\source\repos\Robotron_2084\Disassemblies\Robotron (Apple).asm");
                //reader.Test1();

                Trace.WriteLine($"Running workbench{(o.Breakpoints ? "with" : "without")} breakpoints: -b {o.Breakpoints}");

                using (_machineOperator = new MachineOperator()) {
                    if (o.Breakpoints)
                    {
                        // _machineOperator.OnPaused += MachineOperator_OnPaused;
                        _workbench = new Workbench(_machineOperator, o);
                    }
                    else
                    {
                        _machineOperator.OnLoaded += ( MachineOperator mo ) => mo.LoadStateFromFile(mo.BlaBin);
                    }

                    //Form1 frm = new Form1();
                    //frm.Populate();
                    //frm.Show();

                    _machineOperator.ShowDialog();
                }


                Trace.WriteLine("Main() end");
                Trace.Flush();
                Trace.Listeners.Remove(tracer);
                tracer.Close();
                Trace.Close();
            });
        }
コード例 #2
0
        public void SampleTest()
        {
            Trace.Indent();

            Parser.Default.ParseArguments <Options>(new string[] { "-b -c -f" })
            .WithParsed <Options>(o => {
                using (MachineOperator machineOperator = new MachineOperator()) {
                    Workbench workbench = new Workbench(machineOperator, o);
                    machineOperator.ShowDialog();
                }
            });

            Trace.Unindent();
        }