Previous 199869 Revisions Next

r17998 Tuesday 18th September, 2012 at 14:45:06 UTC by Miodrag Milanović
INTERRUPT_GEN -> INTERRUPT_GEN_MEMBER for MESS part (no whatsnew)
[src/mess/drivers]alphasma.c apexc.c apple3.c aquarius.c arcadia.c b2m.c bbc.c bmjr.c bml3.c c128.c c64.c c65.c cbmb.c cgenie.c compis.c concept.c elwro800.c fmtowns.c fp1100.c galaxy.c gamecom.c gb.c geniusiq.c gmaster.c h19.c hec2hrp.c homelab.c homez80.c interact.c intv.c ip22.c iq151.c kaypro.c lisa.c mac.c mbee.c microtan.c msx.c mz2500.c newbrain.c ondra.c orion.c p2000t.c pasogo.c pc100.c pc2000.c pc6001.c pc8801.c pc88va.c pc9801.c pdp1.c pet.c pk8000.c pk8020.c plus4.c poly88.c primo.c pyl601.c rainbow.c rx78.c samcoupe.c sgi_ip2.c sgi_ip6.c sm1800.c smc777.c socrates.c spectrum.c supracan.c svision.c ti990_10.c ti990_4.c ti99_2.c tim011.c trs80.c tx0.c vc4000.c vector06.c vic10.c vic20.c vii.c vt100.c vt240.c vtech2.c x68k.c
[src/mess/includes]apple3.h arcadia.h b2m.h bbc.h c128.h c16.h c64.h c64_legacy.h c65.h cgenie.h compis.h concept.h fmtowns.h galaxy.h gamecom.h gb.h gmaster.h intv.h kaypro.h lisa.h lynx.h mac.h mbee.h microtan.h msx.h newbrain.h ondra.h orion.h p2000t.h pdp1.h pet.h pk8020.h plus4.h poly88.h primo.h samcoupe.h spectrum.h svision.h trs80.h tx0.h vc4000.h vector06.h vic10.h vic20.h vtech2.h x68k.h
[src/mess/machine]apple3.c b2m.c bbc.c c128.c c64.c c65.c cgenie.c compis.c concept.c galaxy.c gb.c intv.c kay_kbd.c lisa.c mbee.c microtan.c msx.c orion.c pet.c pk8020.c poly88.c primo.c trs80.c vector06.c
[src/mess/video]arcadia.c fmtowns.c vc4000.c

