From ca0bee02b526ecfa267320b382597056d33d4298 Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Tue, 26 May 2009 05:43:32 +0000 Subject: [PATCH] Converted Namco 54xx to a device. The interface now specifies the name of the target discrete sound object and the base node, rather than making assumptions. --- src/emu/sound/namco52.c | 2 +- src/mame/audio/galaga.c | 28 +++--- src/mame/audio/namco54.c | 161 ++++++++++++++++++++++++++++------- src/mame/audio/namco54.h | 36 ++++++-- src/mame/audio/polepos.c | 16 ++-- src/mame/drivers/galaga.c | 30 ++----- src/mame/drivers/polepos.c | 8 +- src/mame/includes/nam_cust.h | 3 - src/mame/machine/namcoio.c | 2 +- 9 files changed, 192 insertions(+), 94 deletions(-) diff --git a/src/emu/sound/namco52.c b/src/emu/sound/namco52.c index 19075ea52c5..41859b53fb5 100644 --- a/src/emu/sound/namco52.c +++ b/src/emu/sound/namco52.c @@ -224,7 +224,7 @@ ADDRESS_MAP_END static MACHINE_DRIVER_START( namco_52xx ) - MDRV_CPU_ADD("mcu", MB8842, DERIVED_CLOCK(1,6)) /* parent clock, internally divided by 6 */ + MDRV_CPU_ADD("mcu", MB8842/*MB8852*/, DERIVED_CLOCK(1,6)) /* parent clock, internally divided by 6 */ MDRV_CPU_PROGRAM_MAP(namco_52xx_map_program) MDRV_CPU_DATA_MAP(namco_52xx_map_data) MDRV_CPU_IO_MAP(namco_52xx_map_io) diff --git a/src/mame/audio/galaga.c b/src/mame/audio/galaga.c index 5a9f660dbe1..b8b0f1e5d92 100644 --- a/src/mame/audio/galaga.c +++ b/src/mame/audio/galaga.c @@ -129,17 +129,17 @@ DISCRETE_SOUND_START(bosco) /************************************************ * Input register mapping ************************************************/ - DISCRETE_INPUT_DATA(NAMCO_54XX_0_DATA) - DISCRETE_INPUT_DATA(NAMCO_54XX_1_DATA) - DISCRETE_INPUT_DATA(NAMCO_54XX_2_DATA) - DISCRETE_INPUT_DATA(NAMCO_52XX_P_DATA) + DISCRETE_INPUT_DATA(NAMCO_54XX_0_DATA(NODE_01)) + DISCRETE_INPUT_DATA(NAMCO_54XX_1_DATA(NODE_01)) + DISCRETE_INPUT_DATA(NAMCO_54XX_2_DATA(NODE_01)) + DISCRETE_INPUT_DATA(NAMCO_52XX_P_DATA(NODE_01)) /************************************************ * CHANL1 sound ************************************************/ DISCRETE_DAC_R1(NODE_20, 1, /* ENAB */ - NAMCO_54XX_2_DATA, + NAMCO_54XX_2_DATA(NODE_01), 4, /* 4V - unmeasured*/ &bosco_54xx_dac) DISCRETE_OP_AMP_FILTER(BOSCO_CHANL1_SND, @@ -153,7 +153,7 @@ DISCRETE_SOUND_START(bosco) ************************************************/ DISCRETE_DAC_R1(NODE_30, 1, /* ENAB */ - NAMCO_54XX_1_DATA, + NAMCO_54XX_1_DATA(NODE_01), 4, /* 4V - unmeasured*/ &bosco_54xx_dac) DISCRETE_OP_AMP_FILTER(BOSCO_CHANL2_SND, @@ -167,7 +167,7 @@ DISCRETE_SOUND_START(bosco) ************************************************/ DISCRETE_DAC_R1(NODE_40, 1, /* ENAB */ - NAMCO_54XX_0_DATA, + NAMCO_54XX_0_DATA(NODE_01), 4, /* 4V - unmeasured*/ &bosco_54xx_dac) DISCRETE_OP_AMP_FILTER(BOSCO_CHANL3_SND, @@ -183,7 +183,7 @@ DISCRETE_SOUND_START(bosco) /* this circuit was simulated in SPICE and an equivalent filter circuit generated */ DISCRETE_DAC_R1(NODE_50, 0, /* ENAB */ - NAMCO_52XX_P_DATA, + NAMCO_52XX_P_DATA(NODE_01), 4, /* 4V - unmeasured*/ &bosco_52xx_dac) DISCRETE_FILTER2(NODE_51, @@ -314,16 +314,16 @@ DISCRETE_SOUND_START(galaga) /************************************************ * Input register mapping ************************************************/ - DISCRETE_INPUT_DATA(NAMCO_54XX_0_DATA) - DISCRETE_INPUT_DATA(NAMCO_54XX_1_DATA) - DISCRETE_INPUT_DATA(NAMCO_54XX_2_DATA) + DISCRETE_INPUT_DATA(NAMCO_54XX_0_DATA(NODE_01)) + DISCRETE_INPUT_DATA(NAMCO_54XX_1_DATA(NODE_01)) + DISCRETE_INPUT_DATA(NAMCO_54XX_2_DATA(NODE_01)) /************************************************ * CHANL1 sound ************************************************/ DISCRETE_DAC_R1(NODE_20, 1, /* ENAB */ - NAMCO_54XX_2_DATA, + NAMCO_54XX_2_DATA(NODE_01), 4, /* 4V - unmeasured*/ &galaga_54xx_dac) DISCRETE_OP_AMP_FILTER(GALAGA_CHANL1_SND, @@ -337,7 +337,7 @@ DISCRETE_SOUND_START(galaga) ************************************************/ DISCRETE_DAC_R1(NODE_30, 1, /* ENAB */ - NAMCO_54XX_1_DATA, + NAMCO_54XX_1_DATA(NODE_01), 4, /* 4V - unmeasured*/ &galaga_54xx_dac) DISCRETE_OP_AMP_FILTER(GALAGA_CHANL2_SND, @@ -351,7 +351,7 @@ DISCRETE_SOUND_START(galaga) ************************************************/ DISCRETE_DAC_R1(NODE_40, 1, /* ENAB */ - NAMCO_54XX_0_DATA, + NAMCO_54XX_0_DATA(NODE_01), 4, /* 4V - unmeasured*/ &galaga_54xx_dac) DISCRETE_OP_AMP_FILTER(GALAGA_CHANL3_SND, diff --git a/src/mame/audio/namco54.c b/src/mame/audio/namco54.c index e8836b5e39c..23564741c7d 100644 --- a/src/mame/audio/namco54.c +++ b/src/mame/audio/namco54.c @@ -52,43 +52,93 @@ The command format is very simple: #include "namco54.h" #include "cpu/mb88xx/mb88xx.h" +typedef struct _namco_54xx_state namco_54xx_state; +struct _namco_54xx_state +{ + const device_config *cpu; + const device_config *discrete; + int basenode; + UINT8 latched_cmd; +}; + +INLINE namco_54xx_state *get_safe_token(const device_config *device) +{ + assert(device != NULL); + assert(device->token != NULL); + assert(device->type == NAMCO_54XX); + + return (namco_54xx_state *)device->token; +} + -static UINT8 latched_cmd; static TIMER_CALLBACK( namco_54xx_latch_callback ) { - latched_cmd = param; + namco_54xx_state *state = get_safe_token((const device_config *)ptr); + state->latched_cmd = param; } static READ8_HANDLER( namco_54xx_K_r ) { - return latched_cmd >> 4; + namco_54xx_state *state = get_safe_token(space->cpu->owner); + return state->latched_cmd >> 4; } static READ8_HANDLER( namco_54xx_R0_r ) { - return latched_cmd & 0x0f; + namco_54xx_state *state = get_safe_token(space->cpu->owner); + return state->latched_cmd & 0x0f; } -static WRITE8_DEVICE_HANDLER( namco_54xx_O_w ) +static WRITE8_HANDLER( namco_54xx_O_w ) { + namco_54xx_state *state = get_safe_token(space->cpu->owner); UINT8 out = (data & 0x0f); if (data & 0x10) - discrete_sound_w(device, NAMCO_54XX_1_DATA, out); + discrete_sound_w(state->discrete, NAMCO_54XX_1_DATA(state->basenode), out); else - discrete_sound_w(device, NAMCO_54XX_0_DATA, out); + discrete_sound_w(state->discrete, NAMCO_54XX_0_DATA(state->basenode), out); } -static WRITE8_DEVICE_HANDLER( namco_54xx_R1_w ) +static WRITE8_HANDLER( namco_54xx_R1_w ) { + namco_54xx_state *state = get_safe_token(space->cpu->owner); UINT8 out = (data & 0x0f); - discrete_sound_w(device, NAMCO_54XX_2_DATA, out); + discrete_sound_w(state->discrete, NAMCO_54XX_2_DATA(state->basenode), out); } + +static TIMER_CALLBACK( namco_54xx_irq_clear ) +{ + namco_54xx_state *state = get_safe_token((const device_config *)ptr); + cpu_set_input_line(state->cpu, 0, CLEAR_LINE); +} + +void namco_54xx_write(const device_config *device, UINT8 data) +{ + namco_54xx_state *state = get_safe_token(device); + + timer_call_after_resynch(device->machine, (void *)device, data, namco_54xx_latch_callback); + + cpu_set_input_line(state->cpu, 0, ASSERT_LINE); + + // The execution time of one instruction is ~4us, so we must make sure to + // give the cpu time to poll the /IRQ input before we clear it. + // The input clock to the 06XX interface chip is 64H, that is + // 18432000/6/64 = 48kHz, so it makes sense for the irq line to be + // asserted for one clock cycle ~= 21us. + timer_set(device->machine, ATTOTIME_IN_USEC(21), (void *)device, 0, namco_54xx_irq_clear); +} + + +/*************************************************************************** + DEVICE INTERFACE +***************************************************************************/ + ADDRESS_MAP_START( namco_54xx_map_program, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x000, 0x3ff) AM_ROM ADDRESS_MAP_END @@ -99,35 +149,86 @@ ADDRESS_MAP_END ADDRESS_MAP_START( namco_54xx_map_io, ADDRESS_SPACE_IO, 8 ) AM_RANGE(MB88_PORTK, MB88_PORTK) AM_READ(namco_54xx_K_r) - AM_RANGE(MB88_PORTO, MB88_PORTO) AM_DEVWRITE("discrete", namco_54xx_O_w) + AM_RANGE(MB88_PORTO, MB88_PORTO) AM_WRITE(namco_54xx_O_w) AM_RANGE(MB88_PORTR0, MB88_PORTR0) AM_READ(namco_54xx_R0_r) - AM_RANGE(MB88_PORTR1, MB88_PORTR1) AM_DEVWRITE("discrete", namco_54xx_R1_w) + AM_RANGE(MB88_PORTR1, MB88_PORTR1) AM_WRITE(namco_54xx_R1_w) AM_RANGE(MB88_PORTR2, MB88_PORTR2) AM_NOP ADDRESS_MAP_END +static MACHINE_DRIVER_START( namco_54xx ) + MDRV_CPU_ADD("mcu", MB8844, DERIVED_CLOCK(1,6)) /* parent clock, internally divided by 6 */ + MDRV_CPU_PROGRAM_MAP(namco_54xx_map_program) + MDRV_CPU_DATA_MAP(namco_54xx_map_data) + MDRV_CPU_IO_MAP(namco_54xx_map_io) +MACHINE_DRIVER_END -static TIMER_CALLBACK( namco_54xx_irq_clear ) + +ROM_START( namco_54xx ) + ROM_REGION( 0x400, "mcu", 0 ) + ROM_LOAD( "54xx.bin", 0x0000, 0x0400, CRC(ee7357e0) SHA1(01bdf984a49e8d0cc8761b2cc162fd6434d5afbe) ) +ROM_END + + +/*------------------------------------------------- + device start callback +-------------------------------------------------*/ + +static DEVICE_START( namco_54xx ) { - const device_config *device = (const device_config *)ptr; - cpu_set_input_line(device, 0, CLEAR_LINE); + namco_54xx_config *config = (namco_54xx_config *)device->inline_config; + namco_54xx_state *state = get_safe_token(device); + astring *tempstring = astring_alloc(); + + /* find our CPU */ + state->cpu = cputag_get_cpu(device->machine, device_build_tag(tempstring, device, "mcu")); + assert(state->cpu != NULL); + astring_free(tempstring); + + /* find the attached discrete sound device */ + assert(config->discrete != NULL); + state->discrete = devtag_get_device(device->machine, config->discrete); + assert(state->discrete != NULL); + state->basenode = config->firstnode; } -void namco_54xx_write(running_machine *machine, UINT8 data) + +/*------------------------------------------------- + device reset callback +-------------------------------------------------*/ + +static DEVICE_RESET( namco_54xx ) { - const device_config *device = cputag_get_cpu(machine, CPUTAG_54XX); - - if (device == NULL) - return; - - timer_call_after_resynch(machine, NULL, data, namco_54xx_latch_callback); - - cpu_set_input_line(device, 0, ASSERT_LINE); - - // The execution time of one instruction is ~4us, so we must make sure to - // give the cpu time to poll the /IRQ input before we clear it. - // The input clock to the 06XX interface chip is 64H, that is - // 18432000/6/64 = 48kHz, so it makes sense for the irq line to be - // asserted for one clock cycle ~= 21us. - timer_set(machine, ATTOTIME_IN_USEC(21), (void *)device, 0, namco_54xx_irq_clear); +// namco_54xx_state *state = get_safe_token(device); +} + + +/*------------------------------------------------- + device get info callback +-------------------------------------------------*/ + +DEVICE_GET_INFO( namco_54xx ) +{ + switch (state) + { + /* --- the following bits of info are returned as 64-bit signed integers --- */ + case DEVINFO_INT_TOKEN_BYTES: info->i = sizeof(namco_54xx_state); break; + case DEVINFO_INT_INLINE_CONFIG_BYTES: info->i = sizeof(namco_54xx_config); break; + case DEVINFO_INT_CLASS: info->i = DEVICE_CLASS_PERIPHERAL; break; + + /* --- the following bits of info are returned as pointers --- */ + case DEVINFO_PTR_ROM_REGION: info->romregion = ROM_NAME(namco_54xx); break; + case DEVINFO_PTR_MACHINE_CONFIG: info->machine_config = MACHINE_DRIVER_NAME(namco_54xx); break; + + /* --- the following bits of info are returned as pointers to data or functions --- */ + case DEVINFO_FCT_START: info->start = DEVICE_START_NAME(namco_54xx); break; + case DEVINFO_FCT_RESET: info->reset = DEVICE_RESET_NAME(namco_54xx); break; + + /* --- the following bits of info are returned as NULL-terminated strings --- */ + case DEVINFO_STR_NAME: strcpy(info->s, "Namco 54xx"); break; + case DEVINFO_STR_FAMILY: strcpy(info->s, "Namco I/O"); break; + case DEVINFO_STR_VERSION: strcpy(info->s, "1.0"); break; + case DEVINFO_STR_SOURCE_FILE: strcpy(info->s, __FILE__); break; + case DEVINFO_STR_CREDITS: strcpy(info->s, "Copyright Nicola Salmoria and the MAME Team"); break; + } } diff --git a/src/mame/audio/namco54.h b/src/mame/audio/namco54.h index 37377236144..e39e1abd351 100644 --- a/src/mame/audio/namco54.h +++ b/src/mame/audio/namco54.h @@ -3,18 +3,36 @@ #include "sound/discrete.h" -#define CPUTAG_54XX "54xx" -ADDRESS_MAP_EXTERN( namco_54xx_map_program, 8 ); -ADDRESS_MAP_EXTERN( namco_54xx_map_data, 8 ); -ADDRESS_MAP_EXTERN( namco_54xx_map_io, 8 ); +typedef struct _namco_54xx_config namco_54xx_config; +struct _namco_54xx_config +{ + const char *discrete; /* name of the discrete sound device */ + int firstnode; /* index of the first node */ +}; -void namco_54xx_write(running_machine *machine, UINT8 data); + + +#define MDRV_NAMCO_54XX_ADD(_tag, _clock, _discrete, _firstnode) \ + MDRV_DEVICE_ADD(_tag, NAMCO_54XX, _clock) \ + MDRV_DEVICE_CONFIG_DATAPTR(namco_54xx_config, discrete, _discrete) \ + MDRV_DEVICE_CONFIG_DATA32(namco_54xx_config, firstnode, _firstnode) + +#define MDRV_NAMCO_54XX_REMOVE(_tag) \ + MDRV_DEVICE_REMOVE(_tag) + + +void namco_54xx_write(const device_config *device, UINT8 data); + +/* device get info callback */ +#define NAMCO_54XX DEVICE_GET_INFO_NAME(namco_54xx) +DEVICE_GET_INFO( namco_54xx ); /* discrete nodes */ -#define NAMCO_54XX_0_DATA NODE_01 -#define NAMCO_54XX_1_DATA NODE_02 -#define NAMCO_54XX_2_DATA NODE_03 -#define NAMCO_52XX_P_DATA NODE_04 +#define NAMCO_54XX_0_DATA(base) (NODE_RELATIVE(base, 0)) +#define NAMCO_54XX_1_DATA(base) (NODE_RELATIVE(base, 1)) +#define NAMCO_54XX_2_DATA(base) (NODE_RELATIVE(base, 2)) +#define NAMCO_52XX_P_DATA(base) (NODE_RELATIVE(base, 3)) + #endif /* NAMCO54_H */ diff --git a/src/mame/audio/polepos.c b/src/mame/audio/polepos.c index 3a96d4b894d..5c7ea95fb44 100644 --- a/src/mame/audio/polepos.c +++ b/src/mame/audio/polepos.c @@ -250,17 +250,17 @@ DISCRETE_SOUND_START(polepos) /************************************************ * Input register mapping ************************************************/ - DISCRETE_INPUT_DATA(NAMCO_54XX_0_DATA) - DISCRETE_INPUT_DATA(NAMCO_54XX_1_DATA) - DISCRETE_INPUT_DATA(NAMCO_54XX_2_DATA) - DISCRETE_INPUT_DATA(NAMCO_52XX_P_DATA) + DISCRETE_INPUT_DATA(NAMCO_54XX_0_DATA(NODE_01)) + DISCRETE_INPUT_DATA(NAMCO_54XX_1_DATA(NODE_01)) + DISCRETE_INPUT_DATA(NAMCO_54XX_2_DATA(NODE_01)) + DISCRETE_INPUT_DATA(NAMCO_52XX_P_DATA(NODE_01)) /************************************************ * CHANL1 sound ************************************************/ DISCRETE_DAC_R1(NODE_20, 1, /* ENAB */ - NAMCO_54XX_2_DATA, + NAMCO_54XX_2_DATA(NODE_01), 4, /* 4V - unmeasured*/ &polepos_54xx_dac) DISCRETE_OP_AMP_FILTER(NODE_21, @@ -278,7 +278,7 @@ DISCRETE_SOUND_START(polepos) ************************************************/ DISCRETE_DAC_R1(NODE_30, 1, /* ENAB */ - NAMCO_54XX_1_DATA, + NAMCO_54XX_1_DATA(NODE_01), 4, /* 4V - unmeasured*/ &polepos_54xx_dac) DISCRETE_OP_AMP_FILTER(NODE_31, @@ -296,7 +296,7 @@ DISCRETE_SOUND_START(polepos) ************************************************/ DISCRETE_DAC_R1(NODE_40, 1, /* ENAB */ - NAMCO_54XX_0_DATA, + NAMCO_54XX_0_DATA(NODE_01), 4, /* 4V - unmeasured*/ &polepos_54xx_dac) DISCRETE_OP_AMP_FILTER(NODE_41, @@ -316,7 +316,7 @@ DISCRETE_SOUND_START(polepos) /* this circuit was simulated in SPICE and an equivalent filter circuit generated */ DISCRETE_DAC_R1(NODE_50, 0, /* ENAB */ - NAMCO_52XX_P_DATA, + NAMCO_52XX_P_DATA(NODE_01), 4, /* 4V - unmeasured*/ &polepos_52xx_dac) /* fake it so 0 is now vRef */ diff --git a/src/mame/drivers/galaga.c b/src/mame/drivers/galaga.c index 42ae47d3cc7..f6bb28bb316 100644 --- a/src/mame/drivers/galaga.c +++ b/src/mame/drivers/galaga.c @@ -846,7 +846,7 @@ static MACHINE_RESET( bosco ) NAMCOIO_51XX, &intf0, NULL, NAMCOIO_NONE, NULL, NULL, NAMCOIO_50XX, NULL, "50xx_1", - NAMCOIO_54XX, NULL, NULL); + NAMCOIO_54XX, NULL, "54xx"); namco_06xx_init(machine, 1, 1, NAMCOIO_50XX, NULL, "50xx_2", @@ -866,7 +866,7 @@ static MACHINE_RESET( galaga ) NAMCOIO_51XX, &intf0, NULL, NAMCOIO_NONE, NULL, NULL, NAMCOIO_NONE, NULL, NULL, - NAMCOIO_54XX, NULL, NULL); + NAMCOIO_54XX, NULL, "54xx"); timer_adjust_oneshot(cpu3_interrupt_timer, video_screen_get_time_until_pos(machine->primary_screen, 64, 0), 64); } @@ -880,7 +880,7 @@ static MACHINE_RESET( xevious ) NAMCOIO_51XX, &intf0, NULL, NAMCOIO_NONE, NULL, NULL, NAMCOIO_50XX, NULL, "50xx", - NAMCOIO_54XX, NULL, NULL); + NAMCOIO_54XX, NULL, "54xx"); timer_adjust_oneshot(cpu3_interrupt_timer, video_screen_get_time_until_pos(machine->primary_screen, 64, 0), 64); } @@ -1635,11 +1635,7 @@ static MACHINE_DRIVER_START( bosco ) MDRV_NAMCO_50XX_ADD("50xx_1", MASTER_CLOCK/12) /* 1.536 MHz */ MDRV_NAMCO_50XX_ADD("50xx_2", MASTER_CLOCK/12) /* 1.536 MHz */ - - MDRV_CPU_ADD(CPUTAG_54XX, MB8844, MASTER_CLOCK/12/6) /* 1.536 MHz, internally divided by 6 */ - MDRV_CPU_PROGRAM_MAP(namco_54xx_map_program) - MDRV_CPU_DATA_MAP(namco_54xx_map_data) - MDRV_CPU_IO_MAP(namco_54xx_map_io) + MDRV_NAMCO_54XX_ADD("54xx", MASTER_CLOCK/12, "discrete", NODE_01) /* 1.536 MHz */ MDRV_WATCHDOG_VBLANK_INIT(8) MDRV_QUANTUM_TIME(HZ(6000)) /* 100 CPU slices per frame - an high value to ensure proper */ @@ -1695,10 +1691,7 @@ static MACHINE_DRIVER_START( galaga ) MDRV_CPU_ADD("sub2", Z80, MASTER_CLOCK/6) /* 3.072 MHz */ MDRV_CPU_PROGRAM_MAP(galaga_map) - MDRV_CPU_ADD(CPUTAG_54XX, MB8844, MASTER_CLOCK/12/6) /* 1.536 MHz, internally divided by 6 */ - MDRV_CPU_PROGRAM_MAP(namco_54xx_map_program) - MDRV_CPU_DATA_MAP(namco_54xx_map_data) - MDRV_CPU_IO_MAP(namco_54xx_map_io) + MDRV_NAMCO_54XX_ADD("54xx", MASTER_CLOCK/12, "discrete", NODE_01) /* 1.536 MHz */ MDRV_WATCHDOG_VBLANK_INIT(8) MDRV_QUANTUM_TIME(HZ(6000)) /* 100 CPU slices per frame - an high value to ensure proper */ @@ -1740,7 +1733,7 @@ static MACHINE_DRIVER_START( galagab ) /* basic machine hardware */ MDRV_IMPORT_FROM(galaga) - MDRV_CPU_REMOVE(CPUTAG_54XX) + MDRV_NAMCO_54XX_REMOVE("54xx") MDRV_CPU_ADD("sub3", Z80, MASTER_CLOCK/6) /* 3.072 MHz */ MDRV_CPU_PROGRAM_MAP(galaga_mem4) @@ -1765,11 +1758,7 @@ static MACHINE_DRIVER_START( xevious ) MDRV_CPU_PROGRAM_MAP(xevious_map) MDRV_NAMCO_50XX_ADD("50xx", MASTER_CLOCK/12) /* 1.536 MHz */ - - MDRV_CPU_ADD(CPUTAG_54XX, MB8844, MASTER_CLOCK/12/6) /* 1.536 MHz, internally divided by 6 */ - MDRV_CPU_PROGRAM_MAP(namco_54xx_map_program) - MDRV_CPU_DATA_MAP(namco_54xx_map_data) - MDRV_CPU_IO_MAP(namco_54xx_map_io) + MDRV_NAMCO_54XX_ADD("54xx", MASTER_CLOCK/12, "discrete", NODE_01) /* 1.536 MHz */ MDRV_WATCHDOG_VBLANK_INIT(8) MDRV_QUANTUM_TIME(HZ(60000)) /* 1000 CPU slices per frame - an high value to ensure proper */ @@ -1811,7 +1800,7 @@ static MACHINE_DRIVER_START( battles ) MDRV_IMPORT_FROM( xevious ) MDRV_NAMCO_50XX_REMOVE("50xx") - MDRV_CPU_REMOVE(CPUTAG_54XX) + MDRV_NAMCO_54XX_REMOVE("54xx") MDRV_CPU_ADD("sub3", Z80, MASTER_CLOCK/6) /* 3.072 MHz */ MDRV_CPU_PROGRAM_MAP(battles_mem4) @@ -1903,7 +1892,6 @@ Namco/Midway, 1981 */ #define BOSCO_CUSTOMS \ - ROM_REGION_NAMCO_54XX( CPUTAG_54XX ) \ ROM_REGION_NAMCO_51XX( "51xx" ) \ @@ -2293,7 +2281,6 @@ Notes: */ #define GALAGA_CUSTOMS \ - ROM_REGION_NAMCO_54XX( CPUTAG_54XX ) \ ROM_REGION_NAMCO_51XX( "51xx" ) \ @@ -2528,7 +2515,6 @@ ROM_END **********************************************************************************************/ #define XEVIOUS_CUSTOMS \ - ROM_REGION_NAMCO_54XX( CPUTAG_54XX ) \ ROM_REGION_NAMCO_51XX( "51xx" ) \ /* diff --git a/src/mame/drivers/polepos.c b/src/mame/drivers/polepos.c index 7eebbbfd6e0..99a65527cbe 100644 --- a/src/mame/drivers/polepos.c +++ b/src/mame/drivers/polepos.c @@ -386,7 +386,7 @@ static MACHINE_RESET( polepos ) NAMCOIO_51XX, &intf0, NULL, NAMCOIO_53XX_POLEPOS, &intf1, NULL, NAMCOIO_52XX, NULL, "namco52", - NAMCOIO_54XX, NULL, NULL); + NAMCOIO_54XX, NULL, "54xx"); /* set the interrupt vectors (this shouldn't be needed) */ cpu_set_input_line_vector(cputag_get_cpu(machine, "sub"), 0, Z8000_NVI); @@ -846,10 +846,7 @@ static MACHINE_DRIVER_START( polepos ) MDRV_CPU_PROGRAM_MAP(z8002_map) MDRV_CPU_VBLANK_INT("screen", irq0_line_assert) - MDRV_CPU_ADD(CPUTAG_54XX, MB8844, 18432000/12/6) /* 1.536 MHz, internally divided by 6 */ - MDRV_CPU_PROGRAM_MAP(namco_54xx_map_program) - MDRV_CPU_DATA_MAP(namco_54xx_map_data) - MDRV_CPU_IO_MAP(namco_54xx_map_io) + MDRV_NAMCO_54XX_ADD("54xx", 18432000/12, "discrete", NODE_01) /* 1.536 MHz */ MDRV_WATCHDOG_VBLANK_INIT(16) // 128V clocks the same as VBLANK @@ -905,7 +902,6 @@ MACHINE_DRIVER_END *********************************************************************/ #define POLEPOS_CUSTOMS \ - ROM_REGION_NAMCO_54XX( CPUTAG_54XX ) \ ROM_REGION_NAMCO_51XX( "51xx" ) \ ROM_REGION_NAMCO_53XX( "53xx" ) \ diff --git a/src/mame/includes/nam_cust.h b/src/mame/includes/nam_cust.h index 4a6d2ad7a09..a8c5c484bca 100644 --- a/src/mame/includes/nam_cust.h +++ b/src/mame/includes/nam_cust.h @@ -16,7 +16,4 @@ ROM_LOAD( "53xx.bin", 0x0000, 0x0400, CRC(b326fecb) SHA1(758d8583d658e4f1df93184009d86c3eb8713899) ) \ /* the 54XX is an explosion sound generator */ -#define ROM_REGION_NAMCO_54XX( region ) \ - ROM_REGION( 0x400, region, 0 ) /* 1k for the 54xx */ \ - ROM_LOAD( "54xx.bin", 0x0000, 0x0400, CRC(ee7357e0) SHA1(01bdf984a49e8d0cc8761b2cc162fd6434d5afbe) ) \ diff --git a/src/mame/machine/namcoio.c b/src/mame/machine/namcoio.c index 5099509893f..d461b45db04 100644 --- a/src/mame/machine/namcoio.c +++ b/src/mame/machine/namcoio.c @@ -932,7 +932,7 @@ static void namco_06xx_data_write(running_machine *machine,int chipnum,UINT8 dat case NAMCOIO_50XX: namco_50xx_write(io[chipnum].device, data); break; case NAMCOIO_51XX: namcoio_51XX_write(machine,chipnum,data); break; case NAMCOIO_52XX: namco_52xx_write(io[chipnum].device, data); break; - case NAMCOIO_54XX: namco_54xx_write(machine, data); break; + case NAMCOIO_54XX: namco_54xx_write(io[chipnum].device, data); break; default: logerror("%s: custom IO type %d unsupported write\n",cpuexec_describe_context(machine),io[chipnum].type); break;