Beispiel #1
0
        public frmAssembler(string code = "", UInt16 startAddress = 0, UInt16 blockLength = 0)
        {
            InitializeComponent();
            ThemeHelper.ExcludeFromTheme(txtCode);
            txtCode.ForeColor = Color.Black;

            DebugInfo config = ConfigManager.Config.DebugInfo;

            RestoreLocation(config.AssemblerLocation, config.AssemblerSize);

            mnuEnableSyntaxHighlighting.Checked = config.AssemblerCodeHighlighting;

            txtCode.Font = new Font(config.AssemblerFontFamily, config.AssemblerFontSize, config.AssemblerFontStyle);
            txtCode.Zoom = config.AssemblerZoom;

            UpdateCodeHighlighting();

            _initialCode  = code;
            _startAddress = startAddress;
            _blockLength  = blockLength;

            ctrlHexBox.Font = new Font(BaseControl.MonospaceFontFamily, 10, FontStyle.Regular);
            ctrlHexBox.SelectionForeColor = Color.White;
            ctrlHexBox.SelectionBackColor = Color.FromArgb(31, 123, 205);
            ctrlHexBox.InfoBackColor      = Color.FromArgb(235, 235, 235);
            ctrlHexBox.InfoForeColor      = Color.Gray;
            ctrlHexBox.Width        = ctrlHexBox.RequiredWidth;
            ctrlHexBox.ByteProvider = new StaticByteProvider(new byte[0]);

            txtStartAddress.Text = _startAddress.ToString("X4");
        }
Beispiel #2
0
        public ctrlRecentGames()
        {
            InitializeComponent();
            if (IsDesignMode)
            {
                return;
            }

            DoubleBuffered = true;
            picPrevGame.Image.RotateFlip(RotateFlipType.RotateNoneFlipX);
            ThemeHelper.ExcludeFromTheme(this);
        }
        public ctrlRecentGames()
        {
            InitializeComponent();
            ThemeHelper.ExcludeFromTheme(this);

            DoubleBuffered = true;

            bool designMode = (LicenseManager.UsageMode == LicenseUsageMode.Designtime);

            if (!designMode)
            {
                _fonts.AddFontFile(Path.Combine(ConfigManager.HomeFolder, "Resources", "PixelFont.ttf"));
                lblGameName.Font = new Font(_fonts.Families[0], 10);
                lblSaveDate.Font = new Font(_fonts.Families[0], 10);

                picPrevGame.Image.RotateFlip(RotateFlipType.RotateNoneFlipX);
            }
        }
Beispiel #4
0
        public frmInputConfig()
        {
            InitializeComponent();
            ThemeHelper.ExcludeFromTheme(pnlConflictWarning);

            tlpControllers.Enabled = !InteropEmu.MoviePlaying() && !InteropEmu.MovieRecording();

            Task.Run(() => {
                InteropEmu.UpdateInputDevices();
            });

            Entity = ConfigManager.Config.InputInfo;

            for (int i = 0; i < 4; i++)
            {
                ConfigManager.Config.InputInfo.Controllers[i].ControllerType = InteropEmu.GetControllerType(i);
            }
            ConfigManager.Config.InputInfo.ExpansionPortDevice = InteropEmu.GetExpansionDevice();
            ConfigManager.Config.InputInfo.ConsoleType         = InteropEmu.GetConsoleType();
            ConfigManager.Config.InputInfo.UseFourScore        = InteropEmu.HasFourScore();

            AddBinding("ExpansionPortDevice", cboExpansionPort);
            AddBinding("ConsoleType", cboConsoleType);
            AddBinding("UseFourScore", chkFourScore);
            AddBinding("AutoConfigureInput", chkAutoConfigureInput);

            AddBinding("DisplayInputPort1", chkDisplayPort1);
            AddBinding("DisplayInputPort2", chkDisplayPort2);
            AddBinding("DisplayInputPort3", chkDisplayPort3);
            AddBinding("DisplayInputPort4", chkDisplayPort4);
            AddBinding("DisplayInputPosition", cboDisplayInputPosition);
            AddBinding("DisplayInputHorizontally", chkDisplayInputHorizontally);
            AddBinding("ControllerDeadzoneSize", trkControllerDeadzoneSize);
            AddBinding("HideMousePointerForZapper", chkHideMousePointerForZapper);

            //Sort expansion port dropdown alphabetically, but keep the "None" option at the top
            SortDropdown(cboExpansionPort, ResourceHelper.GetEnumText(InteropEmu.ExpansionPortDevice.None));

            UpdateCartridgeInputUi();
            UpdateConflictWarning();
        }
