diff --git a/src/emu/machine/6821pia.c b/src/emu/machine/6821pia.c index 317440f7dd9..c279bdd9c3a 100644 --- a/src/emu/machine/6821pia.c +++ b/src/emu/machine/6821pia.c @@ -553,7 +553,7 @@ static UINT8 control_a_r(running_device *device) /* update CA1 & CA2 if callback exists, these in turn may update IRQ's */ if (p->in_ca1_func.read != NULL) - pia6821_ca1_w(device, 0, devcb_call_read_line(&p->in_ca1_func)); + pia6821_ca1_w(device, devcb_call_read_line(&p->in_ca1_func)); else if (!p->logged_ca1_not_connected && (!p->in_ca1_pushed)) { logerror("PIA #%s: Warning! No CA1 read handler. Assuming pin not connected\n", device->tag()); @@ -561,7 +561,7 @@ static UINT8 control_a_r(running_device *device) } if (p->in_ca2_func.read != NULL) - pia6821_ca2_w(device, 0, devcb_call_read_line(&p->in_ca2_func)); + pia6821_ca2_w(device, devcb_call_read_line(&p->in_ca2_func)); else if ( !p->logged_ca2_not_connected && C2_INPUT(p->ctl_a) && !p->in_ca2_pushed) { logerror("PIA #%s: Warning! No CA2 read handler. Assuming pin not connected\n", device->tag()); @@ -595,7 +595,7 @@ static UINT8 control_b_r(running_device *device) /* update CB1 & CB2 if callback exists, these in turn may update IRQ's */ if (p->in_cb1_func.read != NULL) - pia6821_cb1_w(device, 0, devcb_call_read_line(&p->in_cb1_func)); + pia6821_cb1_w(device, devcb_call_read_line(&p->in_cb1_func)); else if (!p->logged_cb1_not_connected && !p->in_cb1_pushed) { logerror("PIA #%s: Error! no CB1 read handler. Three-state pin is undefined\n", device->tag()); @@ -603,7 +603,7 @@ static UINT8 control_b_r(running_device *device) } if (p->in_cb2_func.read != NULL) - pia6821_cb2_w(device, 0, devcb_call_read_line(&p->in_cb2_func)); + pia6821_cb2_w(device, devcb_call_read_line(&p->in_cb2_func)); else if (!p->logged_cb2_not_connected && C2_INPUT(p->ctl_b) && !p->in_cb2_pushed) { logerror("PIA #%s: Error! No CB2 read handler. Three-state pin is undefined\n", device->tag()); @@ -1010,7 +1010,7 @@ UINT8 pia6821_get_output_a(running_device *device) pia6821_ca1_r -------------------------------------------------*/ -READ8_DEVICE_HANDLER( pia6821_ca1_r ) +READ_LINE_DEVICE_HANDLER( pia6821_ca1_r ) { pia6821_state *p = get_token(device); @@ -1022,18 +1022,15 @@ READ8_DEVICE_HANDLER( pia6821_ca1_r ) pia6821_ca1_w -------------------------------------------------*/ -WRITE8_DEVICE_HANDLER( pia6821_ca1_w ) +WRITE_LINE_DEVICE_HANDLER( pia6821_ca1_w ) { pia6821_state *p = get_token(device); - /* limit the data to 0 or 1 */ - data = data ? TRUE : FALSE; - - LOG(("PIA #%s: set input CA1 = %d\n", device->tag(), data)); + LOG(("PIA #%s: set input CA1 = %d\n", device->tag(), state)); /* the new state has caused a transition */ - if ((p->in_ca1 != data) && - ((data && C1_LOW_TO_HIGH(p->ctl_a)) || (!data && C1_HIGH_TO_LOW(p->ctl_a)))) + if ((p->in_ca1 != state) && + ((state && C1_LOW_TO_HIGH(p->ctl_a)) || (!state && C1_HIGH_TO_LOW(p->ctl_a)))) { LOG(("PIA #%s: CA1 triggering\n", device->tag())); @@ -1049,7 +1046,7 @@ WRITE8_DEVICE_HANDLER( pia6821_ca1_w ) } /* set the new value for CA1 */ - p->in_ca1 = data; + p->in_ca1 = state; p->in_ca1_pushed = TRUE; } @@ -1058,7 +1055,7 @@ WRITE8_DEVICE_HANDLER( pia6821_ca1_w ) pia6821_ca2_r -------------------------------------------------*/ -READ8_DEVICE_HANDLER( pia6821_ca2_r ) +READ_LINE_DEVICE_HANDLER( pia6821_ca2_r ) { pia6821_state *p = get_token(device); @@ -1070,19 +1067,16 @@ READ8_DEVICE_HANDLER( pia6821_ca2_r ) pia6821_ca2_w -------------------------------------------------*/ -WRITE8_DEVICE_HANDLER( pia6821_ca2_w ) +WRITE_LINE_DEVICE_HANDLER( pia6821_ca2_w ) { pia6821_state *p = get_token(device); - /* limit the data to 0 or 1 */ - data = data ? 1 : 0; - - LOG(("PIA #%s: set input CA2 = %d\n", device->tag(), data)); + LOG(("PIA #%s: set input CA2 = %d\n", device->tag(), state)); /* if input mode and the new state has caused a transition */ if (C2_INPUT(p->ctl_a) && - (p->in_ca2 != data) && - ((data && C2_LOW_TO_HIGH(p->ctl_a)) || (!data && C2_HIGH_TO_LOW(p->ctl_a)))) + (p->in_ca2 != state) && + ((state && C2_LOW_TO_HIGH(p->ctl_a)) || (!state && C2_HIGH_TO_LOW(p->ctl_a)))) { LOG(("PIA #%s: CA2 triggering\n", device->tag())); @@ -1094,7 +1088,7 @@ WRITE8_DEVICE_HANDLER( pia6821_ca2_w ) } /* set the new value for CA2 */ - p->in_ca2 = data; + p->in_ca2 = state; p->in_ca2_pushed = TRUE; } @@ -1179,7 +1173,7 @@ UINT8 pia6821_get_output_b(running_device *device) pia6821_cb1_r -------------------------------------------------*/ -READ8_DEVICE_HANDLER( pia6821_cb1_r ) +READ_LINE_DEVICE_HANDLER( pia6821_cb1_r ) { pia6821_state *p = get_token(device); @@ -1191,18 +1185,15 @@ READ8_DEVICE_HANDLER( pia6821_cb1_r ) pia6821_cb1_w -------------------------------------------------*/ -WRITE8_DEVICE_HANDLER( pia6821_cb1_w ) +WRITE_LINE_DEVICE_HANDLER( pia6821_cb1_w ) { pia6821_state *p = get_token(device); - /* limit the data to 0 or 1 */ - data = data ? 1 : 0; - - LOG(("PIA #%s: set input CB1 = %d\n", device->tag(), data)); + LOG(("PIA #%s: set input CB1 = %d\n", device->tag(), state)); /* the new state has caused a transition */ - if ((p->in_cb1 != data) && - ((data && C1_LOW_TO_HIGH(p->ctl_b)) || (!data && C1_HIGH_TO_LOW(p->ctl_b)))) + if ((p->in_cb1 != state) && + ((state && C1_LOW_TO_HIGH(p->ctl_b)) || (!state && C1_HIGH_TO_LOW(p->ctl_b)))) { LOG(("PIA #%s: CB1 triggering\n", device->tag())); @@ -1219,7 +1210,7 @@ WRITE8_DEVICE_HANDLER( pia6821_cb1_w ) } /* set the new value for CB1 */ - p->in_cb1 = data; + p->in_cb1 = state; p->in_cb1_pushed = TRUE; } @@ -1228,7 +1219,7 @@ WRITE8_DEVICE_HANDLER( pia6821_cb1_w ) pia6821_cb2_r -------------------------------------------------*/ -READ8_DEVICE_HANDLER( pia6821_cb2_r ) +READ_LINE_DEVICE_HANDLER( pia6821_cb2_r ) { pia6821_state *p = get_token(device); @@ -1240,19 +1231,16 @@ READ8_DEVICE_HANDLER( pia6821_cb2_r ) pia6821_cb2_w -------------------------------------------------*/ -WRITE8_DEVICE_HANDLER( pia6821_cb2_w ) +WRITE_LINE_DEVICE_HANDLER( pia6821_cb2_w ) { pia6821_state *p = get_token(device); - /* limit the data to 0 or 1 */ - data = data ? 1 : 0; - - LOG(("PIA #%s: set input CB2 = %d\n", device->tag(), data)); + LOG(("PIA #%s: set input CB2 = %d\n", device->tag(), state)); /* if input mode and the new state has caused a transition */ if (C2_INPUT(p->ctl_b) && - (p->in_cb2 != data) && - ((data && C2_LOW_TO_HIGH(p->ctl_b)) || (!data && C2_HIGH_TO_LOW(p->ctl_b)))) + (p->in_cb2 != state) && + ((state && C2_LOW_TO_HIGH(p->ctl_b)) || (!state && C2_HIGH_TO_LOW(p->ctl_b)))) { LOG(("PIA #%s: CB2 triggering\n", device->tag())); @@ -1264,7 +1252,7 @@ WRITE8_DEVICE_HANDLER( pia6821_cb2_w ) } /* set the new value for CA2 */ - p->in_cb2 = data; + p->in_cb2 = state; p->in_cb2_pushed = TRUE; } diff --git a/src/emu/machine/6821pia.h b/src/emu/machine/6821pia.h index 4a0a9f44c99..2abb215580a 100644 --- a/src/emu/machine/6821pia.h +++ b/src/emu/machine/6821pia.h @@ -70,11 +70,11 @@ WRITE8_DEVICE_HANDLER( pia6821_porta_w ); void pia6821_set_input_a(running_device *device, UINT8 data, UINT8 z_mask); UINT8 pia6821_get_output_a(running_device *device); -READ8_DEVICE_HANDLER( pia6821_ca1_r ); -WRITE8_DEVICE_HANDLER( pia6821_ca1_w ); +READ_LINE_DEVICE_HANDLER( pia6821_ca1_r ); +WRITE_LINE_DEVICE_HANDLER( pia6821_ca1_w ); -READ8_DEVICE_HANDLER( pia6821_ca2_r ); -WRITE8_DEVICE_HANDLER( pia6821_ca2_w ); +READ_LINE_DEVICE_HANDLER( pia6821_ca2_r ); +WRITE_LINE_DEVICE_HANDLER( pia6821_ca2_w ); int pia6821_get_output_ca2(running_device *device); int pia6821_get_output_ca2_z(running_device *device); @@ -82,11 +82,11 @@ READ8_DEVICE_HANDLER( pia6821_portb_r ); WRITE8_DEVICE_HANDLER( pia6821_portb_w ); UINT8 pia6821_get_output_b(running_device *device); -READ8_DEVICE_HANDLER( pia6821_cb1_r ); -WRITE8_DEVICE_HANDLER( pia6821_cb1_w ); +READ_LINE_DEVICE_HANDLER( pia6821_cb1_r ); +WRITE_LINE_DEVICE_HANDLER( pia6821_cb1_w ); -READ8_DEVICE_HANDLER( pia6821_cb2_r ); -WRITE8_DEVICE_HANDLER( pia6821_cb2_w ); +READ_LINE_DEVICE_HANDLER( pia6821_cb2_r ); +WRITE_LINE_DEVICE_HANDLER( pia6821_cb2_w ); int pia6821_get_output_cb2(running_device *device); int pia6821_get_output_cb2_z(running_device *device); diff --git a/src/mame/audio/exidy.c b/src/mame/audio/exidy.c index 55c8b5d0973..98fc5773481 100644 --- a/src/mame/audio/exidy.c +++ b/src/mame/audio/exidy.c @@ -734,8 +734,8 @@ static const pia6821_interface venture_pia0_intf = DEVCB_NULL, /* line CB2 in */ DEVCB_DEVICE_HANDLER("pia1", pia6821_portb_w), /* port A out */ DEVCB_DEVICE_HANDLER("pia1", pia6821_porta_w), /* port B out */ - DEVCB_DEVICE_HANDLER("pia1", pia6821_cb1_w), /* line CA2 out */ - DEVCB_DEVICE_HANDLER("pia1", pia6821_ca1_w), /* port CB2 out */ + DEVCB_DEVICE_LINE("pia1", pia6821_cb1_w), /* line CA2 out */ + DEVCB_DEVICE_LINE("pia1", pia6821_ca1_w), /* port CB2 out */ DEVCB_NULL, /* IRQA */ DEVCB_NULL /* IRQB */ }; @@ -751,8 +751,8 @@ static const pia6821_interface venture_pia1_intf = DEVCB_NULL, /* line CB2 in */ DEVCB_DEVICE_HANDLER("pia0", pia6821_portb_w), /* port A out */ DEVCB_DEVICE_HANDLER("pia0", pia6821_porta_w), /* port B out */ - DEVCB_DEVICE_HANDLER("pia0", pia6821_cb1_w), /* line CA2 out */ - DEVCB_DEVICE_HANDLER("pia0", pia6821_ca1_w), /* port CB2 out */ + DEVCB_DEVICE_LINE("pia0", pia6821_cb1_w), /* line CA2 out */ + DEVCB_DEVICE_LINE("pia0", pia6821_ca1_w), /* port CB2 out */ DEVCB_NULL, /* IRQA */ DEVCB_LINE(update_irq_state) /* IRQB */ }; @@ -930,7 +930,7 @@ READ8_HANDLER( victory_sound_response_r ) if (VICTORY_LOG_SOUND) logerror("%04X:!!!! Sound response read = %02X\n", cpu_get_previouspc(space->cpu), ret); - pia6821_cb1_w(pia1, 0, 0); + pia6821_cb1_w(pia1, 0); return ret; } @@ -939,7 +939,7 @@ READ8_HANDLER( victory_sound_response_r ) READ8_HANDLER( victory_sound_status_r ) { running_device *pia1 = space->machine->device("pia1"); - UINT8 ret = (pia6821_ca1_r(pia1, 0) << 7) | (pia6821_cb1_r(pia1, 0) << 6); + UINT8 ret = (pia6821_ca1_r(pia1) << 7) | (pia6821_cb1_r(pia1) << 6); if (VICTORY_LOG_SOUND) logerror("%04X:!!!! Sound status read = %02X\n", cpu_get_previouspc(space->cpu), ret); @@ -951,7 +951,7 @@ static TIMER_CALLBACK( delayed_command_w ) { running_device *pia1 = machine->device("pia1"); pia6821_set_input_a(pia1, param, 0); - pia6821_ca1_w(pia1, 0, 0); + pia6821_ca1_w(pia1, 0); } WRITE8_HANDLER( victory_sound_command_w ) @@ -966,7 +966,7 @@ static WRITE8_DEVICE_HANDLER( victory_sound_irq_clear_w ) { if (VICTORY_LOG_SOUND) logerror("%s:!!!! Sound IRQ clear = %02X\n", cpuexec_describe_context(device->machine), data); - if (!data) pia6821_ca1_w(device, 0, 1); + if (!data) pia6821_ca1_w(device, 1); } @@ -975,7 +975,7 @@ static WRITE8_DEVICE_HANDLER( victory_main_ack_w ) if (VICTORY_LOG_SOUND) logerror("%s:!!!! Sound Main ACK W = %02X\n", cpuexec_describe_context(device->machine), data); if (victory_sound_response_ack_clk && !data) - pia6821_cb1_w(device, 0, 1); + pia6821_cb1_w(device, 1); victory_sound_response_ack_clk = data; } @@ -1019,12 +1019,12 @@ static DEVICE_RESET( victory_sound ) /* the flip-flop @ F4 is reset */ victory_sound_response_ack_clk = 0; - pia6821_cb1_w(pia1, 0, 1); + pia6821_cb1_w(pia1, 1); /* these two lines shouldn't be needed, but it avoids the log entry as the sound CPU checks port A before the main CPU ever writes to it */ pia6821_set_input_a(pia1, 0, 0); - pia6821_ca1_w(pia1, 0, 1); + pia6821_ca1_w(pia1, 1); } diff --git a/src/mame/audio/mcr.c b/src/mame/audio/mcr.c index 4fb238366be..d64350e2808 100644 --- a/src/mame/audio/mcr.c +++ b/src/mame/audio/mcr.c @@ -517,7 +517,7 @@ static TIMER_CALLBACK( csdeluxe_delayed_data_w ) running_device *pia = machine->device("csdpia"); pia6821_portb_w(pia, 0, param & 0x0f); - pia6821_ca1_w(pia, 0, ~param & 0x10); + pia6821_ca1_w(pia, ~param & 0x10); /* oftentimes games will write one nibble at a time; the sync on this is very */ /* important, so we boost the interleave briefly while this happens */ @@ -655,7 +655,7 @@ static TIMER_CALLBACK( soundsgood_delayed_data_w ) running_device *pia = machine->device("sgpia"); pia6821_portb_w(pia, 0, (param >> 1) & 0x0f); - pia6821_ca1_w(pia, 0, ~param & 0x01); + pia6821_ca1_w(pia, ~param & 0x01); /* oftentimes games will write one nibble at a time; the sync on this is very */ /* important, so we boost the interleave briefly while this happens */ @@ -759,7 +759,7 @@ static TIMER_CALLBACK( turbocs_delayed_data_w ) running_device *pia = machine->device("tcspia"); pia6821_portb_w(pia, 0, (param >> 1) & 0x0f); - pia6821_ca1_w(pia, 0, ~param & 0x01); + pia6821_ca1_w(pia, ~param & 0x01); /* oftentimes games will write one nibble at a time; the sync on this is very */ /* important, so we boost the interleave briefly while this happens */ @@ -864,8 +864,8 @@ static WRITE8_DEVICE_HANDLER( squawkntalk_portb2_w ) tms5220_data_w(tms, offset, squawkntalk_tms_command); /* DoT expects the ready line to transition on a command/write here, so we oblige */ - pia6821_ca2_w(device, 0, 1); - pia6821_ca2_w(device, 0, 0); + pia6821_ca2_w(device, 1); + pia6821_ca2_w(device, 0); } /* read strobe -- read the current status from the TMS5200 */ @@ -874,8 +874,8 @@ static WRITE8_DEVICE_HANDLER( squawkntalk_portb2_w ) pia6821_porta_w(device, 0, tms5220_status_r(tms, offset)); /* DoT expects the ready line to transition on a command/write here, so we oblige */ - pia6821_ca2_w(device, 0, 1); - pia6821_ca2_w(device, 0, 0); + pia6821_ca2_w(device, 1); + pia6821_ca2_w(device, 0); } /* remember the state */ @@ -896,7 +896,7 @@ static TIMER_CALLBACK( squawkntalk_delayed_data_w ) running_device *pia0 = machine->device("sntpia0"); pia6821_porta_w(pia0, 0, ~param & 0x0f); - pia6821_cb1_w(pia0, 0, ~param & 0x10); + pia6821_cb1_w(pia0, ~param & 0x10); } diff --git a/src/mame/audio/qix.c b/src/mame/audio/qix.c index a0a2f285a7f..0bc2a562013 100644 --- a/src/mame/audio/qix.c +++ b/src/mame/audio/qix.c @@ -177,7 +177,7 @@ static const pia6821_interface qixsnd_pia_0_intf = DEVCB_NULL, /* line CB2 in */ DEVCB_DEVICE_HANDLER("sndpia1", sync_sndpia1_porta_w), /* port A out */ DEVCB_DEVICE_HANDLER("discrete", qix_vol_w), /* port B out */ - DEVCB_DEVICE_HANDLER("sndpia1", pia6821_ca1_w), /* line CA2 out */ + DEVCB_DEVICE_LINE("sndpia1", pia6821_ca1_w), /* line CA2 out */ DEVCB_HANDLER(qix_flip_screen_w), /* port CB2 out */ DEVCB_LINE(qix_pia_dint), /* IRQA */ DEVCB_LINE(qix_pia_dint) /* IRQB */ @@ -193,7 +193,7 @@ static const pia6821_interface qixsnd_pia_1_intf = DEVCB_NULL, /* line CB2 in */ DEVCB_DEVICE_HANDLER("sndpia0", pia6821_porta_w), /* port A out */ DEVCB_DEVICE_HANDLER("discrete", qix_dac_w), /* port B out */ - DEVCB_DEVICE_HANDLER("sndpia0", pia6821_ca1_w), /* line CA2 out */ + DEVCB_DEVICE_LINE("sndpia0", pia6821_ca1_w), /* line CA2 out */ DEVCB_NULL, /* line CB2 out */ DEVCB_LINE(qix_pia_sint), /* IRQA */ DEVCB_LINE(qix_pia_sint) /* IRQB */ diff --git a/src/mame/audio/spiders.c b/src/mame/audio/spiders.c index 2b9321c52fe..e71839447b5 100644 --- a/src/mame/audio/spiders.c +++ b/src/mame/audio/spiders.c @@ -175,7 +175,7 @@ DISCRETE_SOUND_END WRITE8_DEVICE_HANDLER( spiders_audio_command_w ) { pia6821_set_input_a(device, data & 0xf8, 0); - pia6821_ca1_w(device, 0, data & 0x80 ? 1 : 0); + pia6821_ca1_w(device, data & 0x80 ? 1 : 0); } diff --git a/src/mame/audio/williams.c b/src/mame/audio/williams.c index d8ce2e468c0..9eabe647307 100644 --- a/src/mame/audio/williams.c +++ b/src/mame/audio/williams.c @@ -288,7 +288,7 @@ void williams_cvsd_init(running_machine *machine) memory_set_bank(machine, "bank5", 0); /* reset the IRQ state */ - pia6821_ca1_w(machine->device("cvsdpia"), 0, 1); + pia6821_ca1_w(machine->device("cvsdpia"), 1); /* register for save states */ state_save_register_global(machine, williams_sound_int_state); @@ -407,7 +407,7 @@ static void init_audio_state(running_machine *machine) static void cvsd_ym2151_irq(running_device *device, int state) { - pia6821_ca1_w(device->machine->device("cvsdpia"), 0, !state); + pia6821_ca1_w(device->machine->device("cvsdpia"), !state); } @@ -473,8 +473,8 @@ static TIMER_CALLBACK( williams_cvsd_delayed_data_w ) { running_device *pia = machine->device("cvsdpia"); pia6821_portb_w(pia, 0, param & 0xff); - pia6821_cb1_w(pia, 0, (param >> 8) & 1); - pia6821_cb2_w(pia, 0, (param >> 9) & 1); + pia6821_cb1_w(pia, (param >> 8) & 1); + pia6821_cb2_w(pia, (param >> 9) & 1); } diff --git a/src/mame/drivers/laserbat.c b/src/mame/drivers/laserbat.c index 56630fea2e9..39cd1d4166f 100644 --- a/src/mame/drivers/laserbat.c +++ b/src/mame/drivers/laserbat.c @@ -676,7 +676,7 @@ static INTERRUPT_GEN( zaccaria_cb1_toggle ) { laserbat_state *state = (laserbat_state *)device->machine->driver_data; - pia6821_cb1_w(state->pia, 0, state->cb1_toggle & 1); + pia6821_cb1_w(state->pia, state->cb1_toggle & 1); state->cb1_toggle ^= 1; } diff --git a/src/mame/drivers/mpu4.c b/src/mame/drivers/mpu4.c index f23eb351f45..30f31903edb 100644 --- a/src/mame/drivers/mpu4.c +++ b/src/mame/drivers/mpu4.c @@ -514,7 +514,7 @@ static WRITE8_DEVICE_HANDLER( ic2_o1_callback ) static WRITE8_DEVICE_HANDLER( ic2_o2_callback ) { running_device *pia = device->machine->device("pia_ic3"); - pia6821_ca1_w(pia, 0, data); /* copy output value to IC3 ca1 */ + pia6821_ca1_w(pia, data); /* copy output value to IC3 ca1 */ /* the output from timer2 is the input clock for timer3 */ ptm6840_set_c3(device, 0, data); @@ -686,12 +686,12 @@ static READ8_DEVICE_HANDLER( pia_ic4_portb_r ) if ( serial_data ) { ic4_input_b |= 0x80; - pia6821_cb1_w(device, 0, 1); + pia6821_cb1_w(device, 1); } else { ic4_input_b &= ~0x80; - pia6821_cb1_w(device, 0, 0); + pia6821_cb1_w(device, 0); } if ( optic_pattern & 0x01 ) ic4_input_b |= 0x40; /* reel A tab */ @@ -1033,7 +1033,7 @@ static READ8_DEVICE_HANDLER( pia_ic8_porta_r ) /* The orange inputs are polled twice as often as the black ones, for reasons of efficiency. This is achieved via connecting every input line to an AND gate, thus allowing two strobes to represent each orange input bank (strobes are active low). */ - pia6821_cb1_w(pia_ic5, 0, (input_port_read(device->machine, "AUX2") & 0x80)); + pia6821_cb1_w(pia_ic5, (input_port_read(device->machine, "AUX2") & 0x80)); return input_port_read(device->machine, portnames[input_strobe]); } @@ -1745,7 +1745,7 @@ static TIMER_DEVICE_CALLBACK( gen_50hz ) oscillating signal.*/ signal_50hz = signal_50hz?0:1; update_lamps(); - pia6821_ca1_w(timer.machine->device("pia_ic4"), 0, signal_50hz); /* signal is connected to IC4 CA1 */ + pia6821_ca1_w(timer.machine->device("pia_ic4"), signal_50hz); /* signal is connected to IC4 CA1 */ } diff --git a/src/mame/drivers/nyny.c b/src/mame/drivers/nyny.c index 7ed47024446..dda4dc3beb7 100644 --- a/src/mame/drivers/nyny.c +++ b/src/mame/drivers/nyny.c @@ -157,13 +157,13 @@ static INTERRUPT_GEN( update_pia_1 ) /* update the different PIA pins from the input ports */ /* CA1 - copy of PA0 (COIN1) */ - pia6821_ca1_w(state->pia1, 0, input_port_read(device->machine, "IN0") & 0x01); + pia6821_ca1_w(state->pia1, input_port_read(device->machine, "IN0") & 0x01); /* CA2 - copy of PA1 (SERVICE1) */ - pia6821_ca2_w(state->pia1, 0, input_port_read(device->machine, "IN0") & 0x02); + pia6821_ca2_w(state->pia1, input_port_read(device->machine, "IN0") & 0x02); /* CB1 - (crosshatch) */ - pia6821_cb1_w(state->pia1, 0, input_port_read(device->machine, "CROSS")); + pia6821_cb1_w(state->pia1, input_port_read(device->machine, "CROSS")); /* CB2 - NOT CONNECTED */ } @@ -248,7 +248,7 @@ static const pia6821_interface pia_2_intf = static WRITE8_DEVICE_HANDLER( ic48_1_74123_output_changed ) { nyny_state *state = (nyny_state *)device->machine->driver_data; - pia6821_ca1_w(state->pia2, 0, data); + pia6821_ca1_w(state->pia2, data); } diff --git a/src/mame/drivers/r2dtank.c b/src/mame/drivers/r2dtank.c index c1bc32e5041..77d33300605 100644 --- a/src/mame/drivers/r2dtank.c +++ b/src/mame/drivers/r2dtank.c @@ -207,7 +207,7 @@ static const ay8910_interface ay8910_2_interface = static WRITE8_DEVICE_HANDLER( ttl74123_output_changed ) { running_device *pia = device->machine->device("pia_main"); - pia6821_ca1_w(pia, 0, data); + pia6821_ca1_w(pia, data); ttl74123_output = data; } diff --git a/src/mame/drivers/spiders.c b/src/mame/drivers/spiders.c index 6444aa45e69..9da88e76086 100644 --- a/src/mame/drivers/spiders.c +++ b/src/mame/drivers/spiders.c @@ -283,13 +283,13 @@ static INTERRUPT_GEN( update_pia_1 ) /* update the different PIA pins from the input ports */ /* CA1 - copy of PA1 (COIN1) */ - pia6821_ca1_w(pia1, 0, input_port_read(device->machine, "IN0") & 0x02); + pia6821_ca1_w(pia1, input_port_read(device->machine, "IN0") & 0x02); /* CA2 - copy of PA0 (SERVICE1) */ - pia6821_ca2_w(pia1, 0, input_port_read(device->machine, "IN0") & 0x01); + pia6821_ca2_w(pia1, input_port_read(device->machine, "IN0") & 0x01); /* CB1 - (crosshatch) */ - pia6821_cb1_w(pia1, 0, input_port_read(device->machine, "XHATCH")); + pia6821_cb1_w(pia1, input_port_read(device->machine, "XHATCH")); /* CB2 - NOT CONNECTED */ } @@ -383,7 +383,7 @@ static const pia6821_interface pia_4_intf = static WRITE8_DEVICE_HANDLER( ic60_74123_output_changed) { running_device *pia2 = device->machine->device("pia2"); - pia6821_ca1_w(pia2, 0, data); + pia6821_ca1_w(pia2, data); } diff --git a/src/mame/drivers/toratora.c b/src/mame/drivers/toratora.c index 8f9f310402c..9c13e86ddd6 100644 --- a/src/mame/drivers/toratora.c +++ b/src/mame/drivers/toratora.c @@ -152,8 +152,8 @@ static INTERRUPT_GEN( toratora_timer ) generic_pulse_irq_line(device, 0); } pia6821_set_input_a(state->pia_u1, input_port_read(device->machine, "INPUT") & 0x0f, 0); - pia6821_ca1_w(state->pia_u1, 0, input_port_read(device->machine, "INPUT") & 0x10); - pia6821_ca2_w(state->pia_u1, 0, input_port_read(device->machine, "INPUT") & 0x20); + pia6821_ca1_w(state->pia_u1, input_port_read(device->machine, "INPUT") & 0x10); + pia6821_ca2_w(state->pia_u1, input_port_read(device->machine, "INPUT") & 0x20); } static READ8_HANDLER( timer_r ) diff --git a/src/mame/drivers/zaccaria.c b/src/mame/drivers/zaccaria.c index 4dfce004302..a5c54658aa1 100644 --- a/src/mame/drivers/zaccaria.c +++ b/src/mame/drivers/zaccaria.c @@ -165,7 +165,7 @@ static INTERRUPT_GEN( zaccaria_cb1_toggle ) running_device *pia0 = device->machine->device("pia0"); static int toggle = 0; - pia6821_cb1_w(pia0,0, toggle & 1); + pia6821_cb1_w(pia0, toggle & 1); toggle ^= 1; } @@ -195,7 +195,7 @@ static WRITE8_HANDLER( sound_command_w ) static WRITE8_HANDLER( sound1_command_w ) { running_device *pia0 = space->machine->device("pia0"); - pia6821_ca1_w(pia0, 0, data & 0x80); + pia6821_ca1_w(pia0, data & 0x80); soundlatch2_w(space, 0, data); } @@ -532,8 +532,8 @@ static const pia6821_interface pia_1_config = static const tms5220_interface tms5220_config = { - DEVCB_DEVICE_HANDLER("pia1", pia6821_cb1_w), /* IRQ handler */ - DEVCB_DEVICE_HANDLER("pia1", pia6821_ca2_w) /* READYQ handler */ + DEVCB_DEVICE_LINE("pia1", pia6821_cb1_w), /* IRQ handler */ + DEVCB_DEVICE_LINE("pia1", pia6821_ca2_w) /* READYQ handler */ }; diff --git a/src/mame/machine/williams.c b/src/mame/machine/williams.c index c5e65c7d54c..7a604a2a3b2 100644 --- a/src/mame/machine/williams.c +++ b/src/mame/machine/williams.c @@ -172,7 +172,7 @@ const pia6821_interface williams2_muxed_pia_0_intf = const pia6821_interface williams2_pia_1_intf = { /*inputs : A/B,CA/B1,CA/B2 */ DEVCB_INPUT_PORT("IN2"), DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, - /*outputs: A/B,CA/B2 */ DEVCB_NULL, DEVCB_HANDLER(williams2_snd_cmd_w), DEVCB_NULL, DEVCB_DEVICE_HANDLER("pia_2", pia6821_ca1_w), + /*outputs: A/B,CA/B2 */ DEVCB_NULL, DEVCB_HANDLER(williams2_snd_cmd_w), DEVCB_NULL, DEVCB_DEVICE_LINE("pia_2", pia6821_ca1_w), /*irqs : A/B */ DEVCB_LINE(williams_main_irq), DEVCB_LINE(williams_main_irq) }; @@ -180,7 +180,7 @@ const pia6821_interface williams2_pia_1_intf = const pia6821_interface williams2_snd_pia_intf = { /*inputs : A/B,CA/B1,CA/B2 */ DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, - /*outputs: A/B,CA/B2 */ DEVCB_DEVICE_HANDLER("pia_1", pia6821_portb_w), DEVCB_DEVICE_HANDLER("wmsdac", dac_w), DEVCB_DEVICE_HANDLER("pia_1", pia6821_cb1_w), DEVCB_NULL, + /*outputs: A/B,CA/B2 */ DEVCB_DEVICE_HANDLER("pia_1", pia6821_portb_w), DEVCB_DEVICE_HANDLER("wmsdac", dac_w), DEVCB_DEVICE_LINE("pia_1", pia6821_cb1_w), DEVCB_NULL, /*irqs : A/B */ DEVCB_LINE(williams_snd_irq), DEVCB_LINE(williams_snd_irq) }; @@ -204,7 +204,7 @@ const pia6821_interface mysticm_pia_0_intf = const pia6821_interface mysticm_pia_1_intf = { /*inputs : A/B,CA/B1,CA/B2 */ DEVCB_INPUT_PORT("IN2"), DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, - /*outputs: A/B,CA/B2 */ DEVCB_NULL, DEVCB_HANDLER(williams2_snd_cmd_w), DEVCB_NULL, DEVCB_DEVICE_HANDLER("pia_2", pia6821_ca1_w), + /*outputs: A/B,CA/B2 */ DEVCB_NULL, DEVCB_HANDLER(williams2_snd_cmd_w), DEVCB_NULL, DEVCB_DEVICE_LINE("pia_2", pia6821_ca1_w), /*irqs : A/B */ DEVCB_LINE(mysticm_main_irq), DEVCB_LINE(mysticm_main_irq) }; @@ -220,7 +220,7 @@ const pia6821_interface tshoot_pia_0_intf = const pia6821_interface tshoot_pia_1_intf = { /*inputs : A/B,CA/B1,CA/B2 */ DEVCB_INPUT_PORT("IN2"), DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, - /*outputs: A/B,CA/B2 */ DEVCB_NULL, DEVCB_HANDLER(williams2_snd_cmd_w), DEVCB_NULL, DEVCB_DEVICE_HANDLER("pia_2", pia6821_ca1_w), + /*outputs: A/B,CA/B2 */ DEVCB_NULL, DEVCB_HANDLER(williams2_snd_cmd_w), DEVCB_NULL, DEVCB_DEVICE_LINE("pia_2", pia6821_ca1_w), /*irqs : A/B */ DEVCB_LINE(tshoot_main_irq), DEVCB_LINE(tshoot_main_irq) }; @@ -228,7 +228,7 @@ const pia6821_interface tshoot_pia_1_intf = const pia6821_interface tshoot_snd_pia_intf = { /*inputs : A/B,CA/B1,CA/B2 */ DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, - /*outputs: A/B,CA/B2 */ DEVCB_DEVICE_HANDLER("pia_1", pia6821_portb_w), DEVCB_DEVICE_HANDLER("wmsdac", dac_w), DEVCB_DEVICE_HANDLER("pia_1", pia6821_cb1_w), DEVCB_HANDLER(tshoot_maxvol_w), + /*outputs: A/B,CA/B2 */ DEVCB_DEVICE_HANDLER("pia_1", pia6821_portb_w), DEVCB_DEVICE_HANDLER("wmsdac", dac_w), DEVCB_DEVICE_LINE("pia_1", pia6821_cb1_w), DEVCB_HANDLER(tshoot_maxvol_w), /*irqs : A/B */ DEVCB_LINE(williams_snd_irq), DEVCB_LINE(williams_snd_irq) }; @@ -236,7 +236,7 @@ const pia6821_interface tshoot_snd_pia_intf = const pia6821_interface joust2_pia_1_intf = { /*inputs : A/B,CA/B1,CA/B2 */ DEVCB_INPUT_PORT("IN2"), DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, - /*outputs: A/B,CA/B2 */ DEVCB_NULL, DEVCB_HANDLER(joust2_snd_cmd_w), DEVCB_HANDLER(joust2_pia_3_cb1_w), DEVCB_DEVICE_HANDLER("pia_2", pia6821_ca1_w), + /*outputs: A/B,CA/B2 */ DEVCB_NULL, DEVCB_HANDLER(joust2_snd_cmd_w), DEVCB_HANDLER(joust2_pia_3_cb1_w), DEVCB_DEVICE_LINE("pia_2", pia6821_ca1_w), /*irqs : A/B */ DEVCB_LINE(williams_main_irq), DEVCB_LINE(williams_main_irq) }; @@ -254,7 +254,7 @@ TIMER_DEVICE_CALLBACK( williams_va11_callback ) int scanline = param; /* the IRQ signal comes into CB1, and is set to VA11 */ - pia6821_cb1_w(pia_1, 0, scanline & 0x20); + pia6821_cb1_w(pia_1, scanline & 0x20); /* set a timer for the next update */ scanline += 0x20; @@ -268,7 +268,7 @@ static TIMER_CALLBACK( williams_count240_off_callback ) pia6821_device *pia_1 = machine->device("pia_1"); /* the COUNT240 signal comes into CA1, and is set to the logical AND of VA10-VA13 */ - pia6821_ca1_w(pia_1, 0, 0); + pia6821_ca1_w(pia_1, 0); } @@ -277,7 +277,7 @@ TIMER_DEVICE_CALLBACK( williams_count240_callback ) pia6821_device *pia_1 = timer.machine->device("pia_1"); /* the COUNT240 signal comes into CA1, and is set to the logical AND of VA10-VA13 */ - pia6821_ca1_w(pia_1, 0, 1); + pia6821_ca1_w(pia_1, 1); /* set a timer to turn it off once the scanline counter resets */ timer_set(timer.machine, timer.machine->primary_screen->time_until_pos(0), NULL, 0, williams_count240_off_callback); @@ -398,8 +398,8 @@ TIMER_DEVICE_CALLBACK( williams2_va11_callback ) int scanline = param; /* the IRQ signal comes into CB1, and is set to VA11 */ - pia6821_cb1_w(pia_0, 0, scanline & 0x20); - pia6821_ca1_w(pia_1, 0, scanline & 0x20); + pia6821_cb1_w(pia_0, scanline & 0x20); + pia6821_ca1_w(pia_1, scanline & 0x20); /* set a timer for the next update */ scanline += 0x20; @@ -413,7 +413,7 @@ static TIMER_CALLBACK( williams2_endscreen_off_callback ) pia6821_device *pia_0 = machine->device("pia_0"); /* the /ENDSCREEN signal comes into CA1 */ - pia6821_ca1_w(pia_0, 0, 1); + pia6821_ca1_w(pia_0, 1); } @@ -422,7 +422,7 @@ TIMER_DEVICE_CALLBACK( williams2_endscreen_callback ) pia6821_device *pia_0 = timer.machine->device("pia_0"); /* the /ENDSCREEN signal comes into CA1 */ - pia6821_ca1_w(pia_0, 0, 0); + pia6821_ca1_w(pia_0, 0); /* set a timer to turn it off once the scanline counter resets */ timer_set(timer.machine, timer.machine->primary_screen->time_until_pos(8), NULL, 0, williams2_endscreen_off_callback); @@ -540,7 +540,7 @@ static TIMER_CALLBACK( williams_deferred_snd_cmd_w ) pia6821_device *pia_2 = machine->device("pia_2"); pia6821_portb_w(pia_2, 0, param); - pia6821_cb1_w(pia_2, 0, (param == 0xff) ? 0 : 1); + pia6821_cb1_w(pia_2, (param == 0xff) ? 0 : 1); } WRITE8_DEVICE_HANDLER( williams_snd_cmd_w ) @@ -957,7 +957,7 @@ MACHINE_RESET( joust2 ) /* standard init */ MACHINE_RESET_CALL(williams2); - pia6821_ca1_w(pia_3, 0, 1); + pia6821_ca1_w(pia_3, 1); } @@ -973,7 +973,7 @@ static WRITE8_DEVICE_HANDLER( joust2_pia_3_cb1_w ) pia6821_device *pia_3 = device->machine->device("cvsdpia"); joust2_current_sound_data = (joust2_current_sound_data & ~0x100) | ((data << 8) & 0x100); - pia6821_cb1_w(pia_3, offset, data); + pia6821_cb1_w(pia_3, data); }