uae: cd swapping will happen later

This commit is contained in:
feos 2024-06-13 19:07:15 +03:00
parent 52fb840b0e
commit 939762d9fb
2 changed files with 17 additions and 45 deletions

View File

@ -28,12 +28,12 @@ namespace BizHawk.Emulation.Common
public ICoreFileProvider CoreFileProvider { get; }
/// <summary>
/// Gets a message to show. reasonably annoying (dialog box), shouldn't be used most of the time
/// Gets a message to show. Reasonably annoying (dialog box), shouldn't be used most of the time
/// </summary>
public Action<string> ShowMessage { get; }
/// <summary>
/// Gets a message to show. less annoying (OSD message). Should be used for ignorable helpful messages
/// Gets a message to show for optional duration in seconds. Less annoying (OSD message). Should be used for ignorable helpful messages
/// </summary>
public Action<string, int?> Notify { get; }

View File

@ -20,12 +20,13 @@ namespace BizHawk.Emulation.Cores.Computers.Amiga
{
internal CoreComm _comm { get; }
private readonly List<IRomAsset> _roms;
private readonly List<IDiscAsset> _discs;
//private readonly List<IDiscAsset> _discs;
private LibPUAE _puae;
private List<string> _args;
private static string _chipsetCompatible = "";
private static int _currentDrive = 0;
private static int _currentSlot = 0;
private string _chipsetCompatible = "";
private int _currentDrive = 0;
private int _currentSlot = 0;
private byte[] _currentRom;
private bool _nextSlotPressed = false;
private bool _nextDrivePressed = false;
@ -45,7 +46,7 @@ namespace BizHawk.Emulation.Cores.Computers.Amiga
{
_comm = lp.Comm;
_roms = lp.Roms;
_discs = lp.Discs;
//_discs = lp.Discs;
_syncSettings = lp.SyncSettings ?? new();
var filesToRemove = new List<string>();
CreateArguments(_syncSettings);
@ -168,41 +169,22 @@ namespace BizHawk.Emulation.Cores.Computers.Amiga
if (!_nextSlotPressed)
{
_currentSlot++;
_currentSlot %= _roms.Count + _discs.Count;
string selectedFile;
if (_currentSlot < _roms.Count)
{
selectedFile = _roms[_currentSlot].Game.Name;
}
else
{
selectedFile = _discs[_currentSlot - _roms.Count].DiscName;
}
_comm.Notify(selectedFile, null);
_currentSlot %= _roms.Count;
var selectedFile = _roms[_currentSlot];
_currentRom = selectedFile.FileData;
_comm.Notify(selectedFile.Game.Name, null);
}
}
_nextSlotPressed = controller.IsPressed(Inputs.NS);
if (controller.IsPressed(Inputs.ND))
{
if (!_nextDrivePressed)
{
_currentDrive++;
_currentDrive %= _syncSettings.FloppyDrives + (_discs.Count > 0 ? 1 : 0);
string selectedDrive;
if (_currentDrive < _syncSettings.FloppyDrives)
{
selectedDrive = "FD" + _currentDrive;
}
else
{
selectedDrive = "CD";
}
_comm.Notify(selectedDrive, null);
_currentDrive %= _syncSettings.FloppyDrives;
_comm.Notify($"Selected FD{ _currentDrive } Drive", null);
}
}
_nextSlotPressed = controller.IsPressed(Inputs.NS);
_nextDrivePressed = controller.IsPressed(Inputs.ND);
fi.MouseX = controller.AxisValue(Inputs.X);
@ -224,24 +206,14 @@ namespace BizHawk.Emulation.Cores.Computers.Amiga
return fi;
}
public void SaveStateBinary(BinaryWriter writer)
protected override void SaveStateBinaryInternal(BinaryWriter writer)
{
using (_exe.EnterExit())
{
_exe.SaveStateBinary(writer);
}
writer.Write(_nextSlotPressed);
writer.Write(_nextDrivePressed);
}
public void LoadStateBinary(BinaryReader reader)
protected override void LoadStateBinaryInternal(BinaryReader reader)
{
using (_exe.EnterExit())
{
_exe.LoadStateBinary(reader);
}
_nextSlotPressed = reader.ReadBoolean();
_nextDrivePressed = reader.ReadBoolean();
}