public PutSettingsDirtyBits PutSyncSettings(NESSyncSettings o)
        {
            bool ret = NESSyncSettings.NeedsReboot(SyncSettings, o);

            SyncSettings = o;
            return(ret ? PutSettingsDirtyBits.RebootCore : PutSettingsDirtyBits.None);
        }
示例#2
0
        public bool PutSyncSettings(NESSyncSettings o)
        {
            bool ret = NESSyncSettings.NeedsReboot(SyncSettings, o);

            SyncSettings = o;
            return(ret);
        }
示例#3
0
 public static bool NeedsReboot(NESSyncSettings x, NESSyncSettings y)
 {
     return(!(Util.DictionaryEqual(x.BoardProperties, y.BoardProperties) &&
              x.RegionOverride == y.RegionOverride &&
              !NESControlSettings.NeedsReboot(x.Controls, y.Controls) &&
              ((x.InitialWRamStatePattern ?? new List <byte>()).SequenceEqual(y.InitialWRamStatePattern ?? new List <byte>()))));
 }
示例#4
0
        public NES(CoreComm comm, GameInfo game, byte[] rom, NESSettings settings, NESSyncSettings syncSettings)
        {
            var ser = new BasicServiceProvider(this);

            ServiceProvider = ser;

            byte[] fdsBios = comm.CoreFileProvider.GetFirmware("NES", "Bios_FDS", false);
            if (fdsBios != null && fdsBios.Length == 40976)
            {
                comm.ShowMessage("Your FDS BIOS is a bad dump.  BizHawk will attempt to use it, but no guarantees!  You should find a new one.");
                var tmp = new byte[8192];
                Buffer.BlockCopy(fdsBios, 16 + 8192 * 3, tmp, 0, 8192);
                fdsBios = tmp;
            }

            SyncSettings       = (NESSyncSettings)syncSettings ?? new NESSyncSettings();
            ControllerSettings = SyncSettings.Controls;

            videoProvider = new MyVideoProvider(this);
            Init(game, rom, fdsBios);
            if (Board is FDS fds)
            {
                DriveLightEnabled = true;
                fds.SetDriveLightCallback(val => DriveLightOn = val);
                // bit of a hack: we don't have a private gamedb for FDS, but the frontend
                // expects this to be set.
                RomStatus = game.Status;
            }
            PutSettings((NESSettings)settings ?? new NESSettings());

            // we need to put this here because the line directly above will overwrite palette intialization anywhere else
            // TODO: What if settings are later loaded?
            if (_isVS)
            {
                PickVSPalette(cart);
            }

            ser.Register <IDisassemblable>(cpu);

            Tracer = new TraceBuffer {
                Header = cpu.TraceHeader
            };
            ser.Register <ITraceable>(Tracer);
            ser.Register <IVideoProvider>(videoProvider);
            ser.Register <ISoundProvider>(this);
            ser.Register <IStatable>(new StateSerializer(SyncState)
            {
                LoadStateCallback = SetupMemoryDomains
            });

            if (Board is BANDAI_FCG_1 bandai)
            {
                var reader = bandai.reader;
                // not all BANDAI FCG 1 boards have a barcode reader
                if (reader != null)
                {
                    ser.Register(reader);
                }
            }
        }
示例#5
0
文件: NES.cs 项目: stuff2600/RAEmus
        public bool PutSyncSettings(object o)
        {
            var  n   = (NESSyncSettings)o;
            bool ret = NESSyncSettings.NeedsReboot(SyncSettings, n);

            SyncSettings = n;
            return(ret);
        }
示例#6
0
 public static bool NeedsReboot(NESSyncSettings x, NESSyncSettings y)
 {
     return(!(Util.DictionaryEqual(x.BoardProperties, y.BoardProperties) &&
              x.RegionOverride == y.RegionOverride &&
              !NESControlSettings.NeedsReboot(x.Controls, y.Controls)));
 }
示例#7
0
 public bool PutSyncSettings(NESSyncSettings o)
 {
     bool ret = NESSyncSettings.NeedsReboot(SyncSettings, o);
     SyncSettings = o;
     return ret;
 }
示例#8
0
 public static bool NeedsReboot(NESSyncSettings x, NESSyncSettings y)
 {
     return !(Util.DictionaryEqual(x.BoardProperties, y.BoardProperties) &&
         x.RegionOverride == y.RegionOverride &&
         !NESControlSettings.NeedsReboot(x.Controls, y.Controls));
 }
示例#9
0
文件: NES.cs 项目: ddugovic/RASuite
		public bool PutSyncSettings(object o)
		{
			var n = (NESSyncSettings)o;
			bool ret = NESSyncSettings.NeedsReboot(SyncSettings, n);
			SyncSettings = n;
			return ret;
		}