IRQ_CALLBACK modernization part 1 (no whatsnew)

This commit is contained in:
Miodrag Milanovic 2013-01-31 12:21:12 +00:00
parent 3e73b779d0
commit f63dc9ba65
38 changed files with 166 additions and 169 deletions

View File

@ -29,7 +29,7 @@
*
*************************************/
static IRQ_CALLBACK(aztarac_irq_callback)
IRQ_CALLBACK_MEMBER(aztarac_state::aztarac_irq_callback)
{
return 0xc;
}
@ -37,7 +37,7 @@ static IRQ_CALLBACK(aztarac_irq_callback)
void aztarac_state::machine_reset()
{
machine().device("maincpu")->execute().set_irq_acknowledge_callback(aztarac_irq_callback);
machine().device("maincpu")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(aztarac_state::aztarac_irq_callback),this));
}

View File

@ -47,42 +47,36 @@
*
*************************************/
static void update_irq_state( device_t *cpu )
void dcheese_state::update_irq_state()
{
dcheese_state *state = cpu->machine().driver_data<dcheese_state>();
int i;
for (i = 1; i < 5; i++)
cpu->execute().set_input_line(i, state->m_irq_state[i] ? ASSERT_LINE : CLEAR_LINE);
m_maincpu->set_input_line(i, m_irq_state[i] ? ASSERT_LINE : CLEAR_LINE);
}
static IRQ_CALLBACK( irq_callback )
IRQ_CALLBACK_MEMBER(dcheese_state::irq_callback)
{
dcheese_state *state = device->machine().driver_data<dcheese_state>();
/* auto-ack the IRQ */
state->m_irq_state[irqline] = 0;
update_irq_state(device);
m_irq_state[irqline] = 0;
update_irq_state();
/* vector is 0x40 + index */
return 0x40 + irqline;
}
void dcheese_signal_irq( running_machine &machine, int which )
void dcheese_state::dcheese_signal_irq(int which )
{
dcheese_state *state = machine.driver_data<dcheese_state>();
state->m_irq_state[which] = 1;
update_irq_state(state->m_maincpu);
m_irq_state[which] = 1;
update_irq_state();
}
INTERRUPT_GEN_MEMBER(dcheese_state::dcheese_vblank)
{
logerror("---- VBLANK ----\n");
dcheese_signal_irq(machine(), 4);
dcheese_signal_irq(4);
}
@ -99,7 +93,7 @@ void dcheese_state::machine_start()
m_audiocpu = machine().device<cpu_device>("audiocpu");
m_bsmt = machine().device("bsmt");
m_maincpu->set_irq_acknowledge_callback(irq_callback);
m_maincpu->set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(dcheese_state::irq_callback),this));
save_item(NAME(m_irq_state));
save_item(NAME(m_soundlatch_full));

View File

@ -149,6 +149,7 @@ public:
TIMER_CALLBACK_MEMBER(deferred_ls670_0_w);
TIMER_CALLBACK_MEMBER(deferred_ls670_1_w);
TIMER_CALLBACK_MEMBER(delayed_sound_w);
IRQ_CALLBACK_MEMBER(irq_callback);
};
@ -1394,7 +1395,7 @@ static const ay8910_interface ay8912_interface_2 =
DEVCB_DRIVER_MEMBER(mazerbla_state,gg_led_ctrl_w)
};
static IRQ_CALLBACK(irq_callback)
IRQ_CALLBACK_MEMBER(mazerbla_state::irq_callback)
{
/* all data lines are tied to +5V via 10K resistors */
/* D1 is set to GND when INT comes from CFB */
@ -1408,8 +1409,7 @@ static IRQ_CALLBACK(irq_callback)
note:
1111 11110 (0xfe) - cannot happen and is not handled by game */
mazerbla_state *state = device->machine().driver_data<mazerbla_state>();
return (state->m_zpu_int_vector & ~1); /* D0->GND is performed on CFB board */
return (m_zpu_int_vector & ~1); /* D0->GND is performed on CFB board */
}
/* frequency is 14.318 MHz/16/16/16/16 */
@ -1493,7 +1493,7 @@ void mazerbla_state::machine_reset()
memset(m_lookup_ram, 0, ARRAY_LENGTH(m_lookup_ram));
machine().device("maincpu")->execute().set_irq_acknowledge_callback(irq_callback);
machine().device("maincpu")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(mazerbla_state::irq_callback),this));
}

View File

