示例#1
0
        public void NewPrefs(Prefs prefs)
        {
            // Delete and recreate all changed drives
            for (int i = 0; i < 4; i++)
            {
                //if ((GlobalPrefs.ThePrefs.DriveType[i] != prefs.DriveType[i]) || 
                //    GlobalPrefs.ThePrefs.DrivePath[i] != prefs.DrivePath[i] || 
                //    GlobalPrefs.ThePrefs.Emul1541Proc != prefs.Emul1541Proc)
                //{
                drive[i] = null;	// Important because UpdateLEDs is called from drive constructors (via set_error())

                if (!prefs.Emul1541Proc)
                {
                    if (prefs.DriveType[i] == DriveType.DRVTYPE_DIR)
                        drive[i] = new FSDrive(this, prefs.DrivePath[i]);
                    else if (prefs.DriveType[i] == DriveType.DRVTYPE_D64)
                        drive[i] = new D64Drive(this, prefs.DrivePath[i], prefs.DriveData[i]);
                    else
                        drive[i] = new T64Drive(this, prefs.DrivePath[i]);
                }
                //}
            }
            UpdateLEDs();
        }
示例#2
0
文件: IEC.cs 项目: rosc77/vita64
        public IEC(C64Display display)
        {
            the_display = display;

            int i;

            // Create drives 8..11
            for (i = 0; i < drive.Length; i++)
            {
                drive[i] = null;	// Important because UpdateLEDs is called from the drive constructors (via set_error)
            }

            if (!GlobalPrefs.ThePrefs.Emul1541Proc)
            {
                Prefs prefs = GlobalPrefs.ThePrefs;

                DriveType[] prefDrives = prefs.DriveType;

                for (i = 0; i < drive.Length; i++)
                {
                    if (!prefs.Emul1541Proc)
                    {
                        if (prefs.DriveType[i] == DriveType.DRVTYPE_DIR)
                            drive[i] = new FSDrive(this, prefs.DrivePath[i]);
                        else if (prefs.DriveType[i] == DriveType.DRVTYPE_D64)
                            drive[i] = new D64Drive(this, prefs.DrivePath[i], prefs.DriveData[i]);
                        else
                            drive[i] = new T64Drive(this, prefs.DrivePath[i]);
                    }
                }

                // TODO
                //for (i = 0; i < prefDrives.Length; i++)
                //{
                //    if (prefDrives[i] == DriveType.DRVTYPE_DIR)
                //        drive[i] = new FSDrive(this, GlobalPrefs.ThePrefs.DrivePath[i]);
                //    else if (prefDrives[i] == DriveType.DRVTYPE_D64)
                //        drive[i] = new D64Drive(this, GlobalPrefs.ThePrefs.DrivePath[i]);
                //    else
                //        drive[i] = new T64Drive(this, GlobalPrefs.ThePrefs.DrivePath[i]);
                //}
            }

            listener_active = talker_active = false;
            listening = false;
        }