src/mess/drivers/h89.c
| r13603 | r13604 | |
| 4 | 4 | |
| 5 | 5 | 12/05/2009 Skeleton driver. |
| 6 | 6 | |
| 7 | Monitor Commands: |
| 8 | B Boot |
| 9 | C Convert (number) |
| 10 | G Go (address) |
| 11 | I In (address) |
| 12 | O Out (address,data) |
| 13 | R Radix (H/O) |
| 14 | S Substitute (address) |
| 15 | T Test Memory |
| 16 | V View |
| 17 | |
| 7 | 18 | ****************************************************************************/ |
| 8 | 19 | #define ADDRESS_MAP_MODERN |
| 9 | 20 | |
| 10 | 21 | #include "emu.h" |
| 11 | 22 | #include "cpu/z80/z80.h" |
| 23 | #include "machine/ins8250.h" |
| 24 | #include "machine/terminal.h" |
| 12 | 25 | |
| 13 | 26 | |
| 14 | 27 | class h89_state : public driver_device |
| 15 | 28 | { |
| 16 | 29 | public: |
| 17 | 30 | h89_state(const machine_config &mconfig, device_type type, const char *tag) |
| 18 | | : driver_device(mconfig, type, tag) { } |
| 31 | : driver_device(mconfig, type, tag), |
| 32 | m_maincpu(*this, "maincpu"), |
| 33 | m_uart(*this, "ins8250") |
| 34 | { } |
| 19 | 35 | |
| 36 | required_device<cpu_device> m_maincpu; |
| 37 | required_device<device_t> m_uart; |
| 38 | |
| 39 | DECLARE_WRITE8_MEMBER( h89_kbd_put ); |
| 40 | DECLARE_WRITE8_MEMBER( port_f2_w ); |
| 41 | |
| 42 | UINT8 m_port_f2; |
| 20 | 43 | }; |
| 21 | 44 | |
| 22 | 45 | |
| 23 | 46 | static ADDRESS_MAP_START(h89_mem, AS_PROGRAM, 8, h89_state) |
| 24 | 47 | ADDRESS_MAP_UNMAP_HIGH |
| 25 | | AM_RANGE(0x0000, 0x0fff) AM_ROM |
| 26 | | AM_RANGE(0x1000, 0xffff) AM_RAM |
| 48 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 49 | AM_RANGE(0x2000, 0xffff) AM_RAM |
| 27 | 50 | ADDRESS_MAP_END |
| 28 | 51 | |
| 29 | 52 | static ADDRESS_MAP_START( h89_io, AS_IO, 8, h89_state) |
| 30 | 53 | ADDRESS_MAP_UNMAP_HIGH |
| 31 | 54 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 55 | // AM_RANGE(0x78, 0x7b) expansion 1 |
| 56 | // AM_RANGE(0x7c, 0x7f) expansion 2 |
| 57 | // AM_RANGE(0xd0, 0xd7) 8250 UART DCE |
| 58 | // AM_RANGE(0xd8, 0xdf) 8250 UART DTE |
| 59 | // AM_RANGE(0xe0, 0xe7) 8250 UART LP |
| 60 | AM_RANGE(0xe8, 0xef) AM_DEVREADWRITE_LEGACY("ins8250", ins8250_r, ins8250_w) // 8250 UART console |
| 61 | // AM_RANGE(0xf0, 0xf1) front panel |
| 62 | AM_RANGE(0xf2, 0xf2) AM_WRITE(port_f2_w) AM_READ_PORT("SW501") |
| 63 | // AM_RANGE(0xf8, 0xf9) cassette |
| 64 | // AM_RANGE(0xfa, 0xff) serial I/O |
| 32 | 65 | ADDRESS_MAP_END |
| 33 | 66 | |
| 34 | 67 | /* Input ports */ |
| 35 | 68 | static INPUT_PORTS_START( h89 ) |
| 69 | PORT_START("SW501") |
| 70 | PORT_DIPNAME( 0x03, 0x00, "Expansion 1" ) PORT_DIPLOCATION("S1:1,S1:2") |
| 71 | PORT_DIPSETTING( 0x00, "H-88-1" ) |
| 72 | PORT_DIPSETTING( 0x01, "H/Z-47" ) |
| 73 | PORT_DIPSETTING( 0x02, "Z-67" ) |
| 74 | PORT_DIPSETTING( 0x03, "Undefined" ) |
| 75 | PORT_DIPNAME( 0x0c, 0x00, "Expansion 2" ) PORT_DIPLOCATION("S1:3,S1:4") |
| 76 | PORT_DIPSETTING( 0x00, "H-89-37" ) |
| 77 | PORT_DIPSETTING( 0x04, "H/Z-47" ) |
| 78 | PORT_DIPSETTING( 0x08, "Z-67" ) |
| 79 | PORT_DIPSETTING( 0x0c, "Undefined" ) |
| 80 | PORT_DIPNAME( 0x10, 0x00, "Boot from" ) PORT_DIPLOCATION("S1:5") |
| 81 | PORT_DIPSETTING( 0x00, "Expansion 1" ) |
| 82 | PORT_DIPSETTING( 0x10, "Expansion 2" ) |
| 83 | PORT_DIPNAME( 0x20, 0x20, "Perform memory test at start" ) PORT_DIPLOCATION("S1:6") |
| 84 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 85 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 86 | PORT_DIPNAME( 0x40, 0x00, "Console Baud rate" ) PORT_DIPLOCATION("S1:7") |
| 87 | PORT_DIPSETTING( 0x00, "9600" ) |
| 88 | PORT_DIPSETTING( 0x40, "19200" ) |
| 89 | PORT_DIPNAME( 0x80, 0x00, "Boot mode" ) PORT_DIPLOCATION("S1:8") |
| 90 | PORT_DIPSETTING( 0x00, DEF_STR( Normal ) ) |
| 91 | PORT_DIPSETTING( 0x80, "Auto" ) |
| 36 | 92 | INPUT_PORTS_END |
| 37 | 93 | |
| 38 | 94 | |
| r13603 | r13604 | |
| 40 | 96 | { |
| 41 | 97 | } |
| 42 | 98 | |
| 43 | | static VIDEO_START( h89 ) |
| 99 | static TIMER_DEVICE_CALLBACK( h89_irq_timer ) |
| 44 | 100 | { |
| 101 | h89_state *state = timer.machine().driver_data<h89_state>(); |
| 102 | |
| 103 | if (state->m_port_f2 & 0x02) |
| 104 | device_set_input_line_and_vector(state->m_maincpu, 0, HOLD_LINE, 0xcf); |
| 45 | 105 | } |
| 46 | 106 | |
| 47 | | static SCREEN_UPDATE( h89 ) |
| 107 | WRITE8_MEMBER( h89_state::port_f2_w ) |
| 48 | 108 | { |
| 49 | | return 0; |
| 109 | m_port_f2 = data; |
| 50 | 110 | } |
| 51 | 111 | |
| 112 | WRITE8_MEMBER( h89_state::h89_kbd_put ) |
| 113 | { |
| 114 | ins8250_receive(m_uart, data); |
| 115 | } |
| 116 | |
| 117 | static INS8250_TRANSMIT(h89_terminal_w) |
| 118 | { |
| 119 | terminal_write(device->machine().device(TERMINAL_TAG), 0, data); |
| 120 | } |
| 121 | |
| 122 | static GENERIC_TERMINAL_INTERFACE( terminal_intf ) |
| 123 | { |
| 124 | DEVCB_DRIVER_MEMBER(h89_state, h89_kbd_put) |
| 125 | }; |
| 126 | |
| 127 | static const ins8250_interface h89_ins8250_interface = |
| 128 | { |
| 129 | XTAL_12_288MHz / 4, // clock |
| 130 | DEVCB_NULL, // interrupt |
| 131 | h89_terminal_w, // transmit func |
| 132 | NULL, // handshake out |
| 133 | NULL // refresh func |
| 134 | }; |
| 135 | |
| 52 | 136 | static MACHINE_CONFIG_START( h89, h89_state ) |
| 53 | 137 | /* basic machine hardware */ |
| 54 | 138 | MCFG_CPU_ADD("maincpu",Z80, XTAL_12_288MHz / 6) |
| r13603 | r13604 | |
| 57 | 141 | |
| 58 | 142 | MCFG_MACHINE_RESET(h89) |
| 59 | 143 | |
| 144 | #if 0 |
| 60 | 145 | /* video hardware */ |
| 61 | 146 | MCFG_SCREEN_ADD("screen", RASTER) |
| 62 | 147 | MCFG_SCREEN_REFRESH_RATE(50) |
| r13603 | r13604 | |
| 68 | 153 | |
| 69 | 154 | MCFG_PALETTE_LENGTH(2) |
| 70 | 155 | MCFG_PALETTE_INIT(black_and_white) |
| 156 | #endif |
| 71 | 157 | |
| 72 | | MCFG_VIDEO_START(h89) |
| 158 | MCFG_INS8250_ADD( "ins8250", h89_ins8250_interface ) |
| 159 | |
| 160 | MCFG_GENERIC_TERMINAL_ADD(TERMINAL_TAG, terminal_intf) |
| 161 | MCFG_FRAGMENT_ADD( generic_terminal ) |
| 162 | |
| 163 | MCFG_TIMER_ADD_PERIODIC("irq_timer", h89_irq_timer, attotime::from_hz(100)) |
| 73 | 164 | MACHINE_CONFIG_END |
| 74 | 165 | |
| 75 | 166 | /* ROM definition */ |
| 76 | 167 | ROM_START( h89 ) |
| 77 | 168 | ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF ) |
| 78 | 169 | ROM_LOAD( "2732_444-142_mtr90.rom", 0x0000, 0x1000, CRC(c4ff47c5) SHA1(d6f3d71ff270a663003ec18a3ed1fa49f627123a)) |
| 170 | ROM_LOAD( "2716_444-19_h17.rom", 0x1800, 0x0800, CRC(26e80ae3) SHA1(0c0ee95d7cb1a760f924769e10c0db1678f2435c)) |
| 171 | |
| 79 | 172 | ROM_REGION( 0x10000, "otherroms", ROMREGION_ERASEFF ) |
| 80 | | ROM_LOAD( "2716_444-19_h17.rom", 0x0000, 0x0800, CRC(26e80ae3) SHA1(0c0ee95d7cb1a760f924769e10c0db1678f2435c)) |
| 81 | 173 | ROM_LOAD( "2732_444-84_mtr84.rom", 0x0000, 0x1000, CRC(c98e5f4c) SHA1(03347206dca145ff69ca08435db822b70ce106af)) |
| 82 | 174 | ROM_LOAD( "2732_mms84a_magnoliamms.bin", 0x0000, 0x1000, CRC(5563f42a) SHA1(1b74cafca8213d5c083f16d8a848933ab56eb43b)) |
| 83 | 175 | ROM_END |