Exemple #1
0
        public VectrexHawkControllerDeck(string controller1Name, string controller2Name)
        {
            Port1 = ControllerCtors.TryGetValue(controller1Name, out var ctor1)
                                ? ctor1(1)
                                : throw new InvalidOperationException($"Invalid controller type: {controller1Name}");
            Port2 = ControllerCtors.TryGetValue(controller2Name, out var ctor2)
                                ? ctor2(2)
                                : throw new InvalidOperationException($"Invalid controller type: {controller2Name}");

            Definition = new ControllerDefinition
            {
                Name        = Port1.Definition.Name,
                BoolButtons = Port1.Definition.BoolButtons
                              .Concat(Port2.Definition.BoolButtons)
                              .Concat(new[]
                {
                    "Power",
                    "Reset"
                })
                              .ToList()
            };

            foreach (var kvp in Port1.Definition.Axes)
            {
                Definition.Axes.Add(kvp);
            }
            foreach (var kvp in Port2.Definition.Axes)
            {
                Definition.Axes.Add(kvp);
            }
        }
        public ColecoVisionControllerDeck(string controller1Name, string controller2Name)
        {
            Port1 = ControllerCtors.TryGetValue(controller1Name, out var ctor1)
                                ? ctor1(1)
                                : throw new InvalidOperationException($"Invalid controller type: {controller1Name}");
            Port2 = ControllerCtors.TryGetValue(controller2Name, out var ctor2)
                                ? ctor2(2)
                                : throw new InvalidOperationException($"Invalid controller type: {controller2Name}");

            Definition = new("ColecoVision Basic Controller")
            {
                BoolButtons = Port1.Definition.BoolButtons
                              .Concat(Port2.Definition.BoolButtons)
                              .Concat(new[]
                {
                    "Power", "Reset"
                })
                              .ToList()
            };

            foreach (var kvp in Port1.Definition.Axes)
            {
                Definition.Axes.Add(kvp);
            }
            foreach (var kvp in Port2.Definition.Axes)
            {
                Definition.Axes.Add(kvp);
            }

            Definition.MakeImmutable();
        }
        public GBHawkLink4xControllerDeck(string controller1Name, string controller2Name, string controller3Name, string controller4Name)
        {
            Port1 = ControllerCtors.TryGetValue(controller1Name, out var ctor1)
                                ? ctor1(1)
                                : throw new InvalidOperationException($"Invalid controller type: {controller1Name}");
            Port2 = ControllerCtors.TryGetValue(controller2Name, out var ctor2)
                                ? ctor2(2)
                                : throw new InvalidOperationException($"Invalid controller type: {controller2Name}");
            Port3 = ControllerCtors.TryGetValue(controller3Name, out var ctor3)
                                ? ctor3(3)
                                : throw new InvalidOperationException($"Invalid controller type: {controller3Name}");
            Port4 = ControllerCtors.TryGetValue(controller4Name, out var ctor4)
                                ? ctor4(4)
                                : throw new InvalidOperationException($"Invalid controller type: {controller4Name}");

            Definition = new ControllerDefinition
            {
                Name        = Port1.Definition.Name,
                BoolButtons = Port1.Definition.BoolButtons
                              .Concat(Port2.Definition.BoolButtons)
                              .Concat(Port3.Definition.BoolButtons)
                              .Concat(Port4.Definition.BoolButtons)
                              .Concat(new[] { "Toggle Cable UD" })
                              .Concat(new[] { "Toggle Cable LR" })
                              .Concat(new[] { "Toggle Cable X" })
                              .Concat(new[] { "Toggle Cable 4x" })
                              .ToList()
            };
        }
        public O2HawkControllerDeck(string controller1Name, string controller2Name, bool is_G7400)
        {
            Port1 = ControllerCtors.TryGetValue(controller1Name, out var ctor1)
                                ? ctor1(1)
                                : throw new InvalidOperationException($"Invalid controller type: {controller1Name}");
            Port2 = ControllerCtors.TryGetValue(controller2Name, out var ctor2)
                                ? ctor2(2)
                                : throw new InvalidOperationException($"Invalid controller type: {controller2Name}");

            if (is_G7400)
            {
                Definition = new(Port1.Definition.Name)
                {
                    BoolButtons = Port1.Definition.BoolButtons
                                  .Concat(Port2.Definition.BoolButtons)
                                  .Concat(new[]
                    {
                        "0", "1", "2", "3", "4", "5", "6", "7",
                        "8", "9", "SPC", "?", "L", "P",
                        "+", "W", "E", "R", "T", "U", "I", "O",
                        "Q", "S", "D", "F", "G", "H", "J", "K",
                        "A", "Z", "X", "C", "V", "B", "M", "PERIOD",
                        "-", "*", "/", "=", "YES", "NO", "CLR", "ENT",
                        "Reset", "Power",
                        "SHIFT", "LOCK", "CTNL", ":", "|", "]", "..", ",", "<", "ESC", "BREAK", "RET"
                    })
                                  .ToList()
                };
            }
            else
            {
                Definition = new(Port1.Definition.Name)
                {
                    BoolButtons = Port1.Definition.BoolButtons
                                  .Concat(Port2.Definition.BoolButtons)
                                  .Concat(new[]
                    {
                        "0", "1", "2", "3", "4", "5", "6", "7",
                        "8", "9", "SPC", "?", "L", "P",
                        "+", "W", "E", "R", "T", "U", "I", "O",
                        "Q", "S", "D", "F", "G", "H", "J", "K",
                        "A", "Z", "X", "C", "V", "B", "M", "PERIOD",
                        "-", "*", "/", "=", "YES", "NO", "CLR", "ENT",
                        "Reset", "Power"
                    })
                                  .ToList()
                };
            }

            foreach (var kvp in Port1.Definition.Axes)
            {
                Definition.Axes.Add(kvp);
            }

            Definition.MakeImmutable();
        }
