Added DiskIIDrive.RemoveDisk.

Added DisableResetKey to Keyboard settings.
This commit is contained in:
Sean Fausett 2012-05-20 17:21:38 +12:00
parent 6aa86024d3
commit 5f66151bc5
4 changed files with 30 additions and 16 deletions

View File

@ -58,13 +58,19 @@ namespace Jellyfish.Virtu
public void InsertDisk(string name, Stream stream, bool isWriteProtected)
{
FlushTrack();
// TODO handle null param/empty string for eject, or add Eject()
_disk = Disk525.CreateDisk(name, stream, isWriteProtected);
_trackLoaded = false;
}
public void RemoveDisk()
{
_trackLoaded = false;
_trackChanged = false;
_trackNumber = 0;
_trackOffset = 0;
_disk = null;
}
public void ApplyPhaseChange(int phaseState)
{
// step the drive head according to stepper magnet changes
@ -139,12 +145,12 @@ namespace Jellyfish.Virtu
private readonly int[][] DriveArmStepDelta = new int[PhaseCount][];
private Disk525 _disk;
private bool _trackLoaded;
private bool _trackChanged;
private int _trackNumber;
private int _trackOffset;
private byte[] _trackData = new byte[Disk525.TrackSize];
private Disk525 _disk;
private Random _random = new Random();
}

View File

@ -26,6 +26,8 @@ namespace Jellyfish.Virtu
throw new ArgumentNullException("reader");
}
DisableResetKey = reader.ReadBoolean();
UseGamePort = reader.ReadBoolean();
Joystick0UpLeftKey = reader.ReadInt32();
Joystick0UpKey = reader.ReadInt32();
@ -55,6 +57,8 @@ namespace Jellyfish.Virtu
throw new ArgumentNullException("writer");
}
writer.Write(DisableResetKey);
writer.Write(UseGamePort);
writer.Write(Joystick0UpLeftKey);
writer.Write(Joystick0UpKey);
@ -82,6 +86,8 @@ namespace Jellyfish.Virtu
Strobe = false;
}
public bool DisableResetKey { get; set; }
public bool UseGamePort { get; set; }
public int Joystick0UpLeftKey { get; set; }
public int Joystick0UpKey { get; set; }

View File

@ -158,16 +158,6 @@ namespace Jellyfish.Virtu
}
}
private void Uninitialize()
{
foreach (var component in Components)
{
//_debugService.WriteLine("Uninitializing component '{0}'", component.GetType().Name);
component.Uninitialize();
//_debugService.WriteLine("Uninitialized component '{0}'", component.GetType().Name);
}
}
private void SaveState()
{
_storageService.Save(Machine.StateFileName, stream => SaveState(stream));
@ -188,6 +178,16 @@ namespace Jellyfish.Virtu
}
}
private void Uninitialize()
{
foreach (var component in Components)
{
//_debugService.WriteLine("Uninitializing component '{0}'", component.GetType().Name);
component.Uninitialize();
//_debugService.WriteLine("Uninitialized component '{0}'", component.GetType().Name);
}
}
private void Run() // machine thread
{
//_debugService = Services.GetService<DebugService>();
@ -219,7 +219,7 @@ namespace Jellyfish.Virtu
Uninitialize();
}
public const string Version = "0.9.1.0";
public const string Version = "0.9.2.0";
public MachineEvents Events { get; private set; }
public MachineServices Services { get; private set; }

View File

@ -11,7 +11,9 @@
public virtual void Update() // main thread
{
if (IsResetKeyDown)
var keyboard = Machine.Keyboard;
if (IsResetKeyDown && !keyboard.DisableResetKey)
{
if (!_resetKeyDown)
{