mirror of
https://github.com/holub/mame
synced 2025-05-02 04:31:01 +03:00
lc80.cpp, poly880.cpp: Use output finders (nw)
This commit is contained in:
parent
ed7253e918
commit
fe7fa9c237
@ -141,11 +141,10 @@ WRITE_LINE_MEMBER( lc80_state::ctc_z2_w )
|
||||
|
||||
void lc80_state::update_display()
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 6; i++)
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
if (!BIT(m_digit, i)) output().set_digit_value(5 - i, m_segment);
|
||||
if (!BIT(m_digit, i))
|
||||
m_digits[5 - i] = m_segment;
|
||||
}
|
||||
}
|
||||
|
||||
@ -215,7 +214,7 @@ WRITE8_MEMBER( lc80_state::pio1_pb_w )
|
||||
m_speaker->level_w(!BIT(data, 1));
|
||||
|
||||
/* OUT led */
|
||||
output().set_led_value(0, !BIT(data, 1));
|
||||
m_out_led = !BIT(data, 1);
|
||||
|
||||
/* keyboard */
|
||||
m_digit = data >> 2;
|
||||
@ -248,10 +247,10 @@ READ8_MEMBER( lc80_state::pio2_pb_r )
|
||||
{
|
||||
if (!BIT(m_digit, i))
|
||||
{
|
||||
if (!BIT(m_y0->read(), i)) data &= ~0x10;
|
||||
if (!BIT(m_y1->read(), i)) data &= ~0x20;
|
||||
if (!BIT(m_y2->read(), i)) data &= ~0x40;
|
||||
if (!BIT(m_y3->read(), i)) data &= ~0x80;
|
||||
if (!BIT(m_y[0]->read(), i)) data &= ~0x10;
|
||||
if (!BIT(m_y[1]->read(), i)) data &= ~0x20;
|
||||
if (!BIT(m_y[2]->read(), i)) data &= ~0x40;
|
||||
if (!BIT(m_y[3]->read(), i)) data &= ~0x80;
|
||||
}
|
||||
}
|
||||
|
||||
@ -320,6 +319,9 @@ void lc80_state::machine_start()
|
||||
break;
|
||||
}
|
||||
|
||||
m_digits.resolve();
|
||||
m_out_led.resolve();
|
||||
|
||||
/* register for state saving */
|
||||
save_item(NAME(m_digit));
|
||||
save_item(NAME(m_segment));
|
||||
|
@ -46,11 +46,10 @@ Test Paste:
|
||||
|
||||
void poly880_state::update_display()
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 8; i++)
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
if (BIT(m_digit, i)) output().set_digit_value(7 - i, m_segment);
|
||||
if (BIT(m_digit, i))
|
||||
m_digits[7 - i] = m_segment;
|
||||
}
|
||||
}
|
||||
|
||||
@ -191,9 +190,9 @@ READ8_MEMBER( poly880_state::pio1_pb_r )
|
||||
{
|
||||
if (BIT(m_digit, i))
|
||||
{
|
||||
if (!BIT(m_ki1->read(), i)) data &= ~0x10;
|
||||
if (!BIT(m_ki2->read(), i)) data &= ~0x20;
|
||||
if (!BIT(m_ki3->read(), i)) data &= ~0x80;
|
||||
if (!BIT(m_ki[0]->read(), i)) data &= ~0x10;
|
||||
if (!BIT(m_ki[1]->read(), i)) data &= ~0x20;
|
||||
if (!BIT(m_ki[2]->read(), i)) data &= ~0x80;
|
||||
}
|
||||
}
|
||||
|
||||
@ -237,6 +236,8 @@ static const z80_daisy_config poly880_daisy_chain[] =
|
||||
|
||||
void poly880_state::machine_start()
|
||||
{
|
||||
m_digits.resolve();
|
||||
|
||||
/* register for state saving */
|
||||
save_item(NAME(m_digit));
|
||||
save_item(NAME(m_segment));
|
||||
|
@ -30,10 +30,9 @@ public:
|
||||
m_cassette(*this, "cassette"),
|
||||
m_speaker(*this, "speaker"),
|
||||
m_ram(*this, RAM_TAG),
|
||||
m_y0(*this, "Y0"),
|
||||
m_y1(*this, "Y1"),
|
||||
m_y2(*this, "Y2"),
|
||||
m_y3(*this, "Y3")
|
||||
m_y(*this, "Y%u", 0U),
|
||||
m_digits(*this, "digit%u", 0U),
|
||||
m_out_led(*this, "led0")
|
||||
{ }
|
||||
|
||||
required_device<cpu_device> m_maincpu;
|
||||
@ -41,10 +40,9 @@ public:
|
||||
required_device<cassette_image_device> m_cassette;
|
||||
required_device<speaker_sound_device> m_speaker;
|
||||
required_device<ram_device> m_ram;
|
||||
required_ioport m_y0;
|
||||
required_ioport m_y1;
|
||||
required_ioport m_y2;
|
||||
required_ioport m_y3;
|
||||
required_ioport_array<4> m_y;
|
||||
output_finder<6> m_digits;
|
||||
output_finder<> m_out_led;
|
||||
|
||||
virtual void machine_start() override;
|
||||
|
||||
|
@ -26,16 +26,14 @@ public:
|
||||
: driver_device(mconfig, type, tag),
|
||||
m_maincpu(*this, Z80_TAG),
|
||||
m_cassette(*this, "cassette"),
|
||||
m_ki1(*this, "KI1"),
|
||||
m_ki2(*this, "KI2"),
|
||||
m_ki3(*this, "KI3")
|
||||
m_ki(*this, "KI%u", 1U),
|
||||
m_digits(*this, "digit%u", 0U)
|
||||
{ }
|
||||
|
||||
required_device<cpu_device> m_maincpu;
|
||||
required_device<cassette_image_device> m_cassette;
|
||||
required_ioport m_ki1;
|
||||
required_ioport m_ki2;
|
||||
required_ioport m_ki3;
|
||||
required_ioport_array<3> m_ki;
|
||||
output_finder<8> m_digits;
|
||||
|
||||
virtual void machine_start() override;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user