protected BaseGraphicsScreenMode(VduSystem vdu, int textWidth, int textHeight, int pixelWidth, int pixelHeight, int unitsWidth, int unitsHeight, byte bitsPerPixel)
            : base(vdu, textWidth, textHeight, unitsWidth, unitsHeight, bitsPerPixel)
        {
            this.pixelWidth = pixelWidth;
            this.pixelHeight = pixelHeight;

            // stored the pixel format from the bpp of screenmode
            PixelFormat pixelFormat = CreatePixelFormat(bitsPerPixel);

            bitmap = new Bitmap(SquarePixelWidth, SquarePixelHeight, pixelFormat);
            // define the default text window to be full screen

            needsRepaint = true;

            // TODO: Make this a method in VduSystem
            // define the Graphics char size
            vdu.GraphicsCharSizeX = pixelWidth / textWidth;
            vdu.GraphicsCharSizeY = pixelHeight / textHeight;
            vdu.GraphicsCharSpaceX = pixelWidth / textWidth;
            vdu.GraphicsCharSpaceY = pixelHeight / textHeight;

            // TODO: Make this a method in VduSystem
            // define the Text char size
            vdu.TextCharSizeX = pixelWidth / textWidth;
            vdu.TextCharSizeY = pixelHeight / textHeight;
            vdu.TextCharSpaceX = pixelWidth / textWidth;
            vdu.TextCharSpaceY = pixelHeight / textHeight;

            vduForm = new VduForm(this);
            vduForm.BackColor = Color.Black;
            vduForm.Show(); // TODO: Is this the best place for this?
        }
 protected AbstractScreenMode(VduSystem vdu, int textWidth, int textHeight, int unitsWidth, int unitsHeight, byte bitsPerPixel)
 {
     this.vdu = vdu;
     this.textWidth = textWidth;
     this.textHeight = textHeight;
     this.unitsWidth = unitsWidth;
     this.unitsHeight = unitsHeight;
     this.bitsPerPixel = bitsPerPixel;
 }
Esempio n. 3
0
        static BasicCommands()
        {
            vdu = new VduSystem();
            os = new OS(vdu);
            printManager = new PrintManager(os, vdu);

            ticksAtTime = Environment.TickCount;
            time = ticksAtTime / 10;
        }
