Previous 15994 Revisions Next

r5812 Sunday 20th September, 2009 at 00:46:03 UTC by R. Belmont
Support external baud rates in the MC68681 DUART
[src/emu/machine]68681.c 68681.h

src/emu/machine/68681.c
r5811r5812
88#include "driver.h"
99#include "68681.h"
1010
11#define VERBOSE
11#define VERBOSE 1
1212#define LOG(x)   do { if (VERBOSE) logerror x; } while (0)
1313
1414static const char *const duart68681_reg_read_names[0x10] =
r5811r5812
269269   if ( BIT(ACR,7) == 0 )
270270   {
271271      duart68681->channel[ch].baud_rate = baud_rate_ACR_0[data & 0x0f];
272
273      if (ch == 0)
274      {
275         if ((data & 0xf) == 0xe)
276         {
277            duart68681->channel[ch].baud_rate = duart68681->duart_config->ip3clk/16;
278         }
279         else if ((data & 0xf) == 0xf)
280         {
281            duart68681->channel[ch].baud_rate = duart68681->duart_config->ip3clk;
282         }
283      }
284      else if (ch == 1)
285      {
286         if ((data & 0xf) == 0xe)
287         {
288            duart68681->channel[ch].baud_rate = duart68681->duart_config->ip5clk/16;
289         }
290         else if ((data & 0xf) == 0xf)
291         {
292            duart68681->channel[ch].baud_rate = duart68681->duart_config->ip5clk;
293         }
294      }
272295   }
273296   else
274297   {
src/emu/machine/68681.h
r5811r5812
88   void (*tx_callback)(const device_config *device, int channel, UINT8 data);
99   UINT8 (*input_port_read)(const device_config *device);
1010   void (*output_port_write)(const device_config *device, UINT8 data);
11
12   /* clocks for external baud rates */
13   INT32 ip3clk, ip4clk, ip5clk, ip6clk;
1114};
1215
1316#define DUART68681 DEVICE_GET_INFO_NAME(duart68681)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team