public void ClearDebugger()
 {
     richTextBox1.Text = "";
     WriteLine("Welcome to My Nes console");
     WriteLine(@"Write ""Help"" to see a list of instructions.");
     MyNesDEBUGGER.WriteSeparateLine(this, DebugStatus.None);
 }
Пример #2
0
        public Video_HiRes(TVFORMAT TvFormat, Control Surface, string pPath, int chrPages, PPU pp)
        {
            if (Surface == null)
            {
                return;
            }
            _Surface = Surface;
            oppu     = pp;
            switch (TvFormat)
            {
            case TVFORMAT.NTSC:
                _ScanLines      = 224;
                _FirstLinesTCut = 8;
                break;

            case TVFORMAT.PAL:
                _ScanLines      = 240;
                _FirstLinesTCut = 0;
                break;
            }
            VideoModeSettings sett = new VideoModeSettings();

            sett.Reload();

            if (pPath != "")
            {
                ReadHiResPack(Path.GetDirectoryName(pPath) + Path.DirectorySeparatorChar + Path.GetFileNameWithoutExtension(pPath), chrPages);
            }
            tilePalette = new int[3];
            tileRow     = new int[8];
            MyNesDEBUGGER.WriteLine(this, "Video device " + @"""" + "Hi Res" + @"""" + " Ok !!", DebugStatus.Cool);
        }
Пример #3
0
 void InitializeDirect3D()
 {
     try
     {
         d3d            = new Direct3D();
         _presentParams = new PresentParameters();
         _presentParams.BackBufferWidth      = 512;
         _presentParams.BackBufferHeight     = _ScanLines * 2;
         _presentParams.Windowed             = true;
         _presentParams.SwapEffect           = SwapEffect.Discard;
         _presentParams.Multisample          = MultisampleType.None;
         _presentParams.PresentationInterval = PresentInterval.Immediate;
         _displayFormat = d3d.Adapters[0].CurrentDisplayMode.Format;
         _displayDevice = new Device(d3d, 0, DeviceType.Hardware, _Surface.Handle, CreateFlags.SoftwareVertexProcessing, new PresentParameters[] { _presentParams });
         _displayRect   = new Rectangle(0, 0, 512, _ScanLines * 2);
         BuffSize       = (512 * _ScanLines * 2) * 4;
         _displayData   = new byte[BuffSize];
         CreateDisplayObjects(_displayDevice);
         Initialized = true;
         _disposed   = false;
         MyNesDEBUGGER.WriteLine(this, "SlimDX video mode (Windowed) Initialized ok.", DebugStatus.Cool);
     }
     catch (Exception EX)
     { MyNesDEBUGGER.WriteLine(this, "Could not Initialize SlimDX mode because of : \n" + EX.Message, DebugStatus.Error); Initialized = false; }
 }
Пример #4
0
 void InitializeDirect3D()
 {
     try
     {
         if (!_FullScreen)
         {
             d3d            = new Direct3D();
             _presentParams = new PresentParameters();
             _presentParams.BackBufferWidth      = 256;
             _presentParams.BackBufferHeight     = _ScanLines;
             _presentParams.Windowed             = true;
             _presentParams.SwapEffect           = SwapEffect.Discard;
             _presentParams.Multisample          = MultisampleType.None;
             _presentParams.PresentationInterval = PresentInterval.Immediate;
             _displayFormat = d3d.Adapters[0].CurrentDisplayMode.Format;
             _displayDevice = new Device(d3d, 0, DeviceType.Hardware, _Surface.Handle, CreateFlags.SoftwareVertexProcessing, new PresentParameters[] { _presentParams });
             _displayRect   = new Rectangle(0, 0, 256, _ScanLines);
             BuffSize       = (256 * _ScanLines) * 4;
             _displayData   = new byte[BuffSize];
             CreateDisplayObjects(_displayDevice);
             Initialized = true;
             _disposed   = false;
             MyNesDEBUGGER.WriteLine(this, "SlimDX Initialized ok.", DebugStatus.Cool);
         }
         else
         {
             d3d            = new Direct3D();
             mode           = this.FindSupportedMode();
             _presentParams = new PresentParameters();
             _presentParams.BackBufferFormat             = mode.Format;
             _presentParams.BackBufferCount              = 1;
             _presentParams.BackBufferWidth              = mode.Width;
             _presentParams.BackBufferHeight             = mode.Height;
             _presentParams.Windowed                     = false;
             _presentParams.FullScreenRefreshRateInHertz = mode.RefreshRate;
             _presentParams.SwapEffect                   = SwapEffect.Discard;
             _presentParams.Multisample                  = MultisampleType.None;
             _presentParams.PresentationInterval         = PresentInterval.Immediate;
             _displayFormat            = mode.Format;
             _displayDevice            = new Device(d3d, 0, DeviceType.Hardware, _Surface.Parent.Parent.Handle, CreateFlags.SoftwareVertexProcessing, new PresentParameters[] { _presentParams });
             _displayDevice.ShowCursor = false;
             _displayDevice.SetRenderState(RenderState.PointScaleEnable, true);
             _displayDevice.SetRenderState(RenderState.PointSpriteEnable, true);
             _displayRect = new Rectangle(0, 0, 256, _ScanLines);
             _Position    = new Vector3((mode.Width - 256) / 2, (mode.Height - _ScanLines) / 2, 0);
             BuffSize     = (256 * _ScanLines) * 4;
             _displayData = new byte[BuffSize];
             CreateDisplayObjects(_displayDevice);
             Initialized = true;
             _disposed   = false;
             MyNesDEBUGGER.WriteLine(this, "SlimDX video mode Initialized ok.", DebugStatus.Cool);
         }
     }
     catch (Exception EX)
     {
         Initialized = false; MyNesDEBUGGER.WriteLine(this, "Can't initialize SlimDX video mode, system message:\n" + EX.Message + "\nIt's recommanded that you change this video mode via video options.", DebugStatus.Error);
     }
 }