hp64k: moved baud rate generator from generic clock to com8116

This commit is contained in:
fulivi 2015-09-08 14:41:35 +02:00
parent efa3a679a3
commit c79dd5981b

View File

@ -156,7 +156,7 @@
#include "machine/74123.h"
#include "machine/rescap.h"
#include "sound/beep.h"
#include "machine/clock.h"
#include "machine/com8116.h"
#include "machine/i8251.h"
#include "bus/rs232/rs232.h"
@ -166,8 +166,6 @@
#define BIT_CLR(w , n) ((w) &= ~BIT_MASK(n))
#define BIT_SET(w , n) ((w) |= BIT_MASK(n))
#define BAUD_RATE_GEN_CLOCK 5068800
class hp64k_state : public driver_device
{
public:
@ -248,7 +246,7 @@ private:
required_ioport m_rs232_sw;
required_device<beep_device> m_beeper;
required_device<timer_device> m_beep_timer;
required_device<clock_device> m_baud_rate;
required_device<com8116_device> m_baud_rate;
required_ioport m_s5_sw;
required_device<i8251_device> m_uart;
required_device<rs232_port_device> m_rs232;
@ -385,26 +383,6 @@ void hp64k_state::video_start()
m_chargen = memregion("chargen")->base();
}
// Divisors of K1135 baud rate generator
static unsigned baud_rate_divisors[] = {
6336,
4224,
2880,
2355,
2112,
1056,
528,
264,
176,
158,
132,
88,
66,
44,
33,
16
};
void hp64k_state::machine_reset()
{
m_crtc_drq = false;
@ -428,7 +406,7 @@ void hp64k_state::machine_reset()
m_floppy0_wpt = false;
m_floppy1_wpt = false;
m_beeper->set_state(0);
m_baud_rate->set_unscaled_clock(BAUD_RATE_GEN_CLOCK / baud_rate_divisors[ (m_s5_sw->read() >> 1) & 0xf ]);
m_baud_rate->str_w((m_s5_sw->read() >> 1) & 0xf);
m_16x_clk = (m_rs232_sw->read() & 0x02) != 0;
m_loopback = false;
m_txd_state = true;
@ -1410,8 +1388,8 @@ static MACHINE_CONFIG_START(hp64k , hp64k_state)
MCFG_TIMER_DRIVER_ADD("beep_timer" , hp64k_state , hp64k_beeper_off);
MCFG_DEVICE_ADD("baud_rate" , CLOCK , 0)
MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(hp64k_state , hp64k_baud_clk_w));
MCFG_DEVICE_ADD("baud_rate" , COM8116 , XTAL_5_0688MHz)
MCFG_COM8116_FR_HANDLER(WRITELINE(hp64k_state , hp64k_baud_clk_w));
MCFG_DEVICE_ADD("uart" , I8251 , 0)
MCFG_I8251_RXRDY_HANDLER(WRITELINE(hp64k_state , hp64k_rxrdy_w));