// framework public C64(CoreComm comm, GameInfo game, byte[] rom, string romextension) { ServiceProvider = new BasicServiceProvider(this); InputCallbacks = new InputCallbackSystem(); inputFileInfo = new InputFileInfo(); inputFileInfo.Data = rom; inputFileInfo.Extension = romextension; CoreComm = comm; Init(Region.PAL); cyclesPerFrame = board.vic.CyclesPerFrame; SetupMemoryDomains(); HardReset(); (ServiceProvider as BasicServiceProvider).Register<IVideoProvider>(board.vic); }
public Atari7800(CoreComm comm, GameInfo game, byte[] rom, string GameDBfn) { ServiceProvider = new BasicServiceProvider(this); (ServiceProvider as BasicServiceProvider).Register<IVideoProvider>(avProvider); InputCallbacks = new InputCallbackSystem(); CoreComm = comm; byte[] highscoreBIOS = comm.CoreFileProvider.GetFirmware("A78", "Bios_HSC", false, "Some functions may not work without the high score BIOS."); byte[] pal_bios = comm.CoreFileProvider.GetFirmware("A78", "Bios_PAL", false, "The game will not run if the correct region BIOS is not available."); byte[] ntsc_bios = comm.CoreFileProvider.GetFirmware("A78", "Bios_NTSC", false, "The game will not run if the correct region BIOS is not available."); if (EMU7800.Win.GameProgramLibrary.EMU7800DB == null) { EMU7800.Win.GameProgramLibrary.EMU7800DB = new EMU7800.Win.GameProgramLibrary(new StreamReader(GameDBfn)); } if (rom.Length % 1024 == 128) { Console.WriteLine("Trimming 128 byte .a78 header..."); byte[] newrom = new byte[rom.Length - 128]; Buffer.BlockCopy(rom, 128, newrom, 0, newrom.Length); rom = newrom; } GameInfo = EMU7800.Win.GameProgramLibrary.EMU7800DB.TryRecognizeRom(rom); CoreComm.RomStatusDetails = GameInfo.ToString(); Console.WriteLine("Rom Determiniation from 7800DB:"); Console.WriteLine(GameInfo.ToString()); this.rom = rom; this.game = game; this.hsbios = highscoreBIOS; this.bios = GameInfo.MachineType == MachineType.A7800PAL ? pal_bios : ntsc_bios; _pal = GameInfo.MachineType == MachineType.A7800PAL || GameInfo.MachineType == MachineType.A2600PAL; if (bios == null) { throw new MissingFirmwareException("The BIOS corresponding to the region of the game you loaded is required to run Atari 7800 games."); } HardReset(); }
public AppleII(CoreComm comm, GameInfo game, byte[] rom, Settings settings) { GameInfoSet = new List<GameInfo>(); var ser = new BasicServiceProvider(this); ServiceProvider = ser; CoreComm = comm; Tracer = new TraceBuffer { Header = "6502: PC, opcode, register (A, X, Y, P, SP, Cy) flags (NVTBDIZC)" }; MemoryCallbacks = new MemoryCallbackSystem(); InputCallbacks = new InputCallbackSystem(); _disk1 = rom; RomSet.Add(rom); _appleIIRom = comm.CoreFileProvider.GetFirmware( SystemId, "AppleIIe", true, "The Apple IIe BIOS firmware is required"); _diskIIRom = comm.CoreFileProvider.GetFirmware( SystemId, "DiskII", true, "The DiskII firmware is required"); _machine = new Machine(_appleIIRom, _diskIIRom); _machine.BizInitialize(); //make a writeable memory stream cloned from the rom. //for junk.dsk the .dsk is important because it determines the format from that InitDisk(); ser.Register<ITraceable>(Tracer); setCallbacks(); InitSaveStates(); SetupMemoryDomains(); PutSettings(settings ?? new Settings()); }
public C64(CoreComm comm, IEnumerable<byte[]> roms, object settings, object syncSettings) { PutSyncSettings((C64SyncSettings)syncSettings ?? new C64SyncSettings()); PutSettings((C64Settings)settings ?? new C64Settings()); ServiceProvider = new BasicServiceProvider(this); InputCallbacks = new InputCallbackSystem(); CoreComm = comm; Roms = roms; Init(SyncSettings.VicType, Settings.BorderType, SyncSettings.SidType, SyncSettings.TapeDriveType, SyncSettings.DiskDriveType); _cyclesPerFrame = _board.Vic.CyclesPerFrame; SetupMemoryDomains(_board.DiskDrive != null); _memoryCallbacks = new MemoryCallbackSystem(); HardReset(); switch (SyncSettings.VicType) { case VicType.Ntsc: case VicType.Drean: case VicType.NtscOld: Region = DisplayType.NTSC; break; case VicType.Pal: Region = DisplayType.PAL; break; } if (_board.Sid != null) { SyncSoundProvider = DCFilter.AsISyncSoundProvider(_board.Sid, 512); } DeterministicEmulation = true; ((BasicServiceProvider) ServiceProvider).Register<IVideoProvider>(_board.Vic); ((BasicServiceProvider) ServiceProvider).Register<IDriveLight>(this); }
// framework public C64(CoreComm comm, GameInfo game, byte[] rom, string romextension, object settings, object syncSettings) { PutSyncSettings((C64SyncSettings)syncSettings ?? new C64SyncSettings()); PutSettings((C64Settings)settings ?? new C64Settings()); ServiceProvider = new BasicServiceProvider(this); InputCallbacks = new InputCallbackSystem(); _inputFileInfo = new InputFileInfo { Data = rom, Extension = romextension }; CoreComm = comm; Init(SyncSettings.VicType, Settings.BorderType, SyncSettings.SidType, SyncSettings.TapeDriveType, SyncSettings.DiskDriveType); _cyclesPerFrame = _board.Vic.CyclesPerFrame; SetupMemoryDomains(_board.DiskDrive != null); _memoryCallbacks = new MemoryCallbackSystem(); HardReset(); switch (SyncSettings.VicType) { case VicType.Ntsc: case VicType.Drean: case VicType.NtscOld: Region = DisplayType.NTSC; break; case VicType.Pal: Region = DisplayType.PAL; break; } ((BasicServiceProvider) ServiceProvider).Register<IVideoProvider>(_board.Vic); ((BasicServiceProvider) ServiceProvider).Register<IDriveLight>(_board.Serial); }