trunk/src/mame/drivers/microkit.c
| r250154 | r250155 | |
| 6 | 6 | |
| 7 | 7 | http://www.vintagecomputer.net/browse_thread.cfm?id=511 |
| 8 | 8 | |
| 9 | | */ |
| 9 | Press CR or LF to get the * prompt. |
| 10 | Commands: |
| 11 | $Pxxxx - Jump to address xxxx |
| 12 | ?Mxxxx yyyy - Dump memory starting at xxxx for yyyy bytes |
| 13 | !Mxxxx yy zz... - Write data (yy etc) to memory xxxx. Data gets entered when you |
| 14 | press the space after the data. |
| 10 | 15 | |
| 16 | There's no sound or storage facilities, therefore no software. |
| 17 | |
| 18 | ToDo: |
| 19 | - No technical manual or schematic available, so the entire driver is bodgy guesswork. |
| 20 | - Address 0 needs to be read/writeable, otherwise the numbers you enter will get |
| 21 | internally corrupted. |
| 22 | - Address 8000 is IDL which hangs the system, so program counter is preset to 8001. |
| 23 | - The keyboard is hooked up serially, which is ok, but the output to the terminal |
| 24 | is rubbish, so parallel is used so you can at least see something. |
| 25 | - When you enter commands, you can't see what you're doing. |
| 26 | - When you enter numbers, they display as rubbish or act as control codes. They |
| 27 | internally work though. |
| 28 | - The computer looks like a rack-mount metal box with a rudimentary front panel. |
| 29 | Buttons are: Reset; Load; Run program; Run Utility |
| 30 | There is a RUN LED. |
| 31 | None of these items are emulated. |
| 32 | It also has a power switch and lamp, and a fuse. |
| 33 | |
| 34 | *****************************************************************************************/ |
| 35 | |
| 11 | 36 | #include "emu.h" |
| 12 | 37 | #include "cpu/cosmac/cosmac.h" |
| 38 | #include "bus/rs232/rs232.h" |
| 39 | #include "machine/terminal.h" |
| 13 | 40 | |
| 41 | |
| 14 | 42 | class microkit_state : public driver_device |
| 15 | 43 | { |
| 16 | 44 | public: |
| 17 | 45 | microkit_state(const machine_config &mconfig, device_type type, const char *tag) |
| 18 | 46 | : driver_device(mconfig, type, tag) |
| 47 | , m_maincpu(*this, "maincpu") |
| 48 | , m_rs232(*this, "rs232") |
| 49 | , m_terminal(*this, "terminal") |
| 19 | 50 | { } |
| 51 | |
| 52 | DECLARE_READ_LINE_MEMBER(clear_r); |
| 53 | DECLARE_WRITE8_MEMBER(ram_w); |
| 54 | DECLARE_READ8_MEMBER(ram_r); |
| 55 | |
| 56 | private: |
| 57 | virtual void machine_reset(); |
| 58 | UINT8 m_resetcnt; |
| 59 | UINT8 m_ram_data; |
| 60 | required_device<cosmac_device> m_maincpu; |
| 61 | required_device<rs232_port_device> m_rs232; |
| 62 | required_device<generic_terminal_device> m_terminal; |
| 20 | 63 | }; |
| 21 | 64 | |
| 22 | 65 | static ADDRESS_MAP_START( microkit_mem, AS_PROGRAM, 8, microkit_state ) |
| 23 | | AM_RANGE(0x0000, 0x01ff) AM_ROM AM_REGION("maincpu", 0) |
| 66 | AM_RANGE(0x0000, 0x0000) AM_READWRITE(ram_r,ram_w) |
| 67 | AM_RANGE(0x8000, 0x81ff) AM_ROM AM_REGION("maincpu", 0) |
| 68 | AM_RANGE(0x8200, 0x83ff) AM_RAM |
| 24 | 69 | ADDRESS_MAP_END |
| 25 | 70 | |
| 26 | 71 | static ADDRESS_MAP_START( microkit_io, AS_IO, 8, microkit_state ) |
| 72 | AM_RANGE(0x07, 0x07) AM_WRITENOP // writes a lots of zeros here |
| 27 | 73 | ADDRESS_MAP_END |
| 28 | 74 | |
| 29 | 75 | static INPUT_PORTS_START( microkit ) |
| 30 | 76 | INPUT_PORTS_END |
| 31 | 77 | |
| 78 | READ_LINE_MEMBER( microkit_state::clear_r ) |
| 79 | { |
| 80 | if (m_resetcnt < 0x10) |
| 81 | m_maincpu->set_state_int(COSMAC_R0, 0x8001); // skip IDL |
| 82 | if (m_resetcnt < 0x20) |
| 83 | m_resetcnt++; |
| 84 | // set reset pin to normal |
| 85 | return 1; |
| 86 | } |
| 87 | |
| 88 | READ8_MEMBER( microkit_state::ram_r ) |
| 89 | { |
| 90 | return m_ram_data; |
| 91 | } |
| 92 | |
| 93 | WRITE8_MEMBER( microkit_state::ram_w ) |
| 94 | { |
| 95 | m_ram_data = data; |
| 96 | if (data > 0 && data < 0x80) |
| 97 | m_terminal->write(space, 0, data); |
| 98 | } |
| 99 | |
| 100 | void microkit_state::machine_reset() |
| 101 | { |
| 102 | m_resetcnt = 0; |
| 103 | m_ram_data = 0; |
| 104 | } |
| 105 | |
| 106 | static DEVICE_INPUT_DEFAULTS_START( serial_keyb ) |
| 107 | DEVICE_INPUT_DEFAULTS( "RS232_TXBAUD", 0xff, RS232_BAUD_300 ) |
| 108 | DEVICE_INPUT_DEFAULTS( "RS232_RXBAUD", 0xff, RS232_BAUD_300 ) |
| 109 | DEVICE_INPUT_DEFAULTS( "RS232_STARTBITS", 0xff, RS232_STARTBITS_1 ) |
| 110 | DEVICE_INPUT_DEFAULTS( "RS232_DATABITS", 0xff, RS232_DATABITS_8 ) |
| 111 | DEVICE_INPUT_DEFAULTS( "RS232_PARITY", 0xff, RS232_PARITY_NONE ) |
| 112 | DEVICE_INPUT_DEFAULTS( "RS232_STOPBITS", 0xff, RS232_STOPBITS_2 ) |
| 113 | DEVICE_INPUT_DEFAULTS_END |
| 114 | |
| 115 | |
| 32 | 116 | static MACHINE_CONFIG_START( microkit, microkit_state ) |
| 33 | 117 | // basic machine hardware |
| 34 | | MCFG_CPU_ADD("maincpu", CDP1801, 2000000) |
| 118 | MCFG_CPU_ADD("maincpu", CDP1802, 1750000) |
| 35 | 119 | MCFG_CPU_PROGRAM_MAP(microkit_mem) |
| 36 | 120 | MCFG_CPU_IO_MAP(microkit_io) |
| 37 | 121 | MCFG_COSMAC_WAIT_CALLBACK(VCC) |
| 122 | MCFG_COSMAC_CLEAR_CALLBACK(READLINE(microkit_state, clear_r)) |
| 123 | |
| 124 | /* video hardware */ |
| 125 | MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "keyboard") |
| 126 | MCFG_RS232_RXD_HANDLER(DEVWRITELINE("maincpu", cosmac_device, ef4_w)) |
| 127 | MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("keyboard", serial_keyb) |
| 128 | MCFG_DEVICE_ADD("terminal", GENERIC_TERMINAL, 0) |
| 38 | 129 | MACHINE_CONFIG_END |
| 39 | 130 | |
| 40 | 131 | ROM_START( microkit ) |