Previous 199869 Revisions Next

r20629 Thursday 31st January, 2013 at 12:21:12 UTC by Miodrag Milanović
IRQ_CALLBACK modernization part 1 (no whatsnew)
[src/mame/drivers]aztarac.c dcheese.c mazerbla.c metro.c ms32.c pcxt.c quakeat.c seibuspi.c ssv.c
[src/mame/includes]aztarac.h dcheese.h galaxold.h metro.h ms32.h seibuspi.h ssv.h
[src/mame/machine]fd1094.c fd1094.h galaxold.c megacd.c megacd.h mie.c mie.h
[src/mame/video]dcheese.c
[src/mess/drivers]apc.c fm7.c fmtowns.c iq151.c pc88va.c pc9801.c pk8000.c prestige.c qx10.c sm1800.c tsispch.c
[src/mess/includes]fm7.h fmtowns.h tsispch.h

trunk/src/mame/drivers/mazerbla.c
r20628r20629
149149   TIMER_CALLBACK_MEMBER(deferred_ls670_0_w);
150150   TIMER_CALLBACK_MEMBER(deferred_ls670_1_w);
151151   TIMER_CALLBACK_MEMBER(delayed_sound_w);
152   IRQ_CALLBACK_MEMBER(irq_callback);
152153};
153154
154155
r20628r20629
13941395   DEVCB_DRIVER_MEMBER(mazerbla_state,gg_led_ctrl_w)
13951396};
13961397
1397static IRQ_CALLBACK(irq_callback)
1398IRQ_CALLBACK_MEMBER(mazerbla_state::irq_callback)
13981399{
13991400   /* all data lines are tied to +5V via 10K resistors */
14001401   /* D1 is set to GND when INT comes from CFB */
r20628r20629
14081409   note:
14091410   1111 11110 (0xfe) - cannot happen and is not handled by game */
14101411
1411   mazerbla_state *state = device->machine().driver_data<mazerbla_state>();
1412   return (state->m_zpu_int_vector & ~1);  /* D0->GND is performed on CFB board */
1412   return (m_zpu_int_vector & ~1);  /* D0->GND is performed on CFB board */
14131413}
14141414
14151415/* frequency is 14.318 MHz/16/16/16/16 */
r20628r20629
14931493
14941494   memset(m_lookup_ram, 0, ARRAY_LENGTH(m_lookup_ram));
14951495
1496   machine().device("maincpu")->execute().set_irq_acknowledge_callback(irq_callback);
1496   machine().device("maincpu")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(mazerbla_state::irq_callback),this));
14971497}
14981498
14991499
trunk/src/mame/drivers/ms32.c
r20628r20629
389389   return m_f1superb_extraram_16[offset];
390390}
391391
392static void irq_raise(running_machine &machine, int level);
393
394392WRITE32_MEMBER(ms32_state::ms32_irq2_guess_w)
395393{
396   irq_raise(machine(), 2);
394   irq_raise(2);
397395}
398396
399397WRITE32_MEMBER(ms32_state::ms32_irq5_guess_w)
400398{
401   irq_raise(machine(), 5);
399   irq_raise(5);
402400}
403401
404402static ADDRESS_MAP_START( f1superb_map, AS_PROGRAM, 32, ms32_state )
r20628r20629
12771275*/
12781276
12791277
1280static IRQ_CALLBACK(irq_callback)
1278IRQ_CALLBACK_MEMBER(ms32_state::irq_callback)
12811279{
1282   ms32_state *state = device->machine().driver_data<ms32_state>();
12831280   int i;
1284   for(i=15; i>=0 && !(state->m_irqreq & (1<<i)); i--);
1285   state->m_irqreq &= ~(1<<i);
1286   if(!state->m_irqreq)
1287      device->execute().set_input_line(0, CLEAR_LINE);
1281   for(i=15; i>=0 && !(m_irqreq & (1<<i)); i--);
1282   m_irqreq &= ~(1<<i);
1283   if(!m_irqreq)
1284      device.execute().set_input_line(0, CLEAR_LINE);
12881285   return i;
12891286}
12901287
1291static void irq_init(running_machine &machine)
1288void ms32_state::irq_init()
12921289{
1293   ms32_state *state = machine.driver_data<ms32_state>();
1294   state->m_irqreq = 0;
1295   machine.device("maincpu")->execute().set_input_line(0, CLEAR_LINE);
1296   machine.device("maincpu")->execute().set_irq_acknowledge_callback(irq_callback);
1290   m_irqreq = 0;
1291   machine().device("maincpu")->execute().set_input_line(0, CLEAR_LINE);
1292   machine().device("maincpu")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(ms32_state::irq_callback),this));
12971293}
12981294
1299static void irq_raise(running_machine &machine, int level)
1295void ms32_state::irq_raise(int level)
13001296{
1301   ms32_state *state = machine.driver_data<ms32_state>();
1302   state->m_irqreq |= (1<<level);
1303   machine.device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
1297   m_irqreq |= (1<<level);
1298   machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
13041299}
13051300
13061301/* TODO: fix this arrangement (derived from old deprecat lib) */
13071302TIMER_DEVICE_CALLBACK_MEMBER(ms32_state::ms32_interrupt)
13081303{
13091304   int scanline = param;
1310   if( scanline == 0) irq_raise(machine(), 10);
1311   if( scanline == 8) irq_raise(machine(), 9);
1305   if( scanline == 0) irq_raise(10);
1306   if( scanline == 8) irq_raise(9);
13121307   /* hayaosi1 needs at least 12 IRQ 0 per frame to work (see code at FFE02289)
13131308      kirarast needs it too, at least 8 per frame, but waits for a variable amount
13141309      47pi2 needs ?? per frame (otherwise it hangs when you lose)
r20628r20629
13171312      desertwr
13181313      p47aces
13191314      */
1320   if( (scanline % 8) == 0 && scanline <= 224 ) irq_raise(machine(), 0);
1315   if( (scanline % 8) == 0 && scanline <= 224 ) irq_raise(0);
13211316}
13221317
13231318
r20628r20629
13591354WRITE8_MEMBER(ms32_state::to_main_w)
13601355{
13611356   m_to_main=data;
1362   irq_raise(machine(), 1);
1357   irq_raise(1);
13631358}
13641359
13651360static ADDRESS_MAP_START( ms32_sound_map, AS_PROGRAM, 8, ms32_state )
r20628r20629
13841379   machine().root_device().membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base());
13851380   machine().root_device().membank("bank4")->set_entry(0);
13861381   machine().root_device().membank("bank5")->set_entry(1);
1387   irq_init(machine());
1382   irq_init();
13881383}
13891384
13901385/********** MACHINE DRIVER **********/
trunk/src/mame/drivers/ssv.c
r20628r20629
176176***************************************************************************/
177177
178178/* Update the IRQ state based on all possible causes */
179static void update_irq_state(running_machine &machine)
179void ssv_state::update_irq_state()
180180{
181   ssv_state *state = machine.driver_data<ssv_state>();
182
183   machine.device("maincpu")->execute().set_input_line(0, (state->m_requested_int & state->m_irq_enable)? ASSERT_LINE : CLEAR_LINE);
181   machine().device("maincpu")->execute().set_input_line(0, (m_requested_int & m_irq_enable)? ASSERT_LINE : CLEAR_LINE);
184182}
185183
186static IRQ_CALLBACK(ssv_irq_callback)
184IRQ_CALLBACK_MEMBER(ssv_state::ssv_irq_callback)
187185{
188   ssv_state *state = device->machine().driver_data<ssv_state>();
189
190186   int i;
191187   for ( i = 0; i <= 7; i++ )
192188   {
193      if (state->m_requested_int & (1 << i))
189      if (m_requested_int & (1 << i))
194190      {
195         UINT16 vector = state->m_irq_vectors[i * (16/2)] & 7;
191         UINT16 vector = m_irq_vectors[i * (16/2)] & 7;
196192         return vector;
197193      }
198194   }
r20628r20629
205201
206202   m_requested_int &= ~(1 << level);
207203
208   update_irq_state(machine());
204   update_irq_state();
209205}
210206
211207/*
r20628r20629
240236      if (m_interrupt_ultrax)
241237      {
242238         m_requested_int |= 1 << 1;  // needed by ultrax to coin up, breaks cairblad
243         update_irq_state(machine());
239         update_irq_state();
244240      }
245241   }
246242   else if(scanline == 240)
247243   {
248244      m_requested_int |= 1 << 3;  // vblank
249      update_irq_state(machine());
245      update_irq_state();
250246   }
251247}
252248
r20628r20629
257253   if ((scanline % 64) == 0)
258254   {
259255      m_requested_int |= 1 << 6;  // reads lightgun (4 times for 4 axis)
260      update_irq_state(machine());
256      update_irq_state();
261257   }
262258   else if(scanline == 240)
263259   {
264260      m_requested_int |= 1 << 3;  // vblank
265      update_irq_state(machine());
261      update_irq_state();
266262   }
267263}
268264
r20628r20629
321317void ssv_state::machine_reset()
322318{
323319   m_requested_int = 0;
324   machine().device("maincpu")->execute().set_irq_acknowledge_callback(ssv_irq_callback);
320   machine().device("maincpu")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(ssv_state::ssv_irq_callback),this));
325321   membank("bank1")->set_base(memregion("user1")->base());
326322}
327323
trunk/src/mame/drivers/pcxt.c
r20628r20629
125125   DECLARE_DRIVER_INIT(filetto);
126126   virtual void machine_reset();
127127   UINT32 screen_update_tetriskr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
128   IRQ_CALLBACK_MEMBER(irq_callback);
128129};
129130
130131UINT32 pcxt_state::screen_update_tetriskr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
r20628r20629
541542   DEVCB_NULL
542543};
543544
544static IRQ_CALLBACK(irq_callback)
545IRQ_CALLBACK_MEMBER(pcxt_state::irq_callback)
545546{
546   pcxt_state *state = device->machine().driver_data<pcxt_state>();
547   return pic8259_acknowledge(state->m_pic8259_1);
547   return pic8259_acknowledge(m_pic8259_1);
548548}
549549
550550static ADDRESS_MAP_START( filetto_map, AS_PROGRAM, 8, pcxt_state )
r20628r20629
716716   device_t *speaker = machine().device("speaker");
717717   m_bank = -1;
718718   m_lastvalue = -1;
719   machine().device("maincpu")->execute().set_irq_acknowledge_callback(irq_callback);
719   machine().device("maincpu")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(pcxt_state::irq_callback),this));
720720
721721   m_pc_spkrdata = 0;
722722   m_pc_input = 0;
trunk/src/mame/drivers/dcheese.c
r20628r20629
4747 *
4848 *************************************/
4949
50static void update_irq_state( device_t *cpu )
50void dcheese_state::update_irq_state()
5151{
52   dcheese_state *state = cpu->machine().driver_data<dcheese_state>();
53
5452   int i;
5553   for (i = 1; i < 5; i++)
56      cpu->execute().set_input_line(i, state->m_irq_state[i] ? ASSERT_LINE : CLEAR_LINE);
54      m_maincpu->set_input_line(i, m_irq_state[i] ? ASSERT_LINE : CLEAR_LINE);
5755}
5856
5957
60static IRQ_CALLBACK( irq_callback )
58IRQ_CALLBACK_MEMBER(dcheese_state::irq_callback)
6159{
62   dcheese_state *state = device->machine().driver_data<dcheese_state>();
63
6460   /* auto-ack the IRQ */
65   state->m_irq_state[irqline] = 0;
66   update_irq_state(device);
61   m_irq_state[irqline] = 0;
62   update_irq_state();
6763
6864   /* vector is 0x40 + index */
6965   return 0x40 + irqline;
7066}
7167
7268
73void dcheese_signal_irq( running_machine &machine, int which )
69void dcheese_state::dcheese_signal_irq(int which )
7470{
75   dcheese_state *state = machine.driver_data<dcheese_state>();
76
77   state->m_irq_state[which] = 1;
78   update_irq_state(state->m_maincpu);
71   m_irq_state[which] = 1;
72   update_irq_state();
7973}
8074
8175
8276INTERRUPT_GEN_MEMBER(dcheese_state::dcheese_vblank)
8377{
8478   logerror("---- VBLANK ----\n");
85   dcheese_signal_irq(machine(), 4);
79   dcheese_signal_irq(4);
8680}
8781
8882
r20628r20629
9993   m_audiocpu = machine().device<cpu_device>("audiocpu");
10094   m_bsmt = machine().device("bsmt");
10195
102   m_maincpu->set_irq_acknowledge_callback(irq_callback);
96   m_maincpu->set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(dcheese_state::irq_callback),this));
10397
10498   save_item(NAME(m_irq_state));
10599   save_item(NAME(m_soundlatch_full));
trunk/src/mame/drivers/quakeat.c
r20628r20629
7777   virtual void machine_start();
7878   virtual void video_start();
7979   UINT32 screen_update_quake(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
80   IRQ_CALLBACK_MEMBER(irq_callback);
8081};
8182
8283
r20628r20629
152153
153154/*************************************************************/
154155
155static IRQ_CALLBACK(irq_callback)
156IRQ_CALLBACK_MEMBER(quakeat_state::irq_callback)
156157{
157   quakeat_state *state = device->machine().driver_data<quakeat_state>();
158   return pic8259_acknowledge( state->m_pic8259_1);
158   return pic8259_acknowledge(m_pic8259_1);
159159}
160160
161161void quakeat_state::machine_start()
162162{
163   machine().device("maincpu")->execute().set_irq_acknowledge_callback(irq_callback);
163   machine().device("maincpu")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(quakeat_state::irq_callback),this));
164164
165165   m_pic8259_1 = machine().device( "pic8259_1" );
166166   m_pic8259_2 = machine().device( "pic8259_2" );
trunk/src/mame/drivers/aztarac.c
r20628r20629
2929 *
3030 *************************************/
3131
32static IRQ_CALLBACK(aztarac_irq_callback)
32IRQ_CALLBACK_MEMBER(aztarac_state::aztarac_irq_callback)
3333{
3434   return 0xc;
3535}
r20628r20629
3737
3838void aztarac_state::machine_reset()
3939{
40   machine().device("maincpu")->execute().set_irq_acknowledge_callback(aztarac_irq_callback);
40   machine().device("maincpu")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(aztarac_state::aztarac_irq_callback),this));
4141}
4242
4343
trunk/src/mame/drivers/metro.c
r20628r20629
140140
141141
142142/* Update the IRQ state based on all possible causes */
143static void update_irq_state( running_machine &machine )
143void metro_state::update_irq_state()
144144{
145   metro_state *state = machine.driver_data<metro_state>();
146   address_space &space = state->m_maincpu->space(AS_PROGRAM);
145   address_space &space = m_maincpu->space(AS_PROGRAM);
147146
148147   /*  Get the pending IRQs (only the enabled ones, e.g. where irq_enable is *0*)  */
149   UINT16 irq = state->metro_irq_cause_r(space, 0, 0xffff) & ~*state->m_irq_enable;
148   UINT16 irq = metro_irq_cause_r(space, 0, 0xffff) & ~*m_irq_enable;
150149
151   if (state->m_irq_line == -1)    /* mouja, gakusai, gakusai2, dokyusei, dokyusp */
150   if (m_irq_line == -1)    /* mouja, gakusai, gakusai2, dokyusei, dokyusp */
152151   {
153152      /*  This is for games that supply an *IRQ Vector* on the data bus together with an IRQ level for each possible IRQ source */
154153      UINT8 irq_level[8] = { 0 };
r20628r20629
156155
157156      for (i = 0; i < 8; i++)
158157         if (BIT(irq, i))
159            irq_level[state->m_irq_levels[i] & 7] = 1;
158            irq_level[m_irq_levels[i] & 7] = 1;
160159
161160      for (i = 0; i < 8; i++)
162         state->m_maincpu->set_input_line(i, irq_level[i] ? ASSERT_LINE : CLEAR_LINE);
161         m_maincpu->set_input_line(i, irq_level[i] ? ASSERT_LINE : CLEAR_LINE);
163162   }
164163   else
165164   {
r20628r20629
167166          then reads the actual source by peeking a register (metro_irq_cause_r) */
168167
169168      int irq_state = (irq ? ASSERT_LINE : CLEAR_LINE);
170      state->m_maincpu->set_input_line(state->m_irq_line, irq_state);
169      m_maincpu->set_input_line(m_irq_line, irq_state);
171170   }
172171}
173172
174173
175174/* For games that supply an *IRQ Vector* on the data bus */
176static IRQ_CALLBACK( metro_irq_callback )
175IRQ_CALLBACK_MEMBER(metro_state::metro_irq_callback)
177176{
178   metro_state *state = device->machine().driver_data<metro_state>();
179
180   // logerror("%s: irq callback returns %04X\n", device->machine().describe_context(), state->m_irq_vectors[int_level]);
181   return state->m_irq_vectors[irqline] & 0xff;
177   // logerror("%s: irq callback returns %04X\n", device.machine().describe_context(), m_irq_vectors[int_level]);
178   return m_irq_vectors[irqline] & 0xff;
182179}
183180
184181
r20628r20629
194191         if (BIT(data, i)) m_requested_int[i] = 0;
195192   }
196193
197   update_irq_state(machine());
194   update_irq_state();
198195}
199196
200197INTERRUPT_GEN_MEMBER(metro_state::metro_vblank_interrupt)
201198{
202199   m_requested_int[m_vblank_bit] = 1;
203   update_irq_state(machine());
200   update_irq_state();
204201}
205202
206203INTERRUPT_GEN_MEMBER(metro_state::metro_periodic_interrupt)
207204{
208205   m_requested_int[4] = 1;
209   update_irq_state(machine());
206   update_irq_state();
210207}
211208
212209TIMER_CALLBACK_MEMBER(metro_state::karatour_irq_callback)
r20628r20629
223220   machine().scheduler().timer_set(attotime::from_usec(2500), timer_expired_delegate(FUNC(metro_state::karatour_irq_callback),this));
224221   m_requested_int[5] = 1;
225222
226   update_irq_state(machine());
223   update_irq_state();
227224}
228225
229226TIMER_CALLBACK_MEMBER(metro_state::mouja_irq_callback)
230227{
231228   m_requested_int[0] = 1;
232   update_irq_state(machine());
229   update_irq_state();
233230}
234231
235232WRITE16_MEMBER(metro_state::mouja_irq_timer_ctrl_w)
r20628r20629
242239INTERRUPT_GEN_MEMBER(metro_state::puzzlet_interrupt)
243240{
244241   m_requested_int[m_vblank_bit] = 1;
245   update_irq_state(machine());
242   update_irq_state();
246243
247244   m_maincpu->set_input_line(H8_METRO_TIMER_HACK, HOLD_LINE);
248245}
r20628r20629
558555TIMER_CALLBACK_MEMBER(metro_state::metro_blit_done)
559556{
560557   m_requested_int[m_blitter_bit] = 1;
561   update_irq_state(machine());
558   update_irq_state();
562559}
563560
564561INLINE int blt_read( const UINT8 *ROM, const int offs )
r20628r20629
35813578MACHINE_RESET_MEMBER(metro_state,metro)
35823579{
35833580   if (m_irq_line == -1)
3584      machine().device("maincpu")->execute().set_irq_acknowledge_callback(metro_irq_callback);
3581      machine().device("maincpu")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(metro_state::metro_irq_callback),this));
35853582}
35863583
35873584
trunk/src/mame/drivers/seibuspi.c
r20628r20629
17941794   device.execute().set_input_line(0, ASSERT_LINE );
17951795}
17961796
1797static IRQ_CALLBACK(spi_irq_callback)
1797IRQ_CALLBACK_MEMBER(seibuspi_state::spi_irq_callback)
17981798{
17991799   return 0x20;
18001800}
r20628r20629
18151815   UINT8 flash_data = rombase[0x1ffffc];
18161816
18171817   machine().device("soundcpu")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE );
1818   machine().device("maincpu")->execute().set_irq_acknowledge_callback(spi_irq_callback);
1818   machine().device("maincpu")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(seibuspi_state::spi_irq_callback),this));
18191819
18201820   machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x00000680, 0x00000683, read32_delegate(FUNC(seibuspi_state::sound_fifo_r),this));
18211821   machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x00000688, 0x0000068b, write32_delegate(FUNC(seibuspi_state::z80_prg_fifo_w),this));
r20628r20629
19021902   machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_handler(0x0000068c, 0x0000068f, write32_delegate(FUNC(seibuspi_state::eeprom_w),this));
19031903   machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_handler(0x00000680, 0x00000683, read32_delegate(FUNC(seibuspi_state::sb_coin_r),this));
19041904
1905   machine().device("maincpu")->execute().set_irq_acknowledge_callback(spi_irq_callback);
1905   machine().device("maincpu")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(seibuspi_state::spi_irq_callback),this));
19061906
19071907   m_sb_coin_latch = 0;
19081908}
r20628r20629
21842184
21852185MACHINE_RESET_MEMBER(seibuspi_state,seibu386)
21862186{
2187   machine().device("maincpu")->execute().set_irq_acknowledge_callback(spi_irq_callback);
2187   machine().device("maincpu")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(seibuspi_state::spi_irq_callback),this));
21882188}
21892189
21902190static MACHINE_CONFIG_START( seibu386, seibuspi_state )
trunk/src/mame/machine/megacd.c
r20628r20629
1414
1515/* Callback when the genesis enters interrupt code */
1616// needs to be a member
17static IRQ_CALLBACK(segacd_sub_int_callback)
17IRQ_CALLBACK_MEMBER(sega_segacd_device::segacd_sub_int_callback)
1818{
1919   if (irqline==2)
2020   {
2121      // clear this bit
2222      a12000_halt_reset_reg &= ~0x0100;
23      device->machine().device(":segacd:segacd_68k")->execute().set_input_line(2, CLEAR_LINE);
23      device.machine().device(":segacd:segacd_68k")->execute().set_input_line(2, CLEAR_LINE);
2424   }
2525
2626   return (0x60+irqline*4)/4; // vector address
r20628r20629
16091609
16101610
16111611
1612   machine().device(":segacd:segacd_68k")->execute().set_irq_acknowledge_callback(segacd_sub_int_callback);
1612   machine().device(":segacd:segacd_68k")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(sega_segacd_device::segacd_sub_int_callback),this));
16131613
16141614   space.install_read_handler (0x0000070, 0x0000073, read16_delegate(FUNC(sega_segacd_device::scd_hint_vector_r),this) );
16151615
trunk/src/mame/machine/megacd.h
r20628r20629
356356   WRITE16_MEMBER( segacd_font_color_w );
357357   READ16_MEMBER( segacd_font_converted_r );
358358   TIMER_DEVICE_CALLBACK_MEMBER( scd_dma_timer_callback );
359   IRQ_CALLBACK_MEMBER(segacd_sub_int_callback);
359360
360361   void SegaCD_CDC_Do_DMA( int &dmacount, UINT8 *CDC_BUFFER, UINT16 &dma_addrc, UINT16 &destination );
361362   timer_device* scd_dma_timer;
trunk/src/mame/machine/fd1094.c
r20628r20629
721721   // register for the state changing callbacks we need in the m68000
722722   m68k_set_cmpild_callback(this, &fd1094_device::cmp_callback);
723723   m68k_set_rte_callback(this, &fd1094_device::rte_callback);
724   set_irq_acknowledge_callback(&fd1094_device::irq_callback);
724   set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(fd1094_device::irq_callback),this));
725725
726726   // save state
727727   save_item(NAME(m_state));
r20628r20629
987987//  interrupt code
988988//-------------------------------------------------
989989
990IRQ_CALLBACK( fd1094_device::irq_callback )
990IRQ_CALLBACK_MEMBER( fd1094_device::irq_callback )
991991{
992   downcast<fd1094_device *>(device)->change_state(STATE_IRQ);
992   change_state(STATE_IRQ);
993993   return (0x60 + irqline * 4) / 4; // vector address
994994}
995995
trunk/src/mame/machine/fd1094.h
r20628r20629
9595   UINT16 decrypt_one(offs_t address, UINT16 val, const UINT8 *main_key, UINT8 state, bool vector_fetch);
9696   void decrypt(offs_t baseaddr, UINT32 size, const UINT16 *srcptr, UINT16 *opcodesptr, UINT8 state);
9797   void default_state_change(UINT8 state);
98   IRQ_CALLBACK_MEMBER( irq_callback );
9899
99100   // static helpers
100101   static void cmp_callback(device_t *device, UINT32 val, UINT8 reg);
101   static IRQ_CALLBACK( irq_callback );
102102   static void rte_callback(device_t *device);
103103
104104   // internal state
trunk/src/mame/machine/galaxold.c
r20628r20629
1212#include "includes/galaxold.h"
1313
1414
15static IRQ_CALLBACK(hunchbkg_irq_callback)
15IRQ_CALLBACK_MEMBER(galaxold_state::hunchbkg_irq_callback)
1616{
1717   //galaxold_state *state = device->machine().driver_data<galaxold_state>();
1818   /* for some reason a call to cputag_set_input_line
r20628r20629
2222    *
2323    * Therefore we reset the line without any detour ....
2424    */
25   device->machine().firstcpu->set_input_line(0, CLEAR_LINE);
25   device.machine().firstcpu->set_input_line(0, CLEAR_LINE);
2626   //cpu_set_info(device->machine().firstcpu, CPUINFO_INT_INPUT_STATE + state->m_irq_line, CLEAR_LINE);
2727   return 0x03;
2828}
r20628r20629
9797MACHINE_RESET_MEMBER(galaxold_state,hunchbkg)
9898{
9999   machine_reset_common(machine(), 0);
100   machine().device("maincpu")->execute().set_irq_acknowledge_callback(hunchbkg_irq_callback);
100   machine().device("maincpu")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(galaxold_state::hunchbkg_irq_callback),this));
101101}
102102
103103WRITE8_MEMBER(galaxold_state::galaxold_coin_lockout_w)
trunk/src/mame/machine/mie.c
r20628r20629
9191   jvs = 0;
9292}
9393
94IRQ_CALLBACK(mie_device::irq_callback_1)
95{
96   return downcast<mie_device *>(device->owner())->irq_callback();
97}
98
9994void mie_device::device_start()
10095{
10196   maple_device::device_start();
10297   cpu = subdevice<z80_device>("mie");
10398   timer = timer_alloc(0);
104   cpu->set_irq_acknowledge_callback(irq_callback_1);
99   cpu->set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(mie_device::irq_callback),this));
105100   jvs = machine().device<mie_jvs_device>(jvs_name);
106101
107102   save_item(NAME(gpiodir));
r20628r20629
270265   cpu->set_input_line(0, irq_enable & irq_pending & 0x7f ? ASSERT_LINE : CLEAR_LINE);
271266}
272267
273int mie_device::irq_callback()
268IRQ_CALLBACK_MEMBER(mie_device::irq_callback)
274269{
275270   if(!(irq_enable & irq_pending & 0x7f))
276271      throw emu_fatalerror("MIE irq callback called with enable=%02x, pending=%02x", irq_enable, irq_pending);
trunk/src/mame/machine/mie.h
r20628r20629
6666   DECLARE_READ8_MEMBER(read_00);
6767   DECLARE_READ8_MEMBER(read_78xx);
6868
69   static IRQ_CALLBACK(irq_callback_1);
69   IRQ_CALLBACK_MEMBER(irq_callback);
7070
7171   void maple_w(const UINT32 *data, UINT32 in_size);
7272   virtual void maple_reset();
r20628r20629
109109
110110   void raise_irq(int level);
111111   void recalc_irq();
112   int irq_callback();
113112};
114113
115114// Trampoline class, required for device discovery
trunk/src/mame/video/dcheese.c
r20628r20629
4747 *
4848 *************************************/
4949
50static void update_scanline_irq( running_machine &machine )
50void dcheese_state::update_scanline_irq()
5151{
52   dcheese_state *state = machine.driver_data<dcheese_state>();
53
5452   /* if not in range, don't bother */
55   if (state->m_blitter_vidparam[0x22/2] <= state->m_blitter_vidparam[0x1e/2])
53   if (m_blitter_vidparam[0x22/2] <= m_blitter_vidparam[0x1e/2])
5654   {
5755      int effscan;
5856      attotime time;
5957
6058      /* compute the effective scanline of the interrupt */
61      effscan = state->m_blitter_vidparam[0x22/2] - state->m_blitter_vidparam[0x1a/2];
59      effscan = m_blitter_vidparam[0x22/2] - m_blitter_vidparam[0x1a/2];
6260      if (effscan < 0)
63         effscan += state->m_blitter_vidparam[0x1e/2];
61         effscan += m_blitter_vidparam[0x1e/2];
6462
6563      /* determine the time; if it's in this scanline, bump to the next frame */
66      time = machine.primary_screen->time_until_pos(effscan);
67      if (time < machine.primary_screen->scan_period())
68         time += machine.primary_screen->frame_period();
69      state->m_blitter_timer->adjust(time);
64      time = machine().primary_screen->time_until_pos(effscan);
65      if (time < machine().primary_screen->scan_period())
66         time += machine().primary_screen->frame_period();
67      m_blitter_timer->adjust(time);
7068   }
7169}
7270
7371
7472TIMER_CALLBACK_MEMBER(dcheese_state::blitter_scanline_callback)
7573{
76   dcheese_signal_irq(machine(), 3);
77   update_scanline_irq(machine());
74   dcheese_signal_irq(3);
75   update_scanline_irq();
7876}
7977
8078
8179TIMER_CALLBACK_MEMBER(dcheese_state::dcheese_signal_irq_callback)
8280{
83   dcheese_signal_irq(machine(), param);
81   dcheese_signal_irq(param);
8482}
8583
8684
r20628r20629
267265         break;
268266
269267      case 0x22/2:        /* scanline interrupt */
270         update_scanline_irq(machine());
268         update_scanline_irq();
271269         break;
272270
273271      case 0x24/2:        /* writes here after writing to 0x28 */
trunk/src/mame/includes/galaxold.h
r20628r20629
187187   DECLARE_WRITE_LINE_MEMBER(galaxold_7474_9m_2_q_callback);
188188   DECLARE_WRITE_LINE_MEMBER(galaxold_7474_9m_1_callback);
189189   DECLARE_VIDEO_START(bagmanmc);
190   IRQ_CALLBACK_MEMBER(hunchbkg_irq_callback);
190191};
191192
192193/*----------- defined in video/galaxold.c -----------*/
trunk/src/mame/includes/ssv.h
r20628r20629
130130   UINT32 screen_update_eaglshot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
131131   TIMER_DEVICE_CALLBACK_MEMBER(ssv_interrupt);
132132   TIMER_DEVICE_CALLBACK_MEMBER(gdfs_interrupt);
133   void update_irq_state();
134   IRQ_CALLBACK_MEMBER(ssv_irq_callback);
133135};
134136
135137/*----------- defined in video/ssv.c -----------*/
trunk/src/mame/includes/metro.h
r20628r20629
176176   TIMER_CALLBACK_MEMBER(karatour_irq_callback);
177177   TIMER_CALLBACK_MEMBER(mouja_irq_callback);
178178   TIMER_CALLBACK_MEMBER(metro_blit_done);
179   void update_irq_state();
180   IRQ_CALLBACK_MEMBER(metro_irq_callback);
179181};
180182
181183
trunk/src/mame/includes/aztarac.h
r20628r20629
2828   virtual void machine_reset();
2929   virtual void video_start();
3030   INTERRUPT_GEN_MEMBER(aztarac_snd_timed_irq);
31   IRQ_CALLBACK_MEMBER(aztarac_irq_callback);
3132};
trunk/src/mame/includes/dcheese.h
r20628r20629
5050   INTERRUPT_GEN_MEMBER(dcheese_vblank);
5151   TIMER_CALLBACK_MEMBER(blitter_scanline_callback);
5252   TIMER_CALLBACK_MEMBER(dcheese_signal_irq_callback);
53   void dcheese_signal_irq(int which);
54   void update_irq_state();
55   IRQ_CALLBACK_MEMBER(irq_callback);
56   void update_scanline_irq();
5357};
5458
5559/*----------- defined in drivers/dcheese.c -----------*/
56void dcheese_signal_irq(running_machine &machine, int which);
trunk/src/mame/includes/seibuspi.h
r20628r20629
116116   UINT32 screen_update_spi(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
117117   UINT32 screen_update_sys386f2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
118118   INTERRUPT_GEN_MEMBER(spi_interrupt);
119   IRQ_CALLBACK_MEMBER(spi_irq_callback);
119120};
120121/*----------- defined in machine/spisprit.c -----------*/
121122void seibuspi_sprite_decrypt(UINT8 *src, int romsize);
trunk/src/mame/includes/ms32.h
r20628r20629
8989   DECLARE_VIDEO_START(f1superb);
9090   UINT32 screen_update_ms32(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
9191   TIMER_DEVICE_CALLBACK_MEMBER(ms32_interrupt);
92   IRQ_CALLBACK_MEMBER(irq_callback);
93   void irq_init();
94   void irq_raise(int level);
9295};
trunk/src/mess/includes/fm7.h
r20628r20629
250250   DECLARE_WRITE_LINE_MEMBER(fm7_fdc_drq_w);
251251   DECLARE_READ8_MEMBER(fm77av_joy_1_r);
252252   DECLARE_READ8_MEMBER(fm77av_joy_2_r);
253   IRQ_CALLBACK_MEMBER(fm7_irq_ack);
254   IRQ_CALLBACK_MEMBER(fm7_sub_irq_ack);
253255};
254256
255257#endif /*FM7_H_*/
trunk/src/mess/includes/fmtowns.h
r20628r20629
265265   DECLARE_WRITE_LINE_MEMBER(towns_pit_out0_changed);
266266   DECLARE_WRITE_LINE_MEMBER(towns_pit_out1_changed);
267267   DECLARE_READ8_MEMBER(get_slave_ack);
268   IRQ_CALLBACK_MEMBER(towns_irq_callback);
268269};
269270
270271class marty_state : public towns_state
trunk/src/mess/includes/tsispch.h
r20628r20629
4949   DECLARE_WRITE_LINE_MEMBER(i8251_txempty_int);
5050   DECLARE_WRITE_LINE_MEMBER(i8251_txrdy_int);
5151   DECLARE_WRITE_LINE_MEMBER(pic8259_set_int_line);
52   IRQ_CALLBACK_MEMBER(irq_callback);
5253};
5354
5455
trunk/src/mess/drivers/pc9801.c
r20628r20629
654654   inline UINT32 m_calc_grcg_addr(int i,UINT32 offset);
655655
656656   DECLARE_DRIVER_INIT(pc9801_kanji);
657   IRQ_CALLBACK_MEMBER(irq_callback);
657658};
658659
659660
r20628r20629
33303331      palette_set_color_rgb(machine(), i, pal1bit(0), pal1bit(0), pal1bit(0));
33313332}
33323333
3333static IRQ_CALLBACK(irq_callback)
3334IRQ_CALLBACK_MEMBER(pc9801_state::irq_callback)
33343335{
3335   return pic8259_acknowledge( device->machine().device( "pic8259_master" ));
3336   return pic8259_acknowledge( machine().device( "pic8259_master" ));
33363337}
33373338
33383339MACHINE_START_MEMBER(pc9801_state,pc9801_common)
33393340{
3340   machine().device("maincpu")->execute().set_irq_acknowledge_callback(irq_callback);
3341   machine().device("maincpu")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(pc9801_state::irq_callback),this));
33413342
33423343   m_rtc->cs_w(1);
33433344   m_rtc->oe_w(0); // TODO: unknown connection, MS-DOS 6.2x wants this low somehow with the test mode
trunk/src/mess/drivers/tsispch.c
r20628r20629
180180   DEVCB_NULL
181181};
182182
183static IRQ_CALLBACK(irq_callback)
183IRQ_CALLBACK_MEMBER(tsispch_state::irq_callback)
184184{
185   return pic8259_acknowledge(device->machine().device("pic8259"));
185   return pic8259_acknowledge(machine().device("pic8259"));
186186}
187187
188188/*****************************************************************************
r20628r20629
272272   int i;
273273   for (i=0; i<32; i++) m_infifo[i] = 0;
274274   m_infifo_tail_ptr = m_infifo_head_ptr = 0;
275   machine().device("maincpu")->execute().set_irq_acknowledge_callback(irq_callback);
275   machine().device("maincpu")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(tsispch_state::irq_callback),this));
276276   fprintf(stderr,"machine reset\n");
277277}
278278
trunk/src/mess/drivers/apc.c
r20628r20629
148148
149149   int m_dack;
150150   UINT8 m_dma_offset[4];
151   
152   IRQ_CALLBACK_MEMBER(irq_callback);
151153
152154protected:
153155   // driver_device overrides
r20628r20629
741743   pic8259_ir4_w(machine().device("pic8259_slave"), state);
742744}
743745
744static IRQ_CALLBACK(irq_callback)
746IRQ_CALLBACK_MEMBER(apc_state::irq_callback)
745747{
746   return pic8259_acknowledge( device->machine().device( "pic8259_master" ));
748   return pic8259_acknowledge( machine().device( "pic8259_master" ));
747749}
748750
749751void apc_state::machine_start()
750752{
751   machine().device("maincpu")->execute().set_irq_acknowledge_callback(irq_callback);
753   machine().device("maincpu")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(apc_state::irq_callback),this));
752754
753755   m_fdc->set_rate(500000);
754756   m_fdc->setup_intrq_cb(upd765a_device::line_cb(FUNC(apc_state::fdc_irq), this));
trunk/src/mess/drivers/prestige.c
r20628r20629
112112   DECLARE_WRITE8_MEMBER( mouse_w );
113113   virtual void palette_init();
114114   TIMER_DEVICE_CALLBACK_MEMBER(irq_timer);
115   IRQ_CALLBACK_MEMBER(prestige_int_ack);
115116};
116117
117118
r20628r20629
393394
394395INPUT_PORTS_END
395396
396static IRQ_CALLBACK( prestige_int_ack )
397IRQ_CALLBACK_MEMBER(prestige_state::prestige_int_ack)
397398{
398399   UINT32 vector;
399   prestige_state *state = device->machine().driver_data<prestige_state>();
400400
401   state->m_maincpu->set_input_line(0, CLEAR_LINE);
401   m_maincpu->set_input_line(0, CLEAR_LINE);
402402
403   if (state->m_irq_counter == 0x02)
403   if (m_irq_counter == 0x02)
404404   {
405      state->m_irq_counter = 0;
405      m_irq_counter = 0;
406406      vector = 0x0020;
407407   }
408408   else
409409   {
410      state->m_irq_counter++;
410      m_irq_counter++;
411411      vector = 0x0030;
412412   }
413413
r20628r20629
419419   UINT8 *ram = m_ram->pointer();
420420   memset(ram, 0x00, m_ram->size());
421421
422   m_maincpu->set_irq_acknowledge_callback(prestige_int_ack);
422   m_maincpu->set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(prestige_state::prestige_int_ack),this));
423423
424424   membank("bank1")->configure_entries(0, 64, memregion("maincpu")->base(), 0x4000);
425425   membank("bank2")->configure_entries(0, 64, memregion("maincpu")->base(), 0x4000);
trunk/src/mess/drivers/sm1800.c
r20628r20629
4343   virtual void machine_reset();
4444   virtual void palette_init();
4545   INTERRUPT_GEN_MEMBER(sm1800_vblank_interrupt);
46   IRQ_CALLBACK_MEMBER(sm1800_irq_callback);
4647};
4748
4849static ADDRESS_MAP_START(sm1800_mem, AS_PROGRAM, 8, sm1800_state)
r20628r20629
6667static INPUT_PORTS_START( sm1800 )
6768INPUT_PORTS_END
6869
69static IRQ_CALLBACK(sm1800_irq_callback)
70IRQ_CALLBACK_MEMBER(sm1800_state::sm1800_irq_callback)
7071{
7172   return 0xff;
7273}
7374
7475void sm1800_state::machine_reset()
7576{
76   m_maincpu->set_irq_acknowledge_callback(sm1800_irq_callback);
77   m_maincpu->set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(sm1800_state::sm1800_irq_callback),this));
7778}
7879
7980INTERRUPT_GEN_MEMBER(sm1800_state::sm1800_vblank_interrupt)
trunk/src/mess/drivers/iq151.c
r20628r20629
9898   INTERRUPT_GEN_MEMBER(iq151_vblank_interrupt);
9999   DECLARE_INPUT_CHANGED_MEMBER(iq151_break);
100100   TIMER_DEVICE_CALLBACK_MEMBER(cassette_timer);
101   IRQ_CALLBACK_MEMBER(iq151_irq_callback);
101102};
102103
103104READ8_MEMBER(iq151_state::keyboard_row_r)
r20628r20629
327328   m_vblank_irq_state ^= 1;
328329}
329330
330static IRQ_CALLBACK(iq151_irq_callback)
331IRQ_CALLBACK_MEMBER(iq151_state::iq151_irq_callback)
331332{
332   iq151_state *state = device->machine().driver_data<iq151_state>();
333
334   return pic8259_acknowledge(state->m_pic);
333   return pic8259_acknowledge(m_pic);
335334}
336335
337336TIMER_DEVICE_CALLBACK_MEMBER(iq151_state::cassette_timer)
r20628r20629
347346   membank("boot")->configure_entry(0, RAM + 0xf800);
348347   membank("boot")->configure_entry(1, RAM + 0x0000);
349348
350   m_maincpu->set_irq_acknowledge_callback(iq151_irq_callback);
349   m_maincpu->set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(iq151_state::iq151_irq_callback),this));
351350
352351   // keep machine pointers to slots
353352   m_carts[0] = machine().device<iq151cart_slot_device>("slot1");
trunk/src/mess/drivers/qx10.c
r20628r20629
146146   virtual void palette_init();
147147   DECLARE_INPUT_CHANGED_MEMBER(key_stroke);
148148   DECLARE_WRITE_LINE_MEMBER(dma_hrq_changed);
149   IRQ_CALLBACK_MEMBER(irq_callback);
149150};
150151
151152static UPD7220_DISPLAY_PIXELS( hgdc_display_pixels )
r20628r20629
576577   DEVCB_NULL
577578};
578579
579static IRQ_CALLBACK( irq_callback )
580IRQ_CALLBACK_MEMBER(qx10_state::irq_callback)
580581{
581   return pic8259_acknowledge(device->machine().driver_data<qx10_state>()->m_pic_m );
582   return pic8259_acknowledge(m_pic_m);
582583}
583584
584585READ8_MEMBER( qx10_state::upd7201_r )
r20628r20629
908909
909910void qx10_state::machine_start()
910911{
911   machine().device("maincpu")->execute().set_irq_acknowledge_callback(irq_callback);
912   machine().device("maincpu")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(qx10_state::irq_callback),this));
912913   m_fdc->setup_intrq_cb(upd765a_device::line_cb(FUNC(qx10_state::qx10_upd765_interrupt), this));
913914   m_fdc->setup_drq_cb(upd765a_device::line_cb(FUNC(qx10_state::drq_w), this));
914915}
trunk/src/mess/drivers/pk8000.c
r20628r20629
3737   DECLARE_READ8_MEMBER(pk8000_84_porta_r);
3838   DECLARE_WRITE8_MEMBER(pk8000_84_porta_w);
3939   DECLARE_WRITE8_MEMBER(pk8000_84_portc_w);
40   IRQ_CALLBACK_MEMBER(pk8000_irq_callback);
4041};
4142
4243
r20628r20629
318319   device.execute().set_input_line(0, HOLD_LINE);
319320}
320321
321static IRQ_CALLBACK(pk8000_irq_callback)
322IRQ_CALLBACK_MEMBER(pk8000_state::pk8000_irq_callback)
322323{
323324   return 0xff;
324325}
r20628r20629
327328void pk8000_state::machine_reset()
328329{
329330   pk8000_set_bank(machine(),0);
330   machine().device("maincpu")->execute().set_irq_acknowledge_callback(pk8000_irq_callback);
331   machine().device("maincpu")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(pk8000_state::pk8000_irq_callback),this));
331332}
332333
333334void pk8000_state::video_start()
trunk/src/mess/drivers/fmtowns.c
r20628r20629
20162016   return 0x01;
20172017}
20182018
2019static IRQ_CALLBACK( towns_irq_callback )
2019IRQ_CALLBACK_MEMBER(towns_state::towns_irq_callback)
20202020{
2021   towns_state* state = device->machine().driver_data<towns_state>();
2022   return pic8259_acknowledge(state->m_pic_master);
2021   return pic8259_acknowledge(m_pic_master);
20232022}
20242023
20252024// YM3438 interrupt (IRQ 13)
r20628r20629
25112510   // CD-ROM init
25122511   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"));
25132512
2514   machine().device("maincpu")->execute().set_irq_acknowledge_callback(towns_irq_callback);
2513   machine().device("maincpu")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(towns_state::towns_irq_callback),this));
25152514   machine().device("maincpu")->memory().space(AS_PROGRAM).install_ram(0x100000,machine().device<ram_device>(RAM_TAG)->size()-1,0xffffffff,0,NULL);
25162515
25172516}
trunk/src/mess/drivers/pc88va.c
r20628r20629
151151   void fdc_drq(bool state);
152152   DECLARE_FLOPPY_FORMATS( floppy_formats );
153153   void pc88va_fdc_update_ready(floppy_image_device *, int);
154   IRQ_CALLBACK_MEMBER(pc88va_irq_callback);
154155};
155156
156157
r20628r20629
16121613   DEVCB_DRIVER_MEMBER(pc88va_state,r232_ctrl_portc_w)                     /* Port C write */
16131614};
16141615
1615static IRQ_CALLBACK(pc88va_irq_callback)
1616IRQ_CALLBACK_MEMBER(pc88va_state::pc88va_irq_callback)
16161617{
1617   return pic8259_acknowledge( device->machine().device( "pic8259_master" ) );
1618   return pic8259_acknowledge( machine().device( "pic8259_master" ) );
16181619}
16191620
16201621WRITE_LINE_MEMBER(pc88va_state::pc88va_pic_irq)
r20628r20629
16471648
16481649void pc88va_state::machine_start()
16491650{
1650   machine().device("maincpu")->execute().set_irq_acknowledge_callback(pc88va_irq_callback);
1651   machine().device("maincpu")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(pc88va_state::pc88va_irq_callback),this));
16511652
16521653   m_t3_mouse_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(pc88va_state::t3_mouse_callback),this));
16531654   m_t3_mouse_timer->adjust(attotime::never);
trunk/src/mess/drivers/fm7.c
r20628r20629
13361336   }
13371337}
13381338
1339static IRQ_CALLBACK(fm7_irq_ack)
1339IRQ_CALLBACK_MEMBER(fm7_state::fm7_irq_ack)
13401340{
13411341   if(irqline == M6809_FIRQ_LINE)
1342      device->machine().device("maincpu")->execute().set_input_line(irqline,CLEAR_LINE);
1342      machine().device("maincpu")->execute().set_input_line(irqline,CLEAR_LINE);
13431343   return -1;
13441344}
13451345
1346static IRQ_CALLBACK(fm7_sub_irq_ack)
1346IRQ_CALLBACK_MEMBER(fm7_state::fm7_sub_irq_ack)
13471347{
1348   device->machine().device("sub")->execute().set_input_line(irqline,CLEAR_LINE);
1348   machine().device("sub")->execute().set_input_line(irqline,CLEAR_LINE);
13491349   return -1;
13501350}
13511351
r20628r20629
18321832   m_subtimer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(fm7_state::fm7_subtimer_irq),this));
18331833   m_keyboard_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(fm7_state::fm7_keyboard_poll),this));
18341834   m_fm77av_vsync_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(fm7_state::fm77av_vsync),this));
1835   machine().device("maincpu")->execute().set_irq_acknowledge_callback(fm7_irq_ack);
1836   machine().device("sub")->execute().set_irq_acknowledge_callback(fm7_sub_irq_ack);
1835   machine().device("maincpu")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(fm7_state::fm7_irq_ack),this));
1836   machine().device("sub")->execute().set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(fm7_state::fm7_sub_irq_ack),this));
18371837}
18381838
18391839MACHINE_START_MEMBER(fm7_state,fm7)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team