@ -140,15 +140,14 @@ READ16_MEMBER(metro_state::metro_irq_cause_r)
/* Update the IRQ state based on all possible causes */
static void update_irq_state( running_machine &machine )
void metro_state::update_irq_state()
{
metro_state *state = machine.driver_data<metro_state>();
address_space &space = state->m_maincpu->space(AS_PROGRAM);
address_space &space = m_maincpu->space(AS_PROGRAM);
/* Get the pending IRQs (only the enabled ones, e.g. where irq_enable is *0*) */
UINT16 irq = state->metro_irq_cause_r(space, 0, 0xffff) & ~*state->m_irq_enable;
UINT16 irq = metro_irq_cause_r(space, 0, 0xffff) & ~*m_irq_enable;
if (state->m_irq_line == -1) /* mouja, gakusai, gakusai2, dokyusei, dokyusp */
if (m_irq_line == -1) /* mouja, gakusai, gakusai2, dokyusei, dokyusp */
{
/* This is for games that supply an *IRQ Vector* on the data bus together with an IRQ level for each possible IRQ source */
UINT8 irq_level[8] = { 0 };
@ -156,10 +155,10 @@ static void update_irq_state( running_machine &machine )
for (i = 0; i < 8; i++)
if (BIT(irq, i))
irq_level[state->m_irq_levels[i] & 7] = 1;
irq_level[m_irq_levels[i] & 7] = 1;
for (i = 0; i < 8; i++)
state->m_maincpu->set_input_line(i, irq_level[i] ? ASSERT_LINE : CLEAR_LINE);
m_maincpu->set_input_line(i, irq_level[i] ? ASSERT_LINE : CLEAR_LINE);
}
else
{
@ -167,18 +166,16 @@ static void update_irq_state( running_machine &machine )
then reads the actual source by peeking a register (metro_irq_cause_r) */
int irq_state = (irq ? ASSERT_LINE : CLEAR_LINE);
state->m_maincpu->set_input_line(state->m_irq_line, irq_state);
m_maincpu->set_input_line(m_irq_line, irq_state);
}
}
/* For games that supply an *IRQ Vector* on the data bus */
static IRQ_CALLBACK( metro_irq_callback )
IRQ_CALLBACK_MEMBER(metro_state::metro_irq_callback)
{
metro_state *state = device->machine().driver_data<metro_state>();
// logerror("%s: irq callback returns %04X\n", device->machine().describe_context(), state->m_irq_vectors[int_level]);
return state->m_irq_vectors[irqline] & 0xff;
// logerror("%s: irq callback returns %04X\n", device.machine().describe_context(), m_irq_vectors[int_level]);
return m_irq_vectors[irqline] & 0xff;
}
@ -194,19 +191,19 @@ WRITE16_MEMBER(metro_state::metro_irq_cause_w)
if (BIT(data, i)) m_requested_int[i] = 0;
}
update_irq_state(machine());
update_irq_state();
}
INTERRUPT_GEN_MEMBER(metro_state::metro_vblank_interrupt)
{
m_requested_int[m_vblank_bit] = 1;
update_irq_state(machine());
update_irq_state();
}
INTERRUPT_GEN_MEMBER(metro_state::metro_periodic_interrupt)
{
m_requested_int[4] = 1;
update_irq_state(machine());
update_irq_state();
}
TIMER_CALLBACK_MEMBER(metro_state::karatour_irq_callback)
@ -223,13 +220,13 @@ INTERRUPT_GEN_MEMBER(metro_state::karatour_interrupt)
machine().scheduler().timer_set(attotime::from_usec(2500), timer_expired_delegate(FUNC(metro_state::karatour_irq_callback),this));
m_requested_int[5] = 1;
update_irq_state(machine());
update_irq_state();
}
TIMER_CALLBACK_MEMBER(metro_state::mouja_irq_callback)
{
m_requested_int[0] = 1;
update_irq_state(machine());
update_irq_state();
}
WRITE16_MEMBER(metro_state::mouja_irq_timer_ctrl_w)
@ -242,7 +239,7 @@ WRITE16_MEMBER(metro_state::mouja_irq_timer_ctrl_w)
INTERRUPT_GEN_MEMBER(metro_state::puzzlet_interrupt)
{
m_requested_int[m_vblank_bit] = 1;
update_irq_state(machine());
update_irq_state();
m_maincpu->set_input_line(H8_METRO_TIMER_HACK, HOLD_LINE);
}
@ -558,7 +555,7 @@ READ16_MEMBER(metro_state::metro_bankedrom_r)
TIMER_CALLBACK_MEMBER(metro_state::metro_blit_done)
{
m_requested_int[m_blitter_bit] = 1;
update_irq_state(machine());
update_irq_state();
}
INLINE int blt_read( const UINT8 *ROM, const int offs )
@ -3581,7 +3578,7 @@ MACHINE_START_MEMBER(metro_state,metro)
MACHINE_RESET_MEMBER(metro_state,metro)
{
if (m_irq_line == -1)
machine().device("maincpu")->execute().set_irq_acknowledge_callback(metro_irq_callback);
machine().device("maincpu")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(metro_state::metro_irq_callback),this));
}

View File

@ -389,16 +389,14 @@ READ16_MEMBER(ms32_state::ms32_extra_r16)
return m_f1superb_extraram_16[offset];
}
static void irq_raise(running_machine &machine, int level);
WRITE32_MEMBER(ms32_state::ms32_irq2_guess_w)
{
irq_raise(machine(), 2);
irq_raise(2);
}
WRITE32_MEMBER(ms32_state::ms32_irq5_guess_w)
{
irq_raise(machine(), 5);
irq_raise(5);
}
static ADDRESS_MAP_START( f1superb_map, AS_PROGRAM, 32, ms32_state )
@ -1277,38 +1275,35 @@ GFXDECODE_END
*/
static IRQ_CALLBACK(irq_callback)
IRQ_CALLBACK_MEMBER(ms32_state::irq_callback)
{
ms32_state *state = device->machine().driver_data<ms32_state>();
int i;
for(i=15; i>=0 && !(state->m_irqreq & (1<<i)); i--);
state->m_irqreq &= ~(1<<i);
if(!state->m_irqreq)
device->execute().set_input_line(0, CLEAR_LINE);
for(i=15; i>=0 && !(m_irqreq & (1<<i)); i--);
m_irqreq &= ~(1<<i);
if(!m_irqreq)
device.execute().set_input_line(0, CLEAR_LINE);
return i;
}
static void irq_init(running_machine &machine)
void ms32_state::irq_init()
{
ms32_state *state = machine.driver_data<ms32_state>();
state->m_irqreq = 0;
machine.device("maincpu")->execute().set_input_line(0, CLEAR_LINE);
machine.device("maincpu")->execute().set_irq_acknowledge_callback(irq_callback);
m_irqreq = 0;
machine().device("maincpu")->execute().set_input_line(0, CLEAR_LINE);
machine().device("maincpu")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(ms32_state::irq_callback),this));
}
static void irq_raise(running_machine &machine, int level)
void ms32_state::irq_raise(int level)
{
ms32_state *state = machine.driver_data<ms32_state>();
state->m_irqreq |= (1<<level);
machine.device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
m_irqreq |= (1<<level);
machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
}
/* TODO: fix this arrangement (derived from old deprecat lib) */
TIMER_DEVICE_CALLBACK_MEMBER(ms32_state::ms32_interrupt)
{
int scanline = param;
if( scanline == 0) irq_raise(machine(), 10);
if( scanline == 8) irq_raise(machine(), 9);
if( scanline == 0) irq_raise(10);
if( scanline == 8) irq_raise(9);
/* hayaosi1 needs at least 12 IRQ 0 per frame to work (see code at FFE02289)
kirarast needs it too, at least 8 per frame, but waits for a variable amount
47pi2 needs ?? per frame (otherwise it hangs when you lose)
@ -1317,7 +1312,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(ms32_state::ms32_interrupt)
desertwr
p47aces
*/
if( (scanline % 8) == 0 && scanline <= 224 ) irq_raise(machine(), 0);
if( (scanline % 8) == 0 && scanline <= 224 ) irq_raise(0);
}
@ -1359,7 +1354,7 @@ WRITE8_MEMBER(ms32_state::ms32_snd_bank_w)
WRITE8_MEMBER(ms32_state::to_main_w)
{
m_to_main=data;
irq_raise(machine(), 1);
irq_raise(1);
}
static ADDRESS_MAP_START( ms32_sound_map, AS_PROGRAM, 8, ms32_state )
@ -1384,7 +1379,7 @@ void ms32_state::machine_reset()
machine().root_device().membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base());
machine().root_device().membank("bank4")->set_entry(0);
machine().root_device().membank("bank5")->set_entry(1);
irq_init(machine());
irq_init();
}
/********** MACHINE DRIVER **********/

