Esempio n. 1
0
 public void Detach()
 {
     Stop();
     engine = null;
     midi.Close();
     midi = null;
 }
Esempio n. 2
0
 public void Detach()
 {
     beep.Reset();
     engine = null;
     beep.Stop();
     beep = null;
 }
Esempio n. 3
0
 public void Attach(IAsyncEngine aEngine)
 {
     engine = aEngine;
     coreSize = engine.Project.Rules.CoreSize;
     midi=new MidiOut();
     midi.Open(0);
     midi.Instrument(73);
 }
Esempio n. 4
0
 public void Attach(IAsyncEngine aEngine)
 {
     engine = aEngine;
     coreSize = engine.Project.Rules.CoreSize;
     rows = coreSize / columns;
     beep = new BeepOut();
     beep.Start();
 }
Esempio n. 5
0
 public void Attach(TableLayoutPanel panel, int aWarriorIndex)
 {
     Dock = DockStyle.Fill;
     warriorIndex = aWarriorIndex;
     panel.Controls.Add(this, aWarriorIndex, 0);
     engine = IDEApplication.Instance.Engine;
     groupBox.Text = engine.Warriors[aWarriorIndex].Name + " by " +
                     engine.Warriors[aWarriorIndex].Author;
     view = new TaskListCoreView(engine, aWarriorIndex);
     coreList.View = view;
     coreList.Attach(engine);
     coreList.PaintNextInstruction = true;
 }
Esempio n. 6
0
 public CoreBindingList(IAsyncEngine aEngine, ICoreBindingView aView)
 {
     Engine = aEngine;
     view   = aView;
 }
Esempio n. 7
0
 public CoreBindingList(IAsyncEngine aEngine, ICoreBindingView aView)
 {
     Engine = aEngine;
     view = aView;
 }
Esempio n. 8
0
        public static string GetMemoryTooltip(IAsyncEngine engine, int address)
        {
            IRunningInstruction instruction = engine[address];
            CoreEventRecord evnt = engine.CoreEvents[address];

            StringBuilder tooltipText = new StringBuilder(200);
            IRunningWarrior owner = instruction.OriginalOwner;
            IInstruction source = instruction.OriginalInstruction;
            tooltipText.Append(instruction.ToString());
            if (source != null)
            {
                tooltipText.Append("\r\nCopy from: ");
                if (owner != null)
                {
                    tooltipText.Append(owner.Name);
                    tooltipText.Append("\r\n");
                }
                tooltipText.Append(source.GetLine(ParserOptions.Full, false).Trim());
            }

            //dead
            if ((evnt.Event & InstructionEvent.Died) != 0)
            {
                if (evnt.Died!=null)
                {
                    tooltipText.Append("\r\n");
                    tooltipText.Append("Died: ");
                    tooltipText.Append(evnt.Died.Name);
                }
                else
                {
                    tooltipText.Append("\r\nDied");
                }
            }
            else if (evnt.Died!=null)
            {
                tooltipText.Append("\r\nLast death: ");
                tooltipText.Append(evnt.Died.Name);
            }

            //exec
            if ((evnt.Event & InstructionEvent.Executed) != 0)
            {
                if (evnt.Executed != null)
                {
                    tooltipText.Append("\r\nExecuted by: ");
                    tooltipText.Append(evnt.Executed.Name);
                }
                else
                {
                    tooltipText.Append("\r\nExecuted");
                }
            }
            else if (evnt.Executed != null)
            {
                tooltipText.Append("\r\nLast execution by: ");
                tooltipText.Append(evnt.Executed.Name);
            }

            //write instruction
            if ((evnt.Event & InstructionEvent.WrittenInstruction) != 0)
            {
                tooltipText.Append("\r\nInstruction written by: ");
                tooltipText.Append(evnt.WrittenInstruction.Name);
            }
            else if (evnt.WrittenInstruction != null)
            {
                tooltipText.Append("\r\nInstruction last written by: ");
                tooltipText.Append(evnt.WrittenInstruction.Name);
            }

            //write data
            if ((evnt.Event & InstructionEvent.WrittenData) != 0)
            {
                tooltipText.Append("\r\nData written by: ");
                tooltipText.Append(evnt.WrittenData.Name);
            }
            else if (evnt.WrittenData != null)
            {
                tooltipText.Append("\r\nData last written by: ");
                tooltipText.Append(evnt.WrittenData.Name);
            }

            //read
            if ((evnt.Event & InstructionEvent.Read) != 0)
            {
                tooltipText.Append("\r\nRead by: ");
                tooltipText.Append(evnt.Read.Name);
            }
            else if (evnt.Read != null)
            {
                tooltipText.Append("\r\nLast read by: ");
                tooltipText.Append(evnt.Read.Name);
            }

            //tasks
            foreach (IRunningWarrior warrior in engine.LiveWarriors)
            {
                bool found = false;
                int index = 0;
                int count = 0;
                foreach (int task in warrior.Tasks)
                {
                    if (task == address)
                    {
                        if (!found)
                        {
                            found = true;
                            tooltipText.Append("\nIn task queue of: ");
                            tooltipText.Append(warrior.Name);
                            tooltipText.Append(" at");
                        }
                        tooltipText.Append(" ");
                        tooltipText.Append(index.ToString());
                        count++;
                    }
                    index++;
                    if (count > 10)
                    {
                        tooltipText.Append(" ...");
                        break;
                    }
                }
            }

            return tooltipText.ToString();
        }
Esempio n. 9
0
 public CoreListView(IAsyncEngine aEngine)
 {
     coreSize = aEngine.CoreSize;
 }
Esempio n. 10
0
 public void Detach()
 {
     engine = null;
     font.Dispose();
 }
Esempio n. 11
0
 public void Attach(IAsyncEngine aEngine)
 {
     engine = aEngine;
     scrollBar.Maximum = View.Count;
     font = new Font("Courier New", 8.25F, FontStyle.Regular, GraphicsUnit.Point);
 }
Esempio n. 12
0
 public TaskListCoreView(IAsyncEngine aEngine, int aWarriorIndex)
 {
     warriorIndex = aWarriorIndex;
     engine = aEngine;
     Update();
 }