Пример #1
0
        void ISystemBase.setupBase()
        {
            // setup display
            m_VideoInfo            = new VideoInfoStruct();
            m_VideoInfo.Rows       = 25;
            m_VideoInfo.Cols       = 80;
            m_VideoInfo.CharHeight = 16;
            m_VideoInfo.CharWidth  = 8;
            m_VideoInfo.FontColor  = Color.Green;
            m_VideoInfo.BackColor  = Color.Black;

            m_CursorX       = m_CursorY = 0;
            m_CursorVisible = true;

            // blank whole screen
            m_ScreenBuffer = new byte[m_VideoInfo.Rows][];
            for (int r = 0; r < m_VideoInfo.Rows; r++)
            {
                m_ScreenBuffer[r] = new byte[m_VideoInfo.Cols];
                for (int c = 0; c < m_VideoInfo.Cols; c++)
                {
                    m_ScreenBuffer[r][c] = 0x20;
                }
            }

            m_DisplayQueue = new Queue <byte>();

            // load character set
            m_CharacterROM         = Utilities.loadCharacterROM_2BANK("ROMs\\Herc.bin", 16);
            m_CharacterROMInverted = Utilities.loadCharacterROM_2BANK("ROMs\\Herc.bin", 16, true);
        }
Пример #2
0
        void ISystemBase.setupBase()
        {
            // inititalize system components
            m_cpu = new MOS6502();

            if (m_bLoadHELLO)
            {
                m_cpu.installRAMBank(60); // memory needs to go up to EFFF
            }
            else
            {
                m_cpu.installRAMBank(8);
            }

            m_pia = new MC6820("PIA", m_cpu, 0xD010);

            // note: Apple 1 has no interrupt lines connected
            m_pia.OutputB = receiveDsp;

            // setup display
            m_VideoInfo            = new VideoInfoStruct();
            m_VideoInfo.Rows       = 24;
            m_VideoInfo.Cols       = 40;
            m_VideoInfo.CharHeight = 8;
            m_VideoInfo.CharWidth  = 8;
            m_VideoInfo.FontColor  = Color.Green;
            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);

            // setup keyboard
            m_keymap = Apple1KeyMapFactory.Build("DE");

            // load ROMs
            loadROMs();

            m_cpu.Reset();
        }
Пример #3
0
        /// <summary>
        /// http://www.classiccmp.org/cpmarchives/trs80/mirrors/kjsl/www.kjsl.com/trs80/mod1intern.html
        /// </summary>
        void ISystemBase.setupBase()
        {
            m_cpu = new Z80();
            m_cpu.installRAMBank(0x4000, 16);

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

            ROMmodule rmBIOS = new ROMmodule(m_cpu, "ROMs\\TRS80_level1.rom", 0);

            m_cpu.Reset();
        }
Пример #4
0
        /// <summary>
        /// http://searle.hostei.com/grant/z80/SimpleZ80.html
        /// </summary>
        void ISystemBase.setupBase()
        {
            m_cpu = new Z80();
            m_cpu.installRAMBank(0x2000, 56);
            m_cpu.registerIOHandler(0x80, ControlIn, ControlOut);
            m_cpu.registerIOHandler(0x81, DataIn, DataOut);

            // 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;

            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 <KeyPressEventArgs>(10);

            // load character set
            m_CharacterROM         = Utilities.loadCharacterROM("ROMs\\SPECTRUM_ZX82.bin", 8, false, 0x3d00, 0x20);
            m_CharacterROMInverted = Utilities.loadCharacterROM("ROMs\\SPECTRUM_ZX82.bin", 8, true, 0x3d00, 0x20);
            //m_CharacterROM = Utilities.loadCharacterROM("ROMs\\CGA.bin", 8, false);
            //m_CharacterROMInverted = Utilities.loadCharacterROM("ROMs\\CGA.bin", 8, true);

            // load ROMs
            ROMmodule rmBIOS  = new ROMmodule(m_cpu, "ROMs\\Z80_INTMINI.bin", 0);
            ROMmodule rmBASIC = new ROMmodule(m_cpu, "ROMs\\Z80_BASIC.bin", 0x150);

            m_cpu.Reset();
        }
Пример #5
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();
        }
Пример #6
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();
        }
Пример #7
0
        public EmulatorScreen(ISystemBase system)
        {
            InitializeComponent();

            m_System = system;
            Text     = m_System.Title;
            m_System.setupBase();
            VideoInfoStruct vi = m_System.VideoInfo;

            int iPixelSize = 2;

            if (vi.CharHeight > 8)
            {
                iPixelSize = 1;
            }

            int iBorder = 2;

            // setup system screen canvas
            m_Canvas = new Canvas(vi.Rows, vi.Cols,
                                  iBorder, iPixelSize,
                                  vi.CharHeight, vi.CharWidth,
                                  vi.FontColor, vi.BackColor);
            Controls.Add(m_Canvas);

            // setup form with borders
            ClientSize = new Size(m_Canvas.Width + iBorder * 2, m_Canvas.Height + iBorder * 2);
            BackColor  = vi.BackColor;

            m_System.setupVideo(m_Canvas.renderCharacter,
                                m_Canvas.drawScanLine);

            Utilities.SetForegroundWindow(this.Handle.ToInt32());
            Show();

            m_System.run();
        }