From f7b6703ad288851da813b1a15df4354c4d6abc19 Mon Sep 17 00:00:00 2001 From: feos Date: Sun, 24 Nov 2024 11:39:48 +0300 Subject: [PATCH] puae mnemonics --- .../tools/TAStudio/TAStudio.cs | 4 ++++ .../Base Implementations/Bk2MnemonicLookup.cs | 17 +++++++++++--- .../Computers/Amiga/LibPUAE.cs | 22 +++++++++---------- .../Computers/Amiga/PUAE.Controllers.cs | 6 ++--- .../Computers/Amiga/PUAE.cs | 18 +++++++-------- 5 files changed, 41 insertions(+), 26 deletions(-) diff --git a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs index c6eff70740..6c83b6af67 100644 --- a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs +++ b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs @@ -363,6 +363,10 @@ namespace BizHawk.Client.EmuHawk || c.Name == "Light Sensor" || c.Name == "Disc Select" || c.Name == "Disk Index" + || c.Name == "Next Drive" + || c.Name == "Next Slot" + || c.Name == "Insert Disk" + || c.Name == "Eject Disk" || c.Name.StartsWithOrdinal("Tilt") || c.Name.StartsWithOrdinal("Key ") || c.Name.StartsWithOrdinal("Open") diff --git a/src/BizHawk.Emulation.Common/Base Implementations/Bk2MnemonicLookup.cs b/src/BizHawk.Emulation.Common/Base Implementations/Bk2MnemonicLookup.cs index 436f31cc90..67647305c5 100644 --- a/src/BizHawk.Emulation.Common/Base Implementations/Bk2MnemonicLookup.cs +++ b/src/BizHawk.Emulation.Common/Base Implementations/Bk2MnemonicLookup.cs @@ -763,7 +763,7 @@ namespace BizHawk.Emulation.Common ["Less"] = '<', ["Minus"] = '-', ["Number Sign"] = '#', - ["Period"] = '.', + ["Period"] = 'p', ["Quote"] = '\"', ["Return"] = 'r', ["Right"] = 'R', @@ -783,11 +783,22 @@ namespace BizHawk.Emulation.Common ["Joystick Down"] = 'D', ["Joystick Left"] = 'L', ["Joystick Right"] = 'R', + ["CD32 pad Up"] = 'U', + ["CD32 pad Down"] = 'D', + ["CD32 pad Left"] = 'L', + ["CD32 pad Right"] = 'R', + ["CD32 pad Play"] = '>', + ["CD32 pad Rewind"] = '{', + ["CD32 pad Forward"] = '}', + ["CD32 pad Green"] = 'g', + ["CD32 pad Yellow"] = 'y', + ["CD32 pad Red"] = 'r', + ["CD32 pad Blue"] = 'b', ["Mouse Left Button"] = 'l', ["Mouse Middle Button"] = 'm', ["Mouse Right Button"] = 'r', - ["Eject"] = '^', - ["Insert"] = 'v', + ["Eject Disk"] = '^', + ["Insert Disk"] = 'v', ["Next Drive"] = '}', ["Next Slot"] = '>', }, diff --git a/src/BizHawk.Emulation.Cores/Computers/Amiga/LibPUAE.cs b/src/BizHawk.Emulation.Cores/Computers/Amiga/LibPUAE.cs index 2bb34e1eba..e02f9b4001 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Amiga/LibPUAE.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Amiga/LibPUAE.cs @@ -30,17 +30,17 @@ namespace BizHawk.Emulation.Cores.Computers.Amiga public const int KEY_COUNT = 0x68; public const byte MouseButtonsMask = - (byte)(AllButtons.Button1 - | AllButtons.Button2 - | AllButtons.Button3); + (byte)(AllButtons.Button_1 + | AllButtons.Button_2 + | AllButtons.Button_3); public const byte JoystickMask = (byte)(AllButtons.Up | AllButtons.Down | AllButtons.Left | AllButtons.Right - | AllButtons.Button1 - | AllButtons.Button2 - | AllButtons.Button3); + | AllButtons.Button_1 + | AllButtons.Button_2 + | AllButtons.Button_3); public const short Cd32padMask = (short)(AllButtons.Up | AllButtons.Down @@ -96,8 +96,8 @@ namespace BizHawk.Emulation.Cores.Computers.Amiga public enum DriveAction : int { None, - Eject, - Insert + EjectDisk, + InsertDisk } [Flags] @@ -107,9 +107,9 @@ namespace BizHawk.Emulation.Cores.Computers.Amiga Down = 0b0000000000000010, Left = 0b0000000000000100, Right = 0b0000000000001000, - Button1 = 0b0000000000010000, - Button2 = 0b0000000000100000, - Button3 = 0b0000000001000000, + Button_1 = 0b0000000000010000, + Button_2 = 0b0000000000100000, + Button_3 = 0b0000000001000000, Play = 0b0000000010000000, Rewind = 0b0000000100000000, Forward = 0b0000001000000000, diff --git a/src/BizHawk.Emulation.Cores/Computers/Amiga/PUAE.Controllers.cs b/src/BizHawk.Emulation.Cores/Computers/Amiga/PUAE.Controllers.cs index 1de5675880..45083f9540 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Amiga/PUAE.Controllers.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Amiga/PUAE.Controllers.cs @@ -102,7 +102,7 @@ namespace BizHawk.Emulation.Cores.Computers.Amiga controller.BoolButtons.AddRange( [ - Inputs.NextDrive, Inputs.NextSlot, Inputs.Insert, Inputs.Eject + Inputs.NextDrive, Inputs.NextSlot, Inputs.InsertDisk, Inputs.EjectDisk ]); foreach (var (name, _) in _keyboardMap) @@ -123,8 +123,8 @@ namespace BizHawk.Emulation.Cores.Computers.Amiga public const string MouseMiddleButton = "Mouse Middle Button"; public const string MouseX = "Mouse X"; public const string MouseY = "Mouse Y"; - public const string Eject = "Eject"; - public const string Insert = "Insert"; + public const string EjectDisk = "Eject Disk"; + public const string InsertDisk = "Insert Disk"; public const string NextDrive = "Next Drive"; public const string NextSlot = "Next Slot"; } diff --git a/src/BizHawk.Emulation.Cores/Computers/Amiga/PUAE.cs b/src/BizHawk.Emulation.Cores/Computers/Amiga/PUAE.cs index 5ca6bc3403..103bd9bf8d 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Amiga/PUAE.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Amiga/PUAE.cs @@ -168,17 +168,17 @@ namespace BizHawk.Emulation.Cores.Computers.Amiga { if (controller.IsPressed($"P{port} {Inputs.MouseLeftButton}")) { - currentPort.Buttons |= LibPUAE.AllButtons.Button1; + currentPort.Buttons |= LibPUAE.AllButtons.Button_1; } if (controller.IsPressed($"P{port} {Inputs.MouseRightButton}")) { - currentPort.Buttons |= LibPUAE.AllButtons.Button2; + currentPort.Buttons |= LibPUAE.AllButtons.Button_2; } if (controller.IsPressed($"P{port} {Inputs.MouseMiddleButton}")) { - currentPort.Buttons |= LibPUAE.AllButtons.Button3; + currentPort.Buttons |= LibPUAE.AllButtons.Button_3; } currentPort.MouseX = controller.AxisValue($"P{port} {Inputs.MouseX}"); @@ -188,18 +188,18 @@ namespace BizHawk.Emulation.Cores.Computers.Amiga } } - if (controller.IsPressed(Inputs.Eject)) + if (controller.IsPressed(Inputs.EjectDisk)) { if (!_ejectPressed) { - fi.Action = LibPUAE.DriveAction.Eject; + fi.Action = LibPUAE.DriveAction.EjectDisk; } } - else if (controller.IsPressed(Inputs.Insert)) + else if (controller.IsPressed(Inputs.InsertDisk)) { if (!_insertPressed) { - fi.Action = LibPUAE.DriveAction.Insert; + fi.Action = LibPUAE.DriveAction.InsertDisk; unsafe { var str = FileNames.FD + _currentSlot; @@ -235,8 +235,8 @@ namespace BizHawk.Emulation.Cores.Computers.Amiga } } - _ejectPressed = controller.IsPressed(Inputs.Eject); - _insertPressed = controller.IsPressed(Inputs.Insert); + _ejectPressed = controller.IsPressed(Inputs.EjectDisk); + _insertPressed = controller.IsPressed(Inputs.InsertDisk); _nextSlotPressed = controller.IsPressed(Inputs.NextSlot); _nextDrivePressed = controller.IsPressed(Inputs.NextDrive); fi.CurrentDrive = _currentDrive;