Beispiel #1
0
        public Cpu(CpuMap map)
        {
            m_map = map;

            // read pc from fffc lo and fffd hi
            m_pc = m_map.Read(0xFFFC);
            m_pc |= (uint)(m_map.Read(0xFFFD)<<8);

            m_opcode_methods = new Dictionary<byte, Op>
            {
                { 0x08, Op_PHP },
                { 0x09, Op_ORA },
                { 0x10, Op_BPL },
                { 0x0A, Op_ASL },
                { 0x18, Op_CLC },
                { 0x20, Op_JSR },
                { 0x28, Op_PLP },
                { 0x29, Op_AND },
                { 0x38, Op_SEC },
                { 0x45, Op_EOR },
                { 0x48, Op_PHA },
                { 0x4A, Op_LSR },
                { 0x56, Op_LSR },
                { 0x60, Op_RTS },
                { 0x65, Op_ADC },
                { 0x68, Op_PLA },
                { 0x6A, Op_ROR },
                { 0x76, Op_ROR },
                { 0x78, Op_SEI },
                { 0x84, Op_STY },
                { 0x85, Op_STA },
                { 0x86, Op_STX },
                { 0x88, Op_DEY },
                { 0x8A, Op_TXA },
                { 0x8C, Op_STY },
                { 0x8D, Op_STA },
                { 0x8E, Op_STX },
                { 0x90, Op_BCC },
                { 0x91, Op_STA },
                { 0x98, Op_TYA },
                { 0x99, Op_STA },
                { 0x9A, Op_TXS },
                { 0xA0, Op_LDY },
                { 0xA2, Op_LDX },
                { 0xA4, Op_LDY },
                { 0xA5, Op_LDA },
                { 0xA6, Op_LDX },
                { 0xA9, Op_LDA },
                { 0xAA, Op_TAX },
                { 0xAD, Op_LDA },
                { 0xAE, Op_LDX },
                { 0xB0, Op_BCS },
                { 0xB1, Op_LDA },
                { 0xB5, Op_LDA },
                { 0xBD, Op_LDA },
                { 0xC6, Op_DEC },
                { 0xC8, Op_INY },
                { 0xC9, Op_CMP },
                { 0xCA, Op_DEX },
                { 0xD0, Op_BNE },
                { 0xD8, Op_CLD },
                { 0xE5, Op_SBC },
                { 0xE8, Op_INX },
                { 0xF0, Op_BEQ }
            };
        }
Beispiel #2
0
        public Cpu(CpuMap map)
        {
            m_map = map;

            // read pc from fffc lo and fffd hi
            m_pc  = m_map.Read(0xFFFC);
            m_pc |= (uint)(m_map.Read(0xFFFD) << 8);

            m_opcode_methods = new Dictionary <byte, Op>
            {
                { 0x08, Op_PHP },
                { 0x09, Op_ORA },
                { 0x10, Op_BPL },
                { 0x0A, Op_ASL },
                { 0x18, Op_CLC },
                { 0x20, Op_JSR },
                { 0x28, Op_PLP },
                { 0x29, Op_AND },
                { 0x38, Op_SEC },
                { 0x45, Op_EOR },
                { 0x48, Op_PHA },
                { 0x4A, Op_LSR },
                { 0x56, Op_LSR },
                { 0x60, Op_RTS },
                { 0x65, Op_ADC },
                { 0x68, Op_PLA },
                { 0x6A, Op_ROR },
                { 0x76, Op_ROR },
                { 0x78, Op_SEI },
                { 0x84, Op_STY },
                { 0x85, Op_STA },
                { 0x86, Op_STX },
                { 0x88, Op_DEY },
                { 0x8A, Op_TXA },
                { 0x8C, Op_STY },
                { 0x8D, Op_STA },
                { 0x8E, Op_STX },
                { 0x90, Op_BCC },
                { 0x91, Op_STA },
                { 0x98, Op_TYA },
                { 0x99, Op_STA },
                { 0x9A, Op_TXS },
                { 0xA0, Op_LDY },
                { 0xA2, Op_LDX },
                { 0xA4, Op_LDY },
                { 0xA5, Op_LDA },
                { 0xA6, Op_LDX },
                { 0xA9, Op_LDA },
                { 0xAA, Op_TAX },
                { 0xAD, Op_LDA },
                { 0xAE, Op_LDX },
                { 0xB0, Op_BCS },
                { 0xB1, Op_LDA },
                { 0xB5, Op_LDA },
                { 0xBD, Op_LDA },
                { 0xC6, Op_DEC },
                { 0xC8, Op_INY },
                { 0xC9, Op_CMP },
                { 0xCA, Op_DEX },
                { 0xD0, Op_BNE },
                { 0xD8, Op_CLD },
                { 0xE5, Op_SBC },
                { 0xE8, Op_INX },
                { 0xF0, Op_BEQ }
            };
        }