Ejemplo n.º 1
0
        public frmInputConfig()
        {
            InitializeComponent();
            if (DesignMode)
            {
                return;
            }

            InputConfig cfg = ConfigManager.Config.Input.Clone();

            Entity = cfg;

            BaseConfigForm.InitializeComboBox((ComboBox)cboPlayer1, typeof(ControllerType));
            BaseConfigForm.InitializeComboBox((ComboBox)cboPlayer2, typeof(ControllerType));
            BaseConfigForm.InitializeComboBox((ComboBox)cboPlayer3, typeof(ControllerType));
            BaseConfigForm.InitializeComboBox((ComboBox)cboPlayer4, typeof(ControllerType));
            BaseConfigForm.InitializeComboBox((ComboBox)cboPlayer5, typeof(ControllerType));

            //Remove super scope for now
            cboPlayer1.Items.RemoveAt(3);
            cboPlayer2.Items.RemoveAt(3);

            cboPlayer1.SetEnumValue(cfg.Controllers[0].Type);
            cboPlayer2.SetEnumValue(cfg.Controllers[1].Type);
            cboPlayer3.SetEnumValue(cfg.Controllers[2].Type);
            cboPlayer4.SetEnumValue(cfg.Controllers[3].Type);
            cboPlayer5.SetEnumValue(cfg.Controllers[4].Type);
        }
Ejemplo n.º 2
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            if (DesignMode)
            {
                return;
            }

            _notifListener = new NotificationListener();
            _notifListener.OnNotification += OnNotificationReceived;

            BaseConfigForm.InitializeComboBox(cboFormat, typeof(TileFormat));

            _tileData        = new byte[512 * 512 * 4];
            _tileImage       = new Bitmap(512, 512, PixelFormat.Format32bppArgb);
            picTilemap.Image = _tileImage;

            ctrlScanlineCycleSelect.Initialize(241, 0);

            _options.Format  = TileFormat.Bpp4;
            _options.Width   = 32;
            _options.Palette = ctrlPaletteViewer.SelectedPalette;

            RefreshData();
            RefreshViewer();

            InitMemoryTypeDropdown();
            cboFormat.SetEnumValue(TileFormat.Bpp4);
            ctrlPaletteViewer.SelectionMode = PaletteSelectionMode.SixteenColors;
        }
Ejemplo n.º 3
0
        public frmInputConfig()
        {
            InitializeComponent();
            if (DesignMode)
            {
                return;
            }

            InputConfig cfg = ConfigManager.Config.Input.Clone();

            Entity = cfg;

            BaseConfigForm.InitializeComboBox((ComboBox)cboPlayer1, typeof(ControllerType), ControllerType.SuperScope);
            BaseConfigForm.InitializeComboBox((ComboBox)cboPlayer2, typeof(ControllerType));

            BaseConfigForm.InitializeComboBox((ComboBox)cboMultitap1, typeof(ControllerType), ControllerType.None, ControllerType.Multitap, ControllerType.SnesMouse, ControllerType.SuperScope);
            BaseConfigForm.InitializeComboBox((ComboBox)cboMultitap2, typeof(ControllerType), ControllerType.None, ControllerType.Multitap, ControllerType.SnesMouse, ControllerType.SuperScope);
            BaseConfigForm.InitializeComboBox((ComboBox)cboMultitap3, typeof(ControllerType), ControllerType.None, ControllerType.Multitap, ControllerType.SnesMouse, ControllerType.SuperScope);
            BaseConfigForm.InitializeComboBox((ComboBox)cboMultitap4, typeof(ControllerType), ControllerType.None, ControllerType.Multitap, ControllerType.SnesMouse, ControllerType.SuperScope);

            cboPlayer1.SetEnumValue(cfg.Controllers[0].Type);
            cboPlayer2.SetEnumValue(cfg.Controllers[1].Type);

            cboMultitap1.SetEnumValue(ControllerType.SnesController);
            cboMultitap2.SetEnumValue(ControllerType.SnesController);
            cboMultitap3.SetEnumValue(ControllerType.SnesController);
            cboMultitap4.SetEnumValue(ControllerType.SnesController);

            UpdateUiSections();
        }
