Esempio n. 1
0
        public FM2TASController(string fm2Path, int playerNumber, NESConsole console)
        {
            this.playerNumber = playerNumber;
            this.console = console;

            string[] lines = File.ReadAllLines(fm2Path).Where(x => x.StartsWith("|")).ToArray();
            keysForFrame = new byte[lines.Length];

            int frame = 0;
            foreach(string line in lines)
            {
                byte keys = 0;
                if (line.Substring(3, 12).Contains("R")) keys |= 0x80;
                if (line.Substring(3, 12).Contains("L")) keys |= 0x40;
                if (line.Substring(3, 12).Contains("D")) keys |= 0x20;
                if (line.Substring(3, 12).Contains("U")) keys |= 0x10;
                if (line.Substring(3, 12).Contains("T")) keys |= 0x08;
                if (line.Substring(3, 12).Contains("S")) keys |= 0x04;
                if (line.Substring(3, 12).Contains("B")) keys |= 0x02;
                if (line.Substring(3, 12).Contains("A")) keys |= 0x01;

                keysForFrame[frame] = keys;
                frame++;
            }
        }
Esempio n. 2
0
 public PPU(NESConsole console)
 {
     this.console = console;
     for (int i = 0; i < 0x4000; ++i)
     {
         RAM[i] = 0;
     }
 }
Esempio n. 3
0
        public FM2TASController(string fm2Path, int playerNumber, NESConsole console)
        {
            this.playerNumber = playerNumber;
            this.console      = console;

            string[] lines = File.ReadAllLines(fm2Path).Where(x => x.StartsWith("|")).ToArray();
            keysForFrame = new byte[lines.Length];

            int frame = 0;

            foreach (string line in lines)
            {
                byte keys = 0;
                if (line.Substring(3, 12).Contains("R"))
                {
                    keys |= 0x80;
                }
                if (line.Substring(3, 12).Contains("L"))
                {
                    keys |= 0x40;
                }
                if (line.Substring(3, 12).Contains("D"))
                {
                    keys |= 0x20;
                }
                if (line.Substring(3, 12).Contains("U"))
                {
                    keys |= 0x10;
                }
                if (line.Substring(3, 12).Contains("T"))
                {
                    keys |= 0x08;
                }
                if (line.Substring(3, 12).Contains("S"))
                {
                    keys |= 0x04;
                }
                if (line.Substring(3, 12).Contains("B"))
                {
                    keys |= 0x02;
                }
                if (line.Substring(3, 12).Contains("A"))
                {
                    keys |= 0x01;
                }

                keysForFrame[frame] = keys;
                frame++;
            }
        }
Esempio n. 4
0
 public Memory(NESConsole console)
 {
     this.console = console;
     RAM = new byte[0x800];
 }
Esempio n. 5
0
 public Mapper004(NESConsole console)
 {
     this.console = console;
 }
Esempio n. 6
0
        public CPU(NESConsole console)
        {
            this.console = console;

            initializeOpCodeTable();
        }
Esempio n. 7
0
        private void initializeSystem()
        {
            cart = new Cartridge("C:\\roms\\lolo.nes");
            system = new NESConsole(cart);
            system.cpu.coldBoot();
            system.ppu.coldBoot();

            system.ppu.setLoggerEnabled(false);
            system.cpu.setLoggerEnabled(false);
            system.io.setLoggerEnabled(false);
        }
Esempio n. 8
0
 public Memory(NESConsole console)
 {
     this.console = console;
     RAM          = new byte[0x800];
 }