Exemple #5
0
        public GGHawkLinkControllerDeck(string controller1Name, string controller2Name)
        {
            Port1 = ControllerCtors.TryGetValue(controller1Name, out var ctor1)
                                ? ctor1(1)
                                : throw new InvalidOperationException($"Invalid controller type: {controller1Name}");
            Port2 = ControllerCtors.TryGetValue(controller2Name, out var ctor2)
                                ? ctor2(2)
                                : throw new InvalidOperationException($"Invalid controller type: {controller2Name}");

            Definition = new ControllerDefinition(Port1.Definition.Name)
            {
                BoolButtons = Port1.Definition.BoolButtons
                              .Concat(Port2.Definition.BoolButtons)
                              .Concat(new[] { "Toggle Cable" })
                              .ToList()
            }.MakeImmutable();
        }
Exemple #6
0
        public GBHawkControllerDeck(string controller1Name)
        {
            Port1 = ControllerCtors.TryGetValue(controller1Name, out var ctor1)
                                ? ctor1(1)
                                : throw new InvalidOperationException($"Invalid controller type: {controller1Name}");

            Definition = new ControllerDefinition
            {
                Name        = Port1.Definition.Name,
                BoolButtons = Port1.Definition.BoolButtons
                              .ToList()
            };

            foreach (var kvp in Port1.Definition.Axes)
            {
                Definition.Axes.Add(kvp);
            }
        }
Exemple #7
0
        public A7800HawkControllerDeck(string controller1Name, string controller2Name)
        {
            Port1 = ControllerCtors.TryGetValue(controller1Name, out var ctor1)
                                ? ctor1(1)
                                : throw new InvalidOperationException($"Invalid controller type: {controller1Name}");
            Port2 = ControllerCtors.TryGetValue(controller2Name, out var ctor2)
                                ? ctor2(2)
                                : throw new InvalidOperationException($"Invalid controller type: {controller2Name}");

            Definition = new(Port1.Definition.Name)
            {
                BoolButtons = Port1.Definition.BoolButtons
                              .Concat(Port2.Definition.BoolButtons)
                              .Concat(new[]
                {
                    "Power",
                    "Reset",
                    "Select",
                    "BW",
                    "Toggle Left Difficulty",                             // better not put P# on these as they might not correspond to player numbers
                    "Toggle Right Difficulty",
                    "Pause"
                })
                              .ToList()
            };

            foreach (var kvp in Port1.Definition.Axes)
            {
                Definition.Axes.Add(kvp);
            }
            foreach (var kvp in Port2.Definition.Axes)
            {
                Definition.Axes.Add(kvp);
            }

            Definition.MakeImmutable();
        }
Exemple #8
0
        public GBHawkControllerDeck(string controller1Name, bool subframe)
        {
            Port1 = ControllerCtors.TryGetValue(controller1Name, out var ctor1)
                                ? ctor1(1)
                                : throw new InvalidOperationException($"Invalid controller type: {controller1Name}");

            Definition = new(Port1.Definition.Name)
            {
                BoolButtons = Port1.Definition.BoolButtons
                              .ToList()
            };

            foreach (var kvp in Port1.Definition.Axes)
            {
                Definition.Axes.Add(kvp);
            }

            if (subframe)
            {
                Definition.AddAxis("Input Cycle", 0.RangeTo(70224), 70224);
            }

            Definition.MakeImmutable();
        }