コード例 #1
0
        public ChannelF(CoreLoadParameters <ChannelFSettings, ChannelFSyncSettings> lp)
        {
            var ser = new BasicServiceProvider(this);

            ServiceProvider = ser;
            CoreComm        = lp.Comm;
            _gameInfo       = lp.Roms.Select(r => r.Game).ToList();
            _files          = lp.Roms.Select(r => r.RomData).ToList();


            var settings     = lp.Settings ?? new ChannelFSettings();
            var syncSettings = lp.SyncSettings ?? new ChannelFSyncSettings();

            region = syncSettings.Region;


            MemoryCallbacks = new MemoryCallbackSystem(new[] { "System Bus" });

            ControllerDefinition = ChannelFControllerDefinition;

            var bios01 = CoreComm.CoreFileProvider.GetFirmwareOrThrow(new("ChannelF", "ChannelF_sl131253"));
            var bios02 = CoreComm.CoreFileProvider.GetFirmwareOrThrow(new("ChannelF", "ChannelF_sl131254"));

            //var bios02 = CoreComm.CoreFileProvider.GetFirmwareOrThrow(new("ChannelF", "ChannelF_sl90025"));

            Cartridge = VesCartBase.Configure(_gameInfo.First(), _files.First());

            BIOS01 = bios01;
            BIOS02 = bios02;

            CPU = new F3850
            {
                ReadMemory      = ReadBus,
                WriteMemory     = WriteBus,
                ReadHardware    = ReadPort,
                WriteHardware   = WritePort,
                DummyReadMemory = ReadBus
            };

            _tracer = new TraceBuffer(CPU.TraceHeader);

            //var rom = _files.First();
            //Array.Copy(rom, 0, Rom, 0, rom.Length);

            CalcClock();

            ser.Register <IVideoProvider>(this);
            ser.Register <ITraceable>(_tracer);
            ser.Register <IDisassemblable>(CPU);
            ser.Register <ISoundProvider>(this);
            ser.Register <IStatable>(new StateSerializer(SyncState));
            SetupMemoryDomains();
        }
コード例 #2
0
        public ChannelF(CoreComm comm, GameInfo game, byte[] rom, object settings, object syncSettings)
        {
            var ser = new BasicServiceProvider(this);

            ServiceProvider = ser;
            CoreComm        = comm;
            InputCallbacks  = new InputCallbackSystem();
            MemoryCallbacks = new MemoryCallbackSystem(new[] { "System Bus" });

            ControllerDefinition = ChannelFControllerDefinition;

            CPU = new F3850
            {
                ReadMemory      = ReadBus,
                WriteMemory     = WriteBus,
                ReadHardware    = ReadPort,
                WriteHardware   = WritePort,
                DummyReadMemory = ReadBus
            };

            _tracer = new TraceBuffer {
                Header = CPU.TraceHeader
            };

            byte[] bios01 = comm.CoreFileProvider.GetFirmware("ChannelF", "ChannelF_sl131253", true);
            byte[] bios02 = comm.CoreFileProvider.GetFirmware("ChannelF", "ChannelF_sl131254", true);

            BIOS01 = bios01;
            BIOS02 = bios02;

            Array.Copy(rom, 0, Rom, 0, rom.Length);

            CalcClock();

            ser.Register <IVideoProvider>(this);
            ser.Register <ITraceable>(_tracer);
            ser.Register <IDisassemblable>(CPU);
            ser.Register <ISoundProvider>(this);

            SetupMemoryDomains();
        }
コード例 #3
0
        public ChannelF(CoreComm comm, GameInfo game, byte[] rom)
        {
            var ser = new BasicServiceProvider(this);

            ServiceProvider = ser;
            MemoryCallbacks = new MemoryCallbackSystem(new[] { "System Bus" });

            ControllerDefinition = ChannelFControllerDefinition;

            CPU = new F3850
            {
                ReadMemory      = ReadBus,
                WriteMemory     = WriteBus,
                ReadHardware    = ReadPort,
                WriteHardware   = WritePort,
                DummyReadMemory = ReadBus
            };

            _tracer = new TraceBuffer(CPU.TraceHeader);

            var bios01 = comm.CoreFileProvider.GetFirmwareOrThrow(new("ChannelF", "ChannelF_sl131253"));
            var bios02 = comm.CoreFileProvider.GetFirmwareOrThrow(new("ChannelF", "ChannelF_sl131254"));

            BIOS01 = bios01;
            BIOS02 = bios02;

            Array.Copy(rom, 0, Rom, 0, rom.Length);

            CalcClock();

            ser.Register <IVideoProvider>(this);
            ser.Register <ITraceable>(_tracer);
            ser.Register <IDisassemblable>(CPU);
            ser.Register <ISoundProvider>(this);
            ser.Register <IStatable>(new StateSerializer(SyncState));
            SetupMemoryDomains();
        }