View File

@ -125,6 +125,7 @@ public:
DECLARE_DRIVER_INIT(filetto);
virtual void machine_reset();
UINT32 screen_update_tetriskr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
IRQ_CALLBACK_MEMBER(irq_callback);
};
UINT32 pcxt_state::screen_update_tetriskr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
@ -541,10 +542,9 @@ static const struct pic8259_interface pic8259_2_config =
DEVCB_NULL
};
static IRQ_CALLBACK(irq_callback)
IRQ_CALLBACK_MEMBER(pcxt_state::irq_callback)
{
pcxt_state *state = device->machine().driver_data<pcxt_state>();
return pic8259_acknowledge(state->m_pic8259_1);
return pic8259_acknowledge(m_pic8259_1);
}
static ADDRESS_MAP_START( filetto_map, AS_PROGRAM, 8, pcxt_state )
@ -716,7 +716,7 @@ void pcxt_state::machine_reset()
device_t *speaker = machine().device("speaker");
m_bank = -1;
m_lastvalue = -1;
machine().device("maincpu")->execute().set_irq_acknowledge_callback(irq_callback);
machine().device("maincpu")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(pcxt_state::irq_callback),this));
m_pc_spkrdata = 0;
m_pc_input = 0;

View File

@ -77,6 +77,7 @@ public:
virtual void machine_start();
virtual void video_start();
UINT32 screen_update_quake(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
IRQ_CALLBACK_MEMBER(irq_callback);
};
@ -152,15 +153,14 @@ INPUT_PORTS_END
/*************************************************************/
static IRQ_CALLBACK(irq_callback)
IRQ_CALLBACK_MEMBER(quakeat_state::irq_callback)
{
quakeat_state *state = device->machine().driver_data<quakeat_state>();
return pic8259_acknowledge( state->m_pic8259_1);
return pic8259_acknowledge(m_pic8259_1);
}
void quakeat_state::machine_start()
{
machine().device("maincpu")->execute().set_irq_acknowledge_callback(irq_callback);
machine().device("maincpu")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(quakeat_state::irq_callback),this));
m_pic8259_1 = machine().device( "pic8259_1" );
m_pic8259_2 = machine().device( "pic8259_2" );

View File

@ -1794,7 +1794,7 @@ INTERRUPT_GEN_MEMBER(seibuspi_state::spi_interrupt)
device.execute().set_input_line(0, ASSERT_LINE );
}
static IRQ_CALLBACK(spi_irq_callback)
IRQ_CALLBACK_MEMBER(seibuspi_state::spi_irq_callback)
{
return 0x20;
}
@ -1815,7 +1815,7 @@ MACHINE_RESET_MEMBER(seibuspi_state,spi)
UINT8 flash_data = rombase[0x1ffffc];
machine().device("soundcpu")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE );
machine().device("maincpu")->execute().set_irq_acknowledge_callback(spi_irq_callback);
machine().device("maincpu")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(seibuspi_state::spi_irq_callback),this));
machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x00000680, 0x00000683, read32_delegate(FUNC(seibuspi_state::sound_fifo_r),this));
machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x00000688, 0x0000068b, write32_delegate(FUNC(seibuspi_state::z80_prg_fifo_w),this));
@ -1902,7 +1902,7 @@ MACHINE_RESET_MEMBER(seibuspi_state,sxx2f)
machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x0000068c, 0x0000068f, write32_delegate(FUNC(seibuspi_state::eeprom_w),this));
machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x00000680, 0x00000683, read32_delegate(FUNC(seibuspi_state::sb_coin_r),this));
machine().device("maincpu")->execute().set_irq_acknowledge_callback(spi_irq_callback);
machine().device("maincpu")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(seibuspi_state::spi_irq_callback),this));
m_sb_coin_latch = 0;
}
@ -2184,7 +2184,7 @@ DRIVER_INIT_MEMBER(seibuspi_state,rfjet2k)
MACHINE_RESET_MEMBER(seibuspi_state,seibu386)
{
machine().device("maincpu")->execute().set_irq_acknowledge_callback(spi_irq_callback);
machine().device("maincpu")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(seibuspi_state::spi_irq_callback),this));
}
static MACHINE_CONFIG_START( seibu386, seibuspi_state )

