2017-11-28 19:28:22 +00:00
|
|
|
|
using BizHawk.Common;
|
2017-11-23 17:26:15 +00:00
|
|
|
|
using BizHawk.Emulation.Cores.Components.Z80A;
|
|
|
|
|
|
|
|
|
|
namespace BizHawk.Emulation.Cores.Computers.SinclairSpectrum
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The abstract class that all emulated models will inherit from
|
|
|
|
|
/// * Main properties / fields / contruction*
|
|
|
|
|
/// </summary>
|
|
|
|
|
public abstract partial class SpectrumBase
|
2017-12-05 10:02:57 +00:00
|
|
|
|
{
|
2018-03-13 13:09:44 +00:00
|
|
|
|
#region Devices
|
2018-03-08 16:50:56 +00:00
|
|
|
|
|
2017-11-23 17:26:15 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The calling ZXSpectrum class (piped in via constructor)
|
|
|
|
|
/// </summary>
|
2017-11-24 18:43:04 +00:00
|
|
|
|
public ZXSpectrum Spectrum { get; set; }
|
2017-11-23 17:26:15 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Reference to the instantiated Z80 cpu (piped in via constructor)
|
|
|
|
|
/// </summary>
|
2017-11-24 18:43:04 +00:00
|
|
|
|
public Z80A CPU { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// ROM and extended info
|
|
|
|
|
/// </summary>
|
|
|
|
|
public RomData RomData { get; set; }
|
2017-11-23 17:26:15 +00:00
|
|
|
|
|
2017-12-11 12:54:48 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The emulated ULA device
|
|
|
|
|
/// </summary>
|
2018-05-31 16:54:57 +00:00
|
|
|
|
//public ULABase ULADevice { get; set; }
|
|
|
|
|
public ULA ULADevice { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Monitors CPU cycles
|
|
|
|
|
/// </summary>
|
|
|
|
|
public CPUMonitor CPUMon { get; set; }
|
2017-12-11 12:54:48 +00:00
|
|
|
|
|
2017-11-23 17:26:15 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The spectrum buzzer/beeper
|
|
|
|
|
/// </summary>
|
2018-03-07 17:40:15 +00:00
|
|
|
|
public IBeeperDevice BuzzerDevice { get; set; }
|
2017-11-23 17:26:15 +00:00
|
|
|
|
|
2018-03-27 13:12:51 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// A second beeper for the tape
|
|
|
|
|
/// </summary>
|
|
|
|
|
public IBeeperDevice TapeBuzzer { get; set; }
|
|
|
|
|
|
2017-12-05 13:08:47 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Device representing the AY-3-8912 chip found in the 128k and up spectrums
|
|
|
|
|
/// </summary>
|
2018-03-13 14:00:29 +00:00
|
|
|
|
public IPSG AYDevice { get; set; }
|
2017-12-05 13:08:47 +00:00
|
|
|
|
|
2017-11-23 17:26:15 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The spectrum keyboard
|
|
|
|
|
/// </summary>
|
|
|
|
|
public virtual IKeyboard KeyboardDevice { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The spectrum datacorder device
|
|
|
|
|
/// </summary>
|
2018-02-14 12:21:02 +00:00
|
|
|
|
public virtual DatacorderDevice TapeDevice { get; set; }
|
2017-11-23 17:26:15 +00:00
|
|
|
|
|
2018-04-26 11:54:10 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// The +3 built-in disk drive
|
|
|
|
|
/// </summary>
|
|
|
|
|
public virtual NECUPD765 UPDDiskDevice { get; set; }
|
|
|
|
|
|
2017-11-24 18:43:04 +00:00
|
|
|
|
/// <summary>
|
2018-03-06 15:47:14 +00:00
|
|
|
|
/// Holds the currently selected joysticks
|
2017-11-24 18:43:04 +00:00
|
|
|
|
/// </summary>
|
2018-03-06 15:47:14 +00:00
|
|
|
|
public virtual IJoystick[] JoystickCollection { get; set; }
|
2018-03-13 13:09:44 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// +3/2a printer port strobe
|
|
|
|
|
/// </summary>
|
|
|
|
|
protected bool PrinterPortStrobe;
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region Emulator State
|
|
|
|
|
|
2017-11-23 17:26:15 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Signs whether the frame has ended
|
|
|
|
|
/// </summary>
|
|
|
|
|
public bool FrameCompleted;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Overflow from the previous frame (in Z80 cycles)
|
|
|
|
|
/// </summary>
|
|
|
|
|
public int OverFlow;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The total number of frames rendered
|
|
|
|
|
/// </summary>
|
|
|
|
|
public int FrameCount;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// The current cycle (T-State) that we are at in the frame
|
|
|
|
|
/// </summary>
|
2018-03-18 13:55:56 +00:00
|
|
|
|
public long _frameCycles;
|
2017-11-23 17:26:15 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Stores where we are in the frame after each CPU cycle
|
|
|
|
|
/// </summary>
|
2018-03-18 13:55:56 +00:00
|
|
|
|
public long LastFrameStartCPUTick;
|
2017-11-23 17:26:15 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Gets the current frame cycle according to the CPU tick count
|
|
|
|
|
/// </summary>
|
2018-03-18 13:55:56 +00:00
|
|
|
|
public virtual long CurrentFrameCycle => CPU.TotalExecutedCycles - LastFrameStartCPUTick;
|
2017-11-23 17:26:15 +00:00
|
|
|
|
|
2018-03-07 12:21:36 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Non-Deterministic bools
|
|
|
|
|
/// </summary>
|
|
|
|
|
public bool _render;
|
|
|
|
|
public bool _renderSound;
|
|
|
|
|
|
2018-03-13 13:09:44 +00:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region Constants
|
|
|
|
|
|
2017-11-23 17:26:15 +00:00
|
|
|
|
/// <summary>
|
2018-03-13 13:09:44 +00:00
|
|
|
|
/// Mask constants & misc
|
2017-11-23 17:26:15 +00:00
|
|
|
|
/// </summary>
|
|
|
|
|
protected const int BORDER_BIT = 0x07;
|
|
|
|
|
protected const int EAR_BIT = 0x10;
|
|
|
|
|
protected const int MIC_BIT = 0x08;
|
|
|
|
|
protected const int TAPE_BIT = 0x40;
|
2017-12-07 10:49:43 +00:00
|
|
|
|
protected const int AY_SAMPLE_RATE = 16;
|
|
|
|
|
|
2018-03-13 13:09:44 +00:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region Emulation Loop
|
|
|
|
|
|
2017-11-23 17:26:15 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Executes a single frame
|
|
|
|
|
/// </summary>
|
2018-03-07 12:21:36 +00:00
|
|
|
|
public virtual void ExecuteFrame(bool render, bool renderSound)
|
2017-11-23 17:26:15 +00:00
|
|
|
|
{
|
2018-06-11 13:35:12 +00:00
|
|
|
|
ULADevice.FrameEnd = false;
|
|
|
|
|
ULADevice.ULACycleCounter = CurrentFrameCycle;
|
|
|
|
|
|
2018-03-06 17:57:13 +00:00
|
|
|
|
InputRead = false;
|
2018-03-07 12:21:36 +00:00
|
|
|
|
_render = render;
|
|
|
|
|
_renderSound = renderSound;
|
2018-03-06 17:57:13 +00:00
|
|
|
|
|
2017-11-23 17:26:15 +00:00
|
|
|
|
FrameCompleted = false;
|
2018-03-07 12:21:36 +00:00
|
|
|
|
|
2019-01-02 14:02:09 +00:00
|
|
|
|
//if (UPDDiskDevice == null || !UPDDiskDevice.FDD_IsDiskLoaded)
|
|
|
|
|
//TapeDevice.StartFrame();
|
2018-03-19 15:34:25 +00:00
|
|
|
|
|
2018-03-07 12:21:36 +00:00
|
|
|
|
if (_renderSound)
|
|
|
|
|
{
|
2018-03-15 16:32:26 +00:00
|
|
|
|
if (AYDevice != null)
|
2018-03-07 12:21:36 +00:00
|
|
|
|
AYDevice.StartFrame();
|
|
|
|
|
}
|
2017-12-07 10:49:43 +00:00
|
|
|
|
|
2017-12-11 14:08:00 +00:00
|
|
|
|
PollInput();
|
2018-03-13 13:09:44 +00:00
|
|
|
|
|
2018-06-11 13:35:12 +00:00
|
|
|
|
for (;;)
|
2017-11-23 17:26:15 +00:00
|
|
|
|
{
|
2018-06-11 13:35:12 +00:00
|
|
|
|
// run the CPU Monitor cycle
|
2018-06-05 16:14:37 +00:00
|
|
|
|
CPUMon.ExecuteCycle();
|
2018-06-07 14:33:58 +00:00
|
|
|
|
|
2018-03-27 13:12:51 +00:00
|
|
|
|
// cycle the tape device
|
2018-04-27 09:57:54 +00:00
|
|
|
|
if (UPDDiskDevice == null || !UPDDiskDevice.FDD_IsDiskLoaded)
|
|
|
|
|
TapeDevice.TapeCycle();
|
2018-06-11 13:35:12 +00:00
|
|
|
|
|
|
|
|
|
// has frame end been reached?
|
|
|
|
|
if (ULADevice.FrameEnd)
|
|
|
|
|
break;
|
2017-12-07 10:49:43 +00:00
|
|
|
|
}
|
2018-03-13 13:09:44 +00:00
|
|
|
|
|
2018-05-31 16:54:57 +00:00
|
|
|
|
OverFlow = (int)CurrentFrameCycle - ULADevice.FrameLength;
|
|
|
|
|
|
2017-11-23 17:26:15 +00:00
|
|
|
|
// we have reached the end of a frame
|
|
|
|
|
LastFrameStartCPUTick = CPU.TotalExecutedCycles - OverFlow;
|
|
|
|
|
|
2018-05-31 16:54:57 +00:00
|
|
|
|
ULADevice.LastTState = 0;
|
2017-11-23 17:26:15 +00:00
|
|
|
|
|
2018-03-15 16:32:26 +00:00
|
|
|
|
if (AYDevice != null)
|
|
|
|
|
AYDevice.EndFrame();
|
|
|
|
|
|
2017-11-23 17:26:15 +00:00
|
|
|
|
FrameCount++;
|
2018-05-31 16:54:57 +00:00
|
|
|
|
|
2018-04-27 09:57:54 +00:00
|
|
|
|
if (UPDDiskDevice == null || !UPDDiskDevice.FDD_IsDiskLoaded)
|
|
|
|
|
TapeDevice.EndFrame();
|
2018-03-05 16:12:19 +00:00
|
|
|
|
|
2017-11-23 17:26:15 +00:00
|
|
|
|
FrameCompleted = true;
|
2018-03-06 17:57:13 +00:00
|
|
|
|
|
|
|
|
|
// is this a lag frame?
|
|
|
|
|
Spectrum.IsLagFrame = !InputRead;
|
2018-05-01 16:32:35 +00:00
|
|
|
|
|
2018-06-11 13:35:12 +00:00
|
|
|
|
// FDC debug
|
2018-05-01 16:32:35 +00:00
|
|
|
|
if (UPDDiskDevice != null && UPDDiskDevice.writeDebug)
|
|
|
|
|
{
|
|
|
|
|
// only write UPD log every second
|
|
|
|
|
if (FrameCount % 10 == 0)
|
2018-06-19 10:42:08 +00:00
|
|
|
|
{
|
|
|
|
|
System.IO.File.AppendAllLines(UPDDiskDevice.outputfile, UPDDiskDevice.dLog);
|
|
|
|
|
UPDDiskDevice.dLog = new System.Collections.Generic.List<string>();
|
|
|
|
|
//System.IO.File.WriteAllText(UPDDiskDevice.outputfile, UPDDiskDevice.outputString);
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-11-23 17:26:15 +00:00
|
|
|
|
}
|
2018-03-13 13:09:44 +00:00
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region Reset Functions
|
|
|
|
|
|
2017-11-23 17:26:15 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Hard reset of the emulated machine
|
|
|
|
|
/// </summary>
|
|
|
|
|
public virtual void HardReset()
|
2018-03-13 13:09:44 +00:00
|
|
|
|
{
|
2018-06-11 13:35:12 +00:00
|
|
|
|
//ULADevice.ResetInterrupt();
|
2018-03-19 16:21:15 +00:00
|
|
|
|
ROMPaged = 0;
|
|
|
|
|
SpecialPagingMode = false;
|
|
|
|
|
RAMPaged = 0;
|
|
|
|
|
CPU.RegPC = 0;
|
|
|
|
|
|
|
|
|
|
Spectrum.SetCpuRegister("SP", 0xFFFF);
|
|
|
|
|
Spectrum.SetCpuRegister("IY", 0xFFFF);
|
|
|
|
|
Spectrum.SetCpuRegister("IX", 0xFFFF);
|
|
|
|
|
Spectrum.SetCpuRegister("AF", 0xFFFF);
|
|
|
|
|
Spectrum.SetCpuRegister("BC", 0xFFFF);
|
|
|
|
|
Spectrum.SetCpuRegister("DE", 0xFFFF);
|
|
|
|
|
Spectrum.SetCpuRegister("HL", 0xFFFF);
|
|
|
|
|
Spectrum.SetCpuRegister("SP", 0xFFFF);
|
|
|
|
|
Spectrum.SetCpuRegister("Shadow AF", 0xFFFF);
|
|
|
|
|
Spectrum.SetCpuRegister("Shadow BC", 0xFFFF);
|
|
|
|
|
Spectrum.SetCpuRegister("Shadow DE", 0xFFFF);
|
|
|
|
|
Spectrum.SetCpuRegister("Shadow HL", 0xFFFF);
|
|
|
|
|
|
|
|
|
|
CPU.Regs[CPU.I] = 0;
|
|
|
|
|
CPU.Regs[CPU.R] = 0;
|
|
|
|
|
|
|
|
|
|
TapeDevice.Reset();
|
|
|
|
|
if (AYDevice != null)
|
|
|
|
|
AYDevice.Reset();
|
2018-03-20 15:28:23 +00:00
|
|
|
|
|
|
|
|
|
byte[][] rams = new byte[][]
|
|
|
|
|
{
|
|
|
|
|
RAM0,
|
|
|
|
|
RAM1,
|
|
|
|
|
RAM2,
|
|
|
|
|
RAM3,
|
|
|
|
|
RAM4,
|
|
|
|
|
RAM5,
|
|
|
|
|
RAM6,
|
|
|
|
|
RAM7
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
foreach (var r in rams)
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < r.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
r[i] = 0x00;
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-11-23 17:26:15 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Soft reset of the emulated machine
|
|
|
|
|
/// </summary>
|
|
|
|
|
public virtual void SoftReset()
|
|
|
|
|
{
|
2018-06-11 13:35:12 +00:00
|
|
|
|
//ULADevice.ResetInterrupt();
|
2018-03-19 16:21:15 +00:00
|
|
|
|
ROMPaged = 0;
|
|
|
|
|
SpecialPagingMode = false;
|
|
|
|
|
RAMPaged = 0;
|
2018-03-13 22:09:46 +00:00
|
|
|
|
CPU.RegPC = 0;
|
2018-03-19 16:21:15 +00:00
|
|
|
|
|
|
|
|
|
Spectrum.SetCpuRegister("SP", 0xFFFF);
|
|
|
|
|
Spectrum.SetCpuRegister("IY", 0xFFFF);
|
|
|
|
|
Spectrum.SetCpuRegister("IX", 0xFFFF);
|
|
|
|
|
Spectrum.SetCpuRegister("AF", 0xFFFF);
|
|
|
|
|
Spectrum.SetCpuRegister("BC", 0xFFFF);
|
|
|
|
|
Spectrum.SetCpuRegister("DE", 0xFFFF);
|
|
|
|
|
Spectrum.SetCpuRegister("HL", 0xFFFF);
|
|
|
|
|
Spectrum.SetCpuRegister("SP", 0xFFFF);
|
|
|
|
|
Spectrum.SetCpuRegister("Shadow AF", 0xFFFF);
|
|
|
|
|
Spectrum.SetCpuRegister("Shadow BC", 0xFFFF);
|
|
|
|
|
Spectrum.SetCpuRegister("Shadow DE", 0xFFFF);
|
|
|
|
|
Spectrum.SetCpuRegister("Shadow HL", 0xFFFF);
|
|
|
|
|
|
|
|
|
|
CPU.Regs[CPU.I] = 0;
|
|
|
|
|
CPU.Regs[CPU.R] = 0;
|
|
|
|
|
|
|
|
|
|
TapeDevice.Reset();
|
|
|
|
|
if (AYDevice != null)
|
|
|
|
|
AYDevice.Reset();
|
2018-03-20 15:28:23 +00:00
|
|
|
|
|
|
|
|
|
byte[][] rams = new byte[][]
|
|
|
|
|
{
|
|
|
|
|
RAM0,
|
|
|
|
|
RAM1,
|
|
|
|
|
RAM2,
|
|
|
|
|
RAM3,
|
|
|
|
|
RAM4,
|
|
|
|
|
RAM5,
|
|
|
|
|
RAM6,
|
|
|
|
|
RAM7
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
foreach (var r in rams)
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < r.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
r[i] = 0x00;
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-11-23 17:26:15 +00:00
|
|
|
|
}
|
2017-11-28 19:28:22 +00:00
|
|
|
|
|
2018-03-13 13:09:44 +00:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region IStatable
|
|
|
|
|
|
2017-11-28 19:28:22 +00:00
|
|
|
|
public void SyncState(Serializer ser)
|
|
|
|
|
{
|
|
|
|
|
ser.BeginSection("ZXMachine");
|
2019-03-28 03:18:58 +00:00
|
|
|
|
ser.Sync(nameof(FrameCompleted), ref FrameCompleted);
|
|
|
|
|
ser.Sync(nameof(OverFlow), ref OverFlow);
|
|
|
|
|
ser.Sync(nameof(FrameCount), ref FrameCount);
|
|
|
|
|
ser.Sync(nameof(_frameCycles), ref _frameCycles);
|
|
|
|
|
ser.Sync(nameof(inputRead), ref inputRead);
|
|
|
|
|
ser.Sync(nameof(LastFrameStartCPUTick), ref LastFrameStartCPUTick);
|
|
|
|
|
ser.Sync(nameof(LastULAOutByte), ref LastULAOutByte);
|
|
|
|
|
ser.Sync(nameof(ROM0), ref ROM0, false);
|
|
|
|
|
ser.Sync(nameof(ROM1), ref ROM1, false);
|
|
|
|
|
ser.Sync(nameof(ROM2), ref ROM2, false);
|
|
|
|
|
ser.Sync(nameof(ROM3), ref ROM3, false);
|
|
|
|
|
ser.Sync(nameof(RAM0), ref RAM0, false);
|
|
|
|
|
ser.Sync(nameof(RAM1), ref RAM1, false);
|
|
|
|
|
ser.Sync(nameof(RAM2), ref RAM2, false);
|
|
|
|
|
ser.Sync(nameof(RAM3), ref RAM3, false);
|
|
|
|
|
ser.Sync(nameof(RAM4), ref RAM4, false);
|
|
|
|
|
ser.Sync(nameof(RAM5), ref RAM5, false);
|
|
|
|
|
ser.Sync(nameof(RAM6), ref RAM6, false);
|
|
|
|
|
ser.Sync(nameof(RAM7), ref RAM7, false);
|
|
|
|
|
ser.Sync(nameof(ROMPaged), ref ROMPaged);
|
|
|
|
|
ser.Sync(nameof(SHADOWPaged), ref SHADOWPaged);
|
|
|
|
|
ser.Sync(nameof(RAMPaged), ref RAMPaged);
|
|
|
|
|
ser.Sync(nameof(PagingDisabled), ref PagingDisabled);
|
|
|
|
|
ser.Sync(nameof(SpecialPagingMode), ref SpecialPagingMode);
|
|
|
|
|
ser.Sync(nameof(PagingConfiguration), ref PagingConfiguration);
|
|
|
|
|
ser.Sync(nameof(ROMhigh), ref ROMhigh);
|
|
|
|
|
ser.Sync(nameof(ROMlow), ref ROMlow);
|
|
|
|
|
ser.Sync(nameof(LastContendedReadByte), ref LastContendedReadByte);
|
2017-11-28 19:28:22 +00:00
|
|
|
|
|
|
|
|
|
KeyboardDevice.SyncState(ser);
|
|
|
|
|
BuzzerDevice.SyncState(ser);
|
2018-03-27 13:12:51 +00:00
|
|
|
|
TapeBuzzer.SyncState(ser);
|
2017-12-11 14:35:27 +00:00
|
|
|
|
ULADevice.SyncState(ser);
|
2018-06-13 10:53:05 +00:00
|
|
|
|
CPUMon.SyncState(ser);
|
2017-11-28 19:28:22 +00:00
|
|
|
|
|
2017-12-05 13:08:47 +00:00
|
|
|
|
if (AYDevice != null)
|
2018-03-19 23:53:06 +00:00
|
|
|
|
{
|
2017-12-05 13:08:47 +00:00
|
|
|
|
AYDevice.SyncState(ser);
|
2018-05-08 19:20:55 +00:00
|
|
|
|
((AY38912)AYDevice as AY38912).PanningConfiguration = Spectrum.Settings.AYPanConfig;
|
2018-03-19 23:53:06 +00:00
|
|
|
|
}
|
2017-12-05 13:08:47 +00:00
|
|
|
|
|
2019-03-28 03:18:58 +00:00
|
|
|
|
ser.Sync(nameof(tapeMediaIndex), ref tapeMediaIndex);
|
2018-05-03 18:41:33 +00:00
|
|
|
|
if (ser.IsReader)
|
2018-08-06 12:00:57 +00:00
|
|
|
|
{
|
|
|
|
|
IsLoadState = true;
|
2018-05-03 18:41:33 +00:00
|
|
|
|
TapeMediaIndex = tapeMediaIndex;
|
2018-08-06 12:00:57 +00:00
|
|
|
|
IsLoadState = false;
|
|
|
|
|
}
|
|
|
|
|
|
2018-03-05 11:17:22 +00:00
|
|
|
|
|
2018-05-03 18:53:42 +00:00
|
|
|
|
TapeDevice.SyncState(ser);
|
|
|
|
|
|
2019-03-28 03:18:58 +00:00
|
|
|
|
ser.Sync(nameof(diskMediaIndex), ref diskMediaIndex);
|
2018-05-03 18:41:33 +00:00
|
|
|
|
if (ser.IsReader)
|
2018-08-06 12:00:57 +00:00
|
|
|
|
{
|
|
|
|
|
IsLoadState = true;
|
2018-05-03 18:41:33 +00:00
|
|
|
|
DiskMediaIndex = diskMediaIndex;
|
2018-08-06 12:00:57 +00:00
|
|
|
|
IsLoadState = false;
|
|
|
|
|
}
|
2018-03-05 11:17:22 +00:00
|
|
|
|
|
2018-05-03 18:53:42 +00:00
|
|
|
|
if (UPDDiskDevice != null)
|
|
|
|
|
{
|
|
|
|
|
UPDDiskDevice.SyncState(ser);
|
|
|
|
|
}
|
2017-12-07 10:49:43 +00:00
|
|
|
|
|
2017-11-28 19:28:22 +00:00
|
|
|
|
ser.EndSection();
|
|
|
|
|
}
|
2018-03-13 13:09:44 +00:00
|
|
|
|
|
|
|
|
|
#endregion
|
2017-11-23 17:26:15 +00:00
|
|
|
|
}
|
|
|
|
|
}
|