More PIA devic-ification:

- mcr.c
 - williams.c
 - redalert.c
 - exidy.c
 - calomega.c
 - carpolo.c

Fixed sound in Joust 2.
This commit is contained in:
Aaron Giles 2009-03-02 17:37:14 +00:00
parent d6c89dba0f
commit 949667d62c
14 changed files with 276 additions and 262 deletions

View File

@ -9,7 +9,7 @@
#include "machine/rescap.h" #include "machine/rescap.h"
#include "streams.h" #include "streams.h"
#include "cpu/m6502/m6502.h" #include "cpu/m6502/m6502.h"
#include "machine/6821pia.h" #include "machine/6821new.h"
#include "machine/6532riot.h" #include "machine/6532riot.h"
#include "sound/hc55516.h" #include "sound/hc55516.h"
#include "sound/5220intf.h" #include "sound/5220intf.h"
@ -111,9 +111,10 @@ static double freq_to_step;
* *
*************************************/ *************************************/
static void update_irq_state(running_machine *machine, /* unused */ int state) static WRITE_LINE_DEVICE_HANDLER( update_irq_state )
{ {
cpu_set_input_line(machine->cpu[1], M6502_IRQ_LINE, (pia_get_irq_b(1) | riot_irq_state) ? ASSERT_LINE : CLEAR_LINE); const device_config *pia = devtag_get_device(device->machine, "pia1");
cpu_set_input_line(device->machine->cpu[1], M6502_IRQ_LINE, (pianew_get_irq_b(pia) | riot_irq_state) ? ASSERT_LINE : CLEAR_LINE);
} }
@ -454,7 +455,7 @@ DEVICE_GET_INFO( exidy_sound )
static void r6532_irq(const device_config *device, int state) static void r6532_irq(const device_config *device, int state)
{ {
riot_irq_state = (state == ASSERT_LINE) ? 1 : 0; riot_irq_state = (state == ASSERT_LINE) ? 1 : 0;
update_irq_state(device->machine, 0); update_irq_state(device, 0);
} }
@ -698,19 +699,37 @@ static WRITE8_HANDLER( exidy_sound_filter_w )
* *
*************************************/ *************************************/
static const pia6821_interface venture_pia_0_intf = static const pia6821_interface venture_pia0_intf =
{ {
/*inputs : A/B,CA/B1,CA/B2 */ 0, 0, 0, 0, 0, 0, DEVCB_NULL, /* port A in */
/*outputs: A/B,CA/B2 */ pia_1_portb_w, pia_1_porta_w, pia_1_cb1_w, pia_1_ca1_w, DEVCB_NULL, /* port B in */
/*irqs : A/B */ 0, 0 DEVCB_NULL, /* line CA1 in */
DEVCB_NULL, /* line CB1 in */
DEVCB_NULL, /* line CA2 in */
DEVCB_NULL, /* line CB2 in */
DEVCB_DEVICE_HANDLER("pia1", pia_portb_w), /* port A out */
DEVCB_DEVICE_HANDLER("pia1", pia_porta_w), /* port B out */
DEVCB_DEVICE_HANDLER("pia1", pia_cb1_w), /* line CA2 out */
DEVCB_DEVICE_HANDLER("pia1", pia_ca1_w), /* port CB2 out */
DEVCB_NULL, /* IRQA */
DEVCB_NULL /* IRQB */
}; };
static const pia6821_interface venture_pia_1_intf = static const pia6821_interface venture_pia1_intf =
{ {
/*inputs : A/B,CA/B1,CA/B2 */ 0, 0, 0, 0, 0, 0, DEVCB_NULL, /* port A in */
/*outputs: A/B,CA/B2 */ pia_0_portb_w, pia_0_porta_w, pia_0_cb1_w, pia_0_ca1_w, DEVCB_NULL, /* port B in */
/*irqs : A/B */ 0, update_irq_state DEVCB_NULL, /* line CA1 in */
DEVCB_NULL, /* line CB1 in */
DEVCB_NULL, /* line CA2 in */
DEVCB_NULL, /* line CB2 in */
DEVCB_DEVICE_HANDLER("pia0", pia_portb_w), /* port A out */
DEVCB_DEVICE_HANDLER("pia0", pia_porta_w), /* port B out */
DEVCB_DEVICE_HANDLER("pia0", pia_cb1_w), /* line CA2 out */
DEVCB_DEVICE_HANDLER("pia0", pia_ca1_w), /* port CB2 out */
DEVCB_NULL, /* IRQA */
DEVCB_LINE(update_irq_state) /* IRQB */
}; };
@ -738,10 +757,6 @@ static DEVICE_START( venture_common_sh_start )
static DEVICE_START( venture_sound ) static DEVICE_START( venture_sound )
{ {
running_machine *machine = device->machine;
pia_config(machine, 0, &venture_pia_0_intf);
pia_config(machine, 1, &venture_pia_1_intf);
DEVICE_START_CALL(venture_common_sh_start); DEVICE_START_CALL(venture_common_sh_start);
} }
@ -751,7 +766,8 @@ static DEVICE_RESET( venture_sound )
DEVICE_RESET_CALL(common_sh_reset); DEVICE_RESET_CALL(common_sh_reset);
/* PIA */ /* PIA */
pia_reset(); devtag_reset(device->machine, "pia0");
devtag_reset(device->machine, "pia1");
/* 6532 */ /* 6532 */
device_reset(riot); device_reset(riot);
@ -783,7 +799,7 @@ static ADDRESS_MAP_START( venture_audio_map, ADDRESS_SPACE_PROGRAM, 8 )
ADDRESS_MAP_GLOBAL_MASK(0x7fff) ADDRESS_MAP_GLOBAL_MASK(0x7fff)
AM_RANGE(0x0000, 0x007f) AM_MIRROR(0x0780) AM_RAM AM_RANGE(0x0000, 0x007f) AM_MIRROR(0x0780) AM_RAM
AM_RANGE(0x0800, 0x087f) AM_MIRROR(0x0780) AM_DEVREADWRITE("riot", riot6532_r, riot6532_w) AM_RANGE(0x0800, 0x087f) AM_MIRROR(0x0780) AM_DEVREADWRITE("riot", riot6532_r, riot6532_w)
AM_RANGE(0x1000, 0x1003) AM_MIRROR(0x07fc) AM_READWRITE(pia_1_r, pia_1_w) AM_RANGE(0x1000, 0x1003) AM_MIRROR(0x07fc) AM_DEVREADWRITE("pia1", pia_r, pia_w)
AM_RANGE(0x1800, 0x1803) AM_MIRROR(0x07fc) AM_READWRITE(exidy_sh8253_r, exidy_sh8253_w) AM_RANGE(0x1800, 0x1803) AM_MIRROR(0x07fc) AM_READWRITE(exidy_sh8253_r, exidy_sh8253_w)
AM_RANGE(0x2000, 0x27ff) AM_WRITE(exidy_sound_filter_w) AM_RANGE(0x2000, 0x27ff) AM_WRITE(exidy_sound_filter_w)
AM_RANGE(0x2800, 0x2807) AM_MIRROR(0x07f8) AM_READWRITE(exidy_sh6840_r, exidy_sh6840_w) AM_RANGE(0x2800, 0x2807) AM_MIRROR(0x07f8) AM_READWRITE(exidy_sh6840_r, exidy_sh6840_w)
@ -798,6 +814,9 @@ MACHINE_DRIVER_START( venture_audio )
MDRV_CPU_PROGRAM_MAP(venture_audio_map,0) MDRV_CPU_PROGRAM_MAP(venture_audio_map,0)
MDRV_RIOT6532_ADD("riot", SH6532_CLOCK, r6532_interface) MDRV_RIOT6532_ADD("riot", SH6532_CLOCK, r6532_interface)
MDRV_PIA6821_ADD("pia0", venture_pia0_intf)
MDRV_PIA6821_ADD("pia1", venture_pia1_intf)
MDRV_SPEAKER_STANDARD_MONO("mono") MDRV_SPEAKER_STANDARD_MONO("mono")
@ -881,11 +900,12 @@ static UINT8 victory_sound_response_ack_clk; /* 7474 @ F4 */
READ8_HANDLER( victory_sound_response_r ) READ8_HANDLER( victory_sound_response_r )
{ {
UINT8 ret = pia_get_output_b(1); const device_config *pia1 = devtag_get_device(space->machine, "pia1");
UINT8 ret = pianew_get_output_b(pia1);
if (VICTORY_LOG_SOUND) logerror("%04X:!!!! Sound response read = %02X\n", cpu_get_previouspc(space->cpu), ret); if (VICTORY_LOG_SOUND) logerror("%04X:!!!! Sound response read = %02X\n", cpu_get_previouspc(space->cpu), ret);
pia_set_input_cb1(1, 0); pia_cb1_w(pia1, 0, 0);
return ret; return ret;
} }
@ -893,7 +913,8 @@ READ8_HANDLER( victory_sound_response_r )
READ8_HANDLER( victory_sound_status_r ) READ8_HANDLER( victory_sound_status_r )
{ {
UINT8 ret = (pia_get_input_ca1(1) << 7) | (pia_get_input_cb1(1) << 6); const device_config *pia1 = devtag_get_device(space->machine, "pia1");
UINT8 ret = (pia_ca1_r(pia1, 0) << 7) | (pia_cb1_r(pia1, 0) << 6);
if (VICTORY_LOG_SOUND) logerror("%04X:!!!! Sound status read = %02X\n", cpu_get_previouspc(space->cpu), ret); if (VICTORY_LOG_SOUND) logerror("%04X:!!!! Sound status read = %02X\n", cpu_get_previouspc(space->cpu), ret);
@ -903,8 +924,9 @@ READ8_HANDLER( victory_sound_status_r )
static TIMER_CALLBACK( delayed_command_w ) static TIMER_CALLBACK( delayed_command_w )
{ {
pia_set_input_a(1, param, 0); const device_config *pia1 = devtag_get_device(machine, "pia1");
pia_set_input_ca1(1, 0); pianew_set_input_a(pia1, param, 0);
pia_ca1_w(pia1, 0, 0);
} }
WRITE8_HANDLER( victory_sound_command_w ) WRITE8_HANDLER( victory_sound_command_w )
@ -915,39 +937,46 @@ WRITE8_HANDLER( victory_sound_command_w )
} }
static WRITE8_HANDLER( victory_sound_irq_clear_w ) static WRITE8_DEVICE_HANDLER( victory_sound_irq_clear_w )
{ {
if (VICTORY_LOG_SOUND) logerror("%04X:!!!! Sound IRQ clear = %02X\n", cpu_get_previouspc(space->cpu), data); if (VICTORY_LOG_SOUND) logerror("%s:!!!! Sound IRQ clear = %02X\n", cpuexec_describe_context(device->machine), data);
if (!data) pia_set_input_ca1(1, 1); if (!data) pia_ca1_w(device, 0, 1);
} }
static WRITE8_HANDLER( victory_main_ack_w ) static WRITE8_DEVICE_HANDLER( victory_main_ack_w )
{ {
if (VICTORY_LOG_SOUND) logerror("%04X:!!!! Sound Main ACK W = %02X\n", cpu_get_previouspc(space->cpu), data); 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) if (victory_sound_response_ack_clk && !data)
pia_set_input_cb1(1, 1); pia_cb1_w(device, 0, 1);
victory_sound_response_ack_clk = data; victory_sound_response_ack_clk = data;
} }
static const pia6821_interface victory_pia_e5_intf = static const pia6821_interface victory_pia1_intf =
{ {
/*inputs : A/B,CA/B1,CA/B2 */ 0, 0, 0, 0, 0, 0, DEVCB_NULL, /* port A in */
/*outputs: A/B,CA/B2 */ 0, 0, victory_sound_irq_clear_w, victory_main_ack_w, DEVCB_NULL, /* port B in */
/*irqs : A/B */ 0, update_irq_state DEVCB_NULL, /* line CA1 in */
DEVCB_NULL, /* line CB1 in */
DEVCB_NULL, /* line CA2 in */
DEVCB_NULL, /* line CB2 in */
DEVCB_NULL, /* port A out */
DEVCB_NULL, /* port B out */
DEVCB_HANDLER(victory_sound_irq_clear_w), /* line CA2 out */
DEVCB_HANDLER(victory_main_ack_w), /* port CB2 out */
DEVCB_NULL, /* IRQA */
DEVCB_LINE(update_irq_state) /* IRQB */
}; };
static DEVICE_START( victory_sound ) static DEVICE_START( victory_sound )
{ {
running_machine *machine = device->machine; state_save_register_global(device->machine, victory_sound_response_ack_clk);
pia_config(machine, 1, &victory_pia_e5_intf);
state_save_register_global(machine, victory_sound_response_ack_clk);
DEVICE_START_CALL(venture_common_sh_start); DEVICE_START_CALL(venture_common_sh_start);
has_tms5220 = TRUE; has_tms5220 = TRUE;
@ -956,19 +985,21 @@ static DEVICE_START( victory_sound )
static DEVICE_RESET( victory_sound ) static DEVICE_RESET( victory_sound )
{ {
const device_config *pia1 = devtag_get_device(device->machine, "pia1");
DEVICE_RESET_CALL(common_sh_reset); DEVICE_RESET_CALL(common_sh_reset);
pia_reset(); device_reset(pia1);
device_reset(riot); device_reset(riot);
memset(sh8253_timer, 0, sizeof(sh8253_timer)); memset(sh8253_timer, 0, sizeof(sh8253_timer));
/* the flip-flop @ F4 is reset */ /* the flip-flop @ F4 is reset */
victory_sound_response_ack_clk = 0; victory_sound_response_ack_clk = 0;
pia_set_input_cb1(1, 1); pia_cb1_w(pia1, 0, 1);
/* these two lines shouldn't be needed, but it avoids the log entry /* 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 */ as the sound CPU checks port A before the main CPU ever writes to it */
pia_set_input_a(1, 0, 0); pianew_set_input_a(pia1, 0, 0);
pia_set_input_ca1(1, 1); pia_ca1_w(pia1, 0, 1);
} }
@ -993,7 +1024,7 @@ static DEVICE_GET_INFO( victory_sound )
static ADDRESS_MAP_START( victory_audio_map, ADDRESS_SPACE_PROGRAM, 8 ) static ADDRESS_MAP_START( victory_audio_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x00ff) AM_MIRROR(0x0f00) AM_RAM AM_RANGE(0x0000, 0x00ff) AM_MIRROR(0x0f00) AM_RAM
AM_RANGE(0x1000, 0x107f) AM_MIRROR(0x0f80) AM_DEVREADWRITE("riot", riot6532_r, riot6532_w) AM_RANGE(0x1000, 0x107f) AM_MIRROR(0x0f80) AM_DEVREADWRITE("riot", riot6532_r, riot6532_w)
AM_RANGE(0x2000, 0x2003) AM_MIRROR(0x0ffc) AM_READWRITE(pia_1_r, pia_1_w) AM_RANGE(0x2000, 0x2003) AM_MIRROR(0x0ffc) AM_DEVREADWRITE("pia1", pia_r, pia_w)
AM_RANGE(0x3000, 0x3003) AM_MIRROR(0x0ffc) AM_READWRITE(exidy_sh8253_r, exidy_sh8253_w) AM_RANGE(0x3000, 0x3003) AM_MIRROR(0x0ffc) AM_READWRITE(exidy_sh8253_r, exidy_sh8253_w)
AM_RANGE(0x4000, 0x4fff) AM_NOP AM_RANGE(0x4000, 0x4fff) AM_NOP
AM_RANGE(0x5000, 0x5007) AM_MIRROR(0x0ff8) AM_READWRITE(exidy_sh6840_r, exidy_sh6840_w) AM_RANGE(0x5000, 0x5007) AM_MIRROR(0x0ff8) AM_READWRITE(exidy_sh6840_r, exidy_sh6840_w)
@ -1009,6 +1040,7 @@ MACHINE_DRIVER_START( victory_audio )
MDRV_CPU_PROGRAM_MAP(victory_audio_map,0) MDRV_CPU_PROGRAM_MAP(victory_audio_map,0)
MDRV_RIOT6532_ADD("riot", SH6532_CLOCK, r6532_interface) MDRV_RIOT6532_ADD("riot", SH6532_CLOCK, r6532_interface)
MDRV_PIA6821_ADD("pia1", victory_pia1_intf)
MDRV_SPEAKER_STANDARD_MONO("mono") MDRV_SPEAKER_STANDARD_MONO("mono")

View File

@ -157,7 +157,7 @@ void mcr_sound_init(running_machine *machine, UINT8 config)
/* Advanced Audio */ /* Advanced Audio */
if (mcr_sound_config & MCR_WILLIAMS_SOUND) if (mcr_sound_config & MCR_WILLIAMS_SOUND)
{ {
williams_cvsd_init(machine, 0); williams_cvsd_init(machine);
sound_cpu++; sound_cpu++;
} }
} }

