Previous 15994 Revisions Next

r12759 Thursday 1st September, 2011 at 15:05:23 UTC by Miodrag Milanović
Moved acia6551 to c++ device (no whatsnew)
[src/mess/drivers]aim65_40.c coco.c digel804.c ec65.c microtan.c mits680b.c oric.c rvoice.c thomson.c
[src/mess/machine]6551.c 6551.h apple3.c coco_232.c coco_232.h thomson.c

src/mess/machine/apple3.c
r12758r12759
104104static READ8_HANDLER( apple3_c0xx_r )
105105{
106106   apple3_state *state = space->machine().driver_data<apple3_state>();
107   device_t *acia = space->machine().device("acia");
107   acia6551_device *acia = space->machine().device<acia6551_device>("acia");
108108   device_t *fdc = space->machine().device("fdc");
109109   UINT8 result = 0xFF;
110110
r12758r12759
179179      case 0xF1:
180180      case 0xF2:
181181      case 0xF3:
182         result = acia_6551_r(acia, offset & 0x03);
182         result = acia->data_r(*space, offset & 0x03);
183183         break;
184184   }
185185   return result;
r12758r12759
190190static WRITE8_HANDLER( apple3_c0xx_w )
191191{
192192   apple3_state *state = space->machine().driver_data<apple3_state>();
193   device_t *acia = space->machine().device("acia");
193   acia6551_device *acia = space->machine().device<acia6551_device>("acia");
194194   device_t *fdc = space->machine().device("fdc");
195195   switch(offset)
196196   {
r12758r12759
243243      case 0xF1:
244244      case 0xF2:
245245      case 0xF3:
246         acia_6551_w(acia, offset & 0x03, data);
246         acia->data_w(*space, offset & 0x03, data);
247247         break;
248248   }
249249}
src/mess/machine/thomson.c
r12758r12759
393393
394394static DEVICE_START( thom_serial_rf57232 )
395395{
396   device_t *acia = device->machine().device("acia");
396   acia6551_device *acia = device->machine().device<acia6551_device>("acia");
397397   DEVICE_START_CALL(serial);
398398   LOG(( "thom_serial_init: init RF 57-232 RS232 device\n" ));
399   acia_6551_connect_to_serial_device( acia, device );
399   acia->connect_to_serial_device(device);
400400   serial_device_setup( device, 2400, 7, 2, SERIAL_PARITY_NONE );
401401   serial_device_set_transmit_state( device, 1 );
402402}
src/mess/machine/coco_232.c
r12758r12759
88
99#include "emu.h"
1010#include "coco_232.h"
11#include "machine/6551.h"
1211
1312
1413/***************************************************************************
r12758r12759
5251
5352void coco_232_device::device_start()
5453{
55   m_uart = subdevice(UART_TAG);
54   m_uart = subdevice<acia6551_device>(UART_TAG);
5655}
5756
5857//-------------------------------------------------
r12758r12759
7473   UINT8 result = 0x00;
7574
7675   if ((offset >= 0x28) && (offset <= 0x2F))
77      result = acia_6551_r(m_uart, offset - 0x28);
76      result = m_uart->data_r(space, offset - 0x28);
7877
7978   return result;
8079}
r12758r12759
8786WRITE8_MEMBER(coco_232_device::write)
8887{
8988   if ((offset >= 0x28) && (offset <= 0x2F))
90      acia_6551_w(m_uart, offset - 0x28, data);
89      m_uart->data_w(space, offset - 0x28, data);
9190}
src/mess/machine/coco_232.h
r12758r12759
55
66#include "emu.h"
77#include "machine/cococart.h"
8#include "machine/6551.h"
89
910//**************************************************************************
1011//  TYPE DEFINITIONS
r12758r12759
3031      virtual DECLARE_WRITE8_MEMBER(write);
3132private:
3233        // internal state
33      device_t *m_uart;
34      acia6551_device *m_uart;
3435};
3536
3637
src/mess/machine/6551.c
r12758r12759
1414
1515#include "emu.h"
1616#include "6551.h"
17#include "machine/serial.h"
1817
1918
20/***************************************************************************
21    TYPE DEFINITIONS
22***************************************************************************/
19//**************************************************************************
20//  DEVICE DEFINITIONS
21//**************************************************************************
2322
24typedef struct _acia6551_t acia6551_t;
25struct _acia6551_t
26{
27   unsigned char transmit_data_register;
28   unsigned char receive_data_register;
29   unsigned char status_register;
30   unsigned char command_register;
31   unsigned char control_register;
23const device_type ACIA6551 = &device_creator<acia6551_device>;
3224
33   /* internal baud rate timer */
34   emu_timer   *timer;
35   /* callback for internal baud rate timer */
36   void (*acia_updated_callback)(int id, unsigned long State);
25//-------------------------------------------------
26//  acia6551_device - constructor
27//-------------------------------------------------
3728
38   void   (*irq_callback)(int);
39
40   data_form form;
41
42   /* receive register */
43   serial_receive_register   receive_reg;
44   /* transmit register */
45   serial_transmit_register transmit_reg;
46
47   serial_connection connection;
48};
49
50
51/***************************************************************************
52    FUNCTION PROTOTYPES
53***************************************************************************/
54
55static void acia_6551_refresh_ints(device_t *device);
56
57
58
59/***************************************************************************
60    INLINE FUNCTIONS
61***************************************************************************/
62
63INLINE acia6551_t *get_token(device_t *device)
29acia6551_device::acia6551_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
30    : device_t(mconfig, ACIA6551, "MOS Technology 6551 ACIA", tag, owner, clock)
6431{
65   assert(device != NULL);
66   assert(device->type() == ACIA6551);
67
68   return (acia6551_t *) downcast<legacy_device_base *>(device)->token();
6932}
7033
71
72
7334/***************************************************************************
7435    IMPLEMENTATION
7536***************************************************************************/
r12758r12759
8041-------------------------------------------------*/
8142
8243static void acia_6551_in_callback(running_machine &machine, int id, unsigned long state)
83{
84   device_t *device;
85   acia6551_t *acia;
86
44{   
8745   /* NPW 29-Nov-2008 - These two lines are a hack and indicate why our "serial" infrastructure needs to be updated */
88   device = machine.device("acia");
89   acia = get_token(device);
90
91   acia->connection.input_state = state;
46   acia6551_device *acia = machine.device<acia6551_device>("acia");
47   acia->get_connection()->input_state = state;
9248}
9349
9450
9551
9652/*-------------------------------------------------
97    TIMER_CALLBACK(acia_6551_timer_callback)
53    timer_callback
9854-------------------------------------------------*/
99
100static TIMER_CALLBACK(acia_6551_timer_callback)
55void acia6551_device::timer_callback()
10156{
102   device_t *device = (device_t *)ptr;
103   acia6551_t *acia = get_token(device);
104
10557   /* get bit received from other side and update receive register */
106   receive_register_update_bit(&acia->receive_reg, get_in_data_bit(acia->connection.input_state));
58   receive_register_update_bit(&m_receive_reg, get_in_data_bit(m_connection.input_state));
10759
108   if (acia->receive_reg.flags & RECEIVE_REGISTER_FULL)
60   if (m_receive_reg.flags & RECEIVE_REGISTER_FULL)
10961   {
110      receive_register_extract(&acia->receive_reg, &acia->form);
111      acia_6551_receive_char(device, acia->receive_reg.byte_received);
62      receive_register_extract(&m_receive_reg, &m_form);
63      receive_character(m_receive_reg.byte_received);
11264   }
11365
11466   /* transmit register full? */
115   if ((acia->status_register & (1<<4))==0)
67   if ((m_status_register & (1<<4))==0)
11668   {
11769      /* if transmit reg is empty */
118      if (acia->transmit_reg.flags & TRANSMIT_REGISTER_EMPTY)
70      if (m_transmit_reg.flags & TRANSMIT_REGISTER_EMPTY)
11971      {
12072         /* set it up */
121         transmit_register_setup(&acia->transmit_reg, &acia->form, acia->transmit_data_register);
73         transmit_register_setup(&m_transmit_reg, &m_form, m_transmit_data_register);
12274         /* acia transmit reg now empty */
123         acia->status_register |=(1<<4);
75         m_status_register |=(1<<4);
12476         /* and refresh ints */
125         acia_6551_refresh_ints(device);
77         refresh_ints();
12678      }
12779   }
12880
12981   /* if transmit is not empty... transmit data */
130   if ((acia->transmit_reg.flags & TRANSMIT_REGISTER_EMPTY)==0)
82   if ((m_transmit_reg.flags & TRANSMIT_REGISTER_EMPTY)==0)
13183   {
13284   //  logerror("UART6551\n");
133      transmit_register_send_bit(machine, &acia->transmit_reg, &acia->connection);
85      transmit_register_send_bit(machine(), &m_transmit_reg, &m_connection);
13486   }
13587}
13688
89static TIMER_CALLBACK(acia_6551_timer_callback)
90{
91   reinterpret_cast<acia6551_device *>(ptr)->timer_callback();
92}
13793
94//-------------------------------------------------
95//  device_start - device-specific startup
96//-------------------------------------------------
13897
139/*-------------------------------------------------
140    DEVICE_START( acia6551 )
141-------------------------------------------------*/
142
143static DEVICE_START( acia6551 )
98void acia6551_device::device_start()
14499{
145   acia6551_t *acia = get_token(device);
146
147100   serial_helper_setup();
148101
149   memset(acia, 0, sizeof(*acia));
150102   /* transmit data reg is empty */
151   acia->status_register |= (1<<4);
152   acia->timer = device->machine().scheduler().timer_alloc(FUNC(acia_6551_timer_callback), (void *) device);
103   m_status_register |= (1<<4);
104   m_timer = machine().scheduler().timer_alloc(FUNC(acia_6551_timer_callback), (void *) this);
153105
154   serial_connection_init(device->machine(), &acia->connection);
155   serial_connection_set_in_callback(device->machine(), &acia->connection, acia_6551_in_callback);
156   transmit_register_reset(&acia->transmit_reg);
157   receive_register_reset(&acia->receive_reg);
106   serial_connection_init(machine(), &m_connection);
107   serial_connection_set_in_callback(machine(), &m_connection, acia_6551_in_callback);
108   transmit_register_reset(&m_transmit_reg);
109   receive_register_reset(&m_receive_reg);
158110}
159111
160112
r12758r12759
163115    acia_6551_refresh_ints - update interrupt output
164116-------------------------------------------------*/
165117
166static void acia_6551_refresh_ints(device_t *device)
118void acia6551_device::refresh_ints()
167119{
168   acia6551_t *acia = get_token(device);
169120   int interrupt_state;
170121
171122   interrupt_state = 0;
r12758r12759
173124   /* receive interrupts */
174125
175126   /* receive data register full? */
176   if (acia->status_register & (1<<3))
127   if (m_status_register & (1<<3))
177128   {
178129      /* receiver interrupt enable? */
179      if ((acia->command_register & (1<<1))==0)
130      if ((m_command_register & (1<<1))==0)
180131      {
181132         /* trigger a interrupt */
182133         interrupt_state = 1;
r12758r12759
184135   }
185136
186137   /* set state of irq bit in status register */
187   acia->status_register &= ~(1<<7);
138   m_status_register &= ~(1<<7);
188139
189140   if (interrupt_state)
190141   {
191      acia->status_register |=(1<<7);
142      m_status_register |=(1<<7);
192143   }
193144
194   if (acia->irq_callback != NULL)
195        (*acia->irq_callback)(interrupt_state);
145   //if (m_irq_callback != NULL)
146        //(*m_irq_callback)(interrupt_state);
196147}
197148
198149
199150
200151/*-------------------------------------------------
201    acia_6551_receive_char
152    receive_character
202153-------------------------------------------------*/
203154
204extern void acia_6551_receive_char(device_t *device, unsigned char ch)
155void acia6551_device::receive_character(UINT8 ch)
205156{
206   acia6551_t *acia = get_token(device);
207
208157   /* receive register full? */
209   if (acia->status_register & (1<<3))
158   if (m_status_register & (1<<3))
210159   {
211160      /* set overrun error */
212      acia->status_register |= (1<<2);
161      m_status_register |= (1<<2);
213162      return;
214163   }
215164
216165   /* set new byte */
217   acia->receive_data_register = ch;
166   m_receive_data_register = ch;
218167   /* receive register is full */
219   acia->status_register |= (1<<3);
168   m_status_register |= (1<<3);
220169   /* update ints */
221   acia_6551_refresh_ints(device);
170   refresh_ints();
222171}
223172
224173
r12758r12759
227176    acia_6551_r
228177-------------------------------------------------*/
229178
230READ8_DEVICE_HANDLER(acia_6551_r)
179READ8_MEMBER(acia6551_device::data_r)
231180{
232   acia6551_t *acia = get_token(device);
233
234181   unsigned char data;
235182
236183   data = 0x0ff;
r12758r12759
240187      {
241188         /*  clear parity error, framing error and overrun error */
242189         /* when read of data reigster is done */
243         acia->status_register &=~((1<<0) | (1<<1) | (1<<2));
190         m_status_register &=~((1<<0) | (1<<1) | (1<<2));
244191         /* clear receive data register full flag */
245         acia->status_register &=~(1<<3);
192         m_status_register &=~(1<<3);
246193         /* return data */
247         data = acia->receive_data_register;
194         data = m_receive_data_register;
248195      }
249196      break;
250197
r12758r12759
261208    */
262209      case 1:
263210        {
264            data = acia->status_register;
211            data = m_status_register;
265212         /* clear interrupt */
266         acia->status_register &= ~(1<<7);
213         m_status_register &= ~(1<<7);
267214      }
268215        break;
269216
270217        case 2:
271         data = acia->command_register;
218         data = m_command_register;
272219         break;
273220
274221      case 3:
275         data = acia->control_register;
222         data = m_control_register;
276223         break;
277224
278225      default:
r12758r12759
290237    acia_6551_update_data_form
291238-------------------------------------------------*/
292239
293static void acia_6551_update_data_form(device_t *device)
294{
295   acia6551_t *acia = get_token(device);
240void acia6551_device::update_data_form()
241{   
242   m_form.word_length = 8-((m_control_register>>5) & 0x03);
243   m_form.stop_bit_count = (m_control_register>>7)+1;
296244
297   acia->form.word_length = 8-((acia->control_register>>5) & 0x03);
298   acia->form.stop_bit_count = (acia->control_register>>7)+1;
299
300   if (acia->command_register & (1<<5))
245   if (m_command_register & (1<<5))
301246   {
302      acia->form.parity = SERIAL_PARITY_ODD;
247      m_form.parity = SERIAL_PARITY_ODD;
303248   }
304249   else
305250   {
306      acia->form.parity = SERIAL_PARITY_NONE;
251      m_form.parity = SERIAL_PARITY_NONE;
307252   }
308253
309   receive_register_setup(&acia->receive_reg, &acia->form);
254   receive_register_setup(&m_receive_reg, &m_form);
310255}
311256
312257
r12758r12759
315260    acia_6551_w
316261-------------------------------------------------*/
317262
318WRITE8_DEVICE_HANDLER(acia_6551_w)
263WRITE8_MEMBER(acia6551_device::data_w)
319264{
320   acia6551_t *acia = get_token(device);
321
322265   logerror("6551 W %04x %02x\n",offset & 0x03, data);
323266
324267   switch (offset & 0x03)
r12758r12759
326269      case 0:
327270      {
328271         /* clear transmit data register empty */
329         acia->status_register &= ~(1<<4);
272         m_status_register &= ~(1<<4);
330273         /* store byte */
331         acia->transmit_data_register = data;
274         m_transmit_data_register = data;
332275
333276      }
334277      break;
r12758r12759
370313
371314      case 2:
372315      {
373         acia->command_register = data;
316         m_command_register = data;
374317
375318         /* update state of dtr */
376         acia->connection.State &=~SERIAL_STATE_DTR;
377         if (acia->command_register & (1<<0))
319         m_connection.State &=~SERIAL_STATE_DTR;
320         if (m_command_register & (1<<0))
378321         {
379            acia->connection.State |=SERIAL_STATE_DTR;
322            m_connection.State |=SERIAL_STATE_DTR;
380323         }
381324
382325         /* update state of rts */
383         switch ((acia->command_register>>2) & 0x03)
326         switch ((m_command_register>>2) & 0x03)
384327         {
385328            case 0:
386329            {
387               acia->connection.State &=~SERIAL_STATE_RTS;
330               m_connection.State &=~SERIAL_STATE_RTS;
388331            }
389332            break;
390333
r12758r12759
392335            case 2:
393336            case 3:
394337            {
395               acia->connection.State |=SERIAL_STATE_RTS;
338               m_connection.State |=SERIAL_STATE_RTS;
396339            }
397340            break;
398341         }
399342
400         serial_connection_out(device->machine(), &acia->connection);
343         serial_connection_out(machine(), &m_connection);
401344
402         acia_6551_update_data_form(device);
345         update_data_form();
403346      }
404347      break;
405348
r12758r12759
441384      {
442385         unsigned char previous_control_register;
443386
444            previous_control_register = acia->control_register;
387            previous_control_register = m_control_register;
445388
446389            if (((previous_control_register^data) & 0x07)!=0)
447390         {
r12758r12759
450393                rate = data & 0x07;
451394
452395            /* baud rate changed? */
453            acia->timer->reset();
396            m_timer->reset();
454397
455398            if (rate==0)
456399            {
r12758r12759
556499                  break;
557500               }
558501
559               acia->timer->adjust(attotime::zero, 0, attotime::from_hz(baud_rate));
502               m_timer->adjust(attotime::zero, 0, attotime::from_hz(baud_rate));
560503            }
561504         }
562505
563         acia->control_register = data;
564         acia_6551_update_data_form(device);
506         m_control_register = data;
507         update_data_form();
565508      }
566509      break;
567510
r12758r12759
573516
574517
575518/*-------------------------------------------------
576    acia_6551_connect_to_serial_device
519    connect_to_serial_device
577520-------------------------------------------------*/
578521
579void acia_6551_connect_to_serial_device(device_t *device, device_t *image)
522void acia6551_device::connect_to_serial_device(device_t *image)
580523{
581   acia6551_t *acia = get_token(device);
582   serial_device_connect(image, &acia->connection);
583}
584
585
586
587/*-------------------------------------------------
588    DEVICE_GET_INFO( acia6551 )
589-------------------------------------------------*/
590
591DEVICE_GET_INFO( acia6551 )
592{
593   switch (state)
594   {
595      /* --- the following bits of info are returned as 64-bit signed integers --- */
596      case DEVINFO_INT_TOKEN_BYTES:               info->i = sizeof(acia6551_t);            break;
597      case DEVINFO_INT_INLINE_CONFIG_BYTES:         info->i = 0;                        break;
598
599      /* --- the following bits of info are returned as pointers to data or functions --- */
600      case DEVINFO_FCT_START:                     info->start = DEVICE_START_NAME(acia6551);   break;
601      case DEVINFO_FCT_STOP:                     /* Nothing */                        break;
602      case DEVINFO_FCT_RESET:                     /* Nothing */                        break;
603
604      /* --- the following bits of info are returned as NULL-terminated strings --- */
605      case DEVINFO_STR_NAME:                     strcpy(info->s, "MOS Technology 6551 ACIA");      break;
606      case DEVINFO_STR_FAMILY:                  strcpy(info->s, "MOS Technology 6551 ACIA");      break;
607      case DEVINFO_STR_VERSION:                  strcpy(info->s, "1.0");                  break;
608      case DEVINFO_STR_SOURCE_FILE:               strcpy(info->s, __FILE__);               break;
609      case DEVINFO_STR_CREDITS:                  /* Nothing */                        break;
610   }
611}
612
613DEFINE_LEGACY_DEVICE(ACIA6551, acia6551);
524   serial_device_connect(image, &m_connection);
525}
No newline at end of file
src/mess/machine/6551.h
r12758r12759
99#ifndef __6551_H__
1010#define __6551_H__
1111
12#include "machine/serial.h"
1213
13/***************************************************************************
14    MACROS
15***************************************************************************/
14//**************************************************************************
15//  INTERFACE CONFIGURATION MACROS
16//**************************************************************************
1617
17DECLARE_LEGACY_DEVICE(ACIA6551, acia6551);
18
1918#define MCFG_ACIA6551_ADD(_tag)   \
2019   MCFG_DEVICE_ADD((_tag), ACIA6551, 0)
2120
2221
2322/***************************************************************************
24    FUNCTION PROTOTYPES
23    TYPE DEFINITIONS
2524***************************************************************************/
2625
27READ8_DEVICE_HANDLER(acia_6551_r);
28WRITE8_DEVICE_HANDLER(acia_6551_w);
26// ======================> acia6551_device
2927
30void acia_6551_connect_to_serial_device(device_t *device, device_t *image);
31void acia_6551_receive_char(device_t *device, unsigned char ch);
28class acia6551_device :  public device_t
29{
30public:
31    // construction/destruction
32    acia6551_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
3233
34   /* read data register */
35   DECLARE_READ8_MEMBER(data_r);
36   
37   /* write data register */
38   DECLARE_WRITE8_MEMBER(data_w);
39   
40   /* connecting to serial output */
41   void connect_to_serial_device(device_t *image);
42   
43   void receive_character(UINT8 ch);
44   
45   void timer_callback();
46   
47   serial_connection *get_connection() { return &m_connection; }
48protected:
49    // device-level overrides
50    virtual void device_start();
51   
52   void refresh_ints();
53   void update_data_form();
54   
55private:
56   UINT8 m_transmit_data_register;
57   UINT8 m_receive_data_register;
58   UINT8 m_status_register;
59   UINT8 m_command_register;
60   UINT8 m_control_register;
61
62   /* internal baud rate timer */
63   emu_timer   *m_timer;
64
65   data_form m_form;
66
67   /* receive register */
68   serial_receive_register   m_receive_reg;
69   /* transmit register */
70   serial_transmit_register m_transmit_reg;
71
72   serial_connection m_connection;
73};
74
75// device type definition
76extern const device_type ACIA6551;
77
3378#endif /* __6551_H__ */
src/mess/drivers/coco.c
r12758r12759
161161   AM_RANGE(0xE000, 0xEFFF) AM_RAMBANK("bank15")
162162   AM_RANGE(0xF000, 0xFEFF) AM_RAMBANK("bank16")
163163   AM_RANGE(0xff00, 0xff03) AM_DEVREADWRITE_MODERN("pia_0", pia6821_device, read, write) AM_MIRROR(0x0018)
164   AM_RANGE(0xff04, 0xff07) AM_DEVREADWRITE("acia", acia_6551_r,         acia_6551_w)   AM_MIRROR(0x0018)
164   AM_RANGE(0xff04, 0xff07) AM_DEVREADWRITE_MODERN("acia", acia6551_device, data_r, data_w)   AM_MIRROR(0x0018)
165165   AM_RANGE(0xff20, 0xff3f) AM_DEVREAD_MODERN("pia_1", pia6821_device, read) AM_DEVWRITE("pia_1", coco_pia_1_w)
166166   AM_RANGE(0xff40, 0xff7f) AM_DEVREADWRITE_MODERN("ext", cococart_slot_device, read, write)
167167   AM_RANGE(0xff90, 0xffbf) AM_NOP
r12758r12759
195195   AM_RANGE(0xE000, 0xEFFF) AM_RAMBANK("bank15")
196196   AM_RANGE(0xF000, 0xFEFF) AM_RAMBANK("bank16")
197197   AM_RANGE(0xff00, 0xff03) AM_DEVREADWRITE_MODERN("pia_0", pia6821_device, read, write) AM_MIRROR(0x0018)
198   AM_RANGE(0xff04, 0xff07) AM_DEVREADWRITE("acia", acia_6551_r,         acia_6551_w)   AM_MIRROR(0x0018)
198   AM_RANGE(0xff04, 0xff07) AM_DEVREADWRITE_MODERN("acia", acia6551_device, data_r, data_w)   AM_MIRROR(0x0018)
199199   AM_RANGE(0xff20, 0xff3f) AM_DEVREAD_MODERN("pia_1", pia6821_device, read) AM_DEVWRITE("pia_1", coco_pia_1_w)
200200   AM_RANGE(0xff40, 0xff7f) AM_DEVREADWRITE_MODERN("ext", cococart_slot_device, read, write)
201201   AM_RANGE(0xff90, 0xffbf) AM_NOP
r12758r12759
273273   AM_RANGE(0xE000, 0xEFFF) AM_RAMBANK("bank15")
274274   AM_RANGE(0xF000, 0xFEFF) AM_RAMBANK("bank16")
275275   AM_RANGE(0xff00, 0xff03) AM_DEVREADWRITE_MODERN("pia_0", pia6821_device, read, write)
276   AM_RANGE(0xff04, 0xff07) AM_DEVREADWRITE("acia", acia_6551_r, acia_6551_w)
276   AM_RANGE(0xff04, 0xff07) AM_DEVREADWRITE_MODERN("acia", acia6551_device, data_r, data_w)
277277   AM_RANGE(0xff20, 0xff23) AM_DEVREAD_MODERN("pia_1", pia6821_device, read) AM_DEVWRITE("pia_1", coco_pia_1_w)
278278   AM_RANGE(0xff24, 0xff27) AM_DEVREADWRITE_MODERN("pia_2", pia6821_device, read, write)       /* Third PIA on Dragon Alpha */
279279   AM_RANGE(0Xff28, 0xff2b) AM_READWRITE(dgnalpha_modem_r, dgnalpha_modem_w)      /* Modem, dummy to stop eror log ! */
src/mess/drivers/thomson.c
r12758r12759
329329     AM_RANGE ( 0xe7cc, 0xe7cf ) AM_DEVREADWRITE_MODERN( "pia_1", pia6821_device, read_alt, write_alt )
330330     AM_RANGE ( 0xe7d0, 0xe7df ) AM_READWRITE ( to7_floppy_r, to7_floppy_w )
331331     AM_RANGE ( 0xe7e0, 0xe7e3 ) AM_DEVREADWRITE_MODERN( "pia_2", pia6821_device, read_alt, write_alt )
332     AM_RANGE ( 0xe7e8, 0xe7eb ) AM_DEVREADWRITE("acia",  acia_6551_r, acia_6551_w )
332     AM_RANGE ( 0xe7e8, 0xe7eb ) AM_DEVREADWRITE_MODERN( "acia",  acia6551_device, data_r, data_w )
333333     AM_RANGE ( 0xe7f2, 0xe7f3 ) AM_READWRITE ( to7_midi_r, to7_midi_w )
334334     AM_RANGE ( 0xe7f8, 0xe7fb ) AM_DEVREADWRITE_MODERN( "pia_3", pia6821_device, read_alt, write_alt )
335335     AM_RANGE ( 0xe7fe, 0xe7ff ) AM_READWRITE ( to7_modem_mea8000_r,
r12758r12759
773773     AM_RANGE ( 0xe7e0, 0xe7e3 ) AM_DEVREADWRITE_MODERN( "pia_2", pia6821_device, read_alt, write_alt )
774774     AM_RANGE ( 0xe7e4, 0xe7e7 ) AM_READWRITE ( to770_gatearray_r,
775775                                                to770_gatearray_w )
776     AM_RANGE ( 0xe7e8, 0xe7eb ) AM_DEVREADWRITE("acia",  acia_6551_r, acia_6551_w )
776     AM_RANGE ( 0xe7e8, 0xe7eb ) AM_DEVREADWRITE_MODERN( "acia",  acia6551_device, data_r, data_w )
777777     AM_RANGE ( 0xe7f2, 0xe7f3 ) AM_READWRITE ( to7_midi_r, to7_midi_w )
778778     AM_RANGE ( 0xe7f8, 0xe7fb ) AM_DEVREADWRITE_MODERN( "pia_3", pia6821_device, read_alt, write_alt )
779779     AM_RANGE ( 0xe7fe, 0xe7ff ) AM_READWRITE ( to7_modem_mea8000_r,
r12758r12759
961961     AM_RANGE ( 0xa7e0, 0xa7e3 ) AM_DEVREADWRITE_MODERN( "pia_2", pia6821_device, read_alt, write_alt )
962962     AM_RANGE ( 0xa7e4, 0xa7e7 ) AM_READWRITE ( mo5_gatearray_r,
963963                  mo5_gatearray_w )
964     AM_RANGE ( 0xa7e8, 0xa7eb ) AM_DEVREADWRITE("acia",  acia_6551_r, acia_6551_w )
964     AM_RANGE ( 0xa7e8, 0xa7eb ) AM_DEVREADWRITE_MODERN( "acia",  acia6551_device, data_r, data_w )
965965     AM_RANGE ( 0xa7f2, 0xa7f3 ) AM_READWRITE ( to7_midi_r, to7_midi_w )
966966     AM_RANGE ( 0xa7fe, 0xa7ff ) AM_DEVREADWRITE("mea8000", mea8000_r, mea8000_w)
967967     AM_RANGE ( 0xb000, 0xefff ) AM_READ_BANK ( THOM_CART_BANK) AM_WRITE( mo5_cartridge_w )
r12758r12759
11631163     AM_RANGE ( 0xe7de, 0xe7df ) AM_READWRITE ( to9_kbd_r, to9_kbd_w )
11641164     AM_RANGE ( 0xe7e4, 0xe7e7 ) AM_READWRITE ( to9_gatearray_r,
11651165                  to9_gatearray_w )
1166     AM_RANGE ( 0xe7e8, 0xe7eb ) AM_DEVREADWRITE("acia",  acia_6551_r, acia_6551_w )
1166     AM_RANGE ( 0xe7e8, 0xe7eb ) AM_DEVREADWRITE_MODERN( "acia",  acia6551_device, data_r, data_w )
11671167/*   AM_RANGE ( 0xe7f0, 0xe7f7 ) AM_READWRITE ( to9_ieee_r, to9_ieee_w ) */
11681168     AM_RANGE ( 0xe7f2, 0xe7f3 ) AM_READWRITE ( to7_midi_r, to7_midi_w )
11691169     AM_RANGE ( 0xe7f8, 0xe7fb ) AM_DEVREADWRITE_MODERN( "pia_3", pia6821_device, read_alt, write_alt)
r12758r12759
14881488     AM_RANGE ( 0xe7da, 0xe7dd ) AM_READWRITE ( to8_vreg_r, to8_vreg_w )
14891489     AM_RANGE ( 0xe7e4, 0xe7e7 ) AM_READWRITE ( to8_gatearray_r,
14901490                  to8_gatearray_w )
1491     AM_RANGE ( 0xe7e8, 0xe7eb ) AM_DEVREADWRITE("acia",  acia_6551_r, acia_6551_w )
1491     AM_RANGE ( 0xe7e8, 0xe7eb ) AM_DEVREADWRITE_MODERN( "acia",  acia6551_device, data_r, data_w )
14921492/*   AM_RANGE ( 0xe7f0, 0xe7f7 ) AM_READWRITE ( to9_ieee_r, to9_ieee_w ) */
14931493     AM_RANGE ( 0xe7f2, 0xe7f3 ) AM_READWRITE ( to7_midi_r, to7_midi_w )
14941494     AM_RANGE ( 0xe7f8, 0xe7fb ) AM_DEVREADWRITE_MODERN( "pia_3", pia6821_device, read_alt, write_alt)
r12758r12759
16861686     AM_RANGE ( 0xe7de, 0xe7df ) AM_READWRITE ( to9_kbd_r, to9_kbd_w )
16871687     AM_RANGE ( 0xe7e4, 0xe7e7 ) AM_READWRITE ( to8_gatearray_r,
16881688                  to8_gatearray_w )
1689     AM_RANGE ( 0xe7e8, 0xe7eb ) AM_DEVREADWRITE("acia",  acia_6551_r, acia_6551_w )
1689     AM_RANGE ( 0xe7e8, 0xe7eb ) AM_DEVREADWRITE_MODERN( "acia",  acia6551_device, data_r, data_w )
16901690/*   AM_RANGE ( 0xe7f0, 0xe7f7 ) AM_READWRITE ( to9_ieee_r, to9_ieee_w ) */
16911691     AM_RANGE ( 0xe7f2, 0xe7f3 ) AM_READWRITE ( to7_midi_r, to7_midi_w )
16921692     AM_RANGE ( 0xe7f8, 0xe7fb ) AM_DEVREADWRITE_MODERN( "pia_3", pia6821_device, read_alt, write_alt)
r12758r12759
18481848     AM_RANGE ( 0xa7da, 0xa7dd ) AM_READWRITE ( mo6_vreg_r, mo6_vreg_w )
18491849     AM_RANGE ( 0xa7e4, 0xa7e7 ) AM_READWRITE ( mo6_gatearray_r,
18501850                  mo6_gatearray_w )
1851     AM_RANGE ( 0xa7e8, 0xa7eb ) AM_DEVREADWRITE("acia",  acia_6551_r, acia_6551_w )
1851     AM_RANGE ( 0xa7e8, 0xa7eb ) AM_DEVREADWRITE_MODERN( "acia",  acia6551_device, data_r, data_w )
18521852/*   AM_RANGE ( 0xa7f0, 0xa7f7 ) AM_READWRITE ( to9_ieee_r, to9_ieee_w )*/
18531853     AM_RANGE ( 0xa7f2, 0xa7f3 ) AM_READWRITE ( to7_midi_r, to7_midi_w )
18541854     AM_RANGE ( 0xa7fe, 0xa7ff ) AM_DEVREADWRITE("mea8000", mea8000_r, mea8000_w)
r12758r12759
21622162     AM_RANGE ( 0xa7e3, 0xa7e3 ) AM_READWRITE ( mo5nr_prn_r, mo5nr_prn_w )
21632163     AM_RANGE ( 0xa7e4, 0xa7e7 ) AM_READWRITE ( mo6_gatearray_r,
21642164                  mo6_gatearray_w )
2165     AM_RANGE ( 0xa7e8, 0xa7eb ) AM_DEVREADWRITE("acia",  acia_6551_r, acia_6551_w )
2165     AM_RANGE ( 0xa7e8, 0xa7eb ) AM_DEVREADWRITE_MODERN( "acia",  acia6551_device, data_r, data_w )
21662166/*   AM_RANGE ( 0xa7f0, 0xa7f7 ) AM_READWRITE ( to9_ieee_r, to9_ieee_w ) */
21672167     AM_RANGE ( 0xa7f2, 0xa7f3 ) AM_READWRITE ( to7_midi_r, to7_midi_w )
21682168     AM_RANGE ( 0xa7f8, 0xa7fb ) AM_DEVREADWRITE_MODERN( "pia_3", pia6821_device, read_alt, write_alt)
src/mess/drivers/oric.c
r12758r12759
7070   AM_RANGE( 0x0000, 0x02ff) AM_RAM
7171   AM_RANGE( 0x0300, 0x030f) AM_DEVREADWRITE_MODERN("via6522_0", via6522_device, read, write)
7272   AM_RANGE( 0x0310, 0x031b) AM_READWRITE( oric_microdisc_r, oric_microdisc_w )
73   AM_RANGE( 0x031c, 0x031f) AM_DEVREADWRITE("acia",  acia_6551_r, acia_6551_w )
73   AM_RANGE( 0x031c, 0x031f) AM_DEVREADWRITE_MODERN("acia",  acia6551_device, data_r, data_w)
7474   AM_RANGE( 0x0320, 0x032f) AM_DEVREADWRITE_MODERN("via6522_1", via6522_device, read, write)
7575   AM_RANGE( 0x0400, 0xbfff) AM_RAM
7676   AM_RANGE( 0xc000, 0xffff) AM_READ_BANK("bank1") AM_WRITE_BANK("bank2")
src/mess/drivers/microtan.c
r12758r12759
6060   AM_RANGE(0xbc02, 0xbc02) AM_DEVWRITE("ay8910.2", ay8910_address_w)
6161   AM_RANGE(0xbc03, 0xbc03) AM_DEVREADWRITE("ay8910.2", ay8910_r, ay8910_data_w)
6262   AM_RANGE(0xbfc0, 0xbfcf) AM_DEVREADWRITE_MODERN("via6522_0", via6522_device, read, write)
63   AM_RANGE(0xbfd0, 0xbfd3) AM_DEVREADWRITE("acia", acia_6551_r, acia_6551_w)
63   AM_RANGE(0xbfd0, 0xbfd3) AM_DEVREADWRITE_MODERN("acia", acia6551_device, data_r, data_w)
6464   AM_RANGE(0xbfe0, 0xbfef) AM_DEVREADWRITE_MODERN("via6522_1", via6522_device, read, write)
6565   AM_RANGE(0xbff0, 0xbfff) AM_READWRITE(microtan_bffx_r, microtan_bffx_w)
6666   AM_RANGE(0xc000, 0xe7ff) AM_ROM
src/mess/drivers/mits680b.c
r12758r12759
6868static ADDRESS_MAP_START(mits680b_mem, AS_PROGRAM, 8, mits680b_state)
6969   ADDRESS_MAP_UNMAP_HIGH
7070   AM_RANGE( 0x0000, 0x03ff ) AM_RAM // 1024 bytes RAM
71   //AM_RANGE( 0xf000, 0xf003 ) AM_DEVREADWRITE("acia",  acia_6551_r, acia_6551_w )
71   //AM_RANGE( 0xf000, 0xf003 ) AM_DEVREADWRITE("acia",  acia6551_device, data_r, data_w )
7272   AM_RANGE( 0xf000, 0xf000 ) AM_READ(terminal_status_r)
7373   AM_RANGE( 0xf001, 0xf001 ) AM_READ(terminal_r) AM_DEVWRITE_LEGACY(TERMINAL_TAG, terminal_write)
7474   AM_RANGE( 0xf002, 0xf002 ) AM_READ(status_check_r)
src/mess/drivers/digel804.c
r12758r12759
7272   required_device<cpu_device> m_maincpu;
7373   required_device<device_t> m_terminal;
7474   required_device<device_t> m_speaker;
75   required_device<device_t> m_acia;
75   required_device<acia6551_device> m_acia;
7676   DECLARE_WRITE8_MEMBER( port_43_w );
7777   DECLARE_READ8_MEMBER( port_43_r );
7878   DECLARE_WRITE8_MEMBER( port_44_w );
r12758r12759
261261/* ACIA Trampolines */
262262READ8_MEMBER( digel804_state::acia_rxd_r )
263263{
264   return acia_6551_r(m_acia, 0);
264   return m_acia->data_r(space, 0);
265265}
266266
267267WRITE8_MEMBER( digel804_state::acia_txd_w )
268268{
269   acia_6551_w(m_acia, 0, data);
269   m_acia->data_w(space, 0, data);
270270}
271271
272272READ8_MEMBER( digel804_state::acia_status_r )
273273{
274   return acia_6551_r(m_acia, 1);
274   return m_acia->data_r(space, 1);
275275}
276276
277277WRITE8_MEMBER( digel804_state::acia_reset_w )
278278{
279   acia_6551_w(m_acia, 1, data);
279   m_acia->data_w(space, 1, data);
280280}
281281
282282READ8_MEMBER( digel804_state::acia_command_r )
283283{
284   return acia_6551_r(m_acia, 2);
284   return m_acia->data_r(space, 2);
285285}
286286
287287WRITE8_MEMBER( digel804_state::acia_command_w )
288288{
289   acia_6551_w(m_acia, 2, data);
289   m_acia->data_w(space, 2, data);
290290}
291291
292292READ8_MEMBER( digel804_state::acia_control_r )
293293{
294   return acia_6551_r(m_acia, 3);
294   return m_acia->data_r(space, 3);
295295}
296296
297297WRITE8_MEMBER( digel804_state::acia_control_w )
298298{
299   acia_6551_w(m_acia, 3, data);
299   m_acia->data_w(space, 3, data);
300300}
301301
302302/******************************************************************************
r12758r12759
355355   AM_RANGE(0x85, 0x85) AM_MIRROR(0x38) AM_READ(acia_command_r) // (ACIA command reg)
356356   AM_RANGE(0x86, 0x86) AM_MIRROR(0x38) AM_WRITE(acia_control_w) // (ACIA control reg)
357357   AM_RANGE(0x87, 0x87) AM_MIRROR(0x38) AM_READ(acia_control_r) // (ACIA control reg)
358   //AM_RANGE(0x80,0x87) AM_MIRROR(0x38) AM_SHIFT(-1) AM_DEVREADWRITE_LEGACY("acia", acia_6551_r, acia_6551_w) // this doesn't work since we lack an AM_SHIFT command
358   //AM_RANGE(0x80,0x87) AM_MIRROR(0x38) AM_SHIFT(-1) AM_DEVREADWRITE("acia", acia6551_device, data_r, data_w) // this doesn't work since we lack an AM_SHIFT command
359359
360360ADDRESS_MAP_END
361361
r12758r12759
371371******************************************************************************/
372372static WRITE8_DEVICE_HANDLER( digel804_serial_put )
373373{
374   acia_6551_receive_char(device->machine().device("acia"), data);
374   digel804_state *state = device->machine().driver_data<digel804_state>();
375   state->m_acia->receive_character(data);
375376}
376377
377378static GENERIC_TERMINAL_INTERFACE( digel804_terminal_intf )
src/mess/drivers/aim65_40.c
r12758r12759
6161   AM_RANGE(0xffa0, 0xffaf) AM_DEVREADWRITE_MODERN(M6522_0_TAG, via6522_device, read, write)
6262   AM_RANGE(0xffb0, 0xffbf) AM_DEVREADWRITE_MODERN(M6522_1_TAG, via6522_device, read, write)
6363   AM_RANGE(0xffc0, 0xffcf) AM_DEVREADWRITE_MODERN(M6522_2_TAG, via6522_device, read, write)
64   AM_RANGE(0xffd0, 0xffd3) AM_DEVREADWRITE(M6551_TAG, acia_6551_r, acia_6551_w)
64   AM_RANGE(0xffd0, 0xffd3) AM_DEVREADWRITE_MODERN(M6551_TAG, acia6551_device, data_r, data_w)
6565   AM_RANGE(0xffe0, 0xffff) AM_ROM
6666ADDRESS_MAP_END
6767
src/mess/drivers/rvoice.c
r12758r12759
327327   ADDRESS_MAP_UNMAP_HIGH
328328   AM_RANGE(0x0000, 0x0027) AM_READWRITE(main_hd63701_internal_registers_r, main_hd63701_internal_registers_w) // INTERNAL REGS
329329   AM_RANGE(0x0040, 0x013f) AM_RAM // INTERNAL RAM (overlaps acia)
330   AM_RANGE(0x0060, 0x007f) AM_DEVREADWRITE( "acia65c51", acia_6551_r, acia_6551_w) // ACIA 65C51
330   AM_RANGE(0x0060, 0x007f) AM_DEVREADWRITE_MODERN("acia65c51", acia6551_device, data_r, data_w) // ACIA 65C51
331331   AM_RANGE(0x2000, 0x7fff) AM_RAM // EXTERNAL SRAM
332332   AM_RANGE(0x8000, 0xffff) AM_ROM // 27512 EPROM
333333ADDRESS_MAP_END
src/mess/drivers/ec65.c
r12758r12759
4646   AM_RANGE(0xe011, 0xe011) AM_DEVREADWRITE(ACIA6850_TAG, acia6850_device, data_read, data_write)
4747   AM_RANGE(0xe100, 0xe10f) AM_DEVREADWRITE(VIA6522_0_TAG, via6522_device, read, write)
4848   AM_RANGE(0xe110, 0xe11f) AM_DEVREADWRITE(VIA6522_1_TAG, via6522_device, read, write)
49   AM_RANGE(0xe130, 0xe133) AM_DEVREADWRITE_LEGACY(ACIA6551_TAG,  acia_6551_r, acia_6551_w )
49   AM_RANGE(0xe130, 0xe133) AM_DEVREADWRITE(ACIA6551_TAG,  acia6551_device, data_r, data_w)
5050   AM_RANGE(0xe140, 0xe140) AM_DEVWRITE(MC6845_TAG, mc6845_device, address_w)
5151   AM_RANGE(0xe141, 0xe141) AM_DEVREADWRITE(MC6845_TAG, mc6845_device, register_r , register_w)
5252   AM_RANGE(0xe400, 0xe7ff) AM_RAM // 1KB on-board RAM

Previous 15994 Revisions Next


© 1998-2018 The MESS Team