From 7206ae51d0713d754d9d0a20c1f0383c57305be0 Mon Sep 17 00:00:00 2001 From: smf- Date: Sat, 26 Oct 2013 15:48:32 +0000 Subject: [PATCH] Hooked up DSP/GPU interrupt to tom that was missed when modernizing jaguar core in r24736. Fixes Area 51 issue mentioned in mametesters 05256, but 0.149u1 was released before the modernizing and maxf_ng still has the problem mentioned in the bug report. [smf] --- src/emu/cpu/jaguar/jaguar.h | 12 +++--------- src/mame/drivers/jaguar.c | 19 ++++--------------- src/mame/includes/jaguar.h | 4 ++-- src/mame/video/jaguar.c | 14 ++++++-------- 4 files changed, 15 insertions(+), 34 deletions(-) diff --git a/src/emu/cpu/jaguar/jaguar.h b/src/emu/cpu/jaguar/jaguar.h index 976ac582e41..780e96b98d4 100644 --- a/src/emu/cpu/jaguar/jaguar.h +++ b/src/emu/cpu/jaguar/jaguar.h @@ -70,17 +70,11 @@ enum /*************************************************************************** - CONFIGURATION STRUCTURE + CONFIGURATION ***************************************************************************/ -typedef void (*jaguar_int_func)(device_t *device); - - -struct jaguar_cpu_config -{ - jaguar_int_func cpu_int_callback; -}; - +#define MCFG_JAGUAR_IRQ_HANDLER(_devcb) \ + devcb = &jaguar_cpu_device::set_int_func(*device, DEVCB2_##_devcb); /*************************************************************************** diff --git a/src/mame/drivers/jaguar.c b/src/mame/drivers/jaguar.c index 823a5d31b5c..4d210327e2c 100644 --- a/src/mame/drivers/jaguar.c +++ b/src/mame/drivers/jaguar.c @@ -1530,17 +1530,6 @@ INPUT_PORTS_END * *************************************/ - static const jaguar_cpu_config gpu_config = -{ - &jaguar_state::gpu_cpu_int -}; - - -static const jaguar_cpu_config dsp_config = -{ - &jaguar_state::dsp_cpu_int -}; - static MACHINE_CONFIG_START( cojagr3k, jaguar_state ) /* basic machine hardware */ @@ -1549,11 +1538,11 @@ static MACHINE_CONFIG_START( cojagr3k, jaguar_state ) MCFG_CPU_PROGRAM_MAP(r3000_map) MCFG_CPU_ADD("gpu", JAGUARGPU, COJAG_CLOCK/2) - MCFG_CPU_CONFIG(gpu_config) + MCFG_JAGUAR_IRQ_HANDLER(WRITELINE(jaguar_state, gpu_cpu_int)) MCFG_CPU_PROGRAM_MAP(gpu_map) MCFG_CPU_ADD("dsp", JAGUARDSP, COJAG_CLOCK/2) - MCFG_CPU_CONFIG(dsp_config) + MCFG_JAGUAR_IRQ_HANDLER(WRITELINE(jaguar_state, dsp_cpu_int)) MCFG_CPU_PROGRAM_MAP(dsp_map) MCFG_NVRAM_ADD_1FILL("nvram") @@ -1598,11 +1587,11 @@ static MACHINE_CONFIG_START( jaguar, jaguar_state ) MCFG_CPU_PROGRAM_MAP(jaguar_map) MCFG_CPU_ADD("gpu", JAGUARGPU, JAGUAR_CLOCK) - MCFG_CPU_CONFIG(gpu_config) + MCFG_JAGUAR_IRQ_HANDLER(WRITELINE(jaguar_state, gpu_cpu_int)) MCFG_CPU_PROGRAM_MAP(jag_gpu_map) MCFG_CPU_ADD("dsp", JAGUARDSP, JAGUAR_CLOCK) - MCFG_CPU_CONFIG(dsp_config) + MCFG_JAGUAR_IRQ_HANDLER(WRITELINE(jaguar_state, dsp_cpu_int)) MCFG_CPU_PROGRAM_MAP(jag_dsp_map) // MCFG_NVRAM_HANDLER(jaguar) diff --git a/src/mame/includes/jaguar.h b/src/mame/includes/jaguar.h index 18b88738e46..541dd5b9f6a 100644 --- a/src/mame/includes/jaguar.h +++ b/src/mame/includes/jaguar.h @@ -216,8 +216,8 @@ public: DECLARE_READ32_MEMBER( cojag_gun_input_r ); UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - static void gpu_cpu_int(device_t *device); - static void dsp_cpu_int(device_t *device); + DECLARE_WRITE_LINE_MEMBER( gpu_cpu_int ); + DECLARE_WRITE_LINE_MEMBER( dsp_cpu_int ); DECLARE_WRITE_LINE_MEMBER( external_int ); int quickload(device_image_interface &image, const char *file_type, int quickload_size); diff --git a/src/mame/video/jaguar.c b/src/mame/video/jaguar.c index bd526e74f1e..cdbdce829fb 100644 --- a/src/mame/video/jaguar.c +++ b/src/mame/video/jaguar.c @@ -276,18 +276,16 @@ void jaguar_state::update_cpu_irq() } -void jaguar_state::gpu_cpu_int(device_t *device) +WRITE_LINE_MEMBER( jaguar_state::gpu_cpu_int ) { - jaguar_state &state = *device->machine().driver_data(); - state.m_cpu_irq_state |= 2; - state.update_cpu_irq(); + m_cpu_irq_state |= 2; + update_cpu_irq(); } -void jaguar_state::dsp_cpu_int(device_t *device) +WRITE_LINE_MEMBER( jaguar_state::dsp_cpu_int ) { - jaguar_state &state = *device->machine().driver_data(); - state.m_cpu_irq_state |= 16; - state.update_cpu_irq(); + m_cpu_irq_state |= 16; + update_cpu_irq(); }