From 5d4816b66528f07a78ce8470413c524cbb57c799 Mon Sep 17 00:00:00 2001 From: Fabio Priuli Date: Mon, 27 Apr 2009 09:16:08 +0000 Subject: [PATCH] A few more number-to-tag conversions in CPU calls --- src/mame/drivers/arcadia.c | 4 ++-- src/mame/drivers/ataxx.c | 36 ++++++++++++++++++------------------ src/mame/drivers/backfire.c | 4 ++-- src/mame/drivers/balsente.c | 16 ++++++++-------- src/mame/drivers/baraduke.c | 2 +- src/mame/drivers/batman.c | 8 ++++---- src/mame/drivers/battlane.c | 12 ++++++------ src/mame/drivers/battlera.c | 16 +++++++++------- src/mame/drivers/battlnts.c | 2 +- src/mame/drivers/bbusters.c | 8 ++++---- src/mame/drivers/beaminv.c | 2 +- src/mame/drivers/beathead.c | 10 +++++----- src/mame/drivers/berzerk.c | 6 +++--- src/mame/drivers/bfcobra.c | 4 ++-- src/mame/drivers/bfm_sc1.c | 6 +++--- src/mame/drivers/bfm_sc2.c | 4 ++-- src/mame/drivers/bfmsys85.c | 2 +- src/mame/drivers/big10.c | 2 +- src/mame/drivers/bigevglf.c | 6 +++--- src/mame/drivers/bigfghtr.c | 5 ++--- src/mame/drivers/bingoc.c | 3 +-- src/mame/drivers/bishi.c | 4 ++-- src/mame/drivers/bishjan.c | 2 +- src/mame/drivers/bking.c | 4 ++-- src/mame/drivers/bladestl.c | 2 +- src/mame/drivers/blktiger.c | 2 +- src/mame/drivers/blockhl.c | 4 ++-- src/mame/drivers/blockout.c | 4 ++-- src/mame/drivers/blstroid.c | 6 +++--- src/mame/drivers/blueprnt.c | 2 +- src/mame/drivers/bnstars.c | 6 +++--- src/mame/drivers/boogwing.c | 2 +- src/mame/drivers/bottom9.c | 2 +- src/mame/drivers/boxer.c | 8 ++++---- src/mame/drivers/brkthru.c | 12 ++++++------ src/mame/drivers/btime.c | 24 ++++++++++++------------ src/mame/drivers/btoads.c | 4 ++-- src/mame/drivers/bublbobl.c | 4 ++-- src/mame/drivers/buggychl.c | 8 ++++---- src/mame/drivers/bwidow.c | 4 ++-- src/mame/drivers/bwing.c | 23 +++++++++++------------ src/mame/drivers/bzone.c | 12 ++++++------ src/mame/machine/bagman.c | 28 ++++++++++++++-------------- src/mame/machine/balsente.c | 18 +++++++++--------- src/mame/machine/beezer.c | 6 ++---- src/mame/machine/bigevglf.c | 4 ++-- src/mame/machine/bublbobl.c | 22 +++++++++++----------- src/mame/machine/buggychl.c | 20 ++++++++++---------- src/mame/video/beathead.c | 2 +- src/mame/video/bfm_dm01.c | 4 ++-- src/mame/video/bionicc.c | 4 ++-- src/mame/video/blktiger.c | 4 ++-- src/mame/video/blstroid.c | 4 ++-- src/mame/video/btoads.c | 2 +- 54 files changed, 206 insertions(+), 209 deletions(-) diff --git a/src/mame/drivers/arcadia.c b/src/mame/drivers/arcadia.c index 29cfb2c12bc..33808f2a8e3 100644 --- a/src/mame/drivers/arcadia.c +++ b/src/mame/drivers/arcadia.c @@ -100,11 +100,11 @@ static WRITE8_DEVICE_HANDLER( arcadia_cia_0_porta_w ) /* swap the write handlers between ROM and bank 1 based on the bit */ if ((data & 1) == 0) /* overlay disabled, map RAM on 0x000000 */ - memory_install_write16_handler(cpu_get_address_space(device->machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x000000, 0x07ffff, 0, 0, (write16_space_func)SMH_BANK(1)); + memory_install_write16_handler(cputag_get_address_space(device->machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x000000, 0x07ffff, 0, 0, (write16_space_func)SMH_BANK(1)); else /* overlay enabled, map Amiga system ROM on 0x000000 */ - memory_install_write16_handler(cpu_get_address_space(device->machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x000000, 0x07ffff, 0, 0, (write16_space_func)SMH_UNMAP); + memory_install_write16_handler(cputag_get_address_space(device->machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x000000, 0x07ffff, 0, 0, (write16_space_func)SMH_UNMAP); /* bit 2 = Power Led on Amiga */ set_led_status(0, (data & 2) ? 0 : 1); diff --git a/src/mame/drivers/ataxx.c b/src/mame/drivers/ataxx.c index 31e678608ed..5a006eba675 100644 --- a/src/mame/drivers/ataxx.c +++ b/src/mame/drivers/ataxx.c @@ -651,7 +651,7 @@ static DRIVER_INIT( ataxx ) leland_rotate_memory(machine, "slave"); /* set up additional input ports */ - memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x00, 0x03, 0, 0, ataxx_trackball_r); + memory_install_read8_handler(cputag_get_address_space(machine, "master", ADDRESS_SPACE_IO), 0x00, 0x03, 0, 0, ataxx_trackball_r); } @@ -674,7 +674,7 @@ static DRIVER_INIT( ataxxj ) leland_rotate_memory(machine, "slave"); /* set up additional input ports */ - memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x00, 0x03, 0, 0, ataxx_trackball_r); + memory_install_read8_handler(cputag_get_address_space(machine, "master", ADDRESS_SPACE_IO), 0x00, 0x03, 0, 0, ataxx_trackball_r); } @@ -697,9 +697,9 @@ static DRIVER_INIT( wsf ) leland_rotate_memory(machine, "slave"); /* set up additional input ports */ - memory_install_read_port_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x0d, 0x0d, 0, 0, "P1_P2"); - memory_install_read_port_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x0e, 0x0e, 0, 0, "P3_P4"); - memory_install_read_port_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x0f, 0x0f, 0, 0, "BUTTONS"); + memory_install_read_port_handler(cputag_get_address_space(machine, "master", ADDRESS_SPACE_IO), 0x0d, 0x0d, 0, 0, "P1_P2"); + memory_install_read_port_handler(cputag_get_address_space(machine, "master", ADDRESS_SPACE_IO), 0x0e, 0x0e, 0, 0, "P3_P4"); + memory_install_read_port_handler(cputag_get_address_space(machine, "master", ADDRESS_SPACE_IO), 0x0f, 0x0f, 0, 0, "BUTTONS"); } @@ -722,14 +722,14 @@ static DRIVER_INIT( indyheat ) leland_rotate_memory(machine, "slave"); /* set up additional input ports */ - memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x00, 0x02, 0, 0, indyheat_wheel_r); - memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x08, 0x0b, 0, 0, indyheat_analog_r); - memory_install_read_port_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x0d, 0x0d, 0, 0, "P1"); - memory_install_read_port_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x0e, 0x0e, 0, 0, "P2"); - memory_install_read_port_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x0f, 0x0f, 0, 0, "P3"); + memory_install_read8_handler(cputag_get_address_space(machine, "master", ADDRESS_SPACE_IO), 0x00, 0x02, 0, 0, indyheat_wheel_r); + memory_install_read8_handler(cputag_get_address_space(machine, "master", ADDRESS_SPACE_IO), 0x08, 0x0b, 0, 0, indyheat_analog_r); + memory_install_read_port_handler(cputag_get_address_space(machine, "master", ADDRESS_SPACE_IO), 0x0d, 0x0d, 0, 0, "P1"); + memory_install_read_port_handler(cputag_get_address_space(machine, "master", ADDRESS_SPACE_IO), 0x0e, 0x0e, 0, 0, "P2"); + memory_install_read_port_handler(cputag_get_address_space(machine, "master", ADDRESS_SPACE_IO), 0x0f, 0x0f, 0, 0, "P3"); /* set up additional output ports */ - memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x08, 0x0b, 0, 0, indyheat_analog_w); + memory_install_write8_handler(cputag_get_address_space(machine, "master", ADDRESS_SPACE_IO), 0x08, 0x0b, 0, 0, indyheat_analog_w); } @@ -752,9 +752,9 @@ static DRIVER_INIT( brutforc ) leland_rotate_memory(machine, "slave"); /* set up additional input ports */ - memory_install_read_port_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x0d, 0x0d, 0, 0, "P2"); - memory_install_read_port_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x0e, 0x0e, 0, 0, "P1"); - memory_install_read_port_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x0f, 0x0f, 0, 0, "P3"); + memory_install_read_port_handler(cputag_get_address_space(machine, "master", ADDRESS_SPACE_IO), 0x0d, 0x0d, 0, 0, "P2"); + memory_install_read_port_handler(cputag_get_address_space(machine, "master", ADDRESS_SPACE_IO), 0x0e, 0x0e, 0, 0, "P1"); + memory_install_read_port_handler(cputag_get_address_space(machine, "master", ADDRESS_SPACE_IO), 0x0f, 0x0f, 0, 0, "P3"); } @@ -777,13 +777,13 @@ static DRIVER_INIT( asylum ) leland_rotate_memory(machine, "slave"); /* asylum appears to have some extra RAM for the slave CPU */ - memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[1], ADDRESS_SPACE_PROGRAM), 0xf000, 0xfffb, 0, 0, (read8_space_func)SMH_BANK(4), (write8_space_func)SMH_BANK(4)); + memory_install_readwrite8_handler(cputag_get_address_space(machine, "slave", ADDRESS_SPACE_PROGRAM), 0xf000, 0xfffb, 0, 0, (read8_space_func)SMH_BANK(4), (write8_space_func)SMH_BANK(4)); memory_set_bankptr(machine, 4, auto_alloc_array(machine, UINT8, 0x1000)); /* set up additional input ports */ - memory_install_read_port_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x0d, 0x0d, 0, 0, "P2"); - memory_install_read_port_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x0e, 0x0e, 0, 0, "P1"); - memory_install_read_port_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x0f, 0x0f, 0, 0, "P3"); + memory_install_read_port_handler(cputag_get_address_space(machine, "master", ADDRESS_SPACE_IO), 0x0d, 0x0d, 0, 0, "P2"); + memory_install_read_port_handler(cputag_get_address_space(machine, "master", ADDRESS_SPACE_IO), 0x0e, 0x0e, 0, 0, "P1"); + memory_install_read_port_handler(cputag_get_address_space(machine, "master", ADDRESS_SPACE_IO), 0x0f, 0x0f, 0, 0, "P3"); } diff --git a/src/mame/drivers/backfire.c b/src/mame/drivers/backfire.c index 8d7a07c7710..5dc9d6abeb2 100644 --- a/src/mame/drivers/backfire.c +++ b/src/mame/drivers/backfire.c @@ -666,9 +666,9 @@ static DRIVER_INIT( backfire ) deco56_decrypt_gfx(machine, "gfx1"); /* 141 */ deco56_decrypt_gfx(machine, "gfx2"); /* 141 */ deco156_decrypt(machine); - cpu_set_clockscale(machine->cpu[0], 4.0f); /* core timings aren't accurate */ + cpu_set_clockscale(cputag_get_cpu(machine, "maincpu"), 4.0f); /* core timings aren't accurate */ descramble_sound(machine); - memory_install_read32_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0170018, 0x017001b, 0, 0, backfire_speedup_r ); + memory_install_read32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x0170018, 0x017001b, 0, 0, backfire_speedup_r ); } GAME( 1995, backfire, 0, backfire, backfire, backfire, ROT0, "Data East Corporation", "Backfire! (set 1)", 0 ) diff --git a/src/mame/drivers/balsente.c b/src/mame/drivers/balsente.c index 38dbea98bba..fda28710f4f 100644 --- a/src/mame/drivers/balsente.c +++ b/src/mame/drivers/balsente.c @@ -2068,48 +2068,48 @@ static DRIVER_INIT( minigol2 ) { expand_roms(machine, 0x0c); balsente_sho static DRIVER_INIT( toggle ) { expand_roms(machine, EXPAND_ALL); balsente_shooter = 0; /* noanalog */ } static DRIVER_INIT( nametune ) { - const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); + const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); memory_install_write8_handler(space, 0x9f00, 0x9f00, 0, 0, balsente_rombank2_select_w); expand_roms(machine, EXPAND_NONE | SWAP_HALVES); balsente_shooter = 0; /* noanalog */ } static DRIVER_INIT( nstocker ) { - const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); + const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); memory_install_write8_handler(space, 0x9f00, 0x9f00, 0, 0, balsente_rombank2_select_w); expand_roms(machine, EXPAND_NONE | SWAP_HALVES); balsente_shooter = 1; balsente_adc_shift = 1; } static DRIVER_INIT( sfootbal ) { - const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); + const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); memory_install_write8_handler(space, 0x9f00, 0x9f00, 0, 0, balsente_rombank2_select_w); expand_roms(machine, EXPAND_ALL | SWAP_HALVES); balsente_shooter = 0; balsente_adc_shift = 0; } static DRIVER_INIT( spiker ) { - const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); + const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); memory_install_readwrite8_handler(space, 0x9f80, 0x9f8f, 0, 0, spiker_expand_r, spiker_expand_w); memory_install_write8_handler(space, 0x9f00, 0x9f00, 0, 0, balsente_rombank2_select_w); expand_roms(machine, EXPAND_ALL | SWAP_HALVES); balsente_shooter = 0; balsente_adc_shift = 1; } static DRIVER_INIT( stompin ) { - const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); + const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); memory_install_write8_handler(space, 0x9f00, 0x9f00, 0, 0, balsente_rombank2_select_w); expand_roms(machine, 0x0c | SWAP_HALVES); balsente_shooter = 0; balsente_adc_shift = 32; } static DRIVER_INIT( rescraid ) { expand_roms(machine, EXPAND_NONE); balsente_shooter = 0; /* noanalog */ } static DRIVER_INIT( grudge ) { - const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); + const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); memory_install_read8_handler(space, 0x9400, 0x9400, 0, 0, grudge_steering_r); expand_roms(machine, EXPAND_NONE); balsente_shooter = 0; } static DRIVER_INIT( shrike ) { - const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); + const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); memory_install_readwrite8_handler(space, 0x9e00, 0x9fff, 0, 0, shrike_shared_6809_r, shrike_shared_6809_w); memory_install_write8_handler(space, 0x9e01, 0x9e01, 0, 0, shrike_sprite_select_w ); - memory_install_readwrite16_handler(cpu_get_address_space(machine->cpu[2], ADDRESS_SPACE_PROGRAM), 0x10000, 0x1001f, 0, 0, shrike_io_68k_r, shrike_io_68k_w); + memory_install_readwrite16_handler(cputag_get_address_space(machine, "68k", ADDRESS_SPACE_PROGRAM), 0x10000, 0x1001f, 0, 0, shrike_io_68k_r, shrike_io_68k_w); expand_roms(machine, EXPAND_ALL); balsente_shooter = 0; balsente_adc_shift = 32; } diff --git a/src/mame/drivers/baraduke.c b/src/mame/drivers/baraduke.c index 364c665017b..fe7a05ec644 100644 --- a/src/mame/drivers/baraduke.c +++ b/src/mame/drivers/baraduke.c @@ -170,7 +170,7 @@ static WRITE8_HANDLER( baraduke_lamps_w ) static WRITE8_HANDLER( baraduke_irq_ack_w ) { - cpu_set_input_line(space->machine->cpu[0], 0, CLEAR_LINE); + cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE); } diff --git a/src/mame/drivers/batman.c b/src/mame/drivers/batman.c index c0f01452cbc..9a962a04a97 100644 --- a/src/mame/drivers/batman.c +++ b/src/mame/drivers/batman.c @@ -43,8 +43,8 @@ static UINT16 latch_data; static void update_interrupts(running_machine *machine) { - cpu_set_input_line(machine->cpu[0], 4, atarigen_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); - cpu_set_input_line(machine->cpu[0], 6, atarigen_sound_int_state ? ASSERT_LINE : CLEAR_LINE); + cputag_set_input_line(machine, "maincpu", 4, atarigen_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); + cputag_set_input_line(machine, "maincpu", 6, atarigen_sound_int_state ? ASSERT_LINE : CLEAR_LINE); } @@ -103,9 +103,9 @@ static WRITE16_HANDLER( latch_w ) /* bit 4 is connected to the /RESET pin on the 6502 */ if (latch_data & 0x0010) - cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_RESET, CLEAR_LINE); + cputag_set_input_line(space->machine, "jsa", INPUT_LINE_RESET, CLEAR_LINE); else - cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_RESET, ASSERT_LINE); + cputag_set_input_line(space->machine, "jsa", INPUT_LINE_RESET, ASSERT_LINE); /* alpha bank is selected by the upper 4 bits */ if ((oldword ^ latch_data) & 0x7000) diff --git a/src/mame/drivers/battlane.c b/src/mame/drivers/battlane.c index da08a58512c..f8f10842155 100644 --- a/src/mame/drivers/battlane.c +++ b/src/mame/drivers/battlane.c @@ -59,8 +59,8 @@ static WRITE8_HANDLER( battlane_cpu_command_w ) /* if (~battlane_cpu_control & 0x08) { - cpu_set_input_line(space->machine->cpu[0], INPUT_LINE_NMI, PULSE_LINE); - cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_NMI, PULSE_LINE); + cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE); + cputag_set_input_line(space->machine, "sub", INPUT_LINE_NMI, PULSE_LINE); } */ @@ -68,7 +68,7 @@ static WRITE8_HANDLER( battlane_cpu_command_w ) CPU2's SWI will trigger an 6809 IRQ on the master by resetting 0x04 Master will respond by setting the bit back again */ - cpu_set_input_line(space->machine->cpu[0], M6809_IRQ_LINE, data & 0x04 ? CLEAR_LINE : HOLD_LINE); + cputag_set_input_line(space->machine, "maincpu", M6809_IRQ_LINE, data & 0x04 ? CLEAR_LINE : HOLD_LINE); /* Slave function call (e.g. ROM test): @@ -86,7 +86,7 @@ static WRITE8_HANDLER( battlane_cpu_command_w ) FA96: 27 FA BEQ $FA92 ; Wait for bit to be set */ - cpu_set_input_line(space->machine->cpu[1], M6809_IRQ_LINE, data & 0x02 ? CLEAR_LINE : HOLD_LINE); + cputag_set_input_line(space->machine, "sub", M6809_IRQ_LINE, data & 0x02 ? CLEAR_LINE : HOLD_LINE); } static ADDRESS_MAP_START( battlane_map, ADDRESS_SPACE_PROGRAM, 8 ) @@ -110,7 +110,7 @@ static INTERRUPT_GEN( battlane_cpu1_interrupt ) if (~battlane_cpu_control & 0x08) { cpu_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE); - cpu_set_input_line(device->machine->cpu[1], INPUT_LINE_NMI, PULSE_LINE); + cputag_set_input_line(device->machine, "sub", INPUT_LINE_NMI, PULSE_LINE); } } @@ -242,7 +242,7 @@ GFXDECODE_END static void irqhandler(const device_config *device, int irq) { - cpu_set_input_line(device->machine->cpu[0], M6809_FIRQ_LINE, irq ? ASSERT_LINE : CLEAR_LINE); + cputag_set_input_line(device->machine, "maincpu", M6809_FIRQ_LINE, irq ? ASSERT_LINE : CLEAR_LINE); } static const ym3526_interface ym3526_config = diff --git a/src/mame/drivers/battlera.c b/src/mame/drivers/battlera.c index ed31b5cd184..d0d2032a5a0 100644 --- a/src/mame/drivers/battlera.c +++ b/src/mame/drivers/battlera.c @@ -46,9 +46,10 @@ static int control_port_select; static WRITE8_HANDLER( battlera_sound_w ) { - if (offset==0) { + if (offset == 0) + { soundlatch_w(space,0,data); - cpu_set_input_line(space->machine->cpu[1], 0, HOLD_LINE); + cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE); } } @@ -61,7 +62,8 @@ static WRITE8_HANDLER( control_data_w ) static READ8_HANDLER( control_data_r ) { - switch (control_port_select) { + switch (control_port_select) + { case 0xfe: return input_port_read(space->machine, "IN0"); /* Player 1 */ case 0xfd: return input_port_read(space->machine, "IN1"); /* Player 2 */ case 0xfb: return input_port_read(space->machine, "IN2"); /* Coins */ @@ -100,21 +102,21 @@ static void battlera_adpcm_int(const device_config *device) static int toggle; msm5205_data_w(device,msm5205next >> 4); - msm5205next<<=4; + msm5205next <<= 4; toggle = 1 - toggle; if (toggle) - cpu_set_input_line(device->machine->cpu[1], 1, HOLD_LINE); + cputag_set_input_line(device->machine, "audiocpu", 1, HOLD_LINE); } static WRITE8_HANDLER( battlera_adpcm_data_w ) { - msm5205next=data; + msm5205next = data; } static WRITE8_DEVICE_HANDLER( battlera_adpcm_reset_w ) { - msm5205_reset_w(device,0); + msm5205_reset_w(device, 0); } static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 ) diff --git a/src/mame/drivers/battlnts.c b/src/mame/drivers/battlnts.c index d1d011b82e8..546507ce546 100644 --- a/src/mame/drivers/battlnts.c +++ b/src/mame/drivers/battlnts.c @@ -30,7 +30,7 @@ static INTERRUPT_GEN( battlnts_interrupt ) static WRITE8_HANDLER( battlnts_sh_irqtrigger_w ) { - cpu_set_input_line_and_vector(space->machine->cpu[1], 0, HOLD_LINE, 0xff); + cputag_set_input_line_and_vector(space->machine, "audiocpu", 0, HOLD_LINE, 0xff); } static WRITE8_HANDLER( battlnts_bankswitch_w ) diff --git a/src/mame/drivers/bbusters.c b/src/mame/drivers/bbusters.c index c140c2b2489..1845d431689 100644 --- a/src/mame/drivers/bbusters.c +++ b/src/mame/drivers/bbusters.c @@ -264,7 +264,7 @@ static WRITE16_HANDLER( sound_cpu_w ) if (ACCESSING_BITS_0_7) { soundlatch_w(space, 0, data&0xff); - cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_NMI, PULSE_LINE); + cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE); } } @@ -636,7 +636,7 @@ GFXDECODE_END static void sound_irq( const device_config *device, int irq ) { - cpu_set_input_line(device->machine->cpu[1],0,irq ? ASSERT_LINE : CLEAR_LINE); + cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); } static const ym2608_interface ym2608_config = @@ -692,7 +692,7 @@ static NVRAM_HANDLER( bbusters ) static VIDEO_EOF( bbuster ) { - const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); + const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); buffer_spriteram16_w(space,0,0,0xffff); buffer_spriteram16_2_w(space,0,0,0xffff); @@ -700,7 +700,7 @@ static VIDEO_EOF( bbuster ) static VIDEO_EOF( mechatt ) { - const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); + const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); buffer_spriteram16_w(space,0,0,0xffff); } diff --git a/src/mame/drivers/beaminv.c b/src/mame/drivers/beaminv.c index 603a30c6e79..49f9e85987c 100644 --- a/src/mame/drivers/beaminv.c +++ b/src/mame/drivers/beaminv.c @@ -82,7 +82,7 @@ static TIMER_CALLBACK( interrupt_callback ) int next_interrupt_number; int next_vpos; - cpu_set_input_line(machine->cpu[0], 0, HOLD_LINE); + cputag_set_input_line(machine, "maincpu", 0, HOLD_LINE); /* set up for next interrupt */ next_interrupt_number = (interrupt_number + 1) % INTERRUPTS_PER_FRAME; diff --git a/src/mame/drivers/beathead.c b/src/mame/drivers/beathead.c index b531322501b..a7e8a53fedc 100644 --- a/src/mame/drivers/beathead.c +++ b/src/mame/drivers/beathead.c @@ -144,7 +144,7 @@ static TIMER_CALLBACK( scanline_callback ) /* on scanline zero, clear any halt condition */ if (scanline == 0) - cpu_set_input_line(machine->cpu[0], INPUT_LINE_HALT, CLEAR_LINE); + cputag_set_input_line(machine, "maincpu", INPUT_LINE_HALT, CLEAR_LINE); /* wrap around at 262 */ scanline++; @@ -204,7 +204,7 @@ static void update_interrupts(running_machine *machine) { irq_line_state = gen_int; // if (irq_line_state != CLEAR_LINE) - cpu_set_input_line(machine->cpu[0], ASAP_IRQ0, irq_line_state); + cputag_set_input_line(machine, "maincpu", ASAP_IRQ0, irq_line_state); // else // asap_set_irq_line(ASAP_IRQ0, irq_line_state); } @@ -299,7 +299,7 @@ static WRITE32_HANDLER( sound_data_w ) static WRITE32_HANDLER( sound_reset_w ) { logerror("Sound reset = %d\n", !offset); - cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_RESET, offset ? CLEAR_LINE : ASSERT_LINE); + cputag_set_input_line(space->machine, "jsa", INPUT_LINE_RESET, offset ? CLEAR_LINE : ASSERT_LINE); } @@ -514,8 +514,8 @@ static DRIVER_INIT( beathead ) atarijsa_init(machine, "IN2", 0x0040); /* prepare the speedups */ - speedup_data = memory_install_read32_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x00000ae8, 0x00000aeb, 0, 0, speedup_r); - movie_speedup_data = memory_install_read32_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x00000804, 0x00000807, 0, 0, movie_speedup_r); + speedup_data = memory_install_read32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x00000ae8, 0x00000aeb, 0, 0, speedup_r); + movie_speedup_data = memory_install_read32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x00000804, 0x00000807, 0, 0, movie_speedup_r); } diff --git a/src/mame/drivers/berzerk.c b/src/mame/drivers/berzerk.c index 7ae523f5d94..9aa6c01d189 100644 --- a/src/mame/drivers/berzerk.c +++ b/src/mame/drivers/berzerk.c @@ -160,7 +160,7 @@ static TIMER_CALLBACK( irq_callback ) /* set the IRQ line if enabled */ if (irq_enabled) - cpu_set_input_line_and_vector(machine->cpu[0], 0, HOLD_LINE, 0xfc); + cputag_set_input_line_and_vector(machine, "maincpu", 0, HOLD_LINE, 0xfc); /* set up for next interrupt */ next_irq_number = (irq_number + 1) % IRQS_PER_FRAME; @@ -237,7 +237,7 @@ static TIMER_CALLBACK( nmi_callback ) /* pulse the NMI line if enabled */ if (nmi_enabled) - cpu_set_input_line(machine->cpu[0], INPUT_LINE_NMI, PULSE_LINE); + cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE); /* set up for next interrupt */ next_nmi_number = (nmi_number + 1) % NMIS_PER_FRAME; @@ -533,7 +533,7 @@ static READ8_HANDLER( berzerk_audio_r ) static SOUND_RESET(berzerk) { - const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO); + const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO); /* clears the flip-flop controlling the volume and freq on the speech chip */ berzerk_audio_w(space, 4, 0x40); } diff --git a/src/mame/drivers/bfcobra.c b/src/mame/drivers/bfcobra.c index fcb3b25c6b4..a7c5747750e 100644 --- a/src/mame/drivers/bfcobra.c +++ b/src/mame/drivers/bfcobra.c @@ -131,7 +131,7 @@ static void update_irqs(running_machine *machine) if (newstate != irq_state) { irq_state = newstate; - cpu_set_input_line(machine->cpu[0], 0, irq_state ? ASSERT_LINE : CLEAR_LINE); + cputag_set_input_line(machine, "maincpu", 0, irq_state ? ASSERT_LINE : CLEAR_LINE); } } @@ -1617,7 +1617,7 @@ static WRITE_LINE_DEVICE_HANDLER( m6809_acia_tx_w ) static WRITE_LINE_DEVICE_HANDLER( m6809_data_irq ) { - cpu_set_input_line(device->machine->cpu[1], M6809_IRQ_LINE, state ? CLEAR_LINE : ASSERT_LINE); + cputag_set_input_line(device->machine, "audiocpu", M6809_IRQ_LINE, state ? CLEAR_LINE : ASSERT_LINE); } static ACIA6850_INTERFACE( m6809_acia_if ) diff --git a/src/mame/drivers/bfm_sc1.c b/src/mame/drivers/bfm_sc1.c index 2924471b505..fdde28b0803 100644 --- a/src/mame/drivers/bfm_sc1.c +++ b/src/mame/drivers/bfm_sc1.c @@ -180,7 +180,7 @@ static INTERRUPT_GEN( timer_irq ) sc1_Inputs[2] = input_port_read(device->machine,"STROBE0"); - generic_pulse_irq_line(device->machine->cpu[0], M6809_IRQ_LINE); + generic_pulse_irq_line(cputag_get_cpu(device->machine, "maincpu"), M6809_IRQ_LINE); } } @@ -277,7 +277,7 @@ static WRITE8_HANDLER( mmtr_w ) if ( changed & (1 << i) ) { Mechmtr_update(i, cycles, data & (1 << i) ); - generic_pulse_irq_line(space->machine->cpu[0], M6809_FIRQ_LINE); + generic_pulse_irq_line(cputag_get_cpu(space->machine, "maincpu"), M6809_FIRQ_LINE); } } } @@ -371,7 +371,7 @@ static void send_to_adder(running_machine *machine, int data) adder2_sc2data = data; // store data adder2_acia_triggered = 1; // set flag, acia IRQ triggered - cpu_set_input_line(machine->cpu[1], M6809_IRQ_LINE, ASSERT_LINE );//HOLD_LINE);// trigger IRQ + cputag_set_input_line(machine, "adder2", M6809_IRQ_LINE, ASSERT_LINE );//HOLD_LINE);// trigger IRQ } /////////////////////////////////////////////////////////////////////////// diff --git a/src/mame/drivers/bfm_sc2.c b/src/mame/drivers/bfm_sc2.c index b398599357d..04269ab15cd 100644 --- a/src/mame/drivers/bfm_sc2.c +++ b/src/mame/drivers/bfm_sc2.c @@ -266,7 +266,7 @@ static void send_to_adder(running_machine *machine, int data) adder2_sc2data = data; adder2_acia_triggered = 1; - cpu_set_input_line(machine->cpu[1], M6809_IRQ_LINE, HOLD_LINE ); + cputag_set_input_line(machine, "adder2", M6809_IRQ_LINE, HOLD_LINE ); LOG_SERIAL(("sadder %02X (%c)\n",data, data )); } @@ -614,7 +614,7 @@ static WRITE8_HANDLER( mmtr_w ) } } } - if ( data & 0x1F ) cpu_set_input_line(space->machine->cpu[0], M6809_FIRQ_LINE, ASSERT_LINE ); + if ( data & 0x1F ) cputag_set_input_line(space->machine, "maincpu", M6809_FIRQ_LINE, ASSERT_LINE ); } /////////////////////////////////////////////////////////////////////////// diff --git a/src/mame/drivers/bfmsys85.c b/src/mame/drivers/bfmsys85.c index 39909bc63c2..dbf3ccbc32b 100644 --- a/src/mame/drivers/bfmsys85.c +++ b/src/mame/drivers/bfmsys85.c @@ -226,7 +226,7 @@ static WRITE8_HANDLER( mmtr_w ) for (i=0; i<8; i++) if ( changed & (1 << i) ) Mechmtr_update(i, cycles, data & (1 << i) ); - if ( data ) generic_pulse_irq_line(space->machine->cpu[0], M6809_FIRQ_LINE); + if ( data ) generic_pulse_irq_line(cputag_get_cpu(space->machine, "maincpu"), M6809_FIRQ_LINE); } /////////////////////////////////////////////////////////////////////////// diff --git a/src/mame/drivers/big10.c b/src/mame/drivers/big10.c index da67281b047..4ba8c751c60 100644 --- a/src/mame/drivers/big10.c +++ b/src/mame/drivers/big10.c @@ -71,7 +71,7 @@ static void big10_vdp_interrupt(running_machine *machine, int i) { - cpu_set_input_line (machine->cpu[0], 0, (i ? HOLD_LINE : CLEAR_LINE)); + cputag_set_input_line (machine, "maincpu", 0, (i ? HOLD_LINE : CLEAR_LINE)); } static INTERRUPT_GEN( big10_interrupt ) diff --git a/src/mame/drivers/bigevglf.c b/src/mame/drivers/bigevglf.c index d713f4034d8..deeee36338f 100644 --- a/src/mame/drivers/bigevglf.c +++ b/src/mame/drivers/bigevglf.c @@ -117,14 +117,14 @@ static READ8_HANDLER(soundstate_r) static TIMER_CALLBACK( nmi_callback ) { - if (sound_nmi_enable) cpu_set_input_line(machine->cpu[2],INPUT_LINE_NMI,PULSE_LINE); + if (sound_nmi_enable) cputag_set_input_line(machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE); else pending_nmi = 1; sound_state &= ~1; } static WRITE8_HANDLER( sound_command_w ) /* write to port 20 clears bit 0 in status */ { for_sound = data; - timer_call_after_resynch(space->machine, NULL, data,nmi_callback); + timer_call_after_resynch(space->machine, NULL, data, nmi_callback); } static READ8_HANDLER( sound_command_r ) /* read from D800 sets bit 0 in status */ @@ -143,7 +143,7 @@ static WRITE8_HANDLER( nmi_enable_w ) sound_nmi_enable = 1; if (pending_nmi) { - cpu_set_input_line(space->machine->cpu[2],INPUT_LINE_NMI,PULSE_LINE); + cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE); pending_nmi = 0; } } diff --git a/src/mame/drivers/bigfghtr.c b/src/mame/drivers/bigfghtr.c index 4eb6a44718b..010a3d2feb5 100644 --- a/src/mame/drivers/bigfghtr.c +++ b/src/mame/drivers/bigfghtr.c @@ -274,8 +274,8 @@ static VIDEO_UPDATE( bigfghtr ) static VIDEO_EOF( bigfghtr ) { - const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); - buffer_spriteram16_w(space,0,0,0xffff); + const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); + buffer_spriteram16_w(space, 0, 0, 0xffff); } @@ -624,4 +624,3 @@ ROM_END GAME( 1989, skyrobo, 0, bigfghtr, bigfghtr, skyrobo, ROT0, "Nichibutsu", "Sky Robo",GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION) GAME( 1989, bigfghtr, skyrobo, bigfghtr, bigfghtr, bigfghtr, ROT0, "Nichibutsu", "Tatakae! Big Fighter",GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION) - diff --git a/src/mame/drivers/bingoc.c b/src/mame/drivers/bingoc.c index 9c6938cec94..bd75ca08d87 100644 --- a/src/mame/drivers/bingoc.c +++ b/src/mame/drivers/bingoc.c @@ -77,7 +77,7 @@ static READ8_HANDLER( sound_test_r ) static WRITE16_HANDLER( main_sound_latch_w ) { soundlatch_w(space,0,data&0xff); - cpu_set_input_line(space->machine->cpu[1],INPUT_LINE_NMI,PULSE_LINE); + cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_NMI, PULSE_LINE); } #endif @@ -180,4 +180,3 @@ ROM_START( bingoc ) ROM_END GAME( 1989, bingoc, 0, bingoc, bingoc, 0, ROT0, "Sega", "Bingo Circus (Rev. A 891001)", GAME_NOT_WORKING ) - diff --git a/src/mame/drivers/bishi.c b/src/mame/drivers/bishi.c index dcb9179a0f0..8b59939d194 100644 --- a/src/mame/drivers/bishi.c +++ b/src/mame/drivers/bishi.c @@ -285,9 +285,9 @@ static MACHINE_RESET( bishi ) static void sound_irq_gen(const device_config *device, int state) { if (state) - cpu_set_input_line(device->machine->cpu[0], M68K_IRQ_1, ASSERT_LINE); + cputag_set_input_line(device->machine, "maincpu", M68K_IRQ_1, ASSERT_LINE); else - cpu_set_input_line(device->machine->cpu[0], M68K_IRQ_1, CLEAR_LINE); + cputag_set_input_line(device->machine, "maincpu", M68K_IRQ_1, CLEAR_LINE); } static const ymz280b_interface ymz280b_intf = diff --git a/src/mame/drivers/bishjan.c b/src/mame/drivers/bishjan.c index 983d7730eaa..b6486cb9d97 100644 --- a/src/mame/drivers/bishjan.c +++ b/src/mame/drivers/bishjan.c @@ -818,7 +818,7 @@ static INTERRUPT_GEN( bishjan_interrupt ) generic_pulse_irq_line(device, 0); break; default: - cpu_set_input_line(device->machine->cpu[0], H8_METRO_TIMER_HACK, HOLD_LINE); + cputag_set_input_line(device->machine, "maincpu", H8_METRO_TIMER_HACK, HOLD_LINE); break; } } diff --git a/src/mame/drivers/bking.c b/src/mame/drivers/bking.c index 0a8f94de2f5..6a7b23ad827 100644 --- a/src/mame/drivers/bking.c +++ b/src/mame/drivers/bking.c @@ -70,7 +70,7 @@ static WRITE8_HANDLER( bking_soundlatch_w ) if (data & (1 << i)) code |= 0x80 >> i; soundlatch_w(space,offset,code); - if (sndnmi_enable) cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_NMI, PULSE_LINE); + if (sndnmi_enable) cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE); } static WRITE8_HANDLER( bking3_addr_l_w ) @@ -199,7 +199,7 @@ static WRITE8_HANDLER( bking3_68705_portB_w ) if (~data & 0x02) { portA_in = from_main; - if (main_sent) cpu_set_input_line(space->machine->cpu[2],0,CLEAR_LINE); + if (main_sent) cputag_set_input_line(space->machine, "mcu", 0, CLEAR_LINE); main_sent = 0; } diff --git a/src/mame/drivers/bladestl.c b/src/mame/drivers/bladestl.c index 5a2363c3f27..9741e68837b 100644 --- a/src/mame/drivers/bladestl.c +++ b/src/mame/drivers/bladestl.c @@ -91,7 +91,7 @@ static WRITE8_HANDLER( bladestl_bankswitch_w ) static WRITE8_HANDLER( bladestl_sh_irqtrigger_w ) { soundlatch_w(space, offset, data); - cpu_set_input_line(space->machine->cpu[1], M6809_IRQ_LINE, HOLD_LINE); + cputag_set_input_line(space->machine, "audiocpu", M6809_IRQ_LINE, HOLD_LINE); //logerror("(sound) write %02x\n", data); } diff --git a/src/mame/drivers/blktiger.c b/src/mame/drivers/blktiger.c index f0470f32cfe..b3c24c9ce5e 100644 --- a/src/mame/drivers/blktiger.c +++ b/src/mame/drivers/blktiger.c @@ -228,7 +228,7 @@ GFXDECODE_END /* handler called by the 2203 emulator when the internal timers cause an IRQ */ static void irqhandler(const device_config *device, int irq) { - cpu_set_input_line(device->machine->cpu[1],0,irq ? ASSERT_LINE : CLEAR_LINE); + cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); } static const ym2203_interface ym2203_config = diff --git a/src/mame/drivers/blockhl.c b/src/mame/drivers/blockhl.c index 01b09eba0a7..49239b62ac9 100644 --- a/src/mame/drivers/blockhl.c +++ b/src/mame/drivers/blockhl.c @@ -62,7 +62,7 @@ static WRITE8_HANDLER( bankedram_w ) static WRITE8_HANDLER( blockhl_sh_irqtrigger_w ) { - cpu_set_input_line_and_vector(space->machine->cpu[1], 0, HOLD_LINE, 0xff); + cputag_set_input_line_and_vector(space->machine, "audiocpu", 0, HOLD_LINE, 0xff); } @@ -274,7 +274,7 @@ static MACHINE_RESET( blockhl ) { UINT8 *RAM = memory_region(machine, "maincpu"); - konami_configure_set_lines(machine->cpu[0], blockhl_banking); + konami_configure_set_lines(cputag_get_cpu(machine, "maincpu"), blockhl_banking); paletteram = &RAM[0x18000]; } diff --git a/src/mame/drivers/blockout.c b/src/mame/drivers/blockout.c index 2e6bce662f0..ecd1bec4534 100644 --- a/src/mame/drivers/blockout.c +++ b/src/mame/drivers/blockout.c @@ -41,7 +41,7 @@ static WRITE16_HANDLER( blockout_sound_command_w ) if (ACCESSING_BITS_0_7) { soundlatch_w(space,offset,data & 0xff); - cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_NMI, PULSE_LINE); + cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE); } } @@ -171,7 +171,7 @@ INPUT_PORTS_END /* handler called by the 2151 emulator when the internal timers cause an IRQ */ static void blockout_irq_handler(const device_config *device, int irq) { - cpu_set_input_line_and_vector(device->machine->cpu[1],0,irq ? ASSERT_LINE : CLEAR_LINE,0xff); + cputag_set_input_line_and_vector(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE, 0xff); } static const ym2151_interface ym2151_config = diff --git a/src/mame/drivers/blstroid.c b/src/mame/drivers/blstroid.c index dcc12f825c6..9308e7ff429 100644 --- a/src/mame/drivers/blstroid.c +++ b/src/mame/drivers/blstroid.c @@ -33,9 +33,9 @@ static void update_interrupts(running_machine *machine) { - cpu_set_input_line(machine->cpu[0], 1, atarigen_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); - cpu_set_input_line(machine->cpu[0], 2, atarigen_video_int_state ? ASSERT_LINE : CLEAR_LINE); - cpu_set_input_line(machine->cpu[0], 4, atarigen_sound_int_state ? ASSERT_LINE : CLEAR_LINE); + cputag_set_input_line(machine, "maincpu", 1, atarigen_scanline_int_state ? ASSERT_LINE : CLEAR_LINE); + cputag_set_input_line(machine, "maincpu", 2, atarigen_video_int_state ? ASSERT_LINE : CLEAR_LINE); + cputag_set_input_line(machine, "maincpu", 4, atarigen_sound_int_state ? ASSERT_LINE : CLEAR_LINE); } diff --git a/src/mame/drivers/blueprnt.c b/src/mame/drivers/blueprnt.c index 8ff9c5b7c1d..dbece04615d 100644 --- a/src/mame/drivers/blueprnt.c +++ b/src/mame/drivers/blueprnt.c @@ -86,7 +86,7 @@ static READ8_HANDLER( blueprnt_sh_dipsw_r ) static WRITE8_HANDLER( blueprnt_sound_command_w ) { soundlatch_w(space, offset, data); - cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_NMI, PULSE_LINE); + cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE); } static WRITE8_HANDLER( blueprnt_coin_counter_w ) diff --git a/src/mame/drivers/bnstars.c b/src/mame/drivers/bnstars.c index 4a48ff96c3e..440d16dca5d 100644 --- a/src/mame/drivers/bnstars.c +++ b/src/mame/drivers/bnstars.c @@ -1290,14 +1290,14 @@ static IRQ_CALLBACK(irq_callback) static void irq_init(running_machine *machine) { irqreq = 0; - cpu_set_input_line(machine->cpu[0], 0, CLEAR_LINE); - cpu_set_irq_callback(machine->cpu[0], irq_callback); + cputag_set_input_line(machine, "maincpu", 0, CLEAR_LINE); + cpu_set_irq_callback(cputag_get_cpu(machine, "maincpu"), irq_callback); } static void irq_raise(running_machine *machine, int level) { irqreq |= (1<cpu[0], 0, ASSERT_LINE); + cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE); } diff --git a/src/mame/drivers/boogwing.c b/src/mame/drivers/boogwing.c index 709351e8062..b157b6c595a 100644 --- a/src/mame/drivers/boogwing.c +++ b/src/mame/drivers/boogwing.c @@ -279,7 +279,7 @@ GFXDECODE_END static void sound_irq(const device_config *device, int state) { - cpu_set_input_line(device->machine->cpu[1],1,state); /* IRQ 2 */ + cputag_set_input_line(device->machine, "audiocpu", 1, state); /* IRQ 2 */ } static WRITE8_DEVICE_HANDLER( sound_bankswitch_w ) diff --git a/src/mame/drivers/bottom9.c b/src/mame/drivers/bottom9.c index 960e3d5d393..893e246b0d2 100644 --- a/src/mame/drivers/bottom9.c +++ b/src/mame/drivers/bottom9.c @@ -102,7 +102,7 @@ static WRITE8_HANDLER( bottom9_1f90_w ) static WRITE8_HANDLER( bottom9_sh_irqtrigger_w ) { - cpu_set_input_line_and_vector(space->machine->cpu[1],0,HOLD_LINE,0xff); + cputag_set_input_line_and_vector(space->machine, "audiocpu", 0, HOLD_LINE, 0xff); } static int nmienable; diff --git a/src/mame/drivers/boxer.c b/src/mame/drivers/boxer.c index 0271e56f55c..2bac74c9dba 100644 --- a/src/mame/drivers/boxer.c +++ b/src/mame/drivers/boxer.c @@ -27,7 +27,7 @@ static TIMER_CALLBACK( pot_interrupt ) int mask = param; if (pot_latch & mask) - cpu_set_input_line(machine->cpu[0], INPUT_LINE_NMI, ASSERT_LINE); + cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, ASSERT_LINE); pot_state |= mask; } @@ -37,7 +37,7 @@ static TIMER_CALLBACK( periodic_callback ) { int scanline = param; - cpu_set_input_line(machine->cpu[0], 0, ASSERT_LINE); + cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE); if (scanline == 0) { @@ -149,13 +149,13 @@ static WRITE8_HANDLER( boxer_pot_w ) pot_latch = data & 0x3f; - cpu_set_input_line(space->machine->cpu[0], INPUT_LINE_NMI, CLEAR_LINE); + cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_NMI, CLEAR_LINE); } static WRITE8_HANDLER( boxer_irq_reset_w ) { - cpu_set_input_line(space->machine->cpu[0], 0, CLEAR_LINE); + cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE); } diff --git a/src/mame/drivers/brkthru.c b/src/mame/drivers/brkthru.c index 3605fbe7a8e..af454a91676 100644 --- a/src/mame/drivers/brkthru.c +++ b/src/mame/drivers/brkthru.c @@ -72,29 +72,29 @@ VIDEO_UPDATE( brkthru ); static WRITE8_HANDLER( brkthru_1803_w ) { /* bit 0 = NMI enable */ - cpu_interrupt_enable(space->machine->cpu[0], ~data & 1); + cpu_interrupt_enable(cputag_get_cpu(space->machine, "maincpu"), ~data & 1); /* bit 1 = ? maybe IRQ acknowledge */ } static WRITE8_HANDLER( darwin_0803_w ) { /* bit 0 = NMI enable */ - /*cpu_interrupt_enable(space->machine->cpu[1], ~data & 1);*/ + /*cpu_interrupt_enable(cputag_get_cpu(space->machine, "audiocpu"), ~data & 1);*/ logerror("0803 %02X\n",data); - cpu_interrupt_enable(space->machine->cpu[0], data & 1); + cpu_interrupt_enable(cputag_get_cpu(space->machine, "maincpu"), data & 1); /* bit 1 = ? maybe IRQ acknowledge */ } static WRITE8_HANDLER( brkthru_soundlatch_w ) { soundlatch_w(space,offset,data); - cpu_set_input_line(space->machine->cpu[1],INPUT_LINE_NMI,PULSE_LINE); + cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE); } static INPUT_CHANGED( coin_inserted ) { /* coin insertion causes an IRQ */ - cpu_set_input_line(field->port->machine->cpu[0], 0, newval ? CLEAR_LINE : ASSERT_LINE); + cputag_set_input_line(field->port->machine, "maincpu", 0, newval ? CLEAR_LINE : ASSERT_LINE); } @@ -324,7 +324,7 @@ GFXDECODE_END /* handler called by the 3812 emulator when the internal timers cause an IRQ */ static void irqhandler(const device_config *device, int linestate) { - cpu_set_input_line(device->machine->cpu[1],M6809_IRQ_LINE,linestate); + cputag_set_input_line(device->machine, "audiocpu", M6809_IRQ_LINE, linestate); } static const ym3526_interface ym3526_config = diff --git a/src/mame/drivers/btime.c b/src/mame/drivers/btime.c index 62fa86b5a2b..b298aba18d8 100644 --- a/src/mame/drivers/btime.c +++ b/src/mame/drivers/btime.c @@ -185,7 +185,7 @@ static WRITE8_HANDLER( audio_nmi_enable_w ) if (audio_nmi_enable_type == AUDIO_ENABLE_DIRECT) { audio_nmi_enabled = data & 1; - cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_NMI, (audio_nmi_enabled && audio_nmi_state) ? ASSERT_LINE : CLEAR_LINE); + cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, (audio_nmi_enabled && audio_nmi_state) ? ASSERT_LINE : CLEAR_LINE); } } @@ -195,7 +195,7 @@ static WRITE8_DEVICE_HANDLER( ay_audio_nmi_enable_w ) if (audio_nmi_enable_type == AUDIO_ENABLE_AY8910) { audio_nmi_enabled = ~data & 1; - cpu_set_input_line(device->machine->cpu[1], INPUT_LINE_NMI, (audio_nmi_enabled && audio_nmi_state) ? ASSERT_LINE : CLEAR_LINE); + cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_NMI, (audio_nmi_enabled && audio_nmi_state) ? ASSERT_LINE : CLEAR_LINE); } } @@ -203,7 +203,7 @@ static TIMER_DEVICE_CALLBACK( audio_nmi_gen ) { int scanline = param; audio_nmi_state = scanline & 8; - cpu_set_input_line(timer->machine->cpu[1], INPUT_LINE_NMI, (audio_nmi_enabled && audio_nmi_state) ? ASSERT_LINE : CLEAR_LINE); + cputag_set_input_line(timer->machine, "audiocpu", INPUT_LINE_NMI, (audio_nmi_enabled && audio_nmi_state) ? ASSERT_LINE : CLEAR_LINE); } @@ -524,30 +524,30 @@ ADDRESS_MAP_END static INPUT_CHANGED( coin_inserted_irq_hi ) { if (newval) - cpu_set_input_line(field->port->machine->cpu[0], 0, HOLD_LINE); + cputag_set_input_line(field->port->machine, "maincpu", 0, HOLD_LINE); } static INPUT_CHANGED( coin_inserted_irq_lo ) { if (!newval) - cpu_set_input_line(field->port->machine->cpu[0], 0, HOLD_LINE); + cputag_set_input_line(field->port->machine, "maincpu", 0, HOLD_LINE); } static INPUT_CHANGED( coin_inserted_nmi_lo ) { - cpu_set_input_line(field->port->machine->cpu[0], INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE); + cputag_set_input_line(field->port->machine, "maincpu", INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE); } static WRITE8_HANDLER( audio_command_w ) { soundlatch_w(space,offset,data); - cpu_set_input_line(space->machine->cpu[1], 0, ASSERT_LINE); + cputag_set_input_line(space->machine, "audiocpu", 0, ASSERT_LINE); } static READ8_HANDLER( audio_command_r ) { - cpu_set_input_line(space->machine->cpu[1], 0, CLEAR_LINE); + cputag_set_input_line(space->machine, "audiocpu", 0, CLEAR_LINE); return soundlatch_r(space,offset); } @@ -1991,7 +1991,7 @@ static void decrypt_C10707_cpu(running_machine *machine, const char *cputag) for (addr = 0; addr < 0x10000; addr++) decrypt[addr] = swap_bits_5_6(rom[addr]); - if (space->cpu == machine->cpu[0]) + if (space->cpu == cputag_get_cpu(machine, "maincpu")) decrypted = decrypt; } @@ -2078,7 +2078,7 @@ static DRIVER_INIT( cookrace ) { decrypt_C10707_cpu(machine, "maincpu"); - memory_install_read8_handler(cpu_get_address_space(machine->cpu[1], ADDRESS_SPACE_PROGRAM), 0x0200, 0x0fff, 0, 0, (read8_space_func)SMH_BANK(10)); + memory_install_read8_handler(cputag_get_address_space(machine, "audiocpu", ADDRESS_SPACE_PROGRAM), 0x0200, 0x0fff, 0, 0, (read8_space_func)SMH_BANK(10)); memory_set_bankptr(machine, 10, memory_region(machine, "audiocpu") + 0xe200); audio_nmi_enable_type = AUDIO_ENABLE_DIRECT; } @@ -2093,9 +2093,9 @@ static DRIVER_INIT( wtennis ) { decrypt_C10707_cpu(machine, "maincpu"); - memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xc15f, 0xc15f, 0, 0, wtennis_reset_hack_r); + memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xc15f, 0xc15f, 0, 0, wtennis_reset_hack_r); - memory_install_read8_handler(cpu_get_address_space(machine->cpu[1], ADDRESS_SPACE_PROGRAM), 0x0200, 0x0fff, 0, 0, (read8_space_func)SMH_BANK(10)); + memory_install_read8_handler(cputag_get_address_space(machine, "audiocpu", ADDRESS_SPACE_PROGRAM), 0x0200, 0x0fff, 0, 0, (read8_space_func)SMH_BANK(10)); memory_set_bankptr(machine, 10, memory_region(machine, "audiocpu") + 0xe200); audio_nmi_enable_type = AUDIO_ENABLE_DIRECT; } diff --git a/src/mame/drivers/btoads.c b/src/mame/drivers/btoads.c index 62409be63de..d303271a242 100644 --- a/src/mame/drivers/btoads.c +++ b/src/mame/drivers/btoads.c @@ -68,7 +68,7 @@ static TIMER_CALLBACK( delayed_sound_w ) { main_to_sound_data = param; main_to_sound_ready = 1; - cpu_triggerint(machine->cpu[1]); + cpu_triggerint(cputag_get_cpu(machine, "audiocpu")); /* use a timer to make long transfers faster */ timer_set(machine, ATTOTIME_IN_USEC(50), NULL, 0, 0); @@ -149,7 +149,7 @@ static WRITE8_HANDLER( sound_int_state_w ) devtag_reset(space->machine, "bsmt"); /* also clears interrupts */ - cpu_set_input_line(space->machine->cpu[1], 0, CLEAR_LINE); + cputag_set_input_line(space->machine, "audiocpu", 0, CLEAR_LINE); sound_int_state = data; } diff --git a/src/mame/drivers/bublbobl.c b/src/mame/drivers/bublbobl.c index 7d1e7f8e49f..da20fc5c3b7 100644 --- a/src/mame/drivers/bublbobl.c +++ b/src/mame/drivers/bublbobl.c @@ -658,7 +658,7 @@ GFXDECODE_END // handler called by the 2203 emulator when the internal timers cause an IRQ static void irqhandler(const device_config *device, int irq) { - cpu_set_input_line(device->machine->cpu[2], 0, irq ? ASSERT_LINE : CLEAR_LINE); + cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE); } static const ym2203_interface ym2203_config = @@ -1275,7 +1275,7 @@ static DRIVER_INIT( tokiob ) { DRIVER_INIT_CALL(tokio); - memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xfe00, 0xfe00, 0, 0, tokiob_mcu_r ); + memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xfe00, 0xfe00, 0, 0, tokiob_mcu_r ); } diff --git a/src/mame/drivers/buggychl.c b/src/mame/drivers/buggychl.c index 16e6df0045a..9fcd7441628 100644 --- a/src/mame/drivers/buggychl.c +++ b/src/mame/drivers/buggychl.c @@ -100,14 +100,14 @@ static int sound_nmi_enable,pending_nmi; static TIMER_CALLBACK( nmi_callback ) { - if (sound_nmi_enable) cpu_set_input_line(machine->cpu[1],INPUT_LINE_NMI,PULSE_LINE); + if (sound_nmi_enable) cputag_set_input_line(machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE); else pending_nmi = 1; } static WRITE8_HANDLER( sound_command_w ) { - soundlatch_w(space,0,data); - timer_call_after_resynch(space->machine, NULL, data,nmi_callback); + soundlatch_w(space, 0, data); + timer_call_after_resynch(space->machine, NULL, data, nmi_callback); } static WRITE8_HANDLER( nmi_disable_w ) @@ -120,7 +120,7 @@ static WRITE8_HANDLER( nmi_enable_w ) sound_nmi_enable = 1; if (pending_nmi) { - cpu_set_input_line(space->machine->cpu[1],INPUT_LINE_NMI,PULSE_LINE); + cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE); pending_nmi = 0; } } diff --git a/src/mame/drivers/bwidow.c b/src/mame/drivers/bwidow.c index 9ddee1a3da5..60d64c26eae 100644 --- a/src/mame/drivers/bwidow.c +++ b/src/mame/drivers/bwidow.c @@ -305,7 +305,7 @@ static READ8_HANDLER( spacduel_IN3_r ) static CUSTOM_INPUT( clock_r ) { - return (cpu_get_total_cycles(field->port->machine->cpu[0]) & 0x100) ? 1 : 0; + return (cputag_get_total_cycles(field->port->machine, "maincpu") & 0x100) ? 1 : 0; } @@ -341,7 +341,7 @@ static WRITE8_HANDLER( bwidow_misc_w ) static WRITE8_HANDLER( irq_ack_w ) { - cpu_set_input_line(space->machine->cpu[0], 0, CLEAR_LINE); + cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE); } diff --git a/src/mame/drivers/bwing.c b/src/mame/drivers/bwing.c index 391fc19114b..a81342d6cae 100644 --- a/src/mame/drivers/bwing.c +++ b/src/mame/drivers/bwing.c @@ -73,7 +73,7 @@ static INTERRUPT_GEN ( bwp1_interrupt ) latch_data = sound_fifo[fftail]; fftail = (fftail + 1) & (MAX_SOUNDS - 1); soundlatch_w(cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM), 0, latch_data); - cpu_set_input_line(device->machine->cpu[2], DECO16_IRQ_LINE, HOLD_LINE); // SNDREQ + cputag_set_input_line(device->machine, "audiocpu", DECO16_IRQ_LINE, HOLD_LINE); // SNDREQ } break; @@ -98,7 +98,7 @@ static INTERRUPT_GEN ( bwp3_interrupt ) { if (!bwp3_nmimask) cpu_set_input_line( static WRITE8_HANDLER( bwp12_sharedram1_w ) { bwp1_sharedram1[offset] = bwp2_sharedram1[offset] = data; } static WRITE8_HANDLER( bwp3_u8F_w ) { bwp3_u8F_d = data; } // prepares custom chip for various operations -static WRITE8_HANDLER( bwp3_nmiack_w ) { cpu_set_input_line(space->machine->cpu[2], INPUT_LINE_NMI, CLEAR_LINE); } +static WRITE8_HANDLER( bwp3_nmiack_w ) { cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, CLEAR_LINE); } static WRITE8_HANDLER( bwp3_nmimask_w ) { bwp3_nmimask = data & 0x80; } @@ -119,16 +119,16 @@ static WRITE8_HANDLER( bwp1_ctrl_w ) switch (offset) { // MSSTB - case 0: cpu_set_input_line(space->machine->cpu[1], M6809_IRQ_LINE, ASSERT_LINE); break; + case 0: cputag_set_input_line(space->machine, "sub", M6809_IRQ_LINE, ASSERT_LINE); break; // IRQACK - case 1: cpu_set_input_line(space->machine->cpu[0], M6809_IRQ_LINE, CLEAR_LINE); break; + case 1: cputag_set_input_line(space->machine, "maincpu", M6809_IRQ_LINE, CLEAR_LINE); break; // FIRQACK - case 2: cpu_set_input_line(space->machine->cpu[0], M6809_FIRQ_LINE, CLEAR_LINE); break; + case 2: cputag_set_input_line(space->machine, "maincpu", M6809_FIRQ_LINE, CLEAR_LINE); break; // NMIACK - case 3: cpu_set_input_line(space->machine->cpu[0], INPUT_LINE_NMI, CLEAR_LINE); break; + case 3: cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_NMI, CLEAR_LINE); break; // SWAP(bank-swaps sprite RAM between 1800 & 1900; ignored bc. they're treated as a single chunk.) case 4: break; @@ -136,7 +136,7 @@ static WRITE8_HANDLER( bwp1_ctrl_w ) // SNDREQ case 5: if (data == 0x80) // protection trick to screw CPU1 & 3 - cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_NMI, ASSERT_LINE); // SNMI + cputag_set_input_line(space->machine, "sub", INPUT_LINE_NMI, ASSERT_LINE); // SNMI else if (ffcount < MAX_SOUNDS) { @@ -163,13 +163,13 @@ static WRITE8_HANDLER( bwp2_ctrl_w ) { switch (offset) { - case 0: cpu_set_input_line(space->machine->cpu[0], M6809_IRQ_LINE, ASSERT_LINE); break; // SMSTB + case 0: cputag_set_input_line(space->machine, "maincpu", M6809_IRQ_LINE, ASSERT_LINE); break; // SMSTB - case 1: cpu_set_input_line(space->machine->cpu[1], M6809_FIRQ_LINE, CLEAR_LINE); break; + case 1: cputag_set_input_line(space->machine, "sub", M6809_FIRQ_LINE, CLEAR_LINE); break; - case 2: cpu_set_input_line(space->machine->cpu[1], M6809_IRQ_LINE, CLEAR_LINE); break; + case 2: cputag_set_input_line(space->machine, "sub", M6809_IRQ_LINE, CLEAR_LINE); break; - case 3: cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_NMI, CLEAR_LINE); break; + case 3: cputag_set_input_line(space->machine, "sub", INPUT_LINE_NMI, CLEAR_LINE); break; } #if BW_DEBUG @@ -609,4 +609,3 @@ GAME( 1984, bwingsa, bwings, bwing, bwing, bwing, ROT90, "Data East Corporation" GAME( 1984, zaviga, 0, bwing, bwing, bwing, ROT90, "Data East Corporation", "Zaviga", 0 ) GAME( 1984, zavigaj, zaviga, bwing, bwing, bwing, ROT90, "Data East Corporation", "Zaviga (Japan)", 0 ) - diff --git a/src/mame/drivers/bzone.c b/src/mame/drivers/bzone.c index d03d96d50f4..106c4dfadc2 100644 --- a/src/mame/drivers/bzone.c +++ b/src/mame/drivers/bzone.c @@ -264,7 +264,7 @@ static INTERRUPT_GEN( bzone_interrupt ) static CUSTOM_INPUT( clock_r ) { - return (cpu_get_total_cycles(field->port->machine->cpu[0]) & 0x100) ? 1 : 0; + return (cputag_get_total_cycles(field->port->machine, "maincpu") & 0x100) ? 1 : 0; } @@ -787,13 +787,13 @@ static WRITE8_HANDLER( analog_select_w ) static DRIVER_INIT( bradley ) { - memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x400, 0x7ff, 0, 0, (read8_space_func)SMH_BANK(1), (write8_space_func)SMH_BANK(1)); + memory_install_readwrite8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x400, 0x7ff, 0, 0, (read8_space_func)SMH_BANK(1), (write8_space_func)SMH_BANK(1)); memory_set_bankptr(machine, 1, auto_alloc_array(machine, UINT8, 0x400)); - memory_install_read_port_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x1808, 0x1808, 0, 0, "1808"); - memory_install_read_port_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x1809, 0x1809, 0, 0, "1809"); - memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x180a, 0x180a, 0, 0, analog_data_r); - memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x1848, 0x1850, 0, 0, analog_select_w); + memory_install_read_port_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x1808, 0x1808, 0, 0, "1808"); + memory_install_read_port_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x1809, 0x1809, 0, 0, "1809"); + memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x180a, 0x180a, 0, 0, analog_data_r); + memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x1848, 0x1850, 0, 0, analog_select_w); } diff --git a/src/mame/machine/bagman.c b/src/mame/machine/bagman.c index f176c6b4d00..0b8c9230912 100644 --- a/src/mame/machine/bagman.c +++ b/src/mame/machine/bagman.c @@ -212,30 +212,30 @@ WRITE8_HANDLER( bagman_pal16r6_w ) { UINT8 line; - line = offset*4; - columnvalue[line ] = data&1; - columnvalue[line+1] = 1-(data&1); + line = offset * 4; + columnvalue[line ] = data & 1; + columnvalue[line + 1] = 1 - (data & 1); } MACHINE_RESET( bagman ) { - const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); - bagman_pal16r6_w(space,0,1); /*pin 2*/ - bagman_pal16r6_w(space,1,1); /*pin 3*/ - bagman_pal16r6_w(space,2,1); /*pin 4*/ - bagman_pal16r6_w(space,3,1); /*pin 5*/ - bagman_pal16r6_w(space,4,1); /*pin 6*/ - bagman_pal16r6_w(space,5,1); /*pin 7*/ - bagman_pal16r6_w(space,6,1); /*pin 8*/ - bagman_pal16r6_w(space,7,1); /*pin 9*/ + const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); + bagman_pal16r6_w(space, 0, 1); /*pin 2*/ + bagman_pal16r6_w(space, 1, 1); /*pin 3*/ + bagman_pal16r6_w(space, 2, 1); /*pin 4*/ + bagman_pal16r6_w(space, 3, 1); /*pin 5*/ + bagman_pal16r6_w(space, 4, 1); /*pin 6*/ + bagman_pal16r6_w(space, 5, 1); /*pin 7*/ + bagman_pal16r6_w(space, 6, 1); /*pin 8*/ + bagman_pal16r6_w(space, 7, 1); /*pin 9*/ update_pal(); } READ8_HANDLER( bagman_pal16r6_r ) { update_pal(); - return (outvalue[6]) + (outvalue[5]<<1) + (outvalue[4]<<2) + - (outvalue[3]<<3) + (outvalue[2]<<4) + (outvalue[1]<<5); + return (outvalue[6]) + (outvalue[5] << 1) + (outvalue[4] << 2) + + (outvalue[3] << 3) + (outvalue[2] << 4) + (outvalue[1] << 5); /* Bagman schematics show that this is right mapping order of PAL outputs to bits. ** This is the PAL 16R6 shown almost in the middle of the schematics. diff --git a/src/mame/machine/balsente.c b/src/mame/machine/balsente.c index fe3871e66cc..048e34d126f 100644 --- a/src/mame/machine/balsente.c +++ b/src/mame/machine/balsente.c @@ -103,7 +103,7 @@ static UINT8 grudge_last_steering[3]; static TIMER_CALLBACK( irq_off ) { - cpu_set_input_line(machine->cpu[0], M6809_IRQ_LINE, CLEAR_LINE); + cputag_set_input_line(machine, "maincpu", M6809_IRQ_LINE, CLEAR_LINE); } @@ -116,7 +116,7 @@ static TIMER_CALLBACK( interrupt_timer ) timer_adjust_oneshot(scanline_timer, video_screen_get_time_until_pos(machine->primary_screen, param + 64, 0), param + 64); /* IRQ starts on scanline 0, 64, 128, etc. */ - cpu_set_input_line(machine->cpu[0], M6809_IRQ_LINE, ASSERT_LINE); + cputag_set_input_line(machine, "maincpu", M6809_IRQ_LINE, ASSERT_LINE); /* it will turn off on the next HBLANK */ timer_set(machine, video_screen_get_time_until_pos(machine->primary_screen, param, BALSENTE_HBSTART), NULL, 0, irq_off); @@ -148,7 +148,7 @@ static TIMER_CALLBACK( interrupt_timer ) MACHINE_RESET( balsente ) { - const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); + const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); int numbanks, i; /* create the polynomial tables */ @@ -199,7 +199,7 @@ MACHINE_RESET( balsente ) memory_configure_bank(machine, 2, 0, numbanks, &memory_region(machine, "maincpu")[0x12000], 0x6000); memory_set_bank(space->machine, 1, 0); memory_set_bank(space->machine, 2, 0); - device_reset(machine->cpu[0]); + device_reset(cputag_get_cpu(machine, "maincpu")); /* start a timer to generate interrupts */ scanline_timer = timer_alloc(machine, interrupt_timer, NULL); @@ -475,12 +475,12 @@ static void m6850_update_io(running_machine *machine) /* apply the change */ if (new_state && !(m6850_status & 0x80)) { - cpu_set_input_line(machine->cpu[0], M6809_FIRQ_LINE, ASSERT_LINE); + cputag_set_input_line(machine, "maincpu", M6809_FIRQ_LINE, ASSERT_LINE); m6850_status |= 0x80; } else if (!new_state && (m6850_status & 0x80)) { - cpu_set_input_line(machine->cpu[0], M6809_FIRQ_LINE, CLEAR_LINE); + cputag_set_input_line(machine, "maincpu", M6809_FIRQ_LINE, CLEAR_LINE); m6850_status &= ~0x80; } @@ -493,12 +493,12 @@ static void m6850_update_io(running_machine *machine) /* apply the change */ if (new_state && !(m6850_sound_status & 0x80)) { - cpu_set_input_line(machine->cpu[1], INPUT_LINE_NMI, ASSERT_LINE); + cputag_set_input_line(machine, "audiocpu", INPUT_LINE_NMI, ASSERT_LINE); m6850_sound_status |= 0x80; } else if (!new_state && (m6850_sound_status & 0x80)) { - cpu_set_input_line(machine->cpu[1], INPUT_LINE_NMI, CLEAR_LINE); + cputag_set_input_line(machine, "audiocpu", INPUT_LINE_NMI, CLEAR_LINE); m6850_sound_status &= ~0x80; } } @@ -784,7 +784,7 @@ static void counter_set_out(running_machine *machine, int which, int out) { /* OUT on counter 2 is hooked to the /INT line on the Z80 */ if (which == 2) - cpu_set_input_line(machine->cpu[1], 0, out ? ASSERT_LINE : CLEAR_LINE); + cputag_set_input_line(machine, "audiocpu", 0, out ? ASSERT_LINE : CLEAR_LINE); /* OUT on counter 0 is hooked to the GATE line on counter 1 */ else if (which == 0) diff --git a/src/mame/machine/beezer.c b/src/mame/machine/beezer.c index 52eeeeff84f..b1be74eb545 100644 --- a/src/mame/machine/beezer.c +++ b/src/mame/machine/beezer.c @@ -51,9 +51,9 @@ static READ8_DEVICE_HANDLER( b_via_0_pb_r ) static WRITE8_DEVICE_HANDLER( b_via_0_pa_w ) { if ((data & 0x08) == 0) - cpu_set_input_line(device->machine->cpu[1], INPUT_LINE_RESET, ASSERT_LINE); + cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_RESET, ASSERT_LINE); else - cpu_set_input_line(device->machine->cpu[1], INPUT_LINE_RESET, CLEAR_LINE); + cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_RESET, CLEAR_LINE); if ((data & 0x04) == 0) { @@ -121,5 +121,3 @@ WRITE8_HANDLER( beezer_bankswitch_w ) memory_set_bankptr(space->machine, 1, rom + (data & 0x07) * 0x2000 + ((data & 0x08) ? 0x1000: 0)); } } - - diff --git a/src/mame/machine/bigevglf.c b/src/mame/machine/bigevglf.c index 4d5fe370ee7..158e47662c1 100644 --- a/src/mame/machine/bigevglf.c +++ b/src/mame/machine/bigevglf.c @@ -45,7 +45,7 @@ WRITE8_HANDLER( bigevglf_68705_portB_w ) if ((ddrB & 0x02) && (~portB_out & 0x02) && (data & 0x02)) /* positive going transition of the clock */ { - cpu_set_input_line(space->machine->cpu[3],0,CLEAR_LINE); + cputag_set_input_line(space->machine, "mcu", 0, CLEAR_LINE); main_sent = 0; } @@ -86,7 +86,7 @@ WRITE8_HANDLER( bigevglf_mcu_w ) { portA_in = data; main_sent = 1; - cpu_set_input_line(space->machine->cpu[3],0,ASSERT_LINE); + cputag_set_input_line(space->machine, "mcu", 0, ASSERT_LINE); } diff --git a/src/mame/machine/bublbobl.c b/src/mame/machine/bublbobl.c index f68c1f79b70..4a5b60d20c2 100644 --- a/src/mame/machine/bublbobl.c +++ b/src/mame/machine/bublbobl.c @@ -24,11 +24,11 @@ WRITE8_HANDLER( bublbobl_bankswitch_w ) /* bit 3 n.c. */ /* bit 4 resets second Z80 */ - cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); + cputag_set_input_line(space->machine, "slave", INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); /* bit 5 resets mcu */ - if (space->machine->cpu[3] != NULL) // only if we have a MCU - cpu_set_input_line(space->machine->cpu[3], INPUT_LINE_RESET, (data & 0x20) ? CLEAR_LINE : ASSERT_LINE); + if (cputag_get_cpu(space->machine, "mcu") != NULL) // only if we have a MCU + cputag_set_input_line(space->machine, "mcu", INPUT_LINE_RESET, (data & 0x20) ? CLEAR_LINE : ASSERT_LINE); /* bit 6 enables display */ bublbobl_video_enable = data & 0x40; @@ -55,7 +55,7 @@ WRITE8_HANDLER( tokio_videoctrl_w ) WRITE8_HANDLER( bublbobl_nmitrigger_w ) { - cpu_set_input_line(space->machine->cpu[1],INPUT_LINE_NMI,PULSE_LINE); + cputag_set_input_line(space->machine, "slave", INPUT_LINE_NMI, PULSE_LINE); } @@ -94,7 +94,7 @@ static int sound_nmi_enable,pending_nmi,sound_status; static TIMER_CALLBACK( nmi_callback ) { - if (sound_nmi_enable) cpu_set_input_line(machine->cpu[2],INPUT_LINE_NMI,PULSE_LINE); + if (sound_nmi_enable) cputag_set_input_line(machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE); else pending_nmi = 1; } @@ -114,14 +114,14 @@ WRITE8_HANDLER( bublbobl_sh_nmi_enable_w ) sound_nmi_enable = 1; if (pending_nmi) { - cpu_set_input_line(space->machine->cpu[2],INPUT_LINE_NMI,PULSE_LINE); + cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE); pending_nmi = 0; } } WRITE8_HANDLER(soundcpu_reset_w) { - cpu_set_input_line(space->machine->cpu[2], INPUT_LINE_RESET, data ? ASSERT_LINE : CLEAR_LINE); + cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, data ? ASSERT_LINE : CLEAR_LINE); } READ8_HANDLER( sound_status_r ) @@ -207,8 +207,8 @@ WRITE8_HANDLER( bublbobl_mcu_port1_w ) if ((port1_out & 0x40) && (~data & 0x40)) { // logerror("triggering IRQ on main CPU\n"); - cpu_set_input_line_vector(space->machine->cpu[0],0,bublbobl_mcu_sharedram[0]); - cpu_set_input_line(space->machine->cpu[0],0,HOLD_LINE); + cpu_set_input_line_vector(cputag_get_cpu(space->machine, "maincpu"), 0, bublbobl_mcu_sharedram[0]); + cputag_set_input_line(space->machine, "maincpu", 0, HOLD_LINE); } // bit 7: select read or write shared RAM @@ -487,8 +487,8 @@ logerror("%04x: 68705 unknown write to address %04x\n",cpu_get_pc(space->cpu),ad /* hack to get random EXTEND letters (who is supposed to do this? 68705? PAL?) */ bublbobl_mcu_sharedram[0x7c] = mame_rand(space->machine)%6; - cpu_set_input_line_vector(space->machine->cpu[0],0,bublbobl_mcu_sharedram[0]); - cpu_set_input_line(space->machine->cpu[0],0,HOLD_LINE); + cpu_set_input_line_vector(cputag_get_cpu(space->machine, "maincpu"), 0, bublbobl_mcu_sharedram[0]); + cputag_set_input_line(space->machine, "maincpu", 0, HOLD_LINE); } if ((ddrB & 0x40) && (~data & 0x40) && (portB_out & 0x40)) { diff --git a/src/mame/machine/buggychl.c b/src/mame/machine/buggychl.c index 2a0f7d3d253..c8ce34e0e67 100644 --- a/src/mame/machine/buggychl.c +++ b/src/mame/machine/buggychl.c @@ -10,7 +10,7 @@ MACHINE_RESET( buggychl ) { mcu_sent = 0; main_sent = 0; - cpu_set_input_line(machine->cpu[2],0,CLEAR_LINE); + cputag_set_input_line(machine, "mcu", 0, CLEAR_LINE); } @@ -70,18 +70,18 @@ READ8_HANDLER( buggychl_68705_portB_r ) WRITE8_HANDLER( buggychl_68705_portB_w ) { -logerror("%04x: 68705 port B write %02x\n",cpu_get_pc(space->cpu),data); +logerror("%04x: 68705 port B write %02x\n", cpu_get_pc(space->cpu), data); if ((ddrB & 0x02) && (~data & 0x02) && (portB_out & 0x02)) { portA_in = from_main; - if (main_sent) cpu_set_input_line(space->machine->cpu[2],0,CLEAR_LINE); + if (main_sent) cputag_set_input_line(space->machine, "mcu", 0, CLEAR_LINE); main_sent = 0; -logerror("read command %02x from main cpu\n",portA_in); +logerror("read command %02x from main cpu\n", portA_in); } if ((ddrB & 0x04) && (data & 0x04) && (~portB_out & 0x04)) { -logerror("send command %02x to main cpu\n",portA_out); +logerror("send command %02x to main cpu\n", portA_out); from_mcu = portA_out; mcu_sent = 1; } @@ -111,13 +111,13 @@ READ8_HANDLER( buggychl_68705_portC_r ) portC_in = 0; if (main_sent) portC_in |= 0x01; if (!mcu_sent) portC_in |= 0x02; -logerror("%04x: 68705 port C read %02x\n",cpu_get_pc(space->cpu),portC_in); +logerror("%04x: 68705 port C read %02x\n", cpu_get_pc(space->cpu), portC_in); return (portC_out & ddrC) | (portC_in & ~ddrC); } WRITE8_HANDLER( buggychl_68705_portC_w ) { -logerror("%04x: 68705 port C write %02x\n",cpu_get_pc(space->cpu),data); +logerror("%04x: 68705 port C write %02x\n", cpu_get_pc(space->cpu), data); portC_out = data; } @@ -129,15 +129,15 @@ WRITE8_HANDLER( buggychl_68705_ddrC_w ) WRITE8_HANDLER( buggychl_mcu_w ) { -logerror("%04x: mcu_w %02x\n",cpu_get_pc(space->cpu),data); +logerror("%04x: mcu_w %02x\n", cpu_get_pc(space->cpu), data); from_main = data; main_sent = 1; - cpu_set_input_line(space->machine->cpu[2],0,ASSERT_LINE); + cputag_set_input_line(space->machine, "mcu", 0, ASSERT_LINE); } READ8_HANDLER( buggychl_mcu_r ) { -logerror("%04x: mcu_r %02x\n",cpu_get_pc(space->cpu),from_mcu); +logerror("%04x: mcu_r %02x\n", cpu_get_pc(space->cpu), from_mcu); mcu_sent = 0; return from_mcu; } diff --git a/src/mame/video/beathead.c b/src/mame/video/beathead.c index 61a963854a0..90e0773ce3c 100644 --- a/src/mame/video/beathead.c +++ b/src/mame/video/beathead.c @@ -114,7 +114,7 @@ WRITE32_HANDLER( beathead_finescroll_w ) if ((oldword & 8) && !(newword & 8) && video_screen_get_vpos(space->machine->primary_screen) != 261) { logerror("Suspending time! (scanline = %d)\n", video_screen_get_vpos(space->machine->primary_screen)); - cpu_set_input_line(space->machine->cpu[0], INPUT_LINE_HALT, ASSERT_LINE); + cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_HALT, ASSERT_LINE); } } diff --git a/src/mame/video/bfm_dm01.c b/src/mame/video/bfm_dm01.c index 5854b186ac9..05ed07e89c0 100644 --- a/src/mame/video/bfm_dm01.c +++ b/src/mame/video/bfm_dm01.c @@ -204,7 +204,7 @@ static READ8_HANDLER( unknown_r ) static WRITE8_HANDLER( unknown_w ) { - cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_NMI, CLEAR_LINE ); //? + cputag_set_input_line(space->machine, "matrix", INPUT_LINE_NMI, CLEAR_LINE ); //? } /////////////////////////////////////////////////////////////////////////// @@ -226,7 +226,7 @@ void BFM_dm01_writedata(running_machine *machine, UINT8 data) data_avail = 1; //pulse IRQ line - cpu_set_input_line(machine->cpu[1], M6809_IRQ_LINE, HOLD_LINE ); // trigger IRQ + cputag_set_input_line(machine, "matrix", M6809_IRQ_LINE, HOLD_LINE ); // trigger IRQ } /////////////////////////////////////////////////////////////////////////// diff --git a/src/mame/video/bionicc.c b/src/mame/video/bionicc.c index bb6eff90403..36ecac23fff 100644 --- a/src/mame/video/bionicc.c +++ b/src/mame/video/bionicc.c @@ -243,7 +243,7 @@ VIDEO_UPDATE( bionicc ) VIDEO_EOF( bionicc ) { - const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); + const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); - buffer_spriteram16_w(space,0,0,0xffff); + buffer_spriteram16_w(space, 0, 0, 0xffff); } diff --git a/src/mame/video/blktiger.c b/src/mame/video/blktiger.c index c0e9a27f00a..19499635af5 100644 --- a/src/mame/video/blktiger.c +++ b/src/mame/video/blktiger.c @@ -160,7 +160,7 @@ WRITE8_HANDLER( blktiger_video_control_w ) coin_counter_w(1,data & 2); /* bit 5 resets the sound CPU */ - cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_RESET, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE); + cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE); /* bit 6 flips screen */ flip_screen_set(space->machine, data & 0x40); @@ -244,7 +244,7 @@ VIDEO_UPDATE( blktiger ) VIDEO_EOF( blktiger ) { - const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); + const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); buffer_spriteram_w(space, 0, 0); } diff --git a/src/mame/video/blstroid.c b/src/mame/video/blstroid.c index 52f6178da70..b52c4921eac 100644 --- a/src/mame/video/blstroid.c +++ b/src/mame/video/blstroid.c @@ -98,7 +98,7 @@ VIDEO_START( blstroid ) static TIMER_CALLBACK( irq_off ) { - const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); + const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); /* clear the interrupt */ atarigen_scanline_int_ack_w(space, 0, 0, 0xffff); @@ -108,7 +108,7 @@ static TIMER_CALLBACK( irq_off ) static TIMER_CALLBACK( irq_on ) { /* generate the interrupt */ - atarigen_scanline_int_gen(machine->cpu[0]); + atarigen_scanline_int_gen(cputag_get_cpu(machine, "maincpu")); atarigen_update_interrupts(machine); } diff --git a/src/mame/video/btoads.c b/src/mame/video/btoads.c index c60b7950a25..e53b2e08468 100644 --- a/src/mame/video/btoads.c +++ b/src/mame/video/btoads.c @@ -77,7 +77,7 @@ WRITE16_HANDLER( btoads_misc_control_w ) COMBINE_DATA(&misc_control); /* bit 3 controls sound reset line */ - cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_RESET, (misc_control & 8) ? CLEAR_LINE : ASSERT_LINE); + cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, (misc_control & 8) ? CLEAR_LINE : ASSERT_LINE); }