462
static void r6532_porta_w(const device_config *device, UINT8 newdata, UINT8 olddata)
462
static WRITE8_DEVICE_HANDLER( r6532_porta_w )
465
cputag_set_input_line(device->machine, "cvsdcpu", INPUT_LINE_RESET, (newdata & 0x10) ? CLEAR_LINE : ASSERT_LINE);
469
static void r6532_portb_w(const device_config *device, UINT8 newdata, UINT8 olddata)
471
const device_config *tms = devtag_get_device(device->machine, "tms");
474
if ((olddata & 0x01) && !(newdata & 0x01))
476
riot6532_porta_in_set(riot, tms5220_status_r(tms, 0), 0xff);
477
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));
479
if ((olddata & 0x02) && !(newdata & 0x02))
481
logerror("(%f)%s:TMS5220 data write = %02X\n", attotime_to_double(timer_get_time(device->machine)), cpuexec_describe_context(device->machine), riot6532_porta_out_get(riot));
482
tms5220_data_w(tms, 0, riot6532_porta_out_get(riot));
488
static UINT8 r6532_portb_r(const device_config *device, UINT8 olddata)
490
UINT8 newdata = olddata;
465
cputag_set_input_line(device->machine, "cvsdcpu", INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
469
const device_config *tms = devtag_get_device(device->machine, "tms");
470
logerror("(%f)%s:TMS5220 data write = %02X\n", attotime_to_double(timer_get_time(device->machine)), cpuexec_describe_context(device->machine), riot6532_porta_out_get(riot));
471
tms5220_data_w(tms, 0, data);
475
static READ8_DEVICE_HANDLER( r6532_porta_r )
479
const device_config *tms = devtag_get_device(device->machine, "tms");
480
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));
481
return tms5220_status_r(tms, 0);
487
static WRITE8_DEVICE_HANDLER( r6532_portb_w )
491
const device_config *tms = devtag_get_device(device->machine, "tms");
493
tms5220_rsq_w(tms, data & 0x01);
494
tms5220_wsq_w(tms, (data >> 1) & 0x01);
499
static READ8_DEVICE_HANDLER( r6532_portb_r )
501
UINT8 newdata = riot6532_portb_in_get(device);
493
504
const device_config *tms = devtag_get_device(device->machine, "tms");
494
505
newdata &= ~0x0c;
495
if (!tms5220_ready_r(tms)) newdata |= 0x04;
496
if (!tms5220_int_r(tms)) newdata |= 0x08;
506
if (tms5220_readyq_r(tms)) newdata |= 0x04;
507
if (tms5220_intq_r(tms)) newdata |= 0x08;
502
513
static const riot6532_interface r6532_interface =
504
NULL, /* port A read handler */
505
r6532_portb_r, /* port B read handler */
506
r6532_porta_w, /* port A write handler */
507
r6532_portb_w, /* port B write handler */
508
r6532_irq /* IRQ callback */
515
DEVCB_HANDLER(r6532_porta_r), /* port A read handler */
516
DEVCB_HANDLER(r6532_portb_r), /* port B read handler */
517
DEVCB_HANDLER(r6532_porta_w), /* port A write handler */
518
DEVCB_HANDLER(r6532_portb_w), /* port B write handler */
519
DEVCB_LINE(r6532_irq) /* IRQ callback */