Previous 15994 Revisions Next

r15187 Wednesday 16th May, 2012 at 02:01:36 UTC by R. Belmont
M20: Hook up PIT timers 1 and 2 to clock the 8251s. Serial data written to the keyboard is weird - maybe wrong values for the PIT timers? [R. Belmont]
[src/mess/drivers]m20.c

src/mess/drivers/m20.c
r15186r15187
7070    DECLARE_READ16_MEMBER(m20_i8259_r);
7171    DECLARE_WRITE16_MEMBER(m20_i8259_w);
7272    DECLARE_WRITE_LINE_MEMBER(pic_irq_line_w);
73    DECLARE_WRITE_LINE_MEMBER(tty_clock_tick_w);
74    DECLARE_WRITE_LINE_MEMBER(kbd_clock_tick_w);
75   DECLARE_READ_LINE_MEMBER(kbd_rx);
76   DECLARE_WRITE_LINE_MEMBER(kbd_tx);
7377};
7478
7579
r15186r15187
110114   return 0;
111115}
112116
117// these two i8251 callbacks will ask for/send 1 bit at a time.
118READ_LINE_MEMBER(m20_state::kbd_rx)
119{
120//    printf("read keyboard\n");
121    return 0x00;
122}
123
124// this should send 0-0-0-0-0-0-1-1 after the BIOS writes 0x03 to the data port.
125// it comes back 0-1-1-0-0-0-0-0-0-1-1 instead, with 3 leading extraneous bits.  why?
126WRITE_LINE_MEMBER(m20_state::kbd_tx)
127{
128    printf("%d to keyboard\n", state);
129}
130
113131READ16_MEMBER(m20_state::m20_i8259_r)
114132{
115133    return pic8259_r(m_i8259, offset)<<1;
r15186r15187
132150    }
133151}
134152
153WRITE_LINE_MEMBER( m20_state::tty_clock_tick_w )
154{
155    m_ttyi8251->transmit_clock();
156    m_ttyi8251->receive_clock();
157}
158
159WRITE_LINE_MEMBER( m20_state::kbd_clock_tick_w )
160{
161    m_kbdi8251->transmit_clock();
162    m_kbdi8251->receive_clock();
163}
164
135165/* from the M20 hardware reference manual:
136166   M20 memory is configured according to the following scheme:
137167   Segment   Contents
r15186r15187
247277
248278static const i8251_interface kbd_i8251_intf =
249279{
250   DEVCB_NULL,         // rxd in
251   DEVCB_NULL,         // txd out
280   DEVCB_DRIVER_LINE_MEMBER(m20_state, kbd_rx),
281   DEVCB_DRIVER_LINE_MEMBER(m20_state, kbd_tx),
252282   DEVCB_NULL,         // dsr
253283   DEVCB_NULL,         // dtr
254284   DEVCB_NULL,         // rts
r15186r15187
307337      {
308338         1000000,
309339         DEVCB_NULL,
310         DEVCB_NULL
340            DEVCB_DRIVER_LINE_MEMBER(m20_state, tty_clock_tick_w)
311341      },
312342      {
313343         1000000,
314344         DEVCB_NULL,
315         DEVCB_NULL
345            DEVCB_DRIVER_LINE_MEMBER(m20_state, kbd_clock_tick_w)
316346      },
317347      {
318348         1000000,

Previous 15994 Revisions Next


© 1998-2018 The MESS Team