diff --git a/Assets/dll/puae.wbx.zst b/Assets/dll/puae.wbx.zst index cb1463a53f..04123a73b5 100644 Binary files a/Assets/dll/puae.wbx.zst and b/Assets/dll/puae.wbx.zst differ diff --git a/src/BizHawk.Emulation.Cores/Computers/Amiga/LibPUAE.cs b/src/BizHawk.Emulation.Cores/Computers/Amiga/LibPUAE.cs index 25fa6adcb5..cca7c26feb 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Amiga/LibPUAE.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Amiga/LibPUAE.cs @@ -16,6 +16,14 @@ namespace BizHawk.Emulation.Cores.Computers.Amiga public const int MAX_FLOPPIES = 4; public const int FILENAME_MAXLENGTH = 64; public const int KEY_COUNT = 0x68; + public const byte b00000001 = 1 << 0; + public const byte b00000010 = 1 << 1; + public const byte b00000100 = 1 << 2; + public const byte b00001000 = 1 << 3; + public const byte b00010000 = 1 << 4; + public const byte b00100000 = 1 << 5; + public const byte b01000000 = 1 << 6; + public const byte b10000000 = 1 << 7; [BizImport(CC, Compatibility = true)] public abstract bool Init(int argc, string[] argv); @@ -43,21 +51,21 @@ namespace BizHawk.Emulation.Cores.Computers.Amiga public enum DriveAction : int { - NONE, - EJECT, - INSERT + None, + Eject, + Insert } [Flags] public enum PUAEJoystick : byte { - Joystick_Up = 1 << 0, - Joystick_Down = 1 << 1, - Joystick_Left = 1 << 2, - Joystick_Right = 1 << 3, - Joystick_Button_1 = 1 << 4, - Joystick_Button_2 = 1 << 5, - Joystick_Button_3 = 1 << 6 + Joystick_Up = b00000001, + Joystick_Down = b00000010, + Joystick_Left = b00000100, + Joystick_Right = b00001000, + Joystick_Button_1 = b00010000, + Joystick_Button_2 = b00100000, + Joystick_Button_3 = b01000000 } // https://wiki.amigaos.net/wiki/Keymap_Library diff --git a/src/BizHawk.Emulation.Cores/Computers/Amiga/PUAE.cs b/src/BizHawk.Emulation.Cores/Computers/Amiga/PUAE.cs index ba1777534d..112b924ed2 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Amiga/PUAE.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Amiga/PUAE.cs @@ -112,12 +112,12 @@ namespace BizHawk.Emulation.Cores.Computers.Amiga controller.BoolButtons.AddRange( [ - Inputs.MLB, Inputs.MMB, Inputs.MRB + Inputs.MouseLeftButton, Inputs.MouseMIddleButton, Inputs.MouseRightButton ]); controller - .AddAxis(Inputs.X, (0).RangeTo(LibPUAE.PAL_WIDTH), LibPUAE.PAL_WIDTH / 2) - .AddAxis(Inputs.Y, (0).RangeTo(LibPUAE.PAL_HEIGHT), LibPUAE.PAL_HEIGHT / 2); + .AddAxis(Inputs.MouseX, (0).RangeTo(LibPUAE.PAL_WIDTH), LibPUAE.PAL_WIDTH / 2) + .AddAxis(Inputs.MouseY, (0).RangeTo(LibPUAE.PAL_HEIGHT), LibPUAE.PAL_HEIGHT / 2); foreach (var b in controller.BoolButtons) { @@ -129,7 +129,7 @@ namespace BizHawk.Emulation.Cores.Computers.Amiga controller.BoolButtons.AddRange( [ - Inputs.Eject, Inputs.Insert, Inputs.NextDrive, Inputs.NextSlot + Inputs.NextDrive, Inputs.NextSlot, Inputs.Insert, Inputs.Eject ]); foreach (var b in Enum.GetValues(typeof(LibPUAE.PUAEKeyboard))) @@ -147,7 +147,7 @@ namespace BizHawk.Emulation.Cores.Computers.Amiga var fi = new LibPUAE.FrameInfo { MouseButtons = 0, - Action = LibPUAE.DriveAction.NONE + Action = LibPUAE.DriveAction.None }; foreach (var b in Enum.GetValues(typeof(LibPUAE.PUAEJoystick))) @@ -158,31 +158,33 @@ namespace BizHawk.Emulation.Cores.Computers.Amiga } } - if (controller.IsPressed(Inputs.MLB)) + if (controller.IsPressed(Inputs.MouseLeftButton)) { - fi.MouseButtons |= 1 << 0; + fi.MouseButtons |= LibPUAE.b00000001; } - if (controller.IsPressed(Inputs.MRB)) + if (controller.IsPressed(Inputs.MouseRightButton)) { - fi.MouseButtons |= 1 << 1; + fi.MouseButtons |= LibPUAE.b00000010; } - if (controller.IsPressed(Inputs.MMB)) + if (controller.IsPressed(Inputs.MouseMIddleButton)) { - fi.MouseButtons |= 1 << 2; + fi.MouseButtons |= LibPUAE.b00000100; } + fi.MouseX = controller.AxisValue(Inputs.MouseX); + fi.MouseY = controller.AxisValue(Inputs.MouseY); if (controller.IsPressed(Inputs.Eject)) { if (!_ejectPressed) { - fi.Action = LibPUAE.DriveAction.EJECT; + fi.Action = LibPUAE.DriveAction.Eject; } } else if (controller.IsPressed(Inputs.Insert)) { if (!_insertPressed) { - fi.Action = LibPUAE.DriveAction.INSERT; + fi.Action = LibPUAE.DriveAction.Insert; unsafe { string str = FileNames.FD + _currentSlot; @@ -211,18 +213,14 @@ namespace BizHawk.Emulation.Cores.Computers.Amiga { _currentDrive++; _currentDrive %= _syncSettings.FloppyDrives; - _comm.Notify($"Selected FD{ _currentDrive } Drive", null); + _comm.Notify($"Selected FD{ _currentDrive }: Drive", null); } } _ejectPressed = controller.IsPressed(Inputs.Eject); _insertPressed = controller.IsPressed(Inputs.Insert); _nextSlotPressed = controller.IsPressed(Inputs.NextSlot); - _nextDrivePressed = controller.IsPressed(Inputs.NextDrive); - + _nextDrivePressed = controller.IsPressed(Inputs.NextDrive); fi.CurrentDrive = _currentDrive; - - fi.MouseX = controller.AxisValue(Inputs.X); - fi.MouseY = controller.AxisValue(Inputs.Y); foreach (var b in Enum.GetValues(typeof(LibPUAE.PUAEKeyboard))) { @@ -265,11 +263,11 @@ namespace BizHawk.Emulation.Cores.Computers.Amiga private static class Inputs { - public const string MLB = "Mouse Left Button"; - public const string MRB = "Mouse Right Button"; - public const string MMB = "Mouse Middle Button"; - public const string X = "Mouse X"; - public const string Y = "Mouse Y"; + public const string MouseLeftButton = "Mouse Left Button"; + public const string MouseRightButton = "Mouse Right Button"; + 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 NextDrive = "Next Drive"; diff --git a/waterbox/uae/bizhawk.c b/waterbox/uae/bizhawk.c index e81a11b5e4..6a7b927155 100644 --- a/waterbox/uae/bizhawk.c +++ b/waterbox/uae/bizhawk.c @@ -59,6 +59,7 @@ ECL_EXPORT void FrameAdvance(MyFrameInfo* f) } else if (f->Action == ACTION_INSERT) { + disk_eject(f->CurrentDrive); disk_insert_force(f->CurrentDrive, f->FileName, true); log_cb(RETRO_LOG_INFO, "INSERTED FD%d: \"%s\"\n", f->CurrentDrive, f->FileName); }