Exemple #1
0
		private void Init(Region initRegion)
		{
			board = new Motherboard(this, initRegion);
			InitRoms();
			board.Init();
			InitMedia();

			// configure video
			CoreComm.VsyncDen = board.vic.CyclesPerFrame;
			CoreComm.VsyncNum = board.vic.CyclesPerSecond;
		}
Exemple #2
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;
        }
Exemple #3
0
 public void Dispose()
 {
     if (_board != null)
     {
         if (_board.TapeDrive != null)
         {
             _board.TapeDrive.RemoveMedia();
         }
         if (_board.DiskDrive != null)
         {
             _board.DiskDrive.RemoveMedia();
         }
         _board = null;
     }
 }
Exemple #4
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;
        }