View File

@ -176,23 +176,19 @@ Notes:
***************************************************************************/
/* Update the IRQ state based on all possible causes */
static void update_irq_state(running_machine &machine)
void ssv_state::update_irq_state()
{
ssv_state *state = machine.driver_data<ssv_state>();
machine.device("maincpu")->execute().set_input_line(0, (state->m_requested_int & state->m_irq_enable)? ASSERT_LINE : CLEAR_LINE);
machine().device("maincpu")->execute().set_input_line(0, (m_requested_int & m_irq_enable)? ASSERT_LINE : CLEAR_LINE);
}
static IRQ_CALLBACK(ssv_irq_callback)
IRQ_CALLBACK_MEMBER(ssv_state::ssv_irq_callback)
{
ssv_state *state = device->machine().driver_data<ssv_state>();
int i;
for ( i = 0; i <= 7; i++ )
{
if (state->m_requested_int & (1 << i))
if (m_requested_int & (1 << i))
{
UINT16 vector = state->m_irq_vectors[i * (16/2)] & 7;
UINT16 vector = m_irq_vectors[i * (16/2)] & 7;
return vector;
}
}
@ -205,7 +201,7 @@ WRITE16_MEMBER(ssv_state::ssv_irq_ack_w)
m_requested_int &= ~(1 << level);
update_irq_state(machine());
update_irq_state();
}
/*
@ -240,13 +236,13 @@ TIMER_DEVICE_CALLBACK_MEMBER(ssv_state::ssv_interrupt)
if (m_interrupt_ultrax)
{
m_requested_int |= 1 << 1; // needed by ultrax to coin up, breaks cairblad
update_irq_state(machine());
update_irq_state();
}
}
else if(scanline == 240)
{
m_requested_int |= 1 << 3; // vblank
update_irq_state(machine());
update_irq_state();
}
}
@ -257,12 +253,12 @@ TIMER_DEVICE_CALLBACK_MEMBER(ssv_state::gdfs_interrupt)
if ((scanline % 64) == 0)
{
m_requested_int |= 1 << 6; // reads lightgun (4 times for 4 axis)
update_irq_state(machine());
update_irq_state();
}
else if(scanline == 240)
{
m_requested_int |= 1 << 3; // vblank
update_irq_state(machine());
update_irq_state();
}
}
@ -321,7 +317,7 @@ WRITE16_MEMBER(ssv_state::ssv_lockout_inv_w)
void ssv_state::machine_reset()
{
m_requested_int = 0;
machine().device("maincpu")->execute().set_irq_acknowledge_callback(ssv_irq_callback);
machine().device("maincpu")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(ssv_state::ssv_irq_callback),this));
membank("bank1")->set_base(memregion("user1")->base());
}

View File

@ -28,4 +28,5 @@ public:
virtual void machine_reset();
virtual void video_start();
INTERRUPT_GEN_MEMBER(aztarac_snd_timed_irq);
IRQ_CALLBACK_MEMBER(aztarac_irq_callback);
};

View File

@ -50,7 +50,10 @@ public:
INTERRUPT_GEN_MEMBER(dcheese_vblank);
TIMER_CALLBACK_MEMBER(blitter_scanline_callback);
TIMER_CALLBACK_MEMBER(dcheese_signal_irq_callback);
void dcheese_signal_irq(int which);
void update_irq_state();
IRQ_CALLBACK_MEMBER(irq_callback);
void update_scanline_irq();
};
/*----------- defined in drivers/dcheese.c -----------*/
void dcheese_signal_irq(running_machine &machine, int which);

View File

@ -187,6 +187,7 @@ public:
DECLARE_WRITE_LINE_MEMBER(galaxold_7474_9m_2_q_callback);
DECLARE_WRITE_LINE_MEMBER(galaxold_7474_9m_1_callback);
DECLARE_VIDEO_START(bagmanmc);
IRQ_CALLBACK_MEMBER(hunchbkg_irq_callback);
};
/*----------- defined in video/galaxold.c -----------*/

View File

@ -176,6 +176,8 @@ public:
TIMER_CALLBACK_MEMBER(karatour_irq_callback);
TIMER_CALLBACK_MEMBER(mouja_irq_callback);
TIMER_CALLBACK_MEMBER(metro_blit_done);
void update_irq_state();
IRQ_CALLBACK_MEMBER(metro_irq_callback);
};

View File

@ -89,4 +89,7 @@ public:
DECLARE_VIDEO_START(f1superb);
UINT32 screen_update_ms32(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(ms32_interrupt);
IRQ_CALLBACK_MEMBER(irq_callback);
void irq_init();
void irq_raise(int level);
};

View File

@ -116,6 +116,7 @@ public:
UINT32 screen_update_spi(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
UINT32 screen_update_sys386f2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(spi_interrupt);
IRQ_CALLBACK_MEMBER(spi_irq_callback);
};
/*----------- defined in machine/spisprit.c -----------*/
void seibuspi_sprite_decrypt(UINT8 *src, int romsize);

View File

@ -130,6 +130,8 @@ public:
UINT32 screen_update_eaglshot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(ssv_interrupt);
TIMER_DEVICE_CALLBACK_MEMBER(gdfs_interrupt);
void update_irq_state();
IRQ_CALLBACK_MEMBER(ssv_irq_callback);
};
/*----------- defined in video/ssv.c -----------*/

View File

