diff --git a/XQEMU-GUI/App.config b/XQEMU-GUI/App.config index 5754728..88533a3 100644 --- a/XQEMU-GUI/App.config +++ b/XQEMU-GUI/App.config @@ -1,6 +1,6 @@ - + - - - \ No newline at end of file + + + diff --git a/XQEMU-GUI/Main.Designer.cs b/XQEMU-GUI/Main.Designer.cs index 9f2ad7c..1aea6eb 100644 --- a/XQEMU-GUI/Main.Designer.cs +++ b/XQEMU-GUI/Main.Designer.cs @@ -1,4 +1,4 @@ -namespace XQEMU_GUI +namespace xqemu_gui { partial class Main { @@ -41,6 +41,7 @@ private void InitializeComponent() this.lblLoaded = new System.Windows.Forms.Label(); this.openISODialog = new System.Windows.Forms.OpenFileDialog(); this.messageQueue1 = new System.Messaging.MessageQueue(); + this.ejectISOToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.mstMain.SuspendLayout(); this.SuspendLayout(); // @@ -58,6 +59,7 @@ private void InitializeComponent() // this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.menuOpenFile, + this.ejectISOToolStripMenuItem, this.menuExit}); this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); @@ -67,7 +69,7 @@ private void InitializeComponent() // this.menuOpenFile.Name = "menuOpenFile"; this.menuOpenFile.ShortcutKeys = System.Windows.Forms.Keys.F7; - this.menuOpenFile.Size = new System.Drawing.Size(179, 22); + this.menuOpenFile.Size = new System.Drawing.Size(180, 22); this.menuOpenFile.Text = "Open ISO image"; this.menuOpenFile.Click += new System.EventHandler(this.MenuOpenFile_Click); // @@ -75,7 +77,7 @@ private void InitializeComponent() // this.menuExit.Name = "menuExit"; this.menuExit.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.F4))); - this.menuExit.Size = new System.Drawing.Size(179, 22); + this.menuExit.Size = new System.Drawing.Size(180, 22); this.menuExit.Text = "Exit"; this.menuExit.Click += new System.EventHandler(this.MenuExit_Click); // @@ -93,18 +95,19 @@ private void InitializeComponent() // this.menuSkipAnimation.CheckOnClick = true; this.menuSkipAnimation.Name = "menuSkipAnimation"; - this.menuSkipAnimation.Size = new System.Drawing.Size(178, 22); + this.menuSkipAnimation.Size = new System.Drawing.Size(180, 22); this.menuSkipAnimation.Text = "Skip Bootanimation"; + this.menuSkipAnimation.Click += new System.EventHandler(this.MenuSkipAnimation_Click); // // toolStripSeparator1 // this.toolStripSeparator1.Name = "toolStripSeparator1"; - this.toolStripSeparator1.Size = new System.Drawing.Size(175, 6); + this.toolStripSeparator1.Size = new System.Drawing.Size(177, 6); // // menuOptions // this.menuOptions.Name = "menuOptions"; - this.menuOptions.Size = new System.Drawing.Size(178, 22); + this.menuOptions.Size = new System.Drawing.Size(180, 22); this.menuOptions.Text = "Options"; this.menuOptions.Click += new System.EventHandler(this.MenuOptions_Click); // @@ -143,6 +146,14 @@ private void InitializeComponent() this.messageQueue1.MessageReadPropertyFilter.LookupId = true; this.messageQueue1.SynchronizingObject = this; // + // ejectISOToolStripMenuItem + // + this.ejectISOToolStripMenuItem.Name = "ejectISOToolStripMenuItem"; + this.ejectISOToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F8; + this.ejectISOToolStripMenuItem.Size = new System.Drawing.Size(180, 22); + this.ejectISOToolStripMenuItem.Text = "Eject ISO"; + this.ejectISOToolStripMenuItem.Click += new System.EventHandler(this.EjectISOToolStripMenuItem_Click); + // // Main // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -179,6 +190,7 @@ private void InitializeComponent() private System.Windows.Forms.ToolStripMenuItem menuSkipAnimation; private System.Windows.Forms.OpenFileDialog openISODialog; private System.Messaging.MessageQueue messageQueue1; + private System.Windows.Forms.ToolStripMenuItem ejectISOToolStripMenuItem; } } diff --git a/XQEMU-GUI/Main.cs b/XQEMU-GUI/Main.cs index 3add0d7..75f6e04 100644 --- a/XQEMU-GUI/Main.cs +++ b/XQEMU-GUI/Main.cs @@ -4,13 +4,15 @@ using System.Windows.Forms; using Nini.Config; -namespace XQEMU_GUI +namespace xqemu_gui { public partial class Main : Form { private IniConfigSource configSource; - private IConfig config; + private IConfig configGeneral; + private IConfig configController; string selectedISO = ""; + bool skipAnim = false; public Main() { @@ -18,8 +20,11 @@ public Main() LoadConfigs(); - selectedISO = config.GetString("Recent_ISO", ""); - if (selectedISO.Length > 0) lblLoaded.Text = selectedISO; + selectedISO = configGeneral.GetString("Recent_ISO", ""); + lblLoaded.Text = selectedISO.Length > 0 ? selectedISO : "No ISO selected. This will launch the XBox Dashboard."; + + skipAnim = configGeneral.GetBoolean("Skip_Animation", false); + menuSkipAnimation.Checked = skipAnim; } private void MenuOptions_Click(object sender, EventArgs e) @@ -40,7 +45,7 @@ private void Form_Close(object sender, FormClosedEventArgs e) private void MenuOpenFile_Click(object sender, EventArgs e) { - string tempGamesFolder = config.GetString("Games_Folder", ""); + string tempGamesFolder = configGeneral.GetString("Games_Folder", ""); openISODialog.InitialDirectory = selectedISO.Length > 0 ? Path.GetDirectoryName(selectedISO) @@ -52,7 +57,7 @@ private void MenuOpenFile_Click(object sender, EventArgs e) { selectedISO = openISODialog.FileName; lblLoaded.Text = selectedISO; - config.Set("Recent_ISO", selectedISO); + configGeneral.Set("Recent_ISO", selectedISO); configSource.Save(); } } @@ -68,27 +73,54 @@ private void LoadConfigs() if (configSource.Configs["default"] != null) { - config = configSource.Configs["default"]; + configGeneral = configSource.Configs["default"]; + } + else + { + SetDefaultGeneral(configSource); + } + + if (configSource.Configs["controller"] != null) + { + configController = configSource.Configs["controller"]; } else { - SetDefault(configSource); + SetDefaultController(configSource); } } - private void SetDefault(IniConfigSource configSource) + private void SetDefaultGeneral(IniConfigSource configSource) { if (configSource.Configs["default"] == null) configSource.AddConfig("default"); - config = configSource.Configs["default"]; + configGeneral = configSource.Configs["default"]; - config.Set("Recent_ISO", ""); + configGeneral.Set("Recent_ISO", ""); + configGeneral.Set("Skip_Animation", false); + configGeneral.Set("Games_Folder", ""); + configGeneral.Set("MCPX", ""); + configGeneral.Set("BIOS", ""); + configGeneral.Set("HDD", ""); + configSource.Save(); + } + + private void SetDefaultController(IniConfigSource configSource) + { + if (configSource.Configs["controller"] == null) configSource.AddConfig("controller"); + + configController = configSource.Configs["controller"]; + + configController.Set("Controller1", 1); + configController.Set("Controller2", 0); + configController.Set("Controller3", 0); + configController.Set("Controller4", 0); configSource.Save(); } private void BtnStart_Click(object sender, EventArgs e) { - string MCPX = config.GetString("MCPX", ""); + string MCPX = configGeneral.GetString("MCPX", ""); if (MCPX.Length == 0) { MessageBox.Show( @@ -99,7 +131,7 @@ private void BtnStart_Click(object sender, EventArgs e) return; } - string BIOS = config.GetString("BIOS", ""); + string BIOS = configGeneral.GetString("BIOS", ""); if (BIOS.Length == 0) { MessageBox.Show( @@ -110,7 +142,7 @@ private void BtnStart_Click(object sender, EventArgs e) return; } - string HDD = config.GetString("HDD", ""); + string HDD = configGeneral.GetString("HDD", ""); if (HDD.Length == 0) { MessageBox.Show( @@ -121,18 +153,16 @@ private void BtnStart_Click(object sender, EventArgs e) return; } + bool launchDash = false; if (selectedISO.Length == 0) { - MessageBox.Show( - "No ISO seleced. Please open one!", - "No ISO selected", - MessageBoxButtons.OK, - MessageBoxIcon.Error); - return; + launchDash = true; } string skipAnims = menuSkipAnimation.Checked ? ",short-animation" : ""; + string usb = BuildUSBInput(); + Process xqemu = new Process(); xqemu.StartInfo.FileName = @".\xqemu.exe"; xqemu.StartInfo.Arguments = " -cpu pentium3" @@ -140,8 +170,8 @@ private void BtnStart_Click(object sender, EventArgs e) + " -m 64" + $" -bios \"{BIOS.Replace(@"\", @"\\")}\"" + $" -drive index=0,media=disk,file={HDD.Replace(@"\", @"\\")},locked" - + $" -drive index=1,media=cdrom,file={selectedISO.Replace(@"\", @"\\")}" - + " -usb -device usb-xbox-gamepad"; + + " -drive index=1,media=cdrom," + ( launchDash ? "" : $"file={selectedISO.Replace(@"\", @"\\")}" ) + + $" -usb{usb}"; xqemu.Start(); } @@ -164,5 +194,58 @@ private void Main_Shown(object sender, EventArgs e) } } } + + private void MenuSkipAnimation_Click(object sender, EventArgs e) + { + configGeneral.Set("Skip_Animation", menuSkipAnimation.Checked); + configSource.Save(); + } + + private string BuildUSBInput() + { + string build = ""; + string[] magicTable = { "", "usb-host", "usb-xbox-gamepad-sdl", "usb-xbox-gamepad" }; + + int[] controllers = { + configController.GetInt("Controller3", 0) > 3 ? 0 : configController.GetInt("Controller3", 0), + configController.GetInt("Controller4", 0) > 3 ? 0 : configController.GetInt("Controller4", 0), + configController.GetInt("Controller1", 1) > 3 ? 1 : configController.GetInt("Controller1", 1), + configController.GetInt("Controller2", 0) > 3 ? 0 : configController.GetInt("Controller2", 0), + }; + + int sdlIndex = 0; + int port = 0; + + foreach (int controller in controllers) + { + ++port; + switch (controller) + { + case 1: + continue; //build support for usb passthrough of original xbox controller + case 2: + build += $" -device {magicTable[controller]},index={sdlIndex},port={port}"; + ++sdlIndex; + break; + case 3: + build += $" -device {magicTable[controller]},port={port}"; + break; + default: + continue; + } + } + + if (build == "") build += "-device usb-xbox-gamepad,port=3"; + + return build; + } + + private void EjectISOToolStripMenuItem_Click(object sender, EventArgs e) + { + selectedISO = ""; + lblLoaded.Text = "No ISO selected. This will launch the XBox Dashboard."; + configGeneral.Set("Recent_ISO", selectedISO); + configSource.Save(); + } } } diff --git a/XQEMU-GUI/Options.Designer.cs b/XQEMU-GUI/Options.Designer.cs index b69c20c..e0e79ad 100644 --- a/XQEMU-GUI/Options.Designer.cs +++ b/XQEMU-GUI/Options.Designer.cs @@ -1,4 +1,4 @@ -namespace XQEMU_GUI +namespace xqemu_gui { partial class Options { @@ -46,14 +46,28 @@ private void InitializeComponent() this.selectGamesFolderDialog = new System.Windows.Forms.FolderBrowserDialog(); this.openBIOSDialog = new System.Windows.Forms.OpenFileDialog(); this.openHDDDialog = new System.Windows.Forms.OpenFileDialog(); + this.tctOptions = new System.Windows.Forms.TabControl(); + this.tabInput = new System.Windows.Forms.TabPage(); + this.cbxController4 = new System.Windows.Forms.ComboBox(); + this.cbxController3 = new System.Windows.Forms.ComboBox(); + this.cbxController2 = new System.Windows.Forms.ComboBox(); + this.cbxController1 = new System.Windows.Forms.ComboBox(); + this.lblController1 = new System.Windows.Forms.Label(); + this.lblController4 = new System.Windows.Forms.Label(); + this.lblController3 = new System.Windows.Forms.Label(); + this.lblController2 = new System.Windows.Forms.Label(); + this.tabGeneral = new System.Windows.Forms.TabPage(); + this.tctOptions.SuspendLayout(); + this.tabInput.SuspendLayout(); + this.tabGeneral.SuspendLayout(); this.SuspendLayout(); // // tbxGamesPath // - this.tbxGamesPath.Location = new System.Drawing.Point(12, 25); + this.tbxGamesPath.Location = new System.Drawing.Point(18, 33); this.tbxGamesPath.Name = "tbxGamesPath"; this.tbxGamesPath.Size = new System.Drawing.Size(190, 20); - this.tbxGamesPath.TabIndex = 0; + this.tbxGamesPath.TabIndex = 1; // // btnGamesSelect // @@ -62,10 +76,10 @@ private void InitializeComponent() | System.Windows.Forms.AnchorStyles.Right))); this.btnGamesSelect.AutoSize = true; this.btnGamesSelect.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.btnGamesSelect.Location = new System.Drawing.Point(208, 23); + this.btnGamesSelect.Location = new System.Drawing.Point(214, 31); this.btnGamesSelect.Name = "btnGamesSelect"; this.btnGamesSelect.Size = new System.Drawing.Size(26, 23); - this.btnGamesSelect.TabIndex = 1; + this.btnGamesSelect.TabIndex = 2; this.btnGamesSelect.Text = "..."; this.btnGamesSelect.UseVisualStyleBackColor = true; this.btnGamesSelect.Click += new System.EventHandler(this.BtnGamesSelect_Click); @@ -73,7 +87,7 @@ private void InitializeComponent() // lblGamesPath // this.lblGamesPath.AutoSize = true; - this.lblGamesPath.Location = new System.Drawing.Point(12, 9); + this.lblGamesPath.Location = new System.Drawing.Point(18, 17); this.lblGamesPath.Name = "lblGamesPath"; this.lblGamesPath.Size = new System.Drawing.Size(69, 13); this.lblGamesPath.TabIndex = 99; @@ -82,7 +96,7 @@ private void InitializeComponent() // lblMCPXPath // this.lblMCPXPath.AutoSize = true; - this.lblMCPXPath.Location = new System.Drawing.Point(12, 59); + this.lblMCPXPath.Location = new System.Drawing.Point(18, 67); this.lblMCPXPath.Name = "lblMCPXPath"; this.lblMCPXPath.Size = new System.Drawing.Size(56, 13); this.lblMCPXPath.TabIndex = 99; @@ -95,25 +109,25 @@ private void InitializeComponent() | System.Windows.Forms.AnchorStyles.Right))); this.btnMCPXSelect.AutoSize = true; this.btnMCPXSelect.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.btnMCPXSelect.Location = new System.Drawing.Point(208, 73); + this.btnMCPXSelect.Location = new System.Drawing.Point(214, 81); this.btnMCPXSelect.Name = "btnMCPXSelect"; this.btnMCPXSelect.Size = new System.Drawing.Size(26, 23); - this.btnMCPXSelect.TabIndex = 3; + this.btnMCPXSelect.TabIndex = 4; this.btnMCPXSelect.Text = "..."; this.btnMCPXSelect.UseVisualStyleBackColor = true; this.btnMCPXSelect.Click += new System.EventHandler(this.BtnMCPXSelect_Click); // // tbxMCPXPath // - this.tbxMCPXPath.Location = new System.Drawing.Point(12, 75); + this.tbxMCPXPath.Location = new System.Drawing.Point(18, 83); this.tbxMCPXPath.Name = "tbxMCPXPath"; this.tbxMCPXPath.Size = new System.Drawing.Size(190, 20); - this.tbxMCPXPath.TabIndex = 2; + this.tbxMCPXPath.TabIndex = 3; // // lblBIOSPath // this.lblBIOSPath.AutoSize = true; - this.lblBIOSPath.Location = new System.Drawing.Point(12, 110); + this.lblBIOSPath.Location = new System.Drawing.Point(18, 118); this.lblBIOSPath.Name = "lblBIOSPath"; this.lblBIOSPath.Size = new System.Drawing.Size(51, 13); this.lblBIOSPath.TabIndex = 99; @@ -126,25 +140,25 @@ private void InitializeComponent() | System.Windows.Forms.AnchorStyles.Right))); this.btnBIOSSelect.AutoSize = true; this.btnBIOSSelect.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.btnBIOSSelect.Location = new System.Drawing.Point(208, 124); + this.btnBIOSSelect.Location = new System.Drawing.Point(214, 132); this.btnBIOSSelect.Name = "btnBIOSSelect"; this.btnBIOSSelect.Size = new System.Drawing.Size(26, 23); - this.btnBIOSSelect.TabIndex = 5; + this.btnBIOSSelect.TabIndex = 6; this.btnBIOSSelect.Text = "..."; this.btnBIOSSelect.UseVisualStyleBackColor = true; this.btnBIOSSelect.Click += new System.EventHandler(this.BtnBIOSSelect_Click); // // tbxBIOSPath // - this.tbxBIOSPath.Location = new System.Drawing.Point(12, 126); + this.tbxBIOSPath.Location = new System.Drawing.Point(18, 134); this.tbxBIOSPath.Name = "tbxBIOSPath"; this.tbxBIOSPath.Size = new System.Drawing.Size(190, 20); - this.tbxBIOSPath.TabIndex = 4; + this.tbxBIOSPath.TabIndex = 5; // // label1 // this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(12, 160); + this.label1.Location = new System.Drawing.Point(18, 168); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(63, 13); this.label1.TabIndex = 99; @@ -157,27 +171,27 @@ private void InitializeComponent() | System.Windows.Forms.AnchorStyles.Right))); this.btnHDDSelect.AutoSize = true; this.btnHDDSelect.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; - this.btnHDDSelect.Location = new System.Drawing.Point(208, 174); + this.btnHDDSelect.Location = new System.Drawing.Point(214, 182); this.btnHDDSelect.Name = "btnHDDSelect"; this.btnHDDSelect.Size = new System.Drawing.Size(26, 23); - this.btnHDDSelect.TabIndex = 7; + this.btnHDDSelect.TabIndex = 8; this.btnHDDSelect.Text = "..."; this.btnHDDSelect.UseVisualStyleBackColor = true; this.btnHDDSelect.Click += new System.EventHandler(this.BtnHDDSelect_Click); // // tbxHDDPath // - this.tbxHDDPath.Location = new System.Drawing.Point(12, 176); + this.tbxHDDPath.Location = new System.Drawing.Point(18, 184); this.tbxHDDPath.Name = "tbxHDDPath"; this.tbxHDDPath.Size = new System.Drawing.Size(190, 20); - this.tbxHDDPath.TabIndex = 6; + this.tbxHDDPath.TabIndex = 7; // // btnSave // - this.btnSave.Location = new System.Drawing.Point(159, 205); + this.btnSave.Location = new System.Drawing.Point(170, 251); this.btnSave.Name = "btnSave"; this.btnSave.Size = new System.Drawing.Size(75, 23); - this.btnSave.TabIndex = 8; + this.btnSave.TabIndex = 9; this.btnSave.Text = "Save"; this.btnSave.UseVisualStyleBackColor = true; this.btnSave.Click += new System.EventHandler(this.BtnSave_Click); @@ -198,30 +212,165 @@ private void InitializeComponent() this.openHDDDialog.Filter = "XBox HDD image (*.qcow2)|*.qcow2"; this.openHDDDialog.Title = "Open HDD image"; // + // tctOptions + // + this.tctOptions.Controls.Add(this.tabInput); + this.tctOptions.Controls.Add(this.tabGeneral); + this.tctOptions.Location = new System.Drawing.Point(1, 0); + this.tctOptions.Name = "tctOptions"; + this.tctOptions.SelectedIndex = 0; + this.tctOptions.Size = new System.Drawing.Size(268, 245); + this.tctOptions.TabIndex = 0; + // + // tabInput + // + this.tabInput.Controls.Add(this.cbxController4); + this.tabInput.Controls.Add(this.cbxController3); + this.tabInput.Controls.Add(this.cbxController2); + this.tabInput.Controls.Add(this.cbxController1); + this.tabInput.Controls.Add(this.lblController1); + this.tabInput.Controls.Add(this.lblController4); + this.tabInput.Controls.Add(this.lblController3); + this.tabInput.Controls.Add(this.lblController2); + this.tabInput.Location = new System.Drawing.Point(4, 22); + this.tabInput.Name = "tabInput"; + this.tabInput.Padding = new System.Windows.Forms.Padding(3); + this.tabInput.Size = new System.Drawing.Size(260, 219); + this.tabInput.TabIndex = 2; + this.tabInput.Text = "Input"; + this.tabInput.UseVisualStyleBackColor = true; + // + // cbxController4 + // + this.cbxController4.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cbxController4.FormattingEnabled = true; + this.cbxController4.Items.AddRange(new object[] { + "(None)", + "Original XBox Controller", + "XBox360, DS4 Controller", + "Keyboard"}); + this.cbxController4.Location = new System.Drawing.Point(18, 183); + this.cbxController4.Name = "cbxController4"; + this.cbxController4.Size = new System.Drawing.Size(190, 21); + this.cbxController4.TabIndex = 4; + // + // cbxController3 + // + this.cbxController3.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cbxController3.FormattingEnabled = true; + this.cbxController3.Items.AddRange(new object[] { + "(None)", + "Original XBox Controller", + "XBox360, DS4 Controller", + "Keyboard"}); + this.cbxController3.Location = new System.Drawing.Point(18, 133); + this.cbxController3.Name = "cbxController3"; + this.cbxController3.Size = new System.Drawing.Size(190, 21); + this.cbxController3.TabIndex = 3; + // + // cbxController2 + // + this.cbxController2.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cbxController2.FormattingEnabled = true; + this.cbxController2.Items.AddRange(new object[] { + "(None)", + "Original XBox Controller", + "XBox360, DS4 Controller", + "Keyboard"}); + this.cbxController2.Location = new System.Drawing.Point(18, 83); + this.cbxController2.Name = "cbxController2"; + this.cbxController2.Size = new System.Drawing.Size(190, 21); + this.cbxController2.TabIndex = 2; + // + // cbxController1 + // + this.cbxController1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cbxController1.FormattingEnabled = true; + this.cbxController1.Items.AddRange(new object[] { + "(None)", + "Original XBox Controller", + "XBox360, DS4 Controller", + "Keyboard"}); + this.cbxController1.Location = new System.Drawing.Point(18, 32); + this.cbxController1.Name = "cbxController1"; + this.cbxController1.Size = new System.Drawing.Size(190, 21); + this.cbxController1.TabIndex = 1; + // + // lblController1 + // + this.lblController1.AutoSize = true; + this.lblController1.Location = new System.Drawing.Point(18, 17); + this.lblController1.Name = "lblController1"; + this.lblController1.Size = new System.Drawing.Size(60, 13); + this.lblController1.TabIndex = 99; + this.lblController1.Text = "Controller 1"; + // + // lblController4 + // + this.lblController4.AutoSize = true; + this.lblController4.Location = new System.Drawing.Point(18, 168); + this.lblController4.Name = "lblController4"; + this.lblController4.Size = new System.Drawing.Size(60, 13); + this.lblController4.TabIndex = 99; + this.lblController4.Text = "Controller 4"; + // + // lblController3 + // + this.lblController3.AutoSize = true; + this.lblController3.Location = new System.Drawing.Point(18, 118); + this.lblController3.Name = "lblController3"; + this.lblController3.Size = new System.Drawing.Size(60, 13); + this.lblController3.TabIndex = 99; + this.lblController3.Text = "Controller 3"; + // + // lblController2 + // + this.lblController2.AutoSize = true; + this.lblController2.Location = new System.Drawing.Point(18, 67); + this.lblController2.Name = "lblController2"; + this.lblController2.Size = new System.Drawing.Size(60, 13); + this.lblController2.TabIndex = 99; + this.lblController2.Text = "Controller 2"; + // + // tabGeneral + // + this.tabGeneral.Controls.Add(this.lblGamesPath); + this.tabGeneral.Controls.Add(this.tbxGamesPath); + this.tabGeneral.Controls.Add(this.btnGamesSelect); + this.tabGeneral.Controls.Add(this.btnBIOSSelect); + this.tabGeneral.Controls.Add(this.label1); + this.tabGeneral.Controls.Add(this.tbxBIOSPath); + this.tabGeneral.Controls.Add(this.tbxMCPXPath); + this.tabGeneral.Controls.Add(this.lblBIOSPath); + this.tabGeneral.Controls.Add(this.btnHDDSelect); + this.tabGeneral.Controls.Add(this.lblMCPXPath); + this.tabGeneral.Controls.Add(this.btnMCPXSelect); + this.tabGeneral.Controls.Add(this.tbxHDDPath); + this.tabGeneral.Location = new System.Drawing.Point(4, 22); + this.tabGeneral.Name = "tabGeneral"; + this.tabGeneral.Padding = new System.Windows.Forms.Padding(3); + this.tabGeneral.Size = new System.Drawing.Size(260, 219); + this.tabGeneral.TabIndex = 1; + this.tabGeneral.Text = "General"; + this.tabGeneral.UseVisualStyleBackColor = true; + // // Options // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(246, 240); + this.ClientSize = new System.Drawing.Size(266, 280); + this.Controls.Add(this.tctOptions); this.Controls.Add(this.btnSave); - this.Controls.Add(this.label1); - this.Controls.Add(this.btnHDDSelect); - this.Controls.Add(this.tbxHDDPath); - this.Controls.Add(this.lblBIOSPath); - this.Controls.Add(this.btnBIOSSelect); - this.Controls.Add(this.tbxBIOSPath); - this.Controls.Add(this.lblMCPXPath); - this.Controls.Add(this.btnMCPXSelect); - this.Controls.Add(this.tbxMCPXPath); - this.Controls.Add(this.lblGamesPath); - this.Controls.Add(this.btnGamesSelect); - this.Controls.Add(this.tbxGamesPath); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Name = "Options"; this.Text = "Options"; + this.tctOptions.ResumeLayout(false); + this.tabInput.ResumeLayout(false); + this.tabInput.PerformLayout(); + this.tabGeneral.ResumeLayout(false); + this.tabGeneral.PerformLayout(); this.ResumeLayout(false); - this.PerformLayout(); } @@ -243,5 +392,16 @@ private void InitializeComponent() private System.Windows.Forms.FolderBrowserDialog selectGamesFolderDialog; private System.Windows.Forms.OpenFileDialog openBIOSDialog; private System.Windows.Forms.OpenFileDialog openHDDDialog; + private System.Windows.Forms.TabControl tctOptions; + private System.Windows.Forms.TabPage tabInput; + private System.Windows.Forms.TabPage tabGeneral; + private System.Windows.Forms.ComboBox cbxController4; + private System.Windows.Forms.ComboBox cbxController3; + private System.Windows.Forms.ComboBox cbxController2; + private System.Windows.Forms.ComboBox cbxController1; + private System.Windows.Forms.Label lblController1; + private System.Windows.Forms.Label lblController4; + private System.Windows.Forms.Label lblController3; + private System.Windows.Forms.Label lblController2; } } \ No newline at end of file diff --git a/XQEMU-GUI/Options.cs b/XQEMU-GUI/Options.cs index 927cbb3..b208860 100644 --- a/XQEMU-GUI/Options.cs +++ b/XQEMU-GUI/Options.cs @@ -3,12 +3,13 @@ using System.Windows.Forms; using Nini.Config; -namespace XQEMU_GUI +namespace xqemu_gui { public partial class Options : Form { private IniConfigSource configSource; - private IConfig config; + private IConfig configGeneral; + private IConfig configController; public Options() { @@ -17,25 +18,33 @@ public Options() LoadConfigs(); - tbxGamesPath.Text = config.GetString("Games_Folder", ""); + tbxGamesPath.Text = configGeneral.GetString("Games_Folder", ""); selectGamesFolderDialog.SelectedPath = tbxGamesPath.Text.Length > 0 ? tbxGamesPath.Text : Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); - tbxMCPXPath.Text = config.GetString("MCPX", ""); + tbxMCPXPath.Text = configGeneral.GetString("MCPX", ""); openMCPXDialog.InitialDirectory = tbxMCPXPath.Text.Length > 0 ? Path.GetDirectoryName(tbxMCPXPath.Text) : Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); - tbxBIOSPath.Text = config.GetString("BIOS", ""); + tbxBIOSPath.Text = configGeneral.GetString("BIOS", ""); openBIOSDialog.InitialDirectory = tbxBIOSPath.Text.Length > 0 ? Path.GetDirectoryName(tbxBIOSPath.Text) : Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); - tbxHDDPath.Text = config.GetString("HDD", ""); + tbxHDDPath.Text = configGeneral.GetString("HDD", ""); openHDDDialog.InitialDirectory = tbxHDDPath.Text.Length > 0 ? Path.GetDirectoryName(tbxHDDPath.Text) : Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); + + cbxController1.SelectedIndex = configController.GetInt("Controller1", 1); + + cbxController2.SelectedIndex = configController.GetInt("Controller2", 0); + + cbxController3.SelectedIndex = configController.GetInt("Controller3", 0); + + cbxController4.SelectedIndex = configController.GetInt("Controller4", 0); } private void BtnGamesSelect_Click(object sender, EventArgs e) @@ -78,10 +87,14 @@ private void BtnSave_Click(object sender, EventArgs e) { VerifyPaths(); - config.Set("Games_Folder", tbxGamesPath.Text); - config.Set("MCPX", tbxMCPXPath.Text); - config.Set("BIOS", tbxBIOSPath.Text); - config.Set("HDD", tbxHDDPath.Text); + configGeneral.Set("Games_Folder", tbxGamesPath.Text); + configGeneral.Set("MCPX", tbxMCPXPath.Text); + configGeneral.Set("BIOS", tbxBIOSPath.Text); + configGeneral.Set("HDD", tbxHDDPath.Text); + configController.Set("Controller1", cbxController1.SelectedIndex); + configController.Set("Controller2", cbxController2.SelectedIndex); + configController.Set("Controller3", cbxController3.SelectedIndex); + configController.Set("Controller4", cbxController4.SelectedIndex); configSource.Save(); this.Close(); @@ -93,24 +106,48 @@ private void LoadConfigs() if (configSource.Configs["default"] != null) { - config = configSource.Configs["default"]; + configGeneral = configSource.Configs["default"]; + } + else + { + SetDefaultGeneral(configSource); + } + + if (configSource.Configs["controller"] != null) + { + configController = configSource.Configs["controller"]; } else { - SetDefault(configSource); + SetDefaultController(configSource); } } - private void SetDefault(IniConfigSource configSource) + private void SetDefaultGeneral(IniConfigSource configSource) { if (configSource.Configs["default"] == null) configSource.AddConfig("default"); - config = configSource.Configs["default"]; + configGeneral = configSource.Configs["default"]; + + configGeneral.Set("Recent_ISO", ""); + configGeneral.Set("Skip_Animation", false); + configGeneral.Set("Games_Folder", ""); + configGeneral.Set("MCPX", ""); + configGeneral.Set("BIOS", ""); + configGeneral.Set("HDD", ""); + configSource.Save(); + } + + private void SetDefaultController(IniConfigSource configSource) + { + if (configSource.Configs["controller"] == null) configSource.AddConfig("controller"); + + configController = configSource.Configs["controller"]; - config.Set("Games_Folder", ""); - config.Set("MCPX", ""); - config.Set("BIOS", ""); - config.Set("HDD", ""); + configController.Set("Controller1", 1); + configController.Set("Controller2", 0); + configController.Set("Controller3", 0); + configController.Set("Controller4", 0); configSource.Save(); } diff --git a/XQEMU-GUI/Options.resx b/XQEMU-GUI/Options.resx index c270f46..2f4577b 100644 --- a/XQEMU-GUI/Options.resx +++ b/XQEMU-GUI/Options.resx @@ -168,7 +168,37 @@ 495, 17 - + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + True diff --git a/XQEMU-GUI/Program.cs b/XQEMU-GUI/Program.cs index 4bf22c1..702eb00 100644 --- a/XQEMU-GUI/Program.cs +++ b/XQEMU-GUI/Program.cs @@ -4,7 +4,7 @@ using System.Threading.Tasks; using System.Windows.Forms; -namespace XQEMU_GUI +namespace xqemu_gui { static class Program { diff --git a/XQEMU-GUI/Properties/Resources.Designer.cs b/XQEMU-GUI/Properties/Resources.Designer.cs index 095c314..99c7f84 100644 --- a/XQEMU-GUI/Properties/Resources.Designer.cs +++ b/XQEMU-GUI/Properties/Resources.Designer.cs @@ -8,10 +8,10 @@ // //------------------------------------------------------------------------------ -namespace XQEMU_GUI.Properties -{ - - +namespace xqemu_gui.Properties { + using System; + + /// /// A strongly-typed resource class, for looking up localized strings, etc. /// @@ -19,51 +19,43 @@ namespace XQEMU_GUI.Properties // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - + internal class Resources { + private static global::System.Resources.ResourceManager resourceMan; - + private static global::System.Globalization.CultureInfo resourceCulture; - + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { + internal Resources() { } - + /// /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if ((resourceMan == null)) - { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("XQEMU_GUI.Properties.Resources", typeof(Resources).Assembly); + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("xqemu_gui.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } - + /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { + internal static global::System.Globalization.CultureInfo Culture { + get { return resourceCulture; } - set - { + set { resourceCulture = value; } } diff --git a/XQEMU-GUI/Properties/Settings.Designer.cs b/XQEMU-GUI/Properties/Settings.Designer.cs index 60471f3..a82024c 100644 --- a/XQEMU-GUI/Properties/Settings.Designer.cs +++ b/XQEMU-GUI/Properties/Settings.Designer.cs @@ -8,21 +8,17 @@ // //------------------------------------------------------------------------------ -namespace XQEMU_GUI.Properties -{ - - +namespace xqemu_gui.Properties { + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.8.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { + + public static Settings Default { + get { return defaultInstance; } } diff --git a/XQEMU-GUI/XQEMU-GUI.csproj b/XQEMU-GUI/XQEMU-GUI.csproj index 1022849..da6f091 100644 --- a/XQEMU-GUI/XQEMU-GUI.csproj +++ b/XQEMU-GUI/XQEMU-GUI.csproj @@ -6,12 +6,14 @@ AnyCPU {0F649D8A-7F5E-4DCE-912A-D52EF4C353A5} WinExe - XQEMU_GUI - XQEMU-GUI + xqemu_gui + xqemu-gui v4.7.2 512 true true + + AnyCPU @@ -22,6 +24,7 @@ DEBUG;TRACE prompt 4 + false AnyCPU @@ -31,6 +34,7 @@ TRACE prompt 4 + false icon.ico @@ -82,6 +86,7 @@ True Resources.resx + True