From 5d37fb1ec243fb84de29bb9302a360479cd180dc Mon Sep 17 00:00:00 2001 From: Asnivor Date: Wed, 4 Sep 2024 17:36:57 +0100 Subject: [PATCH] ChannelFHawk: Default controls and VirtualPad --- Assets/defctrl.json | 23 +++++++ .../vpads_schemata/ChannelFSchema.cs | 60 +++++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 src/BizHawk.Emulation.Cores/vpads_schemata/ChannelFSchema.cs diff --git a/Assets/defctrl.json b/Assets/defctrl.json index 4e2ba55dc4..a3ccb87ccd 100644 --- a/Assets/defctrl.json +++ b/Assets/defctrl.json @@ -242,6 +242,29 @@ "Insert Previous Disk": "F10", "Get Disk Status": "F12" }, + "ChannelF Controller": { + "P1 Forward": "Keypad8, J1 POV1U, X1 DpadUp, X1 LStickUp", + "P1 Back": "Keypad2, J1 POV1D, X1 DpadDown, X1 LStickDown", + "P1 Left": "Keypad4, J1 POV1L, X1 DpadLeft, X1 LStickLeft", + "P1 Right": "Keypad6, J1 POV1R, X1 DpadRight, X1 LStickRight", + "P1 CCW": "Left, J1 Z-, X1 RStickLeft", + "P1 CW": "Right, J1 Z+, X1 RStickRight", + "P1 Pull": "Up, J1 RotationZ-, X1 RStickUp", + "P1 Push": "Down, J1 RotationZ+, X1 RStickDown", + "TIME": "F1", + "MODE": "F2", + "HOLD": "F3", + "START": "F4", + "RESET": "F5", + "P2 Forward": "W, J2 POV1U, X2 DpadUp, X2 LStickUp", + "P2 Back": "S, J2 POV1D, X2 DpadDown, X2 LStickDown", + "P2 Left": "A, J2 POV1L, X2 DpadLeft, X2 LStickLeft", + "P2 Right": "D, J2 POV1R, X2 DpadRight, X2 LStickRight", + "P2 CCW": "J, J2 Z-, X2 RStickLeft", + "P2 CW": "L, J2 Z+, X2 RStickRight", + "P2 Pull": "I, J2 RotationZ-, X2 RStickUp", + "P2 Push": "K, J2 RotationZ+, X2 RStickDown", + }, "Intellivision Controller": { "P1 Up": "Up, J1 POV1U, X1 DpadUp, X1 LStickUp", "P1 Down": "Down, J1 POV1D, X1 DpadDown, X1 LStickDown", diff --git a/src/BizHawk.Emulation.Cores/vpads_schemata/ChannelFSchema.cs b/src/BizHawk.Emulation.Cores/vpads_schemata/ChannelFSchema.cs new file mode 100644 index 0000000000..bf70d98592 --- /dev/null +++ b/src/BizHawk.Emulation.Cores/vpads_schemata/ChannelFSchema.cs @@ -0,0 +1,60 @@ + +using BizHawk.Emulation.Common; +using System.Collections.Generic; +using System.Drawing; + +namespace BizHawk.Emulation.Cores +{ + [Schema(VSystemID.Raw.ChannelF)] + internal class ChannelFSchema : IVirtualPadSchema + { + public IEnumerable GetPadSchemas(IEmulator core, Action showMessageBox) + { + yield return Joystick(1); + yield return Joystick(2); + yield return Console(); + } + + private static PadSchema Joystick(int controller) + { + string post = controller == 2 ? " (LEFT)" : " (RIGHT)"; + + return new PadSchema + { + DisplayName = $"Controller {controller} {post}", + Size = new Size(150, 160), + Buttons = new[] + { + new ButtonSchema(10, 25, controller, "CCW", "CCW"), + new ButtonSchema(92, 25, controller, "CW", " CW "), + + new ButtonSchema(60, 35, controller, "Forward", "U"), + new ButtonSchema(60, 57, controller, "Back", "D"), + new ButtonSchema(38, 57, controller, "Left", "L"), + new ButtonSchema(85, 57, controller, "Right", "R"), + + + new ButtonSchema(10, 80, controller, "Pull", "PULL"), + new ButtonSchema(92, 80, controller, "Push", "PUSH") + } + }; + } + + private static PadSchema Console() + { + return new PadSchema + { + DisplayName = "Console", + Size = new Size(70, 160), + Buttons = new[] + { + new ButtonSchema(10, 25, "TIME"), + new ButtonSchema(10, 50, "MODE"), + new ButtonSchema(10, 75, "HOLD"), + new ButtonSchema(10, 100, "START"), + new ButtonSchema(10, 125, "RESET") + } + }; + } + } +}