trunk/src/mess/machine/apple3.c
r17997r17998
246246   }
247247}
248248
249INTERRUPT_GEN( apple3_interrupt )
249INTERRUPT_GEN_MEMBER(apple3_state::apple3_interrupt)
250250{
251   via6522_device *via_1 = device->machine().device<via6522_device>("via6522_1");
251   via6522_device *via_1 = machine().device<via6522_device>("via6522_1");
252252
253   via_1->write_ca2((AY3600_keydata_strobe_r(device->machine()) & 0x80) ? 1 : 0);
254   via_1->write_cb1(device->machine().primary_screen->vblank());
255   via_1->write_cb2(device->machine().primary_screen->vblank());
253   via_1->write_ca2((AY3600_keydata_strobe_r(machine()) & 0x80) ? 1 : 0);
254   via_1->write_cb1(machine().primary_screen->vblank());
255   via_1->write_cb2(machine().primary_screen->vblank());
256256}
257257
258258
trunk/src/mess/machine/mbee.c
r17997r17998
559559   machine().scheduler().timer_set(attotime::from_usec(4), FUNC(mbee_reset));
560560}
561561
562INTERRUPT_GEN( mbee_interrupt )
562INTERRUPT_GEN_MEMBER(mbee_state::mbee_interrupt)
563563{
564564// Due to the uncertainly and hackage here, this is commented out for now - Robbbert - 05-Oct-2010
565565#if 0
566   mbee_state *state = device->machine().driver_data<mbee_state>();
567566
568   //address_space &space = *device->machine().device("maincpu")->memory().space(AS_PROGRAM);
567   //address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
569568   /* The printer status connects to the pio ASTB pin, and the printer changing to not
570569        busy should signal an interrupt routine at B61C, (next line) but this doesn't work.
571570        The line below does what the interrupt should be doing. */
572571   /* But it would break any program loaded to that area of memory, such as CP/M programs */
573572
574   //state->m_z80pio->strobe_a(centronics_busy_r(state->m_printer)); /* signal int when not busy (L->H) */
575   //space.write_byte(0x109, centronics_busy_r(state->m_printer));
573   //m_z80pio->strobe_a(centronics_busy_r(m_printer)); /* signal int when not busy (L->H) */
574   //space.write_byte(0x109, centronics_busy_r(m_printer));
576575
577576
578577   /* once per frame, pulse the PIO B bit 7 - it is in the schematic as an option,
579578    but need to find out what it does */
580   state->m_clock_pulse = 0x80;
579   m_clock_pulse = 0x80;
581580   irq0_line_hold(device);
582581
583582#endif
trunk/src/mess/machine/orion.c
r17997r17998
365365   radio86_init_keyboard(machine());
366366}
367367
368INTERRUPT_GEN( orionz80_interrupt )
368INTERRUPT_GEN_MEMBER(orion_state::orionz80_interrupt)
369369{
370   orion_state *state = device->machine().driver_data<orion_state>();
371   if ((state->m_orionz80_dispatcher & 0x40)==0x40)
370   if ((m_orionz80_dispatcher & 0x40)==0x40)
372371   {
373      device->execute().set_input_line(0, HOLD_LINE);
372      device.execute().set_input_line(0, HOLD_LINE);
374373   }
375374}
376375
trunk/src/mess/machine/microtan.c
r17997r17998
421421    microtan_set_irq_line(machine);
422422}
423423
424INTERRUPT_GEN( microtan_interrupt )
424INTERRUPT_GEN_MEMBER(microtan_state::microtan_interrupt)
425425{
426   microtan_state *state = device->machine().driver_data<microtan_state>();
427426    int mod, row, col, chg, newvar;
428427   static const char *const keynames[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6", "ROW7", "ROW8" };
429428
430    if( state->m_repeat )
429    if( m_repeat )
431430    {
432        if( !--state->m_repeat )
433            state->m_repeater = 4;
431        if( !--m_repeat )
432            m_repeater = 4;
434433    }
435    else if( state->m_repeater )
434    else if( m_repeater )
436435    {
437        state->m_repeat = state->m_repeater;
436        m_repeat = m_repeater;
438437    }
439438
440439
441440    row = 9;
442    newvar = device->machine().root_device().ioport("ROW8")->read();
443    chg = state->m_keyrows[--row] ^ newvar;
441    newvar = machine().root_device().ioport("ROW8")->read();
442    chg = m_keyrows[--row] ^ newvar;
444443
445444   while ( !chg && row > 0)
446445   {
447      newvar = device->machine().root_device().ioport(keynames[row - 1])->read();
448      chg = state->m_keyrows[--row] ^ newvar;
446      newvar = machine().root_device().ioport(keynames[row - 1])->read();
447      chg = m_keyrows[--row] ^ newvar;
449448   }
450449    if (!chg)
451450      --row;
452451
453452    if (row >= 0)
454453    {
455        state->m_repeater = 0x00;
456        state->m_mask = 0x00;
457        state->m_key = 0x00;
458        state->m_lastrow = row;
454        m_repeater = 0x00;
455        m_mask = 0x00;
456        m_key = 0x00;
457        m_lastrow = row;
459458        /* CapsLock LED */
460459      if( row == 3 && chg == 0x80 )
461         set_led_status(device->machine(), 1, (state->m_keyrows[3] & 0x80) ? 0 : 1);
460         set_led_status(machine(), 1, (m_keyrows[3] & 0x80) ? 0 : 1);
462461
463462        if (newvar & chg)  /* key(s) pressed ? */
464463        {
465464            mod = 0;
466465
467466            /* Shift modifier */
468            if ( (state->m_keyrows[5] & 0x10) || (state->m_keyrows[6] & 0x80) )
467            if ( (m_keyrows[5] & 0x10) || (m_keyrows[6] & 0x80) )
469468                mod |= 1;
470469
471470            /* Control modifier */
472            if (state->m_keyrows[3] & 0x40)
471            if (m_keyrows[3] & 0x40)
473472                mod |= 2;
474473
475474            /* CapsLock modifier */
476            if (state->m_keyrows[3] & 0x80)
475            if (m_keyrows[3] & 0x80)
477476                mod |= 4;
478477
479478            /* find newvar key */
480            state->m_mask = 0x01;
479            m_mask = 0x01;
481480            for (col = 0; col < 8; col ++)
482481            {
483                if (chg & state->m_mask)
482                if (chg & m_mask)
484483                {
485                    newvar &= state->m_mask;
486                    state->m_key = keyboard[mod][row][col];
484                    newvar &= m_mask;
485                    m_key = keyboard[mod][row][col];
487486                    break;
488487                }
489                state->m_mask <<= 1;
488                m_mask <<= 1;
490489            }
491            if( state->m_key )   /* normal key */
490            if( m_key )   /* normal key */
492491            {
493                state->m_repeater = 30;
494                store_key(device->machine(), state->m_key);
492                m_repeater = 30;
493                store_key(machine(), m_key);
495494            }
496495            else
497496            if( (row == 0) && (chg == 0x04) ) /* Ctrl-@ (NUL) */
498                store_key(device->machine(), 0);
499            state->m_keyrows[row] |= newvar;
497                store_key(machine(), 0);
498            m_keyrows[row] |= newvar;
500499        }
501500        else
502501        {
503            state->m_keyrows[row] = newvar;
502            m_keyrows[row] = newvar;
504503        }
505        state->m_repeat = state->m_repeater;
504        m_repeat = m_repeater;
506505    }
507506    else
508    if ( state->m_key && (state->m_keyrows[state->m_lastrow] & state->m_mask) && state->m_repeat == 0 )
507    if ( m_key && (m_keyrows[m_lastrow] & m_mask) && m_repeat == 0 )
509508    {
510        store_key(device->machine(), state->m_key);
509        store_key(machine(), m_key);
511510    }
512511}
513512
trunk/src/mess/machine/poly88.c
r17997r17998
216216   machine().scheduler().timer_set(attotime::zero, FUNC(setup_machine_state));
217217}
218218
219INTERRUPT_GEN( poly88_interrupt )
219INTERRUPT_GEN_MEMBER(poly88_state::poly88_interrupt)
220220{
221   poly88_state *state = device->machine().driver_data<poly88_state>();
222   state->m_int_vector = 0xf7;
223   device->execute().set_input_line(0, HOLD_LINE);
221   m_int_vector = 0xf7;
222   device.execute().set_input_line(0, HOLD_LINE);
224223}
225224
226225static WRITE_LINE_DEVICE_HANDLER( poly88_usart_rxready )
trunk/src/mess/machine/trs80.c
r17997r17998
624624 *
625625 *************************************/
626626
627INTERRUPT_GEN( trs80_rtc_interrupt )
627INTERRUPT_GEN_MEMBER(trs80_state::trs80_rtc_interrupt)
628628{
629   trs80_state *state = device->machine().driver_data<trs80_state>();
630629/* This enables the processing of interrupts for the clock and the flashing cursor.
631630    The OS counts one tick for each interrupt. The Model I has 40 ticks per
632631    second, while the Model III/4 has 30. */
633632
634   if (state->m_model4)   // Model 4
633   if (m_model4)   // Model 4
635634   {
636      if (state->m_mask & IRQ_M4_RTC)
635      if (m_mask & IRQ_M4_RTC)
637636      {
638         state->m_irq |= IRQ_M4_RTC;
639         device->execute().set_input_line(0, HOLD_LINE);
637         m_irq |= IRQ_M4_RTC;
638         device.execute().set_input_line(0, HOLD_LINE);
640639      }
641640   }
642641   else      // Model 1
643642   {
644      state->m_irq |= IRQ_M1_RTC;
645      device->execute().set_input_line(0, HOLD_LINE);
643      m_irq |= IRQ_M1_RTC;
644      device.execute().set_input_line(0, HOLD_LINE);
646645   }
647646}
648647
r17997r17998
664663   }
665664}
666665
667INTERRUPT_GEN( trs80_fdc_interrupt )   /* not used - should it be? */
666INTERRUPT_GEN_MEMBER(trs80_state::trs80_fdc_interrupt)/* not used - should it be? */
668667{
669   trs80_fdc_interrupt_internal(device->machine());
668   trs80_fdc_interrupt_internal(machine());
670669}
671670
672671static WRITE_LINE_DEVICE_HANDLER( trs80_fdc_intrq_w )
trunk/src/mess/machine/primo.c
r17997r17998
3131
3232*******************************************************************************/
3333
34INTERRUPT_GEN( primo_vblank_interrupt )
34INTERRUPT_GEN_MEMBER(primo_state::primo_vblank_interrupt)
3535{
36   primo_state *state = device->machine().driver_data<primo_state>();
37   if (state->m_nmi)
38      device->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
36   if (m_nmi)
37      device.execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
3938}
4039
4140/*******************************************************************************
trunk/src/mess/machine/intv.c
r17997r17998
671671   state->m_backtab_row += 1;
672672}
673673
674INTERRUPT_GEN( intv_interrupt )
674INTERRUPT_GEN_MEMBER(intv_state::intv_interrupt)
675675{
676   intv_state *state = device->machine().driver_data<intv_state>();
677   device->machine().device("maincpu")->execute().set_input_line(CP1610_INT_INTRM, ASSERT_LINE);
678   state->m_sr1_int_pending = 1;
679   state->m_bus_copy_mode = 1;
680   state->m_backtab_row = 0;
676   machine().device("maincpu")->execute().set_input_line(CP1610_INT_INTRM, ASSERT_LINE);
677   m_sr1_int_pending = 1;
678   m_bus_copy_mode = 1;
679   m_backtab_row = 0;
681680   UINT8 row;
682   device->machine().device("maincpu")->execute().adjust_icount(-(12*STIC_ROW_BUSRQ+STIC_FRAME_BUSRQ)); // Account for stic cycle stealing
683   device->machine().scheduler().timer_set(device->machine().device<cpu_device>("maincpu")
681   machine().device("maincpu")->execute().adjust_icount(-(12*STIC_ROW_BUSRQ+STIC_FRAME_BUSRQ)); // Account for stic cycle stealing
682   machine().scheduler().timer_set(machine().device<cpu_device>("maincpu")
684683      ->cycles_to_attotime(STIC_VBLANK_END), FUNC(intv_interrupt_complete));
685684   for (row=0; row < STIC_BACKTAB_HEIGHT; row++)
686685   {
687      device->machine().scheduler().timer_set(device->machine().device<cpu_device>("maincpu")
688         ->cycles_to_attotime(STIC_FIRST_FETCH-STIC_FRAME_BUSRQ+STIC_CYCLES_PER_SCANLINE*STIC_Y_SCALE*state->m_row_delay + (STIC_CYCLES_PER_SCANLINE*STIC_Y_SCALE*STIC_CARD_HEIGHT - STIC_ROW_BUSRQ)*row), FUNC(intv_btb_fill));
686      machine().scheduler().timer_set(machine().device<cpu_device>("maincpu")
687         ->cycles_to_attotime(STIC_FIRST_FETCH-STIC_FRAME_BUSRQ+STIC_CYCLES_PER_SCANLINE*STIC_Y_SCALE*m_row_delay + (STIC_CYCLES_PER_SCANLINE*STIC_Y_SCALE*STIC_CARD_HEIGHT - STIC_ROW_BUSRQ)*row), FUNC(intv_btb_fill));
689688   }
690689
691   if (state->m_row_delay == 0)
690   if (m_row_delay == 0)
692691   {
693      device->machine().device("maincpu")->execute().adjust_icount(-STIC_ROW_BUSRQ); // extra row fetch occurs if vertical delay == 0
692      machine().device("maincpu")->execute().adjust_icount(-STIC_ROW_BUSRQ); // extra row fetch occurs if vertical delay == 0
694693   }
695694
696   intv_stic_screenrefresh(device->machine());
695   intv_stic_screenrefresh(machine());
697696}
698697
699698/* hand 0 == left, 1 == right, 2 == ECS hand controller 1, 3 == ECS hand controller 2 */
trunk/src/mess/machine/c64.c
r17997r17998
840840      c64_bankswitch(machine, 1);
841841}
842842
843INTERRUPT_GEN( c64_frame_interrupt )
843INTERRUPT_GEN_MEMBER(legacy_c64_state::c64_frame_interrupt)
844844{
845   c64_nmi(device->machine());
846   cbm_common_interrupt(device);
845   c64_nmi(machine());
846   cbm_common_interrupt(&device);
847847}
848848
849849
trunk/src/mess/machine/bbc.c
r17997r17998
733733
734734
735735
736INTERRUPT_GEN( bbcb_keyscan )
736INTERRUPT_GEN_MEMBER(bbc_state::bbcb_keyscan)
737737{
738   bbc_state *state = device->machine().driver_data<bbc_state>();
739738   static const char *const colnames[] = {
740739      "COL0", "COL1", "COL2", "COL3", "COL4",
741740      "COL5", "COL6", "COL7", "COL8", "COL9"
742741   };
743   via6522_device *via_0 = device->machine().device<via6522_device>("via6522_0");
742   via6522_device *via_0 = machine().device<via6522_device>("via6522_0");
744743
745744   /* only do auto scan if keyboard is not enabled */
746   if (state->m_b3_keyboard == 1)
745   if (m_b3_keyboard == 1)
747746   {
748747      /* KBD IC1 4 bit addressable counter */
749748      /* KBD IC3 4 to 10 line decoder */
750749      /* keyboard not enabled so increment counter */
751      state->m_column = (state->m_column + 1) % 16;
752      if (state->m_column < 10)
750      m_column = (m_column + 1) % 16;
751      if (m_column < 10)
753752      {
754753         /* KBD IC4 8 input NAND gate */
755754         /* set the value of via_system ca2, by checking for any keys
756                 being pressed on the selected state->m_column */
757         if ((device->machine().root_device().ioport(colnames[state->m_column])->read() | 0x01) != 0xff)
755                 being pressed on the selected m_column */
756         if ((machine().root_device().ioport(colnames[m_column])->read() | 0x01) != 0xff)
758757         {
759758            via_0->write_ca2(1);
760759         }
r17997r17998
772771}
773772
774773
775INTERRUPT_GEN( bbcm_keyscan )
774INTERRUPT_GEN_MEMBER(bbc_state::bbcm_keyscan)
776775{
777   bbc_state *state = device->machine().driver_data<bbc_state>();
778776   static const char *const colnames[] = {
779777      "COL0", "COL1", "COL2", "COL3", "COL4",
780778      "COL5", "COL6", "COL7", "COL8", "COL9"
781779   };
782   via6522_device *via_0 = device->machine().device<via6522_device>("via6522_0");
780   via6522_device *via_0 = machine().device<via6522_device>("via6522_0");
783781
784782   /* only do auto scan if keyboard is not enabled */
785   if (state->m_b3_keyboard == 1)
783   if (m_b3_keyboard == 1)
786784   {
787785      /* KBD IC1 4 bit addressable counter */
788786      /* KBD IC3 4 to 10 line decoder */
789787      /* keyboard not enabled so increment counter */
790      state->m_column = (state->m_column + 1) % 16;
788      m_column = (m_column + 1) % 16;
791789
792790      /* this IF should be removed as soon as the dip switches (keyboard keys) are set for the master */
793      if (state->m_column < 10)
791      if (m_column < 10)
794792      {
795793         /* KBD IC4 8 input NAND gate */
796794         /* set the value of via_system ca2, by checking for any keys
797                 being pressed on the selected state->m_column */
798         if ((device->machine().root_device().ioport(colnames[state->m_column])->read() | 0x01) != 0xff)
795                 being pressed on the selected m_column */
796         if ((machine().root_device().ioport(colnames[m_column])->read() | 0x01) != 0xff)
799797         {
800798            via_0->write_ca2(1);
801799         }
trunk/src/mess/machine/c65.c
r17997r17998
10231023}
10241024
10251025
1026INTERRUPT_GEN( c65_frame_interrupt )
1026INTERRUPT_GEN_MEMBER(c65_state::c65_frame_interrupt)
10271027{
1028   c65_state *state = device->machine().driver_data<c65_state>();
10291028   int value;
10301029
1031   c65_nmi(device->machine());
1030   c65_nmi(machine());
10321031
10331032   /* common keys input ports */
1034   cbm_common_interrupt(device);
1033   cbm_common_interrupt(&device);
10351034
10361035   /* c65 specific: function keys input ports */
10371036   value = 0xff;
10381037
1039   value &= ~state->ioport("FUNCT")->read();
1040   state->m_keyline = value;
1038   value &= ~ioport("FUNCT")->read();
1039   m_keyline = value;
10411040}
trunk/src/mess/machine/gb.c
r17997r17998
18921892   return IMAGE_INIT_PASS;
18931893}
18941894
1895INTERRUPT_GEN( gb_scanline_interrupt )
1895INTERRUPT_GEN_MEMBER(gb_state::gb_scanline_interrupt)
18961896{
18971897}
18981898
trunk/src/mess/machine/b2m.c
r17997r17998
357357   DEVCB_NULL
358358};
359359
360INTERRUPT_GEN( b2m_vblank_interrupt )
360INTERRUPT_GEN_MEMBER(b2m_state::b2m_vblank_interrupt)
361361{
362   b2m_state *state = device->machine().driver_data<b2m_state>();
363   state->m_vblank_state++;
364   if (state->m_vblank_state>1) state->m_vblank_state=0;
365   pic8259_ir0_w(state->m_pic, state->m_vblank_state);
362   m_vblank_state++;
363   if (m_vblank_state>1) m_vblank_state=0;
364   pic8259_ir0_w(m_pic, m_vblank_state);
366365}
367366
368367void b2m_state::machine_reset()
trunk/src/mess/machine/kay_kbd.c
r17997r17998
302302 * also drives keyboard LEDs and
303303 * and handles autorepeating keys
304304 ******************************************************/
305INTERRUPT_GEN( kay_kbd_interrupt )
305INTERRUPT_GEN_MEMBER(kaypro_state::kay_kbd_interrupt)
306306{
307   kaypro_state *state = device->machine().driver_data<kaypro_state>();
308   kay_kbd_t *kbd = state->m_kbd;
307   kay_kbd_t *kbd = m_kbd;
309308   int mod, row, col, chg, newval;
310309   UINT8 *keyrows = kbd->keyrows;
311310
r17997r17998
321320   }
322321
323322   row = 9;
324   newval = device->machine().root_device().ioport("ROW9")->read();
323   newval = machine().root_device().ioport("ROW9")->read();
325324   chg = keyrows[row] ^ newval;
326325
327   if (!chg) { newval = device->machine().root_device().ioport("ROW8")->read(); chg = keyrows[--row] ^ newval; }
328   if (!chg) { newval = device->machine().root_device().ioport("ROW7")->read(); chg = keyrows[--row] ^ newval; }
329   if (!chg) { newval = device->machine().root_device().ioport("ROW6")->read(); chg = keyrows[--row] ^ newval; }
330   if (!chg) { newval = device->machine().root_device().ioport("ROW5")->read(); chg = keyrows[--row] ^ newval; }
331   if (!chg) { newval = device->machine().root_device().ioport("ROW4")->read(); chg = keyrows[--row] ^ newval; }
332   if (!chg) { newval = device->machine().root_device().ioport("ROW3")->read(); chg = keyrows[--row] ^ newval; }
333   if (!chg) { newval = device->machine().root_device().ioport("ROW2")->read(); chg = keyrows[--row] ^ newval; }
334   if (!chg) { newval = device->machine().root_device().ioport("ROW1")->read(); chg = keyrows[--row] ^ newval; }
335   if (!chg) { newval = device->machine().root_device().ioport("ROW0")->read(); chg = keyrows[--row] ^ newval; }
326   if (!chg) { newval = machine().root_device().ioport("ROW8")->read(); chg = keyrows[--row] ^ newval; }
327   if (!chg) { newval = machine().root_device().ioport("ROW7")->read(); chg = keyrows[--row] ^ newval; }
328   if (!chg) { newval = machine().root_device().ioport("ROW6")->read(); chg = keyrows[--row] ^ newval; }
329   if (!chg) { newval = machine().root_device().ioport("ROW5")->read(); chg = keyrows[--row] ^ newval; }
330   if (!chg) { newval = machine().root_device().ioport("ROW4")->read(); chg = keyrows[--row] ^ newval; }
331   if (!chg) { newval = machine().root_device().ioport("ROW3")->read(); chg = keyrows[--row] ^ newval; }
332   if (!chg) { newval = machine().root_device().ioport("ROW2")->read(); chg = keyrows[--row] ^ newval; }
333   if (!chg) { newval = machine().root_device().ioport("ROW1")->read(); chg = keyrows[--row] ^ newval; }
334   if (!chg) { newval = machine().root_device().ioport("ROW0")->read(); chg = keyrows[--row] ^ newval; }
336335   if (!chg) --row;
337336
338337   if (row >= 0)
r17997r17998
343342      kbd->lastrow = row;
344343      /* CapsLock LED */
345344      if( row == 3 && chg == 0x80 )
346         set_led_status(device->machine(), 1, (kbd->keyrows[3] & 0x80) ? 0 : 1);
345         set_led_status(machine(), 1, (kbd->keyrows[3] & 0x80) ? 0 : 1);
347346
348347      if (newval & chg)   /* key(s) pressed ? */
349348      {
r17997r17998
376375         if( kbd->key )   /* normal key */
377376         {
378377            kbd->repeater = 30;
379            kay_kbd_in(device->machine(), kbd->key);
378            kay_kbd_in(machine(), kbd->key);
380379         }
381380         else
382381         if( (row == 0) && (chg == 0x04) ) /* Ctrl-@ (NUL) */
383            kay_kbd_in(device->machine(), 0);
382            kay_kbd_in(machine(), 0);
384383         keyrows[row] |= newval;
385384      }
386385      else
r17997r17998
391390   }
392391   else if ( kbd->key && (keyrows[kbd->lastrow] & kbd->mask) && kbd->repeat == 0 )
393392   {
394      kay_kbd_in(device->machine(), kbd->key);
393      kay_kbd_in(machine(), kbd->key);
395394   }
396395}
397396
trunk/src/mess/machine/c128.c
r17997r17998
11291129}
11301130
11311131
1132INTERRUPT_GEN( c128_frame_interrupt )
1132INTERRUPT_GEN_MEMBER(c128_state::c128_frame_interrupt)
11331133{
1134   c128_state *state = device->machine().driver_data<c128_state>();
11351134   static const char *const c128ports[] = { "KP0", "KP1", "KP2" };
11361135   int i, value;
1137   //device_t *vic2e = device->machine().device("vic2e");
1138   //device_t *vdc8563 = device->machine().device("vdc8563");
1136   //device_t *vic2e = machine().device("vic2e");
1137   //device_t *vdc8563 = machine().device("vdc8563");
11391138
1140   state->nmi();
1139   nmi();
11411140
11421141   /* common keys input ports */
1143   cbm_common_interrupt(device);
1142   cbm_common_interrupt(&device);
11441143
11451144   /* Fix Me! Currently, neither left Shift nor Shift Lock work in c128, but reading the correspondent input produces a bug!
11461145    Hence, we overwrite the actual reading as it never happens */
1147   if ((device->machine().root_device().ioport("SPECIAL")->read() & 0x40))   //
1146   if ((machine().root_device().ioport("SPECIAL")->read() & 0x40))   //
11481147      c64_keyline[1] |= 0x80;
11491148
11501149   /* c128 specific: keypad input ports */
11511150   for (i = 0; i < 3; i++)
11521151   {
11531152      value = 0xff;
1154      value &= ~device->machine().root_device().ioport(c128ports[i])->read();
1155      state->m_keyline[i] = value;
1153      value &= ~machine().root_device().ioport(c128ports[i])->read();
1154      m_keyline[i] = value;
11561155   }
11571156}
trunk/src/mess/machine/pet.c
r17997r17998
762762}
763763
764764
765INTERRUPT_GEN( pet_frame_interrupt )
765INTERRUPT_GEN_MEMBER(pet_state::pet_frame_interrupt)
766766{
767   pet_state *state = device->machine().driver_data<pet_state>();
768   if (state->m_superpet)
767   if (m_superpet)
769768   {
770      if (state->ioport("CFG")->read() & 0x04)
769      if (ioport("CFG")->read() & 0x04)
771770      {
772         device->execute().set_input_line(INPUT_LINE_HALT, 1);
773         device->execute().set_input_line(INPUT_LINE_HALT, 0);
774         state->m_font |= 2;
771         device.execute().set_input_line(INPUT_LINE_HALT, 1);
772         device.execute().set_input_line(INPUT_LINE_HALT, 0);
773         m_font |= 2;
775774      }
776775      else
777776      {
778         device->execute().set_input_line(INPUT_LINE_HALT, 0);
779         device->execute().set_input_line(INPUT_LINE_HALT, 1);
780         state->m_font &= ~2;
777         device.execute().set_input_line(INPUT_LINE_HALT, 0);
778         device.execute().set_input_line(INPUT_LINE_HALT, 1);
779         m_font &= ~2;
781780      }
782781   }
783782
784   set_led_status (device->machine(),1, device->machine().root_device().ioport("SPECIAL")->read() & 0x80 ? 1 : 0);      /* Shift Lock */
783   set_led_status (machine(),1, machine().root_device().ioport("SPECIAL")->read() & 0x80 ? 1 : 0);      /* Shift Lock */
785784}
786785
787786
trunk/src/mess/machine/vector06.c
r17997r17998
122122   m_ppi2->write(space, offset^3, data);
123123}
124124
125INTERRUPT_GEN( vector06_interrupt )
125INTERRUPT_GEN_MEMBER(vector06_state::vector06_interrupt)
126126{
127   vector06_state *state = device->machine().driver_data<vector06_state>();
128   state->m_vblank_state++;
129   if (state->m_vblank_state>1) state->m_vblank_state=0;
130   device->execute().set_input_line(0,state->m_vblank_state ? HOLD_LINE : CLEAR_LINE);
127   m_vblank_state++;
128   if (m_vblank_state>1) m_vblank_state=0;
129   device.execute().set_input_line(0,m_vblank_state ? HOLD_LINE : CLEAR_LINE);
131130
132131}
133132
trunk/src/mess/machine/galaxy.c
r17997r17998
4545  Interrupts
4646***************************************************************************/
4747
48INTERRUPT_GEN( galaxy_interrupt )
48INTERRUPT_GEN_MEMBER(galaxy_state::galaxy_interrupt)
4949{
50   device->execute().set_input_line(0, HOLD_LINE);
50   device.execute().set_input_line(0, HOLD_LINE);
5151}
5252
5353static IRQ_CALLBACK ( galaxy_irq_callback )
trunk/src/mess/machine/compis.c
r17997r17998
13951395/* Name: compis                                                            */
13961396/* Desc: Interrupt - Vertical Blanking Interrupt                           */
13971397/*-------------------------------------------------------------------------*/
1398INTERRUPT_GEN( compis_vblank_int )
1398INTERRUPT_GEN_MEMBER(compis_state::compis_vblank_int)
13991399{
14001400//  compis_gdc_vblank_int();
1401   compis_keyb_update(device->machine());
1401   compis_keyb_update(machine());
14021402}
trunk/src/mess/machine/concept.c
r17997r17998
182182   }
183183}
184184
185INTERRUPT_GEN( concept_interrupt )
185INTERRUPT_GEN_MEMBER(concept_state::concept_interrupt)
186186{
187   poll_keyboard(device->machine());
187   poll_keyboard(machine());
188188}
189189
190190/*
trunk/src/mess/machine/msx.c
r17997r17998
532532   state->m_v9938->interrupt();
533533}
534534
535INTERRUPT_GEN( msx_interrupt )
535INTERRUPT_GEN_MEMBER(msx_state::msx_interrupt)
536536{
537   msx_state *state = device->machine().driver_data<msx_state>();
538537   int i;
539538
540539   for (i=0; i<2; i++)
541540   {
542      state->m_mouse[i] = state->ioport(i ? "MOUSE1" : "MOUSE0")->read();
543      state->m_mouse_stat[i] = -1;
541      m_mouse[i] = ioport(i ? "MOUSE1" : "MOUSE0")->read();
542      m_mouse_stat[i] = -1;
544543   }
545544}
546545
trunk/src/mess/machine/lisa.c
r17997r17998
10861086   machine().device("maincpu")->reset();
10871087}
10881088
1089INTERRUPT_GEN( lisa_interrupt )
1089INTERRUPT_GEN_MEMBER(lisa_state::lisa_interrupt)
10901090{
1091   lisa_state *state = device->machine().driver_data<lisa_state>();
1092   if ((++state->m_frame_count) == 6)
1091   if ((++m_frame_count) == 6)
10931092   {   /* increment clock every 1/10s */
1094      state->m_frame_count = 0;
1093      m_frame_count = 0;
10951094
1096      if (state->m_clock_regs.clock_mode != clock_timer_disable)
1095      if (m_clock_regs.clock_mode != clock_timer_disable)
10971096      {
1098         if ((++state->m_clock_regs.tenths) == 10)
1097         if ((++m_clock_regs.tenths) == 10)
10991098         {
1100            state->m_clock_regs.tenths = 0;
1099            m_clock_regs.tenths = 0;
11011100
1102            if (state->m_clock_regs.clock_mode != timer_disable)
1101            if (m_clock_regs.clock_mode != timer_disable)
11031102            {
1104               if (state->m_clock_regs.alarm == 0)
1103               if (m_clock_regs.alarm == 0)
11051104               {
11061105                  /* generate reset (should cause a VIA interrupt...) */
11071106                  static const UINT8 cmd[2] =
r17997r17998
11091108                     0x80,   /* RESET code */
11101109                     0xFC   /* timer time-out */
11111110                  };
1112                  COPS_queue_data(device->machine(), cmd, 2);
1111                  COPS_queue_data(machine(), cmd, 2);
11131112
1114                  state->m_clock_regs.alarm = 0xfffffL;
1113                  m_clock_regs.alarm = 0xfffffL;
11151114               }
11161115               else
11171116               {
1118                  state->m_clock_regs.alarm--;
1117                  m_clock_regs.alarm--;
11191118               }
11201119            }
11211120
1122            if ((++state->m_clock_regs.seconds2) == 10)
1121            if ((++m_clock_regs.seconds2) == 10)
11231122            {
1124               state->m_clock_regs.seconds2 = 0;
1123               m_clock_regs.seconds2 = 0;
11251124
1126               if ((++state->m_clock_regs.seconds1) == 6)
1125               if ((++m_clock_regs.seconds1) == 6)
11271126               {
1128                  state->m_clock_regs.seconds1 = 0;
1127                  m_clock_regs.seconds1 = 0;
11291128
1130                  if ((++state->m_clock_regs.minutes2) == 10)
1129                  if ((++m_clock_regs.minutes2) == 10)
11311130                  {
1132                     state->m_clock_regs.minutes2 = 0;
1131                     m_clock_regs.minutes2 = 0;
11331132
1134                     if ((++state->m_clock_regs.minutes1) == 6)
1133                     if ((++m_clock_regs.minutes1) == 6)
11351134                     {
1136                        state->m_clock_regs.minutes1 = 0;
1135                        m_clock_regs.minutes1 = 0;
11371136
1138                        if ((++state->m_clock_regs.hours2) == 10)
1137                        if ((++m_clock_regs.hours2) == 10)
11391138                        {
1140                           state->m_clock_regs.hours2 = 0;
1139                           m_clock_regs.hours2 = 0;
11411140
1142                           state->m_clock_regs.hours1++;
1141                           m_clock_regs.hours1++;
11431142                        }
11441143
1145                        if ((state->m_clock_regs.hours1*10 + state->m_clock_regs.hours2) == 24)
1144                        if ((m_clock_regs.hours1*10 + m_clock_regs.hours2) == 24)
11461145                        {
1147                           state->m_clock_regs.hours1 = state->m_clock_regs.hours2 = 0;
1146                           m_clock_regs.hours1 = m_clock_regs.hours2 = 0;
11481147
1149                           if ((++state->m_clock_regs.days3) == 10)
1148                           if ((++m_clock_regs.days3) == 10)
11501149                           {
1151                              state->m_clock_regs.days3 = 0;
1150                              m_clock_regs.days3 = 0;
11521151
1153                              if ((++state->m_clock_regs.days2) == 10)
1152                              if ((++m_clock_regs.days2) == 10)
11541153                              {
1155                                 state->m_clock_regs.days2 = 0;
1154                                 m_clock_regs.days2 = 0;
11561155
1157                                 state->m_clock_regs.days1++;
1156                                 m_clock_regs.days1++;
11581157                              }
11591158                           }
11601159
1161                           if ((state->m_clock_regs.days1*100 + state->m_clock_regs.days2*10 + state->m_clock_regs.days3) ==
1162                              ((state->m_clock_regs.years % 4) ? 366 : 367))
1160                           if ((m_clock_regs.days1*100 + m_clock_regs.days2*10 + m_clock_regs.days3) ==
1161                              ((m_clock_regs.years % 4) ? 366 : 367))
11631162                           {
1164                              state->m_clock_regs.days1 = state->m_clock_regs.days2 = state->m_clock_regs.days3 = 0;
1163                              m_clock_regs.days1 = m_clock_regs.days2 = m_clock_regs.days3 = 0;
11651164
1166                              state->m_clock_regs.years = (state->m_clock_regs.years + 1) & 0xf;
1165                              m_clock_regs.years = (m_clock_regs.years + 1) & 0xf;
11671166                           }
11681167                        }
11691168                     }
r17997r17998
11751174   }
11761175
11771176   /* set VBI */
1178   if (state->m_VTMSK)
1179      set_VTIR(device->machine(), 1);
1177   if (m_VTMSK)
1178      set_VTIR(machine(), 1);
11801179   else
1181      set_VTIR(device->machine(), 0);
1180      set_VTIR(machine(), 0);
11821181
11831182   /* do keyboard scan */
1184   scan_keyboard(device->machine());
1183   scan_keyboard(machine());
11851184}
11861185
11871186/*
trunk/src/mess/machine/cgenie.c
r17997r17998
411411   return result;
412412}
413413
414INTERRUPT_GEN( cgenie_timer_interrupt )
414INTERRUPT_GEN_MEMBER(cgenie_state::cgenie_timer_interrupt)
415415{
416   cgenie_state *state = device->machine().driver_data<cgenie_state>();
417   if( (state->m_irq_status & IRQ_TIMER) == 0 )
416   if( (m_irq_status & IRQ_TIMER) == 0 )
418417   {
419      state->m_irq_status |= IRQ_TIMER;
420      device->machine().device("maincpu")->execute().set_input_line(0, HOLD_LINE);
418      m_irq_status |= IRQ_TIMER;
419      machine().device("maincpu")->execute().set_input_line(0, HOLD_LINE);
421420   }
422421}
423422
r17997r17998
591590 *
592591 *************************************/
593592
594INTERRUPT_GEN( cgenie_frame_interrupt )
593INTERRUPT_GEN_MEMBER(cgenie_state::cgenie_frame_interrupt)
595594{
596   cgenie_state *state = device->machine().driver_data<cgenie_state>();
597   if( state->m_tv_mode != (device->machine().root_device().ioport("DSW0")->read() & 0x10) )
595   if( m_tv_mode != (machine().root_device().ioport("DSW0")->read() & 0x10) )
598596   {
599      state->m_tv_mode = state->ioport("DSW0")->read() & 0x10;
597      m_tv_mode = ioport("DSW0")->read() & 0x10;
600598      /* force setting of background color */
601      state->m_port_ff ^= FF_BGD0;
602      cgenie_port_ff_w(*device->machine().device("maincpu")->memory().space(AS_PROGRAM), 0, state->m_port_ff ^ FF_BGD0);
599      m_port_ff ^= FF_BGD0;
600      cgenie_port_ff_w(*machine().device("maincpu")->memory().space(AS_PROGRAM), 0, m_port_ff ^ FF_BGD0);
603601   }
604602}
605603
trunk/src/mess/machine/pk8020.c
r17997r17998
10031003   m_sound_level = 0;
10041004}
10051005
1006INTERRUPT_GEN( pk8020_interrupt )
1006INTERRUPT_GEN_MEMBER(pk8020_state::pk8020_interrupt)
10071007{
1008   pk8020_state *state = device->machine().driver_data<pk8020_state>();
1009   state->m_takt ^= 1;
1010   pic8259_ir4_w(device->machine().device("pic8259"), 1);
1008   m_takt ^= 1;
1009   pic8259_ir4_w(machine().device("pic8259"), 1);
10111010}
trunk/src/mess/includes/compis.h
r17997r17998
187187   virtual void machine_reset();
188188   virtual void palette_init();
189189   UINT32 screen_update_compis2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
190   INTERRUPT_GEN_MEMBER(compis_vblank_int);
190191};
191192
192193
r17997r17998
200201extern const i8251_interface compis_usart_interface;
201202extern const upd765_interface compis_fdc_interface;
202203
203INTERRUPT_GEN(compis_vblank_int);
204
205204#endif /* COMPIS_H_ */
trunk/src/mess/includes/vtech2.h
r17997r17998
5555   DECLARE_MACHINE_RESET(laser500);
5656   DECLARE_MACHINE_RESET(laser700);
5757   UINT32 screen_update_laser(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
58   INTERRUPT_GEN_MEMBER(vtech2_interrupt);
5859};
5960
6061
trunk/src/mess/includes/pdp1.h
r17997r17998
261261   virtual void palette_init();
262262   UINT32 screen_update_pdp1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
263263   void screen_eof_pdp1(screen_device &screen, bool state);
264   INTERRUPT_GEN_MEMBER(pdp1_interrupt);
264265};
265266
266267/*----------- defined in video/pdp1.c -----------*/
trunk/src/mess/includes/apple3.h
r17997r17998
6060   DECLARE_MACHINE_RESET(apple3);
6161   DECLARE_VIDEO_START(apple3);
6262   UINT32 screen_update_apple3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
63   INTERRUPT_GEN_MEMBER(apple3_interrupt);
6364};
6465
6566
r17997r17998
6970extern const via6522_interface apple3_via_0_intf;
7071extern const via6522_interface apple3_via_1_intf;
7172
72
73INTERRUPT_GEN( apple3_interrupt );
74
7573/*----------- defined in video/apple3.c -----------*/
7674
7775void apple3_write_charmem(running_machine &machine);
trunk/src/mess/includes/c65.h
r17997r17998
6565   DECLARE_MACHINE_START(c65);
6666   DECLARE_PALETTE_INIT(c65);
6767   UINT32 screen_update_c65(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
68   INTERRUPT_GEN_MEMBER(vic3_raster_irq);
69   INTERRUPT_GEN_MEMBER(c65_frame_interrupt);
6870};
6971
7072
r17997r17998
8587void c65_vic_interrupt(running_machine &machine, int level);
8688void c65_bankswitch_interface(running_machine &machine, int value);
8789
88
89INTERRUPT_GEN( c65_frame_interrupt );
90
9190extern const mos6526_interface c65_cia0;
9291extern const mos6526_interface c65_cia1;
9392
trunk/src/mess/includes/mac.h
r17997r17998
522522   UINT32 screen_update_macdafb(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
523523   UINT32 screen_update_macrbvvram(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
524524   UINT32 screen_update_macpbwd(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
525   INTERRUPT_GEN_MEMBER(mac_rbv_vbl);
525526};
526527
527528#endif /* MAC_H_ */
trunk/src/mess/includes/mbee.h
r17997r17998
141141   DECLARE_MACHINE_RESET(mbee256);
142142   DECLARE_MACHINE_RESET(mbeett);
143143   UINT32 screen_update_mbee(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
144   INTERRUPT_GEN_MEMBER(mbee_interrupt);
144145};
145146
146147
r17997r17998
149150extern const wd17xx_interface mbee_wd17xx_interface;
150151extern const z80pio_interface mbee_z80pio_intf;
151152
152INTERRUPT_GEN( mbee_interrupt );
153153QUICKLOAD_LOAD( mbee );
154154
155155
trunk/src/mess/includes/gb.h
r17997r17998
245245   DECLARE_PALETTE_INIT(gbc);
246246   DECLARE_MACHINE_START(gb_video);
247247   DECLARE_MACHINE_START(gbc_video);
248   INTERRUPT_GEN_MEMBER(gb_scanline_interrupt);
248249};
249250
250251
r17997r17998
252253
253254DEVICE_START(gb_cart);
254255DEVICE_IMAGE_LOAD(gb_cart);
255INTERRUPT_GEN( gb_scanline_interrupt );
256256void gb_timer_callback(lr35902_cpu_device *device, int cycles);
257257
258258
trunk/src/mess/includes/concept.h
r17997r17998
5656   virtual void machine_start();
5757   virtual void video_start();
5858   UINT32 screen_update_concept(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
59   INTERRUPT_GEN_MEMBER(concept_interrupt);
5960};
6061
6162
r17997r17998
6465extern const via6522_interface concept_via6522_intf;
6566extern const wd17xx_interface concept_wd17xx_interface;
6667
67INTERRUPT_GEN( concept_interrupt );
68
69
7068#endif /* CONCEPT_H_ */
trunk/src/mess/includes/msx.h
r17997r17998
124124   DECLARE_MACHINE_RESET(msx);
125125   DECLARE_MACHINE_START(msx2);
126126   DECLARE_MACHINE_RESET(msx2);
127   INTERRUPT_GEN_MEMBER(msx_interrupt);
127128};
128129
129130
r17997r17998
132133extern const i8255_interface msx_ppi8255_interface;
133134extern const wd17xx_interface msx_wd17xx_interface;
134135/* start/stop functions */
135extern INTERRUPT_GEN( msx_interrupt );
136136extern TIMER_DEVICE_CALLBACK( msx2_interrupt );
137137
138138DEVICE_IMAGE_LOAD( msx_cart );
trunk/src/mess/includes/gamecom.h
r17997r17998
243243   virtual void machine_reset();
244244   virtual void video_start();
245245   virtual void palette_init();
246   INTERRUPT_GEN_MEMBER(gamecom_interrupt);
246247};
247248
248249
trunk/src/mess/includes/b2m.h
r17997r17998
4949   virtual void video_start();
5050   virtual void palette_init();
5151   UINT32 screen_update_b2m(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
52   INTERRUPT_GEN_MEMBER(b2m_vblank_interrupt);
5253};
5354
5455/*----------- defined in machine/b2m.c -----------*/
r17997r17998
6061extern const i8255_interface b2m_ppi8255_interface_2;
6162extern const i8255_interface b2m_ppi8255_interface_3;
6263
63extern INTERRUPT_GEN( b2m_vblank_interrupt );
64
6564#endif
trunk/src/mess/includes/vic20.h
r17997r17998
9191
9292   // keyboard state
9393   int m_key_col;
94   INTERRUPT_GEN_MEMBER(vic20_raster_interrupt);
9495};
9596
9697#endif
trunk/src/mess/includes/arcadia.h
r17997r17998
8181   virtual void video_start();
8282   virtual void palette_init();
8383   UINT32 screen_update_arcadia(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
84   INTERRUPT_GEN_MEMBER(arcadia_video_line);
8485};
85
86extern INTERRUPT_GEN( arcadia_video_line );
8786#endif /* ARCADIA_H_ */
trunk/src/mess/includes/lisa.h
r17997r17998
164164   virtual void machine_reset();
165165   virtual void video_start();
166166   UINT32 screen_update_lisa(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
167   INTERRUPT_GEN_MEMBER(lisa_interrupt);
167168};
168169
169170
r17997r17998
174175
175176extern NVRAM_HANDLER(lisa);
176177
177INTERRUPT_GEN( lisa_interrupt );
178178
179
180179#endif /* LISA_H_ */
181180
trunk/src/mess/includes/lynx.h
r17997r17998
145145
146146/*----------- defined in machine/lynx.c -----------*/
147147
148
149
150
151148void lynx_timer_count_down(running_machine &machine, int nr);
152149
153INTERRUPT_GEN( lynx_frame_int );
154
155150/* These functions are also needed for the Quickload */
156151int lynx_verify_cart (char *header, int kind);
157152void lynx_crc_keyword(device_image_interface &image);
trunk/src/mess/includes/cgenie.h
r17997r17998
7171   DECLARE_PALETTE_INIT(cgenie);
7272   DECLARE_PALETTE_INIT(cgenienz);
7373   UINT32 screen_update_cgenie(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
74   INTERRUPT_GEN_MEMBER(cgenie_timer_interrupt);
75   INTERRUPT_GEN_MEMBER(cgenie_frame_interrupt);
7476};
7577
7678
r17997r17998
100102 DECLARE_READ8_HANDLER ( cgenie_port_ff_r );
101103int cgenie_port_xx_r(int offset);
102104
103INTERRUPT_GEN( cgenie_timer_interrupt );
104INTERRUPT_GEN( cgenie_frame_interrupt );
105
106105 DECLARE_READ8_HANDLER ( cgenie_status_r );
107106 DECLARE_READ8_HANDLER ( cgenie_track_r );
108107 DECLARE_READ8_HANDLER ( cgenie_sector_r );
trunk/src/mess/includes/x68k.h
r17997r17998
267267   DECLARE_VIDEO_START(x68000);
268268   DECLARE_PALETTE_INIT(x68000);
269269   UINT32 screen_update_x68000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
270   INTERRUPT_GEN_MEMBER(x68k_vsync_irq);
270271};
271272
272273
trunk/src/mess/includes/spectrum.h
r17997r17998
123123   UINT32 screen_update_tc2048(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
124124   UINT32 screen_update_ts2068(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
125125   void screen_eof_spectrum(screen_device &screen, bool state);
126   INTERRUPT_GEN_MEMBER(spec_interrupt);
126127};
127128
128129
trunk/src/mess/includes/ondra.h
r17997r17998
2424   virtual void machine_reset();
2525   virtual void video_start();
2626   UINT32 screen_update_ondra(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
27   INTERRUPT_GEN_MEMBER(ondra_interrupt);
2728};
2829
2930#endif
trunk/src/mess/includes/kaypro.h
r17997r17998
7878   UINT32 screen_update_kayproii(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
7979   UINT32 screen_update_kaypro2x(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
8080   UINT32 screen_update_omni2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
81   INTERRUPT_GEN_MEMBER(kay_kbd_interrupt);
8182};
8283
8384
r17997r17998
8687UINT8 kay_kbd_c_r( running_machine &machine );
8788UINT8 kay_kbd_d_r( running_machine &machine );
8889void kay_kbd_d_w( running_machine &machine, UINT8 data );
89INTERRUPT_GEN( kay_kbd_interrupt );
9090
9191INPUT_PORTS_EXTERN( kay_kbd );
9292
trunk/src/mess/includes/plus4.h
r17997r17998
107107   // keyboard state
108108   UINT8 m_port6529;
109109   UINT8 m_keyline[10];
110   INTERRUPT_GEN_MEMBER(c16_raster_interrupt);
111   INTERRUPT_GEN_MEMBER(c16_frame_interrupt);
110112};
111113
112114
trunk/src/mess/includes/tx0.h
r17997r17998
152152   virtual void palette_init();
153153   UINT32 screen_update_tx0(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
154154   void screen_eof_tx0(screen_device &screen, bool state);
155   INTERRUPT_GEN_MEMBER(tx0_interrupt);
155156};
156157
157158
trunk/src/mess/includes/c128.h
r17997r17998
220220   DECLARE_DRIVER_INIT(c128d);
221221   DECLARE_DRIVER_INIT(c128);
222222   DECLARE_DRIVER_INIT(c128d81);
223   INTERRUPT_GEN_MEMBER(c128_frame_interrupt);
223224};
224225
225226
226227/*----------- defined in machine/c128.c -----------*/
227228
228extern INTERRUPT_GEN( c128_frame_interrupt );
229
230229extern const mos6526_interface c128_cia1_intf, c128_cia2_intf;
231230
232231#endif /* __C128_H__ */
trunk/src/mess/includes/p2000t.h
r17997r17998
4444   DECLARE_VIDEO_START(p2000m);
4545   DECLARE_PALETTE_INIT(p2000m);
4646   UINT32 screen_update_p2000m(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
47   INTERRUPT_GEN_MEMBER(p2000_interrupt);
4748};
4849
4950#endif /* P2000T_H_ */
trunk/src/mess/includes/pet.h
r17997r17998
5656   virtual void palette_init();
5757   DECLARE_VIDEO_START(pet_crtc);
5858   UINT32 screen_update_pet(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
59   INTERRUPT_GEN_MEMBER(pet_frame_interrupt);
5960};
6061
6162/*----------- defined in video/pet.c -----------*/
r17997r17998
8283extern DECLARE_READ8_HANDLER(superpet_r);
8384extern DECLARE_WRITE8_HANDLER(superpet_w);
8485
85
86INTERRUPT_GEN( pet_frame_interrupt );
87
8886MACHINE_CONFIG_EXTERN( pet_cartslot );
8987MACHINE_CONFIG_EXTERN( pet4_cartslot );
9088
trunk/src/mess/includes/c16.h
r17997r17998
7575extern int c16_dma_read(running_machine &machine, int offset);
7676extern int c16_dma_read_rom(running_machine &machine, int offset);
7777
78extern INTERRUPT_GEN( c16_frame_interrupt );
79
8078MACHINE_CONFIG_EXTERN( c16_cartslot );
8179
8280#endif /* __C16_H__ */
trunk/src/mess/includes/vector06.h
r17997r17998
6464   virtual void video_start();
6565   virtual void palette_init();
6666   UINT32 screen_update_vector06(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
67   INTERRUPT_GEN_MEMBER(vector06_interrupt);
6768};
6869
6970
7071/*----------- defined in machine/vector06.c -----------*/
71
7272extern const i8255_interface vector06_ppi8255_interface;
7373extern const i8255_interface vector06_ppi8255_2_interface;
7474
75extern INTERRUPT_GEN( vector06_interrupt );
76
7775#endif /* VECTOR06_H_ */
trunk/src/mess/includes/c64_legacy.h
r17997r17998
9090   DECLARE_DRIVER_INIT( ultimax );
9191   DECLARE_DRIVER_INIT( c64gs );
9292   DECLARE_DRIVER_INIT( sx64 );
93   INTERRUPT_GEN_MEMBER(c64_frame_interrupt);
9394};
9495
9596
r17997r17998
105106
106107MACHINE_START( c64 );
107108MACHINE_RESET( c64 );
108INTERRUPT_GEN( c64_frame_interrupt );
109109TIMER_CALLBACK( c64_tape_timer );
110110
111111/* private area */
trunk/src/mess/includes/orion.h
r17997r17998
6363   DECLARE_MACHINE_RESET(orionz80);
6464   DECLARE_MACHINE_RESET(orionpro);
6565   UINT32 screen_update_orion128(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
66   INTERRUPT_GEN_MEMBER(orionz80_interrupt);
6667};
6768
68
6969/*----------- defined in machine/orion.c -----------*/
70
7170extern const i8255_interface orion128_ppi8255_interface_1;
7271
73extern INTERRUPT_GEN( orionz80_interrupt );
74
75
7672#endif /* ORION_H_ */
7773
trunk/src/mess/includes/fmtowns.h
r17997r17998
274274   void poll_keyboard();
275275   void mouse_timeout();
276276   void wait_end();
277public:   
278   INTERRUPT_GEN_MEMBER(towns_vsync_irq);
277279};
278280
279281class marty_state : public towns_state
r17997r17998
286288   virtual void driver_start();
287289};
288290
289INTERRUPT_GEN( towns_vsync_irq );
290//VIDEO_START( towns );
291//SCREEN_UPDATE_RGB32( towns );
292
293291#endif /*FMTOWNS_H_*/
trunk/src/mess/includes/gmaster.h
r17997r17998
3232   DECLARE_DRIVER_INIT(gmaster);
3333   virtual void palette_init();
3434   UINT32 screen_update_gmaster(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
35   INTERRUPT_GEN_MEMBER(gmaster_interrupt);
3536};
3637
3738
trunk/src/mess/includes/newbrain.h
r17997r17998
157157   int m_copstate;
158158   int m_copbytes;
159159   int m_copregint;
160   INTERRUPT_GEN_MEMBER(newbrain_interrupt);
160161};
161162
162163class newbrain_eim_state : public newbrain_state
trunk/src/mess/includes/microtan.h
r17997r17998
5252   virtual void machine_reset();
5353   virtual void video_start();
5454   UINT32 screen_update_microtan(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
55   INTERRUPT_GEN_MEMBER(microtan_interrupt);
5556};
5657
5758
r17997r17998
6364SNAPSHOT_LOAD( microtan );
6465QUICKLOAD_LOAD( microtan_hexfile );
6566
66INTERRUPT_GEN( microtan_interrupt );
67
6867#endif /* MICROTAN_H_ */
trunk/src/mess/includes/intv.h
r17997r17998
132132   DECLARE_MACHINE_RESET(intvecs);
133133   UINT32 screen_update_intv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
134134   UINT32 screen_update_intvkbd(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
135   INTERRUPT_GEN_MEMBER(intv_interrupt2);
136   INTERRUPT_GEN_MEMBER(intv_interrupt);
135137};
136138
137139/*----------- defined in video/intv.c -----------*/
r17997r17998
144146DEVICE_START( intv_cart );
145147DEVICE_IMAGE_LOAD( intv_cart );
146148
147extern INTERRUPT_GEN( intv_interrupt );
148149/* for the console + keyboard component... */
149150
150151DEVICE_IMAGE_LOAD( intvkbd_cart );
trunk/src/mess/includes/poly88.h
r17997r17998
3434   virtual void machine_reset();
3535   virtual void video_start();
3636   UINT32 screen_update_poly88(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
37   INTERRUPT_GEN_MEMBER(poly88_interrupt);
3738};
3839
3940
4041/*----------- defined in machine/poly88.c -----------*/
41
42
43INTERRUPT_GEN( poly88_interrupt );
44
4542extern const i8251_interface poly88_usart_interface;
4643
4744extern SNAPSHOT_LOAD( poly88 );
trunk/src/mess/includes/samcoupe.h
r17997r17998
8282   virtual void machine_start();
8383   virtual void machine_reset();
8484   virtual void palette_init();
85   INTERRUPT_GEN_MEMBER(samcoupe_frame_interrupt);
8586};
8687
8788
trunk/src/mess/includes/trs80.h
r17997r17998
122122   UINT32 screen_update_lnw80(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
123123   UINT32 screen_update_radionic(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
124124   UINT32 screen_update_meritum(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
125   INTERRUPT_GEN_MEMBER(trs80_rtc_interrupt);
126   INTERRUPT_GEN_MEMBER(trs80_fdc_interrupt);
125127};
126128
127129
r17997r17998
129131
130132extern const wd17xx_interface trs80_wd17xx_interface;
131133
132INTERRUPT_GEN( trs80_rtc_interrupt );
133INTERRUPT_GEN( trs80_fdc_interrupt );
134
135134#endif   /* TRS80_H_ */
trunk/src/mess/includes/primo.h
r17997r17998
3434   virtual void machine_reset();
3535   DECLARE_MACHINE_RESET(primob);
3636   UINT32 screen_update_primo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
37   INTERRUPT_GEN_MEMBER(primo_vblank_interrupt);
3738};
3839
3940
4041/*----------- defined in machine/primo.c -----------*/
4142
42extern INTERRUPT_GEN( primo_vblank_interrupt );
4343extern SNAPSHOT_LOAD( primo );
4444extern QUICKLOAD_LOAD( primo );
4545
trunk/src/mess/includes/svision.h
r17997r17998
5656   DECLARE_MACHINE_RESET(tvlink);
5757   UINT32 screen_update_svision(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5858   UINT32 screen_update_tvlink(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
59   INTERRUPT_GEN_MEMBER(svision_frame_int);
5960};
6061
6162
trunk/src/mess/includes/c64.h
r17997r17998
142142   int m_cass_rd;
143143   int m_iec_srq;
144144   DECLARE_DRIVER_INIT(c64pal);
145   INTERRUPT_GEN_MEMBER(c64_frame_interrupt);
145146};
146147
147148
trunk/src/mess/includes/vc4000.h
r17997r17998
9797   virtual void video_start();
9898   virtual void palette_init();
9999   UINT32 screen_update_vc4000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
100   INTERRUPT_GEN_MEMBER(vc4000_video_line);
100101};
101102
102
103/*----------- defined in video/vc4000.c -----------*/
104
105extern INTERRUPT_GEN( vc4000_video_line );
106
107103/*----------- defined in audio/vc4000.c -----------*/
108104
109105class vc4000_sound_device : public device_t,
trunk/src/mess/includes/vic10.h
r17997r17998
8383   int m_cia_irq;
8484   int m_vic_irq;
8585   int m_exp_irq;
86   INTERRUPT_GEN_MEMBER(vic10_frame_interrupt);
8687};
8788
8889
trunk/src/mess/includes/pk8020.h
r17997r17998
4545   virtual void video_start();
4646   virtual void palette_init();
4747   UINT32 screen_update_pk8020(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
48   INTERRUPT_GEN_MEMBER(pk8020_interrupt);
4849};
4950
5051
r17997r17998
5455extern const i8255_interface pk8020_ppi8255_interface_3;
5556extern const struct pit8253_config pk8020_pit8253_intf;
5657extern const struct pic8259_interface pk8020_pic8259_config;
57extern INTERRUPT_GEN( pk8020_interrupt );
5858
5959#endif /* pk8020_H_ */
trunk/src/mess/includes/galaxy.h
r17997r17998
3232   DECLARE_MACHINE_RESET(galaxy);
3333   DECLARE_MACHINE_RESET(galaxyp);
3434   UINT32 screen_update_galaxy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
35   INTERRUPT_GEN_MEMBER(galaxy_interrupt);
3536};
3637
3738
3839/*----------- defined in machine/galaxy.c -----------*/
39INTERRUPT_GEN( galaxy_interrupt );
4040SNAPSHOT_LOAD( galaxy );
4141
4242/*----------- defined in video/galaxy.c -----------*/
trunk/src/mess/includes/bbc.h
r17997r17998
282282   DECLARE_MACHINE_RESET(bbcbp);
283283   DECLARE_VIDEO_START(bbcbp);
284284   UINT32 screen_update_bbc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
285   INTERRUPT_GEN_MEMBER(bbcb_vsync);
286   INTERRUPT_GEN_MEMBER(bbcb_keyscan);
287   INTERRUPT_GEN_MEMBER(bbcm_keyscan);
285288};
286289
287290
r17997r17998
295298extern const via6522_interface bbcb_user_via;
296299extern const wd17xx_interface bbc_wd17xx_interface;
297300
298INTERRUPT_GEN( bbcb_keyscan );
299INTERRUPT_GEN( bbcm_keyscan );
300
301301/* disc support */
302302
303303DEVICE_IMAGE_LOAD ( bbcb_cart );
trunk/src/mess/video/arcadia.c
r17997r17998
613613   if (arcadia_sprite_collision(state,2,3)) state->m_reg.d.collision_sprite&=~0x20; //guess
614614}
615615
616INTERRUPT_GEN( arcadia_video_line )
616INTERRUPT_GEN_MEMBER(arcadia_state::arcadia_video_line)
617617{
618   arcadia_state *state = device->machine().driver_data<arcadia_state>();
619   screen_device *screen = device->machine().first_screen();
618   screen_device *screen = machine().first_screen();
620619   int width = screen->width();
621620
622   if (state->m_ad_delay<=0)
623   state->m_ad_select=state->m_reg.d.pal[1]&0x40;
624   else state->m_ad_delay--;
621   if (m_ad_delay<=0)
622   m_ad_select=m_reg.d.pal[1]&0x40;
623   else m_ad_delay--;
625624
626   state->m_line++;
627   state->m_line%=262;
625   m_line++;
626   m_line%=262;
628627   // unbelievable, reflects only charline, but alien invaders uses it for
629628   // alien scrolling
630629
631   if (state->m_line<state->m_ypos)
630   if (m_line<m_ypos)
632631   {
633      state->m_bitmap->plot_box(0, state->m_line, width, 1, (state->m_reg.d.pal[1])&7);
634      memset(state->m_bg[state->m_line], 0, sizeof(state->m_bg[0]));
632      m_bitmap->plot_box(0, m_line, width, 1, (m_reg.d.pal[1])&7);
633      memset(m_bg[m_line], 0, sizeof(m_bg[0]));
635634   }
636635   else
637636   {
638      int h=state->m_doublescan?16:8;
637      int h=m_doublescan?16:8;
639638
640      state->m_charline=(state->m_line-state->m_ypos)/h;
639      m_charline=(m_line-m_ypos)/h;
641640
642      if (state->m_charline<13)
641      if (m_charline<13)
643642      {
644         if (((state->m_line-state->m_ypos)&(h-1))==0)
643         if (((m_line-m_ypos)&(h-1))==0)
645644         {
646            arcadia_vh_draw_line(device->machine(), *state->m_bitmap, state->m_charline*h+state->m_ypos,
647               state->m_reg.d.chars1[state->m_charline]);
645            arcadia_vh_draw_line(machine(), *m_bitmap, m_charline*h+m_ypos,
646               m_reg.d.chars1[m_charline]);
648647         }
649648      }
650649      else
651      if (state->m_lines26 && (state->m_charline<26))
650      if (m_lines26 && (m_charline<26))
652651      {
653         if (((state->m_line-state->m_ypos)&(h-1))==0)
652         if (((m_line-m_ypos)&(h-1))==0)
654653         {
655            arcadia_vh_draw_line(device->machine(), *state->m_bitmap, state->m_charline*h+state->m_ypos,
656               state->m_reg.d.chars2[state->m_charline-13]);
654            arcadia_vh_draw_line(machine(), *m_bitmap, m_charline*h+m_ypos,
655               m_reg.d.chars2[m_charline-13]);
657656         }
658      state->m_charline-=13;
657      m_charline-=13;
659658      }
660659      else
661660      {
662         state->m_charline=0xd;
663         state->m_bitmap->plot_box(0, state->m_line, width, 1, (state->m_reg.d.pal[1])&7);
664         memset(state->m_bg[state->m_line], 0, sizeof(state->m_bg[0]));
661         m_charline=0xd;
662         m_bitmap->plot_box(0, m_line, width, 1, (m_reg.d.pal[1])&7);
663         memset(m_bg[m_line], 0, sizeof(m_bg[0]));
665664      }
666665   }
667   if (state->m_line==261)
668      arcadia_draw_sprites(device->machine(), *state->m_bitmap);
666   if (m_line==261)
667      arcadia_draw_sprites(machine(), *m_bitmap);
669668}
670669
671670READ8_MEMBER( arcadia_state::arcadia_vsync_r )
trunk/src/mess/video/fmtowns.c
r17997r17998
17871787   state->m_video.towns_vblank_flag = 0;
17881788}
17891789
1790INTERRUPT_GEN( towns_vsync_irq )
1790INTERRUPT_GEN_MEMBER(towns_state::towns_vsync_irq)
17911791{
1792   towns_state* state = device->machine().driver_data<towns_state>();
1793   device_t* dev = state->m_pic_slave;
1792   device_t* dev = m_pic_slave;
17941793   pic8259_ir3_w(dev, 1);  // IRQ11 = VSync
17951794   if(IRQ_LOG) logerror("PIC: IRQ11 (VSync) set high\n");
1796   state->m_video.towns_vblank_flag = 1;
1797   device->machine().scheduler().timer_set(device->machine().primary_screen->time_until_vblank_end(), FUNC(towns_vblank_end), 0, (void*)dev);
1798   if(state->m_video.towns_tvram_enable)
1795   m_video.towns_vblank_flag = 1;
1796   machine().scheduler().timer_set(machine().primary_screen->time_until_vblank_end(), FUNC(towns_vblank_end), 0, (void*)dev);
1797   if(m_video.towns_tvram_enable)
17991798      draw_text_layer(dev->machine());
1800   if(state->m_video.towns_sprite_reg[1] & 0x80)
1801      draw_sprites(dev->machine(),&state->m_video.towns_crtc_layerscr[1]);
1799   if(m_video.towns_sprite_reg[1] & 0x80)
1800      draw_sprites(dev->machine(),&m_video.towns_crtc_layerscr[1]);
18021801}
18031802
18041803void towns_state::video_start()
trunk/src/mess/video/vc4000.c
r17997r17998
573573   }
574574}
575575
576INTERRUPT_GEN( vc4000_video_line )
576INTERRUPT_GEN_MEMBER(vc4000_state::vc4000_video_line)
577577{
578   vc4000_state *state = device->machine().driver_data<vc4000_state>();
579578   int x,y,i;
580579   UINT8 collision[400]={0}; // better alloca or gcc feature of non constant long automatic arrays
581   const rectangle &visarea = device->machine().primary_screen->visible_area();
582   assert(ARRAY_LENGTH(collision) >= device->machine().primary_screen->width());
580   const rectangle &visarea = machine().primary_screen->visible_area();
581   assert(ARRAY_LENGTH(collision) >= machine().primary_screen->width());
583582
584   state->m_video.line++;
585   if (state->m_irq_pause) state->m_irq_pause++;
586   if (state->m_video.line>311) state->m_video.line=0;
583   m_video.line++;
584   if (m_irq_pause) m_irq_pause++;
585   if (m_video.line>311) m_video.line=0;
587586
588   if (state->m_video.line==0)
587   if (m_video.line==0)
589588   {
590      state->m_video.background_collision=0;
591      state->m_video.sprite_collision=0;
592      state->m_video.reg.d.sprite_collision=0;
589      m_video.background_collision=0;
590      m_video.sprite_collision=0;
591      m_video.reg.d.sprite_collision=0;
593592//      logerror("begin of frame\n");
594593   }
595594
596   if (state->m_irq_pause>10)
595   if (m_irq_pause>10)
597596   {
598      device->machine().device("maincpu")->execute().set_input_line(0, CLEAR_LINE);
599      state->m_irq_pause = 0;
597      machine().device("maincpu")->execute().set_input_line(0, CLEAR_LINE);
598      m_irq_pause = 0;
600599   }
601600
602   if (state->m_video.line <= VC4000_END_LINE)
601   if (m_video.line <= VC4000_END_LINE)
603602   {
604      vc4000_draw_grid(device->machine(), collision);
603      vc4000_draw_grid(machine(), collision);
605604
606605      /* init object colours */
607      for (i=visarea.min_x; i<visarea.max_x; i++) state->m_objects[i]=8;
606      for (i=visarea.min_x; i<visarea.max_x; i++) m_objects[i]=8;
608607
609608      /* calculate object colours and OR overlapping object colours */
610      vc4000_sprite_update(state, *state->m_bitmap, collision, &state->m_video.sprites[0]);
611      vc4000_sprite_update(state, *state->m_bitmap, collision, &state->m_video.sprites[1]);
612      vc4000_sprite_update(state, *state->m_bitmap, collision, &state->m_video.sprites[2]);
613      vc4000_sprite_update(state, *state->m_bitmap, collision, &state->m_video.sprites[3]);
609      vc4000_sprite_update(this, *m_bitmap, collision, &m_video.sprites[0]);
610      vc4000_sprite_update(this, *m_bitmap, collision, &m_video.sprites[1]);
611      vc4000_sprite_update(this, *m_bitmap, collision, &m_video.sprites[2]);
612      vc4000_sprite_update(this, *m_bitmap, collision, &m_video.sprites[3]);
614613
615614      for (i=visarea.min_x; i<visarea.max_x; i++)
616615      {
617         state->m_video.sprite_collision|=state->m_sprite_collision[collision[i]];
618         state->m_video.background_collision|=state->m_background_collision[collision[i]];
616         m_video.sprite_collision|=m_sprite_collision[collision[i]];
617         m_video.background_collision|=m_background_collision[collision[i]];
619618         /* display final object colours */
620         if (state->m_objects[i] < 8)
621               state->m_bitmap->pix16(state->m_video.line, i) = state->m_objects[i];
619         if (m_objects[i] < 8)
620               m_bitmap->pix16(m_video.line, i) = m_objects[i];
622621      }
623622
624      y = state->m_video.reg.d.score_control&1?200:20;
623      y = m_video.reg.d.score_control&1?200:20;
625624
626      if ((state->m_video.line>=y)&&(state->m_video.line<y+20))
625      if ((m_video.line>=y)&&(m_video.line<y+20))
627626      {
628627         x = 60;
629         vc4000_draw_digit(state, *state->m_bitmap, x, y, state->m_video.reg.d.bcd[0]>>4, state->m_video.line-y);
630         vc4000_draw_digit(state, *state->m_bitmap, x+16, y, state->m_video.reg.d.bcd[0]&0xf, state->m_video.line-y);
631         if (state->m_video.reg.d.score_control&2)   x -= 16;
632         vc4000_draw_digit(state, *state->m_bitmap, x+48, y, state->m_video.reg.d.bcd[1]>>4, state->m_video.line-y);
633         vc4000_draw_digit(state, *state->m_bitmap, x+64, y, state->m_video.reg.d.bcd[1]&0xf, state->m_video.line-y);
628         vc4000_draw_digit(this, *m_bitmap, x, y, m_video.reg.d.bcd[0]>>4, m_video.line-y);
629         vc4000_draw_digit(this, *m_bitmap, x+16, y, m_video.reg.d.bcd[0]&0xf, m_video.line-y);
630         if (m_video.reg.d.score_control&2)   x -= 16;
631         vc4000_draw_digit(this, *m_bitmap, x+48, y, m_video.reg.d.bcd[1]>>4, m_video.line-y);
632         vc4000_draw_digit(this, *m_bitmap, x+64, y, m_video.reg.d.bcd[1]&0xf, m_video.line-y);
634633      }
635634   }
636   if (state->m_video.line==VC4000_END_LINE) state->m_video.reg.d.sprite_collision |=0x40;
635   if (m_video.line==VC4000_END_LINE) m_video.reg.d.sprite_collision |=0x40;
637636
638   if (((state->m_video.line == VC4000_END_LINE) |
639      (state->m_video.sprites[3].finished_now) |
640      (state->m_video.sprites[2].finished_now) |
641      (state->m_video.sprites[1].finished_now) |
642      (state->m_video.sprites[0].finished_now)) && (!state->m_irq_pause))
637   if (((m_video.line == VC4000_END_LINE) |
638      (m_video.sprites[3].finished_now) |
639      (m_video.sprites[2].finished_now) |
640      (m_video.sprites[1].finished_now) |
641      (m_video.sprites[0].finished_now)) && (!m_irq_pause))
643642      {
644         device->machine().device("maincpu")->execute().set_input_line_and_vector(0, ASSERT_LINE, 3);
645         state->m_irq_pause=1;
643         machine().device("maincpu")->execute().set_input_line_and_vector(0, ASSERT_LINE, 3);
644         m_irq_pause=1;
646645      }
647646}
648647
trunk/src/mess/drivers/rainbow.c
r17997r17998
132132   virtual void machine_reset();
133133public:   
134134   UINT32 screen_update_rainbow(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
135   INTERRUPT_GEN_MEMBER(vblank_irq);
135136};
136137
137138void rainbow_state::machine_start()
r17997r17998
316317   return m_p_ram[offset];
317318}
318319
319static INTERRUPT_GEN( vblank_irq )
320INTERRUPT_GEN_MEMBER(rainbow_state::vblank_irq)
320321{
321    device->execute().set_input_line_and_vector(INPUT_LINE_INT0, ASSERT_LINE, 0x20);
322    device.execute().set_input_line_and_vector(INPUT_LINE_INT0, ASSERT_LINE, 0x20);
322323}
323324
324325WRITE8_MEMBER( rainbow_state::clear_video_interrupt )
r17997r17998
463464   MCFG_CPU_ADD("maincpu",I8088, XTAL_24_0734MHz / 5)
464465   MCFG_CPU_PROGRAM_MAP(rainbow8088_map)
465466   MCFG_CPU_IO_MAP(rainbow8088_io)
466   MCFG_CPU_VBLANK_INT("screen", vblank_irq)
467   MCFG_CPU_VBLANK_INT_DRIVER("screen", rainbow_state, vblank_irq)
467468
468469   MCFG_CPU_ADD("subcpu",Z80, XTAL_24_0734MHz / 6)
469470   MCFG_CPU_PROGRAM_MAP(rainbowz80_mem)
trunk/src/mess/drivers/pdp1.c
r17997r17998
18011801/*
18021802    Not a real interrupt - just handle keyboard input
18031803*/
1804INTERRUPT_GEN( pdp1_interrupt )
1804INTERRUPT_GEN_MEMBER(pdp1_state::pdp1_interrupt)
18051805{
1806   pdp1_state *state = device->machine().driver_data<pdp1_state>();
1807   running_machine &machine = device->machine();
18081806   int control_keys;
18091807   int tw_keys;
18101808   int ta_keys;
r17997r17998
18141812   int ta_transitions;
18151813
18161814
1817   device->state().set_state_int(PDP1_SS, device->machine().root_device().ioport("SENSE")->read());
1815   device.state().set_state_int(PDP1_SS, machine().root_device().ioport("SENSE")->read());
18181816
18191817   /* read new state of control keys */
1820   control_keys = state->ioport("CSW")->read();
1818   control_keys = ioport("CSW")->read();
18211819
18221820   if (control_keys & pdp1_control)
18231821   {
18241822      /* compute transitions */
1825      control_transitions = control_keys & (~ state->m_old_control_keys);
1823      control_transitions = control_keys & (~ m_old_control_keys);
18261824
18271825      if (control_transitions & pdp1_extend)
18281826      {
1829         device->state().set_state_int(PDP1_EXTEND_SW, ! device->state().state_int(PDP1_EXTEND_SW));
1827         device.state().set_state_int(PDP1_EXTEND_SW, ! device.state().state_int(PDP1_EXTEND_SW));
18301828      }
18311829      if (control_transitions & pdp1_start_nobrk)
18321830      {
1833         pdp1_pulse_start_clear(device);   /* pulse Start Clear line */
1834         device->state().set_state_int(PDP1_EXD, device->state().state_int(PDP1_EXTEND_SW));
1835         device->state().set_state_int(PDP1_SBM, (UINT64)0);
1836         device->state().set_state_int(PDP1_OV, (UINT64)0);
1837         device->state().set_state_int(PDP1_PC, device->state().state_int(PDP1_TA));
1838         device->state().set_state_int(PDP1_RUN, 1);
1831         pdp1_pulse_start_clear(&device);   /* pulse Start Clear line */
1832         device.state().set_state_int(PDP1_EXD, device.state().state_int(PDP1_EXTEND_SW));
1833         device.state().set_state_int(PDP1_SBM, (UINT64)0);
1834         device.state().set_state_int(PDP1_OV, (UINT64)0);
1835         device.state().set_state_int(PDP1_PC, device.state().state_int(PDP1_TA));
1836         device.state().set_state_int(PDP1_RUN, 1);
18391837      }
18401838      if (control_transitions & pdp1_start_brk)
18411839      {
1842         pdp1_pulse_start_clear(device);   /* pulse Start Clear line */
1843         device->state().set_state_int(PDP1_EXD, device->state().state_int(PDP1_EXTEND_SW));
1844         device->state().set_state_int(PDP1_SBM, 1);
1845         device->state().set_state_int(PDP1_OV, (UINT64)0);
1846         device->state().set_state_int(PDP1_PC, device->state().state_int(PDP1_TA));
1847         device->state().set_state_int(PDP1_RUN, 1);
1840         pdp1_pulse_start_clear(&device);   /* pulse Start Clear line */
1841         device.state().set_state_int(PDP1_EXD, device.state().state_int(PDP1_EXTEND_SW));
1842         device.state().set_state_int(PDP1_SBM, 1);
1843         device.state().set_state_int(PDP1_OV, (UINT64)0);
1844         device.state().set_state_int(PDP1_PC, device.state().state_int(PDP1_TA));
1845         device.state().set_state_int(PDP1_RUN, 1);
18481846      }
18491847      if (control_transitions & pdp1_stop)
18501848      {
1851         device->state().set_state_int(PDP1_RUN, (UINT64)0);
1852         device->state().set_state_int(PDP1_RIM, (UINT64)0);   /* bug : we stop after reading an even-numbered word
1849         device.state().set_state_int(PDP1_RUN, (UINT64)0);
1850         device.state().set_state_int(PDP1_RIM, (UINT64)0);   /* bug : we stop after reading an even-numbered word
18531851                                            (i.e. data), whereas a real pdp-1 stops after reading
18541852                                            an odd-numbered word (i.e. dio instruciton) */
18551853      }
18561854      if (control_transitions & pdp1_continue)
18571855      {
1858         device->state().set_state_int(PDP1_RUN, 1);
1856         device.state().set_state_int(PDP1_RUN, 1);
18591857      }
18601858      if (control_transitions & pdp1_examine)
18611859      {
1862         pdp1_pulse_start_clear(device);   /* pulse Start Clear line */
1863         device->state().set_state_int(PDP1_PC, device->state().state_int(PDP1_TA));
1864         device->state().set_state_int(PDP1_MA, device->state().state_int(PDP1_PC));
1865         device->state().set_state_int(PDP1_IR, LAC);   /* this instruction is actually executed */
1860         pdp1_pulse_start_clear(&device);   /* pulse Start Clear line */
1861         device.state().set_state_int(PDP1_PC, device.state().state_int(PDP1_TA));
1862         device.state().set_state_int(PDP1_MA, device.state().state_int(PDP1_PC));
1863         device.state().set_state_int(PDP1_IR, LAC);   /* this instruction is actually executed */
18661864
1867         device->state().set_state_int(PDP1_MB, (signed)device->memory().space(AS_PROGRAM)->read_dword(PDP1_MA<<2));
1868         device->state().set_state_int(PDP1_AC, device->state().state_int(PDP1_MB));
1865         device.state().set_state_int(PDP1_MB, (signed)device.memory().space(AS_PROGRAM)->read_dword(PDP1_MA<<2));
1866         device.state().set_state_int(PDP1_AC, device.state().state_int(PDP1_MB));
18691867      }
18701868      if (control_transitions & pdp1_deposit)
18711869      {
1872         pdp1_pulse_start_clear(device);   /* pulse Start Clear line */
1873         device->state().set_state_int(PDP1_PC, device->state().state_int(PDP1_TA));
1874         device->state().set_state_int(PDP1_MA, device->state().state_int(PDP1_PC));
1875         device->state().set_state_int(PDP1_AC, device->state().state_int(PDP1_TW));
1876         device->state().set_state_int(PDP1_IR, DAC);   /* this instruction is actually executed */
1870         pdp1_pulse_start_clear(&device);   /* pulse Start Clear line */
1871         device.state().set_state_int(PDP1_PC, device.state().state_int(PDP1_TA));
1872         device.state().set_state_int(PDP1_MA, device.state().state_int(PDP1_PC));
1873         device.state().set_state_int(PDP1_AC, device.state().state_int(PDP1_TW));
1874         device.state().set_state_int(PDP1_IR, DAC);   /* this instruction is actually executed */
18771875
1878         device->state().set_state_int(PDP1_MB, device->state().state_int(PDP1_AC));
1879         device->memory().space(AS_PROGRAM)->write_dword(device->state().state_int(PDP1_MA)<<2, device->state().state_int(PDP1_MB));
1876         device.state().set_state_int(PDP1_MB, device.state().state_int(PDP1_AC));
1877         device.memory().space(AS_PROGRAM)->write_dword(device.state().state_int(PDP1_MA)<<2, device.state().state_int(PDP1_MB));
18801878      }
18811879      if (control_transitions & pdp1_read_in)
18821880      {   /* set cpu to read instructions from perforated tape */
1883         pdp1_pulse_start_clear(device);   /* pulse Start Clear line */
1884         device->state().set_state_int(PDP1_PC, (  device->state().state_int(PDP1_TA) & 0170000)
1885                              |  (device->state().state_int(PDP1_PC) & 0007777));   /* transfer ETA to EPC */
1881         pdp1_pulse_start_clear(&device);   /* pulse Start Clear line */
1882         device.state().set_state_int(PDP1_PC, (  device.state().state_int(PDP1_TA) & 0170000)
1883                              |  (device.state().state_int(PDP1_PC) & 0007777));   /* transfer ETA to EPC */
18861884         /*machine.device("maincpu")->state().set_state_int(PDP1_MA, machine.device("maincpu")->state().state_int(PDP1_PC));*/
1887         device->state().set_state_int(PDP1_EXD, device->state().state_int(PDP1_EXTEND_SW));
1888         device->state().set_state_int(PDP1_OV, (UINT64)0);      /* right??? */
1889         device->state().set_state_int(PDP1_RUN, (UINT64)0);
1890         device->state().set_state_int(PDP1_RIM, 1);
1885         device.state().set_state_int(PDP1_EXD, device.state().state_int(PDP1_EXTEND_SW));
1886         device.state().set_state_int(PDP1_OV, (UINT64)0);      /* right??? */
1887         device.state().set_state_int(PDP1_RUN, (UINT64)0);
1888         device.state().set_state_int(PDP1_RIM, 1);
18911889      }
18921890      if (control_transitions & pdp1_reader)
18931891      {
r17997r17998
18971895      }
18981896      if (control_transitions & pdp1_single_step)
18991897      {
1900         device->state().set_state_int(PDP1_SNGL_STEP, ! device->state().state_int(PDP1_SNGL_STEP));
1898         device.state().set_state_int(PDP1_SNGL_STEP, ! device.state().state_int(PDP1_SNGL_STEP));
19011899      }
19021900      if (control_transitions & pdp1_single_inst)
19031901      {
1904         device->state().set_state_int(PDP1_SNGL_INST, ! device->state().state_int(PDP1_SNGL_INST));
1902         device.state().set_state_int(PDP1_SNGL_INST, ! device.state().state_int(PDP1_SNGL_INST));
19051903      }
19061904
19071905      /* remember new state of control keys */
1908      state->m_old_control_keys = control_keys;
1906      m_old_control_keys = control_keys;
19091907
19101908
19111909      /* handle test word keys */
1912      tw_keys = (machine.root_device().ioport("TWDMSB")->read() << 16) | machine.root_device().ioport("TWDLSB")->read();
1910      tw_keys = (machine().root_device().ioport("TWDMSB")->read() << 16) | machine().root_device().ioport("TWDLSB")->read();
19131911
19141912      /* compute transitions */
1915      tw_transitions = tw_keys & (~ state->m_old_tw_keys);
1913      tw_transitions = tw_keys & (~ m_old_tw_keys);
19161914
19171915      if (tw_transitions)
1918         device->state().set_state_int(PDP1_TW, device->state().state_int(PDP1_TW) ^ tw_transitions);
1916         device.state().set_state_int(PDP1_TW, device.state().state_int(PDP1_TW) ^ tw_transitions);
19191917
19201918      /* remember new state of test word keys */
1921      state->m_old_tw_keys = tw_keys;
1919      m_old_tw_keys = tw_keys;
19221920
19231921
19241922      /* handle address keys */
1925      ta_keys = machine.root_device().ioport("TSTADD")->read();
1923      ta_keys = machine().root_device().ioport("TSTADD")->read();
19261924
19271925      /* compute transitions */
1928      ta_transitions = ta_keys & (~ state->m_old_ta_keys);
1926      ta_transitions = ta_keys & (~ m_old_ta_keys);
19291927
19301928      if (ta_transitions)
1931         device->state().set_state_int(PDP1_TA, device->state().state_int(PDP1_TA) ^ ta_transitions);
1929         device.state().set_state_int(PDP1_TA, device.state().state_int(PDP1_TA) ^ ta_transitions);
19321930
19331931      /* remember new state of test word keys */
1934      state->m_old_ta_keys = ta_keys;
1932      m_old_ta_keys = ta_keys;
19351933
19361934   }
19371935   else
19381936   {
1939      state->m_old_control_keys = 0;
1940      state->m_old_tw_keys = 0;
1941      state->m_old_ta_keys = 0;
1937      m_old_control_keys = 0;
1938      m_old_tw_keys = 0;
1939      m_old_ta_keys = 0;
19421940
1943      pdp1_keyboard(machine);
1941      pdp1_keyboard(machine());
19441942   }
19451943
1946   pdp1_lightpen(machine);
1944   pdp1_lightpen(machine());
19471945}
19481946
19491947
r17997r17998
19541952   MCFG_CPU_ADD("maincpu", PDP1, 1000000/*the CPU core uses microsecond counts*/)
19551953   MCFG_CPU_CONFIG(pdp1_reset_param)
19561954   MCFG_CPU_PROGRAM_MAP(pdp1_map)
1957   MCFG_CPU_VBLANK_INT("screen", pdp1_interrupt)   /* dummy interrupt: handles input */
1955   MCFG_CPU_VBLANK_INT_DRIVER("screen", pdp1_state, pdp1_interrupt)   /* dummy interrupt: handles input */
19581956
19591957
19601958   /* video hardware (includes the control panel and typewriter output) */
trunk/src/mess/drivers/homelab.c
r17997r17998
7373   DECLARE_VIDEO_START(brailab4);
7474   UINT32 screen_update_homelab2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
7575   UINT32 screen_update_homelab3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
76   INTERRUPT_GEN_MEMBER(homelab_frame);
7677};
7778
78static INTERRUPT_GEN( homelab_frame )
79INTERRUPT_GEN_MEMBER(homelab_state::homelab_frame)
7980{
80   homelab_state *state = device->machine().driver_data<homelab_state>();
81   if (state->m_nmi)
82      state->m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
81   if (m_nmi)
82      m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
8383}
8484
8585READ8_MEMBER( homelab_state::key_r ) // offset 27F-2FE
r17997r17998
741741   /* basic machine hardware */
742742   MCFG_CPU_ADD("maincpu", Z80, XTAL_8MHz / 2)
743743   MCFG_CPU_PROGRAM_MAP(homelab2_mem)
744   MCFG_CPU_VBLANK_INT("screen", homelab_frame)
744   MCFG_CPU_VBLANK_INT_DRIVER("screen", homelab_state, homelab_frame)
745745
746746   /* video hardware */
747747   MCFG_SCREEN_ADD("screen", RASTER)
trunk/src/mess/drivers/pc100.c
r17997r17998
6464   virtual void machine_reset();
6565   virtual void video_start();
6666   UINT32 screen_update_pc100(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
67   INTERRUPT_GEN_MEMBER(pc100_vblank_irq);
6768};
6869
6970void pc100_state::video_start()
r17997r17998
342343{
343344}
344345
345static INTERRUPT_GEN(pc100_vblank_irq)
346INTERRUPT_GEN_MEMBER(pc100_state::pc100_vblank_irq)
346347{
347   pic8259_ir4_w(device->machine().device("pic8259"), 1);
348   pic8259_ir4_w(machine().device("pic8259"), 1);
348349}
349350
350351static TIMER_DEVICE_CALLBACK( pc100_600hz_irq )
r17997r17998
386387   MCFG_CPU_ADD("maincpu", I8086, MASTER_CLOCK)
387388   MCFG_CPU_PROGRAM_MAP(pc100_map)
388389   MCFG_CPU_IO_MAP(pc100_io)
389   MCFG_CPU_VBLANK_INT("screen",pc100_vblank_irq)
390   MCFG_CPU_VBLANK_INT_DRIVER("screen", pc100_state, pc100_vblank_irq)
390391
391392
392393   /* video hardware */
trunk/src/mess/drivers/pc9801.c
r17997r17998
415415   DECLARE_PALETTE_INIT(pc9801);
416416   DECLARE_MACHINE_RESET(pc9801rs);
417417   DECLARE_MACHINE_START(pc9821);
418   INTERRUPT_GEN_MEMBER(pc9801_vrtc_irq);
418419};
419420
420421
r17997r17998
26072608   state_save_register_global_pointer(machine(), m_sdip, 24);
26082609}
26092610
2610static INTERRUPT_GEN(pc9801_vrtc_irq)
2611INTERRUPT_GEN_MEMBER(pc9801_state::pc9801_vrtc_irq)
26112612{
2612   pc9801_state *state = device->machine().driver_data<pc9801_state>();
26132613   #if 0
2614   address_space &space = *device->machine().device("maincpu")->memory().space(AS_PROGRAM);
2614   address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
26152615   static UINT8 test;
26162616
2617   if(device->machine().input().code_pressed_once(JOYCODE_BUTTON1))
2617   if(machine().input().code_pressed_once(JOYCODE_BUTTON1))
26182618      test^=1;
26192619
26202620   if(test)
r17997r17998
26242624   }
26252625   #endif
26262626
2627   if(state->m_vrtc_irq_mask)
2627   if(m_vrtc_irq_mask)
26282628   {
2629      pic8259_ir2_w(device->machine().device("pic8259_master"), 1);
2630      state->m_vrtc_irq_mask = 0; // TODO: this irq auto-masks?
2629      pic8259_ir2_w(machine().device("pic8259_master"), 1);
2630      m_vrtc_irq_mask = 0; // TODO: this irq auto-masks?
26312631   }
26322632   else
2633      pic8259_ir2_w(device->machine().device("pic8259_master"), 0);
2633      pic8259_ir2_w(machine().device("pic8259_master"), 0);
26342634}
26352635
26362636
r17997r17998
26392639   MCFG_CPU_ADD("maincpu", I8086, 5000000) //unknown clock
26402640   MCFG_CPU_PROGRAM_MAP(pc9801_map)
26412641   MCFG_CPU_IO_MAP(pc9801_io)
2642   MCFG_CPU_VBLANK_INT("screen",pc9801_vrtc_irq)
2642   MCFG_CPU_VBLANK_INT_DRIVER("screen", pc9801_state, pc9801_vrtc_irq)
26432643
26442644   MCFG_MACHINE_START_OVERRIDE(pc9801_state,pc9801)
26452645   MCFG_MACHINE_RESET_OVERRIDE(pc9801_state,pc9801f)
r17997r17998
26942694   MCFG_CPU_REPLACE("maincpu",V30,10000000)
26952695   MCFG_CPU_PROGRAM_MAP(pc9801_map)
26962696   MCFG_CPU_IO_MAP(pc9801_io)
2697   MCFG_CPU_VBLANK_INT("screen",pc9801_vrtc_irq)
2697   MCFG_CPU_VBLANK_INT_DRIVER("screen", pc9801_state, pc9801_vrtc_irq)
26982698MACHINE_CONFIG_END
26992699#endif
27002700
r17997r17998
27022702   MCFG_CPU_ADD("maincpu", I386, 16000000)
27032703   MCFG_CPU_PROGRAM_MAP(pc9801rs_map)
27042704   MCFG_CPU_IO_MAP(pc9801rs_io)
2705   MCFG_CPU_VBLANK_INT("screen",pc9801_vrtc_irq)
2705   MCFG_CPU_VBLANK_INT_DRIVER("screen", pc9801_state, pc9801_vrtc_irq)
27062706
27072707   MCFG_MACHINE_START_OVERRIDE(pc9801_state,pc9801)
27082708   MCFG_MACHINE_RESET_OVERRIDE(pc9801_state,pc9801rs)
r17997r17998
27552755   MCFG_CPU_CONFIG(i286_address_mask)
27562756   MCFG_CPU_PROGRAM_MAP(pc9801ux_map)
27572757   MCFG_CPU_IO_MAP(pc9801ux_io)
2758   MCFG_CPU_VBLANK_INT("screen",pc9801_vrtc_irq)
2758   MCFG_CPU_VBLANK_INT_DRIVER("screen", pc9801_state, pc9801_vrtc_irq)
27592759MACHINE_CONFIG_END
27602760
27612761static MACHINE_CONFIG_START( pc9821, pc9801_state )
27622762   MCFG_CPU_ADD("maincpu", I486, 16000000)
27632763   MCFG_CPU_PROGRAM_MAP(pc9821_map)
27642764   MCFG_CPU_IO_MAP(pc9821_io)
2765   MCFG_CPU_VBLANK_INT("screen",pc9801_vrtc_irq)
2765   MCFG_CPU_VBLANK_INT_DRIVER("screen", pc9801_state, pc9801_vrtc_irq)
27662766
27672767   MCFG_MACHINE_START_OVERRIDE(pc9801_state,pc9821)
27682768   MCFG_MACHINE_RESET_OVERRIDE(pc9801_state,pc9801rs)
r17997r17998
28122812   MCFG_CPU_REPLACE("maincpu",PENTIUM,32000000) /* TODO: clock */
28132813   MCFG_CPU_PROGRAM_MAP(pc9821_map)
28142814   MCFG_CPU_IO_MAP(pc9821_io)
2815   MCFG_CPU_VBLANK_INT("screen",pc9801_vrtc_irq)
2815   MCFG_CPU_VBLANK_INT_DRIVER("screen", pc9801_state, pc9801_vrtc_irq)
28162816MACHINE_CONFIG_END
28172817
28182818/*
trunk/src/mess/drivers/apple3.c
r17997r17998
7171   MCFG_CPU_ADD("maincpu", M6502, 2000000)        /* 2 MHz */
7272   MCFG_CPU_PROGRAM_MAP(apple3_map)
7373   MCFG_CPU_CONFIG( apple3_m6502_interface )
74   MCFG_CPU_PERIODIC_INT(apple3_interrupt, 192)
74   MCFG_CPU_PERIODIC_INT_DRIVER(apple3_state, apple3_interrupt, 192)
7575   MCFG_QUANTUM_TIME(attotime::from_hz(60))
7676
7777   MCFG_MACHINE_RESET_OVERRIDE(apple3_state, apple3 )
trunk/src/mess/drivers/c65.c
r17997r17998
289289   c65_c64_mem_r
290290};
291291
292static INTERRUPT_GEN( vic3_raster_irq )
292INTERRUPT_GEN_MEMBER(c65_state::vic3_raster_irq)
293293{
294   device_t *vic3 = device->machine().device("vic3");
294   device_t *vic3 = machine().device("vic3");
295295
296296   vic3_raster_interrupt_gen(vic3);
297297}
r17997r17998
306306   /* basic machine hardware */
307307   MCFG_CPU_ADD("maincpu", M4510, 3500000)  /* or VIC6567_CLOCK, */
308308   MCFG_CPU_PROGRAM_MAP(c65_mem)
309   MCFG_CPU_VBLANK_INT("screen", c65_frame_interrupt)
310   MCFG_CPU_PERIODIC_INT(vic3_raster_irq, VIC6567_HRETRACERATE)
309   MCFG_CPU_VBLANK_INT_DRIVER("screen", c65_state,  c65_frame_interrupt)
310   MCFG_CPU_PERIODIC_INT_DRIVER(c65_state, vic3_raster_irq,  VIC6567_HRETRACERATE)
311311
312312   MCFG_MACHINE_START_OVERRIDE(c65_state, c65 )
313313
trunk/src/mess/drivers/cbmb.c
r17997r17998
498498   /* basic machine hardware */
499499   MCFG_CPU_ADD("maincpu", M6509, VIC6567_CLOCK)        /* 7.8336 MHz */
500500   MCFG_CPU_PROGRAM_MAP(p500_mem)
501   //MCFG_CPU_PERIODIC_INT(vic2_raster_irq, VIC6567_HRETRACERATE)
501   //MCFG_CPU_PERIODIC_INT_DRIVER(cbmb_state, vic2_raster_irq, VIC6567_HRETRACERATE)
502502
503503   MCFG_MACHINE_RESET_OVERRIDE(cbmb_state, cbmb )
504504
trunk/src/mess/drivers/mbee.c
r17997r17998
712712   MCFG_CPU_PROGRAM_MAP(mbeeic_mem)
713713   MCFG_CPU_IO_MAP(mbeeic_io)
714714   MCFG_CPU_CONFIG(mbee_daisy_chain)
715   //MCFG_CPU_VBLANK_INT("screen", mbee_interrupt)
715   //MCFG_CPU_VBLANK_INT_DRIVER("screen", mbee_state, mbee_interrupt)
716716
717717   MCFG_MACHINE_RESET_OVERRIDE(mbee_state, mbee )
718718
trunk/src/mess/drivers/pc88va.c
r17997r17998
102102   virtual void machine_reset();
103103   virtual void video_start();
104104   UINT32 screen_update_pc88va(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
105   INTERRUPT_GEN_MEMBER(pc88va_vrtc_irq);
105106};
106107
107108
r17997r17998
15621563   machine().device("fdccpu")->execute().set_input_line_vector(0, 0);
15631564}
15641565
1565static INTERRUPT_GEN( pc88va_vrtc_irq )
1566INTERRUPT_GEN_MEMBER(pc88va_state::pc88va_vrtc_irq)
15661567{
1567   pic8259_ir2_w(device->machine().device("pic8259_master"), 1);
1568   pic8259_ir2_w(machine().device("pic8259_master"), 1);
15681569}
15691570
15701571/* Not sure if parameters are correct for pc88va (copied from x68k) */
r17997r17998
16571658   MCFG_CPU_ADD("maincpu", V30, 8000000)        /* 8 MHz */
16581659   MCFG_CPU_PROGRAM_MAP(pc88va_map)
16591660   MCFG_CPU_IO_MAP(pc88va_io_map)
1660   MCFG_CPU_VBLANK_INT("screen",pc88va_vrtc_irq)
1661   MCFG_CPU_VBLANK_INT_DRIVER("screen", pc88va_state, pc88va_vrtc_irq)
16611662
16621663   MCFG_CPU_ADD("fdccpu", Z80, 8000000)        /* 8 MHz */
16631664   MCFG_CPU_PROGRAM_MAP(pc88va_z80_map)
trunk/src/mess/drivers/pc6001.c
r17997r17998
233233   UINT32 screen_update_pc6001(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
234234   UINT32 screen_update_pc6001m2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
235235   UINT32 screen_update_pc6001sr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
236   INTERRUPT_GEN_MEMBER(pc6001_interrupt);
237   INTERRUPT_GEN_MEMBER(pc6001sr_interrupt);
236238};
237239
238240
r17997r17998
18461848
18471849static UINT8 check_joy_press(running_machine &machine);
18481850
1849static INTERRUPT_GEN( pc6001_interrupt )
1851INTERRUPT_GEN_MEMBER(pc6001_state::pc6001_interrupt)
18501852{
1851   pc6001_state *state = device->machine().driver_data<pc6001_state>();
1852   state->m_cur_keycode = check_joy_press(device->machine());
1853   m_cur_keycode = check_joy_press(machine());
18531854   if(IRQ_LOG) printf("Stick IRQ called 0x16\n");
1854   state->m_irq_vector = 0x16;
1855   device->execute().set_input_line(0, ASSERT_LINE);
1855   m_irq_vector = 0x16;
1856   device.execute().set_input_line(0, ASSERT_LINE);
18561857}
18571858
1858static INTERRUPT_GEN( pc6001sr_interrupt )
1859INTERRUPT_GEN_MEMBER(pc6001_state::pc6001sr_interrupt)
18591860{
1860   pc6001_state *state = device->machine().driver_data<pc6001_state>();
1861   state->m_kludge^= 1;
1861   m_kludge^= 1;
18621862
1863   state->m_cur_keycode = check_joy_press(device->machine());
1863   m_cur_keycode = check_joy_press(machine());
18641864   if(IRQ_LOG) printf("VRTC IRQ called 0x16\n");
1865   state->m_irq_vector = (state->m_kludge) ? 0x22 : 0x16;
1866   device->execute().set_input_line(0, ASSERT_LINE);
1865   m_irq_vector = (m_kludge) ? 0x22 : 0x16;
1866   device.execute().set_input_line(0, ASSERT_LINE);
18671867}
18681868
18691869static IRQ_CALLBACK ( pc6001_irq_callback )
r17997r17998
23262326   MCFG_CPU_ADD("maincpu",Z80, PC6001_MAIN_CLOCK / 2) // ~4 Mhz
23272327   MCFG_CPU_PROGRAM_MAP(pc6001_map)
23282328   MCFG_CPU_IO_MAP(pc6001_io)
2329   MCFG_CPU_VBLANK_INT("screen", pc6001_interrupt)
2329   MCFG_CPU_VBLANK_INT_DRIVER("screen", pc6001_state, pc6001_interrupt)
23302330
23312331//  MCFG_CPU_ADD("subcpu", I8049, 7987200)
23322332
r17997r17998
23982398   MCFG_CPU_REPLACE("maincpu", Z80, PC6001_MAIN_CLOCK / 2)
23992399   MCFG_CPU_PROGRAM_MAP(pc6001m2_map)
24002400   MCFG_CPU_IO_MAP(pc6601_io)
2401   MCFG_CPU_VBLANK_INT("screen", pc6001_interrupt)
2401   MCFG_CPU_VBLANK_INT_DRIVER("screen", pc6001_state, pc6001_interrupt)
24022402MACHINE_CONFIG_END
24032403
24042404static MACHINE_CONFIG_DERIVED( pc6001sr, pc6001m2 )
r17997r17998
24122412   MCFG_CPU_REPLACE("maincpu", Z80, XTAL_3_579545MHz) //*Yes*, PC-6001 SR Z80 CPU is actually slower than older models
24132413   MCFG_CPU_PROGRAM_MAP(pc6001sr_map)
24142414   MCFG_CPU_IO_MAP(pc6001sr_io)
2415   MCFG_CPU_VBLANK_INT("screen", pc6001sr_interrupt)
2415   MCFG_CPU_VBLANK_INT_DRIVER("screen", pc6001_state, pc6001sr_interrupt)
24162416MACHINE_CONFIG_END
24172417
24182418/* ROM definition */
trunk/src/mess/drivers/vii.c
r17997r17998
140140   virtual void machine_reset();
141141   virtual void video_start();
142142   UINT32 screen_update_vii(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
143   INTERRUPT_GEN_MEMBER(vii_vblank);
143144};
144145
145146enum
r17997r17998
10211022{
10221023}
10231024
1024static INTERRUPT_GEN( vii_vblank )
1025INTERRUPT_GEN_MEMBER(vii_state::vii_vblank)
10251026{
1026   vii_state *state = device->machine().driver_data<vii_state>();
1027   UINT32 x = device->machine().rand() & 0x3ff;
1028   UINT32 y = device->machine().rand() & 0x3ff;
1029   UINT32 z = device->machine().rand() & 0x3ff;
1027   UINT32 x = machine().rand() & 0x3ff;
1028   UINT32 y = machine().rand() & 0x3ff;
1029   UINT32 z = machine().rand() & 0x3ff;
10301030
10311031
1032   state->m_controller_input[0] = state->ioport("P1")->read();
1033   state->m_controller_input[1] = (UINT8)x;
1034   state->m_controller_input[2] = (UINT8)y;
1035   state->m_controller_input[3] = (UINT8)z;
1036   state->m_controller_input[4] = 0;
1032   m_controller_input[0] = ioport("P1")->read();
1033   m_controller_input[1] = (UINT8)x;
1034   m_controller_input[2] = (UINT8)y;
1035   m_controller_input[3] = (UINT8)z;
1036   m_controller_input[4] = 0;
10371037   x >>= 8;
10381038   y >>= 8;
10391039   z >>= 8;
1040   state->m_controller_input[5] = (z << 4) | (y << 2) | x;
1041   state->m_controller_input[6] = 0xff;
1042   state->m_controller_input[7] = 0;
1040   m_controller_input[5] = (z << 4) | (y << 2) | x;
1041   m_controller_input[6] = 0xff;
1042   m_controller_input[7] = 0;
10431043
1044   state->m_uart_rx_count = 0;
1044   m_uart_rx_count = 0;
10451045
1046   state->VII_VIDEO_IRQ_STATUS = state->VII_VIDEO_IRQ_ENABLE & 1;
1047   if(state->VII_VIDEO_IRQ_STATUS)
1046   VII_VIDEO_IRQ_STATUS = VII_VIDEO_IRQ_ENABLE & 1;
1047   if(VII_VIDEO_IRQ_STATUS)
10481048   {
1049      verboselog(device->machine(), 0, "Video IRQ\n");
1050      device->machine().device("maincpu")->execute().set_input_line(UNSP_IRQ0_LINE, ASSERT_LINE);
1049      verboselog(machine(), 0, "Video IRQ\n");
1050      machine().device("maincpu")->execute().set_input_line(UNSP_IRQ0_LINE, ASSERT_LINE);
10511051   }
10521052
10531053//  {
1054//      verboselog(device->machine(), 0, "audio 1 IRQ\n");
1055//      device->machine().device("maincpu")->execute().set_input_line(UNSP_IRQ1_LINE, ASSERT_LINE);
1054//      verboselog(machine(), 0, "audio 1 IRQ\n");
1055//      machine().device("maincpu")->execute().set_input_line(UNSP_IRQ1_LINE, ASSERT_LINE);
10561056//  }
1057    if(state->m_io_regs[0x22] & state->m_io_regs[0x21] & 0x0c00)
1057    if(m_io_regs[0x22] & m_io_regs[0x21] & 0x0c00)
10581058   {
1059      verboselog(device->machine(), 0, "timerA, timer B IRQ\n");
1060      device->machine().device("maincpu")->execute().set_input_line(UNSP_IRQ2_LINE, ASSERT_LINE);
1059      verboselog(machine(), 0, "timerA, timer B IRQ\n");
1060      machine().device("maincpu")->execute().set_input_line(UNSP_IRQ2_LINE, ASSERT_LINE);
10611061   }
10621062
1063    //if(state->m_io_regs[0x22] & state->m_io_regs[0x21] & 0x2100)
1063    //if(m_io_regs[0x22] & m_io_regs[0x21] & 0x2100)
10641064   // For now trigger always if any enabled
1065   if(state->VII_CTLR_IRQ_ENABLE)
1065   if(VII_CTLR_IRQ_ENABLE)
10661066   {
1067      verboselog(device->machine(), 0, "UART, ADC IRQ\n");
1068      device->machine().device("maincpu")->execute().set_input_line(UNSP_IRQ3_LINE, ASSERT_LINE);
1067      verboselog(machine(), 0, "UART, ADC IRQ\n");
1068      machine().device("maincpu")->execute().set_input_line(UNSP_IRQ3_LINE, ASSERT_LINE);
10691069   }
10701070//  {
1071//      verboselog(device->machine(), 0, "audio 4 IRQ\n");
1072//      device->machine().device("maincpu")->execute().set_input_line(UNSP_IRQ4_LINE, ASSERT_LINE);
1071//      verboselog(machine(), 0, "audio 4 IRQ\n");
1072//      machine().device("maincpu")->execute().set_input_line(UNSP_IRQ4_LINE, ASSERT_LINE);
10731073//  }
10741074
1075    if(state->m_io_regs[0x22] & state->m_io_regs[0x21] & 0x1200)
1075    if(m_io_regs[0x22] & m_io_regs[0x21] & 0x1200)
10761076   {
1077      verboselog(device->machine(), 0, "External IRQ\n");
1078      device->machine().device("maincpu")->execute().set_input_line(UNSP_IRQ5_LINE, ASSERT_LINE);
1077      verboselog(machine(), 0, "External IRQ\n");
1078      machine().device("maincpu")->execute().set_input_line(UNSP_IRQ5_LINE, ASSERT_LINE);
10791079   }
1080    if(state->m_io_regs[0x22] & state->m_io_regs[0x21] & 0x0070)
1080    if(m_io_regs[0x22] & m_io_regs[0x21] & 0x0070)
10811081   {
1082      verboselog(device->machine(), 0, "1024Hz, 2048HZ, 4096HZ IRQ\n");
1083      device->machine().device("maincpu")->execute().set_input_line(UNSP_IRQ6_LINE, ASSERT_LINE);
1082      verboselog(machine(), 0, "1024Hz, 2048HZ, 4096HZ IRQ\n");
1083      machine().device("maincpu")->execute().set_input_line(UNSP_IRQ6_LINE, ASSERT_LINE);
10841084   }
1085    if(state->m_io_regs[0x22] & state->m_io_regs[0x21] & 0x008b)
1085    if(m_io_regs[0x22] & m_io_regs[0x21] & 0x008b)
10861086   {
1087      verboselog(device->machine(), 0, "TMB1, TMB2, 4Hz, key change IRQ\n");
1088      device->machine().device("maincpu")->execute().set_input_line(UNSP_IRQ7_LINE, ASSERT_LINE);
1087      verboselog(machine(), 0, "TMB1, TMB2, 4Hz, key change IRQ\n");
1088      machine().device("maincpu")->execute().set_input_line(UNSP_IRQ7_LINE, ASSERT_LINE);
10891089   }
10901090
10911091}
r17997r17998
10941094
10951095   MCFG_CPU_ADD( "maincpu", UNSP, XTAL_27MHz)
10961096   MCFG_CPU_PROGRAM_MAP( vii_mem )
1097   MCFG_CPU_VBLANK_INT("screen", vii_vblank)
1097   MCFG_CPU_VBLANK_INT_DRIVER("screen", vii_state, vii_vblank)
10981098
10991099
11001100   MCFG_SCREEN_ADD( "screen", RASTER )
r17997r17998
11161116
11171117   MCFG_CPU_ADD( "maincpu", UNSP, XTAL_27MHz)
11181118   MCFG_CPU_PROGRAM_MAP( vii_mem )
1119   MCFG_CPU_VBLANK_INT("screen", vii_vblank)
1119   MCFG_CPU_VBLANK_INT_DRIVER("screen", vii_state, vii_vblank)
11201120
11211121
11221122   MCFG_SCREEN_ADD( "screen", RASTER )
r17997r17998
11411141
11421142   MCFG_CPU_ADD( "maincpu", UNSP, XTAL_27MHz)
11431143   MCFG_CPU_PROGRAM_MAP( vii_mem )
1144   MCFG_CPU_VBLANK_INT("screen", vii_vblank)
1144   MCFG_CPU_VBLANK_INT_DRIVER("screen", vii_state, vii_vblank)
11451145
11461146
11471147   MCFG_I2CMEM_ADD("i2cmem",i2cmem_interface)
trunk/src/mess/drivers/gb.c
r17997r17998
562562   MCFG_CPU_ADD("maincpu", LR35902, 4194304)         /* 4.194304 MHz */
563563   MCFG_CPU_PROGRAM_MAP(gb_map)
564564   MCFG_LR35902_CONFIG(dmg_cpu_reset)
565   MCFG_CPU_VBLANK_INT("screen", gb_scanline_interrupt)   /* 1 dummy int each frame */
565   MCFG_CPU_VBLANK_INT_DRIVER("screen", gb_state, gb_scanline_interrupt)   /* 1 dummy int each frame */
566566
567567   MCFG_QUANTUM_TIME(attotime::from_hz(60))
568568
r17997r17998
659659   /* basic machine hardware */
660660   MCFG_CPU_ADD("maincpu", LR35902, 4194304)         /* 4.194304 MHz */
661661   MCFG_CPU_PROGRAM_MAP( megaduck_map)
662   MCFG_CPU_VBLANK_INT("screen", gb_scanline_interrupt)   /* 1 int each scanline ! */
662   MCFG_CPU_VBLANK_INT_DRIVER("screen", gb_state, gb_scanline_interrupt)   /* 1 int each scanline ! */
663663   MCFG_LR35902_CONFIG(megaduck_cpu_reset)
664664
665665   MCFG_SCREEN_ADD("screen", LCD)
trunk/src/mess/drivers/sgi_ip6.c
r17997r17998
4242   virtual void machine_reset();
4343   virtual void video_start();
4444   UINT32 screen_update_sgi_ip6(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
45   INTERRUPT_GEN_MEMBER(sgi_ip6_vbl);
4546};
4647
4748
r17997r17998
192193   verboselog(machine(), 0, "ip6_unk3_w: Unknown address: %08x = %08x & %08x\n", 0x1fb00000 + (offset << 2), data, mem_mask );
193194}
194195
195static INTERRUPT_GEN( sgi_ip6_vbl )
196INTERRUPT_GEN_MEMBER(sgi_ip6_state::sgi_ip6_vbl)
196197{
197198}
198199
r17997r17998
233234   MCFG_CPU_ADD( "maincpu", R3000BE, 20000000 ) // FIXME: Should be R2000
234235   MCFG_CPU_CONFIG( config )
235236   MCFG_CPU_PROGRAM_MAP( sgi_ip6_map )
236   MCFG_CPU_VBLANK_INT("screen", sgi_ip6_vbl)
237   MCFG_CPU_VBLANK_INT_DRIVER("screen", sgi_ip6_state, sgi_ip6_vbl)
237238
238239
239240   /* video hardware */
trunk/src/mess/drivers/fp1100.c
r17997r17998
115115   virtual void machine_start();
116116   virtual void machine_reset();
117117   virtual void video_start();
118   INTERRUPT_GEN_MEMBER(fp1100_vblank_irq);
118119};
119120
120121void fp1100_state::video_start()
r17997r17998
394395   NULL      /* update address callback */
395396};
396397
397static INTERRUPT_GEN( fp1100_vblank_irq )
398INTERRUPT_GEN_MEMBER(fp1100_state::fp1100_vblank_irq)
398399{
399   fp1100_state *state = device->machine().driver_data<fp1100_state>();
400400
401   if(state->irq_mask & 0x10)
402      device->machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xf0);
401   if(irq_mask & 0x10)
402      machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xf0);
403403}
404404
405405static MACHINE_CONFIG_START( fp1100, fp1100_state )
r17997r17998
407407   MCFG_CPU_ADD("maincpu", Z80, XTAL_4MHz) //unknown clock
408408   MCFG_CPU_PROGRAM_MAP(fp1100_map)
409409   MCFG_CPU_IO_MAP(fp1100_io)
410   MCFG_CPU_VBLANK_INT("screen",fp1100_vblank_irq)
410   MCFG_CPU_VBLANK_INT_DRIVER("screen", fp1100_state, fp1100_vblank_irq)
411411
412412   MCFG_CPU_ADD( "sub", UPD7801, XTAL_4MHz ) //unknown clock
413413   MCFG_CPU_PROGRAM_MAP( fp1100_slave_map )
trunk/src/mess/drivers/gamecom.c
r17997r17998
8989   return 0;
9090}
9191
92static INTERRUPT_GEN( gamecom_interrupt )
92INTERRUPT_GEN_MEMBER(gamecom_state::gamecom_interrupt)
9393{
94   device->machine().device("maincpu")->execute().set_input_line(LCDC_INT, ASSERT_LINE );
94   machine().device("maincpu")->execute().set_input_line(LCDC_INT, ASSERT_LINE );
9595}
9696
9797static MACHINE_CONFIG_START( gamecom, gamecom_state )
r17997r17998
9999   MCFG_CPU_ADD( "maincpu", SM8500, XTAL_11_0592MHz/2 )   /* actually it's an sm8521 microcontroller containing an sm8500 cpu */
100100   MCFG_CPU_PROGRAM_MAP( gamecom_mem_map)
101101   MCFG_CPU_CONFIG( gamecom_cpu_config )
102   MCFG_CPU_VBLANK_INT("screen", gamecom_interrupt)
102   MCFG_CPU_VBLANK_INT_DRIVER("screen", gamecom_state, gamecom_interrupt)
103103
104104   MCFG_QUANTUM_TIME(attotime::from_hz(60))
105105
trunk/src/mess/drivers/b2m.c
r17997r17998
204204    MCFG_CPU_ADD("maincpu", I8080, 2000000)
205205    MCFG_CPU_PROGRAM_MAP(b2m_mem)
206206    MCFG_CPU_IO_MAP(b2m_io)
207    MCFG_CPU_VBLANK_INT("screen", b2m_vblank_interrupt)
207   MCFG_CPU_VBLANK_INT_DRIVER("screen", b2m_state, b2m_vblank_interrupt)
208208
209209
210210    /* video hardware */
trunk/src/mess/drivers/vic20.c
r17997r17998
308308//  VIDEO
309309//**************************************************************************
310310
311static INTERRUPT_GEN( vic20_raster_interrupt )
311INTERRUPT_GEN_MEMBER(vic20_state::vic20_raster_interrupt)
312312{
313   vic20_state *state = device->machine().driver_data<vic20_state>();
314   state->m_vic->raster_interrupt_gen();
313   m_vic->raster_interrupt_gen();
315314}
316315
317316
r17997r17998
756755   // basic machine hardware
757756   MCFG_CPU_ADD(M6502_TAG, M6502, MOS6560_CLOCK)
758757   MCFG_CPU_PROGRAM_MAP(vic20_mem)
759   MCFG_CPU_PERIODIC_INT(vic20_raster_interrupt, MOS656X_HRETRACERATE)
758   MCFG_CPU_PERIODIC_INT_DRIVER(vic20_state, vic20_raster_interrupt, MOS656X_HRETRACERATE)
760759
761760   // video/sound hardware
762761   MCFG_SPEAKER_STANDARD_MONO("mono")
r17997r17998
782781   // basic machine hardware
783782   MCFG_CPU_ADD(M6502_TAG, M6502, MOS6561_CLOCK)
784783   MCFG_CPU_PROGRAM_MAP(vic20_mem)
785   MCFG_CPU_PERIODIC_INT(vic20_raster_interrupt, MOS656X_HRETRACERATE)
784   MCFG_CPU_PERIODIC_INT_DRIVER(vic20_state, vic20_raster_interrupt, MOS656X_HRETRACERATE)
786785
787786   // video/sound hardware
788787   MCFG_SPEAKER_STANDARD_MONO("mono")
trunk/src/mess/drivers/arcadia.c
r17997r17998
530530   MCFG_CPU_ADD("maincpu", S2650, 3580000/4)        /* 0.895 MHz */
531531   MCFG_CPU_PROGRAM_MAP(arcadia_mem)
532532   MCFG_CPU_IO_MAP(arcadia_io)
533   MCFG_CPU_PERIODIC_INT(arcadia_video_line, 262*60)
533   MCFG_CPU_PERIODIC_INT_DRIVER(arcadia_state, arcadia_video_line, 262*60)
534534   MCFG_QUANTUM_TIME(attotime::from_hz(60))
535535
536536   /* video hardware */
trunk/src/mess/drivers/smc777.c
r17997r17998
8787   virtual void video_start();
8888   virtual void palette_init();
8989   UINT32 screen_update_smc777(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
90   INTERRUPT_GEN_MEMBER(smc777_vblank_irq);
9091};
9192
9293
r17997r17998
10461047   NULL
10471048};
10481049
1049static INTERRUPT_GEN( smc777_vblank_irq )
1050INTERRUPT_GEN_MEMBER(smc777_state::smc777_vblank_irq)
10501051{
1051   smc777_state *state = device->machine().driver_data<smc777_state>();
10521052
1053   if(state->m_irq_mask)
1054      device->execute().set_input_line(0,HOLD_LINE);
1053   if(m_irq_mask)
1054      device.execute().set_input_line(0,HOLD_LINE);
10551055}
10561056
10571057
r17997r17998
10791079    MCFG_CPU_ADD("maincpu",Z80, MASTER_CLOCK)
10801080    MCFG_CPU_PROGRAM_MAP(smc777_mem)
10811081    MCFG_CPU_IO_MAP(smc777_io)
1082   MCFG_CPU_VBLANK_INT("screen",smc777_vblank_irq)
1082   MCFG_CPU_VBLANK_INT_DRIVER("screen", smc777_state, smc777_vblank_irq)
10831083
10841084
10851085    /* video hardware */
trunk/src/mess/drivers/spectrum.c
r17997r17998
660660GFXDECODE_END
661661
662662
663static INTERRUPT_GEN( spec_interrupt )
663INTERRUPT_GEN_MEMBER(spectrum_state::spec_interrupt)
664664{
665   device->execute().set_input_line(0, HOLD_LINE);
665   device.execute().set_input_line(0, HOLD_LINE);
666666}
667667
668668static const cassette_interface spectrum_cassette_interface =
r17997r17998
708708   MCFG_CPU_ADD("maincpu", Z80, X1 / 4)        /* This is verified only for the ZX Spectum. Other clones are reported to have different clocks */
709709   MCFG_CPU_PROGRAM_MAP(spectrum_mem)
710710   MCFG_CPU_IO_MAP(spectrum_io)
711   MCFG_CPU_VBLANK_INT("screen", spec_interrupt)
711   MCFG_CPU_VBLANK_INT_DRIVER("screen", spectrum_state, spec_interrupt)
712712   MCFG_QUANTUM_TIME(attotime::from_hz(60))
713713
714714   MCFG_MACHINE_RESET_OVERRIDE(spectrum_state, spectrum )
trunk/src/mess/drivers/plus4.c
r17997r17998
566566//  ted7360_interface ted_intf
567567//-------------------------------------------------
568568
569static INTERRUPT_GEN( c16_raster_interrupt )
569INTERRUPT_GEN_MEMBER(plus4_state::c16_raster_interrupt)
570570{
571   plus4_state *state = device->machine().driver_data<plus4_state>();
572571
573   state->m_ted->raster_interrupt_gen();
572   m_ted->raster_interrupt_gen();
574573}
575574
576static INTERRUPT_GEN( c16_frame_interrupt )
575INTERRUPT_GEN_MEMBER(plus4_state::c16_frame_interrupt)
577576{
578   plus4_state *state = device->machine().driver_data<plus4_state>();
579577
580578   int value, i;
581579   static const char *const c16ports[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6", "ROW7" };
r17997r17998
584582   for (i = 0; i < 8; i++)
585583   {
586584      value = 0xff;
587      value &= ~device->machine().root_device().ioport(c16ports[i])->read();
585      value &= ~machine().root_device().ioport(c16ports[i])->read();
588586
589587      /* Shift Lock is mapped on Left/Right Shift */
590      if ((i == 1) && (device->machine().root_device().ioport("SPECIAL")->read() & 0x80))
588      if ((i == 1) && (machine().root_device().ioport("SPECIAL")->read() & 0x80))
591589         value &= ~0x80;
592590
593      state->m_keyline[i] = value;
591      m_keyline[i] = value;
594592   }
595593
596   if (device->machine().root_device().ioport("CTRLSEL")->read() & 0x01)
594   if (machine().root_device().ioport("CTRLSEL")->read() & 0x01)
597595   {
598596      value = 0xff;
599      if (device->machine().root_device().ioport("JOY0")->read() & 0x10)         /* Joypad1_Button */
597      if (machine().root_device().ioport("JOY0")->read() & 0x10)         /* Joypad1_Button */
600598         {
601            if (device->machine().root_device().ioport("SPECIAL")->read() & 0x40)
599            if (machine().root_device().ioport("SPECIAL")->read() & 0x40)
602600               value &= ~0x80;
603601            else
604602               value &= ~0x40;
605603         }
606604
607      value &= ~(device->machine().root_device().ioport("JOY0")->read() & 0x0f);   /* Other Inputs Joypad1 */
605      value &= ~(machine().root_device().ioport("JOY0")->read() & 0x0f);   /* Other Inputs Joypad1 */
608606
609      if (device->machine().root_device().ioport("SPECIAL")->read() & 0x40)
610         state->m_keyline[9] = value;
607      if (machine().root_device().ioport("SPECIAL")->read() & 0x40)
608         m_keyline[9] = value;
611609      else
612         state->m_keyline[8] = value;
610         m_keyline[8] = value;
613611   }
614612
615   if (device->machine().root_device().ioport("CTRLSEL")->read() & 0x10)
613   if (machine().root_device().ioport("CTRLSEL")->read() & 0x10)
616614   {
617615      value = 0xff;
618      if (device->machine().root_device().ioport("JOY1")->read() & 0x10)         /* Joypad2_Button */
616      if (machine().root_device().ioport("JOY1")->read() & 0x10)         /* Joypad2_Button */
619617         {
620            if (device->machine().root_device().ioport("SPECIAL")->read() & 0x40)
618            if (machine().root_device().ioport("SPECIAL")->read() & 0x40)
621619               value &= ~0x40;
622620            else
623621               value &= ~0x80;
624622         }
625623
626      value &= ~(device->machine().root_device().ioport("JOY1")->read() & 0x0f);   /* Other Inputs Joypad2 */
624      value &= ~(machine().root_device().ioport("JOY1")->read() & 0x0f);   /* Other Inputs Joypad2 */
627625
628      if (device->machine().root_device().ioport("SPECIAL")->read() & 0x40)
629         state->m_keyline[8] = value;
626      if (machine().root_device().ioport("SPECIAL")->read() & 0x40)
627         m_keyline[8] = value;
630628      else
631         state->m_keyline[9] = value;
629         m_keyline[9] = value;
632630   }
633631
634   state->m_ted->frame_interrupt_gen();
632   m_ted->frame_interrupt_gen();
635633}
636634
637635WRITE_LINE_MEMBER( plus4_state::ted_irq_w )
r17997r17998
905903   MCFG_CPU_ADD(MOS7501_TAG, M7501, XTAL_14_31818MHz/16)
906904   MCFG_CPU_PROGRAM_MAP(plus4_mem)
907905   MCFG_CPU_CONFIG(cpu_intf)
908   MCFG_CPU_VBLANK_INT(SCREEN_TAG, c16_frame_interrupt)
909   MCFG_CPU_PERIODIC_INT(c16_raster_interrupt, TED7360_HRETRACERATE)
906   MCFG_CPU_VBLANK_INT_DRIVER(SCREEN_TAG, plus4_state,  c16_frame_interrupt)
907   MCFG_CPU_PERIODIC_INT_DRIVER(plus4_state, c16_raster_interrupt,  TED7360_HRETRACERATE)
910908   MCFG_QUANTUM_TIME(attotime::from_hz(60))
911909
912910   // video and sound hardware
r17997r17998
944942   MCFG_CPU_ADD(MOS7501_TAG, M7501, XTAL_17_73447MHz/20)
945943   MCFG_CPU_PROGRAM_MAP(plus4_mem)
946944   MCFG_CPU_CONFIG(cpu_intf)
947   MCFG_CPU_VBLANK_INT(SCREEN_TAG, c16_frame_interrupt)
948   MCFG_CPU_PERIODIC_INT(c16_raster_interrupt, TED7360_HRETRACERATE)
945   MCFG_CPU_VBLANK_INT_DRIVER(SCREEN_TAG, plus4_state,  c16_frame_interrupt)
946   MCFG_CPU_PERIODIC_INT_DRIVER(plus4_state, c16_raster_interrupt,  TED7360_HRETRACERATE)
949947   MCFG_QUANTUM_TIME(attotime::from_hz(60))
950948
951949   // video and sound hardware
trunk/src/mess/drivers/tx0.c
r17997r17998
14981498/*
14991499    Not a real interrupt - just handle keyboard input
15001500*/
1501static INTERRUPT_GEN( tx0_interrupt )
1501INTERRUPT_GEN_MEMBER(tx0_state::tx0_interrupt)
15021502{
1503   tx0_state *state = device->machine().driver_data<tx0_state>();
15041503   int control_keys;
15051504   int tsr_keys;
15061505
r17997r17998
15091508
15101509
15111510   /* read new state of control keys */
1512   control_keys = state->ioport("CSW")->read();
1511   control_keys = ioport("CSW")->read();
15131512
15141513   if (control_keys & tx0_control)
15151514   {
15161515      /* compute transitions */
1517      control_transitions = control_keys & (~ state->m_old_control_keys);
1516      control_transitions = control_keys & (~ m_old_control_keys);
15181517
15191518      if (control_transitions & tx0_stop_cyc0)
15201519      {
1521         device->machine().device("maincpu")->state().set_state_int(TX0_STOP_CYC0, !device->machine().device("maincpu")->state().state_int(TX0_STOP_CYC0));
1520         machine().device("maincpu")->state().set_state_int(TX0_STOP_CYC0, !machine().device("maincpu")->state().state_int(TX0_STOP_CYC0));
15221521      }
15231522      if (control_transitions & tx0_stop_cyc1)
15241523      {
1525         device->machine().device("maincpu")->state().set_state_int(TX0_STOP_CYC1, !device->machine().device("maincpu")->state().state_int(TX0_STOP_CYC1));
1524         machine().device("maincpu")->state().set_state_int(TX0_STOP_CYC1, !machine().device("maincpu")->state().state_int(TX0_STOP_CYC1));
15261525      }
15271526      if (control_transitions & tx0_gbl_cm_sel)
15281527      {
1529         device->machine().device("maincpu")->state().set_state_int(TX0_GBL_CM_SEL, !device->machine().device("maincpu")->state().state_int(TX0_GBL_CM_SEL));
1528         machine().device("maincpu")->state().set_state_int(TX0_GBL_CM_SEL, !machine().device("maincpu")->state().state_int(TX0_GBL_CM_SEL));
15301529      }
15311530      if (control_transitions & tx0_stop)
15321531      {
1533         device->machine().device("maincpu")->state().set_state_int(TX0_RUN, (UINT64)0);
1534         device->machine().device("maincpu")->state().set_state_int(TX0_RIM, (UINT64)0);
1532         machine().device("maincpu")->state().set_state_int(TX0_RUN, (UINT64)0);
1533         machine().device("maincpu")->state().set_state_int(TX0_RIM, (UINT64)0);
15351534      }
15361535      if (control_transitions & tx0_restart)
15371536      {
1538         device->machine().device("maincpu")->state().set_state_int(TX0_RUN, 1);
1539         device->machine().device("maincpu")->state().set_state_int(TX0_RIM, (UINT64)0);
1537         machine().device("maincpu")->state().set_state_int(TX0_RUN, 1);
1538         machine().device("maincpu")->state().set_state_int(TX0_RIM, (UINT64)0);
15401539      }
15411540      if (control_transitions & tx0_read_in)
15421541      {   /* set cpu to read instructions from perforated tape */
1543         device->machine().device("maincpu")->state().set_state_int(TX0_RESET, (UINT64)0);
1544         device->machine().device("maincpu")->state().set_state_int(TX0_RUN, (UINT64)0);
1545         device->machine().device("maincpu")->state().set_state_int(TX0_RIM, 1);
1542         machine().device("maincpu")->state().set_state_int(TX0_RESET, (UINT64)0);
1543         machine().device("maincpu")->state().set_state_int(TX0_RUN, (UINT64)0);
1544         machine().device("maincpu")->state().set_state_int(TX0_RIM, 1);
15461545      }
15471546      if (control_transitions & tx0_toggle_dn)
15481547      {
1549         state->m_tsr_index++;
1550         if (state->m_tsr_index == 18)
1551            state->m_tsr_index = 0;
1548         m_tsr_index++;
1549         if (m_tsr_index == 18)
1550            m_tsr_index = 0;
15521551      }
15531552      if (control_transitions & tx0_toggle_up)
15541553      {
1555         state->m_tsr_index--;
1556         if (state->m_tsr_index == -1)
1557            state->m_tsr_index = 17;
1554         m_tsr_index--;
1555         if (m_tsr_index == -1)
1556            m_tsr_index = 17;
15581557      }
15591558      if (control_transitions & tx0_cm_sel)
15601559      {
1561         if (state->m_tsr_index >= 2)
1560         if (m_tsr_index >= 2)
15621561         {
1563            UINT32 cm_sel = (UINT32) device->machine().device("maincpu")->state().state_int(TX0_CM_SEL);
1564            device->machine().device("maincpu")->state().set_state_int(TX0_CM_SEL, cm_sel ^ (1 << (state->m_tsr_index - 2)));
1562            UINT32 cm_sel = (UINT32) machine().device("maincpu")->state().state_int(TX0_CM_SEL);
1563            machine().device("maincpu")->state().set_state_int(TX0_CM_SEL, cm_sel ^ (1 << (m_tsr_index - 2)));
15651564         }
15661565      }
15671566      if (control_transitions & tx0_lr_sel)
15681567      {
1569         if (state->m_tsr_index >= 2)
1568         if (m_tsr_index >= 2)
15701569         {
1571            UINT32 lr_sel = (UINT32) device->machine().device("maincpu")->state().state_int(TX0_LR_SEL);
1572            device->machine().device("maincpu")->state().set_state_int(TX0_LR_SEL, (lr_sel ^ (1 << (state->m_tsr_index - 2))));
1570            UINT32 lr_sel = (UINT32) machine().device("maincpu")->state().state_int(TX0_LR_SEL);
1571            machine().device("maincpu")->state().set_state_int(TX0_LR_SEL, (lr_sel ^ (1 << (m_tsr_index - 2))));
15731572         }
15741573      }
15751574
15761575      /* remember new state of control keys */
1577      state->m_old_control_keys = control_keys;
1576      m_old_control_keys = control_keys;
15781577
15791578
15801579      /* handle toggle switch register keys */
1581      tsr_keys = (device->machine().root_device().ioport("MSW")->read() << 16) | device->machine().root_device().ioport("LSW")->read();
1580      tsr_keys = (machine().root_device().ioport("MSW")->read() << 16) | machine().root_device().ioport("LSW")->read();
15821581
15831582      /* compute transitions */
1584      tsr_transitions = tsr_keys & (~ state->m_old_tsr_keys);
1583      tsr_transitions = tsr_keys & (~ m_old_tsr_keys);
15851584
15861585      /* update toggle switch register */
15871586      if (tsr_transitions)
1588         device->machine().device("maincpu")->state().set_state_int(TX0_TBR+state->m_tsr_index, device->machine().device("maincpu")->state().state_int(TX0_TBR+state->m_tsr_index) ^ tsr_transitions);
1587         machine().device("maincpu")->state().set_state_int(TX0_TBR+m_tsr_index, machine().device("maincpu")->state().state_int(TX0_TBR+m_tsr_index) ^ tsr_transitions);
15891588
15901589      /* remember new state of toggle switch register keys */
1591      state->m_old_tsr_keys = tsr_keys;
1590      m_old_tsr_keys = tsr_keys;
15921591   }
15931592   else
15941593   {
1595      state->m_old_control_keys = 0;
1596      state->m_old_tsr_keys = 0;
1594      m_old_control_keys = 0;
1595      m_old_tsr_keys = 0;
15971596
1598      tx0_keyboard(device->machine());
1597      tx0_keyboard(machine());
15991598   }
16001599}
16011600
r17997r17998
16061605   MCFG_CPU_CONFIG(tx0_reset_param)
16071606   MCFG_CPU_PROGRAM_MAP(tx0_64kw_map)
16081607   /* dummy interrupt: handles input */
1609   MCFG_CPU_VBLANK_INT("screen", tx0_interrupt)
1608   MCFG_CPU_VBLANK_INT_DRIVER("screen", tx0_state, tx0_interrupt)
16101609
16111610
16121611   /* video hardware (includes the control panel and typewriter output) */
trunk/src/mess/drivers/ip22.c
r17997r17998
131131   DECLARE_DRIVER_INIT(ip225015);
132132   virtual void machine_start();
133133   virtual void machine_reset();
134   INTERRUPT_GEN_MEMBER(ip22_vbl);
134135};
135136
136137
r17997r17998
16091610   }
16101611}
16111612
1612static INTERRUPT_GEN( ip22_vbl )
1613INTERRUPT_GEN_MEMBER(ip22_state::ip22_vbl)
16131614{
1614   ip22_state *state = device->machine().driver_data<ip22_state>();
1615   state->m_nIntCounter++;
1616//  if( state->m_nIntCounter == 60 )
1615   m_nIntCounter++;
1616//  if( m_nIntCounter == 60 )
16171617   {
1618      state->m_nIntCounter = 0;
1619      rtc_update(state);
1618      m_nIntCounter = 0;
1619      rtc_update(this);
16201620   }
16211621}
16221622
r17997r17998
16351635   MCFG_CPU_ADD( "maincpu", R5000BE, 50000000*3 )
16361636   MCFG_CPU_CONFIG( config )
16371637   MCFG_CPU_PROGRAM_MAP( ip225015_map)
1638   MCFG_CPU_VBLANK_INT("screen", ip22_vbl)
1638   MCFG_CPU_VBLANK_INT_DRIVER("screen", ip22_state, ip22_vbl)
16391639
16401640
16411641   MCFG_NVRAM_ADD_0FILL("nvram")
r17997r17998
16761676   MCFG_CPU_REPLACE( "maincpu", R4600BE, 133333333 )
16771677   MCFG_CPU_CONFIG( config )
16781678   MCFG_CPU_PROGRAM_MAP( ip225015_map)
1679   MCFG_CPU_VBLANK_INT("screen", ip22_vbl)
1679   MCFG_CPU_VBLANK_INT_DRIVER("screen", ip22_state, ip22_vbl)
16801680MACHINE_CONFIG_END
16811681
16821682static MACHINE_CONFIG_DERIVED( ip244415, ip225015 )
16831683   MCFG_CPU_REPLACE( "maincpu", R4600BE, 150000000 )
16841684   MCFG_CPU_CONFIG( config )
16851685   MCFG_CPU_PROGRAM_MAP( ip225015_map)
1686   MCFG_CPU_VBLANK_INT("screen", ip22_vbl)
1686   MCFG_CPU_VBLANK_INT_DRIVER("screen", ip22_state, ip22_vbl)
16871687MACHINE_CONFIG_END
16881688
16891689ROM_START( ip225015 )
trunk/src/mess/drivers/c128.c
r17997r17998
10851085   MCFG_CPU_ADD(Z80A_TAG, Z80, VIC6567_CLOCK)
10861086   MCFG_CPU_PROGRAM_MAP( z80_mem)
10871087   MCFG_CPU_IO_MAP( z80_io)
1088   MCFG_CPU_VBLANK_INT(SCREEN_VIC_TAG, c128_frame_interrupt)
1088   MCFG_CPU_VBLANK_INT_DRIVER(SCREEN_VIC_TAG, c128_state, c128_frame_interrupt)
10891089   MCFG_QUANTUM_PERFECT_CPU(Z80A_TAG)
10901090
10911091   MCFG_CPU_ADD(M8502_TAG, M8502, VIC6567_CLOCK)
10921092   MCFG_CPU_PROGRAM_MAP( m8502_mem)
10931093   MCFG_CPU_CONFIG( cpu_intf )
1094   MCFG_CPU_VBLANK_INT(SCREEN_VIC_TAG, c128_frame_interrupt)
1094   MCFG_CPU_VBLANK_INT_DRIVER(SCREEN_VIC_TAG, c128_state, c128_frame_interrupt)
10951095   MCFG_QUANTUM_PERFECT_CPU(M8502_TAG)
10961096
10971097   // video hardware
r17997r17998
11921192   MCFG_CPU_ADD(Z80A_TAG, Z80, VIC6569_CLOCK)
11931193   MCFG_CPU_PROGRAM_MAP( z80_mem)
11941194   MCFG_CPU_IO_MAP(z80_io)
1195   MCFG_CPU_VBLANK_INT(SCREEN_VIC_TAG, c128_frame_interrupt)
1195   MCFG_CPU_VBLANK_INT_DRIVER(SCREEN_VIC_TAG, c128_state, c128_frame_interrupt)
11961196   MCFG_QUANTUM_PERFECT_CPU(Z80A_TAG)
11971197
11981198   MCFG_CPU_ADD(M8502_TAG, M8502, VIC6569_CLOCK)
11991199   MCFG_CPU_PROGRAM_MAP( m8502_mem)
12001200   MCFG_CPU_CONFIG( cpu_intf )
1201   MCFG_CPU_VBLANK_INT(SCREEN_VIC_TAG, c128_frame_interrupt)
1201   MCFG_CPU_VBLANK_INT_DRIVER(SCREEN_VIC_TAG, c128_state, c128_frame_interrupt)
12021202   MCFG_QUANTUM_PERFECT_CPU(M8502_TAG)
12031203
12041204   // video hardware
trunk/src/mess/drivers/p2000t.c
r17997r17998
202202INPUT_PORTS_END
203203
204204
205static INTERRUPT_GEN( p2000_interrupt )
205INTERRUPT_GEN_MEMBER(p2000t_state::p2000_interrupt)
206206{
207   device->machine().device("maincpu")->execute().set_input_line(0, HOLD_LINE);
207   machine().device("maincpu")->execute().set_input_line(0, HOLD_LINE);
208208}
209209
210210READ8_MEMBER( p2000t_state::videoram_r )
r17997r17998
224224   MCFG_CPU_ADD("maincpu", Z80, 2500000)
225225   MCFG_CPU_PROGRAM_MAP(p2000t_mem)
226226   MCFG_CPU_IO_MAP(p2000t_io)
227   MCFG_CPU_VBLANK_INT("screen", p2000_interrupt)
227   MCFG_CPU_VBLANK_INT_DRIVER("screen", p2000t_state, p2000_interrupt)
228228
229229   /* video hardware */
230230   MCFG_SCREEN_ADD("screen", RASTER)
r17997r17998
249249   MCFG_CPU_ADD("maincpu", Z80, 2500000)
250250   MCFG_CPU_PROGRAM_MAP(p2000m_mem)
251251   MCFG_CPU_IO_MAP(p2000t_io)
252   MCFG_CPU_VBLANK_INT("screen", p2000_interrupt)
252   MCFG_CPU_VBLANK_INT_DRIVER("screen", p2000t_state, p2000_interrupt)
253253   MCFG_QUANTUM_TIME(attotime::from_hz(60))
254254
255255   /* video hardware */
trunk/src/mess/drivers/pet.c
r17997r17998
659659   /* basic machine hardware */
660660   MCFG_CPU_ADD("maincpu", M6502, XTAL_8MHz/8)
661661   MCFG_CPU_PROGRAM_MAP(pet_mem)
662   MCFG_CPU_VBLANK_INT("screen", pet_frame_interrupt)
662   MCFG_CPU_VBLANK_INT_DRIVER("screen", pet_state, pet_frame_interrupt)
663663
664664
665665    /* video hardware */
r17997r17998
783783   /* m6809 cpu */
784784   MCFG_CPU_ADD("m6809", M6809, 1000000)
785785   MCFG_CPU_PROGRAM_MAP(superpet_m6809_mem)
786   MCFG_CPU_VBLANK_INT("screen", pet_frame_interrupt)
786   MCFG_CPU_VBLANK_INT_DRIVER("screen", pet_state, pet_frame_interrupt)
787787
788788   MCFG_SCREEN_MODIFY("screen")
789789   MCFG_SCREEN_REFRESH_RATE(50)
trunk/src/mess/drivers/vector06.c
r17997r17998
163163//  MCFG_CPU_ADD("maincpu", Z80, 3000000)
164164   MCFG_CPU_PROGRAM_MAP(vector06_mem)
165165   MCFG_CPU_IO_MAP(vector06_io)
166   MCFG_CPU_VBLANK_INT("screen", vector06_interrupt)
166   MCFG_CPU_VBLANK_INT_DRIVER("screen", vector06_state, vector06_interrupt)
167167
168168
169169   /* video hardware */
trunk/src/mess/drivers/ti990_10.c
r17997r17998
8989   virtual void machine_reset();
9090   virtual void video_start();
9191   UINT32 screen_update_ti990_10(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
92   INTERRUPT_GEN_MEMBER(ti990_10_line_interrupt);
9293};
9394
9495
r17997r17998
106107   ti990_hdc_init(machine(), ti990_set_int13);
107108}
108109
109static INTERRUPT_GEN( ti990_10_line_interrupt )
110INTERRUPT_GEN_MEMBER(ti990_10_state::ti990_10_line_interrupt)
110111{
111   ti990_10_state *state = device->machine().driver_data<ti990_10_state>();
112   vdt911_keyboard(state->m_terminal);
112   vdt911_keyboard(m_terminal);
113113
114   ti990_line_interrupt(device->machine());
114   ti990_line_interrupt(machine());
115115}
116116
117117#ifdef UNUSED_FUNCTION
r17997r17998
215215   MCFG_CPU_CONFIG(reset_params)
216216   MCFG_CPU_PROGRAM_MAP(ti990_10_memmap)
217217   MCFG_CPU_IO_MAP(ti990_10_io)
218   MCFG_CPU_PERIODIC_INT(ti990_10_line_interrupt, 120/*or 100 in Europe*/)
218   MCFG_CPU_PERIODIC_INT_DRIVER(ti990_10_state, ti990_10_line_interrupt, 120/*or 100 in Europe*/)
219219
220220
221221   /* video hardware - we emulate a single 911 vdt display */
trunk/src/mess/drivers/orion.c
r17997r17998
183183    MCFG_CPU_ADD("maincpu", Z80, 2500000)
184184    MCFG_CPU_PROGRAM_MAP(orionz80_mem)
185185    MCFG_CPU_IO_MAP(orionz80_io)
186    MCFG_CPU_VBLANK_INT("screen",orionz80_interrupt)
186   MCFG_CPU_VBLANK_INT_DRIVER("screen", orion_state, orionz80_interrupt)
187187
188188    MCFG_MACHINE_START_OVERRIDE(orion_state, orionz80 )
189189    MCFG_MACHINE_RESET_OVERRIDE(orion_state, orionz80 )
trunk/src/mess/drivers/mz2500.c
r17997r17998
164164   virtual void video_start();
165165   virtual void palette_init();
166166   UINT32 screen_update_mz2500(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
167   INTERRUPT_GEN_MEMBER(mz2500_vbl);
167168};
168169
169170
r17997r17998
18211822   GFXDECODE_ENTRY("pcg", 0, mz2500_pcg_layout_3bpp, 0, 4)
18221823GFXDECODE_END
18231824
1824static INTERRUPT_GEN( mz2500_vbl )
1825INTERRUPT_GEN_MEMBER(mz2500_state::mz2500_vbl)
18251826{
1826   mz2500_state *state = device->machine().driver_data<mz2500_state>();
1827   if(state->m_irq_mask[0])
1828      device->execute().set_input_line_and_vector(0, HOLD_LINE, state->m_irq_vector[0]);
1827   if(m_irq_mask[0])
1828      device.execute().set_input_line_and_vector(0, HOLD_LINE, m_irq_vector[0]);
18291829
1830   state->m_cg_clear_flag = 0;
1830   m_cg_clear_flag = 0;
18311831}
18321832
18331833static READ8_DEVICE_HANDLER( mz2500_porta_r )
r17997r17998
20972097    MCFG_CPU_ADD("maincpu", Z80, 6000000)
20982098    MCFG_CPU_PROGRAM_MAP(mz2500_map)
20992099    MCFG_CPU_IO_MAP(mz2500_io)
2100   MCFG_CPU_VBLANK_INT("screen", mz2500_vbl)
2100   MCFG_CPU_VBLANK_INT_DRIVER("screen", mz2500_state, mz2500_vbl)
21012101
21022102
21032103   MCFG_I8255_ADD( "i8255_0", ppi8255_intf )
trunk/src/mess/drivers/fmtowns.c
r17997r17998
26702670   MCFG_CPU_ADD("maincpu",I386, 16000000)
26712671   MCFG_CPU_PROGRAM_MAP(towns_mem)
26722672   MCFG_CPU_IO_MAP(towns_io)
2673   MCFG_CPU_VBLANK_INT("screen", towns_vsync_irq)
2673   MCFG_CPU_VBLANK_INT_DRIVER("screen", towns_state, towns_vsync_irq)
26742674
26752675   //    MCFG_MACHINE_RESET_OVERRIDE(towns_state,towns)
26762676
r17997r17998
27412741   MCFG_CPU_REPLACE("maincpu",I386, 16000000)
27422742   MCFG_CPU_PROGRAM_MAP(ux_mem)
27432743   MCFG_CPU_IO_MAP(towns_io)
2744   MCFG_CPU_VBLANK_INT("screen", towns_vsync_irq)
2744   MCFG_CPU_VBLANK_INT_DRIVER("screen", towns_state, towns_vsync_irq)
27452745
27462746   MCFG_RAM_MODIFY(RAM_TAG)
27472747   MCFG_RAM_DEFAULT_SIZE("2M")
r17997r17998
27532753   MCFG_CPU_REPLACE("maincpu",I486, 66000000)
27542754   MCFG_CPU_PROGRAM_MAP(towns_mem)
27552755   MCFG_CPU_IO_MAP(towns_io)
2756   MCFG_CPU_VBLANK_INT("screen", towns_vsync_irq)
2756   MCFG_CPU_VBLANK_INT_DRIVER("screen", towns_state, towns_vsync_irq)
27572757
27582758   MCFG_RAM_MODIFY(RAM_TAG)
27592759   MCFG_RAM_DEFAULT_SIZE("8M")
r17997r17998
27652765   MCFG_CPU_REPLACE("maincpu",I486, 20000000)
27662766   MCFG_CPU_PROGRAM_MAP(towns_mem)
27672767   MCFG_CPU_IO_MAP(towns_io)
2768   MCFG_CPU_VBLANK_INT("screen", towns_vsync_irq)
2768   MCFG_CPU_VBLANK_INT_DRIVER("screen", towns_state, towns_vsync_irq)
27692769
27702770   MCFG_RAM_MODIFY(RAM_TAG)
27712771   MCFG_RAM_DEFAULT_SIZE("4M")
r17997r17998
27782778   MCFG_CPU_REPLACE("maincpu",I386, 16000000)
27792779   MCFG_CPU_PROGRAM_MAP(marty_mem)
27802780   MCFG_CPU_IO_MAP(towns_io)
2781   MCFG_CPU_VBLANK_INT("screen", towns_vsync_irq)
2781   MCFG_CPU_VBLANK_INT_DRIVER("screen", towns_state, towns_vsync_irq)
27822782
27832783   MCFG_RAM_MODIFY(RAM_TAG)
27842784   MCFG_RAM_DEFAULT_SIZE("6M")
trunk/src/mess/drivers/gmaster.c
r17997r17998
205205}
206206
207207
208static INTERRUPT_GEN( gmaster_interrupt )
208INTERRUPT_GEN_MEMBER(gmaster_state::gmaster_interrupt)
209209{
210   device->machine().device("maincpu")->execute().set_input_line(UPD7810_INTFE1, ASSERT_LINE);
210   machine().device("maincpu")->execute().set_input_line(UPD7810_INTFE1, ASSERT_LINE);
211211}
212212
213213static const UPD7810_CONFIG config = {
r17997r17998
221221   MCFG_CPU_PROGRAM_MAP(gmaster_mem)
222222   MCFG_CPU_IO_MAP( gmaster_io)
223223   MCFG_CPU_CONFIG( config )
224   MCFG_CPU_VBLANK_INT("screen", gmaster_interrupt)
224   MCFG_CPU_VBLANK_INT_DRIVER("screen", gmaster_state, gmaster_interrupt)
225225
226226   MCFG_SCREEN_ADD("screen", LCD)
227227   MCFG_SCREEN_REFRESH_RATE(60)
trunk/src/mess/drivers/newbrain.c
r17997r17998
13291329   timer_set(attotime::from_usec(get_reset_t()), TIMER_ID_RESET);
13301330}
13311331
1332static INTERRUPT_GEN( newbrain_interrupt )
1332INTERRUPT_GEN_MEMBER(newbrain_state::newbrain_interrupt)
13331333{
1334   newbrain_state *state = device->machine().driver_data<newbrain_state>();
13351334
1336   if (!(state->m_enrg1 & NEWBRAIN_ENRG1_CLK))
1335   if (!(m_enrg1 & NEWBRAIN_ENRG1_CLK))
13371336   {
1338      state->m_clkint = 0;
1339      state->check_interrupt();
1337      m_clkint = 0;
1338      check_interrupt();
13401339   }
13411340}
13421341
r17997r17998
13811380   MCFG_CPU_ADD(Z80_TAG, Z80, XTAL_16MHz/8)
13821381   MCFG_CPU_PROGRAM_MAP(newbrain_map)
13831382   MCFG_CPU_IO_MAP(newbrain_a_io_map)
1384   MCFG_CPU_VBLANK_INT(SCREEN_TAG, newbrain_interrupt)
1383   MCFG_CPU_VBLANK_INT_DRIVER(SCREEN_TAG, newbrain_state, newbrain_interrupt)
13851384
13861385   MCFG_CPU_ADD(COP420_TAG, COP420, XTAL_16MHz/8) // COP420-GUW/N
13871386   MCFG_CPU_IO_MAP(newbrain_cop_io_map)
trunk/src/mess/drivers/microtan.c
r17997r17998
219219   /* basic machine hardware */
220220   MCFG_CPU_ADD("maincpu", M6502, 750000)   // 750 kHz
221221   MCFG_CPU_PROGRAM_MAP(microtan_map)
222   MCFG_CPU_VBLANK_INT("screen", microtan_interrupt)
222   MCFG_CPU_VBLANK_INT_DRIVER("screen", microtan_state, microtan_interrupt)
223223
224224
225225    /* video hardware - include overscan */
trunk/src/mess/drivers/ti99_2.c
r17997r17998
102102   virtual void machine_reset();
103103   virtual void palette_init();
104104   UINT32 screen_update_ti99_2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
105   INTERRUPT_GEN_MEMBER(ti99_2_vblank_interrupt);
105106};
106107
107108
r17997r17998
130131      membank("bank1")->set_base((memregion("maincpu")->base()+0x4000));
131132}
132133
133static INTERRUPT_GEN( ti99_2_vblank_interrupt )
134INTERRUPT_GEN_MEMBER(ti99_2_state::ti99_2_vblank_interrupt)
134135{
135   ti99_2_state *state = device->machine().driver_data<ti99_2_state>();
136   device->execute().set_input_line(1, state->m_irq_state);
137   state->m_irq_state = (state->m_irq_state == ASSERT_LINE) ? CLEAR_LINE : ASSERT_LINE;
136   device.execute().set_input_line(1, m_irq_state);
137   m_irq_state = (m_irq_state == ASSERT_LINE) ? CLEAR_LINE : ASSERT_LINE;
138138}
139139
140140
r17997r17998
380380   MCFG_CPU_CONFIG(ti99_2_processor_config)
381381   MCFG_CPU_PROGRAM_MAP(ti99_2_memmap)
382382   MCFG_CPU_IO_MAP(ti99_2_io)
383   MCFG_CPU_VBLANK_INT("screen", ti99_2_vblank_interrupt)
383   MCFG_CPU_VBLANK_INT_DRIVER("screen", ti99_2_state, ti99_2_vblank_interrupt)
384384
385385
386386   /* video hardware */
trunk/src/mess/drivers/bml3.c
r17997r17998
113113   virtual void palette_init();
114114public:   
115115   UINT32 screen_update_bml3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
116   INTERRUPT_GEN_MEMBER(bml3_irq);
117   INTERRUPT_GEN_MEMBER(bml3_timer_firq);
116118};
117119
118120#define mc6845_h_char_total    (m_crtc_vreg[0])
r17997r17998
600602}
601603
602604#if 0
603static INTERRUPT_GEN( bml3_irq )
605INTERRUPT_GEN_MEMBER(bml3_state::bml3_irq)
604606{
605   device->machine().device("maincpu")->execute().set_input_line(M6809_IRQ_LINE, HOLD_LINE);
607   machine().device("maincpu")->execute().set_input_line(M6809_IRQ_LINE, HOLD_LINE);
606608}
607609#endif
608610
609611
610static INTERRUPT_GEN( bml3_timer_firq )
612INTERRUPT_GEN_MEMBER(bml3_state::bml3_timer_firq)
611613{
612   bml3_state *state = device->machine().driver_data<bml3_state>();
613614
614   if(!state->m_firq_mask)
615   if(!m_firq_mask)
615616   {
616      state->m_maincpu->set_input_line(M6809_FIRQ_LINE, ASSERT_LINE);
617      state->m_firq_status = 1;
617      m_maincpu->set_input_line(M6809_FIRQ_LINE, ASSERT_LINE);
618      m_firq_status = 1;
618619   }
619620}
620621
r17997r17998
889890   /* basic machine hardware */
890891   MCFG_CPU_ADD("maincpu",M6809, XTAL_1MHz)
891892   MCFG_CPU_PROGRAM_MAP(bml3_mem)
892   MCFG_CPU_VBLANK_INT("screen", bml3_timer_firq )
893//  MCFG_CPU_PERIODIC_INT(bml3_firq,45)
893   MCFG_CPU_VBLANK_INT_DRIVER("screen", bml3_state,  bml3_timer_firq)
894//   MCFG_CPU_PERIODIC_INT_DRIVER(bml3_state, bml3_firq, 45)
894895
895896//  MCFG_MACHINE_RESET_OVERRIDE(bml3_state,bml3)
896897
trunk/src/mess/drivers/poly88.c
r17997r17998
169169   MCFG_CPU_ADD("maincpu",I8080, 1853000)
170170   MCFG_CPU_PROGRAM_MAP(poly88_mem)
171171   MCFG_CPU_IO_MAP(poly88_io)
172   MCFG_CPU_VBLANK_INT("screen", poly88_interrupt)
172   MCFG_CPU_VBLANK_INT_DRIVER("screen", poly88_state, poly88_interrupt)
173173
174174
175175   /* video hardware */
trunk/src/mess/drivers/samcoupe.c
r17997r17998
349349   state->m_status &= ~src;
350350}
351351
352static INTERRUPT_GEN( samcoupe_frame_interrupt )
352INTERRUPT_GEN_MEMBER(samcoupe_state::samcoupe_frame_interrupt)
353353{
354354   /* signal frame interrupt */
355   samcoupe_irq(device, SAM_FRAME_INT);
355   samcoupe_irq(&device, SAM_FRAME_INT);
356356}
357357
358358
r17997r17998
530530   MCFG_CPU_ADD("maincpu", Z80, SAMCOUPE_XTAL_X1 / 4) /* 6 MHz */
531531   MCFG_CPU_PROGRAM_MAP(samcoupe_mem)
532532   MCFG_CPU_IO_MAP(samcoupe_io)
533   MCFG_CPU_VBLANK_INT("screen", samcoupe_frame_interrupt)
533   MCFG_CPU_VBLANK_INT_DRIVER("screen", samcoupe_state, samcoupe_frame_interrupt)
534534
535535
536536    /* video hardware */
trunk/src/mess/drivers/trs80.c
r17997r17998
610610   MCFG_CPU_MODIFY( "maincpu" )
611611   MCFG_CPU_PROGRAM_MAP( model1_map)
612612   MCFG_CPU_IO_MAP( model1_io)
613   MCFG_CPU_PERIODIC_INT(trs80_rtc_interrupt, 40)
613   MCFG_CPU_PERIODIC_INT_DRIVER(trs80_state, trs80_rtc_interrupt, 40)
614614
615615   /* devices */
616616   MCFG_CASSETTE_MODIFY( CASSETTE_TAG, trs80l2_cassette_interface )
r17997r17998
625625   MCFG_CPU_MODIFY( "maincpu" )
626626   MCFG_CPU_PROGRAM_MAP( model3_map)
627627   MCFG_CPU_IO_MAP( model3_io)
628   MCFG_CPU_PERIODIC_INT(trs80_rtc_interrupt, 30)
628   MCFG_CPU_PERIODIC_INT_DRIVER(trs80_state, trs80_rtc_interrupt, 30)
629629
630630   MCFG_MACHINE_RESET_OVERRIDE(trs80_state, trs80m4 )
631631
trunk/src/mess/drivers/primo.c
r17997r17998
262262   MCFG_CPU_ADD( "maincpu", Z80, 2500000 )
263263   MCFG_CPU_PROGRAM_MAP( primo32_mem)
264264   MCFG_CPU_IO_MAP( primoa_port)
265   MCFG_CPU_VBLANK_INT("screen", primo_vblank_interrupt)
265   MCFG_CPU_VBLANK_INT_DRIVER("screen", primo_state, primo_vblank_interrupt)
266266
267267
268268   /* video hardware */
trunk/src/mess/drivers/homez80.c
r17997r17998
3939   virtual void machine_reset();
4040   virtual void video_start();
4141   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
42   INTERRUPT_GEN_MEMBER(homez80_interrupt);
4243};
4344
4445
r17997r17998
271272GFXDECODE_END
272273
273274
274static INTERRUPT_GEN( homez80_interrupt )
275INTERRUPT_GEN_MEMBER(homez80_state::homez80_interrupt)
275276{
276   homez80_state *state = device->machine().driver_data<homez80_state>();
277   device->execute().set_input_line(0, (state->m_irq) ? HOLD_LINE : CLEAR_LINE);
278   state->m_irq ^= 1;
277   device.execute().set_input_line(0, (m_irq) ? HOLD_LINE : CLEAR_LINE);
278   m_irq ^= 1;
279279}
280280
281281static MACHINE_CONFIG_START( homez80, homez80_state )
r17997r17998
283283   MCFG_CPU_ADD("maincpu",Z80, XTAL_8MHz / 2)
284284   MCFG_CPU_PROGRAM_MAP(homez80_mem)
285285   MCFG_CPU_IO_MAP(homez80_io)
286   MCFG_CPU_PERIODIC_INT(homez80_interrupt, 50)
286   MCFG_CPU_PERIODIC_INT_DRIVER(homez80_state, homez80_interrupt, 50)
287287
288288   /* video hardware */
289289   MCFG_SCREEN_ADD("screen", RASTER)
trunk/src/mess/drivers/interact.c
r17997r17998
143143   /* basic machine hardware */
144144   MCFG_CPU_ADD("maincpu", I8080, XTAL_2MHz)
145145   MCFG_CPU_PROGRAM_MAP(interact_mem)
146   MCFG_CPU_PERIODIC_INT(irq0_line_hold,50) /*  put on the I8080 irq in Hz*/
146   MCFG_CPU_PERIODIC_INT_DRIVER(interact_state, irq0_line_hold, 50) /*  put on the I8080 irq in Hz*/
147147
148148   MCFG_MACHINE_RESET_OVERRIDE(interact_state,interact)
149149   MCFG_MACHINE_START_OVERRIDE(interact_state,interact)
r17997r17998
184184   /* basic machine hardware */
185185   MCFG_CPU_ADD("maincpu", Z80, XTAL_1_75MHz)
186186   MCFG_CPU_PROGRAM_MAP(interact_mem)
187   MCFG_CPU_PERIODIC_INT(irq0_line_hold,50) /*  put on the I8080 irq in Hz*/
187   MCFG_CPU_PERIODIC_INT_DRIVER(interact_state, irq0_line_hold, 50) /*  put on the I8080 irq in Hz*/
188188
189189   MCFG_MACHINE_RESET_OVERRIDE(interact_state,interact)
190190   MCFG_MACHINE_START_OVERRIDE(interact_state,interact)
trunk/src/mess/drivers/galaxy.c
r17997r17998
187187   /* basic machine hardware */
188188   MCFG_CPU_ADD("maincpu", Z80, XTAL / 2)
189189   MCFG_CPU_PROGRAM_MAP(galaxy_mem)
190   MCFG_CPU_VBLANK_INT("screen", galaxy_interrupt)
190   MCFG_CPU_VBLANK_INT_DRIVER("screen", galaxy_state, galaxy_interrupt)
191191   MCFG_SCREEN_ADD("screen", RASTER)
192192   MCFG_SCREEN_REFRESH_RATE(50)
193193
r17997r17998
223223   MCFG_CPU_ADD("maincpu", Z80, XTAL / 2)
224224   MCFG_CPU_PROGRAM_MAP(galaxyp_mem)
225225   MCFG_CPU_IO_MAP(galaxyp_io)
226   MCFG_CPU_VBLANK_INT("screen", galaxy_interrupt)
226   MCFG_CPU_VBLANK_INT_DRIVER("screen", galaxy_state, galaxy_interrupt)
227227   MCFG_SCREEN_ADD("screen", RASTER)
228228   MCFG_SCREEN_REFRESH_RATE(50)
229229
trunk/src/mess/drivers/sm1800.c
r17997r17998
4545   virtual void video_start();
4646   virtual void palette_init();
4747   UINT32 screen_update_sm1800(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
48   INTERRUPT_GEN_MEMBER(sm1800_vblank_interrupt);
4849};
4950
5051static ADDRESS_MAP_START(sm1800_mem, AS_PROGRAM, 8, sm1800_state)
r17997r17998
9293   return 0;
9394}
9495
95static INTERRUPT_GEN( sm1800_vblank_interrupt )
96INTERRUPT_GEN_MEMBER(sm1800_state::sm1800_vblank_interrupt)
9697{
97   sm1800_state *state = device->machine().driver_data<sm1800_state>();
98   device->machine().device("maincpu")->execute().set_input_line(0, state->m_irq_state ?  HOLD_LINE : CLEAR_LINE);
99   state->m_irq_state ^= 1;
98   machine().device("maincpu")->execute().set_input_line(0, m_irq_state ?  HOLD_LINE : CLEAR_LINE);
99   m_irq_state ^= 1;
100100}
101101
102102static I8275_DISPLAY_PIXELS(sm1800_display_pixels)
r17997r17998
189189   MCFG_CPU_ADD("maincpu",I8080, XTAL_2MHz)
190190   MCFG_CPU_PROGRAM_MAP(sm1800_mem)
191191   MCFG_CPU_IO_MAP(sm1800_io)
192   MCFG_CPU_VBLANK_INT("screen", sm1800_vblank_interrupt)
192   MCFG_CPU_VBLANK_INT_DRIVER("screen", sm1800_state, sm1800_vblank_interrupt)
193193
194194   /* video hardware */
195195   MCFG_SCREEN_ADD("screen", RASTER)
trunk/src/mess/drivers/compis.c
r17997r17998
357357   MCFG_CPU_ADD("maincpu", I80186, 8000000)   /* 8 MHz */
358358   MCFG_CPU_PROGRAM_MAP(compis_mem)
359359   MCFG_CPU_IO_MAP(compis_io)
360   MCFG_CPU_VBLANK_INT("screen", compis_vblank_int)
360   MCFG_CPU_VBLANK_INT_DRIVER("screen", compis_state, compis_vblank_int)
361361   MCFG_CPU_CONFIG(i86_address_mask)
362362
363363   //MCFG_QUANTUM_TIME(attotime::from_hz(60))
r17997r17998
400400   MCFG_CPU_ADD("maincpu", I80186, 8000000)   /* 8 MHz */
401401   MCFG_CPU_PROGRAM_MAP(compis_mem)
402402   MCFG_CPU_IO_MAP(compis_io)
403   MCFG_CPU_VBLANK_INT("screen", compis_vblank_int)
403   MCFG_CPU_VBLANK_INT_DRIVER("screen", compis_state, compis_vblank_int)
404404   MCFG_CPU_CONFIG(i86_address_mask)
405405
406406   //MCFG_QUANTUM_TIME(attotime::from_hz(60))
trunk/src/mess/drivers/vtech2.c
r17997r17998
398398      colortable_entry_set_value(machine().colortable, 512+i, i);
399399}
400400
401static INTERRUPT_GEN( vtech2_interrupt )
401INTERRUPT_GEN_MEMBER(vtech2_state::vtech2_interrupt)
402402{
403   device->machine().device("maincpu")->execute().set_input_line(0, HOLD_LINE);
403   machine().device("maincpu")->execute().set_input_line(0, HOLD_LINE);
404404}
405405
406406static const cassette_interface laser_cassette_interface =
r17997r17998
430430   MCFG_CPU_ADD("maincpu", Z80, 3694700)        /* 3.694700 MHz */
431431   MCFG_CPU_PROGRAM_MAP(vtech2_mem)
432432   MCFG_CPU_IO_MAP(vtech2_io)
433   MCFG_CPU_VBLANK_INT("screen", vtech2_interrupt)
433   MCFG_CPU_VBLANK_INT_DRIVER("screen", vtech2_state, vtech2_interrupt)
434434   MCFG_QUANTUM_TIME(attotime::from_hz(60))
435435
436436
trunk/src/mess/drivers/mac.c
r17997r17998
7878// CA2: SCSI interrupt     = 0x01
7979// CB1: ASC interrupt      = 0x10
8080
81static INTERRUPT_GEN( mac_rbv_vbl )
81INTERRUPT_GEN_MEMBER(mac_state::mac_rbv_vbl)
8282{
83   mac_state *mac = device->machine().driver_data<mac_state>();
8483
85   mac->m_rbv_regs[2] &= ~0x40;   // set vblank signal
86   mac->m_rbv_vbltime = 10;
84   m_rbv_regs[2] &= ~0x40;   // set vblank signal
85   m_rbv_vbltime = 10;
8786
8887//  printf("RBV: raising VBL!\n");
8988
90   if (mac->m_rbv_regs[0x12] & 0x40)
89   if (m_rbv_regs[0x12] & 0x40)
9190   {
92      mac->rbv_recalc_irqs();
91      rbv_recalc_irqs();
9392   }
9493}
9594
r17997r17998
11101109
11111110   MCFG_CPU_REPLACE("maincpu", M68020HMMU, C15M)
11121111   MCFG_CPU_PROGRAM_MAP(maclc_map)
1113   MCFG_CPU_VBLANK_INT(MAC_SCREEN_NAME, mac_rbv_vbl)
1112   MCFG_CPU_VBLANK_INT_DRIVER(MAC_SCREEN_NAME, mac_state, mac_rbv_vbl)
11141113
11151114   MCFG_PALETTE_LENGTH(256)
11161115
r17997r17998
11471146
11481147   MCFG_CPU_REPLACE("maincpu", M68030, C15M)
11491148   MCFG_CPU_PROGRAM_MAP(maclc_map)
1150   MCFG_CPU_VBLANK_INT(MAC_SCREEN_NAME, mac_rbv_vbl)
1149   MCFG_CPU_VBLANK_INT_DRIVER(MAC_SCREEN_NAME, mac_state, mac_rbv_vbl)
11511150
11521151   MCFG_RAM_MODIFY(RAM_TAG)
11531152   MCFG_RAM_DEFAULT_SIZE("4M")
r17997r17998
11641163
11651164   MCFG_CPU_REPLACE("maincpu", M68030, 25000000)
11661165   MCFG_CPU_PROGRAM_MAP(maclc3_map)
1167   MCFG_CPU_VBLANK_INT(MAC_SCREEN_NAME, mac_rbv_vbl)
1166   MCFG_CPU_VBLANK_INT_DRIVER(MAC_SCREEN_NAME, mac_state, mac_rbv_vbl)
11681167
11691168   MCFG_VIDEO_START_OVERRIDE(mac_state,macsonora)
11701169   MCFG_VIDEO_RESET_OVERRIDE(mac_state,macsonora)
r17997r17998
11931192
11941193   MCFG_CPU_REPLACE("maincpu", M68030, C32M)
11951194   MCFG_CPU_PROGRAM_MAP(maclc3_map)
1196   MCFG_CPU_VBLANK_INT(MAC_SCREEN_NAME, mac_rbv_vbl)
1195   MCFG_CPU_VBLANK_INT_DRIVER(MAC_SCREEN_NAME, mac_state, mac_rbv_vbl)
11971196
11981197   MCFG_VIDEO_START_OVERRIDE(mac_state,macv8)
11991198   MCFG_VIDEO_RESET_OVERRIDE(mac_state,macrbv)
r17997r17998
12171216
12181217   MCFG_CPU_REPLACE("maincpu", M68030, C15M)
12191218   MCFG_CPU_PROGRAM_MAP(maclc3_map)
1220   MCFG_CPU_VBLANK_INT(MAC_SCREEN_NAME, mac_rbv_vbl)
1219   MCFG_CPU_VBLANK_INT_DRIVER(MAC_SCREEN_NAME, mac_state, mac_rbv_vbl)
12211220
12221221   MCFG_VIDEO_START_OVERRIDE(mac_state,macv8)
12231222   MCFG_VIDEO_RESET_OVERRIDE(mac_state,macrbv)
r17997r17998
14861485
14871486   MCFG_CPU_REPLACE("maincpu", M68030, 25000000)
14881487   MCFG_CPU_PROGRAM_MAP(maciici_map)
1489   MCFG_CPU_VBLANK_INT(MAC_SCREEN_NAME, mac_rbv_vbl)
1488   MCFG_CPU_VBLANK_INT_DRIVER(MAC_SCREEN_NAME, mac_state, mac_rbv_vbl)
14901489
14911490   MCFG_PALETTE_LENGTH(256)
14921491
r17997r17998
15151514
15161515   MCFG_CPU_REPLACE("maincpu", M68030, 20000000)
15171516   MCFG_CPU_PROGRAM_MAP(maciici_map)
1518   MCFG_CPU_VBLANK_INT(MAC_SCREEN_NAME, mac_rbv_vbl)
1517   MCFG_CPU_VBLANK_INT_DRIVER(MAC_SCREEN_NAME, mac_state, mac_rbv_vbl)
15191518
15201519   MCFG_PALETTE_LENGTH(256)
15211520
trunk/src/mess/drivers/tim011.c
r17997r17998
5656   MCFG_CPU_ADD("maincpu",Z180, XTAL_12_288MHz / 2)
5757   MCFG_CPU_PROGRAM_MAP(tim011_mem)
5858   MCFG_CPU_IO_MAP(tim011_io)
59   MCFG_CPU_VBLANK_INT("screen",irq0_line_hold)
59   MCFG_CPU_VBLANK_INT_DRIVER("screen", tim011_state, irq0_line_hold)
6060
6161
6262   /* video hardware */
trunk/src/mess/drivers/pk8000.c
r17997r17998
3030   virtual void machine_reset();
3131   virtual void video_start();
3232   UINT32 screen_update_pk8000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
33   INTERRUPT_GEN_MEMBER(pk8000_interrupt);
3334};
3435
3536
r17997r17998
308309      PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED)
309310INPUT_PORTS_END
310311
311static INTERRUPT_GEN( pk8000_interrupt )
312INTERRUPT_GEN_MEMBER(pk8000_state::pk8000_interrupt)
312313{
313   device->execute().set_input_line(0, HOLD_LINE);
314   device.execute().set_input_line(0, HOLD_LINE);
314315}
315316
316317static IRQ_CALLBACK(pk8000_irq_callback)
r17997r17998
349350   MCFG_CPU_ADD("maincpu",I8080, 1780000)
350351   MCFG_CPU_PROGRAM_MAP(pk8000_mem)
351352   MCFG_CPU_IO_MAP(pk8000_io)
352   MCFG_CPU_VBLANK_INT("screen", pk8000_interrupt)
353   MCFG_CPU_VBLANK_INT_DRIVER("screen", pk8000_state, pk8000_interrupt)
353354
354355
355356   /* video hardware */
trunk/src/mess/drivers/concept.c
r17997r17998
119119   /* basic machine hardware */
120120   MCFG_CPU_ADD("maincpu", M68000, 8182000)        /* 16.364 MHz / 2 */
121121   MCFG_CPU_PROGRAM_MAP(concept_memmap)
122   MCFG_CPU_VBLANK_INT("screen", concept_interrupt)
122   MCFG_CPU_VBLANK_INT_DRIVER("screen", concept_state, concept_interrupt)
123123
124124   MCFG_QUANTUM_TIME(attotime::from_hz(60))
125125
trunk/src/mess/drivers/sgi_ip2.c
r17997r17998
102102   DECLARE_DRIVER_INIT(sgi_ip2);
103103   virtual void machine_start();
104104   virtual void machine_reset();
105   INTERRUPT_GEN_MEMBER(sgi_ip2_vbl);
105106};
106107
107108
r17997r17998
367368};
368369
369370
370static INTERRUPT_GEN( sgi_ip2_vbl )
371INTERRUPT_GEN_MEMBER(sgi_ip2_state::sgi_ip2_vbl)
371372{
372373}
373374
r17997r17998
477478   /* basic machine hardware */
478479   MCFG_CPU_ADD("maincpu", M68020, 16000000)
479480   MCFG_CPU_PROGRAM_MAP(sgi_ip2_map)
480   MCFG_CPU_VBLANK_INT(TERMINAL_TAG ":" TERMINAL_SCREEN_TAG, sgi_ip2_vbl)
481   MCFG_CPU_VBLANK_INT_DRIVER(TERMINAL_TAG ":" TERMINAL_SCREEN_TAG, sgi_ip2_state, sgi_ip2_vbl)
481482
482483
483484   /* video hardware */
trunk/src/mess/drivers/ti990_4.c
r17997r17998
6262   virtual void machine_reset();
6363   virtual void video_start();
6464   UINT32 screen_update_ti990_4(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
65   INTERRUPT_GEN_MEMBER(ti990_4_line_interrupt);
6566};
6667
6768
r17997r17998
7576}
7677
7778
78static INTERRUPT_GEN( ti990_4_line_interrupt )
79INTERRUPT_GEN_MEMBER(ti990_4_state::ti990_4_line_interrupt)
7980{
80   ti990_4_state *state = device->machine().driver_data<ti990_4_state>();
8181
8282#if VIDEO_911
83   vdt911_keyboard(state->m_terminal);
83   vdt911_keyboard(m_terminal);
8484#else
85   asr733_keyboard(state->m_terminal);
85   asr733_keyboard(m_terminal);
8686#endif
8787
88   ti990_line_interrupt(device->machine());
88   ti990_line_interrupt(machine());
8989}
9090
9191#ifdef UNUSED_FUNCTION
r17997r17998
245245   MCFG_CPU_ADD("maincpu", TMS9900L, 3000000)
246246   MCFG_CPU_PROGRAM_MAP(ti990_4_memmap)
247247   MCFG_CPU_IO_MAP(ti990_4_cru_map)
248   MCFG_CPU_PERIODIC_INT(ti990_4_line_interrupt, 120/*or TIME_IN_HZ(100) in Europe*/)
248   MCFG_CPU_PERIODIC_INT_DRIVER(ti990_4_state, ti990_4_line_interrupt, 120/*or TIME_IN_HZ(100) in Europe*/)
249249
250250
251251   /* video hardware - we emulate a single 911 vdt display */
trunk/src/mess/drivers/msx.c
r17997r17998
10691069   MCFG_CPU_ADD("maincpu", Z80, XTAL_10_738635MHz/3)        /* 3.579545 MHz */
10701070   MCFG_CPU_PROGRAM_MAP(msx_memory_map)
10711071   MCFG_CPU_IO_MAP(msx_io_map)
1072   MCFG_CPU_VBLANK_INT("screen", msx_interrupt)   /* Needed for mouse updates */
1072   MCFG_CPU_VBLANK_INT_DRIVER("screen", msx_state, msx_interrupt)   /* Needed for mouse updates */
10731073   MCFG_QUANTUM_TIME(attotime::from_hz(60))
10741074
10751075   MCFG_MACHINE_START_OVERRIDE(msx_state, msx )
trunk/src/mess/drivers/vt100.c
r17997r17998
5757   virtual void machine_start();
5858   virtual void machine_reset();
5959   UINT32 screen_update_vt100(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
60   INTERRUPT_GEN_MEMBER(vt100_vertical_interrupt);
6061};
6162
6263
r17997r17998
379380   DEVCB_DRIVER_MEMBER(vt100_state, vt100_clear_video_interrupt)
380381};
381382
382static INTERRUPT_GEN( vt100_vertical_interrupt )
383INTERRUPT_GEN_MEMBER(vt100_state::vt100_vertical_interrupt)
383384{
384   vt100_state *state = device->machine().driver_data<vt100_state>();
385   state->m_vertical_int = 1;
386   device->execute().set_input_line(0, HOLD_LINE);
385   m_vertical_int = 1;
386   device.execute().set_input_line(0, HOLD_LINE);
387387}
388388
389389/* F4 Character Displayer */
r17997r17998
412412   MCFG_CPU_ADD("maincpu",I8080, XTAL_24_8832MHz / 9)
413413   MCFG_CPU_PROGRAM_MAP(vt100_mem)
414414   MCFG_CPU_IO_MAP(vt100_io)
415   MCFG_CPU_VBLANK_INT("screen", vt100_vertical_interrupt)
415   MCFG_CPU_VBLANK_INT_DRIVER("screen", vt100_state, vt100_vertical_interrupt)
416416
417417
418418   /* video hardware */
trunk/src/mess/drivers/vt240.c
r17997r17998
4747   required_shared_ptr<UINT8> m_video_ram;
4848   DECLARE_DRIVER_INIT(vt240);
4949   virtual void machine_reset();
50   INTERRUPT_GEN_MEMBER(vt240_irq);
5051};
5152
5253/* TODO */
r17997r17998
140141   DEVCB_NULL
141142};
142143
143static INTERRUPT_GEN( vt240_irq )
144INTERRUPT_GEN_MEMBER(vt240_state::vt240_irq)
144145{
145   //device->execute().set_input_line(I8085_RST65_LINE, ASSERT_LINE);
146   //device.execute().set_input_line(I8085_RST65_LINE, ASSERT_LINE);
146147}
147148
148149static const gfx_layout vt240_chars_8x8 =
r17997r17998
165166   MCFG_CPU_ADD("maincpu", I8085A, XTAL_16MHz / 4)
166167   MCFG_CPU_PROGRAM_MAP(vt240_mem)
167168   MCFG_CPU_IO_MAP(vt240_io)
168   MCFG_CPU_VBLANK_INT("screen",vt240_irq)
169   MCFG_CPU_VBLANK_INT_DRIVER("screen", vt240_state, vt240_irq)
169170
170171
171172   /* video hardware */
trunk/src/mess/drivers/pasogo.c
r17997r17998
7070   virtual void machine_reset();
7171   virtual void palette_init();
7272   UINT32 screen_update_pasogo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
73   INTERRUPT_GEN_MEMBER(pasogo_interrupt);
7374};
7475
7576
r17997r17998
449450   return 0;
450451}
451452
452static INTERRUPT_GEN( pasogo_interrupt )
453INTERRUPT_GEN_MEMBER(pasogo_state::pasogo_interrupt)
453454{
454455//  machine.device("maincpu")->execute().set_input_line(UPD7810_INTFE1, PULSE_LINE);
455456}
r17997r17998
504505   MCFG_CPU_ADD("maincpu", I80188/*V30HL in vadem vg230*/, 10000000/*?*/)
505506   MCFG_CPU_PROGRAM_MAP(pasogo_mem)
506507   MCFG_CPU_IO_MAP( pasogo_io)
507   MCFG_CPU_VBLANK_INT("screen", pasogo_interrupt)
508   MCFG_CPU_VBLANK_INT_DRIVER("screen", pasogo_state, pasogo_interrupt)
508509//  MCFG_CPU_CONFIG(i86_address_mask)
509510
510511   MCFG_PIT8254_ADD( "pit8254", pc_pit8254_config )
trunk/src/mess/drivers/lisa.c
r17997r17998
135135   /* basic machine hardware */
136136   MCFG_CPU_ADD("maincpu", M68000, 5093760)        /* 20.37504 MHz / 4 */
137137   MCFG_CPU_PROGRAM_MAP(lisa_map)
138   MCFG_CPU_VBLANK_INT("screen", lisa_interrupt)
138   MCFG_CPU_VBLANK_INT_DRIVER("screen", lisa_state, lisa_interrupt)
139139
140140   MCFG_CPU_ADD(COP421_TAG, COP421, 3900000)
141141   MCFG_CPU_IO_MAP(lisa_cop_io_map)
trunk/src/mess/drivers/aquarius.c
r17997r17998
397397   MCFG_CPU_ADD("maincpu", Z80, XTAL_3_579545MHz) // ???
398398   MCFG_CPU_PROGRAM_MAP(aquarius_mem)
399399   MCFG_CPU_IO_MAP(aquarius_io)
400   MCFG_CPU_VBLANK_INT("screen", irq0_line_hold)
400   MCFG_CPU_VBLANK_INT_DRIVER("screen", aquarius_state, irq0_line_hold)
401401
402402    /* video hardware */
403403   MCFG_SCREEN_ADD("screen", RASTER)
trunk/src/mess/drivers/cgenie.c
r17997r17998
523523   MCFG_CPU_ADD("maincpu", Z80, XTAL_17_73447MHz/8)        /* 2,2168 MHz */
524524   MCFG_CPU_PROGRAM_MAP(cgenie_mem)
525525   MCFG_CPU_IO_MAP(cgenie_io)
526   MCFG_CPU_VBLANK_INT("screen", cgenie_frame_interrupt)
527   MCFG_CPU_PERIODIC_INT(cgenie_timer_interrupt, 40)
526   MCFG_CPU_VBLANK_INT_DRIVER("screen", cgenie_state,  cgenie_frame_interrupt)
527   MCFG_CPU_PERIODIC_INT_DRIVER(cgenie_state, cgenie_timer_interrupt,  40)
528528   MCFG_QUANTUM_TIME(attotime::from_hz(240))
529529
530530
trunk/src/mess/drivers/apexc.c
r17997r17998
3232   virtual void video_start();
3333   virtual void palette_init();
3434   UINT32 screen_update_apexc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
35   INTERRUPT_GEN_MEMBER(apexc_interrupt);
3536};
3637
3738
r17997r17998
395396/*
396397    Not a real interrupt - just handle keyboard input
397398*/
398static INTERRUPT_GEN( apexc_interrupt )
399INTERRUPT_GEN_MEMBER(apexc_state::apexc_interrupt)
399400{
400   apexc_state *state = device->machine().driver_data<apexc_state>();
401   address_space& space = *device->machine().device("maincpu")->memory().space(AS_PROGRAM);
401   address_space& space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
402402   UINT32 edit_keys;
403403   int control_keys;
404404
r17997r17998
406406
407407
408408   /* read new state of edit keys */
409   edit_keys = device->machine().root_device().ioport("data")->read();
409   edit_keys = machine().root_device().ioport("data")->read();
410410
411411   /* toggle data reg according to transitions */
412   state->m_panel_data_reg ^= edit_keys & (~state->m_old_edit_keys);
412   m_panel_data_reg ^= edit_keys & (~m_old_edit_keys);
413413
414414   /* remember new state of edit keys */
415   state->m_old_edit_keys = edit_keys;
415   m_old_edit_keys = edit_keys;
416416
417417
418418   /* read new state of control keys */
419   control_keys = state->ioport("panel")->read();
419   control_keys = ioport("panel")->read();
420420
421421   /* compute transitions */
422   control_transitions = control_keys & (~state->m_old_control_keys);
422   control_transitions = control_keys & (~m_old_control_keys);
423423
424424   /* process commands */
425425
426426   if (control_transitions & panel_run)
427427   {   /* toggle run/stop state */
428      device->state().set_state_int(APEXC_STATE, ! device->state().state_int(APEXC_STATE));
428      device.state().set_state_int(APEXC_STATE, ! device.state().state_int(APEXC_STATE));
429429   }
430430
431431   while (control_transitions & (panel_CR | panel_A | panel_R | panel_ML | panel_HB))
r17997r17998
467467         /* read/write register #reg_id */
468468         if (control_keys & panel_write)
469469            /* write reg */
470            device->state().set_state_int(reg_id, state->m_panel_data_reg);
470            device.state().set_state_int(reg_id, m_panel_data_reg);
471471         else
472472            /* read reg */
473            state->m_panel_data_reg = device->state().state_int(reg_id);
473            m_panel_data_reg = device.state().state_int(reg_id);
474474      }
475475   }
476476
r17997r17998
479479
480480      if (control_keys & panel_write) {
481481         /* write memory */
482         space.write_dword(device->state().state_int(APEXC_ML_FULL)<<2, state->m_panel_data_reg);
482         space.write_dword(device.state().state_int(APEXC_ML_FULL)<<2, m_panel_data_reg);
483483      }
484484      else {
485485         /* read memory */
486         state->m_panel_data_reg = space.read_dword(device->state().state_int(APEXC_ML_FULL)<<2);
486         m_panel_data_reg = space.read_dword(device.state().state_int(APEXC_ML_FULL)<<2);
487487      }
488488   }
489489
490490   /* remember new state of control keys */
491   state->m_old_control_keys = control_keys;
491   m_old_control_keys = control_keys;
492492}
493493
494494/*
r17997r17998
869869   MCFG_CPU_PROGRAM_MAP(apexc_mem_map)
870870   MCFG_CPU_IO_MAP(apexc_io_map)
871871   /* dummy interrupt: handles the control panel */
872   MCFG_CPU_VBLANK_INT("screen", apexc_interrupt)
872   MCFG_CPU_VBLANK_INT_DRIVER("screen", apexc_state, apexc_interrupt)
873873   /*MCFG_CPU_PERIODIC_INT(func, rate)*/
874874
875875
trunk/src/mess/drivers/x68k.c
r17997r17998
18951895   drvstate->m_mfp_prev = state;
18961896}
18971897
1898static INTERRUPT_GEN( x68k_vsync_irq )
1898INTERRUPT_GEN_MEMBER(x68k_state::x68k_vsync_irq)
18991899{
19001900#if 0
19011901   x68k_state *state = machine.driver_data<x68k_state>();
1902   if(state->m_mfp.ierb & 0x40)
1902   if(m_mfp.ierb & 0x40)
19031903   {
1904      state->m_mfp.isrb |= 0x40;
1905      state->m_current_vector[6] = (state->m_mfp.vr & 0xf0) | 0x06;  // GPIP4 (V-DISP)
1906      state->m_current_irq_line = 6;
1904      m_mfp.isrb |= 0x40;
1905      m_current_vector[6] = (m_mfp.vr & 0xf0) | 0x06;  // GPIP4 (V-DISP)
1906      m_current_irq_line = 6;
19071907      mfp_timer_a_callback(0);  // Timer A is usually always in event count mode, and is tied to V-DISP
19081908      mfp_trigger_irq(MFP_IRQ_GPIP4);
19091909   }
1910   if(state->m_crtc.height == 256)
1911      machine.primary_screen->update_partial(256);//state->m_crtc.reg[4]/2);
1910   if(m_crtc.height == 256)
1911      machine.primary_screen->update_partial(256);//m_crtc.reg[4]/2);
19121912   else
1913      machine.primary_screen->update_partial(512);//state->m_crtc.reg[4]);
1913      machine.primary_screen->update_partial(512);//m_crtc.reg[4]);
19141914#endif
19151915}
19161916
r17997r17998
27412741   /* basic machine hardware */
27422742   MCFG_CPU_ADD("maincpu", M68000, 10000000)  /* 10 MHz */
27432743   MCFG_CPU_PROGRAM_MAP(x68k_map)
2744   MCFG_CPU_VBLANK_INT("screen", x68k_vsync_irq)
2744   MCFG_CPU_VBLANK_INT_DRIVER("screen", x68k_state, x68k_vsync_irq)
27452745   MCFG_QUANTUM_TIME(attotime::from_hz(60))
27462746
27472747   MCFG_MACHINE_START_OVERRIDE(x68k_state, x68000 )
trunk/src/mess/drivers/ondra.c
r17997r17998
105105      PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("NMI") PORT_CODE(KEYCODE_ESC)
106106INPUT_PORTS_END
107107
108static INTERRUPT_GEN( ondra_interrupt )
108INTERRUPT_GEN_MEMBER(ondra_state::ondra_interrupt)
109109{
110   device->execute().set_input_line(0, HOLD_LINE);
110   device.execute().set_input_line(0, HOLD_LINE);
111111}
112112
113113static const cassette_interface ondra_cassette_interface =
r17997r17998
125125   MCFG_CPU_ADD("maincpu", Z80, 2000000)
126126   MCFG_CPU_PROGRAM_MAP(ondra_mem)
127127   MCFG_CPU_IO_MAP(ondra_io)
128   MCFG_CPU_VBLANK_INT("screen", ondra_interrupt)
128   MCFG_CPU_VBLANK_INT_DRIVER("screen", ondra_state, ondra_interrupt)
129129
130130
131131    /* video hardware */
trunk/src/mess/drivers/pc2000.c
r17997r17998
329329    MCFG_CPU_ADD("maincpu",Z80, XTAL_4MHz) /* probably not accurate */
330330    MCFG_CPU_PROGRAM_MAP(pc2000_mem)
331331    MCFG_CPU_IO_MAP(pc2000_io)
332    MCFG_CPU_VBLANK_INT("screen",irq0_line_hold)
332   MCFG_CPU_VBLANK_INT_DRIVER("screen", pc2000_state, irq0_line_hold)
333333
334334    /* video hardware */
335335    MCFG_SCREEN_ADD("screen", LCD)
trunk/src/mess/drivers/kaypro.c
r17997r17998
239239   MCFG_CPU_ADD("maincpu", Z80, XTAL_2_5MHz)
240240   MCFG_CPU_PROGRAM_MAP(kaypro_map)
241241   MCFG_CPU_IO_MAP(kayproii_io)
242   MCFG_CPU_VBLANK_INT("screen", kay_kbd_interrupt)   /* this doesn't actually exist, it is to run the keyboard */
242   MCFG_CPU_VBLANK_INT_DRIVER("screen", kaypro_state, kay_kbd_interrupt)   /* this doesn't actually exist, it is to run the keyboard */
243243   MCFG_CPU_CONFIG(kayproii_daisy_chain)
244244
245245   MCFG_MACHINE_START_OVERRIDE(kaypro_state, kayproii )
r17997r17998
284284   MCFG_CPU_ADD("maincpu", Z80, XTAL_4MHz)
285285   MCFG_CPU_PROGRAM_MAP(kaypro_map)
286286   MCFG_CPU_IO_MAP(kaypro2x_io)
287   MCFG_CPU_VBLANK_INT("screen", kay_kbd_interrupt)
287   MCFG_CPU_VBLANK_INT_DRIVER("screen", kaypro_state, kay_kbd_interrupt)
288288   MCFG_CPU_CONFIG(kaypro2x_daisy_chain)
289289
290290   MCFG_MACHINE_RESET_OVERRIDE(kaypro_state, kaypro2x )
trunk/src/mess/drivers/socrates.c
r17997r17998
128128   virtual void video_start();
129129   virtual void palette_init();
130130   UINT32 screen_update_socrates(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
131   INTERRUPT_GEN_MEMBER(assert_irq);
131132};
132133
133134
r17997r17998
909910   state->m_vblankstate = 0;
910911}
911912
912static INTERRUPT_GEN( assert_irq )
913INTERRUPT_GEN_MEMBER(socrates_state::assert_irq)
913914{
914   socrates_state *state = device->machine().driver_data<socrates_state>();
915   device->execute().set_input_line(0, ASSERT_LINE);
916   device->machine().scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(44), FUNC(clear_irq_cb));
915   device.execute().set_input_line(0, ASSERT_LINE);
916   machine().scheduler().timer_set(downcast<cpu_device *>(&device)->cycles_to_attotime(44), FUNC(clear_irq_cb));
917917// 44 is a complete and total guess, need to properly measure how many clocks/microseconds the int line is high for.
918   state->m_vblankstate = 1;
919   state->m_kbmcu_rscount = 0; // clear the mcu poke count
918   m_vblankstate = 1;
919   m_kbmcu_rscount = 0; // clear the mcu poke count
920920}
921921
922922static MACHINE_CONFIG_START( socrates, socrates_state )
r17997r17998
925925    MCFG_CPU_PROGRAM_MAP(z80_mem)
926926    MCFG_CPU_IO_MAP(z80_io)
927927    MCFG_QUANTUM_TIME(attotime::from_hz(60))
928    MCFG_CPU_VBLANK_INT("screen", assert_irq)
928   MCFG_CPU_VBLANK_INT_DRIVER("screen", socrates_state, assert_irq)
929929    //MCFG_MACHINE_START_OVERRIDE(socrates_state,socrates)
930930
931931    /* video hardware */
trunk/src/mess/drivers/pc8801.c
r17997r17998
451451   DECLARE_MACHINE_RESET(pc8801_clock_speed);
452452   DECLARE_MACHINE_RESET(pc8801_dic);
453453   DECLARE_MACHINE_RESET(pc8801_cdrom);
454   INTERRUPT_GEN_MEMBER(pc8801_vrtc_irq);
454455};
455456
456457
r17997r17998
23442345      pc8801_raise_irq(timer.machine(),1<<(2),1);
23452346}
23462347
2347static INTERRUPT_GEN( pc8801_vrtc_irq )
2348INTERRUPT_GEN_MEMBER(pc8801_state::pc8801_vrtc_irq)
23482349{
2349   pc8801_state *state = device->machine().driver_data<pc8801_state>();
2350   if(state->m_vblank_irq_mask)
2351      pc8801_raise_irq(device->machine(),1<<(1),1);
2350   if(m_vblank_irq_mask)
2351      pc8801_raise_irq(machine(),1<<(1),1);
23522352}
23532353
23542354#else
r17997r17998
24112411   }
24122412}
24132413
2414static INTERRUPT_GEN( pc8801_vrtc_irq )
2414INTERRUPT_GEN_MEMBER(pc8801_state::pc8801_vrtc_irq)
24152415{
2416   pc8801_state *state = device->machine().driver_data<pc8801_state>();
2417   if(state->m_vrtc_irq_mask && state->m_i8214_irq_level >= 2)
2416   if(m_vrtc_irq_mask && m_i8214_irq_level >= 2)
24182417   {
2419      state->m_vrtc_irq_latch = 1;
2418      m_vrtc_irq_latch = 1;
24202419      //IRQ_LOG(("vrtc\n"));
2421      device->execute().set_input_line(0,HOLD_LINE);
2420      device.execute().set_input_line(0,HOLD_LINE);
24222421   }
24232422}
24242423#endif
r17997r17998
26632662   MCFG_CPU_ADD("maincpu", Z80, MASTER_CLOCK)        /* 4 MHz */
26642663   MCFG_CPU_PROGRAM_MAP(pc8801_mem)
26652664   MCFG_CPU_IO_MAP(pc8801_io)
2666   MCFG_CPU_VBLANK_INT("screen", pc8801_vrtc_irq)
2665   MCFG_CPU_VBLANK_INT_DRIVER("screen", pc8801_state, pc8801_vrtc_irq)
26672666
26682667   /* sub CPU(5 inch floppy drive) */
26692668   MCFG_CPU_ADD("fdccpu", Z80, MASTER_CLOCK)      /* 4 MHz */
trunk/src/mess/drivers/rx78.c
r17997r17998
476476   MCFG_CPU_ADD("maincpu",Z80, MASTER_CLOCK/7)   // unknown divider
477477   MCFG_CPU_PROGRAM_MAP(rx78_mem)
478478   MCFG_CPU_IO_MAP(rx78_io)
479   MCFG_CPU_VBLANK_INT("screen",irq0_line_hold)
479   MCFG_CPU_VBLANK_INT_DRIVER("screen", rx78_state, irq0_line_hold)
480480
481481   /* video hardware */
482482   MCFG_SCREEN_ADD("screen", RASTER)
trunk/src/mess/drivers/supracan.c
r17997r17998
201201   virtual void video_start();
202202   virtual void palette_init();
203203   UINT32 screen_update_supracan(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
204   INTERRUPT_GEN_MEMBER(supracan_irq);
205   INTERRUPT_GEN_MEMBER(supracan_sound_irq);
204206};
205207
206208
r17997r17998
18701872   GFXDECODE_ENTRY( "ram_gfx3",  0, supracan_gfx1bpp_alt,   0, 0x80 )
18711873GFXDECODE_END
18721874
1873static INTERRUPT_GEN( supracan_irq )
1875INTERRUPT_GEN_MEMBER(supracan_state::supracan_irq)
18741876{
18751877#if 0
1876   supracan_state *state = (supracan_state *)device->machine().driver_data<supracan_state>();
18771878
1878   if(state->m_irq_mask)
1879   if(m_irq_mask)
18791880   {
1880      device->execute().set_input_line(7, HOLD_LINE);
1881      device.execute().set_input_line(7, HOLD_LINE);
18811882   }
18821883#endif
18831884}
18841885
1885static INTERRUPT_GEN( supracan_sound_irq )
1886INTERRUPT_GEN_MEMBER(supracan_state::supracan_sound_irq)
18861887{
1887   supracan_state *state = (supracan_state *)device->machine().driver_data<supracan_state>();
18881888
1889   state->m_sound_irq_source_reg |= 0x80;
1889   m_sound_irq_source_reg |= 0x80;
18901890
1891   if(state->m_sound_irq_enable_reg & state->m_sound_irq_source_reg)
1891   if(m_sound_irq_enable_reg & m_sound_irq_source_reg)
18921892   {
1893      device->machine().device("soundcpu")->execute().set_input_line(0, ASSERT_LINE);
1893      machine().device("soundcpu")->execute().set_input_line(0, ASSERT_LINE);
18941894   }
18951895   else
18961896   {
1897      device->machine().device("soundcpu")->execute().set_input_line(0, CLEAR_LINE);
1897      machine().device("soundcpu")->execute().set_input_line(0, CLEAR_LINE);
18981898   }
18991899}
19001900
r17997r17998
19021902
19031903   MCFG_CPU_ADD( "maincpu", M68000, XTAL_10_738635MHz )      /* Correct frequency unknown */
19041904   MCFG_CPU_PROGRAM_MAP( supracan_mem )
1905   MCFG_CPU_VBLANK_INT("screen", supracan_irq)
1905   MCFG_CPU_VBLANK_INT_DRIVER("screen", supracan_state, supracan_irq)
19061906
19071907   MCFG_CPU_ADD( "soundcpu", M6502, XTAL_3_579545MHz )      /* TODO: Verify actual clock */
19081908   MCFG_CPU_PROGRAM_MAP( supracan_sound_mem )
1909   MCFG_CPU_VBLANK_INT("screen", supracan_sound_irq)
1909   MCFG_CPU_VBLANK_INT_DRIVER("screen", supracan_state, supracan_sound_irq)
19101910
19111911#if !(SOUNDCPU_BOOT_HACK)
19121912   MCFG_QUANTUM_PERFECT_CPU("maincpu")
trunk/src/mess/drivers/hec2hrp.c
r17997r17998
440440   MCFG_CPU_ADD("maincpu",Z80, XTAL_5MHz)
441441   MCFG_CPU_PROGRAM_MAP(hec2hrp_mem)
442442   MCFG_CPU_IO_MAP(hec2hrp_io)
443   MCFG_CPU_PERIODIC_INT(irq0_line_hold,50) /*  put on the Z80 irq in Hz*/
443   MCFG_CPU_PERIODIC_INT_DRIVER(hec2hrp_state, irq0_line_hold, 50) /*  put on the Z80 irq in Hz*/
444444   MCFG_MACHINE_RESET_OVERRIDE(hec2hrp_state,hec2hrp)
445445   MCFG_MACHINE_START_OVERRIDE(hec2hrp_state,hec2hrp)
446446
r17997r17998
483483   MCFG_CPU_ADD("maincpu",Z80, XTAL_5MHz)
484484   MCFG_CPU_PROGRAM_MAP(hec2hrp_mem)
485485   MCFG_CPU_IO_MAP(hec2hrp_io)
486   MCFG_CPU_PERIODIC_INT(irq0_line_hold,50) /*  put on the Z80 irq in Hz*/
486   MCFG_CPU_PERIODIC_INT_DRIVER(hec2hrp_state, irq0_line_hold, 50) /*  put on the Z80 irq in Hz*/
487487   MCFG_MACHINE_RESET_OVERRIDE(hec2hrp_state,hec2hrp)
488488   MCFG_MACHINE_START_OVERRIDE(hec2hrp_state,hec2hrp)
489489
r17997r17998
526526   MCFG_CPU_ADD("maincpu",Z80, XTAL_5MHz)
527527   MCFG_CPU_PROGRAM_MAP(hec2hrx_mem)
528528   MCFG_CPU_IO_MAP(hec2mx40_io)
529   MCFG_CPU_PERIODIC_INT(irq0_line_hold,50) //  put on the Z80 irq in Hz
529   MCFG_CPU_PERIODIC_INT_DRIVER(hec2hrp_state, irq0_line_hold, 50) //  put on the Z80 irq in Hz
530530
531531   /* Disc II unit */
532532   MCFG_CPU_ADD("disc2cpu",Z80, XTAL_4MHz)
r17997r17998
575575   MCFG_CPU_ADD("maincpu",Z80, XTAL_5MHz)
576576   MCFG_CPU_PROGRAM_MAP(hec2hrx_mem)
577577   MCFG_CPU_IO_MAP(hec2hrx_io)
578   MCFG_CPU_PERIODIC_INT(irq0_line_hold,50) //  put on the Z80 irq in Hz
578   MCFG_CPU_PERIODIC_INT_DRIVER(hec2hrp_state, irq0_line_hold, 50) //  put on the Z80 irq in Hz
579579   MCFG_MACHINE_RESET_OVERRIDE(hec2hrp_state,hec2hrx)
580580   MCFG_MACHINE_START_OVERRIDE(hec2hrp_state,hec2hrx)
581581
r17997r17998
625625   MCFG_CPU_ADD("maincpu",Z80, XTAL_5MHz)
626626   MCFG_CPU_PROGRAM_MAP(hec2hrx_mem)
627627   MCFG_CPU_IO_MAP(hec2mdhrx_io)
628   MCFG_CPU_PERIODIC_INT(irq0_line_hold,50) //  put on the Z80 irq in Hz
628   MCFG_CPU_PERIODIC_INT_DRIVER(hec2hrp_state, irq0_line_hold, 50) //  put on the Z80 irq in Hz
629629   MCFG_MACHINE_RESET_OVERRIDE(hec2hrp_state,hec2mdhrx)
630630   MCFG_MACHINE_START_OVERRIDE(hec2hrp_state,hec2mdhrx)
631631
r17997r17998
673673   MCFG_CPU_ADD("maincpu",Z80, XTAL_5MHz)
674674   MCFG_CPU_PROGRAM_MAP(hec2hrx_mem)
675675   MCFG_CPU_IO_MAP(hec2mx80_io)
676   MCFG_CPU_PERIODIC_INT(irq0_line_hold,50) //  put on the Z80 irq in Hz
676   MCFG_CPU_PERIODIC_INT_DRIVER(hec2hrp_state, irq0_line_hold, 50) //  put on the Z80 irq in Hz
677677   MCFG_MACHINE_RESET_OVERRIDE(hec2hrp_state,hec2hrx)
678678   MCFG_MACHINE_START_OVERRIDE(hec2hrp_state,hec2hrx)
679679
trunk/src/mess/drivers/intv.c
r17997r17998
801801   machine.device("keyboard")->execute().set_input_line(0, CLEAR_LINE);
802802}
803803
804static INTERRUPT_GEN( intv_interrupt2 )
804INTERRUPT_GEN_MEMBER(intv_state::intv_interrupt2)
805805{
806   device->machine().device("keyboard")->execute().set_input_line(0, ASSERT_LINE);
807   device->machine().scheduler().timer_set(device->machine().device<cpu_device>("keyboard")->cycles_to_attotime(100), FUNC(intv_interrupt2_complete));
806   machine().device("keyboard")->execute().set_input_line(0, ASSERT_LINE);
807   machine().scheduler().timer_set(machine().device<cpu_device>("keyboard")->cycles_to_attotime(100), FUNC(intv_interrupt2_complete));
808808}
809809
810810static MACHINE_CONFIG_START( intv, intv_state )
811811   /* basic machine hardware */
812812   MCFG_CPU_ADD("maincpu", CP1610, XTAL_3_579545MHz/4)        /* Colorburst/4 */
813813   MCFG_CPU_PROGRAM_MAP(intv_mem)
814   MCFG_CPU_VBLANK_INT("screen", intv_interrupt)
814   MCFG_CPU_VBLANK_INT_DRIVER("screen", intv_state, intv_interrupt)
815815   MCFG_QUANTUM_TIME(attotime::from_hz(60))
816816
817817
r17997r17998
874874
875875   MCFG_CPU_ADD("keyboard", M6502, XTAL_3_579545MHz/2)   /* Colorburst/2 */
876876   MCFG_CPU_PROGRAM_MAP(intvkbd2_mem)
877   MCFG_CPU_VBLANK_INT("screen", intv_interrupt2)
877   MCFG_CPU_VBLANK_INT_DRIVER("screen", intv_state, intv_interrupt2)
878878
879879   MCFG_QUANTUM_TIME(attotime::from_hz(6000))
880880
trunk/src/mess/drivers/elwro800.c
r17997r17998
5050   DECLARE_READ8_MEMBER(elwro800jr_io_r);
5151   DECLARE_WRITE8_MEMBER(elwro800jr_io_w);
5252   DECLARE_MACHINE_RESET(elwro800);   
53   INTERRUPT_GEN_MEMBER(elwro800jr_interrupt);
5354};
5455
5556
r17997r17998
535536   NULL
536537};
537538
538static INTERRUPT_GEN( elwro800jr_interrupt )
539INTERRUPT_GEN_MEMBER(elwro800_state::elwro800jr_interrupt)
539540{
540   device->execute().set_input_line(0, HOLD_LINE);
541   device.execute().set_input_line(0, HOLD_LINE);
541542}
542543
543544static const floppy_interface elwro800jr_floppy_interface =
r17997r17998
578579   MCFG_CPU_ADD("maincpu",Z80, 3500000)   /* 3.5 MHz */
579580   MCFG_CPU_PROGRAM_MAP(elwro800_mem)
580581   MCFG_CPU_IO_MAP(elwro800_io)
581   MCFG_CPU_VBLANK_INT("screen", elwro800jr_interrupt)
582   MCFG_CPU_VBLANK_INT_DRIVER("screen", elwro800_state, elwro800jr_interrupt)
582583
583584   MCFG_MACHINE_RESET_OVERRIDE(elwro800_state,elwro800)
584585
trunk/src/mess/drivers/pyl601.c
r17997r17998
8282   DECLARE_DRIVER_INIT(pyl601);
8383   virtual void machine_reset();
8484   virtual void video_start();
85   INTERRUPT_GEN_MEMBER(pyl601_interrupt);
8586};
8687
8788
r17997r17998
515516   memset(machine().device<ram_device>(RAM_TAG)->pointer(), 0, 64 * 1024);
516517}
517518
518static INTERRUPT_GEN( pyl601_interrupt )
519INTERRUPT_GEN_MEMBER(pyl601_state::pyl601_interrupt)
519520{
520   pyl601_state *state = device->machine().driver_data<pyl601_state>();
521   state->m_tick50_mark = 0x80;
522   device->execute().set_input_line(0, HOLD_LINE);
521   m_tick50_mark = 0x80;
522   device.execute().set_input_line(0, HOLD_LINE);
523523}
524524
525525static LEGACY_FLOPPY_OPTIONS_START(pyldin)
r17997r17998
583583   /* basic machine hardware */
584584   MCFG_CPU_ADD("maincpu",M6800, XTAL_1MHz)
585585   MCFG_CPU_PROGRAM_MAP(pyl601_mem)
586   MCFG_CPU_VBLANK_INT("screen", pyl601_interrupt)
586   MCFG_CPU_VBLANK_INT_DRIVER("screen", pyl601_state, pyl601_interrupt)
587587
588588
589589   /* video hardware */
trunk/src/mess/drivers/iq151.c
r17997r17998
9595   UINT8 m_cassette_data;
9696   iq151cart_slot_device * m_carts[5];
9797   DECLARE_DRIVER_INIT(iq151);
98   INTERRUPT_GEN_MEMBER(iq151_vblank_interrupt);
9899};
99100
100101READ8_MEMBER(iq151_state::keyboard_row_r)
r17997r17998
319320   m_maincpu->set_input_line(0, state ?  HOLD_LINE : CLEAR_LINE);
320321}
321322
322static INTERRUPT_GEN( iq151_vblank_interrupt )
323INTERRUPT_GEN_MEMBER(iq151_state::iq151_vblank_interrupt)
323324{
324   iq151_state *state = device->machine().driver_data<iq151_state>();
325325
326   pic8259_ir6_w(state->m_pic, state->m_vblank_irq_state & 1);
327   state->m_vblank_irq_state ^= 1;
326   pic8259_ir6_w(m_pic, m_vblank_irq_state & 1);
327   m_vblank_irq_state ^= 1;
328328}
329329
330330static IRQ_CALLBACK(iq151_irq_callback)
r17997r17998
435435   MCFG_CPU_ADD("maincpu",I8080, XTAL_2MHz)
436436   MCFG_CPU_PROGRAM_MAP(iq151_mem)
437437   MCFG_CPU_IO_MAP(iq151_io)
438   MCFG_CPU_VBLANK_INT("screen", iq151_vblank_interrupt)
438   MCFG_CPU_VBLANK_INT_DRIVER("screen", iq151_state, iq151_vblank_interrupt)
439439
440440   /* video hardware */
441441   MCFG_SCREEN_ADD("screen", RASTER)
trunk/src/mess/drivers/h19.c
r17997r17998
397397   MCFG_CPU_ADD("maincpu",Z80, H19_CLOCK) // From schematics
398398   MCFG_CPU_PROGRAM_MAP(h19_mem)
399399   MCFG_CPU_IO_MAP(h19_io)
400   //MCFG_DEVICE_PERIODIC_INT(irq0_line_hold, 50) // for testing, causes a keyboard scan
400   //MCFG_DEVICE_PERIODIC_INT_DRIVER(h19_state, irq0_line_hold, 50) // for testing, causes a keyboard scan
401401
402402   /* video hardware */
403403   MCFG_SCREEN_ADD("screen", RASTER)
trunk/src/mess/drivers/geniusiq.c
r17997r17998
576576   /* basic machine hardware */
577577   MCFG_CPU_ADD("maincpu", M68000, XTAL_32MHz/2) // The main crystal is at 32MHz, not sure whats the CPU freq
578578   MCFG_CPU_PROGRAM_MAP(geniusiq_mem)
579   MCFG_CPU_PERIODIC_INT(irq6_line_hold, 125)   // the internal clock is increased by 1 sec every 125 interrupts
579   MCFG_CPU_PERIODIC_INT_DRIVER(geniusiq_state, irq6_line_hold, 125)   // the internal clock is increased by 1 sec every 125 interrupts
580580
581581   /* video hardware */
582582   MCFG_SCREEN_ADD("screen", RASTER)
trunk/src/mess/drivers/svision.c
r17997r17998
414414   return 0;
415415}
416416
417static INTERRUPT_GEN( svision_frame_int )
417INTERRUPT_GEN_MEMBER(svision_state::svision_frame_int)
418418{
419   svision_state *state = device->machine().driver_data<svision_state>();
420   if (state->BANK&1)
421      device->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
419   if (BANK&1)
420      device.execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
422421
423   svision_sound_decrement(state->m_sound);
422   svision_sound_decrement(m_sound);
424423}
425424
426425DRIVER_INIT_MEMBER(svision_state,svision)
r17997r17998
514513   /* basic machine hardware */
515514   MCFG_CPU_ADD("maincpu", M65C02, 4000000)        /* ? stz used! speed? */
516515   MCFG_CPU_PROGRAM_MAP(svision_mem)
517   MCFG_CPU_VBLANK_INT("screen", svision_frame_int)
516   MCFG_CPU_VBLANK_INT_DRIVER("screen", svision_state, svision_frame_int)
518517
519518
520519   /* video hardware */
trunk/src/mess/drivers/c64.c
r17997r17998
373373//  vic2_interface vic_intf
374374//-------------------------------------------------
375375
376static INTERRUPT_GEN( c64_frame_interrupt )
376INTERRUPT_GEN_MEMBER(c64_state::c64_frame_interrupt)
377377{
378   c64_state *state = device->machine().driver_data<c64_state>();
379378
380   state->check_interrupts();
381   cbm_common_interrupt(device);
379   check_interrupts();
380   cbm_common_interrupt(&device);
382381}
383382
384383WRITE_LINE_MEMBER( c64_state::vic_irq_w )
r17997r17998
991990   MCFG_CPU_ADD(M6510_TAG, M6510, VIC6567_CLOCK)
992991   MCFG_CPU_PROGRAM_MAP(c64_mem)
993992   MCFG_CPU_CONFIG(cpu_intf)
994   MCFG_CPU_VBLANK_INT(SCREEN_TAG, c64_frame_interrupt)
993   MCFG_CPU_VBLANK_INT_DRIVER(SCREEN_TAG, c64_state, c64_frame_interrupt)
995994   MCFG_QUANTUM_PERFECT_CPU(M6510_TAG)
996995
997996   // video hardware
r17997r17998
10901089   MCFG_CPU_ADD(M6510_TAG, M6510, VIC6569_CLOCK)
10911090   MCFG_CPU_PROGRAM_MAP(c64_mem)
10921091   MCFG_CPU_CONFIG(cpu_intf)
1093   MCFG_CPU_VBLANK_INT(SCREEN_TAG, c64_frame_interrupt)
1092   MCFG_CPU_VBLANK_INT_DRIVER(SCREEN_TAG, c64_state, c64_frame_interrupt)
10941093   MCFG_QUANTUM_PERFECT_CPU(M6510_TAG)
10951094
10961095   // video hardware
r17997r17998
11671166   MCFG_CPU_ADD(M6510_TAG, M6510, VIC6569_CLOCK)
11681167   MCFG_CPU_PROGRAM_MAP(c64_mem)
11691168   MCFG_CPU_CONFIG(c64gs_cpu_intf)
1170   MCFG_CPU_VBLANK_INT(SCREEN_TAG, c64_frame_interrupt)
1169   MCFG_CPU_VBLANK_INT_DRIVER(SCREEN_TAG, c64_state, c64_frame_interrupt)
11711170   MCFG_QUANTUM_PERFECT_CPU(M6510_TAG)
11721171
11731172   // video hardware
trunk/src/mess/drivers/vc4000.c
r17997r17998
392392   MCFG_CPU_ADD("maincpu", S2650, 3546875/4)
393393   MCFG_CPU_PROGRAM_MAP(vc4000_mem)
394394   MCFG_CPU_IO_MAP(vc4000_io)
395   MCFG_CPU_PERIODIC_INT(vc4000_video_line, 312*53)   // GOLF needs this exact value
395   MCFG_CPU_PERIODIC_INT_DRIVER(vc4000_state, vc4000_video_line, 312*53)   // GOLF needs this exact value
396396
397397   /* video hardware */
398398   MCFG_SCREEN_ADD("screen", RASTER)
trunk/src/mess/drivers/vic10.c
r17997r17998
202202//  vic2_interface vic_intf
203203//-------------------------------------------------
204204
205static INTERRUPT_GEN( vic10_frame_interrupt )
205INTERRUPT_GEN_MEMBER(vic10_state::vic10_frame_interrupt)
206206{
207   cbm_common_interrupt(device);
207   cbm_common_interrupt(&device);
208208}
209209
210210READ8_MEMBER( vic10_state::vic_lightpen_x_cb )
r17997r17998
614614   MCFG_CPU_ADD(M6510_TAG, M6510, VIC6566_CLOCK)
615615   MCFG_CPU_PROGRAM_MAP(vic10_mem)
616616   MCFG_CPU_CONFIG(cpu_intf)
617   MCFG_CPU_VBLANK_INT(SCREEN_TAG, vic10_frame_interrupt)
617   MCFG_CPU_VBLANK_INT_DRIVER(SCREEN_TAG, vic10_state, vic10_frame_interrupt)
618618   MCFG_QUANTUM_PERFECT_CPU(M6510_TAG)
619619
620620   // video hardware
trunk/src/mess/drivers/pk8020.c
r17997r17998
205205   MCFG_CPU_ADD("maincpu", I8080, XTAL_20MHz / 8)
206206   MCFG_CPU_PROGRAM_MAP(pk8020_mem)
207207   MCFG_CPU_IO_MAP(pk8020_io)
208   MCFG_CPU_VBLANK_INT("screen", pk8020_interrupt)
208   MCFG_CPU_VBLANK_INT_DRIVER("screen", pk8020_state, pk8020_interrupt)
209209
210210
211211   /* video hardware */
trunk/src/mess/drivers/bbc.c
r17997r17998
691691
692692
693693
694static INTERRUPT_GEN( bbcb_vsync )
694INTERRUPT_GEN_MEMBER(bbc_state::bbcb_vsync)
695695{
696   via6522_device *via_0 = device->machine().device<via6522_device>("via6522_0");
696   via6522_device *via_0 = machine().device<via6522_device>("via6522_0");
697697   via_0->write_ca1(1);
698698   via_0->write_ca1(0);
699699}
r17997r17998
841841   /* basic machine hardware */
842842   MCFG_CPU_ADD("maincpu", M6502, 2000000)        /* 2.00 MHz */
843843   MCFG_CPU_PROGRAM_MAP( bbca_mem)
844   MCFG_CPU_VBLANK_INT("screen", bbcb_vsync)      /* screen refresh interrupts */
845   MCFG_CPU_PERIODIC_INT(bbcb_keyscan, 1000)      /* scan keyboard */
844   MCFG_CPU_VBLANK_INT_DRIVER("screen", bbc_state,  bbcb_vsync)      /* screen refresh interrupts */
845   MCFG_CPU_PERIODIC_INT_DRIVER(bbc_state, bbcb_keyscan,  1000)      /* scan keyboard */
846846   MCFG_QUANTUM_TIME(attotime::from_hz(60))
847847
848848   MCFG_MACHINE_START_OVERRIDE(bbc_state, bbca )
r17997r17998
933933   /* basic machine hardware */
934934   MCFG_CPU_ADD("maincpu", M65SC02, 2000000)        /* 2.00 MHz */
935935   MCFG_CPU_PROGRAM_MAP( bbcm_mem)
936   MCFG_CPU_VBLANK_INT("screen", bbcb_vsync)            /* screen refresh interrupts */
937   MCFG_CPU_PERIODIC_INT(bbcm_keyscan, 1000)      /* scan keyboard */
936   MCFG_CPU_VBLANK_INT_DRIVER("screen", bbc_state,  bbcb_vsync)            /* screen refresh interrupts */
937   MCFG_CPU_PERIODIC_INT_DRIVER(bbc_state, bbcm_keyscan,  1000)      /* scan keyboard */
938938   MCFG_QUANTUM_TIME(attotime::from_hz(60))
939939
940940   MCFG_MACHINE_START_OVERRIDE(bbc_state, bbcm )
trunk/src/mess/drivers/alphasma.c
r17997r17998
6666   MCFG_CPU_PROGRAM_MAP(alphasmart_mem)
6767   MCFG_CPU_IO_MAP(alphasmart_io)
6868   MCFG_CPU_CONFIG(alphasmart_hc11_config)
69   MCFG_CPU_PERIODIC_INT(irq0_line_hold, 50)
69   MCFG_CPU_PERIODIC_INT_DRIVER(alphasmart_state, irq0_line_hold, 50)
7070
7171   /* video hardware */
7272   MCFG_SCREEN_ADD("screen", LCD)
trunk/src/mess/drivers/bmjr.c
r17997r17998
347347   /* basic machine hardware */
348348   MCFG_CPU_ADD("maincpu",M6800, XTAL_4MHz/4) //unknown clock / divider
349349   MCFG_CPU_PROGRAM_MAP(bmjr_mem)
350   MCFG_CPU_VBLANK_INT("screen", irq0_line_hold)
350   MCFG_CPU_VBLANK_INT_DRIVER("screen", bmjr_state, irq0_line_hold)
351351
352352
353353   /* video hardware */

Previous 199869 Revisions Next


© 1997-2024 The MAME Team