예제 #1
0
        private static bool DetectPal(GameInfo game, byte[] rom)
        {
            // force NTSC mode for the new core we instantiate
            var newgame = game.Clone();

            if (newgame["PAL"])
            {
                newgame.RemoveOption("PAL");
            }
            if (!newgame["NTSC"])
            {
                newgame.AddOption("NTSC");
            }

            // give the emu a minimal of input\output connections so it doesn't crash
            var comm = new CoreComm(null, null);

            using (Atari2600 emu = new Atari2600(new CoreComm(null, null), newgame, rom, null, null))
            {
                emu.Controller = new NullController();

                List <int> framecounts = new List <int>();
                emu._tia.FrameEndCallBack = (i) => framecounts.Add(i);
                for (int i = 0; i < 71; i++)                 // run for 71 * 262 lines, since we're in NTSC mode
                {
                    emu.FrameAdvance(false, false);
                }
                int  numpal = framecounts.Count((i) => i > 287);
                bool pal    = numpal >= 25;
                Console.WriteLine("PAL Detection: {0} lines, {1}", numpal, pal);
                return(pal);
            }
        }
예제 #2
0
        private static bool DetectPal(GameInfo game, byte[] rom)
        {
            // force NTSC mode for the new core we instantiate
            var newGame = game.Clone();

            if (newGame["PAL"])
            {
                newGame.RemoveOption("PAL");
            }

            if (!newGame["NTSC"])
            {
                newGame.AddOption("NTSC", "");
            }

            // here we advance past start up irregularities to see how long a frame is based on calls to Vsync
            // we run 72 frames, then run 270 scanlines worth of cycles.
            // if we don't hit a new frame, we can be pretty confident we are in PAL
            using var emu = new Atari2600(newGame, rom, null, null);
            for (int i = 0; i < 72; i++)
            {
                emu.FrameAdvance(NullController.Instance, false, false);
            }

            for (int i = 0; i < 61560; i++)
            {
                emu.Cycle();
            }

            bool pal = !emu._tia.New_Frame;

            Console.WriteLine("PAL Detection: {0}", pal);
            return(pal);
        }
예제 #3
0
 public TIA(Atari2600 core, bool pal, bool secam)
 {
     _core            = core;
     _player0.ScanCnt = 8;
     _player1.ScanCnt = 8;
     _pal             = pal;
     SetSECAM(secam);
 }