@ -721,7 +721,7 @@ void fd1094_device::device_start()
// register for the state changing callbacks we need in the m68000
m68k_set_cmpild_callback(this, &fd1094_device::cmp_callback);
m68k_set_rte_callback(this, &fd1094_device::rte_callback);
set_irq_acknowledge_callback(&fd1094_device::irq_callback);
set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(fd1094_device::irq_callback),this));
// save state
save_item(NAME(m_state));
@ -987,9 +987,9 @@ void fd1094_device::cmp_callback(device_t *device, UINT32 val, UINT8 reg)
// interrupt code
//-------------------------------------------------
IRQ_CALLBACK( fd1094_device::irq_callback )
IRQ_CALLBACK_MEMBER( fd1094_device::irq_callback )
{
downcast<fd1094_device *>(device)->change_state(STATE_IRQ);
change_state(STATE_IRQ);
return (0x60 + irqline * 4) / 4; // vector address
}

View File

@ -95,10 +95,10 @@ protected:
UINT16 decrypt_one(offs_t address, UINT16 val, const UINT8 *main_key, UINT8 state, bool vector_fetch);
void decrypt(offs_t baseaddr, UINT32 size, const UINT16 *srcptr, UINT16 *opcodesptr, UINT8 state);
void default_state_change(UINT8 state);
IRQ_CALLBACK_MEMBER( irq_callback );
// static helpers
static void cmp_callback(device_t *device, UINT32 val, UINT8 reg);
static IRQ_CALLBACK( irq_callback );
static void rte_callback(device_t *device);
// internal state

View File

@ -12,7 +12,7 @@
#include "includes/galaxold.h"
static IRQ_CALLBACK(hunchbkg_irq_callback)
IRQ_CALLBACK_MEMBER(galaxold_state::hunchbkg_irq_callback)
{
//galaxold_state *state = device->machine().driver_data<galaxold_state>();
/* for some reason a call to cputag_set_input_line
@ -22,7 +22,7 @@ static IRQ_CALLBACK(hunchbkg_irq_callback)
*
* Therefore we reset the line without any detour ....
*/
device->machine().firstcpu->set_input_line(0, CLEAR_LINE);
device.machine().firstcpu->set_input_line(0, CLEAR_LINE);
//cpu_set_info(device->machine().firstcpu, CPUINFO_INT_INPUT_STATE + state->m_irq_line, CLEAR_LINE);
return 0x03;
}
@ -97,7 +97,7 @@ MACHINE_RESET_MEMBER(galaxold_state,devilfsg)
MACHINE_RESET_MEMBER(galaxold_state,hunchbkg)
{
machine_reset_common(machine(), 0);
machine().device("maincpu")->execute().set_irq_acknowledge_callback(hunchbkg_irq_callback);
machine().device("maincpu")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(galaxold_state::hunchbkg_irq_callback),this));
}
WRITE8_MEMBER(galaxold_state::galaxold_coin_lockout_w)

View File

@ -14,13 +14,13 @@ UINT16 a12000_halt_reset_reg = 0x0000;
/* Callback when the genesis enters interrupt code */
// needs to be a member
static IRQ_CALLBACK(segacd_sub_int_callback)
IRQ_CALLBACK_MEMBER(sega_segacd_device::segacd_sub_int_callback)
{
if (irqline==2)
{
// clear this bit
a12000_halt_reset_reg &= ~0x0100;
device->machine().device(":segacd:segacd_68k")->execute().set_input_line(2, CLEAR_LINE);
device.machine().device(":segacd:segacd_68k")->execute().set_input_line(2, CLEAR_LINE);
}
return (0x60+irqline*4)/4; // vector address
@ -1609,7 +1609,7 @@ void sega_segacd_device::device_start()
machine().device(":segacd:segacd_68k")->execute().set_irq_acknowledge_callback(segacd_sub_int_callback);
machine().device(":segacd:segacd_68k")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(sega_segacd_device::segacd_sub_int_callback),this));
space.install_read_handler (0x0000070, 0x0000073, read16_delegate(FUNC(sega_segacd_device::scd_hint_vector_r),this) );

View File

@ -356,6 +356,7 @@ public:
WRITE16_MEMBER( segacd_font_color_w );
READ16_MEMBER( segacd_font_converted_r );
TIMER_DEVICE_CALLBACK_MEMBER( scd_dma_timer_callback );
IRQ_CALLBACK_MEMBER(segacd_sub_int_callback);
void SegaCD_CDC_Do_DMA( int &dmacount, UINT8 *CDC_BUFFER, UINT16 &dma_addrc, UINT16 &destination );
timer_device* scd_dma_timer;

View File

@ -91,17 +91,12 @@ mie_device::mie_device(const machine_config &mconfig, const char *tag, device_t
jvs = 0;
}
IRQ_CALLBACK(mie_device::irq_callback_1)
{
return downcast<mie_device *>(device->owner())->irq_callback();
}
void mie_device::device_start()
{
maple_device::device_start();
cpu = subdevice<z80_device>("mie");
timer = timer_alloc(0);
cpu->set_irq_acknowledge_callback(irq_callback_1);
cpu->set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(mie_device::irq_callback),this));
jvs = machine().device<mie_jvs_device>(jvs_name);
save_item(NAME(gpiodir));
@ -270,7 +265,7 @@ void mie_device::recalc_irq()
cpu->set_input_line(0, irq_enable & irq_pending & 0x7f ? ASSERT_LINE : CLEAR_LINE);
}
int mie_device::irq_callback()
IRQ_CALLBACK_MEMBER(mie_device::irq_callback)
{
if(!(irq_enable & irq_pending & 0x7f))
throw emu_fatalerror("MIE irq callback called with enable=%02x, pending=%02x", irq_enable, irq_pending);

View File

@ -66,7 +66,7 @@ public:
DECLARE_READ8_MEMBER(read_00);
DECLARE_READ8_MEMBER(read_78xx);
static IRQ_CALLBACK(irq_callback_1);
IRQ_CALLBACK_MEMBER(irq_callback);
void maple_w(const UINT32 *data, UINT32 in_size);
virtual void maple_reset();
@ -109,7 +109,6 @@ private:
void raise_irq(int level);
void recalc_irq();
int irq_callback();
};
// Trampoline class, required for device discovery

