/// <summary> /// Signs that the device has been attached to the Spectrum virtual machine /// </summary> public override void OnAttachedToVm(ISpectrumVm hostVm) { base.OnAttachedToVm(hostVm); _cpu = hostVm?.Cpu; _screenDevice = hostVm?.ScreenDevice; _currentSlot3Bank = 0; }
/// <summary> /// Signs that the device has been attached to the Spectrum virtual machine /// </summary> public void OnAttachedToVm(ISpectrumVm hostVm) { HostVm = hostVm; _cpu = hostVm.Cpu; _screenDevice = hostVm.ScreenDevice; _memory = new byte[0x10000]; }
/// <summary> /// Signs that the device has been attached to the Spectrum virtual machine /// </summary> public void OnAttachedToVm(ISpectrumVm hostVm) { HostVm = hostVm; _cpu = hostVm.Cpu; _beeperDevice = hostVm.BeeperDevice; Reset(); }
/// <summary> /// Signs that the device has been attached to the Spectrum virtual machine /// </summary> public void OnAttachedToVm(ISpectrumVm hostVm) { HostVm = hostVm; _cpu = hostVm.Cpu; _borderDevice = hostVm.BorderDevice; _beeperDevice = hostVm.BeeperDevice; _keyboardDevice = hostVm.KeyboardDevice; _tapeDevice = hostVm.TapeDevice; }
/// <summary> /// Signs that the device has been attached to the Spectrum virtual machine /// </summary> public override void OnAttachedToVm(ISpectrumVm hostVm) { base.OnAttachedToVm(hostVm); _cpu = hostVm.Cpu; _screenDevice = hostVm.ScreenDevice; _beeperDevice = hostVm.BeeperDevice; _keyboardDevice = hostVm.KeyboardDevice; _tapeDevice = hostVm.TapeDevice; }
/// <summary> /// Binds this instance to the specified Z80 CPU instance /// </summary> /// <param name="cpu"></param> internal CpuZ80(IZ80Cpu cpu) { _cpu = cpu; if (!(cpu is IZ80CpuTestSupport runSupport)) { throw new ArgumentException("The cpu instance should implement IZ80CpuTestSupport", nameof(cpu)); } OperationTrackingState = new AddressTrackingState(runSupport.ExecutionFlowStatus); }
public SpectrumMemoryContents(IMemoryDevice memoryDevice, IZ80Cpu cpu) { _memoryDevice = memoryDevice; if (!(cpu is IZ80CpuTestSupport runSupport)) { throw new ArgumentException("The cpu instance should implement IZ80CpuTestSupport", nameof(cpu)); } ReadTrackingState = new AddressTrackingState(runSupport.MemoryReadStatus); WriteTrackingState = new AddressTrackingState(runSupport.MemoryReadStatus); }
/// <summary> /// Signs that the device has been attached to the Spectrum virtual machine /// </summary> public override void OnAttachedToVm(ISpectrumVm hostVm) { base.OnAttachedToVm(hostVm); _cpu = hostVm?.Cpu; _screenDevice = hostVm?.ScreenDevice; _slots = new[] { 0, 5, 2, 0 }; SpecialMode = false; }
/// <summary> /// Signs that the device has been attached to the Spectrum virtual machine /// </summary> public virtual void OnAttachedToVm(ISpectrumVm hostVm) { HostVm = hostVm; Cpu = hostVm.Cpu; ScreenDevice = hostVm.ScreenDevice; foreach (var handler in Handlers) { handler.OnAttachedToVm(hostVm); handler.Reset(); } }
/// <summary> /// Signs that the device has been attached to the Spectrum virtual machine /// </summary> public override void OnAttachedToVm(ISpectrumVm hostVm) { base.OnAttachedToVm(hostVm); _isUla3 = hostVm.UlaIssue == "3"; _cpu = hostVm.Cpu; _screenDevice = hostVm.ScreenDevice; _beeperDevice = hostVm.BeeperDevice; _keyboardDevice = hostVm.KeyboardDevice; _tapeDevice = hostVm.TapeDevice; _bit3LastValue = true; _bit4LastValue = true; _bit4ChangedFrom0 = 0; _bit4ChangedFrom1 = 0; }
/// <summary> /// Signs that the device has been attached to the Spectrum virtual machine /// </summary> public void OnAttachedToVm(ISpectrumVm hostVm) { HostVm = hostVm; _cpu = hostVm?.Cpu; _screenDevice = hostVm?.ScreenDevice; // --- Create the ROM pages _romPage0 = new byte[PAGE_LENGTH]; _romPage1 = new byte[PAGE_LENGTH]; _ramBanks = new byte[8][]; // --- Create RAM pages for (var i = 0; i < 8; i++) { _ramBanks[i] = new byte[PAGE_LENGTH]; } _currentRomPage = _romPage0; _currentSlot3Bank = 0; }
/// <summary> /// Signs that the device has been attached to the Spectrum virtual machine /// </summary> public void OnAttachedToVm(ISpectrumVm hostVm) { HostVm = hostVm; _cpu = hostVm.Cpu; _beeperDevice = hostVm.BeeperDevice; _memoryDevice = hostVm.MemoryDevice; var romDevice = HostVm.RomDevice; LoadBytesRoutineAddress = romDevice.GetKnownAddress(SpectrumRomDevice.LOAD_BYTES_ROUTINE_ADDRESS, HostVm.RomConfiguration.Spectrum48RomIndex) ?? 0; SaveBytesRoutineAddress = romDevice.GetKnownAddress(SpectrumRomDevice.SAVE_BYTES_ROUTINE_ADDRESS, HostVm.RomConfiguration.Spectrum48RomIndex) ?? 0; LoadBytesInvalidHeaderAddress = romDevice.GetKnownAddress(SpectrumRomDevice.LOAD_BYTES_INVALID_HEADER_ADDRESS, HostVm.RomConfiguration.Spectrum48RomIndex) ?? 0; LoadBytesResumeAddress = romDevice.GetKnownAddress(SpectrumRomDevice.LOAD_BYTES_RESUME_ADDRESS, HostVm.RomConfiguration.Spectrum48RomIndex) ?? 0; Reset(); }
/// <summary> /// Signs that the device has been attached to the Spectrum virtual machine /// </summary> public void OnAttachedToVm(ISpectrumVm hostVm) { HostVm = hostVm; _cpu = hostVm.Cpu; Reset(); }
/// <summary> /// Signs that the device has been attached to the Spectrum virtual machine /// </summary> public virtual void OnAttachedToVm(ISpectrumVm hostVm) { HostVm = hostVm; Cpu = hostVm?.Cpu; ScreenDevice = hostVm?.ScreenDevice; }