예제 #4
0
 static MapperBase SetMultiCartMapper(Atari2600 core, int romLength, int gameTotal)
 {
     return((romLength / gameTotal) switch
     {
         1024 * 2 => new Multicart2K(core, gameTotal),
         1024 * 4 => new Multicart4K(core, gameTotal),
         1024 * 8 => new Multicart8K(core, gameTotal),
         _ => new Multicart4K(core, gameTotal)
     });
예제 #5
0
파일: M6532.cs 프로젝트: lenalia/BizHawk
        public M6532(Atari2600 core)
        {
            _core = core;

            // Apparently starting the timer at 0 will break for some games (Solaris and H.E.R.O.). To avoid that, we pick an
            // arbitrary value to start with.
            Timer.Value          = 0x73;
            Timer.PrescalerShift = 10;
            Timer.PrescalerCount = 1 << Timer.PrescalerShift;
        }
예제 #6
0
파일: M6532.cs 프로젝트: ddugovic/RASuite
		public M6532(Atari2600 core)
		{
			_core = core;

			// Apparently starting the timer at 0 will break for some games (Solaris and H.E.R.O.). To avoid that, we pick an
			// arbitrary value to start with.
			Timer.Value = 0x73;
			Timer.PrescalerShift = 10;
			Timer.PrescalerCount = 1 << Timer.PrescalerShift;
		}
예제 #7
0
파일: TIA.cs 프로젝트: timconner/BizHawk
        public TIA(Atari2600 core, bool pal, bool secam)
        {
            _core            = core;
            _player0.ScanCnt = 8;
            _player1.ScanCnt = 8;
            _pal             = pal;

            SetSecam(secam);
            CalcFrameRate();

            _spf = _vsyncNum / (double)_vsyncDen > 55.0 ? 735 : 882;
        }
예제 #8
0
 public mF6(Atari2600 core) : base(core)
 {
 }
예제 #9
0
 public mF8_sega(Atari2600 core) : base(core)
 {
 }
예제 #10
0
 public mAR(Atari2600 core)
 {
     Core = core;
     InitializeSettings();
 }
예제 #11
0
 public m4A50(Atari2600 core) : base(core)
 {
 }
예제 #12
0
 protected MapperBase(Atari2600 core)
 {
     Core = core;
 }
예제 #13
0
 public CpuLink(Atari2600 atari2600)
 {
     _atari2600 = atari2600;
 }
예제 #14
0
 public m3F(Atari2600 core) : base(core)
 {
 }
예제 #15
0
 public mDPC(Atari2600 core) : base(core)
 {
 }
예제 #16
0
파일: mAR.cs 프로젝트: gocha/BizHawk
 public mAR(Atari2600 core) : base(core)
 {
     InitializeSettings();
 }
 // TODO: PokeMem, and everything else
 public mDPCPlus(Atari2600 core) : base(core)
 {
     throw new NotImplementedException();
 }
예제 #18
0
 public mE7(Atari2600 core) : base(core)
 {
 }
예제 #19
0
파일: mAR.cs 프로젝트: ddugovic/RASuite
		public mAR(Atari2600 core)
		{
			Core = core;
			InitializeSettings();
		}
예제 #20
0
 public mSB(Atari2600 core) : base(core)
 {
 }
 public Multicart4K(Atari2600 core, int gameTotal)
     : base(core)
 {
     _gameTotal   = gameTotal;
     _currentGame = 0;
 }
예제 #22
0
 public mF4SC(Atari2600 core) : base(core)
 {
 }
예제 #23
0
파일: TIA.cs 프로젝트: CadeLaRen/BizHawk
 public TIA(Atari2600 core, bool pal, bool secam)
 {
     _core = core;
     _player0.ScanCnt = 8;
     _player1.ScanCnt = 8;
     _pal = pal;
     SetSECAM(secam);
 }
예제 #24
0
 public mCV(Atari2600 core) : base(core)
 {
 }
예제 #25
0
 public m0840(Atari2600 core) : base(core)
 {
 }
예제 #26
0
 private static MapperBase CreateMapper(Atari2600 core, string mapperName, int romLength)
 {
예제 #27
0
 public mUA(Atari2600 core) : base(core)
 {
 }
예제 #28
0
 public mEFSC(Atari2600 core) : base(core)
 {
 }
예제 #29
0
		private static bool DetectPal(GameInfo game, byte[] rom)
		{
			// force NTSC mode for the new core we instantiate
			var newgame = game.Clone();
			if (newgame["PAL"])
				newgame.RemoveOption("PAL");
			if (!newgame["NTSC"])
				newgame.AddOption("NTSC");

			// give the emu a minimal of input\output connections so it doesn't crash
			var comm = new CoreComm(null, null);
			comm.InputCallback = new InputCallbackSystem();
			using (Atari2600 emu = new Atari2600(new CoreComm(null, null), newgame, rom, null, null))
			{
				emu.Controller = new NullController();

				List<int> framecounts = new List<int>();
				emu._tia.FrameEndCallBack = (i) => framecounts.Add(i);
				for (int i = 0; i < 71; i++) // run for 71 * 262 lines, since we're in NTSC mode
					emu.FrameAdvance(false, false);
				int numpal = framecounts.Count((i) => i > 287);
				bool pal = numpal >= 25;
				Console.WriteLine("PAL Detection: {0} lines, {1}", numpal, pal);
				return pal;
			}
		}