View File

@ -47,40 +47,38 @@ void dcheese_state::palette_init()
*
*************************************/
static void update_scanline_irq( running_machine &machine )
void dcheese_state::update_scanline_irq()
{
dcheese_state *state = machine.driver_data<dcheese_state>();
/* if not in range, don't bother */
if (state->m_blitter_vidparam[0x22/2] <= state->m_blitter_vidparam[0x1e/2])
if (m_blitter_vidparam[0x22/2] <= m_blitter_vidparam[0x1e/2])
{
int effscan;
attotime time;
/* compute the effective scanline of the interrupt */
effscan = state->m_blitter_vidparam[0x22/2] - state->m_blitter_vidparam[0x1a/2];
effscan = m_blitter_vidparam[0x22/2] - m_blitter_vidparam[0x1a/2];
if (effscan < 0)
effscan += state->m_blitter_vidparam[0x1e/2];
effscan += m_blitter_vidparam[0x1e/2];
/* determine the time; if it's in this scanline, bump to the next frame */
time = machine.primary_screen->time_until_pos(effscan);
if (time < machine.primary_screen->scan_period())
time += machine.primary_screen->frame_period();
state->m_blitter_timer->adjust(time);
time = machine().primary_screen->time_until_pos(effscan);
if (time < machine().primary_screen->scan_period())
time += machine().primary_screen->frame_period();
m_blitter_timer->adjust(time);
}
}
TIMER_CALLBACK_MEMBER(dcheese_state::blitter_scanline_callback)
{
dcheese_signal_irq(machine(), 3);
update_scanline_irq(machine());
dcheese_signal_irq(3);
update_scanline_irq();
}
TIMER_CALLBACK_MEMBER(dcheese_state::dcheese_signal_irq_callback)
{
dcheese_signal_irq(machine(), param);
dcheese_signal_irq(param);
}
@ -267,7 +265,7 @@ WRITE16_MEMBER(dcheese_state::madmax_blitter_vidparam_w)
break;
case 0x22/2: /* scanline interrupt */
update_scanline_irq(machine());
update_scanline_irq();
break;
case 0x24/2: /* writes here after writing to 0x28 */

View File

@ -148,6 +148,8 @@ public:
int m_dack;
UINT8 m_dma_offset[4];
IRQ_CALLBACK_MEMBER(irq_callback);
protected:
// driver_device overrides
@ -741,14 +743,14 @@ void apc_state::fdc_irq(bool state)
pic8259_ir4_w(machine().device("pic8259_slave"), state);
}
static IRQ_CALLBACK(irq_callback)
IRQ_CALLBACK_MEMBER(apc_state::irq_callback)
{
return pic8259_acknowledge( device->machine().device( "pic8259_master" ));
return pic8259_acknowledge( machine().device( "pic8259_master" ));
}
void apc_state::machine_start()
{
machine().device("maincpu")->execute().set_irq_acknowledge_callback(irq_callback);
machine().device("maincpu")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(apc_state::irq_callback),this));
m_fdc->set_rate(500000);
m_fdc->setup_intrq_cb(upd765a_device::line_cb(FUNC(apc_state::fdc_irq), this));

View File

@ -1336,16 +1336,16 @@ TIMER_CALLBACK_MEMBER(fm7_state::fm7_keyboard_poll)
}
}
static IRQ_CALLBACK(fm7_irq_ack)
IRQ_CALLBACK_MEMBER(fm7_state::fm7_irq_ack)
{
if(irqline == M6809_FIRQ_LINE)
device->machine().device("maincpu")->execute().set_input_line(irqline,CLEAR_LINE);
machine().device("maincpu")->execute().set_input_line(irqline,CLEAR_LINE);
return -1;
}
static IRQ_CALLBACK(fm7_sub_irq_ack)
IRQ_CALLBACK_MEMBER(fm7_state::fm7_sub_irq_ack)
{
device->machine().device("sub")->execute().set_input_line(irqline,CLEAR_LINE);
machine().device("sub")->execute().set_input_line(irqline,CLEAR_LINE);
return -1;
}
@ -1832,8 +1832,8 @@ DRIVER_INIT_MEMBER(fm7_state,fm7)
m_subtimer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(fm7_state::fm7_subtimer_irq),this));
m_keyboard_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(fm7_state::fm7_keyboard_poll),this));
m_fm77av_vsync_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(fm7_state::fm77av_vsync),this));
machine().device("maincpu")->execute().set_irq_acknowledge_callback(fm7_irq_ack);
machine().device("sub")->execute().set_irq_acknowledge_callback(fm7_sub_irq_ack);
machine().device("maincpu")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(fm7_state::fm7_irq_ack),this));
machine().device("sub")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(fm7_state::fm7_sub_irq_ack),this));
}
MACHINE_START_MEMBER(fm7_state,fm7)

View File

@ -2016,10 +2016,9 @@ READ8_MEMBER(towns_state::towns_41ff_r)
return 0x01;
}
static IRQ_CALLBACK( towns_irq_callback )
IRQ_CALLBACK_MEMBER(towns_state::towns_irq_callback)
{
towns_state* state = device->machine().driver_data<towns_state>();
return pic8259_acknowledge(state->m_pic_master);
return pic8259_acknowledge(m_pic_master);
}
// YM3438 interrupt (IRQ 13)
@ -2511,7 +2510,7 @@ void towns_state::driver_start()
// CD-ROM init
m_towns_cd.read_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(towns_state::towns_cdrom_read_byte),this), (void*)machine().device("dma_1"));
machine().device("maincpu")->execute().set_irq_acknowledge_callback(towns_irq_callback);
machine().device("maincpu")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(towns_state::towns_irq_callback),this));
machine().device("maincpu")->memory().space(AS_PROGRAM).install_ram(0x100000,machine().device<ram_device>(RAM_TAG)->size()-1,0xffffffff,0,NULL);
}

