Пример #1
0
        /// <summary>
        /// Crée une nouvelle instance de SNES
        /// </summary>
        public SnesPlatform()
        {
            //Taille maximale addressable par la SNES
            const int mappedMemorySize = 0x7FFFFF+1;

            memory = new MemoryContainer(mappedMemorySize);

            cpu = new CPU(this);

            decoder = new InstructionsDecoder(cpu);
            encoder = new InstructionsEncoder(cpu);
            interpreter = new LiveInstructionsDecoder(this);
        }
Пример #2
0
        public InstructionsDecodeTable(CPU cpu)
        {
            if (cpu == null)
                throw new ArgumentNullException("cpu");

            this.cpu = cpu;

            KnownInstructions = new Instruction[256];

            LoadKnownInstructions();

            /* Pour toutes les instructions qu'on ne connait pas ... */
            for (int i = 0; i < 256; i++)
            {
                if (KnownInstructions[i] == null)
                {
                    KnownInstructions[i] = new InstructionInvalid(cpu, i);
                    Debug.WriteLine(String.Format("No OpCode for : {0}", i.ToString("X")));
                }
            }
        }