Previous 199869 Revisions Next

r41643 Sunday 8th November, 2015 at 11:08:13 UTC by Robbbert
Microkit: It sort of works, but with major issues. (nw)
[src/mame/drivers]microkit.c

trunk/src/mame/drivers/microkit.c
r250154r250155
66
77    http://www.vintagecomputer.net/browse_thread.cfm?id=511
88
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.
1015
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
1136#include "emu.h"
1237#include "cpu/cosmac/cosmac.h"
38#include "bus/rs232/rs232.h"
39#include "machine/terminal.h"
1340
41
1442class microkit_state : public driver_device
1543{
1644public:
1745   microkit_state(const machine_config &mconfig, device_type type, const char *tag)
1846      : driver_device(mconfig, type, tag)
47      , m_maincpu(*this, "maincpu")
48      , m_rs232(*this, "rs232")
49      , m_terminal(*this, "terminal")
1950   { }
51
52   DECLARE_READ_LINE_MEMBER(clear_r);
53   DECLARE_WRITE8_MEMBER(ram_w);
54   DECLARE_READ8_MEMBER(ram_r);
55
56private:
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;
2063};
2164
2265static 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
2469ADDRESS_MAP_END
2570
2671static ADDRESS_MAP_START( microkit_io, AS_IO, 8, microkit_state )
72   AM_RANGE(0x07, 0x07) AM_WRITENOP // writes a lots of zeros here
2773ADDRESS_MAP_END
2874
2975static INPUT_PORTS_START( microkit )
3076INPUT_PORTS_END
3177
78READ_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
88READ8_MEMBER( microkit_state::ram_r )
89{
90   return m_ram_data;
91}
92
93WRITE8_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
100void microkit_state::machine_reset()
101{
102   m_resetcnt = 0;
103   m_ram_data = 0;
104}
105
106static 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 )
113DEVICE_INPUT_DEFAULTS_END
114
115
32116static MACHINE_CONFIG_START( microkit, microkit_state )
33117   // basic machine hardware
34   MCFG_CPU_ADD("maincpu", CDP1801, 2000000)
118   MCFG_CPU_ADD("maincpu", CDP1802, 1750000)
35119   MCFG_CPU_PROGRAM_MAP(microkit_mem)
36120   MCFG_CPU_IO_MAP(microkit_io)
37121   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)
38129MACHINE_CONFIG_END
39130
40131ROM_START( microkit )


Previous 199869 Revisions Next


© 1997-2024 The MAME Team