View File

@ -98,6 +98,7 @@ public:
INTERRUPT_GEN_MEMBER(iq151_vblank_interrupt);
DECLARE_INPUT_CHANGED_MEMBER(iq151_break);
TIMER_DEVICE_CALLBACK_MEMBER(cassette_timer);
IRQ_CALLBACK_MEMBER(iq151_irq_callback);
};
READ8_MEMBER(iq151_state::keyboard_row_r)
@ -327,11 +328,9 @@ INTERRUPT_GEN_MEMBER(iq151_state::iq151_vblank_interrupt)
m_vblank_irq_state ^= 1;
}
static IRQ_CALLBACK(iq151_irq_callback)
IRQ_CALLBACK_MEMBER(iq151_state::iq151_irq_callback)
{
iq151_state *state = device->machine().driver_data<iq151_state>();
return pic8259_acknowledge(state->m_pic);
return pic8259_acknowledge(m_pic);
}
TIMER_DEVICE_CALLBACK_MEMBER(iq151_state::cassette_timer)
@ -347,7 +346,7 @@ DRIVER_INIT_MEMBER(iq151_state,iq151)
membank("boot")->configure_entry(0, RAM + 0xf800);
membank("boot")->configure_entry(1, RAM + 0x0000);
m_maincpu->set_irq_acknowledge_callback(iq151_irq_callback);
m_maincpu->set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(iq151_state::iq151_irq_callback),this));
// keep machine pointers to slots
m_carts[0] = machine().device<iq151cart_slot_device>("slot1");

View File

@ -151,6 +151,7 @@ public:
void fdc_drq(bool state);
DECLARE_FLOPPY_FORMATS( floppy_formats );
void pc88va_fdc_update_ready(floppy_image_device *, int);
IRQ_CALLBACK_MEMBER(pc88va_irq_callback);
};
@ -1612,9 +1613,9 @@ static I8255_INTERFACE( r232c_ctrl_intf )
DEVCB_DRIVER_MEMBER(pc88va_state,r232_ctrl_portc_w) /* Port C write */
};
static IRQ_CALLBACK(pc88va_irq_callback)
IRQ_CALLBACK_MEMBER(pc88va_state::pc88va_irq_callback)
{
return pic8259_acknowledge( device->machine().device( "pic8259_master" ) );
return pic8259_acknowledge( machine().device( "pic8259_master" ) );
}
WRITE_LINE_MEMBER(pc88va_state::pc88va_pic_irq)
@ -1647,7 +1648,7 @@ static const struct pic8259_interface pc88va_pic8259_slave_config =
void pc88va_state::machine_start()
{
machine().device("maincpu")->execute().set_irq_acknowledge_callback(pc88va_irq_callback);
machine().device("maincpu")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(pc88va_state::pc88va_irq_callback),this));
m_t3_mouse_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pc88va_state::t3_mouse_callback),this));
m_t3_mouse_timer->adjust(attotime::never);

View File

@ -654,6 +654,7 @@ public:
inline UINT32 m_calc_grcg_addr(int i,UINT32 offset);
DECLARE_DRIVER_INIT(pc9801_kanji);
IRQ_CALLBACK_MEMBER(irq_callback);
};
@ -3330,14 +3331,14 @@ PALETTE_INIT_MEMBER(pc9801_state,pc9801)
palette_set_color_rgb(machine(), i, pal1bit(0), pal1bit(0), pal1bit(0));
}
static IRQ_CALLBACK(irq_callback)
IRQ_CALLBACK_MEMBER(pc9801_state::irq_callback)
{
return pic8259_acknowledge( device->machine().device( "pic8259_master" ));
return pic8259_acknowledge( machine().device( "pic8259_master" ));
}
MACHINE_START_MEMBER(pc9801_state,pc9801_common)
{
machine().device("maincpu")->execute().set_irq_acknowledge_callback(irq_callback);
machine().device("maincpu")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(pc9801_state::irq_callback),this));
m_rtc->cs_w(1);
m_rtc->oe_w(0); // TODO: unknown connection, MS-DOS 6.2x wants this low somehow with the test mode

View File

@ -37,6 +37,7 @@ public:
DECLARE_READ8_MEMBER(pk8000_84_porta_r);
DECLARE_WRITE8_MEMBER(pk8000_84_porta_w);
DECLARE_WRITE8_MEMBER(pk8000_84_portc_w);
IRQ_CALLBACK_MEMBER(pk8000_irq_callback);
};
@ -318,7 +319,7 @@ INTERRUPT_GEN_MEMBER(pk8000_state::pk8000_interrupt)
device.execute().set_input_line(0, HOLD_LINE);
}
static IRQ_CALLBACK(pk8000_irq_callback)
IRQ_CALLBACK_MEMBER(pk8000_state::pk8000_irq_callback)
{
return 0xff;
}
@ -327,7 +328,7 @@ static IRQ_CALLBACK(pk8000_irq_callback)
void pk8000_state::machine_reset()
{
pk8000_set_bank(machine(),0);
machine().device("maincpu")->execute().set_irq_acknowledge_callback(pk8000_irq_callback);
machine().device("maincpu")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(pk8000_state::pk8000_irq_callback),this));
}
void pk8000_state::video_start()

View File

