From fe776eab2bf28aea3f8c04c2ef3fc0db84c55b2c Mon Sep 17 00:00:00 2001 From: adelikat Date: Mon, 8 Jun 2015 20:56:29 +0000 Subject: [PATCH] Apple II - hackery to make prev/next disk buttons stay held, as opposed to swaping rapidly ever frame --- .../Computers/AppleII/AppleII.cs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.cs b/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.cs index b4479d41d3..efd0f8aa2c 100644 --- a/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.cs +++ b/BizHawk.Emulation.Cores/Computers/AppleII/AppleII.cs @@ -124,17 +124,32 @@ namespace BizHawk.Emulation.Cores.Computers.AppleII public bool DriveLightEnabled { get { return true; } } public bool DriveLightOn { get { return _machine.DriveLight; } } + private bool _nextPressed = false; + private bool _prevPressed = false; + private void FrameAdv(bool render, bool rendersound) { - if (Controller["Next Disk"]) + if (Controller["Next Disk"] && !_nextPressed) { + _nextPressed = true; IncrementDisk(); } - else if (Controller["Previous Disk"]) + else if (Controller["Previous Disk"] && !_prevPressed) { + _prevPressed = true; DecrementDisk(); } + if (!Controller["Next Disk"]) + { + _nextPressed = false; + } + + if (!Controller["Previous Disk"]) + { + _prevPressed = false; + } + _machine.BizFrameAdvance(RealButtons.Where(b => Controller[b])); if (IsLagFrame) {