示例#1
0
        public void GPU_Draw(int x1, int x2, int y1, int y2, PublicStuff.DrawMode mode)
        {
            if (mode == PublicStuff.DrawMode.Nothing)
            {
                return;
            }

            if (mode == PublicStuff.DrawMode.FullRectangle)
            {
                for (int x = x1; x <= x2; x++)
                {
                    for (int y = y1; y <= y2; y++)
                    {
                        DrawPixel(x, y);
                    }
                }
            }

            if (mode == PublicStuff.DrawMode.FirstHalf)
            {
                for (int x = x1; x <= x2; x++)
                {
                    DrawPixel(x, y1);
                    DrawPixel(x, y2);
                }
            }

            if (mode == PublicStuff.DrawMode.SecondHalf)
            {
                for (int y = y1; y <= y2; y++)
                {
                    DrawPixel(x1, y);
                    DrawPixel(x2, y);
                }

            }

            if (mode == PublicStuff.DrawMode.Dot)
            {
                for (int x = x1; x <= x2; x += 2)
                {
                    for (int y = y1; y <= y2; y += 2)
                    {
                        DrawPixel(x, y);
                    }
                }

            }

            // This function doesn't exist in the redgame. it was just a test function.
            if (mode == PublicStuff.DrawMode.Pixel)
            {
                DrawPixel(x1, y1);
                DrawPixel(x2, y2);

            }
        }
示例#2
0
 public void WriteToROM(PublicStuff.ROMs location, String Value)
 {
     Int32 Location = Convert.ToInt32(location);
     String Name = GetROMName(location);
     this.Invoke(new MethodInvoker(delegate {
         lbROM.BeginUpdate();
         lbROM.Items.RemoveAt(Location);
         lbROM.Items.Insert(Location, String.Format("{0} ({1}): {2}", Name, ToBinary(Location), addZeros(Value, 4)));
         RegisterRead[Location] = Value;
         lbROM.EndUpdate();
     }));
 }
示例#3
0
 public String ReadFromROM(PublicStuff.ROMs location)
 {
     Int32 Location = Convert.ToInt32(location);
     return RegisterRead[Location];
 }
示例#4
0
 public String ReadFromRegister(PublicStuff.Registers location)
 {
     Int32 Location = Convert.ToInt32(location);
     return RegisterWrite[Location];
 }
示例#5
0
 public String GetROMName(PublicStuff.ROMs location)
 {
     String O = "";
     switch (location)
     {
         case PublicStuff.ROMs.ROM1:       O = "ROM1"; break;
         case PublicStuff.ROMs.RNG:        O = "RNG "; break;
         case PublicStuff.ROMs.ROM3:       O = "ROM3"; break;
         case PublicStuff.ROMs.ALU_Answer: O = "ALU "; break;
         case PublicStuff.ROMs.ROM2:       O = "ROM2"; break;
         case PublicStuff.ROMs.UI:         O = "UI  "; break;
         case PublicStuff.ROMs.ROM4:       O = "ROM4"; break;
     }
     return O;
 }
示例#6
0
 public String GetRegisterName(PublicStuff.Registers location)
 {
     String O = "";
     switch (location) {
         case PublicStuff.Registers.Y1:           O = "Y1  "; break;
         case PublicStuff.Registers.ALU1:         O = "ALU1"; break;
         case PublicStuff.Registers.Y2:           O = "Y2  "; break;
         case PublicStuff.Registers.ALU2:         O = "ALU2"; break;
         case PublicStuff.Registers.X2:           O = "X2  "; break;
         case PublicStuff.Registers.X1:           O = "X1  "; break;
         case PublicStuff.Registers.Numberscreen: O = "NS  "; break;
     }
     return O;
 }