Beispiel #1
0
        public GGHawkLink(CoreComm comm, GameInfo game_L, byte[] rom_L, GameInfo game_R, byte[] rom_R, /*string gameDbFn,*/ object settings, object syncSettings)
        {
            var ser = new BasicServiceProvider(this);

            linkSettings     = (GGLinkSettings)settings ?? new GGLinkSettings();
            linkSyncSettings = (GGLinkSyncSettings)syncSettings ?? new GGLinkSyncSettings();
            _controllerDeck  = new GGHawkLinkControllerDeck(GGHawkLinkControllerDeck.DefaultControllerName, GGHawkLinkControllerDeck.DefaultControllerName);

            CoreComm = comm;

            var temp_set_L = new SMS.SmsSettings();
            var temp_set_R = new SMS.SmsSettings();

            var temp_sync_L = new SMS.SmsSyncSettings();
            var temp_sync_R = new SMS.SmsSyncSettings();

            L = new SMS(new CoreComm(comm.ShowMessage, comm.Notify)
            {
                CoreFileProvider = comm.CoreFileProvider
            },
                        game_L, rom_L, temp_set_L, temp_sync_L);

            R = new SMS(new CoreComm(comm.ShowMessage, comm.Notify)
            {
                CoreFileProvider = comm.CoreFileProvider
            },
                        game_R, rom_R, temp_set_R, temp_sync_R);

            ser.Register <IVideoProvider>(this);
            ser.Register <ISoundProvider>(this);

            _tracer = new TraceBuffer {
                Header = L.Cpu.TraceHeader
            };
            ser.Register <ITraceable>(_tracer);

            ServiceProvider = ser;

            SetupMemoryDomains();

            HardReset();

            L.stand_alone = false;
            R.stand_alone = false;

            _lStates = L.ServiceProvider.GetService <IStatable>();
            _rStates = R.ServiceProvider.GetService <IStatable>();
        }
Beispiel #2
0
        public GGHawkLink(CoreLoadParameters <GGLinkSettings, GGLinkSyncSettings> lp)
        {
            if (lp.Roms.Count != 2)
            {
                throw new InvalidOperationException("Wrong number of roms");
            }

            var ser = new BasicServiceProvider(this);

            linkSettings     = (GGLinkSettings)lp.Settings ?? new GGLinkSettings();
            linkSyncSettings = (GGLinkSyncSettings)lp.SyncSettings ?? new GGLinkSyncSettings();
            _controllerDeck  = new GGHawkLinkControllerDeck(GGHawkLinkControllerDeck.DefaultControllerName, GGHawkLinkControllerDeck.DefaultControllerName);

            var temp_set_L = new SMS.SmsSettings();
            var temp_set_R = new SMS.SmsSettings();

            var temp_sync_L = new SMS.SmsSyncSettings();
            var temp_sync_R = new SMS.SmsSyncSettings();

            L = new SMS(lp.Comm, lp.Roms[0].Game, lp.Roms[0].RomData, temp_set_L, temp_sync_L);
            R = new SMS(lp.Comm, lp.Roms[1].Game, lp.Roms[1].RomData, temp_set_R, temp_sync_R);

            ser.Register <IVideoProvider>(this);
            ser.Register <ISoundProvider>(this);

            _tracer = new TraceBuffer {
                Header = L.Cpu.TraceHeader
            };
            ser.Register(_tracer);

            ServiceProvider = ser;

            SetupMemoryDomains();

            HardReset();

            L.stand_alone = false;
            R.stand_alone = false;

            _lStates = L.ServiceProvider.GetService <IStatable>();
            _rStates = R.ServiceProvider.GetService <IStatable>();
        }