示例#1
0
        /// <summary>
        /// Sets the current mode to text mode 80x50.
        /// </summary>
        private void SwitchTo80x50TextMode()
        {
            var mode = new Modes.TextMode(80, 50, 8, this);

            this.CurrentMode = mode;
            VirtualMachine.OnVideoModeChanged(EventArgs.Empty);
        }
示例#2
0
        /// <summary>
        /// Initializes a new display mode.
        /// </summary>
        /// <param name="videoMode">New display mode.</param>
        public void SetDisplayMode(VideoMode10 videoMode)
        {
            VirtualMachine.PhysicalMemory.Bios.VideoMode = videoMode;
            VideoMode mode;

            switch (videoMode)
            {
            case VideoMode10.ColorText40x25x4:
                mode = new Modes.TextMode(40, 25, 8, this);
                break;

            case VideoMode10.ColorText80x25x4:
                mode = new Modes.TextMode(80, 25, this.verticalTextResolution, this);
                break;

            case VideoMode10.ColorGraphics320x200x2A:
            case VideoMode10.ColorGraphics320x200x2B:
                throw new NotImplementedException("CGA graphics not implemented.");

            case VideoMode10.ColorGraphics320x200x4:
                mode = new Modes.EgaVga16(320, 200, 8, this);
                break;

            case VideoMode10.ColorGraphics640x200x4:
                mode = new Modes.EgaVga16(640, 200, 8, this);
                break;

            case VideoMode10.ColorGraphics640x350x4:
                mode = new Modes.EgaVga16(640, 350, 8, this);
                break;

            case VideoMode10.Graphics640x480x4:
                mode = new Modes.EgaVga16(640, 480, 16, this);
                break;

            case VideoMode10.Graphics320x200x8:
                Sequencer.SequencerMemoryMode = SequencerMemoryMode.Chain4;
                mode = new Modes.Vga256(320, 200, this);
                break;

            default:
                throw new NotSupportedException();
            }

            SetDisplayMode(mode);
        }