Exemplo n.º 1
0
 public void RenderGray2(byte[] frame)
 {
     _hasFrame      = true;
     _nextFrameType = FrameFormat.Gray2;
     _nextFrameData = frame;
     Dmd.RequestRender();
 }
Exemplo n.º 2
0
 public void RenderRgb24(byte[] frame)
 {
     _hasFrame      = true;
     _nextFrameType = FrameFormat.Rgb24;
     _nextFrameData = frame;
     Dmd.RequestRender();
 }
Exemplo n.º 3
0
 public void RenderBitmap(BitmapSource bmp)
 {
     _hasFrame        = true;
     _nextFrameType   = FrameFormat.Bitmap;
     _nextFrameBitmap = bmp;
     Dmd.RequestRender();
 }
Exemplo n.º 4
0
        public void ShouldThrowInvalidAddress()
        {
            TestContext.WriteLine("DmdMapper, should throw when using invalid address, -1");

            var result = Assert.Throws <Exception>(() => Dmd.getAddress(-1));

            Assert.That(result.Message, Is.EqualTo("INVALID_DMD_ADDRESSRANGE_-1"));
        }
Exemplo n.º 5
0
        private void OpenSettings(object sender, RoutedEventArgs e)
        {
            var settingWindow = new DmdSettings(_dmdConfig.Style, _config);

            _settingSubscription = settingWindow.OnConfigUpdated.Subscribe(style => {
                Dmd.SetStyle(style, _config.DataPath);
            });
            settingWindow.Show();
        }
Exemplo n.º 6
0
        public void ShouldGet_0x3FB9()
        {
            TestContext.WriteLine("DmdMapper, should get address, 0x3A00, should calculate offset correct");

            var expectedResult = new MapperModel
            {
                offset    = 0x3FB9,
                subsystem = "command"
            };

            var result = Dmd.getAddress(0x3FB9);

            Assert.That(result, Is.EqualTo(expectedResult));
        }
Exemplo n.º 7
0
        public void Setup(Configuration config = null, string gameName = null)
        {
            _config    = config;
            _dmdConfig = _config?.VirtualDmd as VirtualDmdConfig;

            if (_dmdConfig != null)
            {
                ParentGrid.ContextMenu = new ContextMenu();

                var saveGlobalPos = new MenuItem();
                saveGlobalPos.Click += SavePositionGlobally;
                saveGlobalPos.Header = "Save position globally";
                ParentGrid.ContextMenu.Items.Add(saveGlobalPos);

                if (gameName != null)
                {
                    var saveGamePosItem = new MenuItem();
                    saveGamePosItem.Click += SavePositionGame;
                    saveGamePosItem.Header = "Save position for \"" + gameName + "\"";
                    ParentGrid.ContextMenu.Items.Add(saveGamePosItem);
                }

                ParentGrid.ContextMenu.Items.Add(new Separator());

                var toggleAspect = new MenuItem();
                toggleAspect.Click      += ToggleAspectRatio;
                toggleAspect.Header      = "Ignore Aspect Ratio";
                toggleAspect.IsCheckable = true;
                ParentGrid.ContextMenu.Items.Add(toggleAspect);

                ParentGrid.ContextMenu.Items.Add(new Separator());

                var openSettings = new MenuItem();
                openSettings.Click += OpenSettings;
                openSettings.Header = "Customize Style";
                ParentGrid.ContextMenu.Items.Add(openSettings);
            }
            else
            {
                ParentGrid.ContextMenu = null;
            }

            if (_config != null)
            {
                Dmd.SetStyle(_config.VirtualDmd.Style, _config.DataPath);
                IgnoreAspectRatio = _config.VirtualDmd.IgnoreAr;
                AlwaysOnTop       = _config.VirtualDmd.StayOnTop;
            }
        }
Exemplo n.º 8
0
        public void ShouldGet_0x3A00()
        {
            TestContext.WriteLine("DmdMapper, should get address, 0x3A00");

            var expectedResult = new MapperModel
            {
                offset    = 0,
                subsystem = "videoram",
                bank      = 1
            };

            var result = Dmd.getAddress(0x3A00);

            Assert.That(result, Is.EqualTo(expectedResult));
        }
Exemplo n.º 9
0
        public static void ResetToDefaults(DCompilerConfiguration cfg, DCompilerVendor Compiler)
        {
            CompilerDefaultArgumentProvider cmp = null;
            switch (Compiler)
            {
                case DCompilerVendor.DMD:
                    cmp = new Dmd(cfg);
                    break;
                case DCompilerVendor.GDC:
                    cmp = new Gdc(cfg);
                    break;
                case DCompilerVendor.LDC:
                    cmp = new Ldc(cfg);
                    break;
            }

            // Reset arguments BEFORE reset compiler commands - only then, the 4 link target config objects will be created.
            cmp.ResetBuildArguments();
            cmp.ResetCompilerConfiguration();
        }