io992: Use object finders (nw)

This commit is contained in:
AJR 2018-05-21 13:24:52 -04:00
parent fd4fe2c91e
commit 15efd49e3a
2 changed files with 10 additions and 8 deletions

View File

@ -349,6 +349,10 @@ void video992_device::device_reset()
io992_device::io992_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
: bus::hexbus::hexbus_chained_device(mconfig, type, tag, owner, clock),
m_hexbus(*this, "^" TI_HEXBUS_TAG),
m_cassette(*this, "^" TI_CASSETTE),
m_videoctrl(*this, "^" TI992_VDC_TAG),
m_keyboard(*this, "LINE%u", 0U),
m_set_rom_bank(*this),
m_key_row(0),
m_latch_out(0xd7),
@ -444,9 +448,7 @@ INPUT_PORTS_END
void io992_device::device_start()
{
m_hexbus_outbound = dynamic_cast<bus::hexbus::hexbus_device*>(machine().device(TI_HEXBUS_TAG));
m_cassette = dynamic_cast<cassette_image_device*>(machine().device(TI_CASSETTE));
m_videoctrl = dynamic_cast<video992_device*>(machine().device(TI992_VDC_TAG));
set_outbound_hexbus(m_hexbus.target());
// Establish callback for inbound propagations
m_hexbus_outbound->set_chain_element(this);
@ -456,8 +458,6 @@ void io992_device::device_start()
READ8_MEMBER(io992_device::cruread)
{
static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7" };
int address = offset << 4;
uint8_t value = 0x7f; // All Hexbus lines high
double inp = 0;
@ -469,7 +469,7 @@ READ8_MEMBER(io992_device::cruread)
case 0xe000:
// CRU E000-E7fE: Keyboard
// Read: 0000 1110 0*** **** (mirror 007f)
value = ioport(keynames[m_key_row])->read();
value = m_keyboard[m_key_row]->read();
break;
case 0xe800:
// CRU E800-EFFE: Hexbus and other functions

View File

@ -117,8 +117,10 @@ protected:
private:
const uint8_t m_hexbval[6] = { 0x01, 0x02, 0x40, 0x80, 0x10, 0x04 };
cassette_image_device* m_cassette;
video992_device* m_videoctrl;
required_device<hexbus::hexbus_device> m_hexbus;
required_device<cassette_image_device> m_cassette;
required_device<video992_device> m_videoctrl;
required_ioport_array<8> m_keyboard;
// Set ROM bank
devcb_write_line m_set_rom_bank;