Previous 15994 Revisions Next

r4242 Monday 9th February, 2009 at 10:23:16 UTC by Curt Coder
Refactored the ACIA6850 to use devcb.
[src/emu/machine]6850acia.c 6850acia.h
[src/mess/drivers]atarist.c bw2.c newbrain.c osi.c
[src/mess/includes]atarist.h newbrain.h
[src/mess/machine]bbc.c thomson.c

src/emu/machine/6850acia.c
r4241r4242
2020#define CR6_5   0x60
2121#define CR7      0x80
2222
23#define TXD(_data) \
24   devcb_call_write_line(&acia_p->out_tx_func, _data)
2325
26#define RTS(_data) \
27   devcb_call_write_line(&acia_p->out_rts_func, _data)
28
2429/***************************************************************************
2530    TYPE DEFINITIONS
2631***************************************************************************/
r4241r4242
4449typedef struct _acia6850_t acia6850_t;
4550struct _acia6850_t
4651{
52   devcb_resolved_read_line   in_rx_func;
53   devcb_resolved_write_line   out_tx_func;
54   devcb_resolved_read_line   in_cts_func;
55   devcb_resolved_write_line   out_rts_func;
56   devcb_resolved_read_line   in_dcd_func;
57   devcb_resolved_write_line   out_irq_func;
58
4759   UINT8   ctrl;
4860   UINT8   status;
4961
50   UINT8   *rx_pin;
51   UINT8   *tx_pin;
52   UINT8   *cts_pin;
53   UINT8   *rts_pin;
54   UINT8   *dcd_pin;
55
5662   UINT8   tdr;
5763   UINT8   rdr;
5864   UINT8   rx_shift;
r4241r4242
9096
9197   emu_timer *rx_timer;
9298   emu_timer *tx_timer;
93
94   void (*int_callback)(const device_config *device, int param);
9599};
96100
97101
r4241r4242
153157static DEVICE_RESET( acia6850 )
154158{
155159   acia6850_t *acia_p = get_token(device);
156   int cts = 0, dcd = 0;
157160
158   if (acia_p->cts_pin)
159   {
160      cts = *acia_p->cts_pin;
161   }
161   int cts = devcb_call_read_line(&acia_p->in_cts_func);
162   int dcd = devcb_call_read_line(&acia_p->in_dcd_func);
162163
163   if (acia_p->dcd_pin)
164   {
165      dcd = *acia_p->dcd_pin;
166   }
167
168164   acia_p->status = (cts << 3) | (dcd << 2) | ACIA6850_STATUS_TDRE;
169165   acia_p->tdr = 0;
170166   acia_p->rdr = 0;
r4241r4242
173169   acia_p->tx_counter = 0;
174170   acia_p->rx_counter = 0;
175171
176   *acia_p->tx_pin = 1;
172   TXD(1);
177173   acia_p->overrun = 0;
178174   acia_p->status_read = 0;
179175   acia_p->brk = 0;
r4241r4242
181177   acia_p->rx_state = START;
182178   acia_p->tx_state = START;
183179
184   if (acia_p->int_callback)
185   {
186      acia_p->int_callback(device, 1);
187   }
180   devcb_call_write_line(&acia_p->out_irq_func, 1);
188181
189182   if (acia_p->first_reset)
190183   {
191184      acia_p->first_reset = 0;
192185
193      if (acia_p->rts_pin)
194      {
195         *acia_p->rts_pin = 1;
196      }
186      RTS(1);
197187   }
198188   else
199189   {
200      if (acia_p->rts_pin)
201      {
202         *acia_p->rts_pin = acia_p->rts;
203      }
190      RTS(acia_p->rts);
204191   }
205192}
206193
r4241r4242
215202   acia6850_t *acia_p = get_token(device);
216203   acia6850_interface *intf = get_interface(device);
217204
205   /* resolve callbacks */
206   devcb_resolve_read_line(&acia_p->in_rx_func, &intf->in_rx_func, device);
207   devcb_resolve_write_line(&acia_p->out_tx_func, &intf->out_tx_func, device);
208   devcb_resolve_read_line(&acia_p->in_cts_func, &intf->in_cts_func, device);
209   devcb_resolve_write_line(&acia_p->out_rts_func, &intf->out_rts_func, device);
210   devcb_resolve_read_line(&acia_p->in_dcd_func, &intf->in_dcd_func, device);
211   devcb_resolve_write_line(&acia_p->out_irq_func, &intf->out_irq_func, device);
212
218213   acia_p->rx_clock = intf->rx_clock;
219214   acia_p->tx_clock = intf->tx_clock;
220215   acia_p->tx_counter = 0;
221216   acia_p->rx_counter = 0;
222   acia_p->rx_pin = intf->rx_pin;
223   acia_p->tx_pin = intf->tx_pin;
224   acia_p->cts_pin = intf->cts_pin;
225   acia_p->rts_pin = intf->rts_pin;
226   acia_p->dcd_pin = intf->dcd_pin;
227217   acia_p->rx_timer = timer_alloc(device->machine, receive_event, (void *) device);
228218   acia_p->tx_timer = timer_alloc(device->machine, transmit_event, (void *) device);
229   acia_p->int_callback = intf->int_callback;
230219   acia_p->first_reset = 1;
231220   acia_p->status_read = 0;
232221   acia_p->brk = 0;
r4241r4242
285274   int wordsel;
286275   int divide;
287276
288   acia_p->ctrl = data;
289277
290278   // Counter Divide Select Bits
291279
r4241r4242
315303   switch ((data & CR6_5) >> 5)
316304   {
317305   case 0:
318      if (acia_p->rts_pin)
319      {
320         *acia_p->rts_pin = acia_p->rts = 0;
321      }
306      acia_p->rts = 0;
307      RTS(acia_p->rts);
322308
323309      acia_p->tx_int = 0;
324310      acia_p->brk = 0;
325311      break;
326312
327313   case 1:
328      if (acia_p->rts_pin)
329      {
330         *acia_p->rts_pin = acia_p->rts = 0;
331      }
314      acia_p->rts = 0;
315      RTS(acia_p->rts);
332316
333317      acia_p->tx_int = 1;
334318      acia_p->brk = 0;
335319      break;
336320
337321   case 2:
338      if (acia_p->rts_pin)
339      {
340         *acia_p->rts_pin = acia_p->rts = 1;
341      }
322      acia_p->rts = 1;
323      RTS(acia_p->rts);
342324
343325      acia_p->tx_int = 0;
344326      acia_p->brk = 0;
345327      break;
346328
347329   case 3:
348      if (acia_p->rts_pin)
349      {
350         *acia_p->rts_pin = acia_p->rts = 0;
351      }
330      acia_p->rts = 0;
331      RTS(acia_p->rts);
352332
353333      acia_p->tx_int = 0;
354334      acia_p->brk = 1;
355335      break;
356336   }
357337
358   // After writing the word type, start receive clock
338   // After writing the word type, set the rx/tx clocks (provided the divide values have changed)
359339
360   if (!acia_p->reset)
340   if ((acia_p->ctrl ^ data) & CR1_0)
361341   {
362      if (acia_p->rx_clock)
342      if (!acia_p->reset)
363343      {
364         attotime rx_period = attotime_mul(ATTOTIME_IN_HZ(acia_p->rx_clock), acia_p->divide);
365         timer_adjust_periodic(acia_p->rx_timer, rx_period, 0, rx_period);
344         if (acia_p->rx_clock)
345         {
346            attotime rx_period = attotime_mul(ATTOTIME_IN_HZ(acia_p->rx_clock), acia_p->divide);
347            timer_adjust_periodic(acia_p->rx_timer, rx_period, 0, rx_period);
348         }
349
350         if (acia_p->tx_clock)
351         {
352            attotime tx_period = attotime_mul(ATTOTIME_IN_HZ(acia_p->tx_clock), acia_p->divide);
353            timer_adjust_periodic(acia_p->tx_timer, tx_period, 0, tx_period);
354         }
366355      }
367      if (acia_p->tx_clock)
368      {
369         attotime tx_period = attotime_mul(ATTOTIME_IN_HZ(acia_p->tx_clock), acia_p->divide);
370         timer_adjust_periodic(acia_p->tx_timer, tx_period, 0, tx_period);
371      }
372356   }
357   acia_p->ctrl = data;
373358}
374359
375360
r4241r4242
387372   if (irq)
388373   {
389374      acia_p->status |= ACIA6850_STATUS_IRQ;
390
391      if (acia_p->int_callback)
392      {
393         acia_p->int_callback(device, 0);
394      }
375      devcb_call_write_line(&acia_p->out_irq_func, 0);
395376   }
396377   else
397378   {
398379      acia_p->status &= ~ACIA6850_STATUS_IRQ;
399
400      if (acia_p->int_callback)
401      {
402         acia_p->int_callback(device, 1);
403      }
380      devcb_call_write_line(&acia_p->out_irq_func, 1);
404381   }
405382}
406383
r4241r4242
438415
439416   if (acia_p->status_read)
440417   {
418      int dcd = devcb_call_read_line(&acia_p->in_dcd_func);
419
441420      acia_p->status_read = 0;
442421      acia_p->status &= ~(ACIA6850_STATUS_OVRN | ACIA6850_STATUS_DCD);
443422
444      if (acia_p->dcd_pin && *acia_p->dcd_pin)
423      if (dcd)
445424      {
446425         acia_p->status |= ACIA6850_STATUS_DCD;
447426      }
r4241r4242
467446{
468447   acia6850_t *acia_p = get_token(device);
469448
470   if (acia_p->cts_pin && *acia_p->cts_pin)
449   int cts = devcb_call_read_line(&acia_p->in_cts_func);
450
451   if (cts)
471452   {
472453      acia_p->status |= ACIA6850_STATUS_CTS;
473454   }
r4241r4242
484465         {
485466            // transmit break
486467
487            *acia_p->tx_pin = 0;
468            TXD(0);
488469         }
489470         else
490471         {
r4241r4242
492473            {
493474               // transmitter idle
494475
495               *acia_p->tx_pin = 1;
476               TXD(1);
496477            }
497478            else
498479            {
r4241r4242
501482               //logerror("ACIA6850 #%u: TX DATA %x\n", which, acia_p->tdr);
502483               //logerror("ACIA6850 #%u: TX START BIT\n", which);
503484
504               *acia_p->tx_pin = 0;
485               TXD(0);
505486
506487               acia_p->tx_bits = acia_p->bits;
507488               acia_p->tx_shift = acia_p->tdr;
r4241r4242
525506         int val = acia_p->tx_shift & 1;
526507         //logerror("ACIA6850 #%u: TX DATA BIT %x\n", which, val);
527508
528         *acia_p->tx_pin = val;
509         TXD(val);
529510         acia_p->tx_parity ^= val;
530511         acia_p->tx_shift >>= 1;
531512
r4241r4242
540521      {
541522         if (acia_p->parity == EVEN)
542523         {
543            *acia_p->tx_pin = (acia_p->tx_parity & 1) ? 1 : 0;
524            TXD((acia_p->tx_parity & 1) ? 1 : 0);
544525         }
545526         else
546527         {
547            *acia_p->tx_pin = (acia_p->tx_parity & 1) ? 0 : 1;
528            TXD((acia_p->tx_parity & 1) ? 0 : 1);
548529         }
549530
550531         //logerror("ACIA6850 #%u: TX PARITY BIT %x\n", which, *acia_p->tx_pin);
r4241r4242
555536      case STOP:
556537      {
557538         //logerror("ACIA6850 #%u: TX STOP BIT\n", which);
558         *acia_p->tx_pin = 1;
539         TXD(1);
559540
560541         if (acia_p->stopbits == 1)
561542         {
r4241r4242
570551      case STOP2:
571552      {
572553         //logerror("ACIA6850 #%u: TX STOP BIT\n", which);
573         *acia_p->tx_pin = 1;
554         TXD(1);
574555         acia_p->tx_state = START;
575556         break;
576557      }
r4241r4242
592573
593574
594575/*-------------------------------------------------
595    acia_tx_clock_in - As above, but using the tx pin
576    acia6850_tx_clock_in - As above, but using the tx pin
596577-------------------------------------------------*/
597578
598void acia_tx_clock_in(const device_config *device)
579void acia6850_tx_clock_in(const device_config *device)
599580{
600581   acia6850_t *acia_p = get_token(device);
601582
602   if (acia_p->cts_pin && *acia_p->cts_pin)
583   int cts = devcb_call_read_line(&acia_p->in_cts_func);
584
585   if (cts)
603586   {
604587      acia_p->status |= ACIA6850_STATUS_CTS;
605588   }
r4241r4242
627610{
628611   acia6850_t *acia_p = get_token(device);
629612
630   if (acia_p->dcd_pin && *acia_p->dcd_pin)
613   int dcd = devcb_call_read_line(&acia_p->in_dcd_func);
614
615   if (dcd)
631616   {
632617      acia_p->status |= ACIA6850_STATUS_DCD;
633618      acia6850_check_interrupts(device);
r4241r4242
643628   }
644629   else
645630   {
631      int rxd = devcb_call_read_line(&acia_p->in_rx_func);
632
646633      switch (acia_p->rx_state)
647634      {
648635         case START:
649636         {
650            if (*acia_p->rx_pin == 0)
637            if (rxd == 0)
651638            {
652639               //logerror("ACIA6850 #%u: RX START BIT\n", which);
653640               acia_p->rx_shift = 0;
r4241r4242
659646         }
660647         case DATA:
661648         {
662            //logerror("ACIA6850 #%u: RX DATA BIT %x\n", which, *acia_p->rx_pin);
663            acia_p->rx_shift |= *acia_p->rx_pin ? 0x80 : 0;
664            acia_p->rx_parity ^= *acia_p->rx_pin;
649            //logerror("ACIA6850 #%u: RX DATA BIT %x\n", which, rxd);
650            acia_p->rx_shift |= rxd ? 0x80 : 0;
651            acia_p->rx_parity ^= rxd;
665652
666653            if (--acia_p->rx_bits == 0)
667654            {
r4241r4242
681668         }
682669         case PARITY:
683670         {
684            //logerror("ACIA6850 #%u: RX PARITY BIT %x\n", which, *acia_p->rx_pin);
685            acia_p->rx_parity ^= *acia_p->rx_pin;
671            //logerror("ACIA6850 #%u: RX PARITY BIT %x\n", which, rxd);
672            acia_p->rx_parity ^= rxd;
686673
687674            if (acia_p->parity == EVEN)
688675            {
r4241r4242
704691         }
705692         case STOP:
706693         {
707            if (*acia_p->rx_pin == 1)
694            if (rxd == 1)
708695            {
709696               //logerror("ACIA6850 #%u: RX STOP BIT\n", which);
710697               if (acia_p->stopbits == 1)
r4241r4242
735722         }
736723         case STOP2:
737724         {
738            if (*acia_p->rx_pin == 1)
725            if (rxd == 1)
739726            {
740727               //logerror("ACIA6850 #%u: RX STOP BIT\n", which);
741728               acia_p->status &= ~ACIA6850_STATUS_FE;
r4241r4242
777764
778765
779766/*-------------------------------------------------
780    acia_rx_clock_in - As above, but using the rx pin
767    acia6850_rx_clock_in - As above, but using the rx pin
781768-------------------------------------------------*/
782769
783void acia_rx_clock_in(const device_config *device)
770void acia6850_rx_clock_in(const device_config *device)
784771{
785772   acia6850_t *acia_p = get_token(device);
786773
787   if (acia_p->dcd_pin && *acia_p->dcd_pin)
774   int dcd = devcb_call_read_line(&acia_p->in_dcd_func);
775
776   if (dcd)
788777   {
789778      acia_p->status |= ACIA6850_STATUS_DCD;
790779      acia6850_check_interrupts(device);
r4241r4242
850839   switch (state)
851840   {
852841      /* --- the following bits of info are returned as 64-bit signed integers --- */
853      case DEVINFO_INT_TOKEN_BYTES:               info->i = sizeof(acia6850_t);            break;
854      case DEVINFO_INT_INLINE_CONFIG_BYTES:         info->i = 0;                        break;
855      case DEVINFO_INT_CLASS:                     info->i = DEVICE_CLASS_PERIPHERAL;         break;
842      case DEVINFO_INT_TOKEN_BYTES:               info->i = sizeof(acia6850_t);               break;
843      case DEVINFO_INT_INLINE_CONFIG_BYTES:         info->i = 0;                           break;
844      case DEVINFO_INT_CLASS:                     info->i = DEVICE_CLASS_PERIPHERAL;            break;
856845
857846      /* --- the following bits of info are returned as pointers to data or functions --- */
858847      case DEVINFO_FCT_SET_INFO:                  info->set_info = DEVICE_SET_INFO_NAME(acia6850); break;
859      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(acia6850);   break;
860      case DEVINFO_FCT_STOP:                     /* Nothing */                        break;
861      case DEVINFO_FCT_RESET:                     info->reset = DEVICE_RESET_NAME(acia6850);   break;
848      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(acia6850);      break;
849      case DEVINFO_FCT_STOP:                     /* Nothing */                           break;
850      case DEVINFO_FCT_RESET:                     info->reset = DEVICE_RESET_NAME(acia6850);      break;
862851
863852      /* --- the following bits of info are returned as NULL-terminated strings --- */
864      case DEVINFO_STR_NAME:                     strcpy(info->s, "6850 ACIA");            break;
865      case DEVINFO_STR_FAMILY:                  strcpy(info->s, "6850 ACIA");            break;
866      case DEVINFO_STR_VERSION:                  strcpy(info->s, "1.0");                  break;
867      case DEVINFO_STR_SOURCE_FILE:               strcpy(info->s, __FILE__);               break;
868      case DEVINFO_STR_CREDITS:                  /* Nothing */                        break;
853      case DEVINFO_STR_NAME:                     strcpy(info->s, "6850 ACIA");               break;
854      case DEVINFO_STR_FAMILY:                  strcpy(info->s, "6850 ACIA");               break;
855      case DEVINFO_STR_VERSION:                  strcpy(info->s, "1.0");                     break;
856      case DEVINFO_STR_SOURCE_FILE:               strcpy(info->s, __FILE__);                  break;
857      case DEVINFO_STR_CREDITS:                  /* Nothing */                           break;
869858   }
870859}
871
872
873/* ----------------------------------------------------------------------- */
874
875READ16_DEVICE_HANDLER( acia6850_stat_lsb_r ) { return acia6850_stat_r(device, 0) << 0; }
876READ16_DEVICE_HANDLER( acia6850_stat_msb_r ) { return acia6850_stat_r(device, 0) << 8; }
877
878READ16_DEVICE_HANDLER( acia6850_data_lsb_r ) { return acia6850_data_r(device, 0) << 0; }
879READ16_DEVICE_HANDLER( acia6850_data_msb_r ) { return acia6850_data_r(device, 0) << 8; }
880
881WRITE16_DEVICE_HANDLER( acia6850_ctrl_msb_w ) { if (ACCESSING_BITS_8_15) acia6850_ctrl_w(device, 0, (data >> 8) & 0xff); }
882WRITE16_DEVICE_HANDLER( acia6850_ctrl_lsb_w ) { if (ACCESSING_BITS_0_7) acia6850_ctrl_w(device, 0, (data >> 0) & 0xff); }
883
884WRITE16_DEVICE_HANDLER( acia6850_data_msb_w ) { if (ACCESSING_BITS_8_15) acia6850_data_w(device, 0, (data >> 8) & 0xff); }
885WRITE16_DEVICE_HANDLER( acia6850_data_lsb_w ) { if (ACCESSING_BITS_0_7) acia6850_data_w(device, 0, (data >> 0) & 0xff); }
src/emu/machine/6850acia.h
r4241r4242
99#ifndef __ACIA6850_H__
1010#define __ACIA6850_H__
1111
12#include "devcb.h"
1213
1314/***************************************************************************
1415    MACROS
r4241r4242
3233#define MDRV_ACIA6850_REMOVE(_tag) \
3334   MDRV_DEVICE_REMOVE(_tag, ACIA6850)
3435
36#define ACIA6850_INTERFACE(_name) \
37   const acia6850_interface(_name) =
3538
36
3739/***************************************************************************
3840    TYPE DEFINITIONS
3941***************************************************************************/
r4241r4242
4446   int   tx_clock;
4547   int   rx_clock;
4648
47   UINT8 *rx_pin;
48   UINT8 *tx_pin;
49   UINT8 *cts_pin;
50   UINT8 *rts_pin;
51   UINT8 *dcd_pin;
49   devcb_read_line      in_rx_func;
50   devcb_write_line   out_tx_func;
5251
53   void (*int_callback)(const device_config *device, int state);
52   devcb_read_line      in_cts_func;
53   devcb_write_line   out_rts_func;
54   devcb_read_line      in_dcd_func;
55
56   devcb_write_line   out_irq_func;
5457};
5558
5659
r4241r4242
6063
6164DEVICE_GET_INFO( acia6850 );
6265
63void acia_tx_clock_in(const device_config *device) ATTR_NONNULL;
64void acia_rx_clock_in(const device_config *device) ATTR_NONNULL;
66void acia6850_tx_clock_in(const device_config *device) ATTR_NONNULL;
67void acia6850_rx_clock_in(const device_config *device) ATTR_NONNULL;
6568
6669void acia6850_set_rx_clock(const device_config *device, int clock) ATTR_NONNULL;
6770void acia6850_set_tx_clock(const device_config *device, int clock) ATTR_NONNULL;
r4241r4242
7174WRITE8_DEVICE_HANDLER( acia6850_data_w );
7275READ8_DEVICE_HANDLER( acia6850_data_r );
7376
74READ16_DEVICE_HANDLER( acia6850_stat_lsb_r );
75READ16_DEVICE_HANDLER( acia6850_stat_msb_r );
76READ16_DEVICE_HANDLER( acia6850_data_lsb_r );
77READ16_DEVICE_HANDLER( acia6850_data_msb_r );
78
79WRITE16_DEVICE_HANDLER( acia6850_ctrl_msb_w );
80WRITE16_DEVICE_HANDLER( acia6850_ctrl_lsb_w );
81WRITE16_DEVICE_HANDLER( acia6850_data_msb_w );
82WRITE16_DEVICE_HANDLER( acia6850_data_lsb_w );
83
8477#endif /* __ACIA6850_H__ */
src/mess/includes/atarist.h
r4241r4242
33
44#define SCREEN_TAG   "main"
55#define M68000_TAG   "m68000"
6#define HD6301_TAG   "hd6301"
7#define COP888_TAG   "u703"
8#define YM3439_TAG   "ym3439"
69#define MC68901_TAG   "mc68901"
710#define LMC1992_TAG "lmc1992"
11#define WD1772_TAG   "wd1772"
812
913// Atari ST
1014
r4241r4242
5054   UINT8 ikbd_mouse_px;
5155   UINT8 ikbd_mouse_py;
5256   UINT8 ikbd_mouse_pc;
57   int ikbd_rx;
58   int ikbd_tx;
59   int midi_rx;
60   int midi_tx;
5361   int acia_irq;
5462
5563   /* floppy state */
r4241r4242
122130   /* devices */
123131   const device_config *mc68901;
124132   const device_config *lmc1992;
133   const device_config *wd1772;
125134
126135   /* timers */
127136   emu_timer *glue_timer;
src/mess/includes/newbrain.h
r4241r4242
5050   int bee;            /* identity */
5151   UINT8 enrg1;         /* enable register 1 */
5252   UINT8 enrg2;         /* enable register 2 */
53   int acia_rxd;         /* ACIA receive */
54   int acia_txd;         /* ACIA transmit */
5355
5456   /* COP420 state */
5557   UINT8 cop_bus;         /* data bus */
src/mess/machine/thomson.c
r4241r4242
918918   NULL, NULL
919919};
920920
921static READ_LINE_DEVICE_HANDLER( to7_modem_rx_r )
922{
923   return to7_modem_rx;
924}
921925
926static WRITE_LINE_DEVICE_HANDLER( to7_modem_tx_w )
927{
928   to7_modem_tx = state;
929}
922930
923const acia6850_interface to7_modem =
931ACIA6850_INTERFACE( to7_modem )
924932{
925   1200, 1200, /* 1200 bauds, might be divided by 16 */
926   &to7_modem_rx, &to7_modem_tx,
927   NULL, NULL, NULL,
928   to7_modem_cb
933   1200,
934   1200, /* 1200 bauds, might be divided by 16 */
935   DEVCB_LINE(to7_modem_rx_r), /*&to7_modem_rx,*/
936   DEVCB_LINE(to7_modem_tx_w), /*&to7_modem_tx,*/
937   DEVCB_NULL,
938   DEVCB_NULL,
939   DEVCB_NULL,
940   DEVCB_LINE(to7_modem_cb)
929941};
930942
931943
src/mess/machine/bbc.c
r4241r4242
13831383
13841384
13851385
1386static void Serial_interrupt(const device_config *device, int level)
1386static WRITE_LINE_DEVICE_HANDLER( serial_interrupt )
13871387{
1388   cpu_set_input_line(device->machine->cpu[0], M6502_IRQ_LINE, level);
1388   cpu_set_input_line(device->machine->cpu[0], M6502_IRQ_LINE, state);
13891389}
13901390
13911391static UINT8 bbc_tx_pin;
13921392
1393const acia6850_interface bbc_acia6850_interface =
1393static WRITE_LINE_DEVICE_HANDLER( bbc_tx_w )
13941394{
1395   0,                  /* tx_clock */
1396   0,                  /* rx_clock */
1397   NULL,               /* rx_pin */
1398   &bbc_tx_pin,         /* tx_pin */
1399   NULL,               /* cts_pin */
1400   NULL,               /* rts_pin */
1401   NULL,               /* dcd_pin */
1402   Serial_interrupt,      /* int_callback */
1395   bbc_tx_pin = state;
1396}
1397
1398ACIA6850_INTERFACE( bbc_acia6850_interface )
1399{
1400   0,
1401   0,
1402   DEVCB_NULL,
1403   DEVCB_LINE(bbc_tx_w), /*&bbc_tx_pin,*/
1404   DEVCB_NULL,
1405   DEVCB_NULL,
1406   DEVCB_NULL,
1407   DEVCB_LINE(serial_interrupt),
14031408};
14041409
14051410
r4241r4242
14251430   if (!mc6850_clock && new_clock)
14261431   {
14271432      const device_config *acia = devtag_get_device(machine, ACIA6850, "acia6850");
1428      acia_tx_clock_in(acia);
1433      acia6850_tx_clock_in(acia);
14291434   }
14301435   mc6850_clock = new_clock;
14311436}
src/mess/drivers/atarist.c
r4241r4242
3636
3737*/
3838
39static UINT8 mfp_rx, mfp_tx;
40static UINT8 ikbd_rx, ikbd_tx;
41static UINT8 acia_midi_rx = 1, acia_midi_tx = 1;
42
4339/* Floppy Disk Controller */
4440
4541static void atarist_fdc_dma_transfer(running_machine *machine)
4642{
47   device_config *fdc = (device_config*)devtag_get_device(machine, WD1772, "wd1772");
4843   const address_space *program = cputag_get_address_space(machine, M68000_TAG, ADDRESS_SPACE_PROGRAM);
4944   atarist_state *state = machine->driver_data;
5045
r4241r4242
5651         {
5752            UINT8 data = memory_read_byte_8be(program, state->fdc_dmabase);
5853
59            wd17xx_data_w(fdc, 0, data);
54            wd17xx_data_w(state->wd1772, 0, data);
6055         }
6156         else
6257         {
63            UINT8 data = wd17xx_data_r(fdc, 0);
58            UINT8 data = wd17xx_data_r(state->wd1772, 0);
6459
6560            memory_write_byte_8be(program, state->fdc_dmabase, data);
6661         }
r4241r4242
115110static READ16_HANDLER( atarist_fdc_data_r )
116111{
117112   atarist_state *state = space->machine->driver_data;
118   device_config *fdc = (device_config*)devtag_get_device(space->machine, WD1772, "wd1772");
119113
120114   if (state->fdc_mode & ATARIST_FLOPPY_MODE_SECTOR_COUNT)
121115   {
r4241r4242
132126      }
133127      else
134128      {
135         return wd17xx_r(fdc, (state->fdc_mode & ATARIST_FLOPPY_MODE_ADDRESS_MASK) >> 1);
129         return wd17xx_r(state->wd1772, (state->fdc_mode & ATARIST_FLOPPY_MODE_ADDRESS_MASK) >> 1);
136130      }
137131   }
138132}
r4241r4242
140134static WRITE16_HANDLER( atarist_fdc_data_w )
141135{
142136   atarist_state *state = space->machine->driver_data;
143   device_config *fdc = (device_config*)devtag_get_device(space->machine, WD1772, "wd1772");
144137   
145138   if (state->fdc_mode & ATARIST_FLOPPY_MODE_SECTOR_COUNT)
146139   {
r4241r4242
164157      }
165158      else
166159      {
167         wd17xx_w(fdc, (state->fdc_mode & ATARIST_FLOPPY_MODE_ADDRESS_MASK) >> 1, data);
160         wd17xx_w(state->wd1772, (state->fdc_mode & ATARIST_FLOPPY_MODE_ADDRESS_MASK) >> 1, data);
168161      }
169162   }
170163}
r4241r4242
283276
284277    */
285278
286//   atarist_state *state = space->machine->driver_data;
279   atarist_state *state = space->machine->driver_data;
287280
288   return (ikbd_tx << 3) | (input_port_read_safe(space->machine, "IKBD_JOY1", 0xff) & 0x06);
281   return (state->ikbd_tx << 3) | (input_port_read_safe(space->machine, "IKBD_JOY1", 0xff) & 0x06);
289282}
290283
291284static WRITE8_HANDLER( ikbd_port2_w )
r4241r4242
302295
303296    */
304297
305//   atarist_state *state = space->machine->driver_data;
298   atarist_state *state = space->machine->driver_data;
306299
307   ikbd_rx = (data & 0x10) >> 4;
300   state->ikbd_rx = (data & 0x10) >> 4;
308301}
309302
310303static WRITE8_HANDLER( ikbd_port3_w )
r4241r4242
754747
755748   state->megaste_cache = data;
756749
757   cpu_set_clock(space->machine->cpu[0], BIT(data, 0) ? Y2/2 : Y2/4);
750   cputag_set_clock(space->machine, M68000_TAG, BIT(data, 0) ? Y2/2 : Y2/4);
758751}
759752
760753/* ST Book */
r4241r4242
12661259INPUT_PORTS_END
12671260
12681261static INPUT_PORTS_START( stbook )
1269   PORT_INCLUDE(atarist)   // this fixes "missing port" fatalerror and adds a keyboard - joystick needs investigation
12701262   PORT_START("SW400")
12711263   PORT_DIPNAME( 0x80, 0x80, "DMA sound hardware")
12721264   PORT_DIPSETTING( 0x00, DEF_STR( No ) )
r4241r4242
12841276
12851277static WRITE8_HANDLER( ym2149_port_a_w )
12861278{
1287   device_config *fdc = (device_config*)devtag_get_device(space->machine, WD1772, "wd1772");
1288   wd17xx_set_side(fdc, BIT(data, 0) ? 0 : 1);
1279   atarist_state *state = space->machine->driver_data;
12891280
1281   wd17xx_set_side(state->wd1772, BIT(data, 0) ? 0 : 1);
1282
12901283   if (!BIT(data, 1))
12911284   {
1292      wd17xx_set_drive(fdc,0);
1285      wd17xx_set_drive(state->wd1772, 0);
12931286   }
12941287
12951288   if (!BIT(data, 2))
12961289   {
1297      wd17xx_set_drive(fdc,1);
1290      wd17xx_set_drive(state->wd1772, 1);
12981291   }
12991292
13001293   // 0x08 = RTS
r4241r4242
13231316
13241317/* Machine Drivers */
13251318
1326static void acia_interrupt(const device_config *device, int state)
1319static READ_LINE_DEVICE_HANDLER( ikbd_rx )
13271320{
13281321   atarist_state *driver_state = device->machine->driver_data;
13291322
1323   return driver_state->ikbd_rx;
1324}
1325
1326static WRITE_LINE_DEVICE_HANDLER( ikbd_tx )
1327{
1328   atarist_state *driver_state = device->machine->driver_data;
1329
1330   driver_state->ikbd_tx = state;
1331}
1332
1333static READ_LINE_DEVICE_HANDLER( midi_rx )
1334{
1335   atarist_state *driver_state = device->machine->driver_data;
1336
1337   return driver_state->midi_rx;
1338}
1339
1340static WRITE_LINE_DEVICE_HANDLER( midi_tx )
1341{
1342   atarist_state *driver_state = device->machine->driver_data;
1343
1344   driver_state->midi_tx = state;
1345}
1346
1347static WRITE_LINE_DEVICE_HANDLER( acia_interrupt )
1348{
1349   atarist_state *driver_state = device->machine->driver_data;
1350
13301351   driver_state->acia_irq = state;
13311352}
13321353
1333static const acia6850_interface acia_ikbd_intf =
1354static ACIA6850_INTERFACE( acia_ikbd_intf )
13341355{
13351356   Y2/64,
13361357   Y2/64,
1337   &ikbd_rx,
1338   &ikbd_tx,
1339   NULL,
1340   NULL,
1341   NULL,
1342   acia_interrupt
1358   DEVCB_LINE(ikbd_rx),
1359   DEVCB_LINE(ikbd_tx),
1360   DEVCB_NULL,
1361   DEVCB_NULL,
1362   DEVCB_NULL,
1363   DEVCB_LINE(acia_interrupt)
13431364};
13441365
1345static const acia6850_interface acia_midi_intf =
1366static ACIA6850_INTERFACE( acia_midi_intf )
13461367{
13471368   Y2/64,
13481369   Y2/64,
1349   &acia_midi_rx,
1350   &acia_midi_tx,
1351   NULL,
1352   NULL,
1353   NULL,
1354   acia_interrupt
1370   DEVCB_LINE(midi_rx),
1371   DEVCB_LINE(midi_tx),
1372   DEVCB_NULL,
1373   DEVCB_NULL,
1374   DEVCB_NULL,
1375   DEVCB_LINE(acia_interrupt)
13551376};
13561377
13571378static IRQ_CALLBACK( atarist_int_ack )
r4241r4242
14281449
14291450static void atarist_configure_memory(running_machine *machine)
14301451{
1431   const address_space *program = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
1452   const address_space *program = cputag_get_address_space(machine, M68000_TAG, ADDRESS_SPACE_PROGRAM);
14321453   UINT8 *RAM = memory_region(machine, M68000_TAG);
14331454
14341455   switch (mess_ram_size)
r4241r4242
14861507   state_save_register_global(machine, state->ikbd_mouse_px);
14871508   state_save_register_global(machine, state->ikbd_mouse_py);
14881509   state_save_register_global(machine, state->ikbd_mouse_pc);
1489   state_save_register_global(machine, ikbd_rx);
1490   state_save_register_global(machine, ikbd_tx);
1510   state_save_register_global(machine, state->ikbd_rx);
1511   state_save_register_global(machine, state->ikbd_tx);
1512   state_save_register_global(machine, state->midi_rx);
1513   state_save_register_global(machine, state->midi_tx);
14911514   state_save_register_global(machine, state->acia_irq);
1492   state_save_register_global(machine, acia_midi_rx);
1493   state_save_register_global(machine, acia_midi_tx);
1494   state_save_register_global(machine, mfp_rx);
1495   state_save_register_global(machine, mfp_tx);
14961515}
14971516
14981517static MACHINE_START( atarist )
r4241r4242
15061525   centronics_config(machine, 0, atarist_centronics_config);
15071526
15081527   /* set CPU interrupt callback */
1509   cpu_set_irq_callback(machine->cpu[0], atarist_int_ack);
1528   cpu_set_irq_callback(cputag_get_cpu(machine, M68000_TAG), atarist_int_ack);
15101529
15111530   /* find devices */
15121531   state->mc68901 = devtag_get_device(machine, MC68901, MC68901_TAG);
1532    state->wd1772 = devtag_get_device(machine, WD1772, WD1772_TAG);
15131533
15141534   /* register for state saving */
15151535   atarist_state_save(machine);
r4241r4242
16011621   centronics_config(machine, 0, atarist_centronics_config);
16021622   
16031623   /* set CPU interrupt callback */
1604   cpu_set_irq_callback(machine->cpu[0], atarist_int_ack);
1624   cpu_set_irq_callback(cputag_get_cpu(machine, M68000_TAG), atarist_int_ack);
16051625
16061626   /* allocate timers */
16071627   state->dmasound_timer = timer_alloc(machine, atariste_dmasound_tick, NULL);
r4241r4242
16091629
16101630   /* find devices */
16111631   state->mc68901 = devtag_get_device(machine, MC68901, MC68901_TAG);
1632    state->wd1772 = devtag_get_device(machine, WD1772, WD1772_TAG);
16121633   state->lmc1992 = devtag_get_device(machine, LMC1992, LMC1992_TAG);
16131634
16141635   /* register for state saving */
r4241r4242
16261647
16271648static void stbook_configure_memory(running_machine *machine)
16281649{
1629   const address_space *program = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
1650   const address_space *program = cputag_get_address_space(machine, M68000_TAG, ADDRESS_SPACE_PROGRAM);
16301651   UINT8 *RAM = memory_region(machine, M68000_TAG);
16311652
16321653   switch (mess_ram_size)
r4241r4242
16551676
16561677static WRITE8_HANDLER( stbook_ym2149_port_a_w )
16571678{
1658   device_config *fdc = (device_config*)devtag_get_device(space->machine, WD1772, "wd1772");
1659   wd17xx_set_side(fdc,(data & 0x01) ? 0 : 1);
1679   atarist_state *state = space->machine->driver_data;
16601680
1681   wd17xx_set_side(state->wd1772, (data & 0x01) ? 0 : 1);
1682
16611683   if (!(data & 0x02))
16621684   {
1663      wd17xx_set_drive(fdc,0);
1685      wd17xx_set_drive(state->wd1772, 0);
16641686   }
16651687
16661688   if (!(data & 0x04))
16671689   {
1668      wd17xx_set_drive(fdc,1);
1690      wd17xx_set_drive(state->wd1772, 1);
16691691   }
16701692
16711693   // 0x08 = RTS
r4241r4242
16871709   ym2149_port_b_w
16881710};
16891711
1690static UINT8 krxd, ktxd;
1691
1692static const acia6850_interface stbook_acia_ikbd_intf =
1712static ACIA6850_INTERFACE( stbook_acia_ikbd_intf )
16931713{
16941714   U517/2/16, // 500kHz
16951715   U517/2/2, // 1MHZ
1696   &krxd,
1697   &ktxd,
1698   NULL,
1699   NULL,
1700   NULL,
1701   acia_interrupt
1716   DEVCB_LINE(ikbd_rx),
1717   DEVCB_LINE(ikbd_tx),
1718   DEVCB_NULL,
1719   DEVCB_NULL,
1720   DEVCB_NULL,
1721   DEVCB_LINE(acia_interrupt)
17021722};
17031723
1704#if 0
1705/* SVN 4235 - this code is no longer used */
17061724static READ8_DEVICE_HANDLER( stbook_mfp_gpio_r )
17071725{
17081726   /*
r4241r4242
17221740
17231741   atarist_state *state = device->machine->driver_data;
17241742
1725   UINT8 data = (centronics_read_handshake(device->machine,0) & CENTRONICS_NOT_BUSY) >> 7;
1743   UINT8 data = (centronics_read_handshake(device->machine, 0) & CENTRONICS_NOT_BUSY) >> 7;
17261744
17271745   data |= (state->acia_irq << 4);
17281746   data |= (state->fdc_irq << 5);
17291747
17301748   return data;
17311749}
1732#endif
17331750
17341751static MC68901_INTERFACE( stbook_mfp_intf )
17351752{
17361753   Y1,                                       /* timer clock */
17371754   0,                                       /* receive clock */
17381755   0,                                       /* transmit clock */
1739   DEVCB_DEVICE_HANDLER(MC68901, MC68901_TAG, mfp_gpio_r),   /* GPIO read */
1756   DEVCB_DEVICE_HANDLER(MC68901, MC68901_TAG, stbook_mfp_gpio_r),   /* GPIO read */
17401757   DEVCB_NULL,                                 /* GPIO write */
17411758   DEVCB_NULL,                                 /* serial input */
17421759   DEVCB_NULL,                                 /* serial output */
r4241r4242
17581775   centronics_config(machine, 0, atarist_centronics_config);
17591776
17601777   /* set CPU interrupt callback */
1761   cpu_set_irq_callback(machine->cpu[0], atarist_int_ack);
1778   cpu_set_irq_callback(cputag_get_cpu(machine, M68000_TAG), atarist_int_ack);
17621779
17631780   /* find devices */
17641781   state->mc68901 = devtag_get_device(machine, MC68901, MC68901_TAG);
1782    state->wd1772 = devtag_get_device(machine, WD1772, WD1772_TAG);
17651783
17661784   /* register for state saving */
17671785   atariste_state_save(machine);
1768   state_save_register_global(machine, krxd);
1769   state_save_register_global(machine, ktxd);
17701786}
17711787
17721788static DEVICE_IMAGE_LOAD( atarist_cart )
r4241r4242
18021818   MDRV_CPU_ADD(M68000_TAG, M68000, Y2/4)
18031819   MDRV_CPU_PROGRAM_MAP(st_map, 0)
18041820
1805   MDRV_CPU_ADD("keyboard", HD63701, XTAL_4MHz)  /* HD6301 */
1821   MDRV_CPU_ADD(HD6301_TAG, HD63701, XTAL_4MHz)  /* HD6301 */
18061822   MDRV_CPU_PROGRAM_MAP(ikbd_map, 0)
18071823   MDRV_CPU_IO_MAP(ikbd_io_map, 0)
18081824
r4241r4242
18341850   MDRV_ACIA6850_ADD("acia_0", acia_ikbd_intf)
18351851   MDRV_ACIA6850_ADD("acia_1", acia_midi_intf)
18361852   
1837   MDRV_WD1772_ADD("wd1772", atarist_wd17xx_interface )
1853   MDRV_WD1772_ADD(WD1772_TAG, atarist_wd17xx_interface )
18381854   
18391855   MDRV_IMPORT_FROM(atarist_cartslot)
18401856MACHINE_DRIVER_END
r4241r4242
18441860
18451861   MDRV_CPU_MODIFY(M68000_TAG)
18461862   MDRV_CPU_PROGRAM_MAP(megast_map, 0)
1847   MDRV_RP5C15_ADD("rp5c15",rtc_intf)
1863   MDRV_RP5C15_ADD("rp5c15", rtc_intf)
18481864
18491865   MDRV_MACHINE_START(megast)
18501866MACHINE_DRIVER_END
r4241r4242
18561872   MDRV_CPU_ADD(M68000_TAG, M68000, Y2/4)
18571873   MDRV_CPU_PROGRAM_MAP(ste_map, 0)
18581874
1859   MDRV_CPU_ADD("keyboard", HD63701, XTAL_4MHz)  /* HD6301 */
1875   MDRV_CPU_ADD(HD6301_TAG, HD63701, XTAL_4MHz)  /* HD6301 */
18601876   MDRV_CPU_PROGRAM_MAP(ikbd_map, 0)
18611877   MDRV_CPU_IO_MAP(ikbd_io_map, 0)
18621878
r4241r4242
18961912   MDRV_ACIA6850_ADD("acia_0", acia_ikbd_intf)
18971913   MDRV_ACIA6850_ADD("acia_1", acia_midi_intf)
18981914   
1899   MDRV_WD1772_ADD("wd1772", atarist_wd17xx_interface )
1915   MDRV_WD1772_ADD(WD1772_TAG, atarist_wd17xx_interface )
19001916   
19011917   MDRV_IMPORT_FROM(atarist_cartslot)
19021918MACHINE_DRIVER_END
r4241r4242
19061922
19071923   MDRV_CPU_MODIFY(M68000_TAG)
19081924   MDRV_CPU_PROGRAM_MAP(megaste_map, 0)
1909   MDRV_RP5C15_ADD("rp5c15",rtc_intf)
1925   MDRV_RP5C15_ADD("rp5c15", rtc_intf)
19101926
19111927   MDRV_MACHINE_START(megaste)
19121928MACHINE_DRIVER_END
r4241r4242
19171933   // basic machine hardware
19181934   MDRV_CPU_ADD(M68000_TAG, M68000, U517/2)
19191935   MDRV_CPU_PROGRAM_MAP(stbook_map, 0)
1920   MDRV_RP5C15_ADD("rp5c15",rtc_intf)
19211936
1922   //MDRV_CPU_ADD("cop888", COP888, Y700)
1937   //MDRV_CPU_ADD(COP888_TAG, COP888, Y700)
19231938
19241939   MDRV_MACHINE_START(stbook)
19251940
19261941   // device hardware
19271942   MDRV_MC68901_ADD(MC68901_TAG, U517/8, stbook_mfp_intf)
1943   MDRV_RP5C15_ADD("rp5c15", rtc_intf)
19281944   MDRV_SCC8530_ADD("scc")
19291945
19301946   // video hardware
r4241r4242
19411957
19421958   // sound hardware
19431959   MDRV_SPEAKER_STANDARD_MONO("mono")
1944   MDRV_SOUND_ADD("ym3439", YM3439, U517/8)
1960   MDRV_SOUND_ADD(YM3439_TAG, YM3439, U517/8)
19451961   MDRV_SOUND_CONFIG(stbook_ym2149_interface)
19461962   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
19471963
r4241r4242
19521968   MDRV_ACIA6850_ADD("acia_0", stbook_acia_ikbd_intf)
19531969   MDRV_ACIA6850_ADD("acia_1", acia_midi_intf)
19541970   
1955   MDRV_WD1772_ADD("wd1772", atarist_wd17xx_interface )
1971   MDRV_WD1772_ADD(WD1772_TAG, atarist_wd17xx_interface )
19561972   
19571973   MDRV_IMPORT_FROM(atarist_cartslot)
19581974MACHINE_DRIVER_END
r4241r4242
19791995
19801996   ROM_COPY( M68000_TAG, 0xfc0000, 0x000000, 0x000008 )
19811997
1982   ROM_REGION( 0x10000, "keyboard", 0 )
1998   ROM_REGION( 0x10000, HD6301_TAG, 0 )
19831999   ROM_LOAD( "keyboard.u1", 0xf000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
19842000ROM_END
19852001
r4241r4242
19912007   ROMX_LOAD( "tos102.img", 0xfc0000, 0x030000, BAD_DUMP CRC(3b5cd0c5) SHA1(87900a40a890fdf03bd08be6c60cc645855cbce5), ROM_BIOS(2) )
19922008   ROM_COPY( M68000_TAG, 0xfc0000, 0x000000, 0x000008 )
19932009
1994   ROM_REGION( 0x10000, "keyboard", 0 )
2010   ROM_REGION( 0x10000, HD6301_TAG, 0 )
19952011   ROM_LOAD( "keyboard.u1", 0xf000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
19962012ROM_END
19972013
r4241r4242
20012017   ROMX_LOAD( "tos104.img", 0xfc0000, 0x030000, BAD_DUMP CRC(a50d1d43) SHA1(9526ef63b9cb1d2a7109e278547ae78a5c1db6c6), ROM_BIOS(1) )
20022018   ROM_COPY( M68000_TAG, 0xfc0000, 0x000000, 0x000008 )
20032019
2004   ROM_REGION( 0x10000, "keyboard", 0 )
2020   ROM_REGION( 0x10000, HD6301_TAG, 0 )
20052021   ROM_LOAD( "keyboard.u1", 0xf000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
20062022ROM_END
20072023
r4241r4242
20132029   ROMX_LOAD( "tos106.img", 0xe00000, 0x040000, BAD_DUMP CRC(d72fea29) SHA1(06f9ea322e74b682df0396acfaee8cb4d9c90cad), ROM_BIOS(2) )
20142030   ROM_COPY( M68000_TAG, 0xe00000, 0x000000, 0x000008 )
20152031
2016   ROM_REGION( 0x10000, "keyboard", 0 )
2032   ROM_REGION( 0x10000, HD6301_TAG, 0 )
20172033   ROM_LOAD( "keyboard.u1", 0xf000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
20182034ROM_END
20192035
r4241r4242
20272043   ROMX_LOAD( "tos202.img", 0xe00000, 0x030000, NO_DUMP, ROM_BIOS(3) )
20282044   ROM_COPY( M68000_TAG, 0xe00000, 0x000000, 0x000008 )
20292045
2030   ROM_REGION( 0x10000, "keyboard", 0 )
2046   ROM_REGION( 0x10000, HD6301_TAG, 0 )
20312047   ROM_LOAD( "keyboard.u1", 0xf000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
20322048ROM_END
20332049
r4241r4242
20372053   ROMX_LOAD( "tos208.img", 0xe00000, 0x040000, NO_DUMP, ROM_BIOS(1) )
20382054   ROM_COPY( M68000_TAG, 0xe00000, 0x000000, 0x000008 )
20392055
2040   ROM_REGION( 0x10000, "cpu1", 0 )
2056   ROM_REGION( 0x10000, COP888_TAG, 0 )
20412057   ROM_LOAD( "cop888c0.u703", 0x0000, 0x1000, NO_DUMP )
20422058ROM_END
20432059
r4241r4242
20582074   ROMX_LOAD( "tos301.img", 0xe00000, 0x080000, NO_DUMP, ROM_BIOS(3) )
20592075   ROM_COPY( M68000_TAG, 0xe00000, 0x000000, 0x000008 )
20602076
2061   ROM_REGION( 0x10000, "keyboard", 0 )
2077   ROM_REGION( 0x10000, HD6301_TAG, 0 )
20622078   ROM_LOAD( "keyboard.u1", 0xf000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
20632079ROM_END
20642080
r4241r4242
20682084   ROMX_LOAD( "tos207.img", 0xe00000, 0x040000, NO_DUMP, ROM_BIOS(1) )
20692085   ROM_COPY( M68000_TAG, 0xe00000, 0x000000, 0x000008 )
20702086
2071   ROM_REGION( 0x10000, "keyboard", 0 )
2087   ROM_REGION( 0x10000, HD6301_TAG, 0 )
20722088   ROM_LOAD( "keyboard.u1", 0xf000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
20732089ROM_END
20742090
r4241r4242
20842100   ROMX_LOAD( "tos400.img", 0xe00000, 0x080000, BAD_DUMP CRC(1fbc5396) SHA1(d74d09f11a0bf37a86ccb50c6e7f91aac4d4b11b), ROM_BIOS(4) )
20852101   ROM_COPY( M68000_TAG, 0xe00000, 0x000000, 0x000008 )
20862102
2087   ROM_REGION( 0x10000, "keyboard", 0 )
2103   ROM_REGION( 0x10000, HD6301_TAG, 0 )
20882104   ROM_LOAD( "keyboard.u1", 0xf000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
20892105ROM_END
20902106
r4241r4242
22452261/* System Drivers */
22462262
22472263/*     YEAR  NAME    PARENT    COMPAT   MACHINE   INPUT     INIT    CONFIG   COMPANY    FULLNAME */
2248COMP( 1985, atarist,  0,        0,   atarist,  atarist,  0,     atarist,  "Atari", "ST", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
2249COMP( 1987, megast,   atarist,  0,   megast,   atarist,  0,     megast,   "Atari", "Mega ST", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE  )
2264COMP( 1985, atarist,  0,        0,      atarist,  atarist,  0,     atarist,  "Atari", "ST", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
2265COMP( 1987, megast,   atarist,  0,      megast,   atarist,  0,     megast,   "Atari", "Mega ST", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE  )
22502266/*
22512267COMP( 1989, stacy,    atarist,  0,      stacy,    stacy,    0,     stacy,    "Atari", "Stacy", GAME_NOT_WORKING )
22522268*/
22532269COMP( 1989, atariste, 0,      0,      atariste, atariste, 0,     atariste, "Atari", "STE", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE  )
2254COMP( 1990, stbook,   atariste, 0,   stbook,   stbook,   0,     stbook,    "Atari", "STBook", GAME_NOT_WORKING )
2255COMP( 1991, megaste,  atariste, 0,   megaste,  atarist,  0,     megaste,  "Atari", "Mega STE", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE  )
2270COMP( 1990, stbook,   atariste, 0,      stbook,   stbook,   0,     stbook,    "Atari", "STBook", GAME_NOT_WORKING )
2271COMP( 1991, megaste,  atariste, 0,      megaste,  atarist,  0,     megaste,  "Atari", "Mega STE", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE  )
22562272/*
22572273COMP( 1991, stpad,    atariste, 0,      stpad,    stpad,    0,     stpad,    "Atari", "STPad (prototype)", GAME_NOT_WORKING )
22582274COMP( 1990, tt030,    0,        0,      tt030,    tt030,    0,     tt030,    "Atari", "TT030", GAME_NOT_WORKING )
src/mess/drivers/osi.c
r4241r4242
186186#include "devices/basicdsk.h"
187187#include "devices/cassette.h"
188188
189static UINT8 cas_rx, cas_tx;
190static UINT8 fdc_rx, fdc_tx;
191
192189static const device_config *cassette_device_image(running_machine *machine)
193190{
194191   return devtag_get_device(machine, CASSETTE, "cassette");
r4241r4242
599596
600597/* Machine Start */
601598
602static const acia6850_interface osi600_acia_intf =
599static READ_LINE_DEVICE_HANDLER( cassette_rx )
603600{
601   const device_config *cassette = cassette_device_image(device->machine);
602
603   return (cassette_input(cassette) > 0.0) ? 1 : 0;
604}
605
606static WRITE_LINE_DEVICE_HANDLER( cassette_tx )
607{
608   const device_config *cassette = cassette_device_image(device->machine);
609
610   cassette_output(cassette, state ? +1.0 : -1.0);
611}
612
613static ACIA6850_INTERFACE( osi600_acia_intf )
614{
604615   X1/32,
605616   X1/32,
606   &cas_rx,
607   &cas_tx,
608   NULL,
609   NULL,
610   NULL,
611   NULL
617   DEVCB_LINE(cassette_rx),
618   DEVCB_LINE(cassette_tx),
619   DEVCB_NULL,
620   DEVCB_NULL,
621   DEVCB_NULL,
622   DEVCB_NULL
612623};
613624
614static const acia6850_interface uk101_acia_intf =
625static ACIA6850_INTERFACE( uk101_acia_intf )
615626{
616627   500000, //
617628   500000, //
618   &cas_rx,
619   &cas_tx,
620   NULL,
621   NULL,
622   NULL,
623   NULL
629   DEVCB_LINE(cassette_rx),
630   DEVCB_LINE(cassette_tx),
631   DEVCB_NULL,
632   DEVCB_NULL,
633   DEVCB_NULL,
634   DEVCB_NULL
624635};
625636
626static const acia6850_interface osi470_acia_intf =
637static ACIA6850_INTERFACE( osi470_acia_intf )
627638{
628639   0,            // clocked in from the floppy drive
629640   XTAL_4MHz/8,   // 250 kHz
630   &fdc_rx,
631   &fdc_tx,
632   NULL,
633   NULL,
634   NULL,
635   NULL
641   DEVCB_NULL,
642   DEVCB_NULL,
643   DEVCB_NULL,
644   DEVCB_NULL,
645   DEVCB_NULL,
646   DEVCB_NULL
636647};
637648
638static TIMER_DEVICE_CALLBACK( cassette_tick )
639{
640   const device_config *cassette = cassette_device_image(timer->machine);
641
642   cas_rx = (cassette_input(cassette) > 0.0) ? 1 : 0;
643   cassette_output(cassette, cas_tx ? +1.0 : -1.0);
644}
645
646649static MACHINE_START( osi600 )
647650{
648651   osi_state *state = machine->driver_data;
r4241r4242
735738   MDRV_ACIA6850_ADD("acia_0", osi600_acia_intf)
736739
737740   /* cassette */
738   MDRV_TIMER_ADD_PERIODIC("cassette", cassette_tick, HZ(4800))
739741   MDRV_CASSETTE_ADD("cassette", default_cassette_config)
740742MACHINE_DRIVER_END
741743
r4241r4242
755757   MDRV_ACIA6850_ADD("acia_0", uk101_acia_intf)
756758
757759   /* cassette */
758   MDRV_TIMER_ADD_PERIODIC("cassette", cassette_tick, HZ(4800))
759760   MDRV_CASSETTE_ADD("cassette", default_cassette_config)
760761MACHINE_DRIVER_END
761762
r4241r4242
783784   MDRV_ACIA6850_ADD("acia_0", osi600_acia_intf)
784785
785786   /* cassette */
786   MDRV_TIMER_ADD_PERIODIC("cassette", cassette_tick, HZ(4800))
787787   MDRV_CASSETTE_ADD("cassette", default_cassette_config)
788788MACHINE_DRIVER_END
789789
src/mess/drivers/bw2.c
r4241r4242
597597   bw2_state *state = machine->driver_data;
598598   device_config *fdc = (device_config*)devtag_get_device(machine, WD179X, "wd179x");
599599
600
601600   centronics_config(machine,0, bw2_centronics_config);
602601
603602   wd17xx_set_density(fdc,DEN_MFM_LO);
r4241r4242
820819   return state->video_ram[ma & 0x3fff];
821820}
822821
823static const msm6255_interface bw2_msm6255_intf =
822static MSM6255_INTERFACE( bw2_msm6255_intf )
824823{
825824   SCREEN_TAG,
826825   0,
src/mess/drivers/newbrain.c
r4241r4242
6060
6161*/
6262
63static UINT8 acia_rxd = 1, acia_txd = 1;
64
6563static const device_config *cassette_device_image(running_machine *machine, int index)
6664{
6765   if ( index )
r4241r4242
12661264
12671265/* Machine Initialization */
12681266
1269static void acia_interrupt(const device_config *device, int state)
1267static READ_LINE_DEVICE_HANDLER( acia_rx )
12701268{
12711269   newbrain_state *driver_state = device->machine->driver_data;
12721270
1271   return driver_state->acia_rxd;
1272}
1273
1274static WRITE_LINE_DEVICE_HANDLER( acia_tx )
1275{
1276   newbrain_state *driver_state = device->machine->driver_data;
1277
1278   driver_state->acia_txd = state;
1279}
1280
1281static WRITE_LINE_DEVICE_HANDLER( acia_interrupt )
1282{
1283   newbrain_state *driver_state = device->machine->driver_data;
1284
12731285   driver_state->aciaint = state;
12741286}
12751287
1276static const acia6850_interface newbrain_acia_intf =
1288static ACIA6850_INTERFACE( newbrain_acia_intf )
12771289{
12781290   0,
12791291   0,
1280   &acia_rxd,
1281   &acia_txd,
1282   NULL,
1283   NULL,
1284   NULL,
1285   acia_interrupt
1292   DEVCB_LINE(acia_rx),
1293   DEVCB_LINE(acia_tx),
1294   DEVCB_NULL,
1295   DEVCB_NULL,
1296   DEVCB_NULL,
1297   DEVCB_LINE(acia_interrupt)
12861298};
12871299
12881300static NEC765_INTERRUPT( newbrain_fdc_interrupt )
r4241r4242
13051317   newbrain_state *state = device->machine->driver_data;
13061318
13071319   /* connected to the ACIA receive clock */
1308   if (data) acia_rx_clock_in(state->mc6850);
1320   if (data) acia6850_rx_clock_in(state->mc6850);
13091321}
13101322
13111323static WRITE8_DEVICE_HANDLER( ctc_z1_w )
r4241r4242
13131325   newbrain_state *state = device->machine->driver_data;
13141326
13151327   /* connected to the ACIA transmit clock */
1316   if (data) acia_tx_clock_in(state->mc6850);
1328   if (data) acia6850_tx_clock_in(state->mc6850);
13171329}
13181330
13191331static WRITE8_DEVICE_HANDLER( ctc_z2_w )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team