diff --git a/src/mame/drivers/galaga.c b/src/mame/drivers/galaga.c index 3d114c4be35..1dcd5b7d5b4 100644 --- a/src/mame/drivers/galaga.c +++ b/src/mame/drivers/galaga.c @@ -744,24 +744,24 @@ static WRITE8_HANDLER( bosco_latch_w ) switch (offset) { case 0x00: /* IRQ1 */ - cpu_interrupt_enable(space->machine->cpu[0],bit); + cpu_interrupt_enable(cputag_get_cpu(space->machine, "maincpu"), bit); if (!bit) - cpu_set_input_line(space->machine->cpu[0], 0, CLEAR_LINE); + cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE); break; case 0x01: /* IRQ2 */ - cpu_interrupt_enable(space->machine->cpu[1],bit); + cpu_interrupt_enable(cputag_get_cpu(space->machine, "sub"), bit); if (!bit) - cpu_set_input_line(space->machine->cpu[1], 0, CLEAR_LINE); + cputag_set_input_line(space->machine, "sub", 0, CLEAR_LINE); break; case 0x02: /* NMION */ - cpu_interrupt_enable(space->machine->cpu[2],!bit); + cpu_interrupt_enable(cputag_get_cpu(space->machine, "sub2"), !bit); break; case 0x03: /* RESET */ - cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); - cpu_set_input_line(space->machine->cpu[2], INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); + cputag_set_input_line(space->machine, "sub", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); + cputag_set_input_line(space->machine, "sub2", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); break; case 0x04: /* n.c. */ @@ -822,7 +822,7 @@ static TIMER_CALLBACK( cpu3_interrupt_callback ) { int scanline = param; - nmi_line_pulse(machine->cpu[2]); + nmi_line_pulse(cputag_get_cpu(machine, "sub2")); scanline = scanline + 128; if (scanline >= 272) @@ -841,7 +841,7 @@ static MACHINE_START( galaga ) static void bosco_latch_reset(running_machine *machine) { - 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 i; /* Reset all latches */ @@ -3261,7 +3261,7 @@ static DRIVER_INIT (gatsbee) DRIVER_INIT_CALL(galaga); /* Gatsbee has a larger character ROM, we need a handler for banking */ - memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x1000, 0x1000, 0, 0, gatsbee_bank_w); + memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x1000, 0x1000, 0, 0, gatsbee_bank_w); } @@ -3302,8 +3302,8 @@ static DRIVER_INIT( xevios ) static DRIVER_INIT( battles ) { /* replace the Namco I/O handlers with interface to the 4th CPU */ - memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x7000, 0x700f, 0, 0, battles_customio_data0_r, battles_customio_data0_w ); - memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x7100, 0x7100, 0, 0, battles_customio0_r, battles_customio0_w ); + memory_install_readwrite8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x7000, 0x700f, 0, 0, battles_customio_data0_r, battles_customio_data0_w ); + memory_install_readwrite8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x7100, 0x7100, 0, 0, battles_customio0_r, battles_customio0_w ); DRIVER_INIT_CALL(xevious); } diff --git a/src/mame/drivers/galaxian.c b/src/mame/drivers/galaxian.c index afa7627396a..5adccac5aad 100644 --- a/src/mame/drivers/galaxian.c +++ b/src/mame/drivers/galaxian.c @@ -368,7 +368,7 @@ static WRITE8_DEVICE_HANDLER( konami_sound_control_w ) /* the inverse of bit 3 clocks the flip flop to signal an INT */ /* it is automatically cleared on the acknowledge */ if ((old & 0x08) && !(data & 0x08)) - cpu_set_input_line(device->machine->cpu[1], 0, HOLD_LINE); + cputag_set_input_line(device->machine, "audiocpu", 0, HOLD_LINE); /* bit 4 is sound disable */ sound_global_enable(~data & 0x10); @@ -576,14 +576,14 @@ static const ppi8255_interface scramble_ppi8255_1_intf = static WRITE8_HANDLER( explorer_sound_control_w ) { - cpu_set_input_line(space->machine->cpu[1], 0, ASSERT_LINE); + cputag_set_input_line(space->machine, "audiocpu", 0, ASSERT_LINE); } static READ8_DEVICE_HANDLER( explorer_sound_latch_r ) { - cpu_set_input_line(device->machine->cpu[1], 0, CLEAR_LINE); - return soundlatch_r(cpu_get_address_space(device->machine->cpu[1], ADDRESS_SPACE_PROGRAM), 0); + cputag_set_input_line(device->machine, "audiocpu", 0, CLEAR_LINE); + return soundlatch_r(cputag_get_address_space(device->machine, "audiocpu", ADDRESS_SPACE_PROGRAM), 0); } @@ -619,7 +619,7 @@ static WRITE8_DEVICE_HANDLER( sfx_sample_control_w ) /* the inverse of bit 0 clocks the flip flop to signal an INT */ /* it is automatically cleared on the acknowledge */ if ((old & 0x01) && !(data & 0x01)) - cpu_set_input_line(device->machine->cpu[1], 0, HOLD_LINE); + cputag_set_input_line(device->machine, "audiocpu", 0, HOLD_LINE); } @@ -689,7 +689,7 @@ static READ8_DEVICE_HANDLER( frogger_sound_timer_r ) static WRITE8_HANDLER( froggrmc_sound_control_w ) { - cpu_set_input_line(space->machine->cpu[1], 0, (data & 1) ? CLEAR_LINE : ASSERT_LINE); + cputag_set_input_line(space->machine, "audiocpu", 0, (data & 1) ? CLEAR_LINE : ASSERT_LINE); } @@ -823,7 +823,7 @@ static const ppi8255_interface scorpion_ppi8255_1_intf = static INPUT_CHANGED( gmgalax_game_changed ) { - const address_space *space = cpu_get_address_space(field->port->machine->cpu[0], ADDRESS_SPACE_PROGRAM); + const address_space *space = cputag_get_address_space(field->port->machine, "maincpu", ADDRESS_SPACE_PROGRAM); /* new value is the selected game */ gmgalax_selected_game = newval; @@ -836,7 +836,7 @@ static INPUT_CHANGED( gmgalax_game_changed ) galaxian_stars_enable_w(space, 0, 0); /* reset the CPU */ - cpu_set_input_line(field->port->machine->cpu[0], INPUT_LINE_RESET, PULSE_LINE); + cputag_set_input_line(field->port->machine, "maincpu", INPUT_LINE_RESET, PULSE_LINE); } @@ -1015,13 +1015,13 @@ static READ8_HANDLER( jumpbug_protection_r ) static WRITE8_HANDLER( checkman_sound_command_w ) { soundlatch_w(space, 0, 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 TIMER_DEVICE_CALLBACK( checkmaj_irq0_gen ) { - cpu_set_input_line(timer->machine->cpu[1], 0, HOLD_LINE); + cputag_set_input_line(timer->machine, "audiocpu", 0, HOLD_LINE); } @@ -2324,7 +2324,7 @@ static void common_init( static void unmap_galaxian_sound(running_machine *machine, offs_t base) { - 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, base + 0x0004, base + 0x0007, 0, 0x07f8, (write8_space_func)SMH_UNMAP); memory_install_write8_handler(space, base + 0x0800, base + 0x0807, 0, 0x07f8, (write8_space_func)SMH_UNMAP); @@ -2347,7 +2347,7 @@ static DRIVER_INIT( galaxian ) static DRIVER_INIT( nolock ) { - 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); /* same as galaxian... */ DRIVER_INIT_CALL(galaxian); @@ -2359,7 +2359,7 @@ static DRIVER_INIT( nolock ) static DRIVER_INIT( azurian ) { - 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); /* yellow bullets instead of white ones */ common_init(machine, scramble_draw_bullet, galaxian_draw_background, NULL, NULL); @@ -2371,7 +2371,7 @@ static DRIVER_INIT( azurian ) static DRIVER_INIT( gmgalax ) { - 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); /* video extensions */ common_init(machine, galaxian_draw_bullet, galaxian_draw_background, gmgalax_extend_tile_info, gmgalax_extend_sprite_info); @@ -2388,7 +2388,7 @@ static DRIVER_INIT( gmgalax ) static DRIVER_INIT( pisces ) { - 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); /* video extensions */ common_init(machine, galaxian_draw_bullet, galaxian_draw_background, pisces_extend_tile_info, pisces_extend_sprite_info); @@ -2400,7 +2400,7 @@ static DRIVER_INIT( pisces ) static DRIVER_INIT( batman2 ) { - 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); /* video extensions */ common_init(machine, galaxian_draw_bullet, galaxian_draw_background, batman2_extend_tile_info, upper_extend_sprite_info); @@ -2412,7 +2412,7 @@ static DRIVER_INIT( batman2 ) static DRIVER_INIT( frogg ) { - 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); /* same as galaxian... */ common_init(machine, galaxian_draw_bullet, frogger_draw_background, frogger_extend_tile_info, frogger_extend_sprite_info); @@ -2452,7 +2452,7 @@ static DRIVER_INIT( mooncrsu ) static DRIVER_INIT( mooncrgx ) { - 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); /* video extensions */ common_init(machine, galaxian_draw_bullet, galaxian_draw_background, mooncrst_extend_tile_info, mooncrst_extend_sprite_info); @@ -2464,7 +2464,7 @@ static DRIVER_INIT( mooncrgx ) static DRIVER_INIT( moonqsr ) { - 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); UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x8000); /* video extensions */ @@ -2478,7 +2478,7 @@ static DRIVER_INIT( moonqsr ) static DRIVER_INIT( pacmanbl ) { - 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); /* same as galaxian... */ DRIVER_INIT_CALL(galaxian); @@ -2504,7 +2504,7 @@ static DRIVER_INIT( devilfsg ) static DRIVER_INIT( zigzag ) { - 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); /* video extensions */ common_init(machine, NULL, galaxian_draw_background, NULL, NULL); @@ -2544,8 +2544,8 @@ static DRIVER_INIT( jumpbug ) static DRIVER_INIT( checkman ) { - const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); - const address_space *iospace = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO); + const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); + const address_space *iospace = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO); /* video extensions */ common_init(machine, galaxian_draw_bullet, galaxian_draw_background, mooncrst_extend_tile_info, mooncrst_extend_sprite_info); @@ -2564,7 +2564,7 @@ static DRIVER_INIT( checkman ) static DRIVER_INIT( checkmaj ) { - 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); /* video extensions */ common_init(machine, galaxian_draw_bullet, galaxian_draw_background, NULL, NULL); @@ -2579,7 +2579,7 @@ static DRIVER_INIT( checkmaj ) static DRIVER_INIT( dingo ) { - 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); /* video extensions */ common_init(machine, galaxian_draw_bullet, galaxian_draw_background, NULL, NULL); @@ -2594,8 +2594,8 @@ static DRIVER_INIT( dingo ) static DRIVER_INIT( dingoe ) { - const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); - const address_space *iospace = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO); + const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); + const address_space *iospace = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_IO); /* video extensions */ common_init(machine, galaxian_draw_bullet, galaxian_draw_background, mooncrst_extend_tile_info, mooncrst_extend_sprite_info); @@ -2616,7 +2616,7 @@ static DRIVER_INIT( dingoe ) static DRIVER_INIT( skybase ) { - 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); /* video extensions */ common_init(machine, galaxian_draw_bullet, galaxian_draw_background, pisces_extend_tile_info, pisces_extend_sprite_info); @@ -2662,7 +2662,7 @@ static DRIVER_INIT( mshuttlj ) static DRIVER_INIT( kingball ) { - 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); /* video extensions */ common_init(machine, galaxian_draw_bullet, galaxian_draw_background, NULL, NULL); @@ -2679,7 +2679,7 @@ static DRIVER_INIT( kingball ) static DRIVER_INIT( scorpnmc ) { - 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); /* video extensions */ common_init(machine, galaxian_draw_bullet, galaxian_draw_background, batman2_extend_tile_info, upper_extend_sprite_info); @@ -2710,7 +2710,7 @@ static DRIVER_INIT( scorpnmc ) static DRIVER_INIT( theend ) { - 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); /* video extensions */ common_init(machine, theend_draw_bullet, galaxian_draw_background, NULL, NULL); @@ -2729,7 +2729,7 @@ static DRIVER_INIT( scramble ) static DRIVER_INIT( explorer ) { - 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); /* video extensions */ common_init(machine, scramble_draw_bullet, scramble_draw_background, NULL, NULL); @@ -2755,14 +2755,14 @@ static DRIVER_INIT( sfx ) galaxian_sfx_tilemap = TRUE; /* sound board has space for extra ROM */ - memory_install_read8_handler(cpu_get_address_space(machine->cpu[1], ADDRESS_SPACE_PROGRAM), 0x0000, 0x3fff, 0, 0, (read8_space_func)SMH_BANK(1)); + memory_install_read8_handler(cputag_get_address_space(machine, "audiocpu", ADDRESS_SPACE_PROGRAM), 0x0000, 0x3fff, 0, 0, (read8_space_func)SMH_BANK(1)); memory_set_bankptr(machine, 1, memory_region(machine, "audiocpu")); } static DRIVER_INIT( atlantis ) { - 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); /* video extensions */ common_init(machine, scramble_draw_bullet, scramble_draw_background, NULL, NULL); @@ -2804,7 +2804,7 @@ static DRIVER_INIT( frogger ) static DRIVER_INIT( froggrmc ) { - 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); /* video extensions */ common_init(machine, NULL, frogger_draw_background, frogger_extend_tile_info, frogger_extend_sprite_info); @@ -2853,12 +2853,12 @@ static DRIVER_INIT( amidar ) static DRIVER_INIT( scorpion ) { - 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); common_init(machine, scramble_draw_bullet, scramble_draw_background, batman2_extend_tile_info, upper_extend_sprite_info); /* hook up AY8910 */ - memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[1], ADDRESS_SPACE_IO), 0x00, 0xff, 0, 0, scorpion_ay8910_r, scorpion_ay8910_w); + memory_install_readwrite8_handler(cputag_get_address_space(machine, "audiocpu", ADDRESS_SPACE_IO), 0x00, 0xff, 0, 0, scorpion_ay8910_r, scorpion_ay8910_w); /* extra ROM */ memory_install_read8_handler(space, 0x5800, 0x67ff, 0, 0, (read8_space_func)SMH_BANK(1)); @@ -2867,7 +2867,7 @@ static DRIVER_INIT( scorpion ) /* no background related */ // memory_install_write8_handler(space, 0x6803, 0x6803, 0, 0, (write8_space_func)SMH_NOP); - memory_install_read8_handler(cpu_get_address_space(machine->cpu[1], ADDRESS_SPACE_PROGRAM), 0x3000, 0x3000, 0, 0, scorpion_digitalker_intr_r); + memory_install_read8_handler(cputag_get_address_space(machine, "audiocpu", ADDRESS_SPACE_PROGRAM), 0x3000, 0x3000, 0, 0, scorpion_digitalker_intr_r); /* { const UINT8 *rom = memory_region(machine, "speech"); diff --git a/src/mame/drivers/galpani2.c b/src/mame/drivers/galpani2.c index 8c7c4a3be76..4a5b456881f 100644 --- a/src/mame/drivers/galpani2.c +++ b/src/mame/drivers/galpani2.c @@ -229,8 +229,8 @@ static void galpani2_mcu_nmi1(running_machine *machine) static void galpani2_mcu_nmi2(running_machine *machine) { - galpani2_write_kaneko(machine->cpu[0]); - //logerror("%s : MCU executes CHECKs synchro\n",cpuexec_describe_context(machine)); + galpani2_write_kaneko(cputag_get_cpu(machine, "maincpu")); + //logerror("%s : MCU executes CHECKs synchro\n", cpuexec_describe_context(machine)); } static WRITE8_HANDLER( galpani2_mcu_nmi1_w ) //driven by CPU1's int5 ISR diff --git a/src/mame/drivers/gaplus.c b/src/mame/drivers/gaplus.c index 6a5bc503b95..436bdd8e9ff 100644 --- a/src/mame/drivers/gaplus.c +++ b/src/mame/drivers/gaplus.c @@ -255,40 +255,40 @@ static WRITE8_DEVICE_HANDLER( gaplus_snd_sharedram_w ) static WRITE8_HANDLER( gaplus_irq_1_ctrl_w ) { - int bit = !BIT(offset,11); - cpu_interrupt_enable(space->machine->cpu[0],bit); + int bit = !BIT(offset, 11); + cpu_interrupt_enable(cputag_get_cpu(space->machine, "maincpu"), bit); if (!bit) - cpu_set_input_line(space->machine->cpu[0], 0, CLEAR_LINE); + cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE); } static WRITE8_HANDLER( gaplus_irq_3_ctrl_w ) { - int bit = !BIT(offset,13); - cpu_interrupt_enable(space->machine->cpu[2],bit); + int bit = !BIT(offset, 13); + cpu_interrupt_enable(cputag_get_cpu(space->machine, "sub2"), bit); if (!bit) - cpu_set_input_line(space->machine->cpu[2], 0, CLEAR_LINE); + cputag_set_input_line(space->machine, "sub2", 0, CLEAR_LINE); } static WRITE8_HANDLER( gaplus_irq_2_ctrl_w ) { int bit = offset & 1; - cpu_interrupt_enable(space->machine->cpu[1],bit); + cpu_interrupt_enable(cputag_get_cpu(space->machine, "sub"), bit); if (!bit) - cpu_set_input_line(space->machine->cpu[1], 0, CLEAR_LINE); + cputag_set_input_line(space->machine, "sub", 0, CLEAR_LINE); } static WRITE8_HANDLER( gaplus_sreset_w ) { - int bit = !BIT(offset,11); - cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); - cpu_set_input_line(space->machine->cpu[2], INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); + int bit = !BIT(offset, 11); + cputag_set_input_line(space->machine, "sub", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); + cputag_set_input_line(space->machine, "sub2", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE); mappy_sound_enable(devtag_get_device(space->machine, "namco"), bit); } static WRITE8_HANDLER( gaplus_freset_w ) { - int bit = !BIT(offset,11); -logerror("%04x: freset %d\n",cpu_get_pc(space->cpu),bit); + int bit = !BIT(offset, 11); + logerror("%04x: freset %d\n",cpu_get_pc(space->cpu), bit); namcoio_set_reset_line(0, bit ? CLEAR_LINE : ASSERT_LINE); namcoio_set_reset_line(1, bit ? CLEAR_LINE : ASSERT_LINE); } @@ -296,17 +296,17 @@ logerror("%04x: freset %d\n",cpu_get_pc(space->cpu),bit); static MACHINE_RESET( gaplus ) { /* on reset, VINTON is reset, while the other flags don't seem to be affected */ - cpu_interrupt_enable(machine->cpu[1],0); - cpu_set_input_line(machine->cpu[1], 0, CLEAR_LINE); + cpu_interrupt_enable(cputag_get_cpu(machine, "sub"), 0); + cputag_set_input_line(machine, "sub", 0, CLEAR_LINE); } static INTERRUPT_GEN( gaplus_interrupt_1 ) { irq0_line_assert(device); // this also checks if irq is enabled - IMPORTANT! - // so don't replace with cpu_set_input_line(machine->cpu[0], 0, ASSERT_LINE); + // so don't replace with cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE); - namcoio_set_irq_line(device->machine,0,PULSE_LINE); - namcoio_set_irq_line(device->machine,1,PULSE_LINE); + namcoio_set_irq_line(device->machine, 0, PULSE_LINE); + namcoio_set_irq_line(device->machine, 1, PULSE_LINE); } diff --git a/src/mame/drivers/gsword.c b/src/mame/drivers/gsword.c index 70920ed9435..ecb263af2ec 100644 --- a/src/mame/drivers/gsword.c +++ b/src/mame/drivers/gsword.c @@ -359,8 +359,8 @@ static WRITE8_DEVICE_HANDLER( gsword_adpcm_data_w ) static WRITE8_HANDLER( adpcm_soundcommand_w ) { - soundlatch_w(space,0,data); - cpu_set_input_line(space->machine->cpu[2], INPUT_LINE_NMI, PULSE_LINE); + soundlatch_w(space, 0, data); + cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE); } static ADDRESS_MAP_START( cpu1_map, ADDRESS_SPACE_PROGRAM , 8 ) @@ -943,7 +943,7 @@ static DRIVER_INIT( gsword ) #endif #if 1 /* hack for sound protection or time out function */ - memory_install_read8_handler(cpu_get_address_space(machine->cpu[1], ADDRESS_SPACE_PROGRAM), 0x4004, 0x4005, 0, 0, gsword_hack_r); + memory_install_read8_handler(cputag_get_address_space(machine, "sub", ADDRESS_SPACE_PROGRAM), 0x4004, 0x4005, 0, 0, gsword_hack_r); #endif } @@ -958,7 +958,7 @@ static DRIVER_INIT( gsword2 ) #endif #if 1 /* hack for sound protection or time out function */ - memory_install_read8_handler(cpu_get_address_space(machine->cpu[1], ADDRESS_SPACE_PROGRAM), 0x4004, 0x4005, 0, 0, gsword_hack_r); + memory_install_read8_handler(cputag_get_address_space(machine, "sub", ADDRESS_SPACE_PROGRAM), 0x4004, 0x4005, 0, 0, gsword_hack_r); #endif } diff --git a/src/mame/drivers/nmk16.c b/src/mame/drivers/nmk16.c index 6d56b7e9cef..e3bab79e776 100644 --- a/src/mame/drivers/nmk16.c +++ b/src/mame/drivers/nmk16.c @@ -215,8 +215,8 @@ static WRITE16_HANDLER ( ssmissin_sound_w ) { if (ACCESSING_BITS_0_7) { - soundlatch_w(space,0,data & 0xff); - cpu_set_input_line(space->machine->cpu[1],0, HOLD_LINE); + soundlatch_w(space, 0, data & 0xff); + cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE); } } @@ -275,7 +275,7 @@ static WRITE16_HANDLER( macross2_sound_reset_w ) { /* PCB behaviour verified by Corrado Tomaselli at MAME Italia Forum: every time music changes Z80 is resetted */ - cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_RESET, data ? CLEAR_LINE : ASSERT_LINE); + cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, data ? CLEAR_LINE : ASSERT_LINE); } static WRITE16_HANDLER( macross2_sound_command_w ) @@ -313,8 +313,8 @@ static WRITE16_HANDLER( afega_soundlatch_w ) { if (ACCESSING_BITS_0_7) { - soundlatch_w(space,0,data&0xff); - cpu_set_input_line(space->machine->cpu[1], 0, HOLD_LINE); + soundlatch_w(space, 0, data&0xff); + cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE); } } @@ -3463,7 +3463,7 @@ static const ym2203_interface ym2203_nmk004_interface = static void ym2203_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 = @@ -4583,8 +4583,8 @@ static DRIVER_INIT( bjtwin ) static READ16_HANDLER( vandykeb_r ) { return 0x0000; } static DRIVER_INIT (vandykeb) { - memory_install_read16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x08000e, 0x08000f, 0, 0, vandykeb_r ); - memory_install_write16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x08001e, 0x08001f, 0, 0, (write16_space_func)SMH_NOP ); + memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x08000e, 0x08000f, 0, 0, vandykeb_r ); + memory_install_write16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x08001e, 0x08001f, 0, 0, (write16_space_func)SMH_NOP ); } @@ -4807,7 +4807,7 @@ GFXDECODE_END static void irq_handler(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 ym2151_interface afega_ym2151_intf = @@ -6987,4 +6987,3 @@ GAME( 2001, firehawk, 0, firehawk, firehawk, 0, ORIENTATION_FLIP_Y // bee-oh board - different display / interrupt timing to others? GAME( 1991, manybloc, 0, manybloc, manybloc, 0, ROT270, "Bee-Oh", "Many Block", GAME_NO_COCKTAIL | GAME_IMPERFECT_SOUND ) - diff --git a/src/mame/drivers/suna8.c b/src/mame/drivers/suna8.c index 4b17711acaf..44aadc087df 100644 --- a/src/mame/drivers/suna8.c +++ b/src/mame/drivers/suna8.c @@ -1378,7 +1378,7 @@ GFXDECODE_END static void soundirq(const device_config *device, int state) { - cpu_set_input_line(device->machine->cpu[1], 0, state); + cputag_set_input_line(device->machine, "audiocpu", 0, state); } /* In games with only 2 CPUs, port A&B of the AY8910 are used @@ -1543,7 +1543,7 @@ static MACHINE_DRIVER_START( brickzn ) // MDRV_CPU_VBLANK_INT_HACK(brickzn_interrupt, 2) MDRV_CPU_VBLANK_INT("screen", irq0_line_hold) // nmi breaks ramtest but is needed! - MDRV_CPU_ADD("soundcpu", Z80, SUNA8_MASTER_CLOCK / 4) /* Z0840006PSC */ + MDRV_CPU_ADD("audiocpu", Z80, SUNA8_MASTER_CLOCK / 4) /* Z0840006PSC */ MDRV_CPU_PROGRAM_MAP(brickzn_sound_map) MDRV_CPU_ADD("pcm", Z80, SUNA8_MASTER_CLOCK / 4) /* Z0840006PSC */ @@ -1607,7 +1607,7 @@ static INTERRUPT_GEN( hardhea2_interrupt ) static MACHINE_RESET( hardhea2 ) { - 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); hardhea2_rambank_0_w(space,0,0); } @@ -2073,7 +2073,7 @@ ROM_START( brickzn ) ROM_LOAD( "brickzon.008", 0x10000, 0x20000, CRC(c61540ba) SHA1(08c0ede591b229427b910ca6bb904a6146110be8) ) ROM_LOAD( "brickzon.007", 0x30000, 0x20000, CRC(ceed12f1) SHA1(9006726b75a65455afb1194298bade8fa2207b4a) ) - ROM_REGION( 0x10000, "soundcpu", 0 ) /* Music Z80 Code */ + ROM_REGION( 0x10000, "audiocpu", 0 ) /* Music Z80 Code */ ROM_LOAD( "brickzon.010", 0x00000, 0x10000, CRC(4eba8178) SHA1(9a214a1acacdc124529bc9dde73a8e884fc70293) ) ROM_REGION( 0x10000, "pcm", 0 ) /* PCM Z80 Code */ @@ -2094,7 +2094,7 @@ ROM_START( brickzn3 ) ROM_LOAD( "38", 0x10000, 0x20000, CRC(e16216e8) SHA1(e88ae97e8a632823d5f1fe500954b6f6542407d5) ) ROM_LOAD( "brickzon.007", 0x30000, 0x20000, CRC(ceed12f1) SHA1(9006726b75a65455afb1194298bade8fa2207b4a) ) - ROM_REGION( 0x10000, "soundcpu", 0 ) /* Music Z80 Code */ + ROM_REGION( 0x10000, "audiocpu", 0 ) /* Music Z80 Code */ ROM_LOAD( "brickzon.010", 0x00000, 0x10000, CRC(4eba8178) SHA1(9a214a1acacdc124529bc9dde73a8e884fc70293) ) ROM_REGION( 0x10000, "pcm", 0 ) /* PCM Z80 Code */ @@ -2155,7 +2155,7 @@ ROM_START( hardhea2 ) ROM_LOAD( "hrd-hd12", 0x30000, 0x10000, CRC(35d13212) SHA1(2fd03077b89ec9e55d2758b7f9cada970f0bdd91) ) ROM_LOAD( "hrd-hd13", 0x40000, 0x10000, CRC(3225e7d7) SHA1(2da9d1ce182dab8d9e09772e6899676b84c7458c) ) - ROM_REGION( 0x10000, "soundcpu", 0 ) /* Music Z80 Code */ + ROM_REGION( 0x10000, "audiocpu", 0 ) /* Music Z80 Code */ ROM_LOAD( "hrd-hd14", 0x00000, 0x08000, CRC(79a3be51) SHA1(30bc67cd3a936615c6931f8e15953425dff59611) ) ROM_REGION( 0x10000, "pcm", 0 ) /* PCM Z80 Code */ diff --git a/src/mame/drivers/toaplan2.c b/src/mame/drivers/toaplan2.c index 670f5add1e7..b6f66625174 100644 --- a/src/mame/drivers/toaplan2.c +++ b/src/mame/drivers/toaplan2.c @@ -317,7 +317,7 @@ static MACHINE_RESET( toaplan2 ) This is important for games with common RAM; the RAM test will fail when leaving service mode if the sound CPU is not reset. */ - m68k_set_reset_callback(machine->cpu[0], toaplan2_reset); + m68k_set_reset_callback(cputag_get_cpu(machine, "maincpu"), toaplan2_reset); } static MACHINE_RESET( ghox ) @@ -394,7 +394,7 @@ static DRIVER_INIT( fixeight ) #if USE_V25 #else - memory_install_readwrite16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x28f002, 0x28fbff, 0, 0, (read16_space_func)SMH_BANK(2), (write16_space_func)SMH_BANK(2) ); + memory_install_readwrite16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x28f002, 0x28fbff, 0, 0, (read16_space_func)SMH_BANK(2), (write16_space_func)SMH_BANK(2) ); memory_set_bankptr(machine, 2, fixeight_sec_cpu_mem); #endif @@ -529,7 +529,7 @@ static READ16_HANDLER( toaplan2_inputport_0_word_r ) static TIMER_CALLBACK( toaplan2_raise_irq ) { - cpu_set_input_line(machine->cpu[0], param, HOLD_LINE); + cputag_set_input_line(machine, "maincpu", param, HOLD_LINE); } static void toaplan2_vblank_irq(running_machine *machine, int irq_line) @@ -1157,14 +1157,14 @@ static WRITE16_HANDLER( raizing_clear_sndirq_w ) { // not sure whether this is correct // the 68K writes here during the sound IRQ handler, and nowhere else... - cpu_set_input_line(space->machine->cpu[0], raizing_sndirq_line, CLEAR_LINE); + cputag_set_input_line(space->machine, "maincpu", raizing_sndirq_line, CLEAR_LINE); } static WRITE8_HANDLER( raizing_sndirq_w ) { // if raizing_clear_sndirq_w() is correct, should this be ASSERT_LINE? - cpu_set_input_line(space->machine->cpu[0], raizing_sndirq_line, HOLD_LINE); + cputag_set_input_line(space->machine, "maincpu", raizing_sndirq_line, HOLD_LINE); } diff --git a/src/mame/drivers/tumbleb.c b/src/mame/drivers/tumbleb.c index 84a053452e9..a0d599bd6a5 100644 --- a/src/mame/drivers/tumbleb.c +++ b/src/mame/drivers/tumbleb.c @@ -352,14 +352,14 @@ static READ16_HANDLER( tumblepb_prot_r ) static WRITE16_HANDLER( tumblepb_sound_w ) { soundlatch_w(space,0,data & 0xff); - cpu_set_input_line(space->machine->cpu[1],0,HOLD_LINE); + cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE); } #endif static WRITE16_HANDLER( jumppop_sound_w ) { soundlatch_w(space,0,data & 0xff); - cpu_set_input_line(space->machine->cpu[1], 0, ASSERT_LINE ); + cputag_set_input_line(space->machine, "audiocpu", 0, ASSERT_LINE ); } /******************************************************************************/ @@ -750,8 +750,8 @@ ADDRESS_MAP_END static WRITE16_HANDLER( jumpkids_sound_w ) { - soundlatch_w(space,0,data & 0xff); - cpu_set_input_line(space->machine->cpu[1],0,HOLD_LINE); + soundlatch_w(space, 0, data & 0xff); + cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE); } @@ -835,7 +835,7 @@ ADDRESS_MAP_END static READ8_HANDLER(jumppop_z80latch_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, 0); } @@ -2121,7 +2121,7 @@ MACHINE_DRIVER_END static void semicom_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); } @@ -3292,7 +3292,7 @@ static DRIVER_INIT( tumbleb2 ) tumblepb_patch_code(machine, 0x000132); #endif - memory_install_write16_device_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), oki, 0x100000, 0x100001, 0, 0, tumbleb2_soundmcu_w ); + memory_install_write16_device_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), oki, 0x100000, 0x100001, 0, 0, tumbleb2_soundmcu_w ); } @@ -3333,7 +3333,7 @@ static READ16_HANDLER( bcstory_1a0_read ) static DRIVER_INIT ( bcstory ) { tumblepb_gfx1_rearrange(machine); - memory_install_read16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x180008, 0x180009, 0, 0, bcstory_1a0_read ); // io should be here?? + memory_install_read16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x180008, 0x180009, 0, 0, bcstory_1a0_read ); // io should be here?? } @@ -3574,7 +3574,7 @@ static DRIVER_INIT( htchctch ) HCROM[0x1e228/2] = 0x4e75; - memory_install_write16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x140000, 0x1407ff, 0, 0, (write16_space_func)SMH_NOP ); // kill palette writes as the interrupt code we don't have controls them + memory_install_write16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x140000, 0x1407ff, 0, 0, (write16_space_func)SMH_NOP ); // kill palette writes as the interrupt code we don't have controls them { @@ -3640,10 +3640,10 @@ static DRIVER_INIT( chokchok ) DRIVER_INIT_CALL(htchctch); /* different palette format, closer to tumblep -- is this controlled by a register? the palette was right with the hatch catch trojan */ - memory_install_write16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x140000, 0x140fff, 0, 0, paletteram16_xxxxBBBBGGGGRRRR_word_w); + memory_install_write16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x140000, 0x140fff, 0, 0, paletteram16_xxxxBBBBGGGGRRRR_word_w); /* slightly different banking */ - memory_install_write16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x100002, 0x100003, 0, 0, chokchok_tilebank_w); + memory_install_write16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x100002, 0x100003, 0, 0, chokchok_tilebank_w); } static DRIVER_INIT( wlstar ) @@ -3651,7 +3651,7 @@ static DRIVER_INIT( wlstar ) DRIVER_INIT_CALL(htchctch); /* slightly different banking */ - memory_install_write16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x100002, 0x100003, 0, 0, wlstar_tilebank_w); + memory_install_write16_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x100002, 0x100003, 0, 0, wlstar_tilebank_w); } static DRIVER_INIT ( dquizgo ) diff --git a/src/mame/drivers/tumblep.c b/src/mame/drivers/tumblep.c index 5bd8fcf864d..8887c69d0d1 100644 --- a/src/mame/drivers/tumblep.c +++ b/src/mame/drivers/tumblep.c @@ -72,15 +72,15 @@ static READ16_HANDLER( tumblep_prot_r ) static WRITE16_HANDLER( tumblep_sound_w ) { - soundlatch_w(space,0,data & 0xff); - cpu_set_input_line(space->machine->cpu[1],0,HOLD_LINE); + soundlatch_w(space, 0, data & 0xff); + cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE); } #ifdef UNUSED_FUNCTION static WRITE16_HANDLER( jumppop_sound_w ) { - soundlatch_w(space,0,data & 0xff); - cpu_set_input_line(space->machine->cpu[1], 0, ASSERT_LINE ); + soundlatch_w(space, 0, data & 0xff); + cputag_set_input_line(space->machine, "audiocpu", 0, ASSERT_LINE ); } #endif @@ -276,7 +276,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 const ym2151_interface ym2151_config = diff --git a/src/mame/machine/galaxold.c b/src/mame/machine/galaxold.c index 8fa691f087c..13b5943d568 100644 --- a/src/mame/machine/galaxold.c +++ b/src/mame/machine/galaxold.c @@ -27,7 +27,7 @@ static void galaxold_7474_9M_2_callback(running_machine *machine) static void galaxold_7474_9M_1_callback(running_machine *machine) { /* Q goes to the NMI line */ - cpu_set_input_line(machine->cpu[0], irq_line, TTL7474_output_r(1) ? CLEAR_LINE : ASSERT_LINE); + cputag_set_input_line(machine, "maincpu", irq_line, TTL7474_output_r(1) ? CLEAR_LINE : ASSERT_LINE); } static const struct TTL7474_interface galaxold_7474_9M_2_intf = @@ -209,7 +209,7 @@ DRIVER_INIT( dingoe ) rom[i] = BITSWAP8(rom[i],7,6,5,0,3,2,1,4); } - memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x3001, 0x3001, 0, 0, dingoe_3001_r); /* Protection check */ + memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x3001, 0x3001, 0, 0, dingoe_3001_r); /* Protection check */ } @@ -256,19 +256,19 @@ CUSTOM_INPUT( _4in1_fake_port_r ) DRIVER_INIT( pisces ) { /* the coin lockout was replaced */ - memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x6002, 0x6002, 0, 0, galaxold_gfxbank_w); + memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x6002, 0x6002, 0, 0, galaxold_gfxbank_w); } DRIVER_INIT( checkmaj ) { /* for the title screen */ - memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x3800, 0x3800, 0, 0, checkmaj_protection_r); + memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x3800, 0x3800, 0, 0, checkmaj_protection_r); } DRIVER_INIT( dingo ) { - memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x3000, 0x3000, 0, 0, dingo_3000_r); - memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x3035, 0x3035, 0, 0, dingo_3035_r); + memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x3000, 0x3000, 0, 0, dingo_3000_r); + memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x3035, 0x3035, 0, 0, dingo_3035_r); } @@ -286,7 +286,7 @@ static UINT8 decode_mooncrst(UINT8 data,offs_t addr) DRIVER_INIT( mooncrsu ) { - memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xa000, 0xa002, 0, 0, galaxold_gfxbank_w); + memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xa000, 0xa002, 0, 0, galaxold_gfxbank_w); } DRIVER_INIT( mooncrst ) @@ -303,7 +303,7 @@ DRIVER_INIT( mooncrst ) DRIVER_INIT( mooncrgx ) { - memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x6000, 0x6002, 0, 0, galaxold_gfxbank_w); + memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x6000, 0x6002, 0, 0, galaxold_gfxbank_w); } DRIVER_INIT( moonqsr ) @@ -386,7 +386,7 @@ Pin layout is such that links can replace the PAL if encryption is not used. DRIVER_INIT( 4in1 ) { - 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); offs_t i, len = memory_region_length(machine, "maincpu"); UINT8 *RAM = memory_region(machine, "maincpu"); @@ -410,5 +410,5 @@ INTERRUPT_GEN( hunchbks_vh_interrupt ) DRIVER_INIT( ladybugg ) { /* Doesn't actually use the bank, but it mustn't have a coin lock! */ -memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x6002, 0x6002, 0, 0, galaxold_gfxbank_w); +memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x6002, 0x6002, 0, 0, galaxold_gfxbank_w); } diff --git a/src/mame/machine/psx.c b/src/mame/machine/psx.c index da3950378e8..7aeaf3d3f45 100644 --- a/src/mame/machine/psx.c +++ b/src/mame/machine/psx.c @@ -64,12 +64,12 @@ static void psx_irq_update( running_machine *machine ) if( ( m_n_irqdata & m_n_irqmask ) != 0 ) { verboselog( machine, 2, "psx irq assert\n" ); - cpu_set_input_line(machine->cpu[0], PSXCPU_IRQ0, ASSERT_LINE ); + cputag_set_input_line(machine, "maincpu", PSXCPU_IRQ0, ASSERT_LINE ); } else { verboselog( machine, 2, "psx irq clear\n" ); - cpu_set_input_line(machine->cpu[0], PSXCPU_IRQ0, CLEAR_LINE ); + cputag_set_input_line(machine, "maincpu", PSXCPU_IRQ0, CLEAR_LINE ); } } @@ -485,7 +485,7 @@ static UINT64 m_p_n_root_start[ 3 ]; static UINT64 psxcpu_gettotalcycles( running_machine *machine ) { /* TODO: should return the start of the current tick. */ - return cpu_get_total_cycles(machine->cpu[0]) * 2; + return cpu_get_total_cycles(cputag_get_cpu(machine, "maincpu")) * 2; } static int root_divider( int n_counter ) diff --git a/src/mame/video/psx.c b/src/mame/video/psx.c index 61eceaf735f..ed415b0f054 100644 --- a/src/mame/video/psx.c +++ b/src/mame/video/psx.c @@ -3921,7 +3921,7 @@ INTERRUPT_GEN( psx_vblank ) void psx_gpu_reset( running_machine *machine ) { - 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); psx_gpu_w(space, 1, 0, 0xffffffff ); }