summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/thedeep.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/thedeep.c')
-rw-r--r--src/mame/drivers/thedeep.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/src/mame/drivers/thedeep.c b/src/mame/drivers/thedeep.c
index f3bb642e14c..5073116f50c 100644
--- a/src/mame/drivers/thedeep.c
+++ b/src/mame/drivers/thedeep.c
@@ -406,33 +406,32 @@ static const ym2203_interface thedeep_ym2203_intf =
DEVCB_LINE(irqhandler)
};
-static TIMER_DEVICE_CALLBACK( thedeep_interrupt )
+TIMER_DEVICE_CALLBACK_MEMBER(thedeep_state::thedeep_interrupt)
{
- thedeep_state *state = timer.machine().driver_data<thedeep_state>();
int scanline = param;
if (scanline == 124) // TODO: clean this
{
- if (state->m_protection_command != 0x59)
+ if (m_protection_command != 0x59)
{
- int coins = timer.machine().root_device().ioport("MCU")->read();
- if (coins & 1) state->m_protection_data = 1;
- else if (coins & 2) state->m_protection_data = 2;
- else if (coins & 4) state->m_protection_data = 3;
- else state->m_protection_data = 0;
-
- if (state->m_protection_data)
- state->m_protection_irq = 1;
+ int coins = machine().root_device().ioport("MCU")->read();
+ if (coins & 1) m_protection_data = 1;
+ else if (coins & 2) m_protection_data = 2;
+ else if (coins & 4) m_protection_data = 3;
+ else m_protection_data = 0;
+
+ if (m_protection_data)
+ m_protection_irq = 1;
}
- if (state->m_protection_irq)
- state->m_maincpu->set_input_line(0, HOLD_LINE);
+ if (m_protection_irq)
+ m_maincpu->set_input_line(0, HOLD_LINE);
}
else if(scanline == 0)
{
- if (state->m_nmi_enable)
+ if (m_nmi_enable)
{
- state->m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
- state->m_maincpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
+ m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
+ m_maincpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
}
}
}
@@ -448,7 +447,7 @@ static MACHINE_CONFIG_START( thedeep, thedeep_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, XTAL_12MHz/2) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(main_map)
- MCFG_TIMER_ADD_SCANLINE("scantimer", thedeep_interrupt, "screen", 0, 1) /* IRQ by MCU, NMI by vblank (maskable) */
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", thedeep_state, thedeep_interrupt, "screen", 0, 1)
MCFG_CPU_ADD("audiocpu", M65C02, XTAL_12MHz/8) /* verified on pcb */
MCFG_CPU_PROGRAM_MAP(audio_map)