Esempio n. 1
0
        public override int GetHashCode()
        {
            var hashCode = -2077317876;

            hashCode = hashCode * -1521134295 + DiskDriveMaker.GetHashCode();
            hashCode = hashCode * -1521134295 + DiskDriveType.GetHashCode();
            hashCode = hashCode * -1521134295 + InformationSize.GetHashCode();
            return(hashCode);
        }
Esempio n. 2
0
 public DiskDriveInfoEx(Id <DiskDriveInfoEx> diskDriveId, Id <DiskDriveInfoEx> diskDriveDbId, DiskDriveMaker diskDriveMaker, string serialNumber, DiskDriveType diskDriveType, int?driveNumber, PartitionInfoExs partitionInfoExs, IList <Exception> exceptions)
 {
     DiskDriveId      = diskDriveId;
     DiskDriveDbId    = diskDriveDbId;
     DiskDriveMaker   = diskDriveMaker;
     SerialNumber     = serialNumber ?? throw new ArgumentNullException(nameof(serialNumber));
     DiskDriveType    = diskDriveType;
     DriveNumber      = driveNumber;
     PartitionInfoExs = partitionInfoExs ?? throw new ArgumentNullException(nameof(partitionInfoExs));
     Exceptions       = exceptions ?? throw new ArgumentNullException(nameof(exceptions));
 }
Esempio n. 3
0
		private void InitRoms(DiskDriveType diskDriveType)
		{
            _board.BasicRom.Flash(GetFirmware(0x2000, "Basic"));
            _board.KernalRom.Flash(GetFirmware(0x2000, "Kernal"));
            _board.CharRom.Flash(GetFirmware(0x1000, "Chargen"));

		    switch (diskDriveType)
		    {
		        case DiskDriveType.Commodore1541:
                    _board.DiskDrive.DriveRom.Flash(GetFirmware(0x4000, "Drive1541"));
                    break;
                case DiskDriveType.Commodore1541II:
                    _board.DiskDrive.DriveRom.Flash(GetFirmware(0x4000, "Drive1541II"));
                    break;
		    }
        }
Esempio n. 4
0
        private void InitRoms(DiskDriveType diskDriveType)
        {
            var basicRom  = GetFirmware(0x2000, "Basic");
            var charRom   = GetFirmware(0x1000, "Chargen");
            var kernalRom = GetFirmware(0x2000, "Kernal");

            _board.BasicRom.Flash(basicRom);
            _board.KernalRom.Flash(kernalRom);
            _board.CharRom.Flash(charRom);

            if (diskDriveType == DiskDriveType.Commodore1541)
            {
                var diskRom = GetFirmware(0x4000, "Drive1541II", "Drive1541");
                _board.DiskDrive.DriveRom.Flash(diskRom);
            }
        }
Esempio n. 5
0
        public override int GetHashCode()
        {
            var hashCode = 1057818730;

            hashCode = hashCode * -1521134295 + EqualityComparer <Id <DiskDriveInfoEx> > .Default.GetHashCode(DiskDriveId);

            hashCode = hashCode * -1521134295 + EqualityComparer <Id <DiskDriveInfoEx> > .Default.GetHashCode(DiskDriveDbId);

            hashCode = hashCode * -1521134295 + DiskDriveMaker.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(SerialNumber);

            hashCode = hashCode * -1521134295 + DiskDriveType.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <int?> .Default.GetHashCode(DriveNumber);

            hashCode = hashCode * -1521134295 + EqualityComparer <PartitionInfoExs> .Default.GetHashCode(PartitionInfoExs);

            hashCode = hashCode * -1521134295 + EqualityComparer <IList <Exception> > .Default.GetHashCode(Exceptions);

            return(hashCode);
        }
Esempio n. 6
0
        private void Init(VicType initRegion, BorderType borderType, SidType sidType, TapeDriveType tapeDriveType, DiskDriveType diskDriveType)
        {
            // Force certain drive types to be available depending on ROM type
            var rom = _roms.First();

            switch (C64FormatFinder.GetFormat(rom))
            {
            case C64Format.D64:
            case C64Format.G64:
            case C64Format.X64:
                if (diskDriveType == DiskDriveType.None)
                {
                    diskDriveType = DiskDriveType.Commodore1541;
                }

                break;

            case C64Format.T64:
            case C64Format.TAP:
                if (tapeDriveType == TapeDriveType.None)
                {
                    tapeDriveType = TapeDriveType.Commodore1530;
                }

                break;

            case C64Format.CRT:
                // Nothing required.
                break;

            case C64Format.Unknown:
                if (rom.Length >= 0xFE00)
                {
                    throw new Exception("The image format is not known, and too large to be used as a PRG.");
                }

                if (diskDriveType == DiskDriveType.None)
                {
                    diskDriveType = DiskDriveType.Commodore1541;
                }

                break;

            default:
                throw new Exception("The image format is not yet supported by the Commodore 64 core.");
            }

            _board = new Motherboard(this, initRegion, borderType, sidType, tapeDriveType, diskDriveType);
            InitRoms(diskDriveType);
            _board.Init();
        }
