Previous 15994 Revisions Next

r4235 Thursday 5th February, 2009 at 16:21:28 UTC by Curt Coder
[MC68901] Refactored to use devcb.
[docs]messnew.txt
[src/mess/drivers]atarist.c x68k.c
[src/mess/includes]atarist.h
[src/mess/machine]68901mfp.c 68901mfp.h

src/mess/includes/atarist.h
r4234r4235
22#define __ATARI_ST__
33
44#define SCREEN_TAG   "main"
5#define M68000_TAG   "m68000"
56#define MC68901_TAG   "mc68901"
67#define LMC1992_TAG "lmc1992"
78
src/mess/machine/68901mfp.c
r4234r4235
22
33   TODO:
44
5   - poll TAI/TBI pins
65   - daisy chaining
76   - correct gpio_timer period
87   - disable GPIO3/4 interrupts when timer A/B in pulse mode
r4234r4235
3635#include "68901mfp.h"
3736#include "cpu/m68000/m68000.h"
3837
38/***************************************************************************
39    PARAMETERS
40***************************************************************************/
41
42#define LOG      (0)
43
3944enum
4045{
4146   MC68901_REGISTER_GPIP = 0,
r4234r4235
205210#define MC68901_TSR_UNDERRUN_ERROR      0x40
206211#define MC68901_TSR_BUFFER_EMPTY      0x80
207212
208#define LOG      (0)
209
210213static const int MC68901_INT_MASK_GPIO[] =
211214{
212215   MC68901_IR_GPIP_0, MC68901_IR_GPIP_1, MC68901_IR_GPIP_2, MC68901_IR_GPIP_3,
r4234r4235
218221   MC68901_IR_TIMER_A, MC68901_IR_TIMER_B, MC68901_IR_TIMER_C, MC68901_IR_TIMER_D
219222};
220223
221static const int MC68901_LOOPBACK_TIMER[] =
222{
223   MC68901_TAO_LOOPBACK, MC68901_TBO_LOOPBACK, MC68901_TCO_LOOPBACK, MC68901_TDO_LOOPBACK
224};
225
226224static const int MC68901_GPIO_TIMER[] =
227225{
228226   MC68901_GPIP_4, MC68901_GPIP_3
r4234r4235
230228
231229static const int PRESCALER[] = { 0, 4, 10, 16, 50, 64, 100, 200 };
232230
231#define TXD(_data) devcb_call_write_line(&mc68901->out_so_func, _data);
232
233/***************************************************************************
234    TYPE DEFINITIONS
235***************************************************************************/
236
233237typedef struct _mc68901_t mc68901_t;
234238struct _mc68901_t
235239{
240   devcb_resolved_read8      in_gpio_func;
241   devcb_resolved_write8      out_gpio_func;
242   devcb_resolved_read_line   in_si_func;
243   devcb_resolved_write_line   out_so_func;
244   devcb_resolved_write_line   out_tao_func;
245   devcb_resolved_write_line   out_tbo_func;
246   devcb_resolved_write_line   out_tco_func;
247   devcb_resolved_write_line   out_tdo_func;
248   devcb_resolved_write_line   out_irq_func;
249
236250   int device_type;               /* device type */
237   const mc68901_interface *intf;      /* interface */
251   int timer_clock;               /* timer clock */
238252
239253   /* registers */
240254   UINT8 gpip;                     /* general purpose I/O register */
r4234r4235
288302
289303   /* timers */
290304   emu_timer *timer[MC68901_MAX_TIMERS]; /* counter timers */
291
292305   emu_timer *rx_timer;            /* receive timer */
293306   emu_timer *tx_timer;            /* transmit timer */
294
295307   emu_timer *poll_timer;            /* general purpose I/O poll timer */
296308};
297309
310/***************************************************************************
311    INLINE FUNCTIONS
312***************************************************************************/
313
298314INLINE mc68901_t *get_safe_token(const device_config *device)
299315{
300316   assert(device != NULL);
301317   assert(device->token != NULL);
302
303318   return (mc68901_t *)device->token;
304319}
305320
306static void mc68901_check_interrupts(const device_config *device)
321INLINE const mc68901_interface *get_interface(const device_config *device)
307322{
323   assert(device != NULL);
324   assert(device->type == MC68901);
325   return (const mc68901_interface *) device->static_config;
326}
327
328/***************************************************************************
329    IMPLEMENTATION
330***************************************************************************/
331
332/*-------------------------------------------------
333    check_interrupts - set the interrupt request
334   line state
335-------------------------------------------------*/
336
337static void check_interrupts(const device_config *device)
338{
308339   mc68901_t *mc68901 = get_safe_token(device);
309340
310341   if (mc68901->ipr & mc68901->imr)
311342   {
312      mc68901->intf->on_irq_changed(device, HOLD_LINE);
343      devcb_call_write_line(&mc68901->out_irq_func, ASSERT_LINE);
313344   }
314345   else
315346   {
316      mc68901->intf->on_irq_changed(device, CLEAR_LINE);
347      devcb_call_write_line(&mc68901->out_irq_func, CLEAR_LINE);
317348   }
318349}
319350
320static void mc68901_interrupt(const device_config *device, UINT16 mask)
351/*-------------------------------------------------
352    take_interrupt - mark an interrupt pending
353-------------------------------------------------*/
354
355static void take_interrupt(const device_config *device, UINT16 mask)
321356{
322357   mc68901_t *mc68901 = get_safe_token(device);
323358
324359   mc68901->ipr |= mask;
325360
326   mc68901_check_interrupts(device);
361   check_interrupts(device);
327362}
328363
329static TIMER_CALLBACK( mc68901_gpio_poll_tick )
364/*-------------------------------------------------
365    TIMER_CALLBACK( gpio_poll_tick )
366-------------------------------------------------*/
367
368static TIMER_CALLBACK( gpio_poll_tick )
330369{
331370   const device_config *device = ptr;
332371   mc68901_t *mc68901 = get_safe_token(device);
333372
334   UINT8 gpio = mc68901->intf->gpio_r(device);
373   UINT8 gpio = devcb_call_read8(&mc68901->in_gpio_func, 0);
335374
336375   UINT8 gpold = (mc68901->gpip & ~mc68901->ddr) ^ mc68901->aer;
337376   UINT8 gpnew = (gpio & ~mc68901->ddr) ^ mc68901->aer;
r4234r4235
348387         {
349388            if (LOG) logerror("MC68901 Interrupt Pending for GPIO%u\n", bit);
350389
351            mc68901_interrupt(device, MC68901_INT_MASK_GPIO[bit]); // set interrupt pending bit
390            take_interrupt(device, MC68901_INT_MASK_GPIO[bit]); // set interrupt pending bit
352391         }
353392      }
354393   }
r4234r4235
356395   mc68901->gpip = (gpio & ~mc68901->ddr) | (mc68901->gpip & mc68901->ddr);
357396}
358397
359/* USART */
398/*-------------------------------------------------
399    rx_buffer_full - signal receive buffer full
400   interrupt
401-------------------------------------------------*/
360402
361static void mc68901_rx_buffer_full(const device_config *device)
403static void rx_buffer_full(const device_config *device)
362404{
363405   mc68901_t *mc68901 = get_safe_token(device);
364406
365407   if (mc68901->ier & MC68901_IR_RCV_BUFFER_FULL)
366408   {
367      mc68901_interrupt(device, MC68901_IR_RCV_BUFFER_FULL);
409      take_interrupt(device, MC68901_IR_RCV_BUFFER_FULL);
368410   }
369411}
370412
371static void mc68901_rx_error(const device_config *device)
413/*-------------------------------------------------
414    rx_error - signal receive error interrupt
415-------------------------------------------------*/
416
417static void rx_error(const device_config *device)
372418{
373419   mc68901_t *mc68901 = get_safe_token(device);
374420
375421   if (mc68901->ier & MC68901_IR_RCV_ERROR)
376422   {
377      mc68901_interrupt(device, MC68901_IR_RCV_ERROR);
423      take_interrupt(device, MC68901_IR_RCV_ERROR);
378424   }
379425   else
380426   {
381      mc68901_rx_buffer_full(device);
427      rx_buffer_full(device);
382428   }
383429}
384430
385static void mc68901_tx_buffer_empty(const device_config *device)
431/*-------------------------------------------------
432    tx_buffer_empty - signal transmit buffer
433   empty interrupt
434-------------------------------------------------*/
435
436static void tx_buffer_empty(const device_config *device)
386437{
387438   mc68901_t *mc68901 = get_safe_token(device);
388439
389440   if (mc68901->ier & MC68901_IR_XMIT_BUFFER_EMPTY)
390441   {
391      mc68901_interrupt(device, MC68901_IR_XMIT_BUFFER_EMPTY);
442      take_interrupt(device, MC68901_IR_XMIT_BUFFER_EMPTY);
392443   }
393444}
394445
395static void mc68901_tx_error(const device_config *device)
446/*-------------------------------------------------
447    tx_error - signal transmit error interrupt
448-------------------------------------------------*/
449
450static void tx_error(const device_config *device)
396451{
397452   mc68901_t *mc68901 = get_safe_token(device);
398453
399454   if (mc68901->ier & MC68901_IR_XMIT_ERROR)
400455   {
401      mc68901_interrupt(device, MC68901_IR_XMIT_ERROR);
456      take_interrupt(device, MC68901_IR_XMIT_ERROR);
402457   }
403458   else
404459   {
405      mc68901_tx_buffer_empty(device);
460      tx_buffer_empty(device);
406461   }
407462}
408463
409static int mc68901_parity(UINT8 b)
464/*-------------------------------------------------
465    get_parity_bit - calculate parity bit
466-------------------------------------------------*/
467
468static int get_parity_bit(UINT8 b)
410469{
411470   b ^= b >> 4;
412471   b ^= b >> 2;
r4234r4235
414473   return b & 1;
415474}
416475
417static void mc68901_serial_rx(const device_config *device)
476/*-------------------------------------------------
477    serial_receive - receive serial bit
478-------------------------------------------------*/
479
480static void serial_receive(const device_config *device)
418481{
419482   mc68901_t *mc68901 = get_safe_token(device);
483   int rxd;
420484
421   if (mc68901->rsr & MC68901_RSR_RCV_ENABLE)
485   if (!(mc68901->rsr & MC68901_RSR_RCV_ENABLE)) return;
486
487   rxd = devcb_call_read_line(&mc68901->in_si_func);
488
489   switch (mc68901->rx_state)
422490   {
423      switch (mc68901->rx_state)
491   case MC68901_SERIAL_START:
492      if (!rxd)
424493      {
425      case MC68901_SERIAL_START:
426         if (mc68901->intf->rx_pin == 0)
427         {
428            mc68901->rsr |= MC68901_RSR_CHAR_IN_PROGRESS;
429            mc68901->rx_bits = 0;
430            mc68901->rx_buffer = 0;
431            mc68901->rx_state = MC68901_SERIAL_DATA;
432            mc68901->next_rsr = MC68901_RSR_BREAK;
433         }
434         break;
494         mc68901->rsr |= MC68901_RSR_CHAR_IN_PROGRESS;
495         mc68901->rx_bits = 0;
496         mc68901->rx_buffer = 0;
497         mc68901->rx_state = MC68901_SERIAL_DATA;
498         mc68901->next_rsr = MC68901_RSR_BREAK;
499      }
500      break;
435501
436      case MC68901_SERIAL_DATA:
437         if ((mc68901->next_rsr & MC68901_RSR_BREAK) && (*mc68901->intf->rx_pin == 1) && mc68901->rsr_read)
438         {
439            mc68901->next_rsr &= ~MC68901_RSR_BREAK;
440         }
502   case MC68901_SERIAL_DATA:
503      if ((mc68901->next_rsr & MC68901_RSR_BREAK) && (rxd == 1) && mc68901->rsr_read)
504      {
505         mc68901->next_rsr &= ~MC68901_RSR_BREAK;
506      }
441507
442         mc68901->rx_buffer >>= 1;
443         mc68901->rx_buffer |= (*mc68901->intf->rx_pin << 7);
444         mc68901->rx_bits++;
508      mc68901->rx_buffer >>= 1;
509      mc68901->rx_buffer |= (rxd << 7);
510      mc68901->rx_bits++;
445511
446         if (mc68901->rx_bits == mc68901->rxtx_word)
512      if (mc68901->rx_bits == mc68901->rxtx_word)
513      {
514         if (mc68901->rxtx_word < 8)
447515         {
448            if (mc68901->rxtx_word < 8)
449            {
450               mc68901->rx_buffer >>= (8 - mc68901->rxtx_word);
451            }
452
453            mc68901->rsr &= ~MC68901_RSR_CHAR_IN_PROGRESS;
454
455            if (mc68901->ucr & MC68901_UCR_PARITY_ENABLED)
456            {
457               mc68901->rx_state = MC68901_SERIAL_PARITY;
458            }
459            else
460            {
461               mc68901->rx_state = MC68901_SERIAL_STOP;
462            }
516            mc68901->rx_buffer >>= (8 - mc68901->rxtx_word);
463517         }
464         break;
465518
466      case MC68901_SERIAL_PARITY:
467         mc68901->rx_parity = *mc68901->intf->rx_pin;
519         mc68901->rsr &= ~MC68901_RSR_CHAR_IN_PROGRESS;
468520
469         if (mc68901->rx_parity != (mc68901_parity(mc68901->rx_buffer) ^ ((mc68901->ucr & MC68901_UCR_PARITY_EVEN) >> 1)))
521         if (mc68901->ucr & MC68901_UCR_PARITY_ENABLED)
470522         {
471            mc68901->next_rsr |= MC68901_RSR_PARITY_ERROR;
523            mc68901->rx_state = MC68901_SERIAL_PARITY;
472524         }
525         else
526         {
527            mc68901->rx_state = MC68901_SERIAL_STOP;
528         }
529      }
530      break;
473531
474         mc68901->rx_state = MC68901_SERIAL_STOP;
475         break;
532   case MC68901_SERIAL_PARITY:
533      mc68901->rx_parity = rxd;
476534
477      case MC68901_SERIAL_STOP:
478         if (*mc68901->intf->rx_pin == 1)
535      if (mc68901->rx_parity != (get_parity_bit(mc68901->rx_buffer) ^ ((mc68901->ucr & MC68901_UCR_PARITY_EVEN) >> 1)))
536      {
537         mc68901->next_rsr |= MC68901_RSR_PARITY_ERROR;
538      }
539
540      mc68901->rx_state = MC68901_SERIAL_STOP;
541      break;
542
543   case MC68901_SERIAL_STOP:
544      if (rxd == 1)
545      {
546         if (!((mc68901->rsr & MC68901_RSR_SYNC_STRIP_ENABLE) && (mc68901->rx_buffer == mc68901->scr)))
479547         {
480            if (!((mc68901->rsr & MC68901_RSR_SYNC_STRIP_ENABLE) && (mc68901->rx_buffer == mc68901->scr)))
548            if (!(mc68901->rsr & MC68901_RSR_OVERRUN_ERROR))
481549            {
482               if (!(mc68901->rsr & MC68901_RSR_OVERRUN_ERROR))
550               if (mc68901->rsr & MC68901_RSR_BUFFER_FULL)
483551               {
484                  if (mc68901->rsr & MC68901_RSR_BUFFER_FULL)
485                  {
486                     // incoming word received but last word in receive buffer has not been read
487                     mc68901->next_rsr |= MC68901_RSR_OVERRUN_ERROR;
488                  }
489                  else
490                  {
491                     // incoming word received and receive buffer is empty
492                     mc68901->rsr |= MC68901_RSR_BUFFER_FULL;
493                     mc68901->udr = mc68901->rx_buffer;
494                     mc68901_rx_buffer_full(device);
495                  }
552                  // incoming word received but last word in receive buffer has not been read
553                  mc68901->next_rsr |= MC68901_RSR_OVERRUN_ERROR;
496554               }
555               else
556               {
557                  // incoming word received and receive buffer is empty
558                  mc68901->rsr |= MC68901_RSR_BUFFER_FULL;
559                  mc68901->udr = mc68901->rx_buffer;
560                  rx_buffer_full(device);
561               }
497562            }
498563         }
499         else
564      }
565      else
566      {
567         if (mc68901->rx_buffer)
500568         {
501            if (mc68901->rx_buffer)
502            {
503               // non-zero data word not followed by a stop bit
504               mc68901->next_rsr |= MC68901_RSR_FRAME_ERROR;
505            }
569            // non-zero data word not followed by a stop bit
570            mc68901->next_rsr |= MC68901_RSR_FRAME_ERROR;
506571         }
572      }
507573
508         mc68901->rx_state = MC68901_SERIAL_START;
509         break;
510      }
574      mc68901->rx_state = MC68901_SERIAL_START;
575      break;
511576   }
512577}
513578
579/*-------------------------------------------------
580    TIMER_CALLBACK( rx_tick )
581-------------------------------------------------*/
582
514583static TIMER_CALLBACK( rx_tick )
515584{
516585   const device_config *device = ptr;
517586
518   mc68901_serial_rx(device);
587   serial_receive(device);
519588}
520589
521static void mc68901_transmit_disabled(const device_config *device)
590/*-------------------------------------------------
591    tx_disabled - transmitter disabled handler
592-------------------------------------------------*/
593
594static void tx_disabled(const device_config *device)
522595{
523596   mc68901_t *mc68901 = get_safe_token(device);
524597
525598   switch (mc68901->tsr & MC68901_TSR_OUTPUT_MASK)
526599   {
527600   case MC68901_TSR_OUTPUT_HI_Z:
528      // indeterminate
601      /* indeterminate state */
529602   case MC68901_TSR_OUTPUT_LOW:
530      *mc68901->intf->tx_pin = 0;
603      TXD(0);
531604      break;
532605
533606   case MC68901_TSR_OUTPUT_HIGH:
534607   case MC68901_TSR_OUTPUT_LOOP:
535      *mc68901->intf->tx_pin = 1;
608      TXD(1);
536609      break;
537610   }
538611}
539612
540static void mc68901_transmit(const device_config *device)
613/*-------------------------------------------------
614    tx_starting - transmitter starting handler
615-------------------------------------------------*/
616
617static void tx_starting(const device_config *device)
541618{
542619   mc68901_t *mc68901 = get_safe_token(device);
543620
621   if (mc68901->tsr & MC68901_TSR_XMIT_ENABLE)
622   {
623      /* enable transmitter */
624      TXD(1);
625      mc68901->xmit_state = MC68901_XMIT_ON;
626   }
627   else
628   {
629      /* disable transmitter */
630      mc68901->tsr |= MC68901_TSR_END_OF_XMIT;
631      mc68901->xmit_state = MC68901_XMIT_OFF;
632   }
633}
634
635/*-------------------------------------------------
636    tx_break - transmit break handler
637-------------------------------------------------*/
638
639static void tx_break(const device_config *device)
640{
641   mc68901_t *mc68901 = get_safe_token(device);
642   
643   if (mc68901->tsr & MC68901_TSR_XMIT_ENABLE)
644   {
645      if (mc68901->tsr & MC68901_TSR_BREAK)
646      {
647         /* transmit break */
648         TXD(1);
649      }
650      else
651      {
652         /* enable transmitter */
653         mc68901->xmit_state = MC68901_XMIT_ON;
654      }
655   }
656   else
657   {
658      /* disable transmitter */
659      mc68901->tsr |= MC68901_TSR_END_OF_XMIT;
660      mc68901->xmit_state = MC68901_XMIT_OFF;
661   }
662}
663
664/*-------------------------------------------------
665    tx_enabled - transmitter enabled handler
666-------------------------------------------------*/
667
668static void tx_enabled(const device_config *device)
669{
670   mc68901_t *mc68901 = get_safe_token(device);
671
544672   switch (mc68901->tx_state)
545673   {
546674   case MC68901_SERIAL_START:
547675      if (mc68901->tsr & MC68901_TSR_UNDERRUN_ERROR)
548676      {
677         /* buffer underrun condition */
549678         if (mc68901->tsr & MC68901_TSR_XMIT_ENABLE)
550679         {
551            *mc68901->intf->tx_pin = 1;
680            /* transmit break */
681            TXD(1);
552682         }
553683         else
554684         {
555            mc68901_transmit_disabled(device);
685            /* transmitter disabled */
686            tx_disabled(device);
556687         }
557688      }
558689      else
559690      {
560691         if (mc68901->tsr & MC68901_TSR_BUFFER_EMPTY)
561692         {
693            /* transmit buffer is empty, signal underrun error */
562694            mc68901->tsr |= MC68901_TSR_UNDERRUN_ERROR;
563695
564696            if (mc68901->tsr & MC68901_TSR_XMIT_ENABLE)
565697            {
566               *mc68901->intf->tx_pin = 1;
698               /* transmit break */
699               TXD(1);
567700            }
568701            else
569702            {
570               mc68901_transmit_disabled(device);
703               /* transmitter disabled */
704               tx_disabled(device);
571705            }
572706         }
573707         else
574708         {
575            *mc68901->intf->tx_pin = 0;
709            /* transmit start bit */
710            TXD(0);
711           
712            /* load transmit buffer */
576713            mc68901->tx_buffer = mc68901->udr;
577714            mc68901->tx_bits = 0;
715
716            /* signal transmit buffer empty */
717            mc68901->tsr |= MC68901_TSR_BUFFER_EMPTY;
718            tx_buffer_empty(device);
719
720            /* calculate parity */
721            mc68901->tx_parity = get_parity_bit(mc68901->tx_buffer);
722
723            /* next bit is data */
578724            mc68901->tx_state = MC68901_SERIAL_DATA;
579            mc68901->tsr |= MC68901_TSR_BUFFER_EMPTY;
580            mc68901_tx_buffer_empty(device);
581            mc68901->tx_parity = mc68901_parity(mc68901->tx_buffer);
582725         }
583726      }
584727      break;
585728
586729   case MC68901_SERIAL_DATA:
587      *mc68901->intf->tx_pin = mc68901->tx_buffer & 0x01;
730      /* transmit data bit */
731      TXD(mc68901->tx_buffer & 0x01);
732
733      /* shift transmit buffer */
588734      mc68901->tx_buffer >>= 1;
589735      mc68901->tx_bits++;
590736
591737      if (mc68901->tx_bits == mc68901->rxtx_word)
592738      {
739         /* all data bits transferred */
593740         if (mc68901->ucr & MC68901_UCR_PARITY_ENABLED)
594741         {
742            /* next bit is parity */
595743            mc68901->tx_state = MC68901_SERIAL_PARITY;
596744         }
597745         else
598746         {
747            /* next bit is stop */
599748            mc68901->tx_state = MC68901_SERIAL_STOP;
600749         }
601750      }
r4234r4235
604753   case MC68901_SERIAL_PARITY:
605754      if (mc68901->rxtx_word < 8)
606755      {
607         // highest bit in buffer is user-specified parity bit
608
609         *mc68901->intf->tx_pin = mc68901->tx_buffer & 0x01;
756         /* transmit user-defined parity bit from buffer */
757         TXD(mc68901->tx_buffer & 0x01);
610758      }
611759      else
612760      {
613         // use previously calculated parity
614
615         *mc68901->intf->tx_pin = mc68901->tx_parity ^ ((mc68901->ucr & MC68901_UCR_PARITY_EVEN) >> 1);
761         /* transmit calculated parity bit */
762         TXD(mc68901->tx_parity ^ ((mc68901->ucr & MC68901_UCR_PARITY_EVEN) >> 1));
616763      }
617764
765      /* next bit is stop */
618766      mc68901->tx_state = MC68901_SERIAL_STOP;
619767      break;
620768
621769   case MC68901_SERIAL_STOP:
622      *mc68901->intf->tx_pin = 1;
770      /* transmit stop bit */
771      TXD(1);
623772
624773      if (mc68901->tsr & MC68901_TSR_XMIT_ENABLE)
625774      {
775         /* next bit is start */
626776         mc68901->tx_state = MC68901_SERIAL_START;
627777      }
628778      else
629779      {
630780         if (mc68901->tsr & MC68901_TSR_AUTO_TURNAROUND)
631781         {
782            /* enable transmitter */
632783            mc68901->tsr |= MC68901_TSR_XMIT_ENABLE;
784
785            /* next bit is start */
633786            mc68901->tx_state = MC68901_SERIAL_START;
634787         }
635788         else
636789         {
790            /* disable transmitter */
637791            mc68901->xmit_state = MC68901_XMIT_OFF;
638792            mc68901->tsr |= MC68901_TSR_END_OF_XMIT;
639            mc68901_tx_error(device);
793
794            /* signal transmit error */
795            tx_error(device);
640796         }
641797      }
642798      break;
643799   }
644800}
645801
646static void mc68901_serial_tx(const device_config *device)
802/*-------------------------------------------------
803    serial_transmit - transmit serial bit
804-------------------------------------------------*/
805
806static void serial_transmit(const device_config *device)
647807{
648808   mc68901_t *mc68901 = get_safe_token(device);
649809
650810   switch (mc68901->xmit_state)
651811   {
652   case MC68901_XMIT_OFF:
653      mc68901_transmit_disabled(device);
654      break;
655
656   case MC68901_XMIT_STARTING:
657      if (mc68901->tsr & MC68901_TSR_XMIT_ENABLE)
658      {
659         *mc68901->intf->tx_pin = 1;
660         mc68901->xmit_state = MC68901_XMIT_ON;
661      }
662      else
663      {
664         mc68901->xmit_state = MC68901_XMIT_OFF;
665         mc68901->tsr |= MC68901_TSR_END_OF_XMIT;
666      }
667      break;
668
669   case MC68901_XMIT_BREAK:
670      if (mc68901->tsr & MC68901_TSR_XMIT_ENABLE)
671      {
672         if (mc68901->tsr & MC68901_TSR_BREAK)
673         {
674            *mc68901->intf->tx_pin = 1;
675         }
676         else
677         {
678            mc68901->xmit_state = MC68901_XMIT_ON;
679         }
680      }
681      else
682      {
683         mc68901->xmit_state = MC68901_XMIT_OFF;
684         mc68901->tsr |= MC68901_TSR_END_OF_XMIT;
685      }
686      break;
687
688   case MC68901_XMIT_ON:
689      mc68901_transmit(device);
690      break;
812   case MC68901_XMIT_OFF:      tx_disabled(device);   break;
813   case MC68901_XMIT_STARTING:   tx_starting(device);   break;
814   case MC68901_XMIT_BREAK:   tx_break(device);      break;
815   case MC68901_XMIT_ON:      tx_enabled(device);      break;
691816   }
692817}
693818
819/*-------------------------------------------------
820    TIMER_CALLBACK( tx_tick )
821-------------------------------------------------*/
822
694823static TIMER_CALLBACK( tx_tick )
695824{
696825   const device_config *device = ptr;
697826
698   mc68901_serial_tx(device);
827   serial_transmit(device);
699828}
700829
701/* Register Access */
830/*-------------------------------------------------
831    mc68901_register_r - register read
832-------------------------------------------------*/
702833
703834READ8_DEVICE_HANDLER( mc68901_register_r )
704835{
r4234r4235
738869
739870   case MC68901_REGISTER_TSR:
740871      {
741         // clear UE bit (in reality, this won't be cleared until one full clock cycle of the transmitter has passed since the bit was set)
742
872         /* clear UE bit (in reality, this won't be cleared until one full clock cycle of the transmitter has passed since the bit was set) */
743873         UINT8 tsr = mc68901->tsr;
744874         mc68901->tsr &= 0xbf;
745875
r4234r4235
747877      }
748878
749879   case MC68901_REGISTER_UDR:
750      // load RSR with latched value
751
880      /* load RSR with latched value */
752881      mc68901->rsr = (mc68901->next_rsr & 0x7c) | (mc68901->rsr & 0x03);
753882      mc68901->next_rsr = 0;
754883
755      // signal receiver error interrupt
756
757884      if (mc68901->rsr & 0x78)
758885      {
759         mc68901_rx_error(device);
886         /* signal receiver error interrupt */
887         rx_error(device);
760888      }
761889
762890      return mc68901->udr;
r4234r4235
765893   }
766894}
767895
896/*-------------------------------------------------
897    mc68901_register_w - register write
898-------------------------------------------------*/
899
768900#define DIVISOR PRESCALER[data & 0x07]
769901
770902WRITE8_DEVICE_HANDLER( mc68901_register_w )
r4234r4235
777909      if (LOG) logerror("MC68901 General Purpose I/O : %x\n", data);
778910      mc68901->gpip = data & mc68901->ddr;
779911
780      if (mc68901->intf->gpio_w)
781      {
782         mc68901->intf->gpio_w(device, mc68901->gpip);
783      }
912      devcb_call_write8(&mc68901->out_gpio_func, 0, mc68901->gpip);
784913      break;
785914
786915   case MC68901_REGISTER_AER:
r4234r4235
797926      if (LOG) logerror("MC68901 Interrupt Enable Register A : %x\n", data);
798927      mc68901->ier = (data << 8) | (mc68901->ier & 0xff);
799928      mc68901->ipr &= mc68901->ier;
800      mc68901_check_interrupts(device);
929      check_interrupts(device);
801930      break;
802931
803932   case MC68901_REGISTER_IERB:
804933      if (LOG) logerror("MC68901 Interrupt Enable Register B : %x\n", data);
805934      mc68901->ier = (mc68901->ier & 0xff00) | data;
806935      mc68901->ipr &= mc68901->ier;
807      mc68901_check_interrupts(device);
936      check_interrupts(device);
808937      break;
809938
810939   case MC68901_REGISTER_IPRA:
811940      if (LOG) logerror("MC68901 Interrupt Pending Register A : %x\n", data);
812941      mc68901->ipr &= (data << 8) | (mc68901->ipr & 0xff);
813      mc68901_check_interrupts(device);
942      check_interrupts(device);
814943      break;
815944
816945   case MC68901_REGISTER_IPRB:
817946      if (LOG) logerror("MC68901 Interrupt Pending Register B : %x\n", data);
818947      mc68901->ipr &= (mc68901->ipr & 0xff00) | data;
819      mc68901_check_interrupts(device);
948      check_interrupts(device);
820949      break;
821950
822951   case MC68901_REGISTER_ISRA:
r4234r4235
833962      if (LOG) logerror("MC68901 Interrupt Mask Register A : %x\n", data);
834963      mc68901->imr = (data << 8) | (mc68901->imr & 0xff);
835964      mc68901->isr &= mc68901->imr;
836      mc68901_check_interrupts(device);
965      check_interrupts(device);
837966      break;
838967
839968   case MC68901_REGISTER_IMRB:
840969      if (LOG) logerror("MC68901 Interrupt Mask Register B : %x\n", data);
841970      mc68901->imr = (mc68901->imr & 0xff00) | data;
842971      mc68901->isr &= mc68901->imr;
843      mc68901_check_interrupts(device);
972      check_interrupts(device);
844973      break;
845974
846975   case MC68901_REGISTER_VR:
r4234r4235
8801009         {
8811010         int divisor = PRESCALER[mc68901->tacr & 0x07];
8821011         if (LOG) logerror("MC68901 Timer A Delay Mode : %u Prescale\n", divisor);
883         timer_adjust_periodic(mc68901->timer[MC68901_TIMER_A], ATTOTIME_IN_HZ(mc68901->intf->timer_clock / divisor), 0, ATTOTIME_IN_HZ(mc68901->intf->timer_clock / divisor));
1012         timer_adjust_periodic(mc68901->timer[MC68901_TIMER_A], ATTOTIME_IN_HZ(mc68901->timer_clock / divisor), 0, ATTOTIME_IN_HZ(mc68901->timer_clock / divisor));
8841013         }
8851014         break;
8861015
r4234r4235
8991028         {
9001029         int divisor = PRESCALER[mc68901->tacr & 0x07];
9011030         if (LOG) logerror("MC68901 Timer A Pulse Width Mode : %u Prescale\n", divisor);
902         timer_adjust_periodic(mc68901->timer[MC68901_TIMER_A], attotime_never, 0, ATTOTIME_IN_HZ(mc68901->intf->timer_clock / divisor));
1031         timer_adjust_periodic(mc68901->timer[MC68901_TIMER_A], attotime_never, 0, ATTOTIME_IN_HZ(mc68901->timer_clock / divisor));
9031032         timer_enable(mc68901->timer[MC68901_TIMER_A], 0);
9041033         }
9051034         break;
r4234r4235
9111040
9121041         mc68901->to[MC68901_TIMER_A] = 0;
9131042
914         if (mc68901->intf->on_to_changed)
915         {
916            mc68901->intf->on_to_changed(device, MC68901_TIMER_A, mc68901->to[MC68901_TIMER_A]);
917         }
1043         devcb_call_write_line(&mc68901->out_tao_func, mc68901->to[MC68901_TIMER_A]);
9181044      }
9191045      break;
9201046
r4234r4235
9381064         {
9391065         int divisor = PRESCALER[mc68901->tbcr & 0x07];
9401066         if (LOG) logerror("MC68901 Timer B Delay Mode : %u Prescale\n", divisor);
941         timer_adjust_periodic(mc68901->timer[MC68901_TIMER_B], ATTOTIME_IN_HZ(mc68901->intf->timer_clock / divisor), 0, ATTOTIME_IN_HZ(mc68901->intf->timer_clock / divisor));
1067         timer_adjust_periodic(mc68901->timer[MC68901_TIMER_B], ATTOTIME_IN_HZ(mc68901->timer_clock / divisor), 0, ATTOTIME_IN_HZ(mc68901->timer_clock / divisor));
9421068         }
9431069         break;
9441070
r4234r4235
9571083         {
9581084         int divisor = PRESCALER[mc68901->tbcr & 0x07];
9591085         if (LOG) logerror("MC68901 Timer B Pulse Width Mode : %u Prescale\n", DIVISOR);
960         timer_adjust_periodic(mc68901->timer[MC68901_TIMER_B], attotime_never, 0, ATTOTIME_IN_HZ(mc68901->intf->timer_clock / divisor));
1086         timer_adjust_periodic(mc68901->timer[MC68901_TIMER_B], attotime_never, 0, ATTOTIME_IN_HZ(mc68901->timer_clock / divisor));
9611087         timer_enable(mc68901->timer[MC68901_TIMER_B], 0);
9621088         }
9631089         break;
r4234r4235
9691095
9701096         mc68901->to[MC68901_TIMER_B] = 0;
9711097
972         if (mc68901->intf->on_to_changed)
973         {
974            mc68901->intf->on_to_changed(device, MC68901_TIMER_B, mc68901->to[MC68901_TIMER_B]);
975         }
1098         devcb_call_write_line(&mc68901->out_tbo_func, mc68901->to[MC68901_TIMER_B]);
9761099      }
9771100      break;
9781101
r4234r4235
9961119         {
9971120         int divisor = PRESCALER[mc68901->tcdcr & 0x07];
9981121         if (LOG) logerror("MC68901 Timer D Delay Mode : %u Prescale\n", divisor);
999         timer_adjust_periodic(mc68901->timer[MC68901_TIMER_D], ATTOTIME_IN_HZ(mc68901->intf->timer_clock / divisor), 0, ATTOTIME_IN_HZ(mc68901->intf->timer_clock / divisor));
1122         timer_adjust_periodic(mc68901->timer[MC68901_TIMER_D], ATTOTIME_IN_HZ(mc68901->timer_clock / divisor), 0, ATTOTIME_IN_HZ(mc68901->timer_clock / divisor));
10001123         }
10011124         break;
10021125      }
r4234r4235
10181141         {
10191142         int divisor = PRESCALER[(mc68901->tcdcr >> 4) & 0x07];
10201143         if (LOG) logerror("MC68901 Timer C Delay Mode : %u Prescale\n", divisor);
1021         timer_adjust_periodic(mc68901->timer[MC68901_TIMER_C], ATTOTIME_IN_HZ(mc68901->intf->timer_clock / divisor), 0, ATTOTIME_IN_HZ(mc68901->intf->timer_clock / divisor));
1144         timer_adjust_periodic(mc68901->timer[MC68901_TIMER_C], ATTOTIME_IN_HZ(mc68901->timer_clock / divisor), 0, ATTOTIME_IN_HZ(mc68901->timer_clock / divisor));
10221145         }
10231146         break;
10241147      }
r4234r4235
12311354   }
12321355}
12331356
1234static void mc68901_timer_count(const device_config *device, int index)
1357/*-------------------------------------------------
1358    timer_count - timer count down
1359-------------------------------------------------*/
1360
1361static void timer_count(const device_config *device, int index)
12351362{
12361363   mc68901_t *mc68901 = get_safe_token(device);
12371364
12381365   if (mc68901->tmc[index] == 0x01)
12391366   {
1240      mc68901->to[index] = mc68901->to[index] ? 0 : 1;
1367      /* toggle timer output signal */
1368      mc68901->to[index] = !mc68901->to[index];
12411369
1242      if (mc68901->to[index])
1370      switch (index)
12431371      {
1244         if (mc68901->intf->rx_clock == MC68901_LOOPBACK_TIMER[index])
1245         {
1246            mc68901_serial_rx(device);
1247         }
1248
1249         if (mc68901->intf->tx_clock == MC68901_LOOPBACK_TIMER[index])
1250         {
1251            mc68901_serial_tx(device);
1252         }
1372      case MC68901_TIMER_A:    devcb_call_write_line(&mc68901->out_tao_func, mc68901->to[index]);   break;
1373      case MC68901_TIMER_B:    devcb_call_write_line(&mc68901->out_tbo_func, mc68901->to[index]);   break;
1374      case MC68901_TIMER_C:    devcb_call_write_line(&mc68901->out_tco_func, mc68901->to[index]);   break;
1375      case MC68901_TIMER_D:    devcb_call_write_line(&mc68901->out_tdo_func, mc68901->to[index]);   break;
12531376      }
12541377
1255      if (mc68901->intf->on_to_changed)
1256      {
1257         mc68901->intf->on_to_changed(device, index, mc68901->to[index]);
1258      }
1259
12601378      if (mc68901->ier & MC68901_INT_MASK_TIMER[index])
12611379      {
1262         mc68901_interrupt(device, MC68901_INT_MASK_TIMER[index]);
1380         /* signal timer elapsed interrupt */
1381         take_interrupt(device, MC68901_INT_MASK_TIMER[index]);
12631382      }
12641383
1384      /* load main counter */
12651385      mc68901->tmc[index] = mc68901->tdr[index];
12661386   }
12671387   else
12681388   {
1389      /* count down */
12691390      mc68901->tmc[index]--;
12701391   }
12711392}
12721393
1273static void mc68901_ti_w(const device_config *device, int index, int value)
1394/*-------------------------------------------------
1395    timer_input - timer input
1396-------------------------------------------------*/
1397
1398static void timer_input(const device_config *device, int index, int value)
12741399{
12751400   mc68901_t *mc68901 = get_safe_token(device);
12761401
r4234r4235
12831408   case MC68901_TCR_TIMER_EVENT:
12841409      if (((mc68901->ti[index] ^ aer) == 1) && ((value ^ aer) == 0))
12851410      {
1286         mc68901_timer_count(device, index);
1411         timer_count(device, index);
12871412      }
12881413
12891414      mc68901->ti[index] = value;
r4234r4235
13021427      {
13031428         if (mc68901->ier & MC68901_INT_MASK_GPIO[bit])
13041429         {
1305            mc68901_interrupt(device, MC68901_INT_MASK_GPIO[bit]);
1430            take_interrupt(device, MC68901_INT_MASK_GPIO[bit]);
13061431         }
13071432      }
13081433
r4234r4235
13111436   }
13121437}
13131438
1314static TIMER_CALLBACK( timer_a )
1315{
1316   mc68901_timer_count(ptr, MC68901_TIMER_A);
1317}
1439/*-------------------------------------------------
1440    TIMER_CALLBACK( timer_a )
1441-------------------------------------------------*/
13181442
1319static TIMER_CALLBACK( timer_b )
1320{
1321   mc68901_timer_count(ptr, MC68901_TIMER_B);
1322}
1443static TIMER_CALLBACK( timer_a ) { timer_count(ptr, MC68901_TIMER_A); }
1444static TIMER_CALLBACK( timer_b ) { timer_count(ptr, MC68901_TIMER_B); }
1445static TIMER_CALLBACK( timer_c ) { timer_count(ptr, MC68901_TIMER_C); }
1446static TIMER_CALLBACK( timer_d ) { timer_count(ptr, MC68901_TIMER_D); }
13231447
1324static TIMER_CALLBACK( timer_c )
1325{
1326   mc68901_timer_count(ptr, MC68901_TIMER_C);
1327}
1448/*-------------------------------------------------
1449    mc68901_get_vector - get interrupt vector
1450-------------------------------------------------*/
13281451
1329static TIMER_CALLBACK( timer_d )
1330{
1331   mc68901_timer_count(ptr, MC68901_TIMER_D);
1332}
1333
1334/* External Interface */
1335
1336void mc68901_tai_w(const device_config *device, int value)
1337{
1338   mc68901_ti_w(device, MC68901_TIMER_A, value);
1339}
1340
1341void mc68901_tbi_w(const device_config *device, int value)
1342{
1343   mc68901_ti_w(device, MC68901_TIMER_B, value);
1344}
1345
13461452int mc68901_get_vector(const device_config *device)
13471453{
13481454   mc68901_t *mc68901 = get_safe_token(device);
13491455
13501456   int ch;
13511457
1352   assert(mc68901 != NULL);
1353
13541458   for (ch = 15; ch >= 0; ch--)
13551459   {
13561460      if (BIT(mc68901->imr, ch) && BIT(mc68901->ipr, ch))
13571461      {
13581462         if (mc68901->vr & MC68901_VR_S)
13591463         {
1464            /* set interrupt-in-service bit */
13601465            mc68901->isr |= (1 << ch);
13611466         }
13621467
1468         /* clear interrupt pending bit */
13631469         mc68901->ipr &= ~(1 << ch);
13641470
1365         mc68901_check_interrupts(device);
1471         check_interrupts(device);
13661472
13671473         return (mc68901->vr & 0xf0) | ch;
13681474      }
r4234r4235
13711477   return M68K_INT_ACK_SPURIOUS;
13721478}
13731479
1374/* Device Interface */
1480/*-------------------------------------------------
1481    mc68901_tai_w - timer A input
1482-------------------------------------------------*/
13751483
1484void mc68901_tai_w(const device_config *device, int value)
1485{
1486   timer_input(device, MC68901_TIMER_A, value);
1487}
1488
1489/*-------------------------------------------------
1490    mc68901_tbi_w - timer B input
1491-------------------------------------------------*/
1492
1493void mc68901_tbi_w(const device_config *device, int value)
1494{
1495   timer_input(device, MC68901_TIMER_B, value);
1496}
1497
1498/*-------------------------------------------------
1499    mc68901_rx_clock_w - receiver clock input
1500-------------------------------------------------*/
1501
1502void mc68901_rx_clock_w(const device_config *device, int state)
1503{
1504   if (state)
1505   {
1506      serial_receive(device);
1507   }
1508}
1509
1510/*-------------------------------------------------
1511    mc68901_tx_clock_w - transmitter clock input
1512-------------------------------------------------*/
1513
1514void mc68901_tx_clock_w(const device_config *device, int state)
1515{
1516   if (state)
1517   {
1518      serial_transmit(device);
1519   }
1520}
1521
1522/*-------------------------------------------------
1523    DEVICE_START( mc68901 )
1524-------------------------------------------------*/
1525
13761526static DEVICE_START( mc68901 )
13771527{
13781528   mc68901_t *mc68901 = device->token;
1529   const mc68901_interface *intf = get_interface(device);
13791530
1380   /* validate arguments */
1381   assert(device->tag != NULL);
1531   /* resolve callbacks */
1532   devcb_resolve_read8(&mc68901->in_gpio_func, &intf->in_gpio_func, device);
1533   devcb_resolve_write8(&mc68901->out_gpio_func, &intf->out_gpio_func, device);
1534   devcb_resolve_read_line(&mc68901->in_si_func, &intf->in_si_func, device);
1535   devcb_resolve_write_line(&mc68901->out_so_func, &intf->out_so_func, device);
1536   devcb_resolve_write_line(&mc68901->out_tao_func, &intf->out_tao_func, device);
1537   devcb_resolve_write_line(&mc68901->out_tbo_func, &intf->out_tbo_func, device);
1538   devcb_resolve_write_line(&mc68901->out_tco_func, &intf->out_tco_func, device);
1539   devcb_resolve_write_line(&mc68901->out_tdo_func, &intf->out_tdo_func, device);
1540   devcb_resolve_write_line(&mc68901->out_irq_func, &intf->out_irq_func, device);
13821541
1383   mc68901->intf = device->static_config;
1384
13851542   /* set initial values */
1543   mc68901->timer_clock = intf->timer_clock;
13861544   mc68901->tsr = MC68901_TSR_BUFFER_EMPTY;
13871545
13881546   /* create the timers */
r4234r4235
13911549   mc68901->timer[MC68901_TIMER_C] = timer_alloc(device->machine, timer_c, (void *)device);
13921550   mc68901->timer[MC68901_TIMER_D] = timer_alloc(device->machine, timer_d, (void *)device);
13931551
1394   if (mc68901->intf->rx_clock > 0)
1552   if (intf->rx_clock > 0)
13951553   {
13961554      mc68901->rx_timer = timer_alloc(device->machine, rx_tick, (void *)device);
1397      timer_adjust_periodic(mc68901->rx_timer, attotime_zero, 0, ATTOTIME_IN_HZ(mc68901->intf->rx_clock));
1555      timer_adjust_periodic(mc68901->rx_timer, attotime_zero, 0, ATTOTIME_IN_HZ(intf->rx_clock));
13981556   }
13991557
1400   if (mc68901->intf->tx_clock > 0)
1558   if (intf->tx_clock > 0)
14011559   {
14021560      mc68901->tx_timer = timer_alloc(device->machine, tx_tick, (void *)device);
1403      timer_adjust_periodic(mc68901->tx_timer, attotime_zero, 0, ATTOTIME_IN_HZ(mc68901->intf->tx_clock));
1561      timer_adjust_periodic(mc68901->tx_timer, attotime_zero, 0, ATTOTIME_IN_HZ(intf->tx_clock));
14041562   }
14051563
1406   if (mc68901->intf->gpio_r)
1407   {
1408      mc68901->poll_timer = timer_alloc(device->machine, mc68901_gpio_poll_tick, (void *)device);
1409      timer_adjust_periodic(mc68901->poll_timer, attotime_zero, 0, ATTOTIME_IN_HZ(mc68901->intf->chip_clock / 4));
1410   }
1564   mc68901->poll_timer = timer_alloc(device->machine, gpio_poll_tick, (void *)device);
1565   timer_adjust_periodic(mc68901->poll_timer, attotime_zero, 0, ATTOTIME_IN_HZ(device->clock / 4));
14111566
14121567   /* register for state saving */
14131568   state_save_register_device_item(device, 0, mc68901->gpip);
r4234r4235
14461601   state_save_register_device_item(device, 0, mc68901->next_rsr);
14471602}
14481603
1604/*-------------------------------------------------
1605    DEVICE_RESET( mc68901 )
1606-------------------------------------------------*/
1607
14491608static DEVICE_RESET( mc68901 )
14501609{
14511610   mc68901_register_w(device, MC68901_REGISTER_GPIP, 0);
r4234r4235
14681627   mc68901_register_w(device, MC68901_REGISTER_RSR, 0);
14691628}
14701629
1630/*-------------------------------------------------
1631    DEVICE_SET_INFO( mc68901 )
1632-------------------------------------------------*/
1633
14711634static DEVICE_SET_INFO( mc68901 )
14721635{
14731636   switch (state)
r4234r4235
14761639   }
14771640}
14781641
1642/*-------------------------------------------------
1643    DEVICE_GET_INFO( mc68901 )
1644-------------------------------------------------*/
1645
14791646DEVICE_GET_INFO( mc68901 )
14801647{
14811648   switch (state)
r4234r4235
15001667   }
15011668}
15021669
1670/*-------------------------------------------------
1671    DEVICE_GET_INFO( mk68901 )
1672-------------------------------------------------*/
1673
15031674#ifdef UNUSED_FUNCTION
15041675DEVICE_GET_INFO( mk68901 )
15051676{
src/mess/machine/68901mfp.h
r4234r4235
3838#define __MC68901__
3939
4040#include "driver.h"
41#include "devcb.h"
4142
42enum {
43   MC68901_TAO_LOOPBACK = -1,
44   MC68901_TBO_LOOPBACK = -2,
45   MC68901_TCO_LOOPBACK = -3,
46   MC68901_TDO_LOOPBACK = -4
47};
43/***************************************************************************
44    MACROS / CONSTANTS
45***************************************************************************/
4846
49typedef void (*mc68901_on_irq_changed_func) (const device_config *device, int level);
50#define MC68901_ON_IRQ_CHANGED(name) void name(const device_config *device, int level)
51
52typedef void (*mc68901_on_to_changed_func) (const device_config *device, int timer, int level);
53#define MC68901_ON_TO_CHANGED(name) void name(const device_config *device, int timer, int level)
54
55typedef UINT8 (*mc68901_gpio_read_func) (const device_config *device);
56#define MC68901_GPIO_READ(name) UINT8 name(const device_config *device)
57
58typedef void (*mc68901_gpio_write_func) (const device_config *device, UINT8 data);
59#define MC68901_GPIO_WRITE(name) void name(const device_config *device, UINT8 data)
60
6147#define MC68901 DEVICE_GET_INFO_NAME( mc68901 )
6248#define MK68901 DEVICE_GET_INFO_NAME( mk68901 )
6349
64#define MDRV_MC68901_ADD(_tag, _config)   \
65   MDRV_DEVICE_ADD((_tag), MC68901, 0)   \
50#define MDRV_MC68901_ADD(_tag, _clock, _config) \
51   MDRV_DEVICE_ADD((_tag), MC68901, _clock)   \
6652   MDRV_DEVICE_CONFIG(_config)
6753
68#define MDRV_MK68901_ADD(_tag, _config)   \
69   MDRV_DEVICE_ADD((_tag), MK68901, 0)   \
54#define MDRV_MK68901_ADD(_tag, _clock, _config) \
55   MDRV_DEVICE_ADD((_tag), MK68901, _clock)   \
7056   MDRV_DEVICE_CONFIG(_config)
7157
58#define MC68901_INTERFACE(name) const mc68901_interface (name) =
7259
73/* interface */
60/***************************************************************************
61    TYPE DEFINITIONS
62***************************************************************************/
63
7464typedef struct _mc68901_interface mc68901_interface;
7565struct _mc68901_interface
7666{
77   int   chip_clock;         /* chip clock */
7867   int   timer_clock;      /* timer clock */
7968   int   rx_clock;         /* serial receive clock */
8069   int   tx_clock;         /* serial transmit clock */
8170
82   UINT8 *rx_pin;         /* serial receive pin (pin 9) */
83   UINT8 *tx_pin;         /* serial transmit pin (pin 8) */
71   /* this is called on each read of the GPIO pins */
72   devcb_read8            in_gpio_func;
73
74   /* this is called on each write of the GPIO pins */
75   devcb_write8         out_gpio_func;
76
77   /* this gets called for each read of the SI pin (pin 9) */
78   devcb_read_line         in_si_func;
8479   
85   /* this gets called for each change of the TxO pins (pins 13-16) */
86   mc68901_on_to_changed_func   on_to_changed;
80   /* this gets called for each change of the SO pin (pin 8) */
81   devcb_write_line      out_so_func;
8782
83   /* this gets called for each change of the TAO pin (pin 13) */
84   devcb_write_line      out_tao_func;
85   
86   /* this gets called for each change of the TBO pin (pin 14) */
87   devcb_write_line      out_tbo_func;
88   
89   /* this gets called for each change of the TCO pin (pin 15) */
90   devcb_write_line      out_tco_func;
91   
92   /* this gets called for each change of the TDO pin (pin 16) */
93   devcb_write_line      out_tdo_func;
94
8895   /* this gets called on each change of the interrupt line */
89   mc68901_on_irq_changed_func   on_irq_changed;
96   devcb_write_line      out_irq_func;
97};
9098
91   /* this is called on each read of the GPIO pins */
92   mc68901_gpio_read_func      gpio_r;
99/***************************************************************************
100    PROTOTYPES
101***************************************************************************/
93102
94   /* this is called on each write of the GPIO pins */
95   mc68901_gpio_write_func      gpio_w;
96};
97#define MC68901_INTERFACE(name) const mc68901_interface (name) =
98
99103/* device interface */
100104DEVICE_GET_INFO( mc68901 );
101105
r4234r4235
103107READ8_DEVICE_HANDLER( mc68901_register_r );
104108WRITE8_DEVICE_HANDLER( mc68901_register_w );
105109
110/* get interrupt vector */
111int mc68901_get_vector(const device_config *device) ATTR_NONNULL;
112
106113/* write to Timer A input (pin 19) */
107void mc68901_tai_w(const device_config *device, int value);
114void mc68901_tai_w(const device_config *device, int state) ATTR_NONNULL;
108115
109116/* write to Timer B input (pin 20) */
110void mc68901_tbi_w(const device_config *device, int value);
117void mc68901_tbi_w(const device_config *device, int state) ATTR_NONNULL;
111118
112/* get interrupt vector */
113int mc68901_get_vector(const device_config *device);
119/* receive clock */
120void mc68901_rx_clock_w(const device_config *device, int state) ATTR_NONNULL;
114121
122/* transmit clock */
123void mc68901_tx_clock_w(const device_config *device, int state) ATTR_NONNULL;
124
115125#endif
src/mess/drivers/x68k.c
r4234r4235
143143static unsigned int x68k_scanline;
144144static int led_state;
145145
146static UINT8 mfp_key;
147
148146static emu_timer* kb_timer;
149147//emu_timer* mfp_timer[4];
150148//emu_timer* mfp_irq;
r4234r4235
15221520   }
15231521}
15241522
1525static MC68901_GPIO_READ( mfp_gpio_r )
1523static READ8_DEVICE_HANDLER( mfp_gpio_r )
15261524{
15271525   UINT8 data = x68k_sys.mfp.gpio;
15281526
r4234r4235
15351533   return data;
15361534}
15371535
1538static MC68901_ON_IRQ_CHANGED( mfp_irq_callback )
1536static WRITE_LINE_DEVICE_HANDLER( mfp_irq_callback )
15391537{
15401538   static int prev;
1541   if(prev == CLEAR_LINE && level == CLEAR_LINE)  // eliminate unnecessary calls to set the IRQ line for speed reasons
1539   if(prev == CLEAR_LINE && state == CLEAR_LINE)  // eliminate unnecessary calls to set the IRQ line for speed reasons
15421540      return;
15431541//   if((x68k_sys.ioc.irqstatus & 0xc0) != 0)  // if the FDC is busy, then we don't want to miss that IRQ
15441542//      return;
1545   cpu_set_input_line(device->machine->cpu[0], 6, level);
1543   cpu_set_input_line(device->machine->cpu[0], 6, state);
15461544   current_vector[6] = 0;
1547   prev = level;
1545   prev = state;
15481546}
15491547
15501548static INTERRUPT_GEN( x68k_vsync_irq )
r4234r4235
16261624   AM_RANGE(0xf00000, 0xffffff) AM_ROM
16271625ADDRESS_MAP_END
16281626
1629static const mc68901_interface mfp_interface =
1627static WRITE8_DEVICE_HANDLER( mfp_tdo_w )
16301628{
1631   2000000, // 4MHz clock
1632   4000000,
1633   MC68901_TDO_LOOPBACK,
1634   0,
1635   &mfp_key,  // Rx
1636   NULL,      // Tx
1637   NULL,
1638   mfp_irq_callback,
1639   mfp_gpio_r,
1640   NULL
1629   mc68901_rx_clock_w(device, data);
1630   mc68901_tx_clock_w(device, data);
1631}
1632
1633static MC68901_INTERFACE( mfp_interface )
1634{
1635   4000000,                                 /* timer clock */
1636   0,                                       /* receive clock */
1637   0,                                       /* transmit clock */
1638   DEVCB_DEVICE_HANDLER(MC68901, MC68901_TAG, mfp_gpio_r),   /* GPIO read */
1639   DEVCB_NULL,                                 /* GPIO write */
1640   DEVCB_NULL,                                 /* serial input */
1641   DEVCB_NULL,                                 /* serial output */
1642   DEVCB_NULL,                                 /* TAO */
1643   DEVCB_NULL,                                 /* TBO */
1644   DEVCB_NULL,                                 /* TCO */
1645   DEVCB_DEVICE_HANDLER(MC68901, MC68901_TAG, mfp_tdo_w),   /* TDO */
1646   DEVCB_LINE(mfp_irq_callback)                  /* interrupt */
16411647};
16421648
16431649static const ppi8255_interface ppi_interface =
r4234r4235
21362142   MDRV_MACHINE_RESET( x68000 )
21372143
21382144   /* device hardware */
2139   MDRV_MC68901_ADD(MC68901_TAG, mfp_interface)
2145   MDRV_MC68901_ADD(MC68901_TAG, 2000000, mfp_interface)
21402146
21412147   MDRV_PPI8255_ADD( "ppi8255",  ppi_interface )
21422148
src/mess/drivers/atarist.c
r4234r4235
4545static void atarist_fdc_dma_transfer(running_machine *machine)
4646{
4747   device_config *fdc = (device_config*)devtag_get_device(machine, WD1772, "wd1772");
48   const address_space *program = cputag_get_address_space(machine, "main", ADDRESS_SPACE_PROGRAM);
48   const address_space *program = cputag_get_address_space(machine, M68000_TAG, ADDRESS_SPACE_PROGRAM);
4949   atarist_state *state = machine->driver_data;
5050
5151   if ((state->fdc_mode & ATARIST_FLOPPY_MODE_DMA_DISABLE) == 0)
r4234r4235
478478   if (state->dmasnd_samples == 0)
479479   {
480480      int i;
481      UINT8 *RAM = memory_region(machine, "main");
481      UINT8 *RAM = memory_region(machine, M68000_TAG);
482482
483483      for (i = 0; i < 8; i++)
484484      {
r4234r4235
13531353   acia_interrupt
13541354};
13551355
1356static MC68901_GPIO_READ( mfp_gpio_r )
1356static IRQ_CALLBACK( atarist_int_ack )
13571357{
1358   atarist_state *state = device->machine->driver_data;
1359
1360   if (irqline == M68K_IRQ_6)
1361   {
1362      return mc68901_get_vector(state->mc68901);
1363   }
1364
1365   return M68K_INT_ACK_AUTOVECTOR;
1366}
1367
1368static READ8_DEVICE_HANDLER( mfp_gpio_r )
1369{
13581370   /*
13591371
13601372        bit     description
r4234r4235
13831395   return data;
13841396}
13851397
1386static IRQ_CALLBACK( atarist_int_ack )
1398static WRITE8_DEVICE_HANDLER( mfp_tdo_w )
13871399{
1388   atarist_state *state = device->machine->driver_data;
1389
1390   if (irqline == M68K_IRQ_6)
1391   {
1392      return mc68901_get_vector(state->mc68901);
1393   }
1394
1395   return M68K_INT_ACK_AUTOVECTOR;
1400   mc68901_rx_clock_w(device, data);
1401   mc68901_tx_clock_w(device, data);
13961402}
13971403
1398static MC68901_ON_IRQ_CHANGED( mfp_interrupt )
1399{
1400   cpu_set_input_line(device->machine->cpu[0], M68K_IRQ_6, level);
1401}
1402
14031404static MC68901_INTERFACE( mfp_intf )
14041405{
1405   Y2/8,
1406   Y1,
1407   MC68901_TDO_LOOPBACK,
1408   MC68901_TDO_LOOPBACK,
1409   &mfp_rx,
1410   &mfp_tx,
1411   NULL,
1412   mfp_interrupt,
1413   mfp_gpio_r,
1414   NULL
1406   Y1,                                       /* timer clock */
1407   0,                                       /* receive clock */
1408   0,                                       /* transmit clock */
1409   DEVCB_DEVICE_HANDLER(MC68901, MC68901_TAG, mfp_gpio_r),   /* GPIO read */
1410   DEVCB_NULL,                                 /* GPIO write */
1411   DEVCB_NULL,                                 /* serial input */
1412   DEVCB_NULL,                                 /* serial output */
1413   DEVCB_NULL,                                 /* TAO */
1414   DEVCB_NULL,                                 /* TBO */
1415   DEVCB_NULL,                                 /* TCO */
1416   DEVCB_DEVICE_HANDLER(MC68901, MC68901_TAG, mfp_tdo_w),   /* TDO */
1417   DEVCB_CPU_INPUT_LINE(M68000_TAG, M68K_IRQ_6)      /* interrupt */
14151418};
14161419
14171420static const CENTRONICS_CONFIG atarist_centronics_config[1] =
r4234r4235
14251428static void atarist_configure_memory(running_machine *machine)
14261429{
14271430   const address_space *program = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
1428   UINT8 *RAM = memory_region(machine, "main");
1431   UINT8 *RAM = memory_region(machine, M68000_TAG);
14291432
14301433   switch (mess_ram_size)
14311434   {
r4234r4235
15211524   MACHINE_START_CALL(atarist);
15221525}
15231526
1524static MC68901_GPIO_READ( atariste_mfp_gpio_r )
1527static READ8_DEVICE_HANDLER( atariste_mfp_gpio_r )
15251528{
15261529   /*
15271530
r4234r4235
15511554
15521555static MC68901_INTERFACE( atariste_mfp_intf )
15531556{
1554   Y2/8,
1555   Y1,
1556   MC68901_TDO_LOOPBACK,
1557   MC68901_TDO_LOOPBACK,
1558   &mfp_rx,
1559   &mfp_tx,
1560   NULL,
1561   mfp_interrupt,
1562   atariste_mfp_gpio_r,
1563   NULL
1557   Y1,                                       /* timer clock */
1558   0,                                       /* receive clock */
1559   0,                                       /* transmit clock */
1560   DEVCB_DEVICE_HANDLER(MC68901, MC68901_TAG, atariste_mfp_gpio_r),   /* GPIO read */
1561   DEVCB_NULL,                                 /* GPIO write */
1562   DEVCB_NULL,                                 /* serial input */
1563   DEVCB_NULL,                                 /* serial output */
1564   DEVCB_NULL,                                 /* TAO */
1565   DEVCB_NULL,                                 /* TBO */
1566   DEVCB_NULL,                                 /* TCO */
1567   DEVCB_DEVICE_HANDLER(MC68901, MC68901_TAG, mfp_tdo_w),   /* TDO */
1568   DEVCB_CPU_INPUT_LINE(M68000_TAG, M68K_IRQ_6)      /* interrupt */
15641569};
15651570
15661571static void atariste_state_save(running_machine *machine)
r4234r4235
16211626static void stbook_configure_memory(running_machine *machine)
16221627{
16231628   const address_space *program = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
1624   UINT8 *RAM = memory_region(machine, "main");
1629   UINT8 *RAM = memory_region(machine, M68000_TAG);
16251630
16261631   switch (mess_ram_size)
16271632   {
r4234r4235
16951700   acia_interrupt
16961701};
16971702
1698static MC68901_GPIO_READ( stbook_mfp_gpio_r )
1703static READ8_DEVICE_HANDLER( stbook_mfp_gpio_r )
16991704{
17001705   /*
17011706
r4234r4235
17241729
17251730static MC68901_INTERFACE( stbook_mfp_intf )
17261731{
1727   Y2/8,
1728   Y1,
1729   MC68901_TDO_LOOPBACK,
1730   MC68901_TDO_LOOPBACK,
1731   &mfp_rx,
1732   &mfp_tx,
1733   NULL,
1734   mfp_interrupt,
1735   stbook_mfp_gpio_r,
1736   NULL
1732   Y1,                                       /* timer clock */
1733   0,                                       /* receive clock */
1734   0,                                       /* transmit clock */
1735   DEVCB_DEVICE_HANDLER(MC68901, MC68901_TAG, mfp_gpio_r),   /* GPIO read */
1736   DEVCB_NULL,                                 /* GPIO write */
1737   DEVCB_NULL,                                 /* serial input */
1738   DEVCB_NULL,                                 /* serial output */
1739   DEVCB_NULL,                                 /* TAO */
1740   DEVCB_NULL,                                 /* TBO */
1741   DEVCB_NULL,                                 /* TCO */
1742   DEVCB_DEVICE_HANDLER(MC68901, MC68901_TAG, mfp_tdo_w),   /* TDO */
1743   DEVCB_CPU_INPUT_LINE(M68000_TAG, M68K_IRQ_6)      /* interrupt */
17371744};
17381745
17391746static MACHINE_START( stbook )
r4234r4235
17601767
17611768static DEVICE_IMAGE_LOAD( atarist_cart )
17621769{
1763   UINT8 *RAM = memory_region(image->machine, "main");
1770   UINT8 *RAM = memory_region(image->machine, M68000_TAG);
17641771   UINT8 *ptr = RAM + 0xfa0000;
17651772   int   filesize = image_length(image);
17661773
r4234r4235
17681775   {
17691776      if (image_fread(image, ptr, filesize) == filesize)
17701777      {
1771         memory_install_readwrite16_handler(cputag_get_address_space(image->machine, "main", ADDRESS_SPACE_PROGRAM), 0xfa0000, 0xfbffff, 0, 0, SMH_BANK3, SMH_BANK3);
1778         memory_install_readwrite16_handler(cputag_get_address_space(image->machine, M68000_TAG, ADDRESS_SPACE_PROGRAM), 0xfa0000, 0xfbffff, 0, 0, SMH_BANK3, SMH_BANK3);
17721779
17731780         return INIT_PASS;
17741781      }
r4234r4235
17881795   MDRV_DRIVER_DATA(atarist_state)
17891796
17901797   // basic machine hardware
1791   MDRV_CPU_ADD("main", M68000, Y2/4)
1798   MDRV_CPU_ADD(M68000_TAG, M68000, Y2/4)
17921799   MDRV_CPU_PROGRAM_MAP(st_map, 0)
17931800
17941801   MDRV_CPU_ADD("keyboard", HD63701, XTAL_4MHz)  /* HD6301 */
r4234r4235
17981805   MDRV_MACHINE_START(atarist)
17991806
18001807   // device hardware
1801   MDRV_MC68901_ADD(MC68901_TAG, mfp_intf)
1808   MDRV_MC68901_ADD(MC68901_TAG, Y2/8, mfp_intf)
18021809   MDRV_SCC8530_ADD("scc")
18031810
18041811   // video hardware
1805   MDRV_SCREEN_ADD("main", RASTER)
1812   MDRV_SCREEN_ADD(SCREEN_TAG, RASTER)
18061813   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
18071814   MDRV_PALETTE_LENGTH(16)
18081815   MDRV_VIDEO_START( atarist )
r4234r4235
18311838static MACHINE_DRIVER_START( megast )
18321839   MDRV_IMPORT_FROM(atarist)
18331840
1834   MDRV_CPU_MODIFY("main")
1841   MDRV_CPU_MODIFY(M68000_TAG)
18351842   MDRV_CPU_PROGRAM_MAP(megast_map, 0)
18361843   MDRV_RP5C15_ADD("rp5c15",rtc_intf)
18371844
r4234r4235
18421849   MDRV_DRIVER_DATA(atarist_state)
18431850
18441851   // basic machine hardware
1845   MDRV_CPU_ADD("main", M68000, Y2/4)
1852   MDRV_CPU_ADD(M68000_TAG, M68000, Y2/4)
18461853   MDRV_CPU_PROGRAM_MAP(ste_map, 0)
18471854
18481855   MDRV_CPU_ADD("keyboard", HD63701, XTAL_4MHz)  /* HD6301 */
r4234r4235
18521859   MDRV_MACHINE_START(atariste)
18531860
18541861   // device hardware
1855   MDRV_MC68901_ADD(MC68901_TAG, atariste_mfp_intf)
1862   MDRV_MC68901_ADD(MC68901_TAG, Y2/8, atariste_mfp_intf)
18561863   MDRV_SCC8530_ADD("scc")
18571864
18581865   // video hardware
1859   MDRV_SCREEN_ADD("main", RASTER)
1866   MDRV_SCREEN_ADD(SCREEN_TAG, RASTER)
18601867   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
18611868   MDRV_PALETTE_LENGTH(512)
18621869   MDRV_VIDEO_START( atarist )
r4234r4235
18931900static MACHINE_DRIVER_START( megaste )
18941901   MDRV_IMPORT_FROM(atariste)
18951902
1896   MDRV_CPU_MODIFY("main")
1903   MDRV_CPU_MODIFY(M68000_TAG)
18971904   MDRV_CPU_PROGRAM_MAP(megaste_map, 0)
18981905   MDRV_RP5C15_ADD("rp5c15",rtc_intf)
18991906
r4234r4235
19041911   MDRV_DRIVER_DATA(atarist_state)
19051912
19061913   // basic machine hardware
1907   MDRV_CPU_ADD("main", M68000, U517/2)
1914   MDRV_CPU_ADD(M68000_TAG, M68000, U517/2)
19081915   MDRV_CPU_PROGRAM_MAP(stbook_map, 0)
19091916   MDRV_RP5C15_ADD("rp5c15",rtc_intf)
19101917
r4234r4235
19131920   MDRV_MACHINE_START(stbook)
19141921
19151922   // device hardware
1916   MDRV_MC68901_ADD(MC68901_TAG, stbook_mfp_intf)
1923   MDRV_MC68901_ADD(MC68901_TAG, U517/8, stbook_mfp_intf)
19171924   MDRV_SCC8530_ADD("scc")
19181925
19191926   // video hardware
1920   MDRV_SCREEN_ADD("main", LCD)
1927   MDRV_SCREEN_ADD(SCREEN_TAG, LCD)
19211928   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
19221929   MDRV_SCREEN_REFRESH_RATE(60)
19231930   MDRV_SCREEN_SIZE(640, 400)
r4234r4235
19491956/* ROMs */
19501957
19511958ROM_START( atarist )
1952   ROM_REGION16_BE( 0x1000000, "main", 0 )
1959   ROM_REGION16_BE( 0x1000000, M68000_TAG, 0 )
19531960   ROM_SYSTEM_BIOS( 0, "default", "TOS 1.04 (Rainbow TOS)" )
19541961   ROMX_LOAD( "tos104.img", 0xfc0000, 0x030000, BAD_DUMP CRC(a50d1d43) SHA1(9526ef63b9cb1d2a7109e278547ae78a5c1db6c6), ROM_BIOS(1) )
19551962   ROM_SYSTEM_BIOS( 1, "tos102", "TOS 1.02 (MEGA TOS)" )
r4234r4235
19661973   ROMX_LOAD( "st_7c1_a2.u2", 0xfe0000, 0x008000, CRC(d0513329) SHA1(49855a3585e2f75b2af932dd4414ed64e6d9501f), ROM_SKIP(1) | ROM_BIOS(5) )
19671974   ROMX_LOAD( "st_7c1_b1.u5", 0xfe0001, 0x008000, CRC(c115cbc8) SHA1(2b52b81a1a4e0818d63f98ee4b25c30e2eba61cb), ROM_SKIP(1) | ROM_BIOS(5) )
19681975
1969   ROM_COPY( "main", 0xfc0000, 0x000000, 0x000008 )
1976   ROM_COPY( M68000_TAG, 0xfc0000, 0x000000, 0x000008 )
19701977
19711978   ROM_REGION( 0x10000, "keyboard", 0 )
19721979   ROM_LOAD( "keyboard.u1", 0xf000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
19731980ROM_END
19741981
19751982ROM_START( megast )
1976   ROM_REGION16_BE( 0x1000000, "main", 0 )
1983   ROM_REGION16_BE( 0x1000000, M68000_TAG, 0 )
19771984   ROM_SYSTEM_BIOS( 0, "default", "TOS 1.04 (Rainbow TOS)" )
19781985   ROMX_LOAD( "tos104.img", 0xfc0000, 0x030000, BAD_DUMP CRC(a50d1d43) SHA1(9526ef63b9cb1d2a7109e278547ae78a5c1db6c6), ROM_BIOS(1) )
19791986   ROM_SYSTEM_BIOS( 1, "tos102", "TOS 1.02 (MEGA TOS)" )
19801987   ROMX_LOAD( "tos102.img", 0xfc0000, 0x030000, BAD_DUMP CRC(3b5cd0c5) SHA1(87900a40a890fdf03bd08be6c60cc645855cbce5), ROM_BIOS(2) )
1981   ROM_COPY( "main", 0xfc0000, 0x000000, 0x000008 )
1988   ROM_COPY( M68000_TAG, 0xfc0000, 0x000000, 0x000008 )
19821989
19831990   ROM_REGION( 0x10000, "keyboard", 0 )
19841991   ROM_LOAD( "keyboard.u1", 0xf000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
19851992ROM_END
19861993
19871994ROM_START( stacy )
1988   ROM_REGION16_BE( 0x1000000, "main", 0 )
1995   ROM_REGION16_BE( 0x1000000, M68000_TAG, 0 )
19891996   ROM_SYSTEM_BIOS( 0, "tos104", "TOS 1.04 (Rainbow TOS)" )
19901997   ROMX_LOAD( "tos104.img", 0xfc0000, 0x030000, BAD_DUMP CRC(a50d1d43) SHA1(9526ef63b9cb1d2a7109e278547ae78a5c1db6c6), ROM_BIOS(1) )
1991   ROM_COPY( "main", 0xfc0000, 0x000000, 0x000008 )
1998   ROM_COPY( M68000_TAG, 0xfc0000, 0x000000, 0x000008 )
19921999
19932000   ROM_REGION( 0x10000, "keyboard", 0 )
19942001   ROM_LOAD( "keyboard.u1", 0xf000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
19952002ROM_END
19962003
19972004ROM_START( atariste )
1998   ROM_REGION16_BE( 0x1000000, "main", 0 )
2005   ROM_REGION16_BE( 0x1000000, M68000_TAG, 0 )
19992006   ROM_SYSTEM_BIOS( 0, "default", "TOS 1.62 (STE TOS, Revision 2)" )
20002007   ROMX_LOAD( "tos162.img", 0xe00000, 0x040000, BAD_DUMP CRC(d1c6f2fa) SHA1(70db24a7c252392755849f78940a41bfaebace71), ROM_BIOS(1) )
20012008   ROM_SYSTEM_BIOS( 1, "tos106", "TOS 1.06 (STE TOS, Revision 1)" )
20022009   ROMX_LOAD( "tos106.img", 0xe00000, 0x040000, BAD_DUMP CRC(d72fea29) SHA1(06f9ea322e74b682df0396acfaee8cb4d9c90cad), ROM_BIOS(2) )
2003   ROM_COPY( "main", 0xe00000, 0x000000, 0x000008 )
2010   ROM_COPY( M68000_TAG, 0xe00000, 0x000000, 0x000008 )
20042011
20052012   ROM_REGION( 0x10000, "keyboard", 0 )
20062013   ROM_LOAD( "keyboard.u1", 0xf000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
20072014ROM_END
20082015
20092016ROM_START( megaste )
2010   ROM_REGION16_BE( 0x1000000, "main", 0 )
2017   ROM_REGION16_BE( 0x1000000, M68000_TAG, 0 )
20112018   ROM_SYSTEM_BIOS( 0, "default", "TOS 2.06 (ST/STE TOS)" )
20122019   ROMX_LOAD( "tos206.img", 0xe00000, 0x040000, BAD_DUMP CRC(08538e39) SHA1(2400ea95f547d6ea754a99d05d8530c03f8b28e3), ROM_BIOS(1) )
20132020   ROM_SYSTEM_BIOS( 1, "tos205", "TOS 2.05 (Mega STE TOS)" )
20142021   ROMX_LOAD( "tos205.img", 0xe00000, 0x030000, NO_DUMP, ROM_BIOS(2) )
20152022   ROM_SYSTEM_BIOS( 2, "tos202", "TOS 2.02 (Mega STE TOS)" )
20162023   ROMX_LOAD( "tos202.img", 0xe00000, 0x030000, NO_DUMP, ROM_BIOS(3) )
2017   ROM_COPY( "main", 0xe00000, 0x000000, 0x000008 )
2024   ROM_COPY( M68000_TAG, 0xe00000, 0x000000, 0x000008 )
20182025
20192026   ROM_REGION( 0x10000, "keyboard", 0 )
20202027   ROM_LOAD( "keyboard.u1", 0xf000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
20212028ROM_END
20222029
20232030ROM_START( stbook )
2024   ROM_REGION16_BE( 0x1000000, "main", 0 )
2031   ROM_REGION16_BE( 0x1000000, M68000_TAG, 0 )
20252032   ROM_SYSTEM_BIOS( 0, "tos208", "TOS 2.08" )
20262033   ROMX_LOAD( "tos208.img", 0xe00000, 0x040000, NO_DUMP, ROM_BIOS(1) )
2027   ROM_COPY( "main", 0xe00000, 0x000000, 0x000008 )
2034   ROM_COPY( M68000_TAG, 0xe00000, 0x000000, 0x000008 )
20282035
20292036   ROM_REGION( 0x10000, "cpu1", 0 )
20302037   ROM_LOAD( "cop888c0.u703", 0x0000, 0x1000, NO_DUMP )
20312038ROM_END
20322039
20332040ROM_START( stpad )
2034   ROM_REGION16_BE( 0x1000000, "main", 0 )
2041   ROM_REGION16_BE( 0x1000000, M68000_TAG, 0 )
20352042   ROM_SYSTEM_BIOS( 0, "tos205", "TOS 2.05" )
20362043   ROMX_LOAD( "tos205.img", 0xe00000, 0x040000, NO_DUMP, ROM_BIOS(1) )
2037   ROM_COPY( "main", 0xe00000, 0x000000, 0x000008 )
2044   ROM_COPY( M68000_TAG, 0xe00000, 0x000000, 0x000008 )
20382045ROM_END
20392046
20402047ROM_START( tt030 )
2041   ROM_REGION32_BE( 0x4000000, "main", 0 )
2048   ROM_REGION32_BE( 0x4000000, M68000_TAG, 0 )
20422049   ROM_SYSTEM_BIOS( 0, "default", "TOS 3.06 (TT TOS)" )
20432050   ROMX_LOAD( "tos306.img", 0xe00000, 0x080000, BAD_DUMP CRC(75dda215) SHA1(6325bdfd83f1b4d3afddb2b470a19428ca79478b), ROM_BIOS(1) )
20442051   ROM_SYSTEM_BIOS( 1, "tos305", "TOS 3.05 (TT TOS)" )
20452052   ROMX_LOAD( "tos305.img", 0xe00000, 0x080000, NO_DUMP, ROM_BIOS(2) )
20462053   ROM_SYSTEM_BIOS( 2, "tos301", "TOS 3.01 (TT TOS)" )
20472054   ROMX_LOAD( "tos301.img", 0xe00000, 0x080000, NO_DUMP, ROM_BIOS(3) )
2048   ROM_COPY( "main", 0xe00000, 0x000000, 0x000008 )
2055   ROM_COPY( M68000_TAG, 0xe00000, 0x000000, 0x000008 )
20492056
20502057   ROM_REGION( 0x10000, "keyboard", 0 )
20512058   ROM_LOAD( "keyboard.u1", 0xf000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
20522059ROM_END
20532060
20542061ROM_START( fx1 )
2055   ROM_REGION16_BE( 0x1000000, "main", 0 )
2062   ROM_REGION16_BE( 0x1000000, M68000_TAG, 0 )
20562063   ROM_SYSTEM_BIOS( 0, "tos207", "TOS 2.07" )
20572064   ROMX_LOAD( "tos207.img", 0xe00000, 0x040000, NO_DUMP, ROM_BIOS(1) )
2058   ROM_COPY( "main", 0xe00000, 0x000000, 0x000008 )
2065   ROM_COPY( M68000_TAG, 0xe00000, 0x000000, 0x000008 )
20592066
20602067   ROM_REGION( 0x10000, "keyboard", 0 )
20612068   ROM_LOAD( "keyboard.u1", 0xf000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
20622069ROM_END
20632070
20642071ROM_START( falcon )
2065   ROM_REGION32_BE( 0x4000000, "main", 0 )
2072   ROM_REGION32_BE( 0x4000000, M68000_TAG, 0 )
20662073   ROM_SYSTEM_BIOS( 0, "default", "TOS 4.04" )
20672074   ROMX_LOAD( "tos404.img", 0xe00000, 0x080000, BAD_DUMP CRC(028b561d) SHA1(27dcdb31b0951af99023b2fb8c370d8447ba6ebc), ROM_BIOS(1) )
20682075   ROM_SYSTEM_BIOS( 1, "tos402", "TOS 4.02" )
r4234r4235
20712078   ROMX_LOAD( "tos401.img", 0xe00000, 0x080000, NO_DUMP, ROM_BIOS(3) )
20722079   ROM_SYSTEM_BIOS( 3, "tos400", "TOS 4.00" )
20732080   ROMX_LOAD( "tos400.img", 0xe00000, 0x080000, BAD_DUMP CRC(1fbc5396) SHA1(d74d09f11a0bf37a86ccb50c6e7f91aac4d4b11b), ROM_BIOS(4) )
2074   ROM_COPY( "main", 0xe00000, 0x000000, 0x000008 )
2081   ROM_COPY( M68000_TAG, 0xe00000, 0x000000, 0x000008 )
20752082
20762083   ROM_REGION( 0x10000, "keyboard", 0 )
20772084   ROM_LOAD( "keyboard.u1", 0xf000, 0x1000, CRC(0296915d) SHA1(1102f20d38f333234041c13687d82528b7cde2e1) )
20782085ROM_END
20792086
20802087ROM_START( falcon40 )
2081   ROM_REGION32_BE( 0x4000000, "main", 0 )
2088   ROM_REGION32_BE( 0x4000000, M68000_TAG, 0 )
20822089   ROM_SYSTEM_BIOS( 0, "tos492", "TOS 4.92" )
20832090   ROMX_LOAD( "tos492.img", 0xe00000, 0x080000, BAD_DUMP CRC(bc8e497f) SHA1(747a38042844a6b632dcd9a76d8525fccb5eb892), ROM_BIOS(2) )
20842091ROM_END
docs/messnew.txt
r4234r4235
8080- Fixed image loading related memory leaks. [Curt Coder]
8181
8282- Refactored the following devices to use devcb callbacks:
83  CDP1861, CDP1864, CDP1871, ZX8301, ZX8302 [Curt Coder]
83  CDP1861, CDP1864, CDP1871, MC68901, ZX8301, ZX8302 [Curt Coder]
8484
8585
86860.129

Previous 15994 Revisions Next


© 1998-2018 The MESS Team