summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/mpf1.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/mpf1.cpp')
-rw-r--r--src/mame/drivers/mpf1.cpp24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/mame/drivers/mpf1.cpp b/src/mame/drivers/mpf1.cpp
index ac2d46bd258..468c9b8af0f 100644
--- a/src/mame/drivers/mpf1.cpp
+++ b/src/mame/drivers/mpf1.cpp
@@ -251,12 +251,9 @@ INPUT_PORTS_END
TIMER_CALLBACK_MEMBER(mpf1_state::led_refresh)
{
- if (BIT(m_lednum, 5)) output().set_digit_value(0, param);
- if (BIT(m_lednum, 4)) output().set_digit_value(1, param);
- if (BIT(m_lednum, 3)) output().set_digit_value(2, param);
- if (BIT(m_lednum, 2)) output().set_digit_value(3, param);
- if (BIT(m_lednum, 1)) output().set_digit_value(4, param);
- if (BIT(m_lednum, 0)) output().set_digit_value(5, param);
+ for (int digit = 0; digit < 6; digit++)
+ if (BIT(m_lednum, 5 - digit))
+ m_digits[digit] = param;
}
READ8_MEMBER( mpf1_state::ppi_pa_r )
@@ -264,12 +261,9 @@ READ8_MEMBER( mpf1_state::ppi_pa_r )
uint8_t data = 0x7f;
/* bit 0 to 5, keyboard rows 0 to 5 */
- if (!BIT(m_lednum, 0)) data &= m_pc0->read();
- if (!BIT(m_lednum, 1)) data &= m_pc1->read();
- if (!BIT(m_lednum, 2)) data &= m_pc2->read();
- if (!BIT(m_lednum, 3)) data &= m_pc3->read();
- if (!BIT(m_lednum, 4)) data &= m_pc4->read();
- if (!BIT(m_lednum, 5)) data &= m_pc5->read();
+ for (int row = 0; row < 6; row++)
+ if (!BIT(m_lednum, row))
+ data &= m_pc[row]->read();
/* bit 6, user key */
data &= m_special->read() & 1 ? 0xff : 0xbf;
@@ -305,7 +299,7 @@ WRITE8_MEMBER( mpf1_state::ppi_pc_w )
}
/* bit 7, tape output, tone and led */
- output().set_led_value(0, !BIT(data, 7));
+ m_leds[0] = !BIT(data, 7);
m_speaker->level_w(BIT(data, 7));
m_cassette->output( BIT(data, 7) ? 1.0 : -1.0);
}
@@ -339,12 +333,14 @@ TIMER_DEVICE_CALLBACK_MEMBER(mpf1_state::check_halt_callback)
// halt-LED; the red one, is turned on when the processor is halted
// TODO: processor seems to halt, but restarts(?) at 0x0000 after a while -> fix
int64_t led_halt = m_maincpu->state_int(Z80_HALT);
- output().set_led_value(1, led_halt);
+ m_leds[1] = led_halt;
}
void mpf1_state::machine_start()
{
m_led_refresh_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(mpf1_state::led_refresh),this));
+ m_digits.resolve();
+ m_leds.resolve();
/* register for state saving */
save_item(NAME(m_break));