public GBHawkLink3x(CoreLoadParameters <GBLink3xSettings, GBLink3xSyncSettings> lp) { if (lp.Roms.Count != 3) { throw new InvalidOperationException("Wrong number of roms"); } var ser = new BasicServiceProvider(this); ServiceProvider = ser; Link3xSettings = (GBLink3xSettings)lp.Settings ?? new GBLink3xSettings(); Link3xSyncSettings = (GBLink3xSyncSettings)lp.SyncSettings ?? new GBLink3xSyncSettings(); _controllerDeck = new GBHawkLink3xControllerDeck(GBHawkLink3xControllerDeck.DefaultControllerName, GBHawkLink3xControllerDeck.DefaultControllerName, GBHawkLink3xControllerDeck.DefaultControllerName); var tempSetL = new GBHawk.GBHawk.GBSettings(); var tempSetC = new GBHawk.GBHawk.GBSettings(); var tempSetR = new GBHawk.GBHawk.GBSettings(); var tempSyncL = new GBHawk.GBHawk.GBSyncSettings(); var tempSyncC = new GBHawk.GBHawk.GBSyncSettings(); var tempSyncR = new GBHawk.GBHawk.GBSyncSettings(); tempSyncL.ConsoleMode = Link3xSyncSettings.ConsoleMode_L; tempSyncC.ConsoleMode = Link3xSyncSettings.ConsoleMode_C; tempSyncR.ConsoleMode = Link3xSyncSettings.ConsoleMode_R; tempSyncL.GBACGB = Link3xSyncSettings.GBACGB; tempSyncC.GBACGB = Link3xSyncSettings.GBACGB; tempSyncR.GBACGB = Link3xSyncSettings.GBACGB; tempSyncL.RTCInitialTime = Link3xSyncSettings.RTCInitialTime_L; tempSyncC.RTCInitialTime = Link3xSyncSettings.RTCInitialTime_C; tempSyncR.RTCInitialTime = Link3xSyncSettings.RTCInitialTime_R; tempSyncL.RTCOffset = Link3xSyncSettings.RTCOffset_L; tempSyncC.RTCOffset = Link3xSyncSettings.RTCOffset_C; tempSyncR.RTCOffset = Link3xSyncSettings.RTCOffset_R; L = new GBHawk.GBHawk(lp.Comm, lp.Roms[0].Game, lp.Roms[0].RomData, tempSetL, tempSyncL); C = new GBHawk.GBHawk(lp.Comm, lp.Roms[1].Game, lp.Roms[1].RomData, tempSetC, tempSyncC); R = new GBHawk.GBHawk(lp.Comm, lp.Roms[2].Game, lp.Roms[2].RomData, tempSetR, tempSyncR); ser.Register <IVideoProvider>(this); ser.Register <ISoundProvider>(this); _tracer = new TraceBuffer { Header = L.cpu.TraceHeader }; ser.Register(_tracer); _lStates = L.ServiceProvider.GetService <IStatable>(); _cStates = C.ServiceProvider.GetService <IStatable>(); _rStates = R.ServiceProvider.GetService <IStatable>(); SetupMemoryDomains(); HardReset(); }
//[CoreConstructor("GB", "GBC")] public GBHawkLink3x(CoreComm comm, GameInfo game_L, byte[] rom_L, GameInfo game_C, byte[] rom_C, GameInfo game_R, byte[] rom_R, /*string gameDbFn,*/ object settings, object syncSettings) { var ser = new BasicServiceProvider(this); ServiceProvider = ser; Link3xSettings = (GBLink3xSettings)settings ?? new GBLink3xSettings(); Link3xSyncSettings = (GBLink3xSyncSettings)syncSettings ?? new GBLink3xSyncSettings(); _controllerDeck = new GBHawkLink3xControllerDeck(GBHawkLink3xControllerDeck.DefaultControllerName, GBHawkLink3xControllerDeck.DefaultControllerName, GBHawkLink3xControllerDeck.DefaultControllerName); var tempSetL = new GBHawk.GBHawk.GBSettings(); var tempSetC = new GBHawk.GBHawk.GBSettings(); var tempSetR = new GBHawk.GBHawk.GBSettings(); var tempSyncL = new GBHawk.GBHawk.GBSyncSettings(); var tempSyncC = new GBHawk.GBHawk.GBSyncSettings(); var tempSyncR = new GBHawk.GBHawk.GBSyncSettings(); tempSyncL.ConsoleMode = Link3xSyncSettings.ConsoleMode_L; tempSyncC.ConsoleMode = Link3xSyncSettings.ConsoleMode_C; tempSyncR.ConsoleMode = Link3xSyncSettings.ConsoleMode_R; tempSyncL.GBACGB = Link3xSyncSettings.GBACGB; tempSyncC.GBACGB = Link3xSyncSettings.GBACGB; tempSyncR.GBACGB = Link3xSyncSettings.GBACGB; tempSyncL.RTCInitialTime = Link3xSyncSettings.RTCInitialTime_L; tempSyncC.RTCInitialTime = Link3xSyncSettings.RTCInitialTime_C; tempSyncR.RTCInitialTime = Link3xSyncSettings.RTCInitialTime_R; tempSyncL.RTCOffset = Link3xSyncSettings.RTCOffset_L; tempSyncC.RTCOffset = Link3xSyncSettings.RTCOffset_C; tempSyncR.RTCOffset = Link3xSyncSettings.RTCOffset_R; L = new GBHawk.GBHawk(comm, game_L, rom_L, tempSetL, tempSyncL); C = new GBHawk.GBHawk(comm, game_C, rom_C, tempSetC, tempSyncC); R = new GBHawk.GBHawk(comm, game_R, rom_R, tempSetR, tempSyncR); ser.Register <IVideoProvider>(this); ser.Register <ISoundProvider>(this); _tracer = new TraceBuffer { Header = L.cpu.TraceHeader }; ser.Register(_tracer); _lStates = L.ServiceProvider.GetService <IStatable>(); _cStates = C.ServiceProvider.GetService <IStatable>(); _rStates = R.ServiceProvider.GetService <IStatable>(); SetupMemoryDomains(); HardReset(); }
//[CoreConstructor("GB", "GBC")] public GBHawkLink3x(CoreComm comm, GameInfo game_L, byte[] rom_L, GameInfo game_C, byte[] rom_C, GameInfo game_R, byte[] rom_R, /*string gameDbFn,*/ object settings, object syncSettings) { var ser = new BasicServiceProvider(this); Link3xSettings = (GBLink3xSettings)settings ?? new GBLink3xSettings(); Link3xSyncSettings = (GBLink3xSyncSettings)syncSettings ?? new GBLink3xSyncSettings(); _controllerDeck = new GBHawkLink3xControllerDeck(GBHawkLink3xControllerDeck.DefaultControllerName, GBHawkLink3xControllerDeck.DefaultControllerName, GBHawkLink3xControllerDeck.DefaultControllerName); CoreComm = comm; var temp_set_L = new GBHawk.GBHawk.GBSettings(); var temp_set_C = new GBHawk.GBHawk.GBSettings(); var temp_set_R = new GBHawk.GBHawk.GBSettings(); var temp_sync_L = new GBHawk.GBHawk.GBSyncSettings(); var temp_sync_C = new GBHawk.GBHawk.GBSyncSettings(); var temp_sync_R = new GBHawk.GBHawk.GBSyncSettings(); temp_sync_L.ConsoleMode = Link3xSyncSettings.ConsoleMode_L; temp_sync_C.ConsoleMode = Link3xSyncSettings.ConsoleMode_C; temp_sync_R.ConsoleMode = Link3xSyncSettings.ConsoleMode_R; temp_sync_L.GBACGB = Link3xSyncSettings.GBACGB; temp_sync_C.GBACGB = Link3xSyncSettings.GBACGB; temp_sync_R.GBACGB = Link3xSyncSettings.GBACGB; temp_sync_L.RTCInitialTime = Link3xSyncSettings.RTCInitialTime_L; temp_sync_C.RTCInitialTime = Link3xSyncSettings.RTCInitialTime_C; temp_sync_R.RTCInitialTime = Link3xSyncSettings.RTCInitialTime_R; temp_sync_L.RTCOffset = Link3xSyncSettings.RTCOffset_L; temp_sync_C.RTCOffset = Link3xSyncSettings.RTCOffset_C; temp_sync_R.RTCOffset = Link3xSyncSettings.RTCOffset_R; L = new GBHawk.GBHawk(new CoreComm(comm.ShowMessage, comm.Notify) { CoreFileProvider = comm.CoreFileProvider }, game_L, rom_L, temp_set_L, temp_sync_L); C = new GBHawk.GBHawk(new CoreComm(comm.ShowMessage, comm.Notify) { CoreFileProvider = comm.CoreFileProvider }, game_C, rom_C, temp_set_C, temp_sync_C); R = new GBHawk.GBHawk(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(); }