From ca876a8a0abd93268f2356f0d22afb8b49d50718 Mon Sep 17 00:00:00 2001 From: Fabio Priuli Date: Tue, 5 May 2009 09:08:33 +0000 Subject: [PATCH] Made a few more number-to-tag conversions. Also, removed chd.h includes from cps2.c (leftover of pre-decrypt versions, I guess) --- src/mame/audio/cyberbal.c | 6 +++--- src/mame/audio/exidy.c | 4 ++-- src/mame/audio/n8080.c | 6 +++--- src/mame/drivers/cps2.c | 1 - src/mame/drivers/segac2.c | 1 - src/mame/machine/asic65.c | 2 +- src/mame/machine/cps2crpt.c | 2 +- src/mame/machine/deco102.c | 10 +++++----- src/mame/machine/seicop.c | 8 ++++---- src/mame/video/gtia.c | 2 +- src/mame/video/toaplan2.c | 2 +- 11 files changed, 21 insertions(+), 23 deletions(-) diff --git a/src/mame/audio/cyberbal.c b/src/mame/audio/cyberbal.c index 76790a2c35b..29570ba322d 100644 --- a/src/mame/audio/cyberbal.c +++ b/src/mame/audio/cyberbal.c @@ -63,7 +63,7 @@ WRITE8_HANDLER( cyberbal_sound_bank_select_w ) memory_set_bankptr(space->machine, 8, &bank_base[0x1000 * ((data >> 6) & 3)]); coin_counter_w(1, (data >> 5) & 1); coin_counter_w(0, (data >> 4) & 1); - cpu_set_input_line(space->machine->cpu[3], INPUT_LINE_RESET, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE); + cputag_set_input_line(space->machine, "dac", INPUT_LINE_RESET, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE); if (!(data & 0x01)) devtag_reset(space->machine, "ym"); } @@ -97,8 +97,8 @@ WRITE8_HANDLER( cyberbal_sound_68k_6502_w ) static void update_sound_68k_interrupts(running_machine *machine) { - cpu_set_input_line(machine->cpu[3], 6, fast_68k_int ? ASSERT_LINE : CLEAR_LINE); - cpu_set_input_line(machine->cpu[3], 2, io_68k_int ? ASSERT_LINE : CLEAR_LINE); + cputag_set_input_line(machine, "dac", 6, fast_68k_int ? ASSERT_LINE : CLEAR_LINE); + cputag_set_input_line(machine, "dac", 2, io_68k_int ? ASSERT_LINE : CLEAR_LINE); } diff --git a/src/mame/audio/exidy.c b/src/mame/audio/exidy.c index cb3022a6b92..20746027d03 100644 --- a/src/mame/audio/exidy.c +++ b/src/mame/audio/exidy.c @@ -114,7 +114,7 @@ static double freq_to_step; static WRITE_LINE_DEVICE_HANDLER( update_irq_state ) { const device_config *pia = devtag_get_device(device->machine, "pia1"); - cpu_set_input_line(device->machine->cpu[1], M6502_IRQ_LINE, (pia6821_get_irq_b(pia) | riot_irq_state) ? ASSERT_LINE : CLEAR_LINE); + cputag_set_input_line(device->machine, "audiocpu", M6502_IRQ_LINE, (pia6821_get_irq_b(pia) | riot_irq_state) ? ASSERT_LINE : CLEAR_LINE); } @@ -462,7 +462,7 @@ static void r6532_irq(const device_config *device, int state) static void r6532_porta_w(const device_config *device, UINT8 newdata, UINT8 olddata) { if (has_mc3417) - cpu_set_input_line(device->machine->cpu[2], INPUT_LINE_RESET, (newdata & 0x10) ? CLEAR_LINE : ASSERT_LINE); + cputag_set_input_line(device->machine, "cvsd", INPUT_LINE_RESET, (newdata & 0x10) ? CLEAR_LINE : ASSERT_LINE); } diff --git a/src/mame/audio/n8080.c b/src/mame/audio/n8080.c index e8795d46e44..6fa7f40f945 100644 --- a/src/mame/audio/n8080.c +++ b/src/mame/audio/n8080.c @@ -201,7 +201,7 @@ static void spacefev_sound_pins_changed(running_machine *machine) } if (changes & ((1 << 0x2) | (1 << 0x3) | (1 << 0x5))) { - generic_pulse_irq_line(machine->cpu[1], 0); + generic_pulse_irq_line(cputag_get_cpu(machine, "audiocpu"), 0); } } @@ -225,7 +225,7 @@ static void sheriff_sound_pins_changed(running_machine *machine) } if (changes & ((1 << 0x2) | (1 << 0x3) | (1 << 0x5))) { - generic_pulse_irq_line(machine->cpu[1], 0); + generic_pulse_irq_line(cputag_get_cpu(machine, "audiocpu"), 0); } } @@ -240,7 +240,7 @@ static void helifire_sound_pins_changed(running_machine *machine) if (changes & (1 << 6)) { - generic_pulse_irq_line(machine->cpu[1], 0); + generic_pulse_irq_line(cputag_get_cpu(machine, "audiocpu"), 0); } } diff --git a/src/mame/drivers/cps2.c b/src/mame/drivers/cps2.c index c6ad5177fe9..8a0111412e5 100644 --- a/src/mame/drivers/cps2.c +++ b/src/mame/drivers/cps2.c @@ -590,7 +590,6 @@ Stephh's inputs notes (based on some tests on the "parent" set) : #include "cpu/m68000/m68000.h" #include "sound/qsound.h" #include "sound/okim6295.h" // gigamn2 bootleg -#include "chd.h" #include "cps1.h" /* External CPS1 definitions */ diff --git a/src/mame/drivers/segac2.c b/src/mame/drivers/segac2.c index 03c1476a47f..13acbbe5742 100644 --- a/src/mame/drivers/segac2.c +++ b/src/mame/drivers/segac2.c @@ -68,7 +68,6 @@ #include "driver.h" #include "cpu/m68000/m68000.h" -//#include "genesis.h" #include "megadriv.h" #include "sound/okim6295.h" #include "sound/sn76496.h" diff --git a/src/mame/machine/asic65.c b/src/mame/machine/asic65.c index 4d69c069cdf..5b6843af1b4 100644 --- a/src/mame/machine/asic65.c +++ b/src/mame/machine/asic65.c @@ -145,7 +145,7 @@ void asic65_config(running_machine *machine, int asictype) void asic65_reset(running_machine *machine, int state) { - 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); /* rom-based means reset and clear states */ if (asic65.cpu != NULL) diff --git a/src/mame/machine/cps2crpt.c b/src/mame/machine/cps2crpt.c index 7551f61f22a..671fb7e8cc4 100644 --- a/src/mame/machine/cps2crpt.c +++ b/src/mame/machine/cps2crpt.c @@ -721,7 +721,7 @@ static void cps2_decrypt(running_machine *machine, const UINT32 *master_key, UIN } memory_set_decrypted_region(space, 0x000000, length - 1, dec); - m68k_set_encrypted_opcode_range(machine->cpu[0],0,length); + m68k_set_encrypted_opcode_range(cputag_get_cpu(machine, "maincpu"), 0, length); } diff --git a/src/mame/machine/deco102.c b/src/mame/machine/deco102.c index 75a8344336f..9dcb9429009 100644 --- a/src/mame/machine/deco102.c +++ b/src/mame/machine/deco102.c @@ -53,15 +53,15 @@ void deco102_decrypt_cpu(running_machine *machine, const char *cputag, int addre const address_space *space = cputag_get_address_space(machine, cputag, ADDRESS_SPACE_PROGRAM); UINT16 *rom = (UINT16 *)memory_region(machine, cputag); int size = memory_region_length(machine, cputag); - UINT16 *opcodes = auto_alloc_array(machine, UINT16, size/2); - UINT16 *buf = alloc_array_or_die(UINT16, size/2); + UINT16 *opcodes = auto_alloc_array(machine, UINT16, size / 2); + UINT16 *buf = alloc_array_or_die(UINT16, size / 2); - memcpy(buf,rom,size); + memcpy(buf, rom, size); memory_set_decrypted_region(space, 0, size - 1, opcodes); - m68k_set_encrypted_opcode_range(machine->cpu[0],0,size); + m68k_set_encrypted_opcode_range(cputag_get_cpu(machine, cputag), 0, size); - for (i = 0;i < size/2;i++) + for (i = 0; i < size / 2; i++) { int src; diff --git a/src/mame/machine/seicop.c b/src/mame/machine/seicop.c index 774a9248c40..daab5c649ec 100644 --- a/src/mame/machine/seicop.c +++ b/src/mame/machine/seicop.c @@ -871,8 +871,8 @@ WRITE16_HANDLER( copdxbl_0_w ) /*WRONG*/ case (0x65c/2): { - soundlatch_w(space,1,data&0xff); - cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_NMI, PULSE_LINE ); + soundlatch_w(space, 1, data & 0xff); + cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE ); break; } /*video regs (not scrollram,something else)*/ @@ -888,8 +888,8 @@ WRITE16_HANDLER( copdxbl_0_w ) /*bootleg sound HW*/ /*case (0x740/2): { - soundlatch_w(1,data&0x00ff); - cpu_set_input_line(space->machine->cpu[1], INPUT_LINE_NMI, PULSE_LINE ); + soundlatch_w(space, 1, data & 0x00ff); + cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE ); break; }*/ } diff --git a/src/mame/video/gtia.c b/src/mame/video/gtia.c index e09052e46e8..544558f2a84 100644 --- a/src/mame/video/gtia.c +++ b/src/mame/video/gtia.c @@ -154,7 +154,7 @@ static int is_ntsc(running_machine *machine) static void gtia_reset(running_machine *machine) { int i; - 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); /* reset the GTIA read/write/helper registers */ for (i = 0; i < 32; i++) diff --git a/src/mame/video/toaplan2.c b/src/mame/video/toaplan2.c index 6e16ae7eaa6..ad3e5bf82a5 100644 --- a/src/mame/video/toaplan2.c +++ b/src/mame/video/toaplan2.c @@ -1012,7 +1012,7 @@ static void toaplan2_scroll_reg_data_w(running_machine *machine, offs_t offset, if (ym && (sound_get_type(ym) == SOUND_YM3812)) { - cpu_set_input_line(machine->cpu[1], INPUT_LINE_RESET, PULSE_LINE); + cputag_set_input_line(machine, "audiocpu", INPUT_LINE_RESET, PULSE_LINE); devtag_reset(machine, "ym"); } }