Previous 15994 Revisions Next

r9766 Monday 13th December, 2010 at 10:58:30 UTC by Robbbert
[H19] Connected to terminal keyboard, added notes.
[src/mess/drivers]h19.c

src/mess/drivers/h19.c
r9765r9766
1616        Either device will signal an interrupt to the CPU when a key
1717        is pressed/sent.
1818
19        MAME's implentation of the 8250 seems incomplete, for example
20        there is no facility to change the clock speed.
19        For the moment, the "terminal" device is used for the keyboard.
2120
22        For the moment, the "terminal" device is used for the keyboard,
23        and the interrupt is a periodic timer.
24
2521****************************************************************************/
2622
2723#include "emu.h"
r9765r9766
2925#include "video/mc6845.h"
3026#include "sound/beep.h"
3127#include "machine/ins8250.h"
28#include "machine/terminal.h"
3229
3330
3431#define H19_CLOCK (XTAL_12_288MHz / 6)
r9765r9766
4441   UINT8 *videoram;
4542   UINT8 *charrom;
4643   running_device *beeper;
44   UINT8 term_data;
4745};
4846
4947
r9765r9766
5351   beep_set_state(state->beeper, 0);
5452}
5553
54static READ8_HANDLER( h19_80_r )
55{
56// keyboard data
57   h19_state *state = space->machine->driver_data<h19_state>();
58   UINT8 ret = state->term_data;
59   state->term_data = 0;
60   return ret;
61}
62
63static READ8_HANDLER( h19_a0_r )
64{
65// keyboard status
66   cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
67   return 0x7f; // says that a key is ready and no modifier keys are pressed
68}
69
5670static WRITE8_HANDLER( h19_c0_w )
5771{
5872   h19_state *state = space->machine->driver_data<h19_state>();
59/* Beeper control - lengths need verifying
73/* Beeper control - a 96L02 contains 2 oneshots, one for bell and one for keyclick.
74- lengths need verifying
6075    offset 00-1F = keyclick
6176    offset 20-3F = terminal bell */
6277
63   UINT16 length = 0;
64
65   if (offset & 0x20)
66      length = 200;
67   else
68      length = 4;
69
78   UINT8 length = (offset & 0x20) ? 200 : 4;
79   beep_set_state(state->beeper, 1);
7080   timer_set(space->machine, ATTOTIME_IN_MSEC(length), NULL, 0, h19_beepoff);
71   beep_set_state(state->beeper, 1);
7281}
7382
7483static ADDRESS_MAP_START(h19_mem, ADDRESS_SPACE_PROGRAM, 8)
r9765r9766
8695   AM_RANGE(0x40, 0x47) AM_MIRROR(0x18) AM_DEVREADWRITE("ins8250", ins8250_r, ins8250_w )
8796   AM_RANGE(0x60, 0x60) AM_DEVWRITE("crtc", mc6845_address_w)
8897   AM_RANGE(0x61, 0x61) AM_DEVREADWRITE("crtc", mc6845_register_r, mc6845_register_w)
89   AM_RANGE(0xc0, 0xff) AM_WRITE(h19_c0_w)
90   //AM_RANGE(0x80, 0x9F) keyboard control
91   //AM_RANGE(0xA0, 0xBF) keyboard control
98   AM_RANGE(0x80, 0x9F) AM_READ(h19_80_r)
99   AM_RANGE(0xA0, 0xBF) AM_READ(h19_a0_r)
100   AM_RANGE(0xC0, 0xFF) AM_WRITE(h19_c0_w)
92101ADDRESS_MAP_END
93102
94103/* Input ports */
r9765r9766
119128   PORT_DIPSETTING(    0x00, "Half")
120129   PORT_DIPSETTING(    0x80, "Full")
121130
122   PORT_START("S402")
131   PORT_START("S402") // stored at 40C8
123132   PORT_DIPNAME( 0x01, 0x00, "Cursor")
124133   PORT_DIPSETTING(    0x00, "Underline")
125134   PORT_DIPSETTING(    0x01, "Block")
126135   PORT_DIPNAME( 0x02, 0x00, "Keyclick")
127136   PORT_DIPSETTING(    0x02, DEF_STR(No))
128137   PORT_DIPSETTING(    0x00, DEF_STR(Yes))
129   PORT_DIPNAME( 0x04, 0x00, "Wrap at EOL")
138   PORT_DIPNAME( 0x04, 0x04, "Wrap at EOL")
130139   PORT_DIPSETTING(    0x00, DEF_STR(No))
131140   PORT_DIPSETTING(    0x04, DEF_STR(Yes))
132   PORT_DIPNAME( 0x08, 0x00, "Auto LF on CR")
141   PORT_DIPNAME( 0x08, 0x08, "Auto LF on CR")
133142   PORT_DIPSETTING(    0x00, DEF_STR(No))
134143   PORT_DIPSETTING(    0x08, DEF_STR(Yes))
135144   PORT_DIPNAME( 0x10, 0x00, "Auto CR on LF")
r9765r9766
144153   PORT_DIPNAME( 0x80, 0x00, "Refresh")
145154   PORT_DIPSETTING(    0x00, "50Hz")
146155   PORT_DIPSETTING(    0x80, "60Hz")
156
157   PORT_INCLUDE(generic_terminal)
147158INPUT_PORTS_END
148159
149160
r9765r9766
209220
210221static const ins8250_interface h19_ace_interface =
211222{
212   4800, // clock (baud * 16)
223   XTAL_12_288MHz / 4, // 3.072mhz clock which gets divided down for the various baud rates
213224   h19_ace_irq, // interrupt
214225   NULL, // transmit func
215226   NULL, // handshake out
r9765r9766
248259   GFXDECODE_ENTRY( "chargen", 0x0000, h19_charlayout, 0, 1 )
249260GFXDECODE_END
250261
262static WRITE8_DEVICE_HANDLER( h19_kbd_put )
263{
264   h19_state *state = device->machine->driver_data<h19_state>();
265   state->term_data = data;
266   cputag_set_input_line(device->machine, "maincpu", 0, HOLD_LINE);
267}
251268
269static GENERIC_TERMINAL_INTERFACE( h19_terminal_intf )
270{
271   DEVCB_HANDLER(h19_kbd_put)
272};
273
252274static MACHINE_CONFIG_START( h19, h19_state )
253275   /* basic machine hardware */
254276   MDRV_CPU_ADD("maincpu",Z80, H19_CLOCK) // From schematics
255277   MDRV_CPU_PROGRAM_MAP(h19_mem)
256278   MDRV_CPU_IO_MAP(h19_io)
257   MDRV_DEVICE_PERIODIC_INT(irq0_line_hold, 50) // see notes above
279   //MDRV_DEVICE_PERIODIC_INT(irq0_line_hold, 50) // for testing, causes a keyboard scan
258280
259281   MDRV_MACHINE_RESET(h19)
260282
r9765r9766
271293
272294   MDRV_MC6845_ADD("crtc", MC6845, XTAL_12_288MHz / 8, h19_crtc6845_interface) // clk taken from schematics
273295   MDRV_INS8250_ADD( "ins8250", h19_ace_interface )
296   MDRV_GENERIC_TERMINAL_ADD("terminal", h19_terminal_intf) // keyboard only
274297
275298   MDRV_VIDEO_START( h19 )
276299   MDRV_VIDEO_UPDATE( h19 )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team