mc6805: Timer updates

- Allow timer prescaler and mode to be determined by configuration parameters on models for which these are not otherwise programmable (P2, P6, R2 and U2 models)
- Change default value of timer input from 0 to 1
This commit is contained in:
AJR 2022-06-04 16:25:10 -04:00
parent 40b9053059
commit 324e79adc9
2 changed files with 26 additions and 2 deletions

View File

@ -809,7 +809,8 @@ m6805p2_device::m6805p2_device(machine_config const &mconfig, char const *tag, d
* support prescalar clear, however the 1988 databook indicates the
* M6805P2 does?
*/
//m_timer.set_options(m6805_timer::TIMER_NPC);
m_timer.set_options(m6805_timer::TIMER_MOR /* | m6805::TIMER_NPC */);
m_timer.set_source(m6805_timer::CLOCK_TIMER);
set_port_mask<2>(0xf0); // Port C is four bits wide
set_port_mask<3>(0xff); // Port D isn't present
@ -818,6 +819,9 @@ m6805p2_device::m6805p2_device(machine_config const &mconfig, char const *tag, d
m6805p6_device::m6805p6_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock)
: m6805_mrom_device(mconfig, tag, owner, clock, M6805P6, 11, 64)
{
m_timer.set_options(m6805_timer::TIMER_MOR /* | m6805::TIMER_NPC */);
m_timer.set_source(m6805_timer::CLOCK_TIMER);
set_port_mask<2>(0xf0); // Port C is four bits wide
set_port_mask<3>(0xff); // Port D isn't present
}
@ -825,6 +829,8 @@ m6805p6_device::m6805p6_device(machine_config const &mconfig, char const *tag, d
m6805r2_device::m6805r2_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock)
: m6805_mrom_device(mconfig, tag, owner, clock, M6805R2, 12, 64)
{
m_timer.set_options(m6805_timer::TIMER_MOR);
m_timer.set_source(m6805_timer::CLOCK_TIMER);
}
m6805r3_device::m6805r3_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock)
@ -836,6 +842,8 @@ m6805r3_device::m6805r3_device(machine_config const &mconfig, char const *tag, d
m6805u2_device::m6805u2_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock)
: m6805_mrom_device(mconfig, tag, owner, clock, M6805U2, 12, 64)
{
m_timer.set_options(m6805_timer::TIMER_MOR);
m_timer.set_source(m6805_timer::CLOCK_TIMER);
}
m6805u3_device::m6805u3_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock)

View File

@ -48,7 +48,7 @@ public:
, m_options(0)
, m_divisor(7)
, m_source(CLOCK)
, m_timer(false)
, m_timer(true)
{
}
@ -335,12 +335,20 @@ class m6805p2_device : public m6805_mrom_device
{
public:
m6805p2_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock);
// mask options
void set_timer_divisor(unsigned divisor) { m_timer.set_divisor(divisor); }
void set_timer_external_source(bool external) { m_timer.set_source(external ? m6805_timer::TIMER : m6805_timer::CLOCK_TIMER); }
};
class m6805p6_device : public m6805_mrom_device
{
public:
m6805p6_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock);
// mask options
void set_timer_divisor(unsigned divisor) { m_timer.set_divisor(divisor); }
void set_timer_external_source(bool external) { m_timer.set_source(external ? m6805_timer::TIMER : m6805_timer::CLOCK_TIMER); }
};
class m6805r2_device : public m6805_mrom_device
@ -348,6 +356,10 @@ class m6805r2_device : public m6805_mrom_device
public:
m6805r2_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock);
// mask options
void set_timer_divisor(unsigned divisor) { m_timer.set_divisor(divisor); }
void set_timer_external_source(bool external) { m_timer.set_source(external ? m6805_timer::TIMER : m6805_timer::CLOCK_TIMER); }
protected:
virtual void internal_map(address_map &map) override;
};
@ -365,6 +377,10 @@ class m6805u2_device : public m6805_mrom_device
{
public:
m6805u2_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock);
// mask options
void set_timer_divisor(unsigned divisor) { m_timer.set_divisor(divisor); }
void set_timer_external_source(bool external) { m_timer.set_source(external ? m6805_timer::TIMER : m6805_timer::CLOCK_TIMER); }
};
class m6805u3_device : public m6805_mrom_device