Exemplo n.º 1
0
        public static void Main(string[] args)
        {
            if (args == null || args.Length < 1 || string.IsNullOrWhiteSpace (args [0])) {
                Console.WriteLine ("First argument should be path to NES rom.");
                return;
            }

            var fileInfo = new System.IO.FileInfo (args [0]);
            if (!fileInfo.Exists) {
                Console.WriteLine ("File does not exist: {0}", fileInfo.FullName);
                return;
            }

            var rom = NesRom.Parse (fileInfo);
            var memory = new Memory (0x10000);
            var cpu = new CPU (memory);

            var nesEmulation = new NES (cpu, memory);

            nesEmulation.LoadRom (rom);
            nesEmulation.Reset ();

            nesEmulation.BeginEmulation ();

            Console.WriteLine ("Press any key to whatever.");
            Console.ReadKey ();

            nesEmulation.EndEmulation ();
        }
Exemplo n.º 2
0
 public NES(CPU cpu, Memory memory)
 {
     _memory = memory;
     _cpu = cpu;
     _cpu6502Thread = new Thread (Emulate);
 }
Exemplo n.º 3
0
 public NES(CPU cpu, Memory memory)
 {
     _memory        = memory;
     _cpu           = cpu;
     _cpu6502Thread = new Thread(Emulate);
 }