Intellivision - Hook up controllers to the core

This commit is contained in:
adelikat 2012-12-22 01:56:14 +00:00
parent 726d497997
commit 76c9a68a2d
4 changed files with 190 additions and 17 deletions
BizHawk.Emulation/Consoles/Intellivision
BizHawk.MultiClient

View File

@ -102,6 +102,15 @@ namespace BizHawk.Emulation.Consoles.Intellivision
{
Name = "Intellivision Controller",
BoolButtons = {
"P1 Up", "P1 Down", "P1 Left", "P1 Right",
"P1 L", "P1 R",
"P1 Key0", "P1 Key1", "P1 Key2", "P1 Key3", "P1 Key4", "P1 Key5",
"P1 Key6", "P1 Key7", "P1 Key8", "P1 Key9", "P1 Enter", "P1 Clear",
"P2 Up", "P2 Down", "P2 Left", "P2 Right",
"P2 L", "P2 R",
"P2 Key0", "P2 Key1", "P2 Key2", "P2 Key3", "P2 Key4", "P2 Key5",
"P2 Key6", "P2 Key7", "P2 Key8", "P2 Key9", "P2 Enter", "P2 Clear"
}
};

View File

@ -68,6 +68,11 @@ namespace BizHawk.MultiClient
ColecoAutoController[0] = new ColecoVisionControllerTemplate(false);
ColecoAutoController[1] = new ColecoVisionControllerTemplate(false);
IntellivisionController[0] = new IntellivisionControllerTemplate(true);
IntellivisionController[1] = new IntellivisionControllerTemplate(false);
IntellivisionAutoController[0] = new IntellivisionControllerTemplate(false);
IntellivisionAutoController[1] = new IntellivisionControllerTemplate(false);
C64Joysticks[0] = new SingleButtonJoyStickTemplate(true, true);
C64Joysticks[1] = new SingleButtonJoyStickTemplate(false);
C64AutoJoysticks[0] = new SingleButtonJoyStickTemplate(false);
@ -723,6 +728,10 @@ namespace BizHawk.MultiClient
public ColecoVisionControllerTemplate[] ColecoController = new ColecoVisionControllerTemplate[2];
public ColecoVisionControllerTemplate[] ColecoAutoController = new ColecoVisionControllerTemplate[2];
//Intellivision
public IntellivisionControllerTemplate[] IntellivisionController = new IntellivisionControllerTemplate[2];
public IntellivisionControllerTemplate[] IntellivisionAutoController = new IntellivisionControllerTemplate[2];
//NES settings
public NESControllerTemplate[] NESController = new NESControllerTemplate[4];
public NESControllerTemplate[] NESAutoController = new NESControllerTemplate[4];
@ -1214,7 +1223,6 @@ namespace BizHawk.MultiClient
public string Right = "";
public string L = "";
public string R = "";
public string _0 = "";
public string _1 = "";
public string _2 = "";
public string _3 = "";
@ -1225,6 +1233,7 @@ namespace BizHawk.MultiClient
public string _8 = "";
public string _9 = "";
public string Star = "";
public string _0 = "";
public string Pound = "";
public bool Enabled;
@ -1261,6 +1270,62 @@ namespace BizHawk.MultiClient
}
}
public class IntellivisionControllerTemplate : iControllerConfigObject
{
public string Up = "";
public string Down = "";
public string Left = "";
public string Right = "";
public string L = "";
public string R = "";
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 Enter = "";
public string _0 = "";
public string Clear = "";
public bool Enabled;
public IntellivisionControllerTemplate() { }
public IntellivisionControllerTemplate(bool defaults)
{
if (defaults)
{
SetDefaults();
}
}
public void SetDefaults()
{
Enabled = true;
Up = "UpArrow, X1 DpadUp, X1 LStickUp";
Down = "DownArrow, X1 DpadDown, X1 LStickDown";
Left = "LeftArrow, X1 DpadLeft, X1 LStickLeft";
Right = "RightArrow, X1 DpadRight, X1 LStickRight";
L = "Z, J1 B1";
R = "X, J1 B1";
_0 = "NumberPad0";
_1 = "NumberPad1";
_2 = "NumberPad2";
_3 = "NumberPad3";
_4 = "NumberPad4";
_5 = "NumberPad5";
_6 = "NumberPad6";
_7 = "NumberPad7";
_8 = "NumberPad8";
_9 = "NumberPad9";
Enter = "NumberPadPeriod";
Clear = "NumberPadEnter";
}
}
public class C64KeyboardTemplate : iControllerConfigObject
{
public string F1 = "";

View File

@ -23,34 +23,49 @@ namespace BizHawk.MultiClient
public static IEmulator Emulator;
public static CoreComm CoreComm;
public static GameInfo Game;
public static Controller SMSControls;
public static Controller PCEControls;
public static Controller GenControls;
public static Controller TI83Controls;
public static Controller NESControls;
public static Controller SNESControls;
public static Controller GBControls;
public static Controller GBAControls;
public static Controller Atari2600Controls;
public static Controller Atari7800Controls;
public static Controller NullControls;
public static Controller ColecoControls;
public static Controller Commodore64Controls;
public static CheatList CheatList;
public static Controller NullControls;
public static AutofireController AutofireNullControls;
public static Controller NESControls;
public static AutofireController AutofireNESControls;
public static Controller SNESControls;
public static AutofireController AutofireSNESControls;
public static AutofireController AutofireSMSControls;
public static AutofireController AutofirePCEControls;
public static Controller GBControls;
public static AutofireController AutofireGBControls;
public static Controller GBAControls;
public static AutofireController AutofireGBAControls;
public static Controller PCEControls;
public static AutofireController AutofirePCEControls;
public static Controller SMSControls;
public static AutofireController AutofireSMSControls;
public static Controller GenControls;
public static AutofireController AutofireGenControls;
public static Controller TI83Controls;
public static Controller Atari2600Controls;
public static AutofireController AutofireAtari2600Controls;
public static Controller Atari7800Controls;
public static AutofireController AutofireAtari7800Controls;
public static AutofireController AutofireCommodore64Controls;
public static Controller ColecoControls;
public static AutofireController AutofireColecoControls;
public static Controller IntellivisionControls;
public static AutofireController AutofireIntellivisionControls;
public static Controller Commodore64Controls;
public static AutofireController AutofireCommodore64Controls;
public static readonly Dictionary<string, Dictionary<string, string>> BUTTONS = new Dictionary<string, Dictionary<string, string>>()
{
{

View File

@ -1115,6 +1115,86 @@ namespace BizHawk.MultiClient
acolecoControls.BindMulti("P2 Pound", Global.Config.ColecoController[1].Pound);
Global.AutofireColecoControls = acolecoControls;
var intelliControls = new Controller(Intellivision.IntellivisionController);
intelliControls.BindMulti("P1 Up", Global.Config.IntellivisionController[0].Up);
intelliControls.BindMulti("P1 Left", Global.Config.IntellivisionController[0].Left);
intelliControls.BindMulti("P1 Right", Global.Config.IntellivisionController[0].Right);
intelliControls.BindMulti("P1 Down", Global.Config.IntellivisionController[0].Down);
intelliControls.BindMulti("P1 L", Global.Config.IntellivisionController[0].L);
intelliControls.BindMulti("P1 R", Global.Config.IntellivisionController[0].R);
intelliControls.BindMulti("P1 Key0", Global.Config.IntellivisionController[0]._0);
intelliControls.BindMulti("P1 Key1", Global.Config.IntellivisionController[0]._1);
intelliControls.BindMulti("P1 Key2", Global.Config.IntellivisionController[0]._2);
intelliControls.BindMulti("P1 Key3", Global.Config.IntellivisionController[0]._3);
intelliControls.BindMulti("P1 Key4", Global.Config.IntellivisionController[0]._4);
intelliControls.BindMulti("P1 Key5", Global.Config.IntellivisionController[0]._5);
intelliControls.BindMulti("P1 Key6", Global.Config.IntellivisionController[0]._6);
intelliControls.BindMulti("P1 Key7", Global.Config.IntellivisionController[0]._7);
intelliControls.BindMulti("P1 Key8", Global.Config.IntellivisionController[0]._8);
intelliControls.BindMulti("P1 Key9", Global.Config.IntellivisionController[0]._9);
intelliControls.BindMulti("P1 Clear", Global.Config.IntellivisionController[0].Clear);
intelliControls.BindMulti("P1 Enter", Global.Config.IntellivisionController[0].Enter);
intelliControls.BindMulti("P2 Up", Global.Config.IntellivisionController[1].Up);
intelliControls.BindMulti("P2 Left", Global.Config.IntellivisionController[1].Left);
intelliControls.BindMulti("P2 Right", Global.Config.IntellivisionController[1].Right);
intelliControls.BindMulti("P2 Down", Global.Config.IntellivisionController[1].Down);
intelliControls.BindMulti("P2 L", Global.Config.IntellivisionController[1].L);
intelliControls.BindMulti("P2 R", Global.Config.IntellivisionController[1].R);
intelliControls.BindMulti("P2 Key0", Global.Config.IntellivisionController[1]._0);
intelliControls.BindMulti("P2 Key1", Global.Config.IntellivisionController[1]._1);
intelliControls.BindMulti("P2 Key2", Global.Config.IntellivisionController[1]._2);
intelliControls.BindMulti("P2 Key3", Global.Config.IntellivisionController[1]._3);
intelliControls.BindMulti("P2 Key4", Global.Config.IntellivisionController[1]._4);
intelliControls.BindMulti("P2 Key5", Global.Config.IntellivisionController[1]._5);
intelliControls.BindMulti("P2 Key6", Global.Config.IntellivisionController[1]._6);
intelliControls.BindMulti("P2 Key7", Global.Config.IntellivisionController[1]._7);
intelliControls.BindMulti("P2 Key8", Global.Config.IntellivisionController[1]._8);
intelliControls.BindMulti("P2 Key9", Global.Config.IntellivisionController[1]._9);
intelliControls.BindMulti("P2 Clear", Global.Config.IntellivisionController[1].Clear);
intelliControls.BindMulti("P2 Enter", Global.Config.IntellivisionController[1].Enter);
Global.IntellivisionControls = intelliControls;
var aintelliControls = new AutofireController(Intellivision.IntellivisionController);
aintelliControls.BindMulti("P1 Up", Global.Config.IntellivisionAutoController[0].Up);
aintelliControls.BindMulti("P1 Left", Global.Config.IntellivisionAutoController[0].Left);
aintelliControls.BindMulti("P1 Right", Global.Config.IntellivisionAutoController[0].Right);
aintelliControls.BindMulti("P1 Down", Global.Config.IntellivisionAutoController[0].Down);
aintelliControls.BindMulti("P1 L", Global.Config.IntellivisionAutoController[0].L);
aintelliControls.BindMulti("P1 R", Global.Config.IntellivisionAutoController[0].R);
aintelliControls.BindMulti("P1 Key0", Global.Config.IntellivisionAutoController[0]._0);
aintelliControls.BindMulti("P1 Key1", Global.Config.IntellivisionAutoController[0]._1);
aintelliControls.BindMulti("P1 Key2", Global.Config.IntellivisionAutoController[0]._2);
aintelliControls.BindMulti("P1 Key3", Global.Config.IntellivisionAutoController[0]._3);
aintelliControls.BindMulti("P1 Key4", Global.Config.IntellivisionAutoController[0]._4);
aintelliControls.BindMulti("P1 Key5", Global.Config.IntellivisionAutoController[0]._5);
aintelliControls.BindMulti("P1 Key6", Global.Config.IntellivisionAutoController[0]._6);
aintelliControls.BindMulti("P1 Key7", Global.Config.IntellivisionAutoController[0]._7);
aintelliControls.BindMulti("P1 Key8", Global.Config.IntellivisionAutoController[0]._8);
aintelliControls.BindMulti("P1 Key9", Global.Config.IntellivisionAutoController[0]._9);
aintelliControls.BindMulti("P1 Clear", Global.Config.IntellivisionAutoController[0].Clear);
aintelliControls.BindMulti("P1 Enter", Global.Config.IntellivisionAutoController[0].Enter);
aintelliControls.BindMulti("P2 Up", Global.Config.IntellivisionAutoController[1].Up);
aintelliControls.BindMulti("P2 Left", Global.Config.IntellivisionAutoController[1].Left);
aintelliControls.BindMulti("P2 Right", Global.Config.IntellivisionAutoController[1].Right);
aintelliControls.BindMulti("P2 Down", Global.Config.IntellivisionAutoController[1].Down);
aintelliControls.BindMulti("P2 L", Global.Config.IntellivisionAutoController[1].L);
aintelliControls.BindMulti("P2 R", Global.Config.IntellivisionAutoController[1].R);
aintelliControls.BindMulti("P2 Key0", Global.Config.IntellivisionAutoController[1]._0);
aintelliControls.BindMulti("P2 Key1", Global.Config.IntellivisionAutoController[1]._1);
aintelliControls.BindMulti("P2 Key2", Global.Config.IntellivisionAutoController[1]._2);
aintelliControls.BindMulti("P2 Key3", Global.Config.IntellivisionAutoController[1]._3);
aintelliControls.BindMulti("P2 Key4", Global.Config.IntellivisionAutoController[1]._4);
aintelliControls.BindMulti("P2 Key5", Global.Config.IntellivisionAutoController[1]._5);
aintelliControls.BindMulti("P2 Key6", Global.Config.IntellivisionAutoController[1]._6);
aintelliControls.BindMulti("P2 Key7", Global.Config.IntellivisionAutoController[1]._7);
aintelliControls.BindMulti("P2 Key8", Global.Config.IntellivisionAutoController[1]._8);
aintelliControls.BindMulti("P2 Key9", Global.Config.IntellivisionAutoController[1]._9);
aintelliControls.BindMulti("P2 Clear", Global.Config.IntellivisionAutoController[1].Clear);
aintelliControls.BindMulti("P2 Enter", Global.Config.IntellivisionAutoController[1].Enter);
Global.AutofireIntellivisionControls = aintelliControls;
var TI83Controls = new Controller(TI83.TI83Controller);
TI83Controls.BindMulti("0", Global.Config.TI83Controller[0]._0);
TI83Controls.BindMulti("1", Global.Config.TI83Controller[0]._1);
@ -1570,6 +1650,10 @@ namespace BizHawk.MultiClient
Global.ActiveController = Global.Commodore64Controls;
Global.AutoFireController = Global.AutofireCommodore64Controls;
break;
case "INTV":
Global.ActiveController = Global.IntellivisionControls;
Global.AutoFireController = Global.AutofireIntellivisionControls;
break;
default:
Global.ActiveController = Global.NullControls;
break;