From ad69d72a53e16ce23e6bee8f020ca2186ef1c84a Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Thu, 31 Jan 2013 13:58:02 +0000 Subject: IRQ_CALLBACK modernization part 3 (no whatsnew) --- src/mame/drivers/crystal.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/mame/drivers/crystal.c') diff --git a/src/mame/drivers/crystal.c b/src/mame/drivers/crystal.c index 7c6e9576c83..75a1bbdd859 100644 --- a/src/mame/drivers/crystal.c +++ b/src/mame/drivers/crystal.c @@ -194,6 +194,7 @@ public: void screen_eof_crystal(screen_device &screen, bool state); INTERRUPT_GEN_MEMBER(crystal_interrupt); TIMER_CALLBACK_MEMBER(Timercb); + IRQ_CALLBACK_MEMBER(icallback); }; static void IntReq( running_machine &machine, int num ) @@ -271,10 +272,9 @@ WRITE32_MEMBER(crystal_state::IntAck_w) m_IntHigh = (data >> 8) & 7; } -static IRQ_CALLBACK( icallback ) +IRQ_CALLBACK_MEMBER(crystal_state::icallback) { - crystal_state *state = device->machine().driver_data(); - address_space &space = device->memory().space(AS_PROGRAM); + address_space &space = device.memory().space(AS_PROGRAM); UINT32 IntPend = space.read_dword(0x01800c0c); int i; @@ -282,7 +282,7 @@ static IRQ_CALLBACK( icallback ) { if (BIT(IntPend, i)) { - return (state->m_IntHigh << 5) | i; + return (m_IntHigh << 5) | i; } } return 0; //This should never happen @@ -582,7 +582,7 @@ void crystal_state::machine_start() m_ds1302 = machine().device("rtc"); m_vr0video = machine().device("vr0"); - machine().device("maincpu")->execute().set_irq_acknowledge_callback(icallback); + machine().device("maincpu")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(crystal_state::icallback),this)); for (i = 0; i < 4; i++) m_Timer[i] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(crystal_state::Timercb),this), (void*)(FPTR)i); @@ -611,7 +611,7 @@ void crystal_state::machine_reset() memset(m_vidregs, 0, 0x10000); m_FlipCount = 0; m_IntHigh = 0; - machine().device("maincpu")->execute().set_irq_acknowledge_callback(icallback); + machine().device("maincpu")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(crystal_state::icallback),this)); m_Bank = 0; membank("bank1")->set_base(memregion("user1")->base() + 0); m_FlashCmd = 0xff; -- cgit v1.2.3-70-g09d2