Ejemplo n.º 4
0
        private void radVersion_CheckedChanged(object sender, EventArgs e)
        {
            cboChrRam.Enabled        = radNes2.Checked;
            cboChrRamBattery.Enabled = radNes2.Checked;
            cboSaveRam.Enabled       = radNes2.Checked;
            cboWorkRam.Enabled       = radNes2.Checked;
            cboInputType.Enabled     = radNes2.Checked;
            txtSubmapperId.Enabled   = radNes2.Checked;
            UpdateVsDropdown();

            Enum[] hiddenSystems = null;
            Enum[] hiddenTimings = null;
            if (!radNes2.Checked)
            {
                hiddenSystems = new Enum[] {
                    TvSystem.BitCorporationCreator, TvSystem.Vt01Mono, TvSystem.Vt01RedCyan,
                    TvSystem.Vt02, TvSystem.Vt03, TvSystem.Vt09, TvSystem.Vt36x, TvSystem.Vt3x
                };
                hiddenTimings = new Enum[] {
                    FrameTiming.Dendy
                };
            }
            BaseConfigForm.InitializeComboBox(cboSystem, typeof(TvSystem), hiddenSystems);
            if (cboSystem.SelectedIndex < 0)
            {
                cboSystem.SelectedIndex = 0;
            }

            BaseConfigForm.InitializeComboBox(cboFrameTiming, typeof(FrameTiming), hiddenTimings);
            if (cboFrameTiming.SelectedIndex < 0)
            {
                cboFrameTiming.SelectedIndex = 0;
            }

            if (!cboChrRam.Enabled)
            {
                cboChrRam.SelectedIndex = 0;
            }
            if (!cboChrRamBattery.Enabled)
            {
                cboChrRamBattery.SelectedIndex = 0;
            }
            if (!cboSaveRam.Enabled)
            {
                cboSaveRam.SelectedIndex = 0;
            }
            if (!cboWorkRam.Enabled)
            {
                cboWorkRam.SelectedIndex = 0;
            }
            if (!txtSubmapperId.Enabled)
            {
                txtSubmapperId.Text = "0";
            }
        }
Ejemplo n.º 5
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (!IsDesignMode)
            {
                DebugInfo debugInfo = ConfigManager.Config.DebugInfo;
                chkIgnoreMirroredNametables.Checked = debugInfo.TextHookerIgnoreMirroredNametables;
                chkUseScrollOffsets.Checked         = debugInfo.TextHookerAdjustViewportScrolling;
                chkAutoCopyToClipboard.Checked      = debugInfo.TextHookerAutoCopyToClipboard;

                BaseConfigForm.InitializeComboBox(cboDakutenMode, typeof(DakutenMode));
                cboDakutenMode.SetEnumValue(debugInfo.TextHookerDakutenMode);
            }
        }
Ejemplo n.º 6
0
        public ctrlCheatFinder()
        {
            InitializeComponent();

            BaseConfigForm.InitializeComboBox(cboPrevFilterType, typeof(CheatPrevFilterType));
            BaseConfigForm.InitializeComboBox(cboCurrentFilterType, typeof(CheatCurrentFilterType));
            cboPrevFilterType.SelectedIndex    = 0;
            cboCurrentFilterType.SelectedIndex = 0;

            btnUndo.Enabled = false;

            if (LicenseManager.UsageMode != LicenseUsageMode.Designtime)
            {
                Reset();
            }
        }
Ejemplo n.º 7
0
        public frmInputConfig()
        {
            InitializeComponent();
            if (DesignMode)
            {
                return;
            }

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

            InputConfig cfg = ConfigManager.Config.Input.Clone();

            Entity = cfg;

            BaseConfigForm.InitializeComboBox((ComboBox)cboPlayer1, typeof(ControllerType), ControllerType.SuperScope);
            BaseConfigForm.InitializeComboBox((ComboBox)cboPlayer2, typeof(ControllerType));

            BaseConfigForm.InitializeComboBox((ComboBox)cboMultitap1, typeof(ControllerType), ControllerType.None, ControllerType.Multitap, ControllerType.SnesMouse, ControllerType.SuperScope);
            BaseConfigForm.InitializeComboBox((ComboBox)cboMultitap2, typeof(ControllerType), ControllerType.None, ControllerType.Multitap, ControllerType.SnesMouse, ControllerType.SuperScope);
            BaseConfigForm.InitializeComboBox((ComboBox)cboMultitap3, typeof(ControllerType), ControllerType.None, ControllerType.Multitap, ControllerType.SnesMouse, ControllerType.SuperScope);
            BaseConfigForm.InitializeComboBox((ComboBox)cboMultitap4, typeof(ControllerType), ControllerType.None, ControllerType.Multitap, ControllerType.SnesMouse, ControllerType.SuperScope);

            cboPlayer1.SetEnumValue(cfg.Controllers[0].Type);
            cboPlayer2.SetEnumValue(cfg.Controllers[1].Type);

            cboMultitap1.SetEnumValue(ControllerType.SnesController);
            cboMultitap2.SetEnumValue(ControllerType.SnesController);
            cboMultitap3.SetEnumValue(ControllerType.SnesController);
            cboMultitap4.SetEnumValue(ControllerType.SnesController);

            AddBinding(nameof(InputConfig.DisplayInputPort1), chkDisplayPort1);
            AddBinding(nameof(InputConfig.DisplayInputPort2), chkDisplayPort2);
            AddBinding(nameof(InputConfig.DisplayInputPort3), chkDisplayPort3);
            AddBinding(nameof(InputConfig.DisplayInputPort4), chkDisplayPort4);
            AddBinding(nameof(InputConfig.DisplayInputPort5), chkDisplayPort5);
            AddBinding(nameof(InputConfig.DisplayInputPosition), cboDisplayInputPosition);
            AddBinding(nameof(InputConfig.DisplayInputHorizontally), chkDisplayInputHorizontally);
            AddBinding(nameof(InputConfig.ControllerDeadzoneSize), trkControllerDeadzoneSize);

            UpdateUiSections();
        }
