Exemplo n.º 1
0
        public ColecoVision(CoreComm comm, GameInfo game, byte[] rom, object SyncSettings)
        {
            CoreComm          = comm;
            this.SyncSettings = (ColecoSyncSettings)SyncSettings ?? new ColecoSyncSettings();
            bool skipbios = this.SyncSettings.SkipBiosIntro;

            Cpu               = new Z80A();
            Cpu.ReadMemory    = ReadMemory;
            Cpu.WriteMemory   = WriteMemory;
            Cpu.ReadHardware  = ReadPort;
            Cpu.WriteHardware = WritePort;

            VDP = new TMS9918A(Cpu);
            PSG = new SN76489();

            // TODO: hack to allow bios-less operation would be nice, no idea if its feasible
            string biosPath = CoreComm.CoreFileProvider.GetFirmwarePath("Coleco", "Bios", true, "Coleco BIOS file is required.");

            BiosRom = File.ReadAllBytes(biosPath);

            // gamedb can overwrite the syncsettings; this is ok
            if (game["NoSkip"])
            {
                skipbios = false;
            }
            LoadRom(rom, skipbios);
            this.game = game;
            SetupMemoryDomains();
        }
Exemplo n.º 2
0
        public ColecoVision(CoreComm comm, GameInfo game, byte[] rom, object SyncSettings)
        {
            ServiceProvider = new BasicServiceProvider(this);
            MemoryCallbacks = new MemoryCallbackSystem();
            CoreComm        = comm;
            _syncSettings   = (ColecoSyncSettings)SyncSettings ?? new ColecoSyncSettings();
            bool skipbios = this._syncSettings.SkipBiosIntro;

            Cpu                 = new Z80A();
            Cpu.ReadMemory      = ReadMemory;
            Cpu.WriteMemory     = WriteMemory;
            Cpu.ReadHardware    = ReadPort;
            Cpu.WriteHardware   = WritePort;
            Cpu.MemoryCallbacks = MemoryCallbacks;

            VDP = new TMS9918A(Cpu);
            (ServiceProvider as BasicServiceProvider).Register <IVideoProvider>(VDP);
            PSG = new SN76489();

            // TODO: hack to allow bios-less operation would be nice, no idea if its feasible
            BiosRom = CoreComm.CoreFileProvider.GetFirmware("Coleco", "Bios", true, "Coleco BIOS file is required.");

            // gamedb can overwrite the syncsettings; this is ok
            if (game["NoSkip"])
            {
                skipbios = false;
            }
            LoadRom(rom, skipbios);
            this.game = game;
            SetupMemoryDomains();
            (ServiceProvider as BasicServiceProvider).Register <IDisassemblable>(new Disassembler());
        }
Exemplo n.º 3
0
		public ColecoVision(CoreComm comm, GameInfo game, byte[] rom, object SyncSettings)
		{
			CoreComm = comm;
			this.SyncSettings = (ColecoSyncSettings)SyncSettings ?? new ColecoSyncSettings();
			bool skipbios = this.SyncSettings.SkipBiosIntro;

			Cpu = new Z80A();
			Cpu.ReadMemory = ReadMemory;
			Cpu.WriteMemory = WriteMemory;
			Cpu.ReadHardware = ReadPort;
			Cpu.WriteHardware = WritePort;

			VDP = new TMS9918A(Cpu);
			PSG = new SN76489();

			// TODO: hack to allow bios-less operation would be nice, no idea if its feasible
			string biosPath = CoreComm.CoreFileProvider.GetFirmwarePath("Coleco", "Bios", true, "Coleco BIOS file is required.");
			BiosRom = File.ReadAllBytes(biosPath);

			// gamedb can overwrite the syncsettings; this is ok
			if (game["NoSkip"])
				skipbios = false;
			LoadRom(rom, skipbios);
			this.game = game;
			SetupMemoryDomains();
		}
Exemplo n.º 4
0
        public ColecoVision(CoreComm comm, GameInfo game, byte[] rom,
                            ColecoSettings settings,
                            ColecoSyncSettings syncSettings)
        {
            var ser = new BasicServiceProvider(this);

            ServiceProvider = ser;
            _syncSettings   = (ColecoSyncSettings)syncSettings ?? new ColecoSyncSettings();
            bool skipBios = _syncSettings.SkipBiosIntro;

            _cpu = new Z80A
            {
                FetchMemory     = ReadMemory,
                ReadMemory      = ReadMemory,
                WriteMemory     = WriteMemory,
                ReadHardware    = ReadPort,
                WriteHardware   = WritePort,
                MemoryCallbacks = MemoryCallbacks
            };

            PSG       = new SN76489col();
            SGM_sound = new AY_3_8910_SGM();
            _blip.SetRates(3579545, 44100);

            ControllerDeck = new ColecoVisionControllerDeck(_syncSettings.Port1, _syncSettings.Port2);

            _vdp = new TMS9918A(_cpu);
            ser.Register <IVideoProvider>(_vdp);
            ser.Register <IStatable>(new StateSerializer(SyncState));

            // TODO: hack to allow bios-less operation would be nice, no idea if its feasible
            _biosRom = comm.CoreFileProvider.GetFirmware("Coleco", "Bios", true, "Coleco BIOS file is required.");

            // gamedb can overwrite the SyncSettings; this is ok
            if (game["NoSkip"])
            {
                skipBios = false;
            }

            use_SGM = _syncSettings.UseSGM;

            if (use_SGM)
            {
                Console.WriteLine("Using the Super Game Module");
            }

            LoadRom(rom, skipBios);
            SetupMemoryDomains();

            _tracer.Header = _cpu.TraceHeader;
            ser.Register <IDisassemblable>(_cpu);
            ser.Register <ITraceable>(_tracer);
        }
Exemplo n.º 5
0
        public ColecoVision(CoreComm comm, GameInfo game, byte[] rom, object SyncSettings)
        {
            ServiceProvider = new BasicServiceProvider(this);
            MemoryCallbacks = new MemoryCallbackSystem();
            CoreComm        = comm;
            _syncSettings   = (ColecoSyncSettings)SyncSettings ?? new ColecoSyncSettings();
            bool skipbios = _syncSettings.SkipBiosIntro;

            Cpu = new Z80A
            {
                ReadMemory      = ReadMemory,
                WriteMemory     = WriteMemory,
                ReadHardware    = ReadPort,
                WriteHardware   = WritePort,
                MemoryCallbacks = MemoryCallbacks
            };

            PSG            = new SN76489();
            _fakeSyncSound = new FakeSyncSound(PSG, 735);
            (ServiceProvider as BasicServiceProvider).Register <ISoundProvider>(_fakeSyncSound);

            ControllerDeck = new ColecoVisionControllerDeck(_syncSettings.Port1, _syncSettings.Port2);

            VDP = new TMS9918A(Cpu);
            (ServiceProvider as BasicServiceProvider).Register <IVideoProvider>(VDP);

            // TODO: hack to allow bios-less operation would be nice, no idea if its feasible
            BiosRom = CoreComm.CoreFileProvider.GetFirmware("Coleco", "Bios", true, "Coleco BIOS file is required.");

            // gamedb can overwrite the syncsettings; this is ok
            if (game["NoSkip"])
            {
                skipbios = false;
            }

            LoadRom(rom, skipbios);
            _game = game;
            SetupMemoryDomains();

            Tracer.Header = Cpu.TraceHeader;
            var serviceProvider = ServiceProvider as BasicServiceProvider;

            serviceProvider.Register <IDisassemblable>(new Disassembler());
            serviceProvider.Register <ITraceable>(Tracer);
        }