diff --git a/BizHawk.MultiClient/Config.cs b/BizHawk.MultiClient/Config.cs index 51d1d70db3..b7a762399d 100644 --- a/BizHawk.MultiClient/Config.cs +++ b/BizHawk.MultiClient/Config.cs @@ -29,10 +29,10 @@ namespace BizHawk.MultiClient GenesisController[0] = new GenControllerTemplate(true); GenesisAutoController[0] = new GenControllerTemplate(false); - Atari2600Controller[0] = new Atari2600ControllerTemplate(true); - Atari2600Controller[1] = new Atari2600ControllerTemplate(false); - Atari2600AutoController[0] = new Atari2600ControllerTemplate(false); - Atari2600AutoController[1] = new Atari2600ControllerTemplate(false); + Atari2600Controller[0] = new SingleButtonJoyStickTemplate(true); + Atari2600Controller[1] = new SingleButtonJoyStickTemplate(false); + Atari2600AutoController[0] = new SingleButtonJoyStickTemplate(false); + Atari2600AutoController[1] = new SingleButtonJoyStickTemplate(false); Atari2600ConsoleButtons[0] = new Atari2600ConsoleButtonsTemplate(true); NESAutoController[0] = new NESControllerTemplate(false); @@ -56,6 +56,11 @@ namespace BizHawk.MultiClient ColecoController = new ColecoVisionControllerTemplate(true); + C64Joysticks[0] = new SingleButtonJoyStickTemplate(true); + C64Joysticks[1] = new SingleButtonJoyStickTemplate(false); + C64AutoJoysticks[0] = new SingleButtonJoyStickTemplate(false); + C64AutoJoysticks[1] = new SingleButtonJoyStickTemplate(false); + NESConsoleButtons = new NESConsoleButtonTemplate(); SNESConsoleButtons = new NESConsoleButtonTemplate(); SMSConsoleButtons = new SMSConsoleButtonTemplate(); @@ -654,8 +659,8 @@ namespace BizHawk.MultiClient public GenConsoleButtonTemplate GenesisConsoleButtons = new GenConsoleButtonTemplate(); //Atari 2600 Settings - public Atari2600ControllerTemplate[] Atari2600Controller = new Atari2600ControllerTemplate[2]; - public Atari2600ControllerTemplate[] Atari2600AutoController = new Atari2600ControllerTemplate[2]; + public SingleButtonJoyStickTemplate[] Atari2600Controller = new SingleButtonJoyStickTemplate[2]; + public SingleButtonJoyStickTemplate[] Atari2600AutoController = new SingleButtonJoyStickTemplate[2]; public Atari2600ConsoleButtonsTemplate[] Atari2600ConsoleButtons = new Atari2600ConsoleButtonsTemplate[1]; public bool Atari2600_BW = false; public bool Atari2600_LeftDifficulty = true; @@ -686,6 +691,10 @@ namespace BizHawk.MultiClient public string GB_PaletteFile = ""; public bool GB_AsSGB = false; + //Commodore 64 Settings + public SingleButtonJoyStickTemplate[] C64Joysticks = new SingleButtonJoyStickTemplate[2]; + public SingleButtonJoyStickTemplate[] C64AutoJoysticks = new SingleButtonJoyStickTemplate[2]; + //GIF Animator Settings public int GifAnimatorNumFrames; public int GifAnimatorFrameSkip; @@ -979,7 +988,7 @@ namespace BizHawk.MultiClient } } - public class Atari2600ControllerTemplate + public class SingleButtonJoyStickTemplate { public string Up = ""; public string Down = ""; @@ -988,8 +997,8 @@ namespace BizHawk.MultiClient public string Button = ""; public bool Enabled; - public Atari2600ControllerTemplate() { } - public Atari2600ControllerTemplate(bool defaults) + public SingleButtonJoyStickTemplate() { } + public SingleButtonJoyStickTemplate(bool defaults) { if (defaults) { diff --git a/BizHawk.MultiClient/Global.cs b/BizHawk.MultiClient/Global.cs index d844200e5f..38b2ffee49 100644 --- a/BizHawk.MultiClient/Global.cs +++ b/BizHawk.MultiClient/Global.cs @@ -33,6 +33,7 @@ namespace BizHawk.MultiClient public static Controller Atari2600Controls; public static Controller NullControls; public static Controller ColecoControls; + public static Controller Commodore64Controls; public static CheatList CheatList; public static AutofireController AutofireNullControls; @@ -43,6 +44,7 @@ namespace BizHawk.MultiClient public static AutofireController AutofireGBControls; public static AutofireController AutofireGenControls; public static AutofireController AutofireAtari2600Controls; + public static AutofireController AutofireCommodore64Controls; public static readonly Dictionary> BUTTONS = new Dictionary>() { diff --git a/BizHawk.MultiClient/MainForm.cs b/BizHawk.MultiClient/MainForm.cs index d79ae550a7..afc883c638 100644 --- a/BizHawk.MultiClient/MainForm.cs +++ b/BizHawk.MultiClient/MainForm.cs @@ -1022,6 +1022,35 @@ namespace BizHawk.MultiClient TI83Controls.BindMulti("MODE", Global.Config.TI83Controller[0].MODE); TI83Controls.BindMulti("DEL", Global.Config.TI83Controller[0].DEL); Global.TI83Controls = TI83Controls; + + var CommodoreControls = new Controller(C64.C64ControllerDefinition); + CommodoreControls.BindMulti("P1 Up", Global.Config.C64Joysticks[0].Up); + CommodoreControls.BindMulti("P1 Left", Global.Config.C64Joysticks[0].Left); + CommodoreControls.BindMulti("P1 Right", Global.Config.C64Joysticks[0].Right); + CommodoreControls.BindMulti("P1 Down", Global.Config.C64Joysticks[0].Down); + CommodoreControls.BindMulti("P1 Button", Global.Config.C64Joysticks[0].Button); + + CommodoreControls.BindMulti("P2 Up", Global.Config.C64Joysticks[1].Up); + CommodoreControls.BindMulti("P2 Left", Global.Config.C64Joysticks[1].Left); + CommodoreControls.BindMulti("P2 Right", Global.Config.C64Joysticks[1].Right); + CommodoreControls.BindMulti("P2 Down", Global.Config.C64Joysticks[1].Down); + CommodoreControls.BindMulti("P2 Button", Global.Config.C64Joysticks[1].Button); + Global.Commodore64Controls = CommodoreControls; + + var autofireC64Controls = new AutofireController(C64.C64ControllerDefinition); + autofireC64Controls.BindMulti("P1 Up", Global.Config.C64AutoJoysticks[0].Up); + autofireC64Controls.BindMulti("P1 Left", Global.Config.C64AutoJoysticks[0].Left); + autofireC64Controls.BindMulti("P1 Right", Global.Config.C64AutoJoysticks[0].Right); + autofireC64Controls.BindMulti("P1 Down", Global.Config.C64AutoJoysticks[0].Down); + autofireC64Controls.BindMulti("P1 Button", Global.Config.C64AutoJoysticks[0].Button); + + autofireC64Controls.BindMulti("P2 Up", Global.Config.C64AutoJoysticks[1].Up); + autofireC64Controls.BindMulti("P2 Left", Global.Config.C64AutoJoysticks[1].Left); + autofireC64Controls.BindMulti("P2 Right", Global.Config.C64AutoJoysticks[1].Right); + autofireC64Controls.BindMulti("P2 Down", Global.Config.C64AutoJoysticks[1].Down); + autofireC64Controls.BindMulti("P2 Button", Global.Config.C64AutoJoysticks[1].Button); + + Global.AutofireAtari2600Controls = autofireC64Controls; } private static void FormDragEnter(object sender, DragEventArgs e) @@ -1336,6 +1365,10 @@ namespace BizHawk.MultiClient case "COLV": Global.ActiveController = Global.ColecoControls; break; + case "C64": + Global.ActiveController = Global.Commodore64Controls; + Global.AutoFireController = Global.AutofireCommodore64Controls; + break; default: Global.ActiveController = Global.NullControls; break; diff --git a/BizHawk.MultiClient/config/ControllerConfig.Designer.cs b/BizHawk.MultiClient/config/ControllerConfig.Designer.cs index 97fb084a9a..b879fada41 100644 --- a/BizHawk.MultiClient/config/ControllerConfig.Designer.cs +++ b/BizHawk.MultiClient/config/ControllerConfig.Designer.cs @@ -126,6 +126,7 @@ this.GBController1Panel = new BizHawk.MultiClient.ControllerConfigPanel(); this.GBAutofire1Panel = new BizHawk.MultiClient.ControllerConfigPanel(); this.GenesisController1Panel = new BizHawk.MultiClient.ControllerConfigPanel(); + this.GenesisConsoleButtons = new BizHawk.MultiClient.ControllerConfigPanel(); this.GenesisAutofire1Panel = new BizHawk.MultiClient.ControllerConfigPanel(); this.SMSController1Panel = new BizHawk.MultiClient.ControllerConfigPanel(); this.SMSController2Panel = new BizHawk.MultiClient.ControllerConfigPanel(); @@ -148,7 +149,12 @@ this.Atari2600Autofire1Panel = new BizHawk.MultiClient.ControllerConfigPanel(); this.Atari2600Autofire2Panel = new BizHawk.MultiClient.ControllerConfigPanel(); this.TI83ControllerPanel = new BizHawk.MultiClient.ControllerConfigPanel(); - this.GenesisConsoleButtons = new BizHawk.MultiClient.ControllerConfigPanel(); + this.tabPage10 = new System.Windows.Forms.TabPage(); + this.tabPage11 = new System.Windows.Forms.TabPage(); + this.C64Controller1Panel = new BizHawk.MultiClient.ControllerConfigPanel(); + this.C64Controller2Panel = new BizHawk.MultiClient.ControllerConfigPanel(); + this.C64Autofire1Panel = new BizHawk.MultiClient.ControllerConfigPanel(); + this.C64Autofire2Panel = new BizHawk.MultiClient.ControllerConfigPanel(); this.tabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.ControllerImage)).BeginInit(); @@ -216,8 +222,12 @@ this.tabPage58.SuspendLayout(); this.tabPage7.SuspendLayout(); this.tabControl8.SuspendLayout(); + this.tabPage49.SuspendLayout(); + this.tabPage50.SuspendLayout(); this.tabPage8.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox7)).BeginInit(); + this.tabPage10.SuspendLayout(); + this.tabPage11.SuspendLayout(); this.SuspendLayout(); // // tabControl1 @@ -998,37 +1008,41 @@ this.tabPage7.Name = "tabPage7"; this.tabPage7.Size = new System.Drawing.Size(787, 425); this.tabPage7.TabIndex = 6; - this.tabPage7.Text = "Int. V"; + this.tabPage7.Text = "C64"; this.tabPage7.UseVisualStyleBackColor = true; // // tabControl8 // this.tabControl8.Controls.Add(this.tabPage49); this.tabControl8.Controls.Add(this.tabPage50); - this.tabControl8.Location = new System.Drawing.Point(46, 38); + this.tabControl8.Controls.Add(this.tabPage10); + this.tabControl8.Controls.Add(this.tabPage11); + this.tabControl8.Location = new System.Drawing.Point(15, 15); this.tabControl8.Name = "tabControl8"; this.tabControl8.SelectedIndex = 0; - this.tabControl8.Size = new System.Drawing.Size(200, 100); + this.tabControl8.Size = new System.Drawing.Size(540, 387); this.tabControl8.TabIndex = 0; // // tabPage49 // + this.tabPage49.Controls.Add(this.C64Controller1Panel); this.tabPage49.Location = new System.Drawing.Point(4, 22); this.tabPage49.Name = "tabPage49"; this.tabPage49.Padding = new System.Windows.Forms.Padding(3); - this.tabPage49.Size = new System.Drawing.Size(192, 74); + this.tabPage49.Size = new System.Drawing.Size(532, 361); this.tabPage49.TabIndex = 0; - this.tabPage49.Text = "tabPage49"; + this.tabPage49.Text = "Joy 1"; this.tabPage49.UseVisualStyleBackColor = true; // // tabPage50 // + this.tabPage50.Controls.Add(this.C64Controller2Panel); this.tabPage50.Location = new System.Drawing.Point(4, 22); this.tabPage50.Name = "tabPage50"; this.tabPage50.Padding = new System.Windows.Forms.Padding(3); - this.tabPage50.Size = new System.Drawing.Size(192, 74); + this.tabPage50.Size = new System.Drawing.Size(532, 361); this.tabPage50.TabIndex = 1; - this.tabPage50.Text = "tabPage50"; + this.tabPage50.Text = "Joy 2"; this.tabPage50.UseVisualStyleBackColor = true; // // tabPage8 @@ -1246,6 +1260,13 @@ this.GenesisController1Panel.Size = new System.Drawing.Size(392, 332); this.GenesisController1Panel.TabIndex = 1; // + // GenesisConsoleButtons + // + this.GenesisConsoleButtons.Location = new System.Drawing.Point(13, 14); + this.GenesisConsoleButtons.Name = "GenesisConsoleButtons"; + this.GenesisConsoleButtons.Size = new System.Drawing.Size(368, 125); + this.GenesisConsoleButtons.TabIndex = 1; + // // GenesisAutofire1Panel // this.GenesisAutofire1Panel.Location = new System.Drawing.Point(21, 21); @@ -1403,12 +1424,53 @@ this.TI83ControllerPanel.Size = new System.Drawing.Size(567, 414); this.TI83ControllerPanel.TabIndex = 1; // - // GenesisConsoleButtons + // tabPage10 // - this.GenesisConsoleButtons.Location = new System.Drawing.Point(13, 14); - this.GenesisConsoleButtons.Name = "GenesisConsoleButtons"; - this.GenesisConsoleButtons.Size = new System.Drawing.Size(368, 125); - this.GenesisConsoleButtons.TabIndex = 1; + this.tabPage10.Controls.Add(this.C64Autofire1Panel); + this.tabPage10.Location = new System.Drawing.Point(4, 22); + this.tabPage10.Name = "tabPage10"; + this.tabPage10.Size = new System.Drawing.Size(532, 361); + this.tabPage10.TabIndex = 2; + this.tabPage10.Text = "Autojoy 1"; + this.tabPage10.UseVisualStyleBackColor = true; + // + // tabPage11 + // + this.tabPage11.Controls.Add(this.C64Autofire2Panel); + this.tabPage11.Location = new System.Drawing.Point(4, 22); + this.tabPage11.Name = "tabPage11"; + this.tabPage11.Size = new System.Drawing.Size(532, 361); + this.tabPage11.TabIndex = 3; + this.tabPage11.Text = "Autojoy 2"; + this.tabPage11.UseVisualStyleBackColor = true; + // + // C64Controller1Panel + // + this.C64Controller1Panel.Location = new System.Drawing.Point(6, 6); + this.C64Controller1Panel.Name = "C64Controller1Panel"; + this.C64Controller1Panel.Size = new System.Drawing.Size(369, 332); + this.C64Controller1Panel.TabIndex = 2; + // + // C64Controller2Panel + // + this.C64Controller2Panel.Location = new System.Drawing.Point(6, 6); + this.C64Controller2Panel.Name = "C64Controller2Panel"; + this.C64Controller2Panel.Size = new System.Drawing.Size(369, 332); + this.C64Controller2Panel.TabIndex = 3; + // + // C64Autofire1Panel + // + this.C64Autofire1Panel.Location = new System.Drawing.Point(19, 14); + this.C64Autofire1Panel.Name = "C64Autofire1Panel"; + this.C64Autofire1Panel.Size = new System.Drawing.Size(369, 332); + this.C64Autofire1Panel.TabIndex = 4; + // + // C64Autofire2Panel + // + this.C64Autofire2Panel.Location = new System.Drawing.Point(14, 3); + this.C64Autofire2Panel.Name = "C64Autofire2Panel"; + this.C64Autofire2Panel.Size = new System.Drawing.Size(369, 332); + this.C64Autofire2Panel.TabIndex = 4; // // ControllerConfig // @@ -1492,8 +1554,12 @@ this.tabPage58.ResumeLayout(false); this.tabPage7.ResumeLayout(false); this.tabControl8.ResumeLayout(false); + this.tabPage49.ResumeLayout(false); + this.tabPage50.ResumeLayout(false); this.tabPage8.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.pictureBox7)).EndInit(); + this.tabPage10.ResumeLayout(false); + this.tabPage11.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); @@ -1622,5 +1688,11 @@ private ControllerConfigPanel Atari2600ConsoleButtons; private ControllerConfigPanel SNESConsoleButtons; private ControllerConfigPanel GenesisConsoleButtons; + private System.Windows.Forms.TabPage tabPage10; + private System.Windows.Forms.TabPage tabPage11; + private ControllerConfigPanel C64Controller1Panel; + private ControllerConfigPanel C64Controller2Panel; + private ControllerConfigPanel C64Autofire1Panel; + private ControllerConfigPanel C64Autofire2Panel; } } \ No newline at end of file diff --git a/BizHawk.MultiClient/config/ControllerConfig.cs b/BizHawk.MultiClient/config/ControllerConfig.cs index f047d49597..31bdaf72fe 100644 --- a/BizHawk.MultiClient/config/ControllerConfig.cs +++ b/BizHawk.MultiClient/config/ControllerConfig.cs @@ -86,6 +86,11 @@ namespace BizHawk.MultiClient TI83ControllerPanel.ColumnWidth = 170; TI83ControllerPanel.LoadSettings(Global.Config.TI83Controller[0]); + C64Controller1Panel.LoadSettings(Global.Config.C64Joysticks[0]); + C64Controller2Panel.LoadSettings(Global.Config.C64Joysticks[1]); + C64Autofire1Panel.LoadSettings(Global.Config.C64AutoJoysticks[0]); + C64Autofire2Panel.LoadSettings(Global.Config.C64AutoJoysticks[1]); + SetAutoTab(true); } diff --git a/BizHawk.MultiClient/config/InputConfig.cs b/BizHawk.MultiClient/config/InputConfig.cs index 1f1af72776..98d2206160 100644 --- a/BizHawk.MultiClient/config/InputConfig.cs +++ b/BizHawk.MultiClient/config/InputConfig.cs @@ -153,7 +153,7 @@ namespace BizHawk.MultiClient switch (platform) { case "Atari": - IDX_CONTROLLERENABLED.Checked = ((Atari2600ControllerTemplate)mainController[jpad]).Enabled; + IDX_CONTROLLERENABLED.Checked = ((SingleButtonJoyStickTemplate)mainController[jpad]).Enabled; break; case "Gameboy": IDX_CONTROLLERENABLED.Checked = ((GBControllerTemplate)mainController[jpad]).Enabled; @@ -203,7 +203,7 @@ namespace BizHawk.MultiClient break; case "Atari": { - Atari2600ControllerTemplate obj = (Atari2600ControllerTemplate)controller[jpad]; + SingleButtonJoyStickTemplate obj = (SingleButtonJoyStickTemplate)controller[jpad]; field = obj.GetType().GetField(fieldName).GetValue(obj); break; } @@ -333,7 +333,7 @@ namespace BizHawk.MultiClient ((Atari2600ConsoleButtonsTemplate)mainController[0]).Enabled = IDX_CONTROLLERENABLED.Checked; break; case "Atari": - ((Atari2600ControllerTemplate)mainController[prev]).Enabled = IDX_CONTROLLERENABLED.Checked; + ((SingleButtonJoyStickTemplate)mainController[prev]).Enabled = IDX_CONTROLLERENABLED.Checked; break; case "Gameboy": ((GBControllerTemplate)mainController[prev]).Enabled = IDX_CONTROLLERENABLED.Checked; @@ -372,7 +372,7 @@ namespace BizHawk.MultiClient break; case "Atari": { - Atari2600ControllerTemplate obj = (Atari2600ControllerTemplate)controller[prev]; + SingleButtonJoyStickTemplate obj = (SingleButtonJoyStickTemplate)controller[prev]; FieldInfo buttonField = obj.GetType().GetField(fieldName); field = buttonField.GetValue(obj); buttonField.SetValue(obj, TempBox.Text);