From 97434990fa8b5fbe595aeb3d7785648d6c3ade1d Mon Sep 17 00:00:00 2001 From: hap Date: Sun, 4 Jun 2023 17:12:49 +0200 Subject: addocalc: remove power off timer --- src/mame/handheld/hh_pps41.cpp | 28 ++++++++++++++-------------- src/mame/handheld/hh_tms1k.cpp | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/mame/handheld/hh_pps41.cpp b/src/mame/handheld/hh_pps41.cpp index 56474b4e62e..2212c8a5f91 100644 --- a/src/mame/handheld/hh_pps41.cpp +++ b/src/mame/handheld/hh_pps41.cpp @@ -164,17 +164,14 @@ class addocalc_state : public hh_pps41_state { public: addocalc_state(const machine_config &mconfig, device_type type, const char *tag) : - hh_pps41_state(mconfig, type, tag), - m_power_timer(*this, "power") + hh_pps41_state(mconfig, type, tag) { } void addocalc(machine_config &config); - virtual DECLARE_INPUT_CHANGED_MEMBER(power_button) override { hh_pps41_state::power_button(field, param, oldval, newval); update_int(); } + virtual DECLARE_INPUT_CHANGED_MEMBER(power_button) override; private: - required_device m_power_timer; - virtual void update_int() override; void update_display(); void write_d(u16 data); @@ -182,15 +179,20 @@ private: u8 read_p(); void write_ssc(int state); void write_sdo(int state); - - TIMER_DEVICE_CALLBACK_MEMBER(power_off) { set_power(false); } }; // handlers +INPUT_CHANGED_MEMBER(addocalc_state::power_button) +{ + hh_pps41_state::power_button(field, param, oldval, newval); + + // ON/OFF button is also tied to INT1 (see below) + update_int(); +} + void addocalc_state::update_int() { - // ON/OFF button is tied to INT1 m_maincpu->set_input_line(1, (m_inputs[7]->read() & 1) ? ASSERT_LINE : CLEAR_LINE); } @@ -229,10 +231,9 @@ void addocalc_state::write_ssc(int state) void addocalc_state::write_sdo(int state) { - // DATAO: trigger power off after a short delay - if (state != m_sdo) - m_power_timer->adjust(state ? attotime::from_msec(50) : attotime::never); - + // DATAO: power off on rising edge + if (state && !m_sdo) + set_power(false); m_sdo = state; } @@ -296,8 +297,7 @@ void addocalc_state::addocalc(machine_config &config) m_maincpu->read_p().set(FUNC(addocalc_state::read_p)); m_maincpu->write_ssc().set(FUNC(addocalc_state::write_ssc)); m_maincpu->write_sdo().set(FUNC(addocalc_state::write_sdo)); - - TIMER(config, "power").configure_generic(FUNC(addocalc_state::power_off)); + m_maincpu->read_sdi().set_constant(0); // video hardware PWM_DISPLAY(config, m_display).set_size(11, 8); diff --git a/src/mame/handheld/hh_tms1k.cpp b/src/mame/handheld/hh_tms1k.cpp index 35c57ba59dc..e0e44bfeda1 100644 --- a/src/mame/handheld/hh_tms1k.cpp +++ b/src/mame/handheld/hh_tms1k.cpp @@ -11179,7 +11179,7 @@ static const u16 comparc_output_pla[0x20] = void comparc_state::comparc(machine_config &config) { // basic machine hardware - TMS1100(config, m_maincpu, 400000); // approximation - RC osc. R=39K, C=47pF + TMS1100(config, m_maincpu, 375000); // approximation - RC osc. R=39K, C=47pF m_maincpu->set_output_pla(comparc_output_pla); m_maincpu->read_k().set(FUNC(comparc_state::read_k)); m_maincpu->write_r().set(FUNC(comparc_state::write_r)); -- cgit v1.2.3