From c96889730f23cb7635a99c433a7af3b9191f7b05 Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Sat, 13 Jul 2013 07:19:46 +0000 Subject: [PATCH] Resolve devices specified for vblank/periodic interrupts relative to the owner device, not the device itself, to make it consistent with devcb2 patterns. This change is mostly hidden since most drivers use MCFG_DEVICE_VBLANK_INT_DRIVER and MCFG_DEVICE_PERIODIC_INT_DRIVER. But for those few cases where a device was explicitly specified, it reduces the awkwardness. We should probably standardize this when using device_delegates for consistency. A full rebuild is necessary after taking this change, since the macros mentioned above have changed their parameters. --- src/emu/diexec.c | 4 ++-- src/emu/diexec.h | 4 ++-- src/mame/audio/atarijsa.c | 8 ++++---- src/mame/audio/midway.c | 2 +- src/mame/drivers/atarisy2.c | 2 +- src/mame/drivers/cyberbal.c | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/emu/diexec.c b/src/emu/diexec.c index 887b499a8d4..34d5025d677 100644 --- a/src/emu/diexec.c +++ b/src/emu/diexec.c @@ -532,8 +532,8 @@ void device_execute_interface::interface_validity_check(validity_checker &valid) void device_execute_interface::interface_pre_start() { // bind delegates - m_vblank_interrupt.bind_relative_to(device()); - m_timed_interrupt.bind_relative_to(device()); + m_vblank_interrupt.bind_relative_to(*device().owner()); + m_timed_interrupt.bind_relative_to(*device().owner()); m_driver_irq.bind_relative_to(device()); // fill in the initial states diff --git a/src/emu/diexec.h b/src/emu/diexec.h index 86f5078572f..3b82da24d72 100644 --- a/src/emu/diexec.h +++ b/src/emu/diexec.h @@ -119,13 +119,13 @@ enum #define MCFG_DEVICE_VBLANK_INT(_tag, _func) \ device_execute_interface::static_set_vblank_int(*device, _func, _tag); #define MCFG_DEVICE_VBLANK_INT_DRIVER(_tag, _class, _func) \ - device_execute_interface::static_set_vblank_int(*device, device_interrupt_delegate(&_class::_func, #_class "::" #_func, DEVICE_SELF_OWNER, (_class *)0), _tag); + device_execute_interface::static_set_vblank_int(*device, device_interrupt_delegate(&_class::_func, #_class "::" #_func, DEVICE_SELF, (_class *)0), _tag); #define MCFG_DEVICE_VBLANK_INT_DEVICE(_devtag, _tag, _class, _func) \ device_execute_interface::static_set_vblank_int(*device, device_interrupt_delegate(&_class::_func, #_class "::" #_func, _devtag, (_class *)0), _tag); #define MCFG_DEVICE_PERIODIC_INT(_func, _rate) \ device_execute_interface::static_set_periodic_int(*device, _func, attotime::from_hz(_rate)); #define MCFG_DEVICE_PERIODIC_INT_DRIVER(_class, _func, _rate) \ - device_execute_interface::static_set_periodic_int(*device, device_interrupt_delegate(&_class::_func, #_class "::" #_func, DEVICE_SELF_OWNER, (_class *)0), attotime::from_hz(_rate)); + device_execute_interface::static_set_periodic_int(*device, device_interrupt_delegate(&_class::_func, #_class "::" #_func, DEVICE_SELF, (_class *)0), attotime::from_hz(_rate)); #define MCFG_DEVICE_PERIODIC_INT_DEVICE(_devtag, _class, _func, _rate) \ device_execute_interface::static_set_periodic_int(*device, device_interrupt_delegate(&_class::_func, #_class "::" #_func, _devtag, (_class *)0), attotime::from_hz(_rate)); diff --git a/src/mame/audio/atarijsa.c b/src/mame/audio/atarijsa.c index 010c46c9aed..c285ef5bc80 100644 --- a/src/mame/audio/atarijsa.c +++ b/src/mame/audio/atarijsa.c @@ -795,7 +795,7 @@ MACHINE_CONFIG_FRAGMENT( jsa_i_stereo ) /* basic machine hardware */ MCFG_CPU_ADD("jsa", M6502, JSA_MASTER_CLOCK/2) MCFG_CPU_PROGRAM_MAP(atarijsa1_map) - MCFG_DEVICE_PERIODIC_INT_DEVICE("^soundcomm", atari_sound_comm_device, sound_irq_gen, (double)JSA_MASTER_CLOCK/4/16/16/14) + MCFG_DEVICE_PERIODIC_INT_DEVICE("soundcomm", atari_sound_comm_device, sound_irq_gen, (double)JSA_MASTER_CLOCK/4/16/16/14) /* sound hardware */ MCFG_ATARI_SOUND_COMM_ADD("soundcomm", "jsa", WRITELINE(atarigen_state, sound_int_write_line)) @@ -840,7 +840,7 @@ MACHINE_CONFIG_FRAGMENT( jsa_i_mono_speech ) /* basic machine hardware */ MCFG_CPU_ADD("jsa", M6502, JSA_MASTER_CLOCK/2) MCFG_CPU_PROGRAM_MAP(atarijsa1_map) - MCFG_DEVICE_PERIODIC_INT_DEVICE("^soundcomm", atari_sound_comm_device, sound_irq_gen, (double)JSA_MASTER_CLOCK/4/16/16/14) + MCFG_DEVICE_PERIODIC_INT_DEVICE("soundcomm", atari_sound_comm_device, sound_irq_gen, (double)JSA_MASTER_CLOCK/4/16/16/14) /* sound hardware */ MCFG_ATARI_SOUND_COMM_ADD("soundcomm", "jsa", WRITELINE(atarigen_state, sound_int_write_line)) @@ -863,7 +863,7 @@ MACHINE_CONFIG_FRAGMENT( jsa_ii_mono ) /* basic machine hardware */ MCFG_CPU_ADD("jsa", M6502, JSA_MASTER_CLOCK/2) MCFG_CPU_PROGRAM_MAP(atarijsa2_map) - MCFG_DEVICE_PERIODIC_INT_DEVICE("^soundcomm", atari_sound_comm_device, sound_irq_gen, (double)JSA_MASTER_CLOCK/4/16/16/14) + MCFG_DEVICE_PERIODIC_INT_DEVICE("soundcomm", atari_sound_comm_device, sound_irq_gen, (double)JSA_MASTER_CLOCK/4/16/16/14) /* sound hardware */ MCFG_ATARI_SOUND_COMM_ADD("soundcomm", "jsa", WRITELINE(atarigen_state, sound_int_write_line)) @@ -908,7 +908,7 @@ MACHINE_CONFIG_FRAGMENT( jsa_iiis_stereo ) /* basic machine hardware */ MCFG_CPU_ADD("jsa", M6502, JSA_MASTER_CLOCK/2) MCFG_CPU_PROGRAM_MAP(atarijsa3s_map) - MCFG_DEVICE_PERIODIC_INT_DEVICE("^soundcomm", atari_sound_comm_device, sound_irq_gen, (double)JSA_MASTER_CLOCK/4/16/16/14) + MCFG_DEVICE_PERIODIC_INT_DEVICE("soundcomm", atari_sound_comm_device, sound_irq_gen, (double)JSA_MASTER_CLOCK/4/16/16/14) /* sound hardware */ MCFG_ATARI_SOUND_COMM_ADD("soundcomm", "jsa", WRITELINE(atarigen_state, sound_int_write_line)) diff --git a/src/mame/audio/midway.c b/src/mame/audio/midway.c index 3b7c3eb3a69..3a938890d65 100644 --- a/src/mame/audio/midway.c +++ b/src/mame/audio/midway.c @@ -436,7 +436,7 @@ ADDRESS_MAP_END static MACHINE_CONFIG_FRAGMENT( midway_ssio ) MCFG_CPU_ADD("cpu", Z80, SSIO_CLOCK/2/4) MCFG_CPU_PROGRAM_MAP(ssio_map) - MCFG_DEVICE_PERIODIC_INT_DEVICE(DEVICE_SELF_OWNER, midway_ssio_device, clock_14024, SSIO_CLOCK/2/16/10) + MCFG_DEVICE_PERIODIC_INT_DEVICE(DEVICE_SELF, midway_ssio_device, clock_14024, SSIO_CLOCK/2/16/10) MCFG_SOUND_ADD("ay0", AY8910, SSIO_CLOCK/2/4) MCFG_SOUND_CONFIG(ssio_ay8910_interface_1) diff --git a/src/mame/drivers/atarisy2.c b/src/mame/drivers/atarisy2.c index 2c11ec42857..5d24b112ec0 100644 --- a/src/mame/drivers/atarisy2.c +++ b/src/mame/drivers/atarisy2.c @@ -1238,7 +1238,7 @@ static MACHINE_CONFIG_START( atarisy2, atarisy2_state ) MCFG_CPU_ADD("audiocpu", M6502, SOUND_CLOCK/8) MCFG_CPU_PROGRAM_MAP(sound_map) - MCFG_DEVICE_PERIODIC_INT_DEVICE("^soundcomm", atari_sound_comm_device, sound_irq_gen, (double)MASTER_CLOCK/2/16/16/16/10) + MCFG_DEVICE_PERIODIC_INT_DEVICE("soundcomm", atari_sound_comm_device, sound_irq_gen, (double)MASTER_CLOCK/2/16/16/16/10) MCFG_MACHINE_START_OVERRIDE(atarisy2_state,atarisy2) MCFG_MACHINE_RESET_OVERRIDE(atarisy2_state,atarisy2) diff --git a/src/mame/drivers/cyberbal.c b/src/mame/drivers/cyberbal.c index 1b628a189f9..ab424b31bd7 100644 --- a/src/mame/drivers/cyberbal.c +++ b/src/mame/drivers/cyberbal.c @@ -409,7 +409,7 @@ static MACHINE_CONFIG_START( cyberbal, cyberbal_state ) MCFG_CPU_ADD("audiocpu", M6502, ATARI_CLOCK_14MHz/8) MCFG_CPU_PROGRAM_MAP(sound_map) - MCFG_DEVICE_PERIODIC_INT_DEVICE("^soundcomm", atari_sound_comm_device, sound_irq_gen, (double)ATARI_CLOCK_14MHz/4/4/16/16/14) + MCFG_DEVICE_PERIODIC_INT_DEVICE("soundcomm", atari_sound_comm_device, sound_irq_gen, (double)ATARI_CLOCK_14MHz/4/4/16/16/14) MCFG_CPU_ADD("extra", M68000, ATARI_CLOCK_14MHz/2) MCFG_CPU_PROGRAM_MAP(extra_map)