View File

@ -12,7 +12,7 @@
#include "cpu/m6502/m6502.h" #include "cpu/m6502/m6502.h"
#include "machine/rescap.h" #include "machine/rescap.h"
#include "cpu/i8085/i8085.h" #include "cpu/i8085/i8085.h"
#include "machine/6821pia.h" #include "machine/6821new.h"
#include "sound/ay8910.h" #include "sound/ay8910.h"
#include "sound/hc55516.h" #include "sound/hc55516.h"
#include "redalert.h" #include "redalert.h"
@ -297,22 +297,22 @@ WRITE8_HANDLER( demoneye_audio_command_w )
} }
static WRITE8_HANDLER( demoneye_ay8910_latch_1_w ) static WRITE8_DEVICE_HANDLER( demoneye_ay8910_latch_1_w )
{ {
ay8910_latch_1 = data; ay8910_latch_1 = data;
} }
static READ8_HANDLER( demoneye_ay8910_latch_2_r ) static READ8_DEVICE_HANDLER( demoneye_ay8910_latch_2_r )
{ {
return ay8910_latch_2; return ay8910_latch_2;
} }
static WRITE8_HANDLER( demoneye_ay8910_data_w ) static WRITE8_DEVICE_HANDLER( demoneye_ay8910_data_w )
{ {
const device_config *ay1 = devtag_get_device(space->machine, "ay1"); const device_config *ay1 = devtag_get_device(device->machine, "ay1");
const device_config *ay2 = devtag_get_device(space->machine, "ay2"); const device_config *ay2 = devtag_get_device(device->machine, "ay2");
switch (ay8910_latch_1 & 0x03) switch (ay8910_latch_1 & 0x03)
{ {
@ -353,7 +353,7 @@ static WRITE8_HANDLER( demoneye_ay8910_data_w )
static ADDRESS_MAP_START( demoneye_audio_map, ADDRESS_SPACE_PROGRAM, 8 ) static ADDRESS_MAP_START( demoneye_audio_map, ADDRESS_SPACE_PROGRAM, 8 )
ADDRESS_MAP_GLOBAL_MASK(0x3fff) ADDRESS_MAP_GLOBAL_MASK(0x3fff)
AM_RANGE(0x0000, 0x007f) AM_RAM AM_RANGE(0x0000, 0x007f) AM_RAM
AM_RANGE(0x0500, 0x0503) AM_READWRITE(pia_0_r, pia_0_w) AM_RANGE(0x0500, 0x0503) AM_DEVREADWRITE("sndpia", pia_r, pia_w)
AM_RANGE(0x2000, 0x3fff) AM_ROM AM_RANGE(0x2000, 0x3fff) AM_ROM
ADDRESS_MAP_END ADDRESS_MAP_END
@ -371,9 +371,18 @@ static const ay8910_interface demoneye_ay8910_interface =
static const pia6821_interface demoneye_pia_intf = static const pia6821_interface demoneye_pia_intf =
{ {
/*inputs : A/B,CA/B1,CA/B2 */ demoneye_ay8910_latch_2_r, 0, 0, 0, 0, 0, DEVCB_HANDLER(demoneye_ay8910_latch_2_r), /* port A in */
/*outputs: A/B,CA/B2 */ demoneye_ay8910_data_w, demoneye_ay8910_latch_1_w, 0, 0, DEVCB_NULL, /* port B in */
/*irqs : A/B */ 0, 0 DEVCB_NULL, /* line CA1 in */
DEVCB_NULL, /* line CB1 in */
DEVCB_NULL, /* line CA2 in */
DEVCB_NULL, /* line CB2 in */
DEVCB_HANDLER(demoneye_ay8910_data_w), /* port A out */
DEVCB_HANDLER(demoneye_ay8910_latch_1_w), /* port B out */
DEVCB_NULL, /* line CA2 out */
DEVCB_NULL, /* port CB2 out */
DEVCB_NULL, /* IRQA */
DEVCB_NULL /* IRQB */
}; };
@ -386,27 +395,12 @@ static const pia6821_interface demoneye_pia_intf =
static SOUND_START( demoneye ) static SOUND_START( demoneye )
{ {
pia_config(machine, 0, &demoneye_pia_intf);
state_save_register_global(machine, ay8910_latch_1); state_save_register_global(machine, ay8910_latch_1);
state_save_register_global(machine, ay8910_latch_2); state_save_register_global(machine, ay8910_latch_2);
} }
/*************************************
*
* Demoneye-X audio reset
*
*************************************/
static SOUND_RESET( demoneye )
{
pia_reset();
}
/************************************* /*************************************
* *
* Demoneye-X machine driver * Demoneye-X machine driver
@ -419,8 +413,9 @@ MACHINE_DRIVER_START( demoneye_audio )
MDRV_CPU_PROGRAM_MAP(demoneye_audio_map,0) MDRV_CPU_PROGRAM_MAP(demoneye_audio_map,0)
MDRV_CPU_PERIODIC_INT(irq0_line_hold, REDALERT_AUDIO_CPU_IRQ_FREQ) /* guess */ MDRV_CPU_PERIODIC_INT(irq0_line_hold, REDALERT_AUDIO_CPU_IRQ_FREQ) /* guess */
MDRV_PIA6821_ADD("sndpia", demoneye_pia_intf)
MDRV_SOUND_START( demoneye ) MDRV_SOUND_START( demoneye )
MDRV_SOUND_RESET( demoneye )
MDRV_SPEAKER_STANDARD_MONO("mono") MDRV_SPEAKER_STANDARD_MONO("mono")

View File

@ -23,7 +23,7 @@
****************************************************************************/ ****************************************************************************/
#include "driver.h" #include "driver.h"
#include "machine/6821pia.h" #include "machine/6821new.h"
#include "cpu/m6809/m6809.h" #include "cpu/m6809/m6809.h"
#include "williams.h" #include "williams.h"
#include "sound/2151intf.h" #include "sound/2151intf.h"
@ -54,7 +54,6 @@ static UINT8 audio_sync;
static const device_config *sound_cpu; static const device_config *sound_cpu;
static const device_config *soundalt_cpu; static const device_config *soundalt_cpu;
static UINT8 williams_pianum;
@ -66,13 +65,11 @@ static void init_audio_state(running_machine *machine);
static void cvsd_ym2151_irq(const device_config *device, int state); static void cvsd_ym2151_irq(const device_config *device, int state);
static void adpcm_ym2151_irq(const device_config *device, int state); static void adpcm_ym2151_irq(const device_config *device, int state);
static void cvsd_irqa(running_machine *machine, int state); static WRITE_LINE_DEVICE_HANDLER( cvsd_irqa );
static void cvsd_irqb(running_machine *machine, int state); static WRITE_LINE_DEVICE_HANDLER( cvsd_irqb );
static WRITE8_HANDLER( cvsd_bank_select_w ); static WRITE8_HANDLER( cvsd_bank_select_w );
static READ8_HANDLER( cvsd_pia_r ); static WRITE8_DEVICE_HANDLER( cvsd_talkback_w );
static WRITE8_HANDLER( cvsd_pia_w );
static WRITE8_HANDLER( cvsd_talkback_w );
static WRITE8_DEVICE_HANDLER( cvsd_digit_clock_clear_w ); static WRITE8_DEVICE_HANDLER( cvsd_digit_clock_clear_w );
static WRITE8_DEVICE_HANDLER( cvsd_clock_set_w ); static WRITE8_DEVICE_HANDLER( cvsd_clock_set_w );
@ -101,7 +98,7 @@ static WRITE8_HANDLER( narc_slave_sync_w );
static ADDRESS_MAP_START( williams_cvsd_map, ADDRESS_SPACE_PROGRAM, 8 ) static ADDRESS_MAP_START( williams_cvsd_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x07ff) AM_MIRROR(0x1800) AM_RAM AM_RANGE(0x0000, 0x07ff) AM_MIRROR(0x1800) AM_RAM
AM_RANGE(0x2000, 0x2001) AM_MIRROR(0x1ffe) AM_DEVREADWRITE("ym", ym2151_r, ym2151_w) AM_RANGE(0x2000, 0x2001) AM_MIRROR(0x1ffe) AM_DEVREADWRITE("ym", ym2151_r, ym2151_w)
AM_RANGE(0x4000, 0x4003) AM_MIRROR(0x1ffc) AM_READWRITE(cvsd_pia_r, cvsd_pia_w) AM_RANGE(0x4000, 0x4003) AM_MIRROR(0x1ffc) AM_DEVREADWRITE("cvsdpia", pia_r, pia_w)
AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x07ff) AM_DEVWRITE("cvsd", cvsd_digit_clock_clear_w) AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x07ff) AM_DEVWRITE("cvsd", cvsd_digit_clock_clear_w)
AM_RANGE(0x6800, 0x6800) AM_MIRROR(0x07ff) AM_DEVWRITE("cvsd", cvsd_clock_set_w) AM_RANGE(0x6800, 0x6800) AM_MIRROR(0x07ff) AM_DEVWRITE("cvsd", cvsd_clock_set_w)
AM_RANGE(0x7800, 0x7800) AM_MIRROR(0x07ff) AM_WRITE(cvsd_bank_select_w) AM_RANGE(0x7800, 0x7800) AM_MIRROR(0x07ff) AM_WRITE(cvsd_bank_select_w)
@ -155,16 +152,20 @@ ADDRESS_MAP_END
/* PIA structure */ /* PIA structure */
static WRITE8_HANDLER( dac_0_data_w )
{
dac_data_w(devtag_get_device(space->machine, "dac"), data);
}
static const pia6821_interface cvsd_pia_intf = static const pia6821_interface cvsd_pia_intf =
{ {
/*inputs : A/B,CA/B1,CA/B2 */ 0, 0, 0, 0, 0, 0, DEVCB_NULL, /* port A in */
/*outputs: A/B,CA/B2 */ dac_0_data_w, cvsd_talkback_w, 0, 0, DEVCB_NULL, /* port B in */
/*irqs : A/B */ cvsd_irqa, cvsd_irqb DEVCB_NULL, /* line CA1 in */
DEVCB_NULL, /* line CB1 in */
DEVCB_NULL, /* line CA2 in */
DEVCB_NULL, /* line CB2 in */
DEVCB_DEVICE_HANDLER("dac", dac_w), /* port A out */
DEVCB_HANDLER(cvsd_talkback_w), /* port B out */
DEVCB_NULL, /* line CA2 out */
DEVCB_NULL, /* port CB2 out */
DEVCB_LINE(cvsd_irqa), /* IRQA */
DEVCB_LINE(cvsd_irqb) /* IRQB */
}; };
@ -195,6 +196,8 @@ static const ym2151_interface adpcm_ym2151_interface =
MACHINE_DRIVER_START( williams_cvsd_sound ) MACHINE_DRIVER_START( williams_cvsd_sound )
MDRV_CPU_ADD("cvsdcpu", M6809E, CVSD_MASTER_CLOCK) MDRV_CPU_ADD("cvsdcpu", M6809E, CVSD_MASTER_CLOCK)
MDRV_CPU_PROGRAM_MAP(williams_cvsd_map,0) MDRV_CPU_PROGRAM_MAP(williams_cvsd_map,0)
MDRV_PIA6821_ADD("cvsdpia", cvsd_pia_intf)
MDRV_SPEAKER_STANDARD_MONO("mono") MDRV_SPEAKER_STANDARD_MONO("mono")
@ -262,7 +265,7 @@ MACHINE_DRIVER_END
INITIALIZATION INITIALIZATION
****************************************************************************/ ****************************************************************************/
void williams_cvsd_init(running_machine *machine, int pianum) void williams_cvsd_init(running_machine *machine)
{ {
UINT8 *ROM; UINT8 *ROM;
int bank; int bank;
@ -271,10 +274,6 @@ void williams_cvsd_init(running_machine *machine, int pianum)
sound_cpu = cputag_get_cpu(machine, "cvsdcpu"); sound_cpu = cputag_get_cpu(machine, "cvsdcpu");
soundalt_cpu = NULL; soundalt_cpu = NULL;
/* configure the PIA */
williams_pianum = pianum;
pia_config(machine, pianum, &cvsd_pia_intf);
/* configure master CPU banks */ /* configure master CPU banks */
ROM = memory_region(machine, "cvsdcpu"); ROM = memory_region(machine, "cvsdcpu");
for (bank = 0; bank < 16; bank++) for (bank = 0; bank < 16; bank++)
@ -290,7 +289,7 @@ void williams_cvsd_init(running_machine *machine, int pianum)
memory_set_bank(machine, 5, 0); memory_set_bank(machine, 5, 0);
/* reset the IRQ state */ /* reset the IRQ state */
pia_set_input_ca1(williams_pianum, 1); pia_ca1_w(devtag_get_device(machine, "cvsdpia"), 0, 1);
/* register for save states */ /* register for save states */
state_save_register_global(machine, williams_sound_int_state); state_save_register_global(machine, williams_sound_int_state);
@ -409,17 +408,17 @@ static void init_audio_state(running_machine *machine)
static void cvsd_ym2151_irq(const device_config *device, int state) static void cvsd_ym2151_irq(const device_config *device, int state)
{ {
pia_set_input_ca1(williams_pianum, !state); pia_ca1_w(devtag_get_device(device->machine, "cvsdpia"), 0, !state);
} }
static void cvsd_irqa(running_machine *machine, int state) static WRITE_LINE_DEVICE_HANDLER( cvsd_irqa )
{ {
cpu_set_input_line(sound_cpu, M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE); cpu_set_input_line(sound_cpu, M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
} }
static void cvsd_irqb(running_machine *machine, int state) static WRITE_LINE_DEVICE_HANDLER( cvsd_irqb )
{ {
cpu_set_input_line(sound_cpu, INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE); cpu_set_input_line(sound_cpu, INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE);
} }
@ -447,19 +446,7 @@ static WRITE8_HANDLER( cvsd_bank_select_w )
} }
static READ8_HANDLER( cvsd_pia_r ) static WRITE8_DEVICE_HANDLER( cvsd_talkback_w )
{
return pia_read(williams_pianum, offset);
}
static WRITE8_HANDLER( cvsd_pia_w )
{
pia_write(williams_pianum, offset, data);
}
static WRITE8_HANDLER( cvsd_talkback_w )
{ {
audio_talkback = data; audio_talkback = data;
logerror("CVSD Talkback = %02X\n", data); logerror("CVSD Talkback = %02X\n", data);
@ -485,9 +472,10 @@ static WRITE8_DEVICE_HANDLER( cvsd_clock_set_w )
static TIMER_CALLBACK( williams_cvsd_delayed_data_w ) static TIMER_CALLBACK( williams_cvsd_delayed_data_w )
{ {
pia_set_input_b(williams_pianum, param & 0xff); const device_config *pia = devtag_get_device(machine, "cvsdpia");
pia_set_input_cb1(williams_pianum, param & 0x100); pia_portb_w(pia, 0, param & 0xff);
pia_set_input_cb2(williams_pianum, param & 0x200); pia_cb1_w(pia, 0, (param >> 8) & 1);
pia_cb2_w(pia, 0, (param >> 9) & 1);
} }

View File

@ -8,7 +8,7 @@ MACHINE_DRIVER_EXTERN( williams_cvsd_sound );
MACHINE_DRIVER_EXTERN( williams_adpcm_sound ); MACHINE_DRIVER_EXTERN( williams_adpcm_sound );
MACHINE_DRIVER_EXTERN( williams_narc_sound ); MACHINE_DRIVER_EXTERN( williams_narc_sound );
void williams_cvsd_init(running_machine *machine, int pianum); void williams_cvsd_init(running_machine *machine);
void williams_cvsd_data_w(running_machine *machine, int data); void williams_cvsd_data_w(running_machine *machine, int data);
void williams_cvsd_reset_w(int state); void williams_cvsd_reset_w(int state);

View File

@ -624,7 +624,7 @@
#include "driver.h" #include "driver.h"
#include "cpu/m6502/m6502.h" #include "cpu/m6502/m6502.h"
#include "video/mc6845.h" #include "video/mc6845.h"
#include "machine/6821pia.h" #include "machine/6821new.h"
#include "machine/6850acia.h" #include "machine/6850acia.h"
#include "sound/ay8910.h" #include "sound/ay8910.h"
@ -646,11 +646,6 @@ VIDEO_UPDATE( calomega );
* Read/Write Handlers * * Read/Write Handlers *
****************************/ ****************************/
static READ8_HANDLER( dipsw_1_r )
{
return input_port_read(space->machine, "SW1");
}
static WRITE_LINE_DEVICE_HANDLER( tx_rx_clk ) static WRITE_LINE_DEVICE_HANDLER( tx_rx_clk )
{ {
int trx_clk; int trx_clk;
@ -662,19 +657,19 @@ static WRITE_LINE_DEVICE_HANDLER( tx_rx_clk )
static int s903_mux_data = 0; static int s903_mux_data = 0;
static READ8_HANDLER( s903_mux_port_r ) static READ8_DEVICE_HANDLER( s903_mux_port_r )
{ {
switch( s903_mux_data & 0xf0 ) /* bits 4-7 */ switch( s903_mux_data & 0xf0 ) /* bits 4-7 */
{ {
case 0x10: return input_port_read(space->machine, "IN0-0"); case 0x10: return input_port_read(device->machine, "IN0-0");
case 0x20: return input_port_read(space->machine, "IN0-1"); case 0x20: return input_port_read(device->machine, "IN0-1");
case 0x40: return input_port_read(space->machine, "IN0-2"); case 0x40: return input_port_read(device->machine, "IN0-2");
case 0x80: return input_port_read(space->machine, "IN0-3"); case 0x80: return input_port_read(device->machine, "IN0-3");
} }
return 0xff; return 0xff;
} }
static WRITE8_HANDLER( s903_mux_w ) static WRITE8_DEVICE_HANDLER( s903_mux_w )
{ {
s903_mux_data = data ^ 0xff; /* inverted */ s903_mux_data = data ^ 0xff; /* inverted */
} }
@ -682,19 +677,19 @@ static WRITE8_HANDLER( s903_mux_w )
static int s905_mux_data = 0; static int s905_mux_data = 0;
static READ8_HANDLER( s905_mux_port_r ) static READ8_DEVICE_HANDLER( s905_mux_port_r )
{ {
switch( s905_mux_data & 0x0f ) /* bits 0-3 */ switch( s905_mux_data & 0x0f ) /* bits 0-3 */
{ {
case 0x01: return input_port_read(space->machine, "IN0-0"); case 0x01: return input_port_read(device->machine, "IN0-0");
case 0x02: return input_port_read(space->machine, "IN0-1"); case 0x02: return input_port_read(device->machine, "IN0-1");
case 0x04: return input_port_read(space->machine, "IN0-2"); case 0x04: return input_port_read(device->machine, "IN0-2");
case 0x08: return input_port_read(space->machine, "IN0-3"); case 0x08: return input_port_read(device->machine, "IN0-3");
} }
return 0xff; return 0xff;
} }
static WRITE8_HANDLER( s905_mux_w ) static WRITE8_DEVICE_HANDLER( s905_mux_w )
{ {
s905_mux_data = data ^ 0xff; /* inverted */ s905_mux_data = data ^ 0xff; /* inverted */
} }
@ -720,7 +715,7 @@ static WRITE8_HANDLER( s905_mux_w )
0xff 0x7b = Take 0xff 0x7b = Take
*/ */
static WRITE8_HANDLER( lamps_a_w ) static WRITE8_DEVICE_HANDLER( lamps_a_w )
{ {
output_set_lamp_value(0, 1-((data) & 1)); // 0 output_set_lamp_value(0, 1-((data) & 1)); // 0
output_set_lamp_value(1, 1-((data >> 1) & 1)); // 1 output_set_lamp_value(1, 1-((data >> 1) & 1)); // 1
@ -732,7 +727,7 @@ static WRITE8_HANDLER( lamps_a_w )
output_set_lamp_value(7, 1-((data >> 7) & 1)); // 7 output_set_lamp_value(7, 1-((data >> 7) & 1)); // 7
} }
static WRITE8_HANDLER( lamps_b_w ) static WRITE8_DEVICE_HANDLER( lamps_b_w )
{ {
output_set_lamp_value(8, 1-((data) & 1)); // 0 output_set_lamp_value(8, 1-((data) & 1)); // 0
output_set_lamp_value(9, 1-((data >> 1) & 1)); // 1 output_set_lamp_value(9, 1-((data >> 1) & 1)); // 1
@ -755,8 +750,8 @@ static ADDRESS_MAP_START( sys903_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0840, 0x0841) AM_DEVWRITE("ay8912", ay8910_address_data_w) AM_RANGE(0x0840, 0x0841) AM_DEVWRITE("ay8912", ay8910_address_data_w)
AM_RANGE(0x0880, 0x0880) AM_DEVWRITE("crtc", mc6845_address_w) AM_RANGE(0x0880, 0x0880) AM_DEVWRITE("crtc", mc6845_address_w)
AM_RANGE(0x0881, 0x0881) AM_DEVREADWRITE("crtc", mc6845_register_r, mc6845_register_w) AM_RANGE(0x0881, 0x0881) AM_DEVREADWRITE("crtc", mc6845_register_r, mc6845_register_w)
AM_RANGE(0x08c4, 0x08c7) AM_READWRITE(pia_0_r, pia_0_w) AM_RANGE(0x08c4, 0x08c7) AM_DEVREADWRITE("pia0", pia_r, pia_w)
AM_RANGE(0x08c8, 0x08cb) AM_READWRITE(pia_1_r, pia_1_w) AM_RANGE(0x08c8, 0x08cb) AM_DEVREADWRITE("pia1", pia_r, pia_w)
AM_RANGE(0x08d0, 0x08d0) AM_DEVREADWRITE("acia6850_0", acia6850_stat_r, acia6850_ctrl_w) AM_RANGE(0x08d0, 0x08d0) AM_DEVREADWRITE("acia6850_0", acia6850_stat_r, acia6850_ctrl_w)
AM_RANGE(0x08d1, 0x08d1) AM_DEVREADWRITE("acia6850_0", acia6850_data_r, acia6850_data_w) AM_RANGE(0x08d1, 0x08d1) AM_DEVREADWRITE("acia6850_0", acia6850_data_r, acia6850_data_w)
AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(calomega_videoram_w) AM_BASE(&videoram) AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(calomega_videoram_w) AM_BASE(&videoram)
@ -770,8 +765,8 @@ static ADDRESS_MAP_START( s903mod_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0840, 0x0841) AM_DEVWRITE("ay8912", ay8910_address_data_w) AM_RANGE(0x0840, 0x0841) AM_DEVWRITE("ay8912", ay8910_address_data_w)
AM_RANGE(0x0880, 0x0880) AM_DEVWRITE("crtc", mc6845_address_w) AM_RANGE(0x0880, 0x0880) AM_DEVWRITE("crtc", mc6845_address_w)
AM_RANGE(0x0881, 0x0881) AM_DEVREADWRITE("crtc", mc6845_register_r, mc6845_register_w) AM_RANGE(0x0881, 0x0881) AM_DEVREADWRITE("crtc", mc6845_register_r, mc6845_register_w)
AM_RANGE(0x08c4, 0x08c7) AM_READWRITE(pia_0_r, pia_0_w) AM_RANGE(0x08c4, 0x08c7) AM_DEVREADWRITE("pia0", pia_r, pia_w)
AM_RANGE(0x08c8, 0x08cb) AM_READWRITE(pia_1_r, pia_1_w) AM_RANGE(0x08c8, 0x08cb) AM_DEVREADWRITE("pia1", pia_r, pia_w)
AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(calomega_videoram_w) AM_BASE(&videoram) AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(calomega_videoram_w) AM_BASE(&videoram)
AM_RANGE(0x1400, 0x17ff) AM_RAM_WRITE(calomega_colorram_w) AM_BASE(&colorram) AM_RANGE(0x1400, 0x17ff) AM_RAM_WRITE(calomega_colorram_w) AM_BASE(&colorram)
AM_RANGE(0x1800, 0xffff) AM_ROM AM_RANGE(0x1800, 0xffff) AM_ROM
@ -783,8 +778,8 @@ static ADDRESS_MAP_START( sys905_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x1040, 0x1041) AM_DEVWRITE("ay8912", ay8910_address_data_w) AM_RANGE(0x1040, 0x1041) AM_DEVWRITE("ay8912", ay8910_address_data_w)
AM_RANGE(0x1080, 0x1080) AM_DEVWRITE("crtc", mc6845_address_w) AM_RANGE(0x1080, 0x1080) AM_DEVWRITE("crtc", mc6845_address_w)
AM_RANGE(0x1081, 0x1081) AM_DEVREADWRITE("crtc", mc6845_register_r, mc6845_register_w) AM_RANGE(0x1081, 0x1081) AM_DEVREADWRITE("crtc", mc6845_register_r, mc6845_register_w)
AM_RANGE(0x10c4, 0x10c7) AM_READWRITE(pia_0_r, pia_0_w) AM_RANGE(0x10c4, 0x10c7) AM_DEVREADWRITE("pia0", pia_r, pia_w)
AM_RANGE(0x10c8, 0x10cb) AM_READWRITE(pia_1_r, pia_1_w) AM_RANGE(0x10c8, 0x10cb) AM_DEVREADWRITE("pia1", pia_r, pia_w)
AM_RANGE(0x2000, 0x23ff) AM_RAM_WRITE(calomega_videoram_w) AM_BASE(&videoram) AM_RANGE(0x2000, 0x23ff) AM_RAM_WRITE(calomega_videoram_w) AM_BASE(&videoram)
AM_RANGE(0x2400, 0x27ff) AM_RAM_WRITE(calomega_colorram_w) AM_BASE(&colorram) AM_RANGE(0x2400, 0x27ff) AM_RAM_WRITE(calomega_colorram_w) AM_BASE(&colorram)
AM_RANGE(0x2800, 0xffff) AM_ROM AM_RANGE(0x2800, 0xffff) AM_ROM
@ -1647,14 +1642,18 @@ GFXDECODE_END
*/ */
static const pia6821_interface sys903_pia0_intf = static const pia6821_interface sys903_pia0_intf =
{ {
/* PIA inputs: A, B, CA1, CB1, CA2, CB2 */ DEVCB_HANDLER(s903_mux_port_r), /* port A in */
s903_mux_port_r, 0, 0, 0, 0, 0, DEVCB_NULL, /* port B in */
DEVCB_NULL, /* line CA1 in */
/* PIA outputs: A, B, CA2, CB2 */ DEVCB_NULL, /* line CB1 in */
0, lamps_a_w, 0, 0, DEVCB_NULL, /* line CA2 in */
DEVCB_NULL, /* line CB2 in */
/* PIA IRQs: A, B */ DEVCB_NULL, /* port A out */
0, 0 DEVCB_HANDLER(lamps_a_w), /* port B out */
DEVCB_NULL, /* line CA2 out */
DEVCB_NULL, /* port CB2 out */
DEVCB_NULL, /* IRQA */
DEVCB_NULL /* IRQB */
}; };
/********** Systems 903/904 PIA-1 (U39) wiring ********** /********** Systems 903/904 PIA-1 (U39) wiring **********
@ -1705,14 +1704,18 @@ static const pia6821_interface sys903_pia0_intf =
*/ */
static const pia6821_interface sys903_pia1_intf = static const pia6821_interface sys903_pia1_intf =
{ {
/* PIA inputs: A, B, CA1, CB1, CA2, CB2 */ DEVCB_INPUT_PORT("SW1"), /* port A in */
dipsw_1_r, 0, 0, 0, 0, 0, DEVCB_NULL, /* port B in */
DEVCB_NULL, /* line CA1 in */
/* PIA outputs: A, B, CA2, CB2 */ DEVCB_NULL, /* line CB1 in */
lamps_b_w, s903_mux_w, 0, 0, DEVCB_NULL, /* line CA2 in */
DEVCB_NULL, /* line CB2 in */
/* PIA IRQs: A, B */ DEVCB_HANDLER(lamps_b_w), /* port A out */
0, 0 DEVCB_HANDLER(s903_mux_w), /* port B out */
DEVCB_NULL, /* line CA2 out */
DEVCB_NULL, /* port CB2 out */
DEVCB_NULL, /* IRQA */
DEVCB_NULL /* IRQB */
}; };
/********** System 905 PIA-0 (U48) wiring ********** /********** System 905 PIA-0 (U48) wiring **********
@ -1763,14 +1766,18 @@ static const pia6821_interface sys903_pia1_intf =
*/ */
static const pia6821_interface sys905_pia0_intf = static const pia6821_interface sys905_pia0_intf =
{ {
/* PIA inputs: A, B, CA1, CB1, CA2, CB2 */ DEVCB_HANDLER(s905_mux_port_r), /* port A in */
s905_mux_port_r, 0, 0, 0, 0, 0, DEVCB_NULL, /* port B in */
DEVCB_NULL, /* line CA1 in */
/* PIA outputs: A, B, CA2, CB2 */ DEVCB_NULL, /* line CB1 in */
0, lamps_a_w, 0, 0, DEVCB_NULL, /* line CA2 in */
DEVCB_NULL, /* line CB2 in */
/* PIA IRQs: A, B */ DEVCB_NULL, /* port A out */
0, 0 DEVCB_HANDLER(lamps_a_w), /* port B out */
DEVCB_NULL, /* line CA2 out */
DEVCB_NULL, /* port CB2 out */
DEVCB_NULL, /* IRQA */
DEVCB_NULL /* IRQB */
}; };
/********** Systems 905 PIA-1 (U63) wiring ********** /********** Systems 905 PIA-1 (U63) wiring **********
@ -1821,14 +1828,18 @@ static const pia6821_interface sys905_pia0_intf =
*/ */
static const pia6821_interface sys905_pia1_intf = static const pia6821_interface sys905_pia1_intf =
{ {
/* PIA inputs: A, B, CA1, CB1, CA2, CB2 */ DEVCB_INPUT_PORT("SW1"), /* port A in */
dipsw_1_r, 0, 0, 0, 0, 0, DEVCB_NULL, /* port B in */
DEVCB_NULL, /* line CA1 in */
/* PIA outputs: A, B, CA2, CB2 */ DEVCB_NULL, /* line CB1 in */
lamps_b_w, s905_mux_w, 0, 0, DEVCB_NULL, /* line CA2 in */
DEVCB_NULL, /* line CB2 in */
/* PIA IRQs: A, B */ DEVCB_HANDLER(lamps_b_w), /* port A out */
0, 0 DEVCB_HANDLER(s905_mux_w), /* port B out */
DEVCB_NULL, /* line CA2 out */
DEVCB_NULL, /* port CB2 out */
DEVCB_NULL, /* IRQA */
DEVCB_NULL /* IRQB */
}; };
@ -1859,28 +1870,6 @@ static ACIA6850_INTERFACE( acia6850_intf )
}; };
/*******************************
* Machine Start & Reset *
*******************************/
static MACHINE_START( sys903 )
{
pia_config(machine, 0, &sys903_pia0_intf);
pia_config(machine, 1, &sys903_pia1_intf);
}
static MACHINE_START( sys905 )
{
pia_config(machine, 0, &sys905_pia0_intf);
pia_config(machine, 1, &sys905_pia1_intf);
}
static MACHINE_RESET( calomega )
{
pia_reset();
}
/************************* /*************************
* Sound Interfaces * * Sound Interfaces *
*************************/ *************************/
@ -1935,8 +1924,8 @@ static MACHINE_DRIVER_START( sys903 )
MDRV_NVRAM_HANDLER(generic_0fill) MDRV_NVRAM_HANDLER(generic_0fill)
MDRV_MACHINE_START(sys903) MDRV_PIA6821_ADD("pia0", sys903_pia0_intf)
MDRV_MACHINE_RESET(calomega) MDRV_PIA6821_ADD("pia1", sys903_pia1_intf)
/* video hardware */ /* video hardware */
MDRV_SCREEN_ADD("screen", RASTER) MDRV_SCREEN_ADD("screen", RASTER)
@ -1972,7 +1961,8 @@ static MACHINE_DRIVER_START( sys905 )
MDRV_CPU_MODIFY("maincpu") MDRV_CPU_MODIFY("maincpu")
MDRV_CPU_PROGRAM_MAP(sys905_map, 0) MDRV_CPU_PROGRAM_MAP(sys905_map, 0)
MDRV_MACHINE_START(sys905) MDRV_PIA6821_MODIFY("pia0", sys905_pia0_intf)
MDRV_PIA6821_MODIFY("pia1", sys905_pia1_intf)
/* sound hardware */ /* sound hardware */
MDRV_SOUND_MODIFY("ay8912") MDRV_SOUND_MODIFY("ay8912")

View File

@ -18,7 +18,7 @@
#include "driver.h" #include "driver.h"
#include "cpu/m6502/m6502.h" #include "cpu/m6502/m6502.h"
#include "machine/6821pia.h" #include "machine/6821new.h"
#include "carpolo.h" #include "carpolo.h"
@ -29,10 +29,12 @@
* *
*************************************/ *************************************/
static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 ) static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x01ff) AM_READ(SMH_RAM) AM_RANGE(0x0000, 0x01ff) AM_RAM
AM_RANGE(0x5400, 0x5403) AM_READ(pia_0_r) AM_RANGE(0x3000, 0x30ff) AM_WRITEONLY AM_BASE(&carpolo_alpharam)
AM_RANGE(0x5800, 0x5803) AM_READ(pia_1_r) AM_RANGE(0x4000, 0x400f) AM_WRITEONLY AM_BASE(&carpolo_spriteram)
AM_RANGE(0x5400, 0x5403) AM_DEVREADWRITE("pia0", pia_r, pia_w)
AM_RANGE(0x5800, 0x5803) AM_DEVREADWRITE("pia1", pia_r, pia_w)
AM_RANGE(0xa000, 0xa000) AM_READ(carpolo_ball_screen_collision_cause_r) AM_RANGE(0xa000, 0xa000) AM_READ(carpolo_ball_screen_collision_cause_r)
AM_RANGE(0xa001, 0xa001) AM_READ(carpolo_car_ball_collision_x_r) AM_RANGE(0xa001, 0xa001) AM_READ(carpolo_car_ball_collision_x_r)
AM_RANGE(0xa002, 0xa002) AM_READ(carpolo_car_ball_collision_y_r) AM_RANGE(0xa002, 0xa002) AM_READ(carpolo_car_ball_collision_y_r)
@ -41,23 +43,14 @@ static ADDRESS_MAP_START( readmem, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0xa005, 0xa005) AM_READ(carpolo_car_ball_collision_cause_r) AM_RANGE(0xa005, 0xa005) AM_READ(carpolo_car_ball_collision_cause_r)
AM_RANGE(0xa006, 0xa006) AM_READ(carpolo_car_goal_collision_cause_r) AM_RANGE(0xa006, 0xa006) AM_READ(carpolo_car_goal_collision_cause_r)
AM_RANGE(0xa007, 0xa007) AM_READ_PORT("IN1") AM_RANGE(0xa007, 0xa007) AM_READ_PORT("IN1")
AM_RANGE(0xc000, 0xc000) AM_READ(carpolo_interrupt_cause_r)
AM_RANGE(0xf000, 0xffff) AM_READ(SMH_ROM)
ADDRESS_MAP_END
static ADDRESS_MAP_START( writemem, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x0000, 0x01ff) AM_WRITE(SMH_RAM)
AM_RANGE(0x3000, 0x30ff) AM_WRITE(SMH_RAM) AM_BASE(&carpolo_alpharam)
AM_RANGE(0x4000, 0x400f) AM_WRITE(SMH_RAM) AM_BASE(&carpolo_spriteram)
AM_RANGE(0x5400, 0x5403) AM_WRITE(pia_0_w)
AM_RANGE(0x5800, 0x5803) AM_WRITE(pia_1_w)
AM_RANGE(0xb000, 0xb000) AM_WRITE(carpolo_ball_screen_interrupt_clear_w) AM_RANGE(0xb000, 0xb000) AM_WRITE(carpolo_ball_screen_interrupt_clear_w)
AM_RANGE(0xb001, 0xb001) AM_WRITE(carpolo_timer_interrupt_clear_w) AM_RANGE(0xb001, 0xb001) AM_WRITE(carpolo_timer_interrupt_clear_w)
AM_RANGE(0xb003, 0xb003) AM_WRITE(carpolo_car_car_interrupt_clear_w) AM_RANGE(0xb003, 0xb003) AM_WRITE(carpolo_car_car_interrupt_clear_w)
AM_RANGE(0xb004, 0xb004) AM_WRITE(carpolo_car_border_interrupt_clear_w) AM_RANGE(0xb004, 0xb004) AM_WRITE(carpolo_car_border_interrupt_clear_w)
AM_RANGE(0xb005, 0xb005) AM_WRITE(carpolo_car_ball_interrupt_clear_w) AM_RANGE(0xb005, 0xb005) AM_WRITE(carpolo_car_ball_interrupt_clear_w)
AM_RANGE(0xb006, 0xb006) AM_WRITE(carpolo_car_goal_interrupt_clear_w) AM_RANGE(0xb006, 0xb006) AM_WRITE(carpolo_car_goal_interrupt_clear_w)
AM_RANGE(0xf000, 0xffff) AM_WRITE(SMH_ROM) AM_RANGE(0xc000, 0xc000) AM_READ(carpolo_interrupt_cause_r)
AM_RANGE(0xf000, 0xffff) AM_ROM
ADDRESS_MAP_END ADDRESS_MAP_END
@ -238,12 +231,15 @@ static MACHINE_DRIVER_START( carpolo )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", M6502,11289000/12) /* 940.75 kHz */ MDRV_CPU_ADD("maincpu", M6502,11289000/12) /* 940.75 kHz */
MDRV_CPU_PROGRAM_MAP(readmem,writemem) MDRV_CPU_PROGRAM_MAP(main_map,0)
MDRV_CPU_VBLANK_INT("screen", carpolo_timer_interrupt) /* this not strictly VBLANK, MDRV_CPU_VBLANK_INT("screen", carpolo_timer_interrupt) /* this not strictly VBLANK,
but it's supposed to happen 60 but it's supposed to happen 60
times a sec, so it's a good place */ times a sec, so it's a good place */
MDRV_MACHINE_START(carpolo) MDRV_MACHINE_START(carpolo)
MDRV_MACHINE_RESET(carpolo) MDRV_MACHINE_RESET(carpolo)
MDRV_PIA6821_ADD("pia0", carpolo_pia0_intf)
MDRV_PIA6821_ADD("pia1", carpolo_pia1_intf)
/* video hardware */ /* video hardware */
MDRV_SCREEN_ADD("screen", RASTER) MDRV_SCREEN_ADD("screen", RASTER)

View File

@ -130,7 +130,7 @@
#include "deprecat.h" #include "deprecat.h"
#include "exidy.h" #include "exidy.h"
#include "targ.h" #include "targ.h"
#include "machine/6821pia.h" #include "machine/6821new.h"
static UINT8 last_dial; static UINT8 last_dial;
@ -256,14 +256,14 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( venture_map, ADDRESS_SPACE_PROGRAM, 8 ) static ADDRESS_MAP_START( venture_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x4800, 0x4fff) AM_RAM AM_BASE(&exidy_characterram) AM_RANGE(0x4800, 0x4fff) AM_RAM AM_BASE(&exidy_characterram)
AM_RANGE(0x5200, 0x520f) AM_READWRITE(pia_0_r, pia_0_w) AM_RANGE(0x5200, 0x520f) AM_DEVREADWRITE("pia0", pia_r, pia_w)
AM_RANGE(0x8000, 0xffff) AM_ROM AM_RANGE(0x8000, 0xffff) AM_ROM
ADDRESS_MAP_END ADDRESS_MAP_END
static ADDRESS_MAP_START( pepper2_map, ADDRESS_SPACE_PROGRAM, 8 ) static ADDRESS_MAP_START( pepper2_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x4800, 0x4fff) AM_NOP AM_RANGE(0x4800, 0x4fff) AM_NOP
AM_RANGE(0x5200, 0x520f) AM_READWRITE(pia_0_r, pia_0_w) AM_RANGE(0x5200, 0x520f) AM_DEVREADWRITE("pia0", pia_r, pia_w)
AM_RANGE(0x6000, 0x6fff) AM_RAM AM_BASE(&exidy_characterram) AM_RANGE(0x6000, 0x6fff) AM_RAM AM_BASE(&exidy_characterram)
AM_RANGE(0x8000, 0xffff) AM_ROM AM_RANGE(0x8000, 0xffff) AM_ROM
ADDRESS_MAP_END ADDRESS_MAP_END
@ -275,7 +275,7 @@ static ADDRESS_MAP_START( fax_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x1c00, 0x1c00) AM_READ_PORT("IN3") AM_RANGE(0x1c00, 0x1c00) AM_READ_PORT("IN3")
AM_RANGE(0x2000, 0x2000) AM_WRITE(fax_bank_select_w) AM_RANGE(0x2000, 0x2000) AM_WRITE(fax_bank_select_w)
AM_RANGE(0x2000, 0x3fff) AM_ROMBANK(1) AM_RANGE(0x2000, 0x3fff) AM_ROMBANK(1)
AM_RANGE(0x5200, 0x520f) AM_READWRITE(pia_0_r, pia_0_w) AM_RANGE(0x5200, 0x520f) AM_DEVREADWRITE("pia0", pia_r, pia_w)
AM_RANGE(0x5213, 0x5217) AM_WRITE(SMH_NOP) /* empty control lines on color/sound board */ AM_RANGE(0x5213, 0x5217) AM_WRITE(SMH_NOP) /* empty control lines on color/sound board */
AM_RANGE(0x6000, 0x6fff) AM_RAM AM_BASE(&exidy_characterram) AM_RANGE(0x6000, 0x6fff) AM_RAM AM_BASE(&exidy_characterram)
AM_RANGE(0x8000, 0xffff) AM_ROM AM_RANGE(0x8000, 0xffff) AM_ROM

View File

@ -1684,7 +1684,6 @@ static MACHINE_DRIVER_START( joust2 )
/* pia */ /* pia */
MDRV_PIA6821_MODIFY("pia_1", joust2_pia_1_intf) MDRV_PIA6821_MODIFY("pia_1", joust2_pia_1_intf)
MDRV_PIA6821_ADD("pia_3", joust2_pia_3_intf)
MACHINE_DRIVER_END MACHINE_DRIVER_END

View File

@ -6,8 +6,13 @@
****************************************************************************/ ****************************************************************************/
#include "machine/6821new.h"
/*----------- defined in machine/carpolo.c -----------*/ /*----------- defined in machine/carpolo.c -----------*/
extern const pia6821_interface carpolo_pia0_intf;
extern const pia6821_interface carpolo_pia1_intf;
MACHINE_START( carpolo ); MACHINE_START( carpolo );
MACHINE_RESET( carpolo ); MACHINE_RESET( carpolo );

View File

@ -40,7 +40,6 @@ extern const pia6821_interface tshoot_pia_0_intf;
extern const pia6821_interface tshoot_pia_1_intf; extern const pia6821_interface tshoot_pia_1_intf;
extern const pia6821_interface tshoot_snd_pia_intf; extern const pia6821_interface tshoot_snd_pia_intf;
extern const pia6821_interface joust2_pia_1_intf; extern const pia6821_interface joust2_pia_1_intf;
extern const pia6821_interface joust2_pia_3_intf;
/* initialization */ /* initialization */
MACHINE_RESET( defender ); MACHINE_RESET( defender );

View File

@ -8,7 +8,7 @@
#include "driver.h" #include "driver.h"
#include "cpu/m6502/m6502.h" #include "cpu/m6502/m6502.h"
#include "machine/6821pia.h" #include "machine/6821new.h"
#include "machine/7474.h" #include "machine/7474.h"
#include "machine/74148.h" #include "machine/74148.h"
#include "machine/74153.h" #include "machine/74153.h"
@ -310,28 +310,28 @@ INTERRUPT_GEN( carpolo_timer_interrupt )
} }
static WRITE8_HANDLER( coin1_interrupt_clear_w ) static WRITE_LINE_DEVICE_HANDLER( coin1_interrupt_clear_w )
{ {
TTL7474_clear_w(TTL7474_2S_1, data); TTL7474_clear_w(TTL7474_2S_1, state);
TTL7474_update(space->machine, TTL7474_2S_1); TTL7474_update(device->machine, TTL7474_2S_1);
} }
static WRITE8_HANDLER( coin2_interrupt_clear_w ) static WRITE_LINE_DEVICE_HANDLER( coin2_interrupt_clear_w )
{ {
TTL7474_clear_w(TTL7474_2S_2, data); TTL7474_clear_w(TTL7474_2S_2, state);
TTL7474_update(space->machine, TTL7474_2S_2); TTL7474_update(device->machine, TTL7474_2S_2);
} }
static WRITE8_HANDLER( coin3_interrupt_clear_w ) static WRITE_LINE_DEVICE_HANDLER( coin3_interrupt_clear_w )
{ {
TTL7474_clear_w(TTL7474_2U_1, data); TTL7474_clear_w(TTL7474_2U_1, state);
TTL7474_update(space->machine, TTL7474_2U_1); TTL7474_update(device->machine, TTL7474_2U_1);
} }
static WRITE8_HANDLER( coin4_interrupt_clear_w ) static WRITE_LINE_DEVICE_HANDLER( coin4_interrupt_clear_w )
{ {
TTL7474_clear_w(TTL7474_2U_2, data); TTL7474_clear_w(TTL7474_2U_2, state);
TTL7474_update(space->machine, TTL7474_2U_2); TTL7474_update(device->machine, TTL7474_2U_2);
} }
WRITE8_HANDLER( carpolo_ball_screen_interrupt_clear_w ) WRITE8_HANDLER( carpolo_ball_screen_interrupt_clear_w )
@ -377,7 +377,7 @@ WRITE8_HANDLER( carpolo_timer_interrupt_clear_w )
* *
*************************************/ *************************************/
static WRITE8_HANDLER( pia_0_port_a_w ) static WRITE8_DEVICE_HANDLER( pia_0_port_a_w )
{ {
/* bit 0 - Coin counter /* bit 0 - Coin counter
bit 1 - Player 4 crash sound bit 1 - Player 4 crash sound
@ -396,14 +396,14 @@ static WRITE8_HANDLER( pia_0_port_a_w )
TTL7474_clear_w(TTL7474_1C_1, data & 0x08); TTL7474_clear_w(TTL7474_1C_1, data & 0x08);
TTL7474_clear_w(TTL7474_1A_1, data & 0x08); TTL7474_clear_w(TTL7474_1A_1, data & 0x08);
TTL7474_update(space->machine, TTL7474_1F_1); TTL7474_update(device->machine, TTL7474_1F_1);
TTL7474_update(space->machine, TTL7474_1D_1); TTL7474_update(device->machine, TTL7474_1D_1);
TTL7474_update(space->machine, TTL7474_1C_1); TTL7474_update(device->machine, TTL7474_1C_1);
TTL7474_update(space->machine, TTL7474_1A_1); TTL7474_update(device->machine, TTL7474_1A_1);
} }
static WRITE8_HANDLER( pia_0_port_b_w ) static WRITE8_DEVICE_HANDLER( pia_0_port_b_w )
{ {
/* bit 0 - Strobe speed bits sound /* bit 0 - Strobe speed bits sound
bit 1 - Speed bit 0 sound bit 1 - Speed bit 0 sound
@ -418,7 +418,7 @@ static WRITE8_HANDLER( pia_0_port_b_w )
TTL74153_update(TTL74153_1K); TTL74153_update(TTL74153_1K);
} }
static READ8_HANDLER( pia_0_port_b_r ) static READ8_DEVICE_HANDLER( pia_0_port_b_r )
{ {
/* bit 4 - Pedal bit 0 /* bit 4 - Pedal bit 0
bit 5 - Pedal bit 1 */ bit 5 - Pedal bit 1 */
@ -428,7 +428,7 @@ static READ8_HANDLER( pia_0_port_b_r )
} }
static READ8_HANDLER( pia_1_port_a_r ) static READ8_DEVICE_HANDLER( pia_1_port_a_r )
{ {
UINT8 ret; UINT8 ret;
@ -445,13 +445,13 @@ static READ8_HANDLER( pia_1_port_a_r )
(TTL7474_output_r(TTL7474_1C_2) ? 0x02 : 0x00) | (TTL7474_output_r(TTL7474_1C_2) ? 0x02 : 0x00) |
(TTL7474_output_r(TTL7474_1D_2) ? 0x04 : 0x00) | (TTL7474_output_r(TTL7474_1D_2) ? 0x04 : 0x00) |
(TTL7474_output_r(TTL7474_1F_2) ? 0x08 : 0x00) | (TTL7474_output_r(TTL7474_1F_2) ? 0x08 : 0x00) |
(input_port_read(space->machine, "IN2") & 0xf0); (input_port_read(device->machine, "IN2") & 0xf0);
return ret; return ret;
} }
static READ8_HANDLER( pia_1_port_b_r ) static READ8_DEVICE_HANDLER( pia_1_port_b_r )
{ {
UINT8 ret; UINT8 ret;
@ -469,18 +469,37 @@ static READ8_HANDLER( pia_1_port_b_r )
} }
static const pia6821_interface pia_0_intf = const pia6821_interface carpolo_pia0_intf =
{ {
/*inputs : A/B,CA/B1,CA/B2 */ 0, pia_0_port_b_r, 0, 0, 0, 0, DEVCB_NULL, /* port A in */
/*outputs: A/B,CA/B2 */ pia_0_port_a_w, pia_0_port_b_w, coin1_interrupt_clear_w, coin2_interrupt_clear_w, DEVCB_HANDLER(pia_0_port_b_r), /* port B in */
/*irqs : A/B */ 0, 0 DEVCB_NULL, /* line CA1 in */
DEVCB_NULL, /* line CB1 in */
DEVCB_NULL, /* line CA2 in */
DEVCB_NULL, /* line CB2 in */
DEVCB_HANDLER(pia_0_port_a_w), /* port A out */
DEVCB_HANDLER(pia_0_port_b_w), /* port B out */
DEVCB_LINE(coin1_interrupt_clear_w), /* line CA2 out */
DEVCB_LINE(coin2_interrupt_clear_w), /* port CB2 out */
DEVCB_NULL, /* IRQA */
DEVCB_NULL /* IRQB */
}; };
static const pia6821_interface pia_1_intf =
const pia6821_interface carpolo_pia1_intf =
{ {
/*inputs : A/B,CA/B1,CA/B2 */ pia_1_port_a_r, pia_1_port_b_r, 0, 0, 0, 0, DEVCB_HANDLER(pia_1_port_a_r), /* port A in */
/*outputs: A/B,CA/B2 */ 0, 0, coin3_interrupt_clear_w, coin4_interrupt_clear_w, DEVCB_HANDLER(pia_1_port_b_r), /* port B in */
/*irqs : A/B */ 0, 0 DEVCB_NULL, /* line CA1 in */
DEVCB_NULL, /* line CB1 in */
DEVCB_NULL, /* line CA2 in */
DEVCB_NULL, /* line CB2 in */
DEVCB_NULL, /* port A out */
DEVCB_NULL, /* port B out */
DEVCB_LINE(coin3_interrupt_clear_w), /* line CA2 out */
DEVCB_LINE(coin4_interrupt_clear_w), /* port CB2 out */
DEVCB_NULL, /* IRQA */
DEVCB_NULL /* IRQB */
}; };
static const struct TTL74148_interface TTL74148_3S_intf = static const struct TTL74148_interface TTL74148_3S_intf =
@ -511,10 +530,6 @@ static const struct TTL7474_interface TTL7474_2U_2_intf =
MACHINE_START( carpolo ) MACHINE_START( carpolo )
{ {
/* set up the PIA's */
pia_config(machine, 0, &pia_0_intf);
pia_config(machine, 1, &pia_1_intf);
state_save_register_global(machine, ball_screen_collision_cause); state_save_register_global(machine, ball_screen_collision_cause);
state_save_register_global(machine, car_ball_collision_x); state_save_register_global(machine, car_ball_collision_x);
state_save_register_global(machine, car_ball_collision_y); state_save_register_global(machine, car_ball_collision_y);

View File

@ -291,13 +291,13 @@ static void init_generic(running_machine *machine, int bpp, int sound, int prot_
switch (sound) switch (sound)
{ {
case SOUND_CVSD_SMALL: case SOUND_CVSD_SMALL:
williams_cvsd_init(machine, 0); williams_cvsd_init(machine);
memory_install_write8_handler(cpu_get_address_space(machine->cpu[1], ADDRESS_SPACE_PROGRAM), prot_start, prot_end, 0, 0, cvsd_protection_w); memory_install_write8_handler(cpu_get_address_space(machine->cpu[1], ADDRESS_SPACE_PROGRAM), prot_start, prot_end, 0, 0, cvsd_protection_w);
cvsd_protection_base = memory_region(machine, "cvsdcpu") + 0x10000 + (prot_start - 0x8000); cvsd_protection_base = memory_region(machine, "cvsdcpu") + 0x10000 + (prot_start - 0x8000);
break; break;
case SOUND_CVSD: case SOUND_CVSD:
williams_cvsd_init(machine, 0); williams_cvsd_init(machine);
memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[1], ADDRESS_SPACE_PROGRAM), prot_start, prot_end, 0, 0, SMH_BANK9, SMH_BANK9); memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[1], ADDRESS_SPACE_PROGRAM), prot_start, prot_end, 0, 0, SMH_BANK9, SMH_BANK9);
memory_set_bankptr(machine, 9, auto_malloc(0x80)); memory_set_bankptr(machine, 9, auto_malloc(0x80));
break; break;

View File

@ -258,11 +258,6 @@ const pia6821_interface joust2_pia_1_intf =
/*irqs : A/B */ DEVCB_LINE(williams_main_irq), DEVCB_LINE(williams_main_irq) /*irqs : A/B */ DEVCB_LINE(williams_main_irq), DEVCB_LINE(williams_main_irq)
}; };
/* Joust 2 PIA 3 */
const pia6821_interface joust2_pia_3_intf =
{
DEVCB_NULL,
};
/************************************* /*************************************
@ -956,13 +951,13 @@ static WRITE8_DEVICE_HANDLER( tshoot_lamp_w )
MACHINE_START( joust2 ) MACHINE_START( joust2 )
{ {
williams_cvsd_init(machine, 3); williams_cvsd_init(machine);
} }
MACHINE_RESET( joust2 ) MACHINE_RESET( joust2 )
{ {
const device_config *pia_3 = devtag_get_device(machine, "pia_3"); const device_config *pia_3 = devtag_get_device(machine, "cvsdpia");
/* standard init */ /* standard init */
MACHINE_RESET_CALL(williams2); MACHINE_RESET_CALL(williams2);
@ -980,7 +975,7 @@ static TIMER_CALLBACK( joust2_deferred_snd_cmd_w )
static WRITE8_DEVICE_HANDLER( joust2_pia_3_cb1_w ) static WRITE8_DEVICE_HANDLER( joust2_pia_3_cb1_w )
{ {
const device_config *pia_3 = devtag_get_device(device->machine, "pia_3"); const device_config *pia_3 = devtag_get_device(device->machine, "cvsdpia");
joust2_current_sound_data = (joust2_current_sound_data & ~0x100) | ((data << 8) & 0x100); joust2_current_sound_data = (joust2_current_sound_data & ~0x100) | ((data << 8) & 0x100);
pia_cb1_w(pia_3, offset, data); pia_cb1_w(pia_3, offset, data);