static READ8_DEVICE_HANDLER( r6532_portb_r ) { UINT8 newdata = riot6532_portb_in_get(device); if (has_tms5220) { running_device *tms = devtag_get_device(device->machine, "tms"); newdata &= ~0x0c; if (tms5220_readyq_r(tms)) newdata |= 0x04; if (tms5220_intq_r(tms)) newdata |= 0x08; } return newdata; }
/* TMS7041 PORT A A0 - X1 NDSR A8 A1 - X1 MDTR A9 A2 - R - TMS7020 port B bit 0 (REV2) A3 - TMS5220 IRQ A4 - R - TMS7020 port B bit 1 (REV4) A5 - X1 RXD A4 (version b) / WX301-14 (version a) A6 - X1 SCLK A9 A7 - TMS5220 RDY */ static READ8_HANDLER(tms7041_porta_r) { exelv_state *state = space->machine().driver_data<exelv_state>(); device_t *tms5220c = space->machine().device( "tms5220c" ); UINT8 data = 0x00; logerror("tms7041_porta_r\n"); data |= ( state->m_tms7020_portb & 0x01 ) ? 0x04 : 0x00; data |= tms5220_intq_r( tms5220c ) ? 0x08 : 0x00; data |= ( state->m_tms7020_portb & 0x02 ) ? 0x10 : 0x00; data |= tms5220_readyq_r( tms5220c ) ? 0x80 : 0x00; return data; }