@ -112,6 +112,7 @@ public:
DECLARE_WRITE8_MEMBER( mouse_w );
virtual void palette_init();
TIMER_DEVICE_CALLBACK_MEMBER(irq_timer);
IRQ_CALLBACK_MEMBER(prestige_int_ack);
};
@ -393,21 +394,20 @@ INPUT_PORTS_START( prestige )
INPUT_PORTS_END
static IRQ_CALLBACK( prestige_int_ack )
IRQ_CALLBACK_MEMBER(prestige_state::prestige_int_ack)
{
UINT32 vector;
prestige_state *state = device->machine().driver_data<prestige_state>();
state->m_maincpu->set_input_line(0, CLEAR_LINE);
m_maincpu->set_input_line(0, CLEAR_LINE);
if (state->m_irq_counter == 0x02)
if (m_irq_counter == 0x02)
{
state->m_irq_counter = 0;
m_irq_counter = 0;
vector = 0x0020;
}
else
{
state->m_irq_counter++;
m_irq_counter++;
vector = 0x0030;
}
@ -419,7 +419,7 @@ void prestige_state::machine_start()
UINT8 *ram = m_ram->pointer();
memset(ram, 0x00, m_ram->size());
m_maincpu->set_irq_acknowledge_callback(prestige_int_ack);
m_maincpu->set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(prestige_state::prestige_int_ack),this));
membank("bank1")->configure_entries(0, 64, memregion("maincpu")->base(), 0x4000);
membank("bank2")->configure_entries(0, 64, memregion("maincpu")->base(), 0x4000);

View File

@ -146,6 +146,7 @@ public:
virtual void palette_init();
DECLARE_INPUT_CHANGED_MEMBER(key_stroke);
DECLARE_WRITE_LINE_MEMBER(dma_hrq_changed);
IRQ_CALLBACK_MEMBER(irq_callback);
};
static UPD7220_DISPLAY_PIXELS( hgdc_display_pixels )
@ -576,9 +577,9 @@ static const struct pic8259_interface qx10_pic8259_slave_config =
DEVCB_NULL
};
static IRQ_CALLBACK( irq_callback )
IRQ_CALLBACK_MEMBER(qx10_state::irq_callback)
{
return pic8259_acknowledge(device->machine().driver_data<qx10_state>()->m_pic_m );
return pic8259_acknowledge(m_pic_m);
}
READ8_MEMBER( qx10_state::upd7201_r )
@ -908,7 +909,7 @@ INPUT_PORTS_END
void qx10_state::machine_start()
{
machine().device("maincpu")->execute().set_irq_acknowledge_callback(irq_callback);
machine().device("maincpu")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(qx10_state::irq_callback),this));
m_fdc->setup_intrq_cb(upd765a_device::line_cb(FUNC(qx10_state::qx10_upd765_interrupt), this));
m_fdc->setup_drq_cb(upd765a_device::line_cb(FUNC(qx10_state::drq_w), this));
}

View File

@ -43,6 +43,7 @@ public:
virtual void machine_reset();
virtual void palette_init();
INTERRUPT_GEN_MEMBER(sm1800_vblank_interrupt);
IRQ_CALLBACK_MEMBER(sm1800_irq_callback);
};
static ADDRESS_MAP_START(sm1800_mem, AS_PROGRAM, 8, sm1800_state)
@ -66,14 +67,14 @@ ADDRESS_MAP_END
static INPUT_PORTS_START( sm1800 )
INPUT_PORTS_END
static IRQ_CALLBACK(sm1800_irq_callback)
IRQ_CALLBACK_MEMBER(sm1800_state::sm1800_irq_callback)
{
return 0xff;
}
void sm1800_state::machine_reset()
{
m_maincpu->set_irq_acknowledge_callback(sm1800_irq_callback);
m_maincpu->set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(sm1800_state::sm1800_irq_callback),this));
}
INTERRUPT_GEN_MEMBER(sm1800_state::sm1800_vblank_interrupt)

View File

@ -180,9 +180,9 @@ static const struct pic8259_interface pic8259_config =
DEVCB_NULL
};
static IRQ_CALLBACK(irq_callback)
IRQ_CALLBACK_MEMBER(tsispch_state::irq_callback)
{
return pic8259_acknowledge(device->machine().device("pic8259"));
return pic8259_acknowledge(machine().device("pic8259"));
}
/*****************************************************************************
@ -272,7 +272,7 @@ void tsispch_state::machine_reset()
int i;
for (i=0; i<32; i++) m_infifo[i] = 0;
m_infifo_tail_ptr = m_infifo_head_ptr = 0;
machine().device("maincpu")->execute().set_irq_acknowledge_callback(irq_callback);
machine().device("maincpu")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(tsispch_state::irq_callback),this));
fprintf(stderr,"machine reset\n");
}

View File

@ -250,6 +250,8 @@ public:
DECLARE_WRITE_LINE_MEMBER(fm7_fdc_drq_w);
DECLARE_READ8_MEMBER(fm77av_joy_1_r);
DECLARE_READ8_MEMBER(fm77av_joy_2_r);
IRQ_CALLBACK_MEMBER(fm7_irq_ack);
IRQ_CALLBACK_MEMBER(fm7_sub_irq_ack);
};
#endif /*FM7_H_*/

View File

@ -265,6 +265,7 @@ public:
DECLARE_WRITE_LINE_MEMBER(towns_pit_out0_changed);
DECLARE_WRITE_LINE_MEMBER(towns_pit_out1_changed);
DECLARE_READ8_MEMBER(get_slave_ack);
IRQ_CALLBACK_MEMBER(towns_irq_callback);
};
class marty_state : public towns_state

View File

@ -49,6 +49,7 @@ public:
DECLARE_WRITE_LINE_MEMBER(i8251_txempty_int);
DECLARE_WRITE_LINE_MEMBER(i8251_txrdy_int);
DECLARE_WRITE_LINE_MEMBER(pic8259_set_int_line);
IRQ_CALLBACK_MEMBER(irq_callback);
};