示例#1
0
        public LoadManager(Spectrum spec)
        {
            this._spec = spec;
            base.AddSerializer(new Z80Serializer(spec));
            base.AddSerializer(new SnaSerializer(spec));
            base.AddSerializer(new SitSerializer(spec));
            base.AddSerializer(new ZxSerializer(spec));
            base.AddSerializer(new ScrSerializer(spec));
            ITapeDevice tapeDevice = spec as ITapeDevice;

            if (tapeDevice != null)
            {
                base.AddSerializer(new TapSerializer(tapeDevice.Tape));
                base.AddSerializer(new TzxSerializer(tapeDevice.Tape));
                base.AddSerializer(new CswSerializer(tapeDevice.Tape));
            }
            IBetaDiskDevice betaDiskDevice = spec as IBetaDiskDevice;

            if (betaDiskDevice != null)
            {
                base.AddSerializer(new UdiSerializer(betaDiskDevice.BetaDisk.FDD[0]));
                base.AddSerializer(new FdiSerializer(betaDiskDevice.BetaDisk.FDD[0]));
                base.AddSerializer(new Td0Serializer(betaDiskDevice.BetaDisk.FDD[0]));
                base.AddSerializer(new TrdSerializer(betaDiskDevice.BetaDisk.FDD[0]));
                base.AddSerializer(new SclSerializer(betaDiskDevice.BetaDisk.FDD[0]));
                base.AddSerializer(new HobetaSerializer(betaDiskDevice.BetaDisk.FDD[0]));
                this._diskLoaders = new DiskLoadManager[betaDiskDevice.BetaDisk.FDD.Length];
                for (int i = 0; i < this._diskLoaders.Length; i++)
                {
                    this._diskLoaders[i] = new DiskLoadManager(betaDiskDevice.BetaDisk.FDD[i]);
                }
            }
        }
示例#2
0
 public TapeForm(ITapeDevice tapeDevice)
 {
     m_tape = tapeDevice;
     InitializeComponent();
     tapeDevice.TapeStateChanged += new EventHandler(OnTapeStateChanged);
     OnTapeStateChanged(null, null);
     OnTapeStateChanged(null, null);
 }
 /// <summary>
 /// Signs that the device has been attached to the Spectrum virtual machine
 /// </summary>
 public override void OnAttachedToVm(ISpectrumVm hostVm)
 {
     base.OnAttachedToVm(hostVm);
     _screenDevice   = hostVm.ScreenDevice;
     _beeperDevice   = hostVm.BeeperDevice;
     _keyboardDevice = hostVm.KeyboardDevice;
     _tapeDevice     = hostVm.TapeDevice;
 }
示例#4
0
 public TapeForm(ITapeDevice tape)
 {
     m_tape = tape;
     InitializeComponent();
     tape.TapeStateChanged += new EventHandler(OnTapeStateChanged);
     OnTapeStateChanged(null, null);
     OnTapeStateChanged(null, null);
 }
示例#5
0
        private void toolButtonNext_Click(object sender, EventArgs e)
        {
            ITapeDevice tapeDevice = this._spectrum as ITapeDevice;

            if (tapeDevice != null)
            {
                tapeDevice.Tape.CurrentBlock--;
            }
        }
示例#6
0
        private void toolButtonRewind_Click(object sender, EventArgs e)
        {
            ITapeDevice tapeDevice = this._spectrum as ITapeDevice;

            if (tapeDevice != null)
            {
                tapeDevice.Tape.Rewind(this._spectrum.CPU.Tact);
            }
        }
示例#7
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;
     _borderDevice   = hostVm.BorderDevice;
     _beeperDevice   = hostVm.BeeperDevice;
     _keyboardDevice = hostVm.KeyboardDevice;
     _tapeDevice     = hostVm.TapeDevice;
 }
示例#8
0
        private TapeForm(Spectrum spec)
        {
            this._spectrum = spec;
            this.InitializeComponent();
            ITapeDevice tapeDevice = this._spectrum as ITapeDevice;

            if (tapeDevice != null)
            {
                tapeDevice.Tape.TapeStateChanged += this.OnTapeStateChanged;
                this.OnTapeStateChanged(null, null);
            }
            this.OnTapeStateChanged(null, null);
        }
示例#9
0
        private void blockList_Click(object sender, EventArgs e)
        {
            ITapeDevice tapeDevice = this._spectrum as ITapeDevice;

            if (tapeDevice == null)
            {
                return;
            }
            if (!this.blockList.Enabled || tapeDevice.Tape.IsPlay)
            {
                return;
            }
            tapeDevice.Tape.CurrentBlock = this.blockList.SelectedIndex;
        }
 /// <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;
 }
示例#11
0
        private void toolButtonPlay_Click(object sender, EventArgs e)
        {
            ITapeDevice tapeDevice = this._spectrum as ITapeDevice;

            if (tapeDevice != null)
            {
                if (tapeDevice.Tape.IsPlay)
                {
                    tapeDevice.Tape.Stop(this._spectrum.CPU.Tact);
                    return;
                }
                tapeDevice.Tape.Play(this._spectrum.CPU.Tact);
            }
        }
示例#12
0
        private void timerProgress_Tick(object sender, EventArgs e)
        {
            ITapeDevice tapeDevice = this._spectrum as ITapeDevice;

            if (tapeDevice == null)
            {
                this.toolProgressBar.Maximum = 100;
                this.toolProgressBar.Value   = 0;
                return;
            }
            this.toolProgressBar.Minimum = 0;
            if (tapeDevice.Tape.CurrentBlock >= 0 && tapeDevice.Tape.CurrentBlock < tapeDevice.Tape.Blocks.Count)
            {
                this.toolProgressBar.Maximum = tapeDevice.Tape.Blocks[tapeDevice.Tape.CurrentBlock].Periods.Count;
                this.toolProgressBar.Value   = tapeDevice.Tape.Position;
                return;
            }
            this.toolProgressBar.Maximum = 65535;
            this.toolProgressBar.Value   = 0;
        }
