static void snd_q(int data) { q = data; if (data) { UINT8 val = tms5220_status_r(0); sndlocals.ef[3] = !((val & 0x40) >> 6); sndlocals.ef[4] = ((val & 0x80) >> 7); printf("i"); } else {
static WRITE_HANDLER(nuova_pia_b_w) { if (~data & 0x02) // write tms5220_data_w(0, locals.pia_a); if (~data & 0x01) // read locals.pia_a = tms5220_status_r(0); pia_set_input_ca2(2, 1); locals.pia_b = data; }
UINT8 a2bus_echoii_device::read_c0nx(address_space &space, UINT8 offset) { switch (offset) { case 0: return 0x1f | tms5220_status_r(m_tms, space, 0); } return 0; }
static READ8_DEVICE_HANDLER( r6532_porta_r ) { if (has_tms5220) { running_device *tms = devtag_get_device(device->machine, "tms"); logerror("(%f)%s:TMS5220 status read = %02X\n", attotime_to_double(timer_get_time(device->machine)), cpuexec_describe_context(device->machine), tms5220_status_r(tms, 0)); return tms5220_status_r(tms, 0); } else return 0xff; }
static READ8_DEVICE_HANDLER( r6532_porta_r ) { exidy_sound_state *state = get_safe_token(device); if (state->m_tms != NULL) { logerror("(%f)%s:TMS5220 status read = %02X\n", space.machine().time().as_double(), space.machine().describe_context(), tms5220_status_r(state->m_tms, space, 0)); return tms5220_status_r(state->m_tms, space, 0); } else return 0xff; }
/* TMS5200 speech chip read */ static READ8_HANDLER ( geneve_speech_r ) { activecpu_adjust_icount(-8); /* this is just a minimum, it can be more */ return tms5220_status_r(offset); }
static WRITE8_HANDLER( exidy_shriot_w ) { /* I/O is done if A2 == 0 */ if ((offset & 0x04) == 0) { switch (offset & 0x03) { case 0: /* port A */ if (has_mc3417) cpunum_set_input_line(machine, 2, INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); riot_porta_data = (riot_porta_data & ~riot_porta_ddr) | (data & riot_porta_ddr); break; case 1: /* port A DDR */ riot_porta_ddr = data; break; case 2: /* port B */ if (has_tms5220) { if (!(data & 0x01) && (riot_portb_data & 0x01)) { riot_porta_data = tms5220_status_r(machine, 0); logerror("(%f)%04X:TMS5220 status read = %02X\n", attotime_to_double(timer_get_time()), activecpu_get_previouspc(), riot_porta_data); } if (!(data & 0x02) && (riot_portb_data & 0x02)) { logerror("(%f)%04X:TMS5220 data write = %02X\n", attotime_to_double(timer_get_time()), activecpu_get_previouspc(), riot_porta_data); tms5220_data_w(machine, 0, riot_porta_data); } } riot_portb_data = (riot_portb_data & ~riot_portb_ddr) | (data & riot_portb_ddr); break; case 3: /* port B DDR */ riot_portb_ddr = data; break; } } /* PA7 edge detect control if A2 == 1 and A4 == 0 */ else if ((offset & 0x10) == 0) { riot_PA7_irq_enable = offset & 0x03; } /* timer enable if A2 == 1 and A4 == 1 */ else { static const int divisors[4] = { 1, 8, 64, 1024 }; /* make sure the IRQ state is clear */ if (riot_state != RIOT_COUNT) riot_irq_flag &= ~0x80; riot_irq_state = 0; update_irq_state(0); /* set the enable from the offset */ riot_timer_irq_enable = (offset & 0x08) ? 1 : 0; /* set a new timer */ riot_clock_divisor = divisors[offset & 0x03]; timer_adjust_oneshot(riot_timer, attotime_mul(ATTOTIME_IN_HZ(SH6532_CLOCK), data * riot_clock_divisor), 0); riot_state = RIOT_COUNT; } }