Previous 15994 Revisions Next

r3354 Tuesday 30th September, 2008 at 21:37:14 UTC by Wilbert Pol
oops, forgot to update the actual z80dart files.
[src/mess/machine]z80dart.c z80dart.h

src/mess/machine/z80dart.c
r3353r3354
158158   dart_channel   chan[2];         /* 2 channels */
159159   UINT8      int_state[8];      /* interrupt states */
160160
161   void (*irq_cb)(int state);
162   write8_machine_func dtr_changed_cb;
163   write8_machine_func rts_changed_cb;
164   write8_machine_func break_changed_cb;
165   write8_machine_func transmit_cb;
166   int (*receive_poll_cb)(int which);
161   void (*irq_cb)(const device_config *device, int state);
162   write8_device_func dtr_changed_cb;
163   write8_device_func rts_changed_cb;
164   write8_device_func break_changed_cb;
165   write8_device_func transmit_cb;
166   int (*receive_poll_cb)(const device_config *device, int ch);
167167};
168168
169169
r3353r3354
173173***************************************************************************/
174174
175175static TIMER_CALLBACK(serial_callback);
176static int z80dart_irq_state(const device_config *device);
176177
177178
178179
179/***************************************************************************
180    GLOBAL VARIABLES
181***************************************************************************/
182
183static z80dart darts[MAX_DART];
184
185
186180/*
187181
188182    Interrupt priorities:
r3353r3354
239233    INLINE FUNCTIONS
240234***************************************************************************/
241235
242INLINE void interrupt_check(z80dart *dart)
236INLINE z80dart *get_safe_token(const device_config *device)
243237{
238   assert(device != NULL);
239   assert(device->token != NULL);
240   assert(device->type == Z80DART);
241   return (z80dart *)device->token;
242}
243
244
245INLINE void interrupt_check(const device_config *device)
246{
247   z80dart *dart = get_safe_token( device );
248
244249   /* if we have a callback, update it with the current state */
245250   if (dart->irq_cb != NULL)
246      (*dart->irq_cb)((z80dart_irq_state(dart - darts) & Z80_DAISY_INT) ? ASSERT_LINE : CLEAR_LINE);
251      dart->irq_cb(device, (z80dart_irq_state(device) & Z80_DAISY_INT) ? ASSERT_LINE : CLEAR_LINE);
247252}
248253
249254
250INLINE attotime compute_time_per_character(z80dart *dart, int which)
255INLINE attotime compute_time_per_character(const device_config *device, int ch)
251256{
252257   /* fix me -- should compute properly and include data, stop, parity bits */
253258   return ATTOTIME_IN_HZ(9600 / 10);
254259}
255260
256261
257
258/***************************************************************************
259    INITIALIZATION/CONFIGURATION
260***************************************************************************/
261
262/*-------------------------------------------------
263    z80dart_init - initialize a single DART chip
264-------------------------------------------------*/
265
266void z80dart_init(int which, const z80dart_interface *intf)
262INLINE void reset_channel(const device_config *device, int ch)
267263{
268   z80dart *dart = darts + which;
269
270   assert(which < MAX_DART);
271
272   memset(dart, 0, sizeof(*dart));
273
274   dart->chan[0].receive_timer = timer_alloc(serial_callback, NULL);
275   dart->chan[1].receive_timer = timer_alloc(serial_callback, NULL);
276
277   dart->irq_cb = intf->irq_cb;
278   dart->dtr_changed_cb = intf->dtr_changed_cb;
279   dart->rts_changed_cb = intf->rts_changed_cb;
280   dart->break_changed_cb = intf->break_changed_cb;
281   dart->transmit_cb = intf->transmit_cb;
282   dart->receive_poll_cb = intf->receive_poll_cb;
283
284   z80dart_reset(which);
285}
286
287
288/*-------------------------------------------------
289    reset_channel - reset a single DART channel
290-------------------------------------------------*/
291
292static void reset_channel(z80dart *dart, int ch)
293{
294   attotime tpc = compute_time_per_character(dart, ch);
264   z80dart *dart = get_safe_token( device );
265   attotime tpc = compute_time_per_character(device, ch);
295266   dart_channel *chan = &dart->chan[ch];
296267
297268   chan->status[0] = DART_RR0_TX_BUFFER_EMPTY;
r3353r3354
305276   dart->int_state[2 + 4*ch] = 0;
306277   dart->int_state[3 + 4*ch] = 0;
307278
308   interrupt_check(dart);
309
310279   /* start the receive timer running */
311   timer_adjust_periodic(chan->receive_timer, tpc, ((dart - darts) << 1) | ch, tpc);
280   timer_adjust_periodic(chan->receive_timer, tpc, ch, tpc);
312281}
313282
314283
315/*-------------------------------------------------
316    z80dart_reset - reset a single DART chip
317-------------------------------------------------*/
318284
319void z80dart_reset(int which)
320{
321   z80dart *dart = darts + which;
322   int ch;
323
324   assert(which < MAX_DART);
325
326   /* loop over channels */
327   for (ch = 0; ch < 2; ch++)
328      reset_channel(dart, ch);
329}
330
331
332
333285/***************************************************************************
334286    CONTROL REGISTER READ/WRITE
335287***************************************************************************/
r3353r3354
338290    z80dart_c_w - write to a control register
339291-------------------------------------------------*/
340292
341void z80dart_c_w(running_machine *machine, int which, int ch, UINT8 data)
293WRITE8_DEVICE_HANDLER( z80dart_c_w )
342294{
343   z80dart *dart = darts + which;
344   dart_channel *chan = &dart->chan[ch];
295   z80dart *dart = get_safe_token( device );
296   dart_channel *chan = &dart->chan[offset];
345297   int reg = chan->regs[0] & 7;
346298   UINT8 old = chan->regs[reg];
347299
348300   if (reg != 0 || (reg & 0xf8))
349      VPRINTF(("%04X:dart_reg_w(%c,%d) = %02X\n", activecpu_get_pc(), 'A' + ch, reg, data));
301      VPRINTF(("%04X:dart_reg_w(%c,%d) = %02X\n", activecpu_get_pc(), 'A' + offset, reg, data));
350302
351303   /* write a new value to the selected register */
352304   chan->regs[reg] = data;
r3353r3354
363315         switch (data & DART_WR0_COMMAND_MASK)
364316         {
365317            case DART_WR0_COMMAND_CH_RESET:
366               VPRINTF(("%04X:DART reset channel %c\n", activecpu_get_pc(), 'A' + ch));
367               reset_channel(dart, ch);
318               VPRINTF(("%04X:DART reset channel %c\n", activecpu_get_pc(), 'A' + offset));
319               reset_channel(device, offset);
320               interrupt_check(device);
368321               break;
369322
370323            case DART_WR0_COMMAND_RES_STATUS_INT:
371               dart->int_state[INT_CHA_STATUS - 4*ch] &= ~Z80_DAISY_INT;
372               interrupt_check(dart);
324               dart->int_state[INT_CHA_STATUS - 4*offset] &= ~Z80_DAISY_INT;
325               interrupt_check(device);
373326               break;
374327
375328            case DART_WR0_COMMAND_ENA_RX_INT:
376329               chan->int_on_next_rx = TRUE;
377               interrupt_check(dart);
330               interrupt_check(device);
378331               break;
379332
380333            case DART_WR0_COMMAND_RES_TX_INT:
381               dart->int_state[INT_CHA_TRANSMIT - 4*ch] &= ~Z80_DAISY_INT;
382               interrupt_check(dart);
334               dart->int_state[INT_CHA_TRANSMIT - 4*offset] &= ~Z80_DAISY_INT;
335               interrupt_check(device);
383336               break;
384337
385338            case DART_WR0_COMMAND_RES_ERROR:
386               dart->int_state[INT_CHA_ERROR - 4*ch] &= ~Z80_DAISY_INT;
387               interrupt_check(dart);
339               dart->int_state[INT_CHA_ERROR - 4*offset] &= ~Z80_DAISY_INT;
340               interrupt_check(device);
388341               break;
389342         }
390343         break;
391344
392345      /* DART write register 1 */
393346      case 1:
394         interrupt_check(dart);
347         interrupt_check(device);
395348         break;
396349
397350      /* DART write register 5 */
398351      case 5:
399352         if (((old ^ data) & DART_WR5_DTR) && dart->dtr_changed_cb)
400            (*dart->dtr_changed_cb)(machine, ch, (data & DART_WR5_DTR) != 0);
353            (*dart->dtr_changed_cb)(device, offset, (data & DART_WR5_DTR) != 0);
401354         if (((old ^ data) & DART_WR5_SEND_BREAK) && dart->break_changed_cb)
402            (*dart->break_changed_cb)(machine, ch, (data & DART_WR5_SEND_BREAK) != 0);
355            (*dart->break_changed_cb)(device, offset, (data & DART_WR5_SEND_BREAK) != 0);
403356         if (((old ^ data) & DART_WR5_RTS) && dart->rts_changed_cb)
404            (*dart->rts_changed_cb)(machine, ch, (data & DART_WR5_RTS) != 0);
357            (*dart->rts_changed_cb)(device, offset, (data & DART_WR5_RTS) != 0);
405358         break;
406359   }
407360}
r3353r3354
411364    z80dart_c_r - read from a control register
412365-------------------------------------------------*/
413366
414UINT8 z80dart_c_r(int which, int ch)
367READ8_DEVICE_HANDLER( z80dart_c_r )
415368{
416   z80dart *dart = darts + which;
417   dart_channel *chan = &dart->chan[ch];
369   z80dart *dart = get_safe_token( device );
370   dart_channel *chan = &dart->chan[offset];
418371   int reg = chan->regs[0] & 7;
419372   UINT8 result = chan->status[reg];
420373
r3353r3354
424377      /* DART read register 0 */
425378      case 0:
426379         result &= ~DART_RR0_INT_PENDING;
427         if (z80dart_irq_state(which) & Z80_DAISY_INT)
380         if (z80dart_irq_state(device) & Z80_DAISY_INT)
428381            result |= DART_RR0_INT_PENDING;
429382         break;
430383   }
431384
432   VPRINTF(("%04X:dart_reg_r(%c,%d) = %02x\n", activecpu_get_pc(), 'A' + ch, reg, chan->status[reg]));
385   VPRINTF(("%04X:dart_reg_r(%c,%d) = %02x\n", activecpu_get_pc(), 'A' + offset, reg, chan->status[reg]));
433386
434387   return chan->status[reg];
435388}
r3353r3354
445398    z80dart_d_w - write to a data register
446399-------------------------------------------------*/
447400
448void z80dart_d_w(int which, int ch, UINT8 data)
401WRITE8_DEVICE_HANDLER( z80dart_d_w )
449402{
450   z80dart *dart = darts + which;
451   dart_channel *chan = &dart->chan[ch];
403   z80dart *dart = get_safe_token( device );
404   dart_channel *chan = &dart->chan[offset];
452405
453   VPRINTF(("%04X:dart_data_w(%c) = %02X\n", activecpu_get_pc(), 'A' + ch, data));
406   VPRINTF(("%04X:dart_data_w(%c) = %02X\n", activecpu_get_pc(), 'A' + offset, data));
454407
455408   /* if tx not enabled, just ignore it */
456409   if (!(chan->regs[5] & DART_WR5_TX_ENABLE))
r3353r3354
460413   chan->status[0] &= ~DART_RR0_TX_BUFFER_EMPTY;
461414
462415   /* reset the transmit interrupt */
463   dart->int_state[INT_CHA_TRANSMIT - 4*ch] &= ~Z80_DAISY_INT;
464   interrupt_check(dart);
416   dart->int_state[INT_CHA_TRANSMIT - 4*offset] &= ~Z80_DAISY_INT;
417   interrupt_check(device);
465418
466419   /* stash the character */
467420   chan->outbuf = data;
r3353r3354
472425    z80dart_d_r - read from a data register
473426-------------------------------------------------*/
474427
475UINT8 z80dart_d_r(int which, int ch)
428READ8_DEVICE_HANDLER( z80dart_d_r )
476429{
477   z80dart *dart = darts + which;
478   dart_channel *chan = &dart->chan[ch];
430   z80dart *dart = get_safe_token( device );
431   dart_channel *chan = &dart->chan[offset];
479432
480433   /* update the status register */
481434   chan->status[0] &= ~DART_RR0_RX_CHAR_AVAILABLE;
482435
483436   /* reset the receive interrupt */
484   dart->int_state[INT_CHA_RECEIVE - 4*ch] &= ~Z80_DAISY_INT;
485   interrupt_check(dart);
437   dart->int_state[INT_CHA_RECEIVE - 4*offset] &= ~Z80_DAISY_INT;
438   interrupt_check(device);
486439
487   VPRINTF(("%04X:dart_data_r(%c) = %02X\n", activecpu_get_pc(), 'A' + ch, chan->inbuf));
440   VPRINTF(("%04X:dart_data_r(%c) = %02X\n", activecpu_get_pc(), 'A' + offset, chan->inbuf));
488441
489442   return chan->inbuf;
490443}
r3353r3354
500453    line
501454-------------------------------------------------*/
502455
503int z80dart_get_dtr(int which, int ch)
456int z80dart_get_dtr(const device_config *device, int ch)
504457{
505   z80dart *dart = darts + which;
458   z80dart *dart = get_safe_token( device );
506459   dart_channel *chan = &dart->chan[ch];
507460   return ((chan->regs[5] & DART_WR5_DTR) != 0);
508461}
r3353r3354
513466    line
514467-------------------------------------------------*/
515468
516int z80dart_get_rts(int which, int ch)
469int z80dart_get_rts(const device_config *device, int ch)
517470{
518   z80dart *dart = darts + which;
471   z80dart *dart = get_safe_token( device );
519472   dart_channel *chan = &dart->chan[ch];
520473   return ((chan->regs[5] & DART_WR5_RTS) != 0);
521474}
r3353r3354
528481
529482static TIMER_CALLBACK(change_input_line)
530483{
531   z80dart *dart = darts + ((param >> 1) & 0x3f);
484   const device_config *device = ptr;
485   z80dart *dart = get_safe_token( device );
532486   dart_channel *chan = &dart->chan[param & 1];
533487   UINT8 line = (param >> 8) & 0xff;
534488   int state = (param >> 7) & 1;
r3353r3354
562516   if (((old ^ chan->status[0]) & line) && (chan->regs[1] & DART_WR1_STATUSINT_ENABLE))
563517   {
564518      dart->int_state[INT_CHA_STATUS - 4*ch] |= Z80_DAISY_INT;
565      interrupt_check(dart);
519      interrupt_check(device);
566520   }
567521}
568522
r3353r3354
572526    line
573527-------------------------------------------------*/
574528
575void z80dart_set_cts(int which, int ch, int state)
529void z80dart_set_cts(const device_config *device, int ch, int state)
576530{
577531   /* operate deferred */
578   timer_set(attotime_zero, NULL, (DART_RR0_CTS << 8) + (state != 0) * 0x80 + which * 2 + ch, change_input_line);
532   timer_set(attotime_zero, (void *)device, (DART_RR0_CTS << 8) + (state != 0) * 0x80 + ch, change_input_line);
579533}
580534
581535
r3353r3354
584538    line
585539-------------------------------------------------*/
586540
587void z80dart_set_dcd(int which, int ch, int state)
541void z80dart_set_dcd(const device_config *device, int ch, int state)
588542{
589543   /* operate deferred */
590   timer_set(attotime_zero, NULL, (DART_RR0_DCD << 8) + (state != 0) * 0x80 + which * 2 + ch, change_input_line);
544   timer_set(attotime_zero, (void *)device, (DART_RR0_DCD << 8) + (state != 0) * 0x80 + ch, change_input_line);
591545}
592546
593547
r3353r3354
596550    line
597551-------------------------------------------------*/
598552
599void z80dart_set_ri(int which, int state)
553void z80dart_set_ri(const device_config *device, int state)
600554{
601555   /* operate deferred */
602   timer_set(attotime_zero, NULL, (DART_RR0_RI << 8) + (state != 0) * 0x80 + which * 2, change_input_line);
556   timer_set(attotime_zero, (void *)device, (DART_RR0_RI << 8) + (state != 0) * 0x80, change_input_line);
603557}
604558
605559
r3353r3354
608562    input lines
609563-------------------------------------------------*/
610564
611void z80dart_receive_data(int which, int ch, UINT8 data)
565void z80dart_receive_data(const device_config *device, int ch, UINT8 data)
612566{
613   z80dart *dart = darts + which;
567   z80dart *dart = get_safe_token( device );
614568   dart_channel *chan = &dart->chan[ch];
615569   int newinptr;
616570
r3353r3354
633587
634588static TIMER_CALLBACK(serial_callback)
635589{
636   z80dart *dart = darts + (param >> 1);
590   const device_config *device = ptr;
591   z80dart *dart = get_safe_token( device );
637592   dart_channel *chan = &dart->chan[param & 1];
638593   int ch = param & 1;
639594   int data = -1;
r3353r3354
645600
646601      /* actually transmit the character */
647602      if (dart->transmit_cb != NULL)
648         (*dart->transmit_cb)(machine, ch, chan->outbuf);
603         (*dart->transmit_cb)(device, ch, chan->outbuf);
649604
650605      /* update the status register */
651606      chan->status[0] |= DART_RR0_TX_BUFFER_EMPTY;
r3353r3354
654609      if (chan->regs[1] & DART_WR1_TXINT_ENABLE)
655610      {
656611         dart->int_state[INT_CHA_TRANSMIT - 4*ch] |= Z80_DAISY_INT;
657         interrupt_check(dart);
612         interrupt_check(device);
658613      }
659614
660615      /* reset the output buffer */
r3353r3354
663618
664619   /* ask the polling callback if there is data to receive */
665620   if (dart->receive_poll_cb != NULL)
666      data = (*dart->receive_poll_cb)(ch);
621      data = (*dart->receive_poll_cb)(device, ch);
667622
668623   /* if we have buffered data, pull it */
669624   if (chan->receive_inptr != chan->receive_outptr)
r3353r3354
698653         case DART_WR1_RXINT_ALL_NOPARITY:
699654         case DART_WR1_RXINT_ALL_PARITY:
700655            dart->int_state[INT_CHA_RECEIVE - 4*ch] |= Z80_DAISY_INT;
701            interrupt_check(dart);
656            interrupt_check(device);
702657            break;
703658      }
704659      chan->int_on_next_rx = FALSE;
r3353r3354
724679};
725680
726681
727int z80dart_irq_state(int which)
682static int z80dart_irq_state(const device_config *device)
728683{
729   z80dart *dart = darts + which;
684   z80dart *dart = get_safe_token( device );
730685   int state = 0;
731686   int i;
732687
r3353r3354
752707}
753708
754709
755int z80dart_irq_ack(int which)
710static int z80dart_irq_ack(const device_config *device)
756711{
757   z80dart *dart = darts + which;
712   z80dart *dart = get_safe_token( device );
758713   int i;
759714
760715   /* loop over all interrupt sources */
r3353r3354
769724
770725         /* clear interrupt, switch to the IEO state, and update the IRQs */
771726         dart->int_state[inum] = Z80_DAISY_IEO;
772         interrupt_check(dart);
727         interrupt_check(device);
773728         return dart->chan[1].regs[2] + inum * 2;
774729      }
775730   }
r3353r3354
779734}
780735
781736
782void z80dart_irq_reti(int which)
737static void z80dart_irq_reti(const device_config *device)
783738{
784   z80dart *dart = darts + which;
739   z80dart *dart = get_safe_token( device );
785740   int i;
786741
787742   /* loop over all interrupt sources */
r3353r3354
796751
797752         /* clear the IEO state and update the IRQs */
798753         dart->int_state[inum] &= ~Z80_DAISY_IEO;
799         interrupt_check(dart);
754         interrupt_check(device);
800755         return;
801756      }
802757   }
803758
804759   logerror("z80dart_irq_reti: failed to find an interrupt to clear IEO on!\n");
805760}
761
762
763static DEVICE_START( z80dart )
764{
765   const z80dart_interface *intf = device->static_config;
766   z80dart *dart = get_safe_token(device);
767
768   dart->chan[0].receive_timer = timer_alloc(serial_callback, (void *)device);
769   dart->chan[1].receive_timer = timer_alloc(serial_callback, (void *)device);
770
771   dart->irq_cb = intf->irq_cb;
772   dart->dtr_changed_cb = intf->dtr_changed_cb;
773   dart->rts_changed_cb = intf->rts_changed_cb;
774   dart->break_changed_cb = intf->break_changed_cb;
775   dart->transmit_cb = intf->transmit_cb;
776   dart->receive_poll_cb = intf->receive_poll_cb;
777
778   return DEVICE_START_OK;
779}
780
781
782static DEVICE_RESET( z80dart )
783{
784   int ch;
785
786   /* set up defaults */
787   for (ch = 0; ch < 2; ch++)
788   {
789      reset_channel( device, ch );
790   }
791   interrupt_check(device);
792}
793
794
795static DEVICE_SET_INFO( z80dart )
796{
797   switch (state)
798   {
799      /* no parameters to set */
800   }
801}
802
803
804DEVICE_GET_INFO( z80dart )
805{
806   switch (state)
807   {
808      /* --- the following bits of info are returned as 64-bit signed integers --- */
809      case DEVINFO_INT_TOKEN_BYTES:               info->i = sizeof(z80dart);                  break;
810      case DEVINFO_INT_INLINE_CONFIG_BYTES:         info->i = 0;                           break;
811      case DEVINFO_INT_CLASS:                     info->i = DEVICE_CLASS_PERIPHERAL;            break;
812
813      /* --- the following bits of info are returned as pointers to data or functions --- */
814      case DEVINFO_FCT_SET_INFO:                  info->set_info = DEVICE_SET_INFO_NAME(z80dart);   break;
815      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(z80dart);      break;
816      case DEVINFO_FCT_STOP:                     /* Nothing */                           break;
817      case DEVINFO_FCT_RESET:                     info->reset = DEVICE_RESET_NAME(z80dart);      break;
818      case DEVINFO_FCT_IRQ_STATE:                  info->f = (genf *)z80dart_irq_state;         break;
819      case DEVINFO_FCT_IRQ_ACK:                  info->f = (genf *)z80dart_irq_ack;            break;
820      case DEVINFO_FCT_IRQ_RETI:                  info->f = (genf *)z80dart_irq_reti;            break;
821
822      /* --- the following bits of info are returned as NULL-terminated strings --- */
823      case DEVINFO_STR_NAME:                     info->s = "Zilog Z80 DART";                  break;
824      case DEVINFO_STR_FAMILY:                  info->s = "Z80";                        break;
825      case DEVINFO_STR_VERSION:                  info->s = "1.0";                        break;
826      case DEVINFO_STR_SOURCE_FILE:               info->s = __FILE__;                        break;
827      case DEVINFO_STR_CREDITS:                  info->s = "Copyright the MESS Team";         break;
828   }
829}
830
src/mess/machine/z80dart.h
r3353r3354
77
88***************************************************************************/
99
10/***************************************************************************
11    CONSTANTS
12***************************************************************************/
10#ifndef __Z80DART_H_
11#define __Z80DART_H_
1312
14#define MAX_DART         2
1513
16
17
1814/***************************************************************************
1915    TYPE DEFINITIONS
2016***************************************************************************/
r3353r3354
2218typedef struct _z80dart_interface z80dart_interface;
2319struct _z80dart_interface
2420{
21   const char *cpu;
2522   int baseclock;
26   void (*irq_cb)(int state);
27   write8_machine_func dtr_changed_cb;
28   write8_machine_func rts_changed_cb;
29   write8_machine_func break_changed_cb;
30   write8_machine_func transmit_cb;
31   int (*receive_poll_cb)(int which);
23   void (*irq_cb)(const device_config *device, int state);
24   write8_device_func dtr_changed_cb;
25   write8_device_func rts_changed_cb;
26   write8_device_func break_changed_cb;
27   write8_device_func transmit_cb;
28   int (*receive_poll_cb)(const device_config *device, int ch);
3229};
3330
3431
3532
3633/***************************************************************************
37    INITIALIZATION/CONFIGURATION
34    DEVICE CONFIGURATION MACROS
3835***************************************************************************/
3936
40void z80dart_init(int which, const z80dart_interface *intf);
41void z80dart_reset(int which);
37#define MDRV_Z80DART_ADD(_tag, _intrf) \
38   MDRV_DEVICE_ADD(_tag, Z80DART) \
39   MDRV_DEVICE_CONFIG(_intrf)
4240
41#define MDRV_Z80DART_REMOVE(_tag) \
42   MDRV_DEVICE_REMOVE(_tag, Z80DART)
4343
4444
45
4546/***************************************************************************
4647    CONTROL REGISTER READ/WRITE
4748***************************************************************************/
4849
49void z80dart_c_w(running_machine *machine, int which, int ch, UINT8 data);
50UINT8 z80dart_c_r(int which, int ch);
50WRITE8_DEVICE_HANDLER( z80dart_c_w );
51READ8_DEVICE_HANDLER( z80dart_c_r );
5152
5253
5354
r3353r3354
5556    DATA REGISTER READ/WRITE
5657***************************************************************************/
5758
58void z80dart_d_w(int which, int ch, UINT8 data);
59UINT8 z80dart_d_r(int which, int ch);
59WRITE8_DEVICE_HANDLER( z80dart_d_w );
60READ8_DEVICE_HANDLER( z80dart_d_r );
6061
6162
6263
r3353r3354
6465    CONTROL LINE READ/WRITE
6566***************************************************************************/
6667
67int z80dart_get_dtr(int which, int ch);
68int z80dart_get_rts(int which, int ch);
69void z80dart_set_cts(int which, int ch, int state);
70void z80dart_set_dcd(int which, int ch, int state);
71void z80dart_set_ri(int which, int state);
72void z80dart_receive_data(int which, int ch, UINT8 data);
68int z80dart_get_dtr(const device_config *device, int ch);
69int z80dart_get_rts(const device_config *device, int ch);
70void z80dart_set_cts(const device_config *device, int ch, int state);
71void z80dart_set_dcd(const device_config *device, int ch, int state);
72void z80dart_set_ri(const device_config *device, int state);
73void z80dart_receive_data(const device_config *device, int ch, UINT8 data);
7374
7475
76/* ----- device interface ----- */
7577
76/***************************************************************************
77    DAISY CHAIN INTERFACE
78***************************************************************************/
78#define Z80DART DEVICE_GET_INFO_NAME(z80dart)
79DEVICE_GET_INFO( z80dart );
7980
80int z80dart_irq_state(int which);
81int z80dart_irq_ack(int which);
82void z80dart_irq_reti(int which);
81#endif

Previous 15994 Revisions Next


© 1998-2018 The MESS Team