示例#13
0
        private void OnTapeStateChanged(object sender, EventArgs args)
        {
            ITapeDevice tapeDevice = this._spectrum as ITapeDevice;

            if (tapeDevice == null)
            {
                this.toolButtonRewind.Enabled = (this.toolButtonPrev.Enabled = (this.toolButtonPlay.Enabled = (this.toolButtonNext.Enabled = false)));
                this.blockList.SelectedIndex  = -1;
                return;
            }
            if (tapeDevice.Tape.Blocks.Count <= 0)
            {
                this.toolButtonRewind.Enabled = (this.toolButtonPrev.Enabled = (this.toolButtonPlay.Enabled = (this.toolButtonNext.Enabled = false)));
                this.blockList.SelectedIndex  = -1;
            }
            else
            {
                this.toolButtonNext.Enabled   = (this.toolButtonPrev.Enabled = !tapeDevice.Tape.IsPlay);
                this.toolButtonRewind.Enabled = (this.toolButtonPlay.Enabled = true);
                if (tapeDevice.Tape.IsPlay)
                {
                    this.toolButtonPlay.Image = Resources.StopIcon;
                }
                else
                {
                    this.toolButtonPlay.Image = Resources.PlayIcon;
                }
                this.blockList.Items.Clear();
                foreach (TapeBlock tapeBlock in tapeDevice.Tape.Blocks)
                {
                    this.blockList.Items.Add(tapeBlock.Description);
                }
                this.blockList.SelectedIndex = tapeDevice.Tape.CurrentBlock;
            }
            this.blockList.Enabled = !tapeDevice.Tape.IsPlay;
        }
示例#14
0
 public TapSerializer(ITapeDevice tape)
 {
     _tape = tape;
 }
示例#15
0
 public TapSerializer(ITapeDevice tape)
 {
     _tape = tape;
 }
示例#16
0
        protected override void OnKeyDown(KeyEventArgs e)
        {
            if (e.Alt && e.Control && this._mouse != null)
            {
                this._mouse.StopCapture();
            }
            ITapeDevice tapeDevice = this._platform.Spectrum as ITapeDevice;
            Keys        keyCode    = e.KeyCode;

            if (keyCode != Keys.Return)
            {
                switch (keyCode)
                {
                case Keys.F3:
                    this._platform.Spectrum.DoReset();
                    return;

                case Keys.F4:
                case Keys.F6:
                case Keys.F10:
                case Keys.F11:
                    break;

                case Keys.F5:
                    this._platform.Spectrum.IsRunning = false;
                    return;

                case Keys.F7:
                    if (tapeDevice != null)
                    {
                        tapeDevice.Tape.Rewind(this._platform.Spectrum.CPU.Tact);
                        return;
                    }
                    break;

                case Keys.F8:
                    if (tapeDevice != null)
                    {
                        if (tapeDevice.Tape.IsPlay)
                        {
                            tapeDevice.Tape.Stop(this._platform.Spectrum.CPU.Tact);
                            return;
                        }
                        tapeDevice.Tape.Play(this._platform.Spectrum.CPU.Tact);
                        return;
                    }
                    break;

                case Keys.F9:
                    this._platform.Spectrum.IsRunning = true;
                    return;

                case Keys.F12:
                {
                    string text = Path.Combine(Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName), "boot.zip");
                    if (File.Exists(text) && this._platform.Spectrum.Loader.CheckCanOpenFileName(text))
                    {
                        this._platform.Spectrum.Loader.OpenFileName(text, true, true);
                    }
                    break;
                }

                default:
                    return;
                }
                return;
            }
            if (e.Alt)
            {
                this.Fullscreen = !this.Fullscreen;
            }
            e.Handled = true;
        }
示例#17
0
        private void KeyDown(object sender, KeyboardEventArgs e)
        {
            ITapeDevice tapeDevice = base.Spectrum as ITapeDevice;
            Key         key        = e.Key;

            if (key != 13)
            {
                switch (key)
                {
                case 283:
                    this.fileSaveAsDialog();
                    return;

                case 284:
                    base.Spectrum.DoReset();
                    return;

                case 285:
                    this.fileOpenDialog();
                    return;

                case 286:
                    base.Spectrum.IsRunning = false;
                    return;

                case 287:
                    TapeForm.GetInstance(base.Spectrum).Show();
                    return;

                case 288:
                    if (tapeDevice != null)
                    {
                        tapeDevice.Tape.Rewind(base.Spectrum.CPU.Tact);
                    }
                    break;

                case 289:
                    if (tapeDevice != null)
                    {
                        if (tapeDevice.Tape.IsPlay)
                        {
                            tapeDevice.Tape.Stop(base.Spectrum.CPU.Tact);
                            return;
                        }
                        tapeDevice.Tape.Play(base.Spectrum.CPU.Tact);
                        return;
                    }
                    break;

                case 290:
                    base.Spectrum.IsRunning = true;
                    return;

                default:
                    return;
                }
            }
            else if ((e.Mod & 768) != null)
            {
                this._fullScreen = !this._fullScreen;
                this.UpdateVideoSettings();
                return;
            }
        }
示例#18
0
 public WavSerializer(ITapeDevice tape)
 {
     m_tape = tape;
 }
示例#19
0
 public WavSerializer(ITapeDevice tape)
 {
     m_tape = tape;
 }