src/mess/drivers/h19.c
| r9764 | r9765 | |
| 4 | 4 | |
| 5 | 5 | 12/05/2009 Skeleton driver. |
| 6 | 6 | |
| 7 | The keyboard consists of a 9x10 matrix connected to a MM5740N |
| 8 | mask-programmed keyboard controller. The output of this passes |
| 9 | through a rom. The MM5740N may be custom-made, in which case it |
| 10 | will need to be procured and tested. There is a "default" array; |
| 11 | perhaps this is used. The presence of the rom would seem to |
| 12 | indicate that the default is being used. We won't know, of |
| 13 | course, until the device is emulated. |
| 14 | |
| 15 | Keyboard input can also come from the serial port (a 8250). |
| 16 | Either device will signal an interrupt to the CPU when a key |
| 17 | is pressed/sent. |
| 18 | |
| 19 | MAME's implentation of the 8250 seems incomplete, for example |
| 20 | there is no facility to change the clock speed. |
| 21 | |
| 22 | For the moment, the "terminal" device is used for the keyboard, |
| 23 | and the interrupt is a periodic timer. |
| 24 | |
| 7 | 25 | ****************************************************************************/ |
| 8 | 26 | |
| 9 | 27 | #include "emu.h" |
| 10 | 28 | #include "cpu/z80/z80.h" |
| 11 | 29 | #include "video/mc6845.h" |
| 12 | 30 | #include "sound/beep.h" |
| 31 | #include "machine/ins8250.h" |
| 13 | 32 | |
| 33 | |
| 14 | 34 | #define H19_CLOCK (XTAL_12_288MHz / 6) |
| 15 | 35 | #define H19_BEEP_FRQ (H19_CLOCK / 1024) |
| 16 | | // next one needs to be measured |
| 17 | | #define H19_IRQ_PULSE (H19_BEEP_FRQ / 2) |
| 18 | 36 | |
| 19 | 37 | |
| 20 | 38 | class h19_state : public driver_device |
| r9764 | r9765 | |
| 63 | 81 | static ADDRESS_MAP_START( h19_io , ADDRESS_SPACE_IO, 8) |
| 64 | 82 | ADDRESS_MAP_UNMAP_HIGH |
| 65 | 83 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 66 | | AM_RANGE(0x60, 0x60) AM_MIRROR(0x1E) AM_DEVWRITE("crtc", mc6845_address_w) |
| 67 | | AM_RANGE(0x61, 0x61) AM_MIRROR(0x1E) AM_DEVREADWRITE("crtc", mc6845_register_r, mc6845_register_w) |
| 84 | AM_RANGE(0x00, 0x1F) AM_READ_PORT("S401") |
| 85 | AM_RANGE(0x20, 0x3F) AM_READ_PORT("S402") |
| 86 | AM_RANGE(0x40, 0x47) AM_MIRROR(0x18) AM_DEVREADWRITE("ins8250", ins8250_r, ins8250_w ) |
| 87 | AM_RANGE(0x60, 0x60) AM_DEVWRITE("crtc", mc6845_address_w) |
| 88 | AM_RANGE(0x61, 0x61) AM_DEVREADWRITE("crtc", mc6845_register_r, mc6845_register_w) |
| 68 | 89 | AM_RANGE(0xc0, 0xff) AM_WRITE(h19_c0_w) |
| 69 | | //AM_RANGE(0x00, 0x3F) powerup logic |
| 70 | | //AM_RANGE(0x40, 0x5F) serial control |
| 71 | | //AM_RANGE(0x80, 0x9F) keyboard data |
| 90 | //AM_RANGE(0x80, 0x9F) keyboard control |
| 72 | 91 | //AM_RANGE(0xA0, 0xBF) keyboard control |
| 73 | 92 | ADDRESS_MAP_END |
| 74 | 93 | |
| 75 | 94 | /* Input ports */ |
| 76 | 95 | static INPUT_PORTS_START( h19 ) |
| 96 | PORT_START("S401") |
| 97 | PORT_DIPNAME( 0x0f, 0x03, "Baud Rate") |
| 98 | PORT_DIPSETTING( 0x01, "110") |
| 99 | PORT_DIPSETTING( 0x02, "150") |
| 100 | PORT_DIPSETTING( 0x03, "300") |
| 101 | PORT_DIPSETTING( 0x04, "600") |
| 102 | PORT_DIPSETTING( 0x05, "1200") |
| 103 | PORT_DIPSETTING( 0x06, "1800") |
| 104 | PORT_DIPSETTING( 0x07, "2000") |
| 105 | PORT_DIPSETTING( 0x08, "2400") |
| 106 | PORT_DIPSETTING( 0x09, "3600") |
| 107 | PORT_DIPSETTING( 0x0a, "4800") |
| 108 | PORT_DIPSETTING( 0x0b, "7200") |
| 109 | PORT_DIPSETTING( 0x0c, "9600") |
| 110 | PORT_DIPSETTING( 0x0d, "19200") |
| 111 | PORT_DIPNAME( 0x30, 0x00, "Parity") |
| 112 | PORT_DIPSETTING( 0x00, DEF_STR(None)) |
| 113 | PORT_DIPSETTING( 0x10, "Odd") |
| 114 | PORT_DIPSETTING( 0x30, "Even") |
| 115 | PORT_DIPNAME( 0x40, 0x00, "Parity Type") |
| 116 | PORT_DIPSETTING( 0x00, DEF_STR(Normal)) |
| 117 | PORT_DIPSETTING( 0x40, "Stick") |
| 118 | PORT_DIPNAME( 0x80, 0x00, "Duplex") |
| 119 | PORT_DIPSETTING( 0x00, "Half") |
| 120 | PORT_DIPSETTING( 0x80, "Full") |
| 121 | |
| 122 | PORT_START("S402") |
| 123 | PORT_DIPNAME( 0x01, 0x00, "Cursor") |
| 124 | PORT_DIPSETTING( 0x00, "Underline") |
| 125 | PORT_DIPSETTING( 0x01, "Block") |
| 126 | PORT_DIPNAME( 0x02, 0x00, "Keyclick") |
| 127 | PORT_DIPSETTING( 0x02, DEF_STR(No)) |
| 128 | PORT_DIPSETTING( 0x00, DEF_STR(Yes)) |
| 129 | PORT_DIPNAME( 0x04, 0x00, "Wrap at EOL") |
| 130 | PORT_DIPSETTING( 0x00, DEF_STR(No)) |
| 131 | PORT_DIPSETTING( 0x04, DEF_STR(Yes)) |
| 132 | PORT_DIPNAME( 0x08, 0x00, "Auto LF on CR") |
| 133 | PORT_DIPSETTING( 0x00, DEF_STR(No)) |
| 134 | PORT_DIPSETTING( 0x08, DEF_STR(Yes)) |
| 135 | PORT_DIPNAME( 0x10, 0x00, "Auto CR on LF") |
| 136 | PORT_DIPSETTING( 0x00, DEF_STR(No)) |
| 137 | PORT_DIPSETTING( 0x10, DEF_STR(Yes)) |
| 138 | PORT_DIPNAME( 0x20, 0x00, "Mode") |
| 139 | PORT_DIPSETTING( 0x00, "VT52") |
| 140 | PORT_DIPSETTING( 0x20, "ANSI") |
| 141 | PORT_DIPNAME( 0x40, 0x00, "Keypad Shifted") |
| 142 | PORT_DIPSETTING( 0x00, DEF_STR(No)) |
| 143 | PORT_DIPSETTING( 0x40, DEF_STR(Yes)) |
| 144 | PORT_DIPNAME( 0x80, 0x00, "Refresh") |
| 145 | PORT_DIPSETTING( 0x00, "50Hz") |
| 146 | PORT_DIPSETTING( 0x80, "60Hz") |
| 77 | 147 | INPUT_PORTS_END |
| 78 | 148 | |
| 79 | 149 | |
| r9764 | r9765 | |
| 132 | 202 | } |
| 133 | 203 | } |
| 134 | 204 | |
| 205 | INS8250_INTERRUPT(h19_ace_irq) |
| 206 | { |
| 207 | cputag_set_input_line(device->machine, "maincpu", 0, (state ? HOLD_LINE : CLEAR_LINE)); |
| 208 | } |
| 209 | |
| 210 | static const ins8250_interface h19_ace_interface = |
| 211 | { |
| 212 | 4800, // clock (baud * 16) |
| 213 | h19_ace_irq, // interrupt |
| 214 | NULL, // transmit func |
| 215 | NULL, // handshake out |
| 216 | NULL // refresh func |
| 217 | }; |
| 218 | |
| 135 | 219 | static const mc6845_interface h19_crtc6845_interface = |
| 136 | 220 | { |
| 137 | 221 | "screen", |
| r9764 | r9765 | |
| 170 | 254 | MDRV_CPU_ADD("maincpu",Z80, H19_CLOCK) // From schematics |
| 171 | 255 | MDRV_CPU_PROGRAM_MAP(h19_mem) |
| 172 | 256 | MDRV_CPU_IO_MAP(h19_io) |
| 173 | | MDRV_DEVICE_PERIODIC_INT(irq0_line_hold, H19_IRQ_PULSE) |
| 257 | MDRV_DEVICE_PERIODIC_INT(irq0_line_hold, 50) // see notes above |
| 174 | 258 | |
| 175 | 259 | MDRV_MACHINE_RESET(h19) |
| 176 | 260 | |
| r9764 | r9765 | |
| 186 | 270 | MDRV_PALETTE_INIT(black_and_white) |
| 187 | 271 | |
| 188 | 272 | MDRV_MC6845_ADD("crtc", MC6845, XTAL_12_288MHz / 8, h19_crtc6845_interface) // clk taken from schematics |
| 273 | MDRV_INS8250_ADD( "ins8250", h19_ace_interface ) |
| 189 | 274 | |
| 190 | 275 | MDRV_VIDEO_START( h19 ) |
| 191 | 276 | MDRV_VIDEO_UPDATE( h19 ) |
| r9764 | r9765 | |
| 223 | 308 | /* Driver (year is either 1978 or 1979) */ |
| 224 | 309 | |
| 225 | 310 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ |
| 226 | | COMP( 1978, h19, 0, 0, h19, h19, 0, "Heath Inc", "Heathkit H-19", GAME_NOT_WORKING | GAME_NO_SOUND) |
| 311 | COMP( 1978, h19, 0, 0, h19, h19, 0, "Heath Inc", "Heathkit H-19", GAME_NOT_WORKING ) |