Beispiel #5
0
        public frmScript(bool forceBlank = false)
        {
            InitializeComponent();
            ThemeHelper.ExcludeFromTheme(txtScriptContent);
            txtScriptContent.ForeColor = Color.Black;

            DebugInfo.ApplyConfig();

            List <string> builtInScripts = new List <string> {
                "DmcCapture.lua", "DrawMode.lua", "Example.lua", "GameBoyMode.lua", "Grid.lua", "LogParallax.lua", "ModifyScreen.lua", "NtscSafeArea.lua", "ReverseMode.lua", "SpriteBox.lua"
            };

            foreach (string script in builtInScripts)
            {
                ToolStripItem item = mnuBuiltInScripts.DropDownItems.Add(script);
                item.Click += (s, e) => {
                    LoadBuiltInScript(item.Text);
                };
            }

            tsToolbar.AddItemsToToolbar(
                mnuOpen, mnuSave, null,
                mnuRun, mnuStop, null,
                mnuBuiltInScripts
                );

            DebugInfo config = ConfigManager.Config.DebugInfo;

            _popupMenu           = new AutocompleteMenu(txtScriptContent, this);
            _popupMenu.ImageList = new ImageList();
            _popupMenu.ImageList.Images.Add(Resources.Enum);
            _popupMenu.ImageList.Images.Add(Resources.Function);
            _popupMenu.SelectedColor = Color.LightBlue;
            _popupMenu.SearchPattern = @"[\w\.]";

            List <AutocompleteItem> items = new List <AutocompleteItem>();

            _availableFunctions.Sort((a, b) => {
                int type = a[0].CompareTo(b[0]);
                if (type == 0)
                {
                    return(a[1].CompareTo(b[1]));
                }
                else
                {
                    return(-type);
                }
            });

            foreach (List <string> item in _availableFunctions)
            {
                MethodAutocompleteItem autocompleteItem = new MethodAutocompleteItem(item[1]);
                autocompleteItem.ImageIndex   = item[0] == "func" ? 1 : 0;
                autocompleteItem.ToolTipTitle = item[2];
                if (!string.IsNullOrWhiteSpace(item[3]))
                {
                    autocompleteItem.ToolTipText = "Parameters" + Environment.NewLine + item[3] + Environment.NewLine + Environment.NewLine;
                }
                if (!string.IsNullOrWhiteSpace(item[4]))
                {
                    autocompleteItem.ToolTipText += "Return Value" + Environment.NewLine + item[4] + Environment.NewLine + Environment.NewLine;
                }
                if (!string.IsNullOrWhiteSpace(item[5]))
                {
                    autocompleteItem.ToolTipText += "Description" + Environment.NewLine + item[5] + Environment.NewLine + Environment.NewLine;
                }
                items.Add(autocompleteItem);
            }

            _popupMenu.Items.SetAutocompleteItems(items);

            UpdateRecentScripts();

            mnuTutorialScript.Checked     = config.ScriptStartupBehavior == ScriptStartupBehavior.ShowTutorial;
            mnuBlankWindow.Checked        = config.ScriptStartupBehavior == ScriptStartupBehavior.ShowBlankWindow;
            mnuAutoLoadLastScript.Checked = config.ScriptStartupBehavior == ScriptStartupBehavior.LoadLastScript;

            if (!forceBlank)
            {
                if (mnuAutoLoadLastScript.Checked && mnuRecentScripts.DropDownItems.Count > 0)
                {
                    string scriptToLoad = config.RecentScripts.Where((s) => File.Exists(s)).FirstOrDefault();
                    if (scriptToLoad != null)
                    {
                        LoadScriptFile(scriptToLoad, false);
                    }
                }
                else if (mnuTutorialScript.Checked)
                {
                    LoadBuiltInScript("Example.lua");
                }
            }

            RestoreLocation(config.ScriptWindowLocation, config.ScriptWindowSize);
            mnuSaveBeforeRun.Checked = config.SaveScriptBeforeRun;

            if (config.ScriptCodeWindowHeight >= ctrlSplit.Panel1MinSize)
            {
                if (config.ScriptCodeWindowHeight == Int32.MaxValue)
                {
                    ctrlSplit.CollapsePanel();
                }
                else
                {
                    ctrlSplit.SplitterDistance = config.ScriptCodeWindowHeight;
                }
            }

            txtScriptContent.Font = new Font(config.ScriptFontFamily, config.ScriptFontSize, config.ScriptFontStyle);
            txtScriptContent.Zoom = config.ScriptZoom;
        }
Beispiel #6
0
 public ctrlNsfPlayer()
 {
     InitializeComponent();
     ThemeHelper.ExcludeFromTheme(this);
 }
Beispiel #7
0
 public ctrlLinkLabel()
 {
     ThemeHelper.ExcludeFromTheme(this);
 }
Beispiel #8
0
 public ctrlRenderer()
 {
     InitializeComponent();
     ThemeHelper.ExcludeFromTheme(this);
 }
Beispiel #9
0
 public ctrlKeyBindingHint()
 {
     InitializeComponent();
     ThemeHelper.ExcludeFromTheme(this);
 }
Beispiel #10
0
 public frmHelp()
 {
     InitializeComponent();
     ThemeHelper.ExcludeFromTheme(lblExample);
 }