Clean up handling of Next Disc buttons

This commit is contained in:
YoshiRulz 2025-03-28 06:04:15 +10:00
parent e68aa2e4c3
commit 1bbceeb720
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
1 changed files with 6 additions and 4 deletions

View File

@ -401,23 +401,25 @@ namespace BizHawk.Emulation.Cores.Computers.DOS
// Processing floppy disks swaps
fi.driveActions.insertFloppyDisk = -1;
if (_floppyDiskCount > 1 && controller.IsPressed(Inputs.NextFloppyDisk) && !_nextFloppyDiskPressed)
var nextFloppyDiskWasPressed = _nextFloppyDiskPressed;
_nextFloppyDiskPressed = controller.IsPressed(Inputs.NextFloppyDisk);
if (!nextFloppyDiskWasPressed && _nextFloppyDiskPressed && _floppyDiskCount >= 2)
{
_currentFloppyDisk = (_currentFloppyDisk + 1) % _floppyDiskCount;
fi.driveActions.insertFloppyDisk = _currentFloppyDisk;
CoreComm.Notify($"Insterted FloppyDisk {_currentFloppyDisk}: {GetFullName(_floppyDiskImageFiles[_currentFloppyDisk])} into drive A:", null);
}
_nextFloppyDiskPressed = controller.IsPressed(Inputs.NextFloppyDisk);
// Processing CDROM swaps
fi.driveActions.insertCDROM = -1;
if (_cdRomFileNames.Count > 1 && controller.IsPressed(Inputs.NextCDROM) && !_nextCDROMPressed)
var nextCDROMWasPressed = _nextCDROMPressed;
_nextCDROMPressed = controller.IsPressed(Inputs.NextCDROM);
if (!nextCDROMWasPressed && _nextCDROMPressed && _cdRomFileNames.Count >= 2)
{
_currentCDROM = (_currentCDROM + 1) % _cdRomFileNames.Count;
fi.driveActions.insertCDROM = _currentCDROM;
CoreComm.Notify($"Insterted CDROM {_currentCDROM}: {_cdRomFileNames[_currentCDROM]} into drive D:", null);
}
_nextCDROMPressed = controller.IsPressed(Inputs.NextCDROM);
// Processing keyboard inputs
foreach (var (name, key) in _keyboardMap)