Esempio n. 7
0
        private void InitRoms(DiskDriveType diskDriveType)
        {
            _board.BasicRom.Flash(GetFirmware(0x2000, "Basic"));
            _board.KernalRom.Flash(GetFirmware(0x2000, "Kernal"));
            _board.CharRom.Flash(GetFirmware(0x1000, "Chargen"));

            switch (diskDriveType)
            {
                case DiskDriveType.Commodore1541:
                    _board.DiskDrive.DriveRom.Flash(GetFirmware(0x4000, "Drive1541"));
                    break;
                case DiskDriveType.Commodore1541II:
                    _board.DiskDrive.DriveRom.Flash(GetFirmware(0x4000, "Drive1541II"));
                    break;
            }
        }
Esempio n. 8
0
        private void Init(VicType initRegion, BorderType borderType, SidType sidType, TapeDriveType tapeDriveType, DiskDriveType diskDriveType)
        {
            // Force certain drive types to be available depending on ROM type
            foreach (var rom in Roms)
            {
                switch (C64FormatFinder.GetFormat(rom))
                {
                    case C64Format.D64:
                    case C64Format.G64:
                    case C64Format.X64:
                        if (diskDriveType == DiskDriveType.None)
                            diskDriveType = DiskDriveType.Commodore1541;
                        break;
                    case C64Format.T64:
                    case C64Format.TAP:
                        if (tapeDriveType == TapeDriveType.None)
                        {
                            tapeDriveType = TapeDriveType.Commodore1530;
                        }
                        break;
                    case C64Format.CRT:
                        // Nothing required.
                        break;
                    case C64Format.Unknown:
                        if (rom.Length >= 0xFE00)
                        {
                            throw new Exception("The image format is not known, and too large to be used as a PRG.");
                        }
                        if (diskDriveType == DiskDriveType.None)
                            diskDriveType = DiskDriveType.Commodore1541;
                        break;
                    default:
                        throw new Exception("The image format is not yet supported by the Commodore 64 core.");
                }
            }

            _board = new Motherboard(this, initRegion, borderType, sidType, tapeDriveType, diskDriveType);
            InitRoms(diskDriveType);
            _board.Init();

            // configure video
            CoreComm.VsyncDen = _board.Vic.CyclesPerFrame;
            CoreComm.VsyncNum = _board.Vic.CyclesPerSecond;
        }
Esempio n. 9
0
        private void Init(VicType initRegion, BorderType borderType, SidType sidType, TapeDriveType tapeDriveType, DiskDriveType diskDriveType)
        {
            // Force certain drive types to be available depending on ROM type
            switch (_inputFileInfo.Extension.ToUpper())
            {
            case @".D64":
            case @".G64":
                if (diskDriveType == DiskDriveType.None)
                {
                    diskDriveType = DiskDriveType.Commodore1541;
                }
                break;

            case @".TAP":
                if (tapeDriveType == TapeDriveType.None)
                {
                    tapeDriveType = TapeDriveType.Commodore1530;
                }
                break;
            }

            _board = new Motherboard(this, initRegion, borderType, sidType, tapeDriveType, diskDriveType);
            InitRoms(diskDriveType);
            _board.Init();
            InitMedia();



            // configure video
            CoreComm.VsyncDen = _board.Vic.CyclesPerFrame;
            CoreComm.VsyncNum = _board.Vic.CyclesPerSecond;
        }
Esempio n. 10
0
 public DiskDriveSignil(DiskDriveMaker diskDriveMaker, DiskDriveType diskDriveType, Information informationSize)
 {
     DiskDriveMaker  = diskDriveMaker;
     DiskDriveType   = diskDriveType;
     InformationSize = informationSize;
 }
Esempio n. 11
0
		private void InitRoms(DiskDriveType diskDriveType)
		{
			var basicRom = GetFirmware(0x2000, "Basic");
			var charRom = GetFirmware(0x1000, "Chargen");
			var kernalRom = GetFirmware(0x2000, "Kernal");

            _board.BasicRom.Flash(basicRom);
            _board.KernalRom.Flash(kernalRom);
            _board.CharRom.Flash(charRom);

            if (diskDriveType == DiskDriveType.Commodore1541)
		    {
                var diskRom = GetFirmware(0x4000, "Drive1541II", "Drive1541");
                _board.DiskDrive.DriveRom.Flash(diskRom);
            }
		}
Esempio n. 12
0
		private void Init(VicType initRegion, BorderType borderType, SidType sidType, TapeDriveType tapeDriveType, DiskDriveType diskDriveType)
		{
            // Force certain drive types to be available depending on ROM type
		    switch (_inputFileInfo.Extension.ToUpper())
		    {
                case @".D64":
                case @".G64":
		            if (diskDriveType == DiskDriveType.None)
		            {
		                diskDriveType = DiskDriveType.Commodore1541;
		            }
		            break;
                case @".TAP":
		            if (tapeDriveType == TapeDriveType.None)
		            {
		                tapeDriveType = TapeDriveType.Commodore1530;
		            }
		            break;
		    }

            _board = new Motherboard(this, initRegion, borderType, sidType, tapeDriveType, diskDriveType);
			InitRoms(diskDriveType);
			_board.Init();
			InitMedia();

            

            // configure video
            CoreComm.VsyncDen = _board.Vic.CyclesPerFrame;
			CoreComm.VsyncNum = _board.Vic.CyclesPerSecond;
        }