Ejemplo n.º 8
0
        protected override void OnLoad(EventArgs evt)
        {
            base.OnLoad(evt);
            if (DesignMode)
            {
                return;
            }

            _tileData            = new byte[0x400000];
            _tileImage           = new Bitmap(512, 512, PixelFormat.Format32bppPArgb);
            ctrlImagePanel.Image = _tileImage;

            BaseConfigForm.InitializeComboBox(cboFormat, typeof(TileFormat));
            BaseConfigForm.InitializeComboBox(cboLayout, typeof(TileLayout));
            InitMemoryTypeDropdown();

            InitShortcuts();

            TileViewerConfig config = ConfigManager.Config.Debug.TileViewer;

            RestoreLocation(config.WindowLocation, config.WindowSize);

            cboMemoryType.SetEnumValue(config.Source);
            cboFormat.SetEnumValue(config.Format);
            cboLayout.SetEnumValue(config.Layout);
            nudColumns.Value = config.ColumnCount;

            int memSize = DebugApi.GetMemorySize(_memoryType);

            config.Address = Math.Min(memSize - config.PageSize, config.Address);

            UpdateMemoryType(config.Source);
            nudAddress.Value          = config.Address;
            nudSize.Value             = config.PageSize;
            mnuAutoRefresh.Checked    = config.AutoRefresh;
            chkShowTileGrid.Checked   = config.ShowTileGrid;
            ctrlImagePanel.ImageScale = config.ImageScale;
            ctrlScanlineCycleSelect.Initialize(config.RefreshScanline, config.RefreshCycle);
            ctrlPaletteViewer.SelectedPalette = config.SelectedPalette;

            nudSize.Increment    = 0x1000;
            nudSize.Minimum      = 0x1000;
            nudSize.Maximum      = Math.Min(memSize, 0x40000);
            nudAddress.Increment = nudSize.Value;
            nudAddress.Maximum   = memSize - nudSize.Value;

            _address                 = config.Address;
            _options.Format          = config.Format;
            _options.Layout          = config.Layout;
            _options.Palette         = config.SelectedPalette;
            _options.Width           = config.ColumnCount;
            _options.PageSize        = config.PageSize;
            ctrlImagePanel.GridSizeX = config.ShowTileGrid ? 8 : 0;
            ctrlImagePanel.GridSizeY = config.ShowTileGrid ? 8 : 0;

            _refreshManager                      = new WindowRefreshManager(this);
            _refreshManager.AutoRefresh          = config.AutoRefresh;
            _refreshManager.AutoRefreshSpeed     = config.AutoRefreshSpeed;
            mnuAutoRefreshLow.Click             += (s, e) => _refreshManager.AutoRefreshSpeed = RefreshSpeed.Low;
            mnuAutoRefreshNormal.Click          += (s, e) => _refreshManager.AutoRefreshSpeed = RefreshSpeed.Normal;
            mnuAutoRefreshHigh.Click            += (s, e) => _refreshManager.AutoRefreshSpeed = RefreshSpeed.High;
            mnuAutoRefreshSpeed.DropDownOpening += (s, e) => UpdateRefreshSpeedMenu();

            RefreshData();
            RefreshViewer();

            cboMemoryType.SelectedIndexChanged += cboMemoryType_SelectedIndexChanged;
            nudAddress.ValueChanged            += nudAddress_ValueChanged;
            chkShowTileGrid.Click              += chkShowTileGrid_Click;
            cboFormat.SelectedIndexChanged     += cboFormat_SelectedIndexChanged;
            cboLayout.SelectedIndexChanged     += cboLayout_SelectedIndexChanged;
            nudColumns.ValueChanged            += nudColumns_ValueChanged;
            nudSize.ValueChanged               += nudSize_ValueChanged;
            ctrlPaletteViewer.SelectionChanged += ctrlPaletteViewer_SelectionChanged;
            mnuAutoRefresh.CheckedChanged      += mnuAutoRefresh_CheckedChanged;

            UpdatePaletteControl();

            btnPresetBg1.Click  += (s, e) => GoToBgLayer(0);
            btnPresetBg2.Click  += (s, e) => GoToBgLayer(1);
            btnPresetBg3.Click  += (s, e) => GoToBgLayer(2);
            btnPresetBg4.Click  += (s, e) => GoToBgLayer(3);
            btnPresetOam1.Click += (s, e) => GoToOamPreset(0);
            btnPresetOam2.Click += (s, e) => GoToOamPreset(1);
        }
Ejemplo n.º 9
0
        protected override void OnLoad(EventArgs evt)
        {
            base.OnLoad(evt);
            if (DesignMode)
            {
                return;
            }

            _notifListener = new NotificationListener();
            _notifListener.OnNotification += OnNotificationReceived;

            _tileData            = new byte[512 * 512 * 4];
            _tileImage           = new Bitmap(512, 512, PixelFormat.Format32bppPArgb);
            ctrlImagePanel.Image = _tileImage;

            BaseConfigForm.InitializeComboBox(cboFormat, typeof(TileFormat));
            BaseConfigForm.InitializeComboBox(cboLayout, typeof(TileLayout));
            InitMemoryTypeDropdown();

            InitShortcuts();

            TileViewerConfig config = ConfigManager.Config.Debug.TileViewer;

            if (!config.WindowSize.IsEmpty)
            {
                this.StartPosition = FormStartPosition.Manual;
                this.Size          = config.WindowSize;
                this.Location      = config.WindowLocation;
            }

            cboMemoryType.SetEnumValue(config.Source);
            cboFormat.SetEnumValue(config.Format);
            cboLayout.SetEnumValue(config.Layout);
            nudColumns.Value          = config.ColumnCount;
            nudBank.Value             = config.Bank;
            nudOffset.Value           = config.Offset;
            mnuAutoRefresh.Checked    = config.AutoRefresh;
            chkShowTileGrid.Checked   = config.ShowTileGrid;
            ctrlImagePanel.ImageScale = config.ImageScale;
            ctrlScanlineCycleSelect.Initialize(config.RefreshScanline, config.RefreshCycle);
            ctrlPaletteViewer.SelectedPalette = config.SelectedPalette;

            UpdateMemoryType(config.Source);
            _addressOffset           = config.Bank * 0x10000 + config.Offset;
            _options.Format          = config.Format;
            _options.Layout          = config.Layout;
            _options.Palette         = config.SelectedPalette;
            _options.Width           = config.ColumnCount;
            ctrlImagePanel.GridSizeX = config.ShowTileGrid ? 8 : 0;
            ctrlImagePanel.GridSizeY = config.ShowTileGrid ? 8 : 0;
            _autoRefresh             = config.AutoRefresh;

            RefreshData();
            RefreshViewer();

            cboMemoryType.SelectedIndexChanged += cboMemoryType_SelectedIndexChanged;
            nudBank.ValueChanged               += nudBank_ValueChanged;
            chkShowTileGrid.Click              += chkShowTileGrid_Click;
            cboFormat.SelectedIndexChanged     += cboFormat_SelectedIndexChanged;
            cboLayout.SelectedIndexChanged     += cboLayout_SelectedIndexChanged;
            nudColumns.ValueChanged            += nudColumns_ValueChanged;
            nudOffset.ValueChanged             += nudOffset_ValueChanged;
            ctrlPaletteViewer.SelectionChanged += ctrlPaletteViewer_SelectionChanged;
            mnuAutoRefresh.CheckedChanged      += mnuAutoRefresh_CheckedChanged;

            UpdatePaletteControl();

            btnPresetBg1.Click  += (s, e) => GoToBgLayer(0);
            btnPresetBg2.Click  += (s, e) => GoToBgLayer(1);
            btnPresetBg3.Click  += (s, e) => GoToBgLayer(2);
            btnPresetBg4.Click  += (s, e) => GoToBgLayer(3);
            btnPresetOam1.Click += (s, e) => GoToOamPreset(0);
            btnPresetOam2.Click += (s, e) => GoToOamPreset(1);
        }