示例#1
0
        void ISystemBase.setupBase()
        {
            // inititalize system components
            m_cpu = new MOS6502();

            m_cpu.installRAMBank(64);

            m_cpu.registerMemoryAccess(0xF001, readDsp, writeDsp);
            m_cpu.registerMemoryAccess(0xF004, readKbd, writeKbd);

            // setup display
            m_VideoInfo            = new VideoInfoStruct();
            m_VideoInfo.Rows       = 25;
            m_VideoInfo.Cols       = 40;
            m_VideoInfo.CharHeight = 8;
            m_VideoInfo.CharWidth  = 8;
            m_VideoInfo.FontColor  = Color.Orange;
            m_VideoInfo.BackColor  = Color.Black;

            m_iCursorX     = m_iCursorY = 0;
            m_ScreenBuffer = new char[m_VideoInfo.Rows][];
            for (int r = 0; r < m_VideoInfo.Rows; r++)
            {
                m_ScreenBuffer[r] = new char[m_VideoInfo.Cols];
                for (int c = 0; c < m_VideoInfo.Cols; c++)
                {
                    m_ScreenBuffer[r][c] = ' ';
                }
            }
            m_bNeedRefresh = false;

            m_DisplayQueue  = new Queue <byte>(10);
            m_KeyboardQueue = new Queue <byte>(5);

            // load ROMs
            loadROMs();

            m_cpu.Reset();
        }
示例#2
0
        void ISystemBase.setupBase()
        {
            // inititalize system components
            m_cpu = new MOS6502();
            m_cpu.installRAMBank(32);
            RAMextension ram = new RAMextension(m_cpu, 0xE800, 2); // for BASIC v2

            m_pia1 = new MOS6520("PIA1", m_cpu, 0xE810);
            m_pia2 = new MOS6520("PIA2", m_cpu, 0xE820);
            m_via  = new MOS6522("VIA", m_cpu, 0xE840);

            // set I/O and interupt lines
            m_pia1.OutputA       = receive_PIA1_A;
            m_pia1.InterruptLine = m_cpu.signalInterrupt;
            m_pia2.InterruptLine = m_cpu.signalInterrupt;
            m_via.InterruptLine  = m_cpu.signalInterrupt;

            initKeyboard();

            // setup display
            m_VideoInfo            = new VideoInfoStruct();
            m_VideoInfo.Rows       = 25;
            m_VideoInfo.Cols       = 40;
            m_VideoInfo.CharHeight = 8;
            m_VideoInfo.CharWidth  = 8;
            m_VideoInfo.FontColor  = Color.Green;
            m_VideoInfo.BackColor  = Color.Black;


            // setup screen buffer
            m_ScreenBuffer = new byte[0x0800];
            m_cpu.registerMemoryAccess(0x8000, 0x8800, read, write);

            // load ROMs
            loadROMs();

            m_cpu.Reset();
        }