Previous 15994 Revisions Next

r14107 Friday 20th January, 2012 at 14:00:54 UTC by Curt Coder
Added Intersil IM6402 UART emulation. (nw)
[src/emu]emu.mak
[src/emu/machine]im6402.c* im6402.h*
[src/mess/drivers]kyocera.c wangpc.c
[src/mess/includes]kyocera.h wangpc.h

src/emu/emu.mak
r14106r14107
190190   $(EMUMACHINE)/i8255.o      \
191191   $(EMUMACHINE)/i8355.o      \
192192   $(EMUMACHINE)/idectrl.o      \
193   $(EMUMACHINE)/im6402.o      \
193194   $(EMUMACHINE)/ins8154.o      \
194195   $(EMUMACHINE)/ins8250.o      \
195196   $(EMUMACHINE)/intelfsh.o   \
src/emu/machine/im6402.c
r0r14107
1/***************************************************************************
2 
3    Intersil IM6402 Universal Asynchronous Receiver/Transmitter emulation
4 
5    Copyright the MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7 
8***************************************************************************/
9 
10#include "im6402.h"
11 
12 
13 
14//**************************************************************************
15//  DEVICE DEFINITIONS
16//**************************************************************************
17 
18const device_type IM6402 = &device_creator<im6402_device>;
19 
20 
21 
22//**************************************************************************
23//  MACROS / CONSTANTS
24//**************************************************************************
25 
26#define LOG 0
27 
28 
29 
30//**************************************************************************
31//  INLINE HELPERS
32//**************************************************************************
33 
34//-------------------------------------------------
35//  set_dr -
36//-------------------------------------------------
37 
38inline void im6402_device::set_dr(int state)
39{
40   m_dr = state;
41   
42   m_out_dr_func(state);
43}
44 
45 
46//-------------------------------------------------
47//  set_tbre -
48//-------------------------------------------------
49 
50inline void im6402_device::set_tbre(int state)
51{
52   m_tbre = state;
53   
54   m_out_tbre_func(state);
55}
56 
57 
58//-------------------------------------------------
59//  set_tre -
60//-------------------------------------------------
61 
62inline void im6402_device::set_tre(int state)
63{
64   m_tre = state;
65   
66   m_out_tre_func(state);
67}
68 
69 
70//-------------------------------------------------
71//  receive -
72//-------------------------------------------------
73 
74inline void im6402_device::receive()
75{
76   if (m_in_rri_func.isnull())
77   {
78      receive_register_update_bit(get_in_data_bit());
79   }
80   else
81   {
82      receive_register_update_bit(m_in_rri_func());
83   }
84 
85   if (is_receive_register_full())
86   {
87      receive_register_extract();
88      m_rbr = get_received_char();
89       
90      if (m_dr)
91      {
92         m_oe = 1;
93      }
94       
95      set_dr(ASSERT_LINE);
96   }
97}
98 
99 
100//-------------------------------------------------
101//  transmit -
102//-------------------------------------------------
103 
104inline void im6402_device::transmit()
105{
106   if (is_transmit_register_empty() && !m_tbre)
107   {
108      transmit_register_setup(m_tbr);
109       
110      set_tbre(ASSERT_LINE);
111      set_tre(CLEAR_LINE);
112   }
113   
114   if (!is_transmit_register_empty())
115   {
116      int bit = transmit_register_get_data_bit();
117             
118      m_out_tro_func(bit);
119      serial_connection_out();
120       
121      if (is_transmit_register_empty())
122      {
123         set_tre(ASSERT_LINE);
124      }
125   }
126}
127 
128 
129 
130//**************************************************************************
131//  LIVE DEVICE
132//**************************************************************************
133 
134//-------------------------------------------------
135//  im6402_device - constructor
136//-------------------------------------------------
137 
138im6402_device::im6402_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
139    : device_t(mconfig, IM6402, "Intersil IM6402", tag, owner, clock),
140     device_serial_interface(mconfig, *this)
141{
142}
143 
144 
145//-------------------------------------------------
146//  device_config_complete - perform any
147//  operations now that the configuration is
148//  complete
149//-------------------------------------------------
150 
151void im6402_device::device_config_complete()
152{
153   // inherit a copy of the static data
154   const im6402_interface *intf = reinterpret_cast<const im6402_interface *>(static_config());
155   if (intf != NULL)
156      *static_cast<im6402_interface *>(this) = *intf;
157 
158   // or initialize to defaults if none provided
159   else
160   {
161      memset(&m_in_rri_cb, 0, sizeof(m_in_rri_cb));
162      memset(&m_out_tro_cb, 0, sizeof(m_out_tro_cb));
163      memset(&m_out_dr_cb, 0, sizeof(m_out_dr_cb));
164      memset(&m_out_tbre_cb, 0, sizeof(m_out_tbre_cb));
165      memset(&m_out_tre_cb, 0, sizeof(m_out_tre_cb));
166   }
167}
168 
169 
170//-------------------------------------------------
171//  device_start - device-specific startup
172//-------------------------------------------------
173 
174void im6402_device::device_start()
175{
176   // resolve callbacks
177   m_in_rri_func.resolve(m_in_rri_cb, *this);
178   m_out_tro_func.resolve(m_out_tro_cb, *this);
179   m_out_dr_func.resolve(m_out_dr_cb, *this);
180   m_out_tbre_func.resolve(m_out_tbre_cb, *this);
181   m_out_tre_func.resolve(m_out_tre_cb, *this);
182 
183   // create the timers
184   if (m_rrc > 0)
185   {
186      m_rx_timer = timer_alloc(TIMER_RX);
187      m_rx_timer->adjust(attotime::zero, 0, attotime::from_hz(m_rrc));
188   }
189 
190   if (m_trc > 0)
191   {
192      m_tx_timer = timer_alloc(TIMER_TX);
193      m_tx_timer->adjust(attotime::zero, 0, attotime::from_hz(m_trc));
194   }
195 
196   // state saving
197   save_item(NAME(m_dr));
198   save_item(NAME(m_tbre));
199   save_item(NAME(m_tre));
200   save_item(NAME(m_pe));
201   save_item(NAME(m_fe));
202   save_item(NAME(m_oe));
203   save_item(NAME(m_cls1));
204   save_item(NAME(m_cls2));
205   save_item(NAME(m_sbs));
206   save_item(NAME(m_sfd));
207   save_item(NAME(m_epe));
208   save_item(NAME(m_pi));
209   save_item(NAME(m_rbr));
210   save_item(NAME(m_rrc_count));
211   save_item(NAME(m_tbr));
212   save_item(NAME(m_trc_count));
213}
214 
215 
216//-------------------------------------------------
217//  device_reset - device-specific reset
218//-------------------------------------------------
219 
220void im6402_device::device_reset()
221{
222   m_rrc_count = 0;
223   m_trc_count = 0;
224 
225   m_rbr = 0;
226   m_pe = 0;
227   m_fe = 0;
228   m_oe = 0;
229   
230   set_dr(CLEAR_LINE);
231   set_tbre(ASSERT_LINE);
232   set_tre(ASSERT_LINE);
233}
234 
235 
236//-------------------------------------------------
237//  device_timer - handler timer events
238//-------------------------------------------------
239 
240void im6402_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr)
241{
242   switch (id)
243   {
244   case TIMER_RX:
245      rrc_w(1);
246      break;
247 
248   case TIMER_TX:
249      trc_w(1);
250      break;
251   }
252}
253 
254 
255//-------------------------------------------------
256//  input_callback -
257//-------------------------------------------------
258 
259void im6402_device::input_callback(UINT8 state)
260{
261}
262 
263 
264//-------------------------------------------------
265//  read - receiver buffer register read
266//-------------------------------------------------
267 
268READ8_MEMBER( im6402_device::read )
269{
270   return m_rbr;
271}
272 
273 
274//-------------------------------------------------
275//  write - transmitter buffer register write
276//-------------------------------------------------
277 
278WRITE8_MEMBER( im6402_device::write )
279{
280   m_tbr = data;
281 
282   set_tbre(CLEAR_LINE);
283}
284 
285 
286//-------------------------------------------------
287//  rrc_w - receiver register clock
288//-------------------------------------------------
289 
290WRITE_LINE_MEMBER( im6402_device::rrc_w )
291{
292   if (state)
293   {
294      m_rrc_count++;
295       
296      if (m_rrc_count == 16)
297      {
298         receive();
299         m_rrc_count = 0;
300      }
301   }
302}
303 
304 
305//-------------------------------------------------
306//  trc_w - transmitter register clock
307//-------------------------------------------------
308 
309WRITE_LINE_MEMBER( im6402_device::trc_w )
310{
311   if (state)
312   {
313      m_trc_count++;
314       
315      if (m_trc_count == 16)
316      {
317         transmit();
318         m_trc_count = 0;
319      }
320   }       
321}
322 
323 
324//-------------------------------------------------
325//  dr_r - data received
326//-------------------------------------------------
327 
328READ_LINE_MEMBER( im6402_device::dr_r )
329{
330   return m_dr;
331}
332 
333 
334//-------------------------------------------------
335//  tbre_r - transmitter buffer register empty
336//-------------------------------------------------
337 
338READ_LINE_MEMBER( im6402_device::tbre_r )
339{
340   return m_tbre;
341}
342 
343 
344//-------------------------------------------------
345//  tre_r - transmitter register empty
346//-------------------------------------------------
347 
348READ_LINE_MEMBER( im6402_device::tre_r )
349{
350   return m_tre;
351}
352 
353 
354//-------------------------------------------------
355//  pe_r - parity error
356//-------------------------------------------------
357 
358READ_LINE_MEMBER( im6402_device::pe_r )
359{
360   return m_pe;
361}
362 
363 
364//-------------------------------------------------
365//  fe_r - framing error
366//-------------------------------------------------
367 
368READ_LINE_MEMBER( im6402_device::fe_r )
369{
370   return m_fe;
371}
372 
373 
374//-------------------------------------------------
375//  oe_r - overrun error
376//-------------------------------------------------
377 
378READ_LINE_MEMBER( im6402_device::oe_r )
379{
380   return m_oe;
381}
382 
383 
384//-------------------------------------------------
385//  rrd_w - receiver register disable
386//-------------------------------------------------
387 
388WRITE_LINE_MEMBER( im6402_device::rrd_w )
389{
390}
391 
392 
393//-------------------------------------------------
394//  sfd_w - status flags disable
395//-------------------------------------------------
396 
397WRITE_LINE_MEMBER( im6402_device::sfd_w )
398{
399}
400 
401 
402//-------------------------------------------------
403//  drr_w - data received reset
404//-------------------------------------------------
405 
406WRITE_LINE_MEMBER( im6402_device::drr_w )
407{
408   if (state)
409   {
410      set_dr(CLEAR_LINE);
411   }
412}
413 
414 
415//-------------------------------------------------
416//  mr_w - master reset
417//-------------------------------------------------
418 
419WRITE_LINE_MEMBER( im6402_device::mr_w )
420{
421   if (state)
422   {
423      device_reset();
424   }
425}
426 
427 
428//-------------------------------------------------
429//  crl_w - control register load
430//-------------------------------------------------
431 
432WRITE_LINE_MEMBER( im6402_device::crl_w )
433{
434   if (state)
435   {
436      int word_length = 5 + ((m_cls2 << 1) | m_cls1);
437      int stop_bits = 1 + m_sbs ? ((word_length == 5) ? 0.5 : 1) : 0;
438      int parity_code;
439       
440      if (m_pi) parity_code = SERIAL_PARITY_NONE; 
441      else if (m_epe) parity_code = SERIAL_PARITY_EVEN; 
442      else parity_code = SERIAL_PARITY_ODD;
443       
444      set_data_frame(word_length, stop_bits, parity_code);
445   }
446}
447 
448 
449//-------------------------------------------------
450//  pi_w - parity inhibit
451//-------------------------------------------------
452 
453WRITE_LINE_MEMBER( im6402_device::pi_w )
454{
455   m_pi = state;
456}
457 
458 
459//-------------------------------------------------
460//  sbs_w - stop bit select
461//-------------------------------------------------
462 
463WRITE_LINE_MEMBER( im6402_device::sbs_w )
464{
465   m_sbs = state;
466}
467 
468 
469//-------------------------------------------------
470//  cls1_w - character length select 1
471//-------------------------------------------------
472 
473WRITE_LINE_MEMBER( im6402_device::cls1_w )
474{
475   m_cls1 = state;
476}
477 
478 
479//-------------------------------------------------
480//  cls2_w - character length select 2
481//-------------------------------------------------
482 
483WRITE_LINE_MEMBER( im6402_device::cls2_w )
484{
485   m_cls2 = state;
486}
487 
488 
489//-------------------------------------------------
490//  epe_w - even parity enable
491//-------------------------------------------------
492 
493WRITE_LINE_MEMBER( im6402_device::epe_w )
494{
495   m_epe = state;
496}
src/emu/machine/im6402.h
r0r14107
1/***************************************************************************
2 
3    Intersil IM6402 Universal Asynchronous Receiver/Transmitter emulation
4 
5    Copyright the MESS Team.
6    Visit http://mamedev.org for licensing and usage restrictions.
7 
8****************************************************************************
9                            _____   _____
10                   Vcc   1 |*    \_/     | 40  NOTE
11                  NOTE   2 |             | 39  EPE
12                   GND   3 |             | 38  CLS1
13                   RRD   4 |             | 37  CLS2
14                  RBR8   5 |             | 36  SBS
15                  RBR7   6 |             | 35  PI
16                  RBR6   7 |             | 34  CRL
17                  RBR5   8 |             | 33  TBR8
18                  RBR4   9 |             | 32  TBR7
19                  RBR3  10 |    IM6402   | 31  TBR6
20                  RBR2  11 |    IM6403   | 30  TBR5
21                  RBR1  12 |             | 29  TBR4
22                    PE  13 |             | 28  TBR3
23                    FE  14 |             | 27  TBR2
24                    OE  15 |             | 26  TBR1
25                   SFD  16 |             | 25  TRO
26                  NOTE  17 |             | 24  TRE
27                   DRR  18 |             | 23  TRBL
28                    DR  19 |             | 22  TBRE
29                   RRI  20 |_____________| 21  MR
30 
31 
32            NOTE:   PIN      IM6402      IM6403
33                  ---------------------------
34                  2      N/C         CONTROL
35                  17      RRC         OSC IN
36                  40      TRC         OSC OUT
37               
38***************************************************************************/
39 
40#pragma once
41 
42#ifndef __IM6402__
43#define __IM6402__
44 
45#include "emu.h"
46 
47 
48 
49/***************************************************************************
50    DEVICE CONFIGURATION MACROS
51***************************************************************************/
52 
53#define MCFG_IM6402_ADD(_tag, _config) \
54   MCFG_DEVICE_ADD(_tag, IM6402, 0) \
55   MCFG_DEVICE_CONFIG(_config)
56 
57 
58#define IM6402_INTERFACE(_name) \
59   const im6402_interface (_name) =
60 
61 
62 
63/***************************************************************************
64    TYPE DEFINITIONS
65***************************************************************************/
66 
67// ======================> im6402_interface
68 
69struct im6402_interface
70{
71   int m_rrc;
72   int m_trc;
73   
74   devcb_read_line      m_in_rri_cb;
75   devcb_write_line   m_out_tro_cb;
76   devcb_write_line   m_out_dr_cb;
77   devcb_write_line   m_out_tbre_cb;
78   devcb_write_line   m_out_tre_cb;
79};
80 
81 
82// ======================> im6402_device
83 
84class im6402_device :  public device_t, 
85                  public device_serial_interface,
86                  public im6402_interface
87{
88public:
89   // construction/destruction
90   im6402_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
91 
92   DECLARE_READ8_MEMBER( read );
93   DECLARE_WRITE8_MEMBER( write );
94   
95   DECLARE_READ_LINE_MEMBER( dr_r );
96   DECLARE_READ_LINE_MEMBER( tbre_r );
97   DECLARE_READ_LINE_MEMBER( tre_r );
98   DECLARE_READ_LINE_MEMBER( pe_r );
99   DECLARE_READ_LINE_MEMBER( fe_r );
100   DECLARE_READ_LINE_MEMBER( oe_r );
101 
102   DECLARE_WRITE_LINE_MEMBER( rrc_w );
103   DECLARE_WRITE_LINE_MEMBER( trc_w );
104   DECLARE_WRITE_LINE_MEMBER( rrd_w );
105   DECLARE_WRITE_LINE_MEMBER( sfd_w );
106   DECLARE_WRITE_LINE_MEMBER( drr_w );
107   DECLARE_WRITE_LINE_MEMBER( mr_w );
108   DECLARE_WRITE_LINE_MEMBER( crl_w );
109   DECLARE_WRITE_LINE_MEMBER( pi_w );
110   DECLARE_WRITE_LINE_MEMBER( sbs_w );
111   DECLARE_WRITE_LINE_MEMBER( cls1_w );
112   DECLARE_WRITE_LINE_MEMBER( cls2_w );
113   DECLARE_WRITE_LINE_MEMBER( epe_w );
114 
115protected:
116   // device-level overrides
117   virtual void device_config_complete();
118   virtual void device_start();
119   virtual void device_reset();
120   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
121   
122   // device_serial_interface overrides
123   virtual void input_callback(UINT8 state);
124 
125private:
126   inline void set_dr(int state);
127   inline void set_tbre(int state);
128   inline void set_tre(int state);
129   inline void receive();
130   inline void transmit();
131   
132   static const device_timer_id TIMER_RX = 0;
133   static const device_timer_id TIMER_TX = 1;
134 
135   devcb_resolved_read_line   m_in_rri_func;
136   devcb_resolved_write_line   m_out_tro_func;
137   devcb_resolved_write_line   m_out_dr_func;
138   devcb_resolved_write_line   m_out_tbre_func;
139   devcb_resolved_write_line   m_out_tre_func;
140 
141   // status
142   int m_dr;
143   int m_tbre;
144   int m_tre;
145   int m_pe;
146   int m_fe;
147   int m_oe;
148   
149   // control
150   int m_cls1;
151   int m_cls2;
152   int m_sbs;
153   int m_sfd;
154   int m_epe;
155   int m_pi;
156   
157   // receiver
158   UINT8 m_rbr;
159   int   m_rrc_count;
160   
161   // transmitter
162   UINT8 m_tbr;
163   int   m_trc_count;
164   
165   // timers
166   emu_timer *m_rx_timer;
167   emu_timer *m_tx_timer;
168};
169 
170 
171// device type definition
172extern const device_type IM6402;
173 
174 
175 
176#endif
src/mess/includes/wangpc.h
r14106r14107
99#include "cpu/i86/i86.h"
1010#include "machine/8237dma.h"
1111#include "machine/i8255.h"
12#include "machine/im6402.h"
1213#include "machine/pic8259.h"
1314#include "machine/pit8253.h"
1415#include "machine/ram.h"
r14106r14107
3738        m_pic(*this, I8259A_TAG),
3839        m_ppi(*this, I8255A_TAG),
3940        m_pit(*this, I8253_TAG),
41        m_uart(*this, IM6402_TAG),
4042        m_fdc(*this, UPD765_TAG),
4143        m_ram(*this, RAM_TAG),
4244        m_floppy0(*this, FLOPPY_0),
r14106r14107
5153   required_device<device_t> m_pic;
5254   required_device<i8255_device> m_ppi;
5355   required_device<device_t> m_pit;
56   required_device<im6402_device> m_uart;
5457   required_device<device_t> m_fdc;
5558   required_device<ram_device> m_ram;
5659   required_device<device_t> m_floppy0;
src/mess/includes/kyocera.h
r14106r14107
1212#include "machine/ctronics.h"
1313#include "machine/i8155.h"
1414#include "machine/i8251.h"
15#include "machine/im6402.h"
1516#include "machine/ram.h"
1617#include "machine/rp5c01.h"
1718#include "machine/upd1990a.h"
r14106r14107
5354      : driver_device(mconfig, type, tag),
5455        m_maincpu(*this, I8085_TAG),
5556        m_rtc(*this, UPD1990A_TAG),
57        m_uart(*this, IM6402_TAG),
5658        m_lcdc0(*this, HD44102_0_TAG),
5759        m_lcdc1(*this, HD44102_1_TAG),
5860        m_lcdc2(*this, HD44102_2_TAG),
r14106r14107
7173
7274   required_device<cpu_device> m_maincpu;
7375   required_device<upd1990a_device> m_rtc;
76   optional_device<im6402_device> m_uart;
7477   required_device<hd44102_device> m_lcdc0;
7578   required_device<hd44102_device> m_lcdc1;
7679   required_device<hd44102_device> m_lcdc2;
src/mess/drivers/wangpc.c
r14106r14107
493493 
494494 
495495//-------------------------------------------------
496//  IM6402_INTERFACE( uart_intf )
497//-------------------------------------------------
498 
499static IM6402_INTERFACE( uart_intf )
500{
501   0,
502   0,
503   DEVCB_NULL,
504   DEVCB_NULL,
505   DEVCB_NULL,
506   DEVCB_NULL,
507   DEVCB_NULL
508};
509 
510 
511//-------------------------------------------------
496512//  upd765_interface fdc_intf
497513//-------------------------------------------------
498514 
r14106r14107
603619   MCFG_PIC8259_ADD(I8259A_TAG, pic_intf)
604620   MCFG_I8255A_ADD(I8255A_TAG, ppi_intf)
605621   MCFG_PIT8253_ADD(I8253_TAG, pit_intf)
606   // IM6402 for keyboard
622   MCFG_IM6402_ADD(IM6402_TAG, uart_intf)
607623   // SCN2661 for RS-232
608624   MCFG_UPD765A_ADD(UPD765_TAG, fdc_intf)
609625   MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(floppy_intf)
src/mess/drivers/kyocera.c
r14106r14107
227227        7
228228
229229    */
230/*
230
231231    m_uart->sbs_w(BIT(data, 0));
232232    m_uart->epe_w(BIT(data, 1));
233233    m_uart->pi_w(BIT(data, 2));
234234    m_uart->cls1_w(BIT(data, 3));
235235    m_uart->cls2_w(BIT(data, 4));
236*/
236   
237   m_uart->crl_w(1);
237238}
238239
239240READ8_MEMBER( kc85_state::uart_status_r )
r14106r14107
255256
256257   UINT8 data = 0x40;
257258
258   // carrier detect
259   //data |= m_uart->cd_r();
259   // TODO carrier detect
260260
261261   // overrun error
262   //data |= m_uart->oe_r() << 1;
262   data |= m_uart->oe_r() << 1;
263263
264264   // framing error
265   //data |= m_uart->fe_r() << 2;
265   data |= m_uart->fe_r() << 2;
266266
267267   // parity error
268   //data |= m_uart->pe_r() << 3;
268   data |= m_uart->pe_r() << 3;
269269
270270   // transmit buffer register empty
271   //data |= m_uart->tbre_r() << 4;
271   data |= m_uart->tbre_r() << 4;
272272
273273   // rp TODO
274274   data |= 0x20;
r14106r14107
298298
299299   UINT8 data = 0x40;
300300
301   // data carrier detect / ring detect
302   //data |= m_uart->cd_r();
301   // TODO data carrier detect / ring detect
303302
304303   // overrun error
305   //data |= m_uart->oe_r() << 1;
304   data |= m_uart->oe_r() << 1;
306305
307306   // framing error
308   //data |= m_uart->fe_r() << 2;
307   data |= m_uart->fe_r() << 2;
309308
310309   // parity error
311   //data |= m_uart->pe_r() << 3;
310   data |= m_uart->pe_r() << 3;
312311
313312   // transmit buffer register empty
314   //data |= m_uart->tbre_r() << 4;
313   data |= m_uart->tbre_r() << 4;
315314
316315   // rp TODO
317316   data |= 0x20;
r14106r14107
585584//  AM_RANGE(0x90, 0x90) AM_MIRROR(0x0f) optional answering telephone unit
586585//  AM_RANGE(0xa0, 0xa0) AM_MIRROR(0x0f) optional modem
587586   AM_RANGE(0xb0, 0xb7) AM_MIRROR(0x08) AM_DEVREADWRITE(I8155_TAG, i8155_device, io_r, io_w)
588//  AM_RANGE(0xc0, 0xc0) AM_MIRROR(0x0f) AM_DEVREADWRITE(IM6402_TAG, data_r, data_w)
587   AM_RANGE(0xc0, 0xc0) AM_MIRROR(0x0f) AM_DEVREADWRITE(IM6402_TAG, im6402_device, read, write)
589588   AM_RANGE(0xd0, 0xd0) AM_MIRROR(0x0f) AM_READWRITE(uart_status_r, uart_ctrl_w)
590589   AM_RANGE(0xe0, 0xe0) AM_MIRROR(0x0f) AM_READWRITE(keyboard_r, ctrl_w)
591590   AM_RANGE(0xf0, 0xf1) AM_MIRROR(0x0e) AM_READWRITE(lcd_r, lcd_w)
r14106r14107
606605   AM_RANGE(0x90, 0x90) AM_MIRROR(0x0f) AM_WRITE(scp_w)
607606   AM_RANGE(0xa0, 0xa0) AM_MIRROR(0x0f) AM_READWRITE(bank_r, bank_w)
608607   AM_RANGE(0xb0, 0xb7) AM_MIRROR(0x08) AM_DEVREADWRITE(I8155_TAG, i8155_device, io_r, io_w)
609//  AM_RANGE(0xc0, 0xc0) AM_MIRROR(0x0f) AM_DEVREADWRITE(IM6402_TAG, data_r, data_w)
608   AM_RANGE(0xc0, 0xc0) AM_MIRROR(0x0f) AM_DEVREADWRITE(IM6402_TAG, im6402_device, read, write)
610609   AM_RANGE(0xd0, 0xd0) AM_MIRROR(0x0f) AM_READ(uart_status_r) AM_WRITE_BASE(kc85_state, uart_ctrl_w)
611610   AM_RANGE(0xe0, 0xe0) AM_MIRROR(0x0f) AM_READ_BASE(kc85_state, keyboard_r)
612611   AM_RANGE(0xf0, 0xf1) AM_MIRROR(0x0e) AM_READWRITE_BASE(kc85_state, lcd_r, lcd_w)
r14106r14107
989988   {
990989      speaker_level_w(m_speaker, state);
991990   }
991   
992   m_uart->trc_w(state);
993   m_uart->rrc_w(state);
992994}
993995
994996static I8155_INTERFACE( kc85_8155_intf )
r14106r14107
10931095   DEVCB_DRIVER_LINE_MEMBER(tandy200_state, i8155_to_w)   /* timer output */
10941096};
10951097
1098/* IM6402 Interface */
1099
1100static IM6402_INTERFACE( uart_intf )
1101{
1102   0,
1103   0,
1104   DEVCB_NULL,
1105   DEVCB_NULL,
1106   DEVCB_NULL,
1107   DEVCB_NULL,
1108   DEVCB_NULL
1109};
1110
10961111/* I8251 Interface */
10971112
10981113static const i8251_interface tandy200_uart_intf =
r14106r14107
12991314   /* devices */
13001315   MCFG_I8155_ADD(I8155_TAG, XTAL_4_9152MHz/2, kc85_8155_intf)
13011316   MCFG_UPD1990A_ADD(UPD1990A_TAG, XTAL_32_768kHz, kc85_upd1990a_intf)
1317   MCFG_IM6402_ADD(IM6402_TAG, uart_intf)
13021318   MCFG_CENTRONICS_ADD(CENTRONICS_TAG, standard_centronics)
13031319   MCFG_CASSETTE_ADD(CASSETTE_TAG, kc85_cassette_interface)
13041320
r14106r14107
13351351   /* devices */
13361352   MCFG_I8155_ADD(I8155_TAG, XTAL_4_9152MHz/2, kc85_8155_intf)
13371353   MCFG_UPD1990A_ADD(UPD1990A_TAG, XTAL_32_768kHz, kc85_upd1990a_intf)
1354   MCFG_IM6402_ADD(IM6402_TAG, uart_intf)
13381355   MCFG_CENTRONICS_ADD(CENTRONICS_TAG, standard_centronics)
13391356   MCFG_CASSETTE_ADD(CASSETTE_TAG, kc85_cassette_interface)
13401357
r14106r14107
13771394   /* devices */
13781395   MCFG_I8155_ADD(I8155_TAG, XTAL_4_9152MHz/2, kc85_8155_intf)
13791396   MCFG_UPD1990A_ADD(UPD1990A_TAG, XTAL_32_768kHz, kc85_upd1990a_intf)
1397   MCFG_IM6402_ADD(IM6402_TAG, uart_intf)
13801398   MCFG_CENTRONICS_ADD(CENTRONICS_TAG, standard_centronics)
13811399   MCFG_CASSETTE_ADD(CASSETTE_TAG, kc85_cassette_interface)
13821400//  MCFG_MC14412_ADD(MC14412_TAG, XTAL_1MHz)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team