Previous 199869 Revisions Next

r18138 Tuesday 25th September, 2012 at 13:39:59 UTC by Miodrag Milanović
TIMER_CALLBACK_DEVICE_MEMBER modernization part 1 (no whatsnew)
[src/mame/audio]8080bw.c n8080.c
[src/mame/drivers]1942.c 8080bw.c airbustr.c argus.c astrof.c atarisy1.c balsente.c battlera.c beathead.c beezer.c bionicc.c bishi.c bladestl.c blockout.c bsktball.c btime.c cave.c centiped.c changela.c chqflag.c circus.c cischeat.c cninja.c coolpool.c cosmic.c dambustr.c darkmist.c dbz.c ddragon.c ddragon3.c deadang.c deco32.c deco_mlc.c decocass.c djboy.c dooyong.c dragrace.c dynax.c equites.c espial.c exedexes.c exterm.c fastlane.c finalizr.c foodf.c gaelco2.c gaelco3d.c galaxian.c galaxold.c galpani2.c galpanic.c gberet.c gradius3.c gundealr.c hexion.c higemaru.c hng64.c hyprduel.c ikki.c iqblock.c irobot.c ironhors.c itech8.c jpmimpct.c kaneko16.c konamigx.c lastduel.c lazercmd.c m107.c m92.c mcr.c mcr3.c megasys1.c mhavoc.c mitchell.c model1.c model2.c model3.c mrflea.c ms32.c mw8080bw.c mystwarr.c n8080.c namcofl.c namcona1.c namconb1.c namcos22.c nemesis.c nitedrvr.c nmk16.c orbit.c overdriv.c pgm.c pingpong.c polepos.c polyplay.c psychic5.c qdrmfgp.c renegade.c scobra.c scramble.c segahang.c segas24.c segas32.c seta.c seta2.c shadfrce.c shaolins.c snk6502.c snowbros.c spdodgeb.c sprcros2.c sprint8.c srumbler.c ssv.c st0016.c strnskil.c suna16.c suna8.c suprnova.c system1.c taito_l.c taito_o.c targeth.c thedeep.c vball.c wecleman.c williams.c wwfsstar.c wwfwfest.c xain.c xexex.c xmen.c zodiack.c
[src/mame/includes]1942.h 8080bw.h airbustr.h argus.h astrof.h atarisy1.h balsente.h battlera.h beathead.h beezer.h bionicc.h bishi.h bladestl.h blockout.h bsktball.h btime.h cave.h centiped.h changela.h chqflag.h circus.h cischeat.h cninja.h coolpool.h cosmic.h darkmist.h dbz.h ddragon.h ddragon3.h deadang.h deco32.h deco_mlc.h decocass.h djboy.h dooyong.h dragrace.h dynax.h equites.h espial.h exedexes.h exterm.h fastlane.h finalizr.h foodf.h gaelco2.h gaelco3d.h galaxian.h galaxold.h galpani2.h galpanic.h gberet.h gradius3.h gundealr.h hexion.h higemaru.h hng64.h hyprduel.h ikki.h iqblock.h irobot.h ironhors.h itech8.h jpmimpct.h kaneko16.h konamigx.h lastduel.h lazercmd.h m107.h m92.h mcr.h megasys1.h mhavoc.h mitchell.h model1.h model2.h model3.h mrflea.h ms32.h mw8080bw.h mystwarr.h n8080.h namcofl.h namcona1.h namconb1.h namcos22.h nemesis.h nitedrvr.h nmk16.h orbit.h overdriv.h pgm.h pingpong.h polepos.h polyplay.h psychic5.h qdrmfgp.h renegade.h segahang.h segas24.h segas32.h seta.h seta2.h shadfrce.h shaolins.h snk6502.h snowbros.h spdodgeb.h sprcros2.h sprint8.h srumbler.h ssv.h st0016.h strnskil.h suna16.h suna8.h suprnova.h system1.h taito_l.h taito_o.h targeth.h thedeep.h vball.h wecleman.h williams.h wwfsstar.h wwfwfest.h xain.h xexex.h xmen.h zodiack.h
[src/mame/machine]balsente.c bsktball.c decocass.c gaelco2.c galaxold.c irobot.c mcr.c mhavoc.c nitedrvr.c williams.c
[src/mame/video]atarisy1.c battlera.c beezer.c galaxian.c itech8.c spdodgeb.c
[src/mess/drivers]a7800.c ace.c adam.c amstr_pc.c apple2.c apple2gs.c atom.c avigo.c bullet.c busicom.c bw12.c coleco.c cosmicos.c einstein.c fidelz80.c huebler.c kc.c kyocera.c mc1000.c mc80.c mikromik.c mpf1.c msx.c mtx.c mz700.c mz80.c nc.c newbrain.c pc.c pc8401a.c pcw.c pcw16.c portfoli.c psion.c super6.c svision.c tek405x.c ti89.c tiki100.c trs80m2.c v1050.c vcs80.c vixen.c x07.c x1.c x1twin.c xerox820.c
[src/mess/includes]a7800.h ace.h adam.h apple2.h atom.h avigo.h bullet.h busicom.h bw12.h cgc7900.h coleco.h cosmicos.h einstein.h fidelz80.h huebler.h kc.h kyocera.h mc1000.h mc80.h mikromik.h mpf1.h msx.h mtx.h mz700.h mz80.h nc.h newbrain.h pc.h pc8401a.h pcw.h pcw16.h portfoli.h psion.h super6.h svision.h tek405x.h ti89.h tiki100.h tmc600.h trs80m2.h v1050.h vcs80.h vixen.h x07.h x1.h xerox820.h
[src/mess/machine]apple2.c kc.c msx.c pc.c
[src/mess/video]a7800.c cgc7900.c tmc600.c

trunk/src/mess/machine/msx.c
r18137r18138
524524   z80_set_cycle_tables( machine().device("maincpu"), cc_op, cc_cb, cc_ed, cc_xy, cc_xycb, cc_ex );
525525}
526526
527TIMER_DEVICE_CALLBACK( msx2_interrupt )
527TIMER_DEVICE_CALLBACK_MEMBER(msx_state::msx2_interrupt)
528528{
529   msx_state *state = timer.machine().driver_data<msx_state>();
530   state->m_v9938->set_sprite_limit(timer.machine().root_device().ioport("DSW")->read() & 0x20);
531   state->m_v9938->set_resolution(timer.machine().root_device().ioport("DSW")->read() & 0x03);
532   state->m_v9938->interrupt();
529   m_v9938->set_sprite_limit(machine().root_device().ioport("DSW")->read() & 0x20);
530   m_v9938->set_resolution(machine().root_device().ioport("DSW")->read() & 0x03);
531   m_v9938->interrupt();
533532}
534533
535534INTERRUPT_GEN_MEMBER(msx_state::msx_interrupt)
trunk/src/mess/machine/kc.c
r18137r18138
718718
719719}
720720
721TIMER_DEVICE_CALLBACK( kc_scanline )
721TIMER_DEVICE_CALLBACK_MEMBER(kc_state::kc_scanline)
722722{
723   kc_state *state = timer.machine().driver_data<kc_state>();
724723   int scanline = (int)param;
725724
726725   /* set clock input for channel 0 and 1 to ctc */
727   state->m_z80ctc->trg0(1);
728   state->m_z80ctc->trg0(0);
729   state->m_z80ctc->trg1(1);
730   state->m_z80ctc->trg1(0);
726   m_z80ctc->trg0(1);
727   m_z80ctc->trg0(0);
728   m_z80ctc->trg1(1);
729   m_z80ctc->trg1(0);
731730
732731   if (scanline == 256)
733732   {
734733      /* set clock input for channel 2 and 3 to ctc */
735      state->m_z80ctc->trg2(1);
736      state->m_z80ctc->trg2(0);
737      state->m_z80ctc->trg3(1);
738      state->m_z80ctc->trg3(0);
734      m_z80ctc->trg2(1);
735      m_z80ctc->trg2(0);
736      m_z80ctc->trg3(1);
737      m_z80ctc->trg3(0);
739738   }
740739}
741740
trunk/src/mess/machine/apple2.c
r18137r18138
12131213 * Apple II interrupt; used to force partial updates
12141214 * ----------------------------------------------------------------------- */
12151215
1216TIMER_DEVICE_CALLBACK( apple2_interrupt )
1216TIMER_DEVICE_CALLBACK_MEMBER(apple2_state::apple2_interrupt)
12171217{
12181218   int scanline = param;
12191219
12201220   if((scanline % 8) == 0)
1221      timer.machine().primary_screen->update_partial(timer.machine().primary_screen->vpos());
1221      machine().primary_screen->update_partial(machine().primary_screen->vpos());
12221222}
12231223
12241224
trunk/src/mess/machine/pc.c
r18137r18138
15881588 *
15891589 **************************************************************************/
15901590
1591TIMER_DEVICE_CALLBACK( pc_frame_interrupt )
1591TIMER_DEVICE_CALLBACK_MEMBER(pc_state::pc_frame_interrupt)
15921592{
15931593   int scanline = param;
15941594
r18137r18138
15961596      pc_keyboard();
15971597}
15981598
1599TIMER_DEVICE_CALLBACK( pc_vga_frame_interrupt )
1599TIMER_DEVICE_CALLBACK_MEMBER(pc_state::pc_vga_frame_interrupt)
16001600{
16011601   int scanline = param;
16021602
r18137r18138
16071607   }
16081608}
16091609
1610TIMER_DEVICE_CALLBACK( pcjr_frame_interrupt )
1610TIMER_DEVICE_CALLBACK_MEMBER(pc_state::pcjr_frame_interrupt)
16111611{
16121612   int scanline = param;
16131613
trunk/src/mess/includes/a7800.h
r18137r18138
6666   virtual void palette_init();
6767   DECLARE_PALETTE_INIT(a7800p);
6868   UINT32 screen_update_a7800(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
69   TIMER_DEVICE_CALLBACK_MEMBER(a7800_interrupt);
6970};
7071
71
72/*----------- defined in video/a7800.c -----------*/
73
74TIMER_DEVICE_CALLBACK( a7800_interrupt );
75
7672/*----------- defined in machine/a7800.c -----------*/
7773
7874extern const riot6532_interface a7800_r6532_interface;
trunk/src/mess/includes/pc.h
r18137r18138
9090   TIMER_CALLBACK_MEMBER(pcjr_keyb_signal_callback);
9191   TIMER_CALLBACK_MEMBER(mc1502_keyb_signal_callback);
9292   TIMER_CALLBACK_MEMBER(pc_rtc_timer);
93   TIMER_DEVICE_CALLBACK_MEMBER(pc_frame_interrupt);
94   TIMER_DEVICE_CALLBACK_MEMBER(pc_vga_frame_interrupt);
95   TIMER_DEVICE_CALLBACK_MEMBER(pcjr_frame_interrupt);
9396};
9497
9598/*----------- defined in machine/pc.c -----------*/
r18137r18138
124127
125128DEVICE_IMAGE_LOAD( pcjr_cartridge );
126129
127TIMER_DEVICE_CALLBACK( pc_frame_interrupt );
128TIMER_DEVICE_CALLBACK( pc_vga_frame_interrupt );
129TIMER_DEVICE_CALLBACK( pcjr_frame_interrupt );
130TIMER_DEVICE_CALLBACK( null_frame_interrupt );
131
132
133130void pc_rtc_init(running_machine &machine);
134131
135132
trunk/src/mess/includes/mpf1.h
r18137r18138
5656   emu_timer *m_led_refresh_timer;
5757   DECLARE_DRIVER_INIT(mpf1);
5858   TIMER_CALLBACK_MEMBER(led_refresh);
59   TIMER_DEVICE_CALLBACK_MEMBER(check_halt_callback);
5960};
6061
6162#endif
trunk/src/mess/includes/mikromik.h
r18137r18138
113113   int m_dack3;
114114   int m_tc;
115115   UINT32 screen_update_mm1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
116   TIMER_DEVICE_CALLBACK_MEMBER(kbclk_tick);
116117};
117118
118119
trunk/src/mess/includes/kc.h
r18137r18138
148148   DECLARE_PALETTE_INIT(kc85);
149149   TIMER_CALLBACK_MEMBER(kc_cassette_oneshot_timer);
150150   TIMER_CALLBACK_MEMBER(kc_cassette_timer_callback);
151   TIMER_DEVICE_CALLBACK_MEMBER(kc_scanline);
151152};
152153
153154
r18137r18138
185186/*----------- defined in machine/kc.c -----------*/
186187
187188QUICKLOAD_LOAD( kc );
188TIMER_DEVICE_CALLBACK( kc_scanline );
189189
190190#endif /* KC_H_ */
trunk/src/mess/includes/portfoli.h
r18137r18138
8585   /* peripheral state */
8686   UINT8 m_pid;                  /* peripheral identification */
8787   virtual void palette_init();
88   TIMER_DEVICE_CALLBACK_MEMBER(keyboard_tick);
89   TIMER_DEVICE_CALLBACK_MEMBER(system_tick);
90   TIMER_DEVICE_CALLBACK_MEMBER(counter_tick);
8891};
8992
9093#endif
trunk/src/mess/includes/atom.h
r18137r18138
8989
9090   /* devices */
9191   int m_previous_i8271_int_state;
92   TIMER_DEVICE_CALLBACK_MEMBER(cassette_output_tick);
9293};
9394
9495class atomeb_state : public atom_state
trunk/src/mess/includes/avigo.h
r18137r18138
105105   UINT8            m_warm_start;
106106   UINT8 *          m_ram_base;
107107   virtual void palette_init();
108   TIMER_DEVICE_CALLBACK_MEMBER(avigo_scan_timer);
109   TIMER_DEVICE_CALLBACK_MEMBER(avigo_1hz_timer);
108110};
109111#endif /* AVIGO_H_ */
trunk/src/mess/includes/msx.h
r18137r18138
125125   DECLARE_MACHINE_START(msx2);
126126   DECLARE_MACHINE_RESET(msx2);
127127   INTERRUPT_GEN_MEMBER(msx_interrupt);
128   TIMER_DEVICE_CALLBACK_MEMBER(msx2_interrupt);
128129};
129130
130131
r18137r18138
133134extern const i8255_interface msx_ppi8255_interface;
134135extern const wd17xx_interface msx_wd17xx_interface;
135136/* start/stop functions */
136extern TIMER_DEVICE_CALLBACK( msx2_interrupt );
137137
138138DEVICE_IMAGE_LOAD( msx_cart );
139139DEVICE_IMAGE_UNLOAD( msx_cart );
trunk/src/mess/includes/ace.h
r18137r18138
5858   required_shared_ptr<UINT8> m_video_ram;
5959   required_shared_ptr<UINT8> m_char_ram;
6060   UINT32 screen_update_ace(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
61   TIMER_DEVICE_CALLBACK_MEMBER(set_irq);
62   TIMER_DEVICE_CALLBACK_MEMBER(clear_irq);
6163};
6264
6365#endif /* ACE_H_ */
trunk/src/mess/includes/nc.h
r18137r18138
8282   UINT32 screen_update_nc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
8383   TIMER_CALLBACK_MEMBER(nc_keyboard_timer_callback);
8484   TIMER_CALLBACK_MEMBER(nc_serial_timer_callback);
85   TIMER_DEVICE_CALLBACK_MEMBER(dummy_timer_callback);
8586};
8687
8788
trunk/src/mess/includes/mc1000.h
r18137r18138
7979   required_shared_ptr<UINT8> m_mc6847_video_ram;
8080   UINT8 m_mc6847_attr;
8181   DECLARE_DRIVER_INIT(mc1000);
82   TIMER_DEVICE_CALLBACK_MEMBER(ne555_tick);
8283};
8384
8485#endif
trunk/src/mess/includes/vcs80.h
r18137r18138
3636   int m_keylatch;
3737   int m_keyclk;
3838   DECLARE_DRIVER_INIT(vcs80);
39   TIMER_DEVICE_CALLBACK_MEMBER(vcs80_keyboard_tick);
3940};
4041
4142#endif
trunk/src/mess/includes/newbrain.h
r18137r18138
158158   int m_copbytes;
159159   int m_copregint;
160160   INTERRUPT_GEN_MEMBER(newbrain_interrupt);
161   TIMER_DEVICE_CALLBACK_MEMBER(cop_regint_tick);
161162};
162163
163164class newbrain_eim_state : public newbrain_state
r18137r18138
206207   DECLARE_WRITE_LINE_MEMBER( ctc_z2_w );
207208   DECLARE_WRITE_LINE_MEMBER( adc_eoc_w );
208209
210   TIMER_DEVICE_CALLBACK_MEMBER(ctc_c2_tick);
211
209212   void bankswitch();
210213
211214   // paging state
trunk/src/mess/includes/einstein.h
r18137r18138
8383   DECLARE_MACHINE_START(einstein2);
8484   DECLARE_MACHINE_RESET(einstein2);
8585   UINT32 screen_update_einstein2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
86   TIMER_DEVICE_CALLBACK_MEMBER(einstein_keyboard_timer_callback);
87   TIMER_DEVICE_CALLBACK_MEMBER(einstein_ctc_trigger_callback);
8688};
8789
8890
trunk/src/mess/includes/fidelz80.h
r18137r18138
6565   DECLARE_WRITE8_MEMBER(vsc_pio_portb_w);
6666   DECLARE_INPUT_CHANGED_MEMBER(fidelz80_trigger_reset);
6767   DECLARE_INPUT_CHANGED_MEMBER(abc_trigger_reset);
68   TIMER_DEVICE_CALLBACK_MEMBER(nmi_timer);
6869};
6970
7071
trunk/src/mess/includes/psion.h
r18137r18138
8686   DECLARE_READ8_MEMBER( io_r );
8787   virtual void palette_init();
8888   DECLARE_INPUT_CHANGED_MEMBER(psion_on);
89   TIMER_DEVICE_CALLBACK_MEMBER(nmi_timer);
8990};
9091
9192// device type definition
trunk/src/mess/includes/x1.h
r18137r18138
203203   DECLARE_INPUT_CHANGED_MEMBER(ipl_reset);
204204   DECLARE_INPUT_CHANGED_MEMBER(nmi_reset);
205205   TIMER_CALLBACK_MEMBER(x1_rtc_increment);
206   TIMER_DEVICE_CALLBACK_MEMBER(x1_cmt_wind_timer);
207   TIMER_DEVICE_CALLBACK_MEMBER(x1_keyboard_callback);
206208};
207209
208
209/*----------- shared with x1twin.c -----------*/
210
211TIMER_DEVICE_CALLBACK(x1_keyboard_callback);
212TIMER_DEVICE_CALLBACK( x1_cmt_wind_timer );
213
214210/*----------- defined in machine/x1.c -----------*/
215211
216212extern const device_type X1_KEYBOARD;
trunk/src/mess/includes/pcw.h
r18137r18138
105105   TIMER_CALLBACK_MEMBER(pcw_stepper_callback);
106106   TIMER_CALLBACK_MEMBER(pcw_pins_callback);
107107   TIMER_CALLBACK_MEMBER(setup_beep);
108   TIMER_DEVICE_CALLBACK_MEMBER(pcw_timer_interrupt);
108109};
109110
110111#endif /* PCW_H_ */
trunk/src/mess/includes/vixen.h
r18137r18138
105105   const UINT8 *m_char_rom;
106106   DECLARE_DRIVER_INIT(vixen);
107107   UINT32 screen_update_vixen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
108   TIMER_DEVICE_CALLBACK_MEMBER(vsync_tick);
108109};
109110
110111#endif
trunk/src/mess/includes/mz80.h
r18137r18138
5757   UINT32 screen_update_mz80k(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5858   UINT32 screen_update_mz80kj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5959   UINT32 screen_update_mz80a(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
60   TIMER_DEVICE_CALLBACK_MEMBER(ne555_tempo_callback);
6061};
6162
6263
trunk/src/mess/includes/tmc600.h
r18137r18138
6666
6767   // keyboard state
6868   int m_keylatch;            // key latch
69   TIMER_DEVICE_CALLBACK_MEMBER(blink_tick);
6970};
7071
7172// ---------- defined in video/tmc600.c ----------
trunk/src/mess/includes/cgc7900.h
r18137r18138
8989   required_shared_ptr<UINT16> m_roll_overlay;
9090   int m_blink;
9191   UINT32 screen_update_cgc7900(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
92   TIMER_DEVICE_CALLBACK_MEMBER(blink_tick);
9293};
9394
9495/*----------- defined in video/cgc7900.c -----------*/
trunk/src/mess/includes/ti89.h
r18137r18138
6363   UINT64 m_timer;
6464   virtual void palette_init();
6565   DECLARE_INPUT_CHANGED_MEMBER(ti68k_on_key);
66   TIMER_DEVICE_CALLBACK_MEMBER(ti68k_timer_callback);
6667};
6768
6869#endif // TI89_H_
trunk/src/mess/includes/xerox820.h
r18137r18138
8383   int m_8n5;                     /* 5.25" / 8" drive select */
8484   int m_dsdd;                     /* double sided disk detect */
8585   TIMER_CALLBACK_MEMBER(bigboard_beepoff);
86   TIMER_DEVICE_CALLBACK_MEMBER(xerox820_keyboard_tick);
87   TIMER_DEVICE_CALLBACK_MEMBER(ctc_tick);
8688};
8789
8890class xerox820ii_state : public xerox820_state
trunk/src/mess/includes/tek405x.h
r18137r18138
124124
125125   // GPIB
126126   int m_talk;
127   TIMER_DEVICE_CALLBACK_MEMBER(keyboard_tick);
127128};
128129
129130class tek4052_state : public driver_device
trunk/src/mess/includes/mtx.h
r18137r18138
5858   DECLARE_WRITE8_MEMBER(hrx_attr_w);
5959   DECLARE_MACHINE_START(mtx512);
6060   DECLARE_MACHINE_RESET(mtx512);
61   TIMER_DEVICE_CALLBACK_MEMBER(ctc_tick);
62   TIMER_DEVICE_CALLBACK_MEMBER(cassette_tick);
6163};
6264
6365/*----------- defined in machine/mtx.c -----------*/
trunk/src/mess/includes/cosmicos.h
r18137r18138
121121   int m_efx;
122122   int m_video_on;
123123   DECLARE_DRIVER_INIT(cosmicos);
124   TIMER_DEVICE_CALLBACK_MEMBER(digit_tick);
125   TIMER_DEVICE_CALLBACK_MEMBER(int_tick);
124126};
125127
126128#endif
trunk/src/mess/includes/kyocera.h
r18137r18138
190190
191191   DECLARE_PALETTE_INIT(tandy200);
192192
193   TIMER_DEVICE_CALLBACK_MEMBER(tandy200_tp_tick);
194
193195   void bankswitch(UINT8 data);
194196
195197   /* memory state */
trunk/src/mess/includes/pcw16.h
r18137r18138
9898   virtual void video_start();
9999   virtual void palette_init();
100100   UINT32 screen_update_pcw16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
101   TIMER_DEVICE_CALLBACK_MEMBER(pcw16_timer_callback);
102   TIMER_DEVICE_CALLBACK_MEMBER(pcw16_keyboard_timer_callback);
103   TIMER_DEVICE_CALLBACK_MEMBER(rtc_timer_callback);
101104};
102105
103106#endif /* PCW16_H_ */
trunk/src/mess/includes/coleco.h
r18137r18138
4646   TIMER_CALLBACK_MEMBER(paddle_d7reset_callback);
4747   TIMER_CALLBACK_MEMBER(paddle_irqreset_callback);
4848   TIMER_CALLBACK_MEMBER(paddle_pulse_callback);
49   TIMER_DEVICE_CALLBACK_MEMBER(paddle_update_callback);
4950};
5051
5152#endif
trunk/src/mess/includes/mz700.h
r18137r18138
8181   DECLARE_VIDEO_START(mz800);
8282   UINT32 screen_update_mz700(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
8383   UINT32 screen_update_mz800(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
84   TIMER_DEVICE_CALLBACK_MEMBER(ne556_cursor_callback);
85   TIMER_DEVICE_CALLBACK_MEMBER(ne556_other_callback);
8486};
8587
8688
trunk/src/mess/includes/tiki100.h
r18137r18138
7979
8080   /* keyboard state */
8181   int m_keylatch;
82   TIMER_DEVICE_CALLBACK_MEMBER(ctc_tick);
8283};
8384
8485#endif
trunk/src/mess/includes/svision.h
r18137r18138
5959   INTERRUPT_GEN_MEMBER(svision_frame_int);
6060   TIMER_CALLBACK_MEMBER(svision_pet_timer);
6161   TIMER_CALLBACK_MEMBER(svision_timer);
62   TIMER_DEVICE_CALLBACK_MEMBER(svision_pet_timer_dev);
6263};
6364
6465
trunk/src/mess/includes/busicom.h
r18137r18138
3131   virtual void video_start();
3232   virtual void palette_init();
3333   UINT32 screen_update_busicom(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
34   TIMER_DEVICE_CALLBACK_MEMBER(timer_callback);
3435};
3536
3637#endif /* BUSICOM_H_ */
trunk/src/mess/includes/adam.h
r18137r18138
126126   int m_wr0;
127127   int m_wr1;
128128   int m_track;
129   TIMER_DEVICE_CALLBACK_MEMBER(paddle_tick);
129130};
130131
131132#endif
trunk/src/mess/includes/mc80.h
r18137r18138
4444   DECLARE_VIDEO_START(mc8030);
4545   UINT32 screen_update_mc8020(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4646   UINT32 screen_update_mc8030(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
47   TIMER_DEVICE_CALLBACK_MEMBER(mc8020_kbd);
4748};
4849
4950
trunk/src/mess/includes/bw12.h
r18137r18138
8989   int m_motor_on;
9090   int m_motor0;
9191   int m_motor1;
92   TIMER_DEVICE_CALLBACK_MEMBER(floppy_motor_off_tick);
9293};
9394
9495#endif
trunk/src/mess/includes/x07.h
r18137r18138
265265   TIMER_CALLBACK_MEMBER(rsta_clear);
266266   TIMER_CALLBACK_MEMBER(rstb_clear);
267267   TIMER_CALLBACK_MEMBER(beep_stop);
268   TIMER_DEVICE_CALLBACK_MEMBER(blink_timer);
268269};
trunk/src/mess/includes/huebler.h
r18137r18138
5151   // video state
5252   required_shared_ptr<UINT8> m_video_ram;
5353   const UINT8 *m_char_rom;
54   TIMER_DEVICE_CALLBACK_MEMBER(keyboard_tick);
5455};
5556
5657#endif
trunk/src/mess/includes/bullet.h
r18137r18138
9393   int m_winrdy;
9494   int m_exrdy1;
9595   int m_exrdy2;
96   TIMER_DEVICE_CALLBACK_MEMBER(ctc_tick);
9697};
9798
9899class bulletf_state : public bullet_state
trunk/src/mess/includes/v1050.h
r18137r18138
157157   required_shared_ptr<UINT8> m_video_ram;          // video RAM
158158   UINT8 *m_attr_ram;         // attribute RAM
159159   UINT8 m_attr;            // attribute latch
160   TIMER_DEVICE_CALLBACK_MEMBER(v1050_keyboard_tick);
161   TIMER_DEVICE_CALLBACK_MEMBER(sasi_ack_tick);
162   TIMER_DEVICE_CALLBACK_MEMBER(sasi_rst_tick);
163   TIMER_DEVICE_CALLBACK_MEMBER(kb_8251_tick);
164   TIMER_DEVICE_CALLBACK_MEMBER(sio_8251_tick);
160165};
161166
162167//----------- defined in video/v1050.c -----------
trunk/src/mess/includes/trs80m2.h
r18137r18138
110110   int m_de;
111111   int m_rtc_int;
112112   int m_enable_rtc_int;
113   TIMER_DEVICE_CALLBACK_MEMBER(trs80m2_keyboard_tick);
114   TIMER_DEVICE_CALLBACK_MEMBER(ctc_tick);
113115};
114116
115117class trs80m16_state : public trs80m2_state
trunk/src/mess/includes/pc8401a.h
r18137r18138
8080   UINT8 *m_crt_ram;         // CRT video RAM
8181
8282   UINT8 m_key_latch;
83   TIMER_DEVICE_CALLBACK_MEMBER(pc8401a_keyboard_tick);
8384};
8485
8586class pc8500_state : public pc8401a_state
trunk/src/mess/includes/apple2.h
r18137r18138
242242   DECLARE_MACHINE_START(laser128);
243243   DECLARE_MACHINE_START(space84);
244244   UINT32 screen_update_apple2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
245   TIMER_DEVICE_CALLBACK_MEMBER(apple2_interrupt);
245246};
246247
247248
r18137r18138
270271DECLARE_READ8_HANDLER( apple2_c080_r );
271272DECLARE_WRITE8_HANDLER( apple2_c080_w );
272273
273TIMER_DEVICE_CALLBACK( apple2_interrupt );
274
275274INT8 apple2_slotram_r(running_machine &machine, int slotnum, int offset);
276275
277276void apple2_setvar(running_machine &machine, UINT32 val, UINT32 mask);
trunk/src/mess/includes/super6.h
r18137r18138
7777   UINT8 m_s100;
7878   UINT8 m_bank0;
7979   UINT8 m_bank1;
80   TIMER_DEVICE_CALLBACK_MEMBER(ctc_tick);
8081};
8182
8283#endif
trunk/src/mess/video/cgc7900.c
r18137r18138
173173    TIMER_DEVICE_CALLBACK( blink_tick )
174174-------------------------------------------------*/
175175
176static TIMER_DEVICE_CALLBACK( blink_tick )
176TIMER_DEVICE_CALLBACK_MEMBER(cgc7900_state::blink_tick)
177177{
178   cgc7900_state *state = timer.machine().driver_data<cgc7900_state>();
179
180   state->m_blink = !state->m_blink;
178   m_blink = !m_blink;
181179}
182180
183181/*-------------------------------------------------
r18137r18138
244242
245243   MCFG_GFXDECODE(cgc7900)
246244
247   MCFG_TIMER_ADD_PERIODIC("blink", blink_tick, attotime::from_hz(XTAL_28_48MHz/7500000))
245   MCFG_TIMER_DRIVER_ADD_PERIODIC("blink", cgc7900_state, blink_tick, attotime::from_hz(XTAL_28_48MHz/7500000))
248246MACHINE_CONFIG_END
trunk/src/mess/video/a7800.c
r18137r18138
316316}
317317
318318
319TIMER_DEVICE_CALLBACK( a7800_interrupt )
319TIMER_DEVICE_CALLBACK_MEMBER(a7800_state::a7800_interrupt)
320320{
321   a7800_state *state = timer.machine().driver_data<a7800_state>();
322321   int frame_scanline;
323   UINT8 *ROM = timer.machine().root_device().memregion("maincpu")->base();
324   address_space& space = timer.machine().device("maincpu")->memory().space(AS_PROGRAM);
322   UINT8 *ROM = machine().root_device().memregion("maincpu")->base();
323   address_space& space = machine().device("maincpu")->memory().space(AS_PROGRAM);
325324
326   state->m_maria_scanline++;
325   m_maria_scanline++;
327326
328327   /* why + 1? */
329   frame_scanline = state->m_maria_scanline % ( state->m_lines + 1 );
328   frame_scanline = m_maria_scanline % ( m_lines + 1 );
330329
331330   if( frame_scanline == 1 )
332331   {
333332      /*logerror( "frame beg\n" );*/
334333   }
335334
336   if( state->m_maria_wsync )
335   if( m_maria_wsync )
337336   {
338      timer.machine().scheduler().trigger( TRIGGER_HSYNC );
339      state->m_maria_wsync = 0;
337      machine().scheduler().trigger( TRIGGER_HSYNC );
338      m_maria_wsync = 0;
340339   }
341340
342341   if( frame_scanline == 16 )
343342   {
344343      /* end of vblank */
345344
346      state->m_maria_vblank=0;
347      if( state->m_maria_dmaon || state->m_maria_dodma )
345      m_maria_vblank=0;
346      if( m_maria_dmaon || m_maria_dodma )
348347      {
349         state->m_maria_dodma = 1;   /* if dma allowed, start it */
348         m_maria_dodma = 1;   /* if dma allowed, start it */
350349
351         state->m_maria_dll = (ROM[DPPH] << 8) | ROM[DPPL];
352         state->m_maria_dl = (READ_MEM(state->m_maria_dll+1) << 8) | READ_MEM(state->m_maria_dll+2);
353         state->m_maria_offset = READ_MEM(state->m_maria_dll) & 0x0f;
354         state->m_maria_holey = (READ_MEM(state->m_maria_dll) & 0x60) >> 5;
355         state->m_maria_dli = READ_MEM(state->m_maria_dll) & 0x80;
356         /*  logerror("DLL=%x\n",state->m_maria_dll); */
357         /*  logerror("DLL: DL = %x  dllctrl = %x\n",state->m_maria_dl,ROM[state->m_maria_dll]); */
350         m_maria_dll = (ROM[DPPH] << 8) | ROM[DPPL];
351         m_maria_dl = (READ_MEM(m_maria_dll+1) << 8) | READ_MEM(m_maria_dll+2);
352         m_maria_offset = READ_MEM(m_maria_dll) & 0x0f;
353         m_maria_holey = (READ_MEM(m_maria_dll) & 0x60) >> 5;
354         m_maria_dli = READ_MEM(m_maria_dll) & 0x80;
355         /*  logerror("DLL=%x\n",m_maria_dll); */
356         /*  logerror("DLL: DL = %x  dllctrl = %x\n",m_maria_dl,ROM[m_maria_dll]); */
358357      }
359358
360359      /*logerror( "vblank end on line %d\n", frame_scanline );*/
r18137r18138
364363        this fix made PR Baseball happy
365364        Kung-Fu Master looks worse
366365        don't know about others yet */
367   if( frame_scanline == ( state->m_lines - 4 ) )
366   if( frame_scanline == ( m_lines - 4 ) )
368367   {
369368      /* vblank starts 4 scanlines before end of screen */
370369
371      state->m_maria_vblank = 0x80;
370      m_maria_vblank = 0x80;
372371
373372      /* fixed 2002/05/14 kubecj
374373                when going vblank, dma must be stopped
r18137r18138
385384                Jinks
386385        */
387386
388      state->m_maria_dodma = 0;
387      m_maria_dodma = 0;
389388      /*logerror( "vblank on line %d\n\n", frame_scanline );*/
390389   }
391390
392391
393   if( ( frame_scanline > 15 ) && state->m_maria_dodma )
392   if( ( frame_scanline > 15 ) && m_maria_dodma )
394393   {
395      if (state->m_maria_scanline < ( state->m_lines - 4 ) )
396         maria_draw_scanline(timer.machine());
394      if (m_maria_scanline < ( m_lines - 4 ) )
395         maria_draw_scanline(machine());
397396
398      if( state->m_maria_offset == 0 )
397      if( m_maria_offset == 0 )
399398      {
400         state->m_maria_dll+=3;
401         state->m_maria_dl = (READ_MEM(state->m_maria_dll+1) << 8) | READ_MEM(state->m_maria_dll+2);
402         state->m_maria_offset = READ_MEM(state->m_maria_dll) & 0x0f;
403         state->m_maria_holey = (READ_MEM(state->m_maria_dll) & 0x60) >> 5;
404         state->m_maria_dli = READ_MEM(state->m_maria_dll) & 0x80;
399         m_maria_dll+=3;
400         m_maria_dl = (READ_MEM(m_maria_dll+1) << 8) | READ_MEM(m_maria_dll+2);
401         m_maria_offset = READ_MEM(m_maria_dll) & 0x0f;
402         m_maria_holey = (READ_MEM(m_maria_dll) & 0x60) >> 5;
403         m_maria_dli = READ_MEM(m_maria_dll) & 0x80;
405404      }
406405      else
407406      {
408         state->m_maria_offset--;
407         m_maria_offset--;
409408      }
410409   }
411410
412   if( state->m_maria_dli )
411   if( m_maria_dli )
413412   {
414413      /*logerror( "dli on line %d [%02X] [%02X] [%02X]\n", frame_scanline, ROM[0x7E], ROM[0x7C], ROM[0x7D] );*/
415414   }
416415
417   if( state->m_maria_dli )
416   if( m_maria_dli )
418417   {
419      state->m_maria_dli = 0;
420      state->m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
418      m_maria_dli = 0;
419      m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
421420   }
422421
423422}
trunk/src/mess/video/tmc600.c
r18137r18138
4343   }
4444}
4545
46static TIMER_DEVICE_CALLBACK( blink_tick )
46TIMER_DEVICE_CALLBACK_MEMBER(tmc600_state::blink_tick)
4747{
48   tmc600_state *state = timer.machine().driver_data<tmc600_state>();
49
50   state->m_blink = !state->m_blink;
48   m_blink = !m_blink;
5149}
5250
5351UINT8 tmc600_state::get_color(UINT16 pma)
r18137r18138
146144MACHINE_CONFIG_FRAGMENT( tmc600_video )
147145   // video hardware
148146   MCFG_CDP1869_SCREEN_PAL_ADD(CDP1869_TAG, SCREEN_TAG, CDP1869_DOT_CLK_PAL)
149   MCFG_TIMER_ADD_PERIODIC("blink", blink_tick, attotime::from_hz(2))
147   MCFG_TIMER_DRIVER_ADD_PERIODIC("blink", tmc600_state, blink_tick, attotime::from_hz(2))
150148   MCFG_GFXDECODE(tmc600)
151149
152150   // sound hardware
trunk/src/mess/drivers/psion.c
r18137r18138
2222#include "includes/psion.h"
2323#include "rendlay.h"
2424
25static TIMER_DEVICE_CALLBACK( nmi_timer )
25TIMER_DEVICE_CALLBACK_MEMBER(psion_state::nmi_timer)
2626{
27   psion_state *state = timer.machine().driver_data<psion_state>();
28
29   if (state->m_enable_nmi)
30      timer.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
27   if (m_enable_nmi)
28      machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
3129}
3230
3331UINT8 psion_state::kb_read(running_machine &machine)
r18137r18138
492490
493491   MCFG_NVRAM_HANDLER(psion)
494492
495   MCFG_TIMER_ADD_PERIODIC("nmi_timer", nmi_timer, attotime::from_seconds(1))
493   MCFG_TIMER_DRIVER_ADD_PERIODIC("nmi_timer", psion_state, nmi_timer, attotime::from_seconds(1))
496494
497495   /* Datapack */
498496   MCFG_PSION_DATAPACK_ADD("pack1")
trunk/src/mess/drivers/vixen.c
r18137r18138
393393//  TIMER_DEVICE_CALLBACK( vsync_tick )
394394//-------------------------------------------------
395395
396static TIMER_DEVICE_CALLBACK( vsync_tick )
396TIMER_DEVICE_CALLBACK_MEMBER(vixen_state::vsync_tick)
397397{
398   vixen_state *state = timer.machine().driver_data<vixen_state>();
399
400   if (state->m_cmd_d0)
398   if (m_cmd_d0)
401399   {
402      state->m_vsync = 1;
403      state->update_interrupt();
400      m_vsync = 1;
401      update_interrupt();
404402   }
405403}
406404
r18137r18138
846844   MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
847845   MCFG_SCREEN_UPDATE_DRIVER(vixen_state, screen_update)
848846   MCFG_SCREEN_RAW_PARAMS(XTAL_23_9616MHz/2, 96*8, 0*8, 81*8, 27*10, 0*10, 26*10)
849   MCFG_TIMER_ADD_SCANLINE("vsync", vsync_tick, SCREEN_TAG, 26*10, 27*10)
847   MCFG_TIMER_DRIVER_ADD_SCANLINE("vsync", vixen_state, vsync_tick, SCREEN_TAG, 26*10, 27*10)
850848
851849   MCFG_PALETTE_LENGTH(2)
852850   MCFG_PALETTE_INIT(monochrome_amber)
trunk/src/mess/drivers/x1twin.c
r18137r18138
601601   MCFG_SOUND_ROUTE(1, "pce_r", 0.5)
602602#endif
603603
604   MCFG_TIMER_ADD_PERIODIC("keyboard_timer", x1_keyboard_callback, attotime::from_hz(250))
605   MCFG_TIMER_ADD_PERIODIC("cmt_wind_timer", x1_cmt_wind_timer, attotime::from_hz(16))
604   MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard_timer", x1twin_state, x1_keyboard_callback, attotime::from_hz(250))
605   MCFG_TIMER_DRIVER_ADD_PERIODIC("cmt_wind_timer", x1twin_state, x1_cmt_wind_timer, attotime::from_hz(16))
606606MACHINE_CONFIG_END
607607
608608ROM_START( x1twin )
trunk/src/mess/drivers/kyocera.c
r18137r18138
12871287   DEVCB_DEVICE_LINE(CASSETTE_TAG, kc85_sod_w)   /* SOD changed callback (I8085A only) */
12881288};
12891289
1290static TIMER_DEVICE_CALLBACK( tandy200_tp_tick )
1290TIMER_DEVICE_CALLBACK_MEMBER(tandy200_state::tandy200_tp_tick)
12911291{
1292   tandy200_state *state = timer.machine().driver_data<tandy200_state>();
1292   m_maincpu->set_input_line(I8085_RST75_LINE, m_tp);
12931293
1294   state->m_maincpu->set_input_line(I8085_RST75_LINE, state->m_tp);
1295
1296   state->m_tp = !state->m_tp;
1294   m_tp = !m_tp;
12971295}
12981296
12991297static MACHINE_CONFIG_START( kc85, kc85_state )
r18137r18138
14311429   MCFG_FRAGMENT_ADD(tandy200_video)
14321430
14331431   /* TP timer */
1434   MCFG_TIMER_ADD_PERIODIC("tp", tandy200_tp_tick, attotime::from_hz(XTAL_4_9152MHz/2/8192))
1432   MCFG_TIMER_DRIVER_ADD_PERIODIC("tp", tandy200_state, tandy200_tp_tick, attotime::from_hz(XTAL_4_9152MHz/2/8192))
14351433
14361434   /* sound hardware */
14371435   MCFG_SPEAKER_STANDARD_MONO("mono")
trunk/src/mess/drivers/pc.c
r18137r18138
878878   MCFG_CPU_ADD("maincpu", type, clock)            \
879879   MCFG_CPU_PROGRAM_MAP(mem##_map)   \
880880   MCFG_CPU_IO_MAP(port##_io)   \
881   MCFG_TIMER_ADD_SCANLINE("scantimer", vblankfunc, "screen", 0, 1) \
881   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", pc_state, vblankfunc, "screen", 0, 1) \
882882   MCFG_CPU_CONFIG(i86_address_mask)
883883
884884
trunk/src/mess/drivers/msx.c
r18137r18138
11481148   MCFG_CPU_ADD("maincpu", Z80, XTAL_21_4772MHz/6)        /* 3.579545 MHz */
11491149   MCFG_CPU_PROGRAM_MAP(msx_memory_map)
11501150   MCFG_CPU_IO_MAP(msx2_io_map)
1151   MCFG_TIMER_ADD_SCANLINE("scantimer", msx2_interrupt, "screen", 0, 1)
1151   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", msx_state, msx2_interrupt, "screen", 0, 1)
11521152   MCFG_QUANTUM_TIME(attotime::from_hz(60))
11531153
11541154   MCFG_MACHINE_START_OVERRIDE(msx_state, msx2 )
trunk/src/mess/drivers/tiki100.c
r18137r18138
483483
484484/* Z80-CTC Interface */
485485
486static TIMER_DEVICE_CALLBACK( ctc_tick )
486TIMER_DEVICE_CALLBACK_MEMBER(tiki100_state::ctc_tick)
487487{
488   tiki100_state *state = timer.machine().driver_data<tiki100_state>();
488   m_ctc->trg0(1);
489   m_ctc->trg0(0);
489490
490   state->m_ctc->trg0(1);
491   state->m_ctc->trg0(0);
492
493   state->m_ctc->trg1(1);
494   state->m_ctc->trg1(0);
491   m_ctc->trg1(1);
492   m_ctc->trg1(0);
495493}
496494
497495WRITE_LINE_MEMBER( tiki100_state::ctc_z1_w )
r18137r18138
639637   MCFG_Z80DART_ADD(Z80DART_TAG, XTAL_8MHz/4, dart_intf)
640638   MCFG_Z80PIO_ADD(Z80PIO_TAG, XTAL_8MHz/4, pio_intf)
641639   MCFG_Z80CTC_ADD(Z80CTC_TAG, XTAL_8MHz/4, ctc_intf)
642   MCFG_TIMER_ADD_PERIODIC("ctc", ctc_tick, attotime::from_hz(XTAL_8MHz/4))
640   MCFG_TIMER_DRIVER_ADD_PERIODIC("ctc", tiki100_state, ctc_tick, attotime::from_hz(XTAL_8MHz/4))
643641   MCFG_FD1797_ADD(FD1797_TAG, fdc_intf) // FD1767PL-02 or FD1797-PL
644642   MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(tiki100_floppy_interface)
645643
trunk/src/mess/drivers/kc.c
r18137r18138
140140   MCFG_SCREEN_ADD("screen", RASTER)
141141   MCFG_SCREEN_RAW_PARAMS(XTAL_28_37516MHz/2, 908, 0, 320, 312, 0, 256)
142142   MCFG_SCREEN_UPDATE_DRIVER(kc_state, screen_update)
143   MCFG_TIMER_ADD_SCANLINE("scantimer", kc_scanline, "screen", 0, 1)
143   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", kc_state, kc_scanline, "screen", 0, 1)
144144
145145   MCFG_PALETTE_LENGTH(KC85_PALETTE_SIZE)
146146   MCFG_PALETTE_INIT_OVERRIDE(kc_state, kc85 )
r18137r18138
192192   MCFG_SCREEN_ADD("screen", RASTER)
193193   MCFG_SCREEN_RAW_PARAMS(XTAL_28_37516MHz/2, 908, 0, 320, 312, 0, 256)
194194   MCFG_SCREEN_UPDATE_DRIVER(kc85_4_state, screen_update)
195   MCFG_TIMER_ADD_SCANLINE("scantimer", kc_scanline, "screen", 0, 1)
195   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", kc85_4_state, kc_scanline, "screen", 0, 1)
196196
197197   MCFG_PALETTE_LENGTH(KC85_PALETTE_SIZE)
198198   MCFG_PALETTE_INIT_OVERRIDE(kc85_4_state, kc85 )
trunk/src/mess/drivers/coleco.c
r18137r18138
213213   }
214214}
215215
216static TIMER_DEVICE_CALLBACK( paddle_update_callback )
216TIMER_DEVICE_CALLBACK_MEMBER(coleco_state::paddle_update_callback)
217217{
218218   // arbitrary timer for reading analog controls
219   coleco_state *state = timer.machine().driver_data<coleco_state>();
219   coleco_scan_paddles(machine(), &m_joy_analog_reload[0], &m_joy_analog_reload[1]);
220220
221   coleco_scan_paddles(timer.machine(), &state->m_joy_analog_reload[0], &state->m_joy_analog_reload[1]);
222
223221   for (int port = 0; port < 2; port++)
224222   {
225      if (state->m_joy_analog_reload[port])
223      if (m_joy_analog_reload[port])
226224      {
227225         const int sensitivity = 500;
228         int ipt = state->m_joy_analog_reload[port];
226         int ipt = m_joy_analog_reload[port];
229227         if (ipt & 0x80) ipt = 0x100 - ipt;
230228         attotime freq = attotime::from_msec(sensitivity / ipt);
231229
232230         // change pulse intervals relative to spinner/trackball speed
233         state->m_joy_pulse_reload[port] = freq;
234         state->m_joy_pulse_timer[port]->adjust(min(freq, state->m_joy_pulse_timer[port]->remaining()), port);
231         m_joy_pulse_reload[port] = freq;
232         m_joy_pulse_timer[port]->adjust(min(freq, m_joy_pulse_timer[port]->remaining()), port);
235233      }
236234   }
237235}
r18137r18138
340338   /* software lists */
341339   MCFG_SOFTWARE_LIST_ADD("cart_list","coleco")
342340
343   MCFG_TIMER_ADD_PERIODIC("paddle_timer", paddle_update_callback, attotime::from_msec(20))
341   MCFG_TIMER_DRIVER_ADD_PERIODIC("paddle_timer", coleco_state, paddle_update_callback, attotime::from_msec(20))
344342MACHINE_CONFIG_END
345343
346344static MACHINE_CONFIG_START( czz50, coleco_state )
r18137r18138
370368   /* software lists */
371369   MCFG_SOFTWARE_LIST_ADD("cart_list","coleco")
372370
373   MCFG_TIMER_ADD_PERIODIC("paddle_timer", paddle_update_callback, attotime::from_msec(20))
371   MCFG_TIMER_DRIVER_ADD_PERIODIC("paddle_timer", coleco_state, paddle_update_callback, attotime::from_msec(20))
374372MACHINE_CONFIG_END
375373
376374static MACHINE_CONFIG_DERIVED( dina, czz50 )
trunk/src/mess/drivers/huebler.c
r18137r18138
4747   }
4848}
4949
50static TIMER_DEVICE_CALLBACK( keyboard_tick )
50TIMER_DEVICE_CALLBACK_MEMBER(amu880_state::keyboard_tick)
5151{
52   amu880_state *state = timer.machine().driver_data<amu880_state>();
53
54   state->scan_keyboard();
52   scan_keyboard();
5553}
5654
5755/* Read/Write Handlers */
r18137r18138
388386   MCFG_CPU_IO_MAP(amu880_io)
389387   MCFG_CPU_CONFIG(amu880_daisy_chain)
390388
391   MCFG_TIMER_ADD_PERIODIC("keyboard", keyboard_tick, attotime::from_hz(1500))
389   MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard", amu880_state, keyboard_tick, attotime::from_hz(1500))
392390
393391   /* video hardware */
394392   MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
trunk/src/mess/drivers/trs80m2.c
r18137r18138
109109   }
110110}
111111
112static TIMER_DEVICE_CALLBACK( trs80m2_keyboard_tick )
112TIMER_DEVICE_CALLBACK_MEMBER(trs80m2_state::trs80m2_keyboard_tick)
113113{
114   trs80m2_state *state = timer.machine().driver_data<trs80m2_state>();
115
116   state->scan_keyboard();
114   scan_keyboard();
117115}
118116
119117
r18137r18138
833831//  Z80CTC_INTERFACE( ctc_intf )
834832//-------------------------------------------------
835833
836static TIMER_DEVICE_CALLBACK( ctc_tick )
834TIMER_DEVICE_CALLBACK_MEMBER(trs80m2_state::ctc_tick)
837835{
838   trs80m2_state *state = timer.machine().driver_data<trs80m2_state>();
836   m_ctc->trg0(1);
837   m_ctc->trg0(0);
839838
840   state->m_ctc->trg0(1);
841   state->m_ctc->trg0(0);
839   m_ctc->trg1(1);
840   m_ctc->trg1(0);
842841
843   state->m_ctc->trg1(1);
844   state->m_ctc->trg1(0);
845
846   state->m_ctc->trg2(1);
847   state->m_ctc->trg2(0);
842   m_ctc->trg2(1);
843   m_ctc->trg2(0);
848844}
849845
850846static Z80CTC_INTERFACE( ctc_intf )
r18137r18138
10161012   // devices
10171013   MCFG_FD1791_ADD(FD1791_TAG, fdc_intf)
10181014   MCFG_Z80CTC_ADD(Z80CTC_TAG, XTAL_8MHz/2, ctc_intf)
1019   MCFG_TIMER_ADD_PERIODIC("ctc", ctc_tick, attotime::from_hz(XTAL_8MHz/2/2))
1015   MCFG_TIMER_DRIVER_ADD_PERIODIC("ctc", trs80m2_state, ctc_tick, attotime::from_hz(XTAL_8MHz/2/2))
10201016   MCFG_Z80DMA_ADD(Z80DMA_TAG, XTAL_8MHz/2, dma_intf)
10211017   MCFG_Z80PIO_ADD(Z80PIO_TAG, XTAL_8MHz/2, pio_intf)
10221018   MCFG_Z80SIO0_ADD(Z80SIO_TAG, XTAL_8MHz/2, sio_intf)
r18137r18138
10241020   MCFG_LEGACY_FLOPPY_DRIVE_ADD(FLOPPY_0, trs80m2_floppy_interface)
10251021   MCFG_TRS80M2_KEYBOARD_ADD(kb_intf)
10261022
1027   MCFG_TIMER_ADD_PERIODIC("keyboard", trs80m2_keyboard_tick,attotime::from_hz(60))
1023   MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard", trs80m2_state, trs80m2_keyboard_tick, attotime::from_hz(60))
10281024
10291025   // internal RAM
10301026   MCFG_RAM_ADD(RAM_TAG)
r18137r18138
10671063   // devices
10681064   MCFG_FD1791_ADD(FD1791_TAG, fdc_intf)
10691065   MCFG_Z80CTC_ADD(Z80CTC_TAG, XTAL_8MHz/2, ctc_intf)
1070   MCFG_TIMER_ADD_PERIODIC("ctc", ctc_tick, attotime::from_hz(XTAL_8MHz/2/2))
1066   MCFG_TIMER_DRIVER_ADD_PERIODIC("ctc", trs80m2_state, ctc_tick, attotime::from_hz(XTAL_8MHz/2/2))
10711067   MCFG_Z80DMA_ADD(Z80DMA_TAG, XTAL_8MHz/2, dma_intf)
10721068   MCFG_Z80PIO_ADD(Z80PIO_TAG, XTAL_8MHz/2, pio_intf)
10731069   MCFG_Z80SIO0_ADD(Z80SIO_TAG, XTAL_8MHz/2, sio_intf)
r18137r18138
10761072   MCFG_PIC8259_ADD(AM9519A_TAG, pic_intf)
10771073   MCFG_TRS80M2_KEYBOARD_ADD(kb_intf)
10781074
1079   MCFG_TIMER_ADD_PERIODIC("keyboard", trs80m2_keyboard_tick,attotime::from_hz(60))
1075   MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard", trs80m2_state, trs80m2_keyboard_tick, attotime::from_hz(60))
10801076
10811077   // internal RAM
10821078   MCFG_RAM_ADD(RAM_TAG)
trunk/src/mess/drivers/mikromik.c
r18137r18138
319319//  TIMER_DEVICE_CALLBACK( kbclk_tick )
320320//-------------------------------------------------
321321
322static TIMER_DEVICE_CALLBACK( kbclk_tick )
322TIMER_DEVICE_CALLBACK_MEMBER(mm1_state::kbclk_tick)
323323{
324   mm1_state *state = timer.machine().driver_data<mm1_state>();
325
326   state->scan_keyboard();
324   scan_keyboard();
327325}
328326
329327
r18137r18138
787785   MCFG_CPU_PROGRAM_MAP(mm1_map)
788786   MCFG_CPU_CONFIG(i8085_intf)
789787
790   MCFG_TIMER_ADD_PERIODIC("kbclk", kbclk_tick, attotime::from_hz(2500)) //attotime::from_hz(XTAL_6_144MHz/2/8))
788   MCFG_TIMER_DRIVER_ADD_PERIODIC("kbclk", mm1_state, kbclk_tick, attotime::from_hz(2500))
791789
792790   // sound hardware
793791   MCFG_SPEAKER_STANDARD_MONO("mono")
trunk/src/mess/drivers/x1.c
r18137r18138
807807   logerror("CMT: Command 0xe9-0x%02x received.\n",cmd);
808808}
809809
810TIMER_DEVICE_CALLBACK( x1_cmt_wind_timer )
810TIMER_DEVICE_CALLBACK_MEMBER(x1_state::x1_cmt_wind_timer)
811811{
812   x1_state *state = timer.machine().driver_data<x1_state>();
813
814   if(state->m_cass->get_image() == NULL) //avoid a crash if a disk game tries to access this
812   if(m_cass->get_image() == NULL) //avoid a crash if a disk game tries to access this
815813      return;
816814
817   switch(state->m_cmt_current_cmd)
815   switch(m_cmt_current_cmd)
818816   {
819817      case 0x03:
820818      case 0x05:  // Fast Forwarding tape
821         state->m_cass->seek(1,SEEK_CUR);
822         if(state->m_cass->get_position() >= state->m_cass->get_length())  // at end?
823            cmt_command(timer.machine(),0x01);  // Stop tape
819         m_cass->seek(1,SEEK_CUR);
820         if(m_cass->get_position() >= m_cass->get_length())  // at end?
821            cmt_command(machine(),0x01);  // Stop tape
824822         break;
825823      case 0x04:
826824      case 0x06:  // Rewinding tape
827         state->m_cass->seek(-1,SEEK_CUR);
828         if(state->m_cass->get_position() <= 0) // at beginning?
829            cmt_command(timer.machine(),0x01);  // Stop tape
825         m_cass->seek(-1,SEEK_CUR);
826         if(m_cass->get_position() <= 0) // at beginning?
827            cmt_command(machine(),0x01);  // Stop tape
830828         break;
831829   }
832830}
r18137r18138
24012399}
24022400#endif
24032401
2404TIMER_DEVICE_CALLBACK(x1_keyboard_callback)
2402TIMER_DEVICE_CALLBACK_MEMBER(x1_state::x1_keyboard_callback)
24052403{
2406   x1_state *state = timer.machine().driver_data<x1_state>();
2407   address_space &space = timer.machine().device("x1_cpu")->memory().space(AS_PROGRAM);
2408   UINT32 key1 = timer.machine().root_device().ioport("key1")->read();
2409   UINT32 key2 = timer.machine().root_device().ioport("key2")->read();
2410   UINT32 key3 = timer.machine().root_device().ioport("key3")->read();
2411   UINT32 key4 = timer.machine().root_device().ioport("tenkey")->read();
2412   UINT32 f_key = timer.machine().root_device().ioport("f_keys")->read();
2404   address_space &space = machine().device("x1_cpu")->memory().space(AS_PROGRAM);
2405   UINT32 key1 = machine().root_device().ioport("key1")->read();
2406   UINT32 key2 = machine().root_device().ioport("key2")->read();
2407   UINT32 key3 = machine().root_device().ioport("key3")->read();
2408   UINT32 key4 = machine().root_device().ioport("tenkey")->read();
2409   UINT32 f_key = machine().root_device().ioport("f_keys")->read();
24132410
2414   if(state->m_key_irq_vector)
2411   if(m_key_irq_vector)
24152412   {
24162413      //if(key1 == 0 && key2 == 0 && key3 == 0 && key4 == 0 && f_key == 0)
24172414      //  return;
24182415
2419      if((key1 != state->m_old_key1) || (key2 != state->m_old_key2) || (key3 != state->m_old_key3) || (key4 != state->m_old_key4) || (f_key != state->m_old_fkey))
2416      if((key1 != m_old_key1) || (key2 != m_old_key2) || (key3 != m_old_key3) || (key4 != m_old_key4) || (f_key != m_old_fkey))
24202417      {
24212418         // generate keyboard IRQ
2422         state->x1_sub_io_w(space,0,0xe6);
2423         state->m_irq_vector = state->m_key_irq_vector;
2424         state->m_key_irq_flag = 1;
2425         timer.machine().device("x1_cpu")->execute().set_input_line(0,ASSERT_LINE);
2426         state->m_old_key1 = key1;
2427         state->m_old_key2 = key2;
2428         state->m_old_key3 = key3;
2429         state->m_old_key4 = key4;
2430         state->m_old_fkey = f_key;
2419         x1_sub_io_w(space,0,0xe6);
2420         m_irq_vector = m_key_irq_vector;
2421         m_key_irq_flag = 1;
2422         machine().device("x1_cpu")->execute().set_input_line(0,ASSERT_LINE);
2423         m_old_key1 = key1;
2424         m_old_key2 = key2;
2425         m_old_key3 = key3;
2426         m_old_key4 = key4;
2427         m_old_fkey = f_key;
24312428      }
24322429   }
24332430}
r18137r18138
26202617   MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(x1_floppy_interface)
26212618   MCFG_SOFTWARE_LIST_ADD("flop_list","x1_flop")
26222619
2623   MCFG_TIMER_ADD_PERIODIC("keyboard_timer", x1_keyboard_callback, attotime::from_hz(250))
2624   MCFG_TIMER_ADD_PERIODIC("cmt_wind_timer", x1_cmt_wind_timer, attotime::from_hz(16))
2620   MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard_timer", x1_state, x1_keyboard_callback, attotime::from_hz(250))
2621   MCFG_TIMER_DRIVER_ADD_PERIODIC("cmt_wind_timer", x1_state, x1_cmt_wind_timer, attotime::from_hz(16))
26252622MACHINE_CONFIG_END
26262623
26272624static MACHINE_CONFIG_DERIVED( x1turbo, x1 )
trunk/src/mess/drivers/mtx.c
r18137r18138
210210    Z80CTC_INTERFACE( ctc_intf )
211211-------------------------------------------------*/
212212
213static TIMER_DEVICE_CALLBACK( ctc_tick )
213TIMER_DEVICE_CALLBACK_MEMBER(mtx_state::ctc_tick)
214214{
215   mtx_state *state = timer.machine().driver_data<mtx_state>();
216
217   state->m_z80ctc->trg1(1);
218   state->m_z80ctc->trg1(0);
219   state->m_z80ctc->trg2(1);
220   state->m_z80ctc->trg2(0);
215   m_z80ctc->trg1(1);
216   m_z80ctc->trg1(0);
217   m_z80ctc->trg2(1);
218   m_z80ctc->trg2(0);
221219}
222220
223221static WRITE_LINE_DEVICE_HANDLER( ctc_trg1_w )
r18137r18138
302300    cassette_interface mtx_cassette_interface
303301-------------------------------------------------*/
304302
305static TIMER_DEVICE_CALLBACK( cassette_tick )
303TIMER_DEVICE_CALLBACK_MEMBER(mtx_state::cassette_tick)
306304{
307   mtx_state *state = timer.machine().driver_data<mtx_state>();
308   int data = ((state->m_cassette)->input() > +0.0) ? 0 : 1;
305   int data = ((m_cassette)->input() > +0.0) ? 0 : 1;
309306
310   state->m_z80ctc->trg3(data);
307   m_z80ctc->trg3(data);
311308}
312309
313310static const cassette_interface mtx_cassette_interface =
r18137r18138
368365
369366   /* devices */
370367   MCFG_Z80CTC_ADD(Z80CTC_TAG, XTAL_4MHz, ctc_intf )
371   MCFG_TIMER_ADD_PERIODIC("z80ctc_timer", ctc_tick, attotime::from_hz(XTAL_4MHz/13))
368   MCFG_TIMER_DRIVER_ADD_PERIODIC("z80ctc_timer", mtx_state, ctc_tick, attotime::from_hz(XTAL_4MHz/13))
372369   MCFG_CENTRONICS_PRINTER_ADD(CENTRONICS_TAG, standard_centronics)
373370   MCFG_SNAPSHOT_ADD("snapshot", mtx, "mtb", 0.5)
374371   MCFG_CASSETTE_ADD(CASSETTE_TAG, mtx_cassette_interface)
375   MCFG_TIMER_ADD_PERIODIC("cassette_timer", cassette_tick, attotime::from_hz(44100))
372   MCFG_TIMER_DRIVER_ADD_PERIODIC("cassette_timer", mtx_state, cassette_tick, attotime::from_hz(44100))
376373
377374   /* internal ram */
378375   MCFG_RAM_ADD(RAM_TAG)
trunk/src/mess/drivers/apple2.c
r18137r18138
644644   /* basic machine hardware */
645645   MCFG_CPU_ADD("maincpu", M6502, 1021800)      /* close to actual CPU frequency of 1.020484 MHz */
646646   MCFG_CPU_PROGRAM_MAP(apple2_map)
647   MCFG_TIMER_ADD_SCANLINE("scantimer", apple2_interrupt, "screen", 0, 1)
647   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", apple2_state, apple2_interrupt, "screen", 0, 1)
648648   MCFG_QUANTUM_TIME(attotime::from_hz(60))
649649
650650   MCFG_MACHINE_START_OVERRIDE(apple2_state, apple2 )
trunk/src/mess/drivers/super6.c
r18137r18138
349349//  Z80CTC_INTERFACE( ctc_intf )
350350//-------------------------------------------------
351351
352static TIMER_DEVICE_CALLBACK( ctc_tick )
352TIMER_DEVICE_CALLBACK_MEMBER(super6_state::ctc_tick)
353353{
354   super6_state *state = timer.machine().driver_data<super6_state>();
355
356   state->m_ctc->trg0(1);
357   state->m_ctc->trg0(0);
354   m_ctc->trg0(1);
355   m_ctc->trg0(0);
358356}
359357
360358static Z80CTC_INTERFACE( ctc_intf )
r18137r18138
570568
571569   // devices
572570   MCFG_Z80CTC_ADD(Z80CTC_TAG, XTAL_24MHz/4, ctc_intf)
573   MCFG_TIMER_ADD_PERIODIC("ctc", ctc_tick, attotime::from_hz(XTAL_24MHz/16))
571   MCFG_TIMER_DRIVER_ADD_PERIODIC("ctc", super6_state, ctc_tick, attotime::from_hz(XTAL_24MHz/16))
574572   MCFG_Z80DART_ADD(Z80DART_TAG, XTAL_24MHz/4, dart_intf)
575573   MCFG_Z80DMA_ADD(Z80DMA_TAG, XTAL_24MHz/6, dma_intf)
576574   MCFG_Z80PIO_ADD(Z80PIO_TAG, XTAL_24MHz/4, pio_intf)
trunk/src/mess/drivers/newbrain.c
r18137r18138
730730   }
731731}
732732
733static TIMER_DEVICE_CALLBACK( cop_regint_tick )
733TIMER_DEVICE_CALLBACK_MEMBER(newbrain_state::cop_regint_tick)
734734{
735   newbrain_state *state = timer.machine().driver_data<newbrain_state>();
736
737   if (state->m_copregint)
735   if (m_copregint)
738736   {
739737      logerror("COP REGINT\n");
740      state->m_copint = 0;
741      state->check_interrupt();
738      m_copint = 0;
739      check_interrupt();
742740   }
743741}
744742
r18137r18138
12261224   DEVCB_DRIVER_LINE_MEMBER(newbrain_eim_state, ctc_z2_w)   /* ZC/TO2 callback */
12271225};
12281226
1229static TIMER_DEVICE_CALLBACK( ctc_c2_tick )
1227TIMER_DEVICE_CALLBACK_MEMBER(newbrain_eim_state::ctc_c2_tick)
12301228{
1231   newbrain_eim_state *state = timer.machine().driver_data<newbrain_eim_state>();
1232
1233   state->m_ctc->trg2(1);
1234   state->m_ctc->trg2(0);
1229   m_ctc->trg2(1);
1230   m_ctc->trg2(0);
12351231}
12361232
12371233inline int newbrain_state::get_reset_t()
r18137r18138
13881384
13891385   MCFG_GFXDECODE(newbrain)
13901386
1391   MCFG_TIMER_ADD_PERIODIC("cop_regint", cop_regint_tick, attotime::from_usec(12500)) // HACK
1387   MCFG_TIMER_DRIVER_ADD_PERIODIC("cop_regint", newbrain_state, cop_regint_tick, attotime::from_usec(12500))
13921388
13931389   // video hardware
13941390   MCFG_FRAGMENT_ADD(newbrain_video)
r18137r18138
14301426
14311427   // devices
14321428   MCFG_Z80CTC_ADD(Z80CTC_TAG, XTAL_16MHz/8, newbrain_ctc_intf)
1433   MCFG_TIMER_ADD_PERIODIC("z80ctc_c2", ctc_c2_tick, attotime::from_hz(XTAL_16MHz/4/13))
1429   MCFG_TIMER_DRIVER_ADD_PERIODIC("z80ctc_c2", newbrain_eim_state, ctc_c2_tick, attotime::from_hz(XTAL_16MHz/4/13))
14341430   MCFG_ADC0808_ADD(ADC0809_TAG, 500000, adc_intf)
14351431   MCFG_ACIA6850_ADD(MC6850_TAG, acia_intf)
14361432   MCFG_UPD765A_ADD(UPD765_TAG, fdc_intf)
trunk/src/mess/drivers/bw12.c
r18137r18138
9191   m_motor_on = 0;
9292}
9393
94static TIMER_DEVICE_CALLBACK( floppy_motor_off_tick )
94TIMER_DEVICE_CALLBACK_MEMBER(bw12_state::floppy_motor_off_tick)
9595{
96   bw12_state *state = timer.machine().driver_data<bw12_state>();
97
98   state->floppy_motor_off();
96   floppy_motor_off();
9997}
10098
10199void bw12_state::set_floppy_motor_off_timer()
r18137r18138
789787   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
790788
791789   /* devices */
792   MCFG_TIMER_ADD(FLOPPY_TIMER_TAG, floppy_motor_off_tick)
790   MCFG_TIMER_DRIVER_ADD(FLOPPY_TIMER_TAG, bw12_state, floppy_motor_off_tick)
793791   MCFG_UPD765A_ADD(UPD765_TAG, fdc_intf)
794792   MCFG_PIA6821_ADD(PIA6821_TAG, pia_intf)
795793   MCFG_Z80SIO0_ADD(Z80SIO_TAG, XTAL_16MHz/4, sio_intf)
trunk/src/mess/drivers/v1050.c
r18137r18138
272272   m_keydata = keydata;
273273}
274274
275static TIMER_DEVICE_CALLBACK( v1050_keyboard_tick )
275TIMER_DEVICE_CALLBACK_MEMBER(v1050_state::v1050_keyboard_tick)
276276{
277   v1050_state *state = timer.machine().driver_data<v1050_state>();
278
279   state->scan_keyboard();
277   scan_keyboard();
280278}
281279
282280READ8_MEMBER( v1050_state::kb_data_r )
r18137r18138
374372   return data;
375373}
376374
377static TIMER_DEVICE_CALLBACK( sasi_ack_tick )
375TIMER_DEVICE_CALLBACK_MEMBER(v1050_state::sasi_ack_tick)
378376{
379   v1050_state *state = timer.machine().driver_data<v1050_state>();
380
381   state->m_sasibus->scsi_ack_w(1);
377   m_sasibus->scsi_ack_w(1);
382378}
383379
384static TIMER_DEVICE_CALLBACK( sasi_rst_tick )
380TIMER_DEVICE_CALLBACK_MEMBER(v1050_state::sasi_rst_tick)
385381{
386   v1050_state *state = timer.machine().driver_data<v1050_state>();
387
388   state->m_sasibus->scsi_rst_w(1);
382   m_sasibus->scsi_rst_w(1);
389383}
390384
391385WRITE8_MEMBER( v1050_state::sasi_ctrl_w )
r18137r18138
867861
868862// Keyboard 8251A Interface
869863
870static TIMER_DEVICE_CALLBACK( kb_8251_tick )
864TIMER_DEVICE_CALLBACK_MEMBER(v1050_state::kb_8251_tick)
871865{
872   v1050_state *state = timer.machine().driver_data<v1050_state>();
873
874   state->m_uart_kb->transmit_clock();
875   state->m_uart_kb->receive_clock();
866   m_uart_kb->transmit_clock();
867   m_uart_kb->receive_clock();
876868}
877869
878870WRITE_LINE_MEMBER( v1050_state::kb_rxrdy_w )
r18137r18138
895887
896888// Serial 8251A Interface
897889
898static TIMER_DEVICE_CALLBACK( sio_8251_tick )
890TIMER_DEVICE_CALLBACK_MEMBER(v1050_state::sio_8251_tick)
899891{
900   v1050_state *state = timer.machine().driver_data<v1050_state>();
901
902   state->m_uart_sio->transmit_clock();
903   state->m_uart_sio->receive_clock();
892   m_uart_sio->transmit_clock();
893   m_uart_sio->receive_clock();
904894}
905895
906896WRITE_LINE_MEMBER( v1050_state::sio_rxrdy_w )
r18137r18138
10901080   MCFG_QUANTUM_PERFECT_CPU(M6502_TAG)
10911081
10921082   // keyboard HACK
1093   MCFG_TIMER_ADD_PERIODIC("keyboard", v1050_keyboard_tick, attotime::from_hz(60))
1083   MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard", v1050_state, v1050_keyboard_tick, attotime::from_hz(60))
10941084
10951085    // video hardware
10961086   MCFG_FRAGMENT_ADD(v1050_video)
r18137r18138
11061096   MCFG_I8251_ADD(I8251A_SIO_TAG, /*XTAL_16MHz/8,*/ sio_8251_intf)
11071097   MCFG_MB8877_ADD(MB8877_TAG, /*XTAL_16MHz/16,*/ fdc_intf )
11081098   MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(v1050_floppy_interface)
1109   MCFG_TIMER_ADD_PERIODIC(TIMER_KB_TAG, kb_8251_tick, attotime::from_hz((double)XTAL_16MHz/4/13/8))
1110   MCFG_TIMER_ADD(TIMER_SIO_TAG, sio_8251_tick)
1099   MCFG_TIMER_DRIVER_ADD_PERIODIC(TIMER_KB_TAG, v1050_state, kb_8251_tick, attotime::from_hz((double)XTAL_16MHz/4/13/8))
1100   MCFG_TIMER_DRIVER_ADD(TIMER_SIO_TAG, v1050_state, sio_8251_tick)
11111101
11121102   // SASI bus
11131103   MCFG_SCSIBUS_ADD(SASIBUS_TAG)
11141104   MCFG_SCSIDEV_ADD(SASIBUS_TAG ":harddisk0", S1410, SCSI_ID_0)
11151105   MCFG_SCSICB_ADD(SASIBUS_TAG ":host", sasi_intf)
11161106
1117   MCFG_TIMER_ADD(TIMER_ACK_TAG, sasi_ack_tick)
1118   MCFG_TIMER_ADD(TIMER_RST_TAG, sasi_rst_tick)
1107   MCFG_TIMER_DRIVER_ADD(TIMER_ACK_TAG, v1050_state, sasi_ack_tick)
1108   MCFG_TIMER_DRIVER_ADD(TIMER_RST_TAG, v1050_state, sasi_rst_tick)
11191109
11201110   // keyboard
11211111   MCFG_V1050_KEYBOARD_ADD()
trunk/src/mess/drivers/einstein.c
r18137r18138
188188   einstein->m_keyboard_data = data;
189189}
190190
191static TIMER_DEVICE_CALLBACK( einstein_keyboard_timer_callback )
191TIMER_DEVICE_CALLBACK_MEMBER(einstein_state::einstein_keyboard_timer_callback)
192192{
193   einstein_state *einstein = timer.machine().driver_data<einstein_state>();
194
195193   /* re-scan keyboard */
196   einstein_scan_keyboard(timer.machine());
194   einstein_scan_keyboard(machine());
197195
198196   /* if /fire1 or /fire2 is 0, signal a fire interrupt */
199   if ((timer.machine().root_device().ioport("BUTTONS")->read() & 0x03) != 0)
197   if ((machine().root_device().ioport("BUTTONS")->read() & 0x03) != 0)
200198   {
201      einstein->m_interrupt |= EINSTEIN_FIRE_INT;
199      m_interrupt |= EINSTEIN_FIRE_INT;
202200   }
203201
204202   /* keyboard data changed? */
205   if (einstein->m_keyboard_data != 0xff)
203   if (m_keyboard_data != 0xff)
206204   {
207205      /* generate interrupt */
208      einstein->m_interrupt |= EINSTEIN_KEY_INT;
206      m_interrupt |= EINSTEIN_KEY_INT;
209207   }
210208}
211209
r18137r18138
271269***************************************************************************/
272270
273271/* channel 0 and 1 have a 2 MHz input clock for triggering */
274static TIMER_DEVICE_CALLBACK( einstein_ctc_trigger_callback )
272TIMER_DEVICE_CALLBACK_MEMBER(einstein_state::einstein_ctc_trigger_callback)
275273{
276   einstein_state *einstein = timer.machine().driver_data<einstein_state>();
277
278274   /* toggle line status */
279   einstein->m_ctc_trigger ^= 1;
275   m_ctc_trigger ^= 1;
280276
281   einstein->m_ctc->trg0(einstein->m_ctc_trigger);
282   einstein->m_ctc->trg1(einstein->m_ctc_trigger);
277   m_ctc->trg0(m_ctc_trigger);
278   m_ctc->trg1(m_ctc_trigger);
283279}
284280
285281
r18137r18138
777773
778774   /* this is actually clocked at the system clock 4 MHz, but this would be too fast for our
779775    driver. So we update at 50Hz and hope this is good enough. */
780   MCFG_TIMER_ADD_PERIODIC("keyboard", einstein_keyboard_timer_callback, attotime::from_hz(50))
776   MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard", einstein_state, einstein_keyboard_timer_callback, attotime::from_hz(50))
781777
782778   MCFG_Z80PIO_ADD(IC_I063, XTAL_X002 / 2, einstein_pio_intf)
783779
784780   MCFG_Z80CTC_ADD(IC_I058, XTAL_X002 / 2, einstein_ctc_intf)
785781   /* the input to channel 0 and 1 of the ctc is a 2 MHz clock */
786   MCFG_TIMER_ADD_PERIODIC("ctc", einstein_ctc_trigger_callback, attotime::from_hz(XTAL_X002 /4))
782   MCFG_TIMER_DRIVER_ADD_PERIODIC("ctc", einstein_state, einstein_ctc_trigger_callback, attotime::from_hz(XTAL_X002 /4))
787783
788784   /* Einstein daisy chain support for non-Z80 devices */
789785   MCFG_DEVICE_ADD("keyboard_daisy", EINSTEIN_KEYBOARD_DAISY, 0)
trunk/src/mess/drivers/a7800.c
r18137r18138
253253   /* basic machine hardware */
254254   MCFG_CPU_ADD("maincpu", M6502, A7800_NTSC_Y1/8)   /* 1.79 MHz (switches to 1.19 MHz on TIA or RIOT access) */
255255   MCFG_CPU_PROGRAM_MAP(a7800_mem)
256   MCFG_TIMER_ADD_SCANLINE("scantimer", a7800_interrupt, "screen", 0, 1)
256   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", a7800_state, a7800_interrupt, "screen", 0, 1)
257257
258258
259259   /* video hardware */
trunk/src/mess/drivers/mc1000.c
r18137r18138
409409#define MC1000_NE555_FREQ       (368) /* Hz */
410410#define MC1000_NE555_DUTY_CYCLE (99.745) /* % */
411411
412static TIMER_DEVICE_CALLBACK( ne555_tick )
412TIMER_DEVICE_CALLBACK_MEMBER(mc1000_state::ne555_tick)
413413{
414   mc1000_state *state = timer.machine().driver_data<mc1000_state>();
415
416414   // (m_ne555_int not needed anymore and can be done with?)
417   state->m_ne555_int = param;
415   m_ne555_int = param;
418416
419   state->m_maincpu->set_input_line(INPUT_LINE_IRQ0, param);
417   m_maincpu->set_input_line(INPUT_LINE_IRQ0, param);
420418}
421419
422420static const cassette_interface mc1000_cassette_interface =
r18137r18138
444442   MCFG_CPU_IO_MAP(mc1000_io)
445443
446444   /* timers */
447   MCFG_TIMER_ADD_PERIODIC("ne555clear", ne555_tick, attotime::from_hz(MC1000_NE555_FREQ))
445   MCFG_TIMER_DRIVER_ADD_PERIODIC("ne555clear", mc1000_state, ne555_tick, attotime::from_hz(MC1000_NE555_FREQ))
448446   MCFG_TIMER_PARAM(CLEAR_LINE)
449447
450   MCFG_TIMER_ADD_PERIODIC("ne555assert", ne555_tick, attotime::from_hz(MC1000_NE555_FREQ))
448   MCFG_TIMER_DRIVER_ADD_PERIODIC("ne555assert", mc1000_state, ne555_tick, attotime::from_hz(MC1000_NE555_FREQ))
451449   MCFG_TIMER_START_DELAY(attotime::from_hz(MC1000_NE555_FREQ * 100 / MC1000_NE555_DUTY_CYCLE))
452450   MCFG_TIMER_PARAM(ASSERT_LINE)
453451
trunk/src/mess/drivers/amstr_pc.c
r18137r18138
241241   MCFG_CPU_ADD("maincpu", type, clock)            \
242242   MCFG_CPU_PROGRAM_MAP(mem##_map)   \
243243   MCFG_CPU_IO_MAP(port##_io)   \
244   MCFG_TIMER_ADD_SCANLINE("scantimer", vblankfunc, "screen", 0, 1) \
244   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", pc_state, vblankfunc, "screen", 0, 1) \
245245   MCFG_CPU_CONFIG(i86_address_mask)
246246
247247
r18137r18138
334334   MCFG_CPU_ADD("maincpu", V30, 8000000)
335335   MCFG_CPU_PROGRAM_MAP(ppc512_map)
336336   MCFG_CPU_IO_MAP(ppc512_io)
337   MCFG_TIMER_ADD_SCANLINE("scantimer", pc_frame_interrupt, "screen", 0, 1)
337   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", pc_state, pc_frame_interrupt, "screen", 0, 1)
338338
339339   MCFG_MACHINE_START_OVERRIDE(pc_state,pc)
340340   MCFG_MACHINE_RESET_OVERRIDE(pc_state,pc)
trunk/src/mess/drivers/atom.c
r18137r18138
592592    cassette_interface atom_cassette_interface
593593-------------------------------------------------*/
594594
595static TIMER_DEVICE_CALLBACK( cassette_output_tick )
595TIMER_DEVICE_CALLBACK_MEMBER(atom_state::cassette_output_tick)
596596{
597   atom_state *state = timer.machine().driver_data<atom_state>();
597   int level = !(!(!m_hz2400 && m_pc1) && m_pc0);
598598
599   int level = !(!(!state->m_hz2400 && state->m_pc1) && state->m_pc0);
599   m_cassette->output(level ? -1.0 : +1.0);
600600
601   state->m_cassette->output(level ? -1.0 : +1.0);
602
603   state->m_hz2400 = !state->m_hz2400;
601   m_hz2400 = !m_hz2400;
604602}
605603
606604static const cassette_interface atom_cassette_interface =
r18137r18138
784782   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
785783
786784   /* devices */
787   MCFG_TIMER_ADD_PERIODIC("hz2400", cassette_output_tick, attotime::from_hz(4806)) // X2/4/416
785   MCFG_TIMER_DRIVER_ADD_PERIODIC("hz2400", atom_state, cassette_output_tick, attotime::from_hz(4806))
788786   MCFG_VIA6522_ADD(R6522_TAG, X2/4, via_intf)
789787   MCFG_I8255_ADD(INS8255_TAG, ppi_intf)
790788   MCFG_I8271_ADD(I8271_TAG, fdc_intf)
trunk/src/mess/drivers/vcs80.c
r18137r18138
108108
109109/* Z80-PIO Interface */
110110
111static TIMER_DEVICE_CALLBACK( vcs80_keyboard_tick )
111TIMER_DEVICE_CALLBACK_MEMBER(vcs80_state::vcs80_keyboard_tick)
112112{
113   vcs80_state *state = timer.machine().driver_data<vcs80_state>();
114
115   if (state->m_keyclk)
113   if (m_keyclk)
116114   {
117      state->m_keylatch++;
118      state->m_keylatch &= 7;
115      m_keylatch++;
116      m_keylatch &= 7;
119117   }
120118
121   state->m_pio->port_a_write(state->m_keyclk << 7);
119   m_pio->port_a_write(m_keyclk << 7);
122120
123   state->m_keyclk = !state->m_keyclk;
121   m_keyclk = !m_keyclk;
124122}
125123
126124READ8_MEMBER( vcs80_state::pio_pa_r )
r18137r18138
223221   MCFG_CPU_CONFIG(vcs80_daisy_chain)
224222
225223   /* keyboard timer */
226   MCFG_TIMER_ADD_PERIODIC("keyboard", vcs80_keyboard_tick, attotime::from_hz(1000))
224   MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard", vcs80_state, vcs80_keyboard_tick, attotime::from_hz(1000))
227225
228226   /* video hardware */
229227   MCFG_DEFAULT_LAYOUT( layout_vcs80 )
trunk/src/mess/drivers/tek405x.c
r18137r18138
9898//  TIMER_DEVICE_CALLBACK( keyboard_tick )
9999//-------------------------------------------------
100100
101static TIMER_DEVICE_CALLBACK( keyboard_tick )
101TIMER_DEVICE_CALLBACK_MEMBER(tek4051_state::keyboard_tick)
102102{
103   tek4051_state *state = timer.machine().driver_data<tek4051_state>();
104
105   state->scan_keyboard();
103   scan_keyboard();
106104}
107105
108106
r18137r18138
12301228   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
12311229
12321230   // devices
1233   MCFG_TIMER_ADD_PERIODIC("keyboard", keyboard_tick, attotime::from_hz(XTAL_12_5MHz/15/4))
1231   MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard", tek4051_state, keyboard_tick, attotime::from_hz(XTAL_12_5MHz/15/4))
12341232   MCFG_PIA6821_ADD(MC6820_X_TAG, x_pia_intf)
12351233   MCFG_PIA6821_ADD(MC6820_Y_TAG, y_pia_intf)
12361234   MCFG_PIA6821_ADD(MC6820_KB_TAG, kb_pia_intf)
trunk/src/mess/drivers/apple2gs.c
r18137r18138
235235   /* basic machine hardware */
236236   MCFG_CPU_ADD("maincpu", G65816, APPLE2GS_14M/5)
237237   MCFG_CPU_PROGRAM_MAP(apple2gs_map)
238   MCFG_TIMER_ADD_SCANLINE("scantimer", apple2_interrupt, "screen", 0, 1)
238   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", apple2gs_state, apple2_interrupt, "screen", 0, 1)
239239   MCFG_QUANTUM_TIME(attotime::from_hz(60))
240240
241241   MCFG_SCREEN_ADD("screen", RASTER)
trunk/src/mess/drivers/ace.c
r18137r18138
364364//  TIMER_DEVICE_CALLBACK( set_irq )
365365//-------------------------------------------------
366366
367static TIMER_DEVICE_CALLBACK( set_irq )
367TIMER_DEVICE_CALLBACK_MEMBER(ace_state::set_irq)
368368{
369   timer.machine().device(Z80_TAG)->execute().set_input_line(INPUT_LINE_IRQ0, ASSERT_LINE);
369   machine().device(Z80_TAG)->execute().set_input_line(INPUT_LINE_IRQ0, ASSERT_LINE);
370370}
371371
372372
r18137r18138
374374//  TIMER_DEVICE_CALLBACK( clear_irq )
375375//-------------------------------------------------
376376
377static TIMER_DEVICE_CALLBACK( clear_irq )
377TIMER_DEVICE_CALLBACK_MEMBER(ace_state::clear_irq)
378378{
379   timer.machine().device(Z80_TAG)->execute().set_input_line(INPUT_LINE_IRQ0, CLEAR_LINE);
379   machine().device(Z80_TAG)->execute().set_input_line(INPUT_LINE_IRQ0, CLEAR_LINE);
380380}
381381
382382
r18137r18138
630630   MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
631631   MCFG_SCREEN_UPDATE_DRIVER(ace_state, screen_update)
632632   MCFG_SCREEN_RAW_PARAMS(XTAL_6_5MHz, 416, 0, 336, 312, 0, 304)
633   MCFG_TIMER_ADD_SCANLINE("set_irq", set_irq, SCREEN_TAG, 31*8, 264)
634   MCFG_TIMER_ADD_SCANLINE("clear_irq", clear_irq, SCREEN_TAG, 32*8, 264)
633   MCFG_TIMER_DRIVER_ADD_SCANLINE("set_irq", ace_state, set_irq, SCREEN_TAG, 31*8, 264)
634   MCFG_TIMER_DRIVER_ADD_SCANLINE("clear_irq", ace_state, clear_irq, SCREEN_TAG, 32*8, 264)
635635
636636   MCFG_PALETTE_LENGTH(2)
637637   MCFG_PALETTE_INIT(black_and_white)
trunk/src/mess/drivers/svision.c
r18137r18138
5050   }
5151}
5252
53static TIMER_DEVICE_CALLBACK(svision_pet_timer_dev)
53TIMER_DEVICE_CALLBACK_MEMBER(svision_state::svision_pet_timer_dev)
5454{
55   svision_state *state = timer.machine().driver_data<svision_state>();
56   state->svision_pet_timer(ptr,param);
55   svision_pet_timer(ptr,param);
5756}
5857
5958void svision_irq(running_machine &machine)
r18137r18138
544543MACHINE_CONFIG_END
545544
546545static MACHINE_CONFIG_DERIVED( svisions, svision )
547   MCFG_TIMER_ADD_PERIODIC("pet_timer", svision_pet_timer_dev, attotime::from_seconds(8) * 256/4000000)
546   MCFG_TIMER_DRIVER_ADD_PERIODIC("pet_timer", svision_state, svision_pet_timer_dev, attotime::from_seconds(8))
548547MACHINE_CONFIG_END
549548
550549static MACHINE_CONFIG_DERIVED( svisionp, svision )
trunk/src/mess/drivers/mz80.c
r18137r18138
269269   NULL
270270};
271271
272static TIMER_DEVICE_CALLBACK( ne555_tempo_callback )
272TIMER_DEVICE_CALLBACK_MEMBER(mz80_state::ne555_tempo_callback)
273273{
274   mz80_state *state = timer.machine().driver_data<mz80_state>();
275   state->m_mz80k_tempo_strobe ^= 1;
274   m_mz80k_tempo_strobe ^= 1;
276275}
277276
278277static MACHINE_CONFIG_START( mz80k, mz80_state )
r18137r18138
304303   /* Devices */
305304   MCFG_I8255_ADD( "ppi8255", mz80k_8255_int )
306305   MCFG_PIT8253_ADD( "pit8253", mz80k_pit8253_config )
307   MCFG_TIMER_ADD_PERIODIC("tempo", ne555_tempo_callback, attotime::from_hz(34)) // 33.5Hz - 34.3Hz
306   MCFG_TIMER_DRIVER_ADD_PERIODIC("tempo", mz80_state, ne555_tempo_callback, attotime::from_hz(34))
308307   MCFG_CASSETTE_ADD( CASSETTE_TAG, mz80k_cassette_interface )
309308MACHINE_CONFIG_END
310309
trunk/src/mess/drivers/busicom.c
r18137r18138
178178INPUT_PORTS_END
179179
180180
181static TIMER_DEVICE_CALLBACK(timer_callback)
181TIMER_DEVICE_CALLBACK_MEMBER(busicom_state::timer_callback)
182182{
183   busicom_state *state = timer.machine().driver_data<busicom_state>();
184   state->m_timer ^=1;
185   if (state->m_timer==1) state->m_drum_index++;
186   if (state->m_drum_index==13) state->m_drum_index=0;
187   i4004_set_test(timer.machine().device("maincpu"),state->m_timer);
183   m_timer ^=1;
184   if (m_timer==1) m_drum_index++;
185   if (m_drum_index==13) m_drum_index=0;
186   i4004_set_test(machine().device("maincpu"),m_timer);
188187
189188}
190189
r18137r18138
229228    MCFG_PALETTE_LENGTH(16)
230229
231230
232   MCFG_TIMER_ADD_PERIODIC("busicom_timer", timer_callback, attotime::from_msec(28*2))
231   MCFG_TIMER_DRIVER_ADD_PERIODIC("busicom_timer", busicom_state, timer_callback, attotime::from_msec(28*2))
233232MACHINE_CONFIG_END
234233
235234/* ROM definition */
trunk/src/mess/drivers/pcw.c
r18137r18138
169169}
170170
171171/* callback for 1/300ths of a second interrupt */
172static TIMER_DEVICE_CALLBACK(pcw_timer_interrupt)
172TIMER_DEVICE_CALLBACK_MEMBER(pcw_state::pcw_timer_interrupt)
173173{
174   pcw_state *state = timer.machine().driver_data<pcw_state>();
175   pcw_update_interrupt_counter(state);
174   pcw_update_interrupt_counter(this);
176175
177   state->m_timer_irq_flag = 1;
178   pcw_update_irqs(timer.machine());
179   timer.machine().scheduler().timer_set(attotime::from_usec(100), timer_expired_delegate(FUNC(pcw_state::pcw_timer_pulse),state));
176   m_timer_irq_flag = 1;
177   pcw_update_irqs(machine());
178   machine().scheduler().timer_set(attotime::from_usec(100), timer_expired_delegate(FUNC(pcw_state::pcw_timer_pulse),this));
180179}
181180
182181/* fdc interrupt callback. set/clear fdc int */
r18137r18138
13471346   MCFG_RAM_ADD(RAM_TAG)
13481347   MCFG_RAM_DEFAULT_SIZE("256K")
13491348
1350   MCFG_TIMER_ADD_PERIODIC("pcw_timer", pcw_timer_interrupt, attotime::from_hz(300))
1349   MCFG_TIMER_DRIVER_ADD_PERIODIC("pcw_timer", pcw_state, pcw_timer_interrupt, attotime::from_hz(300))
13511350MACHINE_CONFIG_END
13521351
13531352static MACHINE_CONFIG_DERIVED( pcw8256, pcw )
trunk/src/mess/drivers/ti89.c
r18137r18138
152152}
153153
154154
155static TIMER_DEVICE_CALLBACK( ti68k_timer_callback )
155TIMER_DEVICE_CALLBACK_MEMBER(ti68k_state::ti68k_timer_callback)
156156{
157   ti68k_state *state = timer.machine().driver_data<ti68k_state>();
157   m_timer++;
158158
159   state->m_timer++;
160
161   if (state->m_timer_on)
159   if (m_timer_on)
162160   {
163      if (!(state->m_timer & state->m_timer_mask) && BIT(state->m_io_hw1[0x0a], 3))
161      if (!(m_timer & m_timer_mask) && BIT(m_io_hw1[0x0a], 3))
164162      {
165         if (state->m_timer_val)
166            state->m_timer_val++;
163         if (m_timer_val)
164            m_timer_val++;
167165         else
168            state->m_timer_val = (state->m_io_hw1[0x0b]) & 0xff;
166            m_timer_val = (m_io_hw1[0x0b]) & 0xff;
169167      }
170168
171      if (!BIT(state->m_io_hw1[0x0a], 7) && ((state->m_hw_version == state->m_HW1) || (!BIT(state->m_io_hw1[0x0f], 2) && !BIT(state->m_io_hw1[0x0f], 1))))
169      if (!BIT(m_io_hw1[0x0a], 7) && ((m_hw_version == m_HW1) || (!BIT(m_io_hw1[0x0f], 2) && !BIT(m_io_hw1[0x0f], 1))))
172170      {
173         if (!(state->m_timer & 0x003f))
174            state->m_maincpu->set_input_line(M68K_IRQ_1, HOLD_LINE);
171         if (!(m_timer & 0x003f))
172            m_maincpu->set_input_line(M68K_IRQ_1, HOLD_LINE);
175173
176         if (!(state->m_timer & 0x3fff) && !BIT(state->m_io_hw1[0x0a], 3))
177            state->m_maincpu->set_input_line(M68K_IRQ_3, HOLD_LINE);
174         if (!(m_timer & 0x3fff) && !BIT(m_io_hw1[0x0a], 3))
175            m_maincpu->set_input_line(M68K_IRQ_3, HOLD_LINE);
178176
179         if (!(state->m_timer & state->m_timer_mask) && BIT(state->m_io_hw1[0x0a], 3) && state->m_timer_val == 0)
180            state->m_maincpu->set_input_line(M68K_IRQ_5, HOLD_LINE);
177         if (!(m_timer & m_timer_mask) && BIT(m_io_hw1[0x0a], 3) && m_timer_val == 0)
178            m_maincpu->set_input_line(M68K_IRQ_5, HOLD_LINE);
181179      }
182180   }
183181
184   if (state->keypad_r(timer.machine()) != 0xff)
185      state->m_maincpu->set_input_line(M68K_IRQ_2, HOLD_LINE);
182   if (keypad_r(machine()) != 0xff)
183      m_maincpu->set_input_line(M68K_IRQ_2, HOLD_LINE);
186184}
187185
188186
r18137r18138
526524
527525   MCFG_SHARP_UNK128MBIT_ADD("flash")   //should be LH28F320 for ti89t and v200 and LH28F160S3T for other models
528526
529   MCFG_TIMER_ADD_PERIODIC("ti68k_timer", ti68k_timer_callback, attotime::from_hz(1<<14))
527   MCFG_TIMER_DRIVER_ADD_PERIODIC("ti68k_timer", ti68k_state, ti68k_timer_callback, attotime::from_hz(1<<14))
530528MACHINE_CONFIG_END
531529
532530
trunk/src/mess/drivers/pcw16.c
r18137r18138
134134}
135135
136136
137static TIMER_DEVICE_CALLBACK(pcw16_timer_callback)
137TIMER_DEVICE_CALLBACK_MEMBER(pcw16_state::pcw16_timer_callback)
138138{
139   pcw16_state *state = timer.machine().driver_data<pcw16_state>();
140139   /* do not increment past 15 */
141   if (state->m_interrupt_counter!=15)
140   if (m_interrupt_counter!=15)
142141   {
143      state->m_interrupt_counter++;
142      m_interrupt_counter++;
144143      /* display int */
145      state->m_system_status |= (1<<0);
144      m_system_status |= (1<<0);
146145   }
147146
148   if (state->m_interrupt_counter!=0)
147   if (m_interrupt_counter!=0)
149148   {
150      state->pcw16_refresh_ints();
149      pcw16_refresh_ints();
151150   }
152151}
153152
r18137r18138
878877}
879878
880879
881static TIMER_DEVICE_CALLBACK(pcw16_keyboard_timer_callback)
880TIMER_DEVICE_CALLBACK_MEMBER(pcw16_state::pcw16_keyboard_timer_callback)
882881{
883   pcw16_state *state = timer.machine().driver_data<pcw16_state>();
884882   at_keyboard_polling();
885   if (state->pcw16_keyboard_can_transmit())
883   if (pcw16_keyboard_can_transmit())
886884   {
887885      int data;
888886
r18137r18138
895893//              pcw16_dump_cpu_ram();
896894//          }
897895
898         state->pcw16_keyboard_signal_byte_received(data);
896         pcw16_keyboard_signal_byte_received(data);
899897      }
900898   }
901899   // TODO: fix
902   state->subdevice<ns16550_device>("ns16550_2")->ri_w((timer.machine().root_device().ioport("EXTRA")->read() & 0x040) ? 0 : 1);
900   subdevice<ns16550_device>("ns16550_2")->ri_w((machine().root_device().ioport("EXTRA")->read() & 0x040) ? 0 : 1);
903901}
904902
905903
r18137r18138
938936   }
939937}
940938
941static TIMER_DEVICE_CALLBACK(rtc_timer_callback)
939TIMER_DEVICE_CALLBACK_MEMBER(pcw16_state::rtc_timer_callback)
942940{
943   pcw16_state *state = timer.machine().driver_data<pcw16_state>();
944941   int fraction_of_second;
945942
946943   /* halt counter? */
947   if ((state->m_rtc_control & 0x01)!=0)
944   if ((m_rtc_control & 0x01)!=0)
948945   {
949946      /* no */
950947
951948      /* increment 256th's of a second register */
952      fraction_of_second = state->m_rtc_256ths_seconds+1;
949      fraction_of_second = m_rtc_256ths_seconds+1;
953950      /* add bit 8 = overflow */
954      state->m_rtc_seconds+=(fraction_of_second>>8);
951      m_rtc_seconds+=(fraction_of_second>>8);
955952      /* ensure counter is in range 0-255 */
956      state->m_rtc_256ths_seconds = fraction_of_second & 0x0ff;
953      m_rtc_256ths_seconds = fraction_of_second & 0x0ff;
957954   }
958955
959   if (state->m_rtc_seconds>59)
956   if (m_rtc_seconds>59)
960957   {
961      state->m_rtc_seconds = 0;
958      m_rtc_seconds = 0;
962959
963      state->m_rtc_minutes++;
960      m_rtc_minutes++;
964961
965      if (state->m_rtc_minutes>59)
962      if (m_rtc_minutes>59)
966963      {
967         state->m_rtc_minutes = 0;
964         m_rtc_minutes = 0;
968965
969         state->m_rtc_hours++;
966         m_rtc_hours++;
970967
971         if (state->m_rtc_hours>23)
968         if (m_rtc_hours>23)
972969         {
973            state->m_rtc_hours = 0;
970            m_rtc_hours = 0;
974971
975            state->m_rtc_days++;
972            m_rtc_days++;
976973
977            if (state->m_rtc_days > state->m_rtc_days_max)
974            if (m_rtc_days > m_rtc_days_max)
978975            {
979               state->m_rtc_days = 1;
976               m_rtc_days = 1;
980977
981               state->m_rtc_months++;
978               m_rtc_months++;
982979
983               if (state->m_rtc_months>12)
980               if (m_rtc_months>12)
984981               {
985                  state->m_rtc_months = 1;
982                  m_rtc_months = 1;
986983
987984                  /* 7 bit year counter */
988                  state->m_rtc_years = (state->m_rtc_years + 1) & 0x07f;
985                  m_rtc_years = (m_rtc_years + 1) & 0x07f;
989986
990987               }
991988
992               state->rtc_setup_max_days();
989               rtc_setup_max_days();
993990            }
994991
995992         }
r18137r18138
15121509   MCFG_INTEL_E28F008SA_ADD("flash1")
15131510
15141511   /* video ints */
1515   MCFG_TIMER_ADD_PERIODIC("video_timer", pcw16_timer_callback, attotime::from_usec(5830))
1512   MCFG_TIMER_DRIVER_ADD_PERIODIC("video_timer", pcw16_state, pcw16_timer_callback, attotime::from_usec(5830))
15161513   /* rtc timer */
1517   MCFG_TIMER_ADD_PERIODIC("rtc_timer", rtc_timer_callback, attotime::from_hz(256))
1514   MCFG_TIMER_DRIVER_ADD_PERIODIC("rtc_timer", pcw16_state, rtc_timer_callback, attotime::from_hz(256))
15181515   /* keyboard timer */
1519   MCFG_TIMER_ADD_PERIODIC("keyboard_timer", pcw16_keyboard_timer_callback, attotime::from_hz(50))
1516   MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard_timer", pcw16_state, pcw16_keyboard_timer_callback, attotime::from_hz(50))
15201517MACHINE_CONFIG_END
15211518
15221519/***************************************************************************
trunk/src/mess/drivers/nc.c
r18137r18138
492492
493493
494494
495static TIMER_DEVICE_CALLBACK(dummy_timer_callback)
495TIMER_DEVICE_CALLBACK_MEMBER(nc_state::dummy_timer_callback)
496496{
497   nc_state *state = timer.machine().driver_data<nc_state>();
498497   int inputport_10_state;
499498   int changed_bits;
500499
501   inputport_10_state = timer.machine().root_device().ioport("EXTRA")->read();
500   inputport_10_state = machine().root_device().ioport("EXTRA")->read();
502501
503   changed_bits = inputport_10_state^state->m_previous_inputport_10_state;
502   changed_bits = inputport_10_state^m_previous_inputport_10_state;
504503
505504   /* on/off button changed state? */
506505   if (changed_bits & 0x01)
r18137r18138
509508        {
510509         /* on NC100 on/off button causes a nmi, on
511510            nc200 on/off button causes an int */
512         switch (state->m_type)
511         switch (m_type)
513512         {
514513            case NC_TYPE_1xx:
515514            {
516515                 LOG(("nmi triggered\n"));
517                timer.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
516                machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
518517            }
519518            break;
520519
521520            case NC_TYPE_200:
522521            {
523               state->m_irq_status |= (1 << 4);
524               nc_update_interrupts(timer.machine());
522               m_irq_status |= (1 << 4);
523               nc_update_interrupts(machine());
525524            }
526525            break;
527526         }
r18137r18138
532531   if (changed_bits & 0x02)
533532   {
534533      /* yes refresh memory config */
535      nc_refresh_memory_config(timer.machine());
534      nc_refresh_memory_config(machine());
536535   }
537536
538   state->m_previous_inputport_10_state = inputport_10_state;
537   m_previous_inputport_10_state = inputport_10_state;
539538}
540539
541540
r18137r18138
16401639   MCFG_RAM_DEFAULT_SIZE("64K")
16411640
16421641   /* dummy timer */
1643   MCFG_TIMER_ADD_PERIODIC("dummy_timer", dummy_timer_callback, attotime::from_hz(50))
1642   MCFG_TIMER_DRIVER_ADD_PERIODIC("dummy_timer", nc_state, dummy_timer_callback, attotime::from_hz(50))
16441643MACHINE_CONFIG_END
16451644
16461645static const floppy_interface nc200_floppy_interface =
trunk/src/mess/drivers/mz700.c
r18137r18138
8383    TIMER DEVICE CALLBACKS
8484***************************************************************************/
8585
86static TIMER_DEVICE_CALLBACK( ne556_cursor_callback )
86TIMER_DEVICE_CALLBACK_MEMBER(mz_state::ne556_cursor_callback)
8787{
88   mz_state *mz = timer.machine().driver_data<mz_state>();
89   mz->m_cursor_timer ^= 1;
88   m_cursor_timer ^= 1;
9089}
9190
92static TIMER_DEVICE_CALLBACK( ne556_other_callback )
91TIMER_DEVICE_CALLBACK_MEMBER(mz_state::ne556_other_callback)
9392{
94   mz_state *mz = timer.machine().driver_data<mz_state>();
95   mz->m_other_timer ^= 1;
93   m_other_timer ^= 1;
9694}
9795
9896
r18137r18138
370368   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
371369
372370   /* ne556 timers */
373   MCFG_TIMER_ADD_PERIODIC("cursor", ne556_cursor_callback, attotime::from_hz(1.5))
374   MCFG_TIMER_ADD_PERIODIC("other", ne556_other_callback, attotime::from_hz(34.5))
371   MCFG_TIMER_DRIVER_ADD_PERIODIC("cursor", mz_state, ne556_cursor_callback, attotime::from_hz(1.5))
372   MCFG_TIMER_DRIVER_ADD_PERIODIC("other", mz_state, ne556_other_callback, attotime::from_hz(34.5))
375373
376374   /* devices */
377375   MCFG_PIT8253_ADD("pit8253", mz700_pit8253_config)
trunk/src/mess/drivers/pc8401a.c
r18137r18138
6161   if (strobe)   m_key_strobe = strobe;
6262}
6363
64static TIMER_DEVICE_CALLBACK( pc8401a_keyboard_tick )
64TIMER_DEVICE_CALLBACK_MEMBER(pc8401a_state::pc8401a_keyboard_tick)
6565{
66   pc8401a_state *state = timer.machine().driver_data<pc8401a_state>();
67
68   state->scan_keyboard();
66   scan_keyboard();
6967}
7068
7169/* Read/Write Handlers */
r18137r18138
602600   MCFG_CPU_IO_MAP(pc8401a_io)
603601
604602   /* fake keyboard */
605   MCFG_TIMER_ADD_PERIODIC("keyboard", pc8401a_keyboard_tick, attotime::from_hz(64))
603   MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard", pc8401a_state, pc8401a_keyboard_tick, attotime::from_hz(64))
606604
607605   /* devices */
608606   MCFG_UPD1990A_ADD(UPD1990A_TAG, XTAL_32_768kHz, rtc_intf)
r18137r18138
635633   MCFG_CPU_IO_MAP(pc8500_io)
636634
637635   /* fake keyboard */
638   MCFG_TIMER_ADD_PERIODIC("keyboard", pc8401a_keyboard_tick, attotime::from_hz(64))
636   MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard", pc8401a_state, pc8401a_keyboard_tick, attotime::from_hz(64))
639637
640638   /* devices */
641639   MCFG_UPD1990A_ADD(UPD1990A_TAG, XTAL_32_768kHz, rtc_intf)
trunk/src/mess/drivers/bullet.c
r18137r18138
671671//  Z80CTC_INTERFACE( ctc_intf )
672672//-------------------------------------------------
673673
674static TIMER_DEVICE_CALLBACK( ctc_tick )
674TIMER_DEVICE_CALLBACK_MEMBER(bullet_state::ctc_tick)
675675{
676   bullet_state *state = timer.machine().driver_data<bullet_state>();
676   m_ctc->trg0(1);
677   m_ctc->trg0(0);
677678
678   state->m_ctc->trg0(1);
679   state->m_ctc->trg0(0);
679   m_ctc->trg1(1);
680   m_ctc->trg1(0);
680681
681   state->m_ctc->trg1(1);
682   state->m_ctc->trg1(0);
683
684   state->m_ctc->trg2(1);
685   state->m_ctc->trg2(0);
682   m_ctc->trg2(1);
683   m_ctc->trg2(0);
686684}
687685
688686static WRITE_LINE_DEVICE_HANDLER( dart_rxtxca_w )
r18137r18138
11641162
11651163   // devices
11661164   MCFG_Z80CTC_ADD(Z80CTC_TAG, XTAL_16MHz/4, ctc_intf)
1167   MCFG_TIMER_ADD_PERIODIC("ctc", ctc_tick, attotime::from_hz(XTAL_4_9152MHz/4))
1165   MCFG_TIMER_DRIVER_ADD_PERIODIC("ctc", bullet_state, ctc_tick, attotime::from_hz(XTAL_4_9152MHz/4))
11681166   MCFG_Z80DART_ADD(Z80DART_TAG, XTAL_16MHz/4, dart_intf)
11691167   MCFG_Z80DMA_ADD(Z80DMA_TAG, XTAL_16MHz/4, dma_intf)
11701168   MCFG_Z80PIO_ADD(Z80PIO_TAG, XTAL_16MHz/4, pio_intf)
r18137r18138
11951193
11961194   // devices
11971195   MCFG_Z80CTC_ADD(Z80CTC_TAG, XTAL_16MHz/4, ctc_intf)
1198   MCFG_TIMER_ADD_PERIODIC("ctc", ctc_tick, attotime::from_hz(XTAL_4_9152MHz/4))
1196   MCFG_TIMER_DRIVER_ADD_PERIODIC("ctc", bullet_state, ctc_tick, attotime::from_hz(XTAL_4_9152MHz/4))
11991197   MCFG_Z80DART_ADD(Z80DART_TAG, XTAL_16MHz/4, dart_intf)
12001198   MCFG_Z80DMA_ADD(Z80DMA_TAG, XTAL_16MHz/4, dma_intf)
12011199   MCFG_Z80PIO_ADD(Z80PIO_TAG, XTAL_16MHz/4, bulletf_pio_intf)
trunk/src/mess/drivers/portfoli.c
r18137r18138
247247//  TIMER_DEVICE_CALLBACK( keyboard_tick )
248248//-------------------------------------------------
249249
250static TIMER_DEVICE_CALLBACK( keyboard_tick )
250TIMER_DEVICE_CALLBACK_MEMBER(portfolio_state::keyboard_tick)
251251{
252   portfolio_state *state = timer.machine().driver_data<portfolio_state>();
253
254   state->scan_keyboard();
252   scan_keyboard();
255253}
256254
257255//-------------------------------------------------
r18137r18138
370368//  TIMER_DEVICE_CALLBACK( system_tick )
371369//-------------------------------------------------
372370
373static TIMER_DEVICE_CALLBACK( system_tick )
371TIMER_DEVICE_CALLBACK_MEMBER(portfolio_state::system_tick)
374372{
375   portfolio_state *state = timer.machine().driver_data<portfolio_state>();
376
377   state->trigger_interrupt(INT_TICK);
373   trigger_interrupt(INT_TICK);
378374}
379375
380376//-------------------------------------------------
381377//  TIMER_DEVICE_CALLBACK( counter_tick )
382378//-------------------------------------------------
383379
384static TIMER_DEVICE_CALLBACK( counter_tick )
380TIMER_DEVICE_CALLBACK_MEMBER(portfolio_state::counter_tick)
385381{
386   portfolio_state *state = timer.machine().driver_data<portfolio_state>();
387
388   state->m_counter++;
382   m_counter++;
389383}
390384
391385//-------------------------------------------------
r18137r18138
859853   MCFG_I8255A_ADD(M82C55A_TAG, ppi_intf)
860854   MCFG_CENTRONICS_PRINTER_ADD(CENTRONICS_TAG, centronics_intf)
861855   MCFG_INS8250_ADD(M82C50A_TAG, i8250_intf, XTAL_1_8432MHz) // should be MCFG_INS8250A_ADD
862   MCFG_TIMER_ADD_PERIODIC("counter", counter_tick, attotime::from_hz(XTAL_32_768kHz/16384))
863   MCFG_TIMER_ADD_PERIODIC(TIMER_TICK_TAG, system_tick, attotime::from_hz(XTAL_32_768kHz/32768))
856   MCFG_TIMER_DRIVER_ADD_PERIODIC("counter", portfolio_state, counter_tick, attotime::from_hz(XTAL_32_768kHz/16384))
857   MCFG_TIMER_DRIVER_ADD_PERIODIC(TIMER_TICK_TAG, portfolio_state, system_tick, attotime::from_hz(XTAL_32_768kHz/32768))
864858
865859   /* fake keyboard */
866   MCFG_TIMER_ADD_PERIODIC("keyboard", keyboard_tick, attotime::from_usec(2500))
860   MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard", portfolio_state, keyboard_tick, attotime::from_usec(2500))
867861
868862   /* cartridge */
869863   MCFG_CARTSLOT_ADD("cart")
trunk/src/mess/drivers/adam.c
r18137r18138
11651165//  TIMER_DEVICE_CALLBACK( paddle_tick )
11661166//-------------------------------------------------
11671167
1168static TIMER_DEVICE_CALLBACK( paddle_tick )
1168TIMER_DEVICE_CALLBACK_MEMBER(adam_state::paddle_tick)
11691169{
1170   adam_state *state = timer.machine().driver_data<adam_state>();
1171
11721170   // TODO: improve irq behaviour (see drivers/coleco.c)
1173   if (coleco_scan_paddles(timer.machine(), &state->m_joy_status0, &state->m_joy_status1))
1174      state->m_maincpu->set_input_line(INPUT_LINE_IRQ0, HOLD_LINE);
1171   if (coleco_scan_paddles(machine(), &m_joy_status0, &m_joy_status1))
1172      m_maincpu->set_input_line(INPUT_LINE_IRQ0, HOLD_LINE);
11751173}
11761174
11771175
r18137r18138
17321730    MCFG_SOUND_CONFIG(psg_intf)
17331731
17341732   // devices
1735   MCFG_TIMER_ADD_PERIODIC("paddles", paddle_tick, attotime::from_msec(20))
1733   MCFG_TIMER_DRIVER_ADD_PERIODIC("paddles", adam_state, paddle_tick, attotime::from_msec(20))
17361734   MCFG_WD2793_ADD(WD2793_TAG, fdc_intf)
17371735   MCFG_LEGACY_FLOPPY_DRIVE_ADD(FLOPPY_0, adam_floppy_interface)
17381736   MCFG_CASSETTE_ADD(CASSETTE_TAG, adam_cassette_interface)
trunk/src/mess/drivers/mc80.c
r18137r18138
134134INPUT_PORTS_END
135135
136136
137static TIMER_DEVICE_CALLBACK( mc8020_kbd )
137TIMER_DEVICE_CALLBACK_MEMBER(mc80_state::mc8020_kbd)
138138{
139   device_t *cpu = timer.machine().device( "maincpu" );
139   device_t *cpu = machine().device( "maincpu" );
140140   address_space &mem = cpu->memory().space(AS_PROGRAM);
141141   char kbdrow[6];
142142   UINT8 i;
143143   for (i = 1; i < 8; i++)
144144   {
145145      sprintf(kbdrow,"X%X", i);
146      mem.write_word(0xd20+i, timer.machine().root_device().ioport(kbdrow)->read());
146      mem.write_word(0xd20+i, machine().root_device().ioport(kbdrow)->read());
147147   }
148148}
149149
r18137r18138
180180   /* Devices */
181181   MCFG_Z80PIO_ADD( "z80pio", XTAL_2_4576MHz, mc8020_z80pio_intf )
182182   MCFG_Z80CTC_ADD( "z80ctc", XTAL_2_4576MHz / 100, mc8020_ctc_intf )
183   MCFG_TIMER_ADD_PERIODIC("mc8020_kbd", mc8020_kbd, attotime::from_hz(50)) // keyscanner
183   MCFG_TIMER_DRIVER_ADD_PERIODIC("mc8020_kbd", mc80_state, mc8020_kbd, attotime::from_hz(50))
184184MACHINE_CONFIG_END
185185
186186static MACHINE_CONFIG_START( mc8030, mc80_state )
trunk/src/mess/drivers/fidelz80.c
r18137r18138
10081008   memset(m_digit_line_status, 0, sizeof(m_digit_line_status));
10091009}
10101010
1011static TIMER_DEVICE_CALLBACK( nmi_timer )
1011TIMER_DEVICE_CALLBACK_MEMBER(fidelz80_state::nmi_timer)
10121012{
1013   timer.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
1013   machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
10141014}
10151015
10161016/******************************************************************************
r18137r18138
13351335   MCFG_I8255_ADD("ppi8255", vsc_ppi8255_intf)
13361336   MCFG_Z80PIO_ADD("z80pio", XTAL_4MHz, vsc_z80pio_intf)
13371337
1338   MCFG_TIMER_ADD_PERIODIC("nmi_timer", nmi_timer, attotime::from_hz(600))
1338   MCFG_TIMER_DRIVER_ADD_PERIODIC("nmi_timer", fidelz80_state, nmi_timer, attotime::from_hz(600))
13391339   MCFG_TIMER_START_DELAY(attotime::from_hz(600))
13401340
13411341   /* sound hardware */
trunk/src/mess/drivers/x07.c
r18137r18138
13581358   }
13591359}
13601360
1361static TIMER_DEVICE_CALLBACK( blink_timer )
1361TIMER_DEVICE_CALLBACK_MEMBER(x07_state::blink_timer)
13621362{
1363   x07_state *state = timer.machine().driver_data<x07_state>();
1364
1365   state->m_blink = !state->m_blink;
1363   m_blink = !m_blink;
13661364}
13671365
13681366TIMER_CALLBACK_MEMBER(x07_state::rsta_clear)
r18137r18138
15241522   /* printer */
15251523   MCFG_PRINTER_ADD("printer")
15261524
1527   MCFG_TIMER_ADD_PERIODIC("blink_timer", blink_timer, attotime::from_msec(300))
1525   MCFG_TIMER_DRIVER_ADD_PERIODIC("blink_timer", x07_state, blink_timer, attotime::from_msec(300))
15281526
15291527   MCFG_NVRAM_HANDLER( x07 )
15301528
trunk/src/mess/drivers/xerox820.c
r18137r18138
133133   m_keydata = keydata;
134134}
135135
136static TIMER_DEVICE_CALLBACK( xerox820_keyboard_tick )
136TIMER_DEVICE_CALLBACK_MEMBER(xerox820_state::xerox820_keyboard_tick)
137137{
138   xerox820_state *state = timer.machine().driver_data<xerox820_state>();
139   state->scan_keyboard();
138   scan_keyboard();
140139}
141140
142141/* Read/Write Handlers */
r18137r18138
552551
553552/* Z80 CTC */
554553
555static TIMER_DEVICE_CALLBACK( ctc_tick )
554TIMER_DEVICE_CALLBACK_MEMBER(xerox820_state::ctc_tick)
556555{
557   xerox820_state *state = timer.machine().driver_data<xerox820_state>();
558
559   state->m_ctc->trg0(1);
560   state->m_ctc->trg0(0);
556   m_ctc->trg0(1);
557   m_ctc->trg0(0);
561558}
562559
563560static WRITE_LINE_DEVICE_HANDLER( ctc_z0_w )
r18137r18138
848845   MCFG_PALETTE_INIT(black_and_white)
849846
850847   /* keyboard */
851   MCFG_TIMER_ADD_PERIODIC("keyboard", xerox820_keyboard_tick,attotime::from_hz(60))
852   MCFG_TIMER_ADD_PERIODIC("ctc", ctc_tick, attotime::from_hz(XTAL_20MHz/8))
848   MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard", xerox820_state, xerox820_keyboard_tick, attotime::from_hz(60))
849   MCFG_TIMER_DRIVER_ADD_PERIODIC("ctc", xerox820_state, ctc_tick, attotime::from_hz(XTAL_20MHz/8))
853850
854851   /* sound hardware */
855852   MCFG_SPEAKER_STANDARD_MONO("mono")
r18137r18138
886883   MCFG_PALETTE_INIT(black_and_white)
887884
888885   /* keyboard */
889   MCFG_TIMER_ADD_PERIODIC("keyboard", xerox820_keyboard_tick, attotime::from_hz(60))
890   MCFG_TIMER_ADD_PERIODIC("ctc", ctc_tick, attotime::from_hz(XTAL_16MHz/4))
886   MCFG_TIMER_DRIVER_ADD_PERIODIC("keyboard", xerox820_state, xerox820_keyboard_tick, attotime::from_hz(60))
887   MCFG_TIMER_DRIVER_ADD_PERIODIC("ctc", xerox820_state, ctc_tick, attotime::from_hz(XTAL_16MHz/4))
891888
892889   /* sound hardware */
893890   MCFG_SPEAKER_STANDARD_MONO("mono")
trunk/src/mess/drivers/mpf1.c
r18137r18138
333333
334334/* Machine Initialization */
335335
336static TIMER_DEVICE_CALLBACK( check_halt_callback )
336TIMER_DEVICE_CALLBACK_MEMBER(mpf1_state::check_halt_callback)
337337{
338   mpf1_state *state = timer.machine().driver_data<mpf1_state>();
339
340338   // halt-LED; the red one, is turned on when the processor is halted
341339   // TODO: processor seems to halt, but restarts(?) at 0x0000 after a while -> fix
342   INT64 led_halt = state->m_maincpu->state_int(Z80_HALT);
343   set_led_status(timer.machine(), 1, led_halt);
340   INT64 led_halt = m_maincpu->state_int(Z80_HALT);
341   set_led_status(machine(), 1, led_halt);
344342}
345343
346344void mpf1_state::machine_start()
r18137r18138
382380   MCFG_SOUND_ADD(SPEAKER_TAG, SPEAKER_SOUND, 0)
383381   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
384382
385   MCFG_TIMER_ADD_PERIODIC("halt_timer", check_halt_callback, attotime::from_hz(1))
383   MCFG_TIMER_DRIVER_ADD_PERIODIC("halt_timer", mpf1_state, check_halt_callback, attotime::from_hz(1))
386384MACHINE_CONFIG_END
387385
388386static MACHINE_CONFIG_START( mpf1b, mpf1_state )
r18137r18138
410408   MCFG_SOUND_CONFIG(mpf1_tms5220_intf)
411409   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
412410
413   MCFG_TIMER_ADD_PERIODIC("halt_timer", check_halt_callback, attotime::from_hz(1))
411   MCFG_TIMER_DRIVER_ADD_PERIODIC("halt_timer", mpf1_state, check_halt_callback, attotime::from_hz(1))
414412MACHINE_CONFIG_END
415413
416414static MACHINE_CONFIG_START( mpf1p, mpf1_state )
r18137r18138
434432   MCFG_SOUND_ADD(SPEAKER_TAG, SPEAKER_SOUND, 0)
435433   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
436434
437   MCFG_TIMER_ADD_PERIODIC("halt_timer", check_halt_callback, attotime::from_hz(1))
435   MCFG_TIMER_DRIVER_ADD_PERIODIC("halt_timer", mpf1_state, check_halt_callback, attotime::from_hz(1))
438436MACHINE_CONFIG_END
439437
440438/* ROMs */
trunk/src/mess/drivers/avigo.c
r18137r18138
809809GFXDECODE_END
810810
811811
812static TIMER_DEVICE_CALLBACK( avigo_scan_timer )
812TIMER_DEVICE_CALLBACK_MEMBER(avigo_state::avigo_scan_timer)
813813{
814   avigo_state *state = timer.machine().driver_data<avigo_state>();
814   m_irq |= (1<<1);
815815
816   state->m_irq |= (1<<1);
817
818   state->refresh_ints();
816   refresh_ints();
819817}
820818
821static TIMER_DEVICE_CALLBACK( avigo_1hz_timer )
819TIMER_DEVICE_CALLBACK_MEMBER(avigo_state::avigo_1hz_timer)
822820{
823   avigo_state *state = timer.machine().driver_data<avigo_state>();
821   m_irq |= (1<<4);
824822
825   state->m_irq |= (1<<4);
826
827   state->refresh_ints();
823   refresh_ints();
828824}
829825
830826static QUICKLOAD_LOAD(avigo)
r18137r18138
930926   MCFG_NVRAM_ADD_CUSTOM_DRIVER("nvram", avigo_state, nvram_init)
931927
932928   // IRQ 1 is used for scan the pen and for cursor blinking
933   MCFG_TIMER_ADD_PERIODIC("scan_timer", avigo_scan_timer, attotime::from_hz(50))
929   MCFG_TIMER_DRIVER_ADD_PERIODIC("scan_timer", avigo_state, avigo_scan_timer, attotime::from_hz(50))
934930
935931   // IRQ 4 is generated every second, used for auto power off
936   MCFG_TIMER_ADD_PERIODIC("1hz_timer", avigo_1hz_timer, attotime::from_hz(1))
932   MCFG_TIMER_DRIVER_ADD_PERIODIC("1hz_timer", avigo_state, avigo_1hz_timer, attotime::from_hz(1))
937933
938934   /* quickload */
939935   MCFG_QUICKLOAD_ADD("quickload", avigo, "app", 0)
trunk/src/mess/drivers/cosmicos.c
r18137r18138
341341
342342/* Video */
343343
344static TIMER_DEVICE_CALLBACK( digit_tick )
344TIMER_DEVICE_CALLBACK_MEMBER(cosmicos_state::digit_tick)
345345{
346   cosmicos_state *state = timer.machine().driver_data<cosmicos_state>();
346   m_digit = !m_digit;
347347
348   state->m_digit = !state->m_digit;
349
350   output_set_digit_value(state->m_digit, state->m_segment);
348   output_set_digit_value(m_digit, m_segment);
351349}
352350
353static TIMER_DEVICE_CALLBACK( int_tick )
351TIMER_DEVICE_CALLBACK_MEMBER(cosmicos_state::int_tick)
354352{
355   cosmicos_state *state = timer.machine().driver_data<cosmicos_state>();
356
357   state->m_maincpu->set_input_line(COSMAC_INPUT_LINE_INT, ASSERT_LINE);
353   m_maincpu->set_input_line(COSMAC_INPUT_LINE_INT, ASSERT_LINE);
358354}
359355
360356WRITE_LINE_MEMBER( cosmicos_state::dmaout_w )
r18137r18138
569565    /* video hardware */
570566   MCFG_DEFAULT_LAYOUT( layout_cosmicos )
571567   MCFG_DM9368_ADD(DM9368_TAG, led_intf)
572   MCFG_TIMER_ADD_PERIODIC("digit", digit_tick, attotime::from_hz(100))
573   MCFG_TIMER_ADD_PERIODIC("interrupt", int_tick, attotime::from_hz(1000))
568   MCFG_TIMER_DRIVER_ADD_PERIODIC("digit", cosmicos_state, digit_tick, attotime::from_hz(100))
569   MCFG_TIMER_DRIVER_ADD_PERIODIC("interrupt", cosmicos_state, int_tick, attotime::from_hz(1000))
574570
575571   MCFG_CDP1864_SCREEN_ADD(SCREEN_TAG, XTAL_1_75MHz)
576572   MCFG_SCREEN_UPDATE_DEVICE(CDP1864_TAG, cdp1864_device, screen_update)
trunk/src/mame/drivers/namcona1.c
r18137r18138
955955ADDRESS_MAP_END
956956
957957
958static TIMER_DEVICE_CALLBACK( namcona1_interrupt )
958TIMER_DEVICE_CALLBACK_MEMBER(namcona1_state::namcona1_interrupt)
959959{
960   namcona1_state *state = timer.machine().driver_data<namcona1_state>();
961960   int scanline = param;
962   int enabled = state->m_mEnableInterrupts ? ~state->m_vreg[0x1a/2] : 0;
961   int enabled = m_mEnableInterrupts ? ~m_vreg[0x1a/2] : 0;
963962
964963   // vblank
965964   if (scanline == 224)
966965   {
967      simulate_mcu( timer.machine() );
966      simulate_mcu( machine() );
968967      if (enabled & 8)
969         state->m_maincpu->set_input_line(4, HOLD_LINE);
968         m_maincpu->set_input_line(4, HOLD_LINE);
970969   }
971970
972971   // posirq, used with dolphin in Emeraldia's "how to play" attract mode
973   int posirq_scanline = state->m_vreg[0x8a/2] & 0xff;
972   int posirq_scanline = m_vreg[0x8a/2] & 0xff;
974973   if (scanline == posirq_scanline && enabled & 4)
975974   {
976975      if (posirq_scanline)
977         timer.machine().primary_screen->update_partial(posirq_scanline);
976         machine().primary_screen->update_partial(posirq_scanline);
978977
979      state->m_maincpu->set_input_line(3, HOLD_LINE);
978      m_maincpu->set_input_line(3, HOLD_LINE);
980979   }
981980}
982981
r18137r18138
984983//                 IRQ 1 =>
985984//                 IRQ 2 =>
986985
987static TIMER_DEVICE_CALLBACK( mcu_interrupt )
986TIMER_DEVICE_CALLBACK_MEMBER(namcona1_state::mcu_interrupt)
988987{
989   namcona1_state *state = timer.machine().driver_data<namcona1_state>();
990988   int scanline = param;
991989
992990   // vblank
993991   if (scanline == 224)
994      state->m_mcu->set_input_line(M37710_LINE_IRQ1, HOLD_LINE);
992      m_mcu->set_input_line(M37710_LINE_IRQ1, HOLD_LINE);
995993
996994   // adc (timing guessed, when does this trigger?)
997995   if (scanline == 0)
998      state->m_mcu->set_input_line(M37710_LINE_ADC, HOLD_LINE);
996      m_mcu->set_input_line(M37710_LINE_ADC, HOLD_LINE);
999997}
1000998
1001999static const c140_interface C140_interface_typeA =
r18137r18138
10081006   /* basic machine hardware */
10091007   MCFG_CPU_ADD("maincpu", M68000, 50113000/4)
10101008   MCFG_CPU_PROGRAM_MAP(namcona1_main_map)
1011   MCFG_TIMER_ADD_SCANLINE("scan_main", namcona1_interrupt, "screen", 0, 1)
1009   MCFG_TIMER_DRIVER_ADD_SCANLINE("scan_main", namcona1_state, namcona1_interrupt, "screen", 0, 1)
10121010
10131011   MCFG_CPU_ADD("mcu", M37702, 50113000/4)
10141012   MCFG_CPU_PROGRAM_MAP(namcona1_mcu_map)
10151013   MCFG_CPU_IO_MAP( namcona1_mcu_io_map)
1016   MCFG_TIMER_ADD_SCANLINE("scan_mcu", mcu_interrupt, "screen", 0, 1)
1014   MCFG_TIMER_DRIVER_ADD_SCANLINE("scan_mcu", namcona1_state, mcu_interrupt, "screen", 0, 1)
10171015
10181016   MCFG_NVRAM_HANDLER(namcosna1)
10191017   MCFG_QUANTUM_TIME(attotime::from_hz(2400))
trunk/src/mame/drivers/bsktball.c
r18137r18138
249249   /* basic machine hardware */
250250   MCFG_CPU_ADD("maincpu", M6502,750000)
251251   MCFG_CPU_PROGRAM_MAP(main_map)
252   MCFG_TIMER_ADD_SCANLINE("scantimer", bsktball_scanline, "screen", 0, 1)
252   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", bsktball_state, bsktball_scanline, "screen", 0, 1)
253253
254254
255255   /* video hardware */
trunk/src/mame/drivers/vball.c
r18137r18138
103103      return (vcount - 0x18) | 0x100;
104104}
105105
106static TIMER_DEVICE_CALLBACK( vball_scanline )
106TIMER_DEVICE_CALLBACK_MEMBER(vball_state::vball_scanline)
107107{
108   vball_state *state = timer.machine().driver_data<vball_state>();
109108   int scanline = param;
110   int screen_height = timer.machine().primary_screen->height();
109   int screen_height = machine().primary_screen->height();
111110   int vcount_old = scanline_to_vcount((scanline == 0) ? screen_height - 1 : scanline - 1);
112111   int vcount = scanline_to_vcount(scanline);
113112
114113   /* Update to the current point */
115114   if (scanline > 0)
116115   {
117      timer.machine().primary_screen->update_partial(scanline - 1);
116      machine().primary_screen->update_partial(scanline - 1);
118117   }
119118
120119   /* IRQ fires every on every 8th scanline */
121120   if (!(vcount_old & 8) && (vcount & 8))
122121   {
123      timer.machine().device("maincpu")->execute().set_input_line(M6502_IRQ_LINE, ASSERT_LINE);
122      machine().device("maincpu")->execute().set_input_line(M6502_IRQ_LINE, ASSERT_LINE);
124123   }
125124
126125   /* NMI fires on scanline 248 (VBL) and is latched */
127126   if (vcount == 0xf8)
128127   {
129      timer.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
128      machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
130129   }
131130
132131   /* Save the scroll x register value */
133132   if (scanline < 256)
134133   {
135      state->m_vb_scrollx[255 - scanline] = (state->m_vb_scrollx_hi + state->m_vb_scrollx_lo + 4);
134      m_vb_scrollx[255 - scanline] = (m_vb_scrollx_hi + m_vb_scrollx_lo + 4);
136135   }
137136}
138137
r18137r18138
410409   /* basic machine hardware */
411410   MCFG_CPU_ADD("maincpu", M6502, CPU_CLOCK)   /* 2 MHz - measured by guru but it makes the game far far too slow ?! */
412411   MCFG_CPU_PROGRAM_MAP(main_map)
413   MCFG_TIMER_ADD_SCANLINE("scantimer", vball_scanline, "screen", 0, 1)
412   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", vball_state, vball_scanline, "screen", 0, 1)
414413
415414   MCFG_CPU_ADD("audiocpu", Z80, 3579545)   /* 3.579545 MHz */
416415   MCFG_CPU_PROGRAM_MAP(sound_map)
trunk/src/mame/drivers/bishi.c
r18137r18138
106106   COMBINE_DATA(&m_cur_control2);
107107}
108108
109static TIMER_DEVICE_CALLBACK( bishi_scanline )
109TIMER_DEVICE_CALLBACK_MEMBER(bishi_state::bishi_scanline)
110110{
111   bishi_state *state = timer.machine().driver_data<bishi_state>();
112111   int scanline = param;
113112
114   if (state->m_cur_control & 0x800)
113   if (m_cur_control & 0x800)
115114   {
116115      if(scanline == 240) // vblank-out irq
117         timer.machine().device("maincpu")->execute().set_input_line(M68K_IRQ_3, HOLD_LINE);
116         machine().device("maincpu")->execute().set_input_line(M68K_IRQ_3, HOLD_LINE);
118117
119118      if(scanline == 0) // vblank-in irq
120         timer.machine().device("maincpu")->execute().set_input_line(M68K_IRQ_4, HOLD_LINE);
119         machine().device("maincpu")->execute().set_input_line(M68K_IRQ_4, HOLD_LINE);
121120   }
122121}
123122
r18137r18138
411410   /* basic machine hardware */
412411   MCFG_CPU_ADD("maincpu", M68000, CPU_CLOCK) /* 12MHz (24MHz OSC / 2 ) */
413412   MCFG_CPU_PROGRAM_MAP(main_map)
414   MCFG_TIMER_ADD_SCANLINE("scantimer", bishi_scanline, "screen", 0, 1)
413   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", bishi_state, bishi_scanline, "screen", 0, 1)
415414
416415
417416   /* video hardware */
trunk/src/mame/drivers/ssv.c
r18137r18138
232232   COMBINE_DATA(&m_irq_enable);
233233}
234234
235static TIMER_DEVICE_CALLBACK( ssv_interrupt )
235TIMER_DEVICE_CALLBACK_MEMBER(ssv_state::ssv_interrupt)
236236{
237   ssv_state *state = timer.machine().driver_data<ssv_state>();
238237   int scanline = param;
239238
240239   if (scanline == 0)
241240   {
242      if (state->m_interrupt_ultrax)
241      if (m_interrupt_ultrax)
243242      {
244         state->m_requested_int |= 1 << 1;   // needed by ultrax to coin up, breaks cairblad
245         update_irq_state(timer.machine());
243         m_requested_int |= 1 << 1;   // needed by ultrax to coin up, breaks cairblad
244         update_irq_state(machine());
246245      }
247246   }
248247   else if(scanline == 240)
249248   {
250      state->m_requested_int |= 1 << 3;   // vblank
251      update_irq_state(timer.machine());
249      m_requested_int |= 1 << 3;   // vblank
250      update_irq_state(machine());
252251   }
253252}
254253
255static TIMER_DEVICE_CALLBACK( gdfs_interrupt )
254TIMER_DEVICE_CALLBACK_MEMBER(ssv_state::gdfs_interrupt)
256255{
257   ssv_state *state = timer.machine().driver_data<ssv_state>();
258256   int scanline = param;
259257
260258   if ((scanline % 64) == 0)
261259   {
262      state->m_requested_int |= 1 << 6;   // reads lightgun (4 times for 4 axis)
263      update_irq_state(timer.machine());
260      m_requested_int |= 1 << 6;   // reads lightgun (4 times for 4 axis)
261      update_irq_state(machine());
264262   }
265263   else if(scanline == 240)
266264   {
267      state->m_requested_int |= 1 << 3;   // vblank
268      update_irq_state(timer.machine());
265      m_requested_int |= 1 << 3;   // vblank
266      update_irq_state(machine());
269267   }
270268}
271269
r18137r18138
26022600
26032601   /* basic machine hardware */
26042602   MCFG_CPU_ADD("maincpu", V60, 16000000) /* Based on STA-0001 & STA-0001B System boards */
2605   MCFG_TIMER_ADD_SCANLINE("scantimer", ssv_interrupt, "screen", 0, 1)
2603   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", ssv_state, ssv_interrupt, "screen", 0, 1)
26062604
26072605
26082606   /* video hardware */
r18137r18138
26512649   MCFG_CPU_MODIFY("maincpu")
26522650   MCFG_CPU_PROGRAM_MAP(gdfs_map)
26532651   MCFG_TIMER_MODIFY("scantimer")
2654   MCFG_TIMER_CALLBACK(gdfs_interrupt)
2652   MCFG_TIMER_DRIVER_CALLBACK(ssv_state, gdfs_interrupt)
26552653
26562654   MCFG_EEPROM_93C46_ADD("eeprom")
26572655
trunk/src/mame/drivers/thedeep.c
r18137r18138
406406   DEVCB_LINE(irqhandler)
407407};
408408
409static TIMER_DEVICE_CALLBACK( thedeep_interrupt )
409TIMER_DEVICE_CALLBACK_MEMBER(thedeep_state::thedeep_interrupt)
410410{
411   thedeep_state *state = timer.machine().driver_data<thedeep_state>();
412411   int scanline = param;
413412
414413   if (scanline == 124) // TODO: clean this
415414   {
416      if (state->m_protection_command != 0x59)
415      if (m_protection_command != 0x59)
417416      {
418         int coins = timer.machine().root_device().ioport("MCU")->read();
419         if      (coins & 1)   state->m_protection_data = 1;
420         else if   (coins & 2)   state->m_protection_data = 2;
421         else if   (coins & 4)   state->m_protection_data = 3;
422         else            state->m_protection_data = 0;
417         int coins = machine().root_device().ioport("MCU")->read();
418         if      (coins & 1)   m_protection_data = 1;
419         else if   (coins & 2)   m_protection_data = 2;
420         else if   (coins & 4)   m_protection_data = 3;
421         else            m_protection_data = 0;
423422
424         if (state->m_protection_data)
425            state->m_protection_irq = 1;
423         if (m_protection_data)
424            m_protection_irq = 1;
426425      }
427      if (state->m_protection_irq)
428         state->m_maincpu->set_input_line(0, HOLD_LINE);
426      if (m_protection_irq)
427         m_maincpu->set_input_line(0, HOLD_LINE);
429428   }
430429   else if(scanline == 0)
431430   {
432      if (state->m_nmi_enable)
431      if (m_nmi_enable)
433432      {
434         state->m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
435         state->m_maincpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
433         m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
434         m_maincpu->set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
436435      }
437436   }
438437}
r18137r18138
448447   /* basic machine hardware */
449448   MCFG_CPU_ADD("maincpu", Z80, XTAL_12MHz/2)      /* verified on pcb */
450449   MCFG_CPU_PROGRAM_MAP(main_map)
451   MCFG_TIMER_ADD_SCANLINE("scantimer", thedeep_interrupt, "screen", 0, 1) /* IRQ by MCU, NMI by vblank (maskable) */
450   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", thedeep_state, thedeep_interrupt, "screen", 0, 1)
452451
453452   MCFG_CPU_ADD("audiocpu", M65C02, XTAL_12MHz/8)      /* verified on pcb */
454453   MCFG_CPU_PROGRAM_MAP(audio_map)
trunk/src/mame/drivers/deco32.c
r18137r18138
277277
278278
279279
280static TIMER_DEVICE_CALLBACK( interrupt_gen )
280TIMER_DEVICE_CALLBACK_MEMBER(deco32_state::interrupt_gen)
281281{
282   timer.machine().device("maincpu")->execute().set_input_line(ARM_IRQ_LINE, HOLD_LINE);
282   machine().device("maincpu")->execute().set_input_line(ARM_IRQ_LINE, HOLD_LINE);
283283}
284284
285285READ32_MEMBER(deco32_state::deco32_irq_controller_r)
r18137r18138
17421742
17431743   MCFG_MACHINE_RESET_OVERRIDE(deco32_state,deco32)
17441744
1745   MCFG_TIMER_ADD("int_timer", interrupt_gen)
1745   MCFG_TIMER_DRIVER_ADD("int_timer", deco32_state, interrupt_gen)
17461746
17471747   MCFG_SCREEN_ADD("screen", RASTER)
17481748   MCFG_SCREEN_REFRESH_RATE(60)
r18137r18138
19511951   MCFG_MACHINE_RESET_OVERRIDE(deco32_state,deco32)
19521952   MCFG_EEPROM_93C46_ADD("eeprom")
19531953
1954   MCFG_TIMER_ADD("int_timer", interrupt_gen)
1954   MCFG_TIMER_DRIVER_ADD("int_timer", deco32_state, interrupt_gen)
19551955
19561956   /* video hardware */
19571957   MCFG_SCREEN_ADD("screen", RASTER)
r18137r18138
19921992   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
19931993MACHINE_CONFIG_END
19941994
1995static TIMER_DEVICE_CALLBACK( lockload_vbl_irq )
1995TIMER_DEVICE_CALLBACK_MEMBER(deco32_state::lockload_vbl_irq)
19961996{
1997   deco32_state *state = timer.machine().driver_data<deco32_state>();
19981997   int scanline = param;
19991998
20001999   if(scanline == 31*8)
20012000   {
2002      state->m_irq_source = 0;
2003      state->m_maincpu->set_input_line(ARM_IRQ_LINE, HOLD_LINE);
2001      m_irq_source = 0;
2002      m_maincpu->set_input_line(ARM_IRQ_LINE, HOLD_LINE);
20042003   }
20052004
20062005   if(scanline == 0)
20072006   {
2008      state->m_irq_source = 1;
2009      state->m_maincpu->set_input_line(ARM_IRQ_LINE, HOLD_LINE);
2007      m_irq_source = 1;
2008      m_maincpu->set_input_line(ARM_IRQ_LINE, HOLD_LINE);
20102009   }
20112010}
20122011
r18137r18138
20162015   /* basic machine hardware */
20172016   MCFG_CPU_ADD("maincpu", ARM, 28000000/4)
20182017   MCFG_CPU_PROGRAM_MAP(lockload_map)
2019   MCFG_TIMER_ADD_SCANLINE("scantimer", lockload_vbl_irq, "screen", 0, 1)
2018   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", deco32_state, lockload_vbl_irq, "screen", 0, 1)
20202019
20212020   MCFG_CPU_ADD("audiocpu", Z80, 32220000/8)
20222021   MCFG_CPU_PROGRAM_MAP(nslasher_sound)
r18137r18138
20272026   MCFG_MACHINE_RESET_OVERRIDE(deco32_state,deco32)
20282027   MCFG_EEPROM_93C46_ADD("eeprom")
20292028
2030   MCFG_TIMER_ADD("int_timer", interrupt_gen)
2029   MCFG_TIMER_DRIVER_ADD("int_timer", deco32_state, interrupt_gen)
20312030
20322031   /* video hardware */
20332032   MCFG_SCREEN_ADD("screen", RASTER)
trunk/src/mame/drivers/galaxian.c
r18137r18138
12611261}
12621262
12631263
1264static TIMER_DEVICE_CALLBACK( checkmaj_irq0_gen )
1264TIMER_DEVICE_CALLBACK_MEMBER(galaxian_state::checkmaj_irq0_gen)
12651265{
1266   timer.machine().device("audiocpu")->execute().set_input_line(0, HOLD_LINE);
1266   machine().device("audiocpu")->execute().set_input_line(0, HOLD_LINE);
12671267}
12681268
12691269
r18137r18138
20962096
20972097
20982098   /* blinking frequency is determined by 555 counter with Ra=100k, Rb=10k, C=10uF */
2099   MCFG_TIMER_ADD_PERIODIC("stars", galaxian_stars_blink_timer, PERIOD_OF_555_ASTABLE(100000, 10000, 0.00001))
2099   MCFG_TIMER_DRIVER_ADD_PERIODIC("stars", galaxian_state, galaxian_stars_blink_timer, PERIOD_OF_555_ASTABLE(100000, 10000, 0.00001))
21002100
21012101   /* sound hardware */
21022102   MCFG_SPEAKER_STANDARD_MONO("mono")
r18137r18138
22762276   MCFG_CPU_ADD("audiocpu", Z80, 1620000)
22772277   MCFG_CPU_PROGRAM_MAP(checkmaj_sound_map)
22782278
2279   MCFG_TIMER_ADD_SCANLINE("irq0", checkmaj_irq0_gen, "screen", 0, 8)
2279   MCFG_TIMER_DRIVER_ADD_SCANLINE("irq0", galaxian_state, checkmaj_irq0_gen, "screen", 0, 8)
22802280
22812281   /* sound hardware */
22822282   MCFG_SOUND_ADD("aysnd", AY8910, 1620000)
trunk/src/mame/drivers/hyprduel.c
r18137r18138
5858   m_requested_int &= ~param;
5959}
6060
61static TIMER_DEVICE_CALLBACK( hyprduel_interrupt )
61TIMER_DEVICE_CALLBACK_MEMBER(hyprduel_state::hyprduel_interrupt)
6262{
63   hyprduel_state *state = timer.machine().driver_data<hyprduel_state>();
6463   int line = param;
6564
6665   if (line == 0) /* TODO: fix this! */
6766   {
68      state->m_requested_int |= 0x01;      /* vblank */
69      state->m_requested_int |= 0x20;
70      state->m_maincpu->set_input_line(2, HOLD_LINE);
67      m_requested_int |= 0x01;      /* vblank */
68      m_requested_int |= 0x20;
69      m_maincpu->set_input_line(2, HOLD_LINE);
7170      /* the duration is a guess */
72      timer.machine().scheduler().timer_set(attotime::from_usec(2500), timer_expired_delegate(FUNC(hyprduel_state::vblank_end_callback),state), 0x20);
71      machine().scheduler().timer_set(attotime::from_usec(2500), timer_expired_delegate(FUNC(hyprduel_state::vblank_end_callback),this), 0x20);
7372   }
7473   else
75      state->m_requested_int |= 0x12;      /* hsync */
74      m_requested_int |= 0x12;      /* hsync */
7675
77   update_irq_state(timer.machine());
76   update_irq_state(machine());
7877}
7978
8079READ16_MEMBER(hyprduel_state::hyprduel_irq_cause_r)
r18137r18138
669668   /* basic machine hardware */
670669   MCFG_CPU_ADD("maincpu", M68000,20000000/2)      /* 10MHz */
671670   MCFG_CPU_PROGRAM_MAP(hyprduel_map)
672   MCFG_TIMER_ADD_SCANLINE("scantimer", hyprduel_interrupt, "screen", 0, 1)
671   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", hyprduel_state, hyprduel_interrupt, "screen", 0, 1)
673672
674673   MCFG_CPU_ADD("sub", M68000,20000000/2)      /* 10MHz */
675674   MCFG_CPU_PROGRAM_MAP(hyprduel_map2)
r18137r18138
710709   /* basic machine hardware */
711710   MCFG_CPU_ADD("maincpu", M68000,20000000/2)      /* 10MHz */
712711   MCFG_CPU_PROGRAM_MAP(magerror_map)
713   MCFG_TIMER_ADD_SCANLINE("scantimer", hyprduel_interrupt, "screen", 0, 1)
712   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", hyprduel_state, hyprduel_interrupt, "screen", 0, 1)
714713
715714   MCFG_CPU_ADD("sub", M68000,20000000/2)      /* 10MHz */
716715   MCFG_CPU_PROGRAM_MAP(magerror_map2)
trunk/src/mame/drivers/shaolins.c
r18137r18138
1313
1414#define MASTER_CLOCK XTAL_18_432MHz
1515
16static TIMER_DEVICE_CALLBACK( shaolins_interrupt )
16TIMER_DEVICE_CALLBACK_MEMBER(shaolins_state::shaolins_interrupt)
1717{
18   shaolins_state *state = timer.machine().driver_data<shaolins_state>();
1918   int scanline = param;
2019
2120   if(scanline == 240)
22       state->m_maincpu->set_input_line(0, HOLD_LINE);
21       m_maincpu->set_input_line(0, HOLD_LINE);
2322   else if((scanline % 32) == 0)
24      if (state->m_nmi_enable & 0x02) state->m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
23      if (m_nmi_enable & 0x02) m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
2524}
2625
2726
r18137r18138
207206   /* basic machine hardware */
208207   MCFG_CPU_ADD("maincpu", M6809, MASTER_CLOCK/12)        /* verified on pcb */
209208   MCFG_CPU_PROGRAM_MAP(shaolins_map)
210   MCFG_TIMER_ADD_SCANLINE("scantimer", shaolins_interrupt, "screen", 0, 1)
209   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", shaolins_state, shaolins_interrupt, "screen", 0, 1)
211210
212211   /* video hardware */
213212   MCFG_SCREEN_ADD("screen", RASTER)
trunk/src/mame/drivers/lazercmd.c
r18137r18138
236236 * The rate should be at about 1 Hz
237237 *************************************************************/
238238
239static TIMER_DEVICE_CALLBACK( lazercmd_timer )
239TIMER_DEVICE_CALLBACK_MEMBER(lazercmd_state::lazercmd_timer)
240240{
241   lazercmd_state *state = timer.machine().driver_data<lazercmd_state>();
242241   int scanline = param;
243242
244243   if((scanline % 2) == 1)
245244      return;
246245
247   if (++state->m_timer_count >= 64 * 128)
246   if (++m_timer_count >= 64 * 128)
248247   {
249      state->m_timer_count = 0;
250      state->m_sense_state ^= 1;
251      state->m_maincpu->set_input_line(1, (state->m_sense_state) ? ASSERT_LINE : CLEAR_LINE);
248      m_timer_count = 0;
249      m_sense_state ^= 1;
250      m_maincpu->set_input_line(1, (m_sense_state) ? ASSERT_LINE : CLEAR_LINE);
252251   }
253252}
254253
255static TIMER_DEVICE_CALLBACK( bbonk_timer )
254TIMER_DEVICE_CALLBACK_MEMBER(lazercmd_state::bbonk_timer)
256255{
257   lazercmd_state *state = timer.machine().driver_data<lazercmd_state>();
258256   int scanline = param;
259257
260258   if((scanline % 2) == 1)
261259      return;
262260
263   if (++state->m_timer_count >= 64 * 128)
264      state->m_timer_count = 0;
261   if (++m_timer_count >= 64 * 128)
262      m_timer_count = 0;
265263}
266264
267265/*************************************************************
r18137r18138
635633    thus requiring an extra loading of approx 3-5 */
636634   MCFG_CPU_PROGRAM_MAP(lazercmd_map)
637635   MCFG_CPU_IO_MAP(lazercmd_portmap)
638   MCFG_TIMER_ADD_SCANLINE("scantimer", lazercmd_timer, "screen", 0, 1) /* 7680 Hz */
636   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", lazercmd_state, lazercmd_timer, "screen", 0, 1)
639637
640638
641639   /* video hardware */
r18137r18138
669667    thus requiring an extra loading of approx 3-5 */
670668   MCFG_CPU_PROGRAM_MAP(medlanes_map)
671669   MCFG_CPU_IO_MAP(lazercmd_portmap)
672   MCFG_TIMER_ADD_SCANLINE("scantimer", lazercmd_timer, "screen", 0, 1) /* 7680 Hz */
670   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", lazercmd_state, lazercmd_timer, "screen", 0, 1)
673671
674672
675673   /* video hardware */
r18137r18138
703701    thus requiring an extra loading of approx 3-5 */
704702   MCFG_CPU_PROGRAM_MAP(bbonk_map)
705703   MCFG_CPU_IO_MAP(lazercmd_portmap)
706   MCFG_TIMER_ADD_SCANLINE("scantimer", bbonk_timer, "screen", 0, 1) /* 7680 Hz */
704   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", lazercmd_state, bbonk_timer, "screen", 0, 1)
707705
708706
709707   /* video hardware */
trunk/src/mame/drivers/beezer.c
r18137r18138
8888   /* basic machine hardware */
8989   MCFG_CPU_ADD("maincpu", M6809, 1000000)        /* 1 MHz */
9090   MCFG_CPU_PROGRAM_MAP(main_map)
91   MCFG_TIMER_ADD_SCANLINE("scantimer", beezer_interrupt, "screen", 0, 1)
91   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", beezer_state, beezer_interrupt, "screen", 0, 1)
9292
9393   MCFG_CPU_ADD("audiocpu", M6809, 1000000)        /* 1 MHz */
9494   MCFG_CPU_PROGRAM_MAP(sound_map)
trunk/src/mame/drivers/equites.c
r18137r18138
575575// Interrupt Handlers
576576
577577// Equites Hardware
578static TIMER_DEVICE_CALLBACK( equites_scanline )
578TIMER_DEVICE_CALLBACK_MEMBER(equites_state::equites_scanline)
579579{
580580   int scanline = param;
581581
582582   if(scanline == 232) // vblank-out irq
583      timer.machine().device("maincpu")->execute().set_input_line(1, HOLD_LINE);
583      machine().device("maincpu")->execute().set_input_line(1, HOLD_LINE);
584584
585585   if(scanline == 24) // vblank-in irq
586      timer.machine().device("maincpu")->execute().set_input_line(2, HOLD_LINE);
586      machine().device("maincpu")->execute().set_input_line(2, HOLD_LINE);
587587}
588588
589static TIMER_DEVICE_CALLBACK( splndrbt_scanline )
589TIMER_DEVICE_CALLBACK_MEMBER(equites_state::splndrbt_scanline)
590590{
591591   int scanline = param;
592592
593593   if(scanline == 224) // vblank-out irq
594      timer.machine().device("maincpu")->execute().set_input_line(1, HOLD_LINE);
594      machine().device("maincpu")->execute().set_input_line(1, HOLD_LINE);
595595
596596   if(scanline == 32) // vblank-in irq
597      timer.machine().device("maincpu")->execute().set_input_line(2, HOLD_LINE);
597      machine().device("maincpu")->execute().set_input_line(2, HOLD_LINE);
598598}
599599
600600WRITE8_MEMBER(equites_state::equites_8155_w)
r18137r18138
12491249   /* basic machine hardware */
12501250   MCFG_CPU_ADD("maincpu", M68000, XTAL_12MHz/4) /* 68000P8 running at 3mhz! verified on pcb */
12511251   MCFG_CPU_PROGRAM_MAP(equites_map)
1252   MCFG_TIMER_ADD_SCANLINE("scantimer", equites_scanline, "screen", 0, 1)
1252   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", equites_state, equites_scanline, "screen", 0, 1)
12531253
12541254   MCFG_FRAGMENT_ADD(common_sound)
12551255
r18137r18138
12861286   /* basic machine hardware */
12871287   MCFG_CPU_ADD("maincpu", M68000, XTAL_24MHz/4) /* 68000P8 running at 6mhz, verified on pcb */
12881288   MCFG_CPU_PROGRAM_MAP(splndrbt_map)
1289   MCFG_TIMER_ADD_SCANLINE("scantimer", splndrbt_scanline, "screen", 0, 1)
1289   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", equites_state, splndrbt_scanline, "screen", 0, 1)
12901290
12911291   MCFG_FRAGMENT_ADD(common_sound)
12921292
trunk/src/mame/drivers/ironhors.c
r18137r18138
2020 *
2121 *************************************/
2222
23static TIMER_DEVICE_CALLBACK( ironhors_irq )
23TIMER_DEVICE_CALLBACK_MEMBER(ironhors_state::ironhors_irq)
2424{
25   ironhors_state *state = timer.machine().driver_data<ironhors_state>();
2625   int scanline = param;
2726
2827   if (scanline == 240)
2928   {
30      if (*state->m_interrupt_enable & 4)
31         state->m_maincpu->set_input_line(M6809_FIRQ_LINE, HOLD_LINE);
29      if (*m_interrupt_enable & 4)
30         m_maincpu->set_input_line(M6809_FIRQ_LINE, HOLD_LINE);
3231   }
3332   else if (((scanline+16) % 64) == 0)
3433   {
35      if (*state->m_interrupt_enable & 1)
36         state->m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
34      if (*m_interrupt_enable & 1)
35         m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
3736   }
3837}
3938
r18137r18138
380379   /* basic machine hardware */
381380   MCFG_CPU_ADD("maincpu", M6809,18432000/6)        /* 3.072 MHz??? mod by Shingo Suzuki 1999/10/15 */
382381   MCFG_CPU_PROGRAM_MAP(master_map)
383   MCFG_TIMER_ADD_SCANLINE("scantimer", ironhors_irq, "screen", 0, 1)
382   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", ironhors_state, ironhors_irq, "screen", 0, 1)
384383
385384   MCFG_CPU_ADD("soundcpu",Z80,18432000/6)       /* 3.072 MHz */
386385   MCFG_CPU_PROGRAM_MAP(slave_map)
r18137r18138
416415
417416MACHINE_CONFIG_END
418417
419static TIMER_DEVICE_CALLBACK( farwest_irq )
418TIMER_DEVICE_CALLBACK_MEMBER(ironhors_state::farwest_irq)
420419{
421   ironhors_state *state = timer.machine().driver_data<ironhors_state>();
422420   int scanline = param;
423421
424422   if ((scanline % 2) == 1)
425423   {
426      if (*state->m_interrupt_enable & 4)
427         state->m_maincpu->set_input_line(M6809_FIRQ_LINE, HOLD_LINE);
424      if (*m_interrupt_enable & 4)
425         m_maincpu->set_input_line(M6809_FIRQ_LINE, HOLD_LINE);
428426   }
429427   else if ((scanline % 2) == 0)
430428   {
431      if (*state->m_interrupt_enable & 1)
432         state->m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
429      if (*m_interrupt_enable & 1)
430         m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
433431   }
434432}
435433
r18137r18138
459457   MCFG_CPU_MODIFY("maincpu")
460458   MCFG_CPU_PROGRAM_MAP(farwest_master_map)
461459   MCFG_DEVICE_MODIFY("scantimer")
462   MCFG_TIMER_CALLBACK(farwest_irq)
460   MCFG_TIMER_DRIVER_CALLBACK(ironhors_state, farwest_irq)
463461
464462   MCFG_CPU_MODIFY("soundcpu")
465463   MCFG_CPU_PROGRAM_MAP(farwest_slave_map)
trunk/src/mame/drivers/segas24.c
r18137r18138
861861   }
862862}
863863
864static TIMER_DEVICE_CALLBACK( irq_timer_cb )
864TIMER_DEVICE_CALLBACK_MEMBER(segas24_state::irq_timer_cb)
865865{
866   segas24_state *state = timer.machine().driver_data<segas24_state>();
867   state->irq_timer_sync();
866   irq_timer_sync();
868867
869   if(state->irq_tval != 0x1000)
870      fprintf(stderr, "Error: timer desync %x != 1000\n", state->irq_tval);
868   if(irq_tval != 0x1000)
869      fprintf(stderr, "Error: timer desync %x != 1000\n", irq_tval);
871870
872   state->irq_tval = state->irq_tdata;
873   state->irq_timer_start(state->irq_tmode);
871   irq_tval = irq_tdata;
872   irq_timer_start(irq_tmode);
874873
875   state->irq_timer_pend0 = state->irq_timer_pend1 = 1;
876   if(state->irq_allow0 & (1 << IRQ_TIMER))
877      timer.machine().device("maincpu")->execute().set_input_line(IRQ_TIMER+1, ASSERT_LINE);
878   if(state->irq_allow1 & (1 << IRQ_TIMER))
879      timer.machine().device("subcpu")->execute().set_input_line(IRQ_TIMER+1, ASSERT_LINE);
874   irq_timer_pend0 = irq_timer_pend1 = 1;
875   if(irq_allow0 & (1 << IRQ_TIMER))
876      machine().device("maincpu")->execute().set_input_line(IRQ_TIMER+1, ASSERT_LINE);
877   if(irq_allow1 & (1 << IRQ_TIMER))
878      machine().device("subcpu")->execute().set_input_line(IRQ_TIMER+1, ASSERT_LINE);
880879
881   if(state->irq_tmode == 1 || state->irq_tmode == 2)
882      timer.machine().primary_screen->update_now();
880   if(irq_tmode == 1 || irq_tmode == 2)
881      machine().primary_screen->update_now();
883882}
884883
885static TIMER_DEVICE_CALLBACK( irq_timer_clear_cb )
884TIMER_DEVICE_CALLBACK_MEMBER(segas24_state::irq_timer_clear_cb)
886885{
887   segas24_state *state = timer.machine().driver_data<segas24_state>();
888   state->irq_sprite = state->irq_vblank = 0;
889   timer.machine().device("maincpu")->execute().set_input_line(IRQ_VBLANK+1, CLEAR_LINE);
890   timer.machine().device("maincpu")->execute().set_input_line(IRQ_SPRITE+1, CLEAR_LINE);
891   timer.machine().device("subcpu")->execute().set_input_line(IRQ_VBLANK+1, CLEAR_LINE);
892   timer.machine().device("subcpu")->execute().set_input_line(IRQ_SPRITE+1, CLEAR_LINE);
886   irq_sprite = irq_vblank = 0;
887   machine().device("maincpu")->execute().set_input_line(IRQ_VBLANK+1, CLEAR_LINE);
888   machine().device("maincpu")->execute().set_input_line(IRQ_SPRITE+1, CLEAR_LINE);
889   machine().device("subcpu")->execute().set_input_line(IRQ_VBLANK+1, CLEAR_LINE);
890   machine().device("subcpu")->execute().set_input_line(IRQ_SPRITE+1, CLEAR_LINE);
893891}
894892
895static TIMER_DEVICE_CALLBACK( irq_frc_cb )
893TIMER_DEVICE_CALLBACK_MEMBER(segas24_state::irq_frc_cb)
896894{
897   segas24_state *state = timer.machine().driver_data<segas24_state>();
895   if(irq_allow0 & (1 << IRQ_FRC) && frc_mode == 1)
896      machine().device("maincpu")->execute().set_input_line(IRQ_FRC+1, ASSERT_LINE);
898897
899   if(state->irq_allow0 & (1 << IRQ_FRC) && state->frc_mode == 1)
900      timer.machine().device("maincpu")->execute().set_input_line(IRQ_FRC+1, ASSERT_LINE);
901
902   if(state->irq_allow1 & (1 << IRQ_FRC) && state->frc_mode == 1)
903      timer.machine().device("subcpu")->execute().set_input_line(IRQ_FRC+1, ASSERT_LINE);
898   if(irq_allow1 & (1 << IRQ_FRC) && frc_mode == 1)
899      machine().device("subcpu")->execute().set_input_line(IRQ_FRC+1, ASSERT_LINE);
904900}
905901
906902void segas24_state::irq_init()
r18137r18138
985981   return irq_tval & 0xfff;
986982}
987983
988static TIMER_DEVICE_CALLBACK(irq_vbl)
984TIMER_DEVICE_CALLBACK_MEMBER(segas24_state::irq_vbl)
989985{
990   segas24_state *state = timer.machine().driver_data<segas24_state>();
991986   int irq, mask;
992987   int scanline = param;
993988
994989   /* TODO: perhaps vblank irq happens at 400, sprite IRQ certainly don't at 0! */
995   if(scanline == 0) { irq = IRQ_SPRITE; state->irq_sprite = 1; }
996   else if(scanline == 384) { irq = IRQ_VBLANK; state->irq_vblank = 1; }
990   if(scanline == 0) { irq = IRQ_SPRITE; irq_sprite = 1; }
991   else if(scanline == 384) { irq = IRQ_VBLANK; irq_vblank = 1; }
997992   else
998993      return;
999994
1000   state->irq_timer_clear->adjust(attotime::from_hz(HSYNC_CLOCK));
995   irq_timer_clear->adjust(attotime::from_hz(HSYNC_CLOCK));
1001996
1002997   mask = 1 << irq;
1003998
1004   if(state->irq_allow0 & mask)
1005      timer.machine().device("maincpu")->execute().set_input_line(1+irq, ASSERT_LINE);
999   if(irq_allow0 & mask)
1000      machine().device("maincpu")->execute().set_input_line(1+irq, ASSERT_LINE);
10061001
1007   if(state->irq_allow1 & mask)
1008      timer.machine().device("subcpu")->execute().set_input_line(1+irq, ASSERT_LINE);
1002   if(irq_allow1 & mask)
1003      machine().device("subcpu")->execute().set_input_line(1+irq, ASSERT_LINE);
10091004
10101005   if(scanline == 384) {
10111006      // Ensure one index pulse every 20 frames
10121007      // The is some code in bnzabros at 0x852 that makes it crash
10131008      // if the pulse train is too fast
1014      state->fdc_index_count++;
1015      if(state->fdc_index_count >= 20)
1016         state->fdc_index_count = 0;
1009      fdc_index_count++;
1010      if(fdc_index_count >= 20)
1011         fdc_index_count = 0;
10171012   }
10181013
1019   state->irq_timer_sync();
1020   state->irq_vsynctime = timer.machine().time();
1014   irq_timer_sync();
1015   irq_vsynctime = machine().time();
10211016}
10221017
10231018static void irq_ym(device_t *device, int irq)
r18137r18138
19461941   /* basic machine hardware */
19471942   MCFG_CPU_ADD("maincpu", M68000, MASTER_CLOCK/2)
19481943   MCFG_CPU_PROGRAM_MAP(system24_cpu1_map)
1949   MCFG_TIMER_ADD_SCANLINE("scantimer", irq_vbl, "screen", 0, 1)
1944   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", segas24_state, irq_vbl, "screen", 0, 1)
19501945
19511946   MCFG_CPU_ADD("subcpu", M68000, MASTER_CLOCK/2)
19521947   MCFG_CPU_PROGRAM_MAP(system24_cpu2_map)
r18137r18138
19541949   MCFG_QUANTUM_TIME(attotime::from_hz(6000))
19551950
19561951
1957   MCFG_TIMER_ADD("irq_timer", irq_timer_cb)
1958   MCFG_TIMER_ADD("irq_timer_clear", irq_timer_clear_cb)
1952   MCFG_TIMER_DRIVER_ADD("irq_timer", segas24_state, irq_timer_cb)
1953   MCFG_TIMER_DRIVER_ADD("irq_timer_clear", segas24_state, irq_timer_clear_cb)
19591954   MCFG_TIMER_ADD_NONE("frc_timer")
1960   MCFG_TIMER_ADD_PERIODIC("irq_frc", irq_frc_cb, attotime::from_hz(FRC_CLOCK_MODE1))
1955   MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_frc", segas24_state, irq_frc_cb, attotime::from_hz(FRC_CLOCK_MODE1))
19611956
19621957   MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)
19631958
trunk/src/mame/drivers/cosmic.c
r18137r18138
10001000   MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 4*8, 28*8-1)
10011001MACHINE_CONFIG_END
10021002
1003static TIMER_DEVICE_CALLBACK( panic_scanline )
1003TIMER_DEVICE_CALLBACK_MEMBER(cosmic_state::panic_scanline)
10041004{
10051005   int scanline = param;
10061006
10071007   if(scanline == 224) // vblank-out irq
1008      timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xd7); /* RST 10h */
1008      machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xd7); /* RST 10h */
10091009
10101010   if(scanline == 0) // vblank-in irq
1011      timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xcf); /* RST 08h */
1011      machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xcf); /* RST 08h */
10121012}
10131013
10141014
r18137r18138
10171017   /* basic machine hardware */
10181018   MCFG_CPU_MODIFY("maincpu")
10191019   MCFG_CPU_PROGRAM_MAP(panic_map)
1020   MCFG_TIMER_ADD_SCANLINE("scantimer", panic_scanline, "screen", 0, 1)
1020   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", cosmic_state, panic_scanline, "screen", 0, 1)
10211021
10221022   /* video hardware */
10231023   MCFG_GFXDECODE(panic)
trunk/src/mame/drivers/model2.c
r18137r18138
288288   m_timerrun[offset] = 1;
289289}
290290
291static TIMER_DEVICE_CALLBACK( model2_timer_cb )
291TIMER_DEVICE_CALLBACK_MEMBER(model2_state::model2_timer_cb)
292292{
293   model2_state *state = timer.machine().driver_data<model2_state>();
294293   int tnum = (int)(FPTR)ptr;
295294   int bit = tnum + 2;
296295
297   state->m_timers[tnum]->reset();
296   m_timers[tnum]->reset();
298297
299   state->m_intreq |= (1<<bit);
300   if (state->m_intena & (1<<bit))
298   m_intreq |= (1<<bit);
299   if (m_intena & (1<<bit))
301300   {
302      timer.machine().device("maincpu")->execute().set_input_line(I960_IRQ2, ASSERT_LINE);
301      machine().device("maincpu")->execute().set_input_line(I960_IRQ2, ASSERT_LINE);
303302   }
304303
305   state->m_timervals[tnum] = 0;
306   state->m_timerrun[tnum] = 0;
304   m_timervals[tnum] = 0;
305   m_timerrun[tnum] = 0;
307306}
308307
309308MACHINE_START_MEMBER(model2_state,model2)
r18137r18138
17461745   PORT_BIT( 0x00ff, 0x0000, IPT_AD_STICK_Y ) PORT_MINMAX(0x00,0xff) PORT_SENSITIVITY(30) PORT_KEYDELTA(20) PORT_PLAYER(1)
17471746INPUT_PORTS_END
17481747
1749static TIMER_DEVICE_CALLBACK(model2_interrupt)
1748TIMER_DEVICE_CALLBACK_MEMBER(model2_state::model2_interrupt)
17501749{
1751   model2_state *state = timer.machine().driver_data<model2_state>();
17521750   int scanline = param;
17531751
17541752   if(scanline == 0) // 384
17551753   {
1756      state->m_intreq |= (1<<10);
1757      if (state->m_intena & (1<<10))
1758         state->m_maincpu->set_input_line(I960_IRQ3, ASSERT_LINE);
1754      m_intreq |= (1<<10);
1755      if (m_intena & (1<<10))
1756         m_maincpu->set_input_line(I960_IRQ3, ASSERT_LINE);
17591757   }
17601758
17611759   if(scanline == 384/2)
17621760   {
1763      state->m_intreq |= (1<<0);
1764      if (state->m_intena & (1<<0))
1765         state->m_maincpu->set_input_line(I960_IRQ0, ASSERT_LINE);
1761      m_intreq |= (1<<0);
1762      if (m_intena & (1<<0))
1763         m_maincpu->set_input_line(I960_IRQ0, ASSERT_LINE);
17661764   }
17671765}
17681766
1769static TIMER_DEVICE_CALLBACK(model2c_interrupt)
1767TIMER_DEVICE_CALLBACK_MEMBER(model2_state::model2c_interrupt)
17701768{
1771   model2_state *state = timer.machine().driver_data<model2_state>();
17721769   int scanline = param;
17731770
17741771   if(scanline == 0) // 384
17751772   {
1776      state->m_intreq |= (1<<10);
1777      if (state->m_intena & (1<<10))
1778         state->m_maincpu->set_input_line(I960_IRQ3, ASSERT_LINE);
1773      m_intreq |= (1<<10);
1774      if (m_intena & (1<<10))
1775         m_maincpu->set_input_line(I960_IRQ3, ASSERT_LINE);
17791776   }
17801777
17811778   if(scanline == 256)
17821779   {
1783      state->m_intreq |= (1<<2);
1784      if (state->m_intena & (1<<2))
1785         state->m_maincpu->set_input_line(I960_IRQ2, ASSERT_LINE);
1780      m_intreq |= (1<<2);
1781      if (m_intena & (1<<2))
1782         m_maincpu->set_input_line(I960_IRQ2, ASSERT_LINE);
17861783   }
17871784
17881785   if(scanline == 128)
17891786   {
1790      state->m_intreq |= (1<<0);
1791      if (state->m_intena & (1<<0))
1792         state->m_maincpu->set_input_line(I960_IRQ0, ASSERT_LINE);
1787      m_intreq |= (1<<0);
1788      if (m_intena & (1<<0))
1789         m_maincpu->set_input_line(I960_IRQ0, ASSERT_LINE);
17931790   }
17941791}
17951792
r18137r18138
19671964static MACHINE_CONFIG_START( model2o, model2_state )
19681965   MCFG_CPU_ADD("maincpu", I960, 25000000)
19691966   MCFG_CPU_PROGRAM_MAP(model2o_mem)
1970   MCFG_TIMER_ADD_SCANLINE("scantimer", model2_interrupt, "screen", 0, 1)
1967   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", model2_state, model2_interrupt, "screen", 0, 1)
19711968
19721969   MCFG_CPU_ADD("audiocpu", M68000, 10000000)
19731970   MCFG_CPU_PROGRAM_MAP(model1_snd)
r18137r18138
19831980   MCFG_NVRAM_ADD_1FILL("backup1")
19841981   MCFG_NVRAM_ADD_1FILL("backup2")
19851982
1986   MCFG_TIMER_ADD("timer0", model2_timer_cb)
1983   MCFG_TIMER_DRIVER_ADD("timer0", model2_state, model2_timer_cb)
19871984   MCFG_TIMER_PTR((FPTR)0)
1988   MCFG_TIMER_ADD("timer1", model2_timer_cb)
1985   MCFG_TIMER_DRIVER_ADD("timer1", model2_state, model2_timer_cb)
19891986   MCFG_TIMER_PTR((FPTR)1)
1990   MCFG_TIMER_ADD("timer2", model2_timer_cb)
1987   MCFG_TIMER_DRIVER_ADD("timer2", model2_state, model2_timer_cb)
19911988   MCFG_TIMER_PTR((FPTR)2)
1992   MCFG_TIMER_ADD("timer3", model2_timer_cb)
1989   MCFG_TIMER_DRIVER_ADD("timer3", model2_state, model2_timer_cb)
19931990   MCFG_TIMER_PTR((FPTR)3)
19941991
19951992   MCFG_S24TILE_DEVICE_ADD("tile", 0x3fff)
r18137r18138
20262023static MACHINE_CONFIG_START( model2a, model2_state )
20272024   MCFG_CPU_ADD("maincpu", I960, 25000000)
20282025   MCFG_CPU_PROGRAM_MAP(model2a_crx_mem)
2029   MCFG_TIMER_ADD_SCANLINE("scantimer", model2_interrupt, "screen", 0, 1)
2026   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", model2_state, model2_interrupt, "screen", 0, 1)
20302027
20312028   MCFG_CPU_ADD("audiocpu", M68000, 12000000)
20322029   MCFG_CPU_PROGRAM_MAP(model2_snd)
r18137r18138
20412038   MCFG_EEPROM_93C46_ADD("eeprom")
20422039   MCFG_NVRAM_ADD_1FILL("backup1")
20432040
2044   MCFG_TIMER_ADD("timer0", model2_timer_cb)
2041   MCFG_TIMER_DRIVER_ADD("timer0", model2_state, model2_timer_cb)
20452042   MCFG_TIMER_PTR((FPTR)0)
2046   MCFG_TIMER_ADD("timer1", model2_timer_cb)
2043   MCFG_TIMER_DRIVER_ADD("timer1", model2_state, model2_timer_cb)
20472044   MCFG_TIMER_PTR((FPTR)1)
2048   MCFG_TIMER_ADD("timer2", model2_timer_cb)
2045   MCFG_TIMER_DRIVER_ADD("timer2", model2_state, model2_timer_cb)
20492046   MCFG_TIMER_PTR((FPTR)2)
2050   MCFG_TIMER_ADD("timer3", model2_timer_cb)
2047   MCFG_TIMER_DRIVER_ADD("timer3", model2_state, model2_timer_cb)
20512048   MCFG_TIMER_PTR((FPTR)3)
20522049
20532050   MCFG_S24TILE_DEVICE_ADD("tile", 0x3fff)
r18137r18138
21232120static MACHINE_CONFIG_START( model2b, model2_state )
21242121   MCFG_CPU_ADD("maincpu", I960, 25000000)
21252122   MCFG_CPU_PROGRAM_MAP(model2b_crx_mem)
2126   MCFG_TIMER_ADD_SCANLINE("scantimer", model2_interrupt, "screen", 0, 1)
2123   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", model2_state, model2_interrupt, "screen", 0, 1)
21272124
21282125   MCFG_CPU_ADD("audiocpu", M68000, 12000000)
21292126   MCFG_CPU_PROGRAM_MAP(model2_snd)
r18137r18138
21442141   MCFG_EEPROM_93C46_ADD("eeprom")
21452142   MCFG_NVRAM_ADD_1FILL("backup1")
21462143
2147   MCFG_TIMER_ADD("timer0", model2_timer_cb)
2144   MCFG_TIMER_DRIVER_ADD("timer0", model2_state, model2_timer_cb)
21482145   MCFG_TIMER_PTR((FPTR)0)
2149   MCFG_TIMER_ADD("timer1", model2_timer_cb)
2146   MCFG_TIMER_DRIVER_ADD("timer1", model2_state, model2_timer_cb)
21502147   MCFG_TIMER_PTR((FPTR)1)
2151   MCFG_TIMER_ADD("timer2", model2_timer_cb)
2148   MCFG_TIMER_DRIVER_ADD("timer2", model2_state, model2_timer_cb)
21522149   MCFG_TIMER_PTR((FPTR)2)
2153   MCFG_TIMER_ADD("timer3", model2_timer_cb)
2150   MCFG_TIMER_DRIVER_ADD("timer3", model2_state, model2_timer_cb)
21542151   MCFG_TIMER_PTR((FPTR)3)
21552152
21562153   MCFG_S24TILE_DEVICE_ADD("tile", 0x3fff)
r18137r18138
21802177static MACHINE_CONFIG_START( model2c, model2_state )
21812178   MCFG_CPU_ADD("maincpu", I960, 25000000)
21822179   MCFG_CPU_PROGRAM_MAP(model2c_crx_mem)
2183   MCFG_TIMER_ADD_SCANLINE("scantimer", model2c_interrupt, "screen", 0, 1)
2180   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", model2_state, model2c_interrupt, "screen", 0, 1)
21842181
21852182   MCFG_CPU_ADD("audiocpu", M68000, 12000000)
21862183   MCFG_CPU_PROGRAM_MAP(model2_snd)
r18137r18138
21912188   MCFG_EEPROM_93C46_ADD("eeprom")
21922189   MCFG_NVRAM_ADD_1FILL("backup1")
21932190
2194   MCFG_TIMER_ADD("timer0", model2_timer_cb)
2191   MCFG_TIMER_DRIVER_ADD("timer0", model2_state, model2_timer_cb)
21952192   MCFG_TIMER_PTR((FPTR)0)
2196   MCFG_TIMER_ADD("timer1", model2_timer_cb)
2193   MCFG_TIMER_DRIVER_ADD("timer1", model2_state, model2_timer_cb)
21972194   MCFG_TIMER_PTR((FPTR)1)
2198   MCFG_TIMER_ADD("timer2", model2_timer_cb)
2195   MCFG_TIMER_DRIVER_ADD("timer2", model2_state, model2_timer_cb)
21992196   MCFG_TIMER_PTR((FPTR)2)
2200   MCFG_TIMER_ADD("timer3", model2_timer_cb)
2197   MCFG_TIMER_DRIVER_ADD("timer3", model2_state, model2_timer_cb)
22012198   MCFG_TIMER_PTR((FPTR)3)
22022199
22032200   MCFG_S24TILE_DEVICE_ADD("tile", 0x3fff)
trunk/src/mame/drivers/namcos22.c
r18137r18138
16831683   return m_mSerialDataSlaveToMasterCurrent;
16841684}
16851685
1686static TIMER_DEVICE_CALLBACK( dsp_master_serial_irq )
1686TIMER_DEVICE_CALLBACK_MEMBER(namcos22_state::dsp_master_serial_irq)
16871687{
1688   namcos22_state *state = timer.machine().driver_data<namcos22_state>();
16891688   int scanline = param;
16901689
1691   if( state->m_mbEnableDspIrqs )
1690   if( m_mbEnableDspIrqs )
16921691   {
1693      state->m_mSerialDataSlaveToMasterCurrent = state->m_mSerialDataSlaveToMasterNext;
1692      m_mSerialDataSlaveToMasterCurrent = m_mSerialDataSlaveToMasterNext;
16941693
16951694      if(scanline == 480)
1696         state->m_master->set_input_line(TMS32025_INT0, HOLD_LINE);
1695         m_master->set_input_line(TMS32025_INT0, HOLD_LINE);
16971696      else if((scanline % 2) == 0)
16981697      {
1699         state->m_master->set_input_line(TMS32025_RINT, HOLD_LINE);
1700         state->m_master->set_input_line(TMS32025_XINT, HOLD_LINE);
1698         m_master->set_input_line(TMS32025_RINT, HOLD_LINE);
1699         m_master->set_input_line(TMS32025_XINT, HOLD_LINE);
17011700      }
17021701   }
17031702}
17041703
1705static TIMER_DEVICE_CALLBACK( dsp_slave_serial_irq )
1704TIMER_DEVICE_CALLBACK_MEMBER(namcos22_state::dsp_slave_serial_irq)
17061705{
1707   namcos22_state *state = timer.machine().driver_data<namcos22_state>();
17081706   int scanline = param;
17091707
1710   if( state->m_mbEnableDspIrqs )
1708   if( m_mbEnableDspIrqs )
17111709   {
17121710      if((scanline % 2) == 0)
17131711      {
1714         state->m_slave->set_input_line(TMS32025_RINT, HOLD_LINE);
1715         state->m_slave->set_input_line(TMS32025_XINT, HOLD_LINE);
1712         m_slave->set_input_line(TMS32025_RINT, HOLD_LINE);
1713         m_slave->set_input_line(TMS32025_XINT, HOLD_LINE);
17161714      }
17171715   }
17181716}
r18137r18138
29202918   AM_RANGE(M37710_PORT4, M37710_PORT4) AM_READ(mcu_port4_s22_r )
29212919ADDRESS_MAP_END
29222920
2923static TIMER_DEVICE_CALLBACK( mcu_irq )
2921TIMER_DEVICE_CALLBACK_MEMBER(namcos22_state::mcu_irq)
29242922{
2925   namcos22_state *state = timer.machine().driver_data<namcos22_state>();
29262923   int scanline = param;
29272924
29282925   /* TODO: real sources of these */
29292926   if(scanline == 480)
2930      state->m_mcu->set_input_line(M37710_LINE_IRQ0, HOLD_LINE);
2927      m_mcu->set_input_line(M37710_LINE_IRQ0, HOLD_LINE);
29312928   else if(scanline == 500)
2932      state->m_mcu->set_input_line(M37710_LINE_ADC, HOLD_LINE);
2929      m_mcu->set_input_line(M37710_LINE_ADC, HOLD_LINE);
29332930   else if(scanline == 0)
2934      state->m_mcu->set_input_line(M37710_LINE_IRQ2, HOLD_LINE);
2931      m_mcu->set_input_line(M37710_LINE_IRQ2, HOLD_LINE);
29352932}
29362933
29372934void namcos22_state::machine_reset()
r18137r18138
29482945   MCFG_CPU_PROGRAM_MAP(master_dsp_program)
29492946   MCFG_CPU_DATA_MAP(master_dsp_data)
29502947   MCFG_CPU_IO_MAP(master_dsp_io)
2951   MCFG_TIMER_ADD_SCANLINE("master_st", dsp_master_serial_irq, "screen", 0, 1)
2948   MCFG_TIMER_DRIVER_ADD_SCANLINE("master_st", namcos22_state, dsp_master_serial_irq, "screen", 0, 1)
29522949
29532950   MCFG_CPU_ADD("slave", TMS32025,SS22_MASTER_CLOCK)
29542951   MCFG_CPU_PROGRAM_MAP(slave_dsp_program)
29552952   MCFG_CPU_DATA_MAP(slave_dsp_data)
29562953   MCFG_CPU_IO_MAP(slave_dsp_io)
2957   MCFG_TIMER_ADD_SCANLINE("slave_st", dsp_slave_serial_irq, "screen", 0, 1)
2954   MCFG_TIMER_DRIVER_ADD_SCANLINE("slave_st", namcos22_state, dsp_slave_serial_irq, "screen", 0, 1)
29582955
29592956   MCFG_CPU_ADD("mcu", M37710, SS22_MASTER_CLOCK/3)
29602957   MCFG_CPU_PROGRAM_MAP(mcu_program)
29612958   MCFG_CPU_IO_MAP( mcu_io)
2962   MCFG_TIMER_ADD_SCANLINE("mcu_st", mcu_irq, "screen", 0, 1)
2959   MCFG_TIMER_DRIVER_ADD_SCANLINE("mcu_st", namcos22_state, mcu_irq, "screen", 0, 1)
29632960
29642961   MCFG_QUANTUM_TIME(attotime::from_hz(6000))
29652962//  MCFG_QUANTUM_PERFECT_CPU("maincpu")
r18137r18138
31993196   MCFG_CPU_PROGRAM_MAP(master_dsp_program)
32003197   MCFG_CPU_DATA_MAP(master_dsp_data)
32013198   MCFG_CPU_IO_MAP(master_dsp_io)
3202   MCFG_TIMER_ADD_SCANLINE("master_st", dsp_master_serial_irq, "screen", 0, 1)
3199   MCFG_TIMER_DRIVER_ADD_SCANLINE("master_st", namcos22_state, dsp_master_serial_irq, "screen", 0, 1)
32033200
32043201   MCFG_CPU_ADD("slave", TMS32025,SS22_MASTER_CLOCK) /* ? */
32053202   MCFG_CPU_PROGRAM_MAP(slave_dsp_program)
32063203   MCFG_CPU_DATA_MAP(slave_dsp_data)
32073204   MCFG_CPU_IO_MAP(slave_dsp_io)
3208   MCFG_TIMER_ADD_SCANLINE("slave_st", dsp_slave_serial_irq, "screen", 0, 1)
3205   MCFG_TIMER_DRIVER_ADD_SCANLINE("slave_st", namcos22_state, dsp_slave_serial_irq, "screen", 0, 1)
32093206
32103207   MCFG_CPU_ADD("mcu", M37702, SS22_MASTER_CLOCK/3)   // C74 on the CPU board has no periodic interrupts, it runs entirely off Timer A0
32113208   MCFG_CPU_PROGRAM_MAP( mcu_s22_program)
trunk/src/mame/drivers/galaxold.c
r18137r18138
21792179   MCFG_7474_ADD("7474_9m_1", "7474_9m_1", galaxold_7474_9m_1_callback, NULL)
21802180   MCFG_7474_ADD("7474_9m_2", "7474_9m_1", NULL, galaxold_7474_9m_2_q_callback)
21812181
2182   MCFG_TIMER_ADD("int_timer", galaxold_interrupt_timer)
2182   MCFG_TIMER_DRIVER_ADD("int_timer", galaxold_state, galaxold_interrupt_timer)
21832183
21842184   /* video hardware */
21852185   MCFG_GFXDECODE(galaxian)
trunk/src/mame/drivers/atarisy1.c
r18137r18138
250250 *
251251 *************************************/
252252
253static TIMER_DEVICE_CALLBACK( delayed_joystick_int )
253TIMER_DEVICE_CALLBACK_MEMBER(atarisy1_state::delayed_joystick_int)
254254{
255   atarisy1_state *state = timer.machine().driver_data<atarisy1_state>();
256   state->m_joystick_value = param;
257   state->m_joystick_int = 1;
258   atarigen_update_interrupts(timer.machine());
255   m_joystick_value = param;
256   m_joystick_int = 1;
257   atarigen_update_interrupts(machine());
259258}
260259
261260
r18137r18138
771770   MCFG_MACHINE_RESET_OVERRIDE(atarisy1_state,atarisy1)
772771   MCFG_NVRAM_ADD_1FILL("eeprom")
773772
774   MCFG_TIMER_ADD("joystick_timer", delayed_joystick_int)
775   MCFG_TIMER_ADD("scan_timer", atarisy1_int3_callback)
776   MCFG_TIMER_ADD("int3off_timer", atarisy1_int3off_callback)
777   MCFG_TIMER_ADD("yreset_timer", atarisy1_reset_yscroll_callback)
773   MCFG_TIMER_DRIVER_ADD("joystick_timer", atarisy1_state, delayed_joystick_int)
774   MCFG_TIMER_DRIVER_ADD("scan_timer", atarisy1_state, atarisy1_int3_callback)
775   MCFG_TIMER_DRIVER_ADD("int3off_timer", atarisy1_state, atarisy1_int3off_callback)
776   MCFG_TIMER_DRIVER_ADD("yreset_timer", atarisy1_state, atarisy1_reset_yscroll_callback)
778777
779778   /* video hardware */
780779   MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
trunk/src/mame/drivers/gaelco2.c
r18137r18138
288288   /* basic machine hardware */
289289   MCFG_CPU_ADD("maincpu", M68000, 30000000/2)         /* 15 MHz */
290290   MCFG_CPU_PROGRAM_MAP(bang_map)
291   MCFG_TIMER_ADD_SCANLINE("scantimer", bang_irq, "screen", 0, 1)
291   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", gaelco2_state, bang_irq, "screen", 0, 1)
292292
293293   MCFG_EEPROM_ADD("eeprom", gaelco2_eeprom_interface)
294294
trunk/src/mame/drivers/shadfrce.c
r18137r18138
307307   m_raster_scanline = data;   /* guess, 0 is always written */
308308}
309309
310static TIMER_DEVICE_CALLBACK( shadfrce_scanline )
310TIMER_DEVICE_CALLBACK_MEMBER(shadfrce_state::shadfrce_scanline)
311311{
312   shadfrce_state *state = timer.machine().driver_data<shadfrce_state>();
313312   int scanline = param;
314313
315314   /* Vblank is lowered on scanline 0 */
316315   if (scanline == 0)
317316   {
318      state->m_vblank = 0;
317      m_vblank = 0;
319318   }
320319   /* Hack */
321320   else if (scanline == (248-1))      /* -1 is an hack needed to avoid deadlocks */
322321   {
323      state->m_vblank = 4;
322      m_vblank = 4;
324323   }
325324
326325   /* Raster interrupt - Perform raster effect on given scanline */
327   if (state->m_raster_irq_enable)
326   if (m_raster_irq_enable)
328327   {
329      if (scanline == state->m_raster_scanline)
328      if (scanline == m_raster_scanline)
330329      {
331         state->m_raster_scanline = (state->m_raster_scanline + 1) % 240;
332         if (state->m_raster_scanline > 0)
333            timer.machine().primary_screen->update_partial(state->m_raster_scanline - 1);
334         timer.machine().device("maincpu")->execute().set_input_line(1, ASSERT_LINE);
330         m_raster_scanline = (m_raster_scanline + 1) % 240;
331         if (m_raster_scanline > 0)
332            machine().primary_screen->update_partial(m_raster_scanline - 1);
333         machine().device("maincpu")->execute().set_input_line(1, ASSERT_LINE);
335334      }
336335   }
337336
338337   /* An interrupt is generated every 16 scanlines */
339   if (state->m_irqs_enable)
338   if (m_irqs_enable)
340339   {
341340      if (scanline % 16 == 0)
342341      {
343342         if (scanline > 0)
344            timer.machine().primary_screen->update_partial(scanline - 1);
345         timer.machine().device("maincpu")->execute().set_input_line(2, ASSERT_LINE);
343            machine().primary_screen->update_partial(scanline - 1);
344         machine().device("maincpu")->execute().set_input_line(2, ASSERT_LINE);
346345      }
347346   }
348347
349348   /* Vblank is raised on scanline 248 */
350   if (state->m_irqs_enable)
349   if (m_irqs_enable)
351350   {
352351      if (scanline == 248)
353352      {
354         timer.machine().primary_screen->update_partial(scanline - 1);
355         timer.machine().device("maincpu")->execute().set_input_line(3, ASSERT_LINE);
353         machine().primary_screen->update_partial(scanline - 1);
354         machine().device("maincpu")->execute().set_input_line(3, ASSERT_LINE);
356355      }
357356   }
358357}
r18137r18138
558557
559558   MCFG_CPU_ADD("maincpu", M68000, CPU_CLOCK)         /* verified on pcb */
560559   MCFG_CPU_PROGRAM_MAP(shadfrce_map)
561   MCFG_TIMER_ADD_SCANLINE("scantimer", shadfrce_scanline, "screen", 0, 1)
560   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", shadfrce_state, shadfrce_scanline, "screen", 0, 1)
562561
563562   MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz)         /* verified on pcb */
564563   MCFG_CPU_PROGRAM_MAP(shadfrce_sound_map)
trunk/src/mame/drivers/st0016.c
r18137r18138
417417//  GFXDECODE_ENTRY( NULL, 0, charlayout,      0, 16*4  )
418418GFXDECODE_END
419419
420static TIMER_DEVICE_CALLBACK(st0016_int)
420TIMER_DEVICE_CALLBACK_MEMBER(st0016_state::st0016_int)
421421{
422   st0016_state *state = timer.machine().driver_data<st0016_state>();
423422   int scanline = param;
424423
425424   if(scanline == 240)
426      state->m_maincpu->set_input_line(0,HOLD_LINE);
425      m_maincpu->set_input_line(0,HOLD_LINE);
427426   else if((scanline % 64) == 0)
428      if(state->m_maincpu->state_int(Z80_IFF1)) /* dirty hack ... */
429         state->m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE );
427      if(m_maincpu->state_int(Z80_IFF1)) /* dirty hack ... */
428         m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE );
430429}
431430
432431static const st0016_interface st0016_config =
r18137r18138
446445   MCFG_CPU_ADD("maincpu",Z80,8000000) /* 8 MHz ? */
447446   MCFG_CPU_PROGRAM_MAP(st0016_mem)
448447   MCFG_CPU_IO_MAP(st0016_io)
449   MCFG_TIMER_ADD_SCANLINE("scantimer", st0016_int, "screen", 0, 1) /*  4*nmi + int0 */
448   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", st0016_state, st0016_int, "screen", 0, 1)
450449
451450   /* video hardware */
452451   MCFG_SCREEN_ADD("screen", RASTER)
trunk/src/mame/drivers/spdodgeb.c
r18137r18138
413413   /* basic machine hardware */
414414   MCFG_CPU_ADD("maincpu", M6502,12000000/6)   /* 2MHz ? */
415415   MCFG_CPU_PROGRAM_MAP(spdodgeb_map)
416   MCFG_TIMER_ADD_SCANLINE("scantimer", spdodgeb_interrupt, "screen", 0, 1) /* 1 IRQ every 8 visible scanlines, plus NMI for vblank */
416   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", spdodgeb_state, spdodgeb_interrupt, "screen", 0, 1) /* 1 IRQ every 8 visible scanlines, plus NMI for vblank */
417417
418418   MCFG_CPU_ADD("audiocpu", M6809,12000000/6)   /* 2MHz ? */
419419   MCFG_CPU_PROGRAM_MAP(spdodgeb_sound_map)
trunk/src/mame/drivers/higemaru.c
r18137r18138
1616#include "includes/higemaru.h"
1717
1818
19static TIMER_DEVICE_CALLBACK( higemaru_scanline )
19TIMER_DEVICE_CALLBACK_MEMBER(higemaru_state::higemaru_scanline)
2020{
2121   int scanline = param;
2222
2323   if(scanline == 240) // vblank-out irq
24      timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xcf);   /* RST 08h - vblank */
24      machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xcf);   /* RST 08h - vblank */
2525
2626   if(scanline == 0) // unknown irq event, does various stuff like copying the spriteram
27      timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xd7);   /* RST 10h */
27      machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xd7);   /* RST 10h */
2828}
2929
3030
r18137r18138
162162   /* basic machine hardware */
163163   MCFG_CPU_ADD("maincpu", Z80, XTAL_12MHz/4)   /* 3 MHz Sharp LH0080A Z80A-CPU-D */
164164   MCFG_CPU_PROGRAM_MAP(higemaru_map)
165   MCFG_TIMER_ADD_SCANLINE("scantimer", higemaru_scanline, "screen", 0, 1)
165   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", higemaru_state, higemaru_scanline, "screen", 0, 1)
166166
167167   /* video hardware */
168168   MCFG_SCREEN_ADD("screen", RASTER)
trunk/src/mame/drivers/psychic5.c
r18137r18138
327327
328328***************************************************************************/
329329
330static TIMER_DEVICE_CALLBACK( psychic5_scanline )
330TIMER_DEVICE_CALLBACK_MEMBER(psychic5_state::psychic5_scanline)
331331{
332332   int scanline = param;
333333
334334   if(scanline == 240) // vblank-out irq
335      timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xd7);   /* RST 10h - vblank */
335      machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xd7);   /* RST 10h - vblank */
336336
337337   if(scanline == 0) // sprite buffer irq
338      timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xcf);   /* RST 08h */
338      machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xcf);   /* RST 08h */
339339}
340340
341341
r18137r18138
663663   /* basic machine hardware */
664664   MCFG_CPU_ADD("maincpu", Z80, XTAL_12MHz/2)
665665   MCFG_CPU_PROGRAM_MAP(psychic5_main_map)
666   MCFG_TIMER_ADD_SCANLINE("scantimer", psychic5_scanline, "screen", 0, 1)
666   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", psychic5_state, psychic5_scanline, "screen", 0, 1)
667667
668668   MCFG_CPU_ADD("audiocpu", Z80, XTAL_12MHz/2)
669669   MCFG_CPU_PROGRAM_MAP(psychic5_sound_map)
r18137r18138
708708   /* basic machine hardware */
709709   MCFG_CPU_ADD("maincpu", Z80, XTAL_12MHz/2 ) /* 6 MHz */
710710   MCFG_CPU_PROGRAM_MAP(bombsa_main_map)
711   MCFG_TIMER_ADD_SCANLINE("scantimer", psychic5_scanline, "screen", 0, 1)
711   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", psychic5_state, psychic5_scanline, "screen", 0, 1)
712712
713713   MCFG_CPU_ADD("audiocpu", Z80, XTAL_5MHz )
714714   MCFG_CPU_PROGRAM_MAP(bombsa_sound_map)
trunk/src/mame/drivers/taito_o.c
r18137r18138
212212GFXDECODE_END
213213
214214/* unknown sources ... */
215static TIMER_DEVICE_CALLBACK( parentj_interrupt )
215TIMER_DEVICE_CALLBACK_MEMBER(taitoo_state::parentj_interrupt)
216216{
217   taitoo_state *state = timer.machine().driver_data<taitoo_state>();
218217   int scanline = param;
219218
220219   if(scanline == 448)
221      state->m_maincpu->set_input_line(4, HOLD_LINE);
220      m_maincpu->set_input_line(4, HOLD_LINE);
222221
223222   if(scanline == 0)
224      state->m_maincpu->set_input_line(5, HOLD_LINE);
223      m_maincpu->set_input_line(5, HOLD_LINE);
225224}
226225
227226static const ym2203_interface ym2203_config =
r18137r18138
253252
254253   MCFG_CPU_ADD("maincpu", M68000,12000000 )      /*?? MHz */
255254   MCFG_CPU_PROGRAM_MAP(parentj_map)
256   MCFG_TIMER_ADD_SCANLINE("scantimer", parentj_interrupt, "screen", 0, 1)
255   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", taitoo_state, parentj_interrupt, "screen", 0, 1)
257256
258257
259258   MCFG_SCREEN_ADD("screen", RASTER)
trunk/src/mame/drivers/blockout.c
r18137r18138
293293   m_color = 0;
294294}
295295
296static TIMER_DEVICE_CALLBACK( blockout_scanline )
296TIMER_DEVICE_CALLBACK_MEMBER(blockout_state::blockout_scanline)
297297{
298   blockout_state *state = timer.machine().driver_data<blockout_state>();
299298   int scanline = param;
300299
301300   if(scanline == 248) // vblank-out irq
302      state->m_maincpu->set_input_line(6, ASSERT_LINE);
301      m_maincpu->set_input_line(6, ASSERT_LINE);
303302
304303   if(scanline == 0) // vblank-in irq or directly tied to coin inputs (TODO: check)
305      state->m_maincpu->set_input_line(5, ASSERT_LINE);
304      m_maincpu->set_input_line(5, ASSERT_LINE);
306305}
307306
308307static MACHINE_CONFIG_START( blockout, blockout_state )
r18137r18138
310309   /* basic machine hardware */
311310   MCFG_CPU_ADD("maincpu", M68000, MAIN_CLOCK)       /* MRH - 8.76 makes gfx/adpcm samples sync better -- but 10 is correct speed*/
312311   MCFG_CPU_PROGRAM_MAP(main_map)
313   MCFG_TIMER_ADD_SCANLINE("scantimer", blockout_scanline, "screen", 0, 1)
312   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", blockout_state, blockout_scanline, "screen", 0, 1)
314313
315314   MCFG_CPU_ADD("audiocpu", Z80, AUDIO_CLOCK)   /* 3.579545 MHz */
316315   MCFG_CPU_PROGRAM_MAP(audio_map)
trunk/src/mame/drivers/pingpong.c
r18137r18138
5555   /* other bits unknown */
5656}
5757
58static TIMER_DEVICE_CALLBACK( pingpong_interrupt )
58TIMER_DEVICE_CALLBACK_MEMBER(pingpong_state::pingpong_interrupt)
5959{
60   pingpong_state *state = timer.machine().driver_data<pingpong_state>();
6160   int scanline = param;
6261
6362   if (scanline == 240)
6463   {
65      if (state->m_intenable & 0x04) state->m_maincpu->set_input_line(0, HOLD_LINE);
64      if (m_intenable & 0x04) m_maincpu->set_input_line(0, HOLD_LINE);
6665   }
6766   else if ((scanline % 32) == 0)
6867   {
69      if (state->m_intenable & 0x08) state->m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
68      if (m_intenable & 0x08) m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
7069   }
7170}
7271
73static TIMER_DEVICE_CALLBACK( merlinmm_interrupt )
72TIMER_DEVICE_CALLBACK_MEMBER(pingpong_state::merlinmm_interrupt)
7473{
75   pingpong_state *state = timer.machine().driver_data<pingpong_state>();
7674   int scanline = param;
7775
7876   if (scanline == 240)
7977   {
80      if (state->m_intenable & 0x04) state->m_maincpu->set_input_line(0, HOLD_LINE);
78      if (m_intenable & 0x04) m_maincpu->set_input_line(0, HOLD_LINE);
8179   }
8280   else if (scanline == 0)
8381   {
84      if (state->m_intenable & 0x08) state->m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
82      if (m_intenable & 0x08) m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
8583   }
8684}
8785
r18137r18138
464462   /* basic machine hardware */
465463   MCFG_CPU_ADD("maincpu",Z80,18432000/6)      /* 3.072 MHz (probably) */
466464   MCFG_CPU_PROGRAM_MAP(pingpong_map)
467   MCFG_TIMER_ADD_SCANLINE("scantimer", pingpong_interrupt, "screen", 0, 1)
465   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", pingpong_state, pingpong_interrupt, "screen", 0, 1)
468466
469467   /* video hardware */
470468   MCFG_SCREEN_ADD("screen", RASTER)
r18137r18138
491489   MCFG_CPU_MODIFY("maincpu")
492490   MCFG_CPU_PROGRAM_MAP(merlinmm_map)
493491   MCFG_TIMER_MODIFY("scantimer")
494   MCFG_TIMER_CALLBACK(merlinmm_interrupt)
492   MCFG_TIMER_DRIVER_CALLBACK(pingpong_state, merlinmm_interrupt)
495493
496494   MCFG_NVRAM_ADD_0FILL("nvram")
497495MACHINE_CONFIG_END
trunk/src/mame/drivers/bladestl.c
r18137r18138
3636#include "includes/bladestl.h"
3737
3838
39static TIMER_DEVICE_CALLBACK( bladestl_scanline )
39TIMER_DEVICE_CALLBACK_MEMBER(bladestl_state::bladestl_scanline)
4040{
41   bladestl_state *state = timer.machine().driver_data<bladestl_state>();
4241   int scanline = param;
4342
44   if(scanline == 240 && k007342_is_int_enabled(state->m_k007342)) // vblank-out irq
45      timer.machine().device("maincpu")->execute().set_input_line(HD6309_FIRQ_LINE, HOLD_LINE);
43   if(scanline == 240 && k007342_is_int_enabled(m_k007342)) // vblank-out irq
44      machine().device("maincpu")->execute().set_input_line(HD6309_FIRQ_LINE, HOLD_LINE);
4645
4746   if(scanline == 0) // vblank-in or timer irq
48      timer.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
47      machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
4948}
5049
5150/*************************************
r18137r18138
333332   /* basic machine hardware */
334333   MCFG_CPU_ADD("maincpu", HD6309, 24000000/2)      /* 24MHz/2 (?) */
335334   MCFG_CPU_PROGRAM_MAP(main_map)
336   MCFG_TIMER_ADD_SCANLINE("scantimer", bladestl_scanline, "screen", 0, 1)
335   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", bladestl_state, bladestl_scanline, "screen", 0, 1)
337336
338337   MCFG_CPU_ADD("audiocpu", M6809, 2000000)
339338   MCFG_CPU_PROGRAM_MAP(sound_map)
trunk/src/mame/drivers/srumbler.c
r18137r18138
5050   srumbler_bankswitch_w(space,0,0);
5151}
5252
53static TIMER_DEVICE_CALLBACK( srumbler_interrupt )
53TIMER_DEVICE_CALLBACK_MEMBER(srumbler_state::srumbler_interrupt)
5454{
55   srumbler_state *state = timer.machine().driver_data<srumbler_state>();
5655   int scanline = param;
5756
5857   if (scanline == 248)
59      state->m_maincpu->set_input_line(0,HOLD_LINE);
58      m_maincpu->set_input_line(0,HOLD_LINE);
6059
6160   if (scanline == 0)
62      state->m_maincpu->set_input_line(M6809_FIRQ_LINE,HOLD_LINE);
61      m_maincpu->set_input_line(M6809_FIRQ_LINE,HOLD_LINE);
6362}
6463
6564/*
r18137r18138
239238   /* basic machine hardware */
240239   MCFG_CPU_ADD("maincpu", M6809, 1500000)        /* 1.5 MHz (?) */
241240   MCFG_CPU_PROGRAM_MAP(srumbler_map)
242   MCFG_TIMER_ADD_SCANLINE("scantimer", srumbler_interrupt, "screen", 0, 1)
241   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", srumbler_state, srumbler_interrupt, "screen", 0, 1)
243242
244243   MCFG_CPU_ADD("audiocpu", Z80, 3000000)        /* 3 MHz ??? */
245244   MCFG_CPU_PROGRAM_MAP(srumbler_sound_map)
trunk/src/mame/drivers/overdriv.c
r18137r18138
7474   }
7575}
7676
77static TIMER_DEVICE_CALLBACK( overdriv_cpuA_scanline )
77TIMER_DEVICE_CALLBACK_MEMBER(overdriv_state::overdriv_cpuA_scanline)
7878{
7979   int scanline = param;
8080
8181   /* TODO: irqs routines are TOO slow right now, it ends up firing spurious irqs for whatever reason (shared ram fighting?) */
8282   /*       this is a temporary solution to get rid of deprecat lib and the crashes, but also makes the game timer to be too slow */
83   if(scanline == 256 && timer.machine().primary_screen->frame_number() & 1) // vblank-out irq
84      timer.machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE);
83   if(scanline == 256 && machine().primary_screen->frame_number() & 1) // vblank-out irq
84      machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE);
8585   else if((scanline % 128) == 0) // timer irq
86      timer.machine().device("maincpu")->execute().set_input_line(5, HOLD_LINE);
86      machine().device("maincpu")->execute().set_input_line(5, HOLD_LINE);
8787}
8888
8989INTERRUPT_GEN_MEMBER(overdriv_state::cpuB_interrupt)
r18137r18138
328328   /* basic machine hardware */
329329   MCFG_CPU_ADD("maincpu", M68000,24000000/2)   /* 12 MHz */
330330   MCFG_CPU_PROGRAM_MAP(overdriv_master_map)
331   MCFG_TIMER_ADD_SCANLINE("scantimer", overdriv_cpuA_scanline, "screen", 0, 1)
331   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", overdriv_state, overdriv_cpuA_scanline, "screen", 0, 1)
332332
333333   MCFG_CPU_ADD("sub", M68000,24000000/2)   /* 12 MHz */
334334   MCFG_CPU_PROGRAM_MAP(overdriv_slave_map)
trunk/src/mame/drivers/cninja.c
r18137r18138
6868   m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
6969}
7070
71static TIMER_DEVICE_CALLBACK( interrupt_gen )
71TIMER_DEVICE_CALLBACK_MEMBER(cninja_state::interrupt_gen)
7272{
73   cninja_state *state = timer.machine().driver_data<cninja_state>();
74
75   state->m_maincpu->set_input_line((state->m_irq_mask & 0x10) ? 3 : 4, ASSERT_LINE);
76   state->m_raster_irq_timer->reset();
73   m_maincpu->set_input_line((m_irq_mask & 0x10) ? 3 : 4, ASSERT_LINE);
74   m_raster_irq_timer->reset();
7775}
7876
7977READ16_MEMBER(cninja_state::cninja_irq_r)
r18137r18138
912910   MCFG_CPU_PROGRAM_MAP(sound_map)
913911
914912
915   MCFG_TIMER_ADD("raster_timer", interrupt_gen)
913   MCFG_TIMER_DRIVER_ADD("raster_timer", cninja_state, interrupt_gen)
916914
917915   /* video hardware */
918916   MCFG_SCREEN_ADD("screen", RASTER)
r18137r18138
964962   MCFG_CPU_PROGRAM_MAP(stoneage_s_map)
965963
966964
967   MCFG_TIMER_ADD("raster_timer", interrupt_gen)
965   MCFG_TIMER_DRIVER_ADD("raster_timer", cninja_state, interrupt_gen)
968966
969967   /* video hardware */
970968   MCFG_SCREEN_ADD("screen", RASTER)
r18137r18138
10161014   MCFG_CPU_PROGRAM_MAP(stoneage_s_map)
10171015
10181016
1019   MCFG_TIMER_ADD("raster_timer", interrupt_gen)
1017   MCFG_TIMER_DRIVER_ADD("raster_timer", cninja_state, interrupt_gen)
10201018
10211019   /* video hardware */
10221020   MCFG_SCREEN_ADD("screen", RASTER)
r18137r18138
10591057   MCFG_CPU_PROGRAM_MAP(sound_map)
10601058
10611059
1062   MCFG_TIMER_ADD("raster_timer", interrupt_gen)
1060   MCFG_TIMER_DRIVER_ADD("raster_timer", cninja_state, interrupt_gen)
10631061
10641062   /* video hardware */
10651063   MCFG_SCREEN_ADD("screen", RASTER)
r18137r18138
11111109   MCFG_CPU_PROGRAM_MAP(sound_map)
11121110
11131111
1114   MCFG_TIMER_ADD("raster_timer", interrupt_gen)
1112   MCFG_TIMER_DRIVER_ADD("raster_timer", cninja_state, interrupt_gen)
11151113
11161114   /* video hardware */
11171115   MCFG_SCREEN_ADD("screen", RASTER)
trunk/src/mame/drivers/gradius3.c
r18137r18138
106106}
107107
108108
109static TIMER_DEVICE_CALLBACK( gradius3_sub_scanline )
109TIMER_DEVICE_CALLBACK_MEMBER(gradius3_state::gradius3_sub_scanline)
110110{
111   gradius3_state *state = timer.machine().driver_data<gradius3_state>();
112111   int scanline = param;
113112
114   if(scanline == 240 && state->m_irqBmask & 1) // vblank-out irq
115      timer.machine().device("sub")->execute().set_input_line(1, HOLD_LINE);
113   if(scanline == 240 && m_irqBmask & 1) // vblank-out irq
114      machine().device("sub")->execute().set_input_line(1, HOLD_LINE);
116115
117   if(scanline ==  16 && state->m_irqBmask & 2) // sprite end DMA irq
118      timer.machine().device("sub")->execute().set_input_line(2, HOLD_LINE);
116   if(scanline ==  16 && m_irqBmask & 2) // sprite end DMA irq
117      machine().device("sub")->execute().set_input_line(2, HOLD_LINE);
119118}
120119
121120WRITE16_MEMBER(gradius3_state::cpuB_irqtrigger_w)
r18137r18138
320319
321320   MCFG_CPU_ADD("sub", M68000, 10000000)   /* 10 MHz */
322321   MCFG_CPU_PROGRAM_MAP(gradius3_map2)
323   MCFG_TIMER_ADD_SCANLINE("scantimer", gradius3_sub_scanline, "screen", 0, 1) /* has three interrupt vectors, 1 2 and 4 */
322   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", gradius3_state, gradius3_sub_scanline, "screen", 0, 1)
324323                                                            /* 4 is triggered by cpu A, the others are unknown but */
325324                                                            /* required for the game to run. */
326325
trunk/src/mame/drivers/dynax.c
r18137r18138
47454745   state->m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0x42);
47464746}
47474747
4748static TIMER_DEVICE_CALLBACK( neruton_irq_scanline )
4748TIMER_DEVICE_CALLBACK_MEMBER(dynax_state::neruton_irq_scanline)
47494749{
4750   dynax_state *state = timer.machine().driver_data<dynax_state>();
47514750   int scanline = param;
47524751
47534752   // This is a kludge to avoid losing blitter interrupts
47544753   // there should be a vblank ack mechanism
4755   if (state->m_blitter_irq)   return;
4754   if (m_blitter_irq)   return;
47564755
47574756   if(scanline == 256)
4758      state->m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0x40);
4757      m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0x40);
47594758   else if((scanline % 32) == 0)
4760      state->m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0x46);
4759      m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0x46);
47614760}
47624761
47634762static MACHINE_CONFIG_DERIVED( neruton, mjelctrn )
47644763   MCFG_CPU_MODIFY("maincpu")
4765   MCFG_TIMER_ADD_SCANLINE("scantimer", neruton_irq_scanline, "screen", 0, 1)
4764   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dynax_state, neruton_irq_scanline, "screen", 0, 1)
47664765
47674766   MCFG_VIDEO_START_OVERRIDE(dynax_state,neruton)
47684767MACHINE_CONFIG_END
r18137r18138
47754774    0x42 and 0x44 are very similar, they should be triggered by the blitter
47764775    0x40 is vblank  */
47774776
4778static TIMER_DEVICE_CALLBACK( majxtal7_vblank_interrupt )
4777TIMER_DEVICE_CALLBACK_MEMBER(dynax_state::majxtal7_vblank_interrupt)
47794778{
4780   dynax_state *state = timer.machine().driver_data<dynax_state>();
47814779   int scanline = param;
47824780
47834781   // This is a kludge to avoid losing blitter interrupts
47844782   // there should be a vblank ack mechanism
4785   if (state->m_blitter_irq)   return;
4783   if (m_blitter_irq)   return;
47864784
47874785   if(scanline == 256)
4788      state->m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0x40);
4786      m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0x40);
47894787   else if((scanline % 32) == 0)
4790      state->m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0x44); // temp kludge
4788      m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0x44); // temp kludge
47914789}
47924790
47934791static MACHINE_CONFIG_DERIVED( majxtal7, neruton )
47944792   MCFG_TIMER_MODIFY("scantimer")
4795   MCFG_TIMER_CALLBACK(majxtal7_vblank_interrupt)
4793   MCFG_TIMER_DRIVER_CALLBACK(dynax_state, majxtal7_vblank_interrupt)
47964794MACHINE_CONFIG_END
47974795
47984796
r18137r18138
48614859                               Mahjong Tenkaigen
48624860***************************************************************************/
48634861
4864static TIMER_DEVICE_CALLBACK( tenkai_interrupt )
4862TIMER_DEVICE_CALLBACK_MEMBER(dynax_state::tenkai_interrupt)
48654863{
4866   dynax_state *state = timer.machine().driver_data<dynax_state>();
48674864   int scanline = param;
48684865
48694866   if(scanline == 256)
4870      state->m_maincpu->set_input_line(INPUT_LINE_IRQ0, HOLD_LINE);
4867      m_maincpu->set_input_line(INPUT_LINE_IRQ0, HOLD_LINE);
48714868
48724869   if(scanline == 0)
4873      state->m_maincpu->set_input_line(INPUT_LINE_IRQ1, HOLD_LINE);
4870      m_maincpu->set_input_line(INPUT_LINE_IRQ1, HOLD_LINE);
48744871}
48754872
48764873static const ay8910_interface tenkai_ay8910_interface =
r18137r18138
49054902   MCFG_CPU_ADD("maincpu",TMP91640, 21472700 / 2)
49064903   MCFG_CPU_PROGRAM_MAP(tenkai_map)
49074904   MCFG_CPU_IO_MAP(tenkai_io_map)
4908   MCFG_TIMER_ADD_SCANLINE("scantimer", tenkai_interrupt, "screen", 0, 1)
4905   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dynax_state, tenkai_interrupt, "screen", 0, 1)
49094906
49104907   MCFG_MACHINE_START_OVERRIDE(dynax_state,tenkai)
49114908   MCFG_MACHINE_RESET_OVERRIDE(dynax_state,dynax)
trunk/src/mame/drivers/decocass.c
r18137r18138
760760
761761   MCFG_CPU_ADD("audiocpu", M6502, HCLK1/3/2)
762762   MCFG_CPU_PROGRAM_MAP(decocass_sound_map)
763   MCFG_TIMER_ADD_SCANLINE("audionmi", decocass_audio_nmi_gen, "screen", 0, 8)
763   MCFG_TIMER_DRIVER_ADD_SCANLINE("audionmi", decocass_state, decocass_audio_nmi_gen, "screen", 0, 8)
764764
765765   MCFG_CPU_ADD("mcu", I8041, HCLK)
766766   MCFG_CPU_IO_MAP(decocass_mcu_portmap)
trunk/src/mame/drivers/mystwarr.c
r18137r18138
104104/**********************************************************************************/
105105/* IRQ controllers */
106106
107static TIMER_DEVICE_CALLBACK(mystwarr_interrupt)
107TIMER_DEVICE_CALLBACK_MEMBER(mystwarr_state::mystwarr_interrupt)
108108{
109   mystwarr_state *state = timer.machine().driver_data<mystwarr_state>();
110109   int scanline = param;
111110
112   if (!(state->m_mw_irq_control & 0x01)) return;
111   if (!(m_mw_irq_control & 0x01)) return;
113112
114113   if(scanline == 240)
115      state->m_maincpu->set_input_line(M68K_IRQ_2, HOLD_LINE);
114      m_maincpu->set_input_line(M68K_IRQ_2, HOLD_LINE);
116115
117116   if(scanline == 0)
118      state->m_maincpu->set_input_line(M68K_IRQ_4, HOLD_LINE);
117      m_maincpu->set_input_line(M68K_IRQ_4, HOLD_LINE);
119118
120119   /* writes to LSB of 0x410000 port and clears a work RAM flag, almost likely not really necessary. */
121//  state->m_maincpu->set_input_line(M68K_IRQ_6, HOLD_LINE);
120//  m_maincpu->set_input_line(M68K_IRQ_6, HOLD_LINE);
122121}
123122
124static TIMER_DEVICE_CALLBACK(metamrph_interrupt)
123TIMER_DEVICE_CALLBACK_MEMBER(mystwarr_state::metamrph_interrupt)
125124{
126   mystwarr_state *state = timer.machine().driver_data<mystwarr_state>();
127125   int scanline = param;
128126
129127   /* irq 4 has an irq routine in metamrph, but it's not really called */
130//  state->m_maincpu->set_input_line(M68K_IRQ_4, HOLD_LINE);
128//  m_maincpu->set_input_line(M68K_IRQ_4, HOLD_LINE);
131129
132130   if(scanline == 24)
133      state->m_maincpu->set_input_line(M68K_IRQ_6, HOLD_LINE);
131      m_maincpu->set_input_line(M68K_IRQ_6, HOLD_LINE);
134132
135133   if(scanline == 248)
136      if (K053246_is_IRQ_enabled()) state->m_maincpu->set_input_line(M68K_IRQ_5, HOLD_LINE);
134      if (K053246_is_IRQ_enabled()) m_maincpu->set_input_line(M68K_IRQ_5, HOLD_LINE);
137135}
138136
139static TIMER_DEVICE_CALLBACK(mchamp_interrupt)
137TIMER_DEVICE_CALLBACK_MEMBER(mystwarr_state::mchamp_interrupt)
140138{
141   mystwarr_state *state = timer.machine().driver_data<mystwarr_state>();
142139   int scanline = param;
143140
144   if (!(state->m_mw_irq_control & 0x02)) return;
141   if (!(m_mw_irq_control & 0x02)) return;
145142
146143   if(scanline == 247)
147144   {
148      if (K053246_is_IRQ_enabled()) state->m_maincpu->set_input_line(M68K_IRQ_6, HOLD_LINE);
145      if (K053246_is_IRQ_enabled()) m_maincpu->set_input_line(M68K_IRQ_6, HOLD_LINE);
149146   }
150147
151148   if(scanline == 23)
152      state->m_maincpu->set_input_line(M68K_IRQ_2, HOLD_LINE);
149      m_maincpu->set_input_line(M68K_IRQ_2, HOLD_LINE);
153150}
154151
155152INTERRUPT_GEN_MEMBER(mystwarr_state::ddd_interrupt)
r18137r18138
986983   /* basic machine hardware */
987984   MCFG_CPU_ADD("maincpu", M68000, 16000000)   /* 16 MHz (confirmed) */
988985   MCFG_CPU_PROGRAM_MAP(mystwarr_map)
989   MCFG_TIMER_ADD_SCANLINE("scantimer", mystwarr_interrupt, "screen", 0, 1)
986   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", mystwarr_state, mystwarr_interrupt, "screen", 0, 1)
990987
991988   MCFG_CPU_ADD("soundcpu", Z80, 8000000)
992989   MCFG_CPU_PROGRAM_MAP(mystwarr_sound_map)
r18137r18138
10381035   MCFG_CPU_MODIFY("maincpu")
10391036   MCFG_CPU_PROGRAM_MAP(viostorm_map)
10401037   MCFG_TIMER_MODIFY("scantimer")
1041   MCFG_TIMER_CALLBACK(metamrph_interrupt)
1038   MCFG_TIMER_DRIVER_CALLBACK(mystwarr_state, metamrph_interrupt)
10421039
10431040   /* video hardware */
10441041   MCFG_VIDEO_START_OVERRIDE(mystwarr_state,viostorm)
r18137r18138
10591056   MCFG_CPU_MODIFY("maincpu")
10601057   MCFG_CPU_PROGRAM_MAP(metamrph_map)
10611058   MCFG_TIMER_MODIFY("scantimer")
1062   MCFG_TIMER_CALLBACK(metamrph_interrupt)
1059   MCFG_TIMER_DRIVER_CALLBACK(mystwarr_state, metamrph_interrupt)
10631060
10641061   MCFG_DEVICE_REMOVE("k053252")
10651062   MCFG_K053252_ADD("k053252", 6000000, metamrph_k053252_intf) // 6 MHz?
r18137r18138
11401137   MCFG_CPU_MODIFY("maincpu")
11411138   MCFG_CPU_PROGRAM_MAP(martchmp_map)
11421139   MCFG_TIMER_MODIFY("scantimer")
1143   MCFG_TIMER_CALLBACK(mchamp_interrupt)
1140   MCFG_TIMER_DRIVER_CALLBACK(mystwarr_state, mchamp_interrupt)
11441141
11451142   MCFG_DEVICE_REMOVE("k053252")
11461143   MCFG_K053252_ADD("k053252", 16000000/2, martchmp_k053252_intf)
trunk/src/mame/drivers/konamigx.c
r18137r18138
653653   dmastart_callback(0);
654654}
655655
656static TIMER_DEVICE_CALLBACK(konamigx_hbinterrupt)
656TIMER_DEVICE_CALLBACK_MEMBER(konamigx_state::konamigx_hbinterrupt)
657657{
658   konamigx_state *state = timer.machine().driver_data<konamigx_state>();
659658   int scanline = param;
660659
661660   if (scanline == 240)
662661   {
663662      // lift idle suspension
664      if (resume_trigger && suspension_active) { suspension_active = 0; timer.machine().scheduler().trigger(resume_trigger); }
663      if (resume_trigger && suspension_active) { suspension_active = 0; machine().scheduler().trigger(resume_trigger); }
665664
666665      // IRQ 1 is the main 60hz vblank interrupt
667666      // the gx_syncen & 0x20 test doesn't work on type 3 or 4 ROM boards, likely because the ROM board
r18137r18138
677676         if ((konamigx_wrport1_1 & 0x81) == 0x81 || (gx_syncen & 1))
678677         {
679678            gx_syncen &= ~1;
680            state->m_maincpu->set_input_line(1, HOLD_LINE);
679            m_maincpu->set_input_line(1, HOLD_LINE);
681680
682681         }
683682      }
r18137r18138
694693         if ((konamigx_wrport1_1 & 0x82) == 0x82 || (gx_syncen & 2))
695694         {
696695            gx_syncen &= ~2;
697            state->m_maincpu->set_input_line(2, HOLD_LINE);
696            m_maincpu->set_input_line(2, HOLD_LINE);
698697         }
699698      }
700699   }
r18137r18138
18591858
18601859   MCFG_CPU_ADD("maincpu", M68EC020, 24000000)
18611860   MCFG_CPU_PROGRAM_MAP(gx_type3_map)
1862   MCFG_TIMER_ADD_SCANLINE("scantimer", konamigx_hbinterrupt, "screen", 0, 1)
1861   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", konamigx_state, konamigx_hbinterrupt, "screen", 0, 1)
18631862
18641863   MCFG_DEFAULT_LAYOUT(layout_dualhsxs)
18651864   MCFG_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS | VIDEO_HAS_HIGHLIGHTS | VIDEO_UPDATE_AFTER_VBLANK | VIDEO_ALWAYS_UPDATE)
r18137r18138
18861885
18871886   MCFG_CPU_ADD("maincpu", M68EC020, 24000000)
18881887   MCFG_CPU_PROGRAM_MAP(gx_type4_map)
1889   MCFG_TIMER_ADD_SCANLINE("scantimer", konamigx_hbinterrupt, "screen", 0, 1)
1888   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", konamigx_state, konamigx_hbinterrupt, "screen", 0, 1)
18901889
18911890   MCFG_DEFAULT_LAYOUT(layout_dualhsxs)
18921891   MCFG_VIDEO_ATTRIBUTES(VIDEO_HAS_SHADOWS | VIDEO_HAS_HIGHLIGHTS | VIDEO_UPDATE_AFTER_VBLANK | VIDEO_ALWAYS_UPDATE)
trunk/src/mame/drivers/sprcros2.c
r18137r18138
245245};
246246
247247
248static TIMER_DEVICE_CALLBACK( sprcros2_m_interrupt )
248TIMER_DEVICE_CALLBACK_MEMBER(sprcros2_state::sprcros2_m_interrupt)
249249{
250   sprcros2_state *state = timer.machine().driver_data<sprcros2_state>();
251250   int scanline = param;
252251
253252   if (scanline == 240)
254253   {
255      if(state->m_port7&0x01)
256         state->m_master->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
254      if(m_port7&0x01)
255         m_master->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
257256   }
258257   else if(scanline == 0)
259258   {
260      if(state->m_port7&0x08)
261         state->m_master->set_input_line(0, HOLD_LINE);
259      if(m_port7&0x08)
260         m_master->set_input_line(0, HOLD_LINE);
262261   }
263262}
264263
r18137r18138
282281   MCFG_CPU_ADD("master", Z80,10000000/2)
283282   MCFG_CPU_PROGRAM_MAP(sprcros2_master_map)
284283   MCFG_CPU_IO_MAP(sprcros2_master_io_map)
285   MCFG_TIMER_ADD_SCANLINE("scantimer", sprcros2_m_interrupt, "screen", 0, 1)
284   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", sprcros2_state, sprcros2_m_interrupt, "screen", 0, 1)
286285
287286   MCFG_CPU_ADD("slave", Z80,10000000/2)
288287   MCFG_CPU_PROGRAM_MAP(sprcros2_slave_map)
trunk/src/mame/drivers/fastlane.c
r18137r18138
1616#include "includes/konamipt.h"
1717#include "includes/fastlane.h"
1818
19static TIMER_DEVICE_CALLBACK( fastlane_scanline )
19TIMER_DEVICE_CALLBACK_MEMBER(fastlane_state::fastlane_scanline)
2020{
21   fastlane_state *state = timer.machine().driver_data<fastlane_state>();
2221   int scanline = param;
2322
24   address_space &space = state->generic_space();
25   if(scanline == 240 && k007121_ctrlram_r(state->m_k007121, space, 7) & 0x02) // vblank irq
26      state->m_maincpu->set_input_line(HD6309_IRQ_LINE, HOLD_LINE);
27   else if(((scanline % 32) == 0) && k007121_ctrlram_r(state->m_k007121, space, 7) & 0x01) // timer irq
28      state->m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
23   address_space &space = generic_space();
24   if(scanline == 240 && k007121_ctrlram_r(m_k007121, space, 7) & 0x02) // vblank irq
25      m_maincpu->set_input_line(HD6309_IRQ_LINE, HOLD_LINE);
26   else if(((scanline % 32) == 0) && k007121_ctrlram_r(m_k007121, space, 7) & 0x01) // timer irq
27      m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
2928}
3029
3130
r18137r18138
219218   /* basic machine hardware */
220219   MCFG_CPU_ADD("maincpu", HD6309, 3000000*4)      /* 24MHz/8? */
221220   MCFG_CPU_PROGRAM_MAP(fastlane_map)
222   MCFG_TIMER_ADD_SCANLINE("scantimer", fastlane_scanline, "screen", 0, 1)
221   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", fastlane_state, fastlane_scanline, "screen", 0, 1)
223222
224223
225224   /* video hardware */
trunk/src/mame/drivers/bionicc.c
r18137r18138
123123
124124********************************************************************/
125125
126static TIMER_DEVICE_CALLBACK( bionicc_scanline )
126TIMER_DEVICE_CALLBACK_MEMBER(bionicc_state::bionicc_scanline)
127127{
128128   int scanline = param;
129129
130130   if(scanline == 240) // vblank-out irq
131      timer.machine().device("maincpu")->execute().set_input_line(2, HOLD_LINE);
131      machine().device("maincpu")->execute().set_input_line(2, HOLD_LINE);
132132
133133   if(scanline == 0) // vblank-in or i8751 related irq
134      timer.machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE);
134      machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE);
135135}
136136
137137
r18137r18138
354354   /* basic machine hardware */
355355   MCFG_CPU_ADD("maincpu", M68000, MASTER_CLOCK / 2) /* 12 MHz - verified in schematics */
356356   MCFG_CPU_PROGRAM_MAP(main_map)
357   MCFG_TIMER_ADD_SCANLINE("scantimer", bionicc_scanline, "screen", 0, 1)
357   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", bionicc_state, bionicc_scanline, "screen", 0, 1)
358358
359359   MCFG_CPU_ADD("audiocpu", Z80, EXO3_F0_CLK / 4)   /* EXO3 C,B=GND, A=5V ==> Divisor 2^2 */
360360   MCFG_CPU_PROGRAM_MAP(sound_map)
trunk/src/mame/drivers/megasys1.c
r18137r18138
155155                        [ Main CPU - System A / Z ]
156156***************************************************************************/
157157
158static TIMER_DEVICE_CALLBACK( megasys1A_scanline )
158TIMER_DEVICE_CALLBACK_MEMBER(megasys1_state::megasys1A_scanline)
159159{
160160   int scanline = param;
161161
162162   if(scanline == 240) // vblank-out irq
163      timer.machine().device("maincpu")->execute().set_input_line(2, HOLD_LINE);
163      machine().device("maincpu")->execute().set_input_line(2, HOLD_LINE);
164164
165165   if(scanline == 0)
166      timer.machine().device("maincpu")->execute().set_input_line(1, HOLD_LINE);
166      machine().device("maincpu")->execute().set_input_line(1, HOLD_LINE);
167167
168168   if(scanline == 128)
169      timer.machine().device("maincpu")->execute().set_input_line(3, HOLD_LINE);
169      machine().device("maincpu")->execute().set_input_line(3, HOLD_LINE);
170170}
171171
172172static ADDRESS_MAP_START( megasys1A_map, AS_PROGRAM, 16, megasys1_state )
r18137r18138
191191                            [ Main CPU - System B ]
192192***************************************************************************/
193193
194static TIMER_DEVICE_CALLBACK( megasys1B_scanline )
194TIMER_DEVICE_CALLBACK_MEMBER(megasys1_state::megasys1B_scanline)
195195{
196196   int scanline = param;
197197
198198   if(scanline == 240) // vblank-out irq
199      timer.machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE);
199      machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE);
200200
201201   if(scanline == 0)
202      timer.machine().device("maincpu")->execute().set_input_line(2, HOLD_LINE);
202      machine().device("maincpu")->execute().set_input_line(2, HOLD_LINE);
203203
204204   if(scanline == 128)
205      timer.machine().device("maincpu")->execute().set_input_line(1, HOLD_LINE);
205      machine().device("maincpu")->execute().set_input_line(1, HOLD_LINE);
206206}
207207
208208
r18137r18138
14661466   /* basic machine hardware */
14671467   MCFG_CPU_ADD("maincpu", M68000, SYS_A_CPU_CLOCK) /* 6MHz verified */
14681468   MCFG_CPU_PROGRAM_MAP(megasys1A_map)
1469   MCFG_TIMER_ADD_SCANLINE("scantimer", megasys1A_scanline, "screen", 0, 1)
1469   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", megasys1_state, megasys1A_scanline, "screen", 0, 1)
14701470
14711471   MCFG_CPU_ADD("soundcpu", M68000, SOUND_CPU_CLOCK) /* 7MHz verified */
14721472   MCFG_CPU_PROGRAM_MAP(megasys1A_sound_map)
r18137r18138
15191519   MCFG_CPU_CLOCK(SYS_B_CPU_CLOCK) /* 8MHz */
15201520   MCFG_CPU_PROGRAM_MAP(megasys1B_map)
15211521   MCFG_TIMER_MODIFY("scantimer")
1522   MCFG_TIMER_CALLBACK(megasys1B_scanline)
1522   MCFG_TIMER_DRIVER_CALLBACK(megasys1_state, megasys1B_scanline)
15231523
15241524   MCFG_CPU_MODIFY("soundcpu")
15251525   MCFG_CPU_PROGRAM_MAP(megasys1B_sound_map)
r18137r18138
15311531   /* basic machine hardware */
15321532   MCFG_CPU_ADD("maincpu", M68000, SYS_B_CPU_CLOCK)
15331533   MCFG_CPU_PROGRAM_MAP(megasys1B_map)
1534   MCFG_TIMER_ADD_SCANLINE("scantimer", megasys1B_scanline, "screen", 0, 1)
1534   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", megasys1_state, megasys1B_scanline, "screen", 0, 1)
15351535
15361536   MCFG_MACHINE_RESET_OVERRIDE(megasys1_state,megasys1)
15371537
r18137r18138
15801580   MCFG_CPU_CLOCK(SYS_C_CPU_CLOCK) /* 12MHz */
15811581   MCFG_CPU_PROGRAM_MAP(megasys1C_map)
15821582   MCFG_TIMER_MODIFY("scantimer")
1583   MCFG_TIMER_CALLBACK(megasys1B_scanline)
1583   MCFG_TIMER_DRIVER_CALLBACK(megasys1_state, megasys1B_scanline)
15841584
15851585   MCFG_CPU_MODIFY("soundcpu")
15861586   MCFG_CPU_PROGRAM_MAP(megasys1B_sound_map)
r18137r18138
16641664   /* basic machine hardware */
16651665   MCFG_CPU_ADD("maincpu", M68000, SYS_A_CPU_CLOCK) /* 6MHz (12MHz / 2) */
16661666   MCFG_CPU_PROGRAM_MAP(megasys1A_map)
1667   MCFG_TIMER_ADD_SCANLINE("scantimer", megasys1A_scanline, "screen", 0, 1)
1667   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", megasys1_state, megasys1A_scanline, "screen", 0, 1)
16681668
16691669   MCFG_CPU_ADD("soundcpu", Z80, 3000000) /* OSC 12MHz divided by 4 ??? */
16701670   MCFG_CPU_PROGRAM_MAP(z80_sound_map)
trunk/src/mame/drivers/airbustr.c
r18137r18138
548548/* Interrupt Generators */
549549
550550/* Main Z80 uses IM2 */
551static TIMER_DEVICE_CALLBACK( airbustr_scanline )
551TIMER_DEVICE_CALLBACK_MEMBER(airbustr_state::airbustr_scanline)
552552{
553553   int scanline = param;
554554
555555   if(scanline == 240) // vblank-out irq
556      timer.machine().device("master")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xff);
556      machine().device("master")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xff);
557557
558558   /* Pandora "sprite end dma" irq? TODO: timing is likely off */
559559   if(scanline == 64)
560      timer.machine().device("master")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xfd);
560      machine().device("master")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xfd);
561561}
562562
563563/* Sub Z80 uses IM2 too, but 0xff irq routine just contains an irq ack in it */
r18137r18138
625625   MCFG_CPU_ADD("master", Z80, 6000000)   // ???
626626   MCFG_CPU_PROGRAM_MAP(master_map)
627627   MCFG_CPU_IO_MAP(master_io_map)
628   MCFG_TIMER_ADD_SCANLINE("scantimer", airbustr_scanline, "screen", 0, 1)
628   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", airbustr_state, airbustr_scanline, "screen", 0, 1)
629629
630630   MCFG_CPU_ADD("slave", Z80, 6000000)   // ???
631631   MCFG_CPU_PROGRAM_MAP(slave_map)
trunk/src/mame/drivers/williams.c
r18137r18138
14431443   MCFG_MACHINE_RESET_OVERRIDE(williams_state,defender)
14441444   MCFG_NVRAM_ADD_0FILL("nvram")
14451445
1446   MCFG_TIMER_ADD("scan_timer", williams_va11_callback)
1447   MCFG_TIMER_ADD("240_timer", williams_count240_callback)
1446   MCFG_TIMER_DRIVER_ADD("scan_timer", williams_state, williams_va11_callback)
1447   MCFG_TIMER_DRIVER_ADD("240_timer", williams_state, williams_count240_callback)
14481448
14491449   /* video hardware */
14501450   MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_SCANLINE | VIDEO_ALWAYS_UPDATE)
r18137r18138
16331633   MCFG_MACHINE_RESET_OVERRIDE(williams_state,williams2)
16341634   MCFG_NVRAM_ADD_0FILL("nvram")
16351635
1636   MCFG_TIMER_ADD("scan_timer", williams2_va11_callback)
1637   MCFG_TIMER_ADD("254_timer", williams2_endscreen_callback)
1636   MCFG_TIMER_DRIVER_ADD("scan_timer", williams_state, williams2_va11_callback)
1637   MCFG_TIMER_DRIVER_ADD("254_timer", williams_state, williams2_endscreen_callback)
16381638
16391639   /* video hardware */
16401640   MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_SCANLINE | VIDEO_ALWAYS_UPDATE)
trunk/src/mame/drivers/xmen.c
r18137r18138
349349   xmen_sprite_callback
350350};
351351
352static TIMER_DEVICE_CALLBACK( xmen_scanline )
352TIMER_DEVICE_CALLBACK_MEMBER(xmen_state::xmen_scanline)
353353{
354   xmen_state *state = timer.machine().driver_data<xmen_state>();
355354   int scanline = param;
356355
357   if(scanline == 240 && state->m_vblank_irq_mask) // vblank-out irq
358      timer.machine().device("maincpu")->execute().set_input_line(3, HOLD_LINE);
356   if(scanline == 240 && m_vblank_irq_mask) // vblank-out irq
357      machine().device("maincpu")->execute().set_input_line(3, HOLD_LINE);
359358
360359   if(scanline == 0) // sprite DMA irq?
361      timer.machine().device("maincpu")->execute().set_input_line(5, HOLD_LINE);
360      machine().device("maincpu")->execute().set_input_line(5, HOLD_LINE);
362361
363362}
364363
r18137r18138
369368   /* basic machine hardware */
370369   MCFG_CPU_ADD("maincpu", M68000, XTAL_16MHz)   /* verified on pcb */
371370   MCFG_CPU_PROGRAM_MAP(main_map)
372   MCFG_TIMER_ADD_SCANLINE("scantimer", xmen_scanline, "screen", 0, 1)
371   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", xmen_state, xmen_scanline, "screen", 0, 1)
373372
374373   MCFG_CPU_ADD("audiocpu", Z80, XTAL_16MHz/2)   /* verified on pcb */
375374   MCFG_CPU_PROGRAM_MAP(sound_map)
r18137r18138
419418   /* basic machine hardware */
420419   MCFG_CPU_ADD("maincpu", M68000, 16000000)   /* ? */
421420   MCFG_CPU_PROGRAM_MAP(6p_main_map)
422   MCFG_TIMER_ADD_SCANLINE("scantimer", xmen_scanline, "lscreen", 0, 1)
421   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", xmen_state, xmen_scanline, "lscreen", 0, 1)
423422
424423   MCFG_CPU_ADD("audiocpu", Z80,8000000)   /* verified with M1, guessed but accurate */
425424   MCFG_CPU_PROGRAM_MAP(sound_map)
trunk/src/mame/drivers/darkmist.c
r18137r18138
213213   GFXDECODE_ENTRY( "gfx3", 0, tilelayout,  0, 16*4 )
214214GFXDECODE_END
215215
216static TIMER_DEVICE_CALLBACK( darkmist_scanline )
216TIMER_DEVICE_CALLBACK_MEMBER(darkmist_state::darkmist_scanline)
217217{
218218   int scanline = param;
219219
220220   if(scanline == 240) // vblank-out irq
221      timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0x10); /* RST 10h */
221      machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0x10); /* RST 10h */
222222
223223   if(scanline == 0) // vblank-in irq
224      timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0x08); /* RST 08h */
224      machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0x08); /* RST 08h */
225225}
226226
227227
r18137r18138
230230   /* basic machine hardware */
231231   MCFG_CPU_ADD("maincpu", Z80,4000000)       /* ? MHz */
232232   MCFG_CPU_PROGRAM_MAP(memmap)
233   MCFG_TIMER_ADD_SCANLINE("scantimer", darkmist_scanline, "screen", 0, 1)
233   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", darkmist_state, darkmist_scanline, "screen", 0, 1)
234234
235235   MCFG_CPU_ADD(CPUTAG_T5182,Z80,14318180/4)   /* 3.579545 MHz */
236236   MCFG_CPU_PROGRAM_MAP(t5182_map)
trunk/src/mame/drivers/mitchell.c
r18137r18138
10781078   m_keymatrix = 0;
10791079}
10801080
1081static TIMER_DEVICE_CALLBACK( mitchell_irq )
1081TIMER_DEVICE_CALLBACK_MEMBER(mitchell_state::mitchell_irq)
10821082{
1083   mitchell_state *state = timer.machine().driver_data<mitchell_state>();
10841083   int scanline = param;
10851084
10861085   if (scanline == 240 || scanline == 0)
10871086   {
1088      state->m_maincpu->set_input_line(0, HOLD_LINE);
1087      m_maincpu->set_input_line(0, HOLD_LINE);
10891088
1090      state->m_irq_source = (scanline == 240);
1089      m_irq_source = (scanline == 240);
10911090   }
10921091}
10931092
r18137r18138
10971096   MCFG_CPU_ADD("maincpu", Z80, XTAL_16MHz/2) /* probably same clock as the other mitchell hardware games */
10981097   MCFG_CPU_PROGRAM_MAP(mgakuen_map)
10991098   MCFG_CPU_IO_MAP(mitchell_io_map)
1100   MCFG_TIMER_ADD_SCANLINE("scantimer", mitchell_irq, "screen", 0, 1)   /* ??? one extra irq seems to be needed for music (see input5_r) */
1099   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", mitchell_state, mitchell_irq, "screen", 0, 1)
11011100
11021101   MCFG_MACHINE_START_OVERRIDE(mitchell_state,mitchell)
11031102   MCFG_MACHINE_RESET_OVERRIDE(mitchell_state,mitchell)
r18137r18138
11341133   MCFG_CPU_ADD("maincpu",Z80, XTAL_16MHz/2) /* verified on pcb */
11351134   MCFG_CPU_PROGRAM_MAP(mitchell_map)
11361135   MCFG_CPU_IO_MAP(mitchell_io_map)
1137   MCFG_TIMER_ADD_SCANLINE("scantimer", mitchell_irq, "screen", 0, 1)   /* ??? one extra irq seems to be needed for music (see input5_r) */
1136   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", mitchell_state, mitchell_irq, "screen", 0, 1)
11381137
11391138   MCFG_MACHINE_START_OVERRIDE(mitchell_state,mitchell)
11401139   MCFG_MACHINE_RESET_OVERRIDE(mitchell_state,mitchell)
r18137r18138
12731272   MCFG_CPU_ADD("maincpu", Z80, XTAL_16MHz/2) /* verified on pcb */
12741273   MCFG_CPU_PROGRAM_MAP(mitchell_map)
12751274   MCFG_CPU_IO_MAP(mitchell_io_map)
1276   MCFG_TIMER_ADD_SCANLINE("scantimer", mitchell_irq, "screen", 0, 1)   /* ??? one extra irq seems to be needed for music (see input5_r) */
1275   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", mitchell_state, mitchell_irq, "screen", 0, 1)
12771276
12781277   MCFG_EEPROM_ADD("eeprom", eeprom_intf)
12791278
r18137r18138
13241323   MCFG_CPU_ADD("maincpu", Z80, XTAL_12MHz/2) /* verified on pcb */
13251324   MCFG_CPU_PROGRAM_MAP(mitchell_map)
13261325   MCFG_CPU_IO_MAP(mitchell_io_map)
1327   MCFG_TIMER_ADD_SCANLINE("scantimer", mitchell_irq, "screen", 0, 1)   /* ??? one extra irq seems to be needed for music (see input5_r) */
1326   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", mitchell_state, mitchell_irq, "screen", 0, 1)
13281327
13291328   MCFG_EEPROM_ADD("eeprom", eeprom_intf)
13301329
trunk/src/mame/drivers/deco_mlc.c
r18137r18138
167167   return machine().primary_screen->vpos();
168168}
169169
170static TIMER_DEVICE_CALLBACK( interrupt_gen )
170TIMER_DEVICE_CALLBACK_MEMBER(deco_mlc_state::interrupt_gen)
171171{
172   deco_mlc_state *state = timer.machine().driver_data<deco_mlc_state>();
173172//  logerror("hit scanline IRQ %d (%08x)\n", machine.primary_screen->vpos(), info.i);
174   timer.machine().device("maincpu")->execute().set_input_line(state->m_mainCpuIsArm ? ARM_IRQ_LINE : 1, HOLD_LINE);
173   machine().device("maincpu")->execute().set_input_line(m_mainCpuIsArm ? ARM_IRQ_LINE : 1, HOLD_LINE);
175174}
176175
177176WRITE32_MEMBER(deco_mlc_state::mlc_irq_w)
r18137r18138
384383   MCFG_MACHINE_RESET_OVERRIDE(deco_mlc_state,mlc)
385384   MCFG_EEPROM_93C46_ADD("eeprom") /* Actually 93c45 */
386385
387   MCFG_TIMER_ADD("int_timer", interrupt_gen)
386   MCFG_TIMER_DRIVER_ADD("int_timer", deco_mlc_state, interrupt_gen)
388387
389388   /* video hardware */
390389   MCFG_SCREEN_ADD("screen", RASTER)
r18137r18138
416415   MCFG_MACHINE_RESET_OVERRIDE(deco_mlc_state,mlc)
417416   MCFG_EEPROM_93C46_ADD("eeprom") /* Actually 93c45 */
418417
419   MCFG_TIMER_ADD("int_timer", interrupt_gen)
418   MCFG_TIMER_DRIVER_ADD("int_timer", deco_mlc_state, interrupt_gen)
420419
421420   /* video hardware */
422421   MCFG_SCREEN_ADD("screen", RASTER)
trunk/src/mame/drivers/snowbros.c
r18137r18138
120120   machine().device("maincpu")->execute().set_input_line(2, CLEAR_LINE);
121121}
122122
123static TIMER_DEVICE_CALLBACK( snowbros_irq )
123TIMER_DEVICE_CALLBACK_MEMBER(snowbros_state::snowbros_irq)
124124{
125   snowbros_state *state = timer.machine().driver_data<snowbros_state>();
126125   int scanline = param;
127126
128127   if(scanline == 240)
129      state->m_maincpu->set_input_line(2, ASSERT_LINE);
128      m_maincpu->set_input_line(2, ASSERT_LINE);
130129
131130   if(scanline == 128)
132      state->m_maincpu->set_input_line(3, ASSERT_LINE);
131      m_maincpu->set_input_line(3, ASSERT_LINE);
133132
134133   if(scanline == 32)
135      state->m_maincpu->set_input_line(4, ASSERT_LINE);
134      m_maincpu->set_input_line(4, ASSERT_LINE);
136135}
137136
138static TIMER_DEVICE_CALLBACK( snowbros3_irq )
137TIMER_DEVICE_CALLBACK_MEMBER(snowbros_state::snowbros3_irq)
139138{
140   snowbros_state *state = timer.machine().driver_data<snowbros_state>();
141   okim6295_device *adpcm = timer.machine().device<okim6295_device>("oki");
139   okim6295_device *adpcm = machine().device<okim6295_device>("oki");
142140   int status = adpcm->read_status();
143141   int scanline = param;
144142
145143   if(scanline == 240)
146      state->m_maincpu->set_input_line(2, ASSERT_LINE);
144      m_maincpu->set_input_line(2, ASSERT_LINE);
147145
148146   if(scanline == 128)
149      state->m_maincpu->set_input_line(3, ASSERT_LINE);
147      m_maincpu->set_input_line(3, ASSERT_LINE);
150148
151149   if(scanline == 32)
152      state->m_maincpu->set_input_line(4, ASSERT_LINE);
150      m_maincpu->set_input_line(4, ASSERT_LINE);
153151
154   if (state->m_sb3_music_is_playing)
152   if (m_sb3_music_is_playing)
155153   {
156154      if ((status&0x08)==0x00)
157155      {
158         adpcm->write_command(0x80|state->m_sb3_music);
156         adpcm->write_command(0x80|m_sb3_music);
159157         adpcm->write_command(0x00|0x82);
160158      }
161159
r18137r18138
15441542   /* basic machine hardware */
15451543   MCFG_CPU_ADD("maincpu", M68000, 8000000) /* 8 Mhz - confirmed */
15461544   MCFG_CPU_PROGRAM_MAP(snowbros_map)
1547   MCFG_TIMER_ADD_SCANLINE("scantimer", snowbros_irq, "screen", 0, 1)
1545   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", snowbros_state, snowbros_irq, "screen", 0, 1)
15481546
15491547   MCFG_CPU_ADD("soundcpu", Z80, 6000000) /* 6 MHz - confirmed */
15501548   MCFG_CPU_PROGRAM_MAP(sound_map)
r18137r18138
16541652   /* basic machine hardware */
16551653   MCFG_CPU_ADD("maincpu", M68000, 16000000)
16561654   MCFG_CPU_PROGRAM_MAP(honeydol_map)
1657   MCFG_TIMER_ADD_SCANLINE("scantimer", snowbros_irq, "screen", 0, 1)
1655   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", snowbros_state, snowbros_irq, "screen", 0, 1)
16581656
16591657   MCFG_CPU_ADD("soundcpu", Z80, 4000000)
16601658   MCFG_CPU_PROGRAM_MAP(honeydol_sound_map)
r18137r18138
16901688   /* basic machine hardware */
16911689   MCFG_CPU_ADD("maincpu", M68000, 16000000) // or 12
16921690   MCFG_CPU_PROGRAM_MAP(twinadv_map)
1693   MCFG_TIMER_ADD_SCANLINE("scantimer", snowbros_irq, "screen", 0, 1)
1691   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", snowbros_state, snowbros_irq, "screen", 0, 1)
16941692
16951693   MCFG_CPU_ADD("soundcpu", Z80, 4000000)
16961694   MCFG_CPU_PROGRAM_MAP(sound_map)
r18137r18138
17671765   /* basic machine hardware */
17681766   MCFG_CPU_ADD("maincpu", M68000, 16000000) /* 16mhz or 12mhz ? */
17691767   MCFG_CPU_PROGRAM_MAP(snowbros3_map)
1770   MCFG_TIMER_ADD_SCANLINE("scantimer", snowbros3_irq, "screen", 0, 1)
1768   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", snowbros_state, snowbros3_irq, "screen", 0, 1)
17711769
17721770   /* video hardware */
17731771   MCFG_SCREEN_ADD("screen", RASTER)
trunk/src/mame/drivers/ddragon3.c
r18137r18138
531531 *
532532 *************************************/
533533
534static TIMER_DEVICE_CALLBACK( ddragon3_scanline )
534TIMER_DEVICE_CALLBACK_MEMBER(ddragon3_state::ddragon3_scanline)
535535{
536   ddragon3_state *state = timer.machine().driver_data<ddragon3_state>();
537536   int scanline = param;
538537
539538   /* An interrupt is generated every 16 scanlines */
540539   if (scanline % 16 == 0)
541540   {
542541      if (scanline > 0)
543         timer.machine().primary_screen->update_partial(scanline - 1);
544      state->m_maincpu->set_input_line(5, ASSERT_LINE);
542         machine().primary_screen->update_partial(scanline - 1);
543      m_maincpu->set_input_line(5, ASSERT_LINE);
545544   }
546545
547546   /* Vblank is raised on scanline 248 */
548547   if (scanline == 248)
549548   {
550      timer.machine().primary_screen->update_partial(scanline - 1);
551      state->m_maincpu->set_input_line(6, ASSERT_LINE);
549      machine().primary_screen->update_partial(scanline - 1);
550      m_maincpu->set_input_line(6, ASSERT_LINE);
552551   }
553552}
554553
r18137r18138
593592   /* basic machine hardware */
594593   MCFG_CPU_ADD("maincpu", M68000, XTAL_20MHz / 2)
595594   MCFG_CPU_PROGRAM_MAP(ddragon3_map)
596   MCFG_TIMER_ADD_SCANLINE("scantimer", ddragon3_scanline, "screen", 0, 1)
595   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", ddragon3_state, ddragon3_scanline, "screen", 0, 1)
597596
598597   MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz)
599598   MCFG_CPU_PROGRAM_MAP(sound_map)
trunk/src/mame/drivers/xexex.c
r18137r18138
273273   }
274274}
275275
276static TIMER_DEVICE_CALLBACK( xexex_interrupt )
276TIMER_DEVICE_CALLBACK_MEMBER(xexex_state::xexex_interrupt)
277277{
278   xexex_state *state = timer.machine().driver_data<xexex_state>();
279278   int scanline = param;
280279
281   if (state->m_suspension_active)
280   if (m_suspension_active)
282281   {
283      state->m_suspension_active = 0;
284      timer.machine().scheduler().trigger(state->m_resume_trigger);
282      m_suspension_active = 0;
283      machine().scheduler().trigger(m_resume_trigger);
285284   }
286285
287286   if(scanline == 0)
288287   {
289288      // IRQ 6 is for test mode only
290         if (state->m_cur_control2 & 0x0020)
291            state->m_maincpu->set_input_line(6, HOLD_LINE);
289         if (m_cur_control2 & 0x0020)
290            m_maincpu->set_input_line(6, HOLD_LINE);
292291   }
293292
294293   /* TODO: vblank is at 256! (enable CCU then have fun in fixing offsetted layers) */
295294   if(scanline == 128)
296295   {
297      if (k053246_is_irq_enabled(state->m_k053246))
296      if (k053246_is_irq_enabled(m_k053246))
298297      {
299298         // OBJDMA starts at the beginning of V-blank
300         xexex_objdma(timer.machine(), 0);
299         xexex_objdma(machine(), 0);
301300
302301         // schedule DMA end interrupt
303         state->m_dmadelay_timer->adjust(XE_DMADELAY);
302         m_dmadelay_timer->adjust(XE_DMADELAY);
304303      }
305304
306305      // IRQ 4 is the V-blank interrupt. It controls color, sound and
307306      // vital game logics that shouldn't be interfered by frame-drop.
308      if (state->m_cur_control2 & 0x0800)
309         state->m_maincpu->set_input_line(4, HOLD_LINE);
307      if (m_cur_control2 & 0x0800)
308         m_maincpu->set_input_line(4, HOLD_LINE);
310309   }
311310}
312311
r18137r18138
513512   /* basic machine hardware */
514513   MCFG_CPU_ADD("maincpu", M68000, 32000000/2)   // 16MHz (32MHz xtal)
515514   MCFG_CPU_PROGRAM_MAP(main_map)
516   MCFG_TIMER_ADD_SCANLINE("scantimer", xexex_interrupt, "screen", 0, 1)
515   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", xexex_state, xexex_interrupt, "screen", 0, 1)
517516
518517   // 8MHz (PCB shows one 32MHz/18.432MHz xtal, reference: www.system16.com)
519518   // more likely 32MHz since 18.432MHz yields 4.608MHz(too slow) or 9.216MHz(too fast) with integer divisors
trunk/src/mame/drivers/exedexes.c
r18137r18138
1616#include "includes/exedexes.h"
1717
1818
19static TIMER_DEVICE_CALLBACK( exedexes_scanline )
19TIMER_DEVICE_CALLBACK_MEMBER(exedexes_state::exedexes_scanline)
2020{
2121   int scanline = param;
2222
2323   if(scanline == 240) // vblank-out irq
24      timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xd7);   /* RST 10h - vblank */
24      machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xd7);   /* RST 10h - vblank */
2525
2626   if(scanline == 0) // unknown irq event
27      timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xcf);   /* RST 08h */
27      machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xcf);   /* RST 08h */
2828}
2929
3030
r18137r18138
228228   /* basic machine hardware */
229229   MCFG_CPU_ADD("maincpu", Z80, 4000000)   /* 4 MHz (?) */
230230   MCFG_CPU_PROGRAM_MAP(exedexes_map)
231   MCFG_TIMER_ADD_SCANLINE("scantimer", exedexes_scanline, "screen", 0, 1)
231   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", exedexes_state, exedexes_scanline, "screen", 0, 1)
232232
233233   MCFG_CPU_ADD("audiocpu", Z80, 3000000)   /* 3 MHz ??? */
234234   MCFG_CPU_PROGRAM_MAP(sound_map)
trunk/src/mame/drivers/balsente.c
r18137r18138
12121212
12131213   MCFG_NVRAM_ADD_0FILL("nvram")
12141214
1215   MCFG_TIMER_ADD("scan_timer", balsente_interrupt_timer)
1216   MCFG_TIMER_ADD("8253_0_timer", balsente_clock_counter_0_ff)
1217   MCFG_TIMER_ADD("8253_1_timer", balsente_counter_callback)
1218   MCFG_TIMER_ADD("8253_2_timer", balsente_counter_callback)
1215   MCFG_TIMER_DRIVER_ADD("scan_timer", balsente_state, balsente_interrupt_timer)
1216   MCFG_TIMER_DRIVER_ADD("8253_0_timer", balsente_state, balsente_clock_counter_0_ff)
1217   MCFG_TIMER_DRIVER_ADD("8253_1_timer", balsente_state, balsente_counter_callback)
1218   MCFG_TIMER_DRIVER_ADD("8253_2_timer", balsente_state, balsente_counter_callback)
12191219
12201220   /* video hardware */
12211221   MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
trunk/src/mame/drivers/mhavoc.c
r18137r18138
483483
484484   MCFG_NVRAM_ADD_1FILL("nvram")
485485
486   MCFG_TIMER_ADD_PERIODIC("5k_timer", mhavoc_cpu_irq_clock, attotime::from_hz(MHAVOC_CLOCK_5K))
486   MCFG_TIMER_DRIVER_ADD_PERIODIC("5k_timer", mhavoc_state, mhavoc_cpu_irq_clock, attotime::from_hz(MHAVOC_CLOCK_5K))
487487
488488   /* video hardware */
489489   MCFG_SCREEN_ADD("screen", VECTOR)
trunk/src/mame/drivers/pgm.c
r18137r18138
488488
489489/* most games require IRQ4 for inputs to work, Puzzli 2 is explicit about not wanting it tho
490490   what is the source? */
491TIMER_DEVICE_CALLBACK( pgm_interrupt )
491TIMER_DEVICE_CALLBACK_MEMBER(pgm_state::pgm_interrupt)
492492{
493   pgm_state *state = timer.machine().driver_data<pgm_state>();
494493   int scanline = param;
495494
496495   if(scanline == 224)
497      state->m_maincpu->set_input_line(6, HOLD_LINE);
496      m_maincpu->set_input_line(6, HOLD_LINE);
498497
499498   if(scanline == 0)
500      if (!state->m_irq4_disabled) state->m_maincpu->set_input_line(4, HOLD_LINE);
499      if (!m_irq4_disabled) m_maincpu->set_input_line(4, HOLD_LINE);
501500}
502501
503502MACHINE_START_MEMBER(pgm_state,pgm)
r18137r18138
521520   MCFG_CPU_ADD("maincpu", M68000, 20000000) /* 20 mhz! verified on real board */
522521   MCFG_CPU_PROGRAM_MAP(pgm_basic_mem)
523522   MCFG_CPU_VBLANK_INT_DRIVER("screen", pgm_state,  irq6_line_hold)
524   MCFG_TIMER_ADD_SCANLINE("scantimer", pgm_interrupt, "screen", 0, 1)
523   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", pgm_state, pgm_interrupt, "screen", 0, 1)
525524
526525   MCFG_CPU_ADD("soundcpu", Z80, 33868800/4)
527526   MCFG_CPU_PROGRAM_MAP(pgm_z80_mem)
trunk/src/mame/drivers/m107.c
r18137r18138
4747
4848/*****************************************************************************/
4949
50static TIMER_DEVICE_CALLBACK( m107_scanline_interrupt )
50TIMER_DEVICE_CALLBACK_MEMBER(m107_state::m107_scanline_interrupt)
5151{
52   running_machine &machine = timer.machine();
53   m107_state *state = machine.driver_data<m107_state>();
5452   int scanline = param;
53   m107_state *state = machine().driver_data<m107_state>();
5554
5655   /* raster interrupt */
57   if (scanline == state->m_raster_irq_position)
56   if (scanline == m_raster_irq_position)
5857   {
59      machine.primary_screen->update_partial(scanline);
60      machine.device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, M107_IRQ_2);
58      machine().primary_screen->update_partial(scanline);
59      state->m_maincpu->set_input_line_and_vector(0, HOLD_LINE, M107_IRQ_2);
6160   }
6261
6362   /* VBLANK interrupt */
64   else if (scanline == machine.primary_screen->visible_area().max_y + 1)
63   else if (scanline == machine().primary_screen->visible_area().max_y + 1)
6564   {
66      machine.primary_screen->update_partial(scanline);
67      machine.device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, M107_IRQ_0);
65      machine().primary_screen->update_partial(scanline);
66      state->m_maincpu->set_input_line_and_vector(0, HOLD_LINE, M107_IRQ_0);
6867   }
6968}
7069
r18137r18138
780779   MCFG_CPU_CONFIG(firebarr_config)
781780
782781
783   MCFG_TIMER_ADD_SCANLINE("scantimer", m107_scanline_interrupt, "screen", 0, 1)
782   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", m107_state, m107_scanline_interrupt, "screen", 0, 1)
784783
785784   /* video hardware */
786785   MCFG_SCREEN_ADD("screen", RASTER)
trunk/src/mame/drivers/hexion.c
r18137r18138
199199   GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 16 )
200200GFXDECODE_END
201201
202static TIMER_DEVICE_CALLBACK( hexion_scanline )
202TIMER_DEVICE_CALLBACK_MEMBER(hexion_state::hexion_scanline)
203203{
204   //hexion_state *state = timer.machine().driver_data<hexion_state>();
205204   int scanline = param;
206205
207206   if(scanline == 256)
208      timer.machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
207      machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
209208   else if ((scanline == 85) || (scanline == 170)) //TODO
210      timer.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
209      machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
211210}
212211
213212static const k053252_interface hexion_k053252_intf =
r18137r18138
225224   /* basic machine hardware */
226225   MCFG_CPU_ADD("maincpu", Z80,24000000/4)   /* Z80B 6 MHz */
227226   MCFG_CPU_PROGRAM_MAP(hexion_map)
228   MCFG_TIMER_ADD_SCANLINE("scantimer", hexion_scanline, "screen", 0, 1)
227   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", hexion_state, hexion_scanline, "screen", 0, 1)
229228
230229   MCFG_K053252_ADD("k053252", 24000000/2, hexion_k053252_intf)
231230
trunk/src/mame/drivers/exterm.c
r18137r18138
193193 *
194194 *************************************/
195195
196static TIMER_DEVICE_CALLBACK( master_sound_nmi_callback )
196TIMER_DEVICE_CALLBACK_MEMBER(exterm_state::master_sound_nmi_callback)
197197{
198   exterm_state *state = timer.machine().driver_data<exterm_state>();
199198   /* bit 0 of the sound control determines if the NMI is actually delivered */
200   if (state->m_sound_control & 0x01)
201      timer.machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
199   if (m_sound_control & 0x01)
200      machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
202201}
203202
204203
r18137r18138
457456
458457   MCFG_NVRAM_ADD_0FILL("nvram")
459458
460   MCFG_TIMER_ADD("snd_nmi_timer", master_sound_nmi_callback)
459   MCFG_TIMER_DRIVER_ADD("snd_nmi_timer", exterm_state, master_sound_nmi_callback)
461460
462461   /* video hardware */
463462   MCFG_PALETTE_LENGTH(2048+32768)
trunk/src/mame/drivers/n8080.c
r18137r18138
428428
429429/* Interrupts */
430430
431static TIMER_DEVICE_CALLBACK( rst1_tick )
431TIMER_DEVICE_CALLBACK_MEMBER(n8080_state::rst1_tick)
432432{
433   n8080_state *n8080 = timer.machine().driver_data<n8080_state>();
434   int state = n8080->m_inte ? ASSERT_LINE : CLEAR_LINE;
433   int state = m_inte ? ASSERT_LINE : CLEAR_LINE;
435434
436435   /* V7 = 1, V6 = 0 */
437   n8080->m_maincpu->set_input_line_and_vector(INPUT_LINE_IRQ0, state, 0xcf);
436   m_maincpu->set_input_line_and_vector(INPUT_LINE_IRQ0, state, 0xcf);
438437}
439438
440static TIMER_DEVICE_CALLBACK( rst2_tick )
439TIMER_DEVICE_CALLBACK_MEMBER(n8080_state::rst2_tick)
441440{
442   n8080_state *n8080 = timer.machine().driver_data<n8080_state>();
443   int state = n8080->m_inte ? ASSERT_LINE : CLEAR_LINE;
441   int state = m_inte ? ASSERT_LINE : CLEAR_LINE;
444442
445443   /* vblank */
446   n8080->m_maincpu->set_input_line_and_vector(INPUT_LINE_IRQ0, state, 0xd7);
444   m_maincpu->set_input_line_and_vector(INPUT_LINE_IRQ0, state, 0xd7);
447445}
448446
449447WRITE_LINE_MEMBER(n8080_state::n8080_inte_callback)
r18137r18138
560558   MCFG_PALETTE_INIT_OVERRIDE(n8080_state,n8080)
561559   MCFG_VIDEO_START_OVERRIDE(n8080_state,spacefev)
562560
563   MCFG_TIMER_ADD_SCANLINE("rst1", rst1_tick, "screen", 128, 256)
564   MCFG_TIMER_ADD_SCANLINE("rst2", rst2_tick, "screen", 240, 256)
561   MCFG_TIMER_DRIVER_ADD_SCANLINE("rst1", n8080_state, rst1_tick, "screen", 128, 256)
562   MCFG_TIMER_DRIVER_ADD_SCANLINE("rst2", n8080_state, rst2_tick, "screen", 240, 256)
565563
566564   /* sound hardware */
567565   MCFG_FRAGMENT_ADD( spacefev_sound )
r18137r18138
590588   MCFG_PALETTE_INIT_OVERRIDE(n8080_state,n8080)
591589   MCFG_VIDEO_START_OVERRIDE(n8080_state,sheriff)
592590
593   MCFG_TIMER_ADD_SCANLINE("rst1", rst1_tick, "screen", 128, 256)
594   MCFG_TIMER_ADD_SCANLINE("rst2", rst2_tick, "screen", 240, 256)
591   MCFG_TIMER_DRIVER_ADD_SCANLINE("rst1", n8080_state, rst1_tick, "screen", 128, 256)
592   MCFG_TIMER_DRIVER_ADD_SCANLINE("rst2", n8080_state, rst2_tick, "screen", 240, 256)
595593
596594   /* sound hardware */
597595   MCFG_FRAGMENT_ADD( sheriff_sound )
r18137r18138
632630   MCFG_PALETTE_INIT_OVERRIDE(n8080_state,helifire)
633631   MCFG_VIDEO_START_OVERRIDE(n8080_state,helifire)
634632
635   MCFG_TIMER_ADD_SCANLINE("rst1", rst1_tick, "screen", 128, 256)
636   MCFG_TIMER_ADD_SCANLINE("rst2", rst2_tick, "screen", 240, 256)
633   MCFG_TIMER_DRIVER_ADD_SCANLINE("rst1", n8080_state, rst1_tick, "screen", 128, 256)
634   MCFG_TIMER_DRIVER_ADD_SCANLINE("rst2", n8080_state, rst2_tick, "screen", 240, 256)
637635
638636   /* sound hardware */
639637   MCFG_FRAGMENT_ADD( helifire_sound )
trunk/src/mame/drivers/cave.c
r18137r18138
123123   m_agallet_vblank_irq = 0;
124124}
125125
126static TIMER_DEVICE_CALLBACK( cave_vblank_start )
126TIMER_DEVICE_CALLBACK_MEMBER(cave_state::cave_vblank_start)
127127{
128   cave_state *state = timer.machine().driver_data<cave_state>();
129   state->m_vblank_irq = 1;
130   update_irq_state(timer.machine());
131   cave_get_sprite_info(timer.machine());
132   state->m_agallet_vblank_irq = 1;
133   timer.machine().scheduler().timer_set(attotime::from_usec(2000), timer_expired_delegate(FUNC(cave_state::cave_vblank_end),state));
128   m_vblank_irq = 1;
129   update_irq_state(machine());
130   cave_get_sprite_info(machine());
131   m_agallet_vblank_irq = 1;
132   machine().scheduler().timer_set(attotime::from_usec(2000), timer_expired_delegate(FUNC(cave_state::cave_vblank_end),this));
134133}
135134
136135/* Called once/frame to generate the VBLANK interrupt */
r18137r18138
18581857   MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave)
18591858   MCFG_EEPROM_93C46_ADD("eeprom")
18601859
1861   MCFG_TIMER_ADD("int_timer", cave_vblank_start)
1860   MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start)
18621861
18631862   /* video hardware */
18641863   MCFG_SCREEN_ADD("screen", RASTER)
r18137r18138
19001899   MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave)
19011900   MCFG_EEPROM_93C46_ADD("eeprom")
19021901
1903   MCFG_TIMER_ADD("int_timer", cave_vblank_start)
1902   MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start)
19041903
19051904   /* video hardware */
19061905   MCFG_SCREEN_ADD("screen", RASTER)
r18137r18138
19461945   MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave)
19471946   MCFG_EEPROM_93C46_ADD("eeprom")
19481947
1949   MCFG_TIMER_ADD("int_timer", cave_vblank_start)
1948   MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start)
19501949
19511950   /* video hardware */
19521951   MCFG_SCREEN_ADD("screen", RASTER)
r18137r18138
19921991   MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave)
19931992   MCFG_EEPROM_93C46_ADD("eeprom")
19941993
1995   MCFG_TIMER_ADD("int_timer", cave_vblank_start)
1994   MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start)
19961995
19971996   /* video hardware */
19981997   MCFG_SCREEN_ADD("screen", RASTER)
r18137r18138
20322031   MCFG_MACHINE_START_OVERRIDE(cave_state,cave)
20332032   MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave)
20342033
2035   MCFG_TIMER_ADD("int_timer", cave_vblank_start)
2034   MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start)
20362035
20372036   /* video hardware */
20382037   MCFG_SCREEN_ADD("screen", RASTER)
r18137r18138
20732072   MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave)
20742073   MCFG_EEPROM_93C46_ADD("eeprom")
20752074
2076   MCFG_TIMER_ADD("int_timer", cave_vblank_start)
2075   MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start)
20772076
20782077   /* video hardware */
20792078   MCFG_SCREEN_ADD("screen", RASTER)
r18137r18138
21172116   MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave)
21182117   MCFG_EEPROM_93C46_ADD("eeprom")
21192118
2120   MCFG_TIMER_ADD("int_timer", cave_vblank_start)
2119   MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start)
21212120
21222121   /* video hardware */
21232122   MCFG_SCREEN_ADD("screen", RASTER)
r18137r18138
21692168   MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave)
21702169   MCFG_EEPROM_93C46_8BIT_ADD("eeprom")
21712170
2172   MCFG_TIMER_ADD("int_timer", cave_vblank_start)
2171   MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start)
21732172
21742173   /* video hardware */
21752174   MCFG_SCREEN_ADD("screen", RASTER)
r18137r18138
22232222   MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave)
22242223   MCFG_EEPROM_93C46_ADD("eeprom")
22252224
2226   MCFG_TIMER_ADD("int_timer", cave_vblank_start)
2225   MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start)
22272226
22282227   /* video hardware */
22292228   MCFG_SCREEN_ADD("screen", RASTER)
r18137r18138
22812280   MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave)   /* start with the watchdog armed */
22822281   MCFG_EEPROM_93C46_ADD("eeprom")
22832282
2284   MCFG_TIMER_ADD("int_timer", cave_vblank_start)
2283   MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start)
22852284
22862285   /* video hardware */
22872286   MCFG_SCREEN_ADD("screen", RASTER)
r18137r18138
23362335   MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave)
23372336   MCFG_EEPROM_ADD("eeprom", eeprom_interface_93C46_pacslot)
23382337
2339   MCFG_TIMER_ADD("int_timer", cave_vblank_start)
2338   MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start)
23402339
23412340   /* video hardware */
23422341   MCFG_SCREEN_ADD("screen", RASTER)
r18137r18138
23922391   MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave)
23932392   MCFG_EEPROM_93C46_ADD("eeprom")
23942393
2395   MCFG_TIMER_ADD("int_timer", cave_vblank_start)
2394   MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start)
23962395
23972396   /* video hardware */
23982397   MCFG_SCREEN_ADD("screen", RASTER)
r18137r18138
24552454   MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave)
24562455   MCFG_EEPROM_93C46_ADD("eeprom")
24572456
2458   MCFG_TIMER_ADD("int_timer", cave_vblank_start)
2457   MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start)
24592458
24602459   /* video hardware */
24612460   MCFG_SCREEN_ADD("screen", RASTER)
r18137r18138
25092508   MCFG_MACHINE_RESET_OVERRIDE(cave_state,cave)
25102509   MCFG_EEPROM_93C46_ADD("eeprom")
25112510
2512   MCFG_TIMER_ADD("int_timer", cave_vblank_start)
2511   MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start)
25132512
25142513   /* video hardware */
25152514   MCFG_SCREEN_ADD("screen", RASTER)
r18137r18138
25502549   MCFG_MACHINE_START_OVERRIDE(cave_state,cave)
25512550   MCFG_EEPROM_93C46_ADD("eeprom")
25522551
2553   MCFG_TIMER_ADD("int_timer", cave_vblank_start)
2552   MCFG_TIMER_DRIVER_ADD("int_timer", cave_state, cave_vblank_start)
25542553
25552554   /* video hardware */
25562555   MCFG_SCREEN_ADD("screen", RASTER)
trunk/src/mame/drivers/kaneko16.c
r18137r18138
15781578
15791579***************************************************************************/
15801580
1581static TIMER_DEVICE_CALLBACK( kaneko16_interrupt )
1581TIMER_DEVICE_CALLBACK_MEMBER(kaneko16_state::kaneko16_interrupt)
15821582{
1583   kaneko16_state *state = timer.machine().driver_data<kaneko16_state>();
15841583   int scanline = param;
15851584
15861585   // main vblank interrupt
15871586   if(scanline == 224)
1588      state->m_maincpu->set_input_line(5, HOLD_LINE);
1587      m_maincpu->set_input_line(5, HOLD_LINE);
15891588
15901589   // each of these 2 int are responsible of translating a part of sprite buffer
15911590   // from work ram to sprite ram. How these are scheduled is unknown.
15921591   if(scanline == 64)
1593      state->m_maincpu->set_input_line(4, HOLD_LINE);
1592      m_maincpu->set_input_line(4, HOLD_LINE);
15941593
15951594   if(scanline == 144)
1596      state->m_maincpu->set_input_line(3, HOLD_LINE);
1595      m_maincpu->set_input_line(3, HOLD_LINE);
15971596}
15981597
15991598static const ay8910_interface ay8910_intf_dsw =
r18137r18138
16441643   /* basic machine hardware */
16451644   MCFG_CPU_ADD("maincpu", M68000, 12000000)   /* MC68000P12 */
16461645   MCFG_CPU_PROGRAM_MAP(berlwall)
1647   MCFG_TIMER_ADD_SCANLINE("scantimer", kaneko16_interrupt, "screen", 0, 1)
1646   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", kaneko16_state, kaneko16_interrupt, "screen", 0, 1)
16481647
16491648   /* video hardware */
16501649   MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK)   // mangled sprites otherwise
r18137r18138
16951694   /* basic machine hardware */
16961695   MCFG_CPU_ADD("maincpu", M68000, XTAL_12MHz) /* verified on pcb */
16971696   MCFG_CPU_PROGRAM_MAP(bakubrkr)
1698   MCFG_TIMER_ADD_SCANLINE("scantimer", kaneko16_interrupt, "screen", 0, 1)
1697   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", kaneko16_state, kaneko16_interrupt, "screen", 0, 1)
16991698
17001699   MCFG_MACHINE_RESET_OVERRIDE(kaneko16_state,gtmr)
17011700   MCFG_EEPROM_93C46_ADD("eeprom")
r18137r18138
17631762   /* basic machine hardware */
17641763   MCFG_CPU_ADD("maincpu", M68000,12000000)   /* TMP68HC000-12 */
17651764   MCFG_CPU_PROGRAM_MAP(blazeon)
1766   MCFG_TIMER_ADD_SCANLINE("scantimer", kaneko16_interrupt, "screen", 0, 1)
1765   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", kaneko16_state, kaneko16_interrupt, "screen", 0, 1)
17671766
17681767   MCFG_CPU_ADD("audiocpu", Z80,4000000)   /* D780C-2 */
17691768   MCFG_CPU_PROGRAM_MAP(blazeon_soundmem)
r18137r18138
18231822   /* basic machine hardware */
18241823   MCFG_CPU_ADD("maincpu", M68000, XTAL_16MHz)   /* verified on pcb */
18251824   MCFG_CPU_PROGRAM_MAP(gtmr_map)
1826   MCFG_TIMER_ADD_SCANLINE("scantimer", kaneko16_interrupt, "screen", 0, 1)
1825   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", kaneko16_state, kaneko16_interrupt, "screen", 0, 1)
18271826
18281827   MCFG_MACHINE_RESET_OVERRIDE(kaneko16_gtmr_state,gtmr)
18291828
r18137r18138
19421941   /* basic machine hardware */
19431942   MCFG_CPU_ADD("maincpu", M68000, XTAL_12MHz) /* verified on pcb */
19441943   MCFG_CPU_PROGRAM_MAP(mgcrystl)
1945   MCFG_TIMER_ADD_SCANLINE("scantimer", kaneko16_interrupt, "screen", 0, 1)
1944   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", kaneko16_state, kaneko16_interrupt, "screen", 0, 1)
19461945
19471946   MCFG_MACHINE_RESET_OVERRIDE(kaneko16_state,mgcrystl)
19481947   MCFG_EEPROM_93C46_ADD("eeprom")
r18137r18138
20092008    other: busy loop
20102009*/
20112010
2012static TIMER_DEVICE_CALLBACK( shogwarr_interrupt )
2011TIMER_DEVICE_CALLBACK_MEMBER(kaneko16_state::shogwarr_interrupt)
20132012{
2014   kaneko16_shogwarr_state *state = timer.machine().driver_data<kaneko16_shogwarr_state>();
20152013   int scanline = param;
20162014
20172015   if(scanline == 224)
20182016   {
20192017      // the code for this interrupt is provided by the MCU..
2020      state->m_maincpu->set_input_line(4, HOLD_LINE);
2018      m_maincpu->set_input_line(4, HOLD_LINE);
20212019   }
20222020
20232021   if(scanline == 64)
2024      state->m_maincpu->set_input_line(3, HOLD_LINE);
2022      m_maincpu->set_input_line(3, HOLD_LINE);
20252023
20262024   if(scanline == 144)
2027      state->m_maincpu->set_input_line(2, HOLD_LINE);
2025      m_maincpu->set_input_line(2, HOLD_LINE);
20282026}
20292027
20302028/*
r18137r18138
20662064   /* basic machine hardware */
20672065   MCFG_CPU_ADD("maincpu", M68000, XTAL_12MHz)
20682066   MCFG_CPU_PROGRAM_MAP(shogwarr)
2069   MCFG_TIMER_ADD_SCANLINE("scantimer", shogwarr_interrupt, "screen", 0, 1)
2067   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", kaneko16_state, shogwarr_interrupt, "screen", 0, 1)
20702068
20712069   MCFG_MACHINE_RESET_OVERRIDE(kaneko16_shogwarr_state,mgcrystl)
20722070
trunk/src/mame/drivers/snk6502.c
r18137r18138
298298
299299
300300/* binary counter (1.4MHz update) */
301static TIMER_DEVICE_CALLBACK( sasuke_update_counter )
301TIMER_DEVICE_CALLBACK_MEMBER(snk6502_state::sasuke_update_counter)
302302{
303   snk6502_state *state = timer.machine().driver_data<snk6502_state>();
304
305   state->m_sasuke_counter += 0x10;
303   m_sasuke_counter += 0x10;
306304}
307305
308306static void sasuke_start_counter(running_machine &machine)
r18137r18138
844842
845843   MCFG_MC6845_ADD("crtc", MC6845, MASTER_CLOCK / 16, mc6845_intf)
846844
847   MCFG_TIMER_ADD_PERIODIC("sasuke_timer", sasuke_update_counter, attotime::from_hz(MASTER_CLOCK / 8))   // 1.4 MHz
845   MCFG_TIMER_DRIVER_ADD_PERIODIC("sasuke_timer", snk6502_state, sasuke_update_counter, attotime::from_hz(MASTER_CLOCK / 8))
848846
849847   // sound hardware
850848   MCFG_SPEAKER_STANDARD_MONO("mono")
trunk/src/mame/drivers/wwfsstar.c
r18137r18138
239239    A hack is required: raise the vblank bit a scanline early.
240240*/
241241
242static TIMER_DEVICE_CALLBACK( wwfsstar_scanline )
242TIMER_DEVICE_CALLBACK_MEMBER(wwfsstar_state::wwfsstar_scanline)
243243{
244   wwfsstar_state *state = timer.machine().driver_data<wwfsstar_state>();
245244   int scanline = param;
246245
247246   /* Vblank is lowered on scanline 0 */
248247   if (scanline == 0)
249248   {
250      state->m_vblank = 0;
249      m_vblank = 0;
251250   }
252251   /* Hack */
253252   else if (scanline == (240-1))      /* -1 is an hack needed to avoid deadlocks */
254253   {
255      state->m_vblank = 1;
254      m_vblank = 1;
256255   }
257256
258257   /* An interrupt is generated every 16 scanlines */
259258   if (scanline % 16 == 0)
260259   {
261260      if (scanline > 0)
262         timer.machine().primary_screen->update_partial(scanline - 1);
263      timer.machine().device("maincpu")->execute().set_input_line(5, ASSERT_LINE);
261         machine().primary_screen->update_partial(scanline - 1);
262      machine().device("maincpu")->execute().set_input_line(5, ASSERT_LINE);
264263   }
265264
266265   /* Vblank is raised on scanline 240 */
267266   if (scanline == 240)
268267   {
269      timer.machine().primary_screen->update_partial(scanline - 1);
270      timer.machine().device("maincpu")->execute().set_input_line(6, ASSERT_LINE);
268      machine().primary_screen->update_partial(scanline - 1);
269      machine().device("maincpu")->execute().set_input_line(6, ASSERT_LINE);
271270   }
272271}
273272
r18137r18138
426425   /* basic machine hardware */
427426   MCFG_CPU_ADD("maincpu", M68000, CPU_CLOCK)
428427   MCFG_CPU_PROGRAM_MAP(main_map)
429   MCFG_TIMER_ADD_SCANLINE("scantimer", wwfsstar_scanline, "screen", 0, 1)
428   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", wwfsstar_state, wwfsstar_scanline, "screen", 0, 1)
430429
431430   MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz)
432431   MCFG_CPU_PROGRAM_MAP(sound_map)
trunk/src/mame/drivers/mw8080bw.c
r18137r18138
21162116#define SPCENCTR_STROBE_DUTY_CYCLE   (95)   /* % */
21172117
21182118
2119static TIMER_DEVICE_CALLBACK( spcenctr_strobe_timer_callback )
2119TIMER_DEVICE_CALLBACK_MEMBER(mw8080bw_state::spcenctr_strobe_timer_callback)
21202120{
2121   mw8080bw_state *state = timer.machine().driver_data<mw8080bw_state>();
2122   output_set_value("STROBE", param && state->m_spcenctr_strobe_state);
2121   output_set_value("STROBE", param && m_spcenctr_strobe_state);
21232122}
21242123
21252124
r18137r18138
22592258   MCFG_WATCHDOG_TIME_INIT(255 * attotime::from_hz(MW8080BW_60HZ))
22602259
22612260   /* timers */
2262   MCFG_TIMER_ADD_PERIODIC("strobeon", spcenctr_strobe_timer_callback, attotime::from_hz(SPCENCTR_STROBE_FREQ))
2261   MCFG_TIMER_DRIVER_ADD_PERIODIC("strobeon", mw8080bw_state, spcenctr_strobe_timer_callback, attotime::from_hz(SPCENCTR_STROBE_FREQ))
22632262   MCFG_TIMER_PARAM(TRUE)   /* indicates strobe ON */
22642263
2265   MCFG_TIMER_ADD_PERIODIC("strobeoff", spcenctr_strobe_timer_callback, attotime::from_hz(SPCENCTR_STROBE_FREQ))
2264   MCFG_TIMER_DRIVER_ADD_PERIODIC("strobeoff", mw8080bw_state, spcenctr_strobe_timer_callback, attotime::from_hz(SPCENCTR_STROBE_FREQ))
22662265   MCFG_TIMER_START_DELAY(attotime::from_hz(SPCENCTR_STROBE_FREQ * 100 / SPCENCTR_STROBE_DUTY_CYCLE))
22672266   MCFG_TIMER_PARAM(FALSE)   /* indicates strobe OFF */
22682267
trunk/src/mame/drivers/gaelco3d.c
r18137r18138
623623 *
624624 *************************************/
625625
626static TIMER_DEVICE_CALLBACK( adsp_autobuffer_irq )
626TIMER_DEVICE_CALLBACK_MEMBER(gaelco3d_state::adsp_autobuffer_irq)
627627{
628   gaelco3d_state *state = timer.machine().driver_data<gaelco3d_state>();
629   cpu_device *adsp = timer.machine().device<cpu_device>("adsp");
628   cpu_device *adsp = machine().device<cpu_device>("adsp");
630629
631630   /* get the index register */
632   int reg = adsp->state_int(ADSP2100_I0 + state->m_adsp_ireg);
631   int reg = adsp->state_int(ADSP2100_I0 + m_adsp_ireg);
633632
634633   /* copy the current data into the buffer */
635// logerror("ADSP buffer: I%d=%04X incs=%04X size=%04X\n", state->m_adsp_ireg, reg, state->m_adsp_incs, state->m_adsp_size);
636   if (state->m_adsp_incs)
637      dmadac_transfer(&state->m_dmadac[0], SOUND_CHANNELS, state->m_adsp_incs, SOUND_CHANNELS * state->m_adsp_incs, state->m_adsp_size / (SOUND_CHANNELS * state->m_adsp_incs), (INT16 *)&state->m_adsp_fastram_base[reg - 0x3800]);
634// logerror("ADSP buffer: I%d=%04X incs=%04X size=%04X\n", m_adsp_ireg, reg, m_adsp_incs, m_adsp_size);
635   if (m_adsp_incs)
636      dmadac_transfer(&m_dmadac[0], SOUND_CHANNELS, m_adsp_incs, SOUND_CHANNELS * m_adsp_incs, m_adsp_size / (SOUND_CHANNELS * m_adsp_incs), (INT16 *)&m_adsp_fastram_base[reg - 0x3800]);
638637
639638   /* increment it */
640   reg += state->m_adsp_size;
639   reg += m_adsp_size;
641640
642641   /* check for wrapping */
643   if (reg >= state->m_adsp_ireg_base + state->m_adsp_size)
642   if (reg >= m_adsp_ireg_base + m_adsp_size)
644643   {
645644      /* reset the base pointer */
646      reg = state->m_adsp_ireg_base;
645      reg = m_adsp_ireg_base;
647646
648647      /* generate the (internal, thats why the pulse) irq */
649      generic_pulse_irq_line(adsp, ADSP2105_IRQ1, 1);
648      generic_pulse_irq_line(*adsp, ADSP2105_IRQ1, 1);
650649   }
651650
652651   /* store it */
653   adsp->set_state_int(ADSP2100_I0 + state->m_adsp_ireg, reg);
652   adsp->set_state_int(ADSP2100_I0 + m_adsp_ireg, reg);
654653}
655654
656655
r18137r18138
10091008
10101009   MCFG_QUANTUM_TIME(attotime::from_hz(6000))
10111010
1012   MCFG_TIMER_ADD("adsp_timer", adsp_autobuffer_irq)
1011   MCFG_TIMER_DRIVER_ADD("adsp_timer", gaelco3d_state, adsp_autobuffer_irq)
10131012   MCFG_GAELCO_SERIAL_ADD("serial", 0, serial_interface)
10141013
10151014   /* video hardware */
trunk/src/mame/drivers/namconb1.c
r18137r18138
282282/****************************************************************************/
283283
284284
285static TIMER_DEVICE_CALLBACK( mcu_interrupt )
285TIMER_DEVICE_CALLBACK_MEMBER(namconb1_state::mcu_interrupt)
286286{
287287   int scanline = param;
288288
289289   /* TODO: real sources of these */
290290   if (scanline == 224)
291      timer.machine().device("mcu")->execute().set_input_line(M37710_LINE_IRQ0, HOLD_LINE);
291      machine().device("mcu")->execute().set_input_line(M37710_LINE_IRQ0, HOLD_LINE);
292292   else if (scanline == 0)
293      timer.machine().device("mcu")->execute().set_input_line(M37710_LINE_IRQ2, HOLD_LINE);
293      machine().device("mcu")->execute().set_input_line(M37710_LINE_IRQ2, HOLD_LINE);
294294   else if (scanline == 128)
295      timer.machine().device("mcu")->execute().set_input_line(M37710_LINE_ADC, HOLD_LINE);
295      machine().device("mcu")->execute().set_input_line(M37710_LINE_ADC, HOLD_LINE);
296296}
297297
298298
r18137r18138
10101010   MCFG_CPU_ADD("mcu", M37702, MASTER_CLOCK_HZ/3)
10111011   MCFG_CPU_PROGRAM_MAP(namcoc75_am)
10121012   MCFG_CPU_IO_MAP(namcoc75_io)
1013   MCFG_TIMER_ADD_SCANLINE("mcu_st", mcu_interrupt, "screen", 0, 1)
1013   MCFG_TIMER_DRIVER_ADD_SCANLINE("mcu_st", namconb1_state, mcu_interrupt, "screen", 0, 1)
10141014
10151015   MCFG_NVRAM_HANDLER(namconb1)
10161016   MCFG_MACHINE_START_OVERRIDE(namconb1_state,namconb)
r18137r18138
10421042   MCFG_CPU_ADD("mcu", M37702, MASTER_CLOCK_HZ/3)
10431043   MCFG_CPU_PROGRAM_MAP(namcoc75_am)
10441044   MCFG_CPU_IO_MAP(namcoc75_io)
1045   MCFG_TIMER_ADD_SCANLINE("mcu_st", mcu_interrupt, "screen", 0, 1)
1045   MCFG_TIMER_DRIVER_ADD_SCANLINE("mcu_st", namconb1_state, mcu_interrupt, "screen", 0, 1)
10461046
10471047   MCFG_NVRAM_HANDLER(namconb1)
10481048   MCFG_MACHINE_START_OVERRIDE(namconb1_state,namconb)
trunk/src/mame/drivers/astrof.c
r18137r18138
8787}
8888
8989
90static TIMER_DEVICE_CALLBACK( irq_callback )
90TIMER_DEVICE_CALLBACK_MEMBER(astrof_state::irq_callback)
9191{
92   astrof_state *state = timer.machine().driver_data<astrof_state>();
93   state->m_maincpu->set_input_line(0, ASSERT_LINE);
92   m_maincpu->set_input_line(0, ASSERT_LINE);
9493}
9594
9695
r18137r18138
943942
944943   /* basic machine hardware */
945944   MCFG_CPU_ADD("maincpu", M6502, MAIN_CPU_CLOCK)
946   MCFG_TIMER_ADD_SCANLINE("vblank", irq_callback, "screen", VBSTART, 0)
945   MCFG_TIMER_DRIVER_ADD_SCANLINE("vblank", astrof_state, irq_callback, "screen", VBSTART, 0)
947946
948947   /* video hardware */
949948
trunk/src/mame/drivers/strnskil.c
r18137r18138
317317GFXDECODE_END
318318
319319
320static TIMER_DEVICE_CALLBACK( strnskil_irq )
320TIMER_DEVICE_CALLBACK_MEMBER(strnskil_state::strnskil_irq)
321321{
322   strnskil_state *state = timer.machine().driver_data<strnskil_state>();
323322   int scanline = param;
324323
325324   if(scanline == 240 || scanline == 96)
326325   {
327      state->m_maincpu->set_input_line(0,HOLD_LINE);
326      m_maincpu->set_input_line(0,HOLD_LINE);
328327
329      state->m_irq_source = (scanline != 240);
328      m_irq_source = (scanline != 240);
330329   }
331330}
332331
r18137r18138
352351   /* basic machine hardware */
353352   MCFG_CPU_ADD("maincpu", Z80,8000000/2) /* 4.000MHz */
354353   MCFG_CPU_PROGRAM_MAP(strnskil_map1)
355   MCFG_TIMER_ADD_SCANLINE("scantimer", strnskil_irq, "screen", 0, 1)
354   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", strnskil_state, strnskil_irq, "screen", 0, 1)
356355
357356   MCFG_CPU_ADD("sub", Z80,8000000/2) /* 4.000MHz */
358357   MCFG_CPU_PROGRAM_MAP(strnskil_map2)
trunk/src/mame/drivers/djboy.c
r18137r18138
499499/******************************************************************************/
500500
501501/* Main Z80 uses IM2 */
502static TIMER_DEVICE_CALLBACK( djboy_scanline )
502TIMER_DEVICE_CALLBACK_MEMBER(djboy_state::djboy_scanline)
503503{
504504   int scanline = param;
505505
506506   if(scanline == 240) // vblank-out irq
507      timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xfd);
507      machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xfd);
508508
509509   /* Pandora "sprite end dma" irq? TODO: timing is clearly off, attract mode relies on this */
510510   if(scanline == 64)
511      timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xff);
511      machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xff);
512512}
513513
514514static const kaneko_pandora_interface djboy_pandora_config =
r18137r18138
572572   MCFG_CPU_ADD("maincpu", Z80, 6000000)
573573   MCFG_CPU_PROGRAM_MAP(cpu0_am)
574574   MCFG_CPU_IO_MAP(cpu0_port_am)
575   MCFG_TIMER_ADD_SCANLINE("scantimer", djboy_scanline, "screen", 0, 1)
575   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", djboy_state, djboy_scanline, "screen", 0, 1)
576576
577577   MCFG_CPU_ADD("cpu1", Z80, 6000000)
578578   MCFG_CPU_PROGRAM_MAP(cpu1_am)
trunk/src/mame/drivers/jpmimpct.c
r18137r18138
196196 *  TxDB/TxDB: Data retrieval unit
197197 */
198198
199static TIMER_DEVICE_CALLBACK( duart_1_timer_event )
199TIMER_DEVICE_CALLBACK_MEMBER(jpmimpct_state::duart_1_timer_event)
200200{
201   jpmimpct_state *state = timer.machine().driver_data<jpmimpct_state>();
202   state->m_duart_1.tc = 0;
203   state->m_duart_1.ISR |= 0x08;
201   m_duart_1.tc = 0;
202   m_duart_1.ISR |= 0x08;
204203
205   state->m_duart_1_irq = 1;
206   update_irqs(timer.machine());
204   m_duart_1_irq = 1;
205   update_irqs(machine());
207206}
208207
209208READ16_MEMBER(jpmimpct_state::duart_1_r)
r18137r18138
827826   MCFG_MACHINE_RESET_OVERRIDE(jpmimpct_state,jpmimpct)
828827   MCFG_NVRAM_ADD_0FILL("nvram")
829828
830   MCFG_TIMER_ADD( "duart_1_timer", duart_1_timer_event)
829   MCFG_TIMER_DRIVER_ADD("duart_1_timer", jpmimpct_state, duart_1_timer_event)
831830
832831   MCFG_SCREEN_ADD("screen", RASTER)
833832   MCFG_SCREEN_RAW_PARAMS(40000000/4, 156*4, 0, 100*4, 328, 0, 300)
r18137r18138
13791378   MCFG_NVRAM_ADD_0FILL("nvram")
13801379
13811380   MCFG_I8255_ADD( "ppi8255", ppi8255_intf )
1382   MCFG_TIMER_ADD( "duart_1_timer", duart_1_timer_event)
1381   MCFG_TIMER_DRIVER_ADD("duart_1_timer", jpmimpct_state, duart_1_timer_event)
13831382
13841383   MCFG_SPEAKER_STANDARD_MONO("mono")
13851384   MCFG_SOUND_ADD("upd",UPD7759, UPD7759_STANDARD_CLOCK)
trunk/src/mame/drivers/scramble.c
r18137r18138
13311331
13321332   MCFG_7474_ADD("konami_7474", "konami_7474", NULL, scramble_sh_7474_q_callback)
13331333
1334   MCFG_TIMER_ADD("int_timer", galaxold_interrupt_timer)
1334   MCFG_TIMER_DRIVER_ADD("int_timer", scramble_state, galaxold_interrupt_timer)
13351335
13361336   MCFG_MACHINE_RESET_OVERRIDE(scramble_state,scramble)
13371337
r18137r18138
15621562   MCFG_7474_ADD("7474_9m_1", "7474_9m_1", galaxold_7474_9m_1_callback, NULL)
15631563   MCFG_7474_ADD("7474_9m_2", "7474_9m_1", NULL, galaxold_7474_9m_2_q_callback)
15641564
1565   MCFG_TIMER_ADD("int_timer", galaxold_interrupt_timer)
1565   MCFG_TIMER_DRIVER_ADD("int_timer", scramble_state, galaxold_interrupt_timer)
15661566
15671567   MCFG_MACHINE_RESET_OVERRIDE(scramble_state,galaxold)
15681568
trunk/src/mame/drivers/segas32.c
r18137r18138
440440}
441441
442442
443static TIMER_DEVICE_CALLBACK( signal_v60_irq_callback )
443TIMER_DEVICE_CALLBACK_MEMBER(segas32_state::signal_v60_irq_callback)
444444{
445   signal_v60_irq(timer.machine(), param);
445   signal_v60_irq(machine(), param);
446446}
447447
448448
r18137r18138
22022202
22032203   MCFG_EEPROM_93C46_ADD("eeprom")
22042204
2205   MCFG_TIMER_ADD("v60_irq0", signal_v60_irq_callback)
2206   MCFG_TIMER_ADD("v60_irq1", signal_v60_irq_callback)
2205   MCFG_TIMER_DRIVER_ADD("v60_irq0", segas32_state, signal_v60_irq_callback)
2206   MCFG_TIMER_DRIVER_ADD("v60_irq1", segas32_state, signal_v60_irq_callback)
22072207
22082208   /* video hardware */
22092209   MCFG_GFXDECODE(segas32)
r18137r18138
22612261
22622262   MCFG_EEPROM_93C46_ADD("eeprom")
22632263
2264   MCFG_TIMER_ADD("v60_irq0", signal_v60_irq_callback)
2265   MCFG_TIMER_ADD("v60_irq1", signal_v60_irq_callback)
2264   MCFG_TIMER_DRIVER_ADD("v60_irq0", segas32_state, signal_v60_irq_callback)
2265   MCFG_TIMER_DRIVER_ADD("v60_irq1", segas32_state, signal_v60_irq_callback)
22662266
22672267   /* video hardware */
22682268   MCFG_GFXDECODE(segas32)
trunk/src/mame/drivers/model1.c
r18137r18138
725725   machine.device("maincpu")->execute().set_irq_acknowledge_callback(irq_callback);
726726}
727727
728static TIMER_DEVICE_CALLBACK( model1_interrupt )
728TIMER_DEVICE_CALLBACK_MEMBER(model1_state::model1_interrupt)
729729{
730   model1_state *state = timer.machine().driver_data<model1_state>();
731730   int scanline = param;
732731
733732   if (scanline == 384)
734733   {
735      irq_raise(timer.machine(), 1);
734      irq_raise(machine(), 1);
736735   }
737736   else if(scanline == 384/2)
738737   {
739      irq_raise(timer.machine(), state->m_sound_irq);
738      irq_raise(machine(), m_sound_irq);
740739
741740      // if the FIFO has something in it, signal the 68k too
742      if (state->m_fifo_rptr != state->m_fifo_wptr)
741      if (m_fifo_rptr != m_fifo_wptr)
743742      {
744         timer.machine().device("audiocpu")->execute().set_input_line(2, HOLD_LINE);
743         machine().device("audiocpu")->execute().set_input_line(2, HOLD_LINE);
745744      }
746745   }
747746}
r18137r18138
15201519   MCFG_CPU_ADD("maincpu", V60, 16000000)
15211520   MCFG_CPU_PROGRAM_MAP(model1_mem)
15221521   MCFG_CPU_IO_MAP(model1_io)
1523   MCFG_TIMER_ADD_SCANLINE("scantimer", model1_interrupt, "screen", 0, 1)
1522   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", model1_state, model1_interrupt, "screen", 0, 1)
15241523
15251524   MCFG_CPU_ADD("audiocpu", M68000, 10000000)   // verified on real h/w
15261525   MCFG_CPU_PROGRAM_MAP(model1_snd)
r18137r18138
15651564   MCFG_CPU_ADD("maincpu", V60, 16000000)
15661565   MCFG_CPU_PROGRAM_MAP(model1_vr_mem)
15671566   MCFG_CPU_IO_MAP(model1_vr_io)
1568   MCFG_TIMER_ADD_SCANLINE("scantimer", model1_interrupt, "screen", 0, 1)
1567   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", model1_state, model1_interrupt, "screen", 0, 1)
15691568
15701569   MCFG_CPU_ADD("audiocpu", M68000, 10000000)   // verified on real h/w
15711570   MCFG_CPU_PROGRAM_MAP(model1_snd)
trunk/src/mame/drivers/beathead.c
r18137r18138
144144 *
145145 *************************************/
146146
147static TIMER_DEVICE_CALLBACK( scanline_callback )
147TIMER_DEVICE_CALLBACK_MEMBER(beathead_state::scanline_callback)
148148{
149   beathead_state *state = timer.machine().driver_data<beathead_state>();
150149   int scanline = param;
151150
152151   /* update the video */
153   timer.machine().primary_screen->update_now();
152   machine().primary_screen->update_now();
154153
155154   /* on scanline zero, clear any halt condition */
156155   if (scanline == 0)
157      timer.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
156      machine().device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
158157
159158   /* wrap around at 262 */
160159   scanline++;
r18137r18138
162161      scanline = 0;
163162
164163   /* set the scanline IRQ */
165   state->m_irq_state[2] = 1;
166   state->update_interrupts();
164   m_irq_state[2] = 1;
165   update_interrupts();
167166
168167   /* set the timer for the next one */
169   timer.adjust(timer.machine().primary_screen->time_until_pos(scanline) - state->m_hblank_offset, scanline);
168   timer.adjust(machine().primary_screen->time_until_pos(scanline) - m_hblank_offset, scanline);
170169}
171170
172171
r18137r18138
436435
437436   MCFG_NVRAM_ADD_1FILL("nvram")
438437
439   MCFG_TIMER_ADD("scan_timer", scanline_callback)
438   MCFG_TIMER_DRIVER_ADD("scan_timer", beathead_state, scanline_callback)
440439
441440   /* video hardware */
442441   MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK)
trunk/src/mame/drivers/scobra.c
r18137r18138
673673   MCFG_7474_ADD("7474_9m_1", "7474_9m_1", galaxold_7474_9m_1_callback, NULL)
674674   MCFG_7474_ADD("7474_9m_2", "7474_9m_1", NULL, galaxold_7474_9m_2_q_callback)
675675
676   MCFG_TIMER_ADD("int_timer", galaxold_interrupt_timer)
676   MCFG_TIMER_DRIVER_ADD("int_timer", scobra_state, galaxold_interrupt_timer)
677677
678678   /* video hardware */
679679   MCFG_SCREEN_ADD("screen", RASTER)
r18137r18138
792792   MCFG_7474_ADD("7474_9m_1", "7474_9m_1", galaxold_7474_9m_1_callback, NULL)
793793   MCFG_7474_ADD("7474_9m_2", "7474_9m_1", NULL, galaxold_7474_9m_2_q_callback)
794794
795   MCFG_TIMER_ADD("int_timer", galaxold_interrupt_timer)
795   MCFG_TIMER_DRIVER_ADD("int_timer", scobra_state, galaxold_interrupt_timer)
796796
797797   /* device config overrides */
798798   MCFG_I8255A_ADD( "ppi8255_0", scramble_ppi_0_intf )
trunk/src/mame/drivers/itech8.c
r18137r18138
18061806   MCFG_SCREEN_UPDATE_DRIVER(itech8_state, screen_update_itech8_grmatch)
18071807
18081808   /* palette updater */
1809   MCFG_TIMER_ADD_SCANLINE("palette", grmatch_palette_update, "screen", 0, 0)
1809   MCFG_TIMER_DRIVER_ADD_SCANLINE("palette", itech8_state, grmatch_palette_update, "screen", 0, 0)
18101810MACHINE_CONFIG_END
18111811
18121812
trunk/src/mame/drivers/wecleman.c
r18137r18138
10241024***************************************************************************/
10251025
10261026
1027static TIMER_DEVICE_CALLBACK( wecleman_scanline )
1027TIMER_DEVICE_CALLBACK_MEMBER(wecleman_state::wecleman_scanline)
10281028{
10291029   int scanline = param;
10301030
10311031   if(scanline == 232) // vblank irq
1032      timer.machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE);
1032      machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE);
10331033   else if(((scanline % 64) == 0)) // timer irq TODO: timings
1034      timer.machine().device("maincpu")->execute().set_input_line(5, HOLD_LINE);
1034      machine().device("maincpu")->execute().set_input_line(5, HOLD_LINE);
10351035}
10361036
1037static TIMER_DEVICE_CALLBACK( hotchase_scanline )
1037TIMER_DEVICE_CALLBACK_MEMBER(wecleman_state::hotchase_scanline)
10381038{
10391039   int scanline = param;
10401040
10411041   if(scanline == 224) // vblank irq
1042      timer.machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE);
1042      machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE);
10431043   else if(((scanline % 64) == 0)) // timer irq TODO: timings
1044      timer.machine().device("maincpu")->execute().set_input_line(5, HOLD_LINE);
1044      machine().device("maincpu")->execute().set_input_line(5, HOLD_LINE);
10451045}
10461046
10471047
r18137r18138
10551055   /* basic machine hardware */
10561056   MCFG_CPU_ADD("maincpu", M68000, 10000000)   /* Schems show 10MHz */
10571057   MCFG_CPU_PROGRAM_MAP(wecleman_map)
1058   MCFG_TIMER_ADD_SCANLINE("scantimer", wecleman_scanline, "screen", 0, 1)
1058   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", wecleman_state, wecleman_scanline, "screen", 0, 1)
10591059
10601060   MCFG_CPU_ADD("sub", M68000, 10000000)   /* Schems show 10MHz */
10611061   MCFG_CPU_PROGRAM_MAP(wecleman_sub_map)
r18137r18138
11391139   /* basic machine hardware */
11401140   MCFG_CPU_ADD("maincpu", M68000, 10000000)   /* 10 MHz - PCB is drawn in one set's readme */
11411141   MCFG_CPU_PROGRAM_MAP(hotchase_map)
1142   MCFG_TIMER_ADD_SCANLINE("scantimer", hotchase_scanline, "screen", 0, 1)
1142   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", wecleman_state, hotchase_scanline, "screen", 0, 1)
11431143
11441144   MCFG_CPU_ADD("sub", M68000, 10000000)   /* 10 MHz - PCB is drawn in one set's readme */
11451145   MCFG_CPU_PROGRAM_MAP(hotchase_sub_map)
trunk/src/mame/drivers/lastduel.c
r18137r18138
455455   DEVCB_LINE(irqhandler)
456456};
457457
458static TIMER_DEVICE_CALLBACK( lastduel_timer_cb )
458TIMER_DEVICE_CALLBACK_MEMBER(lastduel_state::lastduel_timer_cb)
459459{
460   lastduel_state *state = timer.machine().driver_data<lastduel_state>();
461
462   state->m_maincpu->set_input_line(4, HOLD_LINE); /* Controls */
460   m_maincpu->set_input_line(4, HOLD_LINE); /* Controls */
463461}
464462
465static TIMER_DEVICE_CALLBACK( madgear_timer_cb )
463TIMER_DEVICE_CALLBACK_MEMBER(lastduel_state::madgear_timer_cb)
466464{
467   lastduel_state *state = timer.machine().driver_data<lastduel_state>();
468
469   state->m_maincpu->set_input_line(6, HOLD_LINE); /* Controls */
465   m_maincpu->set_input_line(6, HOLD_LINE); /* Controls */
470466}
471467
472468MACHINE_START_MEMBER(lastduel_state,lastduel)
r18137r18138
501497   MCFG_CPU_ADD("maincpu", M68000, 10000000) /* Could be 8 MHz */
502498   MCFG_CPU_PROGRAM_MAP(lastduel_map)
503499   MCFG_CPU_VBLANK_INT_DRIVER("screen", lastduel_state, irq2_line_hold)
504   MCFG_TIMER_ADD_PERIODIC("timer_irq", lastduel_timer_cb, attotime::from_hz(120)) /* control reads?? */
500   MCFG_TIMER_DRIVER_ADD_PERIODIC("timer_irq", lastduel_state, lastduel_timer_cb, attotime::from_hz(120))
505501
506502   MCFG_CPU_ADD("audiocpu", Z80, 3579545) /* Accurate */
507503   MCFG_CPU_PROGRAM_MAP(sound_map)
r18137r18138
544540   MCFG_CPU_ADD("maincpu", M68000, 10000000) /* Accurate */
545541   MCFG_CPU_PROGRAM_MAP(madgear_map)
546542   MCFG_CPU_VBLANK_INT_DRIVER("screen", lastduel_state, irq5_line_hold)
547   MCFG_TIMER_ADD_PERIODIC("timer_irq", madgear_timer_cb, attotime::from_hz(120)) /* control reads?? */
543   MCFG_TIMER_DRIVER_ADD_PERIODIC("timer_irq", lastduel_state, madgear_timer_cb, attotime::from_hz(120))
548544
549545   MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz) /* verified on pcb */
550546   MCFG_CPU_PROGRAM_MAP(madgear_sound_map)
trunk/src/mame/drivers/ddragon.c
r18137r18138
116116      return (vcount - 0x18) | 0x100;
117117}
118118
119static TIMER_DEVICE_CALLBACK( ddragon_scanline )
119TIMER_DEVICE_CALLBACK_MEMBER(ddragon_state::ddragon_scanline)
120120{
121   ddragon_state *state = timer.machine().driver_data<ddragon_state>();
122121   int scanline = param;
123   int screen_height = timer.machine().primary_screen->height();
122   int screen_height = machine().primary_screen->height();
124123   int vcount_old = scanline_to_vcount((scanline == 0) ? screen_height - 1 : scanline - 1);
125124   int vcount = scanline_to_vcount(scanline);
126125
127126   /* update to the current point */
128127   if (scanline > 0)
129      timer.machine().primary_screen->update_partial(scanline - 1);
128      machine().primary_screen->update_partial(scanline - 1);
130129
131130   /* on the rising edge of VBLK (vcount == F8), signal an NMI */
132131   if (vcount == 0xf8)
133      state->m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
132      m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
134133
135134   /* set 1ms signal on rising edge of vcount & 8 */
136135   if (!(vcount_old & 8) && (vcount & 8))
137      state->m_maincpu->set_input_line(M6809_FIRQ_LINE, ASSERT_LINE);
136      m_maincpu->set_input_line(M6809_FIRQ_LINE, ASSERT_LINE);
138137}
139138
140139
r18137r18138
966965   /* basic machine hardware */
967966   MCFG_CPU_ADD("maincpu", HD6309, MAIN_CLOCK)      /* 12 MHz / 4 internally */
968967   MCFG_CPU_PROGRAM_MAP(ddragon_map)
969   MCFG_TIMER_ADD_SCANLINE("scantimer", ddragon_scanline, "screen", 0, 1)
968   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", ddragon_state, ddragon_scanline, "screen", 0, 1)
970969
971970   MCFG_CPU_ADD("sub", HD63701, MAIN_CLOCK / 2)   /* 6 MHz / 4 internally */
972971   MCFG_CPU_PROGRAM_MAP(sub_map)
r18137r18138
10291028   /* basic machine hardware */
10301029   MCFG_CPU_ADD("maincpu", M6809, MAIN_CLOCK / 8)   /* 1.5 MHz */
10311030   MCFG_CPU_PROGRAM_MAP(ddragon_map)
1032   MCFG_TIMER_ADD_SCANLINE("scantimer", ddragon_scanline, "screen", 0, 1)
1031   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", ddragon_state, ddragon_scanline, "screen", 0, 1)
10331032
10341033   MCFG_CPU_ADD("sub", M6809, MAIN_CLOCK / 8)   /* 1.5 Mhz */
10351034   MCFG_CPU_PROGRAM_MAP(sub_map)
r18137r18138
10751074   /* basic machine hardware */
10761075   MCFG_CPU_ADD("maincpu", HD6309, MAIN_CLOCK)      /* 12 MHz / 4 internally */
10771076   MCFG_CPU_PROGRAM_MAP(dd2_map)
1078   MCFG_TIMER_ADD_SCANLINE("scantimer", ddragon_scanline, "screen", 0, 1)
1077   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", ddragon_state, ddragon_scanline, "screen", 0, 1)
10791078
10801079   MCFG_CPU_ADD("sub", Z80, MAIN_CLOCK / 3)      /* 4 MHz */
10811080   MCFG_CPU_PROGRAM_MAP(dd2_sub_map)
trunk/src/mame/drivers/cischeat.c
r18137r18138
15331533**************************************************************************/
15341534
15351535/* TODO: this is hackish */
1536static TIMER_DEVICE_CALLBACK( bigrun_scanline )
1536TIMER_DEVICE_CALLBACK_MEMBER(cischeat_state::bigrun_scanline)
15371537{
15381538   int scanline = param;
15391539
15401540   if(scanline == 240) // vblank-out irq
1541      timer.machine().device("cpu1")->execute().set_input_line(4, HOLD_LINE);
1541      machine().device("cpu1")->execute().set_input_line(4, HOLD_LINE);
15421542
15431543   if(scanline == 154)
1544      timer.machine().device("cpu1")->execute().set_input_line(2, HOLD_LINE);
1544      machine().device("cpu1")->execute().set_input_line(2, HOLD_LINE);
15451545
15461546   if(scanline == 69)
1547      timer.machine().device("cpu1")->execute().set_input_line(1, HOLD_LINE);
1547      machine().device("cpu1")->execute().set_input_line(1, HOLD_LINE);
15481548}
15491549
15501550
r18137r18138
15601560   /* basic machine hardware */
15611561   MCFG_CPU_ADD("cpu1", M68000, 10000000)
15621562   MCFG_CPU_PROGRAM_MAP(bigrun_map)
1563   MCFG_TIMER_ADD_SCANLINE("scantimer", bigrun_scanline, "screen", 0, 1)
1563   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", cischeat_state, bigrun_scanline, "screen", 0, 1)
15641564
15651565   MCFG_CPU_ADD("cpu2", M68000, 10000000)
15661566   MCFG_CPU_PROGRAM_MAP(bigrun_map2)
r18137r18138
16911691    4]          == 3
16921692*/
16931693
1694static TIMER_DEVICE_CALLBACK( scudhamm_scanline )
1694TIMER_DEVICE_CALLBACK_MEMBER(cischeat_state::scudhamm_scanline)
16951695{
16961696   int scanline = param;
16971697
16981698   if(scanline == 240) // vblank-out irq
1699      timer.machine().device("maincpu")->execute().set_input_line(3, HOLD_LINE);
1699      machine().device("maincpu")->execute().set_input_line(3, HOLD_LINE);
17001700
17011701   if(scanline == 120) // timer irq (clears a flag, presumably sprite DMA end)
1702      timer.machine().device("maincpu")->execute().set_input_line(2, HOLD_LINE);
1702      machine().device("maincpu")->execute().set_input_line(2, HOLD_LINE);
17031703}
17041704
17051705static MACHINE_CONFIG_START( scudhamm, cischeat_state )
r18137r18138
17071707   /* basic machine hardware */
17081708   MCFG_CPU_ADD("maincpu",M68000, 12000000)
17091709   MCFG_CPU_PROGRAM_MAP(scudhamm_map)
1710   MCFG_TIMER_ADD_SCANLINE("scantimer", scudhamm_scanline, "screen", 0, 1)
1710   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", cischeat_state, scudhamm_scanline, "screen", 0, 1)
17111711
17121712   /* video hardware */
17131713   MCFG_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK | VIDEO_HAS_SHADOWS)
r18137r18138
17411741                            Arm Champs II
17421742**************************************************************************/
17431743
1744static TIMER_DEVICE_CALLBACK( armchamp2_scanline )
1744TIMER_DEVICE_CALLBACK_MEMBER(cischeat_state::armchamp2_scanline)
17451745{
17461746   int scanline = param;
17471747
17481748   if(scanline == 240) // vblank-out irq
1749      timer.machine().device("maincpu")->execute().set_input_line(2, HOLD_LINE);
1749      machine().device("maincpu")->execute().set_input_line(2, HOLD_LINE);
17501750
17511751   if(scanline == 120) // timer irq (TODO: timing)
1752      timer.machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE);
1752      machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE);
17531753}
17541754
17551755static MACHINE_CONFIG_DERIVED( armchmp2, scudhamm )
r18137r18138
17581758   MCFG_CPU_MODIFY("maincpu")
17591759   MCFG_CPU_PROGRAM_MAP(armchmp2_map)
17601760   MCFG_TIMER_MODIFY("scantimer")
1761   MCFG_TIMER_CALLBACK(armchamp2_scanline)
1761   MCFG_TIMER_DRIVER_CALLBACK(cischeat_state, armchamp2_scanline)
17621762MACHINE_CONFIG_END
17631763
17641764
trunk/src/mame/drivers/centiped.c
r18137r18138
441441 *
442442 *************************************/
443443
444static TIMER_DEVICE_CALLBACK( generate_interrupt )
444TIMER_DEVICE_CALLBACK_MEMBER(centiped_state::generate_interrupt)
445445{
446446   int scanline = param;
447447
448448   /* IRQ is clocked on the rising edge of 16V, equal to the previous 32V */
449449   if (scanline & 16)
450      timer.machine().device("maincpu")->execute().set_input_line(0, ((scanline - 1) & 32) ? ASSERT_LINE : CLEAR_LINE);
450      machine().device("maincpu")->execute().set_input_line(0, ((scanline - 1) & 32) ? ASSERT_LINE : CLEAR_LINE);
451451
452452   /* do a partial update now to handle sprite multiplexing (Maze Invaders) */
453   timer.machine().primary_screen->update_partial(scanline);
453   machine().primary_screen->update_partial(scanline);
454454}
455455
456456
r18137r18138
17591759   MCFG_ATARIVGEAROM_ADD("earom")
17601760
17611761   /* timer */
1762   MCFG_TIMER_ADD_SCANLINE("32v", generate_interrupt, "screen", 0, 16)
1762   MCFG_TIMER_DRIVER_ADD_SCANLINE("32v", centiped_state, generate_interrupt, "screen", 0, 16)
17631763
17641764   /* video hardware */
17651765   MCFG_SCREEN_ADD("screen", RASTER)
trunk/src/mame/drivers/taito_l.c
r18137r18138
297297   return state->m_irq_adr_table[state->m_last_irq_level];
298298}
299299
300static TIMER_DEVICE_CALLBACK( vbl_interrupt )
300TIMER_DEVICE_CALLBACK_MEMBER(taitol_state::vbl_interrupt)
301301{
302   taitol_state *state = timer.machine().driver_data<taitol_state>();
303302   int scanline = param;
304   state->m_maincpu->set_irq_acknowledge_callback(irq_callback);
303   m_maincpu->set_irq_acknowledge_callback(irq_callback);
305304
306305   /* kludge to make plgirls boot */
307   if (state->m_maincpu->state_int(Z80_IM) != 2)
306   if (m_maincpu->state_int(Z80_IM) != 2)
308307      return;
309308
310309   // What is really generating interrupts 0 and 1 is still to be found
311310
312   if (scanline == 120 && (state->m_irq_enable & 1))
311   if (scanline == 120 && (m_irq_enable & 1))
313312   {
314      state->m_last_irq_level = 0;
315      state->m_maincpu->set_input_line(0, HOLD_LINE);
313      m_last_irq_level = 0;
314      m_maincpu->set_input_line(0, HOLD_LINE);
316315   }
317   else if (scanline == 0 && (state->m_irq_enable & 2))
316   else if (scanline == 0 && (m_irq_enable & 2))
318317   {
319      state->m_last_irq_level = 1;
320      state->m_maincpu->set_input_line(0, HOLD_LINE);
318      m_last_irq_level = 1;
319      m_maincpu->set_input_line(0, HOLD_LINE);
321320   }
322   else if (scanline == 240 && (state->m_irq_enable & 4))
321   else if (scanline == 240 && (m_irq_enable & 4))
323322   {
324      state->m_last_irq_level = 2;
325      state->m_maincpu->set_input_line(0, HOLD_LINE);
323      m_last_irq_level = 2;
324      m_maincpu->set_input_line(0, HOLD_LINE);
326325   }
327326}
328327
r18137r18138
18441843   /* basic machine hardware */
18451844   MCFG_CPU_ADD("maincpu", Z80, XTAL_13_33056MHz/2)   /* verified freq on pin122 of TC0090LVC cpu */
18461845   MCFG_CPU_PROGRAM_MAP(fhawk_map)
1847   MCFG_TIMER_ADD_SCANLINE("scantimer", vbl_interrupt, "screen", 0, 1)
1846   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", taitol_state, vbl_interrupt, "screen", 0, 1)
18481847
18491848   MCFG_CPU_ADD("audiocpu", Z80, XTAL_12MHz/3)      /* verified on pcb */
18501849   MCFG_CPU_PROGRAM_MAP(fhawk_3_map)
r18137r18138
19391938   /* basic machine hardware */
19401939   MCFG_CPU_ADD("maincpu", Z80, XTAL_13_33056MHz/2)   /* verified freq on pin122 of TC0090LVC cpu */
19411940   MCFG_CPU_PROGRAM_MAP(kurikint_map)
1942   MCFG_TIMER_ADD_SCANLINE("scantimer", vbl_interrupt, "screen", 0, 1)
1941   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", taitol_state, vbl_interrupt, "screen", 0, 1)
19431942
19441943   MCFG_CPU_ADD("audiocpu",  Z80, XTAL_12MHz/3)      /* verified on pcb */
19451944   MCFG_CPU_PROGRAM_MAP(kurikint_2_map)
r18137r18138
19911990   /* basic machine hardware */
19921991   MCFG_CPU_ADD("maincpu", Z80, XTAL_13_33056MHz/2)   /* verified freq on pin122 of TC0090LVC cpu */
19931992   MCFG_CPU_PROGRAM_MAP(plotting_map)
1994   MCFG_TIMER_ADD_SCANLINE("scantimer", vbl_interrupt, "screen", 0, 1)
1993   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", taitol_state, vbl_interrupt, "screen", 0, 1)
19951994
19961995   MCFG_MACHINE_START_OVERRIDE(taitol_state,taito_l)
19971996   MCFG_MACHINE_RESET_OVERRIDE(taitol_state,plotting)
r18137r18138
20772076   /* basic machine hardware */
20782077   MCFG_CPU_ADD("maincpu", Z80, XTAL_13_33056MHz/2)   /* not verified */
20792078   MCFG_CPU_PROGRAM_MAP(evilston_map)
2080   MCFG_TIMER_ADD_SCANLINE("scantimer", vbl_interrupt, "screen", 0, 1)
2079   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", taitol_state, vbl_interrupt, "screen", 0, 1)
20812080
20822081   MCFG_CPU_ADD("audiocpu", Z80, XTAL_12MHz/3)      /* not verified */
20832082   MCFG_CPU_PROGRAM_MAP(evilston_2_map)
trunk/src/mame/drivers/espial.c
r18137r18138
7575   m_sound_nmi_enabled = data & 1;
7676}
7777
78static TIMER_DEVICE_CALLBACK( espial_scanline )
78TIMER_DEVICE_CALLBACK_MEMBER(espial_state::espial_scanline)
7979{
80   espial_state *state = timer.machine().driver_data<espial_state>();
8180   int scanline = param;
8281
83   if(scanline == 240 && state->m_main_nmi_enabled) // vblank-out irq
84      timer.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
82   if(scanline == 240 && m_main_nmi_enabled) // vblank-out irq
83      machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
8584
8685   if(scanline == 16) // timer irq, checks soundlatch port then updates some sound related work RAM buffers
87      timer.machine().device("maincpu")->execute().set_input_line(0, HOLD_LINE);
86      machine().device("maincpu")->execute().set_input_line(0, HOLD_LINE);
8887}
8988
9089
r18137r18138
322321   /* basic machine hardware */
323322   MCFG_CPU_ADD("maincpu", Z80, 3072000)   /* 3.072 MHz */
324323   MCFG_CPU_PROGRAM_MAP(espial_map)
325   MCFG_TIMER_ADD_SCANLINE("scantimer", espial_scanline, "screen", 0, 1)
324   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", espial_state, espial_scanline, "screen", 0, 1)
326325
327326   MCFG_CPU_ADD("audiocpu", Z80, 3072000)   /* 2 MHz?????? */
328327   MCFG_CPU_PROGRAM_MAP(espial_sound_map)
trunk/src/mame/drivers/ms32.c
r18137r18138
13041304}
13051305
13061306/* TODO: fix this arrangement (derived from old deprecat lib) */
1307static TIMER_DEVICE_CALLBACK(ms32_interrupt)
1307TIMER_DEVICE_CALLBACK_MEMBER(ms32_state::ms32_interrupt)
13081308{
13091309   int scanline = param;
1310   if( scanline == 0) irq_raise(timer.machine(), 10);
1311   if( scanline == 8) irq_raise(timer.machine(), 9);
1310   if( scanline == 0) irq_raise(machine(), 10);
1311   if( scanline == 8) irq_raise(machine(), 9);
13121312   /* hayaosi1 needs at least 12 IRQ 0 per frame to work (see code at FFE02289)
13131313       kirarast needs it too, at least 8 per frame, but waits for a variable amount
13141314       47pi2 needs ?? per frame (otherwise it hangs when you lose)
r18137r18138
13171317       desertwr
13181318       p47aces
13191319       */
1320   if( (scanline % 8) == 0 && scanline <= 224 ) irq_raise(timer.machine(), 0);
1320   if( (scanline % 8) == 0 && scanline <= 224 ) irq_raise(machine(), 0);
13211321}
13221322
13231323
r18137r18138
13941394   /* basic machine hardware */
13951395   MCFG_CPU_ADD("maincpu", V70, 20000000) // 20MHz
13961396   MCFG_CPU_PROGRAM_MAP(ms32_map)
1397   MCFG_TIMER_ADD_SCANLINE("scantimer", ms32_interrupt, "screen", 0, 1)
1397   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", ms32_state, ms32_interrupt, "screen", 0, 1)
13981398
13991399   MCFG_CPU_ADD("audiocpu", Z80, 4000000)
14001400   MCFG_CPU_PROGRAM_MAP(ms32_sound_map)
trunk/src/mame/drivers/mcr3.c
r18137r18138
10811081   MCFG_CPU_PROGRAM_MAP(mcrmono_map)
10821082   MCFG_CPU_IO_MAP(mcrmono_portmap)
10831083   MCFG_CPU_CONFIG(mcr_daisy_chain)
1084   MCFG_TIMER_ADD_SCANLINE("scantimer", mcr_interrupt, "screen", 0, 1)
1084   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", mcr3_state, mcr_interrupt, "screen", 0, 1)
10851085
10861086   MCFG_Z80CTC_ADD("ctc", MASTER_CLOCK/4 /* same as "maincpu" */, mcr_ctc_intf)
10871087
trunk/src/mame/drivers/model3.c
r18137r18138
52515251    0x02: Video (VBLANK start?)
52525252    0x01: Video (unused?)
52535253*/
5254static TIMER_DEVICE_CALLBACK(model3_interrupt)
5254TIMER_DEVICE_CALLBACK_MEMBER(model3_state::model3_interrupt)
52555255{
5256//  model3_state *state = timer.machine().driver_data<model3_state>();
52575256   int scanline = param;
52585257
52595258   if (scanline == 384)
5260      model3_set_irq_line(timer.machine(), 0x02, ASSERT_LINE);
5259      model3_set_irq_line(machine(), 0x02, ASSERT_LINE);
52615260   else if(scanline == 0)
5262      model3_set_irq_line(timer.machine(), 0x0d, ASSERT_LINE);
5261      model3_set_irq_line(machine(), 0x0d, ASSERT_LINE);
52635262}
52645263
52655264static const powerpc_config model3_10 =
r18137r18138
52905289   MCFG_CPU_ADD("maincpu", PPC603E, 66000000)
52915290   MCFG_CPU_CONFIG(model3_10)
52925291   MCFG_CPU_PROGRAM_MAP(model3_mem)
5293   MCFG_TIMER_ADD_SCANLINE("scantimer", model3_interrupt, "screen", 0, 1)
5292   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", model3_state, model3_interrupt, "screen", 0, 1)
52945293
52955294   MCFG_CPU_ADD("audiocpu", M68000, 12000000)
52965295   MCFG_CPU_PROGRAM_MAP(model3_snd)
r18137r18138
53335332   MCFG_CPU_ADD("maincpu", PPC603E, 100000000)
53345333   MCFG_CPU_CONFIG(model3_15)
53355334   MCFG_CPU_PROGRAM_MAP(model3_mem)
5336   MCFG_TIMER_ADD_SCANLINE("scantimer", model3_interrupt, "screen", 0, 1)
5335   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", model3_state, model3_interrupt, "screen", 0, 1)
53375336
53385337   MCFG_CPU_ADD("audiocpu", M68000, 12000000)
53395338   MCFG_CPU_PROGRAM_MAP(model3_snd)
r18137r18138
53745373   MCFG_CPU_ADD("maincpu", PPC603R, 166000000)
53755374   MCFG_CPU_CONFIG(model3_2x)
53765375   MCFG_CPU_PROGRAM_MAP(model3_mem)
5377   MCFG_TIMER_ADD_SCANLINE("scantimer", model3_interrupt, "screen", 0, 1)
5376   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", model3_state, model3_interrupt, "screen", 0, 1)
53785377
53795378   MCFG_CPU_ADD("audiocpu", M68000, 12000000)
53805379   MCFG_CPU_PROGRAM_MAP(model3_snd)
r18137r18138
54125411   MCFG_CPU_ADD("maincpu", PPC603R, 166000000)
54135412   MCFG_CPU_CONFIG(model3_2x)
54145413   MCFG_CPU_PROGRAM_MAP(model3_mem)
5415   MCFG_TIMER_ADD_SCANLINE("scantimer", model3_interrupt, "screen", 0, 1)
5414   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", model3_state, model3_interrupt, "screen", 0, 1)
54165415
54175416   MCFG_CPU_ADD("audiocpu", M68000, 12000000)
54185417   MCFG_CPU_PROGRAM_MAP(model3_snd)
trunk/src/mame/drivers/chqflag.c
r18137r18138
2626
2727
2828
29static TIMER_DEVICE_CALLBACK( chqflag_scanline )
29TIMER_DEVICE_CALLBACK_MEMBER(chqflag_state::chqflag_scanline)
3030{
31   chqflag_state *state = timer.machine().driver_data<chqflag_state>();
3231   int scanline = param;
3332
34   if(scanline == 240 && k051960_is_irq_enabled(state->m_k051960)) // vblank irq
35      timer.machine().device("maincpu")->execute().set_input_line(KONAMI_IRQ_LINE, HOLD_LINE);
36   else if(((scanline % 32) == 0) && (k051960_is_nmi_enabled(state->m_k051960))) // timer irq
37      timer.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
33   if(scanline == 240 && k051960_is_irq_enabled(m_k051960)) // vblank irq
34      machine().device("maincpu")->execute().set_input_line(KONAMI_IRQ_LINE, HOLD_LINE);
35   else if(((scanline % 32) == 0) && (k051960_is_nmi_enabled(m_k051960))) // timer irq
36      machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
3837}
3938
4039WRITE8_MEMBER(chqflag_state::chqflag_bankswitch_w)
r18137r18138
356355   /* basic machine hardware */
357356   MCFG_CPU_ADD("maincpu", KONAMI,XTAL_24MHz/8)   /* 052001 (verified on pcb) */
358357   MCFG_CPU_PROGRAM_MAP(chqflag_map)
359   MCFG_TIMER_ADD_SCANLINE("scantimer", chqflag_scanline, "screen", 0, 1)
358   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", chqflag_state, chqflag_scanline, "screen", 0, 1)
360359
361360   MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz) /* verified on pcb */
362361   MCFG_CPU_PROGRAM_MAP(chqflag_sound_map)
trunk/src/mame/drivers/mrflea.c
r18137r18138
116116   return m_status ^ 0x01;
117117}
118118
119static TIMER_DEVICE_CALLBACK( mrflea_slave_interrupt )
119TIMER_DEVICE_CALLBACK_MEMBER(mrflea_state::mrflea_slave_interrupt)
120120{
121   mrflea_state *state = timer.machine().driver_data<mrflea_state>();
122121   int scanline = param;
123122
124   if ((scanline == 248) || (scanline == 248/2 && (state->m_status & 0x08)))
125      state->m_subcpu->set_input_line(0, HOLD_LINE);
123   if ((scanline == 248) || (scanline == 248/2 && (m_status & 0x08)))
124      m_subcpu->set_input_line(0, HOLD_LINE);
126125}
127126
128127READ8_MEMBER(mrflea_state::mrflea_interrupt_type_r)
r18137r18138
362361   MCFG_CPU_ADD("sub", Z80, 6000000)
363362   MCFG_CPU_PROGRAM_MAP(mrflea_slave_map)
364363   MCFG_CPU_IO_MAP(mrflea_slave_io_map)
365   MCFG_TIMER_ADD_SCANLINE("scantimer", mrflea_slave_interrupt, "screen", 0, 1)
364   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", mrflea_state, mrflea_slave_interrupt, "screen", 0, 1)
366365
367366   MCFG_QUANTUM_TIME(attotime::from_hz(6000))
368367
trunk/src/mame/drivers/dooyong.c
r18137r18138
10621062   MCFG_FRAGMENT_ADD( sound_2151 )
10631063MACHINE_CONFIG_END
10641064
1065static TIMER_DEVICE_CALLBACK( rshark_scanline )
1065TIMER_DEVICE_CALLBACK_MEMBER(dooyong_state::rshark_scanline)
10661066{
10671067   int scanline = param;
10681068
10691069   if(scanline == 248) // vblank-out irq
1070      timer.machine().device("maincpu")->execute().set_input_line(5, HOLD_LINE);
1070      machine().device("maincpu")->execute().set_input_line(5, HOLD_LINE);
10711071
10721072   if(scanline == 120) // timer irq?
1073      timer.machine().device("maincpu")->execute().set_input_line(6, HOLD_LINE);
1073      machine().device("maincpu")->execute().set_input_line(6, HOLD_LINE);
10741074}
10751075
10761076
r18137r18138
10791079   /* basic machine hardware */
10801080   MCFG_CPU_ADD("maincpu", M68000, 8000000)   /* measured on super-x */
10811081   MCFG_CPU_PROGRAM_MAP(rshark_map)
1082   MCFG_TIMER_ADD_SCANLINE("scantimer", rshark_scanline, "screen", 0, 1)
1082   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dooyong_state, rshark_scanline, "screen", 0, 1)
10831083
10841084   MCFG_CPU_ADD("audiocpu", Z80, 4000000)   /* measured on super-x */
10851085   MCFG_CPU_PROGRAM_MAP(bluehawk_sound_map)
r18137r18138
11091109   /* basic machine hardware */
11101110   MCFG_CPU_ADD("maincpu", M68000, 8000000)   /* measured on super-x */
11111111   MCFG_CPU_PROGRAM_MAP(superx_map)
1112   MCFG_TIMER_ADD_SCANLINE("scantimer", rshark_scanline, "screen", 0, 1)
1112   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dooyong_state, rshark_scanline, "screen", 0, 1)
11131113
11141114   MCFG_CPU_ADD("audiocpu", Z80, 4000000)   /* measured on super-x */
11151115   MCFG_CPU_PROGRAM_MAP(bluehawk_sound_map)
r18137r18138
11391139   /* basic machine hardware */
11401140   MCFG_CPU_ADD("maincpu", M68000, 10000000)
11411141   MCFG_CPU_PROGRAM_MAP(popbingo_map)
1142   MCFG_TIMER_ADD_SCANLINE("scantimer", rshark_scanline, "screen", 0, 1)
1142   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dooyong_state, rshark_scanline, "screen", 0, 1)
11431143
11441144   MCFG_CPU_ADD("audiocpu", Z80, 4000000)   /* measured on super-x */
11451145   MCFG_CPU_PROGRAM_MAP(bluehawk_sound_map)
trunk/src/mame/drivers/hng64.c
r18137r18138
17571757      m_maincpu->set_input_line(0, CLEAR_LINE);
17581758}
17591759
1760static TIMER_DEVICE_CALLBACK( hng64_irq )
1760TIMER_DEVICE_CALLBACK_MEMBER(hng64_state::hng64_irq)
17611761{
1762   hng64_state *state = timer.machine().driver_data<hng64_state>();
17631762   int scanline = param;
17641763
17651764   switch(scanline)
17661765   {
1767      case 224*2:   state->m_set_irq(0x0001);  break; // lv 0 vblank irq
1768      //case 0*2:   state->m_set_irq(0x0002);  break; // lv 1
1769      //case 64*2:  state->m_set_irq(0x0004);  break; // lv 2
1770      case 128*2: state->m_set_irq(0x0800);  break; // lv 11 network irq?
1766      case 224*2:   m_set_irq(0x0001);  break; // lv 0 vblank irq
1767      //case 0*2:   m_set_irq(0x0002);  break; // lv 1
1768      //case 64*2:  m_set_irq(0x0004);  break; // lv 2
1769      case 128*2: m_set_irq(0x0800);  break; // lv 11 network irq?
17711770   }
17721771}
17731772
r18137r18138
18321831   MCFG_CPU_ADD("maincpu", VR4300BE, MASTER_CLOCK)    // actually R4300
18331832   MCFG_CPU_CONFIG(vr4300_config)
18341833   MCFG_CPU_PROGRAM_MAP(hng_map)
1835   MCFG_TIMER_ADD_SCANLINE("scantimer", hng64_irq, "screen", 0, 1)
1834   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", hng64_state, hng64_irq, "screen", 0, 1)
18361835
18371836   MCFG_CPU_ADD("audiocpu", V33, 8000000)            // v53, 16? mhz!
18381837   MCFG_CPU_PROGRAM_MAP(hng_sound_map)
trunk/src/mame/drivers/targeth.c
r18137r18138
2929GFXDECODE_END
3030
3131
32static TIMER_DEVICE_CALLBACK(targeth_interrupt )
32TIMER_DEVICE_CALLBACK_MEMBER(targeth_state::targeth_interrupt)
3333{
34   targeth_state *state = timer.machine().driver_data<targeth_state>();
3534   int scanline = param;
3635
3736   if(scanline == 240)
3837   {
3938      /* IRQ 2: drives the game */
40      state->m_maincpu->set_input_line(2, HOLD_LINE);
39      m_maincpu->set_input_line(2, HOLD_LINE);
4140   }
4241
4342   if(scanline == 0)
4443   {
4544      /* IRQ 4: Read 1P Gun */
46      state->m_maincpu->set_input_line(4, HOLD_LINE);
45      m_maincpu->set_input_line(4, HOLD_LINE);
4746      /* IRQ 6: Read 2P Gun */
48      state->m_maincpu->set_input_line(6, HOLD_LINE);
47      m_maincpu->set_input_line(6, HOLD_LINE);
4948   }
5049}
5150
r18137r18138
176175   /* basic machine hardware */
177176   MCFG_CPU_ADD("maincpu", M68000,24000000/2)         /* 12 MHz */
178177   MCFG_CPU_PROGRAM_MAP(main_map)
179   MCFG_TIMER_ADD_SCANLINE("scantimer", targeth_interrupt, "screen", 0, 1)
178   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", targeth_state, targeth_interrupt, "screen", 0, 1)
180179
181180   /* video hardware */
182181   MCFG_SCREEN_ADD("screen", RASTER)
trunk/src/mame/drivers/battlera.c
r18137r18138
234234   MCFG_CPU_ADD("maincpu", H6280,21477200/3)
235235   MCFG_CPU_PROGRAM_MAP(battlera_map)
236236   MCFG_CPU_IO_MAP(battlera_portmap)
237   MCFG_TIMER_ADD_SCANLINE("scantimer", battlera_irq, "screen", 0, 1) /* 8 prelines, 232 lines, 16 vblank? */
237   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", battlera_state, battlera_irq, "screen", 0, 1) /* 8 prelines, 232 lines, 16 vblank? */
238238
239239   MCFG_CPU_ADD("audiocpu", H6280,21477200/3)
240240   MCFG_CPU_PROGRAM_MAP(sound_map)
trunk/src/mame/drivers/gundealr.c
r18137r18138
381381   m_scroll[3] = 0;
382382}
383383
384static TIMER_DEVICE_CALLBACK( gundealr_scanline )
384TIMER_DEVICE_CALLBACK_MEMBER(gundealr_state::gundealr_scanline)
385385{
386386   int scanline = param;
387387
388388   if(scanline == 240) // vblank-out irq
389      timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xd7); /* RST 10h */
389      machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xd7); /* RST 10h */
390390   else if((scanline == 0) || (scanline == 120) ) //timer irq
391      timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xcf); /* RST 10h */
391      machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xcf); /* RST 10h */
392392}
393393
394394static const ym2203_interface ym2203_config =
r18137r18138
410410   MCFG_CPU_ADD("maincpu", Z80, 8000000)   /* 8 MHz ??? */
411411   MCFG_CPU_PROGRAM_MAP(main_map)
412412   MCFG_CPU_IO_MAP(main_portmap)
413   MCFG_TIMER_ADD_SCANLINE("scantimer", gundealr_scanline, "screen", 0, 1)
413   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", gundealr_state, gundealr_scanline, "screen", 0, 1)
414414
415415
416416   /* video hardware */
r18137r18138
433433   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
434434MACHINE_CONFIG_END
435435
436static TIMER_DEVICE_CALLBACK( yamyam_mcu_sim )
436TIMER_DEVICE_CALLBACK_MEMBER(gundealr_state::yamyam_mcu_sim)
437437{
438   gundealr_state *state = timer.machine().driver_data<gundealr_state>();
439438   static const UINT8 snipped_cmd03[8] = { 0x3a, 0x00, 0xc0, 0x47, 0x3a, 0x01, 0xc0, 0xc9 };
440439   static const UINT8 snipped_cmd05_1[5] = { 0xcd, 0x20, 0xe0, 0x7e, 0xc9 };
441440   static const UINT8 snipped_cmd05_2[8] = { 0xc5, 0x01, 0x00, 0x00, 0x4f, 0x09, 0xc1, 0xc9 };
442441
443442   int i;
444443
445   //logerror("e000 = %02x\n", state->m_rambase[0x000]);
446   switch(state->m_rambase[0x000])
444   //logerror("e000 = %02x\n", m_rambase[0x000]);
445   switch(m_rambase[0x000])
447446   {
448447      case 0x03:
449         state->m_rambase[0x001] = 0x03;
448         m_rambase[0x001] = 0x03;
450449         /*
451450                read dip switches
452451                3a 00 c0  ld   a,($c000)
r18137r18138
455454                c9        ret
456455            */
457456           for(i=0;i<8;i++)
458              state->m_rambase[0x010+i] = snipped_cmd03[i];
457              m_rambase[0x010+i] = snipped_cmd03[i];
459458
460459         break;
461460      case 0x04:
462         state->m_rambase[0x001] = 0x04;
461         m_rambase[0x001] = 0x04;
463462         break;
464463      case 0x05:
465         state->m_rambase[0x001] = 0x05;
464         m_rambase[0x001] = 0x05;
466465         /*
467466                add a to hl
468467                c5          push    bc
r18137r18138
473472                c9          ret
474473            */
475474           for(i=0;i<8;i++)
476            state->m_rambase[0x020+i] = snipped_cmd05_2[i];
475            m_rambase[0x020+i] = snipped_cmd05_2[i];
477476
478477         /*
479478                lookup data in table
r18137r18138
482481                c9          ret
483482            */
484483           for(i=0;i<5;i++)
485            state->m_rambase[0x010+i] = snipped_cmd05_1[i];
484            m_rambase[0x010+i] = snipped_cmd05_1[i];
486485
487486         break;
488487      case 0x0a:
489         state->m_rambase[0x001] = 0x08;
488         m_rambase[0x001] = 0x08;
490489         break;
491490      case 0x0d:
492         state->m_rambase[0x001] = 0x07;
491         m_rambase[0x001] = 0x07;
493492         break;
494493   }
495494
496   state->m_rambase[0x004] = timer.machine().root_device().ioport("IN2")->read();
497   state->m_rambase[0x005] = timer.machine().root_device().ioport("IN1")->read();
498   state->m_rambase[0x006] = timer.machine().root_device().ioport("IN0")->read();
495   m_rambase[0x004] = machine().root_device().ioport("IN2")->read();
496   m_rambase[0x005] = machine().root_device().ioport("IN1")->read();
497   m_rambase[0x006] = machine().root_device().ioport("IN0")->read();
499498}
500499
501500static MACHINE_CONFIG_DERIVED( yamyam, gundealr )
502501
503   MCFG_TIMER_ADD_PERIODIC("mcusim", yamyam_mcu_sim, attotime::from_hz(8000000/60)) // not real, but for simulating the MCU
502   MCFG_TIMER_DRIVER_ADD_PERIODIC("mcusim", gundealr_state, yamyam_mcu_sim, attotime::from_hz(8000000/60))
504503MACHINE_CONFIG_END
505504
506505
trunk/src/mame/drivers/renegade.c
r18137r18138
664664   }
665665}
666666
667static TIMER_DEVICE_CALLBACK( renegade_interrupt )
667TIMER_DEVICE_CALLBACK_MEMBER(renegade_state::renegade_interrupt)
668668{
669   renegade_state *state = timer.machine().driver_data<renegade_state>();
670669   int scanline = param;
671670
672671   if (scanline == 112) // ???
673      state->m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
672      m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
674673   else if(scanline == 240)
675      state->m_maincpu->set_input_line(0, HOLD_LINE);
674      m_maincpu->set_input_line(0, HOLD_LINE);
676675}
677676
678677WRITE8_MEMBER(renegade_state::renegade_coin_counter_w)
r18137r18138
935934   /* basic machine hardware */
936935   MCFG_CPU_ADD("maincpu", M6502, 12000000/8)   /* 1.5 MHz (measured) */
937936   MCFG_CPU_PROGRAM_MAP(renegade_map)
938   MCFG_TIMER_ADD_SCANLINE("scantimer", renegade_interrupt, "screen", 0, 1)
937   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", renegade_state, renegade_interrupt, "screen", 0, 1)
939938
940939   MCFG_CPU_ADD("audiocpu", M6809, 12000000/8)
941940   MCFG_CPU_PROGRAM_MAP(renegade_sound_map)   /* IRQs are caused by the main CPU */
trunk/src/mame/drivers/suna16.c
r18137r18138
753753                            Back Street Soccer
754754***************************************************************************/
755755
756static TIMER_DEVICE_CALLBACK( bssoccer_interrupt )
756TIMER_DEVICE_CALLBACK_MEMBER(suna16_state::bssoccer_interrupt)
757757{
758   suna16_state *state = timer.machine().driver_data<suna16_state>();
759758   int scanline = param;
760759
761760   if(scanline == 240)
762      state->m_maincpu->set_input_line(1, HOLD_LINE);
761      m_maincpu->set_input_line(1, HOLD_LINE);
763762
764763   if(scanline == 0)
765      state->m_maincpu->set_input_line(2, HOLD_LINE); // does RAM to sprite buffer copy here
764      m_maincpu->set_input_line(2, HOLD_LINE); // does RAM to sprite buffer copy here
766765}
767766
768767static MACHINE_CONFIG_START( bssoccer, suna16_state )
r18137r18138
770769   /* basic machine hardware */
771770   MCFG_CPU_ADD("maincpu", M68000, 8000000)   /* ? */
772771   MCFG_CPU_PROGRAM_MAP(bssoccer_map)
773   MCFG_TIMER_ADD_SCANLINE("scantimer", bssoccer_interrupt, "screen", 0, 1)
772   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", suna16_state, bssoccer_interrupt, "screen", 0, 1)
774773
775774   MCFG_CPU_ADD("audiocpu", Z80, 3579545)      /* Z80B */
776775   MCFG_CPU_PROGRAM_MAP(bssoccer_sound_map)
r18137r18138
944943   /* basic machine hardware */
945944   MCFG_CPU_ADD("maincpu", M68000, 24000000/4)
946945   MCFG_CPU_PROGRAM_MAP(bestbest_map)
947   MCFG_TIMER_ADD_SCANLINE("scantimer", bssoccer_interrupt, "screen", 0, 1)
946   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", suna16_state, bssoccer_interrupt, "screen", 0, 1)
948947
949948   MCFG_CPU_ADD("audiocpu", Z80, 24000000/4)
950949   MCFG_CPU_PROGRAM_MAP(bestbest_sound_map)
trunk/src/mame/drivers/deadang.c
r18137r18138
206206
207207/* Interrupt Generators */
208208
209static TIMER_DEVICE_CALLBACK( deadang_main_scanline )
209TIMER_DEVICE_CALLBACK_MEMBER(deadang_state::deadang_main_scanline)
210210{
211211   int scanline = param;
212212
213213   if(scanline == 240) // vblank-out irq
214      timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xc4/4);
214      machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xc4/4);
215215
216216   if(scanline == 0) // vblank-in irq
217      timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xc8/4);
217      machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xc8/4);
218218}
219219
220static TIMER_DEVICE_CALLBACK( deadang_sub_scanline )
220TIMER_DEVICE_CALLBACK_MEMBER(deadang_state::deadang_sub_scanline)
221221{
222222   int scanline = param;
223223
224224   if(scanline == 240) // vblank-out irq
225      timer.machine().device("sub")->execute().set_input_line_and_vector(0, HOLD_LINE,0xc4/4);
225      machine().device("sub")->execute().set_input_line_and_vector(0, HOLD_LINE,0xc4/4);
226226
227227   if(scanline == 0) // vblank-in irq
228      timer.machine().device("sub")->execute().set_input_line_and_vector(0, HOLD_LINE,0xc8/4);
228      machine().device("sub")->execute().set_input_line_and_vector(0, HOLD_LINE,0xc8/4);
229229}
230230
231231/* Machine Drivers */
r18137r18138
235235   /* basic machine hardware */
236236   MCFG_CPU_ADD("maincpu", V30,XTAL_16MHz/2) /* Sony 8623h9 CXQ70116D-8 (V30 compatible) */
237237   MCFG_CPU_PROGRAM_MAP(main_map)
238   MCFG_TIMER_ADD_SCANLINE("scantimer1", deadang_main_scanline, "screen", 0, 1)
238   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer1", deadang_state, deadang_main_scanline, "screen", 0, 1)
239239
240240   MCFG_CPU_ADD("sub", V30,XTAL_16MHz/2) /* Sony 8623h9 CXQ70116D-8 (V30 compatible) */
241241   MCFG_CPU_PROGRAM_MAP(sub_map)
242   MCFG_TIMER_ADD_SCANLINE("scantimer2", deadang_sub_scanline, "screen", 0, 1)
242   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer2", deadang_state, deadang_sub_scanline, "screen", 0, 1)
243243
244244   SEIBU3A_SOUND_SYSTEM_CPU(XTAL_14_31818MHz/4)
245245
trunk/src/mame/drivers/ikki.c
r18137r18138
239239   m_flipscreen = 0;
240240}
241241
242static TIMER_DEVICE_CALLBACK( ikki_irq )
242TIMER_DEVICE_CALLBACK_MEMBER(ikki_state::ikki_irq)
243243{
244   ikki_state *state = timer.machine().driver_data<ikki_state>();
245244   int scanline = param;
246245
247246   if(scanline == 240 || scanline == 120) // TODO: where non-timer IRQ happens?
248247   {
249      state->m_maincpu->set_input_line(0,HOLD_LINE);
248      m_maincpu->set_input_line(0,HOLD_LINE);
250249
251      state->m_irq_source = (scanline != 240);
250      m_irq_source = (scanline != 240);
252251   }
253252}
254253
r18137r18138
260259   /* basic machine hardware */
261260   MCFG_CPU_ADD("maincpu", Z80,8000000/2) /* 4.000MHz */
262261   MCFG_CPU_PROGRAM_MAP(ikki_cpu1)
263   MCFG_TIMER_ADD_SCANLINE("scantimer", ikki_irq, "screen", 0, 1)
262   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", ikki_state, ikki_irq, "screen", 0, 1)
264263
265264   MCFG_CPU_ADD("sub", Z80,8000000/2) /* 4.000MHz */
266265   MCFG_CPU_PROGRAM_MAP(ikki_cpu2)
trunk/src/mame/drivers/system1.c
r18137r18138
518518}
519519
520520
521static TIMER_DEVICE_CALLBACK( soundirq_gen )
521TIMER_DEVICE_CALLBACK_MEMBER(system1_state::soundirq_gen)
522522{
523523   /* sound IRQ is generated on 32V, 96V, ... and auto-acknowledged */
524   timer.machine().device("soundcpu")->execute().set_input_line(0, HOLD_LINE);
524   machine().device("soundcpu")->execute().set_input_line(0, HOLD_LINE);
525525}
526526
527527
r18137r18138
602602}
603603
604604
605static TIMER_DEVICE_CALLBACK( mcu_t0_callback )
605TIMER_DEVICE_CALLBACK_MEMBER(system1_state::mcu_t0_callback)
606606{
607607   /* The T0 line is clocked by something; if it is not clocked fast
608608       enough, the MCU will fail; on shtngmst this happens after 3
r18137r18138
610610       choplift is even more picky about it, affecting scroll speed
611611    */
612612
613   device_t *mcu = timer.machine().device("mcu");
613   device_t *mcu = machine().device("mcu");
614614   mcu->execute().set_input_line(MCS51_T0_LINE, ASSERT_LINE);
615615   mcu->execute().set_input_line(MCS51_T0_LINE, CLEAR_LINE);
616616}
r18137r18138
21512151
21522152   MCFG_CPU_ADD("soundcpu", Z80, SOUND_CLOCK/2)
21532153   MCFG_CPU_PROGRAM_MAP(sound_map)
2154   MCFG_TIMER_ADD_SCANLINE("soundirq", soundirq_gen, "screen", 32, 64)
2154   MCFG_TIMER_DRIVER_ADD_SCANLINE("soundirq", system1_state, soundirq_gen, "screen", 32, 64)
21552155
21562156   MCFG_QUANTUM_TIME(attotime::from_hz(6000))
21572157
r18137r18138
22222222   MCFG_CPU_IO_MAP(mcu_io_map)
22232223   MCFG_CPU_VBLANK_INT_DRIVER("screen", system1_state,  mcu_irq_assert)
22242224
2225   MCFG_TIMER_ADD_PERIODIC("mcu_t0", mcu_t0_callback, attotime::from_usec(2500))   /* ??? actual clock unknown */
2225   MCFG_TIMER_DRIVER_ADD_PERIODIC("mcu_t0", system1_state, mcu_t0_callback, attotime::from_usec(2500))
22262226MACHINE_CONFIG_END
22272227
22282228
trunk/src/mame/drivers/polyplay.c
r18137r18138
8888
8989
9090/* timer handling */
91static TIMER_DEVICE_CALLBACK( polyplay_timer_callback );
9291
9392
9493
9594
95
9696/* Polyplay Sound Interface */
9797static const samples_interface polyplay_samples_interface =
9898{
r18137r18138
276276   MCFG_CPU_VBLANK_INT_DRIVER("screen", polyplay_state,  coin_interrupt)
277277
278278
279   MCFG_TIMER_ADD("timer", polyplay_timer_callback)
279   MCFG_TIMER_DRIVER_ADD("timer", polyplay_state, polyplay_timer_callback)
280280
281281
282282   /* video hardware */
r18137r18138
342342ROM_END
343343
344344
345static TIMER_DEVICE_CALLBACK( polyplay_timer_callback )
345TIMER_DEVICE_CALLBACK_MEMBER(polyplay_state::polyplay_timer_callback)
346346{
347   timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0x4c);
347   machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0x4c);
348348}
349349
350350/* game driver */
trunk/src/mame/drivers/namcofl.c
r18137r18138
543543   m_raster_interrupt_timer->adjust(machine().primary_screen->frame_period());
544544}
545545
546static TIMER_DEVICE_CALLBACK( mcu_irq0_cb )
546TIMER_DEVICE_CALLBACK_MEMBER(namcofl_state::mcu_irq0_cb)
547547{
548   namcofl_state *state = timer.machine().driver_data<namcofl_state>();
549
550   state->m_mcu->set_input_line(M37710_LINE_IRQ0, HOLD_LINE);
548   m_mcu->set_input_line(M37710_LINE_IRQ0, HOLD_LINE);
551549}
552550
553static TIMER_DEVICE_CALLBACK( mcu_irq2_cb )
551TIMER_DEVICE_CALLBACK_MEMBER(namcofl_state::mcu_irq2_cb)
554552{
555   namcofl_state *state = timer.machine().driver_data<namcofl_state>();
556
557   state->m_mcu->set_input_line(M37710_LINE_IRQ2, HOLD_LINE);
553   m_mcu->set_input_line(M37710_LINE_IRQ2, HOLD_LINE);
558554}
559555
560static TIMER_DEVICE_CALLBACK( mcu_adc_cb )
556TIMER_DEVICE_CALLBACK_MEMBER(namcofl_state::mcu_adc_cb)
561557{
562   namcofl_state *state = timer.machine().driver_data<namcofl_state>();
563
564   state->m_mcu->set_input_line(M37710_LINE_ADC, HOLD_LINE);
558   m_mcu->set_input_line(M37710_LINE_ADC, HOLD_LINE);
565559}
566560
567561
r18137r18138
591585   MCFG_CPU_PROGRAM_MAP(namcoc75_am)
592586   MCFG_CPU_IO_MAP(namcoc75_io)
593587   /* TODO: irq generation for these */
594   MCFG_TIMER_ADD_PERIODIC("mcu_irq0", mcu_irq0_cb, attotime::from_hz(60))
595   MCFG_TIMER_ADD_PERIODIC("mcu_irq2", mcu_irq2_cb, attotime::from_hz(60))
596   MCFG_TIMER_ADD_PERIODIC("mcu_adc",  mcu_adc_cb, attotime::from_hz(60))
588   MCFG_TIMER_DRIVER_ADD_PERIODIC("mcu_irq0", namcofl_state, mcu_irq0_cb, attotime::from_hz(60))
589   MCFG_TIMER_DRIVER_ADD_PERIODIC("mcu_irq2", namcofl_state, mcu_irq2_cb, attotime::from_hz(60))
590   MCFG_TIMER_DRIVER_ADD_PERIODIC("mcu_adc", namcofl_state, mcu_adc_cb, attotime::from_hz(60))
597591
598592   MCFG_MACHINE_START_OVERRIDE(namcofl_state,namcofl)
599593   MCFG_MACHINE_RESET_OVERRIDE(namcofl_state,namcofl)
trunk/src/mame/drivers/dambustr.c
r18137r18138
254254   MCFG_7474_ADD("7474_9m_1", "7474_9m_1", galaxold_7474_9m_1_callback, NULL)
255255   MCFG_7474_ADD("7474_9m_2", "7474_9m_1", NULL, galaxold_7474_9m_2_q_callback)
256256
257   MCFG_TIMER_ADD("int_timer", galaxold_interrupt_timer)
257   MCFG_TIMER_DRIVER_ADD("int_timer", dambustr_state, galaxold_interrupt_timer)
258258
259259   /* video hardware */
260260   MCFG_SCREEN_ADD("screen", RASTER)
trunk/src/mame/drivers/nmk16.c
r18137r18138
867867   }
868868}
869869
870static TIMER_DEVICE_CALLBACK( tdragon_mcu_sim )
870TIMER_DEVICE_CALLBACK_MEMBER(nmk16_state::tdragon_mcu_sim)
871871{
872   mcu_run(timer.machine(),1);
872   mcu_run(machine(),1);
873873}
874874
875static TIMER_DEVICE_CALLBACK( hachamf_mcu_sim )
875TIMER_DEVICE_CALLBACK_MEMBER(nmk16_state::hachamf_mcu_sim)
876876{
877   mcu_run(timer.machine(),0);
877   mcu_run(machine(),0);
878878}
879879
880880static ADDRESS_MAP_START( tdragon_map, AS_PROGRAM, 16, nmk16_state )
r18137r18138
35123512   DEVCB_LINE(ym2203_irqhandler)
35133513};
35143514
3515static TIMER_DEVICE_CALLBACK( nmk16_scanline )
3515TIMER_DEVICE_CALLBACK_MEMBER(nmk16_state::nmk16_scanline)
35163516{
35173517   int scanline = param;
35183518
35193519   if(scanline == 240) // vblank-out irq
3520      timer.machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE);
3520      machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE);
35213521
35223522   /* This is either vblank-in or sprite dma irq complete, Vandyke definitely relies that irq fires at scanline ~0 instead of 112 (as per previous
35233523       cpu_getiloops function implementation), mostly noticeable with sword collisions and related attract mode behaviour. */
35243524   if(scanline == 0)
3525      timer.machine().device("maincpu")->execute().set_input_line(2, HOLD_LINE);
3525      machine().device("maincpu")->execute().set_input_line(2, HOLD_LINE);
35263526}
35273527
35283528/* bee-oh board, almost certainly it has different timings */
3529static TIMER_DEVICE_CALLBACK( manybloc_scanline )
3529TIMER_DEVICE_CALLBACK_MEMBER(nmk16_state::manybloc_scanline)
35303530{
35313531   int scanline = param;
35323532
35333533   if(scanline == 248) // vblank-out irq
3534      timer.machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE);
3534      machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE);
35353535
35363536   /* This is either vblank-in or sprite dma irq complete */
35373537   if(scanline == 0)
3538      timer.machine().device("maincpu")->execute().set_input_line(2, HOLD_LINE);
3538      machine().device("maincpu")->execute().set_input_line(2, HOLD_LINE);
35393539}
35403540
35413541
r18137r18138
35503550   MCFG_CPU_ADD("maincpu", M68000, 10000000) /* 10 MHz */
35513551   MCFG_CPU_PROGRAM_MAP(tharrier_map)
35523552   MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ???????? */
3553   MCFG_TIMER_ADD_SCANLINE("scantimer", nmk16_scanline, "screen", 0, 1)
3553   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1)
35543554
35553555   MCFG_CPU_ADD("audiocpu", Z80, 3000000)
35563556   MCFG_CPU_PROGRAM_MAP(tharrier_sound_map)
r18137r18138
35953595   MCFG_CPU_ADD("maincpu", M68000, 10000000) /* 10? MHz - check */
35963596   MCFG_CPU_PROGRAM_MAP(manybloc_map)
35973597   MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 56)/* this needs to equal the framerate on this, rather than being double it .. */
3598   MCFG_TIMER_ADD_SCANLINE("scantimer", manybloc_scanline, "screen", 0, 1)
3598   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, manybloc_scanline, "screen", 0, 1)
35993599
36003600   MCFG_CPU_ADD("audiocpu", Z80, 3000000)
36013601   MCFG_CPU_PROGRAM_MAP(tharrier_sound_map)
r18137r18138
36383638   MCFG_CPU_ADD("maincpu", M68000, 10000000) /* 10 MHz ? */
36393639   MCFG_CPU_PROGRAM_MAP(mustang_map)
36403640   MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ???????? */
3641   MCFG_TIMER_ADD_SCANLINE("scantimer", nmk16_scanline, "screen", 0, 1)
3641   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1)
36423642
36433643   MCFG_MACHINE_RESET_OVERRIDE(nmk16_state,NMK004)
36443644
r18137r18138
36793679   MCFG_CPU_ADD("maincpu", M68000, 10000000) /* 10 MHz ? */
36803680   MCFG_CPU_PROGRAM_MAP(mustangb_map)
36813681   MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ???????? */
3682   MCFG_TIMER_ADD_SCANLINE("scantimer", nmk16_scanline, "screen", 0, 1)
3682   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1)
36833683
36843684   SEIBU_SOUND_SYSTEM_CPU(14318180/4)
36853685
r18137r18138
37133713   MCFG_CPU_ADD("maincpu", M68000, BIOSHIP_CRYSTAL1 ) /* 10.0 MHz (verified) */
37143714   MCFG_CPU_PROGRAM_MAP(bioship_map)
37153715   MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 100)/* 112 breaks the title screen */
3716   MCFG_TIMER_ADD_SCANLINE("scantimer", nmk16_scanline, "screen", 0, 1)
3716   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1)
37173717
37183718   MCFG_MACHINE_RESET_OVERRIDE(nmk16_state,NMK004)
37193719
r18137r18138
37543754   MCFG_CPU_ADD("maincpu", M68000, XTAL_10MHz) /* 68000p12 running at 10Mhz, verified on pcb */
37553755   MCFG_CPU_PROGRAM_MAP(vandyke_map)
37563756   MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ???????? */
3757   MCFG_TIMER_ADD_SCANLINE("scantimer", nmk16_scanline, "screen", 0, 1)
3757   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1)
37583758
37593759   MCFG_MACHINE_RESET_OVERRIDE(nmk16_state,NMK004)
37603760
r18137r18138
37953795   MCFG_CPU_ADD("maincpu", M68000, 10000000) /* 10 MHz ? */
37963796   MCFG_CPU_PROGRAM_MAP(vandykeb_map)
37973797   MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ???????? */
3798   MCFG_TIMER_ADD_SCANLINE("scantimer", nmk16_scanline, "screen", 0, 1)
3798   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1)
37993799
38003800   MCFG_CPU_ADD("mcu", PIC16C57, 12000000)   /* 3MHz */
38013801   MCFG_DEVICE_DISABLE()
r18137r18138
38293829   MCFG_CPU_ADD("maincpu", M68000, 10000000) /* 10 MHz (verified on pcb) */
38303830   MCFG_CPU_PROGRAM_MAP(acrobatm_map)
38313831   MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ???????? */
3832   MCFG_TIMER_ADD_SCANLINE("scantimer", nmk16_scanline, "screen", 0, 1)
3832   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1)
38333833
38343834   MCFG_MACHINE_RESET_OVERRIDE(nmk16_state,NMK004)
38353835
r18137r18138
38723872   MCFG_CPU_PROGRAM_MAP(tdragonb_map)
38733873   //MCFG_CPU_VBLANK_INT_DRIVER("screen", nmk16_state,  irq4_line_hold)
38743874   MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ?? drives music */
3875   MCFG_TIMER_ADD_SCANLINE("scantimer", nmk16_scanline, "screen", 0, 1)
3875   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1)
38763876
38773877   SEIBU_SOUND_SYSTEM_CPU(14318180/4)
38783878
r18137r18138
39033903   MCFG_CPU_PROGRAM_MAP(tdragon_map)
39043904   //MCFG_CPU_VBLANK_INT_DRIVER("screen", nmk16_state,  irq4_line_hold)
39053905   MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ?? drives music */
3906   MCFG_TIMER_ADD_SCANLINE("scantimer", nmk16_scanline, "screen", 0, 1)
3906   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1)
39073907
39083908   MCFG_MACHINE_RESET_OVERRIDE(nmk16_state,NMK004)
39093909
r18137r18138
39203920   MCFG_PALETTE_LENGTH(1024)
39213921
39223922   MCFG_VIDEO_START_OVERRIDE(nmk16_state,macross)
3923   MCFG_TIMER_ADD_PERIODIC("coinsim", tdragon_mcu_sim, attotime::from_hz(10000)) // not real, but for simulating the MCU
3923   MCFG_TIMER_DRIVER_ADD_PERIODIC("coinsim", nmk16_state, tdragon_mcu_sim, attotime::from_hz(10000))
39243924
39253925   /* sound hardware */
39263926   MCFG_SPEAKER_STANDARD_MONO("mono")
r18137r18138
39783978   MCFG_CPU_ADD("maincpu", M68000, 12000000) /* 12 MHz ? */
39793979   MCFG_CPU_PROGRAM_MAP(strahl_map)
39803980   MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ???????? */
3981   MCFG_TIMER_ADD_SCANLINE("scantimer", nmk16_scanline, "screen", 0, 1)
3981   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1)
39823982
39833983   MCFG_MACHINE_RESET_OVERRIDE(nmk16_state,NMK004)
39843984
r18137r18138
40364036   MCFG_PALETTE_LENGTH(1024)
40374037
40384038   MCFG_VIDEO_START_OVERRIDE(nmk16_state,macross)
4039   MCFG_TIMER_ADD_PERIODIC("coinsim", hachamf_mcu_sim, attotime::from_hz(10000)) // not real, but for simulating the MCU
4039   MCFG_TIMER_DRIVER_ADD_PERIODIC("coinsim", nmk16_state, hachamf_mcu_sim, attotime::from_hz(10000))
40404040
40414041   /* sound hardware */
40424042   MCFG_SPEAKER_STANDARD_MONO("mono")
r18137r18138
48154815   /* basic machine hardware */
48164816   MCFG_CPU_ADD("maincpu", M68000,XTAL_12MHz) /* 68000p10 running at 12mhz, verified on pcb */
48174817   MCFG_CPU_PROGRAM_MAP(afega)
4818   MCFG_TIMER_ADD_SCANLINE("scantimer", nmk16_scanline, "screen", 0, 1)
4818   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1)
48194819
48204820   MCFG_CPU_ADD("audiocpu", Z80, XTAL_4MHz) /* verified on pcb */
48214821   MCFG_CPU_PROGRAM_MAP(afega_sound_cpu)
r18137r18138
49004900   /* basic machine hardware */
49014901   MCFG_CPU_ADD("maincpu", M68000,12000000)
49024902   MCFG_CPU_PROGRAM_MAP(afega)
4903   MCFG_TIMER_ADD_SCANLINE("scantimer", nmk16_scanline, "screen", 0, 1)
4903   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1)
49044904
49054905   MCFG_CPU_ADD("audiocpu", Z80,4000000)
49064906   MCFG_CPU_PROGRAM_MAP(firehawk_sound_cpu)
r18137r18138
49354935   MCFG_CPU_ADD("maincpu", M68000,12000000)
49364936   MCFG_CPU_PROGRAM_MAP(twinactn_map)
49374937   MCFG_CPU_PERIODIC_INT_DRIVER(nmk16_state, irq1_line_hold, 112)/* ???????? */
4938   MCFG_TIMER_ADD_SCANLINE("scantimer", nmk16_scanline, "screen", 0, 1)
4938   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nmk16_state, nmk16_scanline, "screen", 0, 1)
49394939
49404940   MCFG_CPU_ADD("audiocpu", Z80, 4000000)
49414941   MCFG_CPU_PROGRAM_MAP(twinactn_sound_cpu)
trunk/src/mame/drivers/m92.c
r18137r18138
225225
226226/*****************************************************************************/
227227
228static TIMER_DEVICE_CALLBACK( m92_scanline_interrupt )
228TIMER_DEVICE_CALLBACK_MEMBER(m92_state::m92_scanline_interrupt)
229229{
230   running_machine &machine = timer.machine();
231   m92_state *state = machine.driver_data<m92_state>();
230   m92_state *state = machine().driver_data<m92_state>();
232231   int scanline = param;
233232
234233   /* raster interrupt */
235   if (scanline == state->m_raster_irq_position)
234   if (scanline == m_raster_irq_position)
236235   {
237      machine.primary_screen->update_partial(scanline);
236      machine().primary_screen->update_partial(scanline);
238237      state->m_maincpu->set_input_line_and_vector(0, HOLD_LINE, M92_IRQ_2);
239238   }
240239
241240   /* VBLANK interrupt */
242   else if (scanline == machine.primary_screen->visible_area().max_y + 1)
241   else if (scanline == machine().primary_screen->visible_area().max_y + 1)
243242   {
244      machine.primary_screen->update_partial(scanline);
243      machine().primary_screen->update_partial(scanline);
245244      state->m_maincpu->set_input_line_and_vector(0, HOLD_LINE, M92_IRQ_0);
246245   }
247246}
r18137r18138
944943   MCFG_MACHINE_START_OVERRIDE(m92_state,m92)
945944   MCFG_MACHINE_RESET_OVERRIDE(m92_state,m92)
946945
947   MCFG_TIMER_ADD_SCANLINE("scantimer", m92_scanline_interrupt, "screen", 0, 1)
946   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", m92_state, m92_scanline_interrupt, "screen", 0, 1)
948947
949948   /* video hardware */
950949   MCFG_BUFFERED_SPRITERAM16_ADD("spriteram")
r18137r18138
10301029   MCFG_MACHINE_START_OVERRIDE(m92_state,m92)
10311030   MCFG_MACHINE_RESET_OVERRIDE(m92_state,m92)
10321031
1033   MCFG_TIMER_ADD_SCANLINE("scantimer", m92_scanline_interrupt, "screen", 0, 1)
1032   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", m92_state, m92_scanline_interrupt, "screen", 0, 1)
10341033
10351034   /* video hardware */
10361035   MCFG_BUFFERED_SPRITERAM16_ADD("spriteram") // not really...
trunk/src/mame/drivers/mcr.c
r18137r18138
377377 *
378378 *************************************/
379379
380TIMER_DEVICE_CALLBACK( dpoker_hopper_callback )
380TIMER_DEVICE_CALLBACK_MEMBER(mcr_state::dpoker_hopper_callback)
381381{
382   mcr_state *state = timer.machine().driver_data<mcr_state>();
383
384382   if (dpoker_output & 0x40)
385383   {
386384      // hopper timing is a guesstimate
387385      dpoker_coin_status ^= 8;
388      state->m_dpoker_hopper_timer->adjust(attotime::from_msec((dpoker_coin_status & 8) ? 100 : 250));
386      m_dpoker_hopper_timer->adjust(attotime::from_msec((dpoker_coin_status & 8) ? 100 : 250));
389387   }
390388   else
391389   {
392390      dpoker_coin_status &= ~8;
393391   }
394392
395   coin_counter_w(timer.machine(), 3, dpoker_coin_status & 8);
393   coin_counter_w(machine(), 3, dpoker_coin_status & 8);
396394}
397395
398TIMER_DEVICE_CALLBACK( dpoker_coin_in_callback )
396TIMER_DEVICE_CALLBACK_MEMBER(mcr_state::dpoker_coin_in_callback)
399397{
400398   dpoker_coin_status &= ~2;
401399}
r18137r18138
18271825   MCFG_CPU_CONFIG(mcr_daisy_chain)
18281826   MCFG_CPU_PROGRAM_MAP(cpu_90009_map)
18291827   MCFG_CPU_IO_MAP(cpu_90009_portmap)
1830   MCFG_TIMER_ADD_SCANLINE("scantimer", mcr_interrupt, "screen", 0, 1)
1828   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", mcr_state, mcr_interrupt, "screen", 0, 1)
18311829
18321830   MCFG_Z80CTC_ADD("ctc", MAIN_OSC_MCR_I/8 /* same as "maincpu" */, mcr_ctc_intf)
18331831
r18137r18138
18631861static MACHINE_CONFIG_DERIVED( mcr_90009_dp, mcr_90009 )
18641862
18651863   /* basic machine hardware */
1866   MCFG_TIMER_ADD("dp_coinin", dpoker_coin_in_callback)
1867   MCFG_TIMER_ADD("dp_hopper", dpoker_hopper_callback)
1864   MCFG_TIMER_DRIVER_ADD("dp_coinin", mcr_state, dpoker_coin_in_callback)
1865   MCFG_TIMER_DRIVER_ADD("dp_hopper", mcr_state, dpoker_hopper_callback)
18681866MACHINE_CONFIG_END
18691867
18701868
r18137r18138
19391937   MCFG_CPU_PROGRAM_MAP(ipu_91695_map)
19401938   MCFG_CPU_IO_MAP(ipu_91695_portmap)
19411939   MCFG_TIMER_MODIFY("scantimer")
1942   MCFG_TIMER_CALLBACK(mcr_ipu_interrupt)
1940   MCFG_TIMER_DRIVER_CALLBACK(mcr_state, mcr_ipu_interrupt)
19431941
19441942   MCFG_Z80CTC_ADD("ipu_ctc", 7372800/2 /* same as "ipu" */, nflfoot_ctc_intf)
19451943   MCFG_Z80PIO_ADD("ipu_pio0", 7372800/2, nflfoot_pio_intf)
trunk/src/mame/drivers/8080bw.c
r18137r18138
10671067   MCFG_MACHINE_START_OVERRIDE(_8080bw_state,schaser)
10681068   MCFG_MACHINE_RESET_OVERRIDE(_8080bw_state,schaser)
10691069
1070   MCFG_TIMER_ADD("schaser_sh_555", schaser_effect_555_cb)
1070   MCFG_TIMER_DRIVER_ADD("schaser_sh_555", _8080bw_state, schaser_effect_555_cb)
10711071
10721072   /* add shifter */
10731073   MCFG_MB14241_ADD("mb14241")
r18137r18138
23412341
23422342*/
23432343
2344TIMER_DEVICE_CALLBACK( claybust_gun_callback )
2344TIMER_DEVICE_CALLBACK_MEMBER(_8080bw_state::claybust_gun_callback)
23452345{
2346   _8080bw_state *state = timer.machine().driver_data<_8080bw_state>();
23472346   
23482347   // reset gun latch
2349   state->m_claybust_gun_pos = 0;
2348   m_claybust_gun_pos = 0;
23502349}
23512350
23522351CUSTOM_INPUT_MEMBER(_8080bw_state::claybust_gun_on_r)
r18137r18138
24602459   MCFG_CPU_MODIFY("maincpu")
24612460   MCFG_CPU_IO_MAP(claybust_io_map)
24622461
2463   MCFG_TIMER_ADD("claybust_gun", claybust_gun_callback)
2462   MCFG_TIMER_DRIVER_ADD("claybust_gun", _8080bw_state, claybust_gun_callback)
24642463
24652464   MCFG_MACHINE_START_OVERRIDE(_8080bw_state, claybust)
24662465
trunk/src/mame/drivers/orbit.c
r18137r18138
3131 *
3232 *************************************/
3333
34static TIMER_DEVICE_CALLBACK( nmi_32v )
34TIMER_DEVICE_CALLBACK_MEMBER(orbit_state::nmi_32v)
3535{
36   orbit_state *state = timer.machine().driver_data<orbit_state>();
3736   int scanline = param;
38   int nmistate = (scanline & 32) && (state->m_misc_flags & 4);
39   state->m_maincpu->set_input_line(INPUT_LINE_NMI, nmistate ? ASSERT_LINE : CLEAR_LINE);
37   int nmistate = (scanline & 32) && (m_misc_flags & 4);
38   m_maincpu->set_input_line(INPUT_LINE_NMI, nmistate ? ASSERT_LINE : CLEAR_LINE);
4039}
4140
4241
r18137r18138
300299   MCFG_CPU_PROGRAM_MAP(orbit_map)
301300   MCFG_CPU_VBLANK_INT_DRIVER("screen", orbit_state,  orbit_interrupt)
302301
303   MCFG_TIMER_ADD_SCANLINE("32v", nmi_32v, "screen", 0, 32)
302   MCFG_TIMER_DRIVER_ADD_SCANLINE("32v", orbit_state, nmi_32v, "screen", 0, 32)
304303
305304
306305   /* video hardware */
trunk/src/mame/drivers/seta.c
r18137r18138
74107410
74117411***************************************************************************/
74127412
7413static TIMER_DEVICE_CALLBACK( seta_interrupt_1_and_2 )
7413TIMER_DEVICE_CALLBACK_MEMBER(seta_state::seta_interrupt_1_and_2)
74147414{
7415   seta_state *state = timer.machine().driver_data<seta_state>();
74167415   int scanline = param;
74177416
74187417   if(scanline == 240)
7419      state->m_maincpu->set_input_line(1, HOLD_LINE);
7418      m_maincpu->set_input_line(1, HOLD_LINE);
74207419
74217420   if(scanline == 112)
7422      state->m_maincpu->set_input_line(2, HOLD_LINE);
7421      m_maincpu->set_input_line(2, HOLD_LINE);
74237422}
74247423
7425static TIMER_DEVICE_CALLBACK( seta_interrupt_2_and_4 )
7424TIMER_DEVICE_CALLBACK_MEMBER(seta_state::seta_interrupt_2_and_4)
74267425{
7427   seta_state *state = timer.machine().driver_data<seta_state>();
74287426   int scanline = param;
74297427
74307428   if(scanline == 240)
7431      state->m_maincpu->set_input_line(2, HOLD_LINE);
7429      m_maincpu->set_input_line(2, HOLD_LINE);
74327430
74337431   if(scanline == 112)
7434      state->m_maincpu->set_input_line(4, HOLD_LINE);
7432      m_maincpu->set_input_line(4, HOLD_LINE);
74357433}
74367434
74377435
7438static TIMER_DEVICE_CALLBACK( seta_sub_interrupt )
7436TIMER_DEVICE_CALLBACK_MEMBER(seta_state::seta_sub_interrupt)
74397437{
7440   seta_state *state = timer.machine().driver_data<seta_state>();
74417438   int scanline = param;
74427439
74437440   if(scanline == 240)
7444      state->m_subcpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
7441      m_subcpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
74457442
74467443   if(scanline == 112)
7447      state->m_subcpu->set_input_line(0, HOLD_LINE);
7444      m_subcpu->set_input_line(0, HOLD_LINE);
74487445}
74497446
74507447
r18137r18138
74667463};
74677464
74687465
7469static TIMER_DEVICE_CALLBACK( tndrcade_sub_interrupt )
7466TIMER_DEVICE_CALLBACK_MEMBER(seta_state::tndrcade_sub_interrupt)
74707467{
7471   seta_state *state = timer.machine().driver_data<seta_state>();
74727468   int scanline = param;
74737469
74747470   if(scanline == 240)
7475      state->m_subcpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
7471      m_subcpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
74767472
74777473   if((scanline % 16) == 0)
7478      state->m_subcpu->set_input_line(0, HOLD_LINE);
7474      m_subcpu->set_input_line(0, HOLD_LINE);
74797475}
74807476
74817477static MACHINE_CONFIG_START( tndrcade, seta_state )
r18137r18138
74877483
74887484   MCFG_CPU_ADD("sub", M65C02, 16000000/8)   /* 2 MHz */
74897485   MCFG_CPU_PROGRAM_MAP(tndrcade_sub_map)
7490   MCFG_TIMER_ADD_SCANLINE("scantimer", tndrcade_sub_interrupt, "screen", 0, 1)
7486   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, tndrcade_sub_interrupt, "screen", 0, 1)
74917487
74927488   MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
74937489
r18137r18138
75377533
75387534   MCFG_CPU_ADD("sub", M65C02, 16000000/8)   /* 2 MHz */
75397535   MCFG_CPU_PROGRAM_MAP(twineagl_sub_map)
7540   MCFG_TIMER_ADD_SCANLINE("s_scantimer", seta_sub_interrupt, "screen", 0, 1)
7536   MCFG_TIMER_DRIVER_ADD_SCANLINE("s_scantimer", seta_state, seta_sub_interrupt, "screen", 0, 1)
75417537
75427538   MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
75437539
r18137r18138
75757571   /* basic machine hardware */
75767572   MCFG_CPU_ADD("maincpu", M68000, XTAL_16MHz/2) /* verified on pcb */
75777573   MCFG_CPU_PROGRAM_MAP(downtown_map)
7578   MCFG_TIMER_ADD_SCANLINE("m_scantimer", seta_interrupt_1_and_2, "screen", 0, 1)
7574   MCFG_TIMER_DRIVER_ADD_SCANLINE("m_scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1)
75797575
75807576   MCFG_CPU_ADD("sub", M65C02, XTAL_16MHz/8) /* verified on pcb */
75817577   MCFG_CPU_PROGRAM_MAP(downtown_sub_map)
7582   MCFG_TIMER_ADD_SCANLINE("s_scantimer", seta_sub_interrupt, "screen", 0, 1)
7578   MCFG_TIMER_DRIVER_ADD_SCANLINE("s_scantimer", seta_state, seta_sub_interrupt, "screen", 0, 1)
75837579
75847580   MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
75857581
r18137r18138
76147610    5 ints per frame
76157611*/
76167612
7617static TIMER_DEVICE_CALLBACK( calibr50_interrupt )
7613TIMER_DEVICE_CALLBACK_MEMBER(seta_state::calibr50_interrupt)
76187614{
7619   seta_state *state = timer.machine().driver_data<seta_state>();
76207615   int scanline = param;
76217616
76227617   if((scanline % 64) == 0)
7623      state->m_maincpu->set_input_line(4, HOLD_LINE);
7618      m_maincpu->set_input_line(4, HOLD_LINE);
76247619
76257620   if(scanline == 248)
7626      state->m_maincpu->set_input_line(2, HOLD_LINE);
7621      m_maincpu->set_input_line(2, HOLD_LINE);
76277622}
76287623
76297624
r18137r18138
76327627   /* basic machine hardware */
76337628   MCFG_CPU_ADD("maincpu", M68000, 16000000/2)   /* 8 MHz */
76347629   MCFG_CPU_PROGRAM_MAP(usclssic_map)
7635   MCFG_TIMER_ADD_SCANLINE("scantimer", calibr50_interrupt, "screen", 0, 1)
7630   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, calibr50_interrupt, "screen", 0, 1)
76367631
76377632   MCFG_CPU_ADD("sub", M65C02, 16000000/8)   /* 2 MHz */
76387633   MCFG_CPU_PROGRAM_MAP(calibr50_sub_map)
r18137r18138
76807675   /* basic machine hardware */
76817676   MCFG_CPU_ADD("maincpu", M68000, XTAL_16MHz/2) /* verified on pcb */
76827677   MCFG_CPU_PROGRAM_MAP(calibr50_map)
7683   MCFG_TIMER_ADD_SCANLINE("scantimer", calibr50_interrupt, "screen", 0, 1)
7678   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, calibr50_interrupt, "screen", 0, 1)
76847679
76857680   MCFG_CPU_ADD("sub", M65C02, XTAL_16MHz/8) /* verified on pcb */
76867681   MCFG_CPU_PROGRAM_MAP(calibr50_sub_map)
r18137r18138
77277722
77287723   MCFG_CPU_ADD("sub", M65C02, 16000000/8)   /* 2 MHz */
77297724   MCFG_CPU_PROGRAM_MAP(metafox_sub_map)
7730   MCFG_TIMER_ADD_SCANLINE("s_scantimer", seta_sub_interrupt, "screen", 0, 1)
7725   MCFG_TIMER_DRIVER_ADD_SCANLINE("s_scantimer", seta_state, seta_sub_interrupt, "screen", 0, 1)
77317726
77327727   MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
77337728
r18137r18138
77637758   /* basic machine hardware */
77647759   MCFG_CPU_ADD("maincpu", M68000, 16000000)   /* 16 MHz */
77657760   MCFG_CPU_PROGRAM_MAP(atehate_map)
7766   MCFG_TIMER_ADD_SCANLINE("scantimer", seta_interrupt_1_and_2, "screen", 0, 1)
7761   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1)
77677762
77687763   MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
77697764
r18137r18138
78057800   /* basic machine hardware */
78067801   MCFG_CPU_ADD("maincpu", M68000, 16000000)   /* 16 MHz */
78077802   MCFG_CPU_PROGRAM_MAP(blandia_map)
7808   MCFG_TIMER_ADD_SCANLINE("scantimer", seta_interrupt_2_and_4, "screen", 0, 1)
7803   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_2_and_4, "screen", 0, 1)
78097804
78107805   MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
78117806
r18137r18138
78387833   /* basic machine hardware */
78397834   MCFG_CPU_ADD("maincpu", M68000, 16000000)   /* 16 MHz */
78407835   MCFG_CPU_PROGRAM_MAP(blandiap_map)
7841   MCFG_TIMER_ADD_SCANLINE("scantimer", seta_interrupt_2_and_4, "screen", 0, 1)
7836   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_2_and_4, "screen", 0, 1)
78427837
78437838   MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
78447839
r18137r18138
79127907   /* basic machine hardware */
79137908   MCFG_CPU_ADD("maincpu", M68000, 16000000)   /* 16 MHz */
79147909   MCFG_CPU_PROGRAM_MAP(daioh_map)
7915   MCFG_TIMER_ADD_SCANLINE("scantimer", seta_interrupt_1_and_2, "screen", 0, 1)
7910   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1)
79167911
79177912   MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
79187913
r18137r18138
79537948   /* basic machine hardware */
79547949   MCFG_CPU_ADD("maincpu", M68000, 16000000/2)   /* 8 MHz */
79557950   MCFG_CPU_PROGRAM_MAP(drgnunit_map)
7956   MCFG_TIMER_ADD_SCANLINE("scantimer", seta_interrupt_1_and_2, "screen", 0, 1)
7951   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1)
79577952
79587953   MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
79597954
r18137r18138
79887983   /* basic machine hardware */
79897984   MCFG_CPU_ADD("maincpu", M68000, 16000000)   /* 16 MHz */
79907985   MCFG_CPU_PROGRAM_MAP(drgnunit_map)
7991   MCFG_TIMER_ADD_SCANLINE("scantimer", seta_interrupt_1_and_2, "screen", 0, 1)
7986   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1)
79927987
79937988   MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
79947989
r18137r18138
80198014                                Seta Roulette
80208015***************************************************************************/
80218016
8022static TIMER_DEVICE_CALLBACK( setaroul_interrupt )
8017TIMER_DEVICE_CALLBACK_MEMBER(seta_state::setaroul_interrupt)
80238018{
8024   seta_state *state = timer.machine().driver_data<seta_state>();
80258019   int scanline = param;
80268020
80278021   if(scanline == 248)
8028      state->m_maincpu->set_input_line(4, HOLD_LINE);
8022      m_maincpu->set_input_line(4, HOLD_LINE);
80298023
80308024   if(scanline == 112)
8031      state->m_maincpu->set_input_line(2, HOLD_LINE);
8025      m_maincpu->set_input_line(2, HOLD_LINE);
80328026}
80338027
80348028
r18137r18138
80378031   /* basic machine hardware */
80388032   MCFG_CPU_ADD("maincpu", M68000, 16000000/2)   /* 8 MHz */
80398033   MCFG_CPU_PROGRAM_MAP(setaroul_map)
8040   MCFG_TIMER_ADD_SCANLINE("scantimer", setaroul_interrupt, "screen", 0, 1)
8034   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, setaroul_interrupt, "screen", 0, 1)
80418035
80428036   MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
80438037
r18137r18138
80778071   /* basic machine hardware */
80788072   MCFG_CPU_ADD("maincpu", M68000, 16000000)   /* 16 MHz */
80798073   MCFG_CPU_PROGRAM_MAP(wrofaero_map)
8080   MCFG_TIMER_ADD_SCANLINE("scantimer", seta_interrupt_1_and_2, "screen", 0, 1)
8074   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1)
80818075
80828076   MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
80838077
r18137r18138
81188112   /* basic machine hardware */
81198113   MCFG_CPU_ADD("maincpu", M68000, 16000000)   /* 16 MHz */
81208114   MCFG_CPU_PROGRAM_MAP(extdwnhl_map)
8121   MCFG_TIMER_ADD_SCANLINE("scantimer", seta_interrupt_1_and_2, "screen", 0, 1)
8115   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1)
81228116
81238117   MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
81248118
r18137r18138
81728166   MCFG_CPU_ADD("maincpu", M68000, 16000000)   /* 16 MHz */
81738167   MCFG_CPU_PROGRAM_MAP(wrofaero_map)
81748168#if   __uPD71054_TIMER
8175   MCFG_TIMER_ADD_SCANLINE("scantimer", seta_interrupt_1_and_2, "screen", 0, 1)
8169   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1)
81768170#else
8177   MCFG_TIMER_ADD_SCANLINE("scantimer", seta_interrupt_2_and_4, "screen", 0, 1)
8171   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_2_and_4, "screen", 0, 1)
81788172#endif   // __uPD71054_TIMER
81798173
81808174#if   __uPD71054_TIMER
r18137r18138
82208214   /* basic machine hardware */
82218215   MCFG_CPU_ADD("maincpu", M68000, 16000000)   /* 16 MHz */
82228216   MCFG_CPU_PROGRAM_MAP(wrofaero_map)
8223   MCFG_TIMER_ADD_SCANLINE("scantimer", seta_interrupt_1_and_2, "screen", 0, 1)
8217   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1)
82248218
82258219   MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
82268220
r18137r18138
82528246   /* basic machine hardware */
82538247   MCFG_CPU_ADD("maincpu", M68000, 16000000)   /* 16 MHz */
82548248   MCFG_CPU_PROGRAM_MAP(jjsquawb_map)
8255   MCFG_TIMER_ADD_SCANLINE("scantimer", seta_interrupt_1_and_2, "screen", 0, 1)
8249   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1)
82568250
82578251   MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
82588252
r18137r18138
83308324   /* basic machine hardware */
83318325   MCFG_CPU_ADD("maincpu", M68000, 14318180/2)   /* 7.143 MHz */
83328326   MCFG_CPU_PROGRAM_MAP(orbs_map)
8333   MCFG_TIMER_ADD_SCANLINE("scantimer", seta_interrupt_1_and_2, "screen", 0, 1)
8327   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1)
83348328
83358329   MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
83368330
r18137r18138
83668360   /* basic machine hardware */
83678361   MCFG_CPU_ADD("maincpu", M68000, 14318180/2)   /* 7.143 MHz */
83688362   MCFG_CPU_PROGRAM_MAP(keroppi_map)
8369   MCFG_TIMER_ADD_SCANLINE("scantimer", seta_interrupt_1_and_2, "screen", 0, 1)
8363   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1)
83708364
83718365   MCFG_MACHINE_START_OVERRIDE(seta_state,keroppi)
83728366
r18137r18138
84048398   /* basic machine hardware */
84058399   MCFG_CPU_ADD("maincpu", M68000, 16000000)   /* 16 MHz */
84068400   MCFG_CPU_PROGRAM_MAP(krzybowl_map)
8407   MCFG_TIMER_ADD_SCANLINE("scantimer", seta_interrupt_1_and_2, "screen", 0, 1)
8401   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1)
84088402
84098403   MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
84108404
r18137r18138
85288522#if   __uPD71054_TIMER
85298523   MCFG_CPU_VBLANK_INT_DRIVER("screen", seta_state,  wrofaero_interrupt)
85308524#else
8531   MCFG_TIMER_ADD_SCANLINE("scantimer", seta_interrupt_2_and_4, "screen", 0, 1)
8525   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_2_and_4, "screen", 0, 1)
85328526#endif   // __uPD71054_TIMER
85338527
85348528#if   __uPD71054_TIMER
r18137r18138
85718565   /* basic machine hardware */
85728566   MCFG_CPU_ADD("maincpu", M68000, 16000000)   /* 16 MHz */
85738567   MCFG_CPU_PROGRAM_MAP(oisipuzl_map)
8574   MCFG_TIMER_ADD_SCANLINE("scantimer", seta_interrupt_1_and_2, "screen", 0, 1)
8568   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1)
85758569
85768570   MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
85778571
r18137r18138
86828676   /* basic machine hardware */
86838677   MCFG_CPU_ADD("maincpu", M68000, 16000000)   /* 16 MHz */
86848678   MCFG_CPU_PROGRAM_MAP(wrofaero_map)
8685   MCFG_TIMER_ADD_SCANLINE("scantimer", seta_interrupt_1_and_2, "screen", 0, 1)
8679   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1)
86868680
86878681   MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
86888682
r18137r18138
88988892   /* basic machine hardware */
88998893   MCFG_CPU_ADD("maincpu", M68000, 16000000)   /* 16 MHz */
89008894   MCFG_CPU_PROGRAM_MAP(utoukond_map)
8901   MCFG_TIMER_ADD_SCANLINE("scantimer", seta_interrupt_1_and_2, "screen", 0, 1)
8895   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1)
89028896
89038897   MCFG_CPU_ADD("audiocpu", Z80, 16000000/4)   /* 4 MHz */
89048898   MCFG_CPU_PROGRAM_MAP(utoukond_sound_map)
r18137r18138
89468940#if   __uPD71054_TIMER
89478941   MCFG_CPU_VBLANK_INT_DRIVER("screen", seta_state,  wrofaero_interrupt)
89488942#else
8949   MCFG_TIMER_ADD_SCANLINE("scantimer", seta_interrupt_2_and_4, "screen", 0, 1)
8943   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_2_and_4, "screen", 0, 1)
89508944#endif   // __uPD71054_TIMER
89518945
89528946#if   __uPD71054_TIMER
r18137r18138
90299023
90309024   MCFG_CPU_ADD("maincpu", M68000, 16000000)   /* 16 MHz */
90319025   MCFG_CPU_PROGRAM_MAP(zingzipbl_map)
9032   MCFG_TIMER_ADD_SCANLINE("scantimer", seta_interrupt_1_and_2, "screen", 0, 1) // irq3 isn't valid on the bootleg
9026   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1)
90339027
90349028   MCFG_DEVICE_REMOVE("x1snd")
90359029
r18137r18138
90479041   /* basic machine hardware */
90489042   MCFG_CPU_ADD("maincpu", M68000, 16000000/2)   /* 8 MHz */
90499043   MCFG_CPU_PROGRAM_MAP(pairlove_map)
9050   MCFG_TIMER_ADD_SCANLINE("scantimer", seta_interrupt_1_and_2, "screen", 0, 1)
9044   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, seta_interrupt_1_and_2, "screen", 0, 1)
90519045
90529046   MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
90539047
r18137r18138
90789072                                Crazy Fight
90799073***************************************************************************/
90809074
9081static TIMER_DEVICE_CALLBACK( crazyfgt_interrupt )
9075TIMER_DEVICE_CALLBACK_MEMBER(seta_state::crazyfgt_interrupt)
90829076{
9083   seta_state *state = timer.machine().driver_data<seta_state>();
90849077   int scanline = param;
90859078
90869079   if((scanline % 48) == 0)
9087      state->m_maincpu->set_input_line(2, HOLD_LINE); // should this be triggered by the 3812?
9080      m_maincpu->set_input_line(2, HOLD_LINE); // should this be triggered by the 3812?
90889081
90899082   if(scanline == 240)
9090      state->m_maincpu->set_input_line(1, HOLD_LINE);
9083      m_maincpu->set_input_line(1, HOLD_LINE);
90919084}
90929085
90939086static MACHINE_CONFIG_START( crazyfgt, seta_state )
r18137r18138
90959088   /* basic machine hardware */
90969089   MCFG_CPU_ADD("maincpu", M68000, 16000000)   /* 16 MHz */
90979090   MCFG_CPU_PROGRAM_MAP(crazyfgt_map)
9098   MCFG_TIMER_ADD_SCANLINE("scantimer", crazyfgt_interrupt, "screen", 0, 1)
9091   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, crazyfgt_interrupt, "screen", 0, 1)
90999092
91009093   MCFG_DEVICE_ADD("spritegen", SETA001_SPRITE, 0)
91019094
r18137r18138
91289121***************************************************************************/
91299122
91309123// Test mode shows a 16ms and 2ms counters, then there's vblank and presumably ACIA irqs ...
9131static TIMER_DEVICE_CALLBACK( inttoote_interrupt )
9124TIMER_DEVICE_CALLBACK_MEMBER(seta_state::inttoote_interrupt)
91329125{
9133   seta_state *state = timer.machine().driver_data<seta_state>();
91349126   int scanline = param;
91359127
91369128   /* ACIA irq */
91379129   if(scanline == 15)
9138      state->m_maincpu->set_input_line(4, HOLD_LINE);
9130      m_maincpu->set_input_line(4, HOLD_LINE);
91399131
91409132   if(scanline == 38)
9141      state->m_maincpu->set_input_line(1, HOLD_LINE);
9133      m_maincpu->set_input_line(1, HOLD_LINE);
91429134
91439135   if(scanline == 61)
9144      state->m_maincpu->set_input_line(2, HOLD_LINE);
9136      m_maincpu->set_input_line(2, HOLD_LINE);
91459137
91469138   if(scanline >= 85 && (scanline % 23) == 0)
9147      state->m_maincpu->set_input_line(6, HOLD_LINE);
9139      m_maincpu->set_input_line(6, HOLD_LINE);
91489140}
91499141
91509142static const pia6821_interface inttoote_pia0_intf =
r18137r18138
91899181   /* basic machine hardware */
91909182   MCFG_CPU_ADD("maincpu", M68000, 16000000)
91919183   MCFG_CPU_PROGRAM_MAP(inttoote_map)
9192   MCFG_TIMER_ADD_SCANLINE("scantimer", inttoote_interrupt, "screen", 0, 1)
9184   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta_state, inttoote_interrupt, "screen", 0, 1)
91939185
91949186   MCFG_PIA6821_ADD("pia0", inttoote_pia0_intf)
91959187   MCFG_PIA6821_ADD("pia1", inttoote_pia1_intf)
trunk/src/mame/drivers/seta2.c
r18137r18138
21622162                               Funcube series
21632163***************************************************************************/
21642164
2165static TIMER_DEVICE_CALLBACK( funcube_interrupt )
2165TIMER_DEVICE_CALLBACK_MEMBER(seta2_state::funcube_interrupt)
21662166{
2167   seta2_state *state = timer.machine().driver_data<seta2_state>();
21682167   int scanline = param;
21692168
21702169   if(scanline == 368)
2171      state->m_maincpu->set_input_line(1, HOLD_LINE);
2170      m_maincpu->set_input_line(1, HOLD_LINE);
21722171
21732172   if(scanline == 0)
2174      state->m_maincpu->set_input_line(2, HOLD_LINE);
2173      m_maincpu->set_input_line(2, HOLD_LINE);
21752174}
21762175
21772176INTERRUPT_GEN_MEMBER(seta2_state::funcube_sub_timer_irq)
r18137r18138
22132212
22142213   MCFG_CPU_ADD("maincpu", MCF5206E, XTAL_25_447MHz)
22152214   MCFG_CPU_PROGRAM_MAP(funcube_map)
2216   MCFG_TIMER_ADD_SCANLINE("scantimer", funcube_interrupt, "screen", 0, 1)
2215   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", seta2_state, funcube_interrupt, "screen", 0, 1)
22172216
22182217   MCFG_CPU_ADD("sub", H83007, FUNCUBE_SUB_CPU_CLOCK)
22192218   MCFG_CPU_PROGRAM_MAP(funcube_sub_map)
trunk/src/mame/drivers/polepos.c
r18137r18138
445445};
446446
447447
448static TIMER_DEVICE_CALLBACK( polepos_scanline )
448TIMER_DEVICE_CALLBACK_MEMBER(polepos_state::polepos_scanline)
449449{
450   polepos_state *state = timer.machine().driver_data<polepos_state>();
451450   int scanline = param;
452451
453   if (((scanline == 64) || (scanline == 192)) && state->m_main_irq_mask)   // 64V
454      timer.machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
452   if (((scanline == 64) || (scanline == 192)) && m_main_irq_mask)   // 64V
453      machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
455454
456   if (scanline == 240 && state->m_sub_irq_mask)   // VBLANK
455   if (scanline == 240 && m_sub_irq_mask)   // VBLANK
457456   {
458      timer.machine().device("sub")->execute().set_input_line(0, ASSERT_LINE);
459      timer.machine().device("sub2")->execute().set_input_line(0, ASSERT_LINE);
457      machine().device("sub")->execute().set_input_line(0, ASSERT_LINE);
458      machine().device("sub2")->execute().set_input_line(0, ASSERT_LINE);
460459   }
461460}
462461
r18137r18138
903902   MCFG_MACHINE_RESET_OVERRIDE(polepos_state,polepos)
904903   MCFG_NVRAM_ADD_1FILL("nvram")
905904
906   MCFG_TIMER_ADD_SCANLINE("scantimer", polepos_scanline, "screen", 0, 1)
905   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", polepos_state, polepos_scanline, "screen", 0, 1)
907906
908907   /* video hardware */
909908   MCFG_SCREEN_ADD("screen", RASTER)
r18137r18138
982981   MCFG_MACHINE_RESET_OVERRIDE(polepos_state,polepos)
983982   MCFG_NVRAM_ADD_1FILL("nvram")
984983
985   MCFG_TIMER_ADD_SCANLINE("scantimer", polepos_scanline, "screen", 0, 1)
984   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", polepos_state, polepos_scanline, "screen", 0, 1)
986985
987986   /* video hardware */
988987   MCFG_SCREEN_ADD("screen", RASTER)
trunk/src/mame/drivers/1942.c
r18137r18138
7474   membank("bank1")->set_entry(data & 0x03);
7575}
7676
77static TIMER_DEVICE_CALLBACK( c1942_scanline )
77TIMER_DEVICE_CALLBACK_MEMBER(_1942_state::c1942_scanline)
7878{
7979   int scanline = param;
8080
8181   if(scanline == 240) // vblank-out irq
82      timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xd7);   /* RST 10h - vblank */
82      machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xd7);   /* RST 10h - vblank */
8383
8484   if(scanline == 0) // unknown irq event, presumably vblank-in or a periodic one (writes to the soundlatch and drives freeze dip-switch)
85      timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xcf);   /* RST 08h */
85      machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE, 0xcf);   /* RST 08h */
8686}
8787
8888
r18137r18138
258258   /* basic machine hardware */
259259   MCFG_CPU_ADD("maincpu", Z80, MAIN_CPU_CLOCK)   /* 4 MHz ??? */
260260   MCFG_CPU_PROGRAM_MAP(c1942_map)
261   MCFG_TIMER_ADD_SCANLINE("scantimer", c1942_scanline, "screen", 0, 1)
261   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", _1942_state, c1942_scanline, "screen", 0, 1)
262262
263263   MCFG_CPU_ADD("audiocpu", Z80, SOUND_CPU_CLOCK)   /* 3 MHz ??? */
264264   MCFG_CPU_PROGRAM_MAP(sound_map)
trunk/src/mame/drivers/qdrmfgp.c
r18137r18138
264264 *
265265 *************************************/
266266
267static TIMER_DEVICE_CALLBACK(qdrmfgp_interrupt)
267TIMER_DEVICE_CALLBACK_MEMBER(qdrmfgp_state::qdrmfgp_interrupt)
268268{
269   qdrmfgp_state *state = timer.machine().driver_data<qdrmfgp_state>();
270269   int scanline = param;
271270
272271   if(scanline == 0)
273      if (state->m_control & 0x0001)
274         state->m_maincpu->set_input_line(1, HOLD_LINE);
272      if (m_control & 0x0001)
273         m_maincpu->set_input_line(1, HOLD_LINE);
275274
276275   /* trigger V-blank interrupt */
277276   if(scanline == 240)
278      if (state->m_control & 0x0004)
279         state->m_maincpu->set_input_line(3, HOLD_LINE);
277      if (m_control & 0x0004)
278         m_maincpu->set_input_line(3, HOLD_LINE);
280279}
281280
282281static void ide_interrupt(device_t *device, int state)
r18137r18138
675674   /* basic machine hardware */
676675   MCFG_CPU_ADD("maincpu", M68000, 32000000/2)   /*  16.000 MHz */
677676   MCFG_CPU_PROGRAM_MAP(qdrmfgp_map)
678   MCFG_TIMER_ADD_SCANLINE("scantimer", qdrmfgp_interrupt, "screen", 0, 1)
677   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", qdrmfgp_state, qdrmfgp_interrupt, "screen", 0, 1)
679678
680679   MCFG_MACHINE_START_OVERRIDE(qdrmfgp_state,qdrmfgp)
681680   MCFG_NVRAM_ADD_1FILL("nvram")
trunk/src/mame/drivers/segahang.c
r18137r18138
338338
339339
340340#if 0
341static TIMER_DEVICE_CALLBACK( hangon_irq )
341TIMER_DEVICE_CALLBACK_MEMBER(segahang_state::hangon_irq)
342342{
343343   int scanline = param;
344344
trunk/src/mame/drivers/argus.c
r18137r18138
129129
130130***************************************************************************/
131131
132static TIMER_DEVICE_CALLBACK( argus_scanline )
132TIMER_DEVICE_CALLBACK_MEMBER(argus_state::argus_scanline)
133133{
134134   int scanline = param;
135135
136136   if(scanline == 240) // vblank-out irq
137      timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xd7); /* RST 10h */
137      machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xd7); /* RST 10h */
138138
139139   if(scanline == 16) // vblank-in irq
140      timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xcf); /* RST 08h */
140      machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xcf); /* RST 08h */
141141}
142142
143static TIMER_DEVICE_CALLBACK( butasan_scanline )
143TIMER_DEVICE_CALLBACK_MEMBER(argus_state::butasan_scanline)
144144{
145145   int scanline = param;
146146
147147   if(scanline == 248) // vblank-out irq
148      timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xd7); /* RST 10h */
148      machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xd7); /* RST 10h */
149149
150150   if(scanline == 8) // vblank-in irq
151      timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xcf); /* RST 08h */
151      machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xcf); /* RST 08h */
152152}
153153
154154/* Handler called by the YM2203 emulator when the internal timers cause an IRQ */
r18137r18138
545545   /* basic machine hardware */
546546   MCFG_CPU_ADD("maincpu", Z80, 5000000)         /* 4 MHz */
547547   MCFG_CPU_PROGRAM_MAP(argus_map)
548   MCFG_TIMER_ADD_SCANLINE("scantimer", argus_scanline, "screen", 0, 1)
548   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", argus_state, argus_scanline, "screen", 0, 1)
549549
550550   MCFG_CPU_ADD("audiocpu", Z80, 5000000)
551551   MCFG_CPU_PROGRAM_MAP(sound_map_a)
r18137r18138
589589   /* basic machine hardware */
590590   MCFG_CPU_ADD("maincpu", Z80, 5000000)         /* 5 MHz */
591591   MCFG_CPU_PROGRAM_MAP(valtric_map)
592   MCFG_TIMER_ADD_SCANLINE("scantimer", argus_scanline, "screen", 0, 1)
592   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", argus_state, argus_scanline, "screen", 0, 1)
593593
594594   MCFG_CPU_ADD("audiocpu", Z80, 5000000)
595595   MCFG_CPU_PROGRAM_MAP(sound_map_a)
r18137r18138
633633   /* basic machine hardware */
634634   MCFG_CPU_ADD("maincpu", Z80, 5000000)         /* 5 MHz */
635635   MCFG_CPU_PROGRAM_MAP(butasan_map)
636   MCFG_TIMER_ADD_SCANLINE("scantimer", butasan_scanline, "screen", 0, 1)
636   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", argus_state, butasan_scanline, "screen", 0, 1)
637637
638638   MCFG_CPU_ADD("audiocpu", Z80, 5000000)
639639   MCFG_CPU_PROGRAM_MAP(sound_map_b)
trunk/src/mame/drivers/xain.c
r18137r18138
173173      return (vcount - 0x18) | 0x100;
174174}
175175
176static TIMER_DEVICE_CALLBACK( xain_scanline )
176TIMER_DEVICE_CALLBACK_MEMBER(xain_state::xain_scanline)
177177{
178   xain_state *state = timer.machine().driver_data<xain_state>();
179178   int scanline = param;
180   int screen_height = timer.machine().primary_screen->height();
179   int screen_height = machine().primary_screen->height();
181180   int vcount_old = scanline_to_vcount((scanline == 0) ? screen_height - 1 : scanline - 1);
182181   int vcount = scanline_to_vcount(scanline);
183182
184183   /* update to the current point */
185184   if (scanline > 0)
186185   {
187      timer.machine().primary_screen->update_partial(scanline - 1);
186      machine().primary_screen->update_partial(scanline - 1);
188187   }
189188
190189   /* FIRQ (IMS) fires every on every 8th scanline (except 0) */
191190   if (!(vcount_old & 8) && (vcount & 8))
192191   {
193      timer.machine().device("maincpu")->execute().set_input_line(M6809_FIRQ_LINE, ASSERT_LINE);
192      machine().device("maincpu")->execute().set_input_line(M6809_FIRQ_LINE, ASSERT_LINE);
194193   }
195194
196195   /* NMI fires on scanline 248 (VBL) and is latched */
197196   if (vcount == 0xf8)
198197   {
199      timer.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
198      machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
200199   }
201200
202201   /* VBLANK input bit is held high from scanlines 248-255 */
203202   if (vcount >= 248-1)   // -1 is a hack - see notes above
204203   {
205      state->m_vblank = 1;
204      m_vblank = 1;
206205   }
207206   else
208207   {
209      state->m_vblank = 0;
208      m_vblank = 0;
210209   }
211210}
212211
r18137r18138
579578   /* basic machine hardware */
580579   MCFG_CPU_ADD("maincpu", M6809, CPU_CLOCK)
581580   MCFG_CPU_PROGRAM_MAP(main_map)
582   MCFG_TIMER_ADD_SCANLINE("scantimer", xain_scanline, "screen", 0, 1)
581   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", xain_state, xain_scanline, "screen", 0, 1)
583582
584583   MCFG_CPU_ADD("sub", M6809, CPU_CLOCK)
585584   MCFG_CPU_PROGRAM_MAP(cpu_map_B)
trunk/src/mame/drivers/foodf.c
r18137r18138
113113}
114114
115115
116static TIMER_DEVICE_CALLBACK( scanline_update )
116TIMER_DEVICE_CALLBACK_MEMBER(foodf_state::scanline_update)
117117{
118118   int scanline = param;
119119
r18137r18138
123123       mystery yet */
124124
125125   /* INT 1 is on 32V */
126   atarigen_scanline_int_gen(timer.machine().device("maincpu"));
126   atarigen_scanline_int_gen(machine().device("maincpu"));
127127
128128   /* advance to the next interrupt */
129129   scanline += 64;
r18137r18138
131131      scanline = 0;
132132
133133   /* set a timer for it */
134   timer.adjust(timer.machine().primary_screen->time_until_pos(scanline), scanline);
134   timer.adjust(machine().primary_screen->time_until_pos(scanline), scanline);
135135}
136136
137137
r18137r18138
363363
364364   MCFG_WATCHDOG_VBLANK_INIT(8)
365365
366   MCFG_TIMER_ADD("scan_timer", scanline_update)
366   MCFG_TIMER_DRIVER_ADD("scan_timer", foodf_state, scanline_update)
367367
368368   /* video hardware */
369369   MCFG_GFXDECODE(foodf)
trunk/src/mame/drivers/wwfwfest.c
r18137r18138
342342 Interrupt Function
343343*******************************************************************************/
344344
345static TIMER_DEVICE_CALLBACK( wwfwfest_scanline )
345TIMER_DEVICE_CALLBACK_MEMBER(wwfwfest_state::wwfwfest_scanline)
346346{
347347   int scanline = param;
348348
r18137r18138
350350   if (scanline % 16 == 0)
351351   {
352352      if (scanline > 0)
353         timer.machine().primary_screen->update_partial(scanline - 1);
354      timer.machine().device("maincpu")->execute().set_input_line(2, ASSERT_LINE);
353         machine().primary_screen->update_partial(scanline - 1);
354      machine().device("maincpu")->execute().set_input_line(2, ASSERT_LINE);
355355   }
356356
357357   /* Vblank is raised on scanline 248 */
358358   if (scanline == 248)
359359   {
360      timer.machine().primary_screen->update_partial(scanline - 1);
361      timer.machine().device("maincpu")->execute().set_input_line(3, ASSERT_LINE);
360      machine().primary_screen->update_partial(scanline - 1);
361      machine().device("maincpu")->execute().set_input_line(3, ASSERT_LINE);
362362   }
363363}
364364
r18137r18138
387387   /* basic machine hardware */
388388   MCFG_CPU_ADD("maincpu", M68000, CPU_CLOCK)   /* 24 crystal, 12 rated chip */
389389   MCFG_CPU_PROGRAM_MAP(main_map)
390   MCFG_TIMER_ADD_SCANLINE("scantimer", wwfwfest_scanline, "screen", 0, 1)
390   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", wwfwfest_state, wwfwfest_scanline, "screen", 0, 1)
391391
392392   MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz)
393393   MCFG_CPU_PROGRAM_MAP(sound_map)
trunk/src/mame/drivers/zodiack.c
r18137r18138
103103}
104104
105105
106static TIMER_DEVICE_CALLBACK( zodiack_scanline )
106TIMER_DEVICE_CALLBACK_MEMBER(zodiack_state::zodiack_scanline)
107107{
108   zodiack_state *state = timer.machine().driver_data<zodiack_state>();
109108   int scanline = param;
110109
111   if(scanline == 240 && state->m_nmi_enable) // vblank-out irq
112      timer.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
110   if(scanline == 240 && m_nmi_enable) // vblank-out irq
111      machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
113112
114113   if(scanline == 0 ) // vblank-in irq
115      timer.machine().device("maincpu")->execute().set_input_line(0, HOLD_LINE);
114      machine().device("maincpu")->execute().set_input_line(0, HOLD_LINE);
116115}
117116
118117INTERRUPT_GEN_MEMBER(zodiack_state::zodiack_sound_nmi_gen)
r18137r18138
559558   /* basic machine hardware */
560559   MCFG_CPU_ADD("maincpu", Z80, 4000000)        /* 4.00 MHz??? */
561560   MCFG_CPU_PROGRAM_MAP(main_map)
562   MCFG_TIMER_ADD_SCANLINE("scantimer", zodiack_scanline, "screen", 0, 1)
561   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", zodiack_state, zodiack_scanline, "screen", 0, 1)
563562
564563   MCFG_CPU_ADD("audiocpu", Z80, 14318000/8)   /* 1.78975 MHz??? */
565564   MCFG_CPU_PROGRAM_MAP(sound_map)
trunk/src/mame/drivers/iqblock.c
r18137r18138
7373}
7474
7575
76static TIMER_DEVICE_CALLBACK( iqblock_irq )
76TIMER_DEVICE_CALLBACK_MEMBER(iqblock_state::iqblock_irq)
7777{
78   iqblock_state *state = timer.machine().driver_data<iqblock_state>();
7978   int scanline = param;
8079
8180   if((scanline % 16) != 0)
8281      return;
8382
8483   if((scanline % 32) == 16)
85      state->m_maincpu->set_input_line(0, HOLD_LINE);
84      m_maincpu->set_input_line(0, HOLD_LINE);
8685   else if   ((scanline % 32) == 0)
87      state->m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
86      m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
8887}
8988
9089
r18137r18138
275274   MCFG_CPU_ADD("maincpu", Z80,12000000/2)   /* 6 MHz */
276275   MCFG_CPU_PROGRAM_MAP(main_map)
277276   MCFG_CPU_IO_MAP(main_portmap)
278   MCFG_TIMER_ADD_SCANLINE("scantimer", iqblock_irq, "screen", 0, 1)
277   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", iqblock_state, iqblock_irq, "screen", 0, 1)
279278
280279   MCFG_I8255A_ADD( "ppi8255", ppi8255_intf )
281280
trunk/src/mame/drivers/suna8.c
r18137r18138
17371737   soundirq   /* IRQ Line */
17381738};
17391739
1740static TIMER_DEVICE_CALLBACK( brickzn_interrupt )
1740TIMER_DEVICE_CALLBACK_MEMBER(suna8_state::brickzn_interrupt)
17411741{
1742   suna8_state *state = timer.machine().driver_data<suna8_state>();
17431742   int scanline = param;
17441743
17451744   if(scanline == 240)
1746      state->m_maincpu->set_input_line(0, HOLD_LINE);
1745      m_maincpu->set_input_line(0, HOLD_LINE);
17471746   if(scanline == 112)
1748      state->m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
1747      m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
17491748
17501749   // TODO: NMI enable
17511750}
r18137r18138
18191818
18201819/* 1 x 24 MHz crystal */
18211820
1822static TIMER_DEVICE_CALLBACK( hardhea2_interrupt )
1821TIMER_DEVICE_CALLBACK_MEMBER(suna8_state::hardhea2_interrupt)
18231822{
1824   suna8_state *state = timer.machine().driver_data<suna8_state>();
18251823   int scanline = param;
18261824
18271825   if(scanline == 240)
1828      state->m_maincpu->set_input_line(0, HOLD_LINE);
1826      m_maincpu->set_input_line(0, HOLD_LINE);
18291827   if(scanline == 112)
1830      if (state->m_nmi_enable)   state->m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
1828      if (m_nmi_enable)   m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
18311829}
18321830
18331831MACHINE_RESET_MEMBER(suna8_state,hardhea2)
r18137r18138
18411839
18421840   MCFG_CPU_ADD("maincpu", Z80, SUNA8_MASTER_CLOCK / 4)      /* SUNA T568009 */
18431841   MCFG_CPU_PROGRAM_MAP(hardhea2_map)
1844   MCFG_TIMER_ADD_SCANLINE("scantimer", hardhea2_interrupt, "screen", 0, 1)
1842   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", suna8_state, hardhea2_interrupt, "screen", 0, 1)
18451843
18461844   MCFG_MACHINE_RESET_OVERRIDE(suna8_state,hardhea2)
18471845   MCFG_PALETTE_LENGTH(256)
r18137r18138
18671865   /* basic machine hardware */
18681866   MCFG_CPU_ADD("maincpu", Z80, SUNA8_MASTER_CLOCK / 4)               /* ? */
18691867   MCFG_CPU_PROGRAM_MAP(starfigh_map)
1870   MCFG_TIMER_ADD_SCANLINE("scantimer", brickzn_interrupt, "screen", 0, 1)
1868   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", suna8_state, brickzn_interrupt, "screen", 0, 1)
18711869
18721870   /* The sound section is identical to that of hardhead */
18731871   MCFG_CPU_ADD("audiocpu", Z80, SUNA8_MASTER_CLOCK / 4)               /* ? */
r18137r18138
19151913   /* basic machine hardware */
19161914   MCFG_CPU_ADD("maincpu", Z80, SUNA8_MASTER_CLOCK / 4)               /* ? */
19171915   MCFG_CPU_PROGRAM_MAP(sparkman_map)
1918   MCFG_TIMER_ADD_SCANLINE("scantimer", hardhea2_interrupt, "screen", 0, 1)
1916   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", suna8_state, hardhea2_interrupt, "screen", 0, 1)
19191917
19201918   MCFG_CPU_ADD("audiocpu", Z80, SUNA8_MASTER_CLOCK / 4)            /* ? */
19211919   MCFG_CPU_PROGRAM_MAP(hardhead_sound_map)
trunk/src/mame/drivers/irobot.c
r18137r18138
308308   MCFG_PALETTE_LENGTH(64 + 32)   /* 64 for polygons, 32 for text */
309309
310310
311   MCFG_TIMER_ADD("irvg_timer", irobot_irvg_done_callback)
312   MCFG_TIMER_ADD("irmb_timer", irobot_irmb_done_callback)
311   MCFG_TIMER_DRIVER_ADD("irvg_timer", irobot_state, irobot_irvg_done_callback)
312   MCFG_TIMER_DRIVER_ADD("irmb_timer", irobot_state, irobot_irmb_done_callback)
313313
314314   /* sound hardware */
315315   MCFG_SPEAKER_STANDARD_MONO("mono")
trunk/src/mame/drivers/btime.c
r18137r18138
183183   }
184184}
185185
186static TIMER_DEVICE_CALLBACK( audio_nmi_gen )
186TIMER_DEVICE_CALLBACK_MEMBER(btime_state::audio_nmi_gen)
187187{
188   btime_state *state = timer.machine().driver_data<btime_state>();
189188   int scanline = param;
190   state->m_audio_nmi_state = scanline & 8;
191   state->m_audiocpu->set_input_line(INPUT_LINE_NMI, (state->m_audio_nmi_enabled && state->m_audio_nmi_state) ? ASSERT_LINE : CLEAR_LINE);
189   m_audio_nmi_state = scanline & 8;
190   m_audiocpu->set_input_line(INPUT_LINE_NMI, (m_audio_nmi_enabled && m_audio_nmi_state) ? ASSERT_LINE : CLEAR_LINE);
192191}
193192
194193
r18137r18138
14631462
14641463   MCFG_CPU_ADD("audiocpu", M6502, HCLK1/3/2)
14651464   MCFG_CPU_PROGRAM_MAP(audio_map)
1466   MCFG_TIMER_ADD_SCANLINE("audionmi", audio_nmi_gen, "screen", 0, 8)
1465   MCFG_TIMER_DRIVER_ADD_SCANLINE("audionmi", btime_state, audio_nmi_gen, "screen", 0, 8)
14671466
14681467   /* video hardware */
14691468   MCFG_SCREEN_ADD("screen", RASTER)
trunk/src/mame/drivers/changela.c
r18137r18138
402402};
403403
404404
405TIMER_DEVICE_CALLBACK( changela_scanline )
405TIMER_DEVICE_CALLBACK_MEMBER(changela_state::changela_scanline)
406406{
407407   int scanline = param;
408408
409409   if(scanline == 256) // vblank irq
410      timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xdf);
410      machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xdf);
411411   else if(((scanline % 64) == 0)) // timer irq, 3 times per given vblank field
412      timer.machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xcf);
412      machine().device("maincpu")->execute().set_input_line_and_vector(0, HOLD_LINE,0xcf);
413413}
414414
415415INTERRUPT_GEN_MEMBER(changela_state::chl_mcu_irq)
r18137r18138
503503
504504   MCFG_CPU_ADD("maincpu", Z80,5000000)
505505   MCFG_CPU_PROGRAM_MAP(changela_map)
506   MCFG_TIMER_ADD_SCANLINE("scantimer", changela_scanline, "screen", 0, 1)
506   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", changela_state, changela_scanline, "screen", 0, 1)
507507
508508   MCFG_CPU_ADD("mcu", M68705,2500000)
509509   MCFG_CPU_PROGRAM_MAP(mcu_map)
trunk/src/mame/drivers/gberet.c
r18137r18138
8282 *
8383 *************************************/
8484
85static TIMER_DEVICE_CALLBACK( gberet_interrupt_tick )
85TIMER_DEVICE_CALLBACK_MEMBER(gberet_state::gberet_interrupt_tick)
8686{
87   gberet_state *state = timer.machine().driver_data<gberet_state>();
88   UINT8 ticks_mask = ~state->m_interrupt_ticks & (state->m_interrupt_ticks + 1); // 0->1
89   state->m_interrupt_ticks++;
87   UINT8 ticks_mask = ~m_interrupt_ticks & (m_interrupt_ticks + 1); // 0->1
88   m_interrupt_ticks++;
9089
9190   // NMI on d0
92   if (ticks_mask & state->m_interrupt_mask & 1)
93      timer.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
91   if (ticks_mask & m_interrupt_mask & 1)
92      machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
9493
9594   // IRQ on d3 (used by mrgoemon)
96   if (ticks_mask & state->m_interrupt_mask<<2 & 8)
97      timer.machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
95   if (ticks_mask & m_interrupt_mask<<2 & 8)
96      machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
9897
9998   // IRQ on d4 (used by gberet)
100   if (ticks_mask & state->m_interrupt_mask<<2 & 16)
101      timer.machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
99   if (ticks_mask & m_interrupt_mask<<2 & 16)
100      machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
102101}
103102
104103
r18137r18138
423422   /* basic machine hardware */
424423   MCFG_CPU_ADD("maincpu", Z80, XTAL_18_432MHz/6)      // X1S (generated by a custom IC)
425424   MCFG_CPU_PROGRAM_MAP(gberet_map)
426   MCFG_TIMER_ADD_SCANLINE("scantimer", gberet_interrupt_tick, "screen", 0, 16) // ?
425   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", gberet_state, gberet_interrupt_tick, "screen", 0, 16)
427426
428427   MCFG_MACHINE_START_OVERRIDE(gberet_state,gberet)
429428   MCFG_MACHINE_RESET_OVERRIDE(gberet_state,gberet)
trunk/src/mame/drivers/nitedrvr.c
r18137r18138
143143   MCFG_WATCHDOG_VBLANK_INIT(3)
144144
145145
146   MCFG_TIMER_ADD_PERIODIC("crash_timer", nitedrvr_crash_toggle_callback, PERIOD_OF_555_ASTABLE(RES_K(180), 330, CAP_U(1)))
146   MCFG_TIMER_DRIVER_ADD_PERIODIC("crash_timer", nitedrvr_state, nitedrvr_crash_toggle_callback, PERIOD_OF_555_ASTABLE(RES_K(180), 330, CAP_U(1)))
147147
148148   /* video hardware */
149149   MCFG_SCREEN_ADD("screen", RASTER)
trunk/src/mame/drivers/sprint8.c
r18137r18138
2323}
2424
2525
26static TIMER_DEVICE_CALLBACK( input_callback )
26TIMER_DEVICE_CALLBACK_MEMBER(sprint8_state::input_callback)
2727{
28   sprint8_state *state = timer.machine().driver_data<sprint8_state>();
2928   static const char *const dialnames[] = { "DIAL1", "DIAL2", "DIAL3", "DIAL4", "DIAL5", "DIAL6", "DIAL7", "DIAL8" };
3029
3130   int i;
3231
3332   for (i = 0; i < 8; i++)
3433   {
35      UINT8 val = timer.machine().root_device().ioport(dialnames[i])->read() >> 4;
34      UINT8 val = machine().root_device().ioport(dialnames[i])->read() >> 4;
3635
37      signed char delta = (val - state->m_dial[i]) & 15;
36      signed char delta = (val - m_dial[i]) & 15;
3837
3938      if (delta & 8)
4039         delta |= 0xf0; /* extend sign to 8 bits */
4140
42      state->m_steer_flag[i] = (delta != 0);
41      m_steer_flag[i] = (delta != 0);
4342
4443      if (delta > 0)
45         state->m_steer_dir[i] = 0;
44         m_steer_dir[i] = 0;
4645
4746      if (delta < 0)
48         state->m_steer_dir[i] = 1;
47         m_steer_dir[i] = 1;
4948
50      state->m_dial[i] = val;
49      m_dial[i] = val;
5150   }
5251}
5352
r18137r18138
456455   MCFG_CPU_PROGRAM_MAP(sprint8_map)
457456
458457
459   MCFG_TIMER_ADD_PERIODIC("input_timer", input_callback, attotime::from_hz(60))
458   MCFG_TIMER_DRIVER_ADD_PERIODIC("input_timer", sprint8_state, input_callback, attotime::from_hz(60))
460459
461460   /* video hardware */
462461   MCFG_SCREEN_ADD("screen", RASTER)
trunk/src/mame/drivers/dbz.c
r18137r18138
6161
6262
6363
64static TIMER_DEVICE_CALLBACK( dbz_scanline )
64TIMER_DEVICE_CALLBACK_MEMBER(dbz_state::dbz_scanline)
6565{
66   dbz_state *state = timer.machine().driver_data<dbz_state>();
6766   int scanline = param;
6867
6968   if(scanline == 256) // vblank-out irq
70      timer.machine().device("maincpu")->execute().set_input_line(M68K_IRQ_2, ASSERT_LINE);
69      machine().device("maincpu")->execute().set_input_line(M68K_IRQ_2, ASSERT_LINE);
7170
72   if(scanline == 0 && k053246_is_irq_enabled(state->m_k053246)) // vblank-in irq
73      timer.machine().device("maincpu")->execute().set_input_line(M68K_IRQ_4, HOLD_LINE); //auto-acks apparently
71   if(scanline == 0 && k053246_is_irq_enabled(m_k053246)) // vblank-in irq
72      machine().device("maincpu")->execute().set_input_line(M68K_IRQ_4, HOLD_LINE); //auto-acks apparently
7473}
7574
7675#if 0
r18137r18138
383382   /* basic machine hardware */
384383   MCFG_CPU_ADD("maincpu", M68000, 16000000)
385384   MCFG_CPU_PROGRAM_MAP(dbz_map)
386   MCFG_TIMER_ADD_SCANLINE("scantimer", dbz_scanline, "screen", 0, 1)
385   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", dbz_state, dbz_scanline, "screen", 0, 1)
387386
388387   MCFG_CPU_ADD("audiocpu", Z80, 4000000)
389388   MCFG_CPU_PROGRAM_MAP(dbz_sound_map)
trunk/src/mame/drivers/circus.c
r18137r18138
347347   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
348348MACHINE_CONFIG_END
349349
350static TIMER_DEVICE_CALLBACK( crash_scanline )
350TIMER_DEVICE_CALLBACK_MEMBER(circus_state::crash_scanline)
351351{
352352   int scanline = param;
353353
354354   if(scanline == 256 || scanline == 0) // vblank-out / in irq
355      timer.machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
355      machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
356356}
357357
358358static MACHINE_CONFIG_START( crash, circus_state )
r18137r18138
360360   /* basic machine hardware */
361361   MCFG_CPU_ADD("maincpu", M6502, XTAL_11_289MHz / 16) /* 705.562kHz */
362362   MCFG_CPU_PROGRAM_MAP(circus_map)
363   MCFG_TIMER_ADD_SCANLINE("scantimer", crash_scanline, "screen", 0, 1)
363   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", circus_state, crash_scanline, "screen", 0, 1)
364364
365365
366366   /* video hardware */
trunk/src/mame/drivers/galpani2.c
r18137r18138
542542
543543
544544/* CPU#1 Interrups , lev 3,4 & 5 are tested on power up. The rest is rte, but lev 6 */
545static TIMER_DEVICE_CALLBACK( galpani2_interrupt1 )
545TIMER_DEVICE_CALLBACK_MEMBER(galpani2_state::galpani2_interrupt1)
546546{
547   galpani2_state *state = timer.machine().driver_data<galpani2_state>();
548547   int scanline = param;
549548
550549   if(scanline == 240)
551       state->m_maincpu->set_input_line(5, HOLD_LINE);
550       m_maincpu->set_input_line(5, HOLD_LINE);
552551
553552   /* MCU related? */
554553   if(scanline == 128)
555554   {
556      state->m_maincpu->set_input_line(3, HOLD_LINE);
557      state->m_maincpu->set_input_line(4, HOLD_LINE);
555      m_maincpu->set_input_line(3, HOLD_LINE);
556      m_maincpu->set_input_line(4, HOLD_LINE);
558557   }
559558
560559   if(scanline == 0)
561       state->m_maincpu->set_input_line(6, HOLD_LINE); // hblank?
560       m_maincpu->set_input_line(6, HOLD_LINE); // hblank?
562561}
563562
564563/* CPU#2 interrupts, lev 3,4 & 5 are tested on power up. The rest is rte, but lev 7 */
565static TIMER_DEVICE_CALLBACK( galpani2_interrupt2 )
564TIMER_DEVICE_CALLBACK_MEMBER(galpani2_state::galpani2_interrupt2)
566565{
567   galpani2_state *state = timer.machine().driver_data<galpani2_state>();
568566   int scanline = param;
569567
570568   if(scanline == 240)
571      state->m_subcpu->set_input_line(5, HOLD_LINE);
569      m_subcpu->set_input_line(5, HOLD_LINE);
572570
573571   if(scanline == 128)
574      state->m_subcpu->set_input_line(4, HOLD_LINE);
572      m_subcpu->set_input_line(4, HOLD_LINE);
575573
576574   if(scanline == 0)
577      state->m_subcpu->set_input_line(3, HOLD_LINE);
575      m_subcpu->set_input_line(3, HOLD_LINE);
578576}
579577
580578static MACHINE_CONFIG_START( galpani2, galpani2_state )
r18137r18138
582580   /* basic machine hardware */
583581   MCFG_CPU_ADD("maincpu", M68000, XTAL_27MHz/2)      /* Confirmed on galpani2i PCB */
584582   MCFG_CPU_PROGRAM_MAP(galpani2_mem1)
585   MCFG_TIMER_ADD_SCANLINE("m_scantimer", galpani2_interrupt1, "screen", 0, 1)
583   MCFG_TIMER_DRIVER_ADD_SCANLINE("m_scantimer", galpani2_state, galpani2_interrupt1, "screen", 0, 1)
586584   //MCFG_QUANTUM_PERFECT_CPU("maincpu")
587585
588586   MCFG_CPU_ADD("sub", M68000, XTAL_27MHz/2)         /* Confirmed on galpani2i PCB */
589587   MCFG_CPU_PROGRAM_MAP(galpani2_mem2)
590   MCFG_TIMER_ADD_SCANLINE("s_scantimer", galpani2_interrupt2, "screen", 0, 1)
588   MCFG_TIMER_DRIVER_ADD_SCANLINE("s_scantimer", galpani2_state, galpani2_interrupt2, "screen", 0, 1)
591589
592590   MCFG_EEPROM_93C46_ADD("eeprom")
593591
trunk/src/mame/drivers/dragrace.c
r18137r18138
1010#include "sound/discrete.h"
1111
1212
13static TIMER_DEVICE_CALLBACK( dragrace_frame_callback )
13TIMER_DEVICE_CALLBACK_MEMBER(dragrace_state::dragrace_frame_callback)
1414{
15   dragrace_state *state = timer.machine().driver_data<dragrace_state>();
1615   int i;
1716   static const char *const portnames[] = { "P1", "P2" };
1817
1918   for (i = 0; i < 2; i++)
2019   {
21      switch (timer.machine().root_device().ioport(portnames[i])->read())
20      switch (machine().root_device().ioport(portnames[i])->read())
2221      {
23      case 0x01: state->m_gear[i] = 1; break;
24      case 0x02: state->m_gear[i] = 2; break;
25      case 0x04: state->m_gear[i] = 3; break;
26      case 0x08: state->m_gear[i] = 4; break;
27      case 0x10: state->m_gear[i] = 0; break;
22      case 0x01: m_gear[i] = 1; break;
23      case 0x02: m_gear[i] = 2; break;
24      case 0x04: m_gear[i] = 3; break;
25      case 0x08: m_gear[i] = 4; break;
26      case 0x10: m_gear[i] = 0; break;
2827      }
2928   }
3029
3130   /* watchdog is disabled during service mode */
32   timer.machine().watchdog_enable(timer.machine().root_device().ioport("IN0")->read() & 0x20);
31   machine().watchdog_enable(machine().root_device().ioport("IN0")->read() & 0x20);
3332}
3433
3534
r18137r18138
336335   MCFG_WATCHDOG_VBLANK_INIT(8)
337336
338337
339   MCFG_TIMER_ADD_PERIODIC("frame_timer", dragrace_frame_callback, attotime::from_hz(60))
338   MCFG_TIMER_DRIVER_ADD_PERIODIC("frame_timer", dragrace_state, dragrace_frame_callback, attotime::from_hz(60))
340339
341340   /* video hardware */
342341   MCFG_SCREEN_ADD("screen", RASTER)
trunk/src/mame/drivers/coolpool.c
r18137r18138
155155 *
156156 *************************************/
157157
158static TIMER_DEVICE_CALLBACK( nvram_write_timeout )
158TIMER_DEVICE_CALLBACK_MEMBER(coolpool_state::nvram_write_timeout)
159159{
160   coolpool_state *state = timer.machine().driver_data<coolpool_state>();
161   state->m_nvram_write_enable = 0;
160   m_nvram_write_enable = 0;
162161}
163162
164163
r18137r18138
205204 *
206205 *************************************/
207206
208static TIMER_DEVICE_CALLBACK( amerdart_audio_int_gen )
207TIMER_DEVICE_CALLBACK_MEMBER(coolpool_state::amerdart_audio_int_gen)
209208{
210   coolpool_state *state = timer.machine().driver_data<coolpool_state>();
211
212   state->m_dsp->execute().set_input_line(0, ASSERT_LINE);
213   state->m_dsp->execute().set_input_line(0, CLEAR_LINE);
209   m_dsp->execute().set_input_line(0, ASSERT_LINE);
210   m_dsp->execute().set_input_line(0, CLEAR_LINE);
214211}
215212
216213
r18137r18138
858855   MCFG_CPU_PROGRAM_MAP(amerdart_dsp_pgm_map)
859856   /* Data Map is internal to the CPU */
860857   MCFG_CPU_IO_MAP(amerdart_dsp_io_map)
861   MCFG_TIMER_ADD_SCANLINE("audioint", amerdart_audio_int_gen, "screen", 0, 1)
858   MCFG_TIMER_DRIVER_ADD_SCANLINE("audioint", coolpool_state, amerdart_audio_int_gen, "screen", 0, 1)
862859
863860   MCFG_MACHINE_RESET_OVERRIDE(coolpool_state,amerdart)
864861   MCFG_NVRAM_ADD_0FILL("nvram")
865862
866   MCFG_TIMER_ADD("nvram_timer", nvram_write_timeout)
863   MCFG_TIMER_DRIVER_ADD("nvram_timer", coolpool_state, nvram_write_timeout)
867864
868865   /* video hardware */
869866   MCFG_SCREEN_ADD("screen", RASTER)
r18137r18138
892889   MCFG_MACHINE_RESET_OVERRIDE(coolpool_state,coolpool)
893890   MCFG_NVRAM_ADD_0FILL("nvram")
894891
895   MCFG_TIMER_ADD("nvram_timer", nvram_write_timeout)
892   MCFG_TIMER_DRIVER_ADD("nvram_timer", coolpool_state, nvram_write_timeout)
896893
897894   /* video hardware */
898895   MCFG_TLC34076_ADD("tlc34076", tlc34076_6_bit_intf)
trunk/src/mame/drivers/nemesis.c
r18137r18138
7070      device.execute().set_input_line(2, HOLD_LINE);
7171}
7272
73static TIMER_DEVICE_CALLBACK( konamigt_interrupt )
73TIMER_DEVICE_CALLBACK_MEMBER(nemesis_state::konamigt_interrupt)
7474{
75   nemesis_state *state = timer.machine().driver_data<nemesis_state>();
7675   int scanline = param;
7776
78   if (scanline == 240 && state->m_irq_on && (timer.machine().primary_screen->frame_number() & 1) == 0)
79      state->m_maincpu->set_input_line(1, HOLD_LINE);
77   if (scanline == 240 && m_irq_on && (machine().primary_screen->frame_number() & 1) == 0)
78      m_maincpu->set_input_line(1, HOLD_LINE);
8079
81   if (scanline == 0 && state->m_irq2_on)
82      state->m_maincpu->set_input_line(2, HOLD_LINE);
80   if (scanline == 0 && m_irq2_on)
81      m_maincpu->set_input_line(2, HOLD_LINE);
8382}
8483
85static TIMER_DEVICE_CALLBACK( gx400_interrupt )
84TIMER_DEVICE_CALLBACK_MEMBER(nemesis_state::gx400_interrupt)
8685{
87   nemesis_state *state = timer.machine().driver_data<nemesis_state>();
8886   int scanline = param;
8987
90   if (scanline == 240 && state->m_irq1_on && (timer.machine().primary_screen->frame_number() & 1) == 0)
91      state->m_maincpu->set_input_line(1, HOLD_LINE);
88   if (scanline == 240 && m_irq1_on && (machine().primary_screen->frame_number() & 1) == 0)
89      m_maincpu->set_input_line(1, HOLD_LINE);
9290
93   if (scanline == 0 && state->m_irq2_on)
94      state->m_maincpu->set_input_line(2, HOLD_LINE);
91   if (scanline == 0 && m_irq2_on)
92      m_maincpu->set_input_line(2, HOLD_LINE);
9593
96   if (scanline == 120 && state->m_irq4_on)
97      state->m_maincpu->set_input_line(4, HOLD_LINE);
94   if (scanline == 120 && m_irq4_on)
95      m_maincpu->set_input_line(4, HOLD_LINE);
9896}
9997
10098
r18137r18138
15981596   /* basic machine hardware */
15991597   MCFG_CPU_ADD("maincpu", M68000,18432000/2)     /* 9.216MHz */
16001598   MCFG_CPU_PROGRAM_MAP(gx400_map)
1601   MCFG_TIMER_ADD_SCANLINE("scantimer", gx400_interrupt, "screen", 0, 1)
1599   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nemesis_state, gx400_interrupt, "screen", 0, 1)
16021600
16031601   MCFG_CPU_ADD("audiocpu", Z80,14318180/4)        /* 3.579545 MHz */
16041602   MCFG_CPU_PROGRAM_MAP(gx400_sound_map)
r18137r18138
16411639   /* basic machine hardware */
16421640   MCFG_CPU_ADD("maincpu", M68000,18432000/2)         /* 9.216 MHz? */
16431641   MCFG_CPU_PROGRAM_MAP(konamigt_map)
1644   MCFG_TIMER_ADD_SCANLINE("scantimer", konamigt_interrupt, "screen", 0, 1)
1642   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nemesis_state, konamigt_interrupt, "screen", 0, 1)
16451643
16461644   MCFG_CPU_ADD("audiocpu", Z80,14318180/4)        /* 3.579545 MHz */
16471645   MCFG_CPU_PROGRAM_MAP(sound_map)
r18137r18138
16801678   /* basic machine hardware */
16811679   MCFG_CPU_ADD("maincpu", M68000,18432000/2)     /* 9.216MHz */
16821680   MCFG_CPU_PROGRAM_MAP(rf2_gx400_map)
1683   MCFG_TIMER_ADD_SCANLINE("scantimer", gx400_interrupt, "screen", 0, 1)
1681   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nemesis_state, gx400_interrupt, "screen", 0, 1)
16841682
16851683   MCFG_CPU_ADD("audiocpu", Z80,14318180/4)        /* 3.579545 MHz */
16861684   MCFG_CPU_PROGRAM_MAP(gx400_sound_map)
r18137r18138
19031901   /* basic machine hardware */
19041902   MCFG_CPU_ADD("maincpu", M68000,18432000/3)         /* 6.144MHz */
19051903   MCFG_CPU_PROGRAM_MAP(hcrash_map)
1906   MCFG_TIMER_ADD_SCANLINE("scantimer", konamigt_interrupt, "screen", 0, 1)
1904   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nemesis_state, konamigt_interrupt, "screen", 0, 1)
19071905
19081906   MCFG_CPU_ADD("audiocpu", Z80,14318180/4)       /* 3.579545 MHz */
19091907   MCFG_CPU_PROGRAM_MAP(sal_sound_map)
r18137r18138
26482646   /* basic machine hardware */
26492647   MCFG_CPU_ADD("maincpu", M68000,18432000/2)     /* 9.216MHz */
26502648   MCFG_CPU_PROGRAM_MAP(gx400_map)
2651//  MCFG_TIMER_ADD_SCANLINE("scantimer", gx400_interrupt, "screen", 0, 1)
2649   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", nemesis_state, gx400_interrupt, "screen", 0, 1)
26522650   MCFG_DEVICE_DISABLE()
26532651
26542652   MCFG_CPU_ADD("audiocpu", Z80,14318180/4)        /* 3.579545 MHz */
trunk/src/mame/drivers/suprnova.c
r18137r18138
416416/* start old driver code */
417417
418418
419static TIMER_DEVICE_CALLBACK( interrupt_callback )
419TIMER_DEVICE_CALLBACK_MEMBER(skns_state::interrupt_callback)
420420{
421   timer.machine().device("maincpu")->execute().set_input_line(param, HOLD_LINE);
421   machine().device("maincpu")->execute().set_input_line(param, HOLD_LINE);
422422}
423423
424424void skns_state::machine_reset()
r18137r18138
434434}
435435
436436
437static TIMER_DEVICE_CALLBACK(skns_irq)
437TIMER_DEVICE_CALLBACK_MEMBER(skns_state::skns_irq)
438438{
439   skns_state *state = timer.machine().driver_data<skns_state>();
440439   int scanline = param;
441440
442441   if(scanline == 240)
443      state->m_maincpu->set_input_line(5,HOLD_LINE); //vblank
442      m_maincpu->set_input_line(5,HOLD_LINE); //vblank
444443   else if(scanline == 0)
445      state->m_maincpu->set_input_line(1,HOLD_LINE); // spc
444      m_maincpu->set_input_line(1,HOLD_LINE); // spc
446445}
447446
448447/**********************************************************************************
r18137r18138
757756static MACHINE_CONFIG_START( skns, skns_state )
758757   MCFG_CPU_ADD("maincpu", SH2,28638000)
759758   MCFG_CPU_PROGRAM_MAP(skns_map)
760   MCFG_TIMER_ADD_SCANLINE("scantimer", skns_irq, "screen", 0, 1)
759   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", skns_state, skns_irq, "screen", 0, 1)
761760
762761   MCFG_MSM6242_ADD("rtc", rtc_intf)
763762
764763   MCFG_NVRAM_ADD_1FILL("nvram")
765764
766   MCFG_TIMER_ADD_PERIODIC("int15_timer", interrupt_callback, attotime::from_msec(2))
765   MCFG_TIMER_DRIVER_ADD_PERIODIC("int15_timer", skns_state, interrupt_callback, attotime::from_msec(2))
767766   MCFG_TIMER_PARAM(15)
768   MCFG_TIMER_ADD_PERIODIC("int11_timer", interrupt_callback, attotime::from_msec(8))
767   MCFG_TIMER_DRIVER_ADD_PERIODIC("int11_timer", skns_state, interrupt_callback, attotime::from_msec(8))
769768   MCFG_TIMER_PARAM(11)
770   MCFG_TIMER_ADD_PERIODIC("int9_timer", interrupt_callback, attotime::from_hz(28638000/1824))
769   MCFG_TIMER_DRIVER_ADD_PERIODIC("int9_timer", skns_state, interrupt_callback, attotime::from_hz(28638000/1824))
771770   MCFG_TIMER_PARAM(9)
772771
773772   MCFG_VIDEO_ATTRIBUTES(VIDEO_ALWAYS_UPDATE)
trunk/src/mame/drivers/galpanic.c
r18137r18138
134134   }
135135}
136136
137static TIMER_DEVICE_CALLBACK( galpanic_scanline )
137TIMER_DEVICE_CALLBACK_MEMBER(galpanic_state::galpanic_scanline)
138138{
139139   int scanline = param;
140140
141141   if(scanline == 224) // vblank-out irq
142      timer.machine().device("maincpu")->execute().set_input_line(3, HOLD_LINE);
142      machine().device("maincpu")->execute().set_input_line(3, HOLD_LINE);
143143
144144   /* Pandora "sprite end dma" irq? */
145145   if(scanline == 32)
146      timer.machine().device("maincpu")->execute().set_input_line(5, HOLD_LINE);
146      machine().device("maincpu")->execute().set_input_line(5, HOLD_LINE);
147147}
148148
149149
150static TIMER_DEVICE_CALLBACK( galhustl_scanline )
150TIMER_DEVICE_CALLBACK_MEMBER(galpanic_state::galhustl_scanline)
151151{
152152   int scanline = param;
153153
154154   if(scanline == 224) // vblank-out irq
155      timer.machine().device("maincpu")->execute().set_input_line(3, HOLD_LINE);
155      machine().device("maincpu")->execute().set_input_line(3, HOLD_LINE);
156156
157157   /* Pandora "sprite end dma" irq? */
158158   if(scanline == 32)
159      timer.machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE);
159      machine().device("maincpu")->execute().set_input_line(4, HOLD_LINE);
160160
161161   if(scanline == 0) // timer irq?
162      timer.machine().device("maincpu")->execute().set_input_line(5, HOLD_LINE);
162      machine().device("maincpu")->execute().set_input_line(5, HOLD_LINE);
163163}
164164
165165
r18137r18138
559559   /* basic machine hardware */
560560   MCFG_CPU_ADD("maincpu", M68000, XTAL_12MHz) /* verified on pcb */
561561   MCFG_CPU_PROGRAM_MAP(galpanic_map)
562   MCFG_TIMER_ADD_SCANLINE("scantimer", galpanic_scanline, "screen", 0, 1)
562   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", galpanic_state, galpanic_scanline, "screen", 0, 1)
563563
564564   /* video hardware */
565565   MCFG_SCREEN_ADD("screen", RASTER)
r18137r18138
621621   MCFG_CPU_MODIFY("maincpu")
622622   MCFG_CPU_CLOCK(12000000)   /* ? */
623623   MCFG_CPU_PROGRAM_MAP(supmodel_map)
624//  MCFG_TIMER_ADD_SCANLINE("scantimer", galpanic_scanline, "screen", 0, 1)
624   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", galpanic_state, galpanic_scanline, "screen", 0, 1)
625625
626626   /* video hardware */
627627   MCFG_SCREEN_MODIFY("screen")
r18137r18138
654654   MCFG_CPU_CLOCK(12000000)   /* ? */
655655   MCFG_CPU_PROGRAM_MAP(galhustl_map)
656656   MCFG_TIMER_MODIFY("scantimer")
657   MCFG_TIMER_CALLBACK(galhustl_scanline)
657   MCFG_TIMER_DRIVER_CALLBACK(galpanic_state, galhustl_scanline)
658658
659659   /* video hardware */
660660   MCFG_SCREEN_MODIFY("screen")
r18137r18138
673673   MCFG_CPU_CLOCK(12000000)   /* ? */
674674   MCFG_CPU_PROGRAM_MAP(zipzap_map)
675675   MCFG_TIMER_MODIFY("scantimer")
676   MCFG_TIMER_CALLBACK(galhustl_scanline)
676   MCFG_TIMER_DRIVER_CALLBACK(galpanic_state, galhustl_scanline)
677677
678678   /* video hardware */
679679   MCFG_SCREEN_MODIFY("screen")
trunk/src/mame/drivers/finalizr.c
r18137r18138
2222
2323
2424
25static TIMER_DEVICE_CALLBACK( finalizr_scanline )
25TIMER_DEVICE_CALLBACK_MEMBER(finalizr_state::finalizr_scanline)
2626{
27   finalizr_state *state = timer.machine().driver_data<finalizr_state>();
2827   int scanline = param;
2928
30   if(scanline == 240 && state->m_irq_enable) // vblank irq
31      timer.machine().device("maincpu")->execute().set_input_line(M6809_IRQ_LINE, HOLD_LINE);
32   else if(((scanline % 32) == 0) && state->m_nmi_enable) // timer irq
33      timer.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
29   if(scanline == 240 && m_irq_enable) // vblank irq
30      machine().device("maincpu")->execute().set_input_line(M6809_IRQ_LINE, HOLD_LINE);
31   else if(((scanline % 32) == 0) && m_nmi_enable) // timer irq
32      machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
3433}
3534
3635
r18137r18138
279278   /* basic machine hardware */
280279   MCFG_CPU_ADD("maincpu", M6809,XTAL_18_432MHz/6)   /* ??? */
281280   MCFG_CPU_PROGRAM_MAP(main_map)
282   MCFG_TIMER_ADD_SCANLINE("scantimer", finalizr_scanline, "screen", 0, 1)
281   MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", finalizr_state, finalizr_scanline, "screen", 0, 1)
283282
284283   MCFG_CPU_ADD("audiocpu", I8039,XTAL_18_432MHz/2)   /* 9.216MHz clkin ?? */
285284   MCFG_CPU_PROGRAM_MAP(sound_map)
trunk/src/mame/audio/n8080.c
r18137r18138
426426}
427427
428428
429static TIMER_DEVICE_CALLBACK( spacefev_vco_voltage_timer )
429TIMER_DEVICE_CALLBACK_MEMBER(n8080_state::spacefev_vco_voltage_timer)
430430{
431   device_t *sn = timer.machine().device("snsnd");
432   n8080_state *state = timer.machine().driver_data<n8080_state>();
431   device_t *sn = machine().device("snsnd");
433432   double voltage = 0;
434433
435   if (state->m_mono_flop[2])
434   if (m_mono_flop[2])
436435   {
437      voltage = 5 * (1 - exp(- state->m_sound_timer[2]->elapsed().as_double() / 0.22));
436      voltage = 5 * (1 - exp(- m_sound_timer[2]->elapsed().as_double() / 0.22));
438437   }
439438
440439   sn76477_vco_voltage_w(sn, voltage);
441440}
442441
443442
444static TIMER_DEVICE_CALLBACK( helifire_dac_volume_timer )
443TIMER_DEVICE_CALLBACK_MEMBER(n8080_state::helifire_dac_volume_timer)
445444{
446   n8080_state *state = timer.machine().driver_data<n8080_state>();
447   double t = state->m_helifire_dac_timing - timer.machine().time().as_double();
445   double t = m_helifire_dac_timing - machine().time().as_double();
448446
449   if (state->m_helifire_dac_phase)
447   if (m_helifire_dac_phase)
450448   {
451      state->m_helifire_dac_volume = 1 - exp(t / ATTACK_RATE);
449      m_helifire_dac_volume = 1 - exp(t / ATTACK_RATE);
452450   }
453451   else
454452   {
455      state->m_helifire_dac_volume = exp(t / DECAY_RATE);
453      m_helifire_dac_volume = exp(t / DECAY_RATE);
456454   }
457455}
458456
r18137r18138
577575   MCFG_CPU_PROGRAM_MAP(n8080_sound_cpu_map)
578576   MCFG_CPU_IO_MAP(n8080_sound_io_map)
579577
580   MCFG_TIMER_ADD_PERIODIC("vco_timer", spacefev_vco_voltage_timer, attotime::from_hz(1000))
578   MCFG_TIMER_DRIVER_ADD_PERIODIC("vco_timer", n8080_state, spacefev_vco_voltage_timer, attotime::from_hz(1000))
581579
582580   /* sound hardware */
583581   MCFG_SPEAKER_STANDARD_MONO("mono")
r18137r18138
617615   MCFG_CPU_PROGRAM_MAP(n8080_sound_cpu_map)
618616   MCFG_CPU_IO_MAP(helifire_sound_io_map)
619617
620   MCFG_TIMER_ADD_PERIODIC("helifire_dac", helifire_dac_volume_timer, attotime::from_hz(1000) )
618   MCFG_TIMER_DRIVER_ADD_PERIODIC("helifire_dac", n8080_state, helifire_dac_volume_timer, attotime::from_hz(1000))
621619
622620   /* sound hardware */
623621   MCFG_SPEAKER_STANDARD_MONO("mono")
trunk/src/mame/audio/8080bw.c
r18137r18138
869869}
870870
871871
872TIMER_DEVICE_CALLBACK( schaser_effect_555_cb )
872TIMER_DEVICE_CALLBACK_MEMBER(_8080bw_state::schaser_effect_555_cb)
873873{
874   _8080bw_state *state = timer.machine().driver_data<_8080bw_state>();
875874   int effect = param;
876875   attotime new_time;
877876
878877   /* Toggle 555 output */
879   state->m_schaser_effect_555_is_low = !state->m_schaser_effect_555_is_low;
880   state->m_schaser_effect_555_time_remain = attotime::zero;
881   state->m_schaser_effect_555_time_remain_savable = state->m_schaser_effect_555_time_remain.as_double();
878   m_schaser_effect_555_is_low = !m_schaser_effect_555_is_low;
879   m_schaser_effect_555_time_remain = attotime::zero;
880   m_schaser_effect_555_time_remain_savable = m_schaser_effect_555_time_remain.as_double();
882881
883   if (state->m_schaser_effect_555_is_low)
882   if (m_schaser_effect_555_is_low)
884883      new_time = PERIOD_OF_555_ASTABLE(0, RES_K(20), CAP_U(1)) / 2;
885884   else
886885   {
r18137r18138
889888      else
890889         new_time = attotime::never;
891890   }
892   state->m_schaser_effect_555_timer->adjust(new_time, effect);
893   sn76477_enable_w(state->m_sn, !(state->m_schaser_effect_555_is_low || state->m_schaser_explosion));
894   sn76477_one_shot_cap_voltage_w(state->m_sn, !(state->m_schaser_effect_555_is_low || state->m_schaser_explosion) ? 0 : SN76477_EXTERNAL_VOLTAGE_DISCONNECT);
891   m_schaser_effect_555_timer->adjust(new_time, effect);
892   sn76477_enable_w(m_sn, !(m_schaser_effect_555_is_low || m_schaser_explosion));
893   sn76477_one_shot_cap_voltage_w(m_sn, !(m_schaser_effect_555_is_low || m_schaser_explosion) ? 0 : SN76477_EXTERNAL_VOLTAGE_DISCONNECT);
895894}
896895
897896
trunk/src/mame/machine/galaxold.c
r18137r18138
4949}
5050
5151
52TIMER_DEVICE_CALLBACK( galaxold_interrupt_timer )
52TIMER_DEVICE_CALLBACK_MEMBER(galaxold_state::galaxold_interrupt_timer)
5353{
54    ttl7474_device *target = timer.machine().device<ttl7474_device>("7474_9m_2");
54    ttl7474_device *target = machine().device<ttl7474_device>("7474_9m_2");
5555
5656   /* 128V, 64V and 32V go to D */
5757   target->d_w(((param & 0xe0) != 0xe0) ? 1 : 0);
r18137r18138
6161
6262   param = (param + 0x10) & 0xff;
6363
64   timer.adjust(timer.machine().primary_screen->time_until_pos(param), param);
64   timer.adjust(machine().primary_screen->time_until_pos(param), param);
6565}
6666
6767
trunk/src/mame/machine/irobot.c
r18137r18138
6161      m_combase[BYTE_XOR_BE(offset & 0xFFF)] = data;
6262}
6363
64TIMER_DEVICE_CALLBACK( irobot_irvg_done_callback )
64TIMER_DEVICE_CALLBACK_MEMBER(irobot_state::irobot_irvg_done_callback)
6565{
66   irobot_state *state = timer.machine().driver_data<irobot_state>();
6766   logerror("vg done. ");
68   state->m_irvg_running = 0;
67   m_irvg_running = 0;
6968}
7069
7170WRITE8_MEMBER(irobot_state::irobot_statwr_w)
r18137r18138
412411   load_oproms(machine());
413412}
414413
415TIMER_DEVICE_CALLBACK( irobot_irmb_done_callback )
414TIMER_DEVICE_CALLBACK_MEMBER(irobot_state::irobot_irmb_done_callback)
416415{
417   irobot_state *state = timer.machine().driver_data<irobot_state>();
418416   logerror("mb done. ");
419   state->m_irmb_running = 0;
420   timer.machine().device("maincpu")->execute().set_input_line(M6809_FIRQ_LINE, ASSERT_LINE);
417   m_irmb_running = 0;
418   machine().device("maincpu")->execute().set_input_line(M6809_FIRQ_LINE, ASSERT_LINE);
421419}
422420
423421
trunk/src/mame/machine/williams.c
r18137r18138
253253 *
254254 *************************************/
255255
256TIMER_DEVICE_CALLBACK( williams_va11_callback )
256TIMER_DEVICE_CALLBACK_MEMBER(williams_state::williams_va11_callback)
257257{
258   pia6821_device *pia_1 = timer.machine().device<pia6821_device>("pia_1");
258   pia6821_device *pia_1 = machine().device<pia6821_device>("pia_1");
259259   int scanline = param;
260260
261261   /* the IRQ signal comes into CB1, and is set to VA11 */
r18137r18138
264264   /* set a timer for the next update */
265265   scanline += 0x20;
266266   if (scanline >= 256) scanline = 0;
267   timer.adjust(timer.machine().primary_screen->time_until_pos(scanline), scanline);
267   timer.adjust(machine().primary_screen->time_until_pos(scanline), scanline);
268268}
269269
270270
r18137r18138
277277}
278278
279279
280TIMER_DEVICE_CALLBACK( williams_count240_callback )
280TIMER_DEVICE_CALLBACK_MEMBER(williams_state::williams_count240_callback)
281281{
282   williams_state *state = timer.machine().driver_data<williams_state>();
283   pia6821_device *pia_1 = timer.machine().device<pia6821_device>("pia_1");
282   pia6821_device *pia_1 = machine().device<pia6821_device>("pia_1");
284283
285284   /* the COUNT240 signal comes into CA1, and is set to the logical AND of VA10-VA13 */
286285   pia_1->ca1_w(1);
287286
288287   /* set a timer to turn it off once the scanline counter resets */
289   timer.machine().scheduler().timer_set(timer.machine().primary_screen->time_until_pos(0), timer_expired_delegate(FUNC(williams_state::williams_count240_off_callback),state));
288   machine().scheduler().timer_set(machine().primary_screen->time_until_pos(0), timer_expired_delegate(FUNC(williams_state::williams_count240_off_callback),this));
290289
291290   /* set a timer for next frame */
292   timer.adjust(timer.machine().primary_screen->time_until_pos(240));
291   timer.adjust(machine().primary_screen->time_until_pos(240));
293292}
294293
295294
r18137r18138
406405 *
407406 *************************************/
408407
409TIMER_DEVICE_CALLBACK( williams2_va11_callback )
408TIMER_DEVICE_CALLBACK_MEMBER(williams_state::williams2_va11_callback)
410409{
411   pia6821_device *pia_0 = timer.machine().device<pia6821_device>("pia_0");
412   pia6821_device *pia_1 = timer.machine().device<pia6821_device>("pia_1");
410   pia6821_device *pia_0 = machine().device<pia6821_device>("pia_0");
411   pia6821_device *pia_1 = machine().device<pia6821_device>("pia_1");
413412   int scanline = param;
414413
415414   /* the IRQ signal comes into CB1, and is set to VA11 */
r18137r18138
419418   /* set a timer for the next update */
420419   scanline += 0x20;
421420   if (scanline >= 256) scanline = 0;
422   timer.adjust(timer.machine().primary_screen->time_until_pos(scanline), scanline);
421   timer.adjust(machine().primary_screen->time_until_pos(scanline), scanline);
423422}
424423
425424
r18137r18138
432431}
433432
434433
435TIMER_DEVICE_CALLBACK( williams2_endscreen_callback )
434TIMER_DEVICE_CALLBACK_MEMBER(williams_state::williams2_endscreen_callback)
436435{
437   williams_state *state = timer.machine().driver_data<williams_state>();
438   pia6821_device *pia_0 = timer.machine().device<pia6821_device>("pia_0");
436   pia6821_device *pia_0 = machine().device<pia6821_device>("pia_0");
439437
440438   /* the /ENDSCREEN signal comes into CA1 */
441439   pia_0->ca1_w(0);
442440
443441   /* set a timer to turn it off once the scanline counter resets */
444   timer.machine().scheduler().timer_set(timer.machine().primary_screen->time_until_pos(8), timer_expired_delegate(FUNC(williams_state::williams2_endscreen_off_callback),state));
442   machine().scheduler().timer_set(machine().primary_screen->time_until_pos(8), timer_expired_delegate(FUNC(williams_state::williams2_endscreen_off_callback),this));
445443
446444   /* set a timer for next frame */
447   timer.adjust(timer.machine().primary_screen->time_until_pos(254));
445   timer.adjust(machine().primary_screen->time_until_pos(254));
448446}
449447
450448
trunk/src/mame/machine/gaelco2.c
r18137r18138
186186   m_clr_gun_int = 1;
187187}
188188
189TIMER_DEVICE_CALLBACK( bang_irq )
189TIMER_DEVICE_CALLBACK_MEMBER(gaelco2_state::bang_irq)
190190{
191   gaelco2_state *state = timer.machine().driver_data<gaelco2_state>();
192191   int scanline = param;
193192
194193   if (scanline == 256){
195      state->m_maincpu->set_input_line(2, HOLD_LINE);
196      state->m_clr_gun_int = 0;
194      m_maincpu->set_input_line(2, HOLD_LINE);
195      m_clr_gun_int = 0;
197196   }
198197
199   if ((scanline % 64) == 0 && state->m_clr_gun_int)
200      state->m_maincpu->set_input_line(4, HOLD_LINE);
198   if ((scanline % 64) == 0 && m_clr_gun_int)
199      m_maincpu->set_input_line(4, HOLD_LINE);
201200}
202201
203202/***************************************************************************
trunk/src/mame/machine/nitedrvr.c
r18137r18138
248248}
249249
250250
251TIMER_DEVICE_CALLBACK( nitedrvr_crash_toggle_callback )
251TIMER_DEVICE_CALLBACK_MEMBER(nitedrvr_state::nitedrvr_crash_toggle_callback)
252252{
253   nitedrvr_state *state = timer.machine().driver_data<nitedrvr_state>();
254
255   if (state->m_crash_en && state->m_crash_data_en)
253   if (m_crash_en && m_crash_data_en)
256254   {
257      state->m_crash_data--;
258      address_space &space = timer.machine().driver_data()->generic_space();
259      discrete_sound_w(state->m_discrete, space, NITEDRVR_BANG_DATA, state->m_crash_data);   // Crash Volume
260      if (!state->m_crash_data)
261         state->m_crash_data_en = 0;   // Done counting?
255      m_crash_data--;
256      address_space &space = machine().driver_data()->generic_space();
257      discrete_sound_w(m_discrete, space, NITEDRVR_BANG_DATA, m_crash_data);   // Crash Volume
258      if (!m_crash_data)
259         m_crash_data_en = 0;   // Done counting?
262260
263      if (state->m_crash_data & 0x01)
261      if (m_crash_data & 0x01)
264262      {
265263         /* Invert video */
266         palette_set_color(timer.machine(), 1, MAKE_RGB(0x00,0x00,0x00)); /* BLACK */
267         palette_set_color(timer.machine(), 0, MAKE_RGB(0xff,0xff,0xff)); /* WHITE */
264         palette_set_color(machine(), 1, MAKE_RGB(0x00,0x00,0x00)); /* BLACK */
265         palette_set_color(machine(), 0, MAKE_RGB(0xff,0xff,0xff)); /* WHITE */
268266      }
269267      else
270268      {
271269         /* Normal video */
272         palette_set_color(timer.machine(), 0, MAKE_RGB(0x00,0x00,0x00)); /* BLACK */
273         palette_set_color(timer.machine(), 1, MAKE_RGB(0xff,0xff,0xff)); /* WHITE */
270         palette_set_color(machine(), 0, MAKE_RGB(0x00,0x00,0x00)); /* BLACK */
271         palette_set_color(machine(), 1, MAKE_RGB(0xff,0xff,0xff)); /* WHITE */
274272      }
275273   }
276274}
trunk/src/mame/machine/balsente.c
r18137r18138
3434}
3535
3636
37TIMER_DEVICE_CALLBACK( balsente_interrupt_timer )
37TIMER_DEVICE_CALLBACK_MEMBER(balsente_state::balsente_interrupt_timer)
3838{
39   balsente_state *state = timer.machine().driver_data<balsente_state>();
40
4139   /* next interrupt after scanline 256 is scanline 64 */
4240   if (param == 256)
43      state->m_scanline_timer->adjust(timer.machine().primary_screen->time_until_pos(64), 64);
41      m_scanline_timer->adjust(machine().primary_screen->time_until_pos(64), 64);
4442   else
45      state->m_scanline_timer->adjust(timer.machine().primary_screen->time_until_pos(param + 64), param + 64);
43      m_scanline_timer->adjust(machine().primary_screen->time_until_pos(param + 64), param + 64);
4644
4745   /* IRQ starts on scanline 0, 64, 128, etc. */
48   timer.machine().device("maincpu")->execute().set_input_line(M6809_IRQ_LINE, ASSERT_LINE);
46   machine().device("maincpu")->execute().set_input_line(M6809_IRQ_LINE, ASSERT_LINE);
4947
5048   /* it will turn off on the next HBLANK */
51   timer.machine().scheduler().timer_set(timer.machine().primary_screen->time_until_pos(param, BALSENTE_HBSTART), timer_expired_delegate(FUNC(balsente_state::irq_off),state));
49   machine().scheduler().timer_set(machine().primary_screen->time_until_pos(param, BALSENTE_HBSTART), timer_expired_delegate(FUNC(balsente_state::irq_off),this));
5250
5351   /* if this is Grudge Match, update the steering */
54   if (state->m_grudge_steering_result & 0x80)
55      update_grudge_steering(timer.machine());
52   if (m_grudge_steering_result & 0x80)
53      update_grudge_steering(machine());
5654
5755   /* if we're a shooter, we do a little more work */
58   if (state->m_shooter)
56   if (m_shooter)
5957   {
6058      UINT8 tempx, tempy;
6159
6260      /* we latch the beam values on the first interrupt after VBLANK */
6361      if (param == 64)
6462      {
65         state->m_shooter_x = timer.machine().root_device().ioport("FAKEX")->read();
66         state->m_shooter_y = timer.machine().root_device().ioport("FAKEY")->read();
63         m_shooter_x = machine().root_device().ioport("FAKEX")->read();
64         m_shooter_y = machine().root_device().ioport("FAKEY")->read();
6765      }
6866
6967      /* which bits get returned depends on which scanline we're at */
70      tempx = state->m_shooter_x << ((param - 64) / 64);
71      tempy = state->m_shooter_y << ((param - 64) / 64);
72      state->m_nstocker_bits = ((tempx >> 4) & 0x08) | ((tempx >> 1) & 0x04) |
68      tempx = m_shooter_x << ((param - 64) / 64);
69      tempy = m_shooter_y << ((param - 64) / 64);
70      m_nstocker_bits = ((tempx >> 4) & 0x08) | ((tempx >> 1) & 0x04) |
7371                        ((tempy >> 6) & 0x02) | ((tempy >> 3) & 0x01);
7472   }
7573}
r18137r18138
721719}
722720
723721
724TIMER_DEVICE_CALLBACK( balsente_counter_callback )
722TIMER_DEVICE_CALLBACK_MEMBER(balsente_state::balsente_counter_callback)
725723{
726   balsente_state *state = timer.machine().driver_data<balsente_state>();
727
728724   /* reset the counter and the count */
729   state->m_counter[param].timer_active = 0;
730   state->m_counter[param].count = 0;
725   m_counter[param].timer_active = 0;
726   m_counter[param].count = 0;
731727
732728   /* set the state of the OUT line */
733729   /* mode 0 and 1: when firing, transition OUT to high */
734   if (state->m_counter[param].mode == 0 || state->m_counter[param].mode == 1)
735      state->counter_set_out(param, 1);
730   if (m_counter[param].mode == 0 || m_counter[param].mode == 1)
731      counter_set_out(param, 1);
736732
737733   /* no other modes handled currently */
738734}
r18137r18138
867863      {
868864         state->m_counter[0].count--;
869865         if (state->m_counter[0].count == 0)
870            balsente_counter_callback(state, timer, NULL, 0);
866            state->balsente_counter_callback(timer, NULL, 0);
871867      }
872868   }
873869
r18137r18138
876872}
877873
878874
879TIMER_DEVICE_CALLBACK( balsente_clock_counter_0_ff )
875TIMER_DEVICE_CALLBACK_MEMBER(balsente_state::balsente_clock_counter_0_ff)
880876{
881   balsente_state *state = timer.machine().driver_data<balsente_state>();
882
883877   /* clock the D value through the flip-flop */
884   set_counter_0_ff(timer, (state->m_counter_control >> 3) & 1);
878   set_counter_0_ff(timer, (m_counter_control >> 3) & 1);
885879}
886880
887881
trunk/src/mame/machine/mhavoc.c
r18137r18138
1616 *
1717 *************************************/
1818
19TIMER_DEVICE_CALLBACK( mhavoc_cpu_irq_clock )
19TIMER_DEVICE_CALLBACK_MEMBER(mhavoc_state::mhavoc_cpu_irq_clock)
2020{
21   mhavoc_state *state = timer.machine().driver_data<mhavoc_state>();
2221   /* clock the LS161 driving the alpha CPU IRQ */
23   if (state->m_alpha_irq_clock_enable)
22   if (m_alpha_irq_clock_enable)
2423   {
25      state->m_alpha_irq_clock++;
26      if ((state->m_alpha_irq_clock & 0x0c) == 0x0c)
24      m_alpha_irq_clock++;
25      if ((m_alpha_irq_clock & 0x0c) == 0x0c)
2726      {
28         timer.machine().device("alpha")->execute().set_input_line(0, ASSERT_LINE);
29         state->m_alpha_irq_clock_enable = 0;
27         machine().device("alpha")->execute().set_input_line(0, ASSERT_LINE);
28         m_alpha_irq_clock_enable = 0;
3029      }
3130   }
3231
3332   /* clock the LS161 driving the gamma CPU IRQ */
34   if (state->m_has_gamma_cpu)
33   if (m_has_gamma_cpu)
3534   {
36      state->m_gamma_irq_clock++;
37      timer.machine().device("gamma")->execute().set_input_line(0, (state->m_gamma_irq_clock & 0x08) ? ASSERT_LINE : CLEAR_LINE);
35      m_gamma_irq_clock++;
36      machine().device("gamma")->execute().set_input_line(0, (m_gamma_irq_clock & 0x08) ? ASSERT_LINE : CLEAR_LINE);
3837   }
3938}
4039
trunk/src/mame/machine/bsktball.c
r18137r18138
1919    bsktball_interrupt
2020***************************************************************************/
2121/* NMI every 32V, IRQ every VBLANK */
22TIMER_DEVICE_CALLBACK( bsktball_scanline )
22TIMER_DEVICE_CALLBACK_MEMBER(bsktball_state::bsktball_scanline)
2323{
24   bsktball_state *state = timer.machine().driver_data<bsktball_state>();
2524   int scanline = param;
2625
2726   if(scanline == 0) // vblank irq
28      timer.machine().device("maincpu")->execute().set_input_line(0, HOLD_LINE);
29   else if(((scanline % 28) == 0) && (state->m_nmi_on)) // 32v timer irq
30      timer.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
27      machine().device("maincpu")->execute().set_input_line(0, HOLD_LINE);
28   else if(((scanline % 28) == 0) && (m_nmi_on)) // 32v timer irq
29      machine().device("maincpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
3130}
3231
3332
trunk/src/mame/machine/mcr.c
r18137r18138
182182 *
183183 *************************************/
184184
185TIMER_DEVICE_CALLBACK( mcr_interrupt )
185TIMER_DEVICE_CALLBACK_MEMBER(mcr_state::mcr_interrupt)
186186{
187   //mcr_state *state = timer.machine().driver_data<mcr_state>();
188   z80ctc_device *ctc = timer.machine().device<z80ctc_device>("ctc");
187   z80ctc_device *ctc = machine().device<z80ctc_device>("ctc");
189188   int scanline = param;
190189
191190   /* CTC line 2 is connected to VBLANK, which is once every 1/2 frame */
r18137r18138
205204   }
206205}
207206
208TIMER_DEVICE_CALLBACK( mcr_ipu_interrupt )
207TIMER_DEVICE_CALLBACK_MEMBER(mcr_state::mcr_ipu_interrupt)
209208{
210   //mcr_state *state = timer.machine().driver_data<mcr_state>();
211   z80ctc_device *ctc = timer.machine().device<z80ctc_device>("ctc");
209   z80ctc_device *ctc = machine().device<z80ctc_device>("ctc");
212210   int scanline = param;
213211
214212   /* CTC line 3 is connected to 493, which is signalled once every */
trunk/src/mame/machine/decocass.c
r18137r18138
9090   return data;
9191}
9292
93TIMER_DEVICE_CALLBACK( decocass_audio_nmi_gen )
93TIMER_DEVICE_CALLBACK_MEMBER(decocass_state::decocass_audio_nmi_gen)
9494{
95   decocass_state *state = timer.machine().driver_data<decocass_state>();
9695   int scanline = param;
97   state->m_audio_nmi_state = scanline & 8;
98   state->m_audiocpu->set_input_line(INPUT_LINE_NMI, (state->m_audio_nmi_enabled && state->m_audio_nmi_state) ? ASSERT_LINE : CLEAR_LINE);
96   m_audio_nmi_state = scanline & 8;
97   m_audiocpu->set_input_line(INPUT_LINE_NMI, (m_audio_nmi_enabled && m_audio_nmi_state) ? ASSERT_LINE : CLEAR_LINE);
9998}
10099
101100WRITE8_MEMBER(decocass_state::decocass_sound_nmi_enable_w)
trunk/src/mame/includes/lazercmd.h
r18137r18138
5757   virtual void machine_reset();
5858   virtual void palette_init();
5959   UINT32 screen_update_lazercmd(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
60   TIMER_DEVICE_CALLBACK_MEMBER(lazercmd_timer);
61   TIMER_DEVICE_CALLBACK_MEMBER(bbonk_timer);
6062};
trunk/src/mame/includes/jpmimpct.h
r18137r18138
108108   DECLARE_VIDEO_START(jpmimpct);
109109   DECLARE_MACHINE_START(impctawp);
110110   DECLARE_MACHINE_RESET(impctawp);
111   TIMER_DEVICE_CALLBACK_MEMBER(duart_1_timer_event);
111112};
112113
113114
trunk/src/mame/includes/system1.h
r18137r18138
108108   UINT32 screen_update_system2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
109109   UINT32 screen_update_system2_rowscroll(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
110110   INTERRUPT_GEN_MEMBER(mcu_irq_assert);
111   TIMER_DEVICE_CALLBACK_MEMBER(soundirq_gen);
112   TIMER_DEVICE_CALLBACK_MEMBER(mcu_t0_callback);
111113};
112114
113115
trunk/src/mame/includes/gberet.h
r18137r18138
5757   DECLARE_PALETTE_INIT(gberet);
5858   UINT32 screen_update_gberet(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5959   UINT32 screen_update_gberetb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
60   TIMER_DEVICE_CALLBACK_MEMBER(gberet_interrupt_tick);
6061};
trunk/src/mame/includes/namcofl.h
r18137r18138
6161   TIMER_CALLBACK_MEMBER(network_interrupt_callback);
6262   TIMER_CALLBACK_MEMBER(vblank_interrupt_callback);
6363   TIMER_CALLBACK_MEMBER(raster_interrupt_callback);
64   TIMER_DEVICE_CALLBACK_MEMBER(mcu_irq0_cb);
65   TIMER_DEVICE_CALLBACK_MEMBER(mcu_irq2_cb);
66   TIMER_DEVICE_CALLBACK_MEMBER(mcu_adc_cb);
6467};
trunk/src/mame/includes/ikki.h
r18137r18138
3636   virtual void video_start();
3737   virtual void palette_init();
3838   UINT32 screen_update_ikki(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
39   TIMER_DEVICE_CALLBACK_MEMBER(ikki_irq);
3940};
trunk/src/mame/includes/beathead.h
r18137r18138
115115   DECLARE_READ32_MEMBER( hsync_ram_r );
116116   DECLARE_WRITE32_MEMBER( hsync_ram_w );
117117   DECLARE_DRIVER_INIT(beathead);
118   TIMER_DEVICE_CALLBACK_MEMBER(scanline_callback);
118119};
trunk/src/mame/includes/ironhors.h
r18137r18138
5050   DECLARE_VIDEO_START(farwest);
5151   UINT32 screen_update_ironhors(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5252   UINT32 screen_update_farwest(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
53   TIMER_DEVICE_CALLBACK_MEMBER(ironhors_irq);
54   TIMER_DEVICE_CALLBACK_MEMBER(farwest_irq);
5355};
trunk/src/mame/includes/djboy.h
r18137r18138
7373   virtual void video_start();
7474   UINT32 screen_update_djboy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
7575   void screen_eof_djboy(screen_device &screen, bool state);
76   TIMER_DEVICE_CALLBACK_MEMBER(djboy_scanline);
7677};
trunk/src/mame/includes/circus.h
r18137r18138
4040   UINT32 screen_update_robotbwl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4141   UINT32 screen_update_crash(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4242   UINT32 screen_update_ripcord(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
43   TIMER_DEVICE_CALLBACK_MEMBER(crash_scanline);
4344};
4445/*----------- defined in audio/circus.c -----------*/
4546
trunk/src/mame/includes/wecleman.h
r18137r18138
7979   UINT32 screen_update_wecleman(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
8080   UINT32 screen_update_hotchase(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
8181   INTERRUPT_GEN_MEMBER(hotchase_sound_timer);
82   TIMER_DEVICE_CALLBACK_MEMBER(wecleman_scanline);
83   TIMER_DEVICE_CALLBACK_MEMBER(hotchase_scanline);
8284};
8385
8486/*----------- defined in video/wecleman.c -----------*/
trunk/src/mame/includes/lastduel.h
r18137r18138
6060   DECLARE_VIDEO_START(madgear);
6161   UINT32 screen_update_lastduel(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
6262   UINT32 screen_update_madgear(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
63   TIMER_DEVICE_CALLBACK_MEMBER(lastduel_timer_cb);
64   TIMER_DEVICE_CALLBACK_MEMBER(madgear_timer_cb);
6365};
trunk/src/mame/includes/cischeat.h
r18137r18138
8484   UINT32 screen_update_scudhamm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
8585   UINT32 screen_update_cischeat(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
8686   UINT32 screen_update_f1gpstar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
87   TIMER_DEVICE_CALLBACK_MEMBER(bigrun_scanline);
88   TIMER_DEVICE_CALLBACK_MEMBER(scudhamm_scanline);
89   TIMER_DEVICE_CALLBACK_MEMBER(armchamp2_scanline);
8790};
trunk/src/mame/includes/namcos22.h
r18137r18138
259259   INTERRUPT_GEN_MEMBER(namcos22s_interrupt);
260260   INTERRUPT_GEN_MEMBER(namcos22_interrupt);
261261   TIMER_CALLBACK_MEMBER(alpine_steplock_callback);
262   TIMER_DEVICE_CALLBACK_MEMBER(dsp_master_serial_irq);
263   TIMER_DEVICE_CALLBACK_MEMBER(dsp_slave_serial_irq);
264   TIMER_DEVICE_CALLBACK_MEMBER(mcu_irq);
262265};
263266
264267/*----------- defined in video/namcos22.c -----------*/
trunk/src/mame/includes/galaxold.h
r18137r18138
182182   INTERRUPT_GEN_MEMBER(hunchbks_vh_interrupt);
183183   TIMER_CALLBACK_MEMBER(stars_blink_callback);
184184   TIMER_CALLBACK_MEMBER(stars_scroll_callback);
185   TIMER_DEVICE_CALLBACK_MEMBER(galaxold_interrupt_timer);
185186};
186187
187188/*----------- defined in video/galaxold.c -----------*/
r18137r18138
190191
191192/*----------- defined in machine/galaxold.c -----------*/
192193
193TIMER_DEVICE_CALLBACK( galaxold_interrupt_timer );
194
195194WRITE_LINE_DEVICE_HANDLER( galaxold_7474_9m_2_q_callback );
196195WRITE_LINE_DEVICE_HANDLER( galaxold_7474_9m_1_callback );
197196
trunk/src/mame/includes/centiped.h
r18137r18138
7979   UINT32 screen_update_bullsdrt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
8080   UINT32 screen_update_milliped(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
8181   UINT32 screen_update_warlords(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
82   TIMER_DEVICE_CALLBACK_MEMBER(generate_interrupt);
8283};
trunk/src/mame/includes/atarisy1.h
r18137r18138
6565   DECLARE_MACHINE_RESET(atarisy1);
6666   DECLARE_VIDEO_START(atarisy1);
6767   UINT32 screen_update_atarisy1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
68   TIMER_DEVICE_CALLBACK_MEMBER(delayed_joystick_int);
69   TIMER_DEVICE_CALLBACK_MEMBER(atarisy1_reset_yscroll_callback);
70   TIMER_DEVICE_CALLBACK_MEMBER(atarisy1_int3off_callback);
71   TIMER_DEVICE_CALLBACK_MEMBER(atarisy1_int3_callback);
6872};
6973
70
71/*----------- defined in video/atarisy1.c -----------*/
72
73TIMER_DEVICE_CALLBACK( atarisy1_int3_callback );
74TIMER_DEVICE_CALLBACK( atarisy1_int3off_callback );
75TIMER_DEVICE_CALLBACK( atarisy1_reset_yscroll_callback );
76
7774DECLARE_READ16_HANDLER( atarisy1_int3state_r );
7875
7976DECLARE_WRITE16_HANDLER( atarisy1_spriteram_w );
trunk/src/mame/includes/dbz.h
r18137r18138
5151   virtual void machine_reset();
5252   virtual void video_start();
5353   UINT32 screen_update_dbz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
54   TIMER_DEVICE_CALLBACK_MEMBER(dbz_scanline);
5455};
5556
5657/*----------- defined in video/dbz.c -----------*/
trunk/src/mame/includes/shadfrce.h
r18137r18138
4444   virtual void video_start();
4545   UINT32 screen_update_shadfrce(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4646   void screen_eof_shadfrce(screen_device &screen, bool state);
47   TIMER_DEVICE_CALLBACK_MEMBER(shadfrce_scanline);
4748};
trunk/src/mame/includes/polepos.h
r18137r18138
8080   DECLARE_VIDEO_START(polepos);
8181   DECLARE_PALETTE_INIT(polepos);
8282   UINT32 screen_update_polepos(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
83   TIMER_DEVICE_CALLBACK_MEMBER(polepos_scanline);
8384};
8485
8586
trunk/src/mame/includes/qdrmfgp.h
r18137r18138
4141   UINT32 screen_update_qdrmfgp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4242   INTERRUPT_GEN_MEMBER(qdrmfgp2_interrupt);
4343   TIMER_CALLBACK_MEMBER(gp2_timer_callback);
44   TIMER_DEVICE_CALLBACK_MEMBER(qdrmfgp_interrupt);
4445};
4546
4647/*----------- defined in video/qdrmfgp.c -----------*/
trunk/src/mame/includes/spdodgeb.h
r18137r18138
4747   virtual void video_start();
4848   virtual void palette_init();
4949   UINT32 screen_update_spdodgeb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
50   TIMER_DEVICE_CALLBACK_MEMBER(spdodgeb_interrupt);
5051};
5152
52TIMER_DEVICE_CALLBACK( spdodgeb_interrupt );
trunk/src/mame/includes/seta.h
r18137r18138
201201   INTERRUPT_GEN_MEMBER(wrofaero_interrupt);
202202   TIMER_CALLBACK_MEMBER(uPD71054_timer_callback);
203203   TIMER_CALLBACK_MEMBER(keroppi_prize_hop_callback);
204   TIMER_DEVICE_CALLBACK_MEMBER(seta_interrupt_1_and_2);
205   TIMER_DEVICE_CALLBACK_MEMBER(seta_interrupt_2_and_4);
206   TIMER_DEVICE_CALLBACK_MEMBER(seta_sub_interrupt);
207   TIMER_DEVICE_CALLBACK_MEMBER(tndrcade_sub_interrupt);
208   TIMER_DEVICE_CALLBACK_MEMBER(calibr50_interrupt);
209   TIMER_DEVICE_CALLBACK_MEMBER(setaroul_interrupt);
210   TIMER_DEVICE_CALLBACK_MEMBER(crazyfgt_interrupt);
211   TIMER_DEVICE_CALLBACK_MEMBER(inttoote_interrupt);
204212};
205213
206214/*----------- defined in video/seta.c -----------*/
trunk/src/mame/includes/higemaru.h
r18137r18138
2727   virtual void video_start();
2828   virtual void palette_init();
2929   UINT32 screen_update_higemaru(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
30   TIMER_DEVICE_CALLBACK_MEMBER(higemaru_scanline);
3031};
trunk/src/mame/includes/mhavoc.h
r18137r18138
6363   virtual void machine_start();
6464   virtual void machine_reset();
6565   TIMER_CALLBACK_MEMBER(delayed_gamma_w);
66   TIMER_DEVICE_CALLBACK_MEMBER(mhavoc_cpu_irq_clock);
6667};
6768
68/*----------- defined in machine/mhavoc.c -----------*/
69TIMER_DEVICE_CALLBACK( mhavoc_cpu_irq_clock );
trunk/src/mame/includes/hexion.h
r18137r18138
2323   TILE_GET_INFO_MEMBER(get_tile_info1);
2424   virtual void video_start();
2525   UINT32 screen_update_hexion(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
26   TIMER_DEVICE_CALLBACK_MEMBER(hexion_scanline);
2627};
trunk/src/mame/includes/1942.h
r18137r18138
4040   virtual void video_start();
4141   virtual void palette_init();
4242   UINT32 screen_update_1942(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
43   TIMER_DEVICE_CALLBACK_MEMBER(c1942_scanline);
4344};
trunk/src/mame/includes/exterm.h
r18137r18138
3636   DECLARE_WRITE8_MEMBER(sound_slave_dac_w);
3737   virtual void palette_init();
3838   TIMER_CALLBACK_MEMBER(sound_delayed_w);
39   TIMER_DEVICE_CALLBACK_MEMBER(master_sound_nmi_callback);
3940};
4041
4142/*----------- defined in video/exterm.c -----------*/
trunk/src/mame/includes/zodiack.h
r18137r18138
6868   TILE_GET_INFO_MEMBER(get_fg_tile_info);
6969   DECLARE_PALETTE_INIT(zodiack);
7070   INTERRUPT_GEN_MEMBER(zodiack_sound_nmi_gen);
71   TIMER_DEVICE_CALLBACK_MEMBER(zodiack_scanline);
7172};
7273
7374class percuss_state : public zodiack_state
trunk/src/mame/includes/battlera.h
r18137r18138
4141   DECLARE_WRITE8_MEMBER(battlera_adpcm_reset_w);
4242   virtual void video_start();
4343   UINT32 screen_update_battlera(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
44   TIMER_DEVICE_CALLBACK_MEMBER(battlera_irq);
4445};
45
46/*----------- defined in video/battlera.c -----------*/
47TIMER_DEVICE_CALLBACK( battlera_irq );
trunk/src/mame/includes/xain.h
r18137r18138
6969   virtual void machine_start();
7070   virtual void video_start();
7171   UINT32 screen_update_xain(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
72   TIMER_DEVICE_CALLBACK_MEMBER(xain_scanline);
7273};
trunk/src/mame/includes/gundealr.h
r18137r18138
4242   virtual void machine_reset();
4343   virtual void video_start();
4444   UINT32 screen_update_gundealr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
45   TIMER_DEVICE_CALLBACK_MEMBER(gundealr_scanline);
46   TIMER_DEVICE_CALLBACK_MEMBER(yamyam_mcu_sim);
4547};
trunk/src/mame/includes/bionicc.h
r18137r18138
5151   virtual void machine_reset();
5252   virtual void video_start();
5353   UINT32 screen_update_bionicc(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
54   TIMER_DEVICE_CALLBACK_MEMBER(bionicc_scanline);
5455};
trunk/src/mame/includes/renegade.h
r18137r18138
7373   virtual void machine_reset();
7474   virtual void video_start();
7575   UINT32 screen_update_renegade(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
76   TIMER_DEVICE_CALLBACK_MEMBER(renegade_interrupt);
7677};
trunk/src/mame/includes/pgm.h
r18137r18138
116116   DECLARE_MACHINE_RESET(pgm);
117117   UINT32 screen_update_pgm(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
118118   void screen_eof_pgm(screen_device &screen, bool state);
119   TIMER_DEVICE_CALLBACK_MEMBER(pgm_interrupt);
119120};
120121
121122
r18137r18138
317318
318319INPUT_PORTS_EXTERN( pgm );
319320
320TIMER_DEVICE_CALLBACK( pgm_interrupt );
321
322321GFXDECODE_EXTERN( pgm );
323322
324323MACHINE_CONFIG_EXTERN( pgm );
trunk/src/mame/includes/iqblock.h
r18137r18138
3030   TILE_GET_INFO_MEMBER(get_fg_tile_info);
3131   virtual void video_start();
3232   UINT32 screen_update_iqblock(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
33   TIMER_DEVICE_CALLBACK_MEMBER(iqblock_irq);
3334};
trunk/src/mame/includes/hng64.h
r18137r18138
188188   virtual void video_start();
189189   UINT32 screen_update_hng64(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
190190   void screen_eof_hng64(screen_device &screen, bool state);
191   TIMER_DEVICE_CALLBACK_MEMBER(hng64_irq);
191192};
192193
193194/*----------- defined in video/hng64.c -----------*/
trunk/src/mame/includes/psychic5.h
r18137r18138
4747   DECLARE_VIDEO_RESET(bombsa);
4848   UINT32 screen_update_psychic5(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
4949   UINT32 screen_update_bombsa(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
50   TIMER_DEVICE_CALLBACK_MEMBER(psychic5_scanline);
5051};
trunk/src/mame/includes/deco32.h
r18137r18138
110110   UINT32 screen_update_nslasher(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);   
111111   void screen_eof_captaven(screen_device &screen, bool state);
112112   INTERRUPT_GEN_MEMBER(deco32_vbl_interrupt);
113   TIMER_DEVICE_CALLBACK_MEMBER(interrupt_gen);
114   TIMER_DEVICE_CALLBACK_MEMBER(lockload_vbl_irq);
113115};
114116
115117class dragngun_state : public deco32_state
trunk/src/mame/includes/blockout.h
r18137r18138
3535   virtual void machine_reset();
3636   virtual void video_start();
3737   UINT32 screen_update_blockout(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
38   TIMER_DEVICE_CALLBACK_MEMBER(blockout_scanline);
3839};
trunk/src/mame/includes/astrof.h
r18137r18138
7070   DECLARE_MACHINE_START(tomahawk);
7171   UINT32 screen_update_astrof(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
7272   UINT32 screen_update_tomahawk(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
73   TIMER_DEVICE_CALLBACK_MEMBER(irq_callback);
7374};
7475
7576/*----------- defined in audio/astrof.c -----------*/
trunk/src/mame/includes/polyplay.h
r18137r18138
3535   UINT32 screen_update_polyplay(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
3636   INTERRUPT_GEN_MEMBER(periodic_interrupt);
3737   INTERRUPT_GEN_MEMBER(coin_interrupt);
38   TIMER_DEVICE_CALLBACK_MEMBER(polyplay_timer_callback);
3839};
3940
4041
trunk/src/mame/includes/pingpong.h
r18137r18138
2727   virtual void video_start();
2828   virtual void palette_init();
2929   UINT32 screen_update_pingpong(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
30   TIMER_DEVICE_CALLBACK_MEMBER(pingpong_interrupt);
31   TIMER_DEVICE_CALLBACK_MEMBER(merlinmm_interrupt);
3032};
3133
trunk/src/mame/includes/sprint8.h
r18137r18138
3838   UINT32 screen_update_sprint8(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
3939   void screen_eof_sprint8(screen_device &screen, bool state);
4040   TIMER_CALLBACK_MEMBER(sprint8_collision_callback);
41   TIMER_DEVICE_CALLBACK_MEMBER(input_callback);
4142};
4243
4344/*----------- defined in drivers/sprint8.c -----------*/
trunk/src/mame/includes/ssv.h
r18137r18138
128128   UINT32 screen_update_ssv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
129129   UINT32 screen_update_gdfs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
130130   UINT32 screen_update_eaglshot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
131   TIMER_DEVICE_CALLBACK_MEMBER(ssv_interrupt);
132   TIMER_DEVICE_CALLBACK_MEMBER(gdfs_interrupt);
131133};
132134
133135/*----------- defined in video/ssv.c -----------*/
trunk/src/mame/includes/beezer.h
r18137r18138
1818   DECLARE_DRIVER_INIT(beezer);
1919   virtual void machine_start();
2020   UINT32 screen_update_beezer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
21   TIMER_DEVICE_CALLBACK_MEMBER(beezer_interrupt);
2122};
2223
2324
r18137r18138
6061DECLARE_WRITE8_DEVICE_HANDLER( beezer_timer1_w );
6162DECLARE_READ8_DEVICE_HANDLER( beezer_noise_r );
6263
63/*----------- defined in video/beezer.c -----------*/
6464
65TIMER_DEVICE_CALLBACK( beezer_interrupt );
66
trunk/src/mame/includes/bladestl.h
r18137r18138
3535   virtual void machine_reset();
3636   virtual void palette_init();
3737   UINT32 screen_update_bladestl(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
38   TIMER_DEVICE_CALLBACK_MEMBER(bladestl_scanline);
3839};
3940
4041/*----------- defined in video/bladestl.c -----------*/
trunk/src/mame/includes/srumbler.h
r18137r18138
2828   virtual void machine_start();
2929   virtual void video_start();
3030   UINT32 screen_update_srumbler(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
31   TIMER_DEVICE_CALLBACK_MEMBER(srumbler_interrupt);
3132};
trunk/src/mame/includes/overdriv.h
r18137r18138
4444   virtual void machine_reset();
4545   UINT32 screen_update_overdriv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4646   INTERRUPT_GEN_MEMBER(cpuB_interrupt);
47   TIMER_DEVICE_CALLBACK_MEMBER(overdriv_cpuA_scanline);
4748};
4849
4950/*----------- defined in video/overdriv.c -----------*/
trunk/src/mame/includes/xmen.h
r18137r18138
5353   UINT32 screen_update_xmen6p_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5454   UINT32 screen_update_xmen6p_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5555   void screen_eof_xmen6p(screen_device &screen, bool state);
56   TIMER_DEVICE_CALLBACK_MEMBER(xmen_scanline);
5657};
5758
5859/*----------- defined in video/xmen.c -----------*/
trunk/src/mame/includes/model1.h
r18137r18138
136136   DECLARE_MACHINE_RESET(model1_vr);
137137   UINT32 screen_update_model1(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
138138   void screen_eof_model1(screen_device &screen, bool state);
139   TIMER_DEVICE_CALLBACK_MEMBER(model1_interrupt);
139140};
140141
141142
trunk/src/mame/includes/nmk16.h
r18137r18138
142142   UINT32 screen_update_bubl2000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
143143   void screen_eof_nmk(screen_device &screen, bool state);
144144   void screen_eof_strahl(screen_device &screen, bool state);
145   TIMER_DEVICE_CALLBACK_MEMBER(tdragon_mcu_sim);
146   TIMER_DEVICE_CALLBACK_MEMBER(hachamf_mcu_sim);
147   TIMER_DEVICE_CALLBACK_MEMBER(nmk16_scanline);
148   TIMER_DEVICE_CALLBACK_MEMBER(manybloc_scanline);
145149};
trunk/src/mame/includes/itech8.h
r18137r18138
9999   TIMER_CALLBACK_MEMBER(behind_the_beam_update);
100100   TIMER_CALLBACK_MEMBER(delayed_sound_data_w);
101101   TIMER_CALLBACK_MEMBER(blitter_done);
102   TIMER_DEVICE_CALLBACK_MEMBER(grmatch_palette_update);
102103};
103104
104105
r18137r18138
116117DECLARE_READ8_HANDLER( slikshot_z80_control_r );
117118DECLARE_WRITE8_HANDLER( slikshot_z80_control_w );
118119
119/*----------- defined in video/itech8.c -----------*/
120TIMER_DEVICE_CALLBACK( grmatch_palette_update );
trunk/src/mame/includes/nemesis.h
r18137r18138
8787   UINT32 screen_update_nemesis(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
8888   INTERRUPT_GEN_MEMBER(nemesis_interrupt);
8989   INTERRUPT_GEN_MEMBER(blkpnthr_interrupt);
90   TIMER_DEVICE_CALLBACK_MEMBER(konamigt_interrupt);
91   TIMER_DEVICE_CALLBACK_MEMBER(gx400_interrupt);
9092};
trunk/src/mame/includes/cosmic.h
r18137r18138
7575   UINT32 screen_update_magspot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
7676   UINT32 screen_update_devzone(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
7777   UINT32 screen_update_nomnlnd(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
78   TIMER_DEVICE_CALLBACK_MEMBER(panic_scanline);
7879};
trunk/src/mame/includes/gradius3.h
r18137r18138
5050   virtual void video_start();
5151   UINT32 screen_update_gradius3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5252   INTERRUPT_GEN_MEMBER(cpuA_interrupt);
53   TIMER_DEVICE_CALLBACK_MEMBER(gradius3_sub_scanline);
5354};
5455
5556/*----------- defined in video/gradius3.c -----------*/
trunk/src/mame/includes/model2.h
r18137r18138
163163   DECLARE_MACHINE_RESET(model2_common);
164164   DECLARE_MACHINE_RESET(model2_scsp);
165165   UINT32 screen_update_model2(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
166   TIMER_DEVICE_CALLBACK_MEMBER(model2_timer_cb);
167   TIMER_DEVICE_CALLBACK_MEMBER(model2_interrupt);
168   TIMER_DEVICE_CALLBACK_MEMBER(model2c_interrupt);
166169};
167170
168171/*----------- defined in video/model2.c -----------*/
trunk/src/mame/includes/decocass.h
r18137r18138
223223   DECLARE_READ8_MEMBER(mirrorcolorram_r);
224224   DECLARE_READ8_MEMBER(cdsteljn_input_r);
225225   DECLARE_WRITE8_MEMBER(cdsteljn_mux_w);
226   TIMER_DEVICE_CALLBACK_MEMBER(decocass_audio_nmi_gen);
226227private:
227228   DECLARE_READ8_MEMBER(decocass_type1_latch_26_pass_3_inv_2_r);
228229   DECLARE_READ8_MEMBER(decocass_type1_pass_136_r);
r18137r18138
251252               UINT8 *missile_ram, int interleave);                     
252253};
253254
254TIMER_DEVICE_CALLBACK(decocass_audio_nmi_gen);
trunk/src/mame/includes/mystwarr.h
r18137r18138
7272   UINT32 screen_update_dadandrn(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
7373   UINT32 screen_update_martchmp(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
7474   INTERRUPT_GEN_MEMBER(ddd_interrupt);
75   TIMER_DEVICE_CALLBACK_MEMBER(mystwarr_interrupt);
76   TIMER_DEVICE_CALLBACK_MEMBER(metamrph_interrupt);
77   TIMER_DEVICE_CALLBACK_MEMBER(mchamp_interrupt);
7578};
trunk/src/mame/includes/segahang.h
r18137r18138
131131   // internal state
132132   UINT8               m_adc_select;
133133   bool               m_shadow;
134   TIMER_DEVICE_CALLBACK_MEMBER(hangon_irq);
134135};
trunk/src/mame/includes/konamigx.h
r18137r18138
8181   INTERRUPT_GEN_MEMBER(konamigx_vbinterrupt);
8282   INTERRUPT_GEN_MEMBER(tms_sync);
8383   TIMER_CALLBACK_MEMBER(dmaend_callback);
84   TIMER_DEVICE_CALLBACK_MEMBER(konamigx_hbinterrupt);
8485};
8586
8687
trunk/src/mame/includes/sprcros2.h
r18137r18138
3232   virtual void palette_init();
3333   UINT32 screen_update_sprcros2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
3434   INTERRUPT_GEN_MEMBER(sprcros2_s_interrupt);
35   TIMER_DEVICE_CALLBACK_MEMBER(sprcros2_m_interrupt);
3536};
trunk/src/mame/includes/espial.h
r18137r18138
5353   DECLARE_VIDEO_START(netwars);
5454   UINT32 screen_update_espial(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5555   INTERRUPT_GEN_MEMBER(espial_sound_nmi_gen);
56   TIMER_DEVICE_CALLBACK_MEMBER(espial_scanline);
5657};
trunk/src/mame/includes/orbit.h
r18137r18138
4646   UINT32 screen_update_orbit(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4747   INTERRUPT_GEN_MEMBER(orbit_interrupt);
4848   TIMER_CALLBACK_MEMBER(irq_off);
49   TIMER_DEVICE_CALLBACK_MEMBER(nmi_32v);
4950};
5051/*----------- defined in audio/orbit.c -----------*/
5152DECLARE_WRITE8_DEVICE_HANDLER( orbit_note_w );
trunk/src/mame/includes/seta2.h
r18137r18138
7474   INTERRUPT_GEN_MEMBER(seta2_interrupt);
7575   INTERRUPT_GEN_MEMBER(samshoot_interrupt);
7676   INTERRUPT_GEN_MEMBER(funcube_sub_timer_irq);
77   TIMER_DEVICE_CALLBACK_MEMBER(funcube_interrupt);
7778};
trunk/src/mame/includes/model3.h
r18137r18138
199199   DECLARE_MACHINE_RESET(model3_21);
200200   UINT32 screen_update_model3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
201201   TIMER_CALLBACK_MEMBER(model3_sound_timer_tick);
202   TIMER_DEVICE_CALLBACK_MEMBER(model3_interrupt);
202203};
203204
204205
trunk/src/mame/includes/dynax.h
r18137r18138
483483   INTERRUPT_GEN_MEMBER(hginga_irq);
484484   INTERRUPT_GEN_MEMBER(mjflove_irq);
485485   INTERRUPT_GEN_MEMBER(hparadis_irq);
486   TIMER_DEVICE_CALLBACK_MEMBER(neruton_irq_scanline);
487   TIMER_DEVICE_CALLBACK_MEMBER(majxtal7_vblank_interrupt);
488   TIMER_DEVICE_CALLBACK_MEMBER(tenkai_interrupt);
486489};
487490
488491//----------- defined in drivers/dynax.c -----------
trunk/src/mame/includes/fastlane.h
r18137r18138
4949   virtual void video_start();
5050   virtual void palette_init();
5151   UINT32 screen_update_fastlane(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
52   TIMER_DEVICE_CALLBACK_MEMBER(fastlane_scanline);
5253};
trunk/src/mame/includes/st0016.h
r18137r18138
3939   DECLARE_VIDEO_START(st0016);
4040   void st0016_draw_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4141   UINT32 screen_update_st0016(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
42   TIMER_DEVICE_CALLBACK_MEMBER(st0016_int);
4243};
4344
4445#define ISMACS  (st0016_game&0x80)
trunk/src/mame/includes/mrflea.h
r18137r18138
4545   virtual void machine_start();
4646   virtual void machine_reset();
4747   UINT32 screen_update_mrflea(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
48   TIMER_DEVICE_CALLBACK_MEMBER(mrflea_slave_interrupt);
4849};
trunk/src/mame/includes/wwfwfest.h
r18137r18138
4444   virtual void video_start();
4545   DECLARE_VIDEO_START(wwfwfstb);
4646   UINT32 screen_update_wwfwfest(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
47   TIMER_DEVICE_CALLBACK_MEMBER(wwfwfest_scanline);
4748};
trunk/src/mame/includes/argus.h
r18137r18138
8383   UINT32 screen_update_argus(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
8484   UINT32 screen_update_valtric(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
8585   UINT32 screen_update_butasan(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
86   TIMER_DEVICE_CALLBACK_MEMBER(argus_scanline);
87   TIMER_DEVICE_CALLBACK_MEMBER(butasan_scanline);
8688};
trunk/src/mame/includes/snk6502.h
r18137r18138
6363   UINT32 screen_update_snk6502(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
6464   INTERRUPT_GEN_MEMBER(satansat_interrupt);
6565   INTERRUPT_GEN_MEMBER(snk6502_interrupt);
66   TIMER_DEVICE_CALLBACK_MEMBER(sasuke_update_counter);
6667};
6768
6869
trunk/src/mame/includes/m107.h
r18137r18138
1818   m107_state(const machine_config &mconfig, device_type type, const char *tag)
1919      : driver_device(mconfig, type, tag),
2020        m_spriteram(*this, "spriteram"),
21        m_vram_data(*this, "vram_data") { }
21        m_vram_data(*this, "vram_data"),
22        m_maincpu(*this, "maincpu")     { }
2223
2324   required_shared_ptr<UINT16> m_spriteram;
2425   required_shared_ptr<UINT16> m_vram_data;
26   required_device<cpu_device> m_maincpu;
2527
2628   UINT8 m_irq_vectorbase;
2729   int m_sound_status;
r18137r18138
5052   virtual void machine_start();
5153   virtual void video_start();
5254   UINT32 screen_update_m107(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
55   TIMER_DEVICE_CALLBACK_MEMBER(m107_scanline_interrupt);
5356};
trunk/src/mame/includes/megasys1.h
r18137r18138
113113   UINT32 screen_update_megasys1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
114114   void screen_eof_megasys1(screen_device &screen, bool state);
115115   INTERRUPT_GEN_MEMBER(megasys1D_irq);
116   TIMER_DEVICE_CALLBACK_MEMBER(megasys1A_scanline);
117   TIMER_DEVICE_CALLBACK_MEMBER(megasys1B_scanline);
116118};
trunk/src/mame/includes/airbustr.h
r18137r18138
6969   UINT32 screen_update_airbustr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
7070   void screen_eof_airbustr(screen_device &screen, bool state);
7171   INTERRUPT_GEN_MEMBER(slave_interrupt);
72   TIMER_DEVICE_CALLBACK_MEMBER(airbustr_scanline);
7273};
trunk/src/mame/includes/foodf.h
r18137r18138
3636   DECLARE_MACHINE_RESET(foodf);
3737   DECLARE_VIDEO_START(foodf);
3838   UINT32 screen_update_foodf(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
39   TIMER_DEVICE_CALLBACK_MEMBER(scanline_update);
3940};
trunk/src/mame/includes/cave.h
r18137r18138
203203   UINT32 screen_update_cave(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
204204   INTERRUPT_GEN_MEMBER(cave_interrupt);
205205   TIMER_CALLBACK_MEMBER(cave_vblank_end);
206   TIMER_DEVICE_CALLBACK_MEMBER(cave_vblank_start);
206207};
207208
208209/*----------- defined in video/cave.c -----------*/
trunk/src/mame/includes/thedeep.h
r18137r18138
5151   virtual void palette_init();
5252   UINT32 screen_update_thedeep(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5353   INTERRUPT_GEN_MEMBER(thedeep_mcu_irq);
54   TIMER_DEVICE_CALLBACK_MEMBER(thedeep_interrupt);
5455};
trunk/src/mame/includes/williams.h
r18137r18138
112112   TIMER_CALLBACK_MEMBER(williams_deferred_snd_cmd_w);
113113   TIMER_CALLBACK_MEMBER(blaster_deferred_snd_cmd_w);
114114   TIMER_CALLBACK_MEMBER(williams2_deferred_snd_cmd_w);
115   TIMER_DEVICE_CALLBACK_MEMBER(williams_va11_callback);
116   TIMER_DEVICE_CALLBACK_MEMBER(williams_count240_callback);
117   TIMER_DEVICE_CALLBACK_MEMBER(williams2_va11_callback);
118   TIMER_DEVICE_CALLBACK_MEMBER(williams2_endscreen_callback);
115119};
116120
117121
r18137r18138
165169extern const pia6821_interface tshoot_snd_pia_intf;
166170extern const pia6821_interface joust2_pia_1_intf;
167171
168/* timer callbacks */
169TIMER_DEVICE_CALLBACK( williams_va11_callback );
170TIMER_DEVICE_CALLBACK( williams_count240_callback );
171TIMER_DEVICE_CALLBACK( williams2_va11_callback );
172TIMER_DEVICE_CALLBACK( williams2_endscreen_callback );
173
174172/*----------- defined in video/williams.c -----------*/
175173
176174#define WILLIAMS_BLITTER_NONE      0      /* no blitter */
trunk/src/mame/includes/changela.h
r18137r18138
9191   UINT32 screen_update_changela(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
9292   INTERRUPT_GEN_MEMBER(chl_mcu_irq);
9393   TIMER_CALLBACK_MEMBER(changela_scanline_callback);
94   TIMER_DEVICE_CALLBACK_MEMBER(changela_scanline);
9495};
trunk/src/mame/includes/suna16.h
r18137r18138
3838   DECLARE_MACHINE_RESET(uballoon);
3939   UINT32 screen_update_suna16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4040   UINT32 screen_update_bestbest(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
41   TIMER_DEVICE_CALLBACK_MEMBER(bssoccer_interrupt);
4142};
trunk/src/mame/includes/darkmist.h
r18137r18138
2828   virtual void video_start();
2929   virtual void palette_init();
3030   UINT32 screen_update_darkmist(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
31   TIMER_DEVICE_CALLBACK_MEMBER(darkmist_scanline);
3132};
trunk/src/mame/includes/nitedrvr.h
r18137r18138
5757   virtual void machine_reset();
5858   virtual void video_start();
5959   UINT32 screen_update_nitedrvr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
60   TIMER_DEVICE_CALLBACK_MEMBER(nitedrvr_crash_toggle_callback);
6061};
6162
62/*----------- defined in machine/nitedrvr.c -----------*/
63TIMER_DEVICE_CALLBACK( nitedrvr_crash_toggle_callback );
64
6563/*----------- defined in audio/nitedrvr.c -----------*/
6664DISCRETE_SOUND_EXTERN( nitedrvr );
trunk/src/mame/includes/suna8.h
r18137r18138
104104   DECLARE_VIDEO_START(suna8_textdim0);
105105   DECLARE_MACHINE_RESET(hardhea2);
106106   UINT32 screen_update_suna8(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
107   TIMER_DEVICE_CALLBACK_MEMBER(brickzn_interrupt);
108   TIMER_DEVICE_CALLBACK_MEMBER(hardhea2_interrupt);
107109};
108110
109111/*----------- defined in audio/suna8.c -----------*/
trunk/src/mame/includes/btime.h
r18137r18138
114114   UINT32 screen_update_bnj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
115115   UINT32 screen_update_zoar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
116116   UINT32 screen_update_disco(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
117   TIMER_DEVICE_CALLBACK_MEMBER(audio_nmi_gen);
117118};
trunk/src/mame/includes/mitchell.h
r18137r18138
103103   DECLARE_MACHINE_RESET(mitchell);
104104   DECLARE_VIDEO_START(pang);
105105   UINT32 screen_update_pang(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
106   TIMER_DEVICE_CALLBACK_MEMBER(mitchell_irq);
106107};
trunk/src/mame/includes/deco_mlc.h
r18137r18138
3838   DECLARE_VIDEO_START(mlc);
3939   UINT32 screen_update_mlc(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
4040   void screen_eof_mlc(screen_device &screen, bool state);
41   TIMER_DEVICE_CALLBACK_MEMBER(interrupt_gen);
4142};
trunk/src/mame/includes/segas32.h
r18137r18138
180180   INTERRUPT_GEN_MEMBER(start_of_vblank_int);
181181   TIMER_CALLBACK_MEMBER(end_of_vblank_int);
182182   TIMER_CALLBACK_MEMBER(update_sprites);
183   TIMER_DEVICE_CALLBACK_MEMBER(signal_v60_irq_callback);
183184};
184185
185186/*----------- defined in machine/segas32.c -----------*/
trunk/src/mame/includes/snowbros.h
r18137r18138
4949   UINT32 screen_update_snowbro3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5050   UINT32 screen_update_wintbob(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5151   void screen_eof_snowbros(screen_device &screen, bool state);
52   TIMER_DEVICE_CALLBACK_MEMBER(snowbros_irq);
53   TIMER_DEVICE_CALLBACK_MEMBER(snowbros3_irq);
5254};
trunk/src/mame/includes/equites.h
r18137r18138
108108   UINT32 screen_update_splndrbt(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
109109   TIMER_CALLBACK_MEMBER(equites_nmi_callback);
110110   TIMER_CALLBACK_MEMBER(equites_frq_adjuster_callback);
111   TIMER_DEVICE_CALLBACK_MEMBER(equites_scanline);
112   TIMER_DEVICE_CALLBACK_MEMBER(splndrbt_scanline);
111113};
trunk/src/mame/includes/galpani2.h
r18137r18138
5151   virtual void video_start();
5252   virtual void palette_init();
5353   UINT32 screen_update_galpani2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
54   TIMER_DEVICE_CALLBACK_MEMBER(galpani2_interrupt1);
55   TIMER_DEVICE_CALLBACK_MEMBER(galpani2_interrupt2);
5456};
5557
5658
trunk/src/mame/includes/ddragon3.h
r18137r18138
4949   virtual void video_start();
5050   UINT32 screen_update_ddragon3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5151   UINT32 screen_update_ctribe(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
52   TIMER_DEVICE_CALLBACK_MEMBER(ddragon3_scanline);
5253};
trunk/src/mame/includes/segas24.h
r18137r18138
113113   virtual void machine_start();
114114   virtual void machine_reset();
115115   UINT32 screen_update_system24(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
116   TIMER_DEVICE_CALLBACK_MEMBER(irq_timer_cb);
117   TIMER_DEVICE_CALLBACK_MEMBER(irq_timer_clear_cb);
118   TIMER_DEVICE_CALLBACK_MEMBER(irq_frc_cb);
119   TIMER_DEVICE_CALLBACK_MEMBER(irq_vbl);
116120};
trunk/src/mame/includes/dragrace.h
r18137r18138
5454   virtual void video_start();
5555   virtual void palette_init();
5656   UINT32 screen_update_dragrace(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
57   TIMER_DEVICE_CALLBACK_MEMBER(dragrace_frame_callback);
5758};
5859
5960/*----------- defined in audio/dragrace.c -----------*/
trunk/src/mame/includes/coolpool.h
r18137r18138
5959   DECLARE_MACHINE_RESET(amerdart);
6060   DECLARE_MACHINE_RESET(coolpool);
6161   TIMER_CALLBACK_MEMBER(deferred_iop_w);
62   TIMER_DEVICE_CALLBACK_MEMBER(nvram_write_timeout);
63   TIMER_DEVICE_CALLBACK_MEMBER(amerdart_audio_int_gen);
6264};
trunk/src/mame/includes/exedexes.h
r18137r18138
4949   virtual void video_start();
5050   virtual void palette_init();
5151   UINT32 screen_update_exedexes(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
52   TIMER_DEVICE_CALLBACK_MEMBER(exedexes_scanline);
5253};
trunk/src/mame/includes/suprnova.h
r18137r18138
136136   DECLARE_MACHINE_RESET(sknsk);
137137   UINT32 screen_update_skns(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
138138   void screen_eof_skns(screen_device &screen, bool state);
139   TIMER_DEVICE_CALLBACK_MEMBER(interrupt_callback);
140   TIMER_DEVICE_CALLBACK_MEMBER(skns_irq);
139141};
140142
141143/*----------- defined in video/suprnova.c -----------*/
trunk/src/mame/includes/ddragon.h
r18137r18138
100100   DECLARE_MACHINE_RESET(ddragon);
101101   DECLARE_VIDEO_START(ddragon);
102102   UINT32 screen_update_ddragon(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
103   TIMER_DEVICE_CALLBACK_MEMBER(ddragon_scanline);
103104};
trunk/src/mame/includes/8080bw.h
r18137r18138
106106   UINT32 screen_update_shuttlei(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
107107
108108   INTERRUPT_GEN_MEMBER(polaris_interrupt);
109   TIMER_DEVICE_CALLBACK_MEMBER(claybust_gun_callback);
110   TIMER_DEVICE_CALLBACK_MEMBER(schaser_effect_555_cb);
109111};
110112
111113
r18137r18138
122124
123125extern const sn76477_interface schaser_sn76477_interface;
124126DISCRETE_SOUND_EXTERN( schaser );
125TIMER_DEVICE_CALLBACK( schaser_effect_555_cb );
127
trunk/src/mame/includes/taito_l.h
r18137r18138
121121   DECLARE_MACHINE_RESET(cachat);
122122   UINT32 screen_update_taitol(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
123123   void screen_eof_taitol(screen_device &screen, bool state);
124   TIMER_DEVICE_CALLBACK_MEMBER(vbl_interrupt);
124125};
125126
126127/*----------- defined in video/taito_l.c -----------*/
trunk/src/mame/includes/balsente.h
r18137r18138
198198   TIMER_CALLBACK_MEMBER(m6850_data_ready_callback);
199199   TIMER_CALLBACK_MEMBER(m6850_w_callback);
200200   TIMER_CALLBACK_MEMBER(adc_finished);
201   TIMER_DEVICE_CALLBACK_MEMBER(balsente_interrupt_timer);
202   TIMER_DEVICE_CALLBACK_MEMBER(balsente_counter_callback);
203   TIMER_DEVICE_CALLBACK_MEMBER(balsente_clock_counter_0_ff);
201204};
202205
203206
204207/*----------- defined in machine/balsente.c -----------*/
205
206TIMER_DEVICE_CALLBACK( balsente_interrupt_timer );
207
208208void balsente_noise_gen(device_t *device, int count, short *buffer);
209
210TIMER_DEVICE_CALLBACK( balsente_counter_callback );
211
212TIMER_DEVICE_CALLBACK( balsente_clock_counter_0_ff );
213
trunk/src/mame/includes/xexex.h
r18137r18138
6666   virtual void video_start();
6767   UINT32 screen_update_xexex(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
6868   TIMER_CALLBACK_MEMBER(dmaend_callback);
69   TIMER_DEVICE_CALLBACK_MEMBER(xexex_interrupt);
6970};
7071
7172/*----------- defined in video/xexex.c -----------*/
trunk/src/mame/includes/cninja.h
r18137r18138
7070   UINT32 screen_update_edrandy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
7171   UINT32 screen_update_robocop2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
7272   UINT32 screen_update_mutantf(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
73   TIMER_DEVICE_CALLBACK_MEMBER(interrupt_gen);
7374};
trunk/src/mame/includes/m92.h
r18137r18138
7878   UINT32 screen_update_m92(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
7979   UINT32 screen_update_ppan(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
8080   TIMER_CALLBACK_MEMBER(spritebuffer_callback);
81   TIMER_DEVICE_CALLBACK_MEMBER(m92_scanline_interrupt);
8182};
8283
8384/*----------- defined in drivers/m92.c -----------*/
trunk/src/mame/includes/gaelco2.h
r18137r18138
5252   UINT32 screen_update_gaelco2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5353   UINT32 screen_update_gaelco2_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5454   UINT32 screen_update_gaelco2_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
55   TIMER_DEVICE_CALLBACK_MEMBER(bang_irq);
5556};
5657
5758
5859/*----------- defined in machine/gaelco2.c -----------*/
5960
60TIMER_DEVICE_CALLBACK( bang_irq );
6161DECLARE_WRITE16_DEVICE_HANDLER( gaelco2_eeprom_cs_w );
6262DECLARE_WRITE16_DEVICE_HANDLER( gaelco2_eeprom_sk_w );
6363DECLARE_WRITE16_DEVICE_HANDLER( gaelco2_eeprom_data_w );
trunk/src/mame/includes/finalizr.h
r18137r18138
5454   virtual void video_start();
5555   virtual void palette_init();
5656   UINT32 screen_update_finalizr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
57   TIMER_DEVICE_CALLBACK_MEMBER(finalizr_scanline);
5758};
trunk/src/mame/includes/galpanic.h
r18137r18138
2727   UINT32 screen_update_galpanic(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
2828   UINT32 screen_update_comad(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
2929   void screen_eof_galpanic(screen_device &screen, bool state);
30   TIMER_DEVICE_CALLBACK_MEMBER(galpanic_scanline);
31   TIMER_DEVICE_CALLBACK_MEMBER(galhustl_scanline);
3032};
3133
3234/*----------- defined in video/galpanic.c -----------*/
trunk/src/mame/includes/mcr.h
r18137r18138
102102   DECLARE_MACHINE_START(nflfoot);
103103   UINT32 screen_update_mcr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
104104   TIMER_CALLBACK_MEMBER(ipu_watchdog_reset);
105   TIMER_DEVICE_CALLBACK_MEMBER(dpoker_hopper_callback);
106   TIMER_DEVICE_CALLBACK_MEMBER(dpoker_coin_in_callback);
107   TIMER_DEVICE_CALLBACK_MEMBER(mcr_interrupt);
108   TIMER_DEVICE_CALLBACK_MEMBER(mcr_ipu_interrupt);
105109};
106110
107111
r18137r18138
126130extern UINT32 mcr_cpu_board;
127131extern UINT32 mcr_sprite_board;
128132
129TIMER_DEVICE_CALLBACK( mcr_interrupt );
130TIMER_DEVICE_CALLBACK( mcr_ipu_interrupt );
131
132133/*----------- defined in video/mcr.c -----------*/
133134
134135extern INT8 mcr12_sprite_xoffs;
trunk/src/mame/includes/namcona1.h
r18137r18138
111111   virtual void machine_reset();
112112   virtual void video_start();
113113   UINT32 screen_update_namcona1(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
114   TIMER_DEVICE_CALLBACK_MEMBER(namcona1_interrupt);
115   TIMER_DEVICE_CALLBACK_MEMBER(mcu_interrupt);
114116};
trunk/src/mame/includes/bsktball.h
r18137r18138
5656   virtual void video_start();
5757   virtual void palette_init();
5858   UINT32 screen_update_bsktball(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
59   TIMER_DEVICE_CALLBACK_MEMBER(bsktball_scanline);
5960};
6061
61/*----------- defined in machine/bsktball.c -----------*/
62
63TIMER_DEVICE_CALLBACK( bsktball_scanline );
64
6562/*----------- defined in audio/bsktball.c -----------*/
6663
6764DECLARE_WRITE8_DEVICE_HANDLER( bsktball_bounce_w );
trunk/src/mame/includes/chqflag.h
r18137r18138
4444   virtual void machine_reset();
4545   virtual void video_start();
4646   UINT32 screen_update_chqflag(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
47   TIMER_DEVICE_CALLBACK_MEMBER(chqflag_scanline);
4748};
4849
4950/*----------- defined in video/chqflag.c -----------*/
trunk/src/mame/includes/dooyong.h
r18137r18138
8787   UINT32 screen_update_primella(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
8888   UINT32 screen_update_rshark(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
8989   UINT32 screen_update_popbingo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
90   TIMER_DEVICE_CALLBACK_MEMBER(rshark_scanline);
9091};
trunk/src/mame/includes/kaneko16.h
r18137r18138
6565   DECLARE_MACHINE_RESET(mgcrystl);
6666   UINT32 screen_update_kaneko16(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
6767   UINT32 screen_update_common(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
68   TIMER_DEVICE_CALLBACK_MEMBER(kaneko16_interrupt);
69   TIMER_DEVICE_CALLBACK_MEMBER(shogwarr_interrupt);
6870};
6971
7072class kaneko16_gtmr_state : public kaneko16_state
trunk/src/mame/includes/ms32.h
r18137r18138
8888   virtual void video_start();
8989   DECLARE_VIDEO_START(f1superb);
9090   UINT32 screen_update_ms32(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
91   TIMER_DEVICE_CALLBACK_MEMBER(ms32_interrupt);
9192};
trunk/src/mame/includes/wwfsstar.h
r18137r18138
2727   TILE_GET_INFO_MEMBER(get_bg0_tile_info);
2828   virtual void video_start();
2929   UINT32 screen_update_wwfsstar(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
30   TIMER_DEVICE_CALLBACK_MEMBER(wwfsstar_scanline);
3031};
trunk/src/mame/includes/mw8080bw.h
r18137r18138
146146   void screen_eof_phantom2(screen_device &screen, bool state);
147147   TIMER_CALLBACK_MEMBER(maze_tone_timing_timer_callback);
148148   TIMER_CALLBACK_MEMBER(mw8080bw_interrupt_callback);
149   TIMER_DEVICE_CALLBACK_MEMBER(spcenctr_strobe_timer_callback);
149150};
150151
151152
trunk/src/mame/includes/targeth.h
r18137r18138
2121   TILE_GET_INFO_MEMBER(get_tile_info_targeth_screen1);
2222   virtual void video_start();
2323   UINT32 screen_update_targeth(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
24   TIMER_DEVICE_CALLBACK_MEMBER(targeth_interrupt);
2425};
trunk/src/mame/includes/n8080.h
r18137r18138
8282   UINT32 screen_update_helifire(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
8383   void screen_eof_helifire(screen_device &screen, bool state);
8484   TIMER_CALLBACK_MEMBER(spacefev_stop_red_cannon);
85   TIMER_DEVICE_CALLBACK_MEMBER(rst1_tick);
86   TIMER_DEVICE_CALLBACK_MEMBER(rst2_tick);
87   TIMER_DEVICE_CALLBACK_MEMBER(spacefev_vco_voltage_timer);
88   TIMER_DEVICE_CALLBACK_MEMBER(helifire_dac_volume_timer);
8589};
8690
8791/*----------- defined in video/n8080.c -----------*/
trunk/src/mame/includes/gaelco3d.h
r18137r18138
118118   UINT32 screen_update_gaelco3d(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
119119   INTERRUPT_GEN_MEMBER(vblank_gen);
120120   TIMER_CALLBACK_MEMBER(delayed_sound_w);
121   TIMER_DEVICE_CALLBACK_MEMBER(adsp_autobuffer_irq);
121122};
122123
123124/*----------- defined in video/gaelco3d.c -----------*/
trunk/src/mame/includes/galaxian.h
r18137r18138
226226   UINT32 screen_update_galaxian(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
227227   INTERRUPT_GEN_MEMBER(interrupt_gen);
228228   INTERRUPT_GEN_MEMBER(fakechange_interrupt_gen);
229   TIMER_DEVICE_CALLBACK_MEMBER(checkmaj_irq0_gen);
230   TIMER_DEVICE_CALLBACK_MEMBER(galaxian_stars_blink_timer);
229231};
230232
231233
232234/*----------- defined in video/galaxian.c -----------*/
233TIMER_DEVICE_CALLBACK( galaxian_stars_blink_timer );
234235
235236/* special purpose background rendering */
236237void galaxian_draw_background(running_machine &machine, bitmap_rgb32 &bitmap, const rectangle &cliprect);
trunk/src/mame/includes/hyprduel.h
r18137r18138
9393   TIMER_CALLBACK_MEMBER(vblank_end_callback);
9494   TIMER_CALLBACK_MEMBER(magerror_irq_callback);
9595   TIMER_CALLBACK_MEMBER(hyprduel_blit_done);
96   TIMER_DEVICE_CALLBACK_MEMBER(hyprduel_interrupt);
9697};
trunk/src/mame/includes/namconb1.h
r18137r18138
8181   INTERRUPT_GEN_MEMBER(namconb2_interrupt);
8282   TIMER_CALLBACK_MEMBER(namconb1_TriggerPOSIRQ);
8383   TIMER_CALLBACK_MEMBER(namconb2_TriggerPOSIRQ);
84   TIMER_DEVICE_CALLBACK_MEMBER(mcu_interrupt);
8485};
trunk/src/mame/includes/vball.h
r18137r18138
3232   TILE_GET_INFO_MEMBER(get_bg_tile_info);
3333   virtual void video_start();
3434   UINT32 screen_update_vb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
35   TIMER_DEVICE_CALLBACK_MEMBER(vball_scanline);
3536};
3637
3738
trunk/src/mame/includes/strnskil.h
r18137r18138
3131   virtual void video_start();
3232   virtual void palette_init();
3333   UINT32 screen_update_strnskil(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
34   TIMER_DEVICE_CALLBACK_MEMBER(strnskil_irq);
3435};
trunk/src/mame/includes/shaolins.h
r18137r18138
2626   virtual void video_start();
2727   virtual void palette_init();
2828   UINT32 screen_update_shaolins(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
29   TIMER_DEVICE_CALLBACK_MEMBER(shaolins_interrupt);
2930};
trunk/src/mame/includes/deadang.h
r18137r18138
3333   TILE_GET_INFO_MEMBER(get_text_tile_info);
3434   virtual void video_start();
3535   UINT32 screen_update_deadang(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
36   TIMER_DEVICE_CALLBACK_MEMBER(deadang_main_scanline);
37   TIMER_DEVICE_CALLBACK_MEMBER(deadang_sub_scanline);
3638};
trunk/src/mame/includes/taito_o.h
r18137r18138
2020   DECLARE_READ16_MEMBER(io_r);
2121   virtual void machine_start();
2222   UINT32 screen_update_parentj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
23   TIMER_DEVICE_CALLBACK_MEMBER(parentj_interrupt);
2324};
trunk/src/mame/includes/bishi.h
r18137r18138
4040   virtual void machine_reset();
4141   virtual void video_start();
4242   UINT32 screen_update_bishi(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
43   TIMER_DEVICE_CALLBACK_MEMBER(bishi_scanline);
4344};
4445
4546/*----------- defined in video/bishi.c -----------*/
trunk/src/mame/includes/irobot.h
r18137r18138
7979   virtual void palette_init();
8080   UINT32 screen_update_irobot(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
8181   TIMER_CALLBACK_MEMBER(scanline_callback);
82   TIMER_DEVICE_CALLBACK_MEMBER(irobot_irvg_done_callback);
83   TIMER_DEVICE_CALLBACK_MEMBER(irobot_irmb_done_callback);
8284};
8385
84/*----------- defined in machine/irobot.c -----------*/
85TIMER_DEVICE_CALLBACK( irobot_irvg_done_callback );
86TIMER_DEVICE_CALLBACK( irobot_irmb_done_callback );
87
8886/*----------- defined in video/irobot.c -----------*/
8987void irobot_poly_clear(running_machine &machine);
9088void irobot_run_video(running_machine &machine);
trunk/src/mame/video/galaxian.c
r18137r18138
846846 *
847847 *************************************/
848848
849TIMER_DEVICE_CALLBACK( galaxian_stars_blink_timer )
849TIMER_DEVICE_CALLBACK_MEMBER(galaxian_state::galaxian_stars_blink_timer)
850850{
851   galaxian_state *state = timer.machine().driver_data<galaxian_state>();
852   state->m_stars_blink_state++;
851   m_stars_blink_state++;
853852}
854853
855854
trunk/src/mame/video/atarisy1.c
r18137r18138
301301 *
302302 *************************************/
303303
304TIMER_DEVICE_CALLBACK( atarisy1_reset_yscroll_callback )
304TIMER_DEVICE_CALLBACK_MEMBER(atarisy1_state::atarisy1_reset_yscroll_callback)
305305{
306   atarisy1_state *state = timer.machine().driver_data<atarisy1_state>();
307   state->m_playfield_tilemap->set_scrolly(0, param);
306   m_playfield_tilemap->set_scrolly(0, param);
308307}
309308
310309
r18137r18138
382381 *
383382 *************************************/
384383
385TIMER_DEVICE_CALLBACK( atarisy1_int3off_callback )
384TIMER_DEVICE_CALLBACK_MEMBER(atarisy1_state::atarisy1_int3off_callback)
386385{
387   address_space &space = timer.machine().device("maincpu")->memory().space(AS_PROGRAM);
386   address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM);
388387
389388   /* clear the state */
390389   atarigen_scanline_int_ack_w(space, 0, 0, 0xffff);
391390}
392391
393392
394TIMER_DEVICE_CALLBACK( atarisy1_int3_callback )
393TIMER_DEVICE_CALLBACK_MEMBER(atarisy1_state::atarisy1_int3_callback)
395394{
396   atarisy1_state *state = timer.machine().driver_data<atarisy1_state>();
397395   int scanline = param;
398396
399397   /* update the state */
400   atarigen_scanline_int_gen(timer.machine().device("maincpu"));
398   atarigen_scanline_int_gen(machine().device("maincpu"));
401399
402400   /* set a timer to turn it off */
403   state->m_int3off_timer->adjust(timer.machine().primary_screen->scan_period());
401   m_int3off_timer->adjust(machine().primary_screen->scan_period());
404402
405403   /* determine the time of the next one */
406   state->m_next_timer_scanline = -1;
407   update_timers(timer.machine(), scanline);
404   m_next_timer_scanline = -1;
405   update_timers(machine(), scanline);
408406}
409407
410408
trunk/src/mame/video/spdodgeb.c
r18137r18138
8282***************************************************************************/
8383
8484
85TIMER_DEVICE_CALLBACK( spdodgeb_interrupt )
85TIMER_DEVICE_CALLBACK_MEMBER(spdodgeb_state::spdodgeb_interrupt)
8686{
87   spdodgeb_state *state = timer.machine().driver_data<spdodgeb_state>();
8887   int scanline = param;
8988
9089   if (scanline == 256)
9190   {
92      state->m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
93      timer.machine().primary_screen->update_partial(256);
91      m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE);
92      machine().primary_screen->update_partial(256);
9493   }
9594   else if ((scanline % 8) == 0)
9695   {
97      state->m_maincpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE);
98      timer.machine().primary_screen->update_partial(scanline+16); /* TODO: pretty off ... */
96      m_maincpu->set_input_line(M6502_IRQ_LINE, HOLD_LINE);
97      machine().primary_screen->update_partial(scanline+16); /* TODO: pretty off ... */
9998   }
10099}
101100
trunk/src/mame/video/battlera.c
r18137r18138
361361
362362/******************************************************************************/
363363
364TIMER_DEVICE_CALLBACK( battlera_irq )
364TIMER_DEVICE_CALLBACK_MEMBER(battlera_state::battlera_irq)
365365{
366   battlera_state *state = timer.machine().driver_data<battlera_state>();
367   state->m_current_scanline = param; /* 8 lines clipped at top */
366   m_current_scanline = param; /* 8 lines clipped at top */
368367
369368   /* If raster interrupt occurs, refresh screen _up_ to this point */
370   if (state->m_rcr_enable && (state->m_current_scanline+56)==state->m_HuC6270_registers[6]) {
371      timer.machine().primary_screen->update_partial(state->m_current_scanline);
372      state->m_maincpu->set_input_line(0, HOLD_LINE); /* RCR interrupt */
369   if (m_rcr_enable && (m_current_scanline+56)==m_HuC6270_registers[6]) {
370      machine().primary_screen->update_partial(m_current_scanline);
371      m_maincpu->set_input_line(0, HOLD_LINE); /* RCR interrupt */
373372   }
374373
375374   /* Start of vblank */
376   else if (state->m_current_scanline==240) {
377      state->m_bldwolf_vblank=1;
378      timer.machine().primary_screen->update_partial(240);
379      if (state->m_irq_enable)
380         state->m_maincpu->set_input_line(0, HOLD_LINE); /* VBL */
375   else if (m_current_scanline==240) {
376      m_bldwolf_vblank=1;
377      machine().primary_screen->update_partial(240);
378      if (m_irq_enable)
379         m_maincpu->set_input_line(0, HOLD_LINE); /* VBL */
381380   }
382381
383382   /* End of vblank */
384   if (state->m_current_scanline==254) {
385      state->m_bldwolf_vblank=0;
383   if (m_current_scanline==254) {
384      m_bldwolf_vblank=0;
386385   }
387386}
trunk/src/mame/video/beezer.c
r18137r18138
44#include "includes/beezer.h"
55
66
7TIMER_DEVICE_CALLBACK( beezer_interrupt )
7TIMER_DEVICE_CALLBACK_MEMBER(beezer_state::beezer_interrupt)
88{
99   int scanline = param;
10//  beezer_state *state = timer.machine().driver_data<beezer_state>();
11   via6522_device *via_0 = timer.machine().device<via6522_device>("via6522_0");
10   via6522_device *via_0 = machine().device<via6522_device>("via6522_0");
1211
1312   via_0->write_ca2((scanline & 0x20) ? 1 : 0);
1413   #if 0
1514   if (scanline == 240) // actually unused by the game! (points to a tight loop)
16      state->m_maincpu->set_input_line(M6809_FIRQ_LINE, ASSERT_LINE);
15      m_maincpu->set_input_line(M6809_FIRQ_LINE, ASSERT_LINE);
1716   else
18      state->m_maincpu->set_input_line(M6809_FIRQ_LINE, CLEAR_LINE);
17      m_maincpu->set_input_line(M6809_FIRQ_LINE, CLEAR_LINE);
1918   #endif
2019}
2120
trunk/src/mame/video/itech8.c
r18137r18138
568568}
569569
570570
571TIMER_DEVICE_CALLBACK( grmatch_palette_update )
571TIMER_DEVICE_CALLBACK_MEMBER(itech8_state::grmatch_palette_update)
572572{
573   itech8_state *state = timer.machine().driver_data<itech8_state>();
574   struct tms34061_display &tms_state = state->m_tms_state;
573   struct tms34061_display &tms_state = m_tms_state;
575574   /* if the high bit is set, we are supposed to latch the palette values */
576   if (state->m_grmatch_palcontrol & 0x80)
575   if (m_grmatch_palcontrol & 0x80)
577576   {
578577      /* the TMS34070s latch at the start of the frame, based on the first few bytes */
579      UINT32 page_offset = (tms_state.dispstart & 0x0ffff) | state->m_grmatch_xscroll;
578      UINT32 page_offset = (tms_state.dispstart & 0x0ffff) | m_grmatch_xscroll;
580579      int page, x;
581580
582581      /* iterate over both pages */
r18137r18138
587586         {
588587            UINT8 data0 = base[x * 2 + 0];
589588            UINT8 data1 = base[x * 2 + 1];
590            state->m_grmatch_palette[page][x] = MAKE_RGB(pal4bit(data0 >> 0), pal4bit(data1 >> 4), pal4bit(data1 >> 0));
589            m_grmatch_palette[page][x] = MAKE_RGB(pal4bit(data0 >> 0), pal4bit(data1 >> 4), pal4bit(data1 >> 0));
591590         }
592591      }
593592   }

Previous 199869 Revisions Next


© 1997-2024 The MAME Team