diff options
author | Miodrag Milanovic <mmicko@gmail.com> | 2012-09-24 14:09:14 +0000 |
---|---|---|
committer | Miodrag Milanovic <mmicko@gmail.com> | 2012-09-24 14:09:14 +0000 |
commit | ef6f5d0a52b1cbbc1418a248da72122e6958a958 (patch) | |
tree | 4dd325f2232bb5f4f9349599555846552d360d6c /src/mame/drivers/midzeus.c | |
parent | 7a7fa028bdc4fe10253488ffb180fc113eb2a14a (diff) |
Introducing TIMER_CALLBACK_MEMBER and modernization part 1 (no whatsnew)
Diffstat (limited to 'src/mame/drivers/midzeus.c')
-rw-r--r-- | src/mame/drivers/midzeus.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/mame/drivers/midzeus.c b/src/mame/drivers/midzeus.c index 9a17ce11fc6..5741bece552 100644 --- a/src/mame/drivers/midzeus.c +++ b/src/mame/drivers/midzeus.c @@ -61,7 +61,7 @@ static UINT8 cmos_protected; static emu_timer *timer[2]; -static TIMER_CALLBACK( invasn_gun_callback ); + @@ -76,8 +76,8 @@ MACHINE_START_MEMBER(midzeus_state,midzeus) timer[0] = machine().scheduler().timer_alloc(FUNC_NULL); timer[1] = machine().scheduler().timer_alloc(FUNC_NULL); - gun_timer[0] = machine().scheduler().timer_alloc(FUNC(invasn_gun_callback)); - gun_timer[1] = machine().scheduler().timer_alloc(FUNC(invasn_gun_callback)); + gun_timer[0] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(midzeus_state::invasn_gun_callback),this)); + gun_timer[1] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(midzeus_state::invasn_gun_callback),this)); state_save_register_global(machine(), gun_control); state_save_register_global(machine(), gun_irq_state); @@ -106,15 +106,15 @@ MACHINE_RESET_MEMBER(midzeus_state,midzeus) * *************************************/ -static TIMER_CALLBACK( display_irq_off ) +TIMER_CALLBACK_MEMBER(midzeus_state::display_irq_off) { - machine.device("maincpu")->execute().set_input_line(0, CLEAR_LINE); + machine().device("maincpu")->execute().set_input_line(0, CLEAR_LINE); } INTERRUPT_GEN_MEMBER(midzeus_state::display_irq) { device.execute().set_input_line(0, ASSERT_LINE); - machine().scheduler().timer_set(attotime::from_hz(30000000), FUNC(display_irq_off)); + machine().scheduler().timer_set(attotime::from_hz(30000000), timer_expired_delegate(FUNC(midzeus_state::display_irq_off),this)); } @@ -489,19 +489,19 @@ static void update_gun_irq(running_machine &machine) } -static TIMER_CALLBACK( invasn_gun_callback ) +TIMER_CALLBACK_MEMBER(midzeus_state::invasn_gun_callback) { int player = param; - int beamy = machine.primary_screen->vpos(); + int beamy = machine().primary_screen->vpos(); /* set the appropriate IRQ in the internal gun control and update */ gun_irq_state |= 0x01 << player; - update_gun_irq(machine); + update_gun_irq(machine()); /* generate another interrupt on the next scanline while we are within the BEAM_DY */ beamy++; - if (beamy <= machine.primary_screen->visible_area().max_y && beamy <= gun_y[player] + BEAM_DY) - gun_timer[player]->adjust(machine.primary_screen->time_until_pos(beamy, MAX(0, gun_x[player] - BEAM_DX)), player); + if (beamy <= machine().primary_screen->visible_area().max_y && beamy <= gun_y[player] + BEAM_DY) + gun_timer[player]->adjust(machine().primary_screen->time_until_pos(beamy, MAX(0, gun_x[player] - BEAM_DX)), player); } |