From a08e7f2763547a819bb65fe70cb2062cc05f67a9 Mon Sep 17 00:00:00 2001 From: Angelo Salese Date: Mon, 12 Dec 2011 00:04:06 +0000 Subject: [PATCH] deprecat.h --- src/mame/drivers/namconb1.c | 44 +++++++++++++++++++++++------------- src/mame/includes/namconb1.h | 8 ++++++- 2 files changed, 35 insertions(+), 17 deletions(-) diff --git a/src/mame/drivers/namconb1.c b/src/mame/drivers/namconb1.c index 1e36ac4d0c8..875339fcf1c 100644 --- a/src/mame/drivers/namconb1.c +++ b/src/mame/drivers/namconb1.c @@ -270,7 +270,6 @@ GFX: Custom 145 ( 80 pin PQFP) */ #include "emu.h" #include "cpu/m68000/m68000.h" -#include "deprecat.h" #include "includes/namconb1.h" #include "includes/namcos2.h" #include "includes/namcoic.h" @@ -348,22 +347,29 @@ static INTERRUPT_GEN( namconb1_interrupt ) } } /* namconb1_interrupt */ -static INTERRUPT_GEN( mcu_interrupt ) + +static TIMER_DEVICE_CALLBACK( mcu_irq0_cb ) { - if (cpu_getiloops(device) == 0) - { - device_set_input_line(device, M37710_LINE_IRQ0, HOLD_LINE); - } - else if (cpu_getiloops(device) == 1) - { - device_set_input_line(device, M37710_LINE_IRQ2, HOLD_LINE); - } - else - { - device_set_input_line(device, M37710_LINE_ADC, HOLD_LINE); - } + namconb1_state *state = timer.machine().driver_data(); + + device_set_input_line(state->m_mcu, M37710_LINE_IRQ0, HOLD_LINE); } +static TIMER_DEVICE_CALLBACK( mcu_irq2_cb ) +{ + namconb1_state *state = timer.machine().driver_data(); + + device_set_input_line(state->m_mcu, M37710_LINE_IRQ2, HOLD_LINE); +} + +static TIMER_DEVICE_CALLBACK( mcu_adc_cb ) +{ + namconb1_state *state = timer.machine().driver_data(); + + device_set_input_line(state->m_mcu, M37710_LINE_ADC, HOLD_LINE); +} + + static TIMER_CALLBACK( namconb2_TriggerPOSIRQ ) { namconb1_state *state = machine.driver_data(); @@ -1027,7 +1033,10 @@ static MACHINE_CONFIG_START( namconb1, namconb1_state ) MCFG_CPU_ADD("mcu", M37702, MASTER_CLOCK_HZ/3) MCFG_CPU_PROGRAM_MAP(namcoc75_am) MCFG_CPU_IO_MAP(namcoc75_io) - MCFG_CPU_VBLANK_INT_HACK(mcu_interrupt, 3) + /* TODO: irq generation for these */ + MCFG_TIMER_ADD_PERIODIC("mcu_irq0", mcu_irq0_cb, attotime::from_hz(60)) + MCFG_TIMER_ADD_PERIODIC("mcu_irq2", mcu_irq2_cb, attotime::from_hz(60)) + MCFG_TIMER_ADD_PERIODIC("mcu_adc", mcu_adc_cb, attotime::from_hz(60)) MCFG_NVRAM_HANDLER(namconb1) MCFG_MACHINE_START(namconb) @@ -1060,7 +1069,10 @@ static MACHINE_CONFIG_START( namconb2, namconb1_state ) MCFG_CPU_ADD("mcu", M37702, MASTER_CLOCK_HZ/3) MCFG_CPU_PROGRAM_MAP(namcoc75_am) MCFG_CPU_IO_MAP(namcoc75_io) - MCFG_CPU_VBLANK_INT_HACK(mcu_interrupt, 3) + /* TODO: irq generation for these */ + MCFG_TIMER_ADD_PERIODIC("mcu_irq0", mcu_irq0_cb, attotime::from_hz(60)) + MCFG_TIMER_ADD_PERIODIC("mcu_irq2", mcu_irq2_cb, attotime::from_hz(60)) + MCFG_TIMER_ADD_PERIODIC("mcu_adc", mcu_adc_cb, attotime::from_hz(60)) MCFG_NVRAM_HANDLER(namconb1) MCFG_MACHINE_START(namconb) diff --git a/src/mame/includes/namconb1.h b/src/mame/includes/namconb1.h index d1d51cc29f3..bf274c99b1f 100644 --- a/src/mame/includes/namconb1.h +++ b/src/mame/includes/namconb1.h @@ -17,7 +17,10 @@ class namconb1_state : public driver_device { public: namconb1_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag) { } + : driver_device(mconfig, type, tag), + m_maincpu(*this,"maincpu"), + m_mcu(*this,"mcu") + { } UINT32 *m_nvmem32; UINT16 *m_namconb_shareram; @@ -29,6 +32,9 @@ public: UINT32 *m_spritebank32; UINT32 *m_tilebank32; UINT32 m_tilemap_tile_bank[4]; + + required_device m_maincpu; + required_device m_mcu; };