diff options
author | R. Belmont <rb6502@users.noreply.github.com> | 2009-09-20 00:45:39 +0000 |
---|---|---|
committer | R. Belmont <rb6502@users.noreply.github.com> | 2009-09-20 00:45:39 +0000 |
commit | 5b546d6f6c3d601758b933bd77c5303fcb5587bd (patch) | |
tree | b61d3790cfd0cdb35b37e716cb87e9ad12fefad6 | |
parent | b56b22c2f89c305798f66a8e4487e9c0bba471f7 (diff) |
Support external baud rates in the MC68681 DUART
-rw-r--r-- | src/emu/machine/68681.c | 25 | ||||
-rw-r--r-- | src/emu/machine/68681.h | 3 |
2 files changed, 27 insertions, 1 deletions
diff --git a/src/emu/machine/68681.c b/src/emu/machine/68681.c index e84245f0a82..4136c2e9bb9 100644 --- a/src/emu/machine/68681.c +++ b/src/emu/machine/68681.c @@ -8,7 +8,7 @@ #include "driver.h" #include "68681.h" -#define VERBOSE 0 +#define VERBOSE 1 #define LOG(x) do { if (VERBOSE) logerror x; } while (0) static const char *const duart68681_reg_read_names[0x10] = @@ -269,6 +269,29 @@ static void duart68681_write_CSR(duart68681_state *duart68681, int ch, UINT8 dat if ( BIT(ACR,7) == 0 ) { duart68681->channel[ch].baud_rate = baud_rate_ACR_0[data & 0x0f]; + + if (ch == 0) + { + if ((data & 0xf) == 0xe) + { + duart68681->channel[ch].baud_rate = duart68681->duart_config->ip3clk/16; + } + else if ((data & 0xf) == 0xf) + { + duart68681->channel[ch].baud_rate = duart68681->duart_config->ip3clk; + } + } + else if (ch == 1) + { + if ((data & 0xf) == 0xe) + { + duart68681->channel[ch].baud_rate = duart68681->duart_config->ip5clk/16; + } + else if ((data & 0xf) == 0xf) + { + duart68681->channel[ch].baud_rate = duart68681->duart_config->ip5clk; + } + } } else { diff --git a/src/emu/machine/68681.h b/src/emu/machine/68681.h index 8210e08acaf..83947707542 100644 --- a/src/emu/machine/68681.h +++ b/src/emu/machine/68681.h @@ -8,6 +8,9 @@ struct _duart68681_config void (*tx_callback)(const device_config *device, int channel, UINT8 data); UINT8 (*input_port_read)(const device_config *device); void (*output_port_write)(const device_config *device, UINT8 data); + + /* clocks for external baud rates */ + INT32 ip3clk, ip4clk, ip5clk, ip6clk; }; #define DUART68681 DEVICE_GET_INFO_NAME(duart68681) |