diff --git a/Assets/dll/puae.wbx.zst b/Assets/dll/puae.wbx.zst index 8593f89fcc9..f93a0daa0f2 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 e02f9b40018..5f0862a63f8 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Amiga/LibPUAE.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Amiga/LibPUAE.cs @@ -57,6 +57,9 @@ public abstract class LibPUAE : LibWaterboxCore [BizImport(CC, Compatibility = true)] public abstract bool Init(int argc, string[] argv); + [BizImport(CC)] + public abstract void SetLEDCallback(EmptyCallback callback); + [StructLayout(LayoutKind.Sequential)] public new class FrameInfo : LibWaterboxCore.FrameInfo { diff --git a/src/BizHawk.Emulation.Cores/Computers/Amiga/PUAE.cs b/src/BizHawk.Emulation.Cores/Computers/Amiga/PUAE.cs index 7a9d48023bf..fd9368cd589 100644 --- a/src/BizHawk.Emulation.Cores/Computers/Amiga/PUAE.cs +++ b/src/BizHawk.Emulation.Cores/Computers/Amiga/PUAE.cs @@ -38,9 +38,10 @@ public partial class PUAE : WaterboxCore DefaultFpsNumerator = LibPUAE.PUAE_VIDEO_NUMERATOR_NTSC, DefaultFpsDenominator = LibPUAE.PUAE_VIDEO_DENOMINATOR_NTSC }; - - private string _chipsetCompatible = ""; + + private readonly LibWaterboxCore.EmptyCallback _ledCallback; private readonly List _roms; + private const int _messageDuration = 4; private List _args; private List _drives; private int _currentDrive; @@ -50,11 +51,14 @@ public partial class PUAE : WaterboxCore private bool _nextSlotPressed; private bool _nextDrivePressed; private int _correctedWidth; - private const int _messageDuration = 4; - + private string _chipsetCompatible = ""; + public override int VirtualWidth => _correctedWidth; private string GetFullName(IRomAsset rom) => rom.Game.Name + rom.Extension; - public override int VirtualWidth => _correctedWidth; + private void LEDCallback() + { + DriveLightOn = true; + } [CoreConstructor(VSystemID.Raw.Amiga)] public PUAE(CoreLoadParameters lp) @@ -71,10 +75,12 @@ public PUAE(CoreLoadParameters lp) _syncSettings.ControllerPort2 ]; _drives = new(_syncSettings.FloppyDrives); + DriveLightEnabled = _syncSettings.FloppyDrives > 0; UpdateAspectRatio(_syncSettings); CreateArguments(_syncSettings); ControllerDefinition = CreateControllerDefinition(_syncSettings); + _ledCallback = LEDCallback; var puae = PreInit(new WaterboxOptions { @@ -86,7 +92,7 @@ public PUAE(CoreLoadParameters lp) MmapHeapSizeKB = 20 * 1024, SkipCoreConsistencyCheck = lp.Comm.CorePreferences.HasFlag(CoreComm.CorePreferencesFlags.WaterboxCoreConsistencyCheck), SkipMemoryConsistencyCheck = lp.Comm.CorePreferences.HasFlag(CoreComm.CorePreferencesFlags.WaterboxMemoryConsistencyCheck), - }); + }, new Delegate[] { _ledCallback }); for (var index = 0; index < lp.Roms.Count; index++) { @@ -124,10 +130,13 @@ public PUAE(CoreLoadParameters lp) } PostInit(); + + puae.SetLEDCallback(_syncSettings.FloppyDrives > 0 ? _ledCallback : null); } protected override LibWaterboxCore.FrameInfo FrameAdvancePrep(IController controller, bool render, bool rendersound) { + DriveLightOn = false; var fi = new LibPUAE.FrameInfo { Port1 = new LibPUAE.ControllerState diff --git a/waterbox/uae/bizhawk.c b/waterbox/uae/bizhawk.c index 5a5919ebc62..a884cc5b760 100644 --- a/waterbox/uae/bizhawk.c +++ b/waterbox/uae/bizhawk.c @@ -135,8 +135,13 @@ ECL_EXPORT void GetMemoryAreas(MemoryArea *m) m[2].Flags = MEMORYAREA_FLAGS_WORDSIZE1 | MEMORYAREA_FLAGS_WRITABLE; } -void (*InputCallback)(); +void (*LEDCallback)(); +ECL_EXPORT void SetLEDCallback(void (*callback)()) +{ + LEDCallback = callback; +} +void (*InputCallback)(); ECL_EXPORT void SetInputCallback(void (*callback)()) { InputCallback = callback; diff --git a/waterbox/uae/libretro-uae b/waterbox/uae/libretro-uae index 4f86a8dd1b2..ccecb1ead64 160000 --- a/waterbox/uae/libretro-uae +++ b/waterbox/uae/libretro-uae @@ -1 +1 @@ -Subproject commit 4f86a8dd1b222c6bad65a892f79dafe444e40776 +Subproject commit ccecb1ead642c1bbe391308b88a7ffa9478b918d