Esempio n. 4
0
        private int width = 0; // A width of 0 means that width is ignored

        #endregion Fields

        #region Constructors

        public PrintManager(OS os, VduSystem vdu)
        {
            this.os = os;
            this.vdu = vdu;
            FormatNumber = 0x90A;
        }
 public static AbstractScreenMode CreateScreenMode(VduSystem vdu, byte number)
 {
     switch (number & 127) // after reading prm only bottom 7 bits are used for setting mode (top bit is for shadow modes) PRM 1-597
     {
         case 0: return new PalettedGraphicsScreenMode(vdu, 1, 80, 32, 640, 256, 1280, 1024);
         case 1: return new PalettedGraphicsScreenMode(vdu, 2, 40, 32, 320, 256, 1280, 1024);
         case 2: return new PalettedGraphicsScreenMode(vdu, 4, 20, 32, 160, 256, 1280, 1024);
         case 3: return new PalettedTextScreenMode(vdu, 1, 80, 25); // 1280, 1000 checked by using mouse co-ords in this mode
         case 4: return new PalettedGraphicsScreenMode(vdu, 1, 40, 32, 320, 256, 1280, 1024);
         case 5: return new PalettedGraphicsScreenMode(vdu, 2, 20, 32, 160, 256, 1280, 1024);
         case 6: return new PalettedTextScreenMode(vdu, 1, 40, 25); // 1280, 1000
         case 7: return new TeletextScreenMode(vdu); // 1280, 1000
         case 8: return new PalettedGraphicsScreenMode(vdu, 2, 80, 32, 640, 256, 1280, 1024);
         case 9: return new PalettedGraphicsScreenMode(vdu, 4, 40, 32, 320, 256, 1280, 1024);
         case 10: return new PalettedGraphicsScreenMode(vdu, 8, 20, 32, 160, 256, 1280, 1024);
         case 11: return new PalettedGraphicsScreenMode(vdu, 2, 80, 25, 640, 250, 1280, 1000);
         case 12: return new PalettedGraphicsScreenMode(vdu, 4, 80, 32, 640, 256, 1280, 1024);
         case 13: return new PalettedGraphicsScreenMode(vdu, 8, 40, 32, 320, 256, 1280, 1024);
         case 14: return new PalettedGraphicsScreenMode(vdu, 4, 80, 25, 640, 250, 1280, 1024);
         case 15: return new PalettedGraphicsScreenMode(vdu, 8, 80, 32, 640, 256, 1280, 1024);
         case 16: return new PalettedGraphicsScreenMode(vdu, 4, 132, 32, 1056, 256, 2112, 1024);
         case 17: return new PalettedGraphicsScreenMode(vdu, 4, 132, 25, 1056, 250, 2112, 1000);
         case 18: return new PalettedGraphicsScreenMode(vdu, 1, 80, 64, 640, 512, 1280, 1024);
         case 19: return new PalettedGraphicsScreenMode(vdu, 2, 80, 64, 640, 512, 1280, 1024);
         case 20: return new PalettedGraphicsScreenMode(vdu, 4, 80, 64, 640, 512, 1280, 1024);
         case 21: return new PalettedGraphicsScreenMode(vdu, 8, 80, 64, 640, 512, 1280, 1024);
         case 22: return new PalettedGraphicsScreenMode(vdu, 4, 96, 36, 768, 288, 768, 576);
         case 23: return new PalettedGraphicsScreenMode(vdu, 1, 144, 56, 1152, 896, 2304, 1792);
         case 24: return new PalettedGraphicsScreenMode(vdu, 8, 132, 32, 1056, 256, 2112, 1024);
         case 25: return new PalettedGraphicsScreenMode(vdu, 1, 80, 60,640, 480, 1280, 960);
         case 26: return new PalettedGraphicsScreenMode(vdu, 2, 80, 60, 640, 480, 1280, 960);
         case 27: return new PalettedGraphicsScreenMode(vdu, 4, 80, 60, 640, 480, 1280, 960);
         case 28: return new PalettedGraphicsScreenMode(vdu, 8, 80, 60, 640, 480, 1280, 960);
         case 29: return new PalettedGraphicsScreenMode(vdu, 1, 100, 75, 800, 600, 1600, 1200);
         case 30: return new PalettedGraphicsScreenMode(vdu, 2, 100, 75, 800, 600, 1600, 1200);
         case 31: return new PalettedGraphicsScreenMode(vdu, 4, 100, 75, 800, 600, 1600, 1200);
         case 33: return new PalettedGraphicsScreenMode(vdu, 1, 96, 36, 768, 288, 1536, 1152);
         case 34: return new PalettedGraphicsScreenMode(vdu, 2, 96, 36, 768, 288, 1536, 1152);
         case 35: return new PalettedGraphicsScreenMode(vdu, 4, 96, 36, 768, 288, 1536, 1152);
         case 36: return new PalettedGraphicsScreenMode(vdu, 8, 96, 36, 768, 288, 1536, 1152);
         case 37: return new PalettedGraphicsScreenMode(vdu, 1, 112, 44, 896, 352, 1792, 1408);
         case 38: return new PalettedGraphicsScreenMode(vdu, 2, 112, 44, 896, 352, 1792, 1408);
         case 39: return new PalettedGraphicsScreenMode(vdu, 4, 112, 44, 896, 352, 1792, 1408);
         case 40: return new PalettedGraphicsScreenMode(vdu, 8, 112, 44, 896, 352, 1792, 1408);
         case 41: return new PalettedGraphicsScreenMode(vdu, 1, 80, 44, 640, 352, 1280, 1408);
         case 42: return new PalettedGraphicsScreenMode(vdu, 2, 80, 44, 640, 352, 1280, 1408);
         case 43: return new PalettedGraphicsScreenMode(vdu, 4, 80, 44, 640, 352, 1280, 1408);
         case 44: return new PalettedGraphicsScreenMode(vdu, 1, 80, 25, 640, 200, 1280, 800);
         case 45: return new PalettedGraphicsScreenMode(vdu, 2, 80, 25, 640, 200, 1280, 800);
         case 46: return new PalettedGraphicsScreenMode(vdu, 4, 80, 25, 640, 200, 1280, 800);
         case 47: return new RawConsoleScreenMode(vdu);
         default: throw new NoSuchScreenModeException(number);
     }
 }
 public TrueGraphicsScreenMode(VduSystem vdu, int textWidth, int textHeight, int pixelWidth, int pixelHeight, int unitsWidth, int unitsHeight, byte bitsPerPixel)
     : base(vdu, textWidth, textHeight, pixelWidth, pixelHeight, unitsWidth, unitsHeight, bitsPerPixel)
 {
 }
 public TeletextScreenMode(VduSystem vdu) :
     base(vdu, 40, 25, 4) // 4 bits per pixel in last argument for the colours in teletext (7+flashing)
 {
     SetConsoleSize();
 }
Esempio n. 8
0
 public OS(VduSystem vdu)
 {
     this.vdu = vdu;
 }
 public PalettedTextScreenMode(VduSystem vdu, byte bitsPerPixel, int textWidth, int textHeight) :
     base(vdu, textWidth, textHeight, bitsPerPixel)
 {
     SetConsoleSize();
     palette = new Palette(bitsPerPixel);
 }
 public PalettedGraphicsScreenMode(VduSystem vdu, byte bitsPerPixel, int textWidth, int textHeight, int pixelWidth, int pixelHeight, int unitsWidth, int unitsHeight)
     : base(vdu, textWidth, textHeight, pixelWidth, pixelHeight, unitsWidth, unitsHeight, bitsPerPixel)
 {
     palette = new Palette(bitsPerPixel);
     indexedBitmap = new Bitmap(SquarePixelWidth, SquarePixelHeight, PixelFormat.Format8bppIndexed);
 }