diff --git a/BizHawk.MultiClient/ArchiveChooser.Designer.cs b/BizHawk.MultiClient/ArchiveChooser.Designer.cs index 0053648f61..d2a3b3eeb8 100644 --- a/BizHawk.MultiClient/ArchiveChooser.Designer.cs +++ b/BizHawk.MultiClient/ArchiveChooser.Designer.cs @@ -28,88 +28,89 @@ /// private void InitializeComponent() { - this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); - this.btnCancel = new System.Windows.Forms.Button(); - this.btnOK = new System.Windows.Forms.Button(); - this.lvMembers = new System.Windows.Forms.ListView(); - this.colSize = new System.Windows.Forms.ColumnHeader(); - this.colName = new System.Windows.Forms.ColumnHeader(); - this.flowLayoutPanel1.SuspendLayout(); - this.SuspendLayout(); - // - // flowLayoutPanel1 - // - this.flowLayoutPanel1.AutoSize = true; - this.flowLayoutPanel1.Controls.Add(this.btnCancel); - this.flowLayoutPanel1.Controls.Add(this.btnOK); - this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Bottom; - this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft; - this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 276); - this.flowLayoutPanel1.Name = "flowLayoutPanel1"; - this.flowLayoutPanel1.Size = new System.Drawing.Size(528, 29); - this.flowLayoutPanel1.TabIndex = 0; - // - // btnCancel - // - this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.btnCancel.Location = new System.Drawing.Point(450, 3); - this.btnCancel.Name = "btnCancel"; - this.btnCancel.Size = new System.Drawing.Size(75, 23); - this.btnCancel.TabIndex = 1; - this.btnCancel.Text = "Cancel"; - this.btnCancel.UseVisualStyleBackColor = true; - this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); - // - // btnOK - // - this.btnOK.Location = new System.Drawing.Point(369, 3); - this.btnOK.Name = "btnOK"; - this.btnOK.Size = new System.Drawing.Size(75, 23); - this.btnOK.TabIndex = 0; - this.btnOK.Text = "OK"; - this.btnOK.UseVisualStyleBackColor = true; - this.btnOK.Click += new System.EventHandler(this.btnOK_Click); - // - // lvMembers - // - this.lvMembers.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); + this.btnCancel = new System.Windows.Forms.Button(); + this.btnOK = new System.Windows.Forms.Button(); + this.lvMembers = new System.Windows.Forms.ListView(); + this.colSize = new System.Windows.Forms.ColumnHeader(); + this.colName = new System.Windows.Forms.ColumnHeader(); + this.flowLayoutPanel1.SuspendLayout(); + this.SuspendLayout(); + // + // flowLayoutPanel1 + // + this.flowLayoutPanel1.AutoSize = true; + this.flowLayoutPanel1.Controls.Add(this.btnCancel); + this.flowLayoutPanel1.Controls.Add(this.btnOK); + this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Bottom; + this.flowLayoutPanel1.FlowDirection = System.Windows.Forms.FlowDirection.RightToLeft; + this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 276); + this.flowLayoutPanel1.Name = "flowLayoutPanel1"; + this.flowLayoutPanel1.Size = new System.Drawing.Size(528, 29); + this.flowLayoutPanel1.TabIndex = 0; + // + // btnCancel + // + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.Location = new System.Drawing.Point(450, 3); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(75, 23); + this.btnCancel.TabIndex = 1; + this.btnCancel.Text = "Cancel"; + this.btnCancel.UseVisualStyleBackColor = true; + this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); + // + // btnOK + // + this.btnOK.Location = new System.Drawing.Point(369, 3); + this.btnOK.Name = "btnOK"; + this.btnOK.Size = new System.Drawing.Size(75, 23); + this.btnOK.TabIndex = 0; + this.btnOK.Text = "OK"; + this.btnOK.UseVisualStyleBackColor = true; + this.btnOK.Click += new System.EventHandler(this.btnOK_Click); + // + // lvMembers + // + this.lvMembers.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.colSize, this.colName}); - this.lvMembers.Dock = System.Windows.Forms.DockStyle.Fill; - this.lvMembers.FullRowSelect = true; - this.lvMembers.GridLines = true; - this.lvMembers.Location = new System.Drawing.Point(0, 0); - this.lvMembers.Name = "lvMembers"; - this.lvMembers.Size = new System.Drawing.Size(528, 276); - this.lvMembers.TabIndex = 0; - this.lvMembers.UseCompatibleStateImageBehavior = false; - this.lvMembers.View = System.Windows.Forms.View.Details; - this.lvMembers.ItemActivate += new System.EventHandler(this.lvMembers_ItemActivate); - // - // colSize - // - this.colSize.Text = "Size"; - // - // colName - // - this.colName.Text = "Name"; - this.colName.Width = 409; - // - // ArchiveChooser - // - this.AcceptButton = this.btnOK; - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.CancelButton = this.btnCancel; - this.ClientSize = new System.Drawing.Size(528, 305); - this.Controls.Add(this.lvMembers); - this.Controls.Add(this.flowLayoutPanel1); - this.Name = "ArchiveChooser"; - this.ShowIcon = false; - this.Text = "Choose File From Archive"; - this.flowLayoutPanel1.ResumeLayout(false); - this.ResumeLayout(false); - this.PerformLayout(); + this.lvMembers.Dock = System.Windows.Forms.DockStyle.Fill; + this.lvMembers.FullRowSelect = true; + this.lvMembers.GridLines = true; + this.lvMembers.Location = new System.Drawing.Point(0, 0); + this.lvMembers.Name = "lvMembers"; + this.lvMembers.Size = new System.Drawing.Size(528, 276); + this.lvMembers.TabIndex = 0; + this.lvMembers.UseCompatibleStateImageBehavior = false; + this.lvMembers.View = System.Windows.Forms.View.Details; + this.lvMembers.ItemActivate += new System.EventHandler(this.lvMembers_ItemActivate); + // + // colSize + // + this.colSize.Text = "Size"; + // + // colName + // + this.colName.Text = "Name"; + this.colName.Width = 409; + // + // ArchiveChooser + // + this.AcceptButton = this.btnOK; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btnCancel; + this.ClientSize = new System.Drawing.Size(528, 305); + this.Controls.Add(this.lvMembers); + this.Controls.Add(this.flowLayoutPanel1); + this.Name = "ArchiveChooser"; + this.ShowIcon = false; + this.Text = "Choose File From Archive"; + this.Load += new System.EventHandler(this.ArchiveChooser_Load); + this.flowLayoutPanel1.ResumeLayout(false); + this.ResumeLayout(false); + this.PerformLayout(); } diff --git a/BizHawk.MultiClient/ArchiveChooser.cs b/BizHawk.MultiClient/ArchiveChooser.cs index 64ba9f93ba..c153ec1606 100644 --- a/BizHawk.MultiClient/ArchiveChooser.cs +++ b/BizHawk.MultiClient/ArchiveChooser.cs @@ -51,5 +51,10 @@ namespace BizHawk.MultiClient DialogResult = DialogResult.OK; Close(); } + + private void ArchiveChooser_Load(object sender, EventArgs e) + { + + } } } diff --git a/BizHawk.MultiClient/Config.cs b/BizHawk.MultiClient/Config.cs index d20d900970..3984f65676 100644 --- a/BizHawk.MultiClient/Config.cs +++ b/BizHawk.MultiClient/Config.cs @@ -1,105 +1,105 @@ namespace BizHawk.MultiClient -{ - public class Config - { - public Config() - { - SMSController[0] = new SMSControllerTemplate(true); - SMSController[1] = new SMSControllerTemplate(false); - PCEController[0] = new PCEControllerTemplate(true); - PCEController[1] = new PCEControllerTemplate(false); - PCEController[2] = new PCEControllerTemplate(false); - PCEController[3] = new PCEControllerTemplate(false); - PCEController[4] = new PCEControllerTemplate(false); - NESController[0] = new NESControllerTemplate(true); - NESController[1] = new NESControllerTemplate(false); - NESController[2] = new NESControllerTemplate(false); - NESController[3] = new NESControllerTemplate(false); - TI83Controller[0] = new TI83ControllerTemplate(true); - } +{ + public class Config + { + public Config() + { + SMSController[0] = new SMSControllerTemplate(true); + SMSController[1] = new SMSControllerTemplate(false); + PCEController[0] = new PCEControllerTemplate(true); + PCEController[1] = new PCEControllerTemplate(false); + PCEController[2] = new PCEControllerTemplate(false); + PCEController[3] = new PCEControllerTemplate(false); + PCEController[4] = new PCEControllerTemplate(false); + NESController[0] = new NESControllerTemplate(true); + NESController[1] = new NESControllerTemplate(false); + NESController[2] = new NESControllerTemplate(false); + NESController[3] = new NESControllerTemplate(false); + TI83Controller[0] = new TI83ControllerTemplate(true); + } - // Directories - public bool UseRecentForROMs = false; - public string LastRomPath = "."; - public string BasePath = "."; - - public string BaseNES = ".\\NES"; - public string PathNESROMs = "."; - public string PathNESSavestates = ".\\State"; - public string PathNESSaveRAM = ".\\SaveRAM"; - public string PathNESScreenshots = ".\\Screenshots"; - public string PathNESCheats = ".\\Cheats"; + // Directories + public bool UseRecentForROMs = false; + public string LastRomPath = "."; + public string BasePath = "."; + + public string BaseNES = ".\\NES"; + public string PathNESROMs = "."; + public string PathNESSavestates = ".\\State"; + public string PathNESSaveRAM = ".\\SaveRAM"; + public string PathNESScreenshots = ".\\Screenshots"; + public string PathNESCheats = ".\\Cheats"; public string PathNESPalette = ".\\Palettes"; - public string BaseSMS = ".\\SMS"; - public string PathSMSROMs = "."; - public string PathSMSSavestates = ".\\State"; - public string PathSMSSaveRAM = ".\\SaveRAM"; - public string PathSMSScreenshots = ".\\Screenshots"; - public string PathSMSCheats = ".\\Cheats"; + public string BaseSMS = ".\\SMS"; + public string PathSMSROMs = "."; + public string PathSMSSavestates = ".\\State"; + public string PathSMSSaveRAM = ".\\SaveRAM"; + public string PathSMSScreenshots = ".\\Screenshots"; + public string PathSMSCheats = ".\\Cheats"; - public string BaseGG = ".\\GG"; - public string PathGGROMs = "."; - public string PathGGSavestates = ".\\State"; - public string PathGGSaveRAM = ".\\SaveRAM"; - public string PathGGScreenshots = ".\\Screenshots"; - public string PathGGCheats = ".\\Cheats"; + public string BaseGG = ".\\GG"; + public string PathGGROMs = "."; + public string PathGGSavestates = ".\\State"; + public string PathGGSaveRAM = ".\\SaveRAM"; + public string PathGGScreenshots = ".\\Screenshots"; + public string PathGGCheats = ".\\Cheats"; - public string BaseSG = ".\\GG"; - public string PathSGROMs = "."; - public string PathSGSavestates = ".\\State"; - public string PathSGSaveRAM = ".\\SaveRAM"; - public string PathSGScreenshots = ".\\Screenshots"; - public string PathSGCheats = ".\\Cheats"; + public string BaseSG = ".\\GG"; + public string PathSGROMs = "."; + public string PathSGSavestates = ".\\State"; + public string PathSGSaveRAM = ".\\SaveRAM"; + public string PathSGScreenshots = ".\\Screenshots"; + public string PathSGCheats = ".\\Cheats"; - public string BaseGenesis = ".\\Genesis"; - public string PathGenesisROMs = "."; - public string PathGenesisSavestates = ".\\State"; - public string PathGenesisSaveRAM = ".\\SaveRAM"; - public string PathGenesisScreenshots = ".\\Screenshots"; - public string PathGenesisCheats = ".\\Cheats"; + public string BaseGenesis = ".\\Genesis"; + public string PathGenesisROMs = "."; + public string PathGenesisSavestates = ".\\State"; + public string PathGenesisSaveRAM = ".\\SaveRAM"; + public string PathGenesisScreenshots = ".\\Screenshots"; + public string PathGenesisCheats = ".\\Cheats"; - public string BasePCE = ".\\PCE"; - public string PathPCEROMs = "."; - public string PathPCESavestates = ".\\State"; - public string PathPCESaveRAM = ".\\SaveRAM"; - public string PathPCEScreenshots = ".\\Screenshots"; - public string PathPCECheats = ".\\Cheats"; + public string BasePCE = ".\\PCE"; + public string PathPCEROMs = "."; + public string PathPCESavestates = ".\\State"; + public string PathPCESaveRAM = ".\\SaveRAM"; + public string PathPCEScreenshots = ".\\Screenshots"; + public string PathPCECheats = ".\\Cheats"; - public string BaseGameboy = ".\\Gameboy"; - public string PathGBROMs = "."; - public string PathGBSavestates = ".\\State"; - public string PathGBSaveRAM = ".\\SaveRAM"; - public string PathGBScreenshots = ".\\Screenshots"; - public string PathGBCheats = ".\\Cheats"; + public string BaseGameboy = ".\\Gameboy"; + public string PathGBROMs = "."; + public string PathGBSavestates = ".\\State"; + public string PathGBSaveRAM = ".\\SaveRAM"; + public string PathGBScreenshots = ".\\Screenshots"; + public string PathGBCheats = ".\\Cheats"; - public string BaseTI83 = ".\\TI83"; - public string PathTI83ROMs = "."; - public string PathTI83Savestates = ".\\State"; - public string PathTI83SaveRAM = ".\\SaveRAM"; - public string PathTI83Screenshots = ".\\Screenshots"; - public string PathTI83Cheats = ".\\Cheats"; + public string BaseTI83 = ".\\TI83"; + public string PathTI83ROMs = "."; + public string PathTI83Savestates = ".\\State"; + public string PathTI83SaveRAM = ".\\SaveRAM"; + public string PathTI83Screenshots = ".\\Screenshots"; + public string PathTI83Cheats = ".\\Cheats"; - public string MoviesPath = ".\\Movies"; - public string LuaPath = ".\\Lua"; - public string WatchPath = "."; - public string AVIPath = "."; + public string MoviesPath = ".\\Movies"; + public string LuaPath = ".\\Lua"; + public string WatchPath = "."; + public string AVIPath = "."; public string FFMpegPath = "ffmpeg.exe"; - - // General Client Settings - public int TargetZoomFactor = 2; - public bool AutoLoadMostRecentRom = false; - public RecentFiles RecentRoms = new RecentFiles(8); - public bool PauseWhenMenuActivated = true; - public bool SaveWindowPosition = true; - public bool StartPaused = false; - public int MainWndx = -1; //Negative numbers will be ignored - public int MainWndy = -1; - public bool RunInBackground = true; - public bool AcceptBackgroundInput = false; - public bool SingleInstanceMode = false; - public bool AllowUD_LR = false; + + // General Client Settings + public int TargetZoomFactor = 2; + public bool AutoLoadMostRecentRom = false; + public RecentFiles RecentRoms = new RecentFiles(8); + public bool PauseWhenMenuActivated = true; + public bool SaveWindowPosition = true; + public bool StartPaused = false; + public int MainWndx = -1; //Negative numbers will be ignored + public int MainWndy = -1; + public bool RunInBackground = true; + public bool AcceptBackgroundInput = false; + public bool SingleInstanceMode = false; + public bool AllowUD_LR = false; public bool ShowContextMenu = true; public bool EnableBackupMovies = true; @@ -107,122 +107,122 @@ public int FrameProgressDelayMs = 500; //how long until a frame advance hold turns into a frame progress? public int FrameSkip = 0; public int SpeedPercent = 100; - public int SpeedPercentAlternate = 400; + public int SpeedPercentAlternate = 400; public bool LimitFramerate = true; public bool AutoMinimizeSkipping = true; public bool DisplayVSync = false; public bool RewindEnabled = true; - // Display options - public int MessagesColor = -1; - public int AlertMessageColor = -65536; - public int LastInputColor = -23296; - public bool DisplayFPS = false; - public int DispFPSx = 0; - public int DispFPSy = 0; + // Display options + public int MessagesColor = -1; + public int AlertMessageColor = -65536; + public int LastInputColor = -23296; + public bool DisplayFPS = false; + public int DispFPSx = 0; + public int DispFPSy = 0; public int DispFPSanchor = 0; //0 = UL, 1 = UR, 2 = DL, 3 = DR - public bool DisplayFrameCounter = false; - public int DispFrameCx = 0; - public int DispFrameCy = 12; + public bool DisplayFrameCounter = false; + public int DispFrameCx = 0; + public int DispFrameCy = 12; public int DispFrameanchor = 0; - public bool DisplayLagCounter = false; - public int DispLagx = 0; - public int DispLagy = 36; + public bool DisplayLagCounter = false; + public int DispLagx = 0; + public int DispLagy = 36; public int DispLaganchor = 0; - public bool DisplayInput = false; - public int DispInpx = 0; - public int DispInpy = 24; + public bool DisplayInput = false; + public int DispInpx = 0; + public int DispInpy = 24; public int DispInpanchor = 0; - public bool DisplayRerecordCount = false; - public int DispRecx = 0; - public int DispRecy = 48; + public bool DisplayRerecordCount = false; + public int DispRecx = 0; + public int DispRecy = 48; public int DispRecanchor = 0; public bool ForceGDI = false; - public bool DisplayStatusBar = true; + public bool DisplayStatusBar = true; - // Sound options - public bool SoundEnabled = true; - public bool MuteFrameAdvance = true; - public int SoundVolume = 100; //Range 0-100 + // Sound options + public bool SoundEnabled = true; + public bool MuteFrameAdvance = true; + public int SoundVolume = 100; //Range 0-100 - // Lua Console - public RecentFiles RecentLua = new RecentFiles(8); - public bool AutoLoadLua = false; - public bool LuaConsoleSaveWindowPosition = true; - public int LuaConsoleWndx = -1; //Negative numbers will be ignored even with save window position set - public int LuaConsoleWndy = -1; - public int LuaConsoleWidth = -1; - public int LuaConsoleHeight = -1; + // Lua Console + public RecentFiles RecentLua = new RecentFiles(8); + public bool AutoLoadLua = false; + public bool LuaConsoleSaveWindowPosition = true; + public int LuaConsoleWndx = -1; //Negative numbers will be ignored even with save window position set + public int LuaConsoleWndy = -1; + public int LuaConsoleWidth = -1; + public int LuaConsoleHeight = -1; - // RamWatch Settings - public bool AutoLoadRamWatch = false; - public RecentFiles RecentWatches = new RecentFiles(8); - public bool RamWatchSaveWindowPosition = true; - public int RamWatchWndx = -1; //Negative numbers will be ignored even with save window position set - public int RamWatchWndy = -1; - public int RamWatchWidth = -1; - public int RamWatchHeight = -1; - public bool RamWatchShowChangeColumn = true; - public bool RamWatchShowPrevColumn = false; - public bool RamWatchShowChangeFromPrev = true; - public int RamWatchAddressWidth = -1; - public int RamWatchValueWidth = -1; - public int RamWatchPrevWidth = -1; - public int RamWatchChangeWidth = -1; - public int RamWatchNotesWidth = -1; - public int RamWatchAddressIndex = 0; - public int RamWatchValueIndex = 1; - public int RamWatchPrevIndex = 2; - public int RamWatchChangeIndex = 3; - public int RamWatchNotesIndex = 4; + // RamWatch Settings + public bool AutoLoadRamWatch = false; + public RecentFiles RecentWatches = new RecentFiles(8); + public bool RamWatchSaveWindowPosition = true; + public int RamWatchWndx = -1; //Negative numbers will be ignored even with save window position set + public int RamWatchWndy = -1; + public int RamWatchWidth = -1; + public int RamWatchHeight = -1; + public bool RamWatchShowChangeColumn = true; + public bool RamWatchShowPrevColumn = false; + public bool RamWatchShowChangeFromPrev = true; + public int RamWatchAddressWidth = -1; + public int RamWatchValueWidth = -1; + public int RamWatchPrevWidth = -1; + public int RamWatchChangeWidth = -1; + public int RamWatchNotesWidth = -1; + public int RamWatchAddressIndex = 0; + public int RamWatchValueIndex = 1; + public int RamWatchPrevIndex = 2; + public int RamWatchChangeIndex = 3; + public int RamWatchNotesIndex = 4; - // RamSearch Settings - public bool AutoLoadRamSearch = false; - public bool RamSearchSaveWindowPosition = true; - public RecentFiles RecentSearches = new RecentFiles(8); - public int RamSearchWndx = -1; //Negative numbers will be ignored even with save window position set - public int RamSearchWndy = -1; - public int RamSearchWidth = -1; //Negative numbers will be ignored - public int RamSearchHeight = -1; - public int RamSearchPreviousAs = 0; - public bool RamSearchPreviewMode = true; - public bool AlwaysExludeRamWatch = false; - public int RamSearchAddressWidth = -1; - public int RamSearchValueWidth = -1; - public int RamSearchPrevWidth = -1; - public int RamSearchChangesWidth = -1; - public int RamSearchAddressIndex = 0; - public int RamSearchValueIndex = 1; - public int RamSearchPrevIndex = 2; - public int RamSearchChangesIndex = 3; + // RamSearch Settings + public bool AutoLoadRamSearch = false; + public bool RamSearchSaveWindowPosition = true; + public RecentFiles RecentSearches = new RecentFiles(8); + public int RamSearchWndx = -1; //Negative numbers will be ignored even with save window position set + public int RamSearchWndy = -1; + public int RamSearchWidth = -1; //Negative numbers will be ignored + public int RamSearchHeight = -1; + public int RamSearchPreviousAs = 0; + public bool RamSearchPreviewMode = true; + public bool AlwaysExludeRamWatch = false; + public int RamSearchAddressWidth = -1; + public int RamSearchValueWidth = -1; + public int RamSearchPrevWidth = -1; + public int RamSearchChangesWidth = -1; + public int RamSearchAddressIndex = 0; + public int RamSearchValueIndex = 1; + public int RamSearchPrevIndex = 2; + public int RamSearchChangesIndex = 3; - // HexEditor Settings - public bool AutoLoadHexEditor = false; - public bool HexEditorSaveWindowPosition = true; - public int HexEditorWndx = -1; //Negative numbers will be ignored even with save window position set - public int HexEditorWndy = -1; - public int HexEditorWidth = -1; - public int HexEditorHeight = -1; + // HexEditor Settings + public bool AutoLoadHexEditor = false; + public bool HexEditorSaveWindowPosition = true; + public int HexEditorWndx = -1; //Negative numbers will be ignored even with save window position set + public int HexEditorWndy = -1; + public int HexEditorWidth = -1; + public int HexEditorHeight = -1; - // NESPPU Settings - public bool AutoLoadNESPPU = false; - public bool NESPPUSaveWindowPosition = true; - public int NESPPUWndx = -1; - public int NESPPUWndy = -1; + // NESPPU Settings + public bool AutoLoadNESPPU = false; + public bool NESPPUSaveWindowPosition = true; + public int NESPPUWndx = -1; + public int NESPPUWndy = -1; - // NESDebuger Settings - public bool AutoLoadNESDebugger = false; - public bool NESDebuggerSaveWindowPosition = true; - public int NESDebuggerWndx = -1; - public int NESDebuggerWndy = -1; - public int NESDebuggerWidth = -1; - public int NESDebuggerHeight = -1; + // NESDebuger Settings + public bool AutoLoadNESDebugger = false; + public bool NESDebuggerSaveWindowPosition = true; + public int NESDebuggerWndx = -1; + public int NESDebuggerWndy = -1; + public int NESDebuggerWidth = -1; + public int NESDebuggerHeight = -1; - // NESNameTableViewer Settings - public bool AutoLoadNESNameTable = false; - public bool NESNameTableSaveWindowPosition = true; - public int NESNameTableWndx = -1; - public int NESNameTableWndy = -1; + // NESNameTableViewer Settings + public bool AutoLoadNESNameTable = false; + public bool NESNameTableSaveWindowPosition = true; + public int NESNameTableWndx = -1; + public int NESNameTableWndy = -1; // NES Graphics settings public bool NESAllowMoreThanEightSprites = false; @@ -233,441 +233,441 @@ public int NESBackgroundColor = 0; public string NESPaletteFile = ""; - // Cheats Dialog - public bool AutoLoadCheats = false; - public bool CheatsSaveWindowPosition = true; - public bool DisableCheatsOnLoad = false; - public bool LoadCheatFileByGame = true; - public bool CheatsAutoSaveOnClose = true; - public RecentFiles RecentCheats = new RecentFiles(8); - public int CheatsWndx = -1; - public int CheatsWndy = -1; - public int CheatsWidth = -1; - public int CheatsHeight = -1; - public int CheatsNameWidth = -1; - public int CheatsAddressWidth = -1; - public int CheatsValueWidth = -1; - public int CheatsDomainWidth = -1; - public int CheatsOnWidth = -1; - public int CheatsNameIndex = 0; - public int CheatsAddressIndex = 1; - public int CheatsValueIndex = 2; - public int CheatsDomainIndex = 3; - public int CheatsOnIndex = 4; + // Cheats Dialog + public bool AutoLoadCheats = false; + public bool CheatsSaveWindowPosition = true; + public bool DisableCheatsOnLoad = false; + public bool LoadCheatFileByGame = true; + public bool CheatsAutoSaveOnClose = true; + public RecentFiles RecentCheats = new RecentFiles(8); + public int CheatsWndx = -1; + public int CheatsWndy = -1; + public int CheatsWidth = -1; + public int CheatsHeight = -1; + public int CheatsNameWidth = -1; + public int CheatsAddressWidth = -1; + public int CheatsValueWidth = -1; + public int CheatsDomainWidth = -1; + public int CheatsOnWidth = -1; + public int CheatsNameIndex = 0; + public int CheatsAddressIndex = 1; + public int CheatsValueIndex = 2; + public int CheatsDomainIndex = 3; + public int CheatsOnIndex = 4; - - // TAStudio Dialog - public bool TAStudioSaveWindowPosition = true; + + // TAStudio Dialog + public bool TAStudioSaveWindowPosition = true; public bool AutoloadTAStudio = false; - public int TASWndx = -1; - public int TASWndy = -1; - public int TASWidth = -1; - public int TASHeight = -1; + public int TASWndx = -1; + public int TASWndy = -1; + public int TASWidth = -1; + public int TASHeight = -1; - // NES Game Genie Encoder/Decoder - public bool NESGGAutoload = false; - public bool NESGGSaveWindowPosition = true; - public int NESGGWndx = -1; - public int NESGGWndy = -1; + // NES Game Genie Encoder/Decoder + public bool NESGGAutoload = false; + public bool NESGGSaveWindowPosition = true; + public int NESGGWndx = -1; + public int NESGGWndy = -1; - //Movie Settings - public RecentFiles RecentMovies = new RecentFiles(8); - public bool AutoLoadMostRecentMovie = false; - public bool BindSavestatesToMovies = true; + //Movie Settings + public RecentFiles RecentMovies = new RecentFiles(8); + public bool AutoLoadMostRecentMovie = false; + public bool BindSavestatesToMovies = true; - //TI83 - public bool TI83disableSaveSlotKeys = true; - public bool TI83autoloadKeyPad = true; - public bool TI83KeypadSaveWindowPosition = true; - public int TI83KeyPadWndx = -1; - public int TI83KeyPadWndy = -1; - public bool TI83ToolTips = true; - - // Client Hotkey Bindings - public string HardResetBinding = "LeftControl+R"; //TODO: This needs to be Ctrl+R but how? - public string FastForwardBinding = "J1 B6, Tab"; - public string RewindBinding = "J1 B5, LeftShift+R, RightShift+R"; - public string EmulatorPauseBinding = "Pause"; - public string FrameAdvanceBinding = "F"; - public string UnthrottleBinding = "LeftShift+Tab"; - public string ScreenshotBinding = "F12"; - public string ToggleFullscreenBinding = "LeftAlt+Return, RightAlt+Return"; - public string QuickSave = "I"; - public string QuickLoad = "P"; - public string SelectSlot0 = "0"; - public string SelectSlot1 = "1"; - public string SelectSlot2 = "2"; - public string SelectSlot3 = "3"; - public string SelectSlot4 = "4"; - public string SelectSlot5 = "5"; - public string SelectSlot6 = "6"; - public string SelectSlot7 = "7"; - public string SelectSlot8 = "8"; - public string SelectSlot9 = "9"; - public string SaveSlot0 = "LeftShift+F10"; - public string SaveSlot1 = "LeftShift+F1"; - public string SaveSlot2 = "LeftShift+F2"; - public string SaveSlot3 = "LeftShift+F3"; - public string SaveSlot4 = "LeftShift+F4"; - public string SaveSlot5 = "LeftShift+F5"; - public string SaveSlot6 = "LeftShift+F6"; - public string SaveSlot7 = "LeftShift+F7"; - public string SaveSlot8 = "LeftShift+F8"; - public string SaveSlot9 = "LeftShift+F9"; - public string LoadSlot0 = "F10"; - public string LoadSlot1 = "F1"; - public string LoadSlot2 = "F2"; - public string LoadSlot3 = "F3"; - public string LoadSlot4 = "F4"; - public string LoadSlot5 = "F5"; - public string LoadSlot6 = "F6"; - public string LoadSlot7 = "F7"; - public string LoadSlot8 = "F8"; - public string LoadSlot9 = "F9"; - public string ToolBox = "T"; - public string SaveNamedState = ""; - public string LoadNamedState = ""; - public string PreviousSlot = ""; - public string NextSlot = ""; - public string RamWatch = ""; - public string RamSearch = ""; - public string RamPoke = ""; - public string HexEditor = ""; - public string LuaConsole = ""; - public string Cheats = ""; - public string OpenROM = "LeftControl+O"; - public string CloseROM = "LeftControl+W"; - public string FrameCounterBinding = ""; - public string FPSBinding = ""; - public string LagCounterBinding = ""; - public string InputDisplayBinding = ""; - public string ReadOnlyToggleBinding = "Q"; - public string PlayMovieBinding = ""; - public string RecordMovieBinding = ""; - public string StopMovieBinding = ""; - public string PlayBeginningBinding = ""; - public string VolUpBinding = ""; - public string VolDownBinding = ""; - public string ToggleMultiTrack = ""; - public string MTRecordAll = ""; - public string MTRecordNone = ""; - public string MTIncrementPlayer = ""; - public string MTDecrementPlayer = ""; - - // SMS / GameGear Settings - public bool SmsEnableFM = true; - public bool SmsAllowOverlock = false; - public bool SmsForceStereoSeparation = false; + //TI83 + public bool TI83disableSaveSlotKeys = true; + public bool TI83autoloadKeyPad = true; + public bool TI83KeypadSaveWindowPosition = true; + public int TI83KeyPadWndx = -1; + public int TI83KeyPadWndy = -1; + public bool TI83ToolTips = true; - public string SmsReset = "Tab"; - public string SmsPause = "J1 B8, Space"; - public SMSControllerTemplate[] SMSController = new SMSControllerTemplate[2]; + // Client Hotkey Bindings + public string HardResetBinding = "LeftControl+R"; //TODO: This needs to be Ctrl+R but how? + public string FastForwardBinding = "J1 B6, Tab"; + public string RewindBinding = "J1 B5, LeftShift+R, RightShift+R"; + public string EmulatorPauseBinding = "Pause"; + public string FrameAdvanceBinding = "F"; + public string UnthrottleBinding = "LeftShift+Tab"; + public string ScreenshotBinding = "F12"; + public string ToggleFullscreenBinding = "LeftAlt+Return, RightAlt+Return"; + public string QuickSave = "I"; + public string QuickLoad = "P"; + public string SelectSlot0 = "0"; + public string SelectSlot1 = "1"; + public string SelectSlot2 = "2"; + public string SelectSlot3 = "3"; + public string SelectSlot4 = "4"; + public string SelectSlot5 = "5"; + public string SelectSlot6 = "6"; + public string SelectSlot7 = "7"; + public string SelectSlot8 = "8"; + public string SelectSlot9 = "9"; + public string SaveSlot0 = "LeftShift+F10"; + public string SaveSlot1 = "LeftShift+F1"; + public string SaveSlot2 = "LeftShift+F2"; + public string SaveSlot3 = "LeftShift+F3"; + public string SaveSlot4 = "LeftShift+F4"; + public string SaveSlot5 = "LeftShift+F5"; + public string SaveSlot6 = "LeftShift+F6"; + public string SaveSlot7 = "LeftShift+F7"; + public string SaveSlot8 = "LeftShift+F8"; + public string SaveSlot9 = "LeftShift+F9"; + public string LoadSlot0 = "F10"; + public string LoadSlot1 = "F1"; + public string LoadSlot2 = "F2"; + public string LoadSlot3 = "F3"; + public string LoadSlot4 = "F4"; + public string LoadSlot5 = "F5"; + public string LoadSlot6 = "F6"; + public string LoadSlot7 = "F7"; + public string LoadSlot8 = "F8"; + public string LoadSlot9 = "F9"; + public string ToolBox = "T"; + public string SaveNamedState = ""; + public string LoadNamedState = ""; + public string PreviousSlot = ""; + public string NextSlot = ""; + public string RamWatch = ""; + public string RamSearch = ""; + public string RamPoke = ""; + public string HexEditor = ""; + public string LuaConsole = ""; + public string Cheats = ""; + public string OpenROM = "LeftControl+O"; + public string CloseROM = "LeftControl+W"; + public string FrameCounterBinding = ""; + public string FPSBinding = ""; + public string LagCounterBinding = ""; + public string InputDisplayBinding = ""; + public string ReadOnlyToggleBinding = "Q"; + public string PlayMovieBinding = ""; + public string RecordMovieBinding = ""; + public string StopMovieBinding = ""; + public string PlayBeginningBinding = ""; + public string VolUpBinding = ""; + public string VolDownBinding = ""; + public string ToggleMultiTrack = ""; + public string MTRecordAll = ""; + public string MTRecordNone = ""; + public string MTIncrementPlayer = ""; + public string MTDecrementPlayer = ""; - // PCEngine Settings - public PCEControllerTemplate[] PCEController = new PCEControllerTemplate[5]; + // SMS / GameGear Settings + public bool SmsEnableFM = true; + public bool SmsAllowOverlock = false; + public bool SmsForceStereoSeparation = false; - // Genesis Settings - public string GenP1Up = "J1 Up, UpArrow"; - public string GenP1Down = "J1 Down, DownArrow"; - public string GenP1Left = "J1 Left, LeftArrow"; - public string GenP1Right = "J1 Right, RightArrow"; - public string GenP1A = "J1 B1, Z"; - public string GenP1B = "J1 B3, X"; - public string GenP1C = "J1 B4, C"; - public string GenP1Start = "J1 B8, Return"; + public string SmsReset = "Tab"; + public string SmsPause = "J1 B8, Space"; + public SMSControllerTemplate[] SMSController = new SMSControllerTemplate[2]; - //GameBoy Settings - public NESControllerTemplate GameBoyController = new NESControllerTemplate(true); + // PCEngine Settings + public PCEControllerTemplate[] PCEController = new PCEControllerTemplate[5]; + + // Genesis Settings + public string GenP1Up = "J1 Up, UpArrow"; + public string GenP1Down = "J1 Down, DownArrow"; + public string GenP1Left = "J1 Left, LeftArrow"; + public string GenP1Right = "J1 Right, RightArrow"; + public string GenP1A = "J1 B1, Z"; + public string GenP1B = "J1 B3, X"; + public string GenP1C = "J1 B4, C"; + public string GenP1Start = "J1 B8, Return"; + + //GameBoy Settings + public NESControllerTemplate GameBoyController = new NESControllerTemplate(true); //NES settings - public string NESReset = "Backspace"; - public NESControllerTemplate[] NESController = new NESControllerTemplate[4]; + public string NESReset = "Backspace"; + public NESControllerTemplate[] NESController = new NESControllerTemplate[4]; - //TI 83 settings - public TI83ControllerTemplate[] TI83Controller = new TI83ControllerTemplate[1]; - } + //TI 83 settings + public TI83ControllerTemplate[] TI83Controller = new TI83ControllerTemplate[1]; + } - public class SMSControllerTemplate - { - public string Up; - public string Down; - public string Left; - public string Right; - public string B1; - public string B2; - public bool Enabled; - public SMSControllerTemplate() { } - public SMSControllerTemplate(bool defaults) - { - if (defaults) - { - Enabled = true; - Up = "J1 Up, UpArrow"; - Down = "J1 Down, DownArrow"; - Left = "J1 Left, LeftArrow"; - Right = "J1 Right, RightArrow"; - B1 = "J1 B1, Z"; - B2 = "J1 B2, X"; - } - else - { - Enabled = false; - Up = ""; - Down = ""; - Right = ""; - Left = ""; - B1 = ""; - B2 = ""; - } - } - } + public class SMSControllerTemplate + { + public string Up; + public string Down; + public string Left; + public string Right; + public string B1; + public string B2; + public bool Enabled; + public SMSControllerTemplate() { } + public SMSControllerTemplate(bool defaults) + { + if (defaults) + { + Enabled = true; + Up = "J1 Up, UpArrow"; + Down = "J1 Down, DownArrow"; + Left = "J1 Left, LeftArrow"; + Right = "J1 Right, RightArrow"; + B1 = "J1 B1, Z"; + B2 = "J1 B2, X"; + } + else + { + Enabled = false; + Up = ""; + Down = ""; + Right = ""; + Left = ""; + B1 = ""; + B2 = ""; + } + } + } - public class PCEControllerTemplate - { - public string Up; - public string Down; - public string Left; - public string Right; - public string I; - public string II; - public string Run; - public string Select; - public bool Enabled; - public PCEControllerTemplate() { } - public PCEControllerTemplate(bool defaults) - { - if (defaults) - { - Enabled = true; - Up = "J1 Up, UpArrow"; - Down = "J1 Down, DownArrow"; - Left = "J1 Left, LeftArrow"; - Right = "J1 Right, RightArrow"; - I = "J1 B1, X"; - II = "J1 B2, Z"; - Run = "J1 B8, C"; - Select = "J1 B7, V"; - } - else - { - Enabled = false; - Up = ""; - Down = ""; - Right = ""; - Left = ""; - I = ""; - II = ""; - Run = ""; - Select = ""; - } - } - } + public class PCEControllerTemplate + { + public string Up; + public string Down; + public string Left; + public string Right; + public string I; + public string II; + public string Run; + public string Select; + public bool Enabled; + public PCEControllerTemplate() { } + public PCEControllerTemplate(bool defaults) + { + if (defaults) + { + Enabled = true; + Up = "J1 Up, UpArrow"; + Down = "J1 Down, DownArrow"; + Left = "J1 Left, LeftArrow"; + Right = "J1 Right, RightArrow"; + I = "J1 B1, X"; + II = "J1 B2, Z"; + Run = "J1 B8, C"; + Select = "J1 B7, V"; + } + else + { + Enabled = false; + Up = ""; + Down = ""; + Right = ""; + Left = ""; + I = ""; + II = ""; + Run = ""; + Select = ""; + } + } + } - public class NESControllerTemplate - { - public string Up; - public string Down; - public string Left; - public string Right; - public string A; - public string B; - public string Start; - public string Select; - public bool Enabled; - public NESControllerTemplate() { } - public NESControllerTemplate(bool defaults) - { - if (defaults) - { - Enabled = true; - Up = "J1 Up, UpArrow"; - Down = "J1 Down, DownArrow"; - Left = "J1 Left, LeftArrow"; - Right = "J1 Right, RightArrow"; - A = "J1 B2, X"; - B = "J1 B1, Z"; - Start = "J1 B8, Return"; - Select = "J1 B7, Space"; - } - else - { - Enabled = false; - Up = ""; - Down = ""; - Right = ""; - Left = ""; - A = ""; - B = ""; - Start = ""; - Select = ""; - } - } - } + public class NESControllerTemplate + { + public string Up; + public string Down; + public string Left; + public string Right; + public string A; + public string B; + public string Start; + public string Select; + public bool Enabled; + public NESControllerTemplate() { } + public NESControllerTemplate(bool defaults) + { + if (defaults) + { + Enabled = true; + Up = "J1 Up, UpArrow"; + Down = "J1 Down, DownArrow"; + Left = "J1 Left, LeftArrow"; + Right = "J1 Right, RightArrow"; + A = "J1 B2, X"; + B = "J1 B1, Z"; + Start = "J1 B8, Return"; + Select = "J1 B7, Space"; + } + else + { + Enabled = false; + Up = ""; + Down = ""; + Right = ""; + Left = ""; + A = ""; + B = ""; + Start = ""; + Select = ""; + } + } + } - public class TI83ControllerTemplate - { - public string _0; - public string _1; - public string _2; - public string _3; - public string _4; - public string _5; - public string _6; - public string _7; - public string _8; - public string _9; - public string DOT; - public string ON; - public string ENTER; - public string DOWN; - public string UP; - public string LEFT; - public string RIGHT; - public string PLUS; - public string MINUS; - public string MULTIPLY; - public string DIVIDE; - public string CLEAR; - public string EXP; - public string DASH; - public string PARACLOSE; - public string TAN; - public string VARS; - public string PARAOPEN; - public string COS; - public string PRGM; - public string STAT; - public string SIN; - public string MATRIX; - public string X; - public string STO; - public string LN; - public string LOG; - public string SQUARED; - public string NEG1; - public string MATH; - public string ALPHA; - public string GRAPH; - public string TRACE; - public string ZOOM; - public string WINDOW; - public string Y; - public string SECOND; - public string MODE; - public string DEL; - public TI83ControllerTemplate() { } - public bool Enabled; - public string COMMA; - public TI83ControllerTemplate(bool defaults) - { - if (defaults) - { - Enabled = true; - _0 = "NumberPad0"; //0 - _1 = "NumberPad1"; //1 - _2 = "NumberPad2"; //2 - _3 = "NumberPad3"; //3 - _4 = "NumberPad4"; //4 - _5 = "NumberPad5"; //5 - _6 = "NumberPad6"; //6 - _7 = "NumberPad7"; //7 - _8 = "NumberPad8"; //8 - _9 = "NumberPad9"; //9 - DOT = "NumberPadPeriod";//10 - ON = "Space"; //11 - ENTER = "Return"; //12 - UP = "UpArrow"; //13 - DOWN = "DownArrow"; //14 - LEFT = "LeftArrow"; //15 - RIGHT = "RightArrow"; //16 - PLUS = "NumberPadPlus"; //17 - MINUS = "NumberPadMinus"; //18 - MULTIPLY = "NumberPadStar"; //19 - DIVIDE = "NumberPadSlash"; //20 - CLEAR = "Escape"; //21 - EXP = "6"; //22 - DASH = "Minus"; //23 - PARACLOSE = "0"; //24 - PARAOPEN = "9"; //25 - TAN = "T"; //26 - VARS = "V"; //27 - COS = "C"; //28 - PRGM = "R"; //29 - STAT = "S"; //30 - MATRIX = "LeftBracket"; //31 - X = "X"; //32 - STO = "Insert"; //33 - LN = "L"; //34 - LOG = "O"; //35 - SQUARED = "2"; //36 - NEG1 = "1"; //37 - MATH = "M"; //38 - ALPHA = "A"; //39 - GRAPH = "G"; //40 - TRACE = "Home"; //41 - ZOOM = "Z"; //42 - WINDOW = "W"; //43 - Y = "Y"; //44 - SECOND = "Slash"; //45 - MODE = "BackSlash"; //46 - DEL = "Delete"; //47 - COMMA = "Comma"; //48 - SIN = "Period"; //49 - } - else - { - Enabled = false; - _0 = ""; - _1 = ""; - _2 = ""; - _3 = ""; - _4 = ""; - _5 = ""; - _6 = ""; - _7 = ""; - _8 = ""; - _9 = ""; - DOT = ""; - ON = ""; - ENTER = ""; - UP = ""; - DOWN = ""; - LEFT = ""; - RIGHT = ""; - PLUS = ""; - MINUS = ""; - MULTIPLY = ""; - DIVIDE = ""; - CLEAR = ""; - EXP = ""; - DASH = ""; - PARACLOSE = ""; - TAN = ""; - VARS = ""; - PARAOPEN = ""; - COS = ""; - PRGM = ""; - STAT = ""; - SIN = ""; - MATRIX = ""; - X = ""; - STO = ""; - LN = ""; - LOG = ""; - SQUARED = ""; - NEG1 = ""; - MATH = ""; - ALPHA = ""; - GRAPH = ""; - TRACE = ""; - ZOOM = ""; - WINDOW = ""; - Y = ""; - SECOND = ""; - MODE = ""; - DEL = ""; - COMMA = ""; - } - } - } + public class TI83ControllerTemplate + { + public string _0; + public string _1; + public string _2; + public string _3; + public string _4; + public string _5; + public string _6; + public string _7; + public string _8; + public string _9; + public string DOT; + public string ON; + public string ENTER; + public string DOWN; + public string UP; + public string LEFT; + public string RIGHT; + public string PLUS; + public string MINUS; + public string MULTIPLY; + public string DIVIDE; + public string CLEAR; + public string EXP; + public string DASH; + public string PARACLOSE; + public string TAN; + public string VARS; + public string PARAOPEN; + public string COS; + public string PRGM; + public string STAT; + public string SIN; + public string MATRIX; + public string X; + public string STO; + public string LN; + public string LOG; + public string SQUARED; + public string NEG1; + public string MATH; + public string ALPHA; + public string GRAPH; + public string TRACE; + public string ZOOM; + public string WINDOW; + public string Y; + public string SECOND; + public string MODE; + public string DEL; + public TI83ControllerTemplate() { } + public bool Enabled; + public string COMMA; + public TI83ControllerTemplate(bool defaults) + { + if (defaults) + { + Enabled = true; + _0 = "NumberPad0"; //0 + _1 = "NumberPad1"; //1 + _2 = "NumberPad2"; //2 + _3 = "NumberPad3"; //3 + _4 = "NumberPad4"; //4 + _5 = "NumberPad5"; //5 + _6 = "NumberPad6"; //6 + _7 = "NumberPad7"; //7 + _8 = "NumberPad8"; //8 + _9 = "NumberPad9"; //9 + DOT = "NumberPadPeriod";//10 + ON = "Space"; //11 + ENTER = "Return"; //12 + UP = "UpArrow"; //13 + DOWN = "DownArrow"; //14 + LEFT = "LeftArrow"; //15 + RIGHT = "RightArrow"; //16 + PLUS = "NumberPadPlus"; //17 + MINUS = "NumberPadMinus"; //18 + MULTIPLY = "NumberPadStar"; //19 + DIVIDE = "NumberPadSlash"; //20 + CLEAR = "Escape"; //21 + EXP = "6"; //22 + DASH = "Minus"; //23 + PARACLOSE = "0"; //24 + PARAOPEN = "9"; //25 + TAN = "T"; //26 + VARS = "V"; //27 + COS = "C"; //28 + PRGM = "R"; //29 + STAT = "S"; //30 + MATRIX = "LeftBracket"; //31 + X = "X"; //32 + STO = "Insert"; //33 + LN = "L"; //34 + LOG = "O"; //35 + SQUARED = "2"; //36 + NEG1 = "1"; //37 + MATH = "M"; //38 + ALPHA = "A"; //39 + GRAPH = "G"; //40 + TRACE = "Home"; //41 + ZOOM = "Z"; //42 + WINDOW = "W"; //43 + Y = "Y"; //44 + SECOND = "Slash"; //45 + MODE = "BackSlash"; //46 + DEL = "Delete"; //47 + COMMA = "Comma"; //48 + SIN = "Period"; //49 + } + else + { + Enabled = false; + _0 = ""; + _1 = ""; + _2 = ""; + _3 = ""; + _4 = ""; + _5 = ""; + _6 = ""; + _7 = ""; + _8 = ""; + _9 = ""; + DOT = ""; + ON = ""; + ENTER = ""; + UP = ""; + DOWN = ""; + LEFT = ""; + RIGHT = ""; + PLUS = ""; + MINUS = ""; + MULTIPLY = ""; + DIVIDE = ""; + CLEAR = ""; + EXP = ""; + DASH = ""; + PARACLOSE = ""; + TAN = ""; + VARS = ""; + PARAOPEN = ""; + COS = ""; + PRGM = ""; + STAT = ""; + SIN = ""; + MATRIX = ""; + X = ""; + STO = ""; + LN = ""; + LOG = ""; + SQUARED = ""; + NEG1 = ""; + MATH = ""; + ALPHA = ""; + GRAPH = ""; + TRACE = ""; + ZOOM = ""; + WINDOW = ""; + Y = ""; + SECOND = ""; + MODE = ""; + DEL = ""; + COMMA = ""; + } + } + } } \ No newline at end of file diff --git a/BizHawk.MultiClient/ConfigService.cs b/BizHawk.MultiClient/ConfigService.cs index 8984543991..34678dff1b 100644 --- a/BizHawk.MultiClient/ConfigService.cs +++ b/BizHawk.MultiClient/ConfigService.cs @@ -3,37 +3,37 @@ using Newtonsoft.Json; namespace BizHawk.MultiClient { - public static class ConfigService - { - public static T Load(string filepath) where T : new() - { - T config = new T(); + public static class ConfigService + { + public static T Load(string filepath) where T : new() + { + T config = new T(); - try - { - var file = new FileInfo(filepath); - if(file.Exists) + try + { + var file = new FileInfo(filepath); + if (file.Exists) using (var reader = file.OpenText()) { var s = new JsonSerializer(); var r = new JsonReader(reader); - config = (T) s.Deserialize(r, typeof (T)); + config = (T)s.Deserialize(r, typeof(T)); } - } - catch { } + } + catch { } if (config == null) return new T(); - else return config; - } + else return config; + } - public static void Save(string filepath, object config) - { - var file = new FileInfo(filepath); - using (var writer = file.CreateText()) - { - var s = new JsonSerializer(); - var w = new JsonWriter(writer) { Formatting = Formatting.Indented }; - s.Serialize(w, config); - } - } - } + public static void Save(string filepath, object config) + { + var file = new FileInfo(filepath); + using (var writer = file.CreateText()) + { + var s = new JsonSerializer(); + var w = new JsonWriter(writer) { Formatting = Formatting.Indented }; + s.Serialize(w, config); + } + } + } } \ No newline at end of file diff --git a/BizHawk.MultiClient/Global.cs b/BizHawk.MultiClient/Global.cs index 63ba369e2b..345fe83d77 100644 --- a/BizHawk.MultiClient/Global.cs +++ b/BizHawk.MultiClient/Global.cs @@ -3,24 +3,24 @@ using SlimDX.DirectSound; namespace BizHawk.MultiClient { - public static class Global - { - public static MainForm MainForm; - public static DirectSound DSound; - public static Direct3D Direct3D; - public static Sound Sound; - public static IRenderer RenderPanel; - public static Config Config; - public static IEmulator Emulator; + public static class Global + { + public static MainForm MainForm; + public static DirectSound DSound; + public static Direct3D Direct3D; + public static Sound Sound; + public static IRenderer RenderPanel; + public static Config Config; + public static IEmulator Emulator; public static CoreInputComm CoreInputComm; - public static RomGame Game; - public static Controller ClientControls; - public static Controller SMSControls; - public static Controller PCEControls; - public static Controller GenControls; + public static RomGame Game; + public static Controller ClientControls; + public static Controller SMSControls; + public static Controller PCEControls; + public static Controller GenControls; public static Controller TI83Controls; public static Controller NESControls; - public static Controller ActiveController; - public static Controller NullControls; - } + public static Controller ActiveController; + public static Controller NullControls; + } } \ No newline at end of file diff --git a/BizHawk.MultiClient/HawkFile.cs b/BizHawk.MultiClient/HawkFile.cs index 50d72dc47d..9d6c17b9ef 100644 --- a/BizHawk.MultiClient/HawkFile.cs +++ b/BizHawk.MultiClient/HawkFile.cs @@ -9,8 +9,8 @@ namespace BizHawk.MultiClient //split into "bind" and "open (the bound thing)" //scan archive to flatten interior directories down to a path (maintain our own archive item list) - public class HawkFile : IDisposable - { + public class HawkFile : IDisposable + { public static bool ExistsAt(string path) { using (var file = new HawkFile(path)) @@ -62,7 +62,7 @@ namespace BizHawk.MultiClient /// /// returns the complete canonical full path ("c:\path\to\archive|member") of the bound file /// - public string CanonicalFullPath { get { return MakeCanonicalName(rootPath,memberPath); } } + public string CanonicalFullPath { get { return MakeCanonicalName(rootPath, memberPath); } } /// /// returns the complete canonical name ("archive|member") of the bound file @@ -72,7 +72,7 @@ namespace BizHawk.MultiClient /// /// returns the virtual name of the bound file (disregarding the archive) /// - public string Name { get { return GetBoundNameFromCanonical(MakeCanonicalName(rootPath,memberPath)); } } + public string Name { get { return GetBoundNameFromCanonical(MakeCanonicalName(rootPath, memberPath)); } } /// /// returns the extension of Name @@ -111,7 +111,7 @@ namespace BizHawk.MultiClient List archiveItems; public HawkFile(string path) - { + { string autobind = null; bool isArchivePath = IsCanonicalArchivePath(path); if (isArchivePath) @@ -121,11 +121,11 @@ namespace BizHawk.MultiClient autobind = parts[1]; } - var fi = new FileInfo(path); + var fi = new FileInfo(path); rootExists = fi.Exists; if (fi.Exists == false) - return; + return; rootPath = path; exists = true; @@ -158,7 +158,7 @@ namespace BizHawk.MultiClient exists = false; } - } + } /// /// is the supplied path a canonical name including an archive? @@ -204,7 +204,7 @@ namespace BizHawk.MultiClient boundStream.Position = 0; memberPath = FixArchiveFilename(extractor.ArchiveFileNames[archiveIndex]); //TODO - maybe go through our own list of names? maybe not, its indexes dont match.. Console.WriteLine("bound " + CanonicalFullPath); - + return this; } @@ -244,7 +244,7 @@ namespace BizHawk.MultiClient return BindByExtensionCore(false, extensions); } - /// + /// /// Binds the first item in the archive (or the file itself) if the extension matches one of the supplied templates. /// You probably should not use this. use BindSoleItemOf or the archive chooser instead /// @@ -308,7 +308,7 @@ namespace BizHawk.MultiClient } private void AnalyzeArchive(string path) - { + { SevenZip.FileChecker.ThrowExceptions = false; int offset; bool isExecutable; @@ -326,17 +326,17 @@ namespace BizHawk.MultiClient archiveItems = null; } } - } + } - public void Dispose() - { + public void Dispose() + { Unbind(); - + if (extractor != null) extractor.Dispose(); if (rootStream != null) rootStream.Dispose(); extractor = null; rootStream = null; } - } + } } \ No newline at end of file diff --git a/BizHawk.MultiClient/Input/ControllerBinding.cs b/BizHawk.MultiClient/Input/ControllerBinding.cs index 0d4e057dcb..2ad9b92cd8 100644 --- a/BizHawk.MultiClient/Input/ControllerBinding.cs +++ b/BizHawk.MultiClient/Input/ControllerBinding.cs @@ -4,108 +4,108 @@ using System.Text; namespace BizHawk.MultiClient { - public class Controller : IController - { - private ControllerDefinition type; - private Dictionary> bindings = new Dictionary>(); - private Dictionary stickyButtons = new Dictionary(); - private List unpressedButtons = new List(); - private List forcePressedButtons = new List(); - private List removeFromForcePressedButtons = new List(); - private List programmaticallyPressedButtons = new List(); + public class Controller : IController + { + private ControllerDefinition type; + private Dictionary> bindings = new Dictionary>(); + private Dictionary stickyButtons = new Dictionary(); + private List unpressedButtons = new List(); + private List forcePressedButtons = new List(); + private List removeFromForcePressedButtons = new List(); + private List programmaticallyPressedButtons = new List(); - private bool movieMode; - public bool MovieMode - { - get { return movieMode; } - set - { - movieMode = value; - if (value == false) - programmaticallyPressedButtons.Clear(); - } - } + private bool movieMode; + public bool MovieMode + { + get { return movieMode; } + set + { + movieMode = value; + if (value == false) + programmaticallyPressedButtons.Clear(); + } + } - public Controller(ControllerDefinition definition) - { - type = definition; + public Controller(ControllerDefinition definition) + { + type = definition; - foreach (var b in type.BoolButtons) - { - bindings[b] = new List(); - stickyButtons[b] = false; - } + foreach (var b in type.BoolButtons) + { + bindings[b] = new List(); + stickyButtons[b] = false; + } - foreach (var f in type.FloatControls) - bindings[f] = new List(); - } - - public void BindButton(string button, string control) - { - bindings[button].Add(control); - } + foreach (var f in type.FloatControls) + bindings[f] = new List(); + } - public void BindMulti(string button, string controlString) - { - if (string.IsNullOrEmpty(controlString)) - return; - string[] controlbindings = controlString.Split(','); - foreach (string control in controlbindings) + public void BindButton(string button, string control) + { + bindings[button].Add(control); + } + + public void BindMulti(string button, string controlString) + { + if (string.IsNullOrEmpty(controlString)) + return; + string[] controlbindings = controlString.Split(','); + foreach (string control in controlbindings) bindings[button].Add(control.Trim()); - } + } - public ControllerDefinition Type - { - get { return type; } - } + public ControllerDefinition Type + { + get { return type; } + } - public bool this[string button] - { - get { return IsPressed(button); } - } - - public bool IsPressed(string button) - { - if (MovieMode) - { - return programmaticallyPressedButtons.Contains(button); - } - if (forcePressedButtons.Contains(button)) - { - removeFromForcePressedButtons.Add(button); - return true; - } - if (unpressedButtons.Contains(button)) - { - if (IsPressedActually(button) == false) - unpressedButtons.Remove(button); + public bool this[string button] + { + get { return IsPressed(button); } + } - return false; - } + public bool IsPressed(string button) + { + if (MovieMode) + { + return programmaticallyPressedButtons.Contains(button); + } + if (forcePressedButtons.Contains(button)) + { + removeFromForcePressedButtons.Add(button); + return true; + } + if (unpressedButtons.Contains(button)) + { + if (IsPressedActually(button) == false) + unpressedButtons.Remove(button); - if (Global.Config.AllowUD_LR == false) - { - string prefix; + return false; + } - if (button.Contains("Down")) - { - prefix = button.GetPrecedingString("Down"); - if (IsPressed(prefix + "Up")) - return false; - } - if (button.Contains("Right")) - { - prefix = button.GetPrecedingString("Right"); - if (IsPressed(prefix + "Left")) - return false; - } - } + if (Global.Config.AllowUD_LR == false) + { + string prefix; - return IsPressedActually(button); - } + if (button.Contains("Down")) + { + prefix = button.GetPrecedingString("Down"); + if (IsPressed(prefix + "Up")) + return false; + } + if (button.Contains("Right")) + { + prefix = button.GetPrecedingString("Right"); + if (IsPressed(prefix + "Left")) + return false; + } + } - public bool IsPressedActually(string button) - { + return IsPressedActually(button); + } + + public bool IsPressedActually(string button) + { bool sticky = stickyButtons[button]; foreach (var control in bindings[button]) @@ -113,95 +113,95 @@ namespace BizHawk.MultiClient return sticky ? false : true; return sticky ? true : false; - } + } - public float GetFloat(string name) - { - throw new NotImplementedException(); - } + public float GetFloat(string name) + { + throw new NotImplementedException(); + } - public void UnpressButton(string name) - { - unpressedButtons.Add(name); - } + public void UnpressButton(string name) + { + unpressedButtons.Add(name); + } - private int frameNumber; + private int frameNumber; - public void UpdateControls(int frame) - { - if (frame != frameNumber) - { - // update - unpressedButtons.RemoveAll(button => IsPressedActually(button) == false); - forcePressedButtons.RemoveAll(button => removeFromForcePressedButtons.Contains(button)); - removeFromForcePressedButtons.Clear(); - } - frameNumber = frame; - } + public void UpdateControls(int frame) + { + if (frame != frameNumber) + { + // update + unpressedButtons.RemoveAll(button => IsPressedActually(button) == false); + forcePressedButtons.RemoveAll(button => removeFromForcePressedButtons.Contains(button)); + removeFromForcePressedButtons.Clear(); + } + frameNumber = frame; + } - public void SetSticky(string button, bool sticky) - { - stickyButtons[button] = sticky; - } + public void SetSticky(string button, bool sticky) + { + stickyButtons[button] = sticky; + } - public bool IsSticky(string button) - { - return stickyButtons[button]; - } + public bool IsSticky(string button) + { + return stickyButtons[button]; + } - public void ForceButton(string button) - { - forcePressedButtons.Add(button); - } + public void ForceButton(string button) + { + forcePressedButtons.Add(button); + } - public string GetControllersAsMnemonic() - { - StringBuilder input = new StringBuilder("|"); - - if (type.Name == "SMS Controller") - { - input.Append(IsPressed("P1 Up") ? "U" : "."); - input.Append(IsPressed("P1 Down") ? "D" : "."); - input.Append(IsPressed("P1 Left") ? "L" : "."); - input.Append(IsPressed("P1 Right") ? "R" : "."); - input.Append(IsPressed("P1 B1") ? "1" : "."); - input.Append(IsPressed("P1 B2") ? "2" : "."); - input.Append("|"); - input.Append(IsPressed("P2 Up") ? "U" : "."); - input.Append(IsPressed("P2 Down") ? "D" : "."); - input.Append(IsPressed("P2 Left") ? "L" : "."); - input.Append(IsPressed("P2 Right") ? "R" : "."); - input.Append(IsPressed("P2 B1") ? "1" : "."); - input.Append(IsPressed("P2 B2") ? "2" : "."); - input.Append("|"); - input.Append(IsPressed("Pause") ? "P" : "."); - input.Append(IsPressed("Reset") ? "R" : "."); - input.Append("|"); - return input.ToString(); - } + public string GetControllersAsMnemonic() + { + StringBuilder input = new StringBuilder("|"); - if (type.Name == "PC Engine Controller") - { - input.Append("."); //TODO: reset goes here - the turbografx DOES NOT HAVE A RESET BUTTON. but I assume this is for pcejin movie file compatibility, which is a fools errand anyway......... I'll leave it for now, but marked for deletion - input.Append("|"); - for (int player = 1; player < 6; player++) - { - input.Append(IsPressed("P" + player.ToString() + " Up") ? "U" : "."); - input.Append(IsPressed("P" + player.ToString() + " Down") ? "D" : "."); - input.Append(IsPressed("P" + player.ToString() + " Left") ? "L" : "."); - input.Append(IsPressed("P" + player.ToString() + " Right") ? "R" : "."); - input.Append(IsPressed("P" + player.ToString() + " B1") ? "1" : "."); - input.Append(IsPressed("P" + player.ToString() + " B2") ? "2" : "."); - input.Append(IsPressed("P" + player.ToString() + " Run") ? "R" : "."); - input.Append(IsPressed("P" + player.ToString() + " Select") ? "S" : "."); - input.Append("|"); - - } - return input.ToString(); - } + if (type.Name == "SMS Controller") + { + input.Append(IsPressed("P1 Up") ? "U" : "."); + input.Append(IsPressed("P1 Down") ? "D" : "."); + input.Append(IsPressed("P1 Left") ? "L" : "."); + input.Append(IsPressed("P1 Right") ? "R" : "."); + input.Append(IsPressed("P1 B1") ? "1" : "."); + input.Append(IsPressed("P1 B2") ? "2" : "."); + input.Append("|"); + input.Append(IsPressed("P2 Up") ? "U" : "."); + input.Append(IsPressed("P2 Down") ? "D" : "."); + input.Append(IsPressed("P2 Left") ? "L" : "."); + input.Append(IsPressed("P2 Right") ? "R" : "."); + input.Append(IsPressed("P2 B1") ? "1" : "."); + input.Append(IsPressed("P2 B2") ? "2" : "."); + input.Append("|"); + input.Append(IsPressed("Pause") ? "P" : "."); + input.Append(IsPressed("Reset") ? "R" : "."); + input.Append("|"); + return input.ToString(); + } - if (type.Name == "NES Controls") - { + if (type.Name == "PC Engine Controller") + { + input.Append("."); //TODO: reset goes here - the turbografx DOES NOT HAVE A RESET BUTTON. but I assume this is for pcejin movie file compatibility, which is a fools errand anyway......... I'll leave it for now, but marked for deletion + input.Append("|"); + for (int player = 1; player < 6; player++) + { + input.Append(IsPressed("P" + player.ToString() + " Up") ? "U" : "."); + input.Append(IsPressed("P" + player.ToString() + " Down") ? "D" : "."); + input.Append(IsPressed("P" + player.ToString() + " Left") ? "L" : "."); + input.Append(IsPressed("P" + player.ToString() + " Right") ? "R" : "."); + input.Append(IsPressed("P" + player.ToString() + " B1") ? "1" : "."); + input.Append(IsPressed("P" + player.ToString() + " B2") ? "2" : "."); + input.Append(IsPressed("P" + player.ToString() + " Run") ? "R" : "."); + input.Append(IsPressed("P" + player.ToString() + " Select") ? "S" : "."); + input.Append("|"); + + } + return input.ToString(); + } + + if (type.Name == "NES Controls") + { input.Append(IsPressed("Reset") ? "r" : "."); input.Append("|"); for (int player = 1; player <= 2; player++) @@ -216,154 +216,154 @@ namespace BizHawk.MultiClient input.Append(IsPressed("P" + player.ToString() + " A") ? "A" : "."); input.Append("|"); } - return input.ToString(); - } + return input.ToString(); + } - if (type.Name == "TI83 Controls") - { - input.Append(IsPressed("0") ? "0" : "."); - input.Append(IsPressed("1") ? "1" : "."); - input.Append(IsPressed("2") ? "2" : "."); - input.Append(IsPressed("3") ? "3" : "."); - input.Append(IsPressed("4") ? "4" : "."); - input.Append(IsPressed("5") ? "5" : "."); - input.Append(IsPressed("6") ? "6" : "."); - input.Append(IsPressed("7") ? "7" : "."); - input.Append(IsPressed("8") ? "8" : "."); - input.Append(IsPressed("9") ? "9" : "."); - input.Append(IsPressed("DOT") ? "`" : "."); - input.Append(IsPressed("ON") ? "O" : "."); - input.Append(IsPressed("ENTER") ? "=" : "."); - input.Append(IsPressed("UP") ? "U" : "."); - input.Append(IsPressed("DOWN") ? "D" : "."); - input.Append(IsPressed("LEFT") ? "L" : "."); - input.Append(IsPressed("RIGHT") ? "R": "."); - input.Append(IsPressed("PLUS") ? "+": "."); - input.Append(IsPressed("MINUS") ? "_": "."); - input.Append(IsPressed("MULTIPLY") ? "*": "."); - input.Append(IsPressed("DIVIDE") ? "/": "."); - input.Append(IsPressed("CLEAR") ? "c": "."); - input.Append(IsPressed("EXP") ? "^": "."); - input.Append(IsPressed("DASH") ? "-": "."); - input.Append(IsPressed("PARAOPEN") ? "(" : "."); - input.Append(IsPressed("PARACLOSE") ? ")" : "."); - input.Append(IsPressed("TAN") ? "T" : "."); - input.Append(IsPressed("VARS") ? "V" : "."); - input.Append(IsPressed("COS") ? "C" : "."); - input.Append(IsPressed("PRGM") ? "P" : "."); - input.Append(IsPressed("STAT") ? "s" : "."); - input.Append(IsPressed("MATRIX") ? "m" : "."); - input.Append(IsPressed("X") ? "X" : "."); - input.Append(IsPressed("STO") ? ">" : "."); - input.Append(IsPressed("LN") ? "n" : "."); - input.Append(IsPressed("LOG") ? "L" : "."); - input.Append(IsPressed("SQUARED") ? "2" : "."); - input.Append(IsPressed("NEG1") ? "1" : "."); - input.Append(IsPressed("MATH") ? "H" : "."); - input.Append(IsPressed("ALPHA") ? "A" : "."); - input.Append(IsPressed("GRAPH") ? "G" : "."); - input.Append(IsPressed("TRACE") ? "t" : "."); - input.Append(IsPressed("ZOOM") ? "Z" : "."); - input.Append(IsPressed("WINDOW") ? "W" : "."); - input.Append(IsPressed("Y") ? "Y" : "."); - input.Append(IsPressed("2ND") ? "&" : "."); - input.Append(IsPressed("MODE") ? "O" : "."); - input.Append(IsPressed("DEL") ? "D" : "."); - input.Append(IsPressed("COMMA") ? "," : "."); - input.Append(IsPressed("SIN") ? "S" : "."); - input.Append("|.|"); //TODO: perhaps ON should go here? - return input.ToString(); - } - return "?"; - } + if (type.Name == "TI83 Controls") + { + input.Append(IsPressed("0") ? "0" : "."); + input.Append(IsPressed("1") ? "1" : "."); + input.Append(IsPressed("2") ? "2" : "."); + input.Append(IsPressed("3") ? "3" : "."); + input.Append(IsPressed("4") ? "4" : "."); + input.Append(IsPressed("5") ? "5" : "."); + input.Append(IsPressed("6") ? "6" : "."); + input.Append(IsPressed("7") ? "7" : "."); + input.Append(IsPressed("8") ? "8" : "."); + input.Append(IsPressed("9") ? "9" : "."); + input.Append(IsPressed("DOT") ? "`" : "."); + input.Append(IsPressed("ON") ? "O" : "."); + input.Append(IsPressed("ENTER") ? "=" : "."); + input.Append(IsPressed("UP") ? "U" : "."); + input.Append(IsPressed("DOWN") ? "D" : "."); + input.Append(IsPressed("LEFT") ? "L" : "."); + input.Append(IsPressed("RIGHT") ? "R" : "."); + input.Append(IsPressed("PLUS") ? "+" : "."); + input.Append(IsPressed("MINUS") ? "_" : "."); + input.Append(IsPressed("MULTIPLY") ? "*" : "."); + input.Append(IsPressed("DIVIDE") ? "/" : "."); + input.Append(IsPressed("CLEAR") ? "c" : "."); + input.Append(IsPressed("EXP") ? "^" : "."); + input.Append(IsPressed("DASH") ? "-" : "."); + input.Append(IsPressed("PARAOPEN") ? "(" : "."); + input.Append(IsPressed("PARACLOSE") ? ")" : "."); + input.Append(IsPressed("TAN") ? "T" : "."); + input.Append(IsPressed("VARS") ? "V" : "."); + input.Append(IsPressed("COS") ? "C" : "."); + input.Append(IsPressed("PRGM") ? "P" : "."); + input.Append(IsPressed("STAT") ? "s" : "."); + input.Append(IsPressed("MATRIX") ? "m" : "."); + input.Append(IsPressed("X") ? "X" : "."); + input.Append(IsPressed("STO") ? ">" : "."); + input.Append(IsPressed("LN") ? "n" : "."); + input.Append(IsPressed("LOG") ? "L" : "."); + input.Append(IsPressed("SQUARED") ? "2" : "."); + input.Append(IsPressed("NEG1") ? "1" : "."); + input.Append(IsPressed("MATH") ? "H" : "."); + input.Append(IsPressed("ALPHA") ? "A" : "."); + input.Append(IsPressed("GRAPH") ? "G" : "."); + input.Append(IsPressed("TRACE") ? "t" : "."); + input.Append(IsPressed("ZOOM") ? "Z" : "."); + input.Append(IsPressed("WINDOW") ? "W" : "."); + input.Append(IsPressed("Y") ? "Y" : "."); + input.Append(IsPressed("2ND") ? "&" : "."); + input.Append(IsPressed("MODE") ? "O" : "."); + input.Append(IsPressed("DEL") ? "D" : "."); + input.Append(IsPressed("COMMA") ? "," : "."); + input.Append(IsPressed("SIN") ? "S" : "."); + input.Append("|.|"); //TODO: perhaps ON should go here? + return input.ToString(); + } + return "?"; + } - public void SetControllersAsMnemonic(string mnemonic) - { - MovieMode = true; - programmaticallyPressedButtons.Clear(); + public void SetControllersAsMnemonic(string mnemonic) + { + MovieMode = true; + programmaticallyPressedButtons.Clear(); - if (type.Name == "SMS Controller") - { - if (mnemonic[1] != '.') programmaticallyPressedButtons.Add("P1 Up"); - if (mnemonic[2] != '.') programmaticallyPressedButtons.Add("P1 Down"); - if (mnemonic[3] != '.') programmaticallyPressedButtons.Add("P1 Left"); - if (mnemonic[4] != '.') programmaticallyPressedButtons.Add("P1 Right"); - if (mnemonic[5] != '.') programmaticallyPressedButtons.Add("P1 B1"); - if (mnemonic[6] != '.') programmaticallyPressedButtons.Add("P1 B2"); + if (type.Name == "SMS Controller") + { + if (mnemonic[1] != '.') programmaticallyPressedButtons.Add("P1 Up"); + if (mnemonic[2] != '.') programmaticallyPressedButtons.Add("P1 Down"); + if (mnemonic[3] != '.') programmaticallyPressedButtons.Add("P1 Left"); + if (mnemonic[4] != '.') programmaticallyPressedButtons.Add("P1 Right"); + if (mnemonic[5] != '.') programmaticallyPressedButtons.Add("P1 B1"); + if (mnemonic[6] != '.') programmaticallyPressedButtons.Add("P1 B2"); - if (mnemonic[8] != '.') programmaticallyPressedButtons.Add("P2 Up"); - if (mnemonic[9] != '.') programmaticallyPressedButtons.Add("P2 Down"); - if (mnemonic[10] != '.') programmaticallyPressedButtons.Add("P2 Left"); - if (mnemonic[11] != '.') programmaticallyPressedButtons.Add("P2 Right"); - if (mnemonic[12] != '.') programmaticallyPressedButtons.Add("P2 B1"); - if (mnemonic[13] != '.') programmaticallyPressedButtons.Add("P2 B2"); + if (mnemonic[8] != '.') programmaticallyPressedButtons.Add("P2 Up"); + if (mnemonic[9] != '.') programmaticallyPressedButtons.Add("P2 Down"); + if (mnemonic[10] != '.') programmaticallyPressedButtons.Add("P2 Left"); + if (mnemonic[11] != '.') programmaticallyPressedButtons.Add("P2 Right"); + if (mnemonic[12] != '.') programmaticallyPressedButtons.Add("P2 B1"); + if (mnemonic[13] != '.') programmaticallyPressedButtons.Add("P2 B2"); - if (mnemonic[15] != '.') programmaticallyPressedButtons.Add("Pause"); - if (mnemonic[16] != '.') programmaticallyPressedButtons.Add("Reset"); - } + if (mnemonic[15] != '.') programmaticallyPressedButtons.Add("Pause"); + if (mnemonic[16] != '.') programmaticallyPressedButtons.Add("Reset"); + } - if (type.Name == "PC Engine Controller") - { - if (!Global.MainForm.UserMovie.MultiTrack.isActive || (Global.MainForm.UserMovie.GetMovieMode() == MOVIEMODE.PLAY)) - { - for (int i = 1; i < 6; i++) - { - if (mnemonic.Length < (1 + i * 9)) return; - if (mnemonic[(i - 1) * 9 + 3] != '.') programmaticallyPressedButtons.Add("P" + i + " Up"); - if (mnemonic[(i - 1) * 9 + 4] != '.') programmaticallyPressedButtons.Add("P" + i + " Down"); - if (mnemonic[(i - 1) * 9 + 5] != '.') programmaticallyPressedButtons.Add("P" + i + " Left"); - if (mnemonic[(i - 1) * 9 + 6] != '.') programmaticallyPressedButtons.Add("P" + i + " Right"); - if (mnemonic[(i - 1) * 9 + 7] != '.') programmaticallyPressedButtons.Add("P" + i + " B1"); - if (mnemonic[(i - 1) * 9 + 8] != '.') programmaticallyPressedButtons.Add("P" + i + " B2"); - if (mnemonic[(i - 1) * 9 + 9] != '.') programmaticallyPressedButtons.Add("P" + i + " Run"); - if (mnemonic[(i - 1) * 9 + 10] != '.') programmaticallyPressedButtons.Add("P" + i + " Select"); - } - } - else - { - for (int i = 1; i < 6; i++) - { - if ((Global.MainForm.UserMovie.MultiTrack.CurrentPlayer == i) || Global.MainForm.UserMovie.MultiTrack.RecordAll) - { - if (IsPressedActually("P1 Up")) programmaticallyPressedButtons.Add("P" + i + " Up"); - if (IsPressedActually("P1 Down")) programmaticallyPressedButtons.Add("P" + i + " Down"); - if (IsPressedActually("P1 Left")) programmaticallyPressedButtons.Add("P" + i + " Left"); - if (IsPressedActually("P1 Right")) programmaticallyPressedButtons.Add("P" + i + " Right"); - if (IsPressedActually("P1 B1")) programmaticallyPressedButtons.Add("P" + i + " B1"); - if (IsPressedActually("P1 B2")) programmaticallyPressedButtons.Add("P" + i + " B2"); - if (IsPressedActually("P1 Run")) programmaticallyPressedButtons.Add("P" + i + " Run"); - if (IsPressedActually("P1 Select")) programmaticallyPressedButtons.Add("P" + i + " Select"); - } - else - { - if (mnemonic.Length >= (1 + i * 9)) - { - if (mnemonic[(i - 1) * 9 + 3] != '.') programmaticallyPressedButtons.Add("P" + i + " Up"); - if (mnemonic[(i - 1) * 9 + 4] != '.') programmaticallyPressedButtons.Add("P" + i + " Down"); - if (mnemonic[(i - 1) * 9 + 5] != '.') programmaticallyPressedButtons.Add("P" + i + " Left"); - if (mnemonic[(i - 1) * 9 + 6] != '.') programmaticallyPressedButtons.Add("P" + i + " Right"); - if (mnemonic[(i - 1) * 9 + 7] != '.') programmaticallyPressedButtons.Add("P" + i + " B1"); - if (mnemonic[(i - 1) * 9 + 8] != '.') programmaticallyPressedButtons.Add("P" + i + " B2"); - if (mnemonic[(i - 1) * 9 + 9] != '.') programmaticallyPressedButtons.Add("P" + i + " Run"); - if (mnemonic[(i - 1) * 9 + 10] != '.') programmaticallyPressedButtons.Add("P" + i + " Select"); - } - } - } - } - } + if (type.Name == "PC Engine Controller") + { + if (!Global.MainForm.UserMovie.MultiTrack.isActive || (Global.MainForm.UserMovie.GetMovieMode() == MOVIEMODE.PLAY)) + { + for (int i = 1; i < 6; i++) + { + if (mnemonic.Length < (1 + i * 9)) return; + if (mnemonic[(i - 1) * 9 + 3] != '.') programmaticallyPressedButtons.Add("P" + i + " Up"); + if (mnemonic[(i - 1) * 9 + 4] != '.') programmaticallyPressedButtons.Add("P" + i + " Down"); + if (mnemonic[(i - 1) * 9 + 5] != '.') programmaticallyPressedButtons.Add("P" + i + " Left"); + if (mnemonic[(i - 1) * 9 + 6] != '.') programmaticallyPressedButtons.Add("P" + i + " Right"); + if (mnemonic[(i - 1) * 9 + 7] != '.') programmaticallyPressedButtons.Add("P" + i + " B1"); + if (mnemonic[(i - 1) * 9 + 8] != '.') programmaticallyPressedButtons.Add("P" + i + " B2"); + if (mnemonic[(i - 1) * 9 + 9] != '.') programmaticallyPressedButtons.Add("P" + i + " Run"); + if (mnemonic[(i - 1) * 9 + 10] != '.') programmaticallyPressedButtons.Add("P" + i + " Select"); + } + } + else + { + for (int i = 1; i < 6; i++) + { + if ((Global.MainForm.UserMovie.MultiTrack.CurrentPlayer == i) || Global.MainForm.UserMovie.MultiTrack.RecordAll) + { + if (IsPressedActually("P1 Up")) programmaticallyPressedButtons.Add("P" + i + " Up"); + if (IsPressedActually("P1 Down")) programmaticallyPressedButtons.Add("P" + i + " Down"); + if (IsPressedActually("P1 Left")) programmaticallyPressedButtons.Add("P" + i + " Left"); + if (IsPressedActually("P1 Right")) programmaticallyPressedButtons.Add("P" + i + " Right"); + if (IsPressedActually("P1 B1")) programmaticallyPressedButtons.Add("P" + i + " B1"); + if (IsPressedActually("P1 B2")) programmaticallyPressedButtons.Add("P" + i + " B2"); + if (IsPressedActually("P1 Run")) programmaticallyPressedButtons.Add("P" + i + " Run"); + if (IsPressedActually("P1 Select")) programmaticallyPressedButtons.Add("P" + i + " Select"); + } + else + { + if (mnemonic.Length >= (1 + i * 9)) + { + if (mnemonic[(i - 1) * 9 + 3] != '.') programmaticallyPressedButtons.Add("P" + i + " Up"); + if (mnemonic[(i - 1) * 9 + 4] != '.') programmaticallyPressedButtons.Add("P" + i + " Down"); + if (mnemonic[(i - 1) * 9 + 5] != '.') programmaticallyPressedButtons.Add("P" + i + " Left"); + if (mnemonic[(i - 1) * 9 + 6] != '.') programmaticallyPressedButtons.Add("P" + i + " Right"); + if (mnemonic[(i - 1) * 9 + 7] != '.') programmaticallyPressedButtons.Add("P" + i + " B1"); + if (mnemonic[(i - 1) * 9 + 8] != '.') programmaticallyPressedButtons.Add("P" + i + " B2"); + if (mnemonic[(i - 1) * 9 + 9] != '.') programmaticallyPressedButtons.Add("P" + i + " Run"); + if (mnemonic[(i - 1) * 9 + 10] != '.') programmaticallyPressedButtons.Add("P" + i + " Select"); + } + } + } + } + } - if (type.Name == "NES Controls") - { - if (mnemonic.Length < 10) return; - //if (mnemonic[1] != '.' && mnemonic[1] != '0') programmaticallyPressedButtons.Add("Reset"); - if (mnemonic[3] != '.') programmaticallyPressedButtons.Add("P1 Right"); + if (type.Name == "NES Controls") + { + if (mnemonic.Length < 10) return; + //if (mnemonic[1] != '.' && mnemonic[1] != '0') programmaticallyPressedButtons.Add("Reset"); + if (mnemonic[3] != '.') programmaticallyPressedButtons.Add("P1 Right"); if (mnemonic[4] != '.') programmaticallyPressedButtons.Add("P1 Left"); if (mnemonic[5] != '.') programmaticallyPressedButtons.Add("P1 Down"); if (mnemonic[6] != '.') programmaticallyPressedButtons.Add("P1 Up"); if (mnemonic[7] != '.') programmaticallyPressedButtons.Add("P1 Start"); if (mnemonic[8] != '.') programmaticallyPressedButtons.Add("P1 Select"); if (mnemonic[9] != '.') programmaticallyPressedButtons.Add("P1 B"); - if (mnemonic[10] != '.') programmaticallyPressedButtons.Add("P1 A"); + if (mnemonic[10] != '.') programmaticallyPressedButtons.Add("P1 A"); if (mnemonic.Length < 20) return; if (mnemonic[12] != '.') programmaticallyPressedButtons.Add("P2 Right"); @@ -374,113 +374,113 @@ namespace BizHawk.MultiClient if (mnemonic[17] != '.') programmaticallyPressedButtons.Add("P2 Select"); if (mnemonic[18] != '.') programmaticallyPressedButtons.Add("P2 B"); if (mnemonic[19] != '.') programmaticallyPressedButtons.Add("P2 A"); - } + } - if (type.Name == "TI83 Controls") - { - if (mnemonic.Length < 50) return; + if (type.Name == "TI83 Controls") + { + if (mnemonic.Length < 50) return; - if (mnemonic[1] != '.') - programmaticallyPressedButtons.Add("0"); - if (mnemonic[2] != '.') - programmaticallyPressedButtons.Add("1"); - if (mnemonic[3] != '.') - programmaticallyPressedButtons.Add("2"); - if (mnemonic[4] != '.') - programmaticallyPressedButtons.Add("3"); - if (mnemonic[5] != '.') - programmaticallyPressedButtons.Add("4"); - if (mnemonic[6] != '.') - programmaticallyPressedButtons.Add("5"); - if (mnemonic[7] != '.') - programmaticallyPressedButtons.Add("6"); - if (mnemonic[8] != '.') - programmaticallyPressedButtons.Add("7"); - if (mnemonic[9] != '.') - programmaticallyPressedButtons.Add("8"); - if (mnemonic[10] != '.') - programmaticallyPressedButtons.Add("9"); - if (mnemonic[11] != '.') - programmaticallyPressedButtons.Add("DOT"); - if (mnemonic[12] != '.') - programmaticallyPressedButtons.Add("ON"); - if (mnemonic[13] != '.') - programmaticallyPressedButtons.Add("ENTER"); - if (mnemonic[14] != '.') - programmaticallyPressedButtons.Add("UP"); - if (mnemonic[15] != '.') - programmaticallyPressedButtons.Add("DOWN"); - if (mnemonic[16] != '.') - programmaticallyPressedButtons.Add("LEFT"); - if (mnemonic[17] != '.') - programmaticallyPressedButtons.Add("RIGHT"); - if (mnemonic[18] != '.') - programmaticallyPressedButtons.Add("PLUS"); - if (mnemonic[19] != '.') - programmaticallyPressedButtons.Add("MINUS"); - if (mnemonic[20] != '.') - programmaticallyPressedButtons.Add("MULTIPLY"); - if (mnemonic[21] != '.') - programmaticallyPressedButtons.Add("DIVIDE"); - if (mnemonic[22] != '.') - programmaticallyPressedButtons.Add("CLEAR"); - if (mnemonic[23] != '.') - programmaticallyPressedButtons.Add("EXP"); - if (mnemonic[24] != '.') - programmaticallyPressedButtons.Add("DASH"); - if (mnemonic[25] != '.') - programmaticallyPressedButtons.Add("PARAOPEN"); - if (mnemonic[26] != '.') - programmaticallyPressedButtons.Add("PARACLOSE"); - if (mnemonic[27] != '.') - programmaticallyPressedButtons.Add("TAN"); - if (mnemonic[28] != '.') - programmaticallyPressedButtons.Add("VARS"); - if (mnemonic[29] != '.') - programmaticallyPressedButtons.Add("COS"); - if (mnemonic[30] != '.') - programmaticallyPressedButtons.Add("PGRM"); - if (mnemonic[31] != '.') - programmaticallyPressedButtons.Add("STAT"); - if (mnemonic[32] != '.') - programmaticallyPressedButtons.Add("MATRIX"); - if (mnemonic[33] != '.') - programmaticallyPressedButtons.Add("X"); - if (mnemonic[34] != '.') - programmaticallyPressedButtons.Add("STO"); - if (mnemonic[35] != '.') - programmaticallyPressedButtons.Add("LN"); - if (mnemonic[36] != '.') - programmaticallyPressedButtons.Add("LOG"); - if (mnemonic[37] != '.') - programmaticallyPressedButtons.Add("SQUARED"); - if (mnemonic[38] != '.') - programmaticallyPressedButtons.Add("NEG"); - if (mnemonic[39] != '.') - programmaticallyPressedButtons.Add("MATH"); - if (mnemonic[40] != '.') - programmaticallyPressedButtons.Add("ALPHA"); - if (mnemonic[41] != '.') - programmaticallyPressedButtons.Add("GRAPH"); - if (mnemonic[42] != '.') - programmaticallyPressedButtons.Add("TRACE"); - if (mnemonic[43] != '.') - programmaticallyPressedButtons.Add("ZOOM"); - if (mnemonic[44] != '.') - programmaticallyPressedButtons.Add("WINDOW"); - if (mnemonic[45] != '.') - programmaticallyPressedButtons.Add("Y"); - if (mnemonic[46] != '.') - programmaticallyPressedButtons.Add("2ND"); - if (mnemonic[47] != '.') - programmaticallyPressedButtons.Add("MODE"); - if (mnemonic[48] != '.') - programmaticallyPressedButtons.Add("DEL"); - if (mnemonic[49] != '.') - programmaticallyPressedButtons.Add("COMMA"); - if (mnemonic[50] != '.') - programmaticallyPressedButtons.Add("SIN"); - } - } - } + if (mnemonic[1] != '.') + programmaticallyPressedButtons.Add("0"); + if (mnemonic[2] != '.') + programmaticallyPressedButtons.Add("1"); + if (mnemonic[3] != '.') + programmaticallyPressedButtons.Add("2"); + if (mnemonic[4] != '.') + programmaticallyPressedButtons.Add("3"); + if (mnemonic[5] != '.') + programmaticallyPressedButtons.Add("4"); + if (mnemonic[6] != '.') + programmaticallyPressedButtons.Add("5"); + if (mnemonic[7] != '.') + programmaticallyPressedButtons.Add("6"); + if (mnemonic[8] != '.') + programmaticallyPressedButtons.Add("7"); + if (mnemonic[9] != '.') + programmaticallyPressedButtons.Add("8"); + if (mnemonic[10] != '.') + programmaticallyPressedButtons.Add("9"); + if (mnemonic[11] != '.') + programmaticallyPressedButtons.Add("DOT"); + if (mnemonic[12] != '.') + programmaticallyPressedButtons.Add("ON"); + if (mnemonic[13] != '.') + programmaticallyPressedButtons.Add("ENTER"); + if (mnemonic[14] != '.') + programmaticallyPressedButtons.Add("UP"); + if (mnemonic[15] != '.') + programmaticallyPressedButtons.Add("DOWN"); + if (mnemonic[16] != '.') + programmaticallyPressedButtons.Add("LEFT"); + if (mnemonic[17] != '.') + programmaticallyPressedButtons.Add("RIGHT"); + if (mnemonic[18] != '.') + programmaticallyPressedButtons.Add("PLUS"); + if (mnemonic[19] != '.') + programmaticallyPressedButtons.Add("MINUS"); + if (mnemonic[20] != '.') + programmaticallyPressedButtons.Add("MULTIPLY"); + if (mnemonic[21] != '.') + programmaticallyPressedButtons.Add("DIVIDE"); + if (mnemonic[22] != '.') + programmaticallyPressedButtons.Add("CLEAR"); + if (mnemonic[23] != '.') + programmaticallyPressedButtons.Add("EXP"); + if (mnemonic[24] != '.') + programmaticallyPressedButtons.Add("DASH"); + if (mnemonic[25] != '.') + programmaticallyPressedButtons.Add("PARAOPEN"); + if (mnemonic[26] != '.') + programmaticallyPressedButtons.Add("PARACLOSE"); + if (mnemonic[27] != '.') + programmaticallyPressedButtons.Add("TAN"); + if (mnemonic[28] != '.') + programmaticallyPressedButtons.Add("VARS"); + if (mnemonic[29] != '.') + programmaticallyPressedButtons.Add("COS"); + if (mnemonic[30] != '.') + programmaticallyPressedButtons.Add("PGRM"); + if (mnemonic[31] != '.') + programmaticallyPressedButtons.Add("STAT"); + if (mnemonic[32] != '.') + programmaticallyPressedButtons.Add("MATRIX"); + if (mnemonic[33] != '.') + programmaticallyPressedButtons.Add("X"); + if (mnemonic[34] != '.') + programmaticallyPressedButtons.Add("STO"); + if (mnemonic[35] != '.') + programmaticallyPressedButtons.Add("LN"); + if (mnemonic[36] != '.') + programmaticallyPressedButtons.Add("LOG"); + if (mnemonic[37] != '.') + programmaticallyPressedButtons.Add("SQUARED"); + if (mnemonic[38] != '.') + programmaticallyPressedButtons.Add("NEG"); + if (mnemonic[39] != '.') + programmaticallyPressedButtons.Add("MATH"); + if (mnemonic[40] != '.') + programmaticallyPressedButtons.Add("ALPHA"); + if (mnemonic[41] != '.') + programmaticallyPressedButtons.Add("GRAPH"); + if (mnemonic[42] != '.') + programmaticallyPressedButtons.Add("TRACE"); + if (mnemonic[43] != '.') + programmaticallyPressedButtons.Add("ZOOM"); + if (mnemonic[44] != '.') + programmaticallyPressedButtons.Add("WINDOW"); + if (mnemonic[45] != '.') + programmaticallyPressedButtons.Add("Y"); + if (mnemonic[46] != '.') + programmaticallyPressedButtons.Add("2ND"); + if (mnemonic[47] != '.') + programmaticallyPressedButtons.Add("MODE"); + if (mnemonic[48] != '.') + programmaticallyPressedButtons.Add("DEL"); + if (mnemonic[49] != '.') + programmaticallyPressedButtons.Add("COMMA"); + if (mnemonic[50] != '.') + programmaticallyPressedButtons.Add("SIN"); + } + } + } } \ No newline at end of file diff --git a/BizHawk.MultiClient/Input/GamePad.cs b/BizHawk.MultiClient/Input/GamePad.cs index ca60076fdf..caa51d4eb6 100644 --- a/BizHawk.MultiClient/Input/GamePad.cs +++ b/BizHawk.MultiClient/Input/GamePad.cs @@ -5,156 +5,156 @@ using SlimDX.DirectInput; namespace BizHawk.MultiClient { - public class GamePad - { - // ********************************** Static interface ********************************** + public class GamePad + { + // ********************************** Static interface ********************************** - private static DirectInput dinput; - public static List Devices; + private static DirectInput dinput; + public static List Devices; - public static void Initialize() - { - if (dinput == null) - dinput = new DirectInput(); + public static void Initialize() + { + if (dinput == null) + dinput = new DirectInput(); - Devices = new List(); + Devices = new List(); - foreach (DeviceInstance device in dinput.GetDevices(DeviceClass.GameController, DeviceEnumerationFlags.AttachedOnly)) - { - var joystick = new Joystick(dinput, device.InstanceGuid); - joystick.SetCooperativeLevel(Global.MainForm.Handle, CooperativeLevel.Background | CooperativeLevel.Nonexclusive); - foreach (DeviceObjectInstance deviceObject in joystick.GetObjects()) - { - if ((deviceObject.ObjectType & ObjectDeviceType.Axis) != 0) - joystick.GetObjectPropertiesById((int)deviceObject.ObjectType).SetRange(-1000, 1000); - } - joystick.Acquire(); + foreach (DeviceInstance device in dinput.GetDevices(DeviceClass.GameController, DeviceEnumerationFlags.AttachedOnly)) + { + var joystick = new Joystick(dinput, device.InstanceGuid); + joystick.SetCooperativeLevel(Global.MainForm.Handle, CooperativeLevel.Background | CooperativeLevel.Nonexclusive); + foreach (DeviceObjectInstance deviceObject in joystick.GetObjects()) + { + if ((deviceObject.ObjectType & ObjectDeviceType.Axis) != 0) + joystick.GetObjectPropertiesById((int)deviceObject.ObjectType).SetRange(-1000, 1000); + } + joystick.Acquire(); - GamePad p = new GamePad(device.InstanceName, device.InstanceGuid, joystick); - Devices.Add(p); - } - } + GamePad p = new GamePad(device.InstanceName, device.InstanceGuid, joystick); + Devices.Add(p); + } + } - public static void UpdateAll() - { - foreach (var device in Devices) - device.Update(); - } + public static void UpdateAll() + { + foreach (var device in Devices) + device.Update(); + } - // ********************************** Instance Members ********************************** + // ********************************** Instance Members ********************************** - private readonly string name; - private readonly Guid guid; - private readonly Joystick joystick; - private JoystickState state = new JoystickState(); - private bool[] buttons; - private int[] pov; + private readonly string name; + private readonly Guid guid; + private readonly Joystick joystick; + private JoystickState state = new JoystickState(); + private bool[] buttons; + private int[] pov; - private GamePad(string name, Guid guid, Joystick joystick) - { - this.name = name; - this.guid = guid; - this.joystick = joystick; - Update(); - } + private GamePad(string name, Guid guid, Joystick joystick) + { + this.name = name; + this.guid = guid; + this.joystick = joystick; + Update(); + } - public void Update() - { - if (joystick.Acquire().IsFailure) - return; - if (joystick.Poll().IsFailure) - return; - - state = joystick.GetCurrentState(); - if (Result.Last.IsFailure) - return; + public void Update() + { + if (joystick.Acquire().IsFailure) + return; + if (joystick.Poll().IsFailure) + return; - buttons = state.GetButtons(); - pov = state.GetPointOfViewControllers(); - } + state = joystick.GetCurrentState(); + if (Result.Last.IsFailure) + return; - public string Name { get { return name; } } - public Guid Guid { get { return guid; } } + buttons = state.GetButtons(); + pov = state.GetPointOfViewControllers(); + } - public float X { get { return state.X / 1000f; } } - public float Y { get { return state.Y / 1000f; } } - public float Z { get { return state.Z / 1000f; } } + public string Name { get { return name; } } + public Guid Guid { get { return guid; } } - public bool[] Buttons { get { return buttons; } } - - public bool Up - { - get - { - if (state.Y < -250 || state.RotationY < -250) - return true; - foreach (int p in pov) - if (p.In(0, 4500, 31500)) - return true; - return false; - } - } + public float X { get { return state.X / 1000f; } } + public float Y { get { return state.Y / 1000f; } } + public float Z { get { return state.Z / 1000f; } } - public bool Down - { - get - { - if (state.Y > 250 || state.RotationY > 250) - return true; - foreach (int p in pov) - if (p.In(13500, 18000, 22500)) - return true; - return false; - } - } + public bool[] Buttons { get { return buttons; } } - public bool Left - { - get - { - if (state.X < -250 || state.RotationX < -250) - return true; - foreach (int p in pov) - if (p.In(22500, 27000, 31500)) - return true; - return false; - } - } + public bool Up + { + get + { + if (state.Y < -250 || state.RotationY < -250) + return true; + foreach (int p in pov) + if (p.In(0, 4500, 31500)) + return true; + return false; + } + } - public bool Right - { - get - { - if (state.X > 250 || state.RotationX > 250) - return true; - foreach (int p in pov) - if (p.In(4500, 9000, 13500)) - return true; - return false; - } - } + public bool Down + { + get + { + if (state.Y > 250 || state.RotationY > 250) + return true; + foreach (int p in pov) + if (p.In(13500, 18000, 22500)) + return true; + return false; + } + } - /// - /// Note that this does not appear to work at this time. I probably need to have more infos. - /// - public void SetVibration(int left, int right) - { - int[] temp1, temp2; - // my first clue that it doesnt work is that LEFT and RIGHT _ARENT USED_ - // I should just look for C++ examples instead of trying to look for SlimDX examples + public bool Left + { + get + { + if (state.X < -250 || state.RotationX < -250) + return true; + foreach (int p in pov) + if (p.In(22500, 27000, 31500)) + return true; + return false; + } + } - var parameters = new EffectParameters(); - parameters.Duration = 0x2710; - parameters.Gain = 0x2710; - parameters.SamplePeriod = 0; - parameters.TriggerButton = 0; - parameters.TriggerRepeatInterval = 0x2710; - parameters.Flags = EffectFlags.None; - parameters.GetAxes(out temp1, out temp2); - parameters.SetAxes(temp1, temp2); - var effect = new Effect(joystick, EffectGuid.ConstantForce); - effect.SetParameters(parameters); - effect.Start(1); - } - } + public bool Right + { + get + { + if (state.X > 250 || state.RotationX > 250) + return true; + foreach (int p in pov) + if (p.In(4500, 9000, 13500)) + return true; + return false; + } + } + + /// + /// Note that this does not appear to work at this time. I probably need to have more infos. + /// + public void SetVibration(int left, int right) + { + int[] temp1, temp2; + // my first clue that it doesnt work is that LEFT and RIGHT _ARENT USED_ + // I should just look for C++ examples instead of trying to look for SlimDX examples + + var parameters = new EffectParameters(); + parameters.Duration = 0x2710; + parameters.Gain = 0x2710; + parameters.SamplePeriod = 0; + parameters.TriggerButton = 0; + parameters.TriggerRepeatInterval = 0x2710; + parameters.Flags = EffectFlags.None; + parameters.GetAxes(out temp1, out temp2); + parameters.SetAxes(temp1, temp2); + var effect = new Effect(joystick, EffectGuid.ConstantForce); + effect.SetParameters(parameters); + effect.Start(1); + } + } } \ No newline at end of file diff --git a/BizHawk.MultiClient/Input/Input.cs b/BizHawk.MultiClient/Input/Input.cs index abe4ca2960..b42703d818 100644 --- a/BizHawk.MultiClient/Input/Input.cs +++ b/BizHawk.MultiClient/Input/Input.cs @@ -3,40 +3,40 @@ using SlimDX.DirectInput; namespace BizHawk.MultiClient { - public static class Input - { - public static void Initialize() - { - KeyInput.Initialize(); - GamePad.Initialize(); - } + public static class Input + { + public static void Initialize() + { + KeyInput.Initialize(); + GamePad.Initialize(); + } - public static void Update() - { - KeyInput.Update(); - GamePad.UpdateAll(); - } + public static void Update() + { + KeyInput.Update(); + GamePad.UpdateAll(); + } - public static bool IsPressed(string control) - { - string[] controls = control.Split('+'); - for (int i=0; i= GamePad.Devices.Count) - return false; + private static bool GetGamePad(int index, string control) + { + if (index >= GamePad.Devices.Count) + return false; - if (control == "Up") return GamePad.Devices[index].Up; - if (control == "Down") return GamePad.Devices[index].Down; - if (control == "Left") return GamePad.Devices[index].Left; - if (control == "Right") return GamePad.Devices[index].Right; + if (control == "Up") return GamePad.Devices[index].Up; + if (control == "Down") return GamePad.Devices[index].Down; + if (control == "Left") return GamePad.Devices[index].Left; + if (control == "Right") return GamePad.Devices[index].Right; - if (control.StartsWith("B")) - { - int buttonIndex = int.Parse(control.Substring(1)) - 1; - if (buttonIndex >= GamePad.Devices[index].Buttons.Length) - return false; - return GamePad.Devices[index].Buttons[buttonIndex]; - } + if (control.StartsWith("B")) + { + int buttonIndex = int.Parse(control.Substring(1)) - 1; + if (buttonIndex >= GamePad.Devices[index].Buttons.Length) + return false; + return GamePad.Devices[index].Buttons[buttonIndex]; + } - return false; - } + return false; + } - public static string GetPressedKey() - { - //for (int j = 0; j < GamePad.Devices.Count; j++) - return null; - } - } + public static string GetPressedKey() + { + //for (int j = 0; j < GamePad.Devices.Count; j++) + return null; + } + } } diff --git a/BizHawk.MultiClient/MruStack.cs b/BizHawk.MultiClient/MruStack.cs index 9a60db6a74..8d764f3ab6 100644 --- a/BizHawk.MultiClient/MruStack.cs +++ b/BizHawk.MultiClient/MruStack.cs @@ -1,53 +1,53 @@ namespace BizHawk.MultiClient { - public class MruStack - { - private T[] store; - private int count; - private int head; + public class MruStack + { + private T[] store; + private int count; + private int head; - public int Count { get { return count; } } + public int Count { get { return count; } } - public MruStack(int capacity) - { - store = new T[capacity]; - Clear(); - } + public MruStack(int capacity) + { + store = new T[capacity]; + Clear(); + } - public void Clear() - { - head = 0; - count = 0; - for (int i = 0; i < store.Length; i++) - store[i] = default(T); - } + public void Clear() + { + head = 0; + count = 0; + for (int i = 0; i < store.Length; i++) + store[i] = default(T); + } - public void Push(T value) - { - store[head] = value; - head = (head + 1) % store.Length; + public void Push(T value) + { + store[head] = value; + head = (head + 1) % store.Length; - if (count < store.Length) - count++; - } + if (count < store.Length) + count++; + } - public T Pop() - { - if (count == 0) - return default(T); + public T Pop() + { + if (count == 0) + return default(T); - head--; - if (head < 0) - head = store.Length - 1; - count--; - T value = store[head]; - store[head] = default(T); - return value; - } + head--; + if (head < 0) + head = store.Length - 1; + count--; + T value = store[head]; + store[head] = default(T); + return value; + } - public bool HasElements() - { - return count > 0; - } - } + public bool HasElements() + { + return count > 0; + } + } } \ No newline at end of file diff --git a/BizHawk.MultiClient/Program.cs b/BizHawk.MultiClient/Program.cs index fdf3f335a6..8d286a19a1 100644 --- a/BizHawk.MultiClient/Program.cs +++ b/BizHawk.MultiClient/Program.cs @@ -6,21 +6,22 @@ using Microsoft.VisualBasic.ApplicationServices; namespace BizHawk.MultiClient { - static class Program - { - [STAThread] - static void Main(string[] args) - { - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); + static class Program + { + [STAThread] + static void Main(string[] args) + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); Global.Config = ConfigService.Load(PathManager.DefaultIniPath); - try { Global.DSound = new DirectSound(); } - catch { - MessageBox.Show("Couldn't initialize DirectSound!"); - return; - } + try { Global.DSound = new DirectSound(); } + catch + { + MessageBox.Show("Couldn't initialize DirectSound!"); + return; + } try { Global.Direct3D = new Direct3D(); } catch @@ -29,55 +30,60 @@ namespace BizHawk.MultiClient Global.Config.ForceGDI = true; } - try { - if (Global.Config.SingleInstanceMode) - { - SingleInstanceController controller = new SingleInstanceController(args); - controller.Run(args); - } - else - { - var mf = new MainForm(args); - mf.Show(); - mf.ProgramRunLoop(); - } - } catch (Exception e) { + try + { + if (Global.Config.SingleInstanceMode) + { + SingleInstanceController controller = new SingleInstanceController(args); + controller.Run(args); + } + else + { + var mf = new MainForm(args); + mf.Show(); + mf.ProgramRunLoop(); + } + } + catch (Exception e) + { MessageBox.Show(e.ToString(), "Oh, no, a terrible thing happened!\n\n" + e.ToString()); - } finally { - if (Global.DSound != null && Global.DSound.Disposed == false) - Global.DSound.Dispose(); - if (Global.Direct3D != null && Global.Direct3D.Disposed == false) - Global.Direct3D.Dispose(); - } - - } + } + finally + { + if (Global.DSound != null && Global.DSound.Disposed == false) + Global.DSound.Dispose(); + if (Global.Direct3D != null && Global.Direct3D.Disposed == false) + Global.Direct3D.Dispose(); + } - public class SingleInstanceController : WindowsFormsApplicationBase - { - MainForm mf; - string[] cmdArgs; - public SingleInstanceController(string[] args) - { - cmdArgs = args; - IsSingleInstance = true; - StartupNextInstance += this_StartupNextInstance; - - } + } - void this_StartupNextInstance(object sender, StartupNextInstanceEventArgs e) - { - mf.LoadRom(e.CommandLine[0]); - } + public class SingleInstanceController : WindowsFormsApplicationBase + { + MainForm mf; + string[] cmdArgs; + public SingleInstanceController(string[] args) + { + cmdArgs = args; + IsSingleInstance = true; + StartupNextInstance += this_StartupNextInstance; - protected override void OnCreateMainForm() - { - MainForm = new RamWatch(); + } - mf = new MainForm(cmdArgs); - MainForm = mf; - mf.Show(); - mf.ProgramRunLoop(); - } - } - } + void this_StartupNextInstance(object sender, StartupNextInstanceEventArgs e) + { + mf.LoadRom(e.CommandLine[0]); + } + + protected override void OnCreateMainForm() + { + MainForm = new RamWatch(); + + mf = new MainForm(cmdArgs); + MainForm = mf; + mf.Show(); + mf.ProgramRunLoop(); + } + } + } } diff --git a/BizHawk.MultiClient/RecentFiles.cs b/BizHawk.MultiClient/RecentFiles.cs index 76f1eee2d7..4a98afd3c4 100644 --- a/BizHawk.MultiClient/RecentFiles.cs +++ b/BizHawk.MultiClient/RecentFiles.cs @@ -3,84 +3,84 @@ using System.Text; namespace BizHawk.MultiClient { - public class RecentFiles - { - private int MAX_RECENT_FILES; //Maximum number of files - private List recentlist; //List of recent files + public class RecentFiles + { + private int MAX_RECENT_FILES; //Maximum number of files + private List recentlist; //List of recent files - public RecentFiles() : this(8) {} - public RecentFiles(int max) - { - recentlist = new List(); - MAX_RECENT_FILES = max; - } - - public void Clear() - { - recentlist.Clear(); - } + public RecentFiles() : this(8) { } + public RecentFiles(int max) + { + recentlist = new List(); + MAX_RECENT_FILES = max; + } - public bool IsEmpty() - { - if (recentlist.Count == 0) - return true; - else - return false; - } + public void Clear() + { + recentlist.Clear(); + } - public int Length() - { - return recentlist.Count; - } + public bool IsEmpty() + { + if (recentlist.Count == 0) + return true; + else + return false; + } - public void Add(string newFile) - { - for (int x = 0; x < recentlist.Count; x++) - { - if (string.Compare(newFile, recentlist[x]) == 0) - { - recentlist.Remove(newFile); //intentionally keeps iterating after this to remove duplicate instances, though those should never exist in the first place - } - } - recentlist.Insert(0, newFile); - if (recentlist.Count > MAX_RECENT_FILES) - recentlist.Remove(recentlist[recentlist.Count-1]); - } + public int Length() + { + return recentlist.Count; + } - public bool Remove(string newFile) - { - bool removed = false; - for (int x = 0; x < recentlist.Count; x++) - { - if (string.Compare(newFile, recentlist[x]) == 0) - { - recentlist.Remove(newFile); //intentionally keeps iterating after this to remove duplicate instances, though those should never exist in the first place - removed = true; - } + public void Add(string newFile) + { + for (int x = 0; x < recentlist.Count; x++) + { + if (string.Compare(newFile, recentlist[x]) == 0) + { + recentlist.Remove(newFile); //intentionally keeps iterating after this to remove duplicate instances, though those should never exist in the first place + } + } + recentlist.Insert(0, newFile); + if (recentlist.Count > MAX_RECENT_FILES) + recentlist.Remove(recentlist[recentlist.Count - 1]); + } - } - return removed; - } + public bool Remove(string newFile) + { + bool removed = false; + for (int x = 0; x < recentlist.Count; x++) + { + if (string.Compare(newFile, recentlist[x]) == 0) + { + recentlist.Remove(newFile); //intentionally keeps iterating after this to remove duplicate instances, though those should never exist in the first place + removed = true; + } - public List GetRecentList() - { - return recentlist; - } + } + return removed; + } - public List GetRecentListTruncated(int length) - { - //iterate through list, truncating each item to length, and return the result in a List - List temp = new List(); - for (int x = 0; x < recentlist.Count; x++) - { - temp.Add(recentlist[x].Substring(0, length)); - } - return temp; - } + public List GetRecentList() + { + return recentlist; + } - public string GetRecentFileByPosition(int position) - { - return recentlist[position]; - } - } + public List GetRecentListTruncated(int length) + { + //iterate through list, truncating each item to length, and return the result in a List + List temp = new List(); + for (int x = 0; x < recentlist.Count; x++) + { + temp.Add(recentlist[x].Substring(0, length)); + } + return temp; + } + + public string GetRecentFileByPosition(int position) + { + return recentlist[position]; + } + } } diff --git a/BizHawk.MultiClient/ScreenSaver.cs b/BizHawk.MultiClient/ScreenSaver.cs index ca729b3b65..dbdadf1c5b 100644 --- a/BizHawk.MultiClient/ScreenSaver.cs +++ b/BizHawk.MultiClient/ScreenSaver.cs @@ -3,45 +3,45 @@ using System.Runtime.InteropServices; namespace BizHawk.MultiClient { - // Derived from http://www.codeproject.com/KB/cs/ScreenSaverControl.aspx - public static class ScreenSaver - { - [DllImport("user32.dll", CharSet = CharSet.Auto)] - private static extern bool SystemParametersInfo(int uAction, int uParam, ref int lpvParam, int flags); + // Derived from http://www.codeproject.com/KB/cs/ScreenSaverControl.aspx + public static class ScreenSaver + { + [DllImport("user32.dll", CharSet = CharSet.Auto)] + private static extern bool SystemParametersInfo(int uAction, int uParam, ref int lpvParam, int flags); - private const int SPI_GETSCREENSAVERTIMEOUT = 14; - private const int SPI_SETSCREENSAVERTIMEOUT = 15; - private const int SPIF_SENDWININICHANGE = 2; + private const int SPI_GETSCREENSAVERTIMEOUT = 14; + private const int SPI_SETSCREENSAVERTIMEOUT = 15; + private const int SPIF_SENDWININICHANGE = 2; - public static void ResetTimerImmediate() - { - SetScreenSaverTimeout(GetScreenSaverTimeout()); - } + public static void ResetTimerImmediate() + { + SetScreenSaverTimeout(GetScreenSaverTimeout()); + } - private static int ctr; - public static void ResetTimerPeriodically() - { - ctr++; - if (ctr == 120) - { - SetScreenSaverTimeout(GetScreenSaverTimeout()); - ctr = 0; - } - } + private static int ctr; + public static void ResetTimerPeriodically() + { + ctr++; + if (ctr == 120) + { + SetScreenSaverTimeout(GetScreenSaverTimeout()); + ctr = 0; + } + } - // Returns the screen saver timeout setting, in seconds - private static Int32 GetScreenSaverTimeout() - { - Int32 value = 0; - SystemParametersInfo(SPI_GETSCREENSAVERTIMEOUT, 0, ref value, 0); - return value; - } + // Returns the screen saver timeout setting, in seconds + private static Int32 GetScreenSaverTimeout() + { + Int32 value = 0; + SystemParametersInfo(SPI_GETSCREENSAVERTIMEOUT, 0, ref value, 0); + return value; + } - // Pass in the number of seconds to set the screen saver timeout value. - private static void SetScreenSaverTimeout(Int32 Value) - { - int nullVar = 0; - SystemParametersInfo(SPI_SETSCREENSAVERTIMEOUT, Value, ref nullVar, SPIF_SENDWININICHANGE); - } - } + // Pass in the number of seconds to set the screen saver timeout value. + private static void SetScreenSaverTimeout(Int32 Value) + { + int nullVar = 0; + SystemParametersInfo(SPI_SETSCREENSAVERTIMEOUT, Value, ref nullVar, SPIF_SENDWININICHANGE); + } + } } diff --git a/BizHawk.MultiClient/config/HotkeyWindow.cs b/BizHawk.MultiClient/config/HotkeyWindow.cs index 81520aab6d..5cc4945aa8 100644 --- a/BizHawk.MultiClient/config/HotkeyWindow.cs +++ b/BizHawk.MultiClient/config/HotkeyWindow.cs @@ -9,180 +9,180 @@ using System.Windows.Forms; namespace BizHawk.MultiClient.tools { - public partial class HotkeyWindow : Form - { - public HotkeyWindow() - { - InitializeComponent(); - IDW_FRAMEADVANCE.Text = Global.Config.FrameAdvanceBinding; - IDW_PAUSE.Text = Global.Config.EmulatorPauseBinding; - IDW_HARDRESET.Text = Global.Config.HardResetBinding; - IDW_REWIND.Text = Global.Config.RewindBinding; - IDW_UNTHROTTLE.Text = Global.Config.UnthrottleBinding; - IDW_FASTFORWARD.Text = Global.Config.FastForwardBinding; - IDW_SCREENSHOT.Text = Global.Config.ScreenshotBinding; - IDW_FULLSCREEN.Text = Global.Config.ToggleFullscreenBinding; + public partial class HotkeyWindow : Form + { + public HotkeyWindow() + { + InitializeComponent(); + IDW_FRAMEADVANCE.Text = Global.Config.FrameAdvanceBinding; + IDW_PAUSE.Text = Global.Config.EmulatorPauseBinding; + IDW_HARDRESET.Text = Global.Config.HardResetBinding; + IDW_REWIND.Text = Global.Config.RewindBinding; + IDW_UNTHROTTLE.Text = Global.Config.UnthrottleBinding; + IDW_FASTFORWARD.Text = Global.Config.FastForwardBinding; + IDW_SCREENSHOT.Text = Global.Config.ScreenshotBinding; + IDW_FULLSCREEN.Text = Global.Config.ToggleFullscreenBinding; - IDW_QuickSave.Text = Global.Config.QuickSave; - IDW_QuickLoad.Text = Global.Config.QuickLoad; - //Save States - IDW_SS0.Text = Global.Config.SaveSlot0; - IDW_SS1.Text = Global.Config.SaveSlot1; - IDW_SS2.Text = Global.Config.SaveSlot2; - IDW_SS3.Text = Global.Config.SaveSlot3; - IDW_SS4.Text = Global.Config.SaveSlot4; - IDW_SS5.Text = Global.Config.SaveSlot5; - IDW_SS6.Text = Global.Config.SaveSlot6; - IDW_SS7.Text = Global.Config.SaveSlot7; - IDW_SS8.Text = Global.Config.SaveSlot8; - IDW_SS9.Text = Global.Config.SaveSlot9; - //Load States - IDW_LS0.Text = Global.Config.LoadSlot0; - IDW_LS1.Text = Global.Config.LoadSlot1; - IDW_LS2.Text = Global.Config.LoadSlot2; - IDW_LS3.Text = Global.Config.LoadSlot3; - IDW_LS4.Text = Global.Config.LoadSlot4; - IDW_LS5.Text = Global.Config.LoadSlot5; - IDW_LS6.Text = Global.Config.LoadSlot6; - IDW_LS7.Text = Global.Config.LoadSlot7; - IDW_LS8.Text = Global.Config.LoadSlot8; - IDW_LS9.Text = Global.Config.LoadSlot9; - //Select States - IDW_ST0.Text = Global.Config.SelectSlot0; - IDW_ST1.Text = Global.Config.SelectSlot1; - IDW_ST2.Text = Global.Config.SelectSlot2; - IDW_ST3.Text = Global.Config.SelectSlot3; - IDW_ST4.Text = Global.Config.SelectSlot4; - IDW_ST5.Text = Global.Config.SelectSlot5; - IDW_ST6.Text = Global.Config.SelectSlot6; - IDW_ST7.Text = Global.Config.SelectSlot7; - IDW_ST8.Text = Global.Config.SelectSlot8; - IDW_ST9.Text = Global.Config.SelectSlot9; - IDW_TOOLBOX.Text = Global.Config.ToolBox; - IDW_SAVENAMEDSTATE.Text = Global.Config.SaveNamedState; - IDW_LOADNAMEDSTATE.Text = Global.Config.LoadNamedState; - IDW_NEXTSLOT.Text = Global.Config.NextSlot; - IDW_PREVIOUSSLOT.Text = Global.Config.PreviousSlot; - IDW_RamWatch.Text = Global.Config.RamWatch; - IDW_RamSearch.Text = Global.Config.RamSearch; - IDW_RamPoke.Text = Global.Config.RamPoke; - IDW_HexEditor.Text = Global.Config.HexEditor; - IDW_LuaConsole.Text = Global.Config.LuaConsole; - IDW_Cheats.Text = Global.Config.Cheats; - IDW_OpenROM.Text = Global.Config.OpenROM; - IDW_CloseROM.Text = Global.Config.CloseROM; - IDW_DisplayFPS.Text = Global.Config.FPSBinding; - IDW_FrameCounter.Text = Global.Config.FrameCounterBinding; - IDW_LagCounter.Text = Global.Config.LagCounterBinding; - IDW_InputDisplay.Text = Global.Config.InputDisplayBinding; - IDW_TOGGLEREADONLY.Text = Global.Config.ReadOnlyToggleBinding; - IDW_PLAYMOVIE.Text = Global.Config.PlayMovieBinding; - IDW_RECORDMOVIE.Text = Global.Config.RecordMovieBinding; - IDW_STOPMOVIE.Text = Global.Config.StopMovieBinding; - IDW_PLAYBEGINNING.Text = Global.Config.PlayBeginningBinding; - IDW_VOLUP.Text = Global.Config.VolUpBinding; - IDW_VOLDOWN.Text = Global.Config.VolDownBinding; - IDW_TOGGLEMTRACK.Text = Global.Config.ToggleMultiTrack; - IDW_SELECTNONE.Text = Global.Config.MTRecordNone; - IDW_MTSELECTALL.Text = Global.Config.MTRecordAll; - IDW_MTINCPLAYER.Text = Global.Config.MTIncrementPlayer; - IDW_MTDECPLAYER.Text = Global.Config.MTDecrementPlayer; - } - private void button2_Click(object sender, EventArgs e) - { - this.Close(); - } + IDW_QuickSave.Text = Global.Config.QuickSave; + IDW_QuickLoad.Text = Global.Config.QuickLoad; + //Save States + IDW_SS0.Text = Global.Config.SaveSlot0; + IDW_SS1.Text = Global.Config.SaveSlot1; + IDW_SS2.Text = Global.Config.SaveSlot2; + IDW_SS3.Text = Global.Config.SaveSlot3; + IDW_SS4.Text = Global.Config.SaveSlot4; + IDW_SS5.Text = Global.Config.SaveSlot5; + IDW_SS6.Text = Global.Config.SaveSlot6; + IDW_SS7.Text = Global.Config.SaveSlot7; + IDW_SS8.Text = Global.Config.SaveSlot8; + IDW_SS9.Text = Global.Config.SaveSlot9; + //Load States + IDW_LS0.Text = Global.Config.LoadSlot0; + IDW_LS1.Text = Global.Config.LoadSlot1; + IDW_LS2.Text = Global.Config.LoadSlot2; + IDW_LS3.Text = Global.Config.LoadSlot3; + IDW_LS4.Text = Global.Config.LoadSlot4; + IDW_LS5.Text = Global.Config.LoadSlot5; + IDW_LS6.Text = Global.Config.LoadSlot6; + IDW_LS7.Text = Global.Config.LoadSlot7; + IDW_LS8.Text = Global.Config.LoadSlot8; + IDW_LS9.Text = Global.Config.LoadSlot9; + //Select States + IDW_ST0.Text = Global.Config.SelectSlot0; + IDW_ST1.Text = Global.Config.SelectSlot1; + IDW_ST2.Text = Global.Config.SelectSlot2; + IDW_ST3.Text = Global.Config.SelectSlot3; + IDW_ST4.Text = Global.Config.SelectSlot4; + IDW_ST5.Text = Global.Config.SelectSlot5; + IDW_ST6.Text = Global.Config.SelectSlot6; + IDW_ST7.Text = Global.Config.SelectSlot7; + IDW_ST8.Text = Global.Config.SelectSlot8; + IDW_ST9.Text = Global.Config.SelectSlot9; + IDW_TOOLBOX.Text = Global.Config.ToolBox; + IDW_SAVENAMEDSTATE.Text = Global.Config.SaveNamedState; + IDW_LOADNAMEDSTATE.Text = Global.Config.LoadNamedState; + IDW_NEXTSLOT.Text = Global.Config.NextSlot; + IDW_PREVIOUSSLOT.Text = Global.Config.PreviousSlot; + IDW_RamWatch.Text = Global.Config.RamWatch; + IDW_RamSearch.Text = Global.Config.RamSearch; + IDW_RamPoke.Text = Global.Config.RamPoke; + IDW_HexEditor.Text = Global.Config.HexEditor; + IDW_LuaConsole.Text = Global.Config.LuaConsole; + IDW_Cheats.Text = Global.Config.Cheats; + IDW_OpenROM.Text = Global.Config.OpenROM; + IDW_CloseROM.Text = Global.Config.CloseROM; + IDW_DisplayFPS.Text = Global.Config.FPSBinding; + IDW_FrameCounter.Text = Global.Config.FrameCounterBinding; + IDW_LagCounter.Text = Global.Config.LagCounterBinding; + IDW_InputDisplay.Text = Global.Config.InputDisplayBinding; + IDW_TOGGLEREADONLY.Text = Global.Config.ReadOnlyToggleBinding; + IDW_PLAYMOVIE.Text = Global.Config.PlayMovieBinding; + IDW_RECORDMOVIE.Text = Global.Config.RecordMovieBinding; + IDW_STOPMOVIE.Text = Global.Config.StopMovieBinding; + IDW_PLAYBEGINNING.Text = Global.Config.PlayBeginningBinding; + IDW_VOLUP.Text = Global.Config.VolUpBinding; + IDW_VOLDOWN.Text = Global.Config.VolDownBinding; + IDW_TOGGLEMTRACK.Text = Global.Config.ToggleMultiTrack; + IDW_SELECTNONE.Text = Global.Config.MTRecordNone; + IDW_MTSELECTALL.Text = Global.Config.MTRecordAll; + IDW_MTINCPLAYER.Text = Global.Config.MTIncrementPlayer; + IDW_MTDECPLAYER.Text = Global.Config.MTDecrementPlayer; + } + private void button2_Click(object sender, EventArgs e) + { + this.Close(); + } - private void IDB_SAVE_Click(object sender, EventArgs e) - { + private void IDB_SAVE_Click(object sender, EventArgs e) + { - Global.Config.FastForwardBinding = IDW_FASTFORWARD.Text; - Global.Config.FrameAdvanceBinding = IDW_FRAMEADVANCE.Text; - Global.Config.HardResetBinding = IDW_HARDRESET.Text; - Global.Config.RewindBinding = IDW_REWIND.Text; - Global.Config.UnthrottleBinding = IDW_UNTHROTTLE.Text; - Global.Config.EmulatorPauseBinding = IDW_PAUSE.Text; - Global.Config.ToggleFullscreenBinding = IDW_FULLSCREEN.Text; - Global.Config.ScreenshotBinding = IDW_SCREENSHOT.Text; + Global.Config.FastForwardBinding = IDW_FASTFORWARD.Text; + Global.Config.FrameAdvanceBinding = IDW_FRAMEADVANCE.Text; + Global.Config.HardResetBinding = IDW_HARDRESET.Text; + Global.Config.RewindBinding = IDW_REWIND.Text; + Global.Config.UnthrottleBinding = IDW_UNTHROTTLE.Text; + Global.Config.EmulatorPauseBinding = IDW_PAUSE.Text; + Global.Config.ToggleFullscreenBinding = IDW_FULLSCREEN.Text; + Global.Config.ScreenshotBinding = IDW_SCREENSHOT.Text; - Global.Config.QuickLoad = IDW_QuickLoad.Text; - Global.Config.QuickSave = IDW_QuickSave.Text; + Global.Config.QuickLoad = IDW_QuickLoad.Text; + Global.Config.QuickSave = IDW_QuickSave.Text; - Global.Config.SaveSlot0 = IDW_SS0.Text; - Global.Config.SaveSlot1 = IDW_SS1.Text; - Global.Config.SaveSlot2 = IDW_SS2.Text; - Global.Config.SaveSlot3 = IDW_SS3.Text; - Global.Config.SaveSlot4 = IDW_SS4.Text; - Global.Config.SaveSlot5 = IDW_SS5.Text; - Global.Config.SaveSlot6 = IDW_SS6.Text; - Global.Config.SaveSlot7 = IDW_SS7.Text; - Global.Config.SaveSlot8 = IDW_SS8.Text; - Global.Config.SaveSlot9 = IDW_SS9.Text; + Global.Config.SaveSlot0 = IDW_SS0.Text; + Global.Config.SaveSlot1 = IDW_SS1.Text; + Global.Config.SaveSlot2 = IDW_SS2.Text; + Global.Config.SaveSlot3 = IDW_SS3.Text; + Global.Config.SaveSlot4 = IDW_SS4.Text; + Global.Config.SaveSlot5 = IDW_SS5.Text; + Global.Config.SaveSlot6 = IDW_SS6.Text; + Global.Config.SaveSlot7 = IDW_SS7.Text; + Global.Config.SaveSlot8 = IDW_SS8.Text; + Global.Config.SaveSlot9 = IDW_SS9.Text; - Global.Config.LoadSlot0 = IDW_LS0.Text; - Global.Config.LoadSlot1 = IDW_LS1.Text; - Global.Config.LoadSlot2 = IDW_LS2.Text; - Global.Config.LoadSlot3 = IDW_LS3.Text; - Global.Config.LoadSlot4 = IDW_LS4.Text; - Global.Config.LoadSlot5 = IDW_LS5.Text; - Global.Config.LoadSlot6 = IDW_LS6.Text; - Global.Config.LoadSlot7 = IDW_LS7.Text; - Global.Config.LoadSlot8 = IDW_LS8.Text; - Global.Config.LoadSlot9 = IDW_LS9.Text; + Global.Config.LoadSlot0 = IDW_LS0.Text; + Global.Config.LoadSlot1 = IDW_LS1.Text; + Global.Config.LoadSlot2 = IDW_LS2.Text; + Global.Config.LoadSlot3 = IDW_LS3.Text; + Global.Config.LoadSlot4 = IDW_LS4.Text; + Global.Config.LoadSlot5 = IDW_LS5.Text; + Global.Config.LoadSlot6 = IDW_LS6.Text; + Global.Config.LoadSlot7 = IDW_LS7.Text; + Global.Config.LoadSlot8 = IDW_LS8.Text; + Global.Config.LoadSlot9 = IDW_LS9.Text; - Global.Config.SelectSlot0 = IDW_ST0.Text; - Global.Config.SelectSlot1 = IDW_ST1.Text; - Global.Config.SelectSlot2 = IDW_ST2.Text; - Global.Config.SelectSlot3 = IDW_ST3.Text; - Global.Config.SelectSlot4 = IDW_ST4.Text; - Global.Config.SelectSlot5 = IDW_ST5.Text; - Global.Config.SelectSlot6 = IDW_ST6.Text; - Global.Config.SelectSlot7 = IDW_ST7.Text; - Global.Config.SelectSlot8 = IDW_ST8.Text; - Global.Config.SelectSlot9 = IDW_ST9.Text; - Global.Config.ToolBox = IDW_TOOLBOX.Text; - Global.Config.SaveNamedState = IDW_SAVENAMEDSTATE.Text; - Global.Config.LoadNamedState = IDW_LOADNAMEDSTATE.Text; - Global.Config.PreviousSlot = IDW_PREVIOUSSLOT.Text; - Global.Config.NextSlot = IDW_NEXTSLOT.Text; - Global.Config.RamWatch = IDW_RamWatch.Text; - Global.Config.RamSearch = IDW_RamSearch.Text; - Global.Config.RamPoke = IDW_RamPoke.Text; - Global.Config.HexEditor = IDW_HexEditor.Text; - Global.Config.LuaConsole = IDW_LuaConsole.Text; - Global.Config.Cheats = IDW_Cheats.Text; - Global.Config.OpenROM = IDW_OpenROM.Text; - Global.Config.CloseROM = IDW_CloseROM.Text; - Global.Config.FPSBinding = IDW_DisplayFPS.Text; - Global.Config.FrameCounterBinding = IDW_FrameCounter.Text; - Global.Config.LagCounterBinding = IDW_LagCounter.Text; - Global.Config.InputDisplayBinding = IDW_InputDisplay.Text; - Global.Config.ReadOnlyToggleBinding = IDW_TOGGLEREADONLY.Text; - Global.Config.PlayMovieBinding = IDW_PLAYMOVIE.Text; - Global.Config.RecordMovieBinding = IDW_RECORDMOVIE.Text; - Global.Config.StopMovieBinding = IDW_STOPMOVIE.Text; - Global.Config.PlayBeginningBinding = IDW_PLAYBEGINNING.Text; - Global.Config.VolUpBinding = IDW_VOLUP.Text; - Global.Config.VolDownBinding = IDW_VOLDOWN.Text; + Global.Config.SelectSlot0 = IDW_ST0.Text; + Global.Config.SelectSlot1 = IDW_ST1.Text; + Global.Config.SelectSlot2 = IDW_ST2.Text; + Global.Config.SelectSlot3 = IDW_ST3.Text; + Global.Config.SelectSlot4 = IDW_ST4.Text; + Global.Config.SelectSlot5 = IDW_ST5.Text; + Global.Config.SelectSlot6 = IDW_ST6.Text; + Global.Config.SelectSlot7 = IDW_ST7.Text; + Global.Config.SelectSlot8 = IDW_ST8.Text; + Global.Config.SelectSlot9 = IDW_ST9.Text; + Global.Config.ToolBox = IDW_TOOLBOX.Text; + Global.Config.SaveNamedState = IDW_SAVENAMEDSTATE.Text; + Global.Config.LoadNamedState = IDW_LOADNAMEDSTATE.Text; + Global.Config.PreviousSlot = IDW_PREVIOUSSLOT.Text; + Global.Config.NextSlot = IDW_NEXTSLOT.Text; + Global.Config.RamWatch = IDW_RamWatch.Text; + Global.Config.RamSearch = IDW_RamSearch.Text; + Global.Config.RamPoke = IDW_RamPoke.Text; + Global.Config.HexEditor = IDW_HexEditor.Text; + Global.Config.LuaConsole = IDW_LuaConsole.Text; + Global.Config.Cheats = IDW_Cheats.Text; + Global.Config.OpenROM = IDW_OpenROM.Text; + Global.Config.CloseROM = IDW_CloseROM.Text; + Global.Config.FPSBinding = IDW_DisplayFPS.Text; + Global.Config.FrameCounterBinding = IDW_FrameCounter.Text; + Global.Config.LagCounterBinding = IDW_LagCounter.Text; + Global.Config.InputDisplayBinding = IDW_InputDisplay.Text; + Global.Config.ReadOnlyToggleBinding = IDW_TOGGLEREADONLY.Text; + Global.Config.PlayMovieBinding = IDW_PLAYMOVIE.Text; + Global.Config.RecordMovieBinding = IDW_RECORDMOVIE.Text; + Global.Config.StopMovieBinding = IDW_STOPMOVIE.Text; + Global.Config.PlayBeginningBinding = IDW_PLAYBEGINNING.Text; + Global.Config.VolUpBinding = IDW_VOLUP.Text; + Global.Config.VolDownBinding = IDW_VOLDOWN.Text; - Global.Config.ToggleMultiTrack = IDW_TOGGLEMTRACK.Text; - Global.Config.MTRecordAll = IDW_MTSELECTALL.Text; - Global.Config.MTRecordNone = IDW_SELECTNONE.Text; - Global.Config.MTIncrementPlayer = IDW_MTINCPLAYER.Text; - Global.Config.MTDecrementPlayer = IDW_MTDECPLAYER.Text; + Global.Config.ToggleMultiTrack = IDW_TOGGLEMTRACK.Text; + Global.Config.MTRecordAll = IDW_MTSELECTALL.Text; + Global.Config.MTRecordNone = IDW_SELECTNONE.Text; + Global.Config.MTIncrementPlayer = IDW_MTINCPLAYER.Text; + Global.Config.MTDecrementPlayer = IDW_MTDECPLAYER.Text; - this.DialogResult = DialogResult.OK; - this.Close(); - } + this.DialogResult = DialogResult.OK; + this.Close(); + } - private void hotkeyTabs_SelectedIndexChanged(object sender, EventArgs e) - { - hotkeyTabs.TabPages[hotkeyTabs.SelectedIndex].Controls[0].Focus(); - } + private void hotkeyTabs_SelectedIndexChanged(object sender, EventArgs e) + { + hotkeyTabs.TabPages[hotkeyTabs.SelectedIndex].Controls[0].Focus(); + } - private void HotkeyWindow_Load(object sender, EventArgs e) - { + private void HotkeyWindow_Load(object sender, EventArgs e) + { - } - } + } + } } diff --git a/BizHawk.MultiClient/config/PathConfig.cs b/BizHawk.MultiClient/config/PathConfig.cs index 517b379f58..0c3e9bf77b 100644 --- a/BizHawk.MultiClient/config/PathConfig.cs +++ b/BizHawk.MultiClient/config/PathConfig.cs @@ -11,538 +11,538 @@ using System.Reflection; namespace BizHawk.MultiClient { - public partial class PathConfig : Form - { - //TODO: - //Make all base path text boxes not allow %recent% - //All path text boxes should do some kind of error checking - //config path under base, config will default to %exe% - //Think of other modifiers (perhaps all environment paths?) - //If enough modifiers, path boxes can do a pull down of suggestions when user types % + public partial class PathConfig : Form + { + //TODO: + //Make all base path text boxes not allow %recent% + //All path text boxes should do some kind of error checking + //config path under base, config will default to %exe% + //Think of other modifiers (perhaps all environment paths?) + //If enough modifiers, path boxes can do a pull down of suggestions when user types % - //****************** - //Modifiers - //%exe% - path of EXE - //%recent% - most recent directory (windows environment path) - //****************** + //****************** + //Modifiers + //%exe% - path of EXE + //%recent% - most recent directory (windows environment path) + //****************** - //****************** - //Relative path logic - // . will always be relative to to a platform base - // unless it is a tools path or a platform base in which case it is relative to base - // base is always relative to exe - //****************** + //****************** + //Relative path logic + // . will always be relative to to a platform base + // unless it is a tools path or a platform base in which case it is relative to base + // base is always relative to exe + //****************** - public PathConfig() - { - InitializeComponent(); - } + public PathConfig() + { + InitializeComponent(); + } - private void SaveButton_Click(object sender, EventArgs e) - { - SaveSettings(); - } + private void SaveButton_Click(object sender, EventArgs e) + { + SaveSettings(); + } - private void PathConfig_Load(object sender, EventArgs e) - { - RecentForROMs.Checked = Global.Config.UseRecentForROMs; - BasePathBox.Text = Global.Config.BasePath; - - NESBaseBox.Text = Global.Config.BaseNES; - NESROMsBox.Text = Global.Config.PathNESROMs; - NESSavestatesBox.Text = Global.Config.PathNESSavestates; - NESSaveRAMBox.Text = Global.Config.PathNESSaveRAM; - NESScreenshotsBox.Text = Global.Config.PathNESScreenshots; - NESCheatsBox.Text = Global.Config.PathNESCheats; + private void PathConfig_Load(object sender, EventArgs e) + { + RecentForROMs.Checked = Global.Config.UseRecentForROMs; + BasePathBox.Text = Global.Config.BasePath; + + NESBaseBox.Text = Global.Config.BaseNES; + NESROMsBox.Text = Global.Config.PathNESROMs; + NESSavestatesBox.Text = Global.Config.PathNESSavestates; + NESSaveRAMBox.Text = Global.Config.PathNESSaveRAM; + NESScreenshotsBox.Text = Global.Config.PathNESScreenshots; + NESCheatsBox.Text = Global.Config.PathNESCheats; NESPaletteBox.Text = Global.Config.PathNESPalette; - - Sega8BaseBox.Text = Global.Config.BaseSMS; - Sega8ROMsBox.Text = Global.Config.PathSMSROMs; - Sega8SavestatesBox.Text = Global.Config.PathSMSSavestates; - Sega8SaveRAMBox.Text = Global.Config.PathSMSSaveRAM; - Sega8ScreenshotsBox.Text = Global.Config.PathSMSScreenshots; - Sega8CheatsBox.Text = Global.Config.PathSMSCheats; - GGBaseBox.Text = Global.Config.BaseGG; - GGROMBox.Text = Global.Config.PathGGROMs; - GGSavestatesBox.Text = Global.Config.PathGGSavestates; - GGSaveRAMBox.Text = Global.Config.PathGGSaveRAM; - GGScreenshotsBox.Text = Global.Config.PathGGScreenshots; - GGCheatsBox.Text = Global.Config.PathGGCheats; + Sega8BaseBox.Text = Global.Config.BaseSMS; + Sega8ROMsBox.Text = Global.Config.PathSMSROMs; + Sega8SavestatesBox.Text = Global.Config.PathSMSSavestates; + Sega8SaveRAMBox.Text = Global.Config.PathSMSSaveRAM; + Sega8ScreenshotsBox.Text = Global.Config.PathSMSScreenshots; + Sega8CheatsBox.Text = Global.Config.PathSMSCheats; - SGBaseBox.Text = Global.Config.BaseSG; - SGROMsBox.Text = Global.Config.PathSGROMs; - SGSavestatesBox.Text = Global.Config.PathSGSavestates; - SGSaveRAMBox.Text = Global.Config.PathSGSaveRAM; - SGScreenshotsBox.Text = Global.Config.PathSGScreenshots; - SGCheatsBox.Text = Global.Config.PathSGCheats; + GGBaseBox.Text = Global.Config.BaseGG; + GGROMBox.Text = Global.Config.PathGGROMs; + GGSavestatesBox.Text = Global.Config.PathGGSavestates; + GGSaveRAMBox.Text = Global.Config.PathGGSaveRAM; + GGScreenshotsBox.Text = Global.Config.PathGGScreenshots; + GGCheatsBox.Text = Global.Config.PathGGCheats; - PCEBaseBox.Text = Global.Config.BasePCE; - PCEROMsBox.Text = Global.Config.PathPCEROMs; - PCESavestatesBox.Text = Global.Config.PathPCESavestates; - PCESaveRAMBox.Text = Global.Config.PathPCESaveRAM; - PCEScreenshotsBox.Text = Global.Config.PathPCEScreenshots; - PCECheatsBox.Text = Global.Config.PathPCECheats; + SGBaseBox.Text = Global.Config.BaseSG; + SGROMsBox.Text = Global.Config.PathSGROMs; + SGSavestatesBox.Text = Global.Config.PathSGSavestates; + SGSaveRAMBox.Text = Global.Config.PathSGSaveRAM; + SGScreenshotsBox.Text = Global.Config.PathSGScreenshots; + SGCheatsBox.Text = Global.Config.PathSGCheats; - GenesisBaseBox.Text = Global.Config.BaseGenesis; - GenesisROMsBox.Text = Global.Config.PathGenesisROMs; - GenesisSavestatesBox.Text = Global.Config.PathGenesisScreenshots; - GenesisSaveRAMBox.Text = Global.Config.PathGenesisSaveRAM; - GenesisScreenshotsBox.Text = Global.Config.PathGenesisScreenshots; - GenesisCheatsBox.Text = Global.Config.PathGenesisCheats; + PCEBaseBox.Text = Global.Config.BasePCE; + PCEROMsBox.Text = Global.Config.PathPCEROMs; + PCESavestatesBox.Text = Global.Config.PathPCESavestates; + PCESaveRAMBox.Text = Global.Config.PathPCESaveRAM; + PCEScreenshotsBox.Text = Global.Config.PathPCEScreenshots; + PCECheatsBox.Text = Global.Config.PathPCECheats; - GBBaseBox.Text = Global.Config.BaseGameboy; - GBROMsBox.Text = Global.Config.PathGBROMs; - GBSavestatesBox.Text = Global.Config.PathGBSavestates; - GBSaveRAMBox.Text = Global.Config.PathGBSaveRAM; - GBScreenshotsBox.Text = Global.Config.PathGBScreenshots; - GBCheatsBox.Text = Global.Config.PathGBCheats; + GenesisBaseBox.Text = Global.Config.BaseGenesis; + GenesisROMsBox.Text = Global.Config.PathGenesisROMs; + GenesisSavestatesBox.Text = Global.Config.PathGenesisScreenshots; + GenesisSaveRAMBox.Text = Global.Config.PathGenesisSaveRAM; + GenesisScreenshotsBox.Text = Global.Config.PathGenesisScreenshots; + GenesisCheatsBox.Text = Global.Config.PathGenesisCheats; - TI83BaseBox.Text = Global.Config.BaseTI83; - TI83ROMsBox.Text = Global.Config.PathTI83ROMs; - TI83SavestatesBox.Text = Global.Config.PathTI83Savestates; - TI83SaveRAMBox.Text = Global.Config.PathTI83SaveRAM; - TI83ScreenshotsBox.Text = Global.Config.PathTI83Screenshots; - TI83CheatsBox.Text = Global.Config.PathTI83Cheats; + GBBaseBox.Text = Global.Config.BaseGameboy; + GBROMsBox.Text = Global.Config.PathGBROMs; + GBSavestatesBox.Text = Global.Config.PathGBSavestates; + GBSaveRAMBox.Text = Global.Config.PathGBSaveRAM; + GBScreenshotsBox.Text = Global.Config.PathGBScreenshots; + GBCheatsBox.Text = Global.Config.PathGBCheats; - MoviesBox.Text = Global.Config.MoviesPath; - LuaBox.Text = Global.Config.LuaPath; - WatchBox.Text = Global.Config.WatchPath; - AVIBox.Text = Global.Config.AVIPath; - } + TI83BaseBox.Text = Global.Config.BaseTI83; + TI83ROMsBox.Text = Global.Config.PathTI83ROMs; + TI83SavestatesBox.Text = Global.Config.PathTI83Savestates; + TI83SaveRAMBox.Text = Global.Config.PathTI83SaveRAM; + TI83ScreenshotsBox.Text = Global.Config.PathTI83Screenshots; + TI83CheatsBox.Text = Global.Config.PathTI83Cheats; - private void SaveSettings() - { - Global.Config.UseRecentForROMs = RecentForROMs.Checked; - Global.Config.BasePath = BasePathBox.Text; + MoviesBox.Text = Global.Config.MoviesPath; + LuaBox.Text = Global.Config.LuaPath; + WatchBox.Text = Global.Config.WatchPath; + AVIBox.Text = Global.Config.AVIPath; + } - Global.Config.BaseNES = NESBaseBox.Text; - Global.Config.PathNESROMs = NESROMsBox.Text; - Global.Config.PathNESSavestates = NESSavestatesBox.Text; - Global.Config.PathNESSaveRAM = NESSaveRAMBox.Text; - Global.Config.PathNESScreenshots = NESScreenshotsBox.Text; - Global.Config.PathNESCheats = NESCheatsBox.Text; + private void SaveSettings() + { + Global.Config.UseRecentForROMs = RecentForROMs.Checked; + Global.Config.BasePath = BasePathBox.Text; + + Global.Config.BaseNES = NESBaseBox.Text; + Global.Config.PathNESROMs = NESROMsBox.Text; + Global.Config.PathNESSavestates = NESSavestatesBox.Text; + Global.Config.PathNESSaveRAM = NESSaveRAMBox.Text; + Global.Config.PathNESScreenshots = NESScreenshotsBox.Text; + Global.Config.PathNESCheats = NESCheatsBox.Text; Global.Config.PathNESPalette = NESPaletteBox.Text; - Global.Config.BaseSMS = Sega8BaseBox.Text; - Global.Config.PathSMSROMs = Sega8ROMsBox.Text; - Global.Config.PathSMSSavestates = Sega8SavestatesBox.Text; - Global.Config.PathSMSSaveRAM = Sega8SaveRAMBox.Text; - Global.Config.PathSMSScreenshots = Sega8ScreenshotsBox.Text; - Global.Config.PathSMSCheats = Sega8CheatsBox.Text; - - Global.Config.BaseGG = GGBaseBox.Text; - Global.Config.PathGGROMs = GGROMBox.Text; - Global.Config.PathGGSavestates = GGSavestatesBox.Text; - Global.Config.PathGGSaveRAM = GGSaveRAMBox.Text; - Global.Config.PathGGScreenshots = GGScreenshotsBox.Text; - Global.Config.PathGGCheats = GGCheatsBox.Text; - - Global.Config.BaseSG = SGBaseBox.Text; - Global.Config.PathSGROMs = SGROMsBox.Text; - Global.Config.PathSGSavestates = SGSavestatesBox.Text; - Global.Config.PathSGSaveRAM = SGSaveRAMBox.Text; - Global.Config.PathSGScreenshots = SGScreenshotsBox.Text; - Global.Config.PathSGCheats = SGCheatsBox.Text; - - Global.Config.BasePCE = PCEBaseBox.Text; - Global.Config.PathPCEROMs = PCEROMsBox.Text; - Global.Config.PathPCESavestates = PCESavestatesBox.Text; - Global.Config.PathPCESaveRAM = PCESaveRAMBox.Text; - Global.Config.PathPCEScreenshots = PCEScreenshotsBox.Text; - Global.Config.PathPCECheats =PCECheatsBox.Text; - - Global.Config.BaseGenesis = GenesisBaseBox.Text; - Global.Config.PathGenesisROMs = GenesisROMsBox.Text; - Global.Config.PathGenesisScreenshots = GenesisSavestatesBox.Text; - Global.Config.PathGenesisSaveRAM = GenesisSaveRAMBox.Text; - Global.Config.PathGenesisScreenshots = GenesisScreenshotsBox.Text; - Global.Config.PathGenesisCheats = GenesisCheatsBox.Text; - - Global.Config.BaseGameboy = GBBaseBox.Text; - Global.Config.PathGBROMs = GBROMsBox.Text; - Global.Config.PathGBSavestates = GBSavestatesBox.Text; - Global.Config.PathGBSaveRAM = GBSaveRAMBox.Text; - Global.Config.PathGBScreenshots = GBScreenshotsBox.Text; - Global.Config.PathGBCheats = GBCheatsBox.Text; - - Global.Config.BaseTI83 = TI83BaseBox.Text; - Global.Config.PathTI83ROMs = TI83ROMsBox.Text; - Global.Config.PathTI83Savestates = TI83SavestatesBox.Text; - Global.Config.PathTI83SaveRAM = TI83SaveRAMBox.Text; - Global.Config.PathTI83Screenshots = TI83ScreenshotsBox.Text; - Global.Config.PathTI83Cheats = TI83CheatsBox.Text; - - Global.Config.MoviesPath = MoviesBox.Text; - Global.Config.LuaPath = LuaBox.Text; - Global.Config.WatchPath = WatchBox.Text; - Global.Config.AVIPath = AVIBox.Text; - - BasePathBox.Focus(); - } - - private void Cancel_Click(object sender, EventArgs e) - { - this.Close(); - } - - private void OK_Click(object sender, EventArgs e) - { - SaveSettings(); - this.Close(); - } - - private void tabControl1_SelectedIndexChanged(object sender, EventArgs e) - { - //TODO: make base text box Controls[0] so this will focus on it - //tabControl1.TabPages[tabControl1.SelectedIndex].Controls[0].Focus(); - } - - private void RecentForROMs_CheckedChanged(object sender, EventArgs e) - { - Global.Config.UseRecentForROMs = RecentForROMs.Checked; - if (RecentForROMs.Checked) - { - NESROMsBox.Enabled = false; - BrowseNESROMs.Enabled = false; - Sega8ROMsBox.Enabled = false; - Sega8BrowseROMs.Enabled = false; - GGROMBox.Enabled = false; - GGROMsDescription.Enabled = false; - SGROMsBox.Enabled = false; - SGROMsDescription.Enabled = false; - GenesisROMsBox.Enabled = false; - GenesisBrowseROMs.Enabled = false; - PCEROMsBox.Enabled = false; - PCEBrowseROMs.Enabled = false; - GBROMsBox.Enabled = false; - GBBrowseROMs.Enabled = false; - TI83ROMsBox.Enabled = false; - TI83BrowseROMs.Enabled = false; - - NESROMsDescription.Enabled = false; - Sega8ROMsDescription.Enabled = false; - GenesisROMsDescription.Enabled = false; - PCEROMsDescription.Enabled = false; - GBROMsDescription.Enabled = false; - TI83ROMsDescription.Enabled = false; - } - else - { - NESROMsBox.Enabled = true; - BrowseNESROMs.Enabled = true; - Sega8ROMsBox.Enabled = true; - Sega8BrowseROMs.Enabled = true; - GGROMBox.Enabled = true; - GGROMsDescription.Enabled = true; - SGROMsBox.Enabled = true; - SGROMsDescription.Enabled = true; - GenesisROMsBox.Enabled = true; - GenesisBrowseROMs.Enabled = true; - PCEROMsBox.Enabled = true; - PCEBrowseROMs.Enabled = true; - GBROMsBox.Enabled = true; - GBBrowseROMs.Enabled = true; - TI83ROMsBox.Enabled = true; - TI83BrowseROMs.Enabled = true; - - NESROMsDescription.Enabled = true; - Sega8ROMsDescription.Enabled = true; - GenesisROMsDescription.Enabled = true; - PCEROMsDescription.Enabled = true; - GBROMsDescription.Enabled = true; - TI83ROMsDescription.Enabled = true; - } - } - - private void BrowseFolder(TextBox box, string Name) - { - FolderBrowserDialog f = new FolderBrowserDialog(); - f.Description = "Set the directory for " + Name; - f.SelectedPath = PathManager.MakeAbsolutePath(box.Text, ""); - DialogResult result = f.ShowDialog(); - if (result == DialogResult.OK) - box.Text = f.SelectedPath; - } - - private void BrowseFolder(TextBox box, string Name, string System) - { - FolderBrowserDialog f = new FolderBrowserDialog(); - f.Description = "Set the directory for " + Name; - f.SelectedPath = PathManager.MakeAbsolutePath(box.Text, System); - DialogResult result = f.ShowDialog(); - if (result == DialogResult.OK) - box.Text = f.SelectedPath; - } - - private void BrowseWatch_Click(object sender, EventArgs e) - { - BrowseFolder(WatchBox, WatchDescription.Text); - } - - private void BrowseBase_Click(object sender, EventArgs e) - { - BrowseFolder(BasePathBox, BaseDescription.Text); - } - - private void BrowseAVI_Click(object sender, EventArgs e) - { - BrowseFolder(AVIBox, AVIDescription.Text); - } - - private void BrowseLua_Click(object sender, EventArgs e) - { - BrowseFolder(LuaBox, LuaDescription.Text); - } - - private void BrowseMovies_Click(object sender, EventArgs e) - { - BrowseFolder(MoviesBox, MoviesDescription.Text); - } - - private void BrowseNESBase_Click(object sender, EventArgs e) - { - BrowseFolder(NESBaseBox, NESBaseDescription.Text); - } - - private void BrowseNESROMs_Click(object sender, EventArgs e) - { - BrowseFolder(NESROMsBox, NESROMsDescription.Text, "NES"); - } - - private void BrowseNESSavestates_Click(object sender, EventArgs e) - { - BrowseFolder(NESSavestatesBox, NESSavestatesDescription.Text, "NES"); - } - - private void BrowseNESSaveRAM_Click(object sender, EventArgs e) - { - BrowseFolder(NESSaveRAMBox, NESSaveRAMDescription.Text, "NES"); - } - - private void BrowseNESScreenshots_Click(object sender, EventArgs e) - { - BrowseFolder(NESScreenshotsBox, NESScreenshotsDescription.Text, "NES"); - } - - private void NESBrowseCheats_Click(object sender, EventArgs e) - { - BrowseFolder(NESCheatsBox, NESCheatsDescription.Text, "NES"); - } - - private void Sega8BrowseBase_Click(object sender, EventArgs e) - { - BrowseFolder(Sega8BaseBox, Sega8BaseDescription.Text, "SMS"); - } - - private void Sega8BrowseROMs_Click(object sender, EventArgs e) - { - BrowseFolder(Sega8ROMsBox, Sega8ROMsDescription.Text, "SMS"); - } - - private void Sega8BrowseSavestates_Click(object sender, EventArgs e) - { - BrowseFolder(Sega8SavestatesBox, Sega8SavestatesDescription.Text, "SMS"); - } - - private void Sega8BrowseSaveRAM_Click(object sender, EventArgs e) - { - BrowseFolder(Sega8SaveRAMBox, Sega8SaveRAMDescription.Text, "SMS"); - } - - private void Sega8BrowseScreenshots_Click(object sender, EventArgs e) - { - BrowseFolder(Sega8ScreenshotsBox, Sega8ScreenshotsDescription.Text, "SMS"); - } - - private void Sega8BrowseCheats_Click(object sender, EventArgs e) - { - BrowseFolder(Sega8CheatsBox, Sega8CheatsDescription.Text, "SMS"); - } - - private void GenesisBrowseBase_Click(object sender, EventArgs e) - { - BrowseFolder(GenesisBaseBox, GenesisBaseDescription.Text); - } - - private void GenesisBrowseROMs_Click(object sender, EventArgs e) - { - BrowseFolder(GenesisROMsBox, GenesisROMsDescription.Text, "GEN"); - } - - private void GenesisBrowseSavestates_Click(object sender, EventArgs e) - { - BrowseFolder(GenesisSavestatesBox, GenesisSavestatesDescription.Text, "GEN"); - } - - private void GenesisBrowseSaveRAM_Click(object sender, EventArgs e) - { - BrowseFolder(GenesisSaveRAMBox, GenesisSaveRAMDescription.Text, "GEN"); - } - - private void GenesisBrowseScreenshots_Click(object sender, EventArgs e) - { - BrowseFolder(GenesisScreenshotsBox, GenesisScreenshotsDescription.Text, "GEN"); - } - - private void GenesisBrowseCheats_Click(object sender, EventArgs e) - { - BrowseFolder(GenesisCheatsBox, GenesisCheatsDescription.Text, "GEN"); - } - - private void PCEBrowseBase_Click(object sender, EventArgs e) - { - BrowseFolder(PCEBaseBox, PCEBaseDescription.Text); - } - - private void PCEBrowseROMs_Click(object sender, EventArgs e) - { - BrowseFolder(PCEROMsBox, PCEROMsDescription.Text, "PCE"); - } - - private void PCEBrowseSavestates_Click(object sender, EventArgs e) - { - BrowseFolder(PCESavestatesBox, PCESavestatesDescription.Text, "PCE"); - } - - private void PCEBrowseSaveRAM_Click(object sender, EventArgs e) - { - BrowseFolder(PCESaveRAMBox, PCESaveRAMDescription.Text, "PCE"); - } - - private void PCEBrowseScreenshots_Click(object sender, EventArgs e) - { - BrowseFolder(PCEScreenshotsBox, PCEScreenshotsDescription.Text, "PCE"); - } - - private void PCEBrowseCheats_Click(object sender, EventArgs e) - { - BrowseFolder(PCECheatsBox, PCECheatsDescription.Text, "PCE"); - } - - private void GBBrowseBase_Click(object sender, EventArgs e) - { - BrowseFolder(GBBaseBox, GBBaseDescription.Text); - } - - private void GBBrowseROMs_Click(object sender, EventArgs e) - { - BrowseFolder(GBROMsBox, GBROMsDescription.Text, "GB"); - } - - private void GBBrowseSavestates_Click(object sender, EventArgs e) - { - BrowseFolder(GBSavestatesBox, GBSavestatesDescription.Text, "GB"); - } - - private void GBBrowseSaveRAM_Click(object sender, EventArgs e) - { - BrowseFolder(GBSaveRAMBox, GBSaveRAMDescription.Text, "GB"); - } - - private void GBBrowseScreenshots_Click(object sender, EventArgs e) - { - BrowseFolder(GBScreenshotsBox, GBScreenshotsDescription.Text, "GB"); - } - - private void GBBrowseCheats_Click(object sender, EventArgs e) - { - BrowseFolder(GBCheatsBox, GBCheatsDescription.Text, "GB"); - } - - private void TI83BrowseBase_Click(object sender, EventArgs e) - { - BrowseFolder(TI83BaseBox, TI83BaseDescription.Text); - } - - private void TI83BrowseROMs_Click(object sender, EventArgs e) - { - BrowseFolder(TI83ROMsBox, TI83ROMsDescription.Text, "TI83"); - } - - private void TI83BrowseSavestates_Click(object sender, EventArgs e) - { - BrowseFolder(TI83SavestatesBox, TI83SavestatesDescription.Text, "TI83"); - } - - private void TI83BrowseSaveRAM_Click(object sender, EventArgs e) - { - BrowseFolder(TI83SaveRAMBox, TI83SaveRAMDescription.Text, "TI83"); - } - - private void TI83BrowseScreenshots_Click(object sender, EventArgs e) - { - BrowseFolder(TI83ScreenshotsBox, TI83ScreenshotsDescription.Text, "TI83"); - } - - private void TI83BrowseBox_Click(object sender, EventArgs e) - { - BrowseFolder(TI83CheatsBox, TI83CheatsDescription.Text, "TI83"); - } - - private void GGBrowseBase_Click(object sender, EventArgs e) - { - BrowseFolder(GGBaseBox, GGBaseDescription.Text); - } - - private void GGBrowseROMs_Click(object sender, EventArgs e) - { - BrowseFolder(GGROMBox, GGROMsDescription.Text, "GG"); - } - - private void GGBrowseSavestates_Click(object sender, EventArgs e) - { - BrowseFolder(GGSavestatesBox, GGSavestatesDescription.Text, "GG"); - } - - private void GGBrowseSaveRAM_Click(object sender, EventArgs e) - { - BrowseFolder(GGSaveRAMBox, GGSaveRAMDescription.Text, "GG"); - } - - private void GGBrowseScreenshots_Click(object sender, EventArgs e) - { - BrowseFolder(GGScreenshotsBox, GGScreenshotsDescription.Text, "GG"); - } - - private void GGBrowseCheats_Click(object sender, EventArgs e) - { - BrowseFolder(GGCheatsBox, GGCheatsDescription.Text, "GG"); - } - - private void SGBrowseBase_Click(object sender, EventArgs e) - { - BrowseFolder(SGBaseBox, SGBaseDescription.Text); - } - - private void SGROMsBrowse_Click(object sender, EventArgs e) - { - BrowseFolder(SGROMsBox, SGROMsDescription.Text, "SG"); - } - - private void SGBrowseSavestates_Click(object sender, EventArgs e) - { - BrowseFolder(SGSavestatesBox, SGSavestatesDescription.Text, "SG"); - } - - private void SGBrowseSaveRAM_Click(object sender, EventArgs e) - { - BrowseFolder(SGSaveRAMBox, SGSaveRAMDescription.Text, "SG"); - } - - private void SGBrowseScreenshots_Click(object sender, EventArgs e) - { - BrowseFolder(SGScreenshotsBox, SGScreenshotsDescription.Text, "SG"); - } - - private void SGBrowseCheats_Click(object sender, EventArgs e) - { - BrowseFolder(SGCheatsBox, SGCheatsDescription.Text, "SG"); - } + Global.Config.BaseSMS = Sega8BaseBox.Text; + Global.Config.PathSMSROMs = Sega8ROMsBox.Text; + Global.Config.PathSMSSavestates = Sega8SavestatesBox.Text; + Global.Config.PathSMSSaveRAM = Sega8SaveRAMBox.Text; + Global.Config.PathSMSScreenshots = Sega8ScreenshotsBox.Text; + Global.Config.PathSMSCheats = Sega8CheatsBox.Text; + + Global.Config.BaseGG = GGBaseBox.Text; + Global.Config.PathGGROMs = GGROMBox.Text; + Global.Config.PathGGSavestates = GGSavestatesBox.Text; + Global.Config.PathGGSaveRAM = GGSaveRAMBox.Text; + Global.Config.PathGGScreenshots = GGScreenshotsBox.Text; + Global.Config.PathGGCheats = GGCheatsBox.Text; + + Global.Config.BaseSG = SGBaseBox.Text; + Global.Config.PathSGROMs = SGROMsBox.Text; + Global.Config.PathSGSavestates = SGSavestatesBox.Text; + Global.Config.PathSGSaveRAM = SGSaveRAMBox.Text; + Global.Config.PathSGScreenshots = SGScreenshotsBox.Text; + Global.Config.PathSGCheats = SGCheatsBox.Text; + + Global.Config.BasePCE = PCEBaseBox.Text; + Global.Config.PathPCEROMs = PCEROMsBox.Text; + Global.Config.PathPCESavestates = PCESavestatesBox.Text; + Global.Config.PathPCESaveRAM = PCESaveRAMBox.Text; + Global.Config.PathPCEScreenshots = PCEScreenshotsBox.Text; + Global.Config.PathPCECheats = PCECheatsBox.Text; + + Global.Config.BaseGenesis = GenesisBaseBox.Text; + Global.Config.PathGenesisROMs = GenesisROMsBox.Text; + Global.Config.PathGenesisScreenshots = GenesisSavestatesBox.Text; + Global.Config.PathGenesisSaveRAM = GenesisSaveRAMBox.Text; + Global.Config.PathGenesisScreenshots = GenesisScreenshotsBox.Text; + Global.Config.PathGenesisCheats = GenesisCheatsBox.Text; + + Global.Config.BaseGameboy = GBBaseBox.Text; + Global.Config.PathGBROMs = GBROMsBox.Text; + Global.Config.PathGBSavestates = GBSavestatesBox.Text; + Global.Config.PathGBSaveRAM = GBSaveRAMBox.Text; + Global.Config.PathGBScreenshots = GBScreenshotsBox.Text; + Global.Config.PathGBCheats = GBCheatsBox.Text; + + Global.Config.BaseTI83 = TI83BaseBox.Text; + Global.Config.PathTI83ROMs = TI83ROMsBox.Text; + Global.Config.PathTI83Savestates = TI83SavestatesBox.Text; + Global.Config.PathTI83SaveRAM = TI83SaveRAMBox.Text; + Global.Config.PathTI83Screenshots = TI83ScreenshotsBox.Text; + Global.Config.PathTI83Cheats = TI83CheatsBox.Text; + + Global.Config.MoviesPath = MoviesBox.Text; + Global.Config.LuaPath = LuaBox.Text; + Global.Config.WatchPath = WatchBox.Text; + Global.Config.AVIPath = AVIBox.Text; + + BasePathBox.Focus(); + } + + private void Cancel_Click(object sender, EventArgs e) + { + this.Close(); + } + + private void OK_Click(object sender, EventArgs e) + { + SaveSettings(); + this.Close(); + } + + private void tabControl1_SelectedIndexChanged(object sender, EventArgs e) + { + //TODO: make base text box Controls[0] so this will focus on it + //tabControl1.TabPages[tabControl1.SelectedIndex].Controls[0].Focus(); + } + + private void RecentForROMs_CheckedChanged(object sender, EventArgs e) + { + Global.Config.UseRecentForROMs = RecentForROMs.Checked; + if (RecentForROMs.Checked) + { + NESROMsBox.Enabled = false; + BrowseNESROMs.Enabled = false; + Sega8ROMsBox.Enabled = false; + Sega8BrowseROMs.Enabled = false; + GGROMBox.Enabled = false; + GGROMsDescription.Enabled = false; + SGROMsBox.Enabled = false; + SGROMsDescription.Enabled = false; + GenesisROMsBox.Enabled = false; + GenesisBrowseROMs.Enabled = false; + PCEROMsBox.Enabled = false; + PCEBrowseROMs.Enabled = false; + GBROMsBox.Enabled = false; + GBBrowseROMs.Enabled = false; + TI83ROMsBox.Enabled = false; + TI83BrowseROMs.Enabled = false; + + NESROMsDescription.Enabled = false; + Sega8ROMsDescription.Enabled = false; + GenesisROMsDescription.Enabled = false; + PCEROMsDescription.Enabled = false; + GBROMsDescription.Enabled = false; + TI83ROMsDescription.Enabled = false; + } + else + { + NESROMsBox.Enabled = true; + BrowseNESROMs.Enabled = true; + Sega8ROMsBox.Enabled = true; + Sega8BrowseROMs.Enabled = true; + GGROMBox.Enabled = true; + GGROMsDescription.Enabled = true; + SGROMsBox.Enabled = true; + SGROMsDescription.Enabled = true; + GenesisROMsBox.Enabled = true; + GenesisBrowseROMs.Enabled = true; + PCEROMsBox.Enabled = true; + PCEBrowseROMs.Enabled = true; + GBROMsBox.Enabled = true; + GBBrowseROMs.Enabled = true; + TI83ROMsBox.Enabled = true; + TI83BrowseROMs.Enabled = true; + + NESROMsDescription.Enabled = true; + Sega8ROMsDescription.Enabled = true; + GenesisROMsDescription.Enabled = true; + PCEROMsDescription.Enabled = true; + GBROMsDescription.Enabled = true; + TI83ROMsDescription.Enabled = true; + } + } + + private void BrowseFolder(TextBox box, string Name) + { + FolderBrowserDialog f = new FolderBrowserDialog(); + f.Description = "Set the directory for " + Name; + f.SelectedPath = PathManager.MakeAbsolutePath(box.Text, ""); + DialogResult result = f.ShowDialog(); + if (result == DialogResult.OK) + box.Text = f.SelectedPath; + } + + private void BrowseFolder(TextBox box, string Name, string System) + { + FolderBrowserDialog f = new FolderBrowserDialog(); + f.Description = "Set the directory for " + Name; + f.SelectedPath = PathManager.MakeAbsolutePath(box.Text, System); + DialogResult result = f.ShowDialog(); + if (result == DialogResult.OK) + box.Text = f.SelectedPath; + } + + private void BrowseWatch_Click(object sender, EventArgs e) + { + BrowseFolder(WatchBox, WatchDescription.Text); + } + + private void BrowseBase_Click(object sender, EventArgs e) + { + BrowseFolder(BasePathBox, BaseDescription.Text); + } + + private void BrowseAVI_Click(object sender, EventArgs e) + { + BrowseFolder(AVIBox, AVIDescription.Text); + } + + private void BrowseLua_Click(object sender, EventArgs e) + { + BrowseFolder(LuaBox, LuaDescription.Text); + } + + private void BrowseMovies_Click(object sender, EventArgs e) + { + BrowseFolder(MoviesBox, MoviesDescription.Text); + } + + private void BrowseNESBase_Click(object sender, EventArgs e) + { + BrowseFolder(NESBaseBox, NESBaseDescription.Text); + } + + private void BrowseNESROMs_Click(object sender, EventArgs e) + { + BrowseFolder(NESROMsBox, NESROMsDescription.Text, "NES"); + } + + private void BrowseNESSavestates_Click(object sender, EventArgs e) + { + BrowseFolder(NESSavestatesBox, NESSavestatesDescription.Text, "NES"); + } + + private void BrowseNESSaveRAM_Click(object sender, EventArgs e) + { + BrowseFolder(NESSaveRAMBox, NESSaveRAMDescription.Text, "NES"); + } + + private void BrowseNESScreenshots_Click(object sender, EventArgs e) + { + BrowseFolder(NESScreenshotsBox, NESScreenshotsDescription.Text, "NES"); + } + + private void NESBrowseCheats_Click(object sender, EventArgs e) + { + BrowseFolder(NESCheatsBox, NESCheatsDescription.Text, "NES"); + } + + private void Sega8BrowseBase_Click(object sender, EventArgs e) + { + BrowseFolder(Sega8BaseBox, Sega8BaseDescription.Text, "SMS"); + } + + private void Sega8BrowseROMs_Click(object sender, EventArgs e) + { + BrowseFolder(Sega8ROMsBox, Sega8ROMsDescription.Text, "SMS"); + } + + private void Sega8BrowseSavestates_Click(object sender, EventArgs e) + { + BrowseFolder(Sega8SavestatesBox, Sega8SavestatesDescription.Text, "SMS"); + } + + private void Sega8BrowseSaveRAM_Click(object sender, EventArgs e) + { + BrowseFolder(Sega8SaveRAMBox, Sega8SaveRAMDescription.Text, "SMS"); + } + + private void Sega8BrowseScreenshots_Click(object sender, EventArgs e) + { + BrowseFolder(Sega8ScreenshotsBox, Sega8ScreenshotsDescription.Text, "SMS"); + } + + private void Sega8BrowseCheats_Click(object sender, EventArgs e) + { + BrowseFolder(Sega8CheatsBox, Sega8CheatsDescription.Text, "SMS"); + } + + private void GenesisBrowseBase_Click(object sender, EventArgs e) + { + BrowseFolder(GenesisBaseBox, GenesisBaseDescription.Text); + } + + private void GenesisBrowseROMs_Click(object sender, EventArgs e) + { + BrowseFolder(GenesisROMsBox, GenesisROMsDescription.Text, "GEN"); + } + + private void GenesisBrowseSavestates_Click(object sender, EventArgs e) + { + BrowseFolder(GenesisSavestatesBox, GenesisSavestatesDescription.Text, "GEN"); + } + + private void GenesisBrowseSaveRAM_Click(object sender, EventArgs e) + { + BrowseFolder(GenesisSaveRAMBox, GenesisSaveRAMDescription.Text, "GEN"); + } + + private void GenesisBrowseScreenshots_Click(object sender, EventArgs e) + { + BrowseFolder(GenesisScreenshotsBox, GenesisScreenshotsDescription.Text, "GEN"); + } + + private void GenesisBrowseCheats_Click(object sender, EventArgs e) + { + BrowseFolder(GenesisCheatsBox, GenesisCheatsDescription.Text, "GEN"); + } + + private void PCEBrowseBase_Click(object sender, EventArgs e) + { + BrowseFolder(PCEBaseBox, PCEBaseDescription.Text); + } + + private void PCEBrowseROMs_Click(object sender, EventArgs e) + { + BrowseFolder(PCEROMsBox, PCEROMsDescription.Text, "PCE"); + } + + private void PCEBrowseSavestates_Click(object sender, EventArgs e) + { + BrowseFolder(PCESavestatesBox, PCESavestatesDescription.Text, "PCE"); + } + + private void PCEBrowseSaveRAM_Click(object sender, EventArgs e) + { + BrowseFolder(PCESaveRAMBox, PCESaveRAMDescription.Text, "PCE"); + } + + private void PCEBrowseScreenshots_Click(object sender, EventArgs e) + { + BrowseFolder(PCEScreenshotsBox, PCEScreenshotsDescription.Text, "PCE"); + } + + private void PCEBrowseCheats_Click(object sender, EventArgs e) + { + BrowseFolder(PCECheatsBox, PCECheatsDescription.Text, "PCE"); + } + + private void GBBrowseBase_Click(object sender, EventArgs e) + { + BrowseFolder(GBBaseBox, GBBaseDescription.Text); + } + + private void GBBrowseROMs_Click(object sender, EventArgs e) + { + BrowseFolder(GBROMsBox, GBROMsDescription.Text, "GB"); + } + + private void GBBrowseSavestates_Click(object sender, EventArgs e) + { + BrowseFolder(GBSavestatesBox, GBSavestatesDescription.Text, "GB"); + } + + private void GBBrowseSaveRAM_Click(object sender, EventArgs e) + { + BrowseFolder(GBSaveRAMBox, GBSaveRAMDescription.Text, "GB"); + } + + private void GBBrowseScreenshots_Click(object sender, EventArgs e) + { + BrowseFolder(GBScreenshotsBox, GBScreenshotsDescription.Text, "GB"); + } + + private void GBBrowseCheats_Click(object sender, EventArgs e) + { + BrowseFolder(GBCheatsBox, GBCheatsDescription.Text, "GB"); + } + + private void TI83BrowseBase_Click(object sender, EventArgs e) + { + BrowseFolder(TI83BaseBox, TI83BaseDescription.Text); + } + + private void TI83BrowseROMs_Click(object sender, EventArgs e) + { + BrowseFolder(TI83ROMsBox, TI83ROMsDescription.Text, "TI83"); + } + + private void TI83BrowseSavestates_Click(object sender, EventArgs e) + { + BrowseFolder(TI83SavestatesBox, TI83SavestatesDescription.Text, "TI83"); + } + + private void TI83BrowseSaveRAM_Click(object sender, EventArgs e) + { + BrowseFolder(TI83SaveRAMBox, TI83SaveRAMDescription.Text, "TI83"); + } + + private void TI83BrowseScreenshots_Click(object sender, EventArgs e) + { + BrowseFolder(TI83ScreenshotsBox, TI83ScreenshotsDescription.Text, "TI83"); + } + + private void TI83BrowseBox_Click(object sender, EventArgs e) + { + BrowseFolder(TI83CheatsBox, TI83CheatsDescription.Text, "TI83"); + } + + private void GGBrowseBase_Click(object sender, EventArgs e) + { + BrowseFolder(GGBaseBox, GGBaseDescription.Text); + } + + private void GGBrowseROMs_Click(object sender, EventArgs e) + { + BrowseFolder(GGROMBox, GGROMsDescription.Text, "GG"); + } + + private void GGBrowseSavestates_Click(object sender, EventArgs e) + { + BrowseFolder(GGSavestatesBox, GGSavestatesDescription.Text, "GG"); + } + + private void GGBrowseSaveRAM_Click(object sender, EventArgs e) + { + BrowseFolder(GGSaveRAMBox, GGSaveRAMDescription.Text, "GG"); + } + + private void GGBrowseScreenshots_Click(object sender, EventArgs e) + { + BrowseFolder(GGScreenshotsBox, GGScreenshotsDescription.Text, "GG"); + } + + private void GGBrowseCheats_Click(object sender, EventArgs e) + { + BrowseFolder(GGCheatsBox, GGCheatsDescription.Text, "GG"); + } + + private void SGBrowseBase_Click(object sender, EventArgs e) + { + BrowseFolder(SGBaseBox, SGBaseDescription.Text); + } + + private void SGROMsBrowse_Click(object sender, EventArgs e) + { + BrowseFolder(SGROMsBox, SGROMsDescription.Text, "SG"); + } + + private void SGBrowseSavestates_Click(object sender, EventArgs e) + { + BrowseFolder(SGSavestatesBox, SGSavestatesDescription.Text, "SG"); + } + + private void SGBrowseSaveRAM_Click(object sender, EventArgs e) + { + BrowseFolder(SGSaveRAMBox, SGSaveRAMDescription.Text, "SG"); + } + + private void SGBrowseScreenshots_Click(object sender, EventArgs e) + { + BrowseFolder(SGScreenshotsBox, SGScreenshotsDescription.Text, "SG"); + } + + private void SGBrowseCheats_Click(object sender, EventArgs e) + { + BrowseFolder(SGCheatsBox, SGCheatsDescription.Text, "SG"); + } private void NESBrowsePalette_Click(object sender, EventArgs e) { BrowseFolder(NESPaletteBox, NESPaletteDescription.Text, "NES"); } - } + } } diff --git a/BizHawk.MultiClient/tools/Cheat.cs b/BizHawk.MultiClient/tools/Cheat.cs index ce7bb9f435..af31acd379 100644 --- a/BizHawk.MultiClient/tools/Cheat.cs +++ b/BizHawk.MultiClient/tools/Cheat.cs @@ -5,58 +5,58 @@ using System.Text; namespace BizHawk.MultiClient { - public class Cheat - { - //TODO: compare value (for NES) - public string name { get; set; } - public int address { get; set; } - public byte value { get; set; } - public MemoryDomain domain { get; set; } - private bool enabled; + public class Cheat + { + //TODO: compare value (for NES) + public string name { get; set; } + public int address { get; set; } + public byte value { get; set; } + public MemoryDomain domain { get; set; } + private bool enabled; - public Cheat() - { - name = ""; - address = 0; - value = 0; - enabled = false; - domain = new MemoryDomain("NULL", 1, Endian.Little, addr => 0, (a, v) => { }); - } + public Cheat() + { + name = ""; + address = 0; + value = 0; + enabled = false; + domain = new MemoryDomain("NULL", 1, Endian.Little, addr => 0, (a, v) => { }); + } - public Cheat(Cheat c) - { - name = c.name; - address = c.address; - value = c.value; - enabled = c.enabled; - domain = c.domain; - } + public Cheat(Cheat c) + { + name = c.name; + address = c.address; + value = c.value; + enabled = c.enabled; + domain = c.domain; + } - public Cheat(string cname, int addr, byte val, bool e, MemoryDomain d) - { - name = cname; - address = addr; - value = val; - enabled = e; - domain = d; - } + public Cheat(string cname, int addr, byte val, bool e, MemoryDomain d) + { + name = cname; + address = addr; + value = val; + enabled = e; + domain = d; + } - public void Enable() - { - enabled = true; - domain.SetFreeze(address, new MemoryDomain.FreezeData(MemoryDomain.FreezeData.Flag.Frozen, value)); - } + public void Enable() + { + enabled = true; + domain.SetFreeze(address, new MemoryDomain.FreezeData(MemoryDomain.FreezeData.Flag.Frozen, value)); + } - public void Disable() - { - enabled = false; - domain.SetFreeze(address, MemoryDomain.FreezeData.Empty); - } + public void Disable() + { + enabled = false; + domain.SetFreeze(address, MemoryDomain.FreezeData.Empty); + } - public bool IsEnabled() - { - return enabled; - } + public bool IsEnabled() + { + return enabled; + } - } + } } diff --git a/BizHawk.MultiClient/tools/HexEditor.cs b/BizHawk.MultiClient/tools/HexEditor.cs index 0811743dd8..ecf451aa19 100644 --- a/BizHawk.MultiClient/tools/HexEditor.cs +++ b/BizHawk.MultiClient/tools/HexEditor.cs @@ -10,353 +10,353 @@ using System.Globalization; namespace BizHawk.MultiClient { - public partial class HexEditor : Form - { - //TODO: - //different back color for frozen addresses - //Find text box - autohighlights matches, and shows total matches - //Users can customize background, & text colors - //Tool strip - //Text box showing currently highlighted address(es) & total - //Show num addresses in group box title (show "address" if 1 address) - //big font for currently mouse over'ed value? - //Unfreeze All items - this one is tricky though, the dialog should keep track of - // which addresses were frozen using this dialog (its own cheatList), and only - // remove those from the Cheats window cheat list + public partial class HexEditor : Form + { + //TODO: + //different back color for frozen addresses + //Find text box - autohighlights matches, and shows total matches + //Users can customize background, & text colors + //Tool strip + //Text box showing currently highlighted address(es) & total + //Show num addresses in group box title (show "address" if 1 address) + //big font for currently mouse over'ed value? + //Unfreeze All items - this one is tricky though, the dialog should keep track of + // which addresses were frozen using this dialog (its own cheatList), and only + // remove those from the Cheats window cheat list - int defaultWidth; - int defaultHeight; - List domainMenuItems = new List(); + int defaultWidth; + int defaultHeight; + List domainMenuItems = new List(); - public HexEditor() - { - InitializeComponent(); - Closing += (o, e) => SaveConfigSettings(); - } + public HexEditor() + { + InitializeComponent(); + Closing += (o, e) => SaveConfigSettings(); + } - public void SaveConfigSettings() - { - if (Global.Config.HexEditorSaveWindowPosition) - { - Global.Config.HexEditorWndx = this.Location.X; - Global.Config.HexEditorWndy = this.Location.Y; - Global.Config.HexEditorWidth = this.Right - this.Left; - Global.Config.HexEditorHeight = this.Bottom - this.Top; - } - } + public void SaveConfigSettings() + { + if (Global.Config.HexEditorSaveWindowPosition) + { + Global.Config.HexEditorWndx = this.Location.X; + Global.Config.HexEditorWndy = this.Location.Y; + Global.Config.HexEditorWidth = this.Right - this.Left; + Global.Config.HexEditorHeight = this.Bottom - this.Top; + } + } - private void HexEditor_Load(object sender, EventArgs e) - { - defaultWidth = this.Size.Width; //Save these first so that the user can restore to its original size - defaultHeight = this.Size.Height; - if (Global.Config.HexEditorSaveWindowPosition) - { - if (Global.Config.HexEditorSaveWindowPosition && Global.Config.HexEditorWndx >= 0 && Global.Config.HexEditorWndy >= 0) - this.Location = new Point(Global.Config.HexEditorWndx, Global.Config.HexEditorWndy); + private void HexEditor_Load(object sender, EventArgs e) + { + defaultWidth = this.Size.Width; //Save these first so that the user can restore to its original size + defaultHeight = this.Size.Height; + if (Global.Config.HexEditorSaveWindowPosition) + { + if (Global.Config.HexEditorSaveWindowPosition && Global.Config.HexEditorWndx >= 0 && Global.Config.HexEditorWndy >= 0) + this.Location = new Point(Global.Config.HexEditorWndx, Global.Config.HexEditorWndy); - if (Global.Config.HexEditorWidth >= 0 && Global.Config.HexEditorHeight >= 0) - { - this.Size = new System.Drawing.Size(Global.Config.HexEditorWidth, Global.Config.HexEditorHeight); - } - } - SetMemoryDomainMenu(); - } + if (Global.Config.HexEditorWidth >= 0 && Global.Config.HexEditorHeight >= 0) + { + this.Size = new System.Drawing.Size(Global.Config.HexEditorWidth, Global.Config.HexEditorHeight); + } + } + SetMemoryDomainMenu(); + } - private void exitToolStripMenuItem_Click(object sender, EventArgs e) - { - this.Close(); - } + private void exitToolStripMenuItem_Click(object sender, EventArgs e) + { + this.Close(); + } - public void UpdateValues() - { - if (!this.IsHandleCreated || this.IsDisposed) return; - MemoryViewer.Refresh(); - } + public void UpdateValues() + { + if (!this.IsHandleCreated || this.IsDisposed) return; + MemoryViewer.Refresh(); + } - public void Restart() - { - if (!this.IsHandleCreated || this.IsDisposed) return; - SetMemoryDomainMenu(); //Calls update routines - MemoryViewer.ResetScrollBar(); - } + public void Restart() + { + if (!this.IsHandleCreated || this.IsDisposed) return; + SetMemoryDomainMenu(); //Calls update routines + MemoryViewer.ResetScrollBar(); + } - private void restoreWindowSizeToolStripMenuItem_Click(object sender, EventArgs e) - { - this.Size = new System.Drawing.Size(defaultWidth, defaultHeight); - } + private void restoreWindowSizeToolStripMenuItem_Click(object sender, EventArgs e) + { + this.Size = new System.Drawing.Size(defaultWidth, defaultHeight); + } - private void autoloadToolStripMenuItem_Click(object sender, EventArgs e) - { - Global.Config.AutoLoadHexEditor ^= true; - } + private void autoloadToolStripMenuItem_Click(object sender, EventArgs e) + { + Global.Config.AutoLoadHexEditor ^= true; + } - private void optionsToolStripMenuItem_DropDownOpened(object sender, EventArgs e) - { - enToolStripMenuItem.Checked = MemoryViewer.BigEndian; - switch (MemoryViewer.GetDataSize()) - { - default: - case 1: - byteToolStripMenuItem.Checked = true; - byteToolStripMenuItem1.Checked = false; - byteToolStripMenuItem2.Checked = false; - break; - case 2: - byteToolStripMenuItem.Checked = false; - byteToolStripMenuItem1.Checked = true; - byteToolStripMenuItem2.Checked = false; - break; - case 4: - byteToolStripMenuItem.Checked = false; - byteToolStripMenuItem1.Checked = false; - byteToolStripMenuItem2.Checked = true; - break; - } + private void optionsToolStripMenuItem_DropDownOpened(object sender, EventArgs e) + { + enToolStripMenuItem.Checked = MemoryViewer.BigEndian; + switch (MemoryViewer.GetDataSize()) + { + default: + case 1: + byteToolStripMenuItem.Checked = true; + byteToolStripMenuItem1.Checked = false; + byteToolStripMenuItem2.Checked = false; + break; + case 2: + byteToolStripMenuItem.Checked = false; + byteToolStripMenuItem1.Checked = true; + byteToolStripMenuItem2.Checked = false; + break; + case 4: + byteToolStripMenuItem.Checked = false; + byteToolStripMenuItem1.Checked = false; + byteToolStripMenuItem2.Checked = true; + break; + } - if (MemoryViewer.GetHighlightedAddress() >= 0) - { - addToRamWatchToolStripMenuItem1.Enabled = true; - freezeAddressToolStripMenuItem.Enabled = true; - } - else - { - addToRamWatchToolStripMenuItem1.Enabled = false; - freezeAddressToolStripMenuItem.Enabled = false; - } - } + if (MemoryViewer.GetHighlightedAddress() >= 0) + { + addToRamWatchToolStripMenuItem1.Enabled = true; + freezeAddressToolStripMenuItem.Enabled = true; + } + else + { + addToRamWatchToolStripMenuItem1.Enabled = false; + freezeAddressToolStripMenuItem.Enabled = false; + } + } - private void SetMemoryDomain(int pos) - { - if (pos < Global.Emulator.MemoryDomains.Count) //Sanity check - { - MemoryViewer.SetMemoryDomain(Global.Emulator.MemoryDomains[pos]); - } - UpdateDomainString(); - MemoryViewer.ResetScrollBar(); - } + private void SetMemoryDomain(int pos) + { + if (pos < Global.Emulator.MemoryDomains.Count) //Sanity check + { + MemoryViewer.SetMemoryDomain(Global.Emulator.MemoryDomains[pos]); + } + UpdateDomainString(); + MemoryViewer.ResetScrollBar(); + } - private void UpdateDomainString() - { - string memoryDomain = MemoryViewer.GetMemoryDomainStr(); - string systemID = Global.Emulator.SystemId; - MemoryViewer.Text = systemID + " " + memoryDomain; - } + private void UpdateDomainString() + { + string memoryDomain = MemoryViewer.GetMemoryDomainStr(); + string systemID = Global.Emulator.SystemId; + MemoryViewer.Text = systemID + " " + memoryDomain; + } - private void SetMemoryDomainMenu() - { - memoryDomainsToolStripMenuItem.DropDownItems.Clear(); - if (Global.Emulator.MemoryDomains.Count > 0) - { - for (int x = 0; x < Global.Emulator.MemoryDomains.Count; x++) - { - string str = Global.Emulator.MemoryDomains[x].ToString(); - var item = new ToolStripMenuItem(); - item.Text = str; - { - int z = x; - item.Click += (o, ev) => SetMemoryDomain(z); - } - if (x == 0) - { - SetMemoryDomain(x); - } - memoryDomainsToolStripMenuItem.DropDownItems.Add(item); - domainMenuItems.Add(item); - } - } - else - memoryDomainsToolStripMenuItem.Enabled = false; - } + private void SetMemoryDomainMenu() + { + memoryDomainsToolStripMenuItem.DropDownItems.Clear(); + if (Global.Emulator.MemoryDomains.Count > 0) + { + for (int x = 0; x < Global.Emulator.MemoryDomains.Count; x++) + { + string str = Global.Emulator.MemoryDomains[x].ToString(); + var item = new ToolStripMenuItem(); + item.Text = str; + { + int z = x; + item.Click += (o, ev) => SetMemoryDomain(z); + } + if (x == 0) + { + SetMemoryDomain(x); + } + memoryDomainsToolStripMenuItem.DropDownItems.Add(item); + domainMenuItems.Add(item); + } + } + else + memoryDomainsToolStripMenuItem.Enabled = false; + } - public void GoToAddress(int address) - { - if (address < MemoryViewer.GetSize()) - { - MemoryViewer.SetHighlighted(address); - MemoryViewer.Refresh(); - } - } + public void GoToAddress(int address) + { + if (address < MemoryViewer.GetSize()) + { + MemoryViewer.SetHighlighted(address); + MemoryViewer.Refresh(); + } + } - private void goToAddressToolStripMenuItem_Click(object sender, EventArgs e) - { - InputPrompt i = new InputPrompt(); - i.Text = "Go to Address"; - i.SetMessage("Enter a hexadecimal value"); - i.ShowDialog(); + private void goToAddressToolStripMenuItem_Click(object sender, EventArgs e) + { + InputPrompt i = new InputPrompt(); + i.Text = "Go to Address"; + i.SetMessage("Enter a hexadecimal value"); + i.ShowDialog(); - if (i.UserOK) - { - if (InputValidate.IsValidHexNumber(i.UserText)) - { - GoToAddress(int.Parse(i.UserText, NumberStyles.HexNumber)); - } - } - } + if (i.UserOK) + { + if (InputValidate.IsValidHexNumber(i.UserText)) + { + GoToAddress(int.Parse(i.UserText, NumberStyles.HexNumber)); + } + } + } - - private void HexEditor_Resize(object sender, EventArgs e) - { - MemoryViewer.SetUpScrollBar(); - MemoryViewer.Refresh(); - } - private void byteToolStripMenuItem_Click(object sender, EventArgs e) - { - MemoryViewer.SetDataSize(1); - } + private void HexEditor_Resize(object sender, EventArgs e) + { + MemoryViewer.SetUpScrollBar(); + MemoryViewer.Refresh(); + } - private void byteToolStripMenuItem1_Click(object sender, EventArgs e) - { - MemoryViewer.SetDataSize(2); - } + private void byteToolStripMenuItem_Click(object sender, EventArgs e) + { + MemoryViewer.SetDataSize(1); + } - private void byteToolStripMenuItem2_Click(object sender, EventArgs e) - { - MemoryViewer.SetDataSize(4); - } + private void byteToolStripMenuItem1_Click(object sender, EventArgs e) + { + MemoryViewer.SetDataSize(2); + } - private void enToolStripMenuItem_Click(object sender, EventArgs e) - { - MemoryViewer.BigEndian ^= true; - } + private void byteToolStripMenuItem2_Click(object sender, EventArgs e) + { + MemoryViewer.SetDataSize(4); + } - private void MemoryViewer_Paint(object sender, PaintEventArgs e) - { + private void enToolStripMenuItem_Click(object sender, EventArgs e) + { + MemoryViewer.BigEndian ^= true; + } - } + private void MemoryViewer_Paint(object sender, PaintEventArgs e) + { - private void AddToRamWatch() - { - //Add to RAM Watch - int address = MemoryViewer.GetPointedAddress(); - if (address >= 0) - { - Watch w = new Watch(); - w.address = address; + } - switch (MemoryViewer.GetDataSize()) - { - default: - case 1: - w.type = atype.BYTE; - break; - case 2: - w.type = atype.WORD; - break; - case 4: - w.type = atype.DWORD; - break; - } + private void AddToRamWatch() + { + //Add to RAM Watch + int address = MemoryViewer.GetPointedAddress(); + if (address >= 0) + { + Watch w = new Watch(); + w.address = address; - w.bigendian = MemoryViewer.BigEndian; - w.signed = asigned.HEX; + switch (MemoryViewer.GetDataSize()) + { + default: + case 1: + w.type = atype.BYTE; + break; + case 2: + w.type = atype.WORD; + break; + case 4: + w.type = atype.DWORD; + break; + } - Global.MainForm.LoadRamWatch(); - Global.MainForm.RamWatch1.AddWatch(w); - } - } + w.bigendian = MemoryViewer.BigEndian; + w.signed = asigned.HEX; - private void MemoryViewer_MouseDoubleClick(object sender, MouseEventArgs e) - { - AddToRamWatch(); - } + Global.MainForm.LoadRamWatch(); + Global.MainForm.RamWatch1.AddWatch(w); + } + } - private void pokeToolStripMenuItem_Click(object sender, EventArgs e) - { - int p = MemoryViewer.GetPointedAddress(); - if (p >= 0) - { - InputPrompt i = new InputPrompt(); - i.Text = "Poke " + String.Format("{0:X}", p); - i.SetMessage("Enter a hexadecimal value"); - i.ShowDialog(); + private void MemoryViewer_MouseDoubleClick(object sender, MouseEventArgs e) + { + AddToRamWatch(); + } - if (i.UserOK) - { - if (InputValidate.IsValidHexNumber(i.UserText)) - { - int value = int.Parse(i.UserText, NumberStyles.HexNumber); - MemoryViewer.HighlightPointed(); - MemoryViewer.PokeHighlighted(value); - } - } - } - } + private void pokeToolStripMenuItem_Click(object sender, EventArgs e) + { + int p = MemoryViewer.GetPointedAddress(); + if (p >= 0) + { + InputPrompt i = new InputPrompt(); + i.Text = "Poke " + String.Format("{0:X}", p); + i.SetMessage("Enter a hexadecimal value"); + i.ShowDialog(); - private void addToRamWatchToolStripMenuItem_Click(object sender, EventArgs e) - { - AddToRamWatch(); - } + if (i.UserOK) + { + if (InputValidate.IsValidHexNumber(i.UserText)) + { + int value = int.Parse(i.UserText, NumberStyles.HexNumber); + MemoryViewer.HighlightPointed(); + MemoryViewer.PokeHighlighted(value); + } + } + } + } - private void addToRamWatchToolStripMenuItem1_Click(object sender, EventArgs e) - { - AddToRamWatch(); - } + private void addToRamWatchToolStripMenuItem_Click(object sender, EventArgs e) + { + AddToRamWatch(); + } - private void saveWindowsSettingsToolStripMenuItem_Click(object sender, EventArgs e) - { - Global.Config.HexEditorSaveWindowPosition ^= true; - } + private void addToRamWatchToolStripMenuItem1_Click(object sender, EventArgs e) + { + AddToRamWatch(); + } - private void settingsToolStripMenuItem_DropDownOpened(object sender, EventArgs e) - { - autoloadToolStripMenuItem.Checked = Global.Config.AutoLoadHexEditor; - saveWindowsSettingsToolStripMenuItem.Checked = Global.Config.HexEditorSaveWindowPosition; - } + private void saveWindowsSettingsToolStripMenuItem_Click(object sender, EventArgs e) + { + Global.Config.HexEditorSaveWindowPosition ^= true; + } - private void freezeToolStripMenuItem_Click(object sender, EventArgs e) - { - FreezeAddress(); - } + private void settingsToolStripMenuItem_DropDownOpened(object sender, EventArgs e) + { + autoloadToolStripMenuItem.Checked = Global.Config.AutoLoadHexEditor; + saveWindowsSettingsToolStripMenuItem.Checked = Global.Config.HexEditorSaveWindowPosition; + } - private void FreezeAddress() - { - int address = MemoryViewer.GetPointedAddress(); - if (address >= 0) - { - Cheat c = new Cheat(); - c.address = address; - c.value = MemoryViewer.GetPointedValue(); - c.domain = MemoryViewer.GetDomain(); - //TODO: multibyte - switch (MemoryViewer.GetDataSize()) - { - default: - case 1: - break; - case 2: - break; - case 4: - break; - } + private void freezeToolStripMenuItem_Click(object sender, EventArgs e) + { + FreezeAddress(); + } - //w.bigendian = MemoryViewer.BigEndian; + private void FreezeAddress() + { + int address = MemoryViewer.GetPointedAddress(); + if (address >= 0) + { + Cheat c = new Cheat(); + c.address = address; + c.value = MemoryViewer.GetPointedValue(); + c.domain = MemoryViewer.GetDomain(); + //TODO: multibyte + switch (MemoryViewer.GetDataSize()) + { + default: + case 1: + break; + case 2: + break; + case 4: + break; + } - Global.MainForm.Cheats1.AddCheat(c); - } - } + //w.bigendian = MemoryViewer.BigEndian; - private void freezeAddressToolStripMenuItem_Click(object sender, EventArgs e) - { - FreezeAddress(); - } + Global.MainForm.Cheats1.AddCheat(c); + } + } - private void CheckDomainMenuItems() - { - for (int x = 0; x < domainMenuItems.Count; x++) - { - if (MemoryViewer.GetDomain().Name == domainMenuItems[x].Text) - domainMenuItems[x].Checked = true; - else - domainMenuItems[x].Checked = false; - } - } + private void freezeAddressToolStripMenuItem_Click(object sender, EventArgs e) + { + FreezeAddress(); + } - private void memoryDomainsToolStripMenuItem_DropDownOpened(object sender, EventArgs e) - { - CheckDomainMenuItems(); - } - } + private void CheckDomainMenuItems() + { + for (int x = 0; x < domainMenuItems.Count; x++) + { + if (MemoryViewer.GetDomain().Name == domainMenuItems[x].Text) + domainMenuItems[x].Checked = true; + else + domainMenuItems[x].Checked = false; + } + } + + private void memoryDomainsToolStripMenuItem_DropDownOpened(object sender, EventArgs e) + { + CheckDomainMenuItems(); + } + } } diff --git a/BizHawk.MultiClient/tools/RamPoke.cs b/BizHawk.MultiClient/tools/RamPoke.cs index 9476a9466e..62e2bf80a3 100644 --- a/BizHawk.MultiClient/tools/RamPoke.cs +++ b/BizHawk.MultiClient/tools/RamPoke.cs @@ -10,233 +10,233 @@ using System.Globalization; namespace BizHawk.MultiClient { - public partial class RamPoke : Form - { - //TODO: - //If signed/unsigned/hex radios selected, auto-change the value box, and auto limit box length - //Checked signed/u/h value on RamPoke_Load and set value appopriately - //Memory domain selection - //Output message, format number of digits appropriately - public Watch watch = new Watch(); - public Point location = new Point(); + public partial class RamPoke : Form + { + //TODO: + //If signed/unsigned/hex radios selected, auto-change the value box, and auto limit box length + //Checked signed/u/h value on RamPoke_Load and set value appopriately + //Memory domain selection + //Output message, format number of digits appropriately + public Watch watch = new Watch(); + public Point location = new Point(); - public RamPoke() - { - InitializeComponent(); - } + public RamPoke() + { + InitializeComponent(); + } - public void SetWatchObject(Watch w) - { - watch = w; - } + public void SetWatchObject(Watch w) + { + watch = w; + } - private void RamPoke_Load(object sender, EventArgs e) - { - SetTypeRadio(watch.type); - SetSignedRadio(watch.signed); - if (watch.bigendian == true) - BigEndianRadio.Checked = true; - else - LittleEndianRadio.Checked = true; - AddressBox.Text = String.Format("{0:X}", watch.address); + private void RamPoke_Load(object sender, EventArgs e) + { + SetTypeRadio(watch.type); + SetSignedRadio(watch.signed); + if (watch.bigendian == true) + BigEndianRadio.Checked = true; + else + LittleEndianRadio.Checked = true; + AddressBox.Text = String.Format("{0:X}", watch.address); - - ValueBox.Text = watch.value.ToString(); - - - if (location.X > 0 && location.Y > 0) - this.Location = location; - - } - private void SetTypeRadio(atype a) - { - switch (a) - { - case atype.BYTE: - Byte1Radio.Checked = true; - break; - case atype.WORD: - Byte2Radio.Checked = true; - break; - case atype.DWORD: - Byte4Radio.Checked = true; - break; - default: - break; - } - } + ValueBox.Text = watch.value.ToString(); - private void SetSignedRadio(asigned a) - { - switch (a) - { - case asigned.SIGNED: - SignedRadio.Checked = true; - break; - case asigned.UNSIGNED: - UnsignedRadio.Checked = true; - break; - case asigned.HEX: - HexRadio.Checked = true; - break; - default: - break; - } - } - private void Cancel_Click(object sender, EventArgs e) - { - this.Close(); - } + if (location.X > 0 && location.Y > 0) + this.Location = location; - private void OK_Click(object sender, EventArgs e) - { - //Put user settings in the watch file + } - if (InputValidate.IsValidHexNumber(AddressBox.Text)) - watch.address = int.Parse(AddressBox.Text, NumberStyles.HexNumber); - else - { - MessageBox.Show("Invalid Address, must be a valid hex number", "Invalid Address", MessageBoxButtons.OK, MessageBoxIcon.Error); - AddressBox.Focus(); - AddressBox.SelectAll(); - return; - } - - if (SignedRadio.Checked) - watch.signed = asigned.SIGNED; - else if (UnsignedRadio.Checked) - watch.signed = asigned.UNSIGNED; - else if (HexRadio.Checked) - watch.signed = asigned.HEX; + private void SetTypeRadio(atype a) + { + switch (a) + { + case atype.BYTE: + Byte1Radio.Checked = true; + break; + case atype.WORD: + Byte2Radio.Checked = true; + break; + case atype.DWORD: + Byte4Radio.Checked = true; + break; + default: + break; + } + } - if (Byte1Radio.Checked) - watch.type = atype.BYTE; - else if (Byte2Radio.Checked) - watch.type = atype.WORD; - else if (Byte4Radio.Checked) - watch.type = atype.DWORD; + private void SetSignedRadio(asigned a) + { + switch (a) + { + case asigned.SIGNED: + SignedRadio.Checked = true; + break; + case asigned.UNSIGNED: + UnsignedRadio.Checked = true; + break; + case asigned.HEX: + HexRadio.Checked = true; + break; + default: + break; + } + } - if (BigEndianRadio.Checked) - watch.bigendian = true; - else if (LittleEndianRadio.Checked) - watch.bigendian = false; + private void Cancel_Click(object sender, EventArgs e) + { + this.Close(); + } - int x = GetSpecificValue(); - if (x == -99999999) - { - MessageBox.Show("Missing or invalid value", "Invalid Value", MessageBoxButtons.OK, MessageBoxIcon.Error); - ValueBox.Focus(); - ValueBox.SelectAll(); - return; - } - else - watch.value = int.Parse(ValueBox.Text); + private void OK_Click(object sender, EventArgs e) + { + //Put user settings in the watch file - watch.PokeAddress(Global.Emulator.MainMemory); - - //TODO: format value based on watch.type - OutputLabel.Text = watch.value.ToString() + " written to " + String.Format("{0:X}", watch.address); - } + if (InputValidate.IsValidHexNumber(AddressBox.Text)) + watch.address = int.Parse(AddressBox.Text, NumberStyles.HexNumber); + else + { + MessageBox.Show("Invalid Address, must be a valid hex number", "Invalid Address", MessageBoxButtons.OK, MessageBoxIcon.Error); + AddressBox.Focus(); + AddressBox.SelectAll(); + return; + } - private void AddressBox_Leave(object sender, EventArgs e) - { - AddressBox.Text = AddressBox.Text.Replace(" ", ""); - if (!InputValidate.IsValidHexNumber(AddressBox.Text)) - { - AddressBox.Focus(); - AddressBox.SelectAll(); - ToolTip t = new ToolTip(); - t.Show("Must be a valid hexadecimal value", AddressBox, 5000); - } - } + if (SignedRadio.Checked) + watch.signed = asigned.SIGNED; + else if (UnsignedRadio.Checked) + watch.signed = asigned.UNSIGNED; + else if (HexRadio.Checked) + watch.signed = asigned.HEX; - private void ValueBox_Leave(object sender, EventArgs e) - { - ValueBox.Text = ValueBox.Text.Replace(" ", ""); - if (!InputValidate.IsValidUnsignedNumber(ValueBox.Text)) - { - ValueBox.Focus(); - ValueBox.SelectAll(); - ToolTip t = new ToolTip(); - t.Show("Must be a valid unsigned decimal value", ValueBox, 5000); - } - } + if (Byte1Radio.Checked) + watch.type = atype.BYTE; + else if (Byte2Radio.Checked) + watch.type = atype.WORD; + else if (Byte4Radio.Checked) + watch.type = atype.DWORD; - private asigned GetDataType() - { - if (SignedRadio.Checked) - return asigned.UNSIGNED; - if (UnsignedRadio.Checked) - return asigned.SIGNED; - if (HexRadio.Checked) - return asigned.HEX; + if (BigEndianRadio.Checked) + watch.bigendian = true; + else if (LittleEndianRadio.Checked) + watch.bigendian = false; - return asigned.UNSIGNED; //Just in case - } + int x = GetSpecificValue(); + if (x == -99999999) + { + MessageBox.Show("Missing or invalid value", "Invalid Value", MessageBoxButtons.OK, MessageBoxIcon.Error); + ValueBox.Focus(); + ValueBox.SelectAll(); + return; + } + else + watch.value = int.Parse(ValueBox.Text); - private void AddressBox_KeyPress(object sender, KeyPressEventArgs e) - { - if (e.KeyChar == '\b') return; + watch.PokeAddress(Global.Emulator.MainMemory); - if (!InputValidate.IsValidHexNumber(e.KeyChar)) - e.Handled = true; - } + //TODO: format value based on watch.type + OutputLabel.Text = watch.value.ToString() + " written to " + String.Format("{0:X}", watch.address); + } - private void ValueBox_KeyPress(object sender, KeyPressEventArgs e) - { - if (e.KeyChar == '\b') return; + private void AddressBox_Leave(object sender, EventArgs e) + { + AddressBox.Text = AddressBox.Text.Replace(" ", ""); + if (!InputValidate.IsValidHexNumber(AddressBox.Text)) + { + AddressBox.Focus(); + AddressBox.SelectAll(); + ToolTip t = new ToolTip(); + t.Show("Must be a valid hexadecimal value", AddressBox, 5000); + } + } - switch (GetDataType()) - { - case asigned.UNSIGNED: - if (!InputValidate.IsValidUnsignedNumber(e.KeyChar)) - e.Handled = true; - break; - case asigned.SIGNED: - if (!InputValidate.IsValidSignedNumber(e.KeyChar)) - e.Handled = true; - break; - case asigned.HEX: - if (!InputValidate.IsValidHexNumber(e.KeyChar)) - e.Handled = true; - break; - } - } + private void ValueBox_Leave(object sender, EventArgs e) + { + ValueBox.Text = ValueBox.Text.Replace(" ", ""); + if (!InputValidate.IsValidUnsignedNumber(ValueBox.Text)) + { + ValueBox.Focus(); + ValueBox.SelectAll(); + ToolTip t = new ToolTip(); + t.Show("Must be a valid unsigned decimal value", ValueBox, 5000); + } + } - private atype GetDataSize() - { - if (Byte1Radio.Checked) - return atype.BYTE; - if (Byte2Radio.Checked) - return atype.WORD; - if (Byte4Radio.Checked) - return atype.DWORD; + private asigned GetDataType() + { + if (SignedRadio.Checked) + return asigned.UNSIGNED; + if (UnsignedRadio.Checked) + return asigned.SIGNED; + if (HexRadio.Checked) + return asigned.HEX; - return atype.BYTE; - } + return asigned.UNSIGNED; //Just in case + } - private int GetSpecificValue() - { - if (ValueBox.Text == "" || ValueBox.Text == "-") return 0; - bool i = false; - switch (GetDataType()) - { - case asigned.UNSIGNED: - i = InputValidate.IsValidUnsignedNumber(ValueBox.Text); - if (!i) return -99999999; - return (int)Int64.Parse(ValueBox.Text); //Note: 64 to be safe since 4 byte values can be entered - case asigned.SIGNED: - i = InputValidate.IsValidSignedNumber(ValueBox.Text); - if (!i) return -99999999; - return (int)Int64.Parse(ValueBox.Text); - case asigned.HEX: - i = InputValidate.IsValidHexNumber(ValueBox.Text); - if (!i) return -99999999; - return (int)Int64.Parse(ValueBox.Text, NumberStyles.HexNumber); - } - return -99999999; //What are the odds someone wants to search for this value? - } - } + private void AddressBox_KeyPress(object sender, KeyPressEventArgs e) + { + if (e.KeyChar == '\b') return; + + if (!InputValidate.IsValidHexNumber(e.KeyChar)) + e.Handled = true; + } + + private void ValueBox_KeyPress(object sender, KeyPressEventArgs e) + { + if (e.KeyChar == '\b') return; + + switch (GetDataType()) + { + case asigned.UNSIGNED: + if (!InputValidate.IsValidUnsignedNumber(e.KeyChar)) + e.Handled = true; + break; + case asigned.SIGNED: + if (!InputValidate.IsValidSignedNumber(e.KeyChar)) + e.Handled = true; + break; + case asigned.HEX: + if (!InputValidate.IsValidHexNumber(e.KeyChar)) + e.Handled = true; + break; + } + } + + private atype GetDataSize() + { + if (Byte1Radio.Checked) + return atype.BYTE; + if (Byte2Radio.Checked) + return atype.WORD; + if (Byte4Radio.Checked) + return atype.DWORD; + + return atype.BYTE; + } + + private int GetSpecificValue() + { + if (ValueBox.Text == "" || ValueBox.Text == "-") return 0; + bool i = false; + switch (GetDataType()) + { + case asigned.UNSIGNED: + i = InputValidate.IsValidUnsignedNumber(ValueBox.Text); + if (!i) return -99999999; + return (int)Int64.Parse(ValueBox.Text); //Note: 64 to be safe since 4 byte values can be entered + case asigned.SIGNED: + i = InputValidate.IsValidSignedNumber(ValueBox.Text); + if (!i) return -99999999; + return (int)Int64.Parse(ValueBox.Text); + case asigned.HEX: + i = InputValidate.IsValidHexNumber(ValueBox.Text); + if (!i) return -99999999; + return (int)Int64.Parse(ValueBox.Text, NumberStyles.HexNumber); + } + return -99999999; //What are the odds someone wants to search for this value? + } + } } diff --git a/BizHawk.MultiClient/tools/RamWatchNewWatch.cs b/BizHawk.MultiClient/tools/RamWatchNewWatch.cs index 24db3a035a..f378ef5910 100644 --- a/BizHawk.MultiClient/tools/RamWatchNewWatch.cs +++ b/BizHawk.MultiClient/tools/RamWatchNewWatch.cs @@ -10,154 +10,154 @@ using System.Globalization; namespace BizHawk.MultiClient { - public partial class RamWatchNewWatch : Form - { - public Watch watch = new Watch(); - public bool userSelected = false; - public bool customSetup = false; - public Point location = new Point(); + public partial class RamWatchNewWatch : Form + { + public Watch watch = new Watch(); + public bool userSelected = false; + public bool customSetup = false; + public Point location = new Point(); - public RamWatchNewWatch() - { - InitializeComponent(); - } + public RamWatchNewWatch() + { + InitializeComponent(); + } - private void SetTypeRadio(atype a) - { - switch (a) - { - case atype.BYTE: - Byte1Radio.Checked = true; - break; - case atype.WORD: - Byte2Radio.Checked = true; - break; - case atype.DWORD: - Byte4Radio.Checked = true; - break; - default: - break; - } - } + private void SetTypeRadio(atype a) + { + switch (a) + { + case atype.BYTE: + Byte1Radio.Checked = true; + break; + case atype.WORD: + Byte2Radio.Checked = true; + break; + case atype.DWORD: + Byte4Radio.Checked = true; + break; + default: + break; + } + } - private void SetSignedRadio(asigned a) - { - switch (a) - { - case asigned.SIGNED: - SignedRadio.Checked = true; - break; - case asigned.UNSIGNED: - UnsignedRadio.Checked = true; - break; - case asigned.HEX: - HexRadio.Checked = true; - break; - default: - break; - } - } + private void SetSignedRadio(asigned a) + { + switch (a) + { + case asigned.SIGNED: + SignedRadio.Checked = true; + break; + case asigned.UNSIGNED: + UnsignedRadio.Checked = true; + break; + case asigned.HEX: + HexRadio.Checked = true; + break; + default: + break; + } + } - public void SetToEditWatch(Watch w, string message) - { - //Sets this dialog to Edit Watch and receives default values - this.Text = message; - customSetup = true; + public void SetToEditWatch(Watch w, string message) + { + //Sets this dialog to Edit Watch and receives default values + this.Text = message; + customSetup = true; - AddressBox.Text = string.Format("{0:X4}", w.address); - NotesBox.Text = w.notes; + AddressBox.Text = string.Format("{0:X4}", w.address); + NotesBox.Text = w.notes; - SetTypeRadio(w.type); - SetSignedRadio(w.signed); - - if (w.bigendian == true) - BigEndianRadio.Checked = true; - else - LittleEndianRadio.Checked = true; - } + SetTypeRadio(w.type); + SetSignedRadio(w.signed); - private void RamWatchNewWatch_Load(object sender, EventArgs e) - { - if (!customSetup) - { - Watch w = new Watch(); - SetTypeRadio(w.type); - SetSignedRadio(w.signed); + if (w.bigendian == true) + BigEndianRadio.Checked = true; + else + LittleEndianRadio.Checked = true; + } - AddressBox.Text = "0000"; + private void RamWatchNewWatch_Load(object sender, EventArgs e) + { + if (!customSetup) + { + Watch w = new Watch(); + SetTypeRadio(w.type); + SetSignedRadio(w.signed); - if (w.bigendian == true) - BigEndianRadio.Checked = true; - else - LittleEndianRadio.Checked = true; - } - if (location.X > 0 && location.Y > 0) - this.Location = location; - } + AddressBox.Text = "0000"; - private void Cancel_Click(object sender, EventArgs e) - { - userSelected = false; - this.Close(); - } + if (w.bigendian == true) + BigEndianRadio.Checked = true; + else + LittleEndianRadio.Checked = true; + } + if (location.X > 0 && location.Y > 0) + this.Location = location; + } - private void OK_Click(object sender, EventArgs e) - { - //Put user settings in the watch file - userSelected = true; - if (InputValidate.IsValidHexNumber(AddressBox.Text)) - watch.address = int.Parse(AddressBox.Text, NumberStyles.HexNumber); - else - { - MessageBox.Show("Not a valid address (enter a valid Hex number)", "Invalid Address", MessageBoxButtons.OK, MessageBoxIcon.Error); - AddressBox.Focus(); - AddressBox.SelectAll(); - - return; - } + private void Cancel_Click(object sender, EventArgs e) + { + userSelected = false; + this.Close(); + } - if (SignedRadio.Checked) - watch.signed = asigned.SIGNED; - else if (UnsignedRadio.Checked) - watch.signed = asigned.UNSIGNED; - else if (HexRadio.Checked) - watch.signed = asigned.HEX; + private void OK_Click(object sender, EventArgs e) + { + //Put user settings in the watch file + userSelected = true; + if (InputValidate.IsValidHexNumber(AddressBox.Text)) + watch.address = int.Parse(AddressBox.Text, NumberStyles.HexNumber); + else + { + MessageBox.Show("Not a valid address (enter a valid Hex number)", "Invalid Address", MessageBoxButtons.OK, MessageBoxIcon.Error); + AddressBox.Focus(); + AddressBox.SelectAll(); - if (Byte1Radio.Checked) - watch.type = atype.BYTE; - else if (Byte2Radio.Checked) - watch.type = atype.WORD; - else if (Byte4Radio.Checked) - watch.type = atype.DWORD; + return; + } - if (BigEndianRadio.Checked) - watch.bigendian = true; - else if (LittleEndianRadio.Checked) - watch.bigendian = false; + if (SignedRadio.Checked) + watch.signed = asigned.SIGNED; + else if (UnsignedRadio.Checked) + watch.signed = asigned.UNSIGNED; + else if (HexRadio.Checked) + watch.signed = asigned.HEX; - watch.notes = NotesBox.Text; + if (Byte1Radio.Checked) + watch.type = atype.BYTE; + else if (Byte2Radio.Checked) + watch.type = atype.WORD; + else if (Byte4Radio.Checked) + watch.type = atype.DWORD; - this.Close(); - } + if (BigEndianRadio.Checked) + watch.bigendian = true; + else if (LittleEndianRadio.Checked) + watch.bigendian = false; - private void AddressBox_Leave(object sender, EventArgs e) - { - AddressBox.Text = AddressBox.Text.Replace(" ", ""); - if (!InputValidate.IsValidHexNumber(AddressBox.Text)) - { - AddressBox.Focus(); - AddressBox.SelectAll(); - ToolTip t = new ToolTip(); - t.Show("MUst be a valid hexadecimal vaue", AddressBox, 5000); - } - } + watch.notes = NotesBox.Text; - private void AddressBox_KeyPress(object sender, KeyPressEventArgs e) - { - if (e.KeyChar == '\b') return; + this.Close(); + } - if (!InputValidate.IsValidHexNumber(e.KeyChar)) - e.Handled = true; - } - } + private void AddressBox_Leave(object sender, EventArgs e) + { + AddressBox.Text = AddressBox.Text.Replace(" ", ""); + if (!InputValidate.IsValidHexNumber(AddressBox.Text)) + { + AddressBox.Focus(); + AddressBox.SelectAll(); + ToolTip t = new ToolTip(); + t.Show("MUst be a valid hexadecimal vaue", AddressBox, 5000); + } + } + + private void AddressBox_KeyPress(object sender, KeyPressEventArgs e) + { + if (e.KeyChar == '\b') return; + + if (!InputValidate.IsValidHexNumber(e.KeyChar